diff --git a/app/Config/Routes.php b/app/Config/Routes.php
index 15d3ac7d..e349320e 100644
--- a/app/Config/Routes.php
+++ b/app/Config/Routes.php
@@ -200,7 +200,7 @@ $routes->get('EditPO', 'Purchaseorder::EditPurchaseOrder');
$routes->get('purchaseorder/CreatePOPrint', 'Purchaseorder::CreatePOPrint');
$routes->post('purchaseorder/ReleasePO', 'Purchaseorder::ReleasePO');
-$routes->post('purchaseorder/EditRevenuePurchaseOrder', 'Purchaseorder/EditRevenuePurchaseOrder');
+$routes->post('purchaseorder/EditRevenuePurchaseOrder', 'Purchaseorder::EditRevenuePurchaseOrder');
$routes->post('VerifyWithSupplierForPendingPO', 'Purchaseorder::VerifyWithSupplierForPendingPO');
diff --git a/app/Controllers/Amendmentpurchaseorder.php b/app/Controllers/Amendmentpurchaseorder.php
index 5ff68b1f..9d6c4b13 100644
--- a/app/Controllers/Amendmentpurchaseorder.php
+++ b/app/Controllers/Amendmentpurchaseorder.php
@@ -241,9 +241,9 @@ class Amendmentpurchaseorder extends BaseController
$revenuetype = $this->request->getPost('PoTypeOptions');
$insurancestatus = $this->request->getPost('insurancestatus');
if ($insurancestatus == 1) {
- $insuranceno = $this->request->getPost('insuranceno');
+ $InsuranceNumber = $this->request->getPost('InsuranceNumber');
} else {
- $insuranceno = "";
+ $InsuranceNumber = "";
}
$POType = $this->request->getPost('POType');
@@ -288,7 +288,7 @@ class Amendmentpurchaseorder extends BaseController
$Otherpayment = '';
}
- $POMaster = array('ParentPO' => $PONO, 'SupplierID' => $SupplierID, 'POType' => $POType, 'PORange' => $PoRange, 'TotalOrderValue' => $TotalOrderValueSummary, 'PODate' => $PODate, 'Status' => PO_RELEASED, 'PaymentTerms' => $PaymentTerms, 'PaymentOtherDescription' => $Otherpayment, 'Mode_Of_Shipment' => $Modeofshipment, 'Supplier_Reference' => $supplierreference, 'Supplier_Offer_No' => $supplieroffno, 'Other_Reference' => $otherreference, 'Fincap' => $fincap, 'InsuranceStatus' => $insurancestatus, 'InsuranceNumber' => $insuranceno, 'POSubType' => $revenuetype, 'DeliverySchedule' => $DeliverySchedule, 'DeliveryOption' => $DeliveryOption, 'ServiceDescription' => $SpecialInstruction, 'CreatedBy' => $updatedBy, 'DeliveryAddress' => $DeliveryAddr, 'DeliveryDate' => $Deliverydt, 'UpdatedOn' => $updateddt, 'ReleasedBy' => $updatedBy, 'ReleasedOn' => $updateddt, 'AmendedDetails' => $MAD, 'IsQualityChkReqired' => $qtycheckresult);
+ $POMaster = array('ParentPO' => $PONO, 'SupplierID' => $SupplierID, 'POType' => $POType, 'PORange' => $PoRange, 'TotalOrderValue' => $TotalOrderValueSummary, 'PODate' => $PODate, 'Status' => PO_RELEASED, 'PaymentTerms' => $PaymentTerms, 'PaymentOtherDescription' => $Otherpayment, 'Mode_Of_Shipment' => $Modeofshipment, 'Supplier_Reference' => $supplierreference, 'Supplier_Offer_No' => $supplieroffno, 'Other_Reference' => $otherreference, 'Fincap' => $fincap, 'InsuranceStatus' => $insurancestatus, 'InsuranceNumber' => $InsuranceNumber, 'POSubType' => $revenuetype, 'DeliverySchedule' => $DeliverySchedule, 'DeliveryOption' => $DeliveryOption, 'ServiceDescription' => $SpecialInstruction, 'CreatedBy' => $updatedBy, 'DeliveryAddress' => $DeliveryAddr, 'DeliveryDate' => $Deliverydt, 'UpdatedOn' => $updateddt, 'ReleasedBy' => $updatedBy, 'ReleasedOn' => $updateddt, 'AmendedDetails' => $MAD, 'IsQualityChkReqired' => $qtycheckresult);
$LastPO = $this->purchaseorder_model->addAmendPOMaster($POMaster, $updatedBy, $PONO);
if (count($LastPO) > 0) {
$NewPO = $LastPO[0]['PONO'];
@@ -591,7 +591,7 @@ class Amendmentpurchaseorder extends BaseController
$OtherReferences = $this->request->getPost('amendotherreference');
$Fincap = $this->request->getPost('amendfincap');
$InsuranceOptions = $this->request->getPost('insuranceStatus');
- $InsuranceNo = $this->request->getPost('insuranceNo');
+ $InsuranceNumber = $this->request->getPost('InsuranceNumber');
$ServiceTypeOptions = $this->request->getPost('PoTypeOptions');
$DescriptionOfPo = $this->request->getPost('amenddescofpo');
$scopeofwork = $this->request->getPost('ScopeofWork');
@@ -618,7 +618,7 @@ class Amendmentpurchaseorder extends BaseController
if ($PaymentTerms != 'PT08') {
$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, '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, 'IsQualityChkReqired' => $qtycheckresult);
+ $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' => $InsuranceNumber, 'POSubType' => $ServiceTypeOptions, 'IsQualityChkReqired' => $qtycheckresult);
$LastPO = $this->purchaseorder_model->addAmendPOMaster($POMaster, $updatedBy, $PONO);
@@ -849,7 +849,7 @@ class Amendmentpurchaseorder extends BaseController
$OtherReferences = $this->request->getPost('amendotherreference');
$Fincap = $this->request->getPost('amendfincap');
$InsuranceOptions = $this->request->getPost('insuranceStatus');
- $InsuranceNo = $this->request->getPost('insuranceNo');
+ $InsuranceNumber = $this->request->getPost('InsuranceNumber');
$ServiceTypeOptions = $this->request->getPost('PoTypeOptions');
if ($PoRange == 1) {
@@ -916,7 +916,7 @@ class Amendmentpurchaseorder extends BaseController
$Otherpayment = '';
}
$updatedBy = $this->session->get('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, 'Supplier_Reference' => $SupplierReference, 'Mode_Of_Shipment' => $ModeOfShipment, 'Supplier_Offer_No' => $SuppliersOfferNo, 'Other_Reference' => $OtherReferences, 'Fincap' => $Fincap, 'InsuranceStatus' => $InsuranceOptions, 'InsuranceNumber' => $InsuranceNo, 'POSubType' => $ServiceTypeOptions, 'IsQualityChkReqired' => $qtycheckresult);
+ $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' => $InsuranceNumber, 'POSubType' => $ServiceTypeOptions, 'IsQualityChkReqired' => $qtycheckresult);
$LastPO = $this->purchaseorder_model->addAmendPOMaster($POMaster, $CreateBy, $PONO);
foreach ($LastPO as $PO) :
@@ -1268,10 +1268,10 @@ class Amendmentpurchaseorder extends BaseController
if ($Insurance == 'YES') {
- $Insurancenumber = $this->request->getPost('insurancenumber');
+ $InsuranceNumber = $this->request->getPost('InsuranceNumber');
$insurestatus = '1';
} else {
- $Insurancenumber = '';
+ $InsuranceNumber = '';
$insurestatus = '0';
}
$importoption = $this->request->getPost('Importoption');
@@ -1289,7 +1289,7 @@ class Amendmentpurchaseorder extends BaseController
$MAD .= $MAD . "Current Place of Origin: " . $beforePalaceoforigin . "
";
}
- $POMaster = array('ParentPO' => $PONO, 'SupplierID' => $SupplierID, 'POType' => $POType, 'TotalOrderValue' => $TotalOrder, 'PODate' => $PODate, 'Status' => $POStatus, 'PORange' => $PoRange, 'ServiceDescription' => $SpcialInstruction, 'CreatedBy' => $CreateBy, 'DeliveryAddress' => $DeliveryAddr, 'Import_DispatchDetails' => $Dispatch, 'CreatedDate' => $createddt, 'DeliverySchedule' => $DeliverySchedule, 'DeliveryOption' => $DeliveryOption, 'ExchangeRate' => $Exchangerate, 'ExchangeRateCalculatedon' => $ExchangeRateCalculatedon, 'CurrencyType' => $CurrencyType, 'PaymentTerms' => $PaymentTerms, 'ReleasedBy' => $updatedBy, 'ReleasedOn' => $updateddt, 'Import_PlaceofOrgin' => $Palaceoforigin, 'Mode_Of_Shipment' => $Shipmentmode, 'Supplier_Reference' => $SupplierRef, 'Supplier_Offer_No' => $SupplierOffer, 'Other_Reference' => $otherRef, 'Fincap' => $finCap, 'AmendedDetails' => $MAD, 'PaymentOtherDescription' => $OtherPayment, 'InsuranceStatus' => $insurestatus, 'InsuranceNumber' => $Insurancenumber, 'POSubType' => $importoption, 'IsQualityChkReqired' => $qtycheckresult);
+ $POMaster = array('ParentPO' => $PONO, 'SupplierID' => $SupplierID, 'POType' => $POType, 'TotalOrderValue' => $TotalOrder, 'PODate' => $PODate, 'Status' => $POStatus, 'PORange' => $PoRange, 'ServiceDescription' => $SpcialInstruction, 'CreatedBy' => $CreateBy, 'DeliveryAddress' => $DeliveryAddr, 'Import_DispatchDetails' => $Dispatch, 'CreatedDate' => $createddt, 'DeliverySchedule' => $DeliverySchedule, 'DeliveryOption' => $DeliveryOption, 'ExchangeRate' => $Exchangerate, 'ExchangeRateCalculatedon' => $ExchangeRateCalculatedon, 'CurrencyType' => $CurrencyType, 'PaymentTerms' => $PaymentTerms, 'ReleasedBy' => $updatedBy, 'ReleasedOn' => $updateddt, 'Import_PlaceofOrgin' => $Palaceoforigin, 'Mode_Of_Shipment' => $Shipmentmode, 'Supplier_Reference' => $SupplierRef, 'Supplier_Offer_No' => $SupplierOffer, 'Other_Reference' => $otherRef, 'Fincap' => $finCap, 'AmendedDetails' => $MAD, 'PaymentOtherDescription' => $OtherPayment, 'InsuranceStatus' => $insurestatus, 'InsuranceNumber' => $InsuranceNumber, 'POSubType' => $importoption, 'IsQualityChkReqired' => $qtycheckresult);
$LastPO = $this->purchaseorder_model->addAmendPOMaster($POMaster, $CreateBy, $PONO);
$NewPO = '';
if (count($LastPO) > 0) {
diff --git a/app/Controllers/Emergencypurchaseorder.php b/app/Controllers/Emergencypurchaseorder.php
index e1e7089c..d21af6c5 100644
--- a/app/Controllers/Emergencypurchaseorder.php
+++ b/app/Controllers/Emergencypurchaseorder.php
@@ -189,7 +189,7 @@ class Emergencypurchaseorder extends BaseController
$OtherReferences = $this->request->getPost('emergotherreference');
$Fincap = $this->request->getPost('emergfincap');
$InsuranceOptions = $this->request->getPost('insuranceStatus');
- $InsuranceNo = $this->request->getPost('insuranceNo');
+ $InsuranceNumber = $this->request->getPost('InsuranceNumber');
$ServiceTypeOptions = $this->request->getPost('PoTypeOptions');
$DescriptionOfPo = $this->request->getPost('emergdescofpo');
@@ -207,7 +207,7 @@ class Emergencypurchaseorder extends BaseController
$lastPONO = $this->purchaseorder_model->lastPONO();
$newPONO = generate_po_number($lastPONO);
// PO Master
- $POList = array('PONO'=>$newPONO,'SupplierID' => $SupplierID, 'TotalOrderValue' => $TotalOrderValueSummary, 'PODate' => $PODate, 'Status' => $POStatus, 'DeliverySchedule' => $DeliverySchedule, 'DeliveryOption' => $DeliveryOption, 'ServiceDescription' => $SpcialInstruction, 'CreatedBy' => $CreateBy, 'DeliveryAddress' => $DeliveryAddr, 'DeliveryDate' => $Deliverydt, 'CreatedDate' => $createddt, 'PaymentTerms' => $PaymentTerms, 'ServiceWorkStatus' => $ServiceWorkStatus, 'POType' => $POType, 'PaymentOtherDescription' => $OtherPayment, '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, 'BudgetType' => $BudgetType,'IsOpenOrder'=>$IsOpenOrder);
+ $POList = array('PONO'=>$newPONO,'SupplierID' => $SupplierID, 'TotalOrderValue' => $TotalOrderValueSummary, 'PODate' => $PODate, 'Status' => $POStatus, 'DeliverySchedule' => $DeliverySchedule, 'DeliveryOption' => $DeliveryOption, 'ServiceDescription' => $SpcialInstruction, 'CreatedBy' => $CreateBy, 'DeliveryAddress' => $DeliveryAddr, 'DeliveryDate' => $Deliverydt, 'CreatedDate' => $createddt, 'PaymentTerms' => $PaymentTerms, 'ServiceWorkStatus' => $ServiceWorkStatus, 'POType' => $POType, 'PaymentOtherDescription' => $OtherPayment, 'Supplier_Reference' => $SupplierReference, 'Mode_Of_Shipment' => $ModeOfShipment, 'Supplier_Offer_No' => $SuppliersOfferNo, 'Other_Reference' => $OtherReferences, 'Fincap' => $Fincap, 'Description_Of_Service' => $DescriptionOfPo, 'InsuranceStatus' => $InsuranceOptions, 'InsuranceNumber' => $InsuranceNumber, 'POSubType' => $ServiceTypeOptions, 'BudgetType' => $BudgetType,'IsOpenOrder'=>$IsOpenOrder);
$POMaster = $this->purchaseorder_model->addPOMaster($POList, $POType, $ServiceTypeOptions);
@@ -392,9 +392,9 @@ class Emergencypurchaseorder extends BaseController
$revenuetype = $this->request->getPost('PoTypeOptions');
$insurancestatus = $this->request->getPost('insuranceStatus');
if ($insurancestatus == 1) {
- $insuranceno = $this->request->getPost('insuranceNo');
+ $InsuranceNumber = $this->request->getPost('InsuranceNumber');
} else {
- $insuranceno = "";
+ $InsuranceNumber = "";
}
$CostCenterName = $this->request->getPost('CostCenterName');
$POType = $this->request->getPost('POType');
@@ -462,7 +462,7 @@ class Emergencypurchaseorder extends BaseController
$lastPONO = $this->purchaseorder_model->lastPONO();
$newPONO = generate_po_number($lastPONO);
- $POList = array('PONO'=>$newPONO,'SupplierID' => $SupplierID, 'TotalOrderValue' => $TotalOrderValueSummary, 'PODate' => $PODate, 'Status' => $POStatus, 'DeliverySchedule' => $DeliverySchedule, 'DeliveryOption' => $DeliveryOption, 'PORange' => $Local_Interstate, 'ServiceDescription' => $SpcialInstruction, 'CreatedBy' => $CreateBy, 'DeliveryAddress' => $DeliveryAddr, 'DeliveryDate' => $Deliverydt, 'CreatedDate' => $createddt, 'PaymentTerms' => $PaymentTerms, 'POType' => $POType, 'CapitalRange' => $Local_Interstate, 'PaymentOtherDescription' => $OtherPayment, 'Mode_Of_Shipment' => $Modeofshipment, 'Supplier_Offer_No' => $supplieroffno, 'Supplier_Reference' => $supplierreference, 'Other_Reference' => $otherreference, 'InsuranceNumber' => $insuranceno, 'InsuranceStatus' => $insurancestatus, 'Fincap' => $fincap, 'POSubType' => $revenuetype, 'IsQualityChkReqired' => $Qualitycheck, 'BudgetType' => $BudgetType,'IsOpenOrder'=>$IsOpenOrder);
+ $POList = array('PONO'=>$newPONO,'SupplierID' => $SupplierID, 'TotalOrderValue' => $TotalOrderValueSummary, 'PODate' => $PODate, 'Status' => $POStatus, 'DeliverySchedule' => $DeliverySchedule, 'DeliveryOption' => $DeliveryOption, 'PORange' => $Local_Interstate, 'ServiceDescription' => $SpcialInstruction, 'CreatedBy' => $CreateBy, 'DeliveryAddress' => $DeliveryAddr, 'DeliveryDate' => $Deliverydt, 'CreatedDate' => $createddt, 'PaymentTerms' => $PaymentTerms, 'POType' => $POType, 'CapitalRange' => $Local_Interstate, 'PaymentOtherDescription' => $OtherPayment, 'Mode_Of_Shipment' => $Modeofshipment, 'Supplier_Offer_No' => $supplieroffno, 'Supplier_Reference' => $supplierreference, 'Other_Reference' => $otherreference, 'InsuranceNumber' => $InsuranceNumber, 'InsuranceStatus' => $insurancestatus, 'Fincap' => $fincap, 'POSubType' => $revenuetype, 'IsQualityChkReqired' => $Qualitycheck, 'BudgetType' => $BudgetType,'IsOpenOrder'=>$IsOpenOrder);
//print_r($POList);
$POMaster = $this->purchaseorder_model->addPOMaster($POList, $POType, $revenuetype);
$PONO = $POMaster ? $newPONO : "";
diff --git a/app/Controllers/Inwardgateregister.php b/app/Controllers/Inwardgateregister.php
index a984bf7d..7889e60c 100755
--- a/app/Controllers/Inwardgateregister.php
+++ b/app/Controllers/Inwardgateregister.php
@@ -64,7 +64,7 @@ class Inwardgateregister extends BaseController
$result = $this->inwardgateregister_model->getpurchaseorder();
$data['PO_NO'] = array_filter($result, function($item) {
- return !($item->status === 'ST027' && $item->VaildUpto === null);
+ return !($item->status === 'ST027' && $item->IsOpenOrder === null);
});
diff --git a/app/Controllers/Purchaseorder.php b/app/Controllers/Purchaseorder.php
index 3d84dd55..a72269d2 100644
--- a/app/Controllers/Purchaseorder.php
+++ b/app/Controllers/Purchaseorder.php
@@ -1086,9 +1086,9 @@ $mpdf->use_kwt = true;
$revenuetype = $this->request->getPost('PoTypeOptions');
$insurancestatus = $this->request->getPost('insurance');
if ($insurancestatus == 1) {
- $insuranceno = $this->request->getPost('insuranceno');
+ $InsuranceNumber = $this->request->getPost('InsuranceNumber');
} else {
- $insuranceno = $this->request->getPost('insuranceno');
+ $InsuranceNumber = $this->request->getPost('InsuranceNumber');
}
$SpcialInstruction = $this->request->getPost('SpcialInstruction');
$TotalOrderValueSummary = $this->request->getPost('txtTotalOrderValueSummary');
@@ -1117,7 +1117,7 @@ $mpdf->use_kwt = true;
$newPONO = generate_po_number($lastPONO);
// PO Master
- $POList = array('PONO'=>$newPONO,'SupplierID' => $SupplierID, 'TotalOrderValue' => $TotalOrderValueSummary, 'PODate' => $PODate, 'DeliverySchedule' => $DeliverySchedule, 'DeliveryOption' => $DeliveryOption, 'Status' => $POStatus, 'PORange' => $Local_Interstate, 'ServiceDescription' => $SpcialInstruction, 'CreatedBy' => $CreateBy, 'DeliveryAddress' => $DeliveryAddr, 'DeliveryDate' => $Deliverydt, 'CreatedDate' => $createddt, 'PaymentTerms' => $PaymentTerms, 'POType' => $POType, 'CapitalRange' => $Local_Interstate, 'PaymentOtherDescription' => $OtherPayment, 'Supplier_Reference' => $supplierreference, 'Mode_Of_Shipment' => $Modeofshipment, 'Supplier_Offer_No' => $supplieroffno, 'Other_Reference' => $otherreference, 'Fincap' => $fincap, 'InsuranceStatus' => $insurancestatus, 'POSubType' => $revenuetype, 'InsuranceNumber' => $insuranceno, 'IsQualityChkReqired' => $Qualitycheck, 'BudgetType' => $BudgetType,'IsOpenOrder'=>$IsOpenOrder);
+ $POList = array('PONO'=>$newPONO,'SupplierID' => $SupplierID, 'TotalOrderValue' => $TotalOrderValueSummary, 'PODate' => $PODate, 'DeliverySchedule' => $DeliverySchedule, 'DeliveryOption' => $DeliveryOption, 'Status' => $POStatus, 'PORange' => $Local_Interstate, 'ServiceDescription' => $SpcialInstruction, 'CreatedBy' => $CreateBy, 'DeliveryAddress' => $DeliveryAddr, 'DeliveryDate' => $Deliverydt, 'CreatedDate' => $createddt, 'PaymentTerms' => $PaymentTerms, 'POType' => $POType, 'CapitalRange' => $Local_Interstate, 'PaymentOtherDescription' => $OtherPayment, 'Supplier_Reference' => $supplierreference, 'Mode_Of_Shipment' => $Modeofshipment, 'Supplier_Offer_No' => $supplieroffno, 'Other_Reference' => $otherreference, 'Fincap' => $fincap, 'InsuranceStatus' => $insurancestatus, 'POSubType' => $revenuetype, 'InsuranceNumber' => $InsuranceNumber, 'IsQualityChkReqired' => $Qualitycheck, 'BudgetType' => $BudgetType,'IsOpenOrder'=>$IsOpenOrder);
$POMaster = $this->purchaseorder_model->addPOMaster($POList, $POType, $revenuetype);
// echo "@1100 i have pomaster = ".'
'.print_r($POMaster,true).'
'."
";die();
$PONO = $POMaster ? $newPONO : "";
@@ -1205,7 +1205,6 @@ $mpdf->use_kwt = true;
//This used to Edit the Revenue Purchase Order
function EditRevenuePurchaseOrder()
{
-
$PONO = $this->request->getPost('txtPONO');
$POdt = $this->request->getPost('PODate');
$PODate = get_date_time_format($POdt);
@@ -1239,9 +1238,9 @@ $mpdf->use_kwt = true;
$revenuetype = $this->request->getPost('PoTypeOptions');
$insurancestatus = $this->request->getPost('insurancestatus');
if ($insurancestatus == 1) {
- $insuranceno = $this->request->getPost('insuranceno');
+ $InsuranceNumber = $this->request->getPost('InsuranceNumber');
} else {
- $insuranceno = "";
+ $InsuranceNumber = "";
}
$POType = $this->request->getPost('POType');
@@ -1273,8 +1272,13 @@ $mpdf->use_kwt = true;
$Qualitycheck = 1;
// PO Master
// PO Master
- $POList = array('SupplierID' => $SupplierID, 'TotalOrderValue' => $TotalOrderValueSummary, 'PODate' => $PODate, 'DeliverySchedule' => $DeliverySchedule, 'DeliveryOption' => $DeliveryOption, 'Status' => $POStatus, 'PORange' => $Local_Interstate, 'ServiceDescription' => $SpcialInstruction, 'UpdateBY' => $updatedBy, 'DeliveryAddress' => $DeliveryAddr, 'DeliveryDate' => $Deliverydt, 'UpdatedOn' => $updateddt, 'PaymentTerms' => $PaymentTerms, 'POType' => $POType, 'CapitalRange' => $Local_Interstate, 'PaymentOtherDescription' => $OtherPayment, 'Supplier_Reference' => $supplierreference, 'Mode_Of_Shipment' => $Modeofshipment, 'Supplier_Offer_No' => $supplieroffno, 'Other_Reference' => $otherreference, 'Fincap' => $fincap, 'InsuranceStatus' => $insurancestatus, 'POSubType' => $revenuetype, 'InsuranceNumber' => $insuranceno, 'IsQualityChkReqired' => $Qualitycheck, 'BudgetType' => $BudgetType);
-
+ $POList = array('SupplierID' => $SupplierID, 'TotalOrderValue' => $TotalOrderValueSummary, 'PODate' => $PODate, 'DeliverySchedule' => $DeliverySchedule, 'DeliveryOption' => $DeliveryOption, 'Status' => $POStatus, 'PORange' => $Local_Interstate, 'ServiceDescription' => $SpcialInstruction, 'UpdateBY' => $updatedBy, 'DeliveryAddress' => $DeliveryAddr, 'DeliveryDate' => $Deliverydt, 'UpdatedOn' => $updateddt, 'PaymentTerms' => $PaymentTerms, 'POType' => $POType, 'CapitalRange' => $Local_Interstate, 'PaymentOtherDescription' => $OtherPayment, 'Supplier_Reference' => $supplierreference, 'Mode_Of_Shipment' => $Modeofshipment, 'Supplier_Offer_No' => $supplieroffno, 'Other_Reference' => $otherreference, 'Fincap' => $fincap, 'InsuranceStatus' => $insurancestatus, 'POSubType' => $revenuetype, 'InsuranceNumber' => $InsuranceNumber, 'IsQualityChkReqired' => $Qualitycheck, 'BudgetType' => $BudgetType);
+ if ($POStatus == 'ST026') {
+ $POList['ApprovedOn'] = get_current_date_time();
+ $POList['ApprovedBy'] = $this->session->get('userId');
+ $POList['ReleasedOn'] = get_current_date_time();
+ $POList['ReleasedBy'] = $this->session->get('userId');
+ }
$POMaster = $this->purchaseorder_model->updatePOMaster($PONO, $POList);
@@ -1657,12 +1661,7 @@ $mpdf->use_kwt = true;
// Output PDF
$mpdf->Output('ServicePOReport' . $PONO . '.pdf', 'D');
}
-
-
-
-
-
-
+
public function importpoprint($PONO)
{
// echo $PONO;
@@ -1914,9 +1913,9 @@ $mpdf->use_kwt = true;
if ($Insurance == 1) {
- $Insurancenumber = $this->request->getPost('insurancenumber');
+ $InsuranceNumber = $this->request->getPost('InsuranceNumber');
} else {
- $Insurancenumber = '';
+ $InsuranceNumber = '';
}
// $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'CreatedDate'=>$createddt,'ExchangeRate'=>$Exchangerate,'ExchangeRateCalculatedon'=>$ExchangeRateCalculatedon,'CurrencyType'=>$CurrencyType,'PaymentTerms'=>$PaymentTerms,'POType'=>$POType);
@@ -1927,7 +1926,7 @@ $mpdf->use_kwt = true;
$lastPONO = $this->purchaseorder_model->lastPONO();
$newPONO = generate_po_number($lastPONO);
- $POList = array('PONO'=>$newPONO,'SupplierID' => $SupplierID, 'TotalOrderValue' => $TotalOrder, 'PODate' => $PODate, 'Status' => $POStatus, 'PORange' => $PoRange, 'ServiceDescription' => $SpcialInstruction, 'CreatedBy' => $CreateBy, 'DeliveryAddress' => $DeliveryAddr, 'Import_DispatchDetails' => $Dispatch, 'CreatedDate' => $createddt, 'DeliverySchedule' => $DeliverySchedule, 'DeliveryOption' => $DeliveryOption, 'ExchangeRate' => $Exchangerate, 'ExchangeRateCalculatedon' => $ExchangeRateCalculatedon, 'CurrencyType' => $CurrencyType, 'PaymentTerms' => $PaymentTerms, 'POType' => $POType, 'Import_PlaceofOrgin' => $Palaceoforigin, 'PaymentOtherDescription' => $OtherPayment, 'Mode_Of_Shipment' => $Shipmentmode, 'Supplier_Reference' => $SupplierRef, 'Supplier_Offer_No' => $SupplierOffer, 'Other_Reference' => $otherRef, 'Fincap' => $finCap, 'InsuranceStatus' => $Insurance, 'InsuranceNumber' => $Insurancenumber, 'POSubType' => $importoption, 'IsQualityChkReqired' => $Qualitycheck, 'BudgetType' => $BudgetType,'IsOpenOrder'=>$IsOpenOrder);
+ $POList = array('PONO'=>$newPONO,'SupplierID' => $SupplierID, 'TotalOrderValue' => $TotalOrder, 'PODate' => $PODate, 'Status' => $POStatus, 'PORange' => $PoRange, 'ServiceDescription' => $SpcialInstruction, 'CreatedBy' => $CreateBy, 'DeliveryAddress' => $DeliveryAddr, 'Import_DispatchDetails' => $Dispatch, 'CreatedDate' => $createddt, 'DeliverySchedule' => $DeliverySchedule, 'DeliveryOption' => $DeliveryOption, 'ExchangeRate' => $Exchangerate, 'ExchangeRateCalculatedon' => $ExchangeRateCalculatedon, 'CurrencyType' => $CurrencyType, 'PaymentTerms' => $PaymentTerms, 'POType' => $POType, 'Import_PlaceofOrgin' => $Palaceoforigin, 'PaymentOtherDescription' => $OtherPayment, 'Mode_Of_Shipment' => $Shipmentmode, 'Supplier_Reference' => $SupplierRef, 'Supplier_Offer_No' => $SupplierOffer, 'Other_Reference' => $otherRef, 'Fincap' => $finCap, 'InsuranceStatus' => $Insurance, 'InsuranceNumber' => $InsuranceNumber, 'POSubType' => $importoption, 'IsQualityChkReqired' => $Qualitycheck, 'BudgetType' => $BudgetType,'IsOpenOrder'=>$IsOpenOrder);
//print_r($POList);
//die();
@@ -2142,10 +2141,10 @@ $mpdf->use_kwt = true;
if ($Insurance == 'YES') {
- $Insurancenumber = $this->request->getPost('insurancenumber');
+ $InsuranceNumber = $this->request->getPost('InsuranceNumber');
$insurestatus = '1';
} else {
- $Insurancenumber = '';
+ $InsuranceNumber = '';
$insurestatus = '0';
}
// PO Master
@@ -2154,7 +2153,13 @@ $mpdf->use_kwt = true;
$Qualitycheck = 1;
- $POList = array('SupplierID' => $SupplierID, 'TotalOrderValue' => $TotalOrder, 'PODate' => $PODate, 'Status' => $POStatus, 'ServiceDescription' => $SpcialInstruction, 'CreatedBy' => $CreateBy, 'DeliveryAddress' => $DeliveryAddr, 'Import_DispatchDetails' => $Dispatch, 'DeliverySchedule' => $DeliverySchedule, 'DeliveryOption' => $DeliveryOption, 'ExchangeRate' => $Exchangerate, 'ExchangeRateCalculatedon' => $ExchangeRateCalculatedon, 'CurrencyType' => $CurrencyType, 'PaymentTerms' => $PaymentTerms, 'POType' => $POType, 'Import_PlaceofOrgin' => $Palaceoforigin, 'PaymentOtherDescription' => $OtherPayment, 'Mode_Of_Shipment' => $Shipmentmode, 'Supplier_Reference' => $SupplierRef, 'Supplier_Offer_No' => $SupplierOffer, 'Other_Reference' => $otherRef, 'Fincap' => $finCap, 'InsuranceStatus' => $insurestatus, 'InsuranceNumber' => $Insurancenumber, 'POSubType' => $importoption, 'IsQualityChkReqired' => $Qualitycheck, 'BudgetType' => $BudgetType);
+ $POList = array('SupplierID' => $SupplierID, 'TotalOrderValue' => $TotalOrder, 'PODate' => $PODate, 'Status' => $POStatus, 'ServiceDescription' => $SpcialInstruction, 'CreatedBy' => $CreateBy, 'DeliveryAddress' => $DeliveryAddr, 'Import_DispatchDetails' => $Dispatch, 'DeliverySchedule' => $DeliverySchedule, 'DeliveryOption' => $DeliveryOption, 'ExchangeRate' => $Exchangerate, 'ExchangeRateCalculatedon' => $ExchangeRateCalculatedon, 'CurrencyType' => $CurrencyType, 'PaymentTerms' => $PaymentTerms, 'POType' => $POType, 'Import_PlaceofOrgin' => $Palaceoforigin, 'PaymentOtherDescription' => $OtherPayment, 'Mode_Of_Shipment' => $Shipmentmode, 'Supplier_Reference' => $SupplierRef, 'Supplier_Offer_No' => $SupplierOffer, 'Other_Reference' => $otherRef, 'Fincap' => $finCap, 'InsuranceStatus' => $insurestatus, 'InsuranceNumber' => $InsuranceNumber, 'POSubType' => $importoption, 'IsQualityChkReqired' => $Qualitycheck, 'BudgetType' => $BudgetType);
+ if ($POStatus == 'ST026') {
+ $POList['ApprovedOn'] = get_current_date_time();
+ $POList['ApprovedBy'] = $this->session->get('userId');
+ $POList['ReleasedOn'] = get_current_date_time();
+ $POList['ReleasedBy'] = $this->session->get('userId');
+ }
//echo $PONO;
//echo $TotalOrder;
//print_r($POList);
@@ -2537,7 +2542,7 @@ $mpdf->use_kwt = true;
$OtherReferences = $this->request->getPost('addotherreference');
$Fincap = $this->request->getPost('addfincap');
$InsuranceOptions = $this->request->getPost('insuranceStatus');
- $InsuranceNo = $this->request->getPost('insuranceNo');
+ $InsuranceNumber = $this->request->getPost('InsuranceNumber');
$ServiceTypeOptions = $this->request->getPost('PoTypeOptions');
$PaymentMethod = $this->request->getPost('PaymentMethod');
@@ -2570,7 +2575,7 @@ $mpdf->use_kwt = true;
$lastPONO = $this->purchaseorder_model->lastPONO();
$newPONO = generate_po_number($lastPONO);
- $POList = array('PONO'=>$newPONO,'SupplierID' => $SupplierID, 'TotalOrderValue' => $TotalOrder, 'PODate' => $PODate, 'Status' => $POStatus, 'PORange' => $PoRange, 'ExchangeRateCalculatedon' => $ExchangeRateOn, 'ExchangeRate' => $ExchangeRate, 'PaymentTerms' => $PaymentMethod, 'ServiceDescription' => $SpcialInstruction, 'CreatedBy' => $CreateBy, 'DeliveryAddress' => $DeliveryAddr, 'CreatedDate' => $createddt, 'DeliverySchedule' => $DeliverySchedule, 'DeliveryOption' => $DeliveryOption, 'CapitalRange' => $CapitalRange, 'POType' => $POType, 'CurrencyType' => $currencytypeID, 'DeliverySchedule' => $DeliverySchedule, 'Import_PlaceofOrgin' => $Palaceoforigin, 'Import_DispatchDetails' => $Dispatch, 'DeliveryDate' => $Deliverydt, 'PaymentOtherDescription' => $OtherPayment, 'Supplier_Reference' => $SupplierReference, 'Mode_Of_Shipment' => $ModeOfShipment, 'Supplier_Offer_No' => $SuppliersOfferNo, 'Other_Reference' => $OtherReferences, 'Fincap' => $Fincap, 'InsuranceStatus' => $InsuranceOptions, 'InsuranceNumber' => $InsuranceNo, 'POSubType' => $ServiceTypeOptions, 'IsQualityChkReqired' => $Qualitycheck, 'BudgetType' => $BudgetType,'IsOpenOrder'=>$IsOpenOrder);
+ $POList = array('PONO'=>$newPONO,'SupplierID' => $SupplierID, 'TotalOrderValue' => $TotalOrder, 'PODate' => $PODate, 'Status' => $POStatus, 'PORange' => $PoRange, 'ExchangeRateCalculatedon' => $ExchangeRateOn, 'ExchangeRate' => $ExchangeRate, 'PaymentTerms' => $PaymentMethod, 'ServiceDescription' => $SpcialInstruction, 'CreatedBy' => $CreateBy, 'DeliveryAddress' => $DeliveryAddr, 'CreatedDate' => $createddt, 'DeliverySchedule' => $DeliverySchedule, 'DeliveryOption' => $DeliveryOption, 'CapitalRange' => $CapitalRange, 'POType' => $POType, 'CurrencyType' => $currencytypeID, 'DeliverySchedule' => $DeliverySchedule, 'Import_PlaceofOrgin' => $Palaceoforigin, 'Import_DispatchDetails' => $Dispatch, 'DeliveryDate' => $Deliverydt, 'PaymentOtherDescription' => $OtherPayment, 'Supplier_Reference' => $SupplierReference, 'Mode_Of_Shipment' => $ModeOfShipment, 'Supplier_Offer_No' => $SuppliersOfferNo, 'Other_Reference' => $OtherReferences, 'Fincap' => $Fincap, 'InsuranceStatus' => $InsuranceOptions, 'InsuranceNumber' => $InsuranceNumber, 'POSubType' => $ServiceTypeOptions, 'IsQualityChkReqired' => $Qualitycheck, 'BudgetType' => $BudgetType,'IsOpenOrder'=>$IsOpenOrder);
// $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'Import_DispatchDetails'=>$Dispatch,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ExchangeRate'=>$Exchangerate,'ExchangeRateCalculatedon'=>$ExchangeRateCalculatedon,'CurrencyType'=>$CurrencyType,'PaymentTerms'=>$PaymentTerms,'POType'=>$POType,'Import_PlaceofOrgin'=>$Palaceoforigin);
@@ -2803,7 +2808,7 @@ $mpdf->use_kwt = true;
$OtherReferences = $this->request->getPost('editotherreference');
$Fincap = $this->request->getPost('editfincap');
$InsuranceOptions = $this->request->getPost('insuranceStatus');
- $InsuranceNo = $this->request->getPost('insuranceNo');
+ $InsuranceNumber = $this->request->getPost('InsuranceNumber');
$ServiceTypeOptions = $this->request->getPost('PoTypeOptions');
$BudgetType = $this->request->getPost('Budget');
@@ -2822,8 +2827,13 @@ $mpdf->use_kwt = true;
$Qualitycheck = 1;
- $POList = array('SupplierID' => $SupplierID, 'TotalOrderValue' => $TotalOrder, 'PODate' => $PODate, 'Status' => $POStatus, 'PORange' => $PoRange, 'ExchangeRate' => $ExchangeRate, 'ExchangeRateCalculatedon' => $ExchangeRateOn, 'PaymentTerms' => $PaymentMethod, 'ServiceDescription' => $SpcialInstruction, 'CreatedBy' => $CreateBy, 'DeliveryAddress' => $DeliveryAddr, 'CreatedDate' => $createddt, 'DeliverySchedule' => $DeliverySchedule, 'DeliveryOption' => $DeliveryOption, 'CurrencyType' => $currencytypeID, 'DeliverySchedule' => $DeliverySchedule, 'Import_PlaceofOrgin' => $Palaceoforigin, 'Import_DispatchDetails' => $Dispatch, 'DeliveryDate' => $Deliverydt, 'PaymentOtherDescription' => $OtherPayment, 'Supplier_Reference' => $SupplierReference, 'Mode_Of_Shipment' => $ModeOfShipment, 'Supplier_Offer_No' => $SuppliersOfferNo, 'Other_Reference' => $OtherReferences, 'Fincap' => $Fincap, 'InsuranceStatus' => $InsuranceOptions, 'InsuranceNumber' => $InsuranceNo, 'POSubType' => $ServiceTypeOptions, 'IsQualityChkReqired' => $Qualitycheck, 'BudgetType' => $BudgetType);
-
+ $POList = array('SupplierID' => $SupplierID, 'TotalOrderValue' => $TotalOrder, 'PODate' => $PODate, 'Status' => $POStatus, 'PORange' => $PoRange, 'ExchangeRate' => $ExchangeRate, 'ExchangeRateCalculatedon' => $ExchangeRateOn, 'PaymentTerms' => $PaymentMethod, 'ServiceDescription' => $SpcialInstruction, 'CreatedBy' => $CreateBy, 'DeliveryAddress' => $DeliveryAddr, 'CreatedDate' => $createddt, 'DeliverySchedule' => $DeliverySchedule, 'DeliveryOption' => $DeliveryOption, 'CurrencyType' => $currencytypeID, 'DeliverySchedule' => $DeliverySchedule, 'Import_PlaceofOrgin' => $Palaceoforigin, 'Import_DispatchDetails' => $Dispatch, 'DeliveryDate' => $Deliverydt, 'PaymentOtherDescription' => $OtherPayment, 'Supplier_Reference' => $SupplierReference, 'Mode_Of_Shipment' => $ModeOfShipment, 'Supplier_Offer_No' => $SuppliersOfferNo, 'Other_Reference' => $OtherReferences, 'Fincap' => $Fincap, 'InsuranceStatus' => $InsuranceOptions, 'InsuranceNumber' => $InsuranceNumber, 'POSubType' => $ServiceTypeOptions, 'IsQualityChkReqired' => $Qualitycheck, 'BudgetType' => $BudgetType);
+ if ($POStatus == 'ST026') {
+ $POList['ApprovedOn'] = get_current_date_time();
+ $POList['ApprovedBy'] = $this->session->get('userId');
+ $POList['ReleasedOn'] = get_current_date_time();
+ $POList['ReleasedBy'] = $this->session->get('userId');
+ }
$POMaster = $this->purchaseorder_model->updatePOMaster($PONO, $POList);
diff --git a/app/Controllers/Servicepurchaseorder.php b/app/Controllers/Servicepurchaseorder.php
index 842503b3..6af4c29f 100644
--- a/app/Controllers/Servicepurchaseorder.php
+++ b/app/Controllers/Servicepurchaseorder.php
@@ -208,7 +208,7 @@ class Servicepurchaseorder extends BaseController
$OtherReferences = $this->request->getPost('addotherreference');
$Fincap = $this->request->getPost('addfincap');
$InsuranceOptions = $this->request->getPost('insuranceStatus');
- $InsuranceNo = $this->request->getPost('insuranceNo');
+ $InsuranceNumber = $this->request->getPost('InsuranceNumber');
$ServiceTypeOptions = $this->request->getPost('PoTypeOptions');
$DescriptionOfPo = $this->request->getPost('descofpo');
$PaymentTerms = $this->request->getPost('PaymentTerms');
@@ -232,12 +232,12 @@ class Servicepurchaseorder extends BaseController
$createddt = get_current_date_time();
$WorkStatus = $this->request->getPost('workstatus');
- $VaildUpto = ($this->request->getPost('VaildUpto') !== null && !empty($this->request->getPost('VaildUpto'))) ? $this->request->getPost('VaildUpto') : null;
$lastPONO = $this->purchaseorder_model->lastPONO();
$newPONO = generate_po_number($lastPONO);
+ $IsOpenOrder = ($this->request->getPost('IsOpenOrder') !== null && !empty($this->request->getPost('IsOpenOrder')) && $this->request->getPost('IsOpenOrder') === '1') ? $this->request->getPost('IsOpenOrder') : null;
// PO Master
- $POList = array('PONO'=>$newPONO,'SupplierID' => $SupplierID, 'TotalOrderValue' => $TotalOrderValueSummary, 'PODate' => $PODate, 'Status' => $POStatus, 'DeliverySchedule' => $DeliverySchedule, 'DeliveryOption' => $DeliveryOption, 'ServiceDescription' => $SpcialInstruction, 'CreatedBy' => $CreateBy, 'DeliveryAddress' => $DeliveryAddr, 'DeliveryDate' => $Deliverydt, 'CreatedDate' => $createddt, 'PaymentTerms' => $PaymentTerms, 'ServiceWorkStatus' => $WorkStatus, 'POType' => $POType, 'PaymentOtherDescription' => $OtherPayment, '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, 'BudgetType' => $BudgetType,'VaildUpto'=>$VaildUpto);
+ $POList = array('PONO'=>$newPONO,'SupplierID' => $SupplierID, 'TotalOrderValue' => $TotalOrderValueSummary, 'PODate' => $PODate, 'Status' => $POStatus, 'DeliverySchedule' => $DeliverySchedule, 'DeliveryOption' => $DeliveryOption, 'ServiceDescription' => $SpcialInstruction, 'CreatedBy' => $CreateBy, 'DeliveryAddress' => $DeliveryAddr, 'DeliveryDate' => $Deliverydt, 'CreatedDate' => $createddt, 'PaymentTerms' => $PaymentTerms, 'ServiceWorkStatus' => $WorkStatus, 'POType' => $POType, 'PaymentOtherDescription' => $OtherPayment, 'Supplier_Reference' => $SupplierReference, 'Mode_Of_Shipment' => $ModeOfShipment, 'Supplier_Offer_No' => $SuppliersOfferNo, 'Other_Reference' => $OtherReferences, 'Fincap' => $Fincap, 'Description_Of_Service' => $DescriptionOfPo, 'InsuranceStatus' => $InsuranceOptions, 'InsuranceNumber' => $InsuranceNumber, 'POSubType' => $ServiceTypeOptions, 'BudgetType' => $BudgetType,'IsOpenOrder'=>$IsOpenOrder);
$POMaster = $this->purchaseorder_model->addPOMaster($POList, $POType, $ServiceTypeOptions);
$PONO = $POMaster ? $newPONO : "";
@@ -352,7 +352,7 @@ class Servicepurchaseorder extends BaseController
$OtherReferences = $this->request->getPost('editotherreference');
$Fincap = $this->request->getPost('editfincap');
$InsuranceOptions = $this->request->getPost('insuranceStatus');
- $InsuranceNo = $this->request->getPost('insuranceNo');
+ $InsuranceNumber = $this->request->getPost('InsuranceNumber');
$ServiceTypeOptions = $this->request->getPost('PoTypeOptions');
$DescriptionOfPo = $this->request->getPost('editdescofpo');
@@ -377,12 +377,18 @@ class Servicepurchaseorder extends BaseController
$updateddt = get_current_date_time();
$WorkStatus = $this->request->getPost('workstatus');
- $VaildUpto = ($this->request->getPost('VaildUpto') !== null && !empty($this->request->getPost('VaildUpto'))) ? $this->request->getPost('VaildUpto') : null;
+ $IsOpenOrder = ($this->request->getPost('IsOpenOrder') !== null && !empty($this->request->getPost('IsOpenOrder')) && $this->request->getPost('IsOpenOrder') === '1') ? $this->request->getPost('IsOpenOrder') : null;
+
// $lastPONO = $this->purchaseorder_model->lastPONO();
// $newPONO = generate_po_number($lastPONO);
// PO Master
- $POList = array('SupplierID' => $SupplierID, 'TotalOrderValue' => $TotalOrderValueSummary, 'PODate' => $PODate, 'Status' => $POStatus, 'DeliverySchedule' => $DeliverySchedule, 'DeliveryOption' => $DeliveryOption, 'ServiceDescription' => $SpcialInstruction, 'UpdateBY' => $updatedBy, 'DeliveryAddress' => $DeliveryAddr, 'DeliveryDate' => $Deliverydt, 'UpdatedOn' => $updateddt, 'PaymentTerms' => $PaymentTerms, 'ServiceWorkStatus' => $WorkStatus, 'PaymentOtherDescription' => $OtherPayment, '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, 'BudgetType' => $BudgetType,'VaildUpto'=>$VaildUpto);
-
+ $POList = array('SupplierID' => $SupplierID, 'TotalOrderValue' => $TotalOrderValueSummary, 'PODate' => $PODate, 'Status' => $POStatus, 'DeliverySchedule' => $DeliverySchedule, 'DeliveryOption' => $DeliveryOption, 'ServiceDescription' => $SpcialInstruction, 'UpdateBY' => $updatedBy, 'DeliveryAddress' => $DeliveryAddr, 'DeliveryDate' => $Deliverydt, 'UpdatedOn' => $updateddt, 'PaymentTerms' => $PaymentTerms, 'ServiceWorkStatus' => $WorkStatus, 'PaymentOtherDescription' => $OtherPayment, 'Supplier_Reference' => $SupplierReference, 'Mode_Of_Shipment' => $ModeOfShipment, 'Supplier_Offer_No' => $SuppliersOfferNo, 'Other_Reference' => $OtherReferences, 'Fincap' => $Fincap, 'Description_Of_Service' => $DescriptionOfPo, 'InsuranceStatus' => $InsuranceOptions, 'InsuranceNumber' => $InsuranceNumber, 'POSubType' => $ServiceTypeOptions, 'BudgetType' => $BudgetType,'IsOpenOrder'=>$IsOpenOrder);
+ if ($POStatus == 'ST026') {
+ $POList['ApprovedOn'] = get_current_date_time();
+ $POList['ApprovedBy'] = $this->session->get('userId');
+ $POList['ReleasedOn'] = get_current_date_time();
+ $POList['ReleasedBy'] = $this->session->get('userId');
+ }
$POMaster = $this->purchaseorder_model->updatePOMaster($PONO, $POList);
diff --git a/app/Models/Inwardgateregister_model.php b/app/Models/Inwardgateregister_model.php
index 32db8135..61e97074 100755
--- a/app/Models/Inwardgateregister_model.php
+++ b/app/Models/Inwardgateregister_model.php
@@ -144,9 +144,9 @@ class Inwardgateregister_model extends Model
{
$builder = $this->db->table('T_PurchaseOrder_Master POM')
- ->distinct()->select('POM.PONO,POM.ServiceDescription,POM.DeliveryDate,sup.SupplierName,sup.Address,POM.status,OGR_Status,POM.PODate,POM.VaildUpto')
+ ->distinct()->select('POM.PONO,POM.ServiceDescription,POM.DeliveryDate,sup.SupplierName,sup.Address,POM.status,OGR_Status,POM.PODate,POM.IsOpenOrder')
->select("IF(POM.PODate IS NOT NULL, DATE_FORMAT(POM.PODate, '%Y-%m-%d'), NULL) AS formatted_PODate")
- ->select("IF(POM.VaildUpto IS NOT NULL, DATE_FORMAT(POM.VaildUpto, '%Y-%m-%d'), NULL) AS formatted_ValidUpto")
+ ->select("IF(POM.IsOpenOrder IS NOT NULL, POM.IsOpenOrder, '%Y-%m-%d'), NULL) AS formatted_IsOpenOrder")
->join('T_PurchaseOrder_LineItem POL', 'POL.PONO = POM.PONO')
->join('T_SupplierDetailsN sup', 'POM.SupplierID = sup.SupplierID')
->join('T_OGR_Master OGM ', 'POM.PONO = OGM.PONO_INV', 'left')
diff --git a/app/Views/EditservicePurchaseorder.php b/app/Views/EditservicePurchaseorder.php
index ee8ec107..44d767e1 100644
--- a/app/Views/EditservicePurchaseorder.php
+++ b/app/Views/EditservicePurchaseorder.php
@@ -32,7 +32,7 @@ $SuppliersOfferNo = '';
$OtherReferences = '';
$Fincap = '';
$InsuranceOptions = '';
-$InsuranceNo = '';
+$InsuranceNumber = '';
$ServiceTypeOptions = '';
$DescriptionOfPo = '';
$BudgetType = '';
@@ -77,13 +77,13 @@ if (!empty($POMaster)) {
$OtherReferences = $Req->Other_Reference;
$Fincap = $Req->Fincap;
$InsuranceOptions = $Req->InsuranceStatus;
- $InsuranceNo = $Req->InsuranceNumber;
+ $InsuranceNumber = $Req->InsuranceNumber;
$ServiceTypeOptions = $Req->POSubType;
$DescriptionOfPo = $Req->Description_Of_Service;
$BudgetType = $Req->BudgetType;
$IsOpenOrder = isset($Req->IsOpenOrder) ? $Req->IsOpenOrder : null;
- if ($IsOpenOrder !== null && $IsOpenOrder !== "") {
+ if ($IsOpenOrder !== null && (int)$IsOpenOrder !== 0) {
$isChecked = true;
} else {
$isChecked = false;
@@ -137,40 +137,12 @@ if (!empty($getlogpodtl)) {
\ No newline at end of file
diff --git a/app/Views/editRevenuepurchaseorder.php b/app/Views/editRevenuepurchaseorder.php
index ef4c5e02..d25d083d 100644
--- a/app/Views/editRevenuepurchaseorder.php
+++ b/app/Views/editRevenuepurchaseorder.php
@@ -79,7 +79,7 @@ if (!empty($POMaster)) {
$IsOpenOrder = isset($Req->IsOpenOrder) ? $Req->IsOpenOrder : null;
- if ($IsOpenOrder !== null && $IsOpenOrder !== "0000-00-00 00:00:00") {
+ if ($IsOpenOrder !== null && (int)$IsOpenOrder !== 0) {
$isChecked = true;
} else {
$isChecked = false;
@@ -98,12 +98,11 @@ if (!empty($POMaster)) {
$otherref = $Req->Other_Reference;
$fincap = $Req->Fincap;
$revenuesubtype = $Req->POSubType;
- $insurencestatus = $Req->InsuranceStatus;
+ $insurencestatus = (int)$Req->InsuranceStatus;
$insurenceno = $Req->InsuranceNumber;
$BudgetType = $Req->BudgetType;
$IGRNO = $Req->IGRNO;
- // echo $insurenceno;
// echo $otherPayment;
}
}
@@ -197,17 +196,11 @@ if (!empty($getlogpodtl)) {
readonly: 1
});
-
@@ -2091,11 +2084,11 @@ if (!empty($getlogpodtl)) {
-
-
+
+
'insuranceno', 'insuranceno' => set_value('insuranceno', $insurenceno), 'id' => 'insuranceno', 'class' => 'form-control', 'required' => 'true');
+ $data = array('name' => 'InsuranceNumber', 'InsuranceNumber' => set_value('InsuranceNumber', $insurenceno), 'id' => 'InsuranceNumber', 'class' => 'form-control', 'required' => 'true');
echo form_input($data);
?>
@@ -2345,17 +2338,12 @@ if (!empty($getlogpodtl)) {
@@ -3641,7 +3629,7 @@ if (!empty($getlogpodtl)) {
'txtSpcialInstruction', 'value' => set_value('txtSpcialInstruction', $ServiceDescription), 'id' => 'txtSpcialInstruction', 'class' => 'form-control');
+ $data = array('name' => 'txtSpcialInstruction', 'value' => set_value('txtSpcialInstruction', strip_tags($ServiceDescription)), 'id' => 'txtSpcialInstruction', 'class' => 'form-control');
echo form_textarea($data);
?>
@@ -3950,7 +3938,7 @@ if (!empty($getlogpodtl)) {
-
+
@@ -3960,10 +3948,11 @@ if (!empty($getlogpodtl)) {
+ if ($PONOStatus == PO_DRAFT) { ?>
Save
-
Submit
+
Submit
+
Approve and Release
Cancel
Submit
@@ -4770,6 +4759,8 @@ if (!empty($getlogpodtl)) {
stat = '';
} else if (status == '1') {
stat = '';
+ } else if (status == '4') {
+ stat = '';
}
else {
stat = '';
@@ -4804,8 +4795,8 @@ if (!empty($getlogpodtl)) {
alert('Please Enter Payable Terms Description');
$('#Otherpayment').focus();
return false;
- } else if ($('#insurancestatus').val() == 1 && $('#insuranceno').val() == '') {
- alert('Please Enter Insurance No..!');
+ } else if ($('#insurancestatus').val() == 1 && $('#InsuranceNumber').val() == '') {
+ alert('Please Enter Insurance No / Insurance Details..!');
$('#insurance').focus();
return false;
} else {
@@ -5228,11 +5219,11 @@ if (!empty($getlogpodtl)) {
var ans = $("#insurancestatus").val();
//alert(ans);
if (ans == 0) {
- $("#insurancenodiv").hide();
- //$("#insuranceno").val("");
+ $("#InsuranceNumberdiv").hide();
+ //$("#InsuranceNumber").val("");
} else {
- $("#insurancenodiv").show();
- $("#insuranceno").val("Yes");
+ $("#InsuranceNumberdiv").show();
+ $("#InsuranceNumber").val("Yes");
}
});
@@ -5469,9 +5460,9 @@ if (!empty($getlogpodtl)) {
}
\ No newline at end of file
diff --git a/app/Views/servicepo.php b/app/Views/servicepo.php
index 906f0a1f..64de71c2 100644
--- a/app/Views/servicepo.php
+++ b/app/Views/servicepo.php
@@ -99,7 +99,14 @@
-
+
diff --git a/public/assets/js/CreatePOValidation.js b/public/assets/js/CreatePOValidation.js
index 52c74094..c4869792 100644
--- a/public/assets/js/CreatePOValidation.js
+++ b/public/assets/js/CreatePOValidation.js
@@ -61,9 +61,9 @@ function validate()
$('#DeliveryAddr').focus();
return false;
}
- else if($('#insuranceStatus').val() == "1" && $('#insuranceNo').val().trim() == ''){
- alert('Please Enter the Insurance No');
- $('#insuranceNo').focus();
+ else if($('#insuranceStatus').val() == "1" && $('#InsuranceNumber').val().trim() == ''){
+ alert('Please Enter the Insurance No / Insurance Details');
+ $('#InsuranceNumber').focus();
return false;
}
diff --git a/public/assets/js/CreatePOValidation.js~ b/public/assets/js/CreatePOValidation.js~
deleted file mode 100644
index 0b7f04d4..00000000
--- a/public/assets/js/CreatePOValidation.js~
+++ /dev/null
@@ -1,205 +0,0 @@
-/**
-/**
- * File : CreatePOValidation.js
- *
- * This file contain the validation of edit Create Po
- *
- * @author Gandhimathi
- */
-$(document).ready(function(){
-
-
-
-
- //Initialize Select2 Elements
- $("#drpSupplier").select2();
-
-
-});
-function myFunction() {
-
- if(validate())
- {
- var input = $('#POType').val();
-
- $('#' + input).modal('show');
- }
-
-}
-function validate()
-{
- var PoType = $('#POType').val();
- var currencyType = $('#currencytype').val();
- if($('#PODate').val() == '')
- {
- alert('Please Enter the Purchase Order date');
- $('#PODate').focus();
- return false;
- }
- else if($('#drpSupplier').val() == "0")
- {
- alert('Please Select the Supplier details');
- $('#drpSupplier').focus();
- return false;
- }
- else if($('#DeliveryAddr').val() == '')
- {
- alert('Please Enter the Delivery Address');
- $('#DeliveryAddr').focus();
- return false;
- }
- else if($('#Deliverydt').val() == '' && $('#Scheduleby').val() == '')
- {
- alert('Please Enter the Delivery Date');
- $('#Deliverydt').focus();
- return false;
- }
- else if(PoType=='CAPITAL' && capitalType=='International'){
-
- if(currencyType=='0'){
- alert('Please Select the Currency Type');
- $('#currencytype').focus();
- return false;
-}
- else if($('#ExchangeRt').val()==''){
- alert('Please Enter the Exchange Rate');
- $('#ExchangeRt').focus();
- return false;
- }
- else{
- return true;
- }
-
-
- }
-
- else
- {
- return true;
- }
-}
-
-
-function validateRevenueTax()
- {
- if($('#ReqNo').val() == "0")
- {
- alert('Please select the Requisition Number');
- $('#ReqNo').focus();
- return false;
- }
- else if($('#CostCenter').val() == "0")
- {
- alert('Please select the Cost center');
- $('#CostCenter').focus();
- return false;
- }
- else if($('#MaterialCode').val() == "0")
- {
- alert('Please select the Material Code');
- $('#MaterialCode').focus();
- return false;
- }
- else if($('#Quantity').val() == '')
- {
- alert('Please Enter the Quantity value');
- $('#Quantity').focus();
- return false;
- }
- else if($('#Rate').val() == '')
- {
- alert('Please Enter the Rate of the Item');
- $('#Rate').focus();
- return false;
- }
- else
- {
- return true;
- }
- }
-
-function calculateTotalValue()
- {
- var Packaging = $('#txtAfterPackaging').val() == '' ? '0.00' : $('#txtAfterPackaging').val();
- var ExciseDuty = $('#txtAfterExciseDuty').val() == '' ? '0.00' : $('#txtAfterExciseDuty').val();
- var Vat = $('#txtAfterVat').val() == '' ? '0.00' : $('#txtAfterVat').val();
- var CST = $('#txtAfterCST').val() == '' ? '0.00' : $('#txtAfterCST').val();
- var GST = $('#txtAfterGST').val() == '' ? '0.00' : $('#txtAfterGST').val();
- var OtherTax = $('#txtAfterOtherTax').val() == '' ? '0.00' : $('#txtAfterOtherTax').val();
- var Freight = $('#txtAfterFreight').val() == '' ? '0.00' : $('#txtAfterFreight').val();
- var Insurance = $('#txtInsurance').val() == '' ? '0.00' : $('#txtInsurance').val();
- var Discount = $('#txtAfterDiscount').val() == '' ? '0.00' : $('#txtAfterDiscount').val();
- var BasicVal = $('#txtBasicValue').val() == '' ? '0.00' : $('#txtBasicValue').val();
-
- var totvalue = ( parseFloat(BasicVal) + parseFloat(Packaging)+ parseFloat(ExciseDuty)+ parseFloat(Vat) + parseFloat(CST)+ parseFloat(GST) + parseFloat(OtherTax) + parseFloat(Freight) + parseFloat(Insurance)) - parseFloat(Discount);
-
- var tot = parseFloat(totvalue).toFixed(2);
-
- $('#txtTotalOrderValue').val(tot);
-
- validateExceedLimit();
- ExceedQuantityCheck();
- }
-function calculateTaxValue()
- {
- var Packaging = $('#txtAfterPackaging').val() == '' ? '0.00' : $('#txtAfterPackaging').val();
- var ExciseDuty = $('#txtAfterExciseDuty').val() == '' ? '0.00' : $('#txtAfterExciseDuty').val();
- var Vat = $('#txtAfterVat').val() == '' ? '0.00' : $('#txtAfterVat').val();
- var CST = $('#txtAfterCST').val() == '' ? '0.00' : $('#txtAfterCST').val();
- var GST = $('#txtAfterGST').val() == '' ? '0.00' : $('#txtAfterGST').val();
- var OtherTax = $('#txtAfterOtherTax').val() == '' ? '0.00' : $('#txtAfterOtherTax').val();
- var Freight = $('#txtAfterFreight').val() == '' ? '0.00' : $('#txtAfterFreight').val();
- var Insurance = $('#txtInsurance').val() == '' ? '0.00' : $('#txtInsurance').val();
- var Discount = $('#txtAfterDiscount').val() == '' ? '0.00' : $('#txtAfterDiscount').val();
-
-
- var totvalue = ( parseFloat(Packaging)+ parseFloat(ExciseDuty)+ parseFloat(Vat) + parseFloat(CST)+ parseFloat(GST) + parseFloat(OtherTax) + parseFloat(Freight) + parseFloat(Insurance)) - parseFloat(Discount) ;
-
- var tot = parseFloat(totvalue).toFixed(2);
- //alert('tot:'+tot);
- return tot;
- }
-
-
- function validateExceedLimit()
- {
- var avalbudAmt = parseFloat($('#AvlBudAmt').val());
- var basicAmountRate = parseFloat($('#txtBasicValue').val());
- var totalAmount = parseFloat($('#txtTotalOrderValue').val());
-
- if(basicAmountRate > avalbudAmt || totalAmount > avalbudAmt)
- {
- alert('Basic amount is exceeding the Budget Limit.Please adjust the product value.');
- $('#Rate').focus();
- return false;
- }
- else
- {
- return true;
- }
-
- }
-
-
-function isNumberKey(evt)
- {
- var charCode = (evt.which) ? evt.which : evt.keyCode;
- if (charCode != 46 && charCode > 31
- && (charCode < 48 || charCode > 57))
- return false;
-
- return true;
- }
-function change(){
- ExceedQuantityCheck();
- if($('#Quantity').val() != '' && $('#Rate').val() != '')
- {
- var txtQuantity = parseFloat( $('#Quantity').val());
- var txtUnitPrice = parseFloat($('#Rate').val());
- var Tot = txtQuantity * txtUnitPrice
- $('#txtBasicValue').val(Tot);
- calculateTotalValue();
-
- }
-
-}