diff --git a/app/Controllers/Amendmentpurchaseorder.php b/app/Controllers/Amendmentpurchaseorder.php
index 4d154ed3..61d43ece 100755
--- a/app/Controllers/Amendmentpurchaseorder.php
+++ b/app/Controllers/Amendmentpurchaseorder.php
@@ -31,9 +31,8 @@ class Amendmentpurchaseorder extends BaseController
$this->costcenter_model = new Costcenter_model();
$this->session = session();
// $this->session = \CodeIgniter\Config\Factories::libraries('session');
- helper(['form']);
+ helper(['form']);
$this->isLoggedIn();
-
}
/**
@@ -210,7 +209,7 @@ class Amendmentpurchaseorder extends BaseController
*/
function EditRevenuePurchaseOrder()
{
-
+ // print_r($this->request->getPost());die;
$NewPO = '';
$MAD = '';
$PONO = $this->request->getPost('txtPONO');
@@ -232,12 +231,11 @@ class Amendmentpurchaseorder extends BaseController
$Deliverydt = get_date_time_format($dt);
$DeliverySchedule = '';
}
-
$Modeofshipment = $this->request->getPost('addmodeofshipment');
$supplierreference = $this->request->getPost('amendsupplierreference');
$supplieroffno = $this->request->getPost('amendsupplierofferno');
$otherreference = $this->request->getPost('amendotherreference');
- $fincap = "";//$this->request->getPost('amendfincap');
+ $fincap = ""; //$this->request->getPost('amendfincap');
$revenuetype = $this->request->getPost('PoTypeOptions');
$insurancestatus = $this->request->getPost('insurancestatus');
if ($insurancestatus == 1) {
@@ -289,31 +287,39 @@ class Amendmentpurchaseorder extends BaseController
}
$AmendmentNewPoNo = generate_amendment_po_number($PONO);
- $POMaster = array('PONO' =>$AmendmentNewPoNo,'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);
+ $POMaster = array('PONO' => $AmendmentNewPoNo, '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);
$file = $this->request->getFile('POFile');
$requestfilename = $file->getName();
- $PrePOFile = $this->request->getPost('PrePOFile');
+ $PrePOFile = $this->request->getPost('PrePOFile');
if (!empty($requestfilename)) {
if ($file && $file->isValid() && !$file->hasMoved()) {
- $path = ROOTPATH.'public/uploads/POfiles/';
- if(!is_dir($path)) { mkdir($path, 0777, true); }
- if (!empty($this->purchaseorder_model->isFileExists($requestfilename))) {
- log_message('error', 'File already exists in the database'.$requestfilename);
- $POMaster['POFile'] = $PrePOFile ? $PrePOFile : null;
- }
- else{
- $file->move($path, $requestfilename);
- $POMaster['POFile'] = $requestfilename;
- }
- }else{
- $POMaster['POFile'] = $PrePOFile ? $PrePOFile : null;
+ $path = ROOTPATH . 'public/uploads/POfiles/';
+ if (!is_dir($path)) {
+ mkdir($path, 0777, true);
+ }
+ if (!empty($this->purchaseorder_model->isFileExists($requestfilename))) {
+ log_message('error', 'File already exists in the database' . $requestfilename);
+ $POMaster['POFile'] = $PrePOFile ? $PrePOFile : null;
+ } else {
+ $file->move($path, $requestfilename);
+ $POMaster['POFile'] = $requestfilename;
+ }
+ } else {
+ $POMaster['POFile'] = $PrePOFile ? $PrePOFile : null;
+ }
+ } else {
+ $POMaster['POFile'] = $PrePOFile ? $PrePOFile : null;
+ }
+ // print_r($POMaster);die;
+
+ $LastPO = $this->purchaseorder_model->addAmendPOMaster($POMaster, $updatedBy, $PONO);
+ // dd($LastPO);
+ if(!empty($LastPO)){
+ if (count($LastPO) > 0) {
+ $NewPO = $LastPO[0]['PONO'];
}
}else{
- $POMaster['POFile'] = $PrePOFile ? $PrePOFile : null;
- }
- $LastPO = $this->purchaseorder_model->addAmendPOMaster($POMaster, $updatedBy, $PONO);
- if (count($LastPO) > 0) {
- $NewPO = $LastPO[0]['PONO'];
+ $NewPO = "";
}
$PODetail = array('Status' => PO_AMENDED); //TO SET PARENT PO AS AMENDMENT STATUS
@@ -611,7 +617,7 @@ class Amendmentpurchaseorder extends BaseController
$SupplierReference = $this->request->getPost('amendsupplierreference');
$SuppliersOfferNo = $this->request->getPost('amendsupplierofferno');
$OtherReferences = $this->request->getPost('amendotherreference');
- $Fincap = "";//$this->request->getPost('amendfincap');
+ $Fincap = ""; //$this->request->getPost('amendfincap');
$InsuranceOptions = $this->request->getPost('insuranceStatus');
$InsuranceNumber = $this->request->getPost('InsuranceNumber');
$ServiceTypeOptions = $this->request->getPost('PoTypeOptions');
@@ -623,7 +629,7 @@ class Amendmentpurchaseorder extends BaseController
$updatedBy = $this->session->get('userId');
$RowCount = $this->request->getPost('txtRowCount');
-
+
$updateddt = get_current_date_time();
$WorkStatus = $this->request->getPost('workstatus');
@@ -642,27 +648,28 @@ class Amendmentpurchaseorder extends BaseController
}
$AmendmentNewPoNo = generate_amendment_po_number($PONO);
- $POMaster = array('PONO' =>$AmendmentNewPoNo,'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' => strip_tags((string)$DescriptionOfPo), 'InsuranceStatus' => $InsuranceOptions, 'InsuranceNumber' => $InsuranceNumber, 'POSubType' => $ServiceTypeOptions, 'IsQualityChkReqired' => $qtycheckresult);
+ $POMaster = array('PONO' => $AmendmentNewPoNo, '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' => strip_tags((string)$DescriptionOfPo), 'InsuranceStatus' => $InsuranceOptions, 'InsuranceNumber' => $InsuranceNumber, 'POSubType' => $ServiceTypeOptions, 'IsQualityChkReqired' => $qtycheckresult);
$file = $this->request->getFile('POFile');
$PrePOFile = $this->request->getPost('PrePOFile');
- $requestfilename = $file->getName();
+ $requestfilename = $file->getName();
if (!empty($requestfilename)) {
- if ($file && $file->isValid() && !$file->hasMoved()) {
- $path = ROOTPATH.'public/uploads/POfiles/';
- if(!is_dir($path)) { mkdir($path, 0777, true); }
- if (!empty($this->purchaseorder_model->isFileExists($requestfilename))) {
- log_message('error', 'File already exists in the database'.$requestfilename);
- $POMaster['POFile'] = $PrePOFile ? $PrePOFile : null;
- }
- else{
- $file->move($path, $requestfilename);
- $POMaster['POFile'] = $requestfilename;
- }
- }else{
- $POMaster['POFile'] = $PrePOFile ? $PrePOFile : null;
- }
- }else{
- $POMaster['POFile'] = $PrePOFile ? $PrePOFile : null;
+ if ($file && $file->isValid() && !$file->hasMoved()) {
+ $path = ROOTPATH . 'public/uploads/POfiles/';
+ if (!is_dir($path)) {
+ mkdir($path, 0777, true);
+ }
+ if (!empty($this->purchaseorder_model->isFileExists($requestfilename))) {
+ log_message('error', 'File already exists in the database' . $requestfilename);
+ $POMaster['POFile'] = $PrePOFile ? $PrePOFile : null;
+ } else {
+ $file->move($path, $requestfilename);
+ $POMaster['POFile'] = $requestfilename;
+ }
+ } else {
+ $POMaster['POFile'] = $PrePOFile ? $PrePOFile : null;
+ }
+ } else {
+ $POMaster['POFile'] = $PrePOFile ? $PrePOFile : null;
}
$LastPO = $this->purchaseorder_model->addAmendPOMaster($POMaster, $updatedBy, $PONO);
@@ -892,7 +899,7 @@ class Amendmentpurchaseorder extends BaseController
$SupplierReference = $this->request->getPost('amendsupplierreference');
$SuppliersOfferNo = $this->request->getPost('amendsupplierofferno');
$OtherReferences = $this->request->getPost('amendotherreference');
- $Fincap = "";//$this->request->getPost('amendfincap');
+ $Fincap = ""; //$this->request->getPost('amendfincap');
$InsuranceOptions = $this->request->getPost('insuranceStatus');
$InsuranceNumber = $this->request->getPost('InsuranceNumber');
$ServiceTypeOptions = $this->request->getPost('PoTypeOptions');
@@ -962,32 +969,33 @@ class Amendmentpurchaseorder extends BaseController
}
$updatedBy = $this->session->get('userId');
$AmendmentNewPoNo = generate_amendment_po_number($PONO);
- $POMaster = array('PONO' =>$AmendmentNewPoNo,'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);
+ $POMaster = array('PONO' => $AmendmentNewPoNo, '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);
$file = $this->request->getFile('POFile');
- $requestfilename = $file->getName();
+ $requestfilename = $file->getName();
$PrePOFile = $this->request->getPost('PrePOFile');
if (!empty($requestfilename)) {
- if ($file && $file->isValid() && !$file->hasMoved()) {
- $path = ROOTPATH.'public/uploads/POfiles/';
- if(!is_dir($path)) { mkdir($path, 0777, true); }
- if (!empty($this->purchaseorder_model->isFileExists($requestfilename))) {
- log_message('error', 'File already exists in the database'.$requestfilename);
- $POMaster['POFile'] = $PrePOFile ? $PrePOFile : null;
- }
- else{
- $file->move($path, $requestfilename);
- $POMaster['POFile'] = $requestfilename;
- }
- }else{
- $POMaster['POFile'] = $PrePOFile ? $PrePOFile : null;
- }
- }else{
- $POMaster['POFile'] = $PrePOFile ? $PrePOFile : null;
+ if ($file && $file->isValid() && !$file->hasMoved()) {
+ $path = ROOTPATH . 'public/uploads/POfiles/';
+ if (!is_dir($path)) {
+ mkdir($path, 0777, true);
+ }
+ if (!empty($this->purchaseorder_model->isFileExists($requestfilename))) {
+ log_message('error', 'File already exists in the database' . $requestfilename);
+ $POMaster['POFile'] = $PrePOFile ? $PrePOFile : null;
+ } else {
+ $file->move($path, $requestfilename);
+ $POMaster['POFile'] = $requestfilename;
+ }
+ } else {
+ $POMaster['POFile'] = $PrePOFile ? $PrePOFile : null;
+ }
+ } else {
+ $POMaster['POFile'] = $PrePOFile ? $PrePOFile : null;
}
-
+
$LastPO = $this->purchaseorder_model->addAmendPOMaster($POMaster, $CreateBy, $PONO);
-
+
if (count($LastPO) > 0) {
$NewPO = $LastPO[0]['PONO'];
}
@@ -1309,11 +1317,11 @@ class Amendmentpurchaseorder extends BaseController
$CreateBy = $this->session->get('userId');
$RowCount = $this->request->getPost('txtRowCount');
-
+
$createddt = get_current_date_time();
$updateddt = get_current_date_time();
-
+
$PaymentTerms = $this->request->getPost('PaymentTerms');
$beforePaymentTerms = $this->request->getPost('beforePaymentterms');
@@ -1322,7 +1330,7 @@ class Amendmentpurchaseorder extends BaseController
$SupplierRef = $this->request->getPost('amendsupplierreference');
$SupplierOffer = $this->request->getPost('amendsupplierofferno');
$otherRef = $this->request->getPost('amendotherreference');
- $finCap = "";//$this->request->getPost('amendfincap');
+ $finCap = ""; //$this->request->getPost('amendfincap');
$OtherPayment = $this->request->getPost('Otherpayment');
@@ -1358,36 +1366,37 @@ class Amendmentpurchaseorder extends BaseController
$MAD .= $MAD . "Current Place of Origin: " . $beforePalaceoforigin . "
";
}
$AmendmentNewPoNo = generate_amendment_po_number($PONO);
- $POMaster = array('PONO' =>$AmendmentNewPoNo,'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('PONO' => $AmendmentNewPoNo, '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);
$file = $this->request->getFile('POFile');
- $requestfilename = $file->getName();
+ $requestfilename = $file->getName();
$PrePOFile = $this->request->getPost('PrePOFile');
if (!empty($requestfilename)) {
- if ($file && $file->isValid() && !$file->hasMoved()) {
- $path = ROOTPATH.'public/uploads/POfiles/';
- if(!is_dir($path)) { mkdir($path, 0777, true); }
- if (!empty($this->purchaseorder_model->isFileExists($requestfilename))) {
- log_message('error', 'File already exists in the database'.$requestfilename);
- $POMaster['POFile'] = $PrePOFile ? $PrePOFile : null;
- }
- else{
- $file->move($path, $requestfilename);
- $POMaster['POFile'] = $requestfilename;
- }
- }else{
- $POMaster['POFile'] = $PrePOFile ? $PrePOFile : null;
- }
- }else{
- $POMaster['POFile'] = $PrePOFile ? $PrePOFile : null;
+ if ($file && $file->isValid() && !$file->hasMoved()) {
+ $path = ROOTPATH . 'public/uploads/POfiles/';
+ if (!is_dir($path)) {
+ mkdir($path, 0777, true);
+ }
+ if (!empty($this->purchaseorder_model->isFileExists($requestfilename))) {
+ log_message('error', 'File already exists in the database' . $requestfilename);
+ $POMaster['POFile'] = $PrePOFile ? $PrePOFile : null;
+ } else {
+ $file->move($path, $requestfilename);
+ $POMaster['POFile'] = $requestfilename;
+ }
+ } else {
+ $POMaster['POFile'] = $PrePOFile ? $PrePOFile : null;
+ }
+ } else {
+ $POMaster['POFile'] = $PrePOFile ? $PrePOFile : null;
}
$LastPO = $this->purchaseorder_model->addAmendPOMaster($POMaster, $CreateBy, $PONO);
$NewPO = '';
// if (count($LastPO) > 0) {
// $NewPO = $LastPO[0]['PONO'];
// }
- foreach ($LastPO as $PO) :
- $NewPO = $PO['PONO'];
- endforeach;
+ foreach ($LastPO as $PO) :
+ $NewPO = $PO['PONO'];
+ endforeach;
$PODetail = array('Status' => PO_AMENDED); //TO SET PARENT PO AS AMENDMENT STATUS
$APO = $this->purchaseorder_model->updateAmendPOMaster($PONO, $PODetail);
@@ -1635,5 +1644,4 @@ class Amendmentpurchaseorder extends BaseController
echo 'Purchase Order is' . $PONO . 'Amended Successfully! New PO Number is: ' . $NewPO;
}
-
}
diff --git a/app/Controllers/Inwardgateregister.php b/app/Controllers/Inwardgateregister.php
index f7094784..d99a697b 100755
--- a/app/Controllers/Inwardgateregister.php
+++ b/app/Controllers/Inwardgateregister.php
@@ -321,9 +321,9 @@ class Inwardgateregister extends BaseController
$IsThisOpenOrderPO = $this->request->getPost('hiddenIsOpenOrder');
$DeliveryChellanOrInvoiceNo = $this->request->getPost('InvoiceNo');
$DeliveryChellan = (string)$this->request->getPost('InvoiceDate');
- $DeliveryChellanDate = get_date_time_format($DeliveryChellan);
+ $DeliveryChellanDate = get_date_time_format_new($DeliveryChellan);
$Mat_Rcvd_Dt = (string)$this->request->getPost('MaterialRcvdDate');
- $MaterialRcvdDt = get_date_time_format($Mat_Rcvd_Dt);
+ $MaterialRcvdDt = get_date_time_format_new($Mat_Rcvd_Dt);
$VehicleNo = $this->request->getPost('VehicleNo');
$TransporterId = $this->request->getPost('TransporterId');
$DriverName = $this->request->getPost('DriverName');
diff --git a/app/Controllers/Purchaseorder.php b/app/Controllers/Purchaseorder.php
index 83c8101b..5624d679 100755
--- a/app/Controllers/Purchaseorder.php
+++ b/app/Controllers/Purchaseorder.php
@@ -634,7 +634,8 @@ class Purchaseorder extends BaseController
//$data['WorkStatus']=$this->purchaseorder_model->GetWorkStatus('C019');
$data['WorkStatus'] = $this->purchaseorder_model->getStatus(7);
- //print_r($data);die;
+ // echo "
";
+ // print_r($data);die;
$this->global['pageTitle'] = 'Edit Service Purchase order form';
$this->loadViews("EditservicePurchaseorder", $this->global, $data, NULL);
} else if ($ReqType == REVENUE) {
@@ -1212,6 +1213,8 @@ class Purchaseorder extends BaseController
//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);
diff --git a/app/Controllers/Servicepurchaseorder.php b/app/Controllers/Servicepurchaseorder.php
index 3384985b..5e3843aa 100755
--- a/app/Controllers/Servicepurchaseorder.php
+++ b/app/Controllers/Servicepurchaseorder.php
@@ -347,6 +347,7 @@ class Servicepurchaseorder extends BaseController
$newSupId = preg_split('[-]', (string)$newsup);
$POdt = $this->request->getPost('PODate');
+ // print_r($this->request->getPost());die;
$PODate = get_date_time_format($POdt);
/*-----------------------------------*/
$b4supplier = $this->request->getPost('b4supplier');
diff --git a/app/Helpers/datetime_helper.php b/app/Helpers/datetime_helper.php
index eae19f04..6b5e8772 100755
--- a/app/Helpers/datetime_helper.php
+++ b/app/Helpers/datetime_helper.php
@@ -26,12 +26,20 @@ if (!function_exists('get_current_date')) {
if (!function_exists('get_date_time_format')) {
function get_date_time_format($val)
{
- $date = new \DateTime($val, new \DateTimeZone('Asia/Kolkata'));
+ $date = new \DateTime($val, timezone: new \DateTimeZone('Asia/Kolkata'));
return $date->format('Y-m-d H:i:s');
}
}
+if (!function_exists('get_date_time_format_new')) {
+ function get_date_time_format_new($val)
+ {
+ $date = \DateTime::createFromFormat('d/m/Y', $val, new \DateTimeZone('Asia/Kolkata'));
+ return $date->format('Y-m-d H:i:s');
+ }
+}
+
if (!function_exists('get_date_format')) {
function get_date_format($DateValue)
{
diff --git a/app/Models/Monthlypay_model.php b/app/Models/Monthlypay_model.php
index 82fa5014..bfdb24f9 100755
--- a/app/Models/Monthlypay_model.php
+++ b/app/Models/Monthlypay_model.php
@@ -39,7 +39,7 @@ class Monthlypay_model extends Model
// $this->db->where('t_employee_details.DateofJoining <=',$lastdate);
// $this->db->where('Month_Year',$current);
- $sql = "select t_monthly_pay_inputs.*,t_employee_details.FirstName,t_employee_details.LastName,t_loan_master.Loan_ID,t_loan_master.Monthly_Due,t_payroll.Key
+ $sql = "select t_monthly_pay_inputs.*,t_employee_details.FirstName,t_employee_details.LastName,t_loan_master.Loan_ID,t_loan_master.Monthly_Due,t_payroll.Id
from t_monthly_pay_inputs
left join t_employee_details on t_monthly_pay_inputs.EmpID=t_employee_details.EmpID and t_employee_details.DateofJoining <= ?
left join t_payroll on t_monthly_pay_inputs.EmpID=t_payroll.EmpID
@@ -100,7 +100,7 @@ class Monthlypay_model extends Model
//echo $lastdate;
//left join t_payroll on t_employee_details.EmpID = t_payroll.EmpID and month(t_payroll.PayOn) = month(?) and year(t_payroll.PayOn) = year(?)
- $sql = "select t_emp_pay_data.EmpID,t_emp_pay_data.*,t_employee_details.FirstName,t_employee_details.DateofJoining,t_employee_details.Designation,t_employee_details.esi_applicable,t_employee_details.pf_applicable,t_employee_details.is_management_team,t_attendance.Days_Worked as Days_worked,t_attendance.Absent as LOP_Days,t_attendance.Paid_Leave as Paid_leave,t_attendance.Total_OTHrs as OT_Hrs_Worked,t_attendance.NoofDays,t_attendance.sunday_count,t_loan_master.Loan_ID,t_loan_master.Monthly_Due,t_loan_master.Due_Start_Date as DueDate,t_loan_master.Loan_Amount,t_loan_master.Paid_Amount,t_payroll.Key,t_monthly_pay_inputs.Loan_Recovered,t_monthly_pay_inputs.Estimate,t_monthly_pay_inputs.Festival_Bonus,t_monthly_pay_inputs.Other_Deductions,t_loan_history .Balance_Amount
+ $sql = "select t_emp_pay_data.EmpID,t_emp_pay_data.*,t_employee_details.FirstName,t_employee_details.DateofJoining,t_employee_details.Designation,t_employee_details.esi_applicable,t_employee_details.pf_applicable,t_employee_details.is_management_team,t_attendance.Days_Worked as Days_worked,t_attendance.Absent as LOP_Days,t_attendance.Paid_Leave as Paid_leave,t_attendance.Total_OTHrs as OT_Hrs_Worked,t_attendance.NoofDays,t_attendance.sunday_count,t_loan_master.Loan_ID,t_loan_master.Monthly_Due,t_loan_master.Due_Start_Date as DueDate,t_loan_master.Loan_Amount,t_loan_master.Paid_Amount,t_payroll.Id,t_monthly_pay_inputs.Loan_Recovered,t_monthly_pay_inputs.Estimate,t_monthly_pay_inputs.Festival_Bonus,t_monthly_pay_inputs.Other_Deductions,t_loan_history .Balance_Amount
from t_emp_pay_data
left join t_employee_details on t_employee_details.EmpID = t_emp_pay_data.EmpID
left join t_payroll on t_employee_details.EmpID = t_payroll.EmpID and t_payroll.PayOn = ?
diff --git a/app/Models/Purchaseorder_model.php b/app/Models/Purchaseorder_model.php
index bf0a0dd0..5266661b 100755
--- a/app/Models/Purchaseorder_model.php
+++ b/app/Models/Purchaseorder_model.php
@@ -829,13 +829,16 @@ mstr.CourierNo,pom.Status,pom.POType') //,bill.BillNo,bill.FilePath,
$insert_id = $this->db->affectedRows();
$this->db->transComplete();
-
+ // print_r($insert_id);die;
if ($insert_id > 0) {
+
$subQuery = 'select PONO from t_purchaseorder_master where CreatedBy=? and ParentPO=? order by CreatedDate desc limit 1';
$query = $this->db->query($subQuery, array($CreatedBy, $ParentPO));
return $query->getResultArray();
+ }else{
+ return false;
}
}
diff --git a/app/Views/AmendPOlist.php b/app/Views/AmendPOlist.php
index c52f4af4..d8c1994e 100755
--- a/app/Views/AmendPOlist.php
+++ b/app/Views/AmendPOlist.php
@@ -1,44 +1,52 @@
+ .Date-filter-form {
+ display: flex;
+ align-items: center;
+ gap: 10px;
+ /* Adjust the gap as needed */
+ }
+
+ .Date-filter-form input,
+ .Date-filter-form button {
+ padding: 5px;
+ font-size: 14px;
+ }
+
+ .Date-filter-form button {
+ background-color: #007bff;
+ color: white;
+ border: none;
+ cursor: pointer;
+ }
+
+ .Date-filter-form button:hover {
+ background-color: #0056b3;
+ }
+
+ .icon-button {
+ background: none;
+ border: none;
+ cursor: pointer;
+ color: #007bff;
+ font-size: 18px;
+ }
+
+ .icon-button:hover {
+ color: #0056b3;
+ }
+
+ th,
+ td {
+ white-space: nowrap;
+ }
+
@@ -53,12 +61,12 @@
Amendment Purchase Order List
-
+
+
-
+ = "Amended Service Purchase Order - $PONO "; ?>
- Back
+ Back
@@ -1197,7 +1197,8 @@ if (!empty($getlogpodtl)) {
-
+
+
@@ -1436,7 +1437,7 @@ if (!empty($getlogpodtl)) {
-
+
@@ -1460,11 +1461,11 @@ if (!empty($getlogpodtl)) {
-
-
+
+
+ }} ?>
@@ -2336,7 +2337,7 @@ if (!empty($getlogpodtl)) {
-->
-
+
\ No newline at end of file
diff --git a/app/Views/Report_pending_purchase.php b/app/Views/Report_pending_purchase.php
index 03bc0e6f..de33aaef 100755
--- a/app/Views/Report_pending_purchase.php
+++ b/app/Views/Report_pending_purchase.php
@@ -10,15 +10,19 @@
@@ -346,11 +367,11 @@