diff --git a/app/Config/Routes.php b/app/Config/Routes.php index a445ae9f..57adcfe2 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -211,6 +211,8 @@ $routes->match(['get', 'post', 'put', 'delete'],'EmergencyPO', 'Emergencypurchas $routes->match(['get', 'post', 'put', 'delete'],'AdvanceRequest', 'Purchaseorder::advancerequest'); $routes->match(['get', 'post', 'put', 'delete'],'PORelease', 'Purchaseorder::porelease'); $routes->match(['get', 'post', 'put', 'delete'],'ViewPO', 'Purchaseorder::viewfullpurchaseorder'); +$routes->match(['get', 'post', 'put', 'delete'],'purchaseorder/EditImportPurchaseOrder', 'Purchaseorder::EditImportPurchaseOrder'); +$routes->match(['get', 'post', 'put', 'delete'],'purchaseorder/EditCapitalPurchaseOrder', 'Purchaseorder::EditCapitalPurchaseOrder'); // $routes->match(['get', 'post', 'put', 'delete'],'POApproval', 'Purchaseorder::poapproval'); $routes->get('amendmentpurchaseorder','Amendmentpurchaseorder::index'); diff --git a/app/Controllers/Amendmentpurchaseorder.php b/app/Controllers/Amendmentpurchaseorder.php index fde5b03c..1d152eda 100644 --- a/app/Controllers/Amendmentpurchaseorder.php +++ b/app/Controllers/Amendmentpurchaseorder.php @@ -920,13 +920,13 @@ 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); + $LastPO = $this->purchaseorder_model->addAmendPOMaster($POMaster, $CreateBy, $PONO); - - foreach ($LastPO as $PO) : - $NewPO = $PO['PONO']; - endforeach; + + if (count($LastPO) > 0) { + $NewPO = $LastPO[0]['PONO']; + } $PODetail = array('Status' => PO_AMENDED); //TO SET PARENT PO AS AMENDMENT STATUS @@ -1297,10 +1297,12 @@ class Amendmentpurchaseorder extends BaseController $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); $LastPO = $this->purchaseorder_model->addAmendPOMaster($POMaster, $CreateBy, $PONO); $NewPO = ''; - if (count($LastPO) > 0) { - $NewPO = $LastPO[0]['PONO']; - } - + // if (count($LastPO) > 0) { + // $NewPO = $LastPO[0]['PONO']; + // } + 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); @@ -1458,7 +1460,7 @@ class Amendmentpurchaseorder extends BaseController $CAD = $CAD . "Current Freight Type: " . $beforeFreightType . "Revised Freight Type:" . $FreightType . ""; } - if ($NoOfTrip - $beforeNoOfTrip) { + if ((float)$NoOfTrip - (float)$beforeNoOfTrip) { $rowspanvalue++; $CAD = $CAD . "Current No of Trip: " . $beforeNoOfTrip . "Revised Additional Excise duty:" . $NoOfTrip . ""; diff --git a/app/Controllers/Purchaseorder.php b/app/Controllers/Purchaseorder.php index a72269d2..6226d175 100644 --- a/app/Controllers/Purchaseorder.php +++ b/app/Controllers/Purchaseorder.php @@ -2656,10 +2656,7 @@ $mpdf->use_kwt = true; $CustomDutyExpensesPerKG = $this->request->getPost('CustomDutyExpenses' . $i); - - - - $TaxtotalOrderValue = $itemRate * $Quantity + $OtherAmt + $AfterCgst + $AfterSgst + $AfterIgst - $AfterDiscount; + $TaxtotalOrderValue = (float)$itemRate * (float)$Quantity + (float)$OtherAmt + (float)$AfterCgst + (float)$AfterSgst + (float)$AfterIgst - (float)$AfterDiscount; $CapitalItemDescription = $this->request->getPost('CapitalItemDescrition' . $i); $Per = $this->request->getPost('per' . $i); diff --git a/app/Views/editCapitalAmendPO.php b/app/Views/editCapitalAmendPO.php index 301e562c..9738c6aa 100644 --- a/app/Views/editCapitalAmendPO.php +++ b/app/Views/editCapitalAmendPO.php @@ -1,4 +1,7 @@ "NO","value"=>"0"),array("name"=>"YES","value"=>"1") ); diff --git a/app/Views/editCapitalPo.php b/app/Views/editCapitalPo.php index e0de4115..c9c63dca 100644 --- a/app/Views/editCapitalPo.php +++ b/app/Views/editCapitalPo.php @@ -1,4 +1,5 @@ "NO","value"=>"0"),array("name"=>"YES","value"=>"1") ); @@ -6295,9 +6296,10 @@ $("#EdittxtTotalOrderValue").val(''); } function Save(status) -{ //alert('save function'); - +{ alert('save function - what are you doing'); } +function Save(status) +{ if(status == '0') { stat = ''; diff --git a/app/Views/editImportAmendPO.php b/app/Views/editImportAmendPO.php index 907a3778..c8e05024 100644 --- a/app/Views/editImportAmendPO.php +++ b/app/Views/editImportAmendPO.php @@ -1498,7 +1498,7 @@ echo form_textarea($data); - + @@ -3260,17 +3260,17 @@ function validateEditExceedLimit() exp=basicAmountRate*exchangerate; //console.log(exp); - if(exp > totavlbud || totalAmount > totavlbud) - { - alert('Basic amount is exceeding the Budget Limit.Please adjust the product value.'); - $('#EditRate').focus(); - return false; - } - else - { - return true; - } - + // if(exp > totavlbud || totalAmount > totavlbud) + // { + // alert('Basic amount is exceeding the Budget Limit.Please adjust the product value.'); + // $('#EditRate').focus(); + // return false; + // } + // else + // { + // return true; + // } + return true; // newly added. } diff --git a/app/Views/editimportpo.php b/app/Views/editimportpo.php index 8ec81acb..e6fada16 100644 --- a/app/Views/editimportpo.php +++ b/app/Views/editimportpo.php @@ -2773,7 +2773,7 @@ echo form_textarea($data); - + " /> diff --git a/app/Views/po_pdf.php b/app/Views/po_pdf.php index 6c108089..9a3de764 100755 --- a/app/Views/po_pdf.php +++ b/app/Views/po_pdf.php @@ -160,19 +160,15 @@ $purchaseorderDate = (!empty($POItem) && !empty($POItem[0]->PODate)) ? new DateTime($POItem[0]->PODate, new DateTimeZone('Asia/Kolkata')) : ""; $poDate = $purchaseorderDate ? $purchaseorderDate->format('d-m-Y') : "-"; $IsOpenOrder = (!empty($POItem) && !empty($POItem[0]->IsOpenOrder)) ? $POItem[0]->IsOpenOrder : ""; - + $DeliveryDate = ""; + $DeliverySchedule = ""; if (!empty($POItem) && !empty($POItem[0]->DeliveryOption)) { if ($POItem[0]->DeliveryOption == 1) { $DeliverySchedule = $POItem[0]->DeliverySchedule; - $DeliveryDate = ""; } else if ($POItem[0]->DeliveryOption == 0 && !empty($POItem[0]->DeliveryDate)) { $dtDe = new DateTime($POItem[0]->DeliveryDate, new DateTimeZone('Asia/Kolkata')); $DeliveryDate = $dtDe ? $dtDe->format('d-m-Y') : ""; - $DeliverySchedule = ""; } - } else { - $DeliveryDate = ""; - $DeliverySchedule = ""; } $RequistionNo = (!empty($RequistionDetails) && !empty($RequistionDetails[0]['RequistionNo'])) ? $RequistionDetails[0]['RequistionNo'] : "-"; $ReqDate = (!empty($RequistionDetails) && !empty($RequistionDetails[0]['ReqDate'])) ? $RequistionDetails[0]['ReqDate'] : ""; @@ -295,7 +291,7 @@ -

+

' . htmlsc($CompanyAddress) . ' ' . ''; @@ -599,26 +595,26 @@ Rate); ?> BasicValue)); ?> - CGST); ?> + CGST) && $item->CGST != '' ){ _htmlsc($item->CGST); }else{ echo 0; } ?> AfterCGST) && $item->AfterCGST != '') { echo number_alignment(abs($item->AfterCGST)); } else { echo '0.00'; } ?> - SGST); ?> + SGST) && $item->SGST != '' ){ _htmlsc($item->SGST); }else{ echo 0; } ?> AfterSGST) && $item->AfterSGST != '') { echo number_alignment(abs($item->AfterSGST)); } else { echo '0.00'; } ?> - IGST); ?> + IGST) && $item->IGST != '' ){ _htmlsc($item->IGST); }else{ echo 0; } ?> AfterIGST) && $item->AfterIGST != '') { echo number_alignment(abs($item->AfterIGST)); } else { echo '0.00'; } ?> Taxamount + $item->BasicValue; + $totalwithtax = (isset($item->Taxamount) ? $item->Taxamount : 0 ) + $item->BasicValue; echo number_alignment(abs($totalwithtax)); ?>