done amend capital po pdf and screen changes

This commit is contained in:
gandhimathi 2017-09-17 17:45:39 +05:30
parent ceb44d8f28
commit d27e37971a
5 changed files with 8041 additions and 7051 deletions

View File

@ -107,6 +107,7 @@ class amendmentpurchaseorder extends BaseController
$data['MaxPODate'] = $this->purchaseorder_model->getLastCreatedPODate(); $data['MaxPODate'] = $this->purchaseorder_model->getLastCreatedPODate();
$data['TaxType'] = $this->purchaseorder_model->getConfigValue('C006'); $data['TaxType'] = $this->purchaseorder_model->getConfigValue('C006');
$data['FreightType'] = $this->purchaseorder_model->getConfigValue('C018'); $data['FreightType'] = $this->purchaseorder_model->getConfigValue('C018');
$data['PoTypeOptions'] = $this->purchaseorder_model->getConfigValue('C026');
if($ReqType == SERVICE) if($ReqType == SERVICE)
{ {
@ -566,13 +567,14 @@ class amendmentpurchaseorder extends BaseController
function UpdateAmendServicePurchaseOrder() function UpdateAmendServicePurchaseOrder()
{ {
$PONO =$this->input->post('txtPONO'); $PONO =$this->input->post('txtPONO');
$MAD=''; $MAD='';
$POdt =$this->input->post('PODate'); $POdt =$this->input->post('PODate');
$PODate = $this->getDateformat($POdt); $PODate = $this->getDateformat($POdt);
//echo $PODate; //echo $PODate;
$SupplierID = $this->input->post('drpSupplier'); $SupplierID = $this->input->post('drpSupplier');
$DeliveryAddr = $this->input->post('txtDeliveryAddress'); $DeliveryAddr = $this->input->post('txtDeliveryAddress');
$dt = $this->input->post('Deliverydt'); $dt = $this->input->post('Deliverydt');
$DeliveryOption = $this->input->post('DateRange'); $DeliveryOption = $this->input->post('DateRange');
@ -611,7 +613,7 @@ function UpdateAmendServicePurchaseOrder()
// } // }
$PaymentTermsText=$this->input->post('beforePaymentTermsText'); $PaymentTermsText=$this->input->post('beforePaymentTermsText');
$PaymentTerms=$this->input->post('PaymentTerms'); $PaymentTerms=$this->input->post('PaymentTerms');
$Otherpayment=$this->input->post('Otherpayment'); $Otherpayment=$this->input->post('Otherpayment');
$Otherpaymentamend=$this->input->post('Otherpayment'); $Otherpaymentamend=$this->input->post('Otherpayment');
$beforePaymentTerms=$this->input->post('beforePaymentTerms'); $beforePaymentTerms=$this->input->post('beforePaymentTerms');
@ -624,6 +626,15 @@ function UpdateAmendServicePurchaseOrder()
$POType = $this->input->post('POType'); $POType = $this->input->post('POType');
$ModeOfShipment=$this->input->post('addmodeofshipment');
$SupplierReference=$this->input->post('amendsupplierreference');
$SuppliersOfferNo=$this->input->post('amendsupplierofferno');
$OtherReferences=$this->input->post('amendotherreference');
$Fincap=$this->input->post('amendfincap');
$InsuranceOptions=$this->input->post('insuranceStatus');
$InsuranceNo=$this->input->post('insuranceNo');
$ServiceTypeOptions=$this->input->post('PoTypeOptions');
$DescriptionOfPo = $this->input->post('amenddescofpo');
$scopeofwork = $this->input->post('ScopeofWork'); $scopeofwork = $this->input->post('ScopeofWork');
$TotalOrderValueSummary = $this->input->post('txtTotalOrderValueSummary'); $TotalOrderValueSummary = $this->input->post('txtTotalOrderValueSummary');
$POStatus = $this->input->post('txtStatus'); $POStatus = $this->input->post('txtStatus');
@ -643,7 +654,7 @@ function UpdateAmendServicePurchaseOrder()
$Otherpayment=''; $Otherpayment='';
} }
$POMaster = array('ParentPO'=>$PONO,'POType'=>$POType,'SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'Status'=>PO_RELEASED,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ServiceDescription'=>$scopeofwork,'CreatedBy'=>$updatedBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$updateddt,'PaymentTerms'=>$PaymentTerms,'PaymentOtherDescription'=>$Otherpayment,'ServiceWorkStatus'=>$WorkStatus,'ReleasedBy'=>$updatedBy,'ReleasedOn'=>$updateddt,'AmendedDetails'=>$MAD); $POMaster = array('ParentPO'=>$PONO,'POType'=>$POType,'SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'Status'=>PO_RELEASED,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ServiceDescription'=>$scopeofwork,'CreatedBy'=>$updatedBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$updateddt,'PaymentTerms'=>$PaymentTerms,'PaymentOtherDescription'=>$Otherpayment,'ServiceWorkStatus'=>$WorkStatus,'ReleasedBy'=>$updatedBy,'ReleasedOn'=>$updateddt,'AmendedDetails'=>$MAD,'Supplier_Reference'=>$SupplierReference,'Mode_Of_Shipment'=>$ModeOfShipment,'Supplier_Offer_No'=>$SuppliersOfferNo,'Other_Reference'=>$OtherReferences,'Fincap'=>$Fincap,'Description_Of_Service'=>$DescriptionOfPo,'InsuranceStatus'=>$InsuranceOptions,'InsuranceNumber'=>$InsuranceNo,'POSubType'=>$ServiceTypeOptions);
//print_r($POMaster); //print_r($POMaster);
@ -675,7 +686,7 @@ function UpdateAmendServicePurchaseOrder()
$Reqnumber = $this->input->post('Reqnumber'.$i); $Reqnumber = $this->input->post('Reqnumber'.$i);
$itemRate = $this->input->post('itemRate'.$i); $itemRate = $this->input->post('itemRate'.$i);
$beforeitemRate = $this->input->post('beforeitemRate'.$i); $beforeitemRate = $this->input->post('beforeitemRate'.$i);
$Per = $this->input->post('per'.$i);
$AfterSGST = $this->input->post('AfterSgst'.$i); $AfterSGST = $this->input->post('AfterSgst'.$i);
$beforeSGSTvalue = $this->input->post('beforeSgstvalue'.$i); $beforeSGSTvalue = $this->input->post('beforeSgstvalue'.$i);
$AfterCGST = $this->input->post('AfterCgst'.$i); $AfterCGST = $this->input->post('AfterCgst'.$i);
@ -748,7 +759,7 @@ function UpdateAmendServicePurchaseOrder()
//echo "<br>CAD IS" . $CAD . "<br>"; //echo "<br>CAD IS" . $CAD . "<br>";
$POLineItemList = array('PONO'=>$NewPO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'ServiceMaterialDescription'=>$servicematerialdescription,'CreatedBy'=>$updatedBy,'CreatedDate'=>$updateddt,'CostCenterCode'=>$CostCenter,'ServiceFrequency'=>$ServiceFrequency,'ReceivedQuantity'=>$RecQtyvalue,'AmendedDetails'=>$CAD); $POLineItemList = array('PONO'=>$NewPO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'ServiceMaterialDescription'=>$servicematerialdescription,'CreatedBy'=>$updatedBy,'CreatedDate'=>$updateddt,'CostCenterCode'=>$CostCenter,'ServiceFrequency'=>$ServiceFrequency,'ReceivedQuantity'=>$RecQtyvalue,'AmendedDetails'=>$CAD,'Per'=>$Per);
//print_r($POLineItemList); //print_r($POLineItemList);
$POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList); $POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList);
@ -772,7 +783,8 @@ function UpdateAmendServicePurchaseOrder()
function EditAmendCapitalPurchaseOrder() function EditAmendCapitalPurchaseOrder()
{ {
//echo "WELCOME-";
$PONO =$this->input->post('txtPONO'); $PONO =$this->input->post('txtPONO');
//echo $PONO."--"; //echo $PONO."--";
@ -821,6 +833,15 @@ function UpdateAmendServicePurchaseOrder()
//echo "Tjb" . $Totalserviceorder."--" . $PreServiceTotalorder;die(); //echo "Tjb" . $Totalserviceorder."--" . $PreServiceTotalorder;die();
$TotalCapitalorder= $this->input->post('CapitalToatlOrder');//For International total CapitalOrder $TotalCapitalorder= $this->input->post('CapitalToatlOrder');//For International total CapitalOrder
$preTotalCapitalorder= $this->input->post('preinterTotalorderValue');//For International pre total CapitalOrder $preTotalCapitalorder= $this->input->post('preinterTotalorderValue');//For International pre total CapitalOrder
$ModeOfShipment=$this->input->post('addmodeofshipment');
$SupplierReference=$this->input->post('amendsupplierreference');
$SuppliersOfferNo=$this->input->post('amendsupplierofferno');
$OtherReferences=$this->input->post('amendotherreference');
$Fincap=$this->input->post('amendfincap');
$InsuranceOptions=$this->input->post('insuranceStatus');
$InsuranceNo=$this->input->post('insuranceNo');
$ServiceTypeOptions=$this->input->post('PoTypeOptions');
//echo $TotalCapitalorder . "-" . $preTotalCapitalorder; //echo $TotalCapitalorder . "-" . $preTotalCapitalorder;
if($PoRange==1){ if($PoRange==1){
$MAD.="Amended TotalOrder Vale:&nbsp;&nbsp;" . $PreServiceTotalorder . "<br>"; $MAD.="Amended TotalOrder Vale:&nbsp;&nbsp;" . $PreServiceTotalorder . "<br>";
@ -893,7 +914,7 @@ function UpdateAmendServicePurchaseOrder()
$Otherpayment=''; $Otherpayment='';
} }
$updatedBy = $this->session->userdata ( 'userId' ); $updatedBy = $this->session->userdata ( 'userId' );
$POMaster = array('ParentPO'=>$PONO,'SupplierID'=>$SupplierID, 'TotalOrderValue'=>$FinalTotalOrder,'POType'=>$POType,'PODate'=>$PODate,'Status'=>PO_RELEASED,'CapitalRange'=>$PoRange,'ExchangeRate'=>$ExchangeRate,'ExchangeRateCalculatedon'=>$ExchangeRateOn,'PaymentTerms'=>$PaymentMethod,'PaymentOtherDescription'=>$Otherpayment,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'ReleasedBy'=>$updatedBy,'ReleasedOn'=>$updateddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'CurrencyType'=>$currencytypeID,'AmendedDetails'=>$MAD,'Import_DispatchDetails'=>$curdispatch,'Import_PlaceofOrgin'=>$PlaceOforigin); $POMaster = array('ParentPO'=>$PONO,'SupplierID'=>$SupplierID, 'TotalOrderValue'=>$FinalTotalOrder,'POType'=>$POType,'PODate'=>$PODate,'Status'=>PO_RELEASED,'CapitalRange'=>$PoRange,'ExchangeRate'=>$ExchangeRate,'ExchangeRateCalculatedon'=>$ExchangeRateOn,'PaymentTerms'=>$PaymentMethod,'PaymentOtherDescription'=>$Otherpayment,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'ReleasedBy'=>$updatedBy,'ReleasedOn'=>$updateddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'CurrencyType'=>$currencytypeID,'AmendedDetails'=>$MAD,'Import_DispatchDetails'=>$curdispatch,'Import_PlaceofOrgin'=>$PlaceOforigin,'Supplier_Reference'=>$SupplierReference,'Mode_Of_Shipment'=>$ModeOfShipment,'Supplier_Offer_No'=>$SuppliersOfferNo,'Other_Reference'=>$OtherReferences,'Fincap'=>$Fincap,'InsuranceStatus'=>$InsuranceOptions,'InsuranceNumber'=>$InsuranceNo,'POSubType'=>$ServiceTypeOptions);
// print_r($POMaster); // print_r($POMaster);
$LastPO = $this->purchaseorder_model->addAmendPOMaster($POMaster,$CreateBy,$PONO); $LastPO = $this->purchaseorder_model->addAmendPOMaster($POMaster,$CreateBy,$PONO);
@ -926,7 +947,7 @@ function UpdateAmendServicePurchaseOrder()
$Reqnumber = $this->input->post('Reqnumber'.$i); $Reqnumber = $this->input->post('Reqnumber'.$i);
$preitemRate = $this->input->post('itemRate'.$i); $preitemRate = $this->input->post('itemRate'.$i);
$itemRate = $this->input->post('rateInUs'.$i); $itemRate = $this->input->post('rateInUs'.$i);
$Per = $this->input->post('per'.$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);
@ -971,9 +992,9 @@ function UpdateAmendServicePurchaseOrder()
$SGST = $this->input->post('SGST'.$i); $SGST = $this->input->post('SGST'.$i);
$preSGST = $this->input->post('beforeSGST'.$i); $preSGST = $this->input->post('beforeSGST'.$i);
$CGST = $this->input->post('CGST'.$i); $CGST = $this->input->post('CGST'.$i);
$preCGST = $this->input->post('beforeCGST'.$i); $preCGST = $this->input->post('beforeCGST'.$i);
$IGST = $this->input->post('IGST'.$i); $IGST = $this->input->post('IGST'.$i);
$preIGST = $this->input->post('beforeIGST'.$i); $preIGST = $this->input->post('beforeIGST'.$i);
$SGSTvalue=$this->input->post('afterSGST'.$i); $SGSTvalue=$this->input->post('afterSGST'.$i);
@ -983,9 +1004,20 @@ function UpdateAmendServicePurchaseOrder()
$IGSTvalue=$this->input->post('afterIGST'.$i); $IGSTvalue=$this->input->post('afterIGST'.$i);
$preIGSTvalue=$this->input->post('beforeIGSTvalue'.$i); $preIGSTvalue=$this->input->post('beforeIGSTvalue'.$i);
$otherallowance=$this->input->post('otherallowance'.$i); $otherallowance=$this->input->post('otherallowance'.$i);
$preotherallowance=$this->input->post('beforeotherallowance'.$i); $preotherallowance=$this->input->post('beforeotherallowance'.$i);
$TotalServiceOrderValue = $this->input->post('totalservicevalue'.$i); $DiscountType = $this->input->post('DisType'.$i);
$POLineItemNo = $this->input->post('LineItemNo'.$i); $DiscountValue = $this->input->post('DisVal'.$i);
$AfterDiscount = $this->input->post('AfterDisVal'.$i);
$preDiscountType = $this->input->post('beforeDisType'.$i);
$preDiscountValue = $this->input->post('beforeDisVal'.$i);
$preAfterDiscount = $this->input->post('beforeAfterDisVal'.$i);
$TotalServiceOrderValue = $this->input->post('totalservicevalue'.$i);
$CapitalItemDescrition = $this->input->post('CapitalItemDescrition'.$i);
$FreightType = $this->input->post('FreightType'.$i);
$FreightValue = $this->input->post('FreightVal'.$i);
$AfterFreightValue = $this->input->post('AfterFreightVal'.$i);
$NOOfTrip = $this->input->post('NoOfTrip'.$i);
$POLineItemNo = $this->input->post('LineItemNo'.$i);
$rowspanvalue=0; $rowspanvalue=0;
if($Quantity != $preQuantity) if($Quantity != $preQuantity)
@ -1000,6 +1032,10 @@ function UpdateAmendServicePurchaseOrder()
} }
if($PoRange==1){ if($PoRange==1){
if(($DiscountValue!=$preDiscountValue) && ($AfterDiscount!=$preAfterDiscount)){
$rowspanvalue+=2;
$CAD.="<tr><td>Amended Discount :&nbsp;" . $preDiscountValue ."</td><td>Current Discount :&nbsp;" . $DiscountValue . "</td></tr><tr><td>Amended Discount value :&nbsp;" . $preAfterDiscount ."</td><td>Current Discount value:&nbsp;" . $AfterDiscount . "</td></tr>";
}
if(($SGST != $preSGST) && ($SGSTvalue != $preSGSTvalue)) if(($SGST != $preSGST) && ($SGSTvalue != $preSGSTvalue))
{ {
$rowspanvalue+=2; $rowspanvalue+=2;
@ -1031,10 +1067,10 @@ function UpdateAmendServicePurchaseOrder()
$CAD.=$CAD2; $CAD.=$CAD2;
} }
//echo $CAD;
$POLineItemList = array('PONO'=>$NewPO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'CostCenterCode'=>$CostCenter,'AmendedDetails'=>$CAD);
// print_r($POLineItemList); $POLineItemList = array('PONO'=>$NewPO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'CostCenterCode'=>$CostCenter,'AmendedDetails'=>$CAD,'Per'=>$Per,'ServiceMaterialDescription'=>$CapitalItemDescrition);
$POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList); $POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList);
@ -1043,22 +1079,19 @@ function UpdateAmendServicePurchaseOrder()
foreach($POLineItem as $line): foreach($POLineItem as $line):
$LineItemNo = $line['LineItemNo']; $LineItemNo = $line['LineItemNo'];
endforeach; endforeach;
//echo $LineItemNo;
if(trim($POType) == CAPITAL ) if(trim($POType) == CAPITAL )
{ {
$ServiceTaxList = array('LineItemNo'=>$LineItemNo, 'CGST'=>$CGST,'After_CGST'=>$CGSTvalue,'SGST'=>$SGST,'After_SGST'=>$SGSTvalue,'IGST'=>$IGST,'After_IGST'=>$IGSTvalue, 'otherallowance'=>$otherallowance,'TotalValue'=>$TotalServiceOrderValue,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt); if($capitalType=='1'){
// print_r($ServiceTaxList); $ServiceTaxList = array('LineItemNo'=>$LineItemNo, 'CGST'=>$CGST,'After_CGST'=>$CGSTvalue,'SGST'=>$SGST,'After_SGST'=>$SGSTvalue,'IGST'=>$IGST,'After_IGST'=>$IGSTvalue, 'otherallowance'=>$otherallowance,'TotalValue'=>$TotalServiceOrderValue,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'discount'=>$DiscountType,'discountval'=>$DiscountValue,'Afterdiscountval'=>$AfterDiscount);
$ServiceTax = $this->purchaseorder_model->addServiceTax($ServiceTaxList); $ServiceTax = $this->purchaseorder_model->addServiceTax($ServiceTaxList);
//echo "Service"; } //echo "Service";
//print_r($ServiceTax); else if($capitalType=='0'){ //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); $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,'FreightType'=>$FreightType,'NoOfTrip'=>$NOOfTrip,'FreightValue'=>$FreightValue,'AfterFreightValue'=>$AfterFreightValue);
//print_r($ImportTaxList);
//die();
$ImportList = $this->purchaseorder_model->addImportTax($ImportTaxList); $ImportList = $this->purchaseorder_model->addImportTax($ImportTaxList);
}
} }

View File

@ -452,7 +452,7 @@ class purchaseorder extends BaseController
$CapitalRange = $_GET['CapitalRange']; $CapitalRange = $_GET['CapitalRange'];
$CapitalAvlBudget = $this->purchaseorder_model->GetAvailableCapitalBudgetAmount($CostCode,$FYdt,$ReqType); $CapitalAvlBudget = $this->purchaseorder_model->GetAvailableCapitalBudgetAmount($CostCode,$FYdt,$ReqType);
print_r($CapitalAvlBudget);die();
if(count($CapitalAvlBudget)>0) if(count($CapitalAvlBudget)>0)
{ {

File diff suppressed because it is too large Load Diff

View File

@ -5739,6 +5739,7 @@ function clearAfterAddLineItemAdd(){
$('#materialCode'+userid).val(materialCode); $('#materialCode'+userid).val(materialCode);
$('#materialName'+userid).val(materialName); $('#materialName'+userid).val(materialName);
$('#uom'+userid).val(uom); $('#uom'+userid).val(uom);
$('#per'+userid).val(editPer);
$('#quantity'+userid).val(quantity); $('#quantity'+userid).val(quantity);
$('#rateInUs'+userid).val(itemRate); $('#rateInUs'+userid).val(itemRate);

View File

@ -1,82 +1,99 @@
<?php <?php
$insuranceStatus = array(
array("name"=>"NO","value"=>"0"),array("name"=>"YES","value"=>"1")
);
$DeliverOption='';
$SupId = '';
$SupName = '';
$Address = '';
$PODate = '';
$DeliverOption=''; $DeliveryAddress ='';
$SupId = ''; $PONOStatus = '';
$SupName = ''; $PONO = '';
$Address = '';
$PODate = '';
$DeliveryAddress =''; $TotalCgst = 0.0;
$PONOStatus = ''; $TotalSgst = 0.0;
$PONO = ''; $TotalIgst = 0.0;
$TotalSummary = 0.0;
$Totalotherallowance=0.0;
$TotalBasicAmount = 0.0;
$ServiceDescription = '';
$PaymentOtherDescription='';
$ServiceMaterialDescription='';
$Reqon='';
$Deliverydt='';
$DeliverSchedule='';
$MaxPoDate = '';
$AvlAmount = 0;
$Value="&#8377;";
$TotalCgst = 0.0; $StatusName='';
$TotalSgst = 0.0; $ModeOfShipment='';
$TotalIgst = 0.0; $SupplierReference='';
$TotalSummary = 0.0; $SuppliersOfferNo='';
$Totalotherallowance=0.0; $OtherReferences='';
$TotalBasicAmount = 0.0; $Fincap='';
$ServiceDescription = ''; $InsuranceOptions='';
$PaymentOtherDescription=''; $InsuranceNo='';
$ServiceTypeOptions='';
$DescriptionOfPo = '';
$ServiceMaterialDescription=''; if(!empty($INRSYMBOL))
$Reqon=''; {
$Deliverydt='';
$DeliverSchedule='';
$MaxPoDate = '';
$AvlAmount = 0;
$Value="&#8377;";
$StatusName=''; foreach($INRSYMBOL as $INRS)
{
$INRSYM=$INRS->FontCode2000;
}
}
if(!empty($INRSYMBOL)) if(!empty($MaxPODate))
{ {
foreach ($MaxPODate as $date)
{
$MaxPoDate = $date->PODate;
foreach($INRSYMBOL as $INRS) }
{ }
$INRSYM=$INRS->FontCode2000;
} if(!empty($POMaster))
} {
foreach ($POMaster as $Req)
{
if(!empty($MaxPODate)) $SupId = $Req->SupplierID;
{ $SupName = $Req->SupplierName;
foreach ($MaxPODate as $date) $Address = $Req->Address;
{ $pdt = new DateTime($Req->PODate);
$MaxPoDate = $date->PODate; $PODate = $pdt->format('d-m-Y');
$DeliverOption = $Req->DeliveryOption;
} $DeliverSchedule = $Req->DeliverySchedule;
} // echo "*" . $Req->DeliveryDate . "*";
$Ddt = new DateTime($Req->DeliveryDate);
$Deliverydt = $Ddt->format('d-m-Y');
if(!empty($POMaster)) // echo "-" . $Deliverydt . "-";
{ $DeliveryAddress =$Req->DeliveryAddress;
foreach ($POMaster as $Req) $PONOStatus = $Req->StatusCode;
{ $PONO = $Req->PONO;
$ServiceDescription = $Req->ServiceDescription;
$SupId = $Req->SupplierID; //Terms=$Req->PaymentTerms;
$SupName = $Req->SupplierName; $PaymentOtherDescription=$Req->PaymentOtherDescription;
$Address = $Req->Address; $WrkStatus=$Req->ServiceWorkStatus;
$pdt = new DateTime($Req->PODate); $StatusName=$Req->StatusName;
$PODate = $pdt->format('d-m-Y'); $RequesterName='';
$DeliverOption = $Req->DeliveryOption; $ModeOfShipment=$Req->Mode_Of_Shipment;
$DeliverSchedule = $Req->DeliverySchedule; $SupplierReference=$Req->Supplier_Reference;
// echo "*" . $Req->DeliveryDate . "*"; $SuppliersOfferNo=$Req->Supplier_Offer_No;
$Ddt = new DateTime($Req->DeliveryDate); $OtherReferences=$Req->Other_Reference;
$Deliverydt = $Ddt->format('d-m-Y'); $Fincap=$Req->Fincap;
// echo "-" . $Deliverydt . "-"; $InsuranceOptions=$Req->InsuranceStatus;
$DeliveryAddress =$Req->DeliveryAddress; $InsuranceNo=$Req->InsuranceNumber;
$PONOStatus = $Req->StatusCode; $ServiceTypeOptions=$Req->POSubType;
$PONO = $Req->PONO; $DescriptionOfPo = $Req->Description_Of_Service;
$ServiceDescription = $Req->ServiceDescription; }
//Terms=$Req->PaymentTerms; }
$PaymentOtherDescription=$Req->PaymentOtherDescription;
$WrkStatus=$Req->ServiceWorkStatus;
$StatusName=$Req->StatusName;
$RequesterName='';
}
}
if(!empty($RequistionDetails)) if(!empty($RequistionDetails))
@ -147,13 +164,42 @@ tinymce.init({
menubar: false, menubar: false,
statusbar: false, statusbar: false,
toolbar: false, toolbar: false,
// plugins: "link image" // plugins: "link image"
}); });
var DelOpt = '<?php echo $DeliverOption; ?>'; var DelOpt = '<?php echo $DeliverOption; ?>';
var SchName = '<?php echo $DeliverSchedule; ?>'; var SchName = '<?php echo $DeliverSchedule; ?>';
var others ='<?php echo $PaymentOtherDescription;?>'; var others ='<?php echo $PaymentOtherDescription;?>';
var insuranceOpt = '<?php echo $InsuranceOptions; ?>';
var DelDt = '<?php echo $Deliverydt; ?>'; var DelDt = '<?php echo $Deliverydt; ?>';
$(document).ready(function () { $(document).ready(function () {
$('#RequistionNo').attr("style", "pointer-events: none;");
$('#PODate').attr("style", "pointer-events: none;");
$('#drpSupplier').attr("style", "pointer-events: none;");
$('#SupAddress').attr("style", "pointer-events: none;");
$('#POType').attr("style", "pointer-events: none;");
$('#DeliveryAddr').attr("style", "pointer-events: none;");
$('#workstatus').attr("style", "pointer-events: none;");
$('#addmodeofshipment').attr("style", "pointer-events: none;");
$('#amendsupplierreference').attr("style", "pointer-events: none;");
$('#amendsupplierofferno').attr("style", "pointer-events: none;");
$('#amendotherreference').attr("style", "pointer-events: none;");
$('#amendfincap').attr("style", "pointer-events: none;");
$('#PoTypeOptions').attr("style", "pointer-events: none;");
$('#insuranceNo').attr("style", "pointer-events: none;");
$('#insuranceStatus').attr("style", "pointer-events: none;");
if(insuranceOpt=="1"){
}
else{
$('#insuranceTxtDiv').hide();
}
if(DelOpt=="0"){ if(DelOpt=="0"){
$('#Deliverydtdiv').show(); $('#Deliverydtdiv').show();
$('#Schedulediv').hide(); $('#Schedulediv').hide();
@ -810,7 +856,7 @@ $(document).ready(function () {
<div class="form-group"> <div class="form-group">
<?php <?php
$data = array('name' => 'addmodeofshipment','value' => set_value('addmodeofshipment'),'id'=>'addmodeofshipment', 'class' => 'form-control'); $data = array('name' => 'addmodeofshipment','value' => set_value('addmodeofshipment',$ModeOfShipment),'id'=>'addmodeofshipment', 'class' => 'form-control');
echo form_input($data); echo form_input($data);
?> ?>
</div> </div>
@ -826,7 +872,7 @@ $(document).ready(function () {
<div class="form-group"> <div class="form-group">
<?php <?php
$data = array('name' => 'amendsupplierreference','value' => set_value('amendsupplierreference'),'id'=>'amendsupplierreference', 'class' => 'form-control'); $data = array('name' => 'amendsupplierreference','value' => set_value('amendsupplierreference',$SupplierReference),'id'=>'amendsupplierreference', 'class' => 'form-control');
echo form_input($data); echo form_input($data);
?> ?>
</div> </div>
@ -842,7 +888,7 @@ $(document).ready(function () {
<div class="form-group"> <div class="form-group">
<?php <?php
$data = array('name' => 'amendsupplierofferno','value' => set_value('amendsupplierofferno'),'id'=>'amendsupplierofferno', 'class' => 'form-control'); $data = array('name' => 'amendsupplierofferno','value' => set_value('amendsupplierofferno',$SuppliersOfferNo),'id'=>'amendsupplierofferno', 'class' => 'form-control');
echo form_input($data); echo form_input($data);
?> ?>
</div> </div>
@ -856,7 +902,7 @@ $(document).ready(function () {
<div class="form-group"> <div class="form-group">
<?php <?php
$data = array('name' => 'amendotherreference','value' => set_value('amendotherreference'),'id'=>'amendotherreference', 'class' => 'form-control'); $data = array('name' => 'amendotherreference','value' => set_value('amendotherreference',$OtherReferences),'id'=>'amendotherreference', 'class' => 'form-control');
echo form_input($data); echo form_input($data);
?> ?>
</div> </div>
@ -866,12 +912,105 @@ $(document).ready(function () {
<div class="form-group"> <div class="form-group">
<?php <?php
$data = array('name' => 'amendfincap','value' => set_value('amendfincap'),'id'=>'amendfincap', 'class' => 'form-control'); $data = array('name' => 'amendfincap','value' => set_value('amendfincap',$Fincap),'id'=>'amendfincap', 'class' => 'form-control');
echo form_input($data); echo form_input($data);
?> ?>
</div> </div>
</div> </div>
</div> </div>
</div>
</div>
</div><!--End new fields 1 sep-->
<!--start new fields 1 sep-->
<div class="row">
<div class="col-md-12">
<div class="col-md-3">
<div class="col-md-12" style="padding: 0px;">
<label>Service Type Options</label>
<div class="form-group">
<?php
//$optionsWork = array("0"=>'Select Work Status');
if(!empty($PoTypeOptions))
{
foreach ($PoTypeOptions as $POpt):
if($ServiceTypeOptions==$POpt->ConfigValue){
$optionsPO[$POpt->ConfigValue] = $POpt->ConfigValue;
}
endforeach;
foreach ($PoTypeOptions as $POpt1):
if($ServiceTypeOptions!=$POpt1->ConfigValue){
$optionsPO[$POpt1->ConfigValue] = $POpt1->ConfigValue;
}
endforeach;
}
echo form_dropdown('PoTypeOptions', $optionsPO,set_value('PoTypeOptions'),'id="PoTypeOptions"' ,'required="true"' ,'class="form-control select2');
?>
</div>
</div>
</div>
<div class="col-md-9" style="padding:0px;">
<div class="col-md-4" style="padding:0px;" >
<div class="col-md-12">
<label>Insurance Options</label>
<div class="form-group">
<?php
if(!empty($insuranceStatus))
{
foreach ($insuranceStatus as $INS):
if($InsuranceOptions==$INS['value']){
$optionsInsurance[$INS['value']] = $INS['name'];
}
endforeach;
foreach ($insuranceStatus as $INS1):
if($InsuranceOptions!=$INS1['value']){
$optionsInsurance[$INS1['value']] = $INS1['name'];
}
endforeach;
}
echo form_dropdown('insuranceStatus', $optionsInsurance,set_value('insuranceStatus'),'id="insuranceStatus"' ,'required="true"' ,'class="form-control select2');
?>
</div>
</div>
</div>
<div class="col-md-4" id="insuranceTxtDiv" style="display:block;">
<label>Insurance No<span class="badge" style="color:red;text-align:right;background-color: #ecf0f5 ;">*</span></label>
<div class="form-group">
<?php
$data = array('name' => 'insuranceNo','value' => set_value('insuranceNo',$InsuranceNo),'id'=>'insuranceNo', 'class' => 'form-control' ,'required' => 'true');
echo form_input($data);
?>
</div>
</div>
</div> </div>
</div> </div>
</div><!--End new fields 1 sep--> </div><!--End new fields 1 sep-->
@ -1255,7 +1394,7 @@ $(document).ready(function () {
<td align="left"><?php echo $index ; ?></td> <td align="left"><?php echo $index ; ?></td>
<td><?php echo $record->ReqNo ?></td> <td><?php echo $record->ReqNo ?></td>
<td><?php echo $record->MaterialCode ?></td> <td><?php echo $record->MaterialCode ?></td>
<td><?php echo $record->MaterialName ?></td> <td><?php echo $record->ServiceMaterialDescription ?></td>
<td align="right"><?php echo $record->Quantity ?></td> <td align="right"><?php echo $record->Quantity ?></td>
<td><?php echo $record->UOM ?></td> <td><?php echo $record->UOM ?></td>
@ -1276,7 +1415,8 @@ $(document).ready(function () {
<input type="hidden" name="<?php echo 'materialCode'.$index ?>" id="<?php echo 'materialCode'.$index ?>" value="<?php echo $record->MaterialCode ; ?>" /> <input type="hidden" name="<?php echo 'materialCode'.$index ?>" id="<?php echo 'materialCode'.$index ?>" value="<?php echo $record->MaterialCode ; ?>" />
<input type="hidden" name="<?php echo 'materialName'.$index ?>" id="<?php echo 'materialName'.$index ?>" value="<?php echo $record->MaterialName ; ?>" /> <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 '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 'per'.$index ?>" id="<?php echo 'per'.$index ?>" value="<?php echo $record->Per ; ?>" />
<input type="hidden" name="<?php echo 'quantity'.$index ?>" id="<?php echo 'quantity'.$index ?>" value="<?php echo $record->Quantity ; ?>" />
<input type="hidden" name="<?php echo 'beforequantity'.$index ?>" id="<?php echo 'beforequantity'.$index ?>" value="<?php echo $record->Quantity ; ?>" /> <input type="hidden" name="<?php echo 'beforequantity'.$index ?>" id="<?php echo 'beforequantity'.$index ?>" value="<?php echo $record->Quantity ; ?>" />
<input type="hidden" name="<?php echo 'itemRate'.$index ?>" id="<?php echo 'itemRate'.$index ?>" value="<?php echo $record->Rate ; ?>" /> <input type="hidden" name="<?php echo 'itemRate'.$index ?>" id="<?php echo 'itemRate'.$index ?>" value="<?php echo $record->Rate ; ?>" />
<input type="hidden" name="<?php echo 'beforeitemRate'.$index ?>" id="<?php echo 'beforeitemRate'.$index ?>" value="<?php echo $record->Rate ; ?>" /> <input type="hidden" name="<?php echo 'beforeitemRate'.$index ?>" id="<?php echo 'beforeitemRate'.$index ?>" value="<?php echo $record->Rate ; ?>" />
@ -1395,7 +1535,7 @@ $(document).ready(function () {
<label>Description Of Service</label> <label>Description Of Service</label>
<div class="form-group"> <div class="form-group">
<?php <?php
$data = array('name' => 'amenddescofpo','value' => set_value('amenddescofpo'),'id'=>'amenddescofpo', 'class' => 'form-control' ,'rows' => '3', 'cols' => '40' ); $data = array('name' => 'amenddescofpo','value' => set_value('amenddescofpo',$DescriptionOfPo),'id'=>'amenddescofpo', 'class' => 'form-control' ,'rows' => '3', 'cols' => '40' );
echo form_textarea($data); echo form_textarea($data);
?> ?>
</div> </div>
@ -1491,9 +1631,11 @@ $("#EDITSERVICE").on("shown.bs.modal", function(e) {
$('#EditdeptName').val($('#departmentName'+userid).val()); $('#EditdeptName').val($('#departmentName'+userid).val());
$("#EditCostCenter").val($('#costCode'+userid).val()); $("#EditCostCenter").val($('#costCode'+userid).val());
$('#EditAvlBudAmt').val(AvlBudAmt); $('#EditAvlBudAmt').val(AvlBudAmt);
$('#EdittxtSpcialInstruction').val($('#servicematerialdescription'+userid).val());
tinyMCE.get('EdittxtSpcialInstruction').setContent($('#servicematerialdescription'+userid).val());
$('#EditItemName').val($('#materialName'+userid).val()); $('#EditItemName').val($('#materialName'+userid).val());
$('#EditUOM').val($('#uom'+userid).val()); $('#EditUOM').val($('#uom'+userid).val());
$('#EditAmendPer').val($('#per'+userid).val());
$('#EditQuantity').val($('#quantity'+userid).val()); $('#EditQuantity').val($('#quantity'+userid).val());
RequistQuantity = $('#quantity'+userid).val(); RequistQuantity = $('#quantity'+userid).val();
$('#EditRate').val($('#itemRate'+userid).val()); $('#EditRate').val($('#itemRate'+userid).val());
@ -1583,6 +1725,13 @@ $("#EDITSERVICE").on("shown.bs.modal", function(e) {
var editMaterialCode = $("#EditMaterialCode").val(); var editMaterialCode = $("#EditMaterialCode").val();
var editDescription = $("#EditItemName").val(); var editDescription = $("#EditItemName").val();
var editUOM = $('#EditUOM').val(); var editUOM = $('#EditUOM').val();
var editPer='';
if($("#EditAmendPer").val().trim()==''){
editPer = $("#EditUOM").val();
}
else{
editPer = $("#EditAmendPer").val();
}
var editQuantity = $('#EditQuantity').val(); var editQuantity = $('#EditQuantity').val();
var otherallowance=$('#otherallowance').val(); var otherallowance=$('#otherallowance').val();
//alert(otherallowance); //alert(otherallowance);
@ -1612,7 +1761,7 @@ $("#EDITSERVICE").on("shown.bs.modal", function(e) {
var cellval = tr.cells; var cellval = tr.cells;
cellval[2].innerHTML = editMaterialCode; cellval[2].innerHTML = editMaterialCode;
cellval[3].innerHTML = editDescription; cellval[3].innerHTML = materialspecialinstruction;
cellval[4].innerHTML = editQuantity; cellval[4].innerHTML = editQuantity;
cellval[5].innerHTML =editUOM; cellval[5].innerHTML =editUOM;
cellval[6].innerHTML =parseFloat(itemRate).toFixed(2); cellval[6].innerHTML =parseFloat(itemRate).toFixed(2);
@ -1624,6 +1773,7 @@ $("#EDITSERVICE").on("shown.bs.modal", function(e) {
$('#materialCode'+userid).val(editMaterialCode); $('#materialCode'+userid).val(editMaterialCode);
$('#materialName'+userid).val(editDescription); $('#materialName'+userid).val(editDescription);
$('#uom'+userid).val(editUOM); $('#uom'+userid).val(editUOM);
$('#per'+userid).val(editPer);
$('#CostCode'+userid).val(CostCode); $('#CostCode'+userid).val(CostCode);
$('#quantity'+userid).val(editQuantity); $('#quantity'+userid).val(editQuantity);
$('#itemRate'+userid).val(itemRate); $('#itemRate'+userid).val(itemRate);
@ -1970,11 +2120,16 @@ function validateServiceTax()
// { // {
// return false; // return false;
// } // }
else if(ExceedBudget($('#EditTotalOrderValue').val(),$('#EditAvlBudAmt').val()) == false) else if(ExceedBudget($('#txtEditBasicValue').val(),$('#EditAvlBudAmt').val()) == false)
{ {
$('#EditRate').focus(); $('#EditRate').focus();
return false; return false;
} }
else if($('#EdittxtSpcialInstruction').val()==''){
alert('Please Enter the Service Description');
$('#EdittxtSpcialInstruction').focus();
return false;
}
else else
{ {
return true; return true;
@ -2005,7 +2160,7 @@ $('#txtStatus').val(stat);
//$('#SpcialInstruction').val(splinstr); //$('#SpcialInstruction').val(splinstr);
$('#txtDeliveryAddress').val(deladd); $('#txtDeliveryAddress').val(deladd);
AvlBudAmt = '<?php echo number_format($AvlAmount+$TotalBasicAmount, 2, '.', '') ?>'; AvlBudAmt = '<?php echo number_format($AvlAmount+$TotalBasicAmount, 2, '.', '') ?>';
var txtTotalOrderValueSummary = $('#txtTotalOrderValueSummary').val(); var txtTotalOrderValueSummary = $('#txtTotBasicAmount').val();
if(validate()) if(validate())
{ {
@ -2014,6 +2169,11 @@ var txtTotalOrderValueSummary = $('#txtTotalOrderValueSummary').val();
return false; return false;
} }
else if($('#Otherpayment').val()=='' && $('#PaymentTerms').val()=='PT08'){
alert('Please Enter Other Payment Details');
$('#Otherpayment').focus();
return false;
}
else{ else{
$('#content').loader('show'); $('#content').loader('show');
$.ajax({ $.ajax({
@ -2023,6 +2183,7 @@ var txtTotalOrderValueSummary = $('#txtTotalOrderValueSummary').val();
success:function(data) { success:function(data) {
if(data) if(data)
{ {
$('#content').loader('hide'); $('#content').loader('hide');
alert(data); alert(data);
$('#txtRowCount').val(''); $('#txtRowCount').val('');