import po

This commit is contained in:
venbatechnologies@gmail.com 2017-06-19 11:25:35 +05:30
parent fbde8c6950
commit 2d9a57a77e
4 changed files with 30 additions and 2 deletions

View File

@ -172,7 +172,7 @@ define('GROSS_DUTY', 'landingcha+highsesssalless+customcha+excisecha+exciseedc
define('PURCHASE_RATE', 'txtbasicinrprice/txtCtablequantity'); define('PURCHASE_RATE', 'txtbasicinrprice/txtCtablequantity');
define('CUSTOMDUTY_EXP', 'txtgrossexp/txtCtablequantity'); define('CUSTOMDUTY_EXP', 'txtgrossexp/txtCtablequantity');
define('RMC_CAL', 'txtpurchaserate+txtcustomdutyexp'); define('RMC_CAL', 'txtpurchaserate+txtcustomdutyexp');
define('CALCULATE_TOTAL', 'txtrmc+basicamt'); define('CALCULATE_TOTAL', '(txtrmc*quantity)+basicprice');

View File

@ -864,6 +864,10 @@ public function importpoprint($PONO)
{ {
$this->purchaseorder_model->DeletePOServiceTax($LineItemNo); $this->purchaseorder_model->DeletePOServiceTax($LineItemNo);
} }
else If($POType == IMPORT)
{
$this->purchaseorder_model->DeletePOImportTax($LineItemNo);
}
$this->purchaseorder_model->DeletePOLineItem($LineItemNo , $ReqNo,$MaterialCode); $this->purchaseorder_model->DeletePOLineItem($LineItemNo , $ReqNo,$MaterialCode);
echo "Successfully Deleted the Line item".$LineItemNo; echo "Successfully Deleted the Line item".$LineItemNo;
@ -1140,7 +1144,7 @@ public function importpoprint($PONO)
$POLineItem = $this->purchaseorder_model->updatePOLineItem($PONO,$POLineItemNo,$POLineItemList); $POLineItem = $this->purchaseorder_model->updatePOLineItem($PONO,$POLineItemNo,$POLineItemList);
} }
$isExists = $this->purchaseorder_model->LineItemExistsinRevenueTax($LineItemNo); $isExists = $this->purchaseorder_model->LineItemExistsinImportTax($LineItemNo);
if(count($isExists) == 0) if(count($isExists) == 0)
{ {
$ImportTaxList = array('LineItemNo'=>$LineItemNo, 'ExchangeRate'=>$Exchangerate,'BasicPriceInMTon'=>$BasicPriceinmton,'ProductPrice'=>$Productprice,'LandingCharge'=>$LandingCharge,'AfterLandingCharge'=>$AfterLandingCharge,'AfterHighSeasSalesCharge'=>$AfterHighSeas,'HighSeasSalesCharge'=>$HighSeas,'CustomDuty'=>$CustomDuty,'AfterCustomDuty'=>$AfterCustomDuty,'ExciseDuty'=>$ExciseDuty,'AfterExciseDuty'=>$AfterExciseDuty,'ExciseDutyEdCess'=>$ExciseDutyEd,'AfterExciseDutyEdCess'=>$AfterExciseDutyEd,'ExciseDutySHCess'=>$ExciseDutySH,'CustomEdCess'=>$CustomEd,'CustomSHCess'=>$CustomSH,'AddlExciseDuty'=>$AddAdtional,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'AfterExciseDutySHCess'=>$AfterExciseDutySH,'AfterAddlExciseDuty'=>$AfterAddAdtional,'Grossdutypayable'=>$Grossdutypayable,'AvailableModvat'=>$AvailableModvat,'Grossexpensesduetocustomduty'=>$Grossexpensesduetocustomduty,'purchaseratePerKG'=>$purchaseratePerKG,'CustomDutyExpensesPerKG'=>$CustomDutyExpensesPerKG,'RMCIncludingCustomersPerKG'=>$RMCIncludingCustomersPerKG,'QuantityKG'=>$QuantityKG,'AfterCustomSHCess'=>$AfterCustomSH,'AfterCustomEdCess'=>$AfterCustomEd,'CurrencyType'=>$currencytypeID); $ImportTaxList = array('LineItemNo'=>$LineItemNo, 'ExchangeRate'=>$Exchangerate,'BasicPriceInMTon'=>$BasicPriceinmton,'ProductPrice'=>$Productprice,'LandingCharge'=>$LandingCharge,'AfterLandingCharge'=>$AfterLandingCharge,'AfterHighSeasSalesCharge'=>$AfterHighSeas,'HighSeasSalesCharge'=>$HighSeas,'CustomDuty'=>$CustomDuty,'AfterCustomDuty'=>$AfterCustomDuty,'ExciseDuty'=>$ExciseDuty,'AfterExciseDuty'=>$AfterExciseDuty,'ExciseDutyEdCess'=>$ExciseDutyEd,'AfterExciseDutyEdCess'=>$AfterExciseDutyEd,'ExciseDutySHCess'=>$ExciseDutySH,'CustomEdCess'=>$CustomEd,'CustomSHCess'=>$CustomSH,'AddlExciseDuty'=>$AddAdtional,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'AfterExciseDutySHCess'=>$AfterExciseDutySH,'AfterAddlExciseDuty'=>$AfterAddAdtional,'Grossdutypayable'=>$Grossdutypayable,'AvailableModvat'=>$AvailableModvat,'Grossexpensesduetocustomduty'=>$Grossexpensesduetocustomduty,'purchaseratePerKG'=>$purchaseratePerKG,'CustomDutyExpensesPerKG'=>$CustomDutyExpensesPerKG,'RMCIncludingCustomersPerKG'=>$RMCIncludingCustomersPerKG,'QuantityKG'=>$QuantityKG,'AfterCustomSHCess'=>$AfterCustomSH,'AfterCustomEdCess'=>$AfterCustomEd,'CurrencyType'=>$currencytypeID);

View File

@ -633,6 +633,19 @@ function GetCurrencytype()
return $query->result_array(); return $query->result_array();
} }
} }
function LineItemExistsinImportTax($LineItemNo)
{
$this->db->select('LineItemNo');
$this->db->from('T_Import_Tax');
$this->db->where('LineItemNo ',$LineItemNo );
$query = $this->db->get();
if ($query->num_rows > 0) {
return $query->result_array();
}
}
// To Update the PO Line Item // To Update the PO Line Item
function updatePOLineItem($PONO,$LineItemNo,$PODetails) function updatePOLineItem($PONO,$LineItemNo,$PODetails)
{ {
@ -664,6 +677,16 @@ function GetCurrencytype()
return TRUE; return TRUE;
} }
function updateImportTax($LineItemNo,$PODetails)
{
$this->db->where('LineItemNo', $LineItemNo);
$this->db->update('T_Import_Tax', $PODetails);
// print_r($this->db->last_query());
return TRUE;
}
function getLastInsertedPO() function getLastInsertedPO()
{ {

View File

@ -2532,6 +2532,7 @@ function CalculateCtable()
$('#RMCIncludingCustomers').val(Math.round(txtrmc)); $('#RMCIncludingCustomers').val(Math.round(txtrmc));
} }
quantity=parseFloat($('#Quantity').val()); quantity=parseFloat($('#Quantity').val());
basicprice=parseFloat($('#txtBasicValue').val());
total=<?php echo CALCULATE_TOTAL;?>; total=<?php echo CALCULATE_TOTAL;?>;
if(isNaN(total)) if(isNaN(total))
{ {