From 0d5ccfe98989ab3eae3326fdcb18bdfec66a872e Mon Sep 17 00:00:00 2001 From: VE10-Sanjeev Date: Tue, 4 Mar 2025 05:50:44 +0000 Subject: [PATCH 01/14] bug fixes 4th mar : ps --- app/Controllers/Emergencypurchaseorder.php | 4 +- app/Controllers/Payslip.php | 4 +- app/Views/EditservicePurchaseorder.php | 17 +- app/Views/addconfig.php | 3 +- app/Views/alterpurchaseorder.php | 101 +++--- app/Views/capitalpurchaseorder.php | 20 +- app/Views/editCapitalAmendPO.php | 11 +- app/Views/editCapitalPo.php | 13 +- app/Views/editImportAmendPO.php | 14 +- app/Views/editRevenueAmendPO.php | 13 +- app/Views/editRevenuepurchaseorder.php | 23 +- app/Views/editServiceAmendPO.php | 324 +++++++++--------- app/Views/editconfig.php | 3 +- app/Views/editimportpo.php | 374 +++++++++++---------- app/Views/importpo.php | 28 +- app/Views/monthlypayinputs.php | 3 +- app/Views/purchaseorder.php | 20 +- app/Views/servicePurchaseorder.php | 18 +- 18 files changed, 503 insertions(+), 490 deletions(-) diff --git a/app/Controllers/Emergencypurchaseorder.php b/app/Controllers/Emergencypurchaseorder.php index d4a143a2..62ba5781 100755 --- a/app/Controllers/Emergencypurchaseorder.php +++ b/app/Controllers/Emergencypurchaseorder.php @@ -125,7 +125,7 @@ class Emergencypurchaseorder extends BaseController // print_r($this->request->getPost());die; $txtRowCount = $this->request->getPost('txtRowCount'); $POdt = $this->request->getPost('PODate'); - $PODate = get_date_time_format($POdt); + $PODate = get_date_time_dynamical_format('d-m-Y','Y-m-d',"$POdt"); $SupplierID = $this->request->getPost('drpSupplier'); $DeliveryAddr = $this->request->getPost('DeliveryAddr'); $CostCenterName = $this->request->getPost('CostCenterName'); @@ -369,7 +369,7 @@ class Emergencypurchaseorder extends BaseController $POdt = $this->request->getPost('PODate'); - $PODate = get_date_time_format($POdt); + $PODate = get_date_time_dynamical_format('d-m-Y','Y-m-d',"$POdt"); $SupplierID = $this->request->getPost('drpSupplier'); $DeliveryAddr = $this->request->getPost('DeliveryAddr'); $dt = $this->request->getPost('Deliverydt'); diff --git a/app/Controllers/Payslip.php b/app/Controllers/Payslip.php index f790bb11..977045c3 100755 --- a/app/Controllers/Payslip.php +++ b/app/Controllers/Payslip.php @@ -1168,6 +1168,7 @@ class Payslip extends BaseController $EmpID = $j['Emp ID']; $is_driver = $this->driver_model->getDriverName($EmpID,1); $DaysWorked = $j['Days Worked']; + $NoTrips = isset($j['Number Of Trips']) ? $j['Number Of Trips'] : 0.00 ; $TotalCalDays = isset($j['Total Days']) ? $j['Total Days'] : 0.00 ; $ActualSalary = isset($j['Basic Salary']) ? $j['Basic Salary'] : 0.00 ; $WorkedSalary = isset($j['Worked Salary']) ? $j['Worked Salary'] : 0.00 ; @@ -1228,7 +1229,8 @@ class Payslip extends BaseController $drivermonthlypaydata = array( 'month_year'=>$month, 'driver_id'=>$EmpID, - 'no_of_loads'=>(strpos($TotalCalDays, "(trip)") !== false) ? explode(" ", $TotalCalDays)[0] : 0, + 'TotalCalDays' => $TotalCalDays, + 'no_of_loads'=>(strpos($NoTrips, "(trip)") !== false) ? explode(" ", $NoTrips)[0] : 0, 'monthly_food_amount'=>$Food, 'total_diesel_amount'=>$Diesel, 'total_shed_amount'=>$Shed, diff --git a/app/Views/EditservicePurchaseorder.php b/app/Views/EditservicePurchaseorder.php index f9bd28b4..8b2aa672 100755 --- a/app/Views/EditservicePurchaseorder.php +++ b/app/Views/EditservicePurchaseorder.php @@ -1274,10 +1274,8 @@ if (!empty($getlogpodtl)) { ReqNo ?> MaterialCode ?> - - MaterialName, 0, 13, "..."); - echo $shortName; ?> - + MaterialName, 0, 13, "..."); echo $shortName; ?> + @@ -1288,8 +1286,7 @@ if (!empty($getlogpodtl)) { - LineitemAuditorNotes) ? $record->LineitemAuditorNotes : "-"; } ?> - + LineitemAuditorNotes) ? $record->LineitemAuditorNotes : "-"; } ?> Quantity ?> UOM ?> @@ -3190,7 +3187,7 @@ if (!empty($getlogpodtl)) { // $('#content').loader('show'); var formData = new FormData($('.ServicePO')[0]); $('#loader').show(); - disableButtons(); + // disableButtons(); $.ajax({ // data: $('.ServicePO').serialize(), type: "POST", @@ -3218,10 +3215,10 @@ if (!empty($getlogpodtl)) { $('#SpcialInstruction').val(''); $('#txtDeliveryAddress').val('') window.location = "purchaseorderListing"; - setTimeout(function() { enableButtons(); }, 2000); + // setTimeout(function() { enableButtons(); }, 2000); } else { $('#loader').hide(); - setTimeout(function() { enableButtons(); }, 2000); + // setTimeout(function() { enableButtons(); }, 2000); alert("Error"); } @@ -3229,7 +3226,7 @@ if (!empty($getlogpodtl)) { error: function(jqXHR, textStatus, errorThrown) { console.error("AJAX Error: " + textStatus + ": " + errorThrown); alert("Error: " + textStatus); - setTimeout(function() { enableButtons(); }, 2000); + // setTimeout(function() { enableButtons(); }, 2000); } }); diff --git a/app/Views/addconfig.php b/app/Views/addconfig.php index e7c24fd3..9dd7f9bc 100755 --- a/app/Views/addconfig.php +++ b/app/Views/addconfig.php @@ -244,8 +244,7 @@ $('#ConfigValue').show(); var temp = index; - var ConfigValue = $("#ConfigValue").val(); - + var ConfigValue = $.trim($("#ConfigValue").val()); $('#ConfigValue').val(''); diff --git a/app/Views/alterpurchaseorder.php b/app/Views/alterpurchaseorder.php index 13a8efbc..02eac8c8 100755 --- a/app/Views/alterpurchaseorder.php +++ b/app/Views/alterpurchaseorder.php @@ -1875,6 +1875,28 @@ if (!empty($INRSYMBOL)) { } else if ($('#drpSupplier').val() == "0") { alert('Please Select the Supplier details'); $('#drpSupplier').focus(); + return false; + } else if (input == 'REVENUE' && $('#Deliverydate').val() == '' && radioValue == 0) { + alert('Please Select the Delivery Date'); + $('#Deliverydate').focus(); + return false; + } else if (input == 'REVENUE' && $('#Scheduleby').val().trim() == '' && radioValue == 1) { + alert('Please Enter the Schedule By'); + $('#Scheduleby').focus(); + return false; + } else if (input == 'SERVICE' && $('#Deliverydate').val() == '' && radioValue == 0) { + alert('Please Select the Delivery Date'); + $('#Deliverydate').focus(); + return false; + } else if (input == 'SERVICE' && $('#Scheduleby').val().trim() == '' && radioValue == 1) { + alert('Please Enter the Schedule By'); + $('#Scheduleby').focus(); + return false; + } else if ($('#DepartmentName').val() == "0") { + alert('Please Select Department Name ') + return false; + } else if ($('#CostCenterName').val() == "0") { + alert('Please Select Cost Center Name ') return false; } else if ($('#PoTypeOptions').val() == "0") { @@ -1891,40 +1913,19 @@ if (!empty($INRSYMBOL)) { return false; } - - - } else if ($('#DepartmentName').val() == "0") { - alert('Please Select Department Name ') + }else if ($('#Otherpayment').val() == '' && $('#PaymentTerms').val() == 'PT08') { + alert('Please Enter Payable Terms Description'); + $('#Otherpayment').focus(); + return false; + }else if($('#insuranceStatus').val() == "1" && $('#InsuranceNumber').val().trim() == ''){ + alert('Please Enter the Insurance No / Insurance Details'); + $('#InsuranceNumber').focus(); return false; - } - else if ($('#CostCenterName').val() == "0") { - alert('Please Select Cost Center Name ') - } - - - - else if ($('#BudgetType').val() == "0") { + }else if ($('#BudgetType').val() == "0") { alert('Please Select Budget Type'); $('#BudgetType').focus(); return false; - - } else if (input == 'REVENUE' && $('#Deliverydate').val() == '' && radioValue == 0) { - alert('Please Select the Delivery Date'); - $('#Deliverydate').focus(); - return false; - } else if (input == 'REVENUE' && $('#Scheduleby').val().trim() == '' && radioValue == 1) { - alert('Please Enter the Schedule By'); - $('#Scheduleby').focus(); - return false; - - } - else if ($('#Otherpayment').length > 0 && $('#Otherpayment').is(':visible') && $('#Otherpayment').val() == '') { - - alert('Please Enter the Description of payable terms'); - $('#Otherpayment').focus(); - return false; - } - else { + } else { $("#" + input).modal('show'); $('#isEdit').val(0); if (StateTaxCheck == "0") { @@ -2634,21 +2635,21 @@ if (!empty($INRSYMBOL)) {
format('Y-m-d'); - $data = array( - 'type' => 'date', - 'name' => 'PODate', - 'value' => set_value('PODate', $formattedDate), - 'min' => $formattedDate, - 'id' => 'PODate', - 'class' => 'form-control', - 'required' => 'true', - 'onkeypress' => 'return false;' - ); - echo form_input($data); + // $poDt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); + // $formattedDate = $poDt->format('d-m-Y'); + // $data = array( + // 'type' => 'text', + // 'name' => 'PODate', + // 'value' => set_value('PODate', $formattedDate), + // 'min' => $formattedDate, + // 'id' => 'PODate', + // 'class' => 'form-control num', + // 'required' => 'true', + // 'onkeypress' => 'return false;' + // ); + // echo form_input($data); ?> +
@@ -7259,7 +7260,7 @@ if (!empty($INRSYMBOL)) { // } else { // Submit the form using AJAX $('#loader').show(); - disableButtons(); + // disableButtons(); $.ajax({ url: "emergencypurchaseorder/addNewServicePurchaseOrder", type: "POST", @@ -7278,13 +7279,13 @@ if (!empty($INRSYMBOL)) { $('#SpcialInstruction').val(''); $('#txtDeliveryAddress').val(''); window.location = "purchaseorderListing"; - setTimeout(function() { enableButtons(); }, 2000); + // setTimeout(function() { enableButtons(); }, 2000); }, error: function (xhr, status, error) { // Handle errors $('#loader').hide(); alert("Error: " + error); - setTimeout(function() { enableButtons(); }, 2000); + // setTimeout(function() { enableButtons(); }, 2000); } }); // } @@ -7369,7 +7370,7 @@ if (!empty($INRSYMBOL)) { // } else { // Submit the form using AJAX $('#loader').show(); - disableButtons(); + // disableButtons(); $.ajax({ url: "emergencypurchaseorder/addNewRevenuePurchaseOrder", type: "POST", @@ -7384,12 +7385,12 @@ if (!empty($INRSYMBOL)) { $('#SpcialInstruction').val(''); $('#txtDeliveryAddress').val(''); window.location = "purchaseorderListing"; - setTimeout(function() { enableButtons(); }, 2000); + // setTimeout(function() { enableButtons(); }, 2000); }, error: function (xhr, status, error) { // Handle errors alert("Error: " + error); - setTimeout(function() { enableButtons(); }, 2000); + // setTimeout(function() { enableButtons(); }, 2000); } }); // } diff --git a/app/Views/capitalpurchaseorder.php b/app/Views/capitalpurchaseorder.php index a2143c63..a170aa5d 100755 --- a/app/Views/capitalpurchaseorder.php +++ b/app/Views/capitalpurchaseorder.php @@ -783,7 +783,8 @@ if (!empty($INRSYMBOL)) {
- +
+
@@ -806,6 +807,7 @@ if (!empty($INRSYMBOL)) {
SNo
+
@@ -4554,7 +4556,7 @@ if (!empty($INRSYMBOL)) { formData.append('ExchangeRateOn', ExchangeRateOn); formData.append('PaymentMethod', PaymentMethod); $('#loader').show(); - disableButtons(); + // disableButtons(); $.ajax({ data: formData, processData: false, @@ -4576,18 +4578,18 @@ if (!empty($INRSYMBOL)) { clearAfterAddLineItemAdd(); window.location = "purchaseorderListing"; - setTimeout(function() { enableButtons(); }, 2000); + // setTimeout(function() { enableButtons(); }, 2000); } else { // $('#content').loader('hide'); alert("Error"); - setTimeout(function() { enableButtons(); }, 2000); + // setTimeout(function() { enableButtons(); }, 2000); } }, error: function(jqXHR, textStatus, errorThrown) { console.error("AJAX Error: " + textStatus + ": " + errorThrown); alert("Error: " + textStatus); - setTimeout(function() { enableButtons(); }, 2000); + // setTimeout(function() { enableButtons(); }, 2000); } }); @@ -5434,11 +5436,11 @@ if (!empty($INRSYMBOL)) { function Reset() { - disableButtons(); + // disableButtons(); location.reload(); - setTimeout(function() { - enableButtons(); - }, 2000); + // setTimeout(function() { + // enableButtons(); + // }, 2000); } $('#insuranceTxtDiv').hide(); diff --git a/app/Views/editCapitalAmendPO.php b/app/Views/editCapitalAmendPO.php index 1dc1ae3c..4c873001 100755 --- a/app/Views/editCapitalAmendPO.php +++ b/app/Views/editCapitalAmendPO.php @@ -796,9 +796,8 @@ if (!empty($POItem) && $CapitalRange == '1') {
-
- +
+
@@ -3497,7 +3496,7 @@ Calculate Landing charge $('#loader').show(); - disableButtons(); + // disableButtons(); $.ajax({ // data:$('.CapitalPO').serialize()+"&ExchangeRateOn="+ExchangeRateOn+"&PaymentMethod="+PaymentMethod+"&PayableAT="+PayableAT+"&PaymentDate="+PaymentDate, type: "POST", @@ -3516,11 +3515,11 @@ Calculate Landing charge $('#SpcialInstruction').val(''); $('#txtDeliveryAddress').val(''); window.location = status == 1 ? "amendmentpurchaseorder" : "purchaseorderListing"; - setTimeout(function() { enableButtons(); }, 2000); + // setTimeout(function() { enableButtons(); }, 2000); } else { $('#loader').hide(); alert("Error"); - setTimeout(function() { enableButtons(); }, 2000); + // setTimeout(function() { enableButtons(); }, 2000); } } diff --git a/app/Views/editCapitalPo.php b/app/Views/editCapitalPo.php index 714ee71a..e57f3953 100755 --- a/app/Views/editCapitalPo.php +++ b/app/Views/editCapitalPo.php @@ -883,8 +883,9 @@ if (!empty($getlogpodtl)) {
-
SNo
+
+
+
@@ -1288,6 +1289,8 @@ if (!empty($getlogpodtl)) { ?>
SNo
+
+
@@ -6009,7 +6012,7 @@ if (!empty($getlogpodtl)) { //alert('else'); $('#loader').show(); - disableButtons(); + // disableButtons(); //alert('ss'); var formData = new FormData($('.CapitalPO')[0]); formData.append('ExchangeRateOn', ExchangeRateOn); @@ -6060,11 +6063,11 @@ if (!empty($getlogpodtl)) { clearAfterAddLineItemAdd(); window.location = "purchaseorderListing"; - setTimeout(function() { enableButtons(); }, 2000); + // } else { // $('#content').loader('hide'); alert("Error"); - setTimeout(function() { enableButtons(); }, 2000); + // setTimeout(function() { enableButtons(); }, 2000); } } diff --git a/app/Views/editImportAmendPO.php b/app/Views/editImportAmendPO.php index d79e7184..9ba31614 100755 --- a/app/Views/editImportAmendPO.php +++ b/app/Views/editImportAmendPO.php @@ -1198,8 +1198,8 @@ if (!empty($RequistionDetails)) {
-
- +
+
@@ -2933,7 +2933,7 @@ if (!empty($RequistionDetails)) { // return false; // } else { $('#loader').show(); - disableButtons(); + // disableButtons(); var formData = new FormData($('.ImportPO')[0]); if (status == 0) { // for draft @@ -2964,23 +2964,23 @@ if (!empty($RequistionDetails)) { //$('#txtDeliveryAddress').val(''); window.location = status == 1 ? "amendmentpurchaseorder" : "purchaseorderListing"; - setTimeout(function() { enableButtons(); }, 2000); + // setTimeout(function() { enableButtons(); }, 2000); } else { alert("Error"); - setTimeout(function() { enableButtons(); }, 2000); + // setTimeout(function() { enableButtons(); }, 2000); } }, error : function (){ console.error(error); - setTimeout(function() { enableButtons(); }, 2000); + // setTimeout(function() { enableButtons(); }, 2000); }, complete : function (){ console.log("ajax call is completed "); - setTimeout(function() { enableButtons(); }, 2000); + // setTimeout(function() { enableButtons(); }, 2000); } diff --git a/app/Views/editRevenueAmendPO.php b/app/Views/editRevenueAmendPO.php index 993b0388..46dff31a 100755 --- a/app/Views/editRevenueAmendPO.php +++ b/app/Views/editRevenueAmendPO.php @@ -1219,8 +1219,7 @@ if (!empty($INRSYMBOL)) {
-
+
@@ -2575,7 +2574,7 @@ if (!empty($INRSYMBOL)) { }; $('#loader').show(); - disableButtons(); + // disableButtons(); $.ajax({ // data:$('.CreatePO').serialize(), type: "POST", @@ -2594,21 +2593,21 @@ if (!empty($INRSYMBOL)) { $('#txtDeliveryAddress').val('') window.location = (status == 1) ? "amendmentpurchaseorder" : "purchaseorderListing"; - setTimeout(function() { enableButtons(); }, 2000); + // setTimeout(function() { enableButtons(); }, 2000); } else { $('#loader').hide(); - setTimeout(function() { enableButtons(); }, 2000); + // setTimeout(function() { enableButtons(); }, 2000); } }, error : function(error){ console.error("error occured" + error); - setTimeout(function() { enableButtons(); }, 2000); + // setTimeout(function() { enableButtons(); }, 2000); }, complete : function (){ $('#loader').hide(); console.log("ajax call is completed ..!!") - setTimeout(function() { enableButtons(); }, 2000); + // setTimeout(function() { enableButtons(); }, 2000); } }); diff --git a/app/Views/editRevenuepurchaseorder.php b/app/Views/editRevenuepurchaseorder.php index 3baeac77..271c9d9c 100755 --- a/app/Views/editRevenuepurchaseorder.php +++ b/app/Views/editRevenuepurchaseorder.php @@ -2132,9 +2132,10 @@ if (!empty($getlogpodtl)) {
+ 'Deliverydt', 'value' => set_value('Deliverydt', $Deliverydt), 'id' => 'Deliverydt', 'class' => 'form-control num', 'required' => 'true', 'onkeypress' => 'return false;'); - echo form_input($data); + // $data = array('name' => 'Deliverydt', 'value' => set_value('Deliverydt', $Deliverydt), 'id' => 'Deliverydt', 'class' => 'form-control num', 'required' => 'true', 'onkeypress' => 'return false;'); + // echo form_input($data); ?>
@@ -2161,9 +2162,10 @@ if (!empty($getlogpodtl)) {
+ 'PODate', 'value' => set_value('PODate', $PODate), 'id' => 'PODate', 'class' => 'form-control num', 'required' => 'true', 'onkeypress' => 'return false;'); - echo form_input($data); + // $data = array('name' => 'PODate', 'value' => set_value('PODate', $PODate), 'id' => 'PODate', 'class' => 'form-control num', 'required' => 'true', 'onkeypress' => 'return false;'); + // echo form_input($data); ?>
@@ -2326,9 +2328,8 @@ if (!empty($getlogpodtl)) {

-
-
+
+
@@ -5403,7 +5404,7 @@ if (!empty($getlogpodtl)) { // } else { var formData = new FormData($('.CreatePO')[0]); $('#loader').show(); - disableButtons(); + // disableButtons(); $.ajax({ type: "POST", url: "purchaseorder/EditRevenuePurchaseOrder", @@ -5421,11 +5422,11 @@ if (!empty($getlogpodtl)) { $('#SpcialInstruction').val(''); $('#txtDeliveryAddress').val('') window.location = "purchaseorderListing"; - setTimeout(function() { enableButtons(); }, 2000); + // setTimeout(function() { enableButtons(); }, 2000); } else { alert("Something went wrong"); - setTimeout(function() { enableButtons(); }, 2000); + // setTimeout(function() { enableButtons(); }, 2000); } }, @@ -5434,7 +5435,7 @@ if (!empty($getlogpodtl)) { $('#loader').hide(); console.error("AJAX Error: ", textStatus, errorThrown); alert("An error occurred: " + textStatus + " - " + errorThrown); - setTimeout(function() { enableButtons(); }, 2000); + // setTimeout(function() { enableButtons(); }, 2000); }, diff --git a/app/Views/editServiceAmendPO.php b/app/Views/editServiceAmendPO.php index 0797e057..b369c150 100755 --- a/app/Views/editServiceAmendPO.php +++ b/app/Views/editServiceAmendPO.php @@ -1012,166 +1012,170 @@ foreach ($PaymentTerms as $TER) {
-
- - - - - - - - - - - - - - - - - - - - - Schedule_Type != 'Recurring') { - $FrequencyNo = intval(1); - $Frequency = 'One Time'; - } else { - $FrequencyNo = $record->NumberOfService; - $Frequency = $record->Service_Period; - } - - ?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + After_CGST; + $TotalSgst = $TotalSgst + $record->After_SGST; + $TotalIgst = $TotalIgst + $record->After_IGST; + $Totalotherallowance = $Totalotherallowance + $record->otherallowance; + $TotalSummary = $TotalSummary + $record->TotalValue; + + + $TotalBasicAmount = $TotalBasicAmount + ($record->BasicValue * $FrequencyNo); + } + ?> + + +
SNoRequisition NoItem CodeItem DescriptionQuantityUOMRateBasic AmountTax AmountTotal Order AmountActual QuantityReceived QuantityPending QuantityAction
ReqNo ?> MaterialCode ?>MaterialName, 0, 13, "..."); - echo $shortName; ?>Quantity ?>UOM ?>Rate ?>BasicValue * $FrequencyNo, 2, '.', ''); ?>Taxamount ?>TotalValue ?>Quantity ?>ReceivedQuantity ?>Quantity - $record->ReceivedQuantity, 2, '.', ''); ?>     - - - - +
+
+ + + + + + + + + + + + + + + + + - After_CGST; - $TotalSgst = $TotalSgst + $record->After_SGST; - $TotalIgst = $TotalIgst + $record->After_IGST; - $Totalotherallowance = $Totalotherallowance + $record->otherallowance; - $TotalSummary = $TotalSummary + $record->TotalValue; + + + + BasicValue * $FrequencyNo); - } - ?> - - -
SNoRequisition NoItem CodeItem DescriptionQuantityUOMRateBasic AmountTax AmountTotal Order AmountActual QuantityReceived QuantityPending QuantityAction
+ foreach ($POItem as $record) { + $index = $index + 1; + if ($record->Schedule_Type != 'Recurring') { + $FrequencyNo = intval(1); + $Frequency = 'One Time'; + } else { + $FrequencyNo = $record->NumberOfService; + $Frequency = $record->Service_Period; + } + + ?> +
ReqNo ?> MaterialCode ?>MaterialName, 0, 13, "..."); + echo $shortName; ?>Quantity ?>UOM ?>Rate ?>BasicValue * $FrequencyNo, 2, '.', ''); ?>Taxamount ?>TotalValue ?>Quantity ?>ReceivedQuantity ?>Quantity - $record->ReceivedQuantity, 2, '.', ''); ?>     + + + + +
+
+
@@ -2236,19 +2240,19 @@ foreach ($PaymentTerms as $TER) { $('#txtDeliveryAddress').val('') window.location = status == 1 ? "amendmentpurchaseorder" : "purchaseorderListing"; - setTimeout(function() { enableButtons(); }, 2000); + // setTimeout(function() { enableButtons(); }, 2000); } else { - setTimeout(function() { enableButtons(); }, 2000); + // setTimeout(function() { enableButtons(); }, 2000); $('#loader').hide(); console.error("Error"); } }, error : function (error){ - setTimeout(function() { enableButtons(); }, 2000); + // setTimeout(function() { enableButtons(); }, 2000); console.log("error occurred" , error); }, complete : function (){ - setTimeout(function() { enableButtons(); }, 2000); + // setTimeout(function() { enableButtons(); }, 2000); console.log("Ajax call is completed ..!!"); } }); diff --git a/app/Views/editconfig.php b/app/Views/editconfig.php index ccbfc09c..002f9f9f 100755 --- a/app/Views/editconfig.php +++ b/app/Views/editconfig.php @@ -664,7 +664,8 @@ if (!empty($master)) { \ No newline at end of file diff --git a/app/Views/monthlypayinputs.php b/app/Views/monthlypayinputs.php index 65926394..f185fc18 100755 --- a/app/Views/monthlypayinputs.php +++ b/app/Views/monthlypayinputs.php @@ -898,8 +898,7 @@ $(document).ready(function () { if (data) { $('#loader').hide(); - // alert(data); - + alert(data); } } diff --git a/app/Views/purchaseorder.php b/app/Views/purchaseorder.php index e9df80b3..036b64c6 100755 --- a/app/Views/purchaseorder.php +++ b/app/Views/purchaseorder.php @@ -2029,8 +2029,8 @@ if (!empty($INRSYMBOL)) {
@@ -3946,7 +3946,7 @@ if (!empty($INRSYMBOL)) { // else { var formData = new FormData($('.CreatePO')[0]); - disableButtons(); + // disableButtons(); $.ajax({ type: "POST", @@ -3963,19 +3963,19 @@ if (!empty($INRSYMBOL)) { //$('#SpcialInstruction').val(''); //$('#txtDeliveryAddress').val(''); window.location = "purchaseorderListing"; - setTimeout(function() { enableButtons(); }, 2000); + // setTimeout(function() { enableButtons(); }, 2000); } else { alert("Error"); - setTimeout(function() { enableButtons(); }, 2000); + // setTimeout(function() { enableButtons(); }, 2000); } }, error: function(jqXHR, textStatus, errorThrown) { console.error("AJAX Error: " + textStatus + ": " + errorThrown); alert("Error: " + textStatus); - setTimeout(function() { enableButtons(); }, 2000); + // setTimeout(function() { enableButtons(); }, 2000); } }); @@ -4219,11 +4219,11 @@ if (!empty($INRSYMBOL)) { } function Reset() { - disableButtons(); + // disableButtons(); location.reload(); - setTimeout(function() { - enableButtons(); - }, 2000); + // setTimeout(function() { + // enableButtons(); + // }, 2000); } diff --git a/app/Views/servicePurchaseorder.php b/app/Views/servicePurchaseorder.php index 532405f7..783d52ef 100755 --- a/app/Views/servicePurchaseorder.php +++ b/app/Views/servicePurchaseorder.php @@ -1047,7 +1047,7 @@ if (!empty($INRSYMBOL)) {
- +
@@ -2402,7 +2402,7 @@ if (!empty($INRSYMBOL)) { // return false; // } else { var formData = new FormData($('.ServicePO')[0]); - disableButtons(); + // disableButtons(); console.log("inside add service purchase order view page"); console.log(formData); @@ -2422,17 +2422,17 @@ if (!empty($INRSYMBOL)) { $('#SpcialInstruction').val(''); $('#txtDeliveryAddress').val(''); window.location = "purchaseorderListing"; - setTimeout(function() { enableButtons(); }, 2000); + // setTimeout(function() { enableButtons(); }, 2000); } else { alert("Error"); - setTimeout(function() { enableButtons(); }, 2000); + // setTimeout(function() { enableButtons(); }, 2000); } }, error: function(jqXHR, textStatus, errorThrown) { console.error("AJAX Error: " + textStatus + ": " + errorThrown); alert("Error: " + textStatus); - setTimeout(function() { enableButtons(); }, 2000); + // setTimeout(function() { enableButtons(); }, 2000); } }); @@ -2584,11 +2584,11 @@ if (!empty($INRSYMBOL)) { function Reset() { - disableButtons(); + // disableButtons(); location.reload(); - setTimeout(function() { - enableButtons(); - }, 2000); + // setTimeout(function() { + // enableButtons(); + // }, 2000); } From 7739f7d208937025ecc2ddd597407b8a9404d11a Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Tue, 4 Mar 2025 11:37:42 +0530 Subject: [PATCH 02/14] stock module latest today vadivel J 04-03-2025 --- app/Config/Routes.php | 24 +- app/Controllers/Assetdetails.php | 15 +- app/Controllers/CostCenter.php | 16 +- app/Controllers/Department.php | 29 +- app/Controllers/Expense.php | 4 +- app/Controllers/FactoryMachineController.php | 16 + app/Controllers/Inwardgateregister.php | 61 ++ app/Controllers/Rawmaterialdetails.php | 17 +- app/Controllers/StockController.php | 709 +++++++++++++--- app/Controllers/Supplier.php | 32 +- app/Controllers/User.php | 26 +- app/Models/Assetdetails_model.php | 3 +- app/Models/Costcenter_model.php | 3 +- app/Models/Department_model.php | 6 +- app/Models/FactoryMachineModel.php | 51 ++ app/Models/GasShortageModel.php | 49 ++ app/Models/Inwardgateregister_model.php | 19 +- ....php => MonthWiseMachinesInStockModel.php} | 6 +- ....php => MonthWiseMaterialInStockModel.php} | 6 +- app/Models/Rawmaterialdetails_model.php | 3 +- app/Models/Supplier_model.php | 11 +- app/Models/TrpAbstractModel.php | 73 ++ app/Models/TrpProductionModel.php | 2 + app/Models/User_model.php | 12 +- app/Views/addasset.php | 9 +- app/Views/adddepartment.php | 6 + app/Views/assetListing.php | 73 +- app/Views/costListing.php | 64 +- app/Views/departmentListing.php | 47 +- app/Views/editasset.php | 2 +- app/Views/factoryMachineMasterDetails.php | 57 +- app/Views/rawmaterialListing.php | 68 +- app/Views/stock/CoatingMachineDetail.php | 2 +- app/Views/stock/bagStockDetails.php | 200 ++++- app/Views/stock/dieselStockDetails.php | 204 ++++- app/Views/stock/drierMachineDetails.php | 30 +- app/Views/stock/dustAndRoughStockDetails.php | 52 +- app/Views/stock/gasStockDetails.php | 8 +- app/Views/stock/incomingSilicaSandDetails.php | 43 +- app/Views/stock/powerConsumptionDetails.php | 199 ++++- app/Views/stock/resinStockDetails.php | 174 ++-- app/Views/stock/trpProductionStockDetails.php | 502 +++++++++--- app/Views/stock/trpSandUseStockDetails.php | 45 +- app/Views/supplierListing.php | 69 +- app/Views/transporterListing.php | 54 +- app/Views/userListing.php | 65 +- app/Views/viewinwardgateregister.php | 761 +++++++++++++++++- 47 files changed, 3201 insertions(+), 726 deletions(-) create mode 100644 app/Models/GasShortageModel.php rename app/Models/{TrpAbstractParticulars.php => MonthWiseMachinesInStockModel.php} (86%) rename app/Models/{TrpAbstract.php => MonthWiseMaterialInStockModel.php} (85%) create mode 100644 app/Models/TrpAbstractModel.php diff --git a/app/Config/Routes.php b/app/Config/Routes.php index b08ca39c..b613750c 100755 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -43,9 +43,9 @@ $routes->get('user/deleteUser', 'User::deleteUser'); $routes->get('user/reActivateUser', 'User::reActivateUser'); // Supplier Routes -$routes->get('supplierlisting', 'Supplier::index'); // list supplier +$routes->match(["GET","POST"],'supplierlisting', 'Supplier::index'); // list supplier $routes->add('addsupplier', 'Supplier::addsupplier');//load add supplier page -$routes->get('viewsupplier', 'Supplier::viewsupplier');// load edit supplier page +$routes->get('viewsupplier', 'Supplier::viewsupplier'); $routes->post('editsupplier', 'Supplier::updatesupplierdetails'); //save supplier details $routes->post('addNewsupplier', 'Supplier::savesupplierdetails'); // update supplier details $routes->post('supplierExist', 'Supplier::checksupplier'); @@ -68,7 +68,7 @@ $routes->post('deleteMaterial', 'Rawmaterialdetails::deleteMaterial'); $routes->post('reActivateMaterial', 'Rawmaterialdetails::reActivateMaterial'); // Cost Center Routes -$routes->get('costListing', 'CostCenter::index'); +$routes->match(['GET','POST'],'costListing', 'CostCenter::index'); $routes->post('fetchCostCenterDetails', 'CostCenter::fetchCostCenterDetails');// for Ajax both add and edit.... $routes->get('reActivateCostCenter', 'CostCenter::reActivateCostCenter'); $routes->get('deleteCostCenter', 'CostCenter::deleteCostCenter'); @@ -97,7 +97,7 @@ $routes->post('getDriver', 'Driver::getDriver'); $routes->match(['GET', 'POST', 'PUT', 'DELETE'], 'driverPrintPdf', 'Driver::driverPrintPdf'); // Asset Detail Routes -$routes->get('assetListing', 'Assetdetails::assetListing'); +$routes->match(['GET','POST'],'assetListing', 'Assetdetails::assetListing'); $routes->get('addasset', 'Assetdetails::addasset'); $routes->post('assetdetails/getpodetails', 'Assetdetails::getpodetails'); $routes->post('assetdetails/getline', 'Assetdetails::getline'); @@ -151,7 +151,7 @@ $routes->get('configurationctrl/deleteConfig', 'Configurationctrl::deleteConfig' $routes->get('configurationctrl/reActivateConfig', 'Configurationctrl::reActivateConfig'); // Department Master Routes -$routes->get('departmentListing', 'Department::index'); +$routes->match(["GET","POST"],'departmentListing', 'Department::index'); $routes->get('adddepartment', 'Department::adddepartment'); $routes->post('savedepartment', 'Department::savedepartment'); $routes->get('editOlddepartment', 'Department::viewdepartment'); @@ -295,10 +295,10 @@ $routes->match(['GET', 'POST', 'PUT', 'DELETE'], 'storerequisitionlisting', 'Sto $routes->match(['GET', 'POST', 'PUT', 'DELETE'], 'EditStoreRequisition', 'Storerequisitioncontroller::EditStoreRequistion'); // Application IGR Routes -$routes->get('AddIGR', 'Inwardgateregister::addIGR'); // ADD IGR page - working -$routes->get('ViewIGR', 'Inwardgateregister::viewIGR'); // View IGR PAGE - Working +$routes->get( 'AddIGR', 'Inwardgateregister::addIGR'); // ADD IGR page - working +$routes->get( 'ViewIGR', 'Inwardgateregister::viewIGR'); // View IGR PAGE - Working $routes->post('ViewIGR', 'Inwardgateregister::viewIGR');//for filter purpose -$routes->get('accountsDashboard', 'Inwardgateregister::accountsDashboard'); // View IGR PAGE - Working +$routes->get( 'accountsDashboard', 'Inwardgateregister::accountsDashboard'); // View IGR PAGE - Working $routes->post('ViewIGRDetails', 'Inwardgateregister::viewIGRDetails'); $routes->post('GetIGRLineItemDetails', 'Inwardgateregister::getIGRLineItemDetails'); $routes->post('SaveIGR', 'Inwardgateregister::SaveIGR');// Save IGR PAGE - Working @@ -309,10 +309,13 @@ $routes->post('getCostCenterData', 'Inwardgateregister::getCostCenterData'); $routes->post('ViewIGRfile', 'Inwardgateregister::ViewIGRfile'); $routes->post('getAdditionalIGRFile', 'Inwardgateregister::getAdditionalIGRFile'); $routes->post('deleteAdditionalIGRFile', 'Inwardgateregister::deleteAdditionalIGRFile'); -$routes->get('download-files/(:segment)', 'Inwardgateregister::downloadFilesAsZip/$1'); +$routes->get( 'download-files/(:segment)', 'Inwardgateregister::downloadFilesAsZip/$1'); $routes->post('inwardgateregister/edituploadfile', 'Inwardgateregister::edituploadfile'); $routes->post('getIGRRemarks', 'Inwardgateregister::getIGRRemarks'); $routes->post('saveIGRRemarks', 'Inwardgateregister::saveIGRRemarks'); +$routes->post('updateGasShortage','Inwardgateregister::updateGasShortage'); +$routes->post('gasShortageList','Inwardgateregister::gasShortageList'); +$routes->post('getGasShortageDetail',"Inwardgateregister::getGasShortageDetail"); // Non IGR / Expense @@ -439,7 +442,7 @@ $routes->post('download_sales_invoice', 'Sales::download_sales_invoice'); $routes->post('updateInvRecQty', 'Sales::updateInvRecQty'); // transporter Routes -$routes->get('transporterListing', 'Supplier::transporterListing'); +$routes->match(['GET', 'POST'],'transporterListing', 'Supplier::transporterListing'); $routes->post('fetchTransporterDetails', 'Supplier::fetchTransporterDetails');// for Ajax both add and edit.... $routes->get('deleteTransporter', 'Supplier::deleteTransporter'); $routes->get('reActivateTransporter', 'Supplier::reActivateTransporter'); @@ -449,6 +452,7 @@ $routes->post('checkTransporter', 'Supplier::checkTransporter'); $routes->post('createFactoryMachineMasterDetails', 'FactoryMachineController::createFactoryMachineMasterDetails'); $routes->get('readFactoryMachineMasterDetails', 'FactoryMachineController::readFactoryMachineMasterDetails'); +$routes->post('readFactoryMachineMasterDetails', 'FactoryMachineController::readFactoryMachineMasterDetails'); $routes->get('readFactoryMachineMasterDetailsById', 'FactoryMachineController::readFactoryMachineMasterDetailsById'); $routes->post('updateFactoryMachineMasterDetails', 'FactoryMachineController::updateFactoryMachineMasterDetails'); $routes->get('deleteFactoryMachineMasterDetails', 'FactoryMachineController::deleteFactoryMachineMasterDetails'); diff --git a/app/Controllers/Assetdetails.php b/app/Controllers/Assetdetails.php index d1b2977a..abe28116 100755 --- a/app/Controllers/Assetdetails.php +++ b/app/Controllers/Assetdetails.php @@ -50,9 +50,22 @@ class Assetdetails extends BaseController */ function assetListing() { + $isActiveFilter = 1 ; // default showing active data + $showArchive = 0 ; // + + if ($this->request->getMethod() === 'POST') { + + $showArchive = $this->request->getPost('showArchive'); + //reversing condition that when user wants deleted data to be shown then we are making active filter 0 + if($showArchive){ + $isActiveFilter = 0; + } + } + + $data['showArchive'] = $showArchive; - $data['userRecords'] = $this->assetdetails_model->assetListing(); + $data['userRecords'] = $this->assetdetails_model->assetListing($isActiveFilter); $this->global['pageTitle'] = 'Asset List'; //print_r($data);die(); diff --git a/app/Controllers/CostCenter.php b/app/Controllers/CostCenter.php index d23a4a2d..b91be7f4 100755 --- a/app/Controllers/CostCenter.php +++ b/app/Controllers/CostCenter.php @@ -45,7 +45,21 @@ class CostCenter extends BaseController */ public function index() { - $data['userRecords'] = $this->costcenter_model->CostListing(); + + $isActiveFilter = 1 ; // default showing active data + $showArchive = 0 ; // + + if ($this->request->getMethod() === 'POST') { + + $showArchive = $this->request->getPost('showArchive'); + //reversing condition that when user wants deleted data to be shown we are making active filter + if($showArchive){ + $isActiveFilter = 0; + } + } + + $data['showArchive'] = $showArchive; + $data['userRecords'] = $this->costcenter_model->CostListing($isActiveFilter); $this->global['pageTitle'] = 'Cost List'; $this->loadViews("costListing", $this->global, $data, NULL); diff --git a/app/Controllers/Department.php b/app/Controllers/Department.php index 79d4d956..fa607f43 100755 --- a/app/Controllers/Department.php +++ b/app/Controllers/Department.php @@ -48,20 +48,25 @@ class Department extends BaseController public function index() { - // if($this->isAdmin() == TRUE) - // { - // $this->loadThis(); - // } - // else - // { + + $isActiveFilter = 1 ; // default showing active data + $showArchive = 0 ; // + + if ($this->request->getMethod() === 'POST') { + + $showArchive = $this->request->getPost('showArchive'); + //reversing condition that when user wants deleted data to be shown then we are making active filter 0 + if($showArchive){ + $isActiveFilter = 0; + } + } + + $data['showArchive'] = $showArchive; + + $this->department_model = new department_model(); - //$searchText = $this->request->getPost('searchText'); - //$data['searchText'] = $searchText; - //$count = $this->department_model->departmentListing($searchText); - //$returns = $this->paginationCompress ( "departmentListing/", $count, 20 ); - - $data['userRecords'] = $this->department_model->departmentListing(); //$searchText, $returns["page"], $returns["segment"]); + $data['userRecords'] = $this->department_model->departmentListing($isActiveFilter); //$searchText, $returns["page"], $returns["segment"]); $this->global['pageTitle'] = 'Department Listing'; diff --git a/app/Controllers/Expense.php b/app/Controllers/Expense.php index 4483e649..4d4a61d6 100755 --- a/app/Controllers/Expense.php +++ b/app/Controllers/Expense.php @@ -25,6 +25,8 @@ class Expense extends BaseController public function index() { + + $isActiveFilter = 1 ; if ($this->request->getMethod() === 'GET') { @@ -38,7 +40,7 @@ class Expense extends BaseController } $data['expense_list'] = $this->expense_model->getAllExpense($fromDate,$toDate); - $data['supplier_list'] = json_encode($this->supplier_model->supplierlisting()); + $data['supplier_list'] = json_encode($this->supplier_model->supplierlisting($isActiveFilter)); $this->global['pageTitle'] = 'Non IGR / Expense List'; $data['fromDate'] = date('d-m-Y', strtotime($fromDate)); $data['toDate'] = date('d-m-Y', strtotime($toDate)); diff --git a/app/Controllers/FactoryMachineController.php b/app/Controllers/FactoryMachineController.php index 002f78dd..aac84358 100644 --- a/app/Controllers/FactoryMachineController.php +++ b/app/Controllers/FactoryMachineController.php @@ -80,9 +80,25 @@ class FactoryMachineController extends BaseController public function readFactoryMachineMasterDetails(){ + + $isActiveFilter = 1 ; // default showing active data + $showArchive = 0 ; // + + if ($this->request->getMethod() === 'POST') { + + $showArchive = $this->request->getPost('showArchive'); + //reversing condition that when user wants deleted data to be shown then we are making active filter 0 + if($showArchive){ + $isActiveFilter = 0; + } + } + + $data['showArchive'] = $showArchive; + $this->global['pageTitle'] = 'Factory Machine Master Details'; $data['masterData'] = $this->factoryMachineMaster_model + ->where('is_active',$isActiveFilter) ->orderBy('created_at','DESC') ->findAll(); diff --git a/app/Controllers/Inwardgateregister.php b/app/Controllers/Inwardgateregister.php index 438272e9..a66fabb8 100755 --- a/app/Controllers/Inwardgateregister.php +++ b/app/Controllers/Inwardgateregister.php @@ -8,6 +8,7 @@ use CodeIgniter\Validation\Exceptions\ValidationException; use App\Models\Inwardgateregister_model; use App\Models\IGRRemarks_model; +use App\Models\GasShortageModel; use App\Helpers\Notification; use DateTime; @@ -25,6 +26,7 @@ class Inwardgateregister extends BaseController { protected $inwardgateregister_model; protected $IGRRemarks_model; + protected $gasShortage_model; protected $session; protected $logger; @@ -37,6 +39,7 @@ class Inwardgateregister extends BaseController parent::__construct(); $this->inwardgateregister_model = new Inwardgateregister_model(); $this->IGRRemarks_model = new IGRRemarks_model(); + $this->gasShortage_model = new GasShortageModel(); $this->session = session(); helper('form'); //$this->load->library('form_validation'); @@ -1472,4 +1475,62 @@ function updateIGRWeight(){ } } + + + public function gasShortageList(){ + + $postData = $this->request->getPost(); + + $allShortages = $this->gasShortage_model->where('invoiceNo',$postData['invoiceNo'])->findAll(); + + return $this->response->setJSON(['status' => 'success', 'data' => $allShortages]); + + + } + + + public function getGasShortageDetail(){ + + $postData = $this->request->getPost(); + + $shortage = $this->gasShortage_model->where('id',$postData['id'])->find(); + + return $this->response->setJSON(['status' => 'success', 'data' => $shortage]); + + } + + + + public function updateGasShortage() + { + $postData = $this->request->getPost(); + + // Validate required data + if (!$postData) { + return $this->response->setJSON(['status' => 'error', 'message' => 'Invalid request. No data received.']); + } + + // Validate required fields for adding + if ( !isset($postData['invoiceNo']) ) { + return $this->response->setJSON(['status' => 'error', 'message' => 'Missing required fields: invoice No.']); + } + + // Handle update (edit) + if (isset($postData["id"])) { + return $this->gasShortage_model->update($postData["id"], $postData) + ? $this->response->setJSON(['status' => 'success', 'message' => 'Gas shortage details updated successfully.']) + : $this->response->setJSON(['status' => 'error', 'message' => 'Failed to update gas shortage details.']); + } + + // Insert new shortage (add) + return ($insertId = $this->gasShortage_model->insert($postData)) + ? $this->response->setJSON(['status' => 'success', 'message' => 'Gas shortage details added successfully.', 'data' => ['id' => $insertId]]) + : $this->response->setJSON(['status' => 'error', 'message' => 'Failed to save gas shortage details.']); + + } + + + + + } \ No newline at end of file diff --git a/app/Controllers/Rawmaterialdetails.php b/app/Controllers/Rawmaterialdetails.php index 738e2c69..0c48421e 100755 --- a/app/Controllers/Rawmaterialdetails.php +++ b/app/Controllers/Rawmaterialdetails.php @@ -66,9 +66,22 @@ class Rawmaterialdetails extends BaseController function rawmaterialListing() { - $this->rawmaterialdetails_model = new rawmaterialdetails_model();; + $isActiveFilter = 1 ; // default showing active data + $showArchive = 0 ; // - $data['userRecords'] = $this->rawmaterialdetails_model->rawmaterialListing(); + if ($this->request->getMethod() === 'POST') { + + $showArchive = $this->request->getPost('showArchive'); + //reversing condition that when user wants deleted data to be shown we are making active filter + if($showArchive){ + $isActiveFilter = 0; + } + } + + $this->rawmaterialdetails_model = new rawmaterialdetails_model(); + + $data['userRecords'] = $this->rawmaterialdetails_model->rawmaterialListing($isActiveFilter); + $data['showArchive'] = $showArchive ; $data['materialCategoryList']= $this->materialCategories_model->where('is_active',1)->findAll(); $this->global['pageTitle'] = 'RawMaterial Listing'; diff --git a/app/Controllers/StockController.php b/app/Controllers/StockController.php index c3b26a66..de76134c 100644 --- a/app/Controllers/StockController.php +++ b/app/Controllers/StockController.php @@ -17,14 +17,16 @@ use App\Models\BagStockDetailsModel; use App\Models\DustAndRoughModel; use App\Models\ResinStockModel; use App\Models\GasStockModel; -use App\Models\TrpAbstract; -use App\Models\TrpAbstractParticulars; use App\Models\TrpSandUseStockModel; use App\Models\TrpProductionModel; use App\Models\TrpProductionMaintenanceModel; use App\Models\TrpProductionWasteModel; use App\Models\Employeedetails_model; use App\Models\PowerConsumptionSummaryModel; +use App\Models\MonthWiseMaterialInStockModel; +use App\Models\MonthWiseMachinesInStockModel; +use App\Models\TrpAbstractModel; + @@ -68,9 +70,11 @@ class StockController extends BaseController protected $employeedetails_model; - protected $trpAbstractParticularsModel ; + protected $monthWiseMaterialInStockModel ; - protected $trpAbstractModel ; + protected $monthWiseMachineInStockModel ; + + protected $trpAbstract_model ; /** @@ -120,10 +124,12 @@ class StockController extends BaseController $this->employeedetails_model = new Employeedetails_model(); $this->powerConsumptionSummary_model = new PowerConsumptionSummaryModel(); + + $this->monthWiseMaterialInStockModel = new MonthWiseMaterialInStockModel(); - $this->trpAbstractParticularsModel = new TrpAbstractParticulars(); + $this->monthWiseMachineInStockModel = new MonthWiseMachinesInStockModel(); - $this->trpAbstractModel = new TrpAbstract(); + $this->trpAbstract_model = new TrpAbstractModel(); $this->session = session(); @@ -791,6 +797,98 @@ class StockController extends BaseController $this->global['pageTitle'] = 'Bag Stock Details'; + $startDate = "$month-01"; + $endDate = date("Y-m-t", strtotime($startDate)); + + + + $customisedMaterialCodes = $this->request->getPost('customisedMaterialCodes') ?? []; + + $existingCustomMaterialCodes = $this->monthWiseMaterialInStockModel + ->select('materialCode') + ->where('date',"$month-01") + ->where('stock_category','packing_material') + ->findAll(); + + + //check user applies for filter currently + if(!empty($customisedMaterialCodes)){ + + //user applied filter, + + //check already filter existing , if exists remove that , + if(!empty($existingCustomMaterialCodes)){ + + //hard delete done..!! + $existingCustomMaterialCodes = $this->monthWiseMaterialInStockModel + ->where('date',"$month-01") + ->where('stock_category','packing_material') + ->delete(); + + } + + + //if no filter already exists or removed current one , just add current filter for that month ....!! + $inserts = []; + + foreach($customisedMaterialCodes as $index => $customisedMaterialCode){ + + $inserts [] = [ + 'date' => "$month-01", + 'stock_category' => "packing_material", + 'materialCode' => $customisedMaterialCode + ]; + + //checking filtered material code present in table , if not create dummy one for whole month + $findMaterialCode = $this->bagStockDetails_model + ->where('date >=', $startDate) + ->where('date <=', $endDate) + ->where('materialCode',$customisedMaterialCode) + ->findAll(); + + //check any material code is not present in stock table but applied in filter + if(empty($findMaterialCode)){ + //create dummy entry for that + $this->createDummyEntryForBag($customisedMaterialCode,$startDate,$endDate); + } + + } + + if(!empty($inserts)){ + //insert all the latest applied filter + $this->monthWiseMaterialInStockModel->insertBatch($inserts); + + //get the currently applied filter + $existingCustomMaterialCodes = $this->monthWiseMaterialInStockModel + ->select('materialCode') + ->where('date',"$month-01") + ->where('stock_category','packing_material') + ->get()->getResultArray(); + + } + + } + + + //possible if no filter applied at all...!!! + if(empty($existingCustomMaterialCodes)){ + //no filter applied at all just present all active material codes + $existingCustomMaterialCodes = $this->rawmaterialdetails_model + ->getAllBagMaterialCode(); + }else{ + //if filter present,get that material codes + $existingCustomMaterialCodes = $this->rawmaterialdetails_model + ->getSelectedBagMaterialCode(array_column($existingCustomMaterialCodes, 'materialCode')); + } + + + $materialCodeList = array_column($existingCustomMaterialCodes, 'MaterialCode'); + + $bagMaterials = $existingCustomMaterialCodes ; + + $data['activeBagMaterials'] = $this->rawmaterialdetails_model->getAllBagMaterialCode(); + + // Get the previous month's last date bag stock details for next month updation $previousMonth = DateTime::createFromFormat('Y-m', $month)->modify('-1 month')->format('Y-m'); @@ -809,11 +907,10 @@ class StockController extends BaseController // checking in database if the data is available for the month - $startDate = "$month-01"; - $endDate = date("Y-m-t", strtotime($startDate)); $data['bagStockDetails'] = $this->bagStockDetails_model ->where('date >=', $startDate) ->where('date <=', $endDate) + ->whereIn('materialCode',$materialCodeList) ->groupBy(['materialCode', 'date']) ->orderBy('date', 'asc') ->orderBy('materialCode', 'asc') @@ -856,25 +953,28 @@ class StockController extends BaseController + //temp_code_s_2025_02 - // getting bag material for creating table headers - // checking already existing stock if yes then get the material code from the existing bag - // if not get all the material codes from the raw material details table + // // getting bag material for creating table headers + // // checking already existing stock if yes then get the material code from the existing bag + // // if not get all the material codes from the raw material details table - if (!empty($data['groupedBagStockDetails'])) { - $result = $groupedByDate[$date]; + // if (!empty($data['groupedBagStockDetails'])) { + // $result = $groupedByDate[$date]; - $distinctMaterialCodes = []; + // $distinctMaterialCodes = []; - foreach ($result as $index => $eachResult) { - $distinctMaterialCodes[] = $result[$index]['materialCode']; - } + // foreach ($result as $index => $eachResult) { + // $distinctMaterialCodes[] = $result[$index]['materialCode']; + // } - $bagMaterials = $this->rawmaterialdetails_model->getSelectedBagMaterialCode($distinctMaterialCodes); + // $bagMaterials = $this->rawmaterialdetails_model->getSelectedBagMaterialCode($distinctMaterialCodes); - } else { - $bagMaterials = $this->rawmaterialdetails_model->getAllBagMaterialCode(); - } + // } else { + // $bagMaterials = $this->rawmaterialdetails_model->getAllBagMaterialCode(); + // } + + //temp_code_e_2025_02 // getting customer for creating table headers @@ -1104,6 +1204,97 @@ class StockController extends BaseController $this->global['pageTitle'] = 'Resin Stock Details'; + $startDate = "$month-01"; + $endDate = date("Y-m-t", strtotime($startDate)); + + + + $customisedMaterialCodes = $this->request->getPost('customisedMaterialCodes') ?? []; + + $existingCustomMaterialCodes = $this->monthWiseMaterialInStockModel + ->select('materialCode') + ->where('date',"$month-01") + ->where('stock_category','resin') + ->findAll(); + + + //check user applies for filter currently + if(!empty($customisedMaterialCodes)){ + + //user applied filter, + + //check already filter existing , if exists remove that , + if(!empty($existingCustomMaterialCodes)){ + + //hard delete done..!! + $existingCustomMaterialCodes = $this->monthWiseMaterialInStockModel + ->where('date',"$month-01") + ->where('stock_category','resin') + ->delete(); + + } + + + //if no filter already exists or removed current one , just add current filter for that month ....!! + $inserts = []; + + foreach($customisedMaterialCodes as $index => $customisedMaterialCode){ + + $inserts [] = [ + 'date' => "$month-01", + 'stock_category' => "resin", + 'materialCode' => $customisedMaterialCode + ]; + + //checking filtered material code present in table , if not create dummy one for whole month + $findMaterialCode = $this->resinStockDetails_model + ->where('date >=', $startDate) + ->where('date <=', $endDate) + ->where('materialCode',$customisedMaterialCode) + ->findAll(); + + //check any material code is not present in stock table but applied in filter + if(empty($findMaterialCode)){ + //create dummy entry for that + $this->createDummyEntryForResin($customisedMaterialCode,$startDate,$endDate); + } + + } + + if(!empty($inserts)){ + //insert all the latest applied filter + $this->monthWiseMaterialInStockModel->insertBatch($inserts); + + //get the currently applied filter + $existingCustomMaterialCodes = $this->monthWiseMaterialInStockModel + ->select('materialCode') + ->where('date',"$month-01") + ->where('stock_category','resin') + ->get()->getResultArray(); + + } + + } + + + //possible if no filter applied at all...!!! + if(empty($existingCustomMaterialCodes)){ + //no filter applied at all just present all active material codes + $existingCustomMaterialCodes = $this->rawmaterialdetails_model->getAllResinMaterialCode(); + }else{ + //if filter present,get that material codes + $existingCustomMaterialCodes = $this->rawmaterialdetails_model + ->getSelectedResinMaterialCode(array_column($existingCustomMaterialCodes, 'materialCode')); + } + + + $materialCodeList = array_column($existingCustomMaterialCodes, 'MaterialCode'); + + $resinMaterials = $existingCustomMaterialCodes ; + + $data['activeResinMaterials'] = $this->rawmaterialdetails_model->getAllResinMaterialCode(); + + // Get the previous month's last date resin stock details for next month updation @@ -1123,11 +1314,12 @@ class StockController extends BaseController // checking in database if the data is available for the month - $startDate = "$month-01"; - $endDate = date("Y-m-t", strtotime($startDate)); + + $data['resinStockDetails'] = $this->resinStockDetails_model ->where('date >=', $startDate) ->where('date <=', $endDate) + ->whereIn('materialCode',$materialCodeList) ->groupBy(['materialCode', 'date']) ->orderBy('date', 'asc') ->orderBy('materialCode', 'asc') @@ -1166,28 +1358,31 @@ class StockController extends BaseController $data['groupedResinStockDetails'] = array_values($groupedByDate); + //temp_code_s_2025_02 // getting resin material for creating table headers // checking already existing stock if yes then get the material code from the existing stock - // if not get all the material codes from the raw material details table + // if not get all the material codes currently isActive from the raw material details table - if (!empty($data['groupedResinStockDetails'])) { + // if (!empty($data['groupedResinStockDetails'])) { - $result = $groupedByDate[$date]; + // $result = $groupedByDate[$date]; - $distinctMaterialCodes = []; + // $distinctMaterialCodes = []; - foreach ($result as $index => $eachResult) { - $distinctMaterialCodes[] = $result[$index]['materialCode']; - } + // foreach ($result as $index => $eachResult) { + // $distinctMaterialCodes[] = $result[$index]['materialCode']; + // } - $resinMaterials = $this->rawmaterialdetails_model->getSelectedResinMaterialCode($distinctMaterialCodes); + // $resinMaterials = $this->rawmaterialdetails_model->getSelectedResinMaterialCode($distinctMaterialCodes); - } else { + // } else { - $resinMaterials = $this->rawmaterialdetails_model->getAllResinMaterialCode(); + // $resinMaterials = $this->rawmaterialdetails_model->getAllResinMaterialCode(); - } + // } + + //temp_code_e_2025_02 // getting customer for creating table headers @@ -1218,6 +1413,119 @@ class StockController extends BaseController return $this->loadViews("stock/resinStockDetails", $this->global, $data, NULL); } + public function createDummyEntryForResin($customisedMaterialCode, $startDate, $endDate) + { + if (!empty($customisedMaterialCode)) { + $inserts = []; + + // Convert start and end date to timestamps + $startTimestamp = strtotime($startDate); + $endTimestamp = strtotime($endDate); + + while ($startTimestamp <= $endTimestamp) { + $inserts[] = [ + 'date' => date('Y-m-d', $startTimestamp), // Convert timestamp to date format + 'materialCode' => $customisedMaterialCode, + 'customer' => ' ', + 'opening' => ' ', + 'receipt' => ' ', + 'used' => ' ', + 'balanceStock' => ' ', + ]; + + $startTimestamp = strtotime('+1 day', $startTimestamp); // Move to the next day + } + + if (!empty($inserts)) { + $this->resinStockDetails_model->insertBatch($inserts); + } + } + } + + public function createDummyEntryForBag($customisedMaterialCode, $startDate, $endDate) + { + if (!empty($customisedMaterialCode)) { + $inserts = []; + + // Convert start and end date to timestamps + $startTimestamp = strtotime($startDate); + $endTimestamp = strtotime($endDate); + + while ($startTimestamp <= $endTimestamp) { + $inserts[] = [ + 'date' => date('Y-m-d', $startTimestamp), // Convert timestamp to date format + 'materialCode' => $customisedMaterialCode, + 'customer' => ' ', + 'opening' => ' ', + 'receipt' => ' ', + 'used' => ' ', + 'balanceStock' => ' ', + ]; + + $startTimestamp = strtotime('+1 day', $startTimestamp); // Move to the next day + } + + if (!empty($inserts)) { + $this->bagStockDetails_model->insertBatch($inserts); + } + } + } + + public function createDummyEntryForDieselMachine($customisedMachineCode, $startDate, $endDate) + { + if (!empty($customisedMachineCode)) { + $inserts = []; + + // Convert start and end date to timestamps + $startTimestamp = strtotime($startDate); + $endTimestamp = strtotime($endDate); + + while ($startTimestamp <= $endTimestamp) { + $inserts[] = [ + 'date' => date('Y-m-d', $startTimestamp), // Convert timestamp to date format + 'machine_id' => $customisedMachineCode, + 'opening_units' => ' ', + 'closing_units' => ' ', + 'total_units' => ' ', + ]; + + $startTimestamp = strtotime('+1 day', $startTimestamp); // Move to the next day + } + + if (!empty($inserts)) { + $this->factoryVehicleDieselDetails_model->insertBatch($inserts); + } + } + } + + public function createDummyEntryForElectricMachine($customisedMachineCode, $startDate, $endDate) + { + if (!empty($customisedMachineCode)) { + $inserts = []; + + // Convert start and end date to timestamps + $startTimestamp = strtotime($startDate); + $endTimestamp = strtotime($endDate); + + while ($startTimestamp <= $endTimestamp) { + $inserts[] = [ + 'date' => date('Y-m-d', $startTimestamp), // Convert timestamp to date format + 'machine_id' => $customisedMachineCode, + 'opening_units' => ' ', + 'closing_units' => ' ', + 'total_units' => ' ', + ]; + + $startTimestamp = strtotime('+1 day', $startTimestamp); // Move to the next day + } + + if (!empty($inserts)) { + $this->powerConsumptionDetails_model->insertBatch($inserts); + } + } + } + + public function updateResinStockDetails() { @@ -1737,6 +2045,7 @@ class StockController extends BaseController $data['wcsSupplierList'] = $result[2] ; + $data['trpAbstract'] = $this->trpAbstract_model->currentMonthTrpAbstract($startDate,$endDate); $date = DateTime::createFromFormat('Y-m', $month); @@ -1931,24 +2240,6 @@ class StockController extends BaseController foreach ($datesInMonth as $datesInMonthIndex => $dateInMonth) { - if($datesInMonthIndex == 0){ - - $trpAbstractParticulars =$this->trpAbstractParticularsModel->findAll(); - - foreach($trpAbstractParticulars as $index => $trpAbstractParticular){ - - $trpAbstract[] = [ - 'date' => $dateInMonth , - 'abs_opening_stock' => 0 , - 'abs_physical_stock'=> 0 , - 'abs_remarks' => " " , - 'abs_particular_id' => $trpAbstractParticular['id'], - ]; - } - - - } - $inserts[] = [ 'Date' => $dateInMonth, @@ -2091,10 +2382,11 @@ class StockController extends BaseController $monthData = $this->getMonthDatesFromInput($currentMonth); + $isActiveFilter = 1 ; $data['startDate'] = $monthData[0]['database']; $data['endDate'] = $monthData[count($monthData) - 1]['database']; $data['timeDropdown'] = $this->generateTimeOptions(); - $data['supplierData'] = $this->supplier_model->supplierlisting(); + $data['supplierData'] = $this->supplier_model->supplierlisting($isActiveFilter); $data['drierDetails'] = $this->drierMachineDetails_model ->where('date >=', $data['startDate']) @@ -2130,14 +2422,12 @@ class StockController extends BaseController $data = $row; - if (($existingRow)) { - // dd("inside update"); + if (($existingRow)) { $existingRow = $this->drierMachineDetails_model->where('id', $row['id'] ?? '')->first(); $this->handleGasStockUpdate($existingRow, $row); $updates[] = $data; } else { - // dd("inside insert"); $this->updateGasStockConsumption($data['date'], $data['total_gas_consumption']); $inserts[] = $data; } @@ -2261,6 +2551,121 @@ class StockController extends BaseController $this->global['pageTitle'] = 'Power Consumption Stock Details'; + + + //filter part starts + + //start date dynamic from front-end + $startDate = "$month-01"; + //end date of given month + $endDate = date("Y-m-t", strtotime($startDate)); + + + //filter applied currently + $customisedMachineCodes = $this->request->getPost('customisedMachineCodes') ?? []; + + + //already applied filter + $existingCustomMachineCodes = $this->monthWiseMachineInStockModel + ->select('machine_id') + ->where('date',"$month-01") + ->where('machine_category','electric') + ->findAll(); + + + //check user applies for filter currently + if(!empty($customisedMachineCodes)){ + + //user applied filter, + + //check already filter existing , if exists remove that , + if(!empty($existingCustomMachineCodes)){ + + //hard delete done..!! + $existingCustomMachineCodes = $this->monthWiseMachineInStockModel + ->where('date',"$month-01") + ->where('machine_category','electric') + ->delete(); + + } + + + //if no filter already exists or removed current one , just add current filter for that month ....!! + $inserts = []; + + foreach($customisedMachineCodes as $index => $customisedMachineCode){ + + $inserts [] = [ + 'date' => "$month-01", + 'machine_category' => "electric", + 'machine_id' => $customisedMachineCode + ]; + + + //checking filtered material code present in table , if not create dummy one for whole month + $findMachineCode = $this->powerConsumptionDetails_model + ->where('date >=', $startDate) + ->where('date <=', $endDate) + ->where('machine_id',$customisedMachineCode) + ->findAll(); + + + //check any material code is not present in stock table but applied in filter + if(empty($findMachineCode)){ + + + //create dummy entry for this + $this->createDummyEntryForElectricMachine($customisedMachineCode,$startDate,$endDate); + } + + } + + if(!empty($inserts)){ + //insert all the latest applied filter + $this->monthWiseMachineInStockModel->insertBatch($inserts); + + //get the currently applied filter + $existingCustomMachineCodes = $this->monthWiseMachineInStockModel + ->select('machine_id') + ->where('date',"$month-01") + ->where('machine_category','electric') + ->get() + ->getResultArray(); + + } + + } + + + //possible if no filter applied at all...!!! + if(empty($existingCustomMachineCodes)){ + //no filter applied at all just present all active material codes + $existingCustomMachineCodes = $this->factoryMachine_model + ->getAllActiveElectricMachines(); + }else{ + //if filter present,get that material codes + $existingCustomMachineCodes = $this->factoryMachine_model + ->getSelectedElectricMachines(array_column($existingCustomMachineCodes, 'machine_id')); + } + + + + //this existingCustomMachineCodes gets its machine after visiting factory machine master table + $machineCodeList = array_column($existingCustomMachineCodes, 'id'); + + $electricMachines = $existingCustomMachineCodes; + + $data['activeElectricMachines'] = $this->factoryMachine_model->getAllActiveElectricMachines(); + + + + + + + + + + // Get the previous month's last date power consumption stock details for next month updation $previousMonth = DateTime::createFromFormat('Y-m', $month)->modify('-1 month')->format('Y-m'); @@ -2288,12 +2693,12 @@ class StockController extends BaseController // checking in database if the data is available for the month - $startDate = "$month-01"; - $endDate = date("Y-m-t", strtotime($startDate)); + $data['powerConsumptionStockDetails'] = $this->powerConsumptionDetails_model ->where('date >=', $startDate) ->where('date <=', $endDate) + ->whereIn('machine_id',$machineCodeList) ->groupBy(['machine_id', 'date']) ->orderBy('date', 'asc') ->orderBy('machine_id', 'asc') @@ -2338,37 +2743,32 @@ class StockController extends BaseController $data['groupedPowerConsumptionStockDetails'] = array_values($groupedByDate); + //temp_code_s_2025_02 + // getting electric machines for creating table headers // checking already existing stock if yes then get the electric machines id from the existing stock // if not get all the electric machines from the factory Machine master table - if (!empty($data['groupedPowerConsumptionStockDetails'])) { + // if (!empty($data['groupedPowerConsumptionStockDetails'])) { - $result = $groupedByDate[$date]; + // $result = $groupedByDate[$date]; - $distinctMachineId = []; + // $distinctMachineId = []; - foreach ($result as $index => $eachResult) { - $distinctMachineId[] = $result[$index]['machine_id']; - } + // foreach ($result as $index => $eachResult) { + // $distinctMachineId[] = $result[$index]['machine_id']; + // } - $electricMachines = $this->factoryMachine_model - ->whereIn('id', $distinctMachineId) - ->orderBy('id', 'asc') - ->get() - ->getResultArray(); + // $electricMachines = $this->factoryMachine_model->getSelectedElectricMachines($distinctMachineId); - } else { + // } else { - $electricMachines = $this->factoryMachine_model - ->where('is_active', 1) - ->where('energy_type', 'Electric') - ->orderBy('id', 'asc') - ->get() - ->getResultArray(); + // $electricMachines = $this->factoryMachine_model->getAllActiveElectricMachines(); - } + // } + + //temp_code_e_2025_02 @@ -2545,6 +2945,119 @@ class StockController extends BaseController $this->global['pageTitle'] = 'Diesel Machine Stock Details'; + //filter part starts + + //start date dynamic from front-end + $startDate = "$month-01"; + //end date of given month + $endDate = date("Y-m-t", strtotime($startDate)); + + + //filter applied currently + $customisedMachineCodes = $this->request->getPost('customisedMachineCodes') ?? []; + + + //already applied filter + $existingCustomMachineCodes = $this->monthWiseMachineInStockModel + ->select('machine_id') + ->where('date',"$month-01") + ->where('machine_category','diesel') + ->findAll(); + + + //check user applies for filter currently + if(!empty($customisedMachineCodes)){ + + //user applied filter, + + //check already filter existing , if exists remove that , + if(!empty($existingCustomMachineCodes)){ + + //hard delete done..!! + $existingCustomMachineCodes = $this->monthWiseMachineInStockModel + ->where('date',"$month-01") + ->where('machine_category','diesel') + ->delete(); + + } + + + //if no filter already exists or removed current one , just add current filter for that month ....!! + $inserts = []; + + foreach($customisedMachineCodes as $index => $customisedMachineCode){ + + $inserts [] = [ + 'date' => "$month-01", + 'machine_category' => "diesel", + 'machine_id' => $customisedMachineCode + ]; + + + //checking filtered material code present in table , if not create dummy one for whole month + $findMachineCode = $this->factoryVehicleDieselDetails_model + ->where('date >=', $startDate) + ->where('date <=', $endDate) + ->where('machine_id',$customisedMachineCode) + ->findAll(); + + //check any material code is not present in stock table but applied in filter + if(empty($findMachineCode)){ + + //create dummy entry for this + $this->createDummyEntryForDieselMachine($customisedMachineCode,$startDate,$endDate); + } + + } + + if(!empty($inserts)){ + //insert all the latest applied filter + $this->monthWiseMachineInStockModel->insertBatch($inserts); + + //get the currently applied filter + $existingCustomMachineCodes = $this->monthWiseMachineInStockModel + ->select('machine_id') + ->where('date',"$month-01") + ->where('machine_category','diesel') + ->get() + ->getResultArray(); + + } + + } + + + //possible if no filter applied at all...!!! + if(empty($existingCustomMachineCodes)){ + //no filter applied at all just present all active material codes + $existingCustomMachineCodes = $this->factoryMachine_model + ->getAllActiveDieselMachines(); + }else{ + //if filter present,get that material codes + $existingCustomMachineCodes = $this->factoryMachine_model + ->getSelectedDieselMachines(array_column($existingCustomMachineCodes, 'machine_id')); + } + + + + //this existingCustomMachineCodes gets its machine 'id' after visiting factory machine master table in above step, + + $machineCodeList = array_column($existingCustomMachineCodes, 'id'); + + $dieselMachines = $existingCustomMachineCodes; + + $data['activeDieselMachines'] = $this->factoryMachine_model->getAllActiveDieselMachines(); + + + + + + + + + + + // Get the previous month's last date diesel stock details for next month updation $previousMonth = DateTime::createFromFormat('Y-m', $month)->modify('-1 month')->format('Y-m'); @@ -2579,6 +3092,7 @@ class StockController extends BaseController $data['dieselMachineStockDetails'] = $this->factoryVehicleDieselDetails_model ->where('date >=', $startDate) ->where('date <=', $endDate) + ->whereIn('machine_id',$machineCodeList) ->groupBy(['machine_id', 'date']) ->orderBy('date', 'asc') ->orderBy('machine_id', 'asc') @@ -2625,38 +3139,41 @@ class StockController extends BaseController + //temp_code_s_2025_02 + // getting diesel machines for creating table headers // checking already existing stock if yes then get the diesel machines id from the existing stock // if not get all the diesel machines from the factory Machine master table - if (!empty($data['groupedDieselMachineStockDetails'])) { + // if (!empty($data['groupedDieselMachineStockDetails'])) { - $result = $groupedByDate[$date]; + // $result = $groupedByDate[$date]; - $distinctMachineId = []; + // $distinctMachineId = []; - foreach ($result as $index => $eachResult) { - $distinctMachineId[] = $result[$index]['machine_id']; - } + // foreach ($result as $index => $eachResult) { + // $distinctMachineId[] = $result[$index]['machine_id']; + // } - $dieselMachines = $this->factoryMachine_model - ->whereIn('id', $distinctMachineId) - ->orderBy('id', 'asc') - ->get() - ->getResultArray(); + // $dieselMachines = $this->factoryMachine_model + // ->whereIn('id', $distinctMachineId) + // ->orderBy('id', 'asc') + // ->get() + // ->getResultArray(); - } else { + // } else { - $dieselMachines = $this->factoryMachine_model - ->where('is_active', 1) - ->where('energy_type', 'Diesel') - ->orderBy('id', 'asc') - ->get() - ->getResultArray(); + // $dieselMachines = $this->factoryMachine_model + // ->where('is_active', 1) + // ->where('energy_type', 'Diesel') + // ->orderBy('id', 'asc') + // ->get() + // ->getResultArray(); - } + // } + //temp_code_e_2025_02 diff --git a/app/Controllers/Supplier.php b/app/Controllers/Supplier.php index 3cc7562b..2aacb665 100755 --- a/app/Controllers/Supplier.php +++ b/app/Controllers/Supplier.php @@ -47,7 +47,22 @@ class Supplier extends BaseController */ public function index() { - $data['userRecords'] = $this->supplier_model->supplierlisting(); + + $isActiveFilter = 1 ; // default showing active transporters data + $showArchive = 0 ; // + + if ($this->request->getMethod() === 'POST') { + + $showArchive = $this->request->getPost('showArchive'); + //reversing condition that when user wants deleted data to be shown we are making active filter + if($showArchive){ + $isActiveFilter = 0; + } + } + + + $data['userRecords'] = $this->supplier_model->supplierlisting($isActiveFilter); + $data['showArchive'] = $showArchive ; $this->global['pageTitle'] = 'Supplier Listing'; $this->loadViews("supplierListing", $this->global, $data, NULL); } @@ -473,7 +488,20 @@ class Supplier extends BaseController */ public function transporterListing() { - $data['userRecords'] = $this->supplier_model->transporterListing(); + $isActiveFilter = 1 ; // default showing active transporters data + $showArchive = 0 ; // + + if ($this->request->getMethod() === 'POST') { + + $showArchive = $this->request->getPost('showArchive'); + //reversing condition that when user wants deleted data to be shown we are making active filter + if($showArchive){ + $isActiveFilter = 0; + } + } + + $data['userRecords'] = $this->supplier_model->transporterListing($isActiveFilter); + $data['showArchive'] = $showArchive ; $this->global['pageTitle'] = 'Transporter List'; $this->loadViews("transporterListing", $this->global, $data, NULL); } diff --git a/app/Controllers/User.php b/app/Controllers/User.php index 5cea8b2e..04999c49 100755 --- a/app/Controllers/User.php +++ b/app/Controllers/User.php @@ -891,14 +891,26 @@ class User extends BaseController */ function userListing() { - // if($this->isAdmin() == TRUE) - // { - // $this->loadThis(); - // } - // else - // { + + $isDeleted = 0 ; // default showing active data + $showArchive = 0 ; // + + if ($this->request->getMethod() === 'POST') { + + $showArchive = $this->request->getPost('showArchive'); + //reversing condition that when user wants deleted data to be shown then we are making active filter 0 + if($showArchive){ + $isDeleted = 1; + } + } + + $data['showArchive'] = $showArchive; + + // dd($data); + + + $data['userRecords'] = $this->user_model->userListing($isDeleted); - $data['userRecords'] = $this->user_model->userListing(); $this->global['pageTitle'] = 'User Listing'; // dd($data); diff --git a/app/Models/Assetdetails_model.php b/app/Models/Assetdetails_model.php index db2b81cf..e1340547 100755 --- a/app/Models/Assetdetails_model.php +++ b/app/Models/Assetdetails_model.php @@ -14,12 +14,13 @@ class Assetdetails_model extends Model * @param number $segment : This is pagination limit * @return array $result : This is result */ - function assetListing() + function assetListing($isActiveFilter) { $builder = $this->db->table('t_asset_details asd') ->select('asd.*,dep.DepartmentName,sup.SupplierName') ->join('t_departmentdetails dep', ' dep.DEPCode = asd.DEPCode', 'left') ->join('t_supplierdetailsn sup', 'sup.SupplierID = asd.SupplierCode', 'left') + ->where('asd.IsActive',$isActiveFilter) ->orderBy('asd.CreatedDt', 'desc'); $query = $builder->get(); diff --git a/app/Models/Costcenter_model.php b/app/Models/Costcenter_model.php index 01c6d783..bb7105ea 100755 --- a/app/Models/Costcenter_model.php +++ b/app/Models/Costcenter_model.php @@ -13,12 +13,13 @@ class Costcenter_model extends Model * @param number $segment : This is pagination limit * @return array $result : This is result */ - function CostListing() + function CostListing($isActiveFilter) { $builder = $this->db->table('t_costcenter_master as Cost') ->select('Cost.id as id, Cost.CostCenterCode as code,Cost.CostCenterName as CostCenterName , Cost.ApprovedBy as ApprovedBy,Emp.FirstName as FirstName,Emp.Designation as Designation ,Cost.CreatedDate,Cost.IsActive,Cost.DeletedBy,Cost.DeletedBy') ->join('t_employee_details as Emp', 'Emp.EmpID=Cost.ApprovedBy') + ->where('Cost.IsActive',$isActiveFilter) ->orderBy('Cost.CreatedDate', 'desc'); $query =$builder->get(); diff --git a/app/Models/Department_model.php b/app/Models/Department_model.php index 7e943aa2..9ab32dfe 100755 --- a/app/Models/Department_model.php +++ b/app/Models/Department_model.php @@ -49,11 +49,13 @@ class Department_model extends Model * @param number $segment : This is pagination limit * @return array $result : This is result */ - function departmentListing() + function departmentListing($isActiveFilter) { $builder = $this->db->table('t_departmentdetails as BaseT') ->select('BaseT.CreatedDt,BaseT.DepartmentName, BaseT.DEPCode, BaseT.HeadDept, BaseT.IsActive , - BaseT.HeadDept') + BaseT.HeadDept,HeadDept.DepartmentName as headDepartmentName') + ->join('t_departmentdetails as HeadDept', 'BaseT.HeadDept = HeadDept.DEPCode' ,'left') + ->where('BaseT.IsActive',$isActiveFilter) ->orderBy("BaseT.DEPCode", "desc"); $query = $builder->get(); $result = $query->getResult(); diff --git a/app/Models/FactoryMachineModel.php b/app/Models/FactoryMachineModel.php index 12fd7af4..83d6eaed 100644 --- a/app/Models/FactoryMachineModel.php +++ b/app/Models/FactoryMachineModel.php @@ -62,6 +62,57 @@ class FactoryMachineModel extends Model } + public function getAllActiveElectricMachines(){ + + $result = $this->db->table('t_factoryMachineMaster') + ->where('is_active', 1) + ->where('energy_type', 'electric') + ->orderBy('id', 'asc') + ->get() + ->getResultArray(); + + return $result ; + + } + + public function getSelectedElectricMachines($distinctMachineId){ + + $result = $this->db->table('t_factoryMachineMaster') + ->whereIn('id', $distinctMachineId) + ->orderBy('id', 'asc') + ->get() + ->getResultArray(); + + return $result; + + } + + public function getAllActiveDieselMachines(){ + + $result = $this->db->table('t_factoryMachineMaster') + ->where('is_active', 1) + ->where('energy_type', 'diesel') + ->orderBy('id', 'asc') + ->get() + ->getResultArray(); + + return $result ; + + } + + public function getSelectedDieselMachines($distinctMachineId){ + + $result = $this->db->table('t_factoryMachineMaster') + ->whereIn('id', $distinctMachineId) + ->orderBy('id', 'asc') + ->get() + ->getResultArray(); + + return $result; + + } + + } diff --git a/app/Models/GasShortageModel.php b/app/Models/GasShortageModel.php new file mode 100644 index 00000000..4b8f5be9 --- /dev/null +++ b/app/Models/GasShortageModel.php @@ -0,0 +1,49 @@ +db->table('t_igr_master igr') ->distinct() - ->select("igr.IGRNO,igr.*,igrd.*,MM.MaterialName,MM.UOM,sup.Address,sup.SupplierName,POM.ServiceDescription,POL.Quantity,POL.Rate,POM.POType,POM.IsOpenOrder, - POM.CapitalRange,POM.CapitalRange,st.CGST as service_cgst,st.SGST as service_sgst,st.IGST as service_igst,it.IGST as import_igst,rt.CGST as revenue_cgst,rt.SGST as revenue_sgst,rt.IGST as revenue_igst") + ->select(" + igr.IGRNO,igr.*,igrd.*, + MM.MaterialName,MM.UOM, + sup.Address,sup.SupplierName, + POL.Rate, + POM.ServiceDescription,POL.Quantity,POM.POType,POM.IsOpenOrder, + POM.CapitalRange,POM.CapitalRange, + st.CGST as service_cgst,st.SGST as service_sgst,st.IGST as service_igst, + it.IGST as import_igst, + rt.CGST as revenue_cgst,rt.SGST as revenue_sgst,rt.IGST as revenue_igst, + cd.ConfigValue As MaterialCategory") + ->join('t_igr_details igrd', 'igrd.IGRNO = igr.IGRNO') ->join('t_purchaseorder_master POM', 'igr.PONO = POM.PONO') ->join('t_purchaseorder_lineitem POL', 'igr.PONO = POL.PONO and POL.MaterialCode=igrd.MaterialCode ') @@ -562,6 +572,7 @@ class Inwardgateregister_model extends Model ->join('t_service_tax st', 'st.LineItemNo = POL.LineItemNo' , 'left') ->join('t_revenue_tax rt', 'rt.LineItemNo = POL.LineItemNo' , 'left') ->join('t_import_tax it', 'it.LineItemNo = POL.LineItemNo' , 'left') + ->join('t_configdetails cd','cd.key = MM.Category','left') ->where('igr.IGRNO', $IGRNO); $query = $builder->get(); @@ -1189,7 +1200,7 @@ class Inwardgateregister_model extends Model igrMast.MaterialRcvdDate as materialRecievedDate, igrMast.VehicleNo, supplierDetails.SupplierName, - materialMaster.Category as sandType , + cd.ConfigValue as sandType , t_igr_details.QuantityAsPerInvoice as Qty, issd.*') ->whereIn('t_igr_details.MaterialCode', $materialCodes) @@ -1205,6 +1216,7 @@ class Inwardgateregister_model extends Model ->join('t_igr_master igrMast', 'igrMast.IGRNO = t_igr_details.IGRNO') ->join('t_incomingSilicaSandDetails issd','issd.igrNo_fk = t_igr_details.IGRNO AND issd.materialCode = t_igr_details.MaterialCode','left') ->join('t_materialmaster materialMaster', 'materialMaster.MaterialCode = t_igr_details.MaterialCode') + ->join('t_configdetails cd','cd.key = materialMaster.Category','left') ->join('t_purchaseorder_master poMaster', 'poMaster.PONO = igrMast.PONO', 'left') ->join('t_supplierdetailsn supplierDetails', 'supplierDetails.SupplierID = poMaster.SupplierID', 'left') ->orderBy('t_igr_details.CreatedDate', 'asc '); @@ -1336,5 +1348,6 @@ $builder = $this->db->table('t_igr_history') return $result; } + } \ No newline at end of file diff --git a/app/Models/TrpAbstractParticulars.php b/app/Models/MonthWiseMachinesInStockModel.php similarity index 86% rename from app/Models/TrpAbstractParticulars.php rename to app/Models/MonthWiseMachinesInStockModel.php index 4cef5bd9..ff901a90 100644 --- a/app/Models/TrpAbstractParticulars.php +++ b/app/Models/MonthWiseMachinesInStockModel.php @@ -4,15 +4,15 @@ namespace App\Models; use CodeIgniter\Model; -class TrpAbstractParticulars extends Model +class MonthWiseMachinesInStockModel extends Model { - protected $table = 't_trp_abstract_particulars'; + protected $table = 't_monthwisemachinesinstock'; protected $primaryKey = 'id'; protected $useAutoIncrement = true; protected $returnType = 'array'; protected $useSoftDeletes = false; protected $protectFields = true; - protected $allowedFields = ['particular']; + protected $allowedFields = ['date','machine_id','machine_category']; protected bool $allowEmptyInserts = false; protected bool $updateOnlyChanged = true; diff --git a/app/Models/TrpAbstract.php b/app/Models/MonthWiseMaterialInStockModel.php similarity index 85% rename from app/Models/TrpAbstract.php rename to app/Models/MonthWiseMaterialInStockModel.php index 3df62676..e4626b70 100644 --- a/app/Models/TrpAbstract.php +++ b/app/Models/MonthWiseMaterialInStockModel.php @@ -4,15 +4,15 @@ namespace App\Models; use CodeIgniter\Model; -class TrpAbstract extends Model +class MonthWiseMaterialInStockModel extends Model { - protected $table = 't_trp_abstract'; + protected $table = 't_monthwisematerialinstock'; protected $primaryKey = 'id'; protected $useAutoIncrement = true; protected $returnType = 'array'; protected $useSoftDeletes = false; protected $protectFields = true; - protected $allowedFields = ['abs_opening_stock','abs_physical_stock','abs_remarks','abs_particular_id']; + protected $allowedFields = ['date','materialCode','stock_category']; protected bool $allowEmptyInserts = false; protected bool $updateOnlyChanged = true; diff --git a/app/Models/Rawmaterialdetails_model.php b/app/Models/Rawmaterialdetails_model.php index cbd3a5fa..5c589be8 100755 --- a/app/Models/Rawmaterialdetails_model.php +++ b/app/Models/Rawmaterialdetails_model.php @@ -14,7 +14,7 @@ class Rawmaterialdetails_model extends Model * @param number $segment : This is pagination limit * @return array $result : This is result */ - function rawmaterialListing() + function rawmaterialListing($isActiveFilter) { $builder = $this->db->table('t_materialmaster') @@ -22,6 +22,7 @@ class Rawmaterialdetails_model extends Model ->join('tbl_users as user', 'user.UserId = t_materialmaster.createdby', 'left') ->join('t_employee_details as emp', 'emp.EmpID = user.EmpID', 'left') ->join('t_configdetails as cd', 'cd.Key = t_materialmaster.Category', 'left') + ->where('t_materialmaster.IsActive',$isActiveFilter) ->orderBy('CreatedDate','desc'); $query = $builder->get(); $result = $query->getResult(); diff --git a/app/Models/Supplier_model.php b/app/Models/Supplier_model.php index 16cba09a..69613bb2 100755 --- a/app/Models/Supplier_model.php +++ b/app/Models/Supplier_model.php @@ -14,7 +14,7 @@ class Supplier_model extends Model * @param number $segment : This is pagination limit * @return array $result : This is result */ - function supplierlisting() + function supplierlisting($isActiveFilter) { $builder = $this->db->table('t_supplierdetailsn as BaseT') @@ -22,6 +22,7 @@ class Supplier_model extends Model ->join('t_paymentterms as pmt', 'pmt.PaymentID = BaseT.PaymentID', 'left') ->join('tbl_users as user', 'user.UserId = BaseT.createdby', 'left') ->join('t_employee_details as emp', 'emp.EmpID = user.EmpID', 'left') + ->where('BaseT.IsActive',$isActiveFilter) ->orderBy('BaseT.CreatedOn', 'desc'); $query = $builder->get(); @@ -224,17 +225,19 @@ class Supplier_model extends Model } /*SUPPLIER */ /** for transporter listing */ - function transporterListing() + function transporterListing($isActiveFilter) { + $builder = $this->db->table('t_transporter as t') ->select('t.id,t.name,t_employee_details.FirstName as FirstName,t.created_on,t.isactive') ->join('tbl_users', 'tbl_users.userId = t.created_by') ->join('t_employee_details', 't_employee_details.EmpID=tbl_users.EmpID') - ->orderBy('t.created_on', 'desc'); + ->where('t.isactive',$isActiveFilter); + $builder->orderBy('t.created_on', 'desc'); $query =$builder->get(); $result = $query->getResult(); - // echo $this->db->getLastQuery()->getQuery();die; + // echo $this->db->getLastQuery()->getQuery();die; return $result; } diff --git a/app/Models/TrpAbstractModel.php b/app/Models/TrpAbstractModel.php new file mode 100644 index 00000000..487749ac --- /dev/null +++ b/app/Models/TrpAbstractModel.php @@ -0,0 +1,73 @@ +db->table('t_trp_abstract') + ->where('date',$startDate) + ->where('date',$endDate) + ->get() + ->getResultArray(); + + return $currentMonthTrpAbstract; + + } + + + + + + + + + + + + +} + diff --git a/app/Models/TrpProductionModel.php b/app/Models/TrpProductionModel.php index 0b498b98..e6691ebd 100644 --- a/app/Models/TrpProductionModel.php +++ b/app/Models/TrpProductionModel.php @@ -66,6 +66,8 @@ class TrpProductionModel extends Model $materialCodes = array_column($subquery, 'materialCode'); // Extracts 'materialCode' values + + // dd($this->db->getLastQuery()); // Convert the array of material codes to a comma-separated string diff --git a/app/Models/User_model.php b/app/Models/User_model.php index 2abe7eb9..ebafde7c 100755 --- a/app/Models/User_model.php +++ b/app/Models/User_model.php @@ -15,14 +15,16 @@ class User_model extends Model * @param number $segment : This is pagination limit * @return array $result : This is result */ - function userListing() + function userListing($isDeleted) { $builder = $this->db->table('t_employee_details EMP') - ->select('user.isDeleted,user.createdDtm,EMP.EmpID,EMP.FirstName,EMP.LastName,EMP.Designation,user.email as EmailId,EMP.ContactNumber, + ->select('user.isDeleted,user.createdDtm,EMP.EmpID,EMP.FirstName, + EMP.LastName,EMP.Designation,user.email as EmailId,EMP.ContactNumber, DEPT.DEPCode,DEPT.DepartmentName,role.role,user.userId') - ->join('t_departmentdetails DEPT', 'EMP.Departmentcode = DEPT.DEPCode') - ->join('tbl_users user', 'user.EmpID = EMP.EmpID') - ->join('tbl_roles role', 'user.roleId = role.roleId') + ->join('t_departmentdetails DEPT', 'EMP.Departmentcode = DEPT.DEPCode','left') + ->join('tbl_users user', 'user.EmpID = EMP.EmpID','left') + ->join('tbl_roles role', 'user.roleId = role.roleId','left') + ->where('user.isDeleted',$isDeleted) ->orderBy('user.createdDtm', 'desc'); $query = $builder->get(); diff --git a/app/Views/addasset.php b/app/Views/addasset.php index 4458c5e9..b9e18ed3 100755 --- a/app/Views/addasset.php +++ b/app/Views/addasset.php @@ -102,7 +102,7 @@
- +
@@ -355,6 +355,13 @@ $("#User").focus(); return false; } + + if ($('#DateOfPurchase').val().length < 1) { + alert('Please Enter the purchase date'); + $("#DateOfPurchase").focus(); + return false; + } + if ($('#Location').val().length < 1) { alert('Please Enter the Asset Location'); $("#Location").focus(); diff --git a/app/Views/adddepartment.php b/app/Views/adddepartment.php index 78e4bff2..7f2c2182 100755 --- a/app/Views/adddepartment.php +++ b/app/Views/adddepartment.php @@ -115,6 +115,12 @@ let departmentName = $("#DepartmentName").val().trim(); let headDepCode =$("#HeadDept").val()??''; let depCode =$("#DEPCode").val() ?? ''; + + if(departmentName.length<1){ + alert(`Department Name cannot be empty..!!`); + return; + } + $('#loader').show(); $.ajax({ type:"POST", diff --git a/app/Views/assetListing.php b/app/Views/assetListing.php index ec575ecf..58770a69 100755 --- a/app/Views/assetListing.php +++ b/app/Views/assetListing.php @@ -79,22 +79,30 @@ -
+ +
+ + +
- - +
+ + style="width: 18px; height: 18px;"> + +
-
- + + + +
SNo
@@ -121,12 +129,7 @@ if (!empty($userRecords)) { foreach ($userRecords as $record) { ?> - " - style="IsActive == 0) { - echo "display:none"; - } ?>"> + CreatedDt)) == "30-11--0001") { $cdate = '00-00-0000'; @@ -150,7 +153,7 @@ ' + '' + '' + @@ -969,9 +1250,10 @@ '' + '' + '' + - '' + + '' + '' + '' + + '' + '' + '' + '' + @@ -982,8 +1264,21 @@ '' + '' + '' + - '' + - ''; + '' ; + + + + if(item.MaterialCategory == "gas"){ + $('#gasShortageHeader').show(); + $('#gasShortageListHeader').show(); + trIGRHTML += '' ; + trIGRHTML += '' ; + + trIGRHTML +=''; + }else{ + trIGRHTML +=''; + } + if ((item.Quantity - item.QuantityAsPerInvoice) == 0.00) { $('#QuantityAsPerInvoice' + i).attr('readonly', 'true'); @@ -1009,7 +1304,7 @@ '' + '' + '' + - '' + + '' + '' + '' + '' + @@ -1022,8 +1317,18 @@ '' + '' + '' + - '' + - ''; + '' ; + + if(item.MaterialCategory == "gas"){ + $('#gasShortageHeader').show(); + $('#gasShortageListHeader').show(); + trIGRHTML += '' ; + trIGRHTML += '' ; + + trIGRHTML +=''; + }else{ + trIGRHTML +=''; + } if ((item.Quantity - item.QuantityAsPerInvoice) == 0.00) { $('#QuantityAsPerInvoice' + i).attr('readonly', 'true'); @@ -1043,7 +1348,7 @@ '' + '' + '' + - '' + + '' + '' + '' + '' + @@ -1056,8 +1361,18 @@ '' + '' + '' + - '' + - ''; + ''; + + if(item.MaterialCategory == "gas"){ + $('#gasShortageHeader').show(); + $('#gasShortageListHeader').show(); + trIGRHTML += '' ; + trIGRHTML += '' ; + + trIGRHTML +=''; + }else{ + trIGRHTML +=''; + } } } @@ -1097,12 +1412,18 @@ + + + + \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 3390fcc385dc21ae432c3e14d0339e9aeb81753b Mon Sep 17 00:00:00 2001 From: VE10-Sanjeev Date: Tue, 4 Mar 2025 11:28:48 +0000 Subject: [PATCH 03/14] 0001425 --- app/Views/EditservicePurchaseorder.php | 4 +- app/Views/capitalpurchaseorder.php | 2 +- app/Views/editCapitalAmendPO.php | 2 +- app/Views/editCapitalPo.php | 8 +- app/Views/editImportAmendPO.php | 2 +- app/Views/editOldemppay.php | 204 ++++++++++++------------- app/Views/editRevenueAmendPO.php | 8 +- app/Views/editRevenuepurchaseorder.php | 4 +- app/Views/editServiceAmendPO.php | 4 +- app/Views/editimportpo.php | 6 +- app/Views/importpo.php | 2 +- app/Views/purchaseorder.php | 2 +- app/Views/servicePurchaseorder.php | 2 +- 13 files changed, 123 insertions(+), 127 deletions(-) diff --git a/app/Views/EditservicePurchaseorder.php b/app/Views/EditservicePurchaseorder.php index 8b2aa672..df5aafb0 100755 --- a/app/Views/EditservicePurchaseorder.php +++ b/app/Views/EditservicePurchaseorder.php @@ -2813,7 +2813,7 @@ if (!empty($getlogpodtl)) { function populateValueMainFormForEditServiceTax() { - var rows = document.getElementById('ServiceTable').rows.length; + var rows = $('#ServiceTable tbody tr').length; // alert(rows); var editrow = parseFloat(rows) - 1; var TotCgst = 0; @@ -3336,7 +3336,7 @@ if (!empty($getlogpodtl)) { AvlBudAmt = ''; //ServiceTable - var rows = document.getElementById('ServiceTable').rows.length; + var rows = $('#ServiceTable tbody tr').length; if (DeletedMaterialCode != undefined && DeletedMaterialCode != '') { diff --git a/app/Views/capitalpurchaseorder.php b/app/Views/capitalpurchaseorder.php index a170aa5d..fffe84d9 100755 --- a/app/Views/capitalpurchaseorder.php +++ b/app/Views/capitalpurchaseorder.php @@ -4070,7 +4070,7 @@ if (!empty($INRSYMBOL)) { */ function populateValueMainFormForDeleteServiceTax(deletedRow) { - var rows = document.getElementById('serviceTax').rows.length; + var rows = $('#serviceTax tbody tr').length; var TotalOrderValueSummary = 0; diff --git a/app/Views/editCapitalAmendPO.php b/app/Views/editCapitalAmendPO.php index 4c873001..0b1a2591 100755 --- a/app/Views/editCapitalAmendPO.php +++ b/app/Views/editCapitalAmendPO.php @@ -4055,7 +4055,7 @@ Calculate Landing charge */ function populateValueMainFormForEditCapitalTax() { - var rows = document.getElementById('serviceTax').rows.length; + var rows = $('#serviceTax tbody tr').length; var TotalOrderValueSummary = 0; var basicfordometic = 0; var qty = 0; diff --git a/app/Views/editCapitalPo.php b/app/Views/editCapitalPo.php index e57f3953..9991086e 100755 --- a/app/Views/editCapitalPo.php +++ b/app/Views/editCapitalPo.php @@ -5380,7 +5380,7 @@ if (!empty($getlogpodtl)) { */ function populateValueMainFormForDeleteServiceTax(deletedRow) { - var rows = document.getElementById('serviceTax').rows.length; + var rows = $('#serviceTax tbody tr').length; var capital = ; var TotalOrderValueSummary = 0; @@ -6767,7 +6767,7 @@ if (!empty($getlogpodtl)) { */ function populateValueMainFormForEditCapitalTax() { - var rows = document.getElementById('serviceTax').rows.length; + var rows = $('#serviceTax tbody tr').length; var capital = ; var TotalOrderValueSummary = 0; @@ -6917,7 +6917,7 @@ if (!empty($getlogpodtl)) { function populateValueMainFormForViewCapitalTax() { - var rows = document.getElementById('serviceTax').rows.length; + var rows = $('#serviceTax tbody tr').length; var capital = ; var TotalOrderValueSummary = 0; @@ -8108,7 +8108,7 @@ if (!empty($getlogpodtl)) { function populateValueMainFormForupdateCapitalTax() { - var rows = document.getElementById('serviceTax').rows.length; + var rows = $('#serviceTax tbody tr').length; var TotalFreight = 0; var i = 0; do { diff --git a/app/Views/editImportAmendPO.php b/app/Views/editImportAmendPO.php index 9ba31614..98e9f3e7 100755 --- a/app/Views/editImportAmendPO.php +++ b/app/Views/editImportAmendPO.php @@ -2786,7 +2786,7 @@ if (!empty($RequistionDetails)) { function populateValueMainFormForEditImportTax() { - var rows = document.getElementById('ImportTax').rows.length; + var rows = $('#ImportTax tbody tr').length; var TotalLanding = 0; var TotalCustom = 0; var TotalCustomED = 0; diff --git a/app/Views/editOldemppay.php b/app/Views/editOldemppay.php index 857d5d2a..627347c3 100755 --- a/app/Views/editOldemppay.php +++ b/app/Views/editOldemppay.php @@ -16,9 +16,6 @@ autoclose: true }); }); - - - "> - - + +
@@ -191,7 +188,7 @@ if (!empty($emppay)) {
- +
@@ -207,7 +204,7 @@ if (!empty($emppay)) {
Loan Issue(d) Date - +
@@ -216,109 +213,110 @@ if (!empty($emppay)) {
Due Started - +
- +
Paid Amount - +
-
- Paid Due - -
+
+ Paid Due + +
- Remaining Due - -
+ Remaining Due + +
- -

Loan Documents

- -
-
-
- Request letter - - -
-
- - - -
+ +

Loan Documents

+ +
+
+
+ Request letter + + +
+
+ + + +
-
-
-
- Payment Receipt - - -
-
- - - - -
+
+
+
+ Payment Receipt + + +
+
+ + + + +
-
-

Loan History

-
IsActive == 0) { ?> - @@ -288,29 +291,6 @@ + + + + \ No newline at end of file diff --git a/app/Views/costListing.php b/app/Views/costListing.php index 71e3a7df..66baab6f 100755 --- a/app/Views/costListing.php +++ b/app/Views/costListing.php @@ -78,21 +78,26 @@ -
-
- - -
-
+
+ + +
+
+
+ + style="width: 18px; height: 18px;"> + +
+
+
@@ -114,11 +119,7 @@ $date = $createdat->format('d-m-Y'); $time = $createdat->format('h:i A'); ?> - " style="IsActive == 0) { - echo "display:none"; - } ?>"> + @@ -406,29 +407,6 @@ - function showArchiveList() { - let isChecked = $("#showArchiveId").prop('checked'); - - // Show or hide the rows based on checkbox status - $(".deactivatedRow").each(function () { - if (isChecked) { - $(this).show(); - } else { - $(this).hide(); - } - }); - } - - $(document).ready(function () { - let table = $('#cost_listing').DataTable(); - - showArchiveList(); - - table.on('draw', function () { - showArchiveList(); - }); - - }); @@ -440,4 +418,12 @@ $(document).on('keydown', function(event) { } }); + + + \ No newline at end of file diff --git a/app/Views/departmentListing.php b/app/Views/departmentListing.php index bd6b4184..2b36b420 100755 --- a/app/Views/departmentListing.php +++ b/app/Views/departmentListing.php @@ -107,20 +107,23 @@ title="Reset"> -
-
- - -
- -
- -
+ +
+
+
+ + style="width: 18px; height: 18px;"> + + +
+
+
code ?> CostCenterName ?>
@@ -139,13 +142,7 @@ if (!empty($userRecords)) { foreach ($userRecords as $record) { ?> - " - style="IsActive == 0) { - echo "display:none"; - } ?>"> + CreatedDt)) == "30-11--0001") { $cdate = '00-00-0000'; @@ -155,7 +152,7 @@ - + " style=""> + @@ -260,30 +258,11 @@ - function showArchiveList() { - let isChecked = $("#showArchiveId").prop('checked'); - - // Show or hide the rows based on checkbox status - $(".deactivatedRow").each(function () { - if (isChecked) { - $(this).show(); - } else { - $(this).hide(); - } - }); - } - - $(document).ready(function () { - let table = $('#datatable').DataTable(); - - showArchiveList(); - - table.on('draw', function () { - showArchiveList(); - }); + + \ No newline at end of file diff --git a/app/Views/rawmaterialListing.php b/app/Views/rawmaterialListing.php index de3eac73..fc5811b2 100755 --- a/app/Views/rawmaterialListing.php +++ b/app/Views/rawmaterialListing.php @@ -97,19 +97,27 @@ -
-
- - -
-
+
+ + +
+
+
+ + style="width: 18px; height: 18px;"> + + +
+
+
DEPCode; ?> DepartmentName ?>HeadDept ?>headDepartmentName)?$record->DepartmentName:$record->headDepartmentName ?> IsActive == 1) {echo"Active";}else{echo "InActive";}?> IsActive == 0) { ?> @@ -339,4 +336,14 @@ if(result){return;}else{event.preventDefault();} } + + + + \ No newline at end of file diff --git a/app/Views/editasset.php b/app/Views/editasset.php index e50ed279..a3850daa 100755 --- a/app/Views/editasset.php +++ b/app/Views/editasset.php @@ -176,7 +176,7 @@ if (!empty($assetList)) {
- +
diff --git a/app/Views/factoryMachineMasterDetails.php b/app/Views/factoryMachineMasterDetails.php index fe129dba..518c5e5c 100644 --- a/app/Views/factoryMachineMasterDetails.php +++ b/app/Views/factoryMachineMasterDetails.php @@ -111,18 +111,20 @@

-
-
- - +
+
+
+ + style="width: 18px; height: 18px;"> + +
+
-
@@ -147,11 +149,7 @@ foreach ($masterData as $record) { ?> -
@@ -134,12 +142,7 @@ foreach ($userRecords as $record) { $date = date("Y-m-d"); ?> - " - style="IsActive == 0) { - echo "display:none"; - } ?>"> + CreatedDate)) == "30-11--0001") { $cdate = '00-00-0000'; @@ -156,7 +159,7 @@ - + - + @@ -1080,4 +1187,89 @@ } }); + + + + + \ No newline at end of file diff --git a/app/Views/stock/dieselStockDetails.php b/app/Views/stock/dieselStockDetails.php index 50b61eb4..5f0fedf1 100644 --- a/app/Views/stock/dieselStockDetails.php +++ b/app/Views/stock/dieselStockDetails.php @@ -3,6 +3,15 @@ text-align: right; } + + .grab { + cursor: grab; /* Default open-hand cursor */ + } + + .grab:active { + cursor: grabbing; /* Closed-hand cursor when dragging */ + } + .fht-table, .fht-table thead, .fht-table tfoot, @@ -291,12 +300,27 @@ foreach ($period as $day) { " class="form-control mt-2" data-provide="datepicker" style="z-index:30;" - data-date-format="M-yyyy" data-date-min-view-mode="1"> + data-date-format="M-yyyy" data-date-min-view-mode="1" readonly> - - $dieselStockDetails) { - - ?> + + + \ No newline at end of file diff --git a/app/Views/stock/drierMachineDetails.php b/app/Views/stock/drierMachineDetails.php index ee3a217e..3cf051d8 100644 --- a/app/Views/stock/drierMachineDetails.php +++ b/app/Views/stock/drierMachineDetails.php @@ -294,7 +294,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
- +
@@ -343,7 +343,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
- + @@ -452,7 +452,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y'); - @@ -682,7 +682,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
- @@ -717,7 +717,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
- + type="text" class="form-control" id="additionalEntryInputSandQtyId" name="input_sand_qty" value="" required>
- +
@@ -745,7 +745,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
+ type="text" class="form-control" id="additionalEntrySandDriedQtyId" name="sand_dried_qty" value="" required>
@@ -758,13 +758,13 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
+ type="text" class="form-control" id="additionalEntryTotalGasConsumptionId" name="total_gas_consumption" value="" required>
-
@@ -772,7 +772,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
-
@@ -780,7 +780,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
-
@@ -792,14 +792,14 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
- +
- +
diff --git a/app/Views/stock/dustAndRoughStockDetails.php b/app/Views/stock/dustAndRoughStockDetails.php index e799142e..c3435ccf 100644 --- a/app/Views/stock/dustAndRoughStockDetails.php +++ b/app/Views/stock/dustAndRoughStockDetails.php @@ -172,12 +172,14 @@ .fht-table thead { position: sticky; top: 0; - z-index: 20; /* Ensure the entire header stays above table rows */ - background-color: #50bbd9; /* Header background color */ + z-index: 20; + /* Ensure the entire header stays above table rows */ + background-color: #50bbd9; + /* Header background color */ } - .dropdown-menu { - z-index :25 ; + .dropdown-menu { + z-index: 25; } @@ -186,8 +188,10 @@ .fht-table thead th { position: sticky; top: 0; - z-index: 11; /* Higher than table rows but lower than first column */ - background-color: #50bbd9; /* Green background */ + z-index: 11; + /* Higher than table rows but lower than first column */ + background-color: #50bbd9; + /* Green background */ color: #ffffff; border: 1px solid #ddd; padding: 10px; @@ -199,7 +203,8 @@ position: sticky; left: 0; background-color: #50bbd9; - z-index: 15; /* Ensures it stays above other cells */ + z-index: 15; + /* Ensures it stays above other cells */ border-right: 2px solid #ddd; color: #ffffff; } @@ -207,23 +212,25 @@ /* Table Wrapper for Scrolling */ .table-responsive { overflow-x: auto; - overflow-y: auto; - max-height: 500px; /* Adjust as needed */ + overflow-y: auto; + max-height: 500px; + /* Adjust as needed */ position: relative; } - td{ - min-width: 100px; - max-width: 100px; + td { + min-width: 150px; + max-width: 150px; } - - - - - + th { + min-width: 150px; + max-width: 150px; + } + +
@@ -263,7 +270,7 @@
" class="form-control mt-2" data-provide="datepicker" - data-date-format="M-yyyy" data-date-min-view-mode="1"> + data-date-format="M-yyyy" data-date-min-view-mode="1" readonly>
@@ -372,10 +379,10 @@
stock ?> 0 CategoryName ?> HSNCODE ?> IsActive == 1) { @@ -501,32 +504,6 @@ $(document).ready(function () { + + \ No newline at end of file diff --git a/app/Views/stock/CoatingMachineDetail.php b/app/Views/stock/CoatingMachineDetail.php index 6dea2e9d..03b7d201 100644 --- a/app/Views/stock/CoatingMachineDetail.php +++ b/app/Views/stock/CoatingMachineDetail.php @@ -296,7 +296,7 @@ + class="form-control monthpicker" id="monthpicker" readonly> diff --git a/app/Views/stock/bagStockDetails.php b/app/Views/stock/bagStockDetails.php index d95a023c..6b529812 100644 --- a/app/Views/stock/bagStockDetails.php +++ b/app/Views/stock/bagStockDetails.php @@ -13,6 +13,14 @@ margin: 0; } + .grab { + cursor: grab; /* Default open-hand cursor */ + } + + .grab:active { + cursor: grabbing; /* Closed-hand cursor when dragging */ + } + .fht-table td { text-align: center; } @@ -297,12 +305,26 @@
" class="form-control mt-2" data-provide="datepicker" - data-date-format="M-yyyy" data-date-min-view-mode="1"> + data-date-format="M-yyyy" data-date-min-view-mode="1" readonly>
-
material Material
Moisture Loss Qty (Metric Ton) Dust Qty (Metric Ton)Customer NameCustomer Name Action +
- - - - + + + + @@ -509,6 +516,7 @@ $('#loader').hide(); console.log(data); alert(data); + window.location.reload(); } }, diff --git a/app/Views/stock/gasStockDetails.php b/app/Views/stock/gasStockDetails.php index 406a7da0..672242db 100644 --- a/app/Views/stock/gasStockDetails.php +++ b/app/Views/stock/gasStockDetails.php @@ -262,7 +262,7 @@
" class="form-control mt-2" data-provide="datepicker" - data-date-format="M-yyyy" data-date-min-view-mode="1"> + data-date-format="M-yyyy" data-date-min-view-mode="1" readonly>
@@ -478,14 +478,14 @@ // Sum values for the material $summary["opening"] = 0 ; - $summary["purchaseBharath"] = is_numeric($gasStockDetail['purchaseBharath']) ? $gasStockDetail['purchaseBharath'] : 0 ; + $summary["purchaseBharath"] += is_numeric($gasStockDetail['purchaseBharath']) ? $gasStockDetail['purchaseBharath'] : 0 ; $summary["purchaseIndian"] += is_numeric($gasStockDetail['purchaseIndian']) ? $gasStockDetail['purchaseIndian'] : 0 ; $summary["total"] += is_numeric($gasStockDetail['total']) ? $gasStockDetail['total'] : 0 ; $summary["consumption"] += is_numeric($gasStockDetail['consumption']) ? $gasStockDetail['consumption'] : 0 ; $summary["balanceStock"] += is_numeric($gasStockDetail['balanceStock']) ? $gasStockDetail['balanceStock'] : 0 ; - $summary["drierMachineGasConsumption"] = is_numeric( $gasStockDetail['drierMachineGasConsumption']) ? $gasStockDetail['drierMachineGasConsumption'] : 0 ; - $summary["sandDried"] = is_numeric( $gasStockDetail['sandDried']) ? $gasStockDetail['sandDried'] : 0 ; + $summary["drierMachineGasConsumption"] += is_numeric( $gasStockDetail['drierMachineGasConsumption']) ? $gasStockDetail['drierMachineGasConsumption'] : 0 ; + $summary["sandDried"] += is_numeric( $gasStockDetail['sandDried']) ? $gasStockDetail['sandDried'] : 0 ; $summary["coatingMachineGasconsumption"] += is_numeric($gasStockDetail['coatingMachineGasconsumption']) ? $gasStockDetail['coatingMachineGasconsumption'] : 0 ; $summary["coatedSand"] += is_numeric($gasStockDetail['coatedSand']) ? $gasStockDetail['coatedSand'] : 0 ; $summary["trp_panel_gas_consumption"] += is_numeric($gasStockDetail['trp_panel_gas_consumption']) ? $gasStockDetail['trp_panel_gas_consumption'] : 0 ; diff --git a/app/Views/stock/incomingSilicaSandDetails.php b/app/Views/stock/incomingSilicaSandDetails.php index 080ee3fe..8f84ac0e 100644 --- a/app/Views/stock/incomingSilicaSandDetails.php +++ b/app/Views/stock/incomingSilicaSandDetails.php @@ -4,6 +4,10 @@ text-align: right; } + .side-table tbody td{ + padding:3px !important ; + } + .fht-table, .fht-table thead, .fht-table tfoot, @@ -292,7 +296,7 @@
- " class="form-control mt-2" data-provide="datepicker" data-date-format="M-yyyy" data-date-min-view-mode="1"> + " class="form-control mt-2" data-provide="datepicker" data-date-format="M-yyyy" data-date-min-view-mode="1" readonly>
@@ -704,7 +708,7 @@
- + @@ -813,7 +817,7 @@ - + @@ -1018,7 +1022,7 @@
-
Total Final Rough Dust Total Total Final Rough Dust Total
-
total
Total
-
Supplier NameSupplier Name
+
@@ -1497,7 +1501,7 @@ function calculateRow(value){ - var table = $('#meshTableId'); + var table = $('#meshTableId'); if( value != "moistureValue" ){ var tr = $(value).closest('tr'); @@ -1610,7 +1614,7 @@ $(document).ready(function() { + + \ No newline at end of file diff --git a/app/Views/stock/powerConsumptionDetails.php b/app/Views/stock/powerConsumptionDetails.php index a8c272c8..2de8b655 100644 --- a/app/Views/stock/powerConsumptionDetails.php +++ b/app/Views/stock/powerConsumptionDetails.php @@ -17,6 +17,14 @@ text-align: center; } + .grab { + cursor: grab; /* Default open-hand cursor */ + } + + .grab:active { + cursor: grabbing; /* Closed-hand cursor when dragging */ + } + /* .fht-table td[contenteditable="true"] { background-color: lightyellow; color:rgb(13, 7, 7); @@ -295,12 +303,26 @@ foreach ($period as $day) { " class="form-control mt-2" data-provide="datepicker" style="z-index:30;" - data-date-format="M-yyyy" data-date-min-view-mode="1"> + data-date-format="M-yyyy" data-date-min-view-mode="1" readonly> - - + + \ No newline at end of file diff --git a/app/Views/stock/resinStockDetails.php b/app/Views/stock/resinStockDetails.php index 502b17ee..0f8b0693 100644 --- a/app/Views/stock/resinStockDetails.php +++ b/app/Views/stock/resinStockDetails.php @@ -302,15 +302,23 @@ foreach ($period as $day) {
" class="form-control mt-2" data-provide="datepicker" - data-date-format="M-yyyy" data-date-min-view-mode="1"> + data-date-format="M-yyyy" data-date-min-view-mode="1" readonly>
+ + +
+ + + + + + +
+ + + + +
+ +
+ + + " + class="form-control mt-2" data-provide="datepicker" + data-date-format="M-yyyy" data-date-min-view-mode="1"> + @@ -336,7 +433,7 @@ foreach ($period as $day) {
- + @@ -656,71 +753,7 @@ foreach ($period as $day) { - -
- -
@@ -1140,12 +1173,6 @@ foreach ($period as $day) { let materialCode = checkbox.value; let materialName = container.querySelector("label").innerText; - let dropdown = document.getElementById("customizeHeader"); - let newOption = document.createElement("option"); - newOption.value = materialCode; - newOption.text = materialName; - dropdown.appendChild(newOption); - container.remove(); }; @@ -1162,7 +1189,7 @@ foreach ($period as $day) { container.id = materialCode + "_container"; container.innerHTML = `
@@ -1171,7 +1198,6 @@ foreach ($period as $day) { attachDragEvents(container); document.getElementById("sortableList").appendChild(container); - dropdown.removeChild(selectedOption); } }; }); diff --git a/app/Views/stock/trpProductionStockDetails.php b/app/Views/stock/trpProductionStockDetails.php index 670d81c1..fcb5ada9 100644 --- a/app/Views/stock/trpProductionStockDetails.php +++ b/app/Views/stock/trpProductionStockDetails.php @@ -321,7 +321,7 @@ $timeOtions[] = "12:00 AM";
" class="form-control mt-2" data-provide="datepicker" - data-date-format="M-yyyy" data-date-min-view-mode="1"> + data-date-format="M-yyyy" data-date-min-view-mode="1" readonly>
@@ -494,6 +494,9 @@ $timeOtions[] = "12:00 AM";
-
- - - - +

Abstract for the month

@@ -1457,7 +1460,7 @@ $timeOtions[] = "12:00 AM";
Accepted
material Material
- + @@ -1466,25 +1469,409 @@ $timeOtions[] = "12:00 AM"; - + + $trpAbstractEach){ + + $particulars = $trpAbstractEach['particulars']; + + switch ($particulars) { + case "Incoming Raw Sand Details": ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParticularsParticulars Running Hours Per Hour Opening StockConsumption Closing Stock Physical StockRemarksRemarks
+ +
+ +
dummy dummy dummy dummy dummy dummy dummy dummy dummy dummy
Incoming Raw Sand Details
ED Details + +
TRP Total Sand
Trp Physical Gas Consumption
Trp Panel Gas Consumption
Water Consumption
Power Consumption
@@ -2014,74 +2401,3 @@ $timeOtions[] = "12:00 AM"; - - \ No newline at end of file diff --git a/app/Views/stock/trpSandUseStockDetails.php b/app/Views/stock/trpSandUseStockDetails.php index ef86e42b..9fe0ee10 100644 --- a/app/Views/stock/trpSandUseStockDetails.php +++ b/app/Views/stock/trpSandUseStockDetails.php @@ -172,12 +172,14 @@ .fht-table thead { position: sticky; top: 0; - z-index: 20; /* Ensure the entire header stays above table rows */ - background-color: #50bbd9; /* Header background color */ + z-index: 20; + /* Ensure the entire header stays above table rows */ + background-color: #50bbd9; + /* Header background color */ } - .dropdown-menu { - z-index :25 ; + .dropdown-menu { + z-index: 25; } @@ -186,14 +188,13 @@ .fht-table thead th { position: sticky; top: 0; - z-index: 11; /* Higher than table rows but lower than first column */ - background-color: #50bbd9; /* Green background */ + z-index: 11; + /* Higher than table rows but lower than first column */ + background-color: #50bbd9; + /* Green background */ color: #ffffff; border: 1px solid #ddd; padding: 10px; - white-space: normal; /* Allows text to wrap */ - word-wrap: break-word; /* Breaks long words if needed */ - text-align: center; /* Centers text for better alignment */ } /* Sticky First Column */ @@ -202,7 +203,8 @@ position: sticky; left: 0; background-color: #50bbd9; - z-index: 15; /* Ensures it stays above other cells */ + z-index: 15; + /* Ensures it stays above other cells */ border-right: 2px solid #ddd; color: #ffffff; } @@ -210,22 +212,16 @@ /* Table Wrapper for Scrolling */ .table-responsive { overflow-x: auto; - overflow-y: auto; - max-height: 500px; /* Adjust as needed */ + overflow-y: auto; + max-height: 500px; + /* Adjust as needed */ position: relative; } - td{ - min-width: 100px; - max-width: 100px; + td { + min-width: 150px; + max-width: 150px; } - - - - - - - @@ -269,7 +265,7 @@
" class="form-control mt-2" data-provide="datepicker" - data-date-format="M-yyyy" data-date-min-view-mode="1"> + data-date-format="M-yyyy" data-date-min-view-mode="1" readonly>
@@ -382,7 +378,7 @@ } ?> -
+
@@ -544,6 +540,7 @@ $('#loader').hide(); console.log(data); alert(data); + window.location.reload(); } }, diff --git a/app/Views/supplierListing.php b/app/Views/supplierListing.php index 380c84a8..9fd8c7ee 100755 --- a/app/Views/supplierListing.php +++ b/app/Views/supplierListing.php @@ -82,24 +82,28 @@ - -
-
- - -
- -
+ id="resetButton" title="Reset">
+ +
+
+
+ + style="width: 18px; height: 18px;"> + + +
+ +
+ +
@@ -124,12 +128,7 @@ foreach ($userRecords as $record) { ?> - " - style="IsActive == 0) { - echo "display:none"; - } ?>"> + CreatedOn)) == "30-11--0001") { $cdate = '00-00-0000'; @@ -491,30 +490,16 @@ function formatNumberToIndianCurrency(number) { } }); }); + + + - function showArchiveList() { - let isChecked = $("#showArchiveId").prop('checked'); + \ No newline at end of file diff --git a/app/Views/transporterListing.php b/app/Views/transporterListing.php index bd8c4173..ecc666ee 100755 --- a/app/Views/transporterListing.php +++ b/app/Views/transporterListing.php @@ -121,21 +121,27 @@ -
+
+ + + +
+
style="width: 18px; height: 18px;"> + + +
-
-
@@ -156,11 +162,8 @@ $date = $createdat->format('d-m-Y'); $time = $createdat->format('h:i A'); ?> - " style="isactive == 0) { - echo "display:none"; - } ?>"> + + @@ -423,30 +426,6 @@ } - function showArchiveList() { - let isChecked = $("#showArchiveId").prop('checked'); - - // Show or hide the rows based on checkbox status - $(".deactivatedRow").each(function () { - if (isChecked) { - $(this).show(); - } else { - $(this).hide(); - } - }); - } - - $(document).ready(function () { - let table = $('#transporter_list').DataTable(); - - showArchiveList(); - - table.on('draw', function () { - showArchiveList(); - }); - - }); - @@ -458,4 +437,13 @@ $(document).on('keydown', function(event) { } }); + + + \ No newline at end of file diff --git a/app/Views/userListing.php b/app/Views/userListing.php index 037bc220..f0c28c68 100755 --- a/app/Views/userListing.php +++ b/app/Views/userListing.php @@ -88,22 +88,26 @@ -
-
- - -
- -
-
+ +
+
+
+ + style="width: 18px; height: 18px;"> + + +
+
+ + +
name ?> FirstName ?>
@@ -128,12 +132,7 @@ ?> - " - style="isDeleted == 1) { - echo "display:none"; - } ?>"> + createdDtm)) == "30-11--0001") { $cdate = '00-00-0000'; @@ -295,29 +294,11 @@ }); }); + - function showArchiveList() { - let isChecked = $("#showArchiveId").prop('checked'); - - // Show or hide the rows based on checkbox status - $(".deactivatedRow").each(function () { - if (isChecked) { - $(this).show(); - } else { - $(this).hide(); - } - }); - } - - $(document).ready(function () { - let table = $('#user_list_table').DataTable(); - - showArchiveList(); - - table.on('draw', function () { - showArchiveList(); - }); - + \ No newline at end of file diff --git a/app/Views/viewinwardgateregister.php b/app/Views/viewinwardgateregister.php index 5bf60e71..ee09d429 100755 --- a/app/Views/viewinwardgateregister.php +++ b/app/Views/viewinwardgateregister.php @@ -9,6 +9,13 @@ text-align: right; } + #Inwardgateregistertable1 thead tr th{ + + width: 150px; + word-wrap: break-word; + white-space: normal; + } + th { white-space: nowrap; } @@ -232,7 +239,8 @@ CreatedDate); @@ -242,8 +250,17 @@ - - + @@ -485,7 +502,9 @@ - + + + @@ -632,6 +651,259 @@ + + + + + + + +
- IGRNO ?> + + + + IGRNO ?> + + PONO ?> @@ -340,7 +357,7 @@
# Item CodeItem DescriptionItem Description UOM Ordered Qty Received QtyTaxable Amt Total Amt RemarksCalculate Net Weight
+ + + + + + + + + + + + + + + + + + + + + +
Full Cylinder DateEmpty Cylinder DateInvoice NoCylinder NoGross WeightTare WeightNet WeightActual WeightShortageIDAction
+ + +
+ +
+
+
+ + + + + + + + + + + + + +
' + i + '' + item.MaterialCode + '' + amount + '' + grand_total_amount + '
' + amount + '' + grand_total_amount + '
' + tax_percentage + '' + amount + '' + grand_total_amount + '
- - - - - - - - - - - - - - - - - - - - - - -
Due AmountBalance Amount Debit Date
Due_Amount, 2); ?>Balance_Amount, 2); ?>Entry_Date); echo $entryDate->format('F j, Y, g:i A'); ?>
No Loan History Found
-
+
+

Loan History

+ + + + + + + + + + + + + + + + + + + + + + + +
Due AmountBalance Amount Debit Date
Due_Amount, 2); ?>Balance_Amount, 2); ?>Entry_Date); + echo $entryDate->format('F j, Y, g:i A'); ?>
No Loan History Found
+
@@ -383,10 +381,6 @@ if (!empty($emppay)) {
+ \ No newline at end of file diff --git a/app/Views/editRevenueAmendPO.php b/app/Views/editRevenueAmendPO.php index 46dff31a..be615a82 100755 --- a/app/Views/editRevenueAmendPO.php +++ b/app/Views/editRevenueAmendPO.php @@ -1554,7 +1554,7 @@ if (!empty($INRSYMBOL)) {
-

+

@@ -2270,6 +2270,7 @@ if (!empty($INRSYMBOL)) { $('#BudgetType').attr("style", "pointer-events: none;"); $('#EditRevenue').click(function () { + console.log("####"); tinyMCE.triggerSave(); if (validateEditRevenueTax() && validateEditExceedLimit()) { var CostCode = $("#EditCostCenter").val(); @@ -2407,7 +2408,7 @@ if (!empty($INRSYMBOL)) { } function populateValueMainFormForEditRevenueTax() { - var rows = document.getElementById('revenueTax').rows.length; + var rows = $('#revenueTax tbody tr').length; var totBasicAmt = 0; var totDiscountAmt = 0; var totPackagingAmt = 0; @@ -2483,7 +2484,8 @@ if (!empty($INRSYMBOL)) { + + + + + + + From a0e93ab1324dfa8df5fbe620f12c3a7e3b9fbab5 Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Wed, 5 Mar 2025 12:30:11 +0530 Subject: [PATCH 06/14] changes in supplier module 05-03-2025 --- app/Controllers/Inwardgateregister.php | 1 + app/Views/viewinwardgateregister.php | 27 ++++++++++++++++++++++---- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/app/Controllers/Inwardgateregister.php b/app/Controllers/Inwardgateregister.php index e7f3a97a..b709be63 100755 --- a/app/Controllers/Inwardgateregister.php +++ b/app/Controllers/Inwardgateregister.php @@ -691,6 +691,7 @@ function viewIGRDetails() $IGRNO = $this->request->getPost('id'); $data['details'] = $this->inwardgateregister_model->viewigr($IGRNO); + $TaxInPercentage = 0; for ($i = 0; $i < count($data['details']); $i++) { $details = $data['details'][$i]; diff --git a/app/Views/viewinwardgateregister.php b/app/Views/viewinwardgateregister.php index c73bcc47..adebd413 100755 --- a/app/Views/viewinwardgateregister.php +++ b/app/Views/viewinwardgateregister.php @@ -1273,8 +1273,9 @@ '' ; + let regex = /gas/i; - if(item.MaterialCategory == "gas"){ + if(regex.test(item.MaterialCategory) ){ $('#gasShortageHeader').show(); $('#gasShortageListHeader').show(); trIGRHTML += ' ' ; @@ -2461,8 +2462,17 @@ @@ -2535,9 +2545,16 @@ @@ -2572,6 +2589,8 @@ console.log(response.data); let data = response.data ; + console.log("gas shortage list"); + console.log(data); let tableData = ''; data.forEach((val) => { @@ -2601,7 +2620,7 @@ // Assuming you have a table with ID "gasShortageTable" $("#gasShortageTable tbody").html(tableData); - + } else { From c3c7cd95a06344771ea73b6e7792401422ec55cd Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Wed, 5 Mar 2025 13:58:54 +0530 Subject: [PATCH 07/14] changes in supplier module 05-03-2025 --- app/Views/editdepartment.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/Views/editdepartment.php b/app/Views/editdepartment.php index 11a4fc50..88fb7515 100755 --- a/app/Views/editdepartment.php +++ b/app/Views/editdepartment.php @@ -186,6 +186,12 @@ $("#deptBtnId").on('click',function(){ let depCode =$("#DEPCode").val(); let headDepCode = $("#HeadDept").val(); + + if(departmentName.length<1){ + alert(`Department Name cannot be empty..!!`); + return; + } + $('#loader').show(); $.ajax({ type:"POST", From 1c900d99b92b417a8664f334f64616b11b38f58d Mon Sep 17 00:00:00 2001 From: VE10-Sanjeev Date: Wed, 5 Mar 2025 08:53:06 +0000 Subject: [PATCH 08/14] monthly payroll dropdown : ps --- app/Models/Payroll_model.php | 18 ++++++++- app/Models/Requistion_model.php | 4 +- app/Views/alterpurchaseorder.php | 64 +++++++++++++++--------------- app/Views/capitalpurchaseorder.php | 5 ++- app/Views/purchaseorder.php | 4 +- 5 files changed, 56 insertions(+), 39 deletions(-) diff --git a/app/Models/Payroll_model.php b/app/Models/Payroll_model.php index 3b71a779..48b7e907 100755 --- a/app/Models/Payroll_model.php +++ b/app/Models/Payroll_model.php @@ -172,11 +172,27 @@ class Payroll_model extends Model function getPayOn() { + // For Employee - old $builder = $this->db->table('t_monthly_pay_inputs') ->select('DISTINCT(Month_Year)') ->orderBy("Month_Year", "desc"); $query = $builder->get(); - return $query->getResult(); + $result1 = $query->getResult(); + + // For Driver - new + $builder = $this->db->table('t_driver_monthly_pay_inputs') + ->select('DISTINCT(month_year) as Month_Year') + ->orderBy("month_year", "desc"); + $query = $builder->get(); + $result2 = $query->getResult(); + + $result = array_merge($result1, $result2); + // removed duplicates - refer gpt - gpt solved + $unique = array_map("unserialize", array_unique(array_map("serialize", $result))); + return $unique; + + + } function getBankInfo($bank = "") diff --git a/app/Models/Requistion_model.php b/app/Models/Requistion_model.php index 47a68809..28af2c0d 100755 --- a/app/Models/Requistion_model.php +++ b/app/Models/Requistion_model.php @@ -387,9 +387,7 @@ class Requistion_model extends Model $this->db->transComplete(); // Complete transaction try { - $result = ($result) ? $result : false; - if ($result && $affected_rows > 0) { - + if ($affected_rows > 0) { $subQuery = 'SELECT ReqNo FROM t_requestion_master ORDER BY CreatedDate DESC LIMIT 1'; $query = $this->db->query($subQuery); diff --git a/app/Views/alterpurchaseorder.php b/app/Views/alterpurchaseorder.php index 02eac8c8..8effcdeb 100755 --- a/app/Views/alterpurchaseorder.php +++ b/app/Views/alterpurchaseorder.php @@ -7240,24 +7240,24 @@ if (!empty($INRSYMBOL)) { // Perform form validation - if (serviceValidate()) { - // if (document.getElementById('serviceTax').rows.length < 2) { - // alert('Please Select Line item to Create PO'); - // $('#Deliverydt').focus(); - // return false; - // } else if ($('#Otherpayment').val() == '' && $('#PaymentMethod').val() == 'PT08') { - // alert('Please Enter Other Payable Terms Description'); - // $('#Otherpayment').focus(); - // return false; - // } else if ($('#emergdescofpo').val().trim() == '') { - // alert('Please Enter Description Of Service'); - // $('#emergdescofpo').focus(); - // return false; - // } else if ($('#PoTypeOptions').val() == "0") { - // alert('Please Select POType'); - // $('#PoTypeOptions').focus(); - // return false; - // } else { + if (validate()) { + if (document.getElementById('serviceTax').rows.length < 2) { + alert('Please Select Line item to Create PO'); + $('#Deliverydt').focus(); + return false; + } else if ($('#Otherpayment').val() == '' && $('#PaymentMethod').val() == 'PT08') { + alert('Please Enter Other Payable Terms Description'); + $('#Otherpayment').focus(); + return false; + } else if ($('#emergdescofpo').val().trim() == '') { + alert('Please Enter Description Of Service'); + $('#emergdescofpo').focus(); + return false; + } else if ($('#PoTypeOptions').val() == "0") { + alert('Please Select POType'); + $('#PoTypeOptions').focus(); + return false; + } else { // Submit the form using AJAX $('#loader').show(); // disableButtons(); @@ -7288,7 +7288,7 @@ if (!empty($INRSYMBOL)) { // setTimeout(function() { enableButtons(); }, 2000); } }); - // } + } } } @@ -7354,20 +7354,20 @@ if (!empty($INRSYMBOL)) { // Perform form validation - if (revenueValidate()) { - // if (document.getElementById('serviceTax').rows.length < 2) { - // alert('Please Select Line item to Create PO'); - // $('#Deliverydt').focus(); - // return false; - // } else if ($('#insuranceStatus').val() == 'YES' && $('#InsuranceNumber').val() == '') { - // alert('Please Enter Insurance Number..!'); + if (validate()) { + if (document.getElementById('serviceTax').rows.length < 2) { + alert('Please Select Line item to Create PO'); + $('#Deliverydt').focus(); + return false; + } else if ($('#insuranceStatus').val() == 'YES' && $('#InsuranceNumber').val() == '') { + alert('Please Enter Insurance Number..!'); - // return false; - // } else if ($('#PaymentMethod').val() == 'PT08' && $('#Otherpayment').val() == '') { - // alert('Please Enter Other Payment Description..!'); + return false; + } else if ($('#PaymentMethod').val() == 'PT08' && $('#Otherpayment').val() == '') { + alert('Please Enter Other Payment Description..!'); - // return false; - // } else { + return false; + } else { // Submit the form using AJAX $('#loader').show(); // disableButtons(); @@ -7393,7 +7393,7 @@ if (!empty($INRSYMBOL)) { // setTimeout(function() { enableButtons(); }, 2000); } }); - // } + } } } diff --git a/app/Views/capitalpurchaseorder.php b/app/Views/capitalpurchaseorder.php index fffe84d9..3022c0dd 100755 --- a/app/Views/capitalpurchaseorder.php +++ b/app/Views/capitalpurchaseorder.php @@ -2547,6 +2547,7 @@ if (!empty($INRSYMBOL)) { }); } + $("#PaymentMethod").trigger('change'); }); @@ -5401,9 +5402,11 @@ if (!empty($INRSYMBOL)) { $("#PaymentMethod").change(function() { if ($('#PaymentMethod').val().trim() == 'PT08') { $('#otheroptiondiv').show(); + $('#Otherpayment').prop('required', true); } else { $('#otheroptiondiv').hide(); - $('#Otherpayment').val(''); + $('#Otherpayment').prop('required', false); + $('#Otherpayment').val(''); } }); diff --git a/app/Views/purchaseorder.php b/app/Views/purchaseorder.php index e5210f26..c7e71882 100755 --- a/app/Views/purchaseorder.php +++ b/app/Views/purchaseorder.php @@ -291,9 +291,9 @@ if (!empty($INRSYMBOL)) { }); } + $("#PaymentTerms").trigger('change'); }); - - + $('#drpSupplier').change(function() { var id = $('#drpSupplier').val(); From 70ad27c36c2c0750f662b698462d52178d14de2f Mon Sep 17 00:00:00 2001 From: VE10-Sanjeev Date: Wed, 5 Mar 2025 09:15:48 +0000 Subject: [PATCH 09/14] foot mistake : ps --- app/Views/monthlypayinputs.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/Views/monthlypayinputs.php b/app/Views/monthlypayinputs.php index f185fc18..4989dffd 100755 --- a/app/Views/monthlypayinputs.php +++ b/app/Views/monthlypayinputs.php @@ -1191,7 +1191,7 @@ $(document).ready(function () { var driverSalaryAdd = driverEarn + Festivals; var driverSalarySub = current_loan_amt; - console.log(current_loan_amt); + console.log("current loan amt == ",current_loan_amt); var driverMonthSalary = driverSalaryAdd - driverSalarySub @@ -1202,7 +1202,7 @@ $(document).ready(function () { document.getElementById("empsal" + sno).innerHTML = cals; // copied from calculategrandtotal() because we need those two only thats why - var AutoLoanDueIndex = 21; + var AutoLoanDueIndex = 22; var AutoLoanDue = 0; $('#monthlylistings tbody tr').each(function() { var value = $(this).find('td').eq(AutoLoanDueIndex).text(); @@ -1210,7 +1210,7 @@ $(document).ready(function () { }); $('#monthloan').text(AutoLoanDue); - var FestivalBonusIndex = 23; + var FestivalBonusIndex = 24; var FestivalBonus = 0; $('#monthlylistings tbody tr').each(function() { var value = $(this).find('td').eq(FestivalBonusIndex).text(); @@ -1218,7 +1218,7 @@ $(document).ready(function () { }); $('#fest').text(FestivalBonus); - var EstimateIndex = 24; + var EstimateIndex = 25; var Estimate = 0; $('#monthlylistings tbody tr').each(function() { var value = $(this).find('td').eq(EstimateIndex).text(); @@ -1230,7 +1230,7 @@ $(document).ready(function () { function calculategrandtotal() { - var AutoLoanDueIndex = 21; + var AutoLoanDueIndex = 22; var AutoLoanDue = 0; $('#monthlylistings tbody tr').each(function() { var value = $(this).find('td').eq(AutoLoanDueIndex).text(); @@ -1238,7 +1238,7 @@ $(document).ready(function () { }); $('#monthloan').text(AutoLoanDue); - var TDSDeductionsIndex = 22; + var TDSDeductionsIndex = 23; var TDSDeductions = 0; $('#monthlylistings tbody tr').each(function() { var value = $(this).find('td').eq(TDSDeductionsIndex).text(); @@ -1246,7 +1246,7 @@ $(document).ready(function () { }); $('#other').text(TDSDeductions); - var FestivalBonusIndex = 23; + var FestivalBonusIndex = 24; var FestivalBonus = 0; $('#monthlylistings tbody tr').each(function() { var value = $(this).find('td').eq(FestivalBonusIndex).text(); @@ -1254,7 +1254,7 @@ $(document).ready(function () { }); $('#fest').text(FestivalBonus); - var EstimateIndex = 24; + var EstimateIndex = 25; var Estimate = 0; $('#monthlylistings tbody tr').each(function() { var value = $(this).find('td').eq(EstimateIndex).text(); From d7a1e8561c517a0a6d57d177b4e710900a45fb01 Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Wed, 5 Mar 2025 18:55:58 +0530 Subject: [PATCH 10/14] changes in supplier module 05-03-2025 --- app/Controllers/StockController.php | 34 +++++++++++--------- app/Models/CoatingMachineDetailsModel.php | 2 +- app/Models/FactoryMachineModel.php | 2 +- app/Models/GasStockModel.php | 2 +- app/Views/stock/CoatingMachineDetail.php | 27 +++++++--------- app/Views/stock/dustAndRoughStockDetails.php | 5 ++- 6 files changed, 37 insertions(+), 35 deletions(-) diff --git a/app/Controllers/StockController.php b/app/Controllers/StockController.php index 00299d0a..354eca66 100644 --- a/app/Controllers/StockController.php +++ b/app/Controllers/StockController.php @@ -526,7 +526,7 @@ class StockController extends BaseController $startDate = "$month-01"; $endDate = date("Y-m-t", strtotime($startDate)); $data['coatingMachineDetails'] = $this->coatingMachineDetails_model - ->select('t_coatingMachineDetails.*, + ->select('t_coatingmachinedetails.*, JSON_ARRAYAGG( JSON_OBJECT( "client_given_name", t_batchcard_files.client_file_name, @@ -535,11 +535,11 @@ class StockController extends BaseController "coating_id", t_batchcard_files.coating_id ) ) as batchcard_files') - ->join('t_batchcard_files', 't_batchcard_files.coating_id = t_coatingMachineDetails.id', 'left') - ->where('t_coatingMachineDetails.date >=', $startDate) - ->where('t_coatingMachineDetails.date <=', $endDate) - ->groupBy('t_coatingMachineDetails.id') - ->orderBy('t_coatingMachineDetails.date', 'asc') + ->join('t_batchcard_files', 't_batchcard_files.coating_id = t_coatingmachinedetails.id', 'left') + ->where('t_coatingmachinedetails.date >=', $startDate) + ->where('t_coatingmachinedetails.date <=', $endDate) + ->groupBy('t_coatingmachinedetails.id') + ->orderBy('t_coatingmachinedetails.date', 'asc') ->findAll(); @@ -606,6 +606,7 @@ class StockController extends BaseController if (!empty($batchCardFiles) && !($batchCardFiles[0]->getError() === UPLOAD_ERR_NO_FILE)) { + foreach ($batchCardFiles as $file) { if ($file->isValid() && !$file->hasMoved()) { @@ -623,12 +624,14 @@ class StockController extends BaseController 'coating_id' => $insertedId ]; - $builder->insert($data); + $result = $builder->insert($data); + } } } } + } @@ -636,6 +639,7 @@ class StockController extends BaseController if ($this->db->transStatus() === false) { throw new \Exception('Transaction failed due to database errors.'); } + $this->db->transCommit(); @@ -905,7 +909,7 @@ class StockController extends BaseController $data['gasStockDetails'] = $this->gasStockDetails_model ->select( - 't_gasStockDetails.*, + 't_gasstockdetails.*, drier_summary.drierMachineGasconsumption AS drierMachineGasConsumption, drier_summary.driedSand AS sandDried, coating_summary.coatingMachineGasconsumption, @@ -916,31 +920,31 @@ class StockController extends BaseController '(SELECT date, SUM(totalGasconsumption) AS coatingMachineGasconsumption, SUM(totalCoatingSandInKg) / 1000 AS coatedSand - FROM t_coatingMachineDetails + FROM t_coatingmachinedetails WHERE is_active = 1 AND date >= ' . $this->db->escape($startDate) . ' AND date <= ' . $this->db->escape($endDate) . ' GROUP BY date ) AS coating_summary', - 'coating_summary.date = t_gasStockDetails.date', + 'coating_summary.date = t_gasstockdetails.date', 'left' ) ->join( '(SELECT date, SUM(total_gas_consumption) AS drierMachineGasconsumption, SUM(sand_dried_qty) AS driedSand - FROM t_drierMachineDetails + FROM t_driermachinedetails WHERE date >= ' . $this->db->escape($startDate) . ' AND date <= ' . $this->db->escape($endDate) . ' GROUP BY date ) AS drier_summary', - 'drier_summary.date = t_gasStockDetails.date', + 'drier_summary.date = t_gasstockdetails.date', 'left' ) - ->where('t_gasStockDetails.date >=', $startDate) - ->where('t_gasStockDetails.date <=', $endDate) - ->groupBy('t_gasStockDetails.date') + ->where('t_gasstockdetails.date >=', $startDate) + ->where('t_gasstockdetails.date <=', $endDate) + ->groupBy('t_gasstockdetails.date') ->findAll(); diff --git a/app/Models/CoatingMachineDetailsModel.php b/app/Models/CoatingMachineDetailsModel.php index 46819fe7..544478ba 100644 --- a/app/Models/CoatingMachineDetailsModel.php +++ b/app/Models/CoatingMachineDetailsModel.php @@ -6,7 +6,7 @@ use CodeIgniter\Model; class CoatingMachineDetailsModel extends Model { - protected $table = 't_coatingMachineDetails'; + protected $table = 't_coatingmachinedetails'; protected $primaryKey = 'id'; protected $useAutoIncrement = true; protected $returnType = 'array'; diff --git a/app/Models/FactoryMachineModel.php b/app/Models/FactoryMachineModel.php index 3e77c081..6c363b76 100644 --- a/app/Models/FactoryMachineModel.php +++ b/app/Models/FactoryMachineModel.php @@ -92,7 +92,7 @@ class FactoryMachineModel extends Model $result = $this->db->table('t_factorymachinemaster') ->where('is_active', 1) ->where('energy_type', 'diesel') - ->orderBy('id', 'asc') + ->orderBy('id', 'desc') ->get() ->getResultArray(); diff --git a/app/Models/GasStockModel.php b/app/Models/GasStockModel.php index 1f95543d..259807ce 100644 --- a/app/Models/GasStockModel.php +++ b/app/Models/GasStockModel.php @@ -6,7 +6,7 @@ use CodeIgniter\Model; class GasStockModel extends Model { - protected $table = 't_gasStockDetails'; + protected $table = 't_gasstockdetails'; protected $primaryKey = 'id'; protected $useAutoIncrement = true; protected $returnType = 'array'; diff --git a/app/Views/stock/CoatingMachineDetail.php b/app/Views/stock/CoatingMachineDetail.php index e22539d7..2e69cd0c 100644 --- a/app/Views/stock/CoatingMachineDetail.php +++ b/app/Views/stock/CoatingMachineDetail.php @@ -728,15 +728,13 @@
-
+
- + + +
-
- -
- - +
@@ -950,15 +948,12 @@
-
+
+
-
- -
- - +
@@ -1284,7 +1279,7 @@ } - let string = `
+ let string = `

( Previously Uploaded File ${element.client_given_name} )

@@ -1680,7 +1675,7 @@ return; } - let string = `
+ let string = `
@@ -1705,7 +1700,7 @@ return; } - let string = `
+ let string = `
diff --git a/app/Views/stock/dustAndRoughStockDetails.php b/app/Views/stock/dustAndRoughStockDetails.php index f394a58c..a9860050 100644 --- a/app/Views/stock/dustAndRoughStockDetails.php +++ b/app/Views/stock/dustAndRoughStockDetails.php @@ -269,9 +269,10 @@
" - class="form-control mt-2" data-provide="datepicker" + class="form-control datepicker mt-2 " data-provide="datepicker" data-date-format="M-yyyy" data-date-min-view-mode="1" readonly>
+
@@ -290,6 +291,8 @@
+ +
From 765600c4c6a3727e9c6fc31aab952b9f82d0651c Mon Sep 17 00:00:00 2001 From: VE10-Sanjeev Date: Wed, 5 Mar 2025 13:28:53 +0000 Subject: [PATCH 11/14] Alter , Payment terms , rate po bug --- app/Views/alterpurchaseorder.php | 34 +++++++++++++++++++----------- app/Views/capitalpurchaseorder.php | 34 ++++++++++++++++++------------ app/Views/importpo.php | 11 +++++++++- app/Views/purchaseorder.php | 11 +++++++--- app/Views/servicePurchaseorder.php | 9 +++++++- 5 files changed, 69 insertions(+), 30 deletions(-) diff --git a/app/Views/alterpurchaseorder.php b/app/Views/alterpurchaseorder.php index 8effcdeb..92943fb1 100755 --- a/app/Views/alterpurchaseorder.php +++ b/app/Views/alterpurchaseorder.php @@ -1838,8 +1838,16 @@ if (!empty($INRSYMBOL)) { function showsubmit() { var isChecked = $('#IsOpenOrder').is(':checked'); - // alert("isChecked: " + isChecked); + console.log("Step 1 = SS"); var PO = $('#POType').val(); + + if (PO == 'SERVICE') { + if ($('#emergdescofpo').val().trim() == '') { + alert('Please Enter Description Of Service'); + $('#emergdescofpo').focus(); + return false; + } + } if (isChecked) { if (PO == 'REVENUE') { @@ -6335,6 +6343,7 @@ if (!empty($INRSYMBOL)) { }); } + $("#PaymentMethod").trigger('change'); }); $(document).ready(function () { @@ -6406,6 +6415,18 @@ if (!empty($INRSYMBOL)) { } }); + + //If others is the payment terms to display mandatory field + $("#PaymentMethod").change(function () { + + if ($('#PaymentMethod').val().trim() == 'PT08') { + $('#otheroptiondiv').show(); + } else { + $('#otheroptiondiv').hide(); + $('#Otherpayment').val(''); + } + }); + /*get cost center name using department*/ var CostArray = ''; $('#DepartmentName').change(function () { @@ -8018,17 +8039,6 @@ if (!empty($INRSYMBOL)) { } - //If others is the payment terms to display mandatory field - $("#PaymentMethod").change(function () { - - if ($('#PaymentMethod').val().trim() == 'PT08') { - $('#otheroptiondiv').show(); - } else { - $('#otheroptiondiv').hide(); - $('#Otherpayment').val(''); - } - }); - // set default null value function clearTotalItemValues() { diff --git a/app/Views/capitalpurchaseorder.php b/app/Views/capitalpurchaseorder.php index 3022c0dd..d0624eb6 100755 --- a/app/Views/capitalpurchaseorder.php +++ b/app/Views/capitalpurchaseorder.php @@ -123,6 +123,18 @@ $('#editpackagingcalmodel').on('hidden.bs.modal', function() { $('#editpackagingcalmodel').css('z-index', ''); // Reset to default }); + + //If others is the payment terms to display mandatory field + $("#PaymentMethod").change(function() { + if ($('#PaymentMethod').val().trim() == 'PT08') { + $('#otheroptiondiv').show(); + $('#Otherpayment').prop('required', true); + } else { + $('#otheroptiondiv').hide(); + $('#Otherpayment').prop('required', false); + $('#Otherpayment').val(''); + } + }); });
- + 'Select Payment method'); @@ -722,7 +734,7 @@ if (!empty($INRSYMBOL)) { ?>
- + 'Select Payment Terms '); @@ -3946,7 +3949,7 @@ if (!empty($INRSYMBOL)) { // else { var formData = new FormData($('.CreatePO')[0]); - // disableButtons(); + $('#loader').show(); $.ajax({ type: "POST", @@ -3955,6 +3958,7 @@ if (!empty($INRSYMBOL)) { processData: false, contentType: false, success: function(data) { + $('#loader').hide(); if (data) { alert(data); @@ -3973,6 +3977,7 @@ if (!empty($INRSYMBOL)) { }, error: function(jqXHR, textStatus, errorThrown) { + $('#loader').hide(); console.error("AJAX Error: " + textStatus + ": " + errorThrown); alert("Error: " + textStatus); // setTimeout(function() { enableButtons(); }, 2000); diff --git a/app/Views/servicePurchaseorder.php b/app/Views/servicePurchaseorder.php index 74a51a19..88d6e852 100755 --- a/app/Views/servicePurchaseorder.php +++ b/app/Views/servicePurchaseorder.php @@ -208,6 +208,7 @@ if (!empty($INRSYMBOL)) { }); } + $("#PaymentTerms").trigger('change'); }); document.getElementById("Date").checked = true; @@ -369,6 +370,10 @@ if (!empty($INRSYMBOL)) { $('#otherdescription').show(); $('#OtheritemDescription').val(obj.MaterialDescription); } + + if(obj.material_rate != 0){ + Ratechange(); + } } }); } @@ -2402,7 +2407,7 @@ if (!empty($INRSYMBOL)) { // return false; // } else { var formData = new FormData($('.ServicePO')[0]); - // disableButtons(); + $('#loader').show(); console.log("inside add service purchase order view page"); console.log(formData); @@ -2415,6 +2420,7 @@ if (!empty($INRSYMBOL)) { processData: false, contentType: false, success: function(data) { + $('#loader').hide(); if (data) { alert(data); $('#txtRowCount').val(''); @@ -2424,6 +2430,7 @@ if (!empty($INRSYMBOL)) { window.location = "purchaseorderListing"; // setTimeout(function() { enableButtons(); }, 2000); } else { + $('#loader').hide(); alert("Error"); // setTimeout(function() { enableButtons(); }, 2000); } From ebb6265626f9bd320d1f6243f2e559e0b634f653 Mon Sep 17 00:00:00 2001 From: VE10-Sanjeev Date: Wed, 5 Mar 2025 14:03:25 +0000 Subject: [PATCH 12/14] Edit PO - Rate : ps --- app/Views/EditservicePurchaseorder.php | 5 +++++ app/Views/editCapitalPo.php | 5 +++++ app/Views/editRevenuepurchaseorder.php | 4 ++++ app/Views/editimportpo.php | 6 ++++++ app/Views/servicePurchaseorder.php | 6 +++--- public/assets/js/CreatePOValidation.js | 2 +- 6 files changed, 24 insertions(+), 4 deletions(-) diff --git a/app/Views/EditservicePurchaseorder.php b/app/Views/EditservicePurchaseorder.php index df5aafb0..8b4676d5 100755 --- a/app/Views/EditservicePurchaseorder.php +++ b/app/Views/EditservicePurchaseorder.php @@ -500,6 +500,7 @@ if (!empty($getlogpodtl)) { $("#ItemName").val(obj.MaterialName); $("#UOM").val(obj.UOM); $("#Quantity").val(obj.Quantity); + $("#Rate").val(obj.material_rate); RequistQuantity = obj.Quantity; var materialn = obj.MaterialName; @@ -510,6 +511,10 @@ if (!empty($getlogpodtl)) { $('#OtheritemDescription').val(obj.MaterialDescription); } + if(obj.material_rate != 0){ + Ratechange(); + } + } }); diff --git a/app/Views/editCapitalPo.php b/app/Views/editCapitalPo.php index 9991086e..cd22d284 100755 --- a/app/Views/editCapitalPo.php +++ b/app/Views/editCapitalPo.php @@ -3935,6 +3935,7 @@ if (!empty($getlogpodtl)) { $("#CPUOM").val(''); $("#CPQuantity").val(''); $("#CPTotalAmount").val(''); + $("#CPRate").val(''); RequistQuantity = ''; clearTaxField(); if (id != '0') { @@ -3946,12 +3947,16 @@ if (!empty($getlogpodtl)) { $("#CapitalItemName").val(obj.MaterialName); $("#CPUOM").val(obj.UOM); $("#CPQuantity").val(obj.Quantity); + $("#CPRate").val(obj.material_rate); RequistQuantity = obj.Quantity; var CPUOMDisplay = obj.UOM; $('#RateIn').html('Rate(in' + " " + DisplayCurrencySymbol + '/' + CPUOMDisplay + ')'); $('#EditRateIn').html('Rate(in' + " " + DisplayCurrencySymbol + '/' + CPUOMDisplay + ')'); + if(obj.material_rate != 0){ + Ratechange();calculateFreight(3);calculateFreightlocaddper(); + } diff --git a/app/Views/editRevenuepurchaseorder.php b/app/Views/editRevenuepurchaseorder.php index 2bcfd617..c68ab4c3 100755 --- a/app/Views/editRevenuepurchaseorder.php +++ b/app/Views/editRevenuepurchaseorder.php @@ -541,6 +541,10 @@ if (!empty($getlogpodtl)) { $("#ItemName").val(obj.MaterialName); $("#UOM").val(obj.UOM); $("#Quantity").val(obj.Quantity); + $("#Rate").val(obj.material_rate); + if(obj.material_rate != 0){ + change(); + } RequistQuantity = obj.Quantity; } }); diff --git a/app/Views/editimportpo.php b/app/Views/editimportpo.php index 4856b6e6..08252d8c 100755 --- a/app/Views/editimportpo.php +++ b/app/Views/editimportpo.php @@ -3375,6 +3375,12 @@ if (!empty($getlogpodtl)) { $("#ItemName").val(obj.MaterialName); $("#UOM").val(obj.UOM); $("#Quantity").val(obj.Quantity).trigger('change'); + $("#Rate").val(obj.material_rate); + if(obj.material_rate != 0){ + Ratechange(); + validateExceedLimit(); + calculateFreight(0); + } RequistQuantity = obj.Quantity; reqq = RequistQuantity; //RequistQuantity=parseFloat($('#Quantity').val()); diff --git a/app/Views/servicePurchaseorder.php b/app/Views/servicePurchaseorder.php index 88d6e852..c4ee6fde 100755 --- a/app/Views/servicePurchaseorder.php +++ b/app/Views/servicePurchaseorder.php @@ -1052,7 +1052,7 @@ if (!empty($INRSYMBOL)) {
- +
@@ -1071,7 +1071,7 @@ if (!empty($INRSYMBOL)) { -
SNo
+
@@ -2101,7 +2101,7 @@ if (!empty($INRSYMBOL)) { function populateValueMainFormForEditServiceTax() { - var rows = $('#serviceTax tbody tr').length; + var rows = $('#ServiceTable tbody tr').length; var TotCgst = 0; var TotSgst = 0; diff --git a/public/assets/js/CreatePOValidation.js b/public/assets/js/CreatePOValidation.js index 92e8ab86..559e8828 100755 --- a/public/assets/js/CreatePOValidation.js +++ b/public/assets/js/CreatePOValidation.js @@ -145,7 +145,7 @@ function serviceValidate(){ alert('Please Select Budget Type'); $('#BudgetType').focus(); return false; - }else if ($('#serviceTax tbody tr').length < 1) { + }else if ($('#ServiceTable tbody tr').length < 1) { alert('Atleast One Line needed'); return false; } else if ($('#descofpo').val().trim() == '') { From bdcfe0c01e61990891c3a3ea1751804f9d35e9e7 Mon Sep 17 00:00:00 2001 From: VE10-Sanjeev Date: Thu, 6 Mar 2025 07:14:45 +0000 Subject: [PATCH 13/14] Fixes : ps --- app/Controllers/Payslip.php | 17 +- app/Controllers/Purchaseorder.php | 1 - app/Models/Driver_model.php | 2 +- app/Views/EditservicePurchaseorder.php | 2362 +++++++++++----------- app/Views/driverPayslipGeneratePrint.php | 40 +- app/Views/editCapitalPo.php | 4 +- app/Views/editimportpo.php | 1052 +++++----- app/Views/monthlypayinputs.php | 47 +- app/Views/servicePurchaseorder.php | 18 +- public/assets/js/CreatePOValidation.js | 18 +- 10 files changed, 1777 insertions(+), 1784 deletions(-) diff --git a/app/Controllers/Payslip.php b/app/Controllers/Payslip.php index 977045c3..2adae210 100755 --- a/app/Controllers/Payslip.php +++ b/app/Controllers/Payslip.php @@ -801,10 +801,10 @@ class Payslip extends BaseController $loan = $Balance_Amount; } - $empSalaryAdd = $final_salary_amount+$shed+$diesel; + $empSalaryAdd = $final_salary_amount; $empSalarySub = $loan; - $salaryInCurrentday = $empSalaryAdd - $empSalarySub; - $load_driver_data[$i]->driver_final_payment = $salaryInCurrentday; + // $salaryInCurrentday = $empSalaryAdd - $empSalarySub; + // $load_driver_data[$i]->driver_final_payment = $salaryInCurrentday; $load_driver_data[$i]->payroll_id = $monthly_pay_array[$driver_id]->payroll_id; $load_driver_data[$i]->Festival_Bonus = $monthly_pay_array[$driver_id]->Festival_Bonus; @@ -871,8 +871,8 @@ class Payslip extends BaseController $empSalaryAdd = $final_salary_amount; $empSalarySub = $loan; - $salaryInCurrentday = $empSalaryAdd - $empSalarySub; - $load_driver_data[$i]->driver_final_payment = $salaryInCurrentday+$shed+$diesel; + // $salaryInCurrentday = $empSalaryAdd - $empSalarySub; + // $load_driver_data[$i]->driver_final_payment = $salaryInCurrentday+$shed+$diesel; $load_driver_data[$i]->total_cal_days = $get_last_date_of_the_month; } @@ -1236,6 +1236,7 @@ class Payslip extends BaseController 'total_shed_amount'=>$Shed, 'monthly_salary_amount'=>($Basic+$Food), 'final_payment'=>$Estimate, + 'BASIC'=>$Basic, 'HRA'=>$HRA, 'ESI'=>$ESI, 'PF'=>$PF, @@ -1421,8 +1422,10 @@ class Payslip extends BaseController $currentDayBasic = isset($Data['PayDetails'][0]->monthly_salary_amount) ? $Data['PayDetails'][0]->monthly_salary_amount : 0; $PF_Rate = $Data['PayDetails'][0]->PF_Rate; $ESI_Rate = $Data['PayDetails'][0]->ESI_Rate; - $Data['esi_amount'] = ($Data['PayDetails'][0]->esi_applicable == 1) ? $currentDayBasic * $ESI_Rate / 100 : 0; - $Data['pf_amount'] = ($Data['PayDetails'][0]->pf_applicable == 1) ? $currentDayBasic * $PF_Rate / 100 : 0; + // $Data['esi_amount'] = ($Data['PayDetails'][0]->esi_applicable == 1) ? $currentDayBasic * $ESI_Rate / 100 : 0; + // $Data['pf_amount'] = ($Data['PayDetails'][0]->pf_applicable == 1) ? $currentDayBasic * $PF_Rate / 100 : 0; + $Data['esi_amount'] = ($Data['PayDetails'][0]->esi_applicable == 1) ? $Data['PayDetails'][0]->ESI : 0; + $Data['pf_amount'] = ($Data['PayDetails'][0]->pf_applicable == 1) ? $Data['PayDetails'][0]->PF : 0; $html = view("driverPayslipGeneratePrint", $Data); }else{ //echo "EmpID" . $EmpID; diff --git a/app/Controllers/Purchaseorder.php b/app/Controllers/Purchaseorder.php index ee194634..dc0be372 100755 --- a/app/Controllers/Purchaseorder.php +++ b/app/Controllers/Purchaseorder.php @@ -3068,7 +3068,6 @@ class Purchaseorder extends BaseController $this->purchaseorder_model->insertlogpo($logpo); } } - // print_r($this->request->getPost());die; for ($i = 1; $i <= $RowCount; $i++) { $MaterialCode = $this->request->getPost('materialCode' . $i); diff --git a/app/Models/Driver_model.php b/app/Models/Driver_model.php index d0b5e716..97fecf21 100755 --- a/app/Models/Driver_model.php +++ b/app/Models/Driver_model.php @@ -285,7 +285,7 @@ class Driver_model extends Model $builder = $this->db->table('t_driver_payroll Pay')->select('Pay.*') ->select('Emp.EmpID,CONCAT_WS(" ", Emp.FirstName, Emp.LastName) as driver_name,Emp.DateofBirth as Dob,Emp.PANNo as Pan,Emp.BankBranchName as BankName,Emp.BankAccountNo as BankAccountNumber,Emp.IFSCCode as IFSCCode,Emp.DateofJoining as DOJ,Emp.AadharNo,Emp.Designation as Designation,Dep.DepartmentName as DeptName,Emp.esi_applicable,Emp.pf_applicable') ->select('t_emp_pay_data.PF_Rate,t_emp_pay_data.ESI_Rate') - ->select('month.Festival_Bonus,month.HRA,month.Loan_Recovered,month.total_diesel_amount,month.total_shed_amount') + ->select('month.Festival_Bonus,month.BASIC,month.HRA,month.Loan_Recovered,month.total_diesel_amount,month.total_shed_amount') // ->select('month.monthly_salary_amount,month.monthly_food_amount,month.Festival_Bonus,month.final_payment,month.HRA,month.ESI,month.PF,month.Loan_Recovered,month.total_diesel_amount,month.total_shed_amount') ->join('t_employee_details Emp', 'Pay.driver_id = Emp.EmpID') ->join('t_departmentdetails Dep', 'Emp.Departmentcode = Dep.DEPCode') diff --git a/app/Views/EditservicePurchaseorder.php b/app/Views/EditservicePurchaseorder.php index 8b4676d5..ae89c7d9 100755 --- a/app/Views/EditservicePurchaseorder.php +++ b/app/Views/EditservicePurchaseorder.php @@ -1,60 +1,61 @@ + }); + }); + "NO", "value" => "0"), @@ -148,6 +151,7 @@ if (!empty($MaxPODate)) { $MaxPoDate = $date->PODate; } } + if (!empty($POMaster)) { foreach ($POMaster as $Req) { @@ -279,8 +283,6 @@ if (!empty($getlogpodtl)) { }); - - + + + // Hide the edit container and show the tag + $editContainer.hide(); + $link.show(); + }); + }); + +
+
+ +
- - 'form-label-left ImportPO ', 'name' => 'ImportPO', 'id' => 'ImportPO', 'enctype' => 'multipart/form-data'); - echo form_open(base_url() . '/purchaseorder/addPO/', $attributes); ?> - - -
@@ -550,7 +548,6 @@ if (!empty($getlogpodtl)) {
-
@@ -615,7 +612,6 @@ if (!empty($getlogpodtl)) {
-
Check Today's Foreign Exchange value (Click here) @@ -809,6 +805,7 @@ if (!empty($getlogpodtl)) {
+
@@ -825,10 +822,10 @@ if (!empty($getlogpodtl)) {




-
-
- - +
+
+
+ @@ -841,10 +838,10 @@ if (!empty($getlogpodtl)) { - + + + + --> @@ -863,40 +860,37 @@ if (!empty($getlogpodtl)) { + echo $shortName; ?> + + + LineitemAuditorNotes) ? $record->LineitemAuditorNotes : "-"; + } ?> + - - - - + - + " /> @@ -936,8 +930,8 @@ if (!empty($getlogpodtl)) { - - + + @@ -947,7 +941,7 @@ if (!empty($getlogpodtl)) { - + @@ -955,10 +949,10 @@ if (!empty($getlogpodtl)) { - + - + @@ -973,7 +967,7 @@ if (!empty($getlogpodtl)) { - + @@ -992,7 +986,7 @@ if (!empty($getlogpodtl)) { - + -
SNoRate Basic Amount Rejected QtyPending QtyTax AmountTotal Order AmountAction
ReqNo ?> MaterialCode ?> MaterialName, 0, 13, "..."); - echo $shortName; ?> - - + + LineitemAuditorNotes) ? $record->LineitemAuditorNotes : "-"; ?> - - - LineitemAuditorNotes) ? $record->LineitemAuditorNotes : "-"; } ?> - Quantity ?> UOM ?> Rate ?> BasicValue ?>
-
-
-
-
+ +
+
-

- - +

@@ -1196,8 +1186,8 @@ if (!empty($getlogpodtl)) { > - - + +
@@ -1269,44 +1259,41 @@ if (!empty($getlogpodtl)) {
- - +
-
- - 'txtSpcialInstruction', 'value' => set_value('txtSpcialInstruction', strip_tags($ServiceDescription)), 'id' => 'txtSpcialInstruction', 'class' => 'form-control', 'rows' => '10', 'cols' => '40'); - echo form_textarea($data); - ?> -
+
+ + 'txtSpcialInstruction', 'value' => set_value('txtSpcialInstruction', strip_tags($ServiceDescription)), 'id' => 'txtSpcialInstruction', 'class' => 'form-control', 'rows' => '10', 'cols' => '40'); + echo form_textarea($data); + ?>
-
- +
- -
- - - -
- + +
+ + + +
+
@@ -1315,71 +1302,71 @@ if (!empty($getlogpodtl)) {
-
- - - - - - - - +
- + + + + + + + -   Cancel - -   Save as Draft - -   Submit -   Approve - - + - - - OK - - - -   Submit -   Approve - OK - +   Cancel + +   Save as Draft +   Submit +   Approve + + -
+ + OK + + + +   Submit +   Approve + OK + + + + +
-
- -
-
- 'AWAITING APPROVE', - 'AWAITING RELEASE' => 'AWAITING APPROVE', - 'RELEASER ONHOLD' => 'APPROVER ONHOLD', - 'PO RELEASED' => 'PO APPROVED', - ]; +
- if (isset($StatusName) && !empty($StatusName)) { - if (isset($statusMappings[$StatusName])) { - echo $statusMappings[$StatusName]; - } else { - echo $StatusName; - } +
+
+ 'AWAITING APPROVE', + 'AWAITING RELEASE' => 'AWAITING APPROVE', + 'RELEASER ONHOLD' => 'APPROVER ONHOLD', + 'PO RELEASED' => 'PO APPROVED', + ]; + + if (isset($StatusName) && !empty($StatusName)) { + if (isset($statusMappings[$StatusName])) { + echo $statusMappings[$StatusName]; } else { - echo "Status not provided"; + echo $StatusName; } - ?> - + } else { + echo "Status not provided"; + } + ?> +
@@ -1388,19 +1375,19 @@ if (!empty($getlogpodtl)) { -
-
-
-
-
-
-
+
+
+
+
+
+
+