capital po changes

This commit is contained in:
venbatechnologies@gmail.com 2017-07-22 11:28:57 +05:30
parent b0a30fbf5e
commit 6d8a9c1115
3 changed files with 1243 additions and 992 deletions

View File

@ -1739,28 +1739,48 @@ $createddt='';
} }
} }
/* Add capital Po*/ /* Add capital Po*/
function addNewCapitalPurchaseOrder() function addNewCapitalPurchaseOrder()
{ {
//echo "sxscd";
//die();
$POdt =$this->input->post('PODate');
$POdt =$this->input->post('PODate'); $PODate = $this->getDateformat($POdt);
$PODate = $this->getDateformat($POdt);
$SupplierID = $this->input->post('drpSupplier'); $SupplierID = $this->input->post('drpSupplier');
$DeliveryAddr = $this->input->post('DeliveryAddr'); $DeliveryAddr = $this->input->post('DeliveryAddr');
$dt = $this->input->post('Deliverydt'); $dt = $this->input->post('Deliverydt');
$POType = $this->input->post('POType'); $POType = $this->input->post('POType');
$PoRange = $this->input->post('txtPoRange'); $PoRange = $this->input->post('txtPoRange');
$DeliveryOption = $this->input->post('DateRange'); //$DeliveryOption = $this->input->post('DateRange');
if($DeliveryOption==1){ // if($DeliveryOption==1){
$Deliverydt = ''; // $Deliverydt = '';
$DeliverySchedule = $this->input->post('Scheduleby'); // $DeliverySchedule = $this->input->post('Scheduleby');
} // }
else{ //else{
$Deliverydt = $this->getDateformat($dt); //$Deliverydt = $this->getDateformat($dt);
$DeliverySchedule = ''; //$DeliverySchedule = '';
} // }
$DeliveryOption = $this->input->post('DateRange');
//echo $DeliveryOption;
//die();
$DeliverySchedule='';
$Dispatch='';
if($DeliveryOption==1)
{
$Dispatch='';
$DeliverySchedule = $this->input->post('Scheduleby');
}
else
{
$Dispatch = $this->input->post('Dispatch');
$DeliverySchedule = '';
}
$capitalType = $this->input->post('capitalType'); $capitalType = $this->input->post('capitalType');
if($capitalType=='Domestic'){ if($capitalType=='Domestic'){
$CapitalRange = '1'; $CapitalRange = '1';
@ -1776,142 +1796,153 @@ $createddt='';
$PaymentMethod = $this->input->post('PaymentMethod'); $PaymentMethod = $this->input->post('PaymentMethod');
$PayableAT = $this->input->post('PayableAT'); $PayableAT = $this->input->post('PayableAT');
$Palaceoforigin=$this->input->post('PlaceOforigin');
$PaymentDate=$this->input->post('PaymentDate'); $PaymentDate=$this->input->post('PaymentDate');
$SpcialInstruction = $this->input->post('txtSpcialInstruction'); $SpcialInstruction = $this->input->post('txtSpcialInstruction');
$TotalOrder = $this->input->post('CapitalToatlOrder'); $TotalOrder = $this->input->post('CapitalToatlOrder');
$POStatus = $this->input->post('txtStatus'); $POStatus = $this->input->post('txtStatus');
$CreateBy = $this->session->userdata ( 'userId' ); $CreateBy = $this->session->userdata ( 'userId' );
$RowCount = $this->input->post('txtRowCount'); $RowCount = $this->input->post('txtRowCount');
$DeletedRow = $this->input->post('txtDeletedRow'); $DeletedRow = $this->input->post('txtDeletedRow');
$comma_separated = explode(':', $DeletedRow); $comma_separated = explode(':', $DeletedRow);
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
$createddt = $dt->format('Y-m-d H:i:s'); $createddt = $dt->format('Y-m-d H:i:s');
$currencytypeID = $this->input->post('currencytype'); $currencytypeID = $this->input->post('currencytype');
$POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ExchangeRateCalculatedon'=>$ExchangeRateOn,'ExchangeRate'=>$ExchangeRate,'PaymentTerms'=>$PaymentMethod,'PaymentDays'=>$PaymentDate,'PayableAt'=>$PayableAT,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'CapitalRange'=>$CapitalRange,'POType'=>$POType,'CurrencyType'=>$currencytypeID); $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ExchangeRateCalculatedon'=>$ExchangeRateOn,'ExchangeRate'=>$ExchangeRate,'PaymentTerms'=>$PaymentMethod,'PaymentDays'=>$PaymentDate,'PayableAt'=>$PayableAT,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'CapitalRange'=>$CapitalRange,'POType'=>$POType,'CurrencyType'=>$currencytypeID,'DeliverySchedule'=>$DeliverySchedule,'Import_PlaceofOrgin'=>$Palaceoforigin,'Import_DispatchDetails'=>$Dispatch);
// $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'Import_DispatchDetails'=>$Dispatch,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ExchangeRate'=>$Exchangerate,'ExchangeRateCalculatedon'=>$ExchangeRateCalculatedon,'CurrencyType'=>$CurrencyType,'PaymentTerms'=>$PaymentTerms,'POType'=>$POType,'Import_PlaceofOrgin'=>$Palaceoforigin);
$POMaster = $this->purchaseorder_model->addPOMaster($POList); $POMaster = $this->purchaseorder_model->addPOMaster($POList);
$PONO = ''; $PONO = '';
if(count($POMaster)>0) if(count($POMaster)>0)
{ {
$PONO = $POMaster[0]['PONO']; $PONO = $POMaster[0]['PONO'];
} }
$LineItemStatus = REQITEM_NEW; $LineItemStatus = REQITEM_NEW;
for ($i = 1; $i <= $RowCount; $i++) for ($i = 1; $i <= $RowCount; $i++)
{ {
$MaterialCode = $this->input->post('materialCode'.$i); $MaterialCode = $this->input->post('materialCode'.$i);
$Quantity = $this->input->post('quantity'.$i); $Quantity = $this->input->post('quantity'.$i);
$Reqnumber = $this->input->post('Reqnumber'.$i); $Reqnumber = $this->input->post('Reqnumber'.$i);
$itemRate = $this->input->post('itemRate'.$i); $itemRate = $this->input->post('itemRate'.$i);
//echo $itemRate;
//die();
$BasicPriceinmton = $this->input->post('rateInUs'.$i); $BasicPriceinmton = $this->input->post('rateInUs'.$i);
$Productprice = $this->input->post('basicvalInINR'.$i); $Productprice = $this->input->post('basicvalInINR'.$i);
$LandingCharge = $this->input->post('beforeLanding'.$i); $LandingCharge = $this->input->post('beforeLanding'.$i);
$AfterLandingCharge = $this->input->post('landingCharge'.$i); $AfterLandingCharge = $this->input->post('landingCharge'.$i);
$HighSeas = $this->input->post('beforeHighSeasSalesCharge'.$i); $HighSeas = $this->input->post('beforeHighSeasSalesCharge'.$i);
$AfterHighSeas = $this->input->post('HighSeasSalesCharge'.$i); $AfterHighSeas = $this->input->post('HighSeasSalesCharge'.$i);
$CustomDuty = $this->input->post('beforeCustomDuty'.$i); $CustomDuty = $this->input->post('beforeCustomDuty'.$i);
$AfterCustomDuty = $this->input->post('CustomDuty'.$i); $AfterCustomDuty = $this->input->post('CustomDuty'.$i);
$ExciseDuty = $this->input->post('beforeExciseDuty'.$i); $ExciseDuty = $this->input->post('beforeExciseDuty'.$i);
$AfterExciseDuty = $this->input->post('ExciseDuty'.$i); $AfterExciseDuty = $this->input->post('ExciseDuty'.$i);
$ExciseDutyEd = $this->input->post('beforeExciseDutyEDCess'.$i); $ExciseDutyEd = $this->input->post('beforeExciseDutyEDCess'.$i);
$AfterExciseDutyEd = $this->input->post('ExciseDutyEDCess'.$i); $AfterExciseDutyEd = $this->input->post('ExciseDutyEDCess'.$i);
$ExciseDutySH = $this->input->post('beforeExciseDutySHCess'.$i); $ExciseDutySH = $this->input->post('beforeExciseDutySHCess'.$i);
$AfterExciseDutySH = $this->input->post('ExciseDutySHCess'.$i); $AfterExciseDutySH = $this->input->post('ExciseDutySHCess'.$i);
$CustomEd= $this->input->post('beforeCustomEDCess'.$i); $CustomEd= $this->input->post('beforeCustomEDCess'.$i);
$AfterCustomEd= $this->input->post('CustomEDCess'.$i); $AfterCustomEd= $this->input->post('CustomEDCess'.$i);
$CustomSH = $this->input->post('beforeCustomSHCess'.$i); $CustomSH = $this->input->post('beforeCustomSHCess'.$i);
$AfterCustomSH = $this->input->post('CustomSHCess'.$i); $AfterCustomSH = $this->input->post('CustomSHCess'.$i);
$AddAdtional = $this->input->post('beforeAdditionalExciseDuty'.$i); $AddAdtional = $this->input->post('beforeAdditionalExciseDuty'.$i);
$AfterAddAdtional = $this->input->post('AdditionalExciseDuty'.$i); $AfterAddAdtional = $this->input->post('AdditionalExciseDuty'.$i);
$Grossdutypayable = $this->input->post('GrossDutyPayable'.$i); $Grossdutypayable = $this->input->post('GrossDutyPayable'.$i);
$AvailableModvat = $this->input->post('AvailableModvat'.$i); $AvailableModvat = $this->input->post('AvailableModvat'.$i);
$Grossexpensesduetocustomduty = $this->input->post('GrossExpensesDuetoCustom'.$i); $Grossexpensesduetocustomduty = $this->input->post('GrossExpensesDuetoCustom'.$i);
$purchaseratePerKG = $this->input->post('purchaseRate'.$i); $purchaseratePerKG = $this->input->post('purchaseRate'.$i);
$CustomDutyExpensesPerKG = $this->input->post('CustomDutyExpenses'.$i); $CustomDutyExpensesPerKG = $this->input->post('CustomDutyExpenses'.$i);
$RMCIncludingCustomersPerKG = $this->input->post('RMCIncludingCustomers'.$i); $RMCIncludingCustomersPerKG = $this->input->post('RMCIncludingCustomers'.$i);
$QuantityKG = $this->input->post('PurQuantity'.$i); $QuantityKG = $this->input->post('PurQuantity'.$i);
$Totalvalueitem=$this->input->post('PerKgExpense'.$i); $Totalvalueitem=$this->input->post('PerKgExpense'.$i);
//echo $BasicPriceinmton; //echo $BasicPriceinmton;
$CostCenter = $this->input->post('CPCostCode'.$i); $CostCenter = $this->input->post('CPCostCode'.$i);
$ServiceTax = $this->input->post('AfterServiceTax'.$i); $ServiceTax = $this->input->post('AfterServiceTax'.$i);
$EduCess = $this->input->post('AfterEduCess'.$i); $EduCess = $this->input->post('AfterEduCess'.$i);
$SecHighTax = $this->input->post('AfterSecHighTax'.$i); $SecHighTax = $this->input->post('AfterSecHighTax'.$i);
$KrishiTax = $this->input->post('AfterKrishiTax'.$i); $KrishiTax = $this->input->post('AfterKrishiTax'.$i);
$SwachhTax = $this->input->post('AfterSwachhTax'.$i); $SwachhTax = $this->input->post('AfterSwachhTax'.$i);
$TotalOrderValue = $this->input->post('TotalOrderValue'.$i);
$SkipInsert = "False";
if( count($comma_separated) > 0)
{
for($j = 1; $j < count($comma_separated); $j++)
{
$deletedRow = $comma_separated[$j] ;
if($deletedRow == $i )
{
$SkipInsert = "True";
break;
}
}
}
if($SkipInsert == "False")
{
$POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'CostCenterCode'=>$CostCenter);
$POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList);
$LineItemNo = '';
if(count($POLineItem)>0)
{
$LineItemNo = $POLineItem[0]['LineItemNo'];
}
//echo $LineItemNo;
if(trim($POType) == CAPITAL )
{
$ServiceTaxList = array('LineItemNo'=>$LineItemNo, 'ServiceTax'=>$ServiceTax,'EducessTax'=>$EduCess,'SecHigherEducessTax'=>$SecHighTax,'KrishiKalyantax'=>$KrishiTax,'SwachhBharattax'=>$SwachhTax,'TotalValue'=>$TotalOrderValue, 'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt);
$ServiceTax = $this->purchaseorder_model->addServiceTax($ServiceTaxList);
}
if($CapitalRange=='0')
{
//echo "dsc";
//die();
$ImportTaxList = array('LineItemNo'=>$LineItemNo,'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,'TotalValue'=>$Totalvalueitem);
//print_r( $ImportTaxList);
//die();
$TotalOrderValue = $this->input->post('TotalOrderValue'.$i); $ImportList = $this->purchaseorder_model->addImportTax($ImportTaxList);
$SkipInsert = "False";
if( count($comma_separated) > 0)
{
for($j = 1; $j < count($comma_separated); $j++)
{
$deletedRow = $comma_separated[$j] ;
if($deletedRow == $i )
{
$SkipInsert = "True";
break;
}
}
}
if($SkipInsert == "False")
{
$POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'CostCenterCode'=>$CostCenter);
$POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList);
$LineItemNo = '';
if(count($POLineItem)>0)
{
$LineItemNo = $POLineItem[0]['LineItemNo'];
}
//echo $LineItemNo;
if(trim($POType) == CAPITAL )
{
$ServiceTaxList = array('LineItemNo'=>$LineItemNo, 'ServiceTax'=>$ServiceTax,'EducessTax'=>$EduCess,'SecHigherEducessTax'=>$SecHighTax,'KrishiKalyantax'=>$KrishiTax,'SwachhBharattax'=>$SwachhTax,'TotalValue'=>$TotalOrderValue, 'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt);
$ServiceTax = $this->purchaseorder_model->addServiceTax($ServiceTaxList);
if($CapitalRange=='0'){
$ImportTaxList = array('LineItemNo'=>$LineItemNo,'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,'TotalValue'=>$Totalvalueitem);
$ImportList = $this->purchaseorder_model->addImportTax($ImportTaxList);
} }
} //}
} }
} }
echo 'Purchase Order Created Successfully! PO Number Is: '.$PONO ; echo 'Purchase Order Created Successfully! PO Number Is: '.$PONO ;
} }
@ -1919,26 +1950,49 @@ $createddt='';
function EditCapitalPurchaseOrder() function EditCapitalPurchaseOrder()
{ {
echo "scsdc";
die();
$PONO =$this->input->post('txtPONO');
$POdt =$this->input->post('PODate');
$PODate = $this->getDateformat($POdt);
$SupplierID = $this->input->post('drpSupplier');
$DeliveryAddr = $this->input->post('DeliveryAddr');
$dt = $this->input->post('Deliverydt');
$PONO =$this->input->post('txtPONO'); $POType = $this->input->post('POType');
$POdt =$this->input->post('PODate'); $PoRange = $this->input->post('txtPoRange');
$PODate = $this->getDateformat($POdt);
$SupplierID = $this->input->post('drpSupplier'); // $DeliveryOption = $this->input->post('DateRange');
$DeliveryAddr = $this->input->post('DeliveryAddr'); // if($DeliveryOption==1){
$dt = $this->input->post('Deliverydt'); // $Deliverydt = '';
// $DeliverySchedule = $this->input->post('Scheduleby');
// }
// else{
// $Deliverydt = $this->getDateformat($dt);
// $DeliverySchedule = '';
// }
$DeliveryOption = $this->input->post('DateRange');
//echo $DeliveryOption;
//die();
$DeliverySchedule='';
$Dispatch='';
if($DeliveryOption==1)
{
$Dispatch='';
$DeliverySchedule = $this->input->post('Scheduleby');
}
else
{
$Dispatch = $this->input->post('Dispatch');
$DeliverySchedule = '';
}
$POType = $this->input->post('POType');
$PoRange = $this->input->post('txtPoRange');
$DeliveryOption = $this->input->post('DateRange');
if($DeliveryOption==1){
$Deliverydt = '';
$DeliverySchedule = $this->input->post('Scheduleby');
}
else{
$Deliverydt = $this->getDateformat($dt);
$DeliverySchedule = '';
}
$capitalType = $this->input->post('capitalType'); $capitalType = $this->input->post('capitalType');
$currencytypeID = $this->input->post('currencytype'); $currencytypeID = $this->input->post('currencytype');
@ -1959,163 +2013,171 @@ $createddt='';
$PaymentDate=$this->input->post('PaymentDate'); $PaymentDate=$this->input->post('PaymentDate');
$SpcialInstruction = $this->input->post('txtSpcialInstruction'); $SpcialInstruction = $this->input->post('txtSpcialInstruction');
$TotalOrder = $this->input->post('CapitalToatlOrder'); $TotalOrder = $this->input->post('CapitalToatlOrder');
$POStatus = $this->input->post('txtStatus'); $POStatus = $this->input->post('txtStatus');
$Palaceoforigin=$this->input->post('PlaceOforigin');
$CreateBy = $this->session->userdata ( 'userId' ); $CreateBy = $this->session->userdata ( 'userId' );
$RowCount = $this->input->post('txtRowCount'); $RowCount = $this->input->post('txtRowCount');
$DeletedRow = $this->input->post('txtDeletedRow'); $DeletedRow = $this->input->post('txtDeletedRow');
$comma_separated = explode(':', $DeletedRow); $comma_separated = explode(':', $DeletedRow);
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
$createddt = $dt->format('Y-m-d H:i:s'); $createddt = $dt->format('Y-m-d H:i:s');
$updateddt = $dt->format('Y-m-d H:i:s'); $updateddt = $dt->format('Y-m-d H:i:s');
$POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ExchangeRate'=>$ExchangeRate,'ExchangeRateCalculatedon'=>$ExchangeRateOn,'PaymentTerms'=>$PaymentMethod,'PaymentDays'=>$PaymentDate,'PayableAt'=>$PayableAT,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'CurrencyType'=>$currencytypeID); $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ExchangeRate'=>$ExchangeRate,'ExchangeRateCalculatedon'=>$ExchangeRateOn,'PaymentTerms'=>$PaymentMethod,'PaymentDays'=>$PaymentDate,'PayableAt'=>$PayableAT,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'CurrencyType'=>$currencytypeID,'DeliverySchedule'=>$DeliverySchedule,'Import_PlaceofOrgin'=>$Palaceoforigin,'Import_DispatchDetails'=>$Dispatch);
// $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ExchangeRateCalculatedon'=>$ExchangeRateOn,'ExchangeRate'=>$ExchangeRate,'PaymentTerms'=>$PaymentMethod,'PaymentDays'=>$PaymentDate,'PayableAt'=>$PayableAT,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'CapitalRange'=>$CapitalRange,'POType'=>$POType,'CurrencyType'=>$currencytypeID,'DeliverySchedule'=>$DeliverySchedule,'Import_PlaceofOrgin'=>$Palaceoforigin,'Import_DispatchDetails'=>$Dispatch);
print_r($POList);
die();
$POMaster = $this->purchaseorder_model->updatePOMaster($PONO,$POList);
$LineItemStatus = REQITEM_NEW; $POMaster = $this->purchaseorder_model->updatePOMaster($PONO,$POList);
$LineItemStatus = REQITEM_NEW;
for ($i = 1; $i <= $RowCount; $i++) for ($i = 1; $i <= $RowCount; $i++)
{ {
$MaterialCode = $this->input->post('materialCode'.$i); $MaterialCode = $this->input->post('materialCode'.$i);
$Quantity = $this->input->post('quantity'.$i); $Quantity = $this->input->post('quantity'.$i);
$Reqnumber = $this->input->post('Reqnumber'.$i); $Reqnumber = $this->input->post('Reqnumber'.$i);
$itemRate = $this->input->post('itemRate'.$i); $itemRate = $this->input->post('itemRate'.$i);
$Exchangerate = $this->input->post('echangeRate'.$i); $Exchangerate = $this->input->post('echangeRate'.$i);
$BasicPriceinmton = $this->input->post('rateInUs'.$i); $BasicPriceinmton = $this->input->post('rateInUs'.$i);
$Productprice = $this->input->post('basicvalInINR'.$i); $Productprice = $this->input->post('basicvalInINR'.$i);
$LandingCharge = $this->input->post('beforeLanding'.$i); $LandingCharge = $this->input->post('beforeLanding'.$i);
$AfterLandingCharge = $this->input->post('landingCharge'.$i); $AfterLandingCharge = $this->input->post('landingCharge'.$i);
$HighSeas = $this->input->post('beforeHighSeasSalesCharge'.$i); $HighSeas = $this->input->post('beforeHighSeasSalesCharge'.$i);
$AfterHighSeas = $this->input->post('HighSeasSalesCharge'.$i); $AfterHighSeas = $this->input->post('HighSeasSalesCharge'.$i);
$CustomDuty = $this->input->post('beforeCustomDuty'.$i); $CustomDuty = $this->input->post('beforeCustomDuty'.$i);
$AfterCustomDuty = $this->input->post('CustomDuty'.$i); $AfterCustomDuty = $this->input->post('CustomDuty'.$i);
$ExciseDuty = $this->input->post('beforeExciseDuty'.$i); $ExciseDuty = $this->input->post('beforeExciseDuty'.$i);
$AfterExciseDuty = $this->input->post('ExciseDuty'.$i); $AfterExciseDuty = $this->input->post('ExciseDuty'.$i);
$ExciseDutyEd = $this->input->post('beforeExciseDutyEDCess'.$i); $ExciseDutyEd = $this->input->post('beforeExciseDutyEDCess'.$i);
$AfterExciseDutyEd = $this->input->post('ExciseDutyEDCess'.$i); $AfterExciseDutyEd = $this->input->post('ExciseDutyEDCess'.$i);
$ExciseDutySH = $this->input->post('beforeExciseDutySHCess'.$i); $ExciseDutySH = $this->input->post('beforeExciseDutySHCess'.$i);
$AfterExciseDutySH = $this->input->post('ExciseDutySHCess'.$i); $AfterExciseDutySH = $this->input->post('ExciseDutySHCess'.$i);
$CustomEd= $this->input->post('beforeCustomEDCess'.$i); $CustomEd= $this->input->post('beforeCustomEDCess'.$i);
$AfterCustomEd= $this->input->post('CustomEDCess'.$i); $AfterCustomEd= $this->input->post('CustomEDCess'.$i);
$CustomSH = $this->input->post('beforeCustomSHCess'.$i); $CustomSH = $this->input->post('beforeCustomSHCess'.$i);
$AfterCustomSH = $this->input->post('CustomSHCess'.$i); $AfterCustomSH = $this->input->post('CustomSHCess'.$i);
$AddAdtional = $this->input->post('beforeAdditionalExciseDuty'.$i); $AddAdtional = $this->input->post('beforeAdditionalExciseDuty'.$i);
$AfterAddAdtional = $this->input->post('AdditionalExciseDuty'.$i); $AfterAddAdtional = $this->input->post('AdditionalExciseDuty'.$i);
$Grossdutypayable = $this->input->post('GrossDutyPayable'.$i); $Grossdutypayable = $this->input->post('GrossDutyPayable'.$i);
$AvailableModvat = $this->input->post('AvailableModvat'.$i); $AvailableModvat = $this->input->post('AvailableModvat'.$i);
$Grossexpensesduetocustomduty = $this->input->post('GrossExpensesDuetoCustom'.$i); $Grossexpensesduetocustomduty = $this->input->post('GrossExpensesDuetoCustom'.$i);
$purchaseratePerKG = $this->input->post('purchaseRate'.$i); $purchaseratePerKG = $this->input->post('purchaseRate'.$i);
$CustomDutyExpensesPerKG = $this->input->post('CustomDutyExpenses'.$i); $CustomDutyExpensesPerKG = $this->input->post('CustomDutyExpenses'.$i);
$RMCIncludingCustomersPerKG = $this->input->post('RMCIncludingCustomers'.$i); $RMCIncludingCustomersPerKG = $this->input->post('RMCIncludingCustomers'.$i);
$QuantityKG = $this->input->post('PurQuantity'.$i); $QuantityKG = $this->input->post('PurQuantity'.$i);
$Totalvalueitem=$this->input->post('PerKgExpense'.$i); $Totalvalueitem=$this->input->post('PerKgExpense'.$i);
//echo $BasicPriceinmton; //echo $BasicPriceinmton;
$CostCenter = $this->input->post('CPCostCode'.$i); $CostCenter = $this->input->post('CPCostCode'.$i);
$ServiceTax = $this->input->post('AfterServiceTax'.$i); $ServiceTax = $this->input->post('AfterServiceTax'.$i);
$EduCess = $this->input->post('AfterEduCess'.$i); $EduCess = $this->input->post('AfterEduCess'.$i);
$SecHighTax = $this->input->post('AfterSecHighTax'.$i); $SecHighTax = $this->input->post('AfterSecHighTax'.$i);
$KrishiTax = $this->input->post('AfterKrishiTax'.$i); $KrishiTax = $this->input->post('AfterKrishiTax'.$i);
$SwachhTax = $this->input->post('AfterSwachhTax'.$i); $SwachhTax = $this->input->post('AfterSwachhTax'.$i);
$TotalOrderValue = $this->input->post('TotalOrderValue'.$i);
$POLineItemNo = $this->input->post('LineItemNo'.$i);
$SkipInsert = "False";
if( count($comma_separated) > 0)
{
for($j = 1; $j < count($comma_separated); $j++)
{
$deletedRow = $comma_separated[$j] ;
if($deletedRow == $i)
{
$SkipInsert = "True";
break;
}
}
}
if($SkipInsert == "False")
{
if(strlen($POLineItemNo) == 0)
{
$POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'CostCenterCode'=>$CostCenter);
$POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList);
$LineItemNo = '';
if(count($POLineItem)>0)
{
$LineItemNo = $POLineItem[0]['LineItemNo'];
}
//echo $LineItemNo;
if(trim($POType) == CAPITAL )
{
$ServiceTaxList = array('LineItemNo'=>$LineItemNo, 'ServiceTax'=>$ServiceTax,'EducessTax'=>$EduCess,'SecHigherEducessTax'=>$SecHighTax,'KrishiKalyantax'=>$KrishiTax,'SwachhBharattax'=>$SwachhTax,'TotalValue'=>$TotalOrderValue, 'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt);
$ServiceTax = $this->purchaseorder_model->addServiceTax($ServiceTaxList);
$ImportTaxList = array('LineItemNo'=>$LineItemNo, '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,'TotalValue'=>$Totalvalueitem);
//print_r($ImportTaxList);
//die();
$TotalOrderValue = $this->input->post('TotalOrderValue'.$i); $ImportList = $this->purchaseorder_model->addImportTax($ImportTaxList);
$POLineItemNo = $this->input->post('LineItemNo'.$i);
$SkipInsert = "False"; }
if( count($comma_separated) > 0)
{
for($j = 1; $j < count($comma_separated); $j++)
{
$deletedRow = $comma_separated[$j] ;
if($deletedRow == $i) }
{ else
$SkipInsert = "True"; {
break; $LineItemNo = $POLineItemNo;
}
}
}
if($SkipInsert == "False")
{
if(strlen($POLineItemNo) == 0)
{
$POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'CostCenterCode'=>$CostCenter);
$POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList);
$LineItemNo = '';
if(count($POLineItem)>0)
{
$LineItemNo = $POLineItem[0]['LineItemNo'];
}
//echo $LineItemNo;
if(trim($POType) == CAPITAL )
{
$ServiceTaxList = array('LineItemNo'=>$LineItemNo, 'ServiceTax'=>$ServiceTax,'EducessTax'=>$EduCess,'SecHigherEducessTax'=>$SecHighTax,'KrishiKalyantax'=>$KrishiTax,'SwachhBharattax'=>$SwachhTax,'TotalValue'=>$TotalOrderValue, 'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt);
$ServiceTax = $this->purchaseorder_model->addServiceTax($ServiceTaxList);
$ImportTaxList = array('LineItemNo'=>$LineItemNo, '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,'TotalValue'=>$Totalvalueitem);
//print_r($ImportTaxList);
//die();
$ImportList = $this->purchaseorder_model->addImportTax($ImportTaxList);
}
}
else
{
$LineItemNo = $POLineItemNo;
$POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'CostCenterCode'=>$CostCenter); $POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'CostCenterCode'=>$CostCenter);
$POLineItem = $this->purchaseorder_model->updatePOLineItem($PONO,$LineItemNo,$POLineItemList); $POLineItem = $this->purchaseorder_model->updatePOLineItem($PONO,$LineItemNo,$POLineItemList);
$ServiceTaxList = array('ServiceTax'=>$ServiceTax,'EducessTax'=>$EduCess,'SecHigherEducessTax'=>$SecHighTax,'KrishiKalyantax'=>$KrishiTax,'SwachhBharattax'=>$SwachhTax,'TotalValue'=>$TotalOrderValue, 'UpdateBY'=>$updatedBy,'UpdatedOn'=>$updateddt); $ServiceTaxList = array('ServiceTax'=>$ServiceTax,'EducessTax'=>$EduCess,'SecHigherEducessTax'=>$SecHighTax,'KrishiKalyantax'=>$KrishiTax,'SwachhBharattax'=>$SwachhTax,'TotalValue'=>$TotalOrderValue, 'UpdateBY'=>$updatedBy,'UpdatedOn'=>$updateddt);
$ServiceTax = $this->purchaseorder_model->updateServiceTax($LineItemNo,$ServiceTaxList); $ServiceTax = $this->purchaseorder_model->updateServiceTax($LineItemNo,$ServiceTaxList);
$ImportTaxList = array('LineItemNo'=>$LineItemNo,'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,'TotalValue'=>$Totalvalueitem);
$ImportList= $this->purchaseorder_model->updateImportTax($LineItemNo,$ImportTaxList);
} $ImportTaxList = array('LineItemNo'=>$LineItemNo,'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,'TotalValue'=>$Totalvalueitem);
}
} $ImportList= $this->purchaseorder_model->updateImportTax($LineItemNo,$ImportTaxList);
echo 'Purchase Order Updated Successfully! PO Number Is: '.$PONO ; }
}
}
echo 'Purchase Order Updated Successfully! PO Number Is: '.$PONO ;
} }
/* capital po print/pdf*/ /* capital po print/pdf*/
public function CapitalPoPrint($PONO) public function CapitalPoPrint($PONO)
{ {

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff