Skip to content
Snippets Groups Projects
Commit 7baadd75 authored by madhu sr's avatar madhu sr
Browse files

#Fixes::158205948::madhusr::Taxes on charges were not exporting to the pdf in inventory

parent 60a50b22
No related branches found
No related tags found
1 merge request!1074#Fixes::158205948::madhusr::Taxes on charges were not exporting to the pdf in inventory
......@@ -539,7 +539,7 @@ function getAssociatedProducts($module, $focus, $seid = '', $refModuleName = fal
$shtax_percent = 0;
//if condition is added to call this function when we create PO/SO/Quotes/Invoice from Product module
if (in_array($module, $inventoryModules)) {
$shtax_percent = getInventorySHTaxPercent($focus->id,$shtax_name,$shtax_count);
$shtax_percent = getInventorySHTaxPercent($focus->id,$shtax_name);
}
$shtaxamount = $shCharge*$shtax_percent/100;
$shtaxtotal = $shtaxtotal + $shtaxamount;
......
......@@ -969,7 +969,7 @@ function getInventoryProductTaxValue($id, $productId, $taxName, $lineItemId = 0)
* @param string $taxname - shipping and handling taxname
* @return float $taxpercentage - shipping and handling taxpercentage which is associated with the given entity
*/
function getInventorySHTaxPercent($id, $taxname, $taxnum=null)
function getInventorySHTaxPercent($id, $taxname)
{
global $log, $adb;
$log->debug("Entering into function getInventorySHTaxPercent($id, $taxname)");
......@@ -978,15 +978,6 @@ function getInventorySHTaxPercent($id, $taxname, $taxnum=null)
$res = $adb->pquery("select $taxname from vtiger_inventoryshippingrel where id= ?", array($id));
$taxpercentage = $adb->query_result($res,0,$taxname);
//To get the values from the vtiger_inventorychargesrel where the actual shiiping and handling tax info of particular record stored.
if($adb->num_rows($res) < 1){
$j=$taxnum+1;
$charges_result = $adb->pquery("SELECT JSON_EXTRACT(charges, '$.1.taxes.$j') as charges FROM vtiger_inventorychargesrel WHERE recordid=?", array($id));
$rowData = $adb->fetch_array($charges_result);
$charges = Zend_Json::decode(html_entity_decode($rowData['charges']));
$taxpercentage = $charges;
}
if($taxpercentage == '')
$taxpercentage = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment