diff --git a/app/Controllers/Amendmentpurchaseorder.php b/app/Controllers/Amendmentpurchaseorder.php
index b61ba103..4d154ed3 100644
--- a/app/Controllers/Amendmentpurchaseorder.php
+++ b/app/Controllers/Amendmentpurchaseorder.php
@@ -291,19 +291,25 @@ class Amendmentpurchaseorder extends BaseController
$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();
+ $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);
- }
- else{
- $file->move($path, $requestfilename);
- $POMaster['POFile'] = $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;
}
$LastPO = $this->purchaseorder_model->addAmendPOMaster($POMaster, $updatedBy, $PONO);
if (count($LastPO) > 0) {
@@ -636,21 +642,27 @@ 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' => $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();
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);
- }
- else{
- $file->move($path, $requestfilename);
- $POMaster['POFile'] = $requestfilename;
- }
+ 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);
@@ -953,18 +965,24 @@ class Amendmentpurchaseorder extends BaseController
$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();
+ $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);
- }
- else{
- $file->move($path, $requestfilename);
- $POMaster['POFile'] = $requestfilename;
- }
+ 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;
}
@@ -1341,6 +1359,27 @@ class Amendmentpurchaseorder extends BaseController
}
$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);
+ $file = $this->request->getFile('POFile');
+ $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;
+ }
$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 d76f84e0..5aae2f09 100644
--- a/app/Controllers/Emergencypurchaseorder.php
+++ b/app/Controllers/Emergencypurchaseorder.php
@@ -208,7 +208,26 @@ class Emergencypurchaseorder extends BaseController
$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' => $InsuranceNumber, 'POSubType' => $ServiceTypeOptions, 'BudgetType' => $BudgetType,'IsOpenOrder'=>$IsOpenOrder);
-
+ $file = $this->request->getFile('POFile');
+ $requestfilename = $file->getName();
+ if (!empty($requestfilename)) {
+
+ if ($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);
+ $POList['POFile'] = NULL;
+ }else{
+ $file->move($path, $requestfilename);
+ $POList['POFile'] = $requestfilename;
+ }
+ }else{
+ $POList['POFile'] = NULL;
+ }
+
+ }
+
$POMaster = $this->purchaseorder_model->addPOMaster($POList, $POType, $ServiceTypeOptions);
$PONO = $POMaster ? $newPONO : "";
@@ -463,7 +482,25 @@ 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' => $InsuranceNumber, 'InsuranceStatus' => $insurancestatus, 'Fincap' => $fincap, 'POSubType' => $revenuetype, 'IsQualityChkReqired' => $Qualitycheck, 'BudgetType' => $BudgetType,'IsOpenOrder'=>$IsOpenOrder);
- //print_r($POList);
+ $file = $this->request->getFile('POFiles');
+ $requestfilename = $file->getName();
+ if (!empty($requestfilename)) {
+
+ if ($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);
+ $POList['POFile'] = NULL;
+ }else{
+ $file->move($path, $requestfilename);
+ $POList['POFile'] = $requestfilename;
+ }
+ }else{
+ $POList['POFile'] = NULL;
+ }
+
+ }
$POMaster = $this->purchaseorder_model->addPOMaster($POList, $POType, $revenuetype);
$PONO = $POMaster ? $newPONO : "";
// $PONO = '';
diff --git a/app/Views/EditservicePurchaseorder.php b/app/Views/EditservicePurchaseorder.php
index b256b766..ab707794 100644
--- a/app/Views/EditservicePurchaseorder.php
+++ b/app/Views/EditservicePurchaseorder.php
@@ -2466,8 +2466,8 @@ if (!empty($getlogpodtl)) {
-
-
+ 'AWAITING APPROVE',
'AWAITING RELEASE' => 'AWAITING APPROVE',
@@ -2484,7 +2484,7 @@ if (!empty($getlogpodtl)) {
} else {
echo "Status not provided";
}
- ?> -->
+ ?>
diff --git a/app/Views/alterpurchaseorder.php b/app/Views/alterpurchaseorder.php
index d9000f8e..b789f664 100644
--- a/app/Views/alterpurchaseorder.php
+++ b/app/Views/alterpurchaseorder.php
@@ -2120,7 +2120,7 @@ if (!empty($INRSYMBOL)) {
if (!empty($Suplist)) {
foreach ($Suplist as $SID) :
- $options[$SID->SupplierID] = $SID->SupplierID . ' - ' . $SID->SupplierName . (!empty($SID->MSME) ? ' ( MSME - ' . $SID->MSME.' )' : '');
+ $options[$SID->SupplierID] = $SID->SupplierID . ' - ' . $SID->SupplierName ;
endforeach;
}
@@ -5337,7 +5337,7 @@ if (!empty($INRSYMBOL)) {