$tax_details = getTaxDetailsForProduct($productid, 'available_associated'); } elseif ($_REQUEST['isDuplicate'] == 'true') { $retrieve_taxes = true; $productid = $_REQUEST['record']; $tax_details = getTaxDetailsForProduct($productid, 'available_associated'); } else { $tax_details = getAllTaxes('available'); } for ($i = 0; $i < count($tax_details); $i++) { $tax_details[$i]['check_name'] = $tax_details[$i]['taxname'] . '_check'; $tax_details[$i]['check_value'] = 0; } //For Edit and Duplicate we have to retrieve the product associated taxes and show them if ($retrieve_taxes) { for ($i = 0; $i < count($tax_details); $i++) { $tax_value = getProductTaxPercentage($tax_details[$i]['taxname'], $productid); $tax_details[$i]['percentage'] = $tax_value; $tax_details[$i]['check_value'] = 1; //if the tax is not associated with the product then we should get the default value and unchecked if ($tax_value == '') { $tax_details[$i]['check_value'] = 0; $tax_details[$i]['percentage'] = getTaxPercentage($tax_details[$i]['taxname']); } } } $smarty->assign("TAX_DETAILS", $tax_details); //Tax handling - ends $unit_price = $focus->column_fields['unit_price']; $price_details = getPriceDetailsForProduct($productid, $unit_price, 'available', $currentModule); $smarty->assign("PRICE_DETAILS", $price_details); $base_currency = 'curname' . $product_base_currency;
$associated_prod = $INVOICE_associated_prod; $smarty->assign("AVAILABLE_PRODUCTS", 'true'); $smarty->assign("MODE", $focus->mode); } elseif (isset($_REQUEST['product_id']) && $_REQUEST['product_id'] != '' || isset($_REQUEST['opportunity_id']) && $_REQUEST['opportunity_id'] != '') { $smarty->assign("ASSOCIATEDPRODUCTS", $associated_prod); $InvTotal = getInventoryTotal($_REQUEST['return_module'], $_REQUEST['return_id']); $smarty->assign("MODE", $focus->mode); //this is to display the Product Details in first row when we create new PO from Product relatedlist if ($_REQUEST['return_module'] == 'Products') { $smarty->assign("PRODUCT_ID", vtlib_purify($_REQUEST['product_id'])); $smarty->assign("PRODUCT_NAME", getProductName($_REQUEST['product_id'])); $smarty->assign("UNIT_PRICE", vtlib_purify($_REQUEST['product_id'])); $smarty->assign("QTY_IN_STOCK", getPrdQtyInStck($_REQUEST['product_id'])); $smarty->assign("VAT_TAX", getProductTaxPercentage("VAT", $_REQUEST['product_id'])); $smarty->assign("SALES_TAX", getProductTaxPercentage("Sales", $_REQUEST['product_id'])); $smarty->assign("SERVICE_TAX", getProductTaxPercentage("Service", $_REQUEST['product_id'])); } } if (isset($cust_fld)) { $smarty->assign("CUSTOMFIELD", $cust_fld); } $smarty->assign("ASSOCIATEDPRODUCTS", $associated_prod); if (isset($_REQUEST['return_module'])) { $smarty->assign("RETURN_MODULE", vtlib_purify($_REQUEST['return_module'])); } else { $smarty->assign("RETURN_MODULE", "Invoice"); } if (isset($_REQUEST['return_action'])) { $smarty->assign("RETURN_ACTION", vtlib_purify($_REQUEST['return_action'])); } else { $smarty->assign("RETURN_ACTION", "index");
$recordName = array_values(getEntityName($currentModule, $focus->id)); $recordName = $recordName[0]; $smarty->assign('NAME', $recordName); $smarty->assign('UPDATEINFO', updateInfo($focus->id)); // Module Sequence Numbering $mod_seq_field = getModuleSequenceField($currentModule); if ($mod_seq_field != null) { $mod_seq_id = $focus->column_fields[$mod_seq_field['name']]; } else { $mod_seq_id = $focus->id; } $smarty->assign('MOD_SEQ_ID', $mod_seq_id); //Added to display the Tax informations $tax_details = getTaxDetailsForProduct($focus->id); for ($i = 0; $i < count($tax_details); $i++) { $tax_details[$i]['percentage'] = getProductTaxPercentage($tax_details[$i]['taxname'], $focus->id); } $smarty->assign("TAX_DETAILS", $tax_details); $price_details = getPriceDetailsForProduct($focus->id, $focus->unit_price, 'available_associated', $currentModule); $smarty->assign('PRICE_DETAILS', $price_details); $validationArray = split_validationdataArray(getDBValidationData($focus->tab_name, $tabid)); $smarty->assign('VALIDATION_DATA_FIELDNAME', $validationArray['fieldname']); $smarty->assign('VALIDATION_DATA_FIELDDATATYPE', $validationArray['datatype']); $smarty->assign('VALIDATION_DATA_FIELDLABEL', $validationArray['fieldlabel']); $smarty->assign('EDIT_PERMISSION', isPermitted($currentModule, 'EditView', $record)); $smarty->assign('CHECK', $tool_buttons); if (PerformancePrefs::getBoolean('DETAILVIEW_RECORD_NAVIGATION', true) && isset($_SESSION[$currentModule . '_listquery'])) { $recordNavigationInfo = ListViewSession::getListViewNavigation($focus->id); VT_detailViewNavigation($smarty, $recordNavigationInfo, $focus->id); } $smarty->assign('IS_REL_LIST', isPresentRelatedLists($currentModule));
/** * Function to get Tax Class Details for this record(Product) * @return <Array> List of Taxes */ public function getTaxClassDetails() { $taxClassDetails = $this->get('taxClassDetails'); if (!empty($taxClassDetails)) { return $taxClassDetails; } $record = $this->getId(); if (empty($record)) { return $this->getAllTaxes(); } $taxClassDetails = getTaxDetailsForProduct($record, 'available_associated'); $noOfTaxes = count($taxClassDetails); for ($i = 0; $i < $noOfTaxes; $i++) { $taxValue = getProductTaxPercentage($taxClassDetails[$i]['taxname'], $this->getId()); $taxClassDetails[$i]['percentage'] = $taxValue; $taxClassDetails[$i]['check_name'] = $taxClassDetails[$i]['taxname'] . '_check'; $taxClassDetails[$i]['check_value'] = 1; //if the tax is not associated with the product then we should get the default value and unchecked if ($taxValue == '') { $taxClassDetails[$i]['check_value'] = 0; $taxClassDetails[$i]['percentage'] = getTaxPercentage($taxClassDetails[$i]['taxname']); } } $this->set('taxClassDetails', $taxClassDetails); return $taxClassDetails; }