diff --git a/app/Controllers/Purchaseorder.php b/app/Controllers/Purchaseorder.php index f9e9c900..1d82d47e 100755 --- a/app/Controllers/Purchaseorder.php +++ b/app/Controllers/Purchaseorder.php @@ -139,6 +139,8 @@ class Purchaseorder extends BaseController */ public function CreatePurchaseOrder() { + + $validation = \Config\Services::validation(); $validation->setRule('txtReqNo', 'Requisition Number', ['Req_validate[txtReqNo]'], ['Req_validate' => 'Please Select Requisition Number to Create PO.']); @@ -253,11 +255,13 @@ class Purchaseorder extends BaseController $ViewName = 'servicePurchaseorder'; + } else if ($ReqType == IMPORT) { $data['staticspecialinstruction'] = $this->purchaseorder_model->getConfigValue('C027'); $ViewName = 'importpo'; + } else if ($ReqType == CAPITAL) { $data['staticspecialinstruction'] = $this->purchaseorder_model->getConfigValue('C027'); $CapitalAvlBudget = $this->purchaseorder_model->GetAvailableCapitalBudgetAmount($CostCode, $FYdt, $ReqType); @@ -536,6 +540,7 @@ class Purchaseorder extends BaseController { view("capitalpopdf"); } + //To View/Update Purchase Order function EditPurchaseOrder() @@ -640,6 +645,7 @@ class Purchaseorder extends BaseController // print_r($data);die; $this->global['pageTitle'] = 'Edit Service Purchase order form'; $this->loadViews("EditservicePurchaseorder", $this->global, $data, NULL); + } else if ($ReqType == REVENUE) { $data['POItem'] = $this->purchaseorder_model->GetRevenuePurchaseOrderDetails($PONO); @@ -650,6 +656,7 @@ class Purchaseorder extends BaseController $data['WorkStatus'] = $this->purchaseorder_model->getStatus(7); $this->global['pageTitle'] = 'Edit Revenue Purchase order form'; $this->loadViews("editRevenuepurchaseorder", $this->global, $data, NULL); + } else if ($ReqType == IMPORT) { $AvlBudget = $this->purchaseorder_model->GetAvailableImportBudgetAmount($CostCode, $FYdt, $ReqType); @@ -661,10 +668,12 @@ class Purchaseorder extends BaseController $data['POItem'] = $this->purchaseorder_model->GetImportPurchaseOrderDetails($PONO); // print_r($data['POItem']); $data['Currency'] = $this->purchaseorder_model->GetCurrencytype(); + foreach ($data['POMaster'] as $CUR) { //print_r($CUR->CurrencyType); $Currency = $CUR->CurrencyType; - } + } + // $data[$Rate->ExchangeRate]=$Rate->ExchangeRate; $data['CurrencyDetail'] = $this->purchaseorder_model->GetCurrencyDetail($Currency); $data['PaymentTerms'] = $this->purchaseorder_model->GetPaymentTerms($PONO); @@ -682,7 +691,10 @@ class Purchaseorder extends BaseController $data['unicode'] = $unicode; $data['currencycode'] = $currencycode; $this->global['pageTitle'] = 'Edit Import Purchase order form'; + $this->loadViews("editimportpo", $this->global, $data, NULL); + + } else if ($ReqType == CAPITAL) { $CapitalRange = $this->request->getVar('CapitalRange'); @@ -690,8 +702,6 @@ class Purchaseorder extends BaseController if (count($CapitalAvlBudget) > 0) { - - $data['AvlCapitalBudAmt'] = $CapitalAvlBudget[0]['BudgetAmount'] - $CapitalAvlBudget[0]['Totalvalue']; } @@ -1068,6 +1078,7 @@ class Purchaseorder extends BaseController function addNewPurchaseOrder() { try { + // Extract POST data $POdt = $this->request->getPost('PODate'); $PODate = get_date_time_format($POdt); @@ -1096,7 +1107,7 @@ class Purchaseorder extends BaseController $TotalOrderValueSummary = $this->request->getPost('txtTotalOrderValueSummary'); $POStatus = $this->request->getPost('txtStatus'); $CreateBy = $this->session->get('userId'); - $RowCount = $this->request->getPost('txtRowCount'); + $RowCount = $this->request->getPost('txtRowCount'); $DeletedRow = $this->request->getPost('txtDeletedRow'); $comma_separated = ($DeletedRow !== null && is_string($DeletedRow)) ? explode(':', $DeletedRow) : []; $createddt = get_current_date_time(); @@ -1118,7 +1129,11 @@ class Purchaseorder extends BaseController } if (!empty($this->purchaseorder_model->isFileExists($requestfilename))) { log_message('error', 'File already exists in the database' . $requestfilename); - $requestfilename = ""; + + //$requestfilename = ""; + //the above line is commented due to the fact that same file can exist in the database + //for different po + } else { $file->move($path, $requestfilename); } @@ -1302,6 +1317,8 @@ class Purchaseorder extends BaseController } if (!empty($this->purchaseorder_model->isFileExists($requestfilename))) { log_message('error', 'File already exists in the database' . $requestfilename); + $POList['POFile'] = $requestfilename; + } else { $file->move($path, $requestfilename); $POList['POFile'] = $requestfilename; @@ -1991,7 +2008,11 @@ class Purchaseorder extends BaseController } if (!empty($this->purchaseorder_model->isFileExists($requestfilename))) { log_message('error', 'File already exists in the database' . $requestfilename); - $requestfilename = ""; + + //$requestfilename = ""; + //the above line is commented due to the fact that same file can exist in the database + //for different po + } else { $file->move($path, $requestfilename); } @@ -2216,6 +2237,7 @@ class Purchaseorder extends BaseController } if (!empty($this->purchaseorder_model->isFileExists($requestfilename))) { log_message('error', 'File already exists in the database' . $requestfilename); + $POList['POFile'] = $requestfilename; } else { $file->move($path, $requestfilename); $POList['POFile'] = $requestfilename; @@ -2655,7 +2677,11 @@ class Purchaseorder extends BaseController } if (!empty($this->purchaseorder_model->isFileExists($requestfilename))) { log_message('error', 'File already exists in the database' . $requestfilename); - $requestfilename = ""; + + //$requestfilename = ""; + //the above line is commented due to the fact that same file can exist in the database + //for different po + } else { $file->move($path, $requestfilename); } @@ -2938,7 +2964,8 @@ class Purchaseorder extends BaseController mkdir($path, 0777, true); } if (!empty($this->purchaseorder_model->isFileExists($requestfilename))) { - log_message('error', 'File already exists in the database' . $requestfilename); + log_message('error', 'File already exists in the database' . $requestfilename); + $POList['POFile'] = $requestfilename; } else { $file->move($path, $requestfilename); $POList['POFile'] = $requestfilename; diff --git a/app/Controllers/Servicepurchaseorder.php b/app/Controllers/Servicepurchaseorder.php index cc35371f..1bed9d67 100755 --- a/app/Controllers/Servicepurchaseorder.php +++ b/app/Controllers/Servicepurchaseorder.php @@ -246,7 +246,11 @@ class Servicepurchaseorder extends BaseController } if (!empty($this->purchaseorder_model->isFileExists($requestfilename))) { log_message('error', 'File already exists in the database' . $requestfilename); - $requestfilename = ""; + + //$requestfilename = ""; + //the above line is commented due to the fact that same file can exist in the database + //for different po + } else { $file->move($path, $requestfilename); } @@ -422,6 +426,7 @@ class Servicepurchaseorder extends BaseController } if (!empty($this->purchaseorder_model->isFileExists($requestfilename))) { log_message('error', 'File already exists in the database: ' . $requestfilename); + $POList['POFile'] = $requestfilename; } else { $file->move($path, $requestfilename); $POList['POFile'] = $requestfilename; diff --git a/app/Models/Purchaseorder_model.php b/app/Models/Purchaseorder_model.php index fe3d6992..10d5c695 100755 --- a/app/Models/Purchaseorder_model.php +++ b/app/Models/Purchaseorder_model.php @@ -145,9 +145,7 @@ Where IGRM.PONO = ? '; return $query->getResult(); } - - - function fileupload($myfile) + function fileupload($myfile) { //print_r($myfile);die; @@ -986,8 +984,14 @@ mstr.CourierNo,pom.Status,pom.POType') //,bill.BillNo,bill.FilePath, function GetServicePurchaseOrder($PONO = '') { + $builder = $this->db->table('t_purchaseorder_master POMast')->distinct() - ->select('ReqNo,POMast.PONO,POMast.PaymentTerms,POMast.PaymentOtherDescription,ServiceDescription,supp.SupplierID,supp.SupplierName,supp.Address,supp.MSME,PODate,Stat.StatusName,DeliveryOption,DeliverySchedule,DeliveryDate,DeliveryAddress,POMast.PaymentTerms,POMast.ExchangeRate,POMast.UpdatedOn,Stat.StatusCode,POMast.ServiceWorkStatus,POMast.*,POMast.TotalOrderValue,POMast.BudgetType,IGR.IGRNO') + ->select('ReqNo,POMast.PONO,POMast.PaymentTerms,POMast.PaymentOtherDescription, + ServiceDescription,supp.SupplierID,supp.SupplierName,supp.Address,supp.MSME, + PODate,Stat.StatusName,DeliveryOption,DeliverySchedule,DeliveryDate,DeliveryAddress, + POMast.PaymentTerms,POMast.ExchangeRate,POMast.UpdatedOn,Stat.StatusCode, + POMast.ServiceWorkStatus,POMast.*,POMast.TotalOrderValue,POMast.BudgetType,IGR.IGRNO') + ->join('t_supplierdetailsn supp', 'supp.SupplierID = POMast.SupplierID') ->join('t_status Stat', 'Stat.StatusCode = POMast.Status') ->join('t_purchaseorder_lineitem LineItem', 'POMast.PONO = LineItem.PONO') diff --git a/app/Views/EditservicePurchaseorder.php b/app/Views/EditservicePurchaseorder.php index 64fce0d3..d48606c2 100755 --- a/app/Views/EditservicePurchaseorder.php +++ b/app/Views/EditservicePurchaseorder.php @@ -1312,7 +1312,7 @@ if (!empty($getlogpodtl)) {
-
+
@@ -1447,18 +1447,28 @@ if (!empty($getlogpodtl)) { -
-
- +
+ +
- + + + +
+ + +
+ +
+ +

diff --git a/app/Views/capitalpurchaseorder.php b/app/Views/capitalpurchaseorder.php index 92aab1f1..00e7ad36 100755 --- a/app/Views/capitalpurchaseorder.php +++ b/app/Views/capitalpurchaseorder.php @@ -842,7 +842,7 @@ if (!empty($INRSYMBOL)) {

-
+
@@ -5106,14 +5106,6 @@ if (!empty($INRSYMBOL)) { $('#txtTotalFreight').val(parseFloat(TotFreight).toFixed(2)); } - - - - - - - - $("#CurrencySymbol").val(''); var DisplayCurrencySymbol = ''; $('#currencytype').change(function() { diff --git a/app/Views/editCapitalPo.php b/app/Views/editCapitalPo.php index 48e4de67..786ec2a9 100755 --- a/app/Views/editCapitalPo.php +++ b/app/Views/editCapitalPo.php @@ -1493,12 +1493,27 @@ if (!empty($getlogpodtl)) {
-
-
- - +
+ +
+
+ + +
+
+ + + +
+
+ +
diff --git a/app/Views/editRevenuepurchaseorder.php b/app/Views/editRevenuepurchaseorder.php index af4ed5da..e2e10c98 100755 --- a/app/Views/editRevenuepurchaseorder.php +++ b/app/Views/editRevenuepurchaseorder.php @@ -2625,15 +2625,35 @@ if (!empty($getlogpodtl)) {
+ +
+
+
+ +
+
+ + + + + + +

-
- - - - -
+ +
@@ -2664,6 +2684,12 @@ if (!empty($getlogpodtl)) {

+ + + + + +
diff --git a/app/Views/editimportpo.php b/app/Views/editimportpo.php index 738d4ced..91ba111f 100755 --- a/app/Views/editimportpo.php +++ b/app/Views/editimportpo.php @@ -153,7 +153,6 @@ if (!empty($POMaster)) { $SupplierRef = $Req->Supplier_Reference; $SupOfferno = $Req->Supplier_Offer_No; $Otherref = $Req->Other_Reference; - $Insurance = $Req->InsuranceStatus; $InsuranceNumber = $Req->InsuranceNumber; $Importoption = $Req->POSubType; @@ -1166,16 +1165,25 @@ if (!empty($getlogpodtl)) {
-
- - - - - - - -
+
+ + + + +
+ +
+
diff --git a/app/Views/purchaseorder.php b/app/Views/purchaseorder.php index 8f873b57..0f4883cb 100755 --- a/app/Views/purchaseorder.php +++ b/app/Views/purchaseorder.php @@ -3878,6 +3878,7 @@ if (!empty($INRSYMBOL)) { var formData = new FormData($('.CreatePO')[0]); + $.ajax({ type: "POST", diff --git a/app/Views/servicePurchaseorder.php b/app/Views/servicePurchaseorder.php index a2548db7..bea4707d 100755 --- a/app/Views/servicePurchaseorder.php +++ b/app/Views/servicePurchaseorder.php @@ -2296,6 +2296,10 @@ if (!empty($INRSYMBOL)) { } else { var formData = new FormData($('.ServicePO')[0]); + console.log("inside add service purchase order view page"); + + console.log(formData); + $.ajax({ // data: $('.ServicePO').serialize(), type: "POST", diff --git a/public/uploads/POfiles/Screenshot from 2024-07-26 07-02-46.png b/public/uploads/POfiles/Screenshot from 2024-07-26 07-02-46.png deleted file mode 100755 index eda4969b..00000000 Binary files a/public/uploads/POfiles/Screenshot from 2024-07-26 07-02-46.png and /dev/null differ diff --git a/public/uploads/POfiles/Screenshot from 2024-07-26 07-02-46_1.png b/public/uploads/POfiles/Screenshot from 2024-07-26 07-02-46_1.png deleted file mode 100755 index eda4969b..00000000 Binary files a/public/uploads/POfiles/Screenshot from 2024-07-26 07-02-46_1.png and /dev/null differ