[ Index ]
 

Code source de vtiger CRM 5.0.2

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/modules/Products/ -> InventoryTaxAjax.php (source)

   1  <?php
   2  /*********************************************************************************
   3  ** The contents of this file are subject to the vtiger CRM Public License Version 1.0
   4   * ("License"); You may not use this file except in compliance with the License
   5   * The Original Code is:  vtiger CRM Open Source
   6   * The Initial Developer of the Original Code is vtiger.
   7   * Portions created by vtiger are Copyright (C) vtiger.
   8   * All Rights Reserved.
   9   *
  10   ********************************************************************************/
  11  
  12  global $theme;
  13  $theme_path="themes/".$theme."/";
  14  $image_path=$theme_path."images/";
  15  
  16  $productid = $_REQUEST['productid'];
  17  $rowid = $_REQUEST['curr_row'];
  18  $product_total = $_REQUEST['productTotal'];
  19  
  20  $tax_details = getTaxDetailsForProduct($productid,'all');//we should pass available instead of all if we want to display only the available taxes.
  21  $associated_tax_count = count($tax_details);
  22  
  23  
  24  $tax_div = '
  25          <table width="100%" border="0" cellpadding="5" cellspacing="0" class="small" id="tax_table'.$rowid.'">
  26             <tr>
  27              <td id="tax_div_title'.$rowid.'" nowrap align="left" ><b>Set Tax for : '.$product_total.'</b></td>
  28              <td>&nbsp;</td>
  29              <td align="right"><img src="'.$image_path.'close.gif" border="0" onClick="fnHidePopDiv(\'tax_div'.$rowid.'\')" style="cursor:pointer;"></td>
  30             </tr>
  31         ';
  32  
  33  $net_tax_total = 0.00;
  34  for($i=0,$j=$i+1;$i<count($tax_details);$i++,$j++)
  35  {
  36      $tax_name = $tax_details[$i]['taxname'];
  37      $tax_label = $tax_details[$i]['taxlabel'];
  38      $tax_percentage = $tax_details[$i]['percentage'];
  39      $tax_name_percentage = $tax_name."_percentage".$rowid;
  40      $tax_id_name = "hidden_tax".$j."_percentage".$rowid;//used to store the tax name, used in function callTaxCalc
  41      $tax_name_total = "popup_tax_row".$rowid;//$tax_name."_total".$rowid;
  42      $tax_total = $product_total*$tax_percentage/100.00;
  43  
  44      $net_tax_total += $tax_total;
  45      $tax_div .= '
  46             <tr>
  47              <td align="left" class="lineOnTop">
  48                  <input type="text" class="small" size="5" name="'.$tax_name_percentage.'" id="'.$tax_name_percentage.'" value="'.$tax_percentage.'" onBlur="calcCurrentTax(\''.$tax_name_percentage.'\','.$rowid.','.$i.')">&nbsp;%
  49                  <input type="hidden" id="'.$tax_id_name.'" value="'.$tax_name_percentage.'">
  50              </td>
  51              <td align="center" class="lineOnTop">'.$tax_label.'</td>
  52              <td align="right" class="lineOnTop">
  53                  <input type="text" class="small" size="6" name="'.$tax_name_total.'" id="'.$tax_name_total.'" style="cursor:pointer;" value="'.$tax_total.'" readonly>
  54              </td>
  55             </tr>
  56          ';
  57  }
  58  
  59  $tax_div .= '</table>';
  60  
  61  if($associated_tax_count == 0)
  62  {
  63      $tax_div .= '<div align="left" class="lineOnTop" width="100%">No taxes associated with this product.</div>';
  64  }
  65  
  66  $tax_div .= '<input type="hidden" id="hdnTaxTotal'.$rowid.'" name="hdnTaxTotal'.$rowid.'" value="'.$net_tax_total.'">';
  67  
  68  echo $tax_div;
  69  
  70  
  71  ?>


Généré le : Sun Feb 25 10:22:19 2007 par Balluche grâce à PHPXref 0.7