ALL AMENDMENT PO'S
This commit is contained in:
parent
9b293de9e0
commit
ba4e6ba405
@ -62,7 +62,7 @@ class amendmentpurchaseorder extends BaseController
|
||||
endforeach;
|
||||
$data['MaterialList'] = $result;//$this->purchaseorder_model->getRawMaterialList($ReqType,$ReqArray);
|
||||
$data['Suplist'] = $this->purchaseorder_model->getSupplierName();
|
||||
$data['Payment']=$this->purchaseorder_model->getSupplierPayment();
|
||||
$data['Payment']=$this->purchaseorder_model->getConfigValue('C009');
|
||||
//print_r($data['Payment']);
|
||||
/* Cost code from Requisition - Client Review Fix
|
||||
Start here */
|
||||
@ -105,7 +105,7 @@ class amendmentpurchaseorder extends BaseController
|
||||
$data['POSTATUS']=$this->purchaseorder_model->GetPOStatus($PONO);
|
||||
$data['POItem'] = $this->purchaseorder_model->GetRevenuePurchaseOrderDetails($PONO);
|
||||
$data['PaymentTerms']=$this->purchaseorder_model->GetPaymentTerms($PONO);
|
||||
echo "FROM CON";
|
||||
//echo "FROM CON";
|
||||
//print_r($data['Payment']);
|
||||
$this->global['pageTitle'] = 'Siddharth : Edit Revenue Purchase order form';
|
||||
$this->loadViews("editRevenueAmendPO", $this->global, $data, NULL);
|
||||
@ -124,38 +124,99 @@ class amendmentpurchaseorder extends BaseController
|
||||
}
|
||||
// print_r($data);
|
||||
$data['POItem'] = $this->purchaseorder_model->GetImportPurchaseOrderDetails($PONO);
|
||||
//print_r($data);
|
||||
//$data['ExchangeRate']=$data['POItem']->ExchangeRate;
|
||||
$data['Currency']=$this->purchaseorder_model->GetCurrencytype();
|
||||
|
||||
//print_r($data['POItem']);
|
||||
|
||||
foreach($data['POMaster'] as $CUR)
|
||||
{
|
||||
|
||||
//print_r($CUR->CurrencyType);
|
||||
$Currency=$CUR->CurrencyType;
|
||||
|
||||
}
|
||||
// $data[$Rate->ExchangeRate]=$Rate->ExchangeRate;
|
||||
$data['CurrencyDetail']=$this->purchaseorder_model->GetCurrencyDetail($Currency);
|
||||
$data['PaymentTerms']=$this->purchaseorder_model->GetPaymentTerms($PONO);
|
||||
//print_r($data['PaymentTerms']);
|
||||
$unicode ='';
|
||||
foreach ($data['CurrencyDetail'] as $Detail)
|
||||
{
|
||||
$unicode=$Detail->FontCode2000;
|
||||
}
|
||||
|
||||
|
||||
foreach ($data['CurrencyDetail'] as $Detail)
|
||||
{
|
||||
$currencycode=$Detail->Currency_Code;
|
||||
}
|
||||
|
||||
//print_r($unicode);
|
||||
$data['unicode']=$unicode;
|
||||
$data['currencycode']=$currencycode;
|
||||
$this->global['pageTitle'] = 'Siddharth : Edit Import Purchase order form';
|
||||
$this->loadViews("editImportAmendPO", $this->global, $data, NULL);
|
||||
}
|
||||
else if($ReqType == CAPITAL)
|
||||
{
|
||||
|
||||
|
||||
$AvlBudget = $this->purchaseorder_model->GetAvailableBudgetAmount($CostCode,$Year,$ReqType);
|
||||
|
||||
|
||||
if(count($AvlBudget)>0)
|
||||
{
|
||||
$data['AvlBudAmt'] = $AvlBudget[0]['BudgetAmount'] - $AvlBudget[0]['Totalvalue'];
|
||||
}
|
||||
|
||||
$data['POItem'] = $this->purchaseorder_model->getCapitalPurchaseOrderDetails($PONO);
|
||||
$data['requestedBy'] = $this->purchaseorder_model->GetRequesedByDetails($PONO);
|
||||
|
||||
|
||||
|
||||
$CapitalRange='';
|
||||
|
||||
foreach($data['POItem'] as $Rate)
|
||||
{
|
||||
|
||||
// print_r($Rate->ExchangeRate);
|
||||
|
||||
|
||||
$exRate=$Rate->ExchangeRate;
|
||||
$CapitalRange=$Rate->CapitalRange;
|
||||
|
||||
// $data[$Rate->ExchangeRate]=$Rate->ExchangeRate;
|
||||
|
||||
}
|
||||
|
||||
|
||||
foreach($data['POItem'] as $CUR)
|
||||
{
|
||||
|
||||
//print_r($CUR->CurrencyType);
|
||||
|
||||
$Currency=$CUR->CurrencyType;
|
||||
|
||||
|
||||
// $data[$Rate->ExchangeRate]=$Rate->ExchangeRate;
|
||||
|
||||
}
|
||||
//echo "$Currency";
|
||||
|
||||
if($CapitalRange=='0'){
|
||||
|
||||
$data['CurrencyDetail']=$this->purchaseorder_model->GetCurrencyDetail($Currency);
|
||||
//print_r($data);
|
||||
|
||||
|
||||
$data['ExchangeRate']=$exRate;
|
||||
|
||||
$data['Currency']=$this->purchaseorder_model->GetCurrencytype();
|
||||
//print_r($data);
|
||||
$this->global['pageTitle'] = 'Siddharth : Edit Import Purchase order form';
|
||||
$this->loadViews("editImportAmendPO", $this->global, $data, NULL);
|
||||
|
||||
}
|
||||
else if($CapitalRange=='1'){
|
||||
$data['CurrencyDetail']='';
|
||||
|
||||
$data['ExchangeRate']=$exRate;
|
||||
|
||||
$data['Currency']=$this->purchaseorder_model->GetCurrencytype();
|
||||
|
||||
}
|
||||
|
||||
|
||||
$this->global['pageTitle'] = 'Siddharth : Edit Capital Purchase order form';
|
||||
$this->loadViews("editCapitalAmendPO", $this->global, $data, NULL);
|
||||
}
|
||||
|
||||
}
|
||||
@ -165,11 +226,12 @@ class amendmentpurchaseorder extends BaseController
|
||||
{
|
||||
$NewPO='0';
|
||||
$PONO =$this->input->post('txtPONO');
|
||||
// echo "OLD PO IS" . $PONO;
|
||||
//echo "OLD PO IS" . $PONO;
|
||||
|
||||
$POdt =$this->input->post('PODate');
|
||||
$PODate = $this->getDateformat($POdt);
|
||||
$SupplierID = $this->input->post('drpSupplier');
|
||||
$POType = $this->input->post('POType');
|
||||
$DeliveryAddr = $this->input->post('txtDeliveryAddress');
|
||||
$dt = $this->input->post('Deliverydt');
|
||||
//$Deliverydt = $this->getDateformat($dt);
|
||||
@ -208,6 +270,7 @@ class amendmentpurchaseorder extends BaseController
|
||||
$updatedBy = $this->session->userdata ( 'userId' );
|
||||
|
||||
$RowCount = $this->input->post('txtRowCount');
|
||||
//echo $RowCount;
|
||||
|
||||
|
||||
//$DeletedRow = $this->input->post('txtDeletedRow');
|
||||
@ -217,8 +280,9 @@ class amendmentpurchaseorder extends BaseController
|
||||
$updateddt = $dt->format('Y-m-d H:i:s');
|
||||
// PO Master
|
||||
// PO Master
|
||||
$POMaster = array('ParentPO'=>$PONO,'SupplierID'=>$SupplierID,'PaymentTerms'=> $PaymentTerms,'PayableAT'=>$PayableAT,'PaymentDays'=>$PaymentDays,'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'Status'=>'ST015','DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$updatedBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'UpdatedOn'=>$updateddt );
|
||||
|
||||
$POMaster = array('ParentPO'=>$PONO,'SupplierID'=>$SupplierID,'POType'=>$POType,'PaymentTerms'=> $PaymentTerms,'PayableAT'=>$PayableAT,'PaymentDays'=>$PaymentDays,'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'Status'=>'ST015','DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$updatedBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'UpdatedOn'=>$updateddt );
|
||||
//print_r($POMaster);
|
||||
|
||||
//$POMaster = $this->purchaseorder_model->updatePOMaster($PONO,$POList);
|
||||
$LastPO = $this->purchaseorder_model->addPOMaster($POMaster);
|
||||
foreach($LastPO as $PO):
|
||||
@ -228,7 +292,7 @@ class amendmentpurchaseorder extends BaseController
|
||||
//echo "";
|
||||
//change old po status as Amendment
|
||||
$PODetail=array('Status'=>"ST030");//TO SET PARENT PO AS AMENDMENT STATUS
|
||||
print_r($PODetail);
|
||||
//print_r($PODetail);
|
||||
$APO=$this->purchaseorder_model->updateAmendPOMaster($PONO,$PODetail);
|
||||
echo $APO."Affected";
|
||||
//die();
|
||||
@ -240,11 +304,11 @@ class amendmentpurchaseorder extends BaseController
|
||||
|
||||
|
||||
//echo 'before for loop';
|
||||
echo $RowCount;
|
||||
//echo $RowCount;
|
||||
|
||||
for ($i = 1; $i <= $RowCount; $i++)
|
||||
{
|
||||
echo "inside loop";
|
||||
//echo "inside loop";
|
||||
$MaterialCode = $this->input->post('materialCode'.$i);
|
||||
$Quantity = $this->input->post('quantity'.$i);
|
||||
$Reqnumber = $this->input->post('Reqnumber'.$i);
|
||||
@ -300,16 +364,19 @@ class amendmentpurchaseorder extends BaseController
|
||||
// if(strlen($POLineItemNo) == 0)
|
||||
// {
|
||||
$POLineItemList = array('PONO'=>$NewPO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$updatedBy,'CreatedDate'=>$updateddt,'CostCenterCode'=>$CostCenter);
|
||||
print_r($POLineItemList);
|
||||
//print_r($POLineItemList);
|
||||
//die();
|
||||
|
||||
$POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList);
|
||||
//print_r($POLineItem);
|
||||
// if(count($POLineItem)>0)
|
||||
// {
|
||||
foreach($POLineItem as $line):
|
||||
$LineItemNo = $line->LineItemNo;
|
||||
$LineItemNo = $line['LineItemNo'];
|
||||
endforeach;
|
||||
|
||||
//echo "Lineitem no is" . $LineItemNo;
|
||||
|
||||
//print_r($LineItemNo);
|
||||
|
||||
// }
|
||||
@ -329,7 +396,7 @@ class amendmentpurchaseorder extends BaseController
|
||||
$RevenueTaxList = array('LineItemNo'=>$LineItemNo, 'DiscountType'=>$DiscountType,'DiscountValue'=>$DiscountValue,'AfterDiscount'=>$AfterDiscount,'PackagingType'=>$PackagingType,'PackagingValue'=>$PackagingValue,'PackagingCalulatedOn'=>$PackagingOption,'AfterPackagingValue'=>$AfterPackagingValue,'FreightType'=>$FreightType, 'FreightValue'=>$FreightValue,'AfterFreightValue'=>$AfterFreightValue,'ExciseDuty'=>$ExciseValue,'ExciseDutyCalulatedOn'=>$ExciseOption,'AfterExciseDuty'=>$AfterExciseValue,'Vat'=>$VatValue,'AfterVAT'=>$AfterVatValue,'VatCalulatedOn'=>$VatOption, 'CST'=>$CSTValue,'AfterCST'=>$AfterCSTValue,'CSTCalulatedOn'=>$CSTOption,'GST'=>$GSTValue,'AfterGST'=>$AfterGSTValue,'OtherTaxes'=>$OtherTaxValue,'AfterOtherTaxes'=>$AfterOtherTaxValue,'Insurance'=>$InsuranceValue,'TotalValue'=>$TotalOrderValue, 'CreatedBy'=>$updatedBy,'CreatedDate'=>$updateddt);
|
||||
|
||||
$RevenueList = $this->purchaseorder_model->addRevenueTax($RevenueTaxList);
|
||||
echo "DONE ALL";
|
||||
//echo "DONE ALL";
|
||||
|
||||
// }
|
||||
// else
|
||||
@ -468,7 +535,7 @@ function UpdateAmendServicePurchaseOrder()
|
||||
// if(count($POLineItem)>0)
|
||||
// {
|
||||
foreach($POLineItem as $line):
|
||||
$LineItemNo = $line->LineItemNo;
|
||||
$LineItemNo = $line['LineItemNo'];
|
||||
endforeach;
|
||||
// echo " Last Lineitem no is" . $LineItemNo;
|
||||
|
||||
@ -518,7 +585,433 @@ function UpdateAmendServicePurchaseOrder()
|
||||
}
|
||||
|
||||
|
||||
function EditAmendCapitalPurchaseOrder()
|
||||
{
|
||||
|
||||
// echo "WELCOME-";
|
||||
$PONO =$this->input->post('txtPONO');
|
||||
//echo $PONO;
|
||||
|
||||
|
||||
$POdt =$this->input->post('PODate');
|
||||
$PODate = $this->getDateformat($POdt);
|
||||
$SupplierID = $this->input->post('drpSupplier');
|
||||
$DeliveryAddr = $this->input->post('DeliveryAddr');
|
||||
$dt = $this->input->post('Deliverydt');
|
||||
|
||||
$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');
|
||||
$currencytypeID = $this->input->post('currencytype');
|
||||
if($capitalType=='1'){
|
||||
$CapitalRange = '1';
|
||||
$ExchangeRateOn = '';
|
||||
$ExchangeRate='';
|
||||
|
||||
}
|
||||
else{
|
||||
|
||||
$CapitalRange = '0';
|
||||
$ExchangeRateOn = $this->input->post('ExchangeRateOn');
|
||||
$ExchangeRate=$this->input->post('ExchangeRt');
|
||||
}
|
||||
$PaymentMethod = $this->input->post('PaymentMethod');
|
||||
$PayableAT = $this->input->post('PayableAT');
|
||||
|
||||
|
||||
$PaymentDate=$this->input->post('PaymentDate');
|
||||
$SpcialInstruction = $this->input->post('txtSpcialInstruction');
|
||||
$TotalOrder = $this->input->post('CapitalToatlOrder');
|
||||
$POStatus = $this->input->post('txtStatus');
|
||||
|
||||
|
||||
$CreateBy = $this->session->userdata ( 'userId' );
|
||||
$RowCount = $this->input->post('txtRowCount');
|
||||
//echo $RowCount;
|
||||
|
||||
//$DeletedRow = $this->input->post('txtDeletedRow');
|
||||
|
||||
//$comma_separated = explode(':', $DeletedRow);
|
||||
|
||||
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
|
||||
$createddt = $dt->format('Y-m-d H:i:s');
|
||||
$updateddt = $dt->format('Y-m-d H:i:s');
|
||||
|
||||
$POMaster = array('ParentPO'=>$PONO,'SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'POType'=>$POType,'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);
|
||||
//print_r($POMaster);
|
||||
|
||||
$LastPO = $this->purchaseorder_model->addPOMaster($POMaster);
|
||||
foreach($LastPO as $PO):
|
||||
$NewPO=$PO['PONO'];
|
||||
endforeach;
|
||||
//echo "NEW PO IS " . $NewPO."</br>";
|
||||
//echo "";
|
||||
|
||||
$PODetail=array('Status'=>"ST030");//TO SET PARENT PO AS AMENDMENT STATUS
|
||||
//print_r($PODetail);
|
||||
$APO=$this->purchaseorder_model->updateAmendPOMaster($PONO,$PODetail);
|
||||
// echo $APO."Affected</br>";
|
||||
|
||||
$LineItemStatus = REQITEM_NEW;
|
||||
|
||||
|
||||
|
||||
//echo "Before Loopp";
|
||||
|
||||
for ($i = 1; $i <= $RowCount; $i++)
|
||||
{
|
||||
//echo "Inside Loopp";
|
||||
$MaterialCode = $this->input->post('materialCode'.$i);
|
||||
$Quantity = $this->input->post('quantity'.$i);
|
||||
$Reqnumber = $this->input->post('Reqnumber'.$i);
|
||||
$itemRate = $this->input->post('itemRate'.$i);
|
||||
|
||||
$Exchangerate = $this->input->post('echangeRate'.$i);
|
||||
$BasicPriceinmton = $this->input->post('rateInUs'.$i);
|
||||
$Productprice = $this->input->post('basicvalInINR'.$i);
|
||||
$LandingCharge = $this->input->post('beforeLanding'.$i);
|
||||
$AfterLandingCharge = $this->input->post('landingCharge'.$i);
|
||||
$HighSeas = $this->input->post('beforeHighSeasSalesCharge'.$i);
|
||||
$AfterHighSeas = $this->input->post('HighSeasSalesCharge'.$i);
|
||||
|
||||
$CustomDuty = $this->input->post('beforeCustomDuty'.$i);
|
||||
$AfterCustomDuty = $this->input->post('CustomDuty'.$i);
|
||||
|
||||
$ExciseDuty = $this->input->post('beforeExciseDuty'.$i);
|
||||
$AfterExciseDuty = $this->input->post('ExciseDuty'.$i);
|
||||
$ExciseDutyEd = $this->input->post('beforeExciseDutyEDCess'.$i);
|
||||
$AfterExciseDutyEd = $this->input->post('ExciseDutyEDCess'.$i);
|
||||
|
||||
$ExciseDutySH = $this->input->post('beforeExciseDutySHCess'.$i);
|
||||
$AfterExciseDutySH = $this->input->post('ExciseDutySHCess'.$i);
|
||||
|
||||
$CustomEd= $this->input->post('beforeCustomEDCess'.$i);
|
||||
$AfterCustomEd= $this->input->post('CustomEDCess'.$i);
|
||||
|
||||
$CustomSH = $this->input->post('beforeCustomSHCess'.$i);
|
||||
$AfterCustomSH = $this->input->post('CustomSHCess'.$i);
|
||||
|
||||
$AddAdtional = $this->input->post('beforeAdditionalExciseDuty'.$i);
|
||||
$AfterAddAdtional = $this->input->post('AdditionalExciseDuty'.$i);
|
||||
|
||||
$Grossdutypayable = $this->input->post('GrossDutyPayable'.$i);
|
||||
$AvailableModvat = $this->input->post('AvailableModvat'.$i);
|
||||
$Grossexpensesduetocustomduty = $this->input->post('GrossExpensesDuetoCustom'.$i);
|
||||
$purchaseratePerKG = $this->input->post('purchaseRate'.$i);
|
||||
$CustomDutyExpensesPerKG = $this->input->post('CustomDutyExpenses'.$i);
|
||||
$RMCIncludingCustomersPerKG = $this->input->post('RMCIncludingCustomers'.$i);
|
||||
$QuantityKG = $this->input->post('PurQuantity'.$i);
|
||||
|
||||
|
||||
$Totalvalueitem=$this->input->post('PerKgExpense'.$i);
|
||||
|
||||
//echo $BasicPriceinmton;
|
||||
$CostCenter = $this->input->post('CPCostCode'.$i);
|
||||
$ServiceTax = $this->input->post('AfterServiceTax'.$i);
|
||||
$EduCess = $this->input->post('AfterEduCess'.$i);
|
||||
$SecHighTax = $this->input->post('AfterSecHighTax'.$i);
|
||||
$KrishiTax = $this->input->post('AfterKrishiTax'.$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'=>$NewPO, '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)
|
||||
// {
|
||||
foreach($POLineItem as $line):
|
||||
$LineItemNo = $line['LineItemNo'];
|
||||
endforeach;
|
||||
//echo $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);
|
||||
//echo "Service";
|
||||
//print_r($ServiceTax);
|
||||
$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);
|
||||
|
||||
//die();
|
||||
|
||||
|
||||
$ImportList = $this->purchaseorder_model->addImportTax($ImportTaxList);
|
||||
//echo "Import";
|
||||
|
||||
//print_r($ImportList);
|
||||
|
||||
}
|
||||
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// $LineItemNo = $POLineItemNo;
|
||||
|
||||
|
||||
|
||||
// $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);
|
||||
|
||||
// $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);
|
||||
// $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'.$PONO.'Amended Successfully! New PO Number Is: '.$NewPO ;
|
||||
}
|
||||
|
||||
function EditAmendImportPO()
|
||||
{
|
||||
|
||||
$PONO =$this->input->post('txtPONO');
|
||||
//echo $PONO;
|
||||
|
||||
$POdt = '';
|
||||
$createddt='';
|
||||
|
||||
$PODate = $this->getDateformat($POdt);
|
||||
$SupplierID = $this->input->post('drpSupplier');
|
||||
$DeliveryAddr = $this->input->post('DeliveryAddr');
|
||||
$dt = $this->input->post('Deliverydt');
|
||||
$Deliverydt = $this->getDateformat($dt);
|
||||
$POType = $this->input->post('POType');
|
||||
$PoRange = $this->input->post('txtPoRange');
|
||||
$DeliveryOption = $this->input->post('DateRange');
|
||||
|
||||
$Exchangerate=$this->input->post('ExchangeRate');
|
||||
$ExchangeRateCalculatedon=$this->input->post('Exchangerateon');
|
||||
$CurrencyType=$this->input->post('currencytype');
|
||||
|
||||
|
||||
if($DeliveryOption==1){
|
||||
$Deliverydt = '';
|
||||
$DeliverySchedule = $this->input->post('Scheduleby');
|
||||
}
|
||||
else{
|
||||
$Deliverydt = $this->getDateformat($dt);
|
||||
$DeliverySchedule = '';
|
||||
}
|
||||
$PaymentDate=$this->input->post('Payment');
|
||||
if($PaymentDate==1)
|
||||
{
|
||||
$PaymentDays='After';
|
||||
}
|
||||
else
|
||||
{
|
||||
$PaymentDays='Before';
|
||||
}
|
||||
|
||||
$SpcialInstruction = $this->input->post('txtSpcialInstruction');
|
||||
$TotalOrder = $this->input->post('txtTotalorderValue');
|
||||
//echo "Total Order:".$TotalOrder;
|
||||
$POStatus = $this->input->post('txtStatus');
|
||||
|
||||
$CreateBy = $this->session->userdata ( 'userId' );
|
||||
$RowCount = $this->input->post('txtRowCount');
|
||||
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
|
||||
$createddt = $dt->format('Y-m-d H:i:s');
|
||||
$updateddt = $dt->format('Y-m-d H:i:s');
|
||||
//echo "Row Count is:";
|
||||
//echo $RowCount;
|
||||
|
||||
//$DeletedRow = $this->input->post('txtDeletedRow');
|
||||
|
||||
//$comma_separated = explode(':', $DeletedRow);
|
||||
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
|
||||
$updateddt = $dt->format('Y-m-d H:i:s');
|
||||
|
||||
$PaymentTerms=$this->input->post('PaymentTerms');
|
||||
$Payableat=$this->input->post('PayableAT');
|
||||
// PO Master
|
||||
// PO Master
|
||||
$POMaster = array('ParentPO'=>$PONO,'SupplierID'=>$SupplierID, 'POType'=>$POType,'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);
|
||||
//echo $PONO;
|
||||
//echo $TotalOrder;
|
||||
//print_r($POMaster);
|
||||
|
||||
|
||||
$LastPO = $this->purchaseorder_model->addPOMaster($POMaster);
|
||||
foreach($LastPO as $PO):
|
||||
$NewPO=$PO['PONO'];
|
||||
endforeach;
|
||||
// echo "NEW PO IS " . $NewPO."</br>";
|
||||
//echo "";
|
||||
|
||||
$PODetail=array('Status'=>"ST030");//TO SET PARENT PO AS AMENDMENT STATUS
|
||||
// print_r($PODetail);
|
||||
$APO=$this->purchaseorder_model->updateAmendPOMaster($PONO,$PODetail);
|
||||
// echo "Affected Rows:";
|
||||
// print_r($APO);
|
||||
|
||||
$LineItemStatus = REQITEM_NEW;
|
||||
|
||||
|
||||
|
||||
//echo "Before Loop";
|
||||
for ($i = 1; $i <= $RowCount; $i++)
|
||||
{
|
||||
//echo "Inside Loop";
|
||||
$MaterialCode = $this->input->post('materialCode'.$i);
|
||||
$Quantity = $this->input->post('quantity'.$i);
|
||||
$Reqnumber = $this->input->post('Reqnumber'.$i);
|
||||
$itemRate = $this->input->post('itemRate'.$i);
|
||||
|
||||
//$Exchangerate = $this->input->post('Exchangerate'.$i);
|
||||
$BasicPriceinmton = $this->input->post('BasicPriceInMTon'.$i);
|
||||
$Productprice = $this->input->post('ProductPrice'.$i);
|
||||
$LandingCharge = $this->input->post('LandingCharge'.$i);
|
||||
$AfterLandingCharge = $this->input->post('AfterLandingCharge'.$i);
|
||||
$HighSeas = $this->input->post('HighSeasSalesCharge'.$i);
|
||||
$AfterHighSeas = $this->input->post('AfterHighSeasSalesCharge'.$i);
|
||||
|
||||
$CustomDuty = $this->input->post('CustomDuty'.$i);
|
||||
$AfterCustomDuty = $this->input->post('AfterCustomDuty'.$i);
|
||||
|
||||
$ExciseDuty = $this->input->post('ExciseDuty'.$i);
|
||||
$AfterExciseDuty = $this->input->post('AfterExciseDuty'.$i);
|
||||
$ExciseDutyEd = $this->input->post('ExciseDutyEdCess'.$i);
|
||||
$AfterExciseDutyEd = $this->input->post('AfterExciseDutyEdCess'.$i);
|
||||
|
||||
$ExciseDutySH = $this->input->post('ExciseDutySHCess'.$i);
|
||||
$AfterExciseDutySH = $this->input->post('AfterExciseDutySHCess'.$i);
|
||||
|
||||
$CustomEd= $this->input->post('CustomEdCess'.$i);
|
||||
$AfterCustomEd= $this->input->post('AfterCustomEdCess'.$i);
|
||||
|
||||
$CustomSH = $this->input->post('CustomSHCess'.$i);
|
||||
$AfterCustomSH = $this->input->post('AfterCustomSHCess'.$i);
|
||||
|
||||
$AddAdtional = $this->input->post('AddlExciseDuty'.$i);
|
||||
$AfterAddAdtional = $this->input->post('AfterAddlExciseDuty'.$i);
|
||||
|
||||
$Grossdutypayable = $this->input->post('Grossdutypayable'.$i);
|
||||
$AvailableModvat = $this->input->post('AvailableModvat'.$i);
|
||||
$Grossexpensesduetocustomduty = $this->input->post('Grossexpensesduetocustomduty'.$i);
|
||||
$purchaseratePerKG = $this->input->post('purchaseratePerKG'.$i);
|
||||
$CustomDutyExpensesPerKG = $this->input->post('CustomDutyExpensesPerKG'.$i);
|
||||
$RMCIncludingCustomersPerKG = $this->input->post('RMCIncludingCustomersPerKG'.$i);
|
||||
|
||||
$QuantityKG = $this->input->post('QuantityKG'.$i);
|
||||
|
||||
|
||||
|
||||
//$POLineItemNo = $this->input->post('LineItemNo'.$i);
|
||||
$CostCenter = $this->input->post('costCode'.$i);
|
||||
|
||||
$Totalvalueitem=$this->input->post('txtTotalorderValue');
|
||||
$LineItemNo = '';
|
||||
|
||||
//$currencytypeID = $this->input->post('currencytype');
|
||||
// $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'=>$NewPO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'CostCenterCode'=>$CostCenter);
|
||||
//print_r($POLineItemList);
|
||||
|
||||
$POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList);
|
||||
// // if(count($POLineItem)>0)
|
||||
// // {
|
||||
foreach($POLineItem as $line):
|
||||
$LineItemNo = $line['LineItemNo'];
|
||||
endforeach;
|
||||
// //}
|
||||
// echo "New Line Item is:".$LineItemNo;
|
||||
|
||||
// }
|
||||
// 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);
|
||||
|
||||
// }
|
||||
// $isExists = $this->purchaseorder_model->LineItemExistsinImportTax($LineItemNo);
|
||||
// if(count($isExists) == 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);
|
||||
//print_r($ImportTaxList);
|
||||
//die();
|
||||
$ImportList = $this->purchaseorder_model->addImportTax($ImportTaxList);
|
||||
//echo "DONE ALL";
|
||||
//}
|
||||
// else
|
||||
// {
|
||||
// $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($ImportTaxList);
|
||||
// //die();
|
||||
// $this->purchaseorder_model->updateImportTax($LineItemNo,$ImportTaxList);
|
||||
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
echo 'Purchase Order'.$PONO.'Amended Successfully! New PO Number Is: '.$NewPO ;
|
||||
}
|
||||
|
||||
|
||||
function getDateformat($Val)
|
||||
|
||||
@ -103,6 +103,7 @@ if(!empty($AvlBudAmt))
|
||||
$AvlAmount = $AvlBudAmt;
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
<style>
|
||||
.modal
|
||||
@ -150,16 +151,11 @@ window.onload = function()
|
||||
|
||||
document.getElementById('ExchangeRateOnDiv').style.display = 'none';
|
||||
document.getElementById('ExchangeRateOnDiv').style.display = 'none';
|
||||
document.getElementById('ExchangeRateDiv').style.display = 'none';
|
||||
document.getElementById('currencyTypeDiv').style.display = 'none';
|
||||
document.getElementById('ExchangeRateModalDiv').style.display = 'none';
|
||||
document.getElementById('ExchangeRateModalEditDiv').style.display = 'none';
|
||||
document.getElementById('HideImportTaxTotal').style.display = 'none';
|
||||
document.getElementById('ModalImportTaxHide').style.display = 'none';
|
||||
document.getElementById('EditModalImportTaxHide').style.display = 'none';
|
||||
|
||||
|
||||
|
||||
document.getElementById('ExchangeRateDiv').style.display = 'none';
|
||||
document.getElementById('currencyTypeDiv').style.display = 'none';
|
||||
document.getElementById('ExchangeRateModalDiv').style.display = 'none';
|
||||
document.getElementById('ExchangeRateModalEditDiv').style.display = 'none';
|
||||
|
||||
|
||||
capitalType='Domestic';
|
||||
|
||||
@ -553,15 +549,23 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
|
||||
<input type="hidden" name="<?php echo 'materialName'.$index ?>" id="<?php echo 'materialName'.$index ?>" value="<?php echo $record->MaterialName ; ?>" />
|
||||
<input type="hidden" name="<?php echo 'uom'.$index ?>" id="<?php echo 'uom'.$index ?>" value="<?php echo $record->UOM ; ?>" />
|
||||
<input type="hidden" name="<?php echo 'quantity'.$index ?>" id="<?php echo 'quantity'.$index ?>" value="<?php echo $record->Quantity ; ?>" />
|
||||
<input type="hidden" name="<?php echo 'itemRate'.$index ?>" id="<?php echo 'itemRate'.$index ?>" value="<?php echo $record->Rate ; ?>" />
|
||||
<?php if($CapitalRange=='1'){ ?>
|
||||
<input type="hidden" name="<?php echo 'rateInUs'.$index ?>" id="<?php echo 'rateInUs'.$index ?>" value="<?php echo $record->Rate ; ?>" />
|
||||
<?php } ?>
|
||||
|
||||
<?php if($CapitalRange=='0'){ ?>
|
||||
|
||||
<input type="hidden" name="<?php echo 'rateInUs'.$index ?>" id="<?php echo 'rateInUs'.$index ?>" value="<?php echo $record->BasicPriceInMTon ; ?>" />
|
||||
<input type="hidden" name="<?php echo 'itemRate'.$index ?>" id="<?php echo 'itemRate'.$index ?>" value="<?php echo $record->Rate ; ?>" />
|
||||
<input type="hidden" name="<?php echo 'basicval'.$index ?>" id="<?php echo 'basicval'.$index ?>" value="<?php echo $record->BasicValue ; ?>" />
|
||||
|
||||
<input type="hidden" name="<?php echo 'basicvalInINR'.$index ?>" id="<?php echo 'basicvalInINR'.$index ?>" value="<?php echo $record->ProductPrice ; ?>" />
|
||||
|
||||
<input type="hidden" name="<?php echo 'AfterServiceTax'.$index ?>" id="<?php echo 'AfterServiceTax'.$index ?>" value="<?php echo $record->ServiceTax ; ?>" />
|
||||
<input type="hidden" name="<?php echo 'AfterEduCess'.$index ?>" id="<?php echo 'AfterEduCess'.$index ?>" value="<?php echo $record->EducessTax ; ?>" />
|
||||
|
||||
<input type="hidden" name="<?php echo 'AfterSecHighTax'.$index ?>" id="<?php echo 'AfterSecHighTax'.$index ?>" value="<?php echo $record->SecHigherEducessTax ; ?>" />
|
||||
|
||||
<input type="hidden" name="<?php echo 'AfterKrishiTax'.$index ?>" id="<?php echo 'AfterKrishiTax'.$index ?>" value="<?php echo $record->KrishiKalyantax ; ?>" />
|
||||
<input type="hidden" name="<?php echo 'AfterSwachhTax'.$index ?>" id="<?php echo 'AfterSwachhTax'.$index ?>" value="<?php echo $record->SwachhBharattax ; ?>" />
|
||||
<input type="hidden" name="<?php echo 'ServiceTotalOrderValue'.$index ?>" id="<?php echo 'ServiceTotalOrderValue'.$index ?>" value="<?php echo $record->ServiceTaxamount ; ?>" />
|
||||
|
||||
|
||||
|
||||
<input type="hidden" name="<?php echo 'beforeLanding'.$index ?>" id="<?php echo 'beforeLanding'.$index ?>" value="<?php echo $record->LandingCharge; ?>" />
|
||||
<input type="hidden" name="<?php echo 'landingCharge'.$index ?>" id="<?php echo 'landingCharge'.$index ?>" value="<?php echo $record->AfterLandingCharge; ?>" />
|
||||
<input type="hidden" name="<?php echo 'beforeHighSeasSalesCharge'.$index ?>" id="<?php echo 'beforeHighSeasSalesCharge'.$index ?>" value="<?php echo $record->HighSeasSalesCharge ; ?>" />
|
||||
@ -602,23 +606,6 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
|
||||
<input type="hidden" name="<?php echo 'PurQuantity'.$index ?>" id="<?php echo 'PurQuantity'.$index ?>" value="<?php echo $record->QuantityKG; ?>" />
|
||||
|
||||
<input type="hidden" name="<?php echo 'PerKgExpense'.$index ?>" id="<?php echo 'PerKgExpense'.$index ?>" value="<?php echo $record->ImportTotalValue; ?>" />
|
||||
<?php } ?>
|
||||
|
||||
<input type="hidden" name="<?php echo 'basicval'.$index ?>" id="<?php echo 'basicval'.$index ?>" value="<?php echo $record->BasicValue ; ?>" />
|
||||
|
||||
|
||||
<input type="hidden" name="<?php echo 'AfterServiceTax'.$index ?>" id="<?php echo 'AfterServiceTax'.$index ?>" value="<?php echo $record->ServiceTax ; ?>" />
|
||||
<input type="hidden" name="<?php echo 'AfterEduCess'.$index ?>" id="<?php echo 'AfterEduCess'.$index ?>" value="<?php echo $record->EducessTax ; ?>" />
|
||||
|
||||
<input type="hidden" name="<?php echo 'AfterSecHighTax'.$index ?>" id="<?php echo 'AfterSecHighTax'.$index ?>" value="<?php echo $record->SecHigherEducessTax ; ?>" />
|
||||
|
||||
<input type="hidden" name="<?php echo 'AfterKrishiTax'.$index ?>" id="<?php echo 'AfterKrishiTax'.$index ?>" value="<?php echo $record->KrishiKalyantax ; ?>" />
|
||||
<input type="hidden" name="<?php echo 'AfterSwachhTax'.$index ?>" id="<?php echo 'AfterSwachhTax'.$index ?>" value="<?php echo $record->SwachhBharattax ; ?>" />
|
||||
<input type="hidden" name="<?php echo 'ServiceTotalOrderValue'.$index ?>" id="<?php echo 'ServiceTotalOrderValue'.$index ?>" value="<?php echo $record->ServiceTaxamount ; ?>" />
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -643,7 +630,7 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
|
||||
$TotalSummary = $TotalSummary+$record->ServiceTaxamount;
|
||||
$TotalBasicAmount = $TotalBasicAmount+$record->BasicValue;
|
||||
$ServiceDescription = $ServiceDescription;
|
||||
if($CapitalRange=='0'){
|
||||
|
||||
$TotalLanding = $TotalLanding + $record->AfterLandingCharge;
|
||||
$tothighseas = $tothighseas + $record->AfterHighSeasSalesCharge;
|
||||
$totcustom = $totcustom + $record->AfterCustomDuty;
|
||||
@ -660,10 +647,6 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
|
||||
|
||||
$totgrossexpense=$totgrossexpense+$record->Grossexpensesduetocustomduty;
|
||||
$ExchangeRate=$record->ExchangeRate;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// $totorder=$totorder+$record->TotalOrderValue;
|
||||
$totalCapitalOrder = $totalCapitalOrder+$record->BasicValue;
|
||||
|
||||
@ -875,7 +858,7 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12" style="padding:1%;" ></div>
|
||||
<div class="col-md-12" style="border:1px solid #000;padding:0px;" id="ModalImportTaxHide" style="display:none;">
|
||||
<div class="col-md-12" style="border:1px solid #000;padding:0px;">
|
||||
<br/>
|
||||
<div class="col-md-6" style="padding:0px;">
|
||||
<div class="col-md-12">
|
||||
@ -1413,7 +1396,7 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12" style="padding:1%;" ></div>
|
||||
<div class="col-md-12" style="border:1px solid #000;padding:0px;" id="EditModalImportTaxHide" style="display:none;">
|
||||
<div class="col-md-12" style="border:1px solid #000;padding:0px;">
|
||||
<br/>
|
||||
<div class="col-md-6" style="padding:0px;">
|
||||
<div class="col-md-12">
|
||||
@ -1822,7 +1805,7 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
|
||||
</div>
|
||||
|
||||
<div class="col-md-12" style="padding:1%;" ></div>
|
||||
<div class="col-md-12" style="border: 1px solid;padding:1% 0%;" id="HideImportTaxTotal" style="display:none;">
|
||||
<div class="col-md-12" style="border: 1px solid;padding:1% 0%;">
|
||||
|
||||
<div class="col-md-4">
|
||||
<label >Total Landing Charge :</label>
|
||||
@ -1997,12 +1980,9 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
|
||||
<input type="hidden" name="txtDeletedRow" id="txtDeletedRow" />
|
||||
|
||||
|
||||
<?php if($POStatus == PO_DRAFT) {?>
|
||||
<a class="btn btn-primary Save" ID="Save" onclick="Save(0)" > <span class="bold">Save</span></a>
|
||||
<a class="btn btn-primary Save" ID="Submit" onclick="Save(1)" > <span class="bold">Submit</span></a>
|
||||
<input type="reset" class="btn btn-primary" value="Reset">
|
||||
<?php }else {?>
|
||||
<input type="reset" class="btn btn-primary" value = "OK"> <?php } ?>
|
||||
<a class="btn btn-primary Save" ID="Save" onclick="Save(0)"> <span class="bold">Save</span></a>
|
||||
<a class="btn btn-primary Submit" ID="Submit" onclick="Save(1)"> <span class="bold">Submit</span></a>
|
||||
<input type="reset" class="btn btn-primary" value="Reset">
|
||||
|
||||
</div>
|
||||
<br/>
|
||||
@ -2906,7 +2886,7 @@ var myArray = <?php echo json_encode($res_arr_values); ?>;
|
||||
var exchangeRate = $("#ExchangeRtModal").val();
|
||||
var quantity = $("#CPQuantity").val();
|
||||
var convertRate = $("#CPRate").val();
|
||||
var itemRate = parseFloat(convertRate).toFixed(2);
|
||||
var itemRate = parseFloat(convertRate * exchangeRate).toFixed(2);
|
||||
var basicval = parseFloat($("#CPTotalAmount").val()).toFixed(2);
|
||||
var AfterServiceTax = $("#AfterServiceTax").val();
|
||||
var AfterEduCess = $("#AfterEduCess").val();
|
||||
@ -3805,6 +3785,7 @@ $('#txtStatus').val(stat);
|
||||
success:function(data) {
|
||||
if(data)
|
||||
{
|
||||
alert(data);
|
||||
$('#content').loader('hide');
|
||||
|
||||
$('#txtRowCount').val('');
|
||||
@ -3812,8 +3793,8 @@ $('#txtStatus').val(stat);
|
||||
$('#SpcialInstruction').val('');
|
||||
$('#txtDeliveryAddress').val('');
|
||||
|
||||
clearAfterAddLineItemAdd();
|
||||
window.location ="purchaseorderListing";
|
||||
// clearAfterAddLineItemAdd();
|
||||
//window.location ="purchaseorderListing";
|
||||
|
||||
}
|
||||
else
|
||||
@ -4078,7 +4059,7 @@ function clearAfterAddLineItemAdd(){
|
||||
var exchangeRate = $("#EditExchangeRtModal").val();
|
||||
var quantity = $("#EditCPQuantity").val();
|
||||
var convertRate = $("#EditCPRate").val();
|
||||
var itemRate = convertRate;
|
||||
var itemRate = convertRate * exchangeRate;
|
||||
var basicval = $("#EditCPTotalAmount").val();
|
||||
var AfterServiceTax = $("#EditAfterServiceTax").val();
|
||||
var AfterEduCess = $("#EditAfterEduCess").val();
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -58,6 +58,10 @@ foreach ($PaymentTerms as $TER)
|
||||
|
||||
if(!empty($POMaster))
|
||||
{
|
||||
// print_r($POMaster);
|
||||
// print_r($Payment);
|
||||
// echo "****";
|
||||
// print_r($PaymentTerms);
|
||||
foreach ($POMaster as $Req)
|
||||
{
|
||||
$SupId = $Req->SupplierID;
|
||||
@ -1899,7 +1903,7 @@ body {
|
||||
foreach ($payment as $rl)
|
||||
{
|
||||
?>
|
||||
<option value="<?php echo $rl->PaymentTerms ?>"><?php echo $rl->PaymentTerms ?></option>
|
||||
<option value="<?php echo $rl->ConfigValue ?>"><?php echo $rl->ConfigValue ?></option>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
@ -3378,10 +3382,10 @@ $('.AddRevenue').click(function(){
|
||||
});
|
||||
$('.EditRevenue').click(function(){
|
||||
|
||||
alert('inside Functioon');
|
||||
//alert('inside Functioon');
|
||||
if(validateEditRevenueTax() && validateEditExceedLimit())
|
||||
{
|
||||
alert('inside IF');
|
||||
// alert('inside IF');
|
||||
var CostCode = $("#EditCostCenter").val();
|
||||
var AvilBudget = $('#EditAvlBudAmt').val();
|
||||
var editMaterialCode = $("#EditMaterialCode").val();
|
||||
@ -3592,7 +3596,7 @@ function populateValueMainFormForEditRevenueTax()
|
||||
|
||||
} while (i < rows);
|
||||
|
||||
alert(totOrderSummaryAmt);
|
||||
// alert(totOrderSummaryAmt);
|
||||
$('#txtTotBasicAmount').val(parseFloat(totBasicAmt).toFixed(2) );
|
||||
$('#txtTotalDiscount').val(parseFloat(totDiscountAmt).toFixed(2) );
|
||||
$('#txtTotalPackaing').val(parseFloat(totPackagingAmt).toFixed(2) );
|
||||
@ -3698,16 +3702,16 @@ function validateEditRevenueTax()
|
||||
<script>
|
||||
function validateBudgetExceedLimit()
|
||||
{
|
||||
alert('inside validateBudgetExceedLimit function');
|
||||
//alert('inside validateBudgetExceedLimit function');
|
||||
var rows = document.getElementById('revenueTax').rows.length;
|
||||
var ReqType = '<?php echo REVENUE ?>';
|
||||
alert(rows);
|
||||
//alert(rows);
|
||||
for (i = 1; i < rows; i++) {
|
||||
var costcode = $('#costCode'+i).val();
|
||||
var basicAmountRate = parseFloat($('#basicval'+i).val());
|
||||
var totalAmount = parseFloat($('#TotalOrderValue'+i).val());
|
||||
var avalbudAmt = '';
|
||||
alert('before Ajax');
|
||||
//alert('before Ajax');
|
||||
$.ajax({
|
||||
data:{id:costcode},
|
||||
type:"POST",
|
||||
@ -3715,7 +3719,7 @@ function validateBudgetExceedLimit()
|
||||
success:function(data) {
|
||||
if(data)
|
||||
{
|
||||
alert(data);
|
||||
//alert(data);
|
||||
avalbudAmt = parseFloat(data);
|
||||
if(basicAmountRate > avalbudAmt || totalAmount > avalbudAmt)
|
||||
{
|
||||
@ -3726,7 +3730,7 @@ function validateBudgetExceedLimit()
|
||||
}
|
||||
else
|
||||
{
|
||||
alert('Not exceeding in else part');
|
||||
//alert('Not exceeding in else part');
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -3913,14 +3917,14 @@ function populateValueMainFormForDeleteItem(rowid)
|
||||
function Save(status)
|
||||
{
|
||||
|
||||
alert('Inside Save');
|
||||
//alert('Inside Save');
|
||||
if(status == '0')
|
||||
{
|
||||
stat = '<?php echo PO_DRAFT; ?>';
|
||||
}
|
||||
else
|
||||
{
|
||||
alert('Inside else');
|
||||
//alert('Inside else');
|
||||
stat = '<?php echo PO_CREATED; ?>';
|
||||
}
|
||||
var splinstr = $('#txtSpcialInstruction').val();
|
||||
@ -3931,12 +3935,12 @@ $('#txtStatus').val(stat);
|
||||
$('#SpcialInstruction').val(splinstr);
|
||||
$('#txtDeliveryAddress').val(deladd);
|
||||
|
||||
alert('Before Validate IF condition');
|
||||
//alert('Before Validate IF condition');
|
||||
if(validate())
|
||||
{
|
||||
alert('insdie Validate IF condition');
|
||||
//alert('insdie Validate IF condition');
|
||||
var realrows=document.getElementById('txtRowCount').value;
|
||||
alert(realrows);
|
||||
//alert(realrows);
|
||||
if(document.getElementById('revenueTax').rows.length < 2)
|
||||
{
|
||||
alert('Please Select Line item to Create PO');
|
||||
@ -3950,7 +3954,7 @@ alert('Before Validate IF condition');
|
||||
}
|
||||
else
|
||||
{
|
||||
alert('final else for store data');
|
||||
//alert('final else for store data');
|
||||
$('.content').loader('show');
|
||||
$.ajax({
|
||||
data:$('.CreatePO').serialize(),
|
||||
@ -4014,7 +4018,7 @@ $('#Scheduleby').change(function(){
|
||||
|
||||
$.each(Detail, function (index, value)
|
||||
{
|
||||
$("#PaymentTerms").append( $('<option></option>').val(value.PaymentTerms).html(value.PaymentTerms) );
|
||||
$("#PaymentTerms").append( $('<option></option>').val(value.ConfigValue).html(value.ConfigValue) );
|
||||
|
||||
|
||||
|
||||
|
||||
@ -34,6 +34,10 @@ if(!empty($MaxPODate))
|
||||
}
|
||||
if(!empty($POMaster))
|
||||
{
|
||||
// print_r($POMaster);
|
||||
// print_r($Payment);
|
||||
// echo "****";
|
||||
// print_r($PaymentTerms);
|
||||
foreach ($POMaster as $Req)
|
||||
{
|
||||
|
||||
@ -2208,12 +2212,12 @@ var stat='';
|
||||
if(status == '0')
|
||||
{
|
||||
stat = '<?php echo PO_DRAFT; ?>';
|
||||
alert(stat);
|
||||
//alert(stat);
|
||||
}
|
||||
else
|
||||
{
|
||||
stat = '<?php echo PO_CREATED; ?>';
|
||||
alert(stat);
|
||||
//alert(stat);
|
||||
}
|
||||
var splinstr = $('#txtSpcialInstruction').val();
|
||||
var deladd = $('#DeliveryAddr').val();
|
||||
@ -2250,7 +2254,7 @@ $('#txtDeliveryAddress').val(deladd);
|
||||
$('#txtStatus').val('');
|
||||
$('#SpcialInstruction').val('');
|
||||
$('#txtDeliveryAddress').val('')
|
||||
//window.location = "purchaseorderListing";
|
||||
window.location = "amendmentpurchaseorder";
|
||||
|
||||
}
|
||||
else
|
||||
@ -2289,7 +2293,7 @@ var Detail = <?php echo json_encode($Payment, JSON_PRETTY_PRINT) ?>;
|
||||
|
||||
$.each(Detail, function (index, value)
|
||||
{
|
||||
$("#PaymentTerms").append( $('<option></option>').val(value.PaymentTerms).html(value.PaymentTerms) );
|
||||
$("#PaymentTerms").append( $('<option></option>').val(value.ConfigValue).html(value.ConfigValue) );
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user