diff --git a/app/Controllers/Amendmentpurchaseorder.php b/app/Controllers/Amendmentpurchaseorder.php index 34d8c875..df3325dc 100755 --- a/app/Controllers/Amendmentpurchaseorder.php +++ b/app/Controllers/Amendmentpurchaseorder.php @@ -546,6 +546,8 @@ class Amendmentpurchaseorder extends BaseController $RecQtyvalue = $ReceivedQty[0]['ReceivedQuantity']; } + if($itemRate != 0){ + $this->purchaseorder_model->updateMaterialRate($MaterialCode, $itemRate); } $POLineItemList = array('PONO' => $NewPO, 'ReqNo' => $Reqnumber, 'MaterialCode' => $MaterialCode, 'ReceivedQuantity' => $RecQtyvalue, 'Quantity' => $Quantity, 'Per' => $per, 'ServiceMaterialDescription' => $servicematerialdescription, 'Rate' => $itemRate, 'Status' => $LineItemStatus, 'CreatedBy' => $updatedBy, 'CreatedDate' => $updateddt, 'CostCenterCode' => $CostCenter, 'ServiceFrequency' => $ServiceFrequency, 'AmendedDetails' => $CAD); $POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList); @@ -815,6 +817,8 @@ class Amendmentpurchaseorder extends BaseController $CAD = "" . $MaterialCode . "-" . $MaterialName . ""; $CAD .= $CAD2; } + if($itemRate != 0){ + $this->purchaseorder_model->updateMaterialRate($MaterialCode, $itemRate); } $POLineItemList = array('PONO' => $NewPO, 'ReqNo' => $Reqnumber, 'MaterialCode' => $MaterialCode, 'Quantity' => $Quantity, 'Rate' => $itemRate, 'Status' => $LineItemStatus, 'ServiceMaterialDescription' => $servicematerialdescription, 'CreatedBy' => $updatedBy, 'CreatedDate' => $updateddt, 'CostCenterCode' => $CostCenter, 'ServiceFrequency' => $ServiceFrequency, 'ReceivedQuantity' => $RecQtyvalue, 'AmendedDetails' => $CAD, 'Per' => $Per); @@ -1248,6 +1252,8 @@ class Amendmentpurchaseorder extends BaseController $CAD = "" . $MaterialCode . ""; $CAD .= $CAD2; } + if($itemRate != 0){ + $this->purchaseorder_model->updateMaterialRate($MaterialCode, $itemRate); } $POLineItemList = array('PONO' => $NewPO, 'ReqNo' => $Reqnumber, 'MaterialCode' => $MaterialCode, 'Quantity' => $Quantity, 'Rate' => $itemRate, 'Status' => $LineItemStatus, 'CreatedBy' => $CreateBy, 'CreatedDate' => $createddt, 'CostCenterCode' => $CostCenter, 'AmendedDetails' => $CAD, 'Per' => $Per, 'ServiceMaterialDescription' => $CapitalItemDescrition); $POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList); @@ -1636,6 +1642,8 @@ class Amendmentpurchaseorder extends BaseController $CAD = "" . $MaterialCode . ""; $CAD .= $CAD2; } + if($itemRate != 0){ + $this->purchaseorder_model->updateMaterialRate($MaterialCode, $itemRate); } $POLineItemList = array('PONO' => $NewPO, 'ReqNo' => $Reqnumber, 'MaterialCode' => $MaterialCode, 'Quantity' => $Quantity, 'Rate' => $itemRate, 'Status' => $LineItemStatus, 'CreatedBy' => $CreateBy, 'CreatedDate' => $createddt, 'CostCenterCode' => $CostCenter, 'AmendedDetails' => $CAD, 'Per' => $per, 'ServiceMaterialDescription' => $specialinstruction); diff --git a/app/Controllers/Emergencypurchaseorder.php b/app/Controllers/Emergencypurchaseorder.php index f2c64289..d4a143a2 100755 --- a/app/Controllers/Emergencypurchaseorder.php +++ b/app/Controllers/Emergencypurchaseorder.php @@ -257,6 +257,8 @@ class Emergencypurchaseorder extends BaseController $TotalOrderValue = $this->request->getPost('TotalOrderValue' . $i); $ServiceFrequency = $this->request->getPost('Frequency' . $i) . ' - ' . $this->request->getPost('FrequencyValue' . $i); $ServiceMaterialDescription = $this->request->getPost('ItemServiceDescription' . $i); + if($itemRate != 0){ + $this->purchaseorder_model->updateMaterialRate($MaterialCode, $itemRate); } $SkipInsert = "False"; if (count($comma_separated) > 0) { for ($j = 1; $j < count($comma_separated); $j++) { @@ -524,6 +526,8 @@ class Emergencypurchaseorder extends BaseController $AfterCgst = $this->request->getPost('RevenueAfterCgst' . $i); $AfterSgst = $this->request->getPost('RevenueAfterSgst' . $i); $AfterIgst = $this->request->getPost('RevenueAfterIgst' . $i); + if($itemRate != 0){ + $this->purchaseorder_model->updateMaterialRate($MaterialCode, $itemRate); } $SkipInsert = "False"; if (count($comma_separated) > 0) { for ($j = 1; $j < count($comma_separated); $j++) { @@ -1231,7 +1235,8 @@ class Emergencypurchaseorder extends BaseController $InsuranceValue = $this->request->getPost('Insval' . $i); $TotalOrderValue = $this->request->getPost('TotalOrderValue' . $i); $CostCenter = $this->request->getPost('costCode' . $i); - + if($itemRate != 0){ + $this->purchaseorder_model->updateMaterialRate($MaterialCode, $itemRate); } $SkipInsert = "False"; if (count($comma_separated) > 0) { for ($j = 1; $j < count($comma_separated); $j++) { @@ -1398,7 +1403,8 @@ class Emergencypurchaseorder extends BaseController /*----------end--------------------*/ - + if($itemRate != 0){ + $this->purchaseorder_model->updateMaterialRate($MaterialCode, $itemRate); } $SkipInsert = "False"; if (count($comma_separated) > 0) { diff --git a/app/Controllers/Payslip.php b/app/Controllers/Payslip.php index 7b6b79e6..f790bb11 100755 --- a/app/Controllers/Payslip.php +++ b/app/Controllers/Payslip.php @@ -817,8 +817,8 @@ class Payslip extends BaseController $load_driver_data[$i]->esi_amount = ($load_driver_data[$i]->esi_applicable == 1) ? ($basic) * $ESI_Rate / 100 : 0; $load_driver_data[$i]->pf_amount = ($load_driver_data[$i]->pf_applicable == 1) ? ($basic) * $PF_Rate / 100 : 0; + $load_driver_data[$i]->total_cal_days = $get_last_date_of_the_month; - }else { $PF_Rate = $load_driver_data[$i]->PF_Rate; $ESI_Rate = $load_driver_data[$i]->ESI_Rate; @@ -873,6 +873,7 @@ class Payslip extends BaseController $empSalarySub = $loan; $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; } } diff --git a/app/Controllers/Purchaseorder.php b/app/Controllers/Purchaseorder.php index 020efadd..ee194634 100755 --- a/app/Controllers/Purchaseorder.php +++ b/app/Controllers/Purchaseorder.php @@ -1226,7 +1226,8 @@ class Purchaseorder extends BaseController $AfterSgst = $this->request->getPost('RevenueAfterSgst' . $i); $AfterIgst = $this->request->getPost('RevenueAfterIgst' . $i); $LineitemAuditorNotes = $this->request->getPost('LineItemNoteForAuditor' . $i); - + if($itemRate != 0){ + $this->purchaseorder_model->updateMaterialRate($MaterialCode, $itemRate); } $SkipInsert = "False"; if (count($comma_separated) > 0) { for ($j = 1; $j < count($comma_separated); $j++) { @@ -1437,7 +1438,8 @@ class Purchaseorder extends BaseController $this->purchaseorder_model->insertlogpo($logpo); } - + if($itemRate != 0){ + $this->purchaseorder_model->updateMaterialRate($MaterialCode, $itemRate); } $SkipInsert = "False"; if (count($comma_separated) > 0) { for ($j = 1; $j < count($comma_separated); $j++) { @@ -2111,6 +2113,8 @@ class Purchaseorder extends BaseController $per = $this->request->getPost('Per' . $i); $LineitemAuditorNotes = $this->request->getPost('LineItemNoteForAuditor' . $i); + if($itemRate != 0){ + $this->purchaseorder_model->updateMaterialRate($MaterialCode, $itemRate); } $SkipInsert = "False"; if (count($comma_separated) > 0) { for ($j = 1; $j < count($comma_separated); $j++) { @@ -2452,6 +2456,8 @@ class Purchaseorder extends BaseController //die(); $currencytypeID = $this->request->getPost('currencytype'); + if($itemRate != 0){ + $this->purchaseorder_model->updateMaterialRate($MaterialCode, $itemRate); } $SkipInsert = "False"; if (count($comma_separated) > 0) { for ($j = 1; $j < count($comma_separated); $j++) { @@ -2839,6 +2845,8 @@ class Purchaseorder extends BaseController $CapitalItemDescription = $this->request->getPost('CapitalItemDescrition' . $i); $Per = $this->request->getPost('per' . $i); $LineitemAuditorNotes = $this->request->getPost('LineItemNoteForAuditor' . $i); + if($itemRate != 0){ + $this->purchaseorder_model->updateMaterialRate($MaterialCode, $itemRate); } $SkipInsert = "False"; if (count($comma_separated) > 0) { for ($j = 1; $j < count($comma_separated); $j++) { @@ -3189,7 +3197,8 @@ class Purchaseorder extends BaseController /*----------end--------------------*/ - + if($itemRate != 0){ + $this->purchaseorder_model->updateMaterialRate($MaterialCode, $itemRate); } $SkipInsert = "False"; if (count($comma_separated) > 0) { for ($j = 1; $j < count($comma_separated); $j++) { @@ -3279,7 +3288,8 @@ class Purchaseorder extends BaseController } else { $LineItemNo = $POLineItemNo; - + if($itemRate != 0){ + $this->purchaseorder_model->updateMaterialRate($MaterialCode, $itemRate); } $POLineItemList = array('PONO' => $PONO, 'ReqNo' => $Reqnumber, 'MaterialCode' => $MaterialCode, 'Quantity' => $Quantity, 'Rate' => $itemRate, 'Status' => $LineItemStatus, 'CreatedBy' => $CreateBy, 'CostCenterCode' => $CostCenter, 'ServiceMaterialDescription' => $CapitalItemDescription, 'Per' => $Per,'LineitemAuditorNotes'=>$LineitemAuditorNotes); $POLineItem = $this->purchaseorder_model->updatePOLineItem($PONO, $LineItemNo, $POLineItemList); diff --git a/app/Models/Driver_model.php b/app/Models/Driver_model.php index cfea2b94..d0b5e716 100755 --- a/app/Models/Driver_model.php +++ b/app/Models/Driver_model.php @@ -103,7 +103,7 @@ class Driver_model extends Model function driverAttendanceForMonthlyPayInputs($from,$to){ $builder = $this->db->table('t_driver_attendance') - ->select('t_driver_attendance.driver_id,driver_details.FirstName as driver_name,driver_details.is_driver, + ->select('t_driver_attendance.driver_id,driver_details.FirstName as driver_name,driver_details.is_driver,COUNT(DISTINCT t_driver_attendance.date) AS unique_days, DATE_FORMAT(date, "%M-%Y") AS month_year,COUNT(t_driver_attendance.load_type) AS no_of_loads,driver_details.*,t_emp_pay_data.PF_Rate,t_emp_pay_data.ESI_Rate') ->select('SUM(t_driver_attendance.salary_amount) as monthly_salary_amount, SUM(t_driver_attendance.food_amount) as monthly_food_amount, diff --git a/app/Models/Purchaseorder_model.php b/app/Models/Purchaseorder_model.php index 9aef1057..049f8966 100755 --- a/app/Models/Purchaseorder_model.php +++ b/app/Models/Purchaseorder_model.php @@ -2565,11 +2565,28 @@ mstr.CourierNo,pom.Status,pom.POType') //,bill.BillNo,bill.FilePath, $query = $builder->get()->getRow(); - $material_rate = $query ? $query->material_rate : null; + $material_rate = $query ? $query->material_rate : 0; return $material_rate; } + public function updateMaterialRate($code, $incoming_rate) + { + $default_rate = $this->materialRate($code); + + if ($incoming_rate == $default_rate) { + return 1; + } else { + $this->db->table('t_materialmaster') + ->where('MaterialCode', $code) + ->set('material_rate', $incoming_rate) + ->update(); + + return $this->db->affectedRows(); + } + } + + function lastPONO() { $query = $this->db->table('t_purchaseorder_master')->select('PONO')->orderBy('PONO', 'DESC')->limit(1)->get(); diff --git a/app/Views/EditservicePurchaseorder.php b/app/Views/EditservicePurchaseorder.php index c4965983..f9bd28b4 100755 --- a/app/Views/EditservicePurchaseorder.php +++ b/app/Views/EditservicePurchaseorder.php @@ -1236,17 +1236,18 @@ if (!empty($getlogpodtl)) { style="font-size:12px;"> - SNo - Requisition No - Item Code - Item Name - Line Item Specs - Quantity - UOM - Rate - Basic Amount - Tax Amount - Total Order Amount + + SNo + Requisition No + Item Code + Item Description + Line Item Specs + Quantity + UOM + Rate + Basic Amount + Tax Amount + Total Order Amount Action @@ -1273,8 +1274,9 @@ if (!empty($getlogpodtl)) { ReqNo ?> MaterialCode ?> - MaterialName ?> - + + MaterialName, 0, 13, "..."); + echo $shortName; ?> + var shorten = materialName.length > 13 ? materialName.slice(0, 13) + "..." : materialName; var rowHtml = ` ${temp} ${Reqnumber} ${materialCode} - ${materialName}`; + ${shorten}`; if (PONOStatus === "PO_DRAFT" || PONOStatus === "PO_CREATED") { rowHtml += ` - SNo - Requisition No - Item Code - Item Description - Quantity - UOM - Rate - Basic Amount - Tax Amount - Total Order Amount + SNo + Requisition No + Item Code + Item Description + Quantity + UOM + Rate + Basic Amount + Tax Amount + Total Order Amount Action @@ -6029,13 +6029,14 @@ if (!empty($INRSYMBOL)) { index = parseInt(index) + 1; var template = jQuery("#RevenueList").html(); + var rshorten = materialName.length > 13 ? materialName.slice(0, 13) + "..." : materialName; var html = ` ${temp} ${Reqnumber} ${materialCode} - ${materialName} + ${rshorten} ${quantity} ${uom} ${itemRate} @@ -6709,13 +6710,15 @@ if (!empty($INRSYMBOL)) { index = parseInt(index) + 1; var template = jQuery("#ServiceList").html(); + + var sshorten = materialName.length > 13 ? materialName.slice(0, 13) + "..." : materialName; var html = ` ${temp} ${Reqnumber} ${materialCode} - ${materialName} + ${sshorten} ${quantity} ${uom} ${itemRate} @@ -7236,26 +7239,27 @@ if (!empty($INRSYMBOL)) { // Perform form validation - 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 { + 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 { // Submit the form using AJAX $('#loader').show(); + disableButtons(); $.ajax({ url: "emergencypurchaseorder/addNewServicePurchaseOrder", type: "POST", @@ -7274,14 +7278,16 @@ if (!empty($INRSYMBOL)) { $('#SpcialInstruction').val(''); $('#txtDeliveryAddress').val(''); window.location = "purchaseorderListing"; + setTimeout(function() { enableButtons(); }, 2000); }, error: function (xhr, status, error) { // Handle errors $('#loader').hide(); alert("Error: " + error); + setTimeout(function() { enableButtons(); }, 2000); } }); - } + // } } } @@ -7347,22 +7353,23 @@ if (!empty($INRSYMBOL)) { // Perform form validation - 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..!'); + 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..!'); - 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(); $.ajax({ url: "emergencypurchaseorder/addNewRevenuePurchaseOrder", type: "POST", @@ -7377,13 +7384,15 @@ if (!empty($INRSYMBOL)) { $('#SpcialInstruction').val(''); $('#txtDeliveryAddress').val(''); window.location = "purchaseorderListing"; + setTimeout(function() { enableButtons(); }, 2000); }, error: function (xhr, status, error) { // Handle errors alert("Error: " + error); + setTimeout(function() { enableButtons(); }, 2000); } }); - } + // } } } diff --git a/app/Views/capitalpurchaseorder.php b/app/Views/capitalpurchaseorder.php index 93f2b6f1..27d9c9b1 100755 --- a/app/Views/capitalpurchaseorder.php +++ b/app/Views/capitalpurchaseorder.php @@ -334,98 +334,98 @@ if (!empty($INRSYMBOL)) { var radioValue = $("input[name='DateRange']:checked").val(); if (capitalType == 'International') { - if ($('#drpSupplier').val() == "0") { - alert('Please Select the Supplier details'); - $('#drpSupplier').focus(); - return false; - } else if ($('#PODate').val() == '') { - alert('Please Enter the Purchase Order date'); - $('#PODate').focus(); - return false; - } else if (radioValue == 0 && $('#Deliverydate').val() == '') { - alert('Please Select the Delivery Date'); - $('#Deliverydate').focus(); - return false; - } else if (radioValue == 1 && $('#Scheduleby').val() == '') { - alert('Please Enter the Schedule By'); - $('#Deliverydate').focus(); - return false; - } else if (radioValue == 2 && $('#Dispatch').val().trim() == '') { - alert('Please Enter the Dispatch Instruction'); - $('#Deliverydate').focus(); - return false; - } else if ($('#Deliverydt').val() == '' && $('#Scheduleby').val() == '') { - alert('Please Enter the Dispatch Instruction'); - $('#Deliverydt').focus(); - return false; - } else if ($('#DeliveryAddr').val() == '') { - alert('Please Enter the Delivery Address'); - $('#DeliveryAddr').focus(); - return false; - } else if ($('#PoTypeOptions').val() == "0") { - alert('Please Select Capital Type'); - $('#PoTypeOptions').focus(); - return false; - - } else if ($('#BudgetType').val() == "0") { - alert('Please Select Budget Type'); - $('#BudgetType').focus(); - return false; - - } + if ($('#drpSupplier').val() == "0") { + alert('Please Select the Supplier details'); + $('#drpSupplier').focus(); + return false; + } else if ($('#currencytype').val() == '0') { + alert('Please Select the Currency Type'); + $('#currencytype').focus(); + return false; + } else if ($('#PODate').val() == '') { + alert('Please Enter the Purchase Order date'); + $('#PODate').focus(); + return false; + } else if (radioValue == 0 && $('#Deliverydate').val() == '') { + alert('Please Select the Delivery Date'); + $('#Deliverydate').focus(); + return false; + } else if (radioValue == 1 && $('#Scheduleby').val() == '') { + alert('Please Enter the Schedule By'); + $('#Deliverydate').focus(); + return false; + } else if (radioValue == 2 && $('#Dispatch').val().trim() == '') { + alert('Please Enter the Dispatch Instruction'); + $('#Deliverydate').focus(); + return false; + } else if ($('#ExchangeRate').val() == '') { + alert('Please Enter the Exchange Rate'); + $('#ExchangeRate').focus(); + return false; + } else if ($('#ExchangeRate').val() == 0) { + alert('Please Enter the Exchange Rate'); + $('#ExchangeRate').focus(); + return false; + } else if ($('#PlaceOforigin').val() == '') { + alert('Please Enter Place Of Origin'); + $('#PlaceOforigin').focus(); + return false; + } else if ($('#PoTypeOptions').val() == "0") { + alert('Please Select Capital Type'); + $('#PoTypeOptions').focus(); + return false; + } else if ($('#PaymentTerms').val() == '') { + alert('Please Select Payment Terms'); + $('#PaymentTerms').focus(); + return false; + } else if ($('#Otherpayment').val() == '' && $('#PaymentTerms').val() == 'PT08') { + alert('Please Enter Payable Terms Description'); + $('#Otherpayment').focus(); + return false; + } else if ($('#BudgetType').val() == "0") { + alert('Please Select Budget Type'); + $('#BudgetType').focus(); + return false; + } else { return true; } } if (capitalType == 'Domestic') { - if ($('#drpSupplier').val() == "0") { - alert('Please Select the Supplier details'); - $('#drpSupplier').focus(); - return false; - } else if ($('#currencytype').val() == '0') { - alert('Please Select the Currency Type'); - $('#currencytype').focus(); - return false; - } else if ($('#PODate').val() == '') { - alert('Please Enter the Purchase Order date'); - $('#PODate').focus(); - return false; - } else if (radioValue == 0 && $('#Deliverydate').val() == '') { - alert('Please Select the Delivery Date'); - $('#Deliverydate').focus(); - return false; - } else if (radioValue == 1 && $('#Scheduleby').val() == '') { - alert('Please Enter the Schedule By'); - $('#Deliverydate').focus(); - return false; - } else if (radioValue == 2 && $('#Dispatch').val().trim() == '') { - alert('Please Enter the Dispatch Instruction'); - $('#Deliverydate').focus(); - return false; - } else if ($('#Deliverydt').val() == '' && $('#Scheduleby').val() == '') { - alert('Please Enter the Dispatch Instruction'); - $('#Deliverydt').focus(); - return false; - } else if ($('#ExchangeRt').val() == '') { - alert('Please Enter the Exchange Rate'); - $('#ExchangeRt').focus(); - return false; - } else if ($('#PlaceOforigin').val().trim() == '') { - alert('Please Enter the Place Of Origin'); - $('#PlaceOforigin').focus(); - return false; - } else if ($('#DeliveryAddr').val() == '') { - alert('Please Enter the Delivery Address'); - $('#DeliveryAddr').focus(); - return false; - } else if ($('#PoTypeOptions').val() == "0") { - alert('Please Select Capital Type'); - $('#PoTypeOptions').focus(); - return false; - - } else if ($('#BudgetType').val() == "0") { - alert('Please Select Budget Type'); - $('#BudgetType').focus(); - return false; - - } + if ($('#drpSupplier').val() == "0") { + alert('Please Select the Supplier details'); + $('#drpSupplier').focus(); + return false; + } else if ($('#PODate').val() == '') { + alert('Please Enter the Purchase Order date'); + $('#PODate').focus(); + return false; + } else if (radioValue == 0 && $('#Deliverydate').val() == '') { + alert('Please Select the Delivery Date'); + $('#Deliverydate').focus(); + return false; + } else if (radioValue == 1 && $('#Scheduleby').val() == '') { + alert('Please Enter the Schedule By'); + $('#Deliverydate').focus(); + return false; + } else if (radioValue == 2 && $('#Dispatch').val().trim() == '') { + alert('Please Enter the Dispatch Instruction'); + $('#Deliverydate').focus(); + return false; + } else if ($('#PoTypeOptions').val() == "0") { + alert('Please Select Capital Type'); + $('#PoTypeOptions').focus(); + return false; + } else if ($('#PaymentTerms').val() == '') { + alert('Please Select Payment Terms'); + $('#PaymentTerms').focus(); + return false; + } else if ($('#Otherpayment').val() == '' && $('#PaymentTerms').val() == 'PT08') { + alert('Please Enter Payable Terms Description'); + $('#Otherpayment').focus(); + return false; + } else if ($('#BudgetType').val() == "0") { + alert('Please Select Budget Type'); + $('#BudgetType').focus(); + return false; + } else { return true; } } @@ -555,7 +555,7 @@ if (!empty($INRSYMBOL)) { 'Scheduleby', 'value' => set_value('Scheduleby'), 'id' => 'Scheduleby', 'class' => 'form-control', 'required' => 'true', 'rows' => '3', 'cols' => '40', 'maxlength' => '110'); - echo Form_textarea($data); + echo form_textarea($data); ?> @@ -566,7 +566,7 @@ if (!empty($INRSYMBOL)) { // $data = array('name' => 'Dispatch','value' => set_value('Dispatch'),'id'=>'Dispatch', 'class' => 'form-control' ,'required' => 'true'); // echo form_input($data); $data = array('name' => 'Dispatch', 'value' => set_value('Dispatch'), 'id' => 'Dispatch', 'class' => 'form-control', 'required' => 'true', 'rows' => '3', 'cols' => '40', 'maxlength' => '110'); - echo Form_textarea($data); + echo form_textarea($data); ?> @@ -786,17 +786,17 @@ if (!empty($INRSYMBOL)) { - - - - - - - - - - - + + + + + + + + + + + @@ -2648,6 +2648,7 @@ if (!empty($INRSYMBOL)) { $("#MaterialCode").empty(); $("#CapitalDepartmentName").val(''); $("#CPUOM").val(''); + $("#CPRate").val(''); $("#CPQuantity").val(''); $("#CapitalItemName").val(''); $("#CPTotalAmount").val(''); @@ -2717,6 +2718,7 @@ if (!empty($INRSYMBOL)) { var id = $('#MaterialCode').val(); $("#CapitalItemName").val(''); $("#CPUOM").val(''); + $("#CPRate").val(''); $("#CPQuantity").val(''); $("#CPTotalAmount").val(''); RequistQuantity = ''; @@ -2729,6 +2731,7 @@ if (!empty($INRSYMBOL)) { if (obj.MaterialCode === id) { $("#CapitalItemName").val(obj.MaterialName); $("#CPUOM").val(obj.UOM); + $("#CPRate").val(obj.material_rate); var CPUOMDisplay = obj.UOM; $("#CPQuantity").val(obj.Quantity); RequistQuantity = obj.Quantity; @@ -3522,13 +3525,13 @@ if (!empty($INRSYMBOL)) { // Taxvalue: TotalTaxValue, // TotalValue: Total // })); - + var shorten = materialName.length > 13 ? materialName.slice(0, 13) + "..." : materialName; var rowHtml = ` - + - - - - - - - - - - + + + + + + + + + + @@ -826,7 +826,8 @@ if (!empty($POItem) && $CapitalRange == '1') { - + @@ -3451,29 +3452,27 @@ Calculate Landing charge //alert(basicamt); } - if (validate()) { + if (capitalValidate()) { var ex = $('#ExchangeRt').val(); //alert(ex); //alert(parseInt($('#CapitalToatlOrder').val() * ex)); var AvlBudAmt = ''; //alert(AvlBudAmt); - 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; - } - + // 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(parseInt(AvlBudAmt) < parseInt(basicamt)) { - // alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.'); - - // return false; - // } - else { + // alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.'); + // return false; + // } + // else { //alert('else'); @@ -3498,7 +3497,7 @@ Calculate Landing charge $('#loader').show(); - + disableButtons(); $.ajax({ // data:$('.CapitalPO').serialize()+"&ExchangeRateOn="+ExchangeRateOn+"&PaymentMethod="+PaymentMethod+"&PayableAT="+PayableAT+"&PaymentDate="+PaymentDate, type: "POST", @@ -3517,15 +3516,17 @@ Calculate Landing charge $('#SpcialInstruction').val(''); $('#txtDeliveryAddress').val(''); window.location = status == 1 ? "amendmentpurchaseorder" : "purchaseorderListing"; + setTimeout(function() { enableButtons(); }, 2000); } else { $('#loader').hide(); alert("Error"); + setTimeout(function() { enableButtons(); }, 2000); } } }); - } + // } } } diff --git a/app/Views/editCapitalPo.php b/app/Views/editCapitalPo.php index 3c1dfbfd..714ee71a 100755 --- a/app/Views/editCapitalPo.php +++ b/app/Views/editCapitalPo.php @@ -888,16 +888,16 @@ if (!empty($getlogpodtl)) { - - - - - - - - - - + + + + + + + + + + @@ -922,7 +922,8 @@ if (!empty($getlogpodtl)) { - + - `; + `; if (PONOStatus === "PO_DRAFT" || PONOStatus === "PO_CREATED") { rowHtml += ` - - - - - + + + + + + + @@ -1232,7 +1232,8 @@ if (!empty($RequistionDetails)) { - + @@ -2925,13 +2926,14 @@ if (!empty($RequistionDetails)) { if (validate() && Budgetcheck()) { - if (document.getElementById('ImportTax').rows.length <= 0) { + // if (document.getElementById('ImportTax').rows.length <= 0) { - alert('Please Select Line item to Create PO'); - $('#Deliverydt').focus(); - return false; - } else { + // alert('Please Select Line item to Create PO'); + // $('#Deliverydt').focus(); + // return false; + // } else { $('#loader').show(); + disableButtons(); var formData = new FormData($('.ImportPO')[0]); if (status == 0) { // for draft @@ -2962,21 +2964,29 @@ if (!empty($RequistionDetails)) { //$('#txtDeliveryAddress').val(''); window.location = status == 1 ? "amendmentpurchaseorder" : "purchaseorderListing"; + setTimeout(function() { enableButtons(); }, 2000); + } else { alert("Error"); + setTimeout(function() { enableButtons(); }, 2000); + } }, error : function (){ console.error(error); + setTimeout(function() { enableButtons(); }, 2000); + }, complete : function (){ console.log("ajax call is completed "); + setTimeout(function() { enableButtons(); }, 2000); + } }); - } + // } } } diff --git a/app/Views/editRevenueAmendPO.php b/app/Views/editRevenueAmendPO.php index 6f5abf94..993b0388 100755 --- a/app/Views/editRevenueAmendPO.php +++ b/app/Views/editRevenueAmendPO.php @@ -1224,15 +1224,15 @@ if (!empty($INRSYMBOL)) { - - - - - - - - - + + + + + + + + + @@ -1249,7 +1249,8 @@ if (!empty($INRSYMBOL)) { - + @@ -2547,21 +2548,21 @@ if (!empty($INRSYMBOL)) { var txtTotBasicAmount = $('#txtTotBasicAmount').val(); var txtTotalDiscount = $('#txtTotalDiscount').val(); //alert('Before Validate IF condition'); - if (validate()) { + if (revenueValidate()) { //alert('insdie Validate IF condition'); var realrows = document.getElementById('txtRowCount').value; //alert(realrows); - if (document.getElementById('revenueTax').rows.length < 2) { - alert('Please Select Line item to Create PO'); - $('#Deliverydt').focus(); - return false; - } + // if (document.getElementById('revenueTax').rows.length < 2) { + // alert('Please Select Line item to Create PO'); + // $('#Deliverydt').focus(); + // return false; + // } // else if(parseInt(AvlBudAmt) < (parseInt(txtTotBasicAmount) - parseInt(txtTotalDiscount))) { // alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.'); // return false; // } - else { + // else { //alert('final else for store data'); // $('.content').loader('show'); var formData = new FormData($('.CreatePO')[0]); @@ -2574,6 +2575,7 @@ if (!empty($INRSYMBOL)) { }; $('#loader').show(); + disableButtons(); $.ajax({ // data:$('.CreatePO').serialize(), type: "POST", @@ -2592,22 +2594,25 @@ if (!empty($INRSYMBOL)) { $('#txtDeliveryAddress').val('') window.location = (status == 1) ? "amendmentpurchaseorder" : "purchaseorderListing"; - + setTimeout(function() { enableButtons(); }, 2000); } else { $('#loader').hide(); + setTimeout(function() { enableButtons(); }, 2000); } }, error : function(error){ console.error("error occured" + error); + setTimeout(function() { enableButtons(); }, 2000); }, complete : function (){ $('#loader').hide(); console.log("ajax call is completed ..!!") + setTimeout(function() { enableButtons(); }, 2000); } }); - } + // } } } diff --git a/app/Views/editRevenuepurchaseorder.php b/app/Views/editRevenuepurchaseorder.php index eaf2de39..3baeac77 100755 --- a/app/Views/editRevenuepurchaseorder.php +++ b/app/Views/editRevenuepurchaseorder.php @@ -2332,28 +2332,28 @@ if (!empty($getlogpodtl)) { - - - - - - - - + + + + + + + - - - - + @@ -2368,7 +2368,8 @@ if (!empty($getlogpodtl)) { - + - `; + `; if (PONOStatus === "PO_DRAFT" || PONOStatus === "PO_CREATED") { rowHtml += ` - - - - - - - - - - - - + + + + + + + + + + + + @@ -1056,7 +1056,8 @@ foreach ($PaymentTerms as $TER) { - + @@ -2191,31 +2192,32 @@ foreach ($PaymentTerms as $TER) { var txtTotalOrderValueSummary = $('#txtTotBasicAmount').val(); // alert("worked"); - // if (validate()) { + if (serviceValidate()) { // if(parseInt(AvlBudAmt) < parseInt(txtTotalOrderValueSummary)) { // alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.'); // return false; // } - if ($('#Otherpayment').val() == '' && $('#PaymentTerms').val() == 'PT08') { - alert('Please Enter Other Payment Details'); - $('#Otherpayment').focus(); - return false; - } else if ($('#amenddescofpo').val().trim() == '') { - alert('Please Enter Description Of Service'); - $('#amenddescofpo').focus(); - return false; - } else { + // if ($('#Otherpayment').val() == '' && $('#PaymentTerms').val() == 'PT08') { + // alert('Please Enter Other Payment Details'); + // $('#Otherpayment').focus(); + // return false; + // } else if ($('#amenddescofpo').val().trim() == '') { + // alert('Please Enter Description Of Service'); + // $('#amenddescofpo').focus(); + // return false; + // } else { // $('#content').loader('show'); - var formData = new FormData($('.ServicePO')[0]); - if (status == 0) { // for draft + var formData = new FormData($('.ServicePO')[0]); + if (status == 0) { // for draft formData.append('changeStatus','ST014'); }; if (status == 1) { // for approve formData.append('changeStatus','ST026'); }; - $('#loader').show(); + disableButtons(); + $('#loader').show(); $.ajax({ // data: $('.ServicePO').serialize(), type: "POST", @@ -2234,15 +2236,19 @@ foreach ($PaymentTerms as $TER) { $('#txtDeliveryAddress').val('') window.location = status == 1 ? "amendmentpurchaseorder" : "purchaseorderListing"; + setTimeout(function() { enableButtons(); }, 2000); } else { + setTimeout(function() { enableButtons(); }, 2000); $('#loader').hide(); console.error("Error"); } }, error : function (error){ + setTimeout(function() { enableButtons(); }, 2000); console.log("error occurred" , error); }, complete : function (){ + setTimeout(function() { enableButtons(); }, 2000); console.log("Ajax call is completed ..!!"); } }); diff --git a/app/Views/editimportpo.php b/app/Views/editimportpo.php index 7c7f960a..24a5928b 100755 --- a/app/Views/editimportpo.php +++ b/app/Views/editimportpo.php @@ -828,15 +828,15 @@ if (!empty($getlogpodtl)) {
SNoRequisition NoItem CodeItem DescriptionLine Item SpecsQuantityUOMRateBasic AmountTax AmountTotal Order AmountSNoRequisition NoItem CodeItem DescriptionLine Item SpecsQuantityUOMRateBasic AmountTax AmountTotal Order Amount Action
${temp} ${Reqnumber} ${materialCode}${materialName}${shorten} - @@ -4431,6 +4434,7 @@ if (!empty($INRSYMBOL)) { var id = $('#EditMaterialCode').val(); $("#EditCapitalItemName").val(''); $("#EditCPUOM").val(''); + $("#EditCPRate").val(''); $("#EditCPQuantity").val(''); $("#EditCPTotalAmount").val(''); RequistQuantity = ''; @@ -4443,6 +4447,7 @@ if (!empty($INRSYMBOL)) { if (obj.MaterialCode === id) { $("#EditCapitalItemName").val(obj.MaterialName); $("#EditCPUOM").val(obj.UOM); + $("#EditCPRate").val(obj.material_rate); $("#EditCPQuantity").val(obj.Quantity); RequistQuantity = obj.Quantity; } @@ -4523,32 +4528,32 @@ if (!empty($INRSYMBOL)) { } else { basicAmountRate = parseFloat($('#CapitalBasicOrder').val()) - parseFloat($('#txtTotalDiscount').val()); } - 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(parseInt(AvlBudAmt) < parseInt(basicAmountRate)) { + if (capitalValidate()) { + // 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(parseInt(AvlBudAmt) < parseInt(basicAmountRate)) { // alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.'); - // return false; // } - else if ($('#PoTypeOptions').val() == "0") { - alert('Please Select POType'); - $('#PoTypeOptions').focus(); - return false; + // else if ($('#PoTypeOptions').val() == "0") { + // alert('Please Select POType'); + // $('#PoTypeOptions').focus(); + // return false; - } else { + // } else { // $('#content').loader('show'); var formData = new FormData($('.CapitalPO')[0]); formData.append('ExchangeRateOn', ExchangeRateOn); formData.append('PaymentMethod', PaymentMethod); $('#loader').show(); + disableButtons(); $.ajax({ data: formData, processData: false, @@ -4570,16 +4575,22 @@ if (!empty($INRSYMBOL)) { clearAfterAddLineItemAdd(); window.location = "purchaseorderListing"; - + setTimeout(function() { enableButtons(); }, 2000); } else { // $('#content').loader('hide'); alert("Error"); + setTimeout(function() { enableButtons(); }, 2000); } - } + }, + error: function(jqXHR, textStatus, errorThrown) { + console.error("AJAX Error: " + textStatus + ": " + errorThrown); + alert("Error: " + textStatus); + setTimeout(function() { enableButtons(); }, 2000); + } }); - } + // } } } @@ -5422,9 +5433,12 @@ if (!empty($INRSYMBOL)) { function Reset() { - location.reload(); - - } + disableButtons(); + location.reload(); + setTimeout(function() { + enableButtons(); + }, 2000); + } $('#insuranceTxtDiv').hide(); $("#insuranceStatus").change(function() { diff --git a/app/Views/editCapitalAmendPO.php b/app/Views/editCapitalAmendPO.php index 9ead78a5..1dc1ae3c 100755 --- a/app/Views/editCapitalAmendPO.php +++ b/app/Views/editCapitalAmendPO.php @@ -801,16 +801,16 @@ if (!empty($POItem) && $CapitalRange == '1') { style="font-size:12px;">
SNoRequisition NoItem NameQuantityUOMRateBasic AmountTax AmountTotal Order AmountActionSNoRequisition NoItem DescriptionQuantityUOMRateBasic AmountTax AmountTotal Order AmountAction
ReqNo ?>MaterialName ?>MaterialName, 0, 13, "..."); + echo $shortName; ?> Quantity ?> UOM ?> Rate, 2, '.', ''); ?>
SNoRequisition NoItem CodeItem DescriptionLine Item SpecsQuantityUOMRateBasic AmountTax AmountTotal Order AmountRequisition NoItem CodeItem DescriptionLine Item SpecsQuantityUOMRateBasic AmountTax AmountTotal Order Amount ReqNo ?> MaterialCode ?>MaterialName ?>MaterialName, 0, 13, "..."); + echo $shortName; ?> + var shorten = materialName.length > 13 ? materialName.slice(0, 13) + "..." : materialName; var rowHtml = `
${temp} ${Reqnumber} ${materialCode}${materialName}${shorten}SNo - Requisition NoItem NameQuantityUOMRateBasic AmountSNoRequisition NoItem DescriptionQuantityUOMRateBasic Amount Action
ReqNo ?>MaterialName ?>MaterialName, 0, 13, "..."); + echo $shortName; ?> Quantity ?> UOM ?> Rate ?>
SNoRequisition NoItem NameQuantityUOMRateBasic AmountTax AmountTotal Order AmountSNoRequisition NoItem DescriptionQuantityUOMRateBasic AmountTax AmountTotal Order Amount Action
ReqNo ?>MaterialName ?>MaterialName, 0, 13, "..."); + echo $shortName; ?> Quantity ?> UOM ?> Rate ?>
SNoRequisition NoItem CodeItem DescriptionLine Item SpecsQuantityUOMRate + SNoRequisition NoItem CodeItem DescriptionLine Item SpecsQuantityUOMRate Basic Amount + Basic Amount Tax Amount + Tax Amount Total Order Amount + Total Order Amount ActionAction
ReqNo ?> MaterialCode ?>MaterialName ?>MaterialName, 0, 13, "..."); + echo $shortName; ?> console.log("PONOStatus",PONOStatus); + var shorten = materialName.length > 13 ? materialName.slice(0, 13) + "..." : materialName; + // var template = jQuery("#RevenueList").html(); @@ -4507,7 +4510,7 @@ if (!empty($getlogpodtl)) { ${temp} ${Reqnumber} ${materialCode}${materialName}${shorten}purchaseorder/EditRevenuePurchaseOrder", @@ -5417,9 +5421,11 @@ if (!empty($getlogpodtl)) { $('#SpcialInstruction').val(''); $('#txtDeliveryAddress').val('') window.location = "purchaseorderListing"; + setTimeout(function() { enableButtons(); }, 2000); } else { alert("Something went wrong"); + setTimeout(function() { enableButtons(); }, 2000); } }, @@ -5428,6 +5434,7 @@ if (!empty($getlogpodtl)) { $('#loader').hide(); console.error("AJAX Error: ", textStatus, errorThrown); alert("An error occurred: " + textStatus + " - " + errorThrown); + setTimeout(function() { enableButtons(); }, 2000); }, @@ -5435,10 +5442,11 @@ if (!empty($getlogpodtl)) { // // Actions that should always happen regardless of success or error // console.log("AJAX request completed."); // $('#loader').hide(); // Hide the loader in any case + // setTimeout(function() { enableButtons(); }, 2000); // } }); - } + // } } } $(document).ready(function () { diff --git a/app/Views/editServiceAmendPO.php b/app/Views/editServiceAmendPO.php index 7a1da430..0797e057 100755 --- a/app/Views/editServiceAmendPO.php +++ b/app/Views/editServiceAmendPO.php @@ -1016,18 +1016,18 @@ foreach ($PaymentTerms as $TER) {
SNoRequisition NoItem CodeItem NameQuantityUOMRateBasic AmountTax AmountTotal Order AmountActual QuantityReceived QuantityPending QuantityRequisition NoItem CodeItem DescriptionQuantityUOMRateBasic AmountTax AmountTotal Order AmountActual QuantityReceived QuantityPending Quantity Action
ReqNo ?> MaterialCode ?>MaterialName ?>MaterialName, 0, 13, "..."); + echo $shortName; ?> Quantity ?> UOM ?> Rate ?>
- - - - - - - - - + + + + + + + + + @@ -859,7 +859,8 @@ if (!empty($getlogpodtl)) { - + - `; + `; if (PONOStatus === "PO_DRAFT" || PONOStatus === "PO_CREATED") { rowHtml += ` - - - - - - - - - + + + + + + + + + @@ -980,30 +982,26 @@ if (isset($AvlimportBudAmt) && !empty($AvlimportBudAmt)) {
- -
- -
- -
+ @@ -3519,12 +3517,13 @@ if (isset($AvlimportBudAmt) && !empty($AvlimportBudAmt)) { // RejectedQty: rejectedqty, // PendingQty: pendingqty // })); + var shorten = materialName.length > 13 ? materialName.slice(0, 13) + "..." : materialName; var rowHtml = `
- + + @@ -294,7 +295,7 @@ - + - + + + - + diff --git a/app/Views/purchaseorder.php b/app/Views/purchaseorder.php index 45de4b7c..ec5fd8ce 100755 --- a/app/Views/purchaseorder.php +++ b/app/Views/purchaseorder.php @@ -411,7 +411,7 @@ if (!empty($INRSYMBOL)) { }); $('#MaterialCode').change(function() { - +alert("**"); var id = $('#MaterialCode').val(); var drpSupplier = $('#drpSupplier').val(); $("#ItemName").val(''); @@ -432,6 +432,7 @@ if (!empty($INRSYMBOL)) { $("#ItemName").val(obj.MaterialName); $("#UOM").val(obj.UOM); $("#Quantity").val(obj.Quantity); + $("#Rate").val(obj.Rate); RequistQuantity = obj.Quantity; } }); @@ -2166,20 +2167,20 @@ if (!empty($INRSYMBOL)) {
-
SNoRequisition NoMaterial CodeDescriptionLine Item SpecsQuantityUOMRateBasic AmountSNoRequisition NoItem CodeItem DescriptionLine Item SpecsQuantityUOMRateBasic Amount ReqNo ?> MaterialCode ?>MaterialName ?>MaterialName, 0, 13, "..."); + echo $shortName; ?> + var shorten = materialName.length > 13 ? materialName.slice(0, 13) + "..." : materialName; var rowHtml = `
${temp} ${Reqnumber} ${materialCode}${materialName}${shorten}
SNoRequisition NoMaterial CodeDescriptionLine Item SpecsQuantityUOMRateBasic AmountSNoRequisition NoItem CodeItem DescriptionLine Item SpecsQuantityUOMRateBasic Amount
${temp} ${Reqnumber} ${materialCode}${materialName}${shorten} - @@ -4189,19 +4188,14 @@ if (isset($AvlimportBudAmt) && !empty($AvlimportBudAmt)) { //alert(stat); //alert(JSON.stringify(txtStatus)); //exit(); - if (validate() && Budgetcheck()) { - else if ($('#Importoption').val() == "0") { - alert('Please Select Import Type'); - $('#Importoption').focus(); - return false; - - } else { + if (importValidate() && Budgetcheck()) { // $('#content').loader('show'); var formData = new FormData($('.ImportPO')[0]); formData.append('txtRowCount', txtRowCount); formData.append('txtDeletedRow', txtDeletedRow); formData.append('textStatus', stat); + disableButtons(); $.ajax({ // data:$('.ImportPO').serialize()+"&txtRowCount="+txtRowCount+"&txtDeletedRow="+txtDeletedRow+"&textStatus="+stat, @@ -4220,17 +4214,22 @@ if (isset($AvlimportBudAmt) && !empty($AvlimportBudAmt)) { //$('#SpcialInstruction').val(''); //$('#txtDeliveryAddress').val(''); window.location = "purchaseorderListing"; + setTimeout(function() { enableButtons(); }, 2000); } else { alert("Error"); + setTimeout(function() { enableButtons(); }, 2000); } - } + }, + error: function(jqXHR, textStatus, errorThrown) { + console.error("AJAX Error: " + textStatus + ": " + errorThrown); + alert("Error: " + textStatus); + setTimeout(function() { enableButtons(); }, 2000); + } }); - } - } @@ -4333,4 +4332,12 @@ if (isset($AvlimportBudAmt) && !empty($AvlimportBudAmt)) { calculateFreight(1); }); + function Reset() { + disableButtons(); + location.reload(); + setTimeout(function() { + enableButtons(); + }, 2000); + + } \ No newline at end of file diff --git a/app/Views/monthlypayinputs.php b/app/Views/monthlypayinputs.php index 4b5759f6..65926394 100755 --- a/app/Views/monthlypayinputs.php +++ b/app/Views/monthlypayinputs.php @@ -233,6 +233,7 @@ DOJ Designation Total DaysNumber Of Trips Days Worked LOP Days Paid Leave NoofDays; ?> Key)) { echo "contenteditable='false';"; @@ -534,10 +535,16 @@ Designation; ?> no_of_loads." (trip)"; ?> + total_cal_days; ?> + + no_of_loads." (trip)"; ?> + - + unique_days, 2, '.', ''); ?> @@ -557,7 +564,9 @@ - + total_cal_days ; + echo number_format($worked_amt, 2, '.', ''); ?> @@ -565,7 +574,8 @@ - + @@ -675,7 +685,7 @@ Total Total
+
- - - - - - - - - - - + + + + + + + + + + + @@ -3457,12 +3458,13 @@ if (!empty($INRSYMBOL)) { // })); // Define your template using ES6 template literals + var shorten = materialName.length > 13 ? materialName.slice(0, 13) + "..." : materialName; var rowHtml = ` - +
SNoRequisition NoItem CodeItem DescriptionLine Item SpecsQuantityUOMRateBasic AmountTax AmountTotal Order AmountSNoRequisition NoItem CodeItem DescriptionLine Item SpecsQuantityUOMRateBasic AmountTax AmountTotal Order Amount Action
${temp} ${Reqnumber} ${materialCode}${materialName}${shorten} - diff --git a/app/Views/servicePurchaseorder.php b/app/Views/servicePurchaseorder.php index 75e71157..ccf805dd 100755 --- a/app/Views/servicePurchaseorder.php +++ b/app/Views/servicePurchaseorder.php @@ -1048,17 +1048,17 @@ if (!empty($INRSYMBOL)) { - - - - - - - - - - - + + + + + + + + + + + @@ -1975,13 +1975,13 @@ if (!empty($INRSYMBOL)) { // Taxvalue: TotalTaxValue, // TotalValue: TotalOrderValue // })); - + var shorten = materialName.length > 13 ? materialName.slice(0, 13) + "..." : materialName; var rowHtml = ` - +
SNoRequisition NoItem CodeItem NameLine Item SpecsQuantityUOMRate Basic Amount Tax Amount Total Order Amount SNoRequisition NoItem CodeItem DescriptionLine Item SpecsQuantityUOMRate Basic Amount Tax Amount Total Order Amount Action
${temp} ${Reqnumber} ${materialCode}${materialName}${shorten} - diff --git a/public/assets/js/CreatePOValidation.js b/public/assets/js/CreatePOValidation.js index f1e86374..92e8ab86 100755 --- a/public/assets/js/CreatePOValidation.js +++ b/public/assets/js/CreatePOValidation.js @@ -88,7 +88,7 @@ function revenueValidate(){ $('#BudgetType').focus(); return false; }else if ($('#revenueTax tbody tr').length < 1) { - alert('Please Select Line item to Create PO'); + alert('Atleast One Line needed'); return false; }else { return true; @@ -146,7 +146,7 @@ function serviceValidate(){ $('#BudgetType').focus(); return false; }else if ($('#serviceTax tbody tr').length < 1) { - alert('Please Select Line item to Create PO'); + alert('Atleast One Line needed'); return false; } else if ($('#descofpo').val().trim() == '') { alert('Please Enter Description Of Service'); @@ -161,148 +161,170 @@ function capitalValidate(){ var radioValue = parseInt($("input[name='DateRange']:checked").val()); var PoType = $('#POType').val(); if(PoType=='CAPITAL' && capitalType=='International'){ - if ($('#drpSupplier').val() == "0") { - alert('Please Select the Supplier details'); - $('#drpSupplier').focus(); - return false; - } - }else{ - if ($('#drpSupplier').val() == "0") { - alert('Please Select the Supplier details'); - $('#drpSupplier').focus(); - return false; - } - } + + + if ($('#drpSupplier').val() == "0") { + alert('Please Select the Supplier details'); + $('#drpSupplier').focus(); + return false; + } else if ($('#currencytype').val() == '0') { + alert('Please Select the Currency Type'); + $('#currencytype').focus(); + return false; + } else if ($('#PODate').val() == '') { + alert('Please Enter the Purchase Order date'); + $('#PODate').focus(); + return false; + } else if (radioValue == 0 && $('#Deliverydate').val() == '') { + alert('Please Select the Delivery Date'); + $('#Deliverydate').focus(); + return false; + } else if (radioValue == 1 && $('#Scheduleby').val() == '') { + alert('Please Enter the Schedule By'); + $('#Deliverydate').focus(); + return false; + } else if (radioValue == 2 && $('#Dispatch').val().trim() == '') { + alert('Please Enter the Dispatch Instruction'); + $('#Deliverydate').focus(); + return false; + } else if ($('#ExchangeRate').val() == '') { + alert('Please Enter the Exchange Rate'); + $('#ExchangeRate').focus(); + return false; + } else if ($('#ExchangeRate').val() == 0) { + alert('Please Enter the Exchange Rate'); + $('#ExchangeRate').focus(); + return false; + } else if ($('#PlaceOforigin').val() == '') { + alert('Please Enter Place Of Origin'); + $('#PlaceOforigin').focus(); + return false; + } else if ($('#PoTypeOptions').val() == "0") { + alert('Please Select Capital Type'); + $('#PoTypeOptions').focus(); + return false; + } else if ($('#PaymentTerms').val() == '') { + alert('Please Select Payment Terms'); + $('#PaymentTerms').focus(); + return false; + } else if ($('#Otherpayment').val() == '' && $('#PaymentTerms').val() == 'PT08') { + alert('Please Enter Payable Terms Description'); + $('#Otherpayment').focus(); + return false; + } else if ($('#BudgetType').val() == "0") { + alert('Please Select Budget Type'); + $('#BudgetType').focus(); + return false; + } else if ($('#serviceTax tbody tr').length < 1) { + alert('Atleast One Line needed'); + return false; + } else { return true; } - else if ($('#PODate').val().trim() == '') { - alert('Please Enter the Purchase Order date'); - $('#PODate').focus(); - return false; - }else if ($('#DeliveryAddr').val().trim() == '') { - alert('Please Enter the Delivery Address'); - $('#DeliveryAddr').focus(); - return false; - }else if (radioValue === 0 && $('#Deliverydt').val() == '') { - alert('Please Select the Delivery Date'); - $('#Deliverydt').focus(); - return false; - }else if (radioValue == 1) { - var scheduleBy = $('#Scheduleby').val(); // Get the value - if (!scheduleBy || scheduleBy.trim() == '') { // Check if it's empty or undefined - alert('Please Enter the Schedule By'); - $('#Scheduleby').focus(); - return false; + } + if(PoType=='CAPITAL' && capitalType=='Domestic'){ + if ($('#drpSupplier').val() == "0") { + alert('Please Select the Supplier details'); + $('#drpSupplier').focus(); + return false; + } else if ($('#PODate').val() == '') { + alert('Please Enter the Purchase Order date'); + $('#PODate').focus(); + return false; + } else if (radioValue == 0 && $('#Deliverydate').val() == '') { + alert('Please Select the Delivery Date'); + $('#Deliverydate').focus(); + return false; + } else if (radioValue == 1 && $('#Scheduleby').val() == '') { + alert('Please Enter the Schedule By'); + $('#Deliverydate').focus(); + return false; + } else if (radioValue == 2 && $('#Dispatch').val().trim() == '') { + alert('Please Enter the Dispatch Instruction'); + $('#Deliverydate').focus(); + return false; + } else if ($('#PoTypeOptions').val() == "0") { + alert('Please Select Capital Type'); + $('#PoTypeOptions').focus(); + return false; + } else if ($('#PaymentTerms').val() == '') { + alert('Please Select Payment Terms'); + $('#PaymentTerms').focus(); + return false; + } else if ($('#Otherpayment').val() == '' && $('#PaymentTerms').val() == 'PT08') { + alert('Please Enter Payable Terms Description'); + $('#Otherpayment').focus(); + return false; + } else if ($('#BudgetType').val() == "0") { + alert('Please Select Budget Type'); + $('#BudgetType').focus(); + return false; + } else if ($('#serviceTax tbody tr').length < 1) { + alert('Atleast One Line needed'); + return false; + } else { return true; } } - }else if($('#PODate').val() == ''){ - alert('Please Enter the Purchase Order date'); - $('#PODate').focus(); - return false; - }else if ($('#PoTypeOptions').val() == "0") { - alert('Please Select Service Type'); - $('#PoTypeOptions').focus(); - return false; - }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 ($('#BudgetType').val() == "0") { - alert('Please Select Budget Type'); - $('#BudgetType').focus(); - return false; - }else if ($('#serviceTax tbody tr').length < 1) { - alert('Please Select Line item to Create PO'); - return false; - } else if ($('#descofpo').val().trim() == '') { - alert('Please Enter Description Of Service'); - $('#descofpo').focus(); - return false; - }else { - return true; - } } function importValidate(){ var radioValue = parseInt($("input[name='DateRange']:checked").val()); - - if ($('#drpSupplier').val() == "0") { - alert('Please Select the Supplier details'); - $('#drpSupplier').focus(); - return false; - } else if ($('#currencytype').val() == '0') { - alert('Please Select the Currency Type'); - $('#currencytype').focus(); - return false; - } else if ($('#DeliveryAddr').val().trim() == '') { - alert('Please Enter the Delivery Address'); - $('#DeliveryAddr').focus(); - return false; - } else if (radioValue === 0 && $('#Deliverydt').val() == '') { - alert('Please Select the Delivery Date'); - $('#Deliverydt').focus(); - return false; - } else if (radioValue == 1) { - var scheduleBy = $('#Scheduleby').val(); // Get the value - if (!scheduleBy || scheduleBy.trim() == '') { // Check if it's empty or undefined - alert('Please Enter the Schedule By'); - $('#Scheduleby').focus(); + if ($('#drpSupplier').val() == "0") { + alert('Please Select the Supplier details'); + $('#drpSupplier').focus(); + return false; + } else if ($('#currencytype').val() == '0') { + alert('Please Select the Currency Type'); + $('#currencytype').focus(); + return false; + } else if ($('#PODate').val() == '') { + alert('Please Enter the Purchase Order date'); + $('#PODate').focus(); + return false; + } else if ($('#DeliveryAddr').val() == '') { + alert('Please Enter the Delivery Address'); + $('#DeliveryAddr').focus(); + return false; + } else if (radioValue === 1 && $('#Scheduleby').val() == '') { + alert('Please Enter Schedule By'); + $('#Scheduleby').focus(); + return false; + } else if (radioValue === 2 && $('#Dispatch').val() == '') { + alert('Please Enter Dispatch Instruction'); + $('#Dispatch').focus(); + return false; + } else if ($('#ExchangeRate').val() == '') { + alert('Please Enter the Exchange Rate'); + $('#ExchangeRate').focus(); + return false; + } else if ($('#ExchangeRate').val() == 0) { + alert('Please Enter the Exchange Rate'); + $('#ExchangeRate').focus(); + return false; + } else if ($('#PlaceOforigin').val() == '') { + alert('Please Enter Place Of Origin'); + $('#PlaceOforigin').focus(); + return false; + } else if ($('#Importoption').val() == "0") { + alert('Please Select Import Type'); + $('#Importoption').focus(); + return false; + } else if ($('#PaymentTerms').val() == '') { + alert('Please Select Payment Terms'); + $('#PaymentTerms').focus(); + return false; + } else if ($('#Otherpayment').val() == '' && $('#PaymentTerms').val() == 'PT08') { + alert('Please Enter Payable Terms Description'); + $('#Otherpayment').focus(); + return false; + } else if ($('#BudgetType').val() == "0") { + alert('Please Select Budget Type'); + $('#BudgetType').focus(); + return false; + } else if ($('#ImportTax tbody tr').length < 1) { + alert('Atleast One Line needed'); return false; + }else { + return true; } - } else if ($('#Dispatch').val() == '' && $('#Scheduleby').val() == '') { - if (document.getElementById("Schedule").checked) { - alert('Please Enter Schedule By'); - return false; - } else if (document.getElementById("Date").checked) { - alert('Please Enter Dispatch Instruction'); - return false; - } - - } else if ($('#ExchangeRate').val() == '') { - alert('Please Enter the Exchange Rate'); - $('#ExchangeRate').focus(); - return false; - } else if ($('#ExchangeRate').val() == 0) { - alert('Please Enter the Exchange Rate'); - $('#ExchangeRate').focus(); - return false; - } else if ($('#PlaceOforigin').val() == '') { - alert('Please Enter Place Of Origin'); - $('#PlaceOforigin').focus(); - return false; - } else if ($('#PoTypeOptions').val() == "0") { - alert('Please Select Service Type'); - $('#PoTypeOptions').focus(); - return false; - } else if($('#PODate').val() == ''){ - alert('Please Enter the Purchase Order date'); - $('#PODate').focus(); - return false; - } else if ($('#PaymentTerms').val() == '') { - alert('Please Select Payment Terms'); - $('#PaymentTerms').focus(); - return false; - - } 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 ($('#BudgetType').val() == "0") { - alert('Please Select Budget Type'); - $('#BudgetType').focus(); - return false; - }else if ($('#ImportTax tbody tr').length < 1) { - alert('Please Select Line item to Create PO'); - return false; - }else { - return true; - } } function validate()