import po
This commit is contained in:
parent
6adbd1ee89
commit
61db6d8e3a
@ -1030,15 +1030,15 @@ $DeliveryOption = $this->input->post('DateRange');
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
public function importpoprint($PONO)
|
public function importpoprint($PONO)
|
||||||
{
|
{
|
||||||
|
|
||||||
// $this->load->view('includes/pdfheader');
|
//$this->load->view('includes/pdfheader');
|
||||||
|
|
||||||
// Load the pdf page with multiviews
|
// Load the pdf page with multiviews
|
||||||
$Requester='';
|
$Requester='';
|
||||||
$Depcode='';
|
$Depcode='';
|
||||||
$Currencycode='';
|
$Currencycode='';
|
||||||
$data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformation();
|
$data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformation();
|
||||||
$data['POItem'] = $this->purchaseorder_model->GetImportPurchaseOrderDetailsForPDF($PONO);
|
$data['POItem'] = $this->purchaseorder_model->GetImportPurchaseOrderDetailsForPDF($PONO);
|
||||||
|
|
||||||
@ -1063,18 +1063,58 @@ public function importpoprint($PONO)
|
|||||||
$data['DEPCODE']=$this->purchaseorder_model->GerRequesterDep($Depcode);
|
$data['DEPCODE']=$this->purchaseorder_model->GerRequesterDep($Depcode);
|
||||||
//print_r($data['Requestername']);
|
//print_r($data['Requestername']);
|
||||||
$data['Currencytype']=$this->purchaseorder_model->GerCurrencyCodeName($Currencycode);
|
$data['Currencytype']=$this->purchaseorder_model->GerCurrencyCodeName($Currencycode);
|
||||||
$ProductPrice='';
|
$ProductPrice='';
|
||||||
foreach ($data['POItem'] as $PO )
|
foreach ($data['POItem'] as $PO )
|
||||||
{
|
{
|
||||||
$ProductPrice=$PO->ProductPrice;
|
$TotalOrderValue=$PO->TotalOrderValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$totalAmt=sprintf("%.2f", $ProductPrice);
|
//$totalAmt=sprintf("%.2f", $ProductPrice);
|
||||||
$data['TotalAmountInWords']= $this->convertNumber($totalAmt);
|
//$data['TotalAmountInWords']= $this->convertNumber($totalAmt);
|
||||||
//print_r($data['TotalAmountInWords']);
|
//print_r($data['TotalAmountInWords']);
|
||||||
|
|
||||||
$this->load->View("importpopdf", $data);
|
//$this->load->View("importpopdf", $data);
|
||||||
|
|
||||||
|
|
||||||
|
$CurrencyType='';
|
||||||
|
if(!empty($data['POItem'])){
|
||||||
|
$CurrencyType=$data['POItem'][0]->CurrencyType;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
}
|
||||||
|
|
||||||
|
if($CurrencyType==''){
|
||||||
|
$data['CurrencySymbol']=$this->purchaseorder_model->GerCurrencyCodeName('INR');
|
||||||
|
|
||||||
|
|
||||||
|
$TotalOrderValue=$data['POItem'][0]->$TotalOrderValue;
|
||||||
|
//print_r($data['POItem'][0]);
|
||||||
|
|
||||||
|
$totalAmt=sprintf("%.2f", $TotalOrderValue);
|
||||||
|
|
||||||
|
$data['TotalAmountInWords']= $this->convertNumber($totalAmt);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
else{
|
||||||
|
$data['CurrencySymbol']=$this->purchaseorder_model->GerCurrencyCodeName($CurrencyType);
|
||||||
|
//print_r($data['CurrencySymbol']);
|
||||||
|
$SymbolCurrency=$data['CurrencySymbol'][0]->FontCode2000;
|
||||||
|
$SymbolCurrencyName=$data['CurrencySymbol'][0]->Currency;
|
||||||
|
$PaiseVal=$data['CurrencySymbol'][0]->PaiseVal;
|
||||||
|
|
||||||
|
$TotalOrderValue=$data['POItem'][0]->TotalOrderValue;
|
||||||
|
|
||||||
|
$totalAmt=sprintf("%.2f", $TotalOrderValue);
|
||||||
|
|
||||||
|
$data['TotalAmountInWords']= $this->convertNumberSymbol($totalAmt,$SymbolCurrency,$SymbolCurrencyName,$PaiseVal);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$this->load->View("importpopdf", $data);
|
||||||
|
|
||||||
|
|
||||||
// Add header to pdf
|
// Add header to pdf
|
||||||
//$this->load->view('includes/pdffooter');
|
//$this->load->view('includes/pdffooter');
|
||||||
|
|
||||||
@ -1089,10 +1129,11 @@ $ProductPrice='';
|
|||||||
$this->dompdf->load_html($php);
|
$this->dompdf->load_html($php);
|
||||||
$this->dompdf->render();
|
$this->dompdf->render();
|
||||||
$data['Attachment'] = FALSE;
|
$data['Attachment'] = FALSE;
|
||||||
$this->dompdf->stream("ImportPOReport.pdf",$data,$php);
|
//$this->dompdf->stream("ImportPOReport.pdf",$data,$php);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function used to load the Delete the Requistion Items
|
* This function used to load the Delete the Requistion Items
|
||||||
*/
|
*/
|
||||||
@ -1313,26 +1354,28 @@ function addNewImportPurchaseOrder()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function EditImportPurchaseOrder()
|
function EditImportPurchaseOrder()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
//echo "dfds";
|
||||||
|
//die();
|
||||||
$PONO =$this->input->post('txtPONO');
|
$PONO =$this->input->post('txtPONO');
|
||||||
$POdt = '';
|
$POdt = '';
|
||||||
$createddt='';
|
$createddt='';
|
||||||
|
|
||||||
$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');
|
||||||
$Deliverydt = $this->getDateformat($dt);
|
$Deliverydt = $this->getDateformat($dt);
|
||||||
$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');
|
||||||
|
|
||||||
$Exchangerate=$this->input->post('ExchangeRate');
|
$Exchangerate=$this->input->post('ExchangeRate');
|
||||||
$ExchangeRateCalculatedon=$this->input->post('Exchangerateon');
|
$ExchangeRateCalculatedon=$this->input->post('Exchangerateon');
|
||||||
$CurrencyType=$this->input->post('currencytype');
|
$CurrencyType=$this->input->post('currencytype');
|
||||||
|
|
||||||
|
|
||||||
if($DeliveryOption==1){
|
if($DeliveryOption==1){
|
||||||
$Deliverydt = '';
|
$Deliverydt = '';
|
||||||
@ -1345,54 +1388,62 @@ $createddt='';
|
|||||||
$PaymentDate=$this->input->post('Payment');
|
$PaymentDate=$this->input->post('Payment');
|
||||||
if($PaymentDate==1)
|
if($PaymentDate==1)
|
||||||
{
|
{
|
||||||
$PaymentDays='After';
|
$PaymentDays='After';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$PaymentDays='Before';
|
$PaymentDays='Before';
|
||||||
}
|
}
|
||||||
|
|
||||||
$SpcialInstruction = $this->input->post('txtSpcialInstruction');
|
$SpcialInstruction = $this->input->post('txtSpcialInstruction');
|
||||||
$TotalOrder = $this->input->post('txtToatlOrder');
|
$TotalOrder = $this->input->post('txtToatlOrder');
|
||||||
$POStatus = $this->input->post('txtStatus');
|
//echo $TotalOrder;
|
||||||
|
//die();
|
||||||
|
$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'));
|
||||||
$updateddt = $dt->format('Y-m-d H:i:s');
|
$updateddt = $dt->format('Y-m-d H:i:s');
|
||||||
|
|
||||||
$PaymentTerms=$this->input->post('PaymentTerms');
|
$PaymentTerms=$this->input->post('PaymentTerms');
|
||||||
$Payableat=$this->input->post('PayableAT');
|
$Payableat=$this->input->post('PayableAT');
|
||||||
// PO Master
|
// PO Master
|
||||||
// PO Master
|
// PO Master
|
||||||
$POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ExchangeRate'=>$Exchangerate,'ExchangeRateCalculatedon'=>$ExchangeRateCalculatedon,'CurrencyType'=>$CurrencyType,'PaymentTerms'=>$PaymentTerms,'PayableAT'=>$Payableat,'PaymentDays'=>$PaymentDays);
|
$POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$updateddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ExchangeRate'=>$Exchangerate,'ExchangeRateCalculatedon'=>$ExchangeRateCalculatedon,'CurrencyType'=>$CurrencyType,'PaymentTerms'=>$PaymentTerms,'PayableAT'=>$Payableat,'PaymentDays'=>$PaymentDays);
|
||||||
//echo $PONO;
|
//echo $PONO;
|
||||||
//echo $TotalOrder;
|
//echo $TotalOrder;
|
||||||
//print_r($POList);
|
//print_r($POList);
|
||||||
//die();
|
//die();
|
||||||
|
|
||||||
$POMaster = $this->purchaseorder_model->updatePOMaster($PONO,$POList);
|
$POMaster = $this->purchaseorder_model->updatePOMaster($PONO,$POList);
|
||||||
|
//echo "sdasds";
|
||||||
$LineItemStatus = REQITEM_NEW;
|
$LineItemStatus = REQITEM_NEW;
|
||||||
|
//echo $LineItemStatus;
|
||||||
|
|
||||||
|
|
||||||
//echo $RowCount;
|
|
||||||
for ($i = 1; $i <= $RowCount; $i++)
|
//echo $RowCount;
|
||||||
{
|
for ($i = 1; $i <= $RowCount; $i++)
|
||||||
//echo "sdsfsd";
|
{
|
||||||
//die();
|
|
||||||
$MaterialCode = $this->input->post('materialCode'.$i);
|
$MaterialCode = $this->input->post('materialCode'.$i);
|
||||||
$Quantity = $this->input->post('Quantity'.$i);
|
|
||||||
|
$Quantity = $this->input->post('quantity'.$i);
|
||||||
|
//echo $Quantity;
|
||||||
$Reqnumber = $this->input->post('Reqnumber'.$i);
|
$Reqnumber = $this->input->post('Reqnumber'.$i);
|
||||||
$itemRate = $this->input->post('itemRate'.$i);
|
$itemRate = $this->input->post('itemRate'.$i);
|
||||||
|
;
|
||||||
|
//die();
|
||||||
|
|
||||||
//$Exchangerate = $this->input->post('Exchangerate'.$i);
|
//$Exchangerate = $this->input->post('Exchangerate'.$i);
|
||||||
$BasicPriceinmton = $this->input->post('BasicPriceInMTon'.$i);
|
$BasicPriceinmton = $this->input->post('BasicPriceInMTon'.$i);
|
||||||
$Productprice = $this->input->post('BasicAmt'.$i);
|
$Productprice = $this->input->post('TotalValue'.$i);
|
||||||
|
//echo $ProductPrice;
|
||||||
|
//die();
|
||||||
$LandingCharge = $this->input->post('LandingCharge'.$i);
|
$LandingCharge = $this->input->post('LandingCharge'.$i);
|
||||||
$AfterLandingCharge = $this->input->post('AfterLandingCharge'.$i);
|
$AfterLandingCharge = $this->input->post('AfterLandingCharge'.$i);
|
||||||
$HighSeas = $this->input->post('HighSeasSalesCharge'.$i);
|
$HighSeas = $this->input->post('HighSeasSalesCharge'.$i);
|
||||||
@ -1419,80 +1470,113 @@ $createddt='';
|
|||||||
$AfterAddAdtional = $this->input->post('AfterAddlExciseDuty'.$i);
|
$AfterAddAdtional = $this->input->post('AfterAddlExciseDuty'.$i);
|
||||||
|
|
||||||
$Grossdutypayable = $this->input->post('Grossdutypayable'.$i);
|
$Grossdutypayable = $this->input->post('Grossdutypayable'.$i);
|
||||||
|
//echo $Grossdutypayable;
|
||||||
|
//die();
|
||||||
|
|
||||||
$AvailableModvat = $this->input->post('AvailableModvat'.$i);
|
$AvailableModvat = $this->input->post('AvailableModvat'.$i);
|
||||||
|
|
||||||
$Grossexpensesduetocustomduty = $this->input->post('Grossexpensesduetocustomduty'.$i);
|
$Grossexpensesduetocustomduty = $this->input->post('Grossexpensesduetocustomduty'.$i);
|
||||||
|
|
||||||
|
|
||||||
$purchaseratePerKG = $this->input->post('purchaseratePerKG'.$i);
|
$purchaseratePerKG = $this->input->post('purchaseratePerKG'.$i);
|
||||||
|
|
||||||
$CustomDutyExpensesPerKG = $this->input->post('CustomDutyExpensesPerKG'.$i);
|
$CustomDutyExpensesPerKG = $this->input->post('CustomDutyExpensesPerKG'.$i);
|
||||||
|
|
||||||
$RMCIncludingCustomersPerKG = $this->input->post('RMCIncludingCustomersPerKG'.$i);
|
$RMCIncludingCustomersPerKG = $this->input->post('RMCIncludingCustomersPerKG'.$i);
|
||||||
|
|
||||||
$QuantityKG = $this->input->post('QuantityKG'.$i);
|
$QuantityKG = $this->input->post('QuantityKG'.$i);
|
||||||
|
|
||||||
$POLineItemNo = $this->input->post('LineItemNo'.$i);
|
$POLineItemNo = $this->input->post('LineItemNo'.$i);
|
||||||
|
|
||||||
$CostCenter = $this->input->post('costCode'.$i);
|
$CostCenter = $this->input->post('costCode'.$i);
|
||||||
|
|
||||||
//$ExciseDutySH = $this->input->post('ExcisedutySH'.$i);
|
//$ExciseDutySH = $this->input->post('ExcisedutySH'.$i);
|
||||||
$Totalvalueitem=$this->input->post('TotalValue'.$i);
|
$Totalvalueitem=$this->input->post('TotalValue'.$i);
|
||||||
|
// echo $Totalvalueitem;
|
||||||
|
//die();
|
||||||
$LineItemNo = '';
|
$LineItemNo = '';
|
||||||
// echo "sdsfsd";
|
//echo "sdsfsd";
|
||||||
//die();
|
//die();
|
||||||
|
|
||||||
//$currencytypeID = $this->input->post('currencytype');
|
$currencytypeID = $this->input->post('currencytype');
|
||||||
$SkipInsert = "False";
|
$SkipInsert = "False";
|
||||||
if( count($comma_separated) > 0)
|
if( count($comma_separated) > 0)
|
||||||
{
|
{
|
||||||
for($j = 1; $j < count($comma_separated); $j++)
|
for($j = 1; $j < count($comma_separated); $j++)
|
||||||
{
|
{
|
||||||
$deletedRow = $comma_separated[$j] ;
|
$deletedRow = $comma_separated[$j] ;
|
||||||
|
|
||||||
if($deletedRow == $i )
|
if($deletedRow == $i )
|
||||||
{
|
{
|
||||||
$SkipInsert = "True";
|
$SkipInsert = "True";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($SkipInsert == "False")
|
if($SkipInsert == "False")
|
||||||
{
|
{
|
||||||
if(strlen($POLineItemNo) == 0)
|
if(strlen($POLineItemNo) == 0)
|
||||||
{
|
{
|
||||||
$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);
|
||||||
if(count($POLineItem)>0)
|
$POLineItem=$this->purchaseorder_model->addPOLineItem($POLineItemList);
|
||||||
{
|
if(count($POLineItem)>0)
|
||||||
$LineItemNo = $POLineItem[0]['LineItemNo'];
|
{
|
||||||
}
|
$LineItemNo = $POLineItem[0]['LineItemNo'];
|
||||||
|
}
|
||||||
}
|
|
||||||
else
|
}
|
||||||
{
|
else
|
||||||
$LineItemNo = $POLineItemNo;
|
{
|
||||||
|
|
||||||
$POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'UpdateBY'=>$updatedBy,'UpdatedOn'=>$updateddt,'CostCenterCode'=>$CostCenter);
|
|
||||||
$POLineItem = $this->purchaseorder_model->updatePOLineItem($PONO,$POLineItemNo,$POLineItemList);
|
|
||||||
|
$LineItemNo = $POLineItemNo;
|
||||||
}
|
//echo $LineItemNo;
|
||||||
$isExists = $this->purchaseorder_model->LineItemExistsinImportTax($LineItemNo);
|
//die();
|
||||||
if(count($isExists) == 0)
|
|
||||||
{
|
$POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'UpdatedOn'=>$updateddt,'CostCenterCode'=>$CostCenter);
|
||||||
$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);
|
$POLineItem = $this->purchaseorder_model->updatePOLineItem($PONO,$POLineItemNo,$POLineItemList);
|
||||||
//print_r($ImportTaxList);
|
|
||||||
//die();
|
}
|
||||||
$ImportList = $this->purchaseorder_model->addImportTax($ImportTaxList);
|
$isExists = $this->purchaseorder_model->LineItemExistsinImportTax($LineItemNo);
|
||||||
|
//echo $isExists;
|
||||||
}
|
|
||||||
else
|
//die();
|
||||||
{
|
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,'TotalValue'=>$Totalvalueitem);
|
{
|
||||||
|
print_r(count($isExists));
|
||||||
//print_r($ImportTaxList);
|
//echo $isExists;
|
||||||
//die();
|
//die();
|
||||||
$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,'UpdatedOn'=>$updateddt,'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);
|
||||||
|
|
||||||
echo 'Purchase Order Updated Successfully! PO Number Is: '.$PONO ;
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//echo "xxcx";
|
||||||
|
//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,'UpdatedOn'=>$updateddt,'AfterExciseDutySHCess'=>$AfterExciseDutySH,'AfterAddlExciseDuty'=>$AfterAddAdtional,'Grossdutypayable'=>$Grossdutypayable,'AvailableModvat'=>$AvailableModvat,'Grossexpensesduetocustomduty'=>$Grossexpensesduetocustomduty,'purchaseratePerKG'=>$purchaseratePerKG,'CustomDutyExpensesPerKG'=>$CustomDutyExpensesPerKG,'RMCIncludingCustomersPerKG'=>$RMCIncludingCustomersPerKG,'QuantityKG'=>$QuantityKG,'AfterCustomSHCess'=>$AfterCustomSH,'AfterCustomEdCess'=>$AfterCustomEd,'TotalValue'=>$Totalvalueitem);
|
||||||
|
//echo "cxvc ";
|
||||||
|
//die();
|
||||||
|
//print_r($ImportTaxList);
|
||||||
|
//die();
|
||||||
|
$this->purchaseorder_model->updateImportTax($LineItemNo,$ImportTaxList);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
echo 'Purchase Order Updated Successfully! PO Number Is: '.$PONO ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* All Function following This command for FINANCE TEAM PO APPROVAL SCREEN*/
|
/* All Function following This command for FINANCE TEAM PO APPROVAL SCREEN*/
|
||||||
|
|||||||
40
application/views/editimportpo.php
Executable file → Normal file
40
application/views/editimportpo.php
Executable file → Normal file
@ -1760,8 +1760,7 @@ body {
|
|||||||
|
|
||||||
<input type="hidden" name="<?php echo 'BasicINRValue'.$index ?>" id="<?php echo 'BasicINRValue'.$index ?>" value="<?php echo $record->BasicINRValue; ?>" />
|
<input type="hidden" name="<?php echo 'BasicINRValue'.$index ?>" id="<?php echo 'BasicINRValue'.$index ?>" value="<?php echo $record->BasicINRValue; ?>" />
|
||||||
|
|
||||||
<input type="hidden" name="<?php echo 'TotalValue'.$index ?>" id="<?php echo 'TotalValue'.$index ?>" value="<?php echo $record->TotalValue; ?>" />
|
<input type="hidden" name="<?php echo 'TotalValue'.$index ?>" id="<?php echo 'TotalValue'.$index ?>" value="<?php echo $record->ProductPrice; ?>" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
@ -1781,20 +1780,22 @@ body {
|
|||||||
$TotalLanding = $TotalLanding + $record->AfterLandingCharge;
|
$TotalLanding = $TotalLanding + $record->AfterLandingCharge;
|
||||||
$tothighseas = $tothighseas + $record->AfterHighSeasSalesCharge;
|
$tothighseas = $tothighseas + $record->AfterHighSeasSalesCharge;
|
||||||
$totcustom = $totcustom + $record->AfterCustomDuty;
|
$totcustom = $totcustom + $record->AfterCustomDuty;
|
||||||
$totexciseduty = $totexciseduty + $record->ExciseDuty;
|
$totexciseduty = $totexciseduty + $record->AfterExciseDuty;
|
||||||
$totexcisedutyED = $totexcisedutyED + $record->ExciseDutyEdCess;
|
$totexcisedutyED = $totexcisedutyED + $record->AfterExciseDutyEdCess;
|
||||||
$totexciseSH = $totexciseSH + $record->AfterExciseDutySHCess;
|
$totexciseSH = $totexciseSH + $record->AfterExciseDutySHCess;
|
||||||
$totcustomED = $totcustomED +$record->AfterCustomEdCess;
|
$totcustomED = $totcustomED +$record->AfterCustomEdCess;
|
||||||
|
|
||||||
$totcustomSH = $totcustomSH + $record->CustomSHCess;
|
$totcustomSH = $totcustomSH + $record->AfterCustomSHCess;
|
||||||
$totaddtnlexcise= $totaddtnlexcise + $record->AddlExciseDuty;
|
$totaddtnlexcise= $totaddtnlexcise + $record->AfterAddlExciseDuty;
|
||||||
$totgrossduty = $totgrossduty + $record->Grossdutypayable;
|
$totgrossduty = $totgrossduty + $record->Grossdutypayable;
|
||||||
$totavlmodvat = $totavlmodvat +$record->AvailableModvat;
|
$totavlmodvat = $totavlmodvat +$record->AvailableModvat;
|
||||||
$totgrossduty=$totgrossduty+$record->Grossdutypayable;
|
$totgrossduty=$totgrossduty+$record->Grossdutypayable;
|
||||||
$totavlmodvat=$totavlmodvat+$record->AvailableModvat;
|
$totavlmodvat=$totavlmodvat+$record->AvailableModvat;
|
||||||
$totgrossexpense=$totgrossexpense+$record->Grossexpensesduetocustomduty;
|
$totgrossexpense=$totgrossexpense+$record->Grossexpensesduetocustomduty;
|
||||||
$ExchangeRate=$record->ExchangeRate;
|
$ExchangeRate=$record->ExchangeRate;
|
||||||
$totorder=$totorder+$record->BasicPriceInMTon;
|
//$totorder=$totorder+$record->ProductPrice;
|
||||||
|
$totorder=$totorder+$record->ProductPrice;
|
||||||
|
|
||||||
//alert($totorder);
|
//alert($totorder);
|
||||||
|
|
||||||
|
|
||||||
@ -2130,7 +2131,7 @@ $('#drpSupplier').change(function() {
|
|||||||
$("#SupAddress").val(obj.Address);
|
$("#SupAddress").val(obj.Address);
|
||||||
$("#PayableAT").val(obj.PayableAT);
|
$("#PayableAT").val(obj.PayableAT);
|
||||||
var a=obj.PaymentDays;
|
var a=obj.PaymentDays;
|
||||||
console.log(a);
|
// console.log(a);
|
||||||
if (a=="After")
|
if (a=="After")
|
||||||
{
|
{
|
||||||
//alert();
|
//alert();
|
||||||
@ -3243,7 +3244,7 @@ $('.AddImport').click(function()
|
|||||||
|
|
||||||
//index = parseInt(index)+1;
|
//index = parseInt(index)+1;
|
||||||
|
|
||||||
populateValueMainFormForImportTax();
|
// populateValueMainFormForImportTax();
|
||||||
|
|
||||||
|
|
||||||
//alert('in');
|
//alert('in');
|
||||||
@ -3313,7 +3314,8 @@ $('.AddImport').click(function()
|
|||||||
//addHidden(theForm,"AfterBasicPriceTax"+temp,AfterBasicPriceTax);
|
//addHidden(theForm,"AfterBasicPriceTax"+temp,AfterBasicPriceTax);
|
||||||
$('#txtRow').val(index);
|
$('#txtRow').val(index);
|
||||||
var a=parseFloat($('#txtRow').val());
|
var a=parseFloat($('#txtRow').val());
|
||||||
alert(a)
|
//alert(a)
|
||||||
|
populateValueMainFormForImportTax();
|
||||||
clearTaxField();
|
clearTaxField();
|
||||||
|
|
||||||
|
|
||||||
@ -3387,8 +3389,11 @@ function populateValueMainFormForImportTax()
|
|||||||
{
|
{
|
||||||
|
|
||||||
//$('#txtToatlOrder').val(parseFloat(TotalOrderValue)).toFixed(2);
|
//$('#txtToatlOrder').val(parseFloat(TotalOrderValue)).toFixed(2);
|
||||||
|
//var Aft=$('#AfterLandingCharge').val();
|
||||||
|
//console.log(Aft);
|
||||||
var AfterLandingCharge= $('#AfterLandingCharge').val() == '' ? '0.00' : $('#AfterLandingCharge').val();
|
var AfterLandingCharge= $('#AfterLandingCharge').val() == '' ? '0.00' : $('#AfterLandingCharge').val();
|
||||||
|
|
||||||
|
//console.log(AfterLandingCharge);
|
||||||
var AfterHighseas=$('#AfterHighseas').val()==''?'0.00':$('#AfterHighseas').val();
|
var AfterHighseas=$('#AfterHighseas').val()==''?'0.00':$('#AfterHighseas').val();
|
||||||
var AfterCustomduty=$('#AfterCustomduty').val()==''?'0.00':$('#AfterCustomduty').val();
|
var AfterCustomduty=$('#AfterCustomduty').val()==''?'0.00':$('#AfterCustomduty').val();
|
||||||
var AfterExcisedutyTax=$('#AfterExcisedutyTax').val()==''?'0.00':$('#AfterExcisedutyTax').val();
|
var AfterExcisedutyTax=$('#AfterExcisedutyTax').val()==''?'0.00':$('#AfterExcisedutyTax').val();
|
||||||
@ -3401,7 +3406,10 @@ var Grossdutypayable=$('#Grossdutypayable').val()==''?'0.00':$('#Grossdutypayabl
|
|||||||
var AvailableModvat=$('#AvailableModvat').val()==''?'0.00':$('#AvailableModvat').val();
|
var AvailableModvat=$('#AvailableModvat').val()==''?'0.00':$('#AvailableModvat').val();
|
||||||
var Grossexpenses=$('#Grossexpenses').val()==''?'0.00':$('#Grossexpenses').val();
|
var Grossexpenses=$('#Grossexpenses').val()==''?'0.00':$('#Grossexpenses').val();
|
||||||
var totalexp=$('#TotalExp').val()==''?'0.00':$('#TotalExp').val();
|
var totalexp=$('#TotalExp').val()==''?'0.00':$('#TotalExp').val();
|
||||||
var TotalLanding=$('#txttotallanding').val()==''?'0.00':$('#txttotallanding').val();
|
//var TotalLanding=$('#txttotallanding').val()==''?'0.00':$('#txttotallanding').val();
|
||||||
|
var TotalLanding=parseFloat($('#txttotallanding').val());
|
||||||
|
//alert(TotalLanding);
|
||||||
|
//console.log(TotalLanding);
|
||||||
var TotalHighseas=$('#txttotalhighseas').val()==''?'0.00':$('#txttotalhighseas').val();
|
var TotalHighseas=$('#txttotalhighseas').val()==''?'0.00':$('#txttotalhighseas').val();
|
||||||
var TotalCustom=$('#txttotalcustom').val()==''?'0.00':$('#txttotalcustom').val();
|
var TotalCustom=$('#txttotalcustom').val()==''?'0.00':$('#txttotalcustom').val();
|
||||||
var TotalExcise=$('#txttotalexcise').val()==''?'0.00':$('#txttotalexcise').val();
|
var TotalExcise=$('#txttotalexcise').val()==''?'0.00':$('#txttotalexcise').val();
|
||||||
@ -3414,6 +3422,8 @@ var TotalGrossDuty=$('#txttotalgrossduty').val()==''?'0.00':$('#txttotalgrossdut
|
|||||||
var TotalAvlmodvat=$('#txttotalavlmodvat').val()==''?'0.00':$('#txttotalavlmodvat').val();
|
var TotalAvlmodvat=$('#txttotalavlmodvat').val()==''?'0.00':$('#txttotalavlmodvat').val();
|
||||||
var TotalGrossExpense=$('#txttotalgrossexpense').val()==''?'0.00':$('#txttotalgrossexpense').val();
|
var TotalGrossExpense=$('#txttotalgrossexpense').val()==''?'0.00':$('#txttotalgrossexpense').val();
|
||||||
var TotalOrder=$('#txtToatlOrder').val()==''?'0.00':$('#txtToatlOrder').val();
|
var TotalOrder=$('#txtToatlOrder').val()==''?'0.00':$('#txtToatlOrder').val();
|
||||||
|
|
||||||
|
|
||||||
$('#txttotallanding').val((parseFloat(AfterLandingCharge) + parseFloat(TotalLanding)).toFixed(2) );
|
$('#txttotallanding').val((parseFloat(AfterLandingCharge) + parseFloat(TotalLanding)).toFixed(2) );
|
||||||
$('#txttotalhighseas').val((parseFloat(TotalHighseas) + parseFloat(AfterHighseas)).toFixed(2) );
|
$('#txttotalhighseas').val((parseFloat(TotalHighseas) + parseFloat(AfterHighseas)).toFixed(2) );
|
||||||
$('#txttotalcustom').val((parseFloat(TotalCustom) + parseFloat(AfterCustomduty)).toFixed(2) );
|
$('#txttotalcustom').val((parseFloat(TotalCustom) + parseFloat(AfterCustomduty)).toFixed(2) );
|
||||||
@ -3427,7 +3437,9 @@ $('#txttotalgrossduty').val((parseFloat(TotalGrossDuty) + parseFloat(Grossdutypa
|
|||||||
$('#txttotalavlmodvat').val((parseFloat(TotalAvlmodvat) + parseFloat(AvailableModvat)).toFixed(2) );
|
$('#txttotalavlmodvat').val((parseFloat(TotalAvlmodvat) + parseFloat(AvailableModvat)).toFixed(2) );
|
||||||
$('#txttotalgrossexpense').val((parseFloat(TotalGrossExpense) + parseFloat(Grossexpenses)).toFixed(2) );
|
$('#txttotalgrossexpense').val((parseFloat(TotalGrossExpense) + parseFloat(Grossexpenses)).toFixed(2) );
|
||||||
$('#txtToatlOrder').val((parseFloat(TotalOrder) + parseFloat(totalexp)).toFixed(2) );
|
$('#txtToatlOrder').val((parseFloat(TotalOrder) + parseFloat(totalexp)).toFixed(2) );
|
||||||
//alert(JSON.stringify(totalexp));
|
var r=parseFloat($('#txtToatlOrder').val());
|
||||||
|
console.log(r);
|
||||||
|
//alert(JSON.stringify(txttotallanding));
|
||||||
//alert(TotalOrder);
|
//alert(TotalOrder);
|
||||||
|
|
||||||
|
|
||||||
@ -3924,7 +3936,7 @@ if(validate())
|
|||||||
$('#txtDeletedRow').val('');
|
$('#txtDeletedRow').val('');
|
||||||
//$('#SpcialInstruction').val('');
|
//$('#SpcialInstruction').val('');
|
||||||
//$('#txtDeliveryAddress').val('');
|
//$('#txtDeliveryAddress').val('');
|
||||||
// window.location = "purchaseorderListing";
|
window.location = "purchaseorderListing";
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -210,7 +210,7 @@
|
|||||||
<td align="right"><?php echo $record->Rate ; ?></td>
|
<td align="right"><?php echo $record->Rate ; ?></td>
|
||||||
<td align="right"><?php $BasicValue=($record->Quantity*$record->Rate);
|
<td align="right"><?php $BasicValue=($record->Quantity*$record->Rate);
|
||||||
echo number_format($BasicValue,2) ; ?></td>
|
echo number_format($BasicValue,2) ; ?></td>
|
||||||
<td align="right"><?php echo $record->BasicPriceInMTon; ?></td>
|
<td align="right"><?php echo $record->ProductPrice; ?></td>
|
||||||
<!--<td align="right"><?php echo $record->AfterLandingCharge; ?></td>
|
<!--<td align="right"><?php echo $record->AfterLandingCharge; ?></td>
|
||||||
<td align="right"><?php echo $record->AfterHighSeasSalesCharge ; ?></td>
|
<td align="right"><?php echo $record->AfterHighSeasSalesCharge ; ?></td>
|
||||||
<td align="right"><?php echo $record->AfterCustomDuty ; ?></td>
|
<td align="right"><?php echo $record->AfterCustomDuty ; ?></td>
|
||||||
@ -248,7 +248,7 @@
|
|||||||
$CustomDutyExpensesPerKG = $CustomDutyExpensesPerKG+$record->CustomDutyExpensesPerKG ;
|
$CustomDutyExpensesPerKG = $CustomDutyExpensesPerKG+$record->CustomDutyExpensesPerKG ;
|
||||||
$RMCIncludingCustomersPerKG = $RMCIncludingCustomersPerKG+$record->RMCIncludingCustomersPerKG ;
|
$RMCIncludingCustomersPerKG = $RMCIncludingCustomersPerKG+$record->RMCIncludingCustomersPerKG ;
|
||||||
$AfterExciseDutySHCess= $AfterExciseDutySHCess+$record->AfterExciseDutySHCess ;
|
$AfterExciseDutySHCess= $AfterExciseDutySHCess+$record->AfterExciseDutySHCess ;
|
||||||
$TotalOrderValue = $TotalOrderValue+$record->BasicPriceInMTon;
|
$TotalOrderValue = $record->TotalOrderValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user