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)) {

-
+
@@ -5436,6 +5436,7 @@ if (!empty($INRSYMBOL)) {

+
diff --git a/app/Views/editCapitalAmendPO.php b/app/Views/editCapitalAmendPO.php index fff4fd18..b97816ba 100644 --- a/app/Views/editCapitalAmendPO.php +++ b/app/Views/editCapitalAmendPO.php @@ -469,10 +469,10 @@ document.getElementById('dispatchinternational').style.display = 'block'; { // $currentCurrencyType=$CurrencyDetail[0]->CurrencyCode; - $options1[$CurrencyDetail[0]->Currency_Code] = $CurrencyDetail[0]->Currency_Code.' '.' - '.' '.$CurrencyDetail[0]->Country_and_Currency; + $options1[$Currency[0]->Currency_Code] = $Currency[0]->Currency_Code.' '.' - '.' '.$Currency[0]->Country_and_Currency; foreach ($Currency as $Cur) - if($CurrencyDetail[0]->Currency_Code!=$Cur->Currency_Code){ + if($Currency[0]->Currency_Code!=$Cur->Currency_Code){ $options1[$Cur->Currency_Code] = $Cur->Currency_Code.' '.' - '.' '.$Cur->Country_and_Currency; } @@ -2305,8 +2305,8 @@ document.getElementById('dispatchinternational').style.display = 'block';
- - + 'AWAITING APPROVE', 'AWAITING RELEASE' => 'AWAITING APPROVE', @@ -2324,7 +2324,6 @@ document.getElementById('dispatchinternational').style.display = 'block'; echo "Status not provided"; } ?> - -->
diff --git a/app/Views/editRevenueAmendPO.php b/app/Views/editRevenueAmendPO.php index d500cf58..d0529be9 100644 --- a/app/Views/editRevenueAmendPO.php +++ b/app/Views/editRevenueAmendPO.php @@ -427,13 +427,13 @@ function calculateDiscount() var basicValue = parseFloat($('#txtEditBasicValue').val()); var DiscountType =$("#EditDiscountType").val(); - if(DiscountType == "0") + /* if(DiscountType == "0") { alert('Please Select the discount Type'); $('#txtEditDiscount').val(''); $("#EditDiscountType").focus(); } - else if ($('#txtEditDiscount').val() != '' && $('#txtEditDiscount').val() != '0') + else */ if ($('#txtEditDiscount').val() != '' && $('#txtEditDiscount').val() != '0') { var AfterDiscount = 0.0; var Discountval = parseFloat($('#txtEditDiscount').val()); @@ -524,14 +524,14 @@ function calculatePackaging() var PackagingType =$("#EditPackagingType").val(); - if(PackagingType == "0") + /* if(PackagingType == "0") { alert('Please select the Packaging Type'); $('#txtEditPackaging').val(''); $("#EditPackagingType").focus(); } - else if($('#txtEditPackaging').val() != '' && $('#txtEditPackaging').val() !='0') + else */ if($('#txtEditPackaging').val() != '' && $('#txtEditPackaging').val() !='0') { var Packagingvalue = parseFloat($('#txtEditPackaging').val()); var AfterPackaging = 0.0; @@ -621,7 +621,7 @@ function calculatePackaging() if($('#txtEditVat').val() != '') { - var vatValue = parseFloat($('#txtEditVat').val()); + var vatValue = parseFloat($('#txtEditVat').val()).toFixed(2); var basicValue2 = parseFloat($('#txtEditBasicValue').val()); var discount=parseFloat($('#txtEditAfterDiscount').val()); basicValue1=basicValue2-discount; @@ -632,7 +632,7 @@ function calculatePackaging() //alert(packfreight); basicValue=parseFloat(basicValue1+packfreight); //alert(vatValue); - $('#txtEditGST').val(vatValue); + $('#txtEditGST').val(parseFloat(vatValue).toFixed(2)); //$('#txtEditOtherTax').val(0.00); AfterVat = ; Vatval = parseFloat(AfterVat).toFixed(2); @@ -754,13 +754,13 @@ function calculatePackaging() var basicValue = parseFloat($('#txtEditBasicValue').val()); var FreightType =$("#drpEditFreight").val(); - if(FreightType == "0") + /* if(FreightType == "0") { alert('Please select Freight Type'); $('#txtEditFreight').val(''); $("#drpEditFreight").focus(); } - else if( $('#txtEditFreight').val() != "0" && $('#txtEditFreight').val() != '') + else */if( $('#txtEditFreight').val() != "0" && $('#txtEditFreight').val() != '') { var FreightValue = parseFloat($('#txtEditFreight').val()); var UOM = parseFloat($('#EditUOM').val()); diff --git a/app/Views/editServiceAmendPO.php b/app/Views/editServiceAmendPO.php index db502bfd..cf1f535d 100644 --- a/app/Views/editServiceAmendPO.php +++ b/app/Views/editServiceAmendPO.php @@ -1596,8 +1596,7 @@ foreach ($PaymentTerms as $TER) { $Reqon = $Reqon->format('d-m-Y'); ?>

- - + ?>