diff --git a/app/Controllers/Amendmentpurchaseorder.php b/app/Controllers/Amendmentpurchaseorder.php
index 86406d99..70787293 100755
--- a/app/Controllers/Amendmentpurchaseorder.php
+++ b/app/Controllers/Amendmentpurchaseorder.php
@@ -231,6 +231,7 @@ class Amendmentpurchaseorder extends BaseController
{
$NewPO = '';
$MAD = '';
+ $changeStatus = $this->request->getPost('changeStatus');
$PONO = $this->request->getPost('txtPONO');
$POdt = $this->request->getPost('PODate');
$PODate = get_date_time_format($POdt);
@@ -306,7 +307,7 @@ 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' => $changeStatus == 1 ? PO_RELEASED : PO_DRAFT, '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');
@@ -329,9 +330,12 @@ class Amendmentpurchaseorder extends BaseController
} else {
$POMaster['POFile'] = $PrePOFile ? $PrePOFile : null;
}
- // print_r($POMaster);die;
- $LastPO = $this->purchaseorder_model->addAmendPOMaster($POMaster, $updatedBy, $PONO);
+ // print_r($POMaster);
+ // echo 'end';
+ // die;
+
+ $LastPO = $this->purchaseorder_model->addAmendPOMaster($POMaster, $updatedBy, $PONO);
if(!empty($LastPO)){
if (count($LastPO) > 0) {
@@ -578,6 +582,7 @@ class Amendmentpurchaseorder extends BaseController
echo 'Purchase Order Amended Successfully! PO Number Is: ' . $PONO . '- New PO Number is' . $NewPO;
+
}
/**
diff --git a/app/Views/editRevenueAmendPO.php b/app/Views/editRevenueAmendPO.php
index a923975d..a42302c3 100755
--- a/app/Views/editRevenueAmendPO.php
+++ b/app/Views/editRevenueAmendPO.php
@@ -1,7 +1,7 @@
format('d-m-Y');
+$CurrentDate = $dt->format('d-m-Y');
$MaxPoDate = '';
$AvlAmount = 0;
$DeliverSchedule = '';
@@ -37,20 +37,20 @@ $Address = '';
$PODate = '';
$Deliverydt = '';
$DeliveryAddress = '';
-$POStatus = '';
-$PONO = '';
-$totBasicAmt = 0;
-$totDiscountAmt = 0.0;
-$totPackagingAmt = 0.0;
-$totExciseAmt = 0.0;
-$totVATAmt = 0.0; //FOR SGST
-$totCSTAmt = 0.0; //FOR CGST
-$totGSTAmt = 0.0; //FOR IGST
+$POStatus = '';
+$PONO = '';
+$totBasicAmt = 0;
+$totDiscountAmt = 0.0;
+$totPackagingAmt = 0.0;
+$totExciseAmt = 0.0;
+$totVATAmt = 0.0; //FOR SGST
+$totCSTAmt = 0.0; //FOR CGST
+$totGSTAmt = 0.0; //FOR IGST
-$totOtherTaxAmt = 0.0;
-$totFreightAmt = 0.0;
-$totInsuranceAmt = 0.0;
-$totOrderSummaryAmt = 0.0;
+$totOtherTaxAmt = 0.0;
+$totFreightAmt = 0.0;
+$totInsuranceAmt = 0.0;
+$totOrderSummaryAmt = 0.0;
$PaymentOtherDescription = '';
$ServiceDescription = '';
$taxrange = "";
@@ -74,19 +74,19 @@ if (!empty($POMaster)) {
$SupName = $Req->SupplierName;
$Address = $Req->MSME ? "MSME : " . $Req->MSME . "\n" . $Req->Address : $Req->Address;
- $Pdt = new DateTime($Req->PODate);
- $PODate = $Pdt->format('d-m-Y');
+ $Pdt = new DateTime($Req->PODate);
+ $PODate = $Pdt->format('d-m-Y');
$DeliverOption = $Req->DeliveryOption;
$DeliverSchedule = $Req->DeliverySchedule;
- $Ddt = new DateTime($Req->DeliveryDate);
+ $Ddt = new DateTime($Req->DeliveryDate);
//echo $Req->DeliveryDate."
";
- $Deliverydt = $Ddt->format('d-m-Y');
+ $Deliverydt = $Ddt->format('d-m-Y');
//echo $Deliverydt;
$PaymentOtherDescription = $Req->PaymentOtherDescription;
//echo $PaymentOtherDescription;
$DeliveryAddress = $Req->DeliveryAddress;
- $POStatus = $Req->StatusName;
- $PONO = $Req->PONO;
+ $POStatus = $Req->StatusName;
+ $PONO = $Req->PONO;
$taxrange = $Req->PORange;
//echo $taxrange . "t";
$ServiceDescription = $Req->ServiceDescription;
@@ -131,14 +131,17 @@ if (!empty($INRSYMBOL)) {
@@ -169,7 +172,7 @@ if (!empty($INRSYMBOL)) {
var DelDt = '';
var insurancestatus = '';
var InsuranceNumber = '';
- $(document).ready(function() {
+ $(document).ready(function () {
// $('#RequistionNo').attr("style", "pointer-events: none;");
$('#drpSupplier').attr("style", "pointer-events: none;");
@@ -233,7 +236,7 @@ if (!empty($INRSYMBOL)) {
Mat: []
};
// alert(new Date(year,month,day));
- $(function() {
+ $(function () {
$("#PODate").datepicker({
minDate: d,
@@ -255,7 +258,7 @@ if (!empty($INRSYMBOL)) {
maxDate : 'now',
dateFormat: 'mm/dd/yy',changeMonth: true, changeYear: true,yearRange: '-100:+0'
}); */
- $('#drpSupplier').change(function() {
+ $('#drpSupplier').change(function () {
var cd = $("#drpSupplier option:selected").text();
//alert(cd);
$("#changeSup").val(cd);
@@ -265,7 +268,7 @@ if (!empty($INRSYMBOL)) {
if (id != '0') {
var y = ;
- $.each(y, function(idx, obj) {
+ $.each(y, function (idx, obj) {
if (obj.SupplierID === id) {
if (obj.MSME) {
$("#SupAddress").val("MSME : " + obj.MSME + "\n" + obj.Address);
@@ -282,7 +285,7 @@ if (!empty($INRSYMBOL)) {
});
- $('#EditDiscountType').change(function() {
+ $('#EditDiscountType').change(function () {
selValue = $("#EditDiscountType").val();
$('#txtEditDiscount').val('');
$('#txtEditAfterDiscount').val('');
@@ -303,7 +306,7 @@ if (!empty($INRSYMBOL)) {
});
- $('#EditPackagingType').change(function() {
+ $('#EditPackagingType').change(function () {
$('#txtEditPackaging').val('');
$('#txtEditAfterPackaging').val('');
selValue = $("#EditPackagingType").val();
@@ -328,16 +331,16 @@ if (!empty($INRSYMBOL)) {
- $('#drpEditFreight').change(function() {
+ $('#drpEditFreight').change(function () {
var FreightType = $("#drpEditFreight").val();
if (FreightType == "PER TRIP") {
$('#EditTripsValue').show();
-
+
} else {
$('#EditTripsValue').hide();
-
+
}
selValue = $("#drpEditFreight").val();
$('#txtEditFreight').val('');
@@ -345,12 +348,12 @@ if (!empty($INRSYMBOL)) {
if (selValue == PercentageType) {
var PackagingCalculation = '';
- $('#freightmodel').modal('show');
- $('#freightmodel').modal({
- backdrop: true,
- keyboard: true
- });
-
+ $('#freightmodel').modal('show');
+ $('#freightmodel').modal({
+ backdrop: true,
+ keyboard: true
+ });
+
$('#txtEditFreight').removeAttr('readonly', 'true');
} else if (selValue == NilType) {
@@ -684,9 +687,7 @@ if (!empty($INRSYMBOL)) {
//alert((FreightValue/100) * (basicValue-AfterDiscount));
//alert(((FreightValue/100) * basicValue));
//alert(FreightCalculation);
- if (FreightCalculation == 0)
-
- {
+ if (FreightCalculation == 0) {
AfterFreight = ;
} else {
AfterFreight = ;
@@ -752,7 +753,7 @@ if (!empty($INRSYMBOL)) {
FreightCalculation = $("input:radio[name='optfreight']:checked").val();
// alert("this is value taken as before after radio value"+FreightCalculation);
$('#freightmodel').modal('hide');
-
+
// $('#EDITREVENUE').modal('show');
calculateFreight();
}
@@ -847,30 +848,30 @@ if (!empty($INRSYMBOL)) {
//alert('tot:'+tot);
return tot;
}
- $(document).ready(function() {
+ $(document).ready(function () {
$("#PaymentTerms").select2();
- $('#Date').click(function() {
+ $('#Date').click(function () {
//for Date range selection
$('#Schedulediv').hide();
$('#Deliverydtdiv').show();
});
- $('#Schedule').click(function() {
+ $('#Schedule').click(function () {
//for schedule range selection
$('#Deliverydtdiv').hide();
$('#Schedulediv').show();
});
SetVatorCST();
});
- $(document).ready(function() {
- $('#Local').click(function() {
+ $(document).ready(function () {
+ $('#Local').click(function () {
//for Date range selection
$('#IGSTShow').hide();
$('#SGSTShow').show();
$('#SGSTModel').show(); // SGST Fields in Modal Show
$('#IGSTModel').hide(); // IGST Fields in Modal Hide
});
- $('#Inter_state').click(function() {
+ $('#Inter_state').click(function () {
//for schedule range selection
$('#SGSTShow').hide();
$('#IGSTShow').show();
@@ -931,7 +932,8 @@ if (!empty($INRSYMBOL)) {