diff --git a/application/views/EditservicePurchaseorder.php b/application/views/EditservicePurchaseorder.php index 660df09d..c36ba7fb 100755 --- a/application/views/EditservicePurchaseorder.php +++ b/application/views/EditservicePurchaseorder.php @@ -2878,4 +2878,4 @@ $("#PaymentTerms").change(function() { }); }); - \ No newline at end of file + diff --git a/application/views/alterpurchaseorder.php b/application/views/alterpurchaseorder.php index 47a88740..6f7dec65 100755 --- a/application/views/alterpurchaseorder.php +++ b/application/views/alterpurchaseorder.php @@ -1,7 +1,7 @@ format('Y-m-d'); +$CurrentDate = $dt->format('d-m-Y'); $MaxPoDate = ''; if(!empty($MaxPODate)) { @@ -120,11 +120,11 @@ if(!empty($INRSYMBOL)) $("#PODate").datepicker({ minDate : 'now', maxDate : 'now', - dateFormat: 'mm/dd/yy',changeMonth: true, changeYear: true,yearRange: '-100:+0' + dateFormat: 'dd/mm/yy',changeMonth: true, changeYear: true,yearRange: '-100:+0' }); $("#Deliverydt").datepicker({ minDate : 'now', - dateFormat: 'mm/dd/yy',changeMonth: true, changeYear: true,yearRange: '0:+10' + dateFormat: 'dd/mm/yy',changeMonth: true, changeYear: true,yearRange: '0:+10' }); @@ -1841,6 +1841,22 @@ function SetExciseCalculationCancel() else if(avaBud==''){ alert ("Select Cost Center Name"); } + else if($('#drpSupplier').val() == "0") + { + alert('Please Select the Supplier details'); + $('#drpSupplier').focus(); + return false; + } + else if(input=='REVENUE' && $('#Deliverydate').val()==''){ + alert('Please Select the Delivery Date'); + $('#Deliverydate').focus(); + return false; + } + else if(input=='REVENUE' && $('#Scheduleby').val().trim()==''){ + alert('Please Enter the Schedule By'); + $('#Deliverydate').focus(); + return false; + } else { $("#" + input ).modal('show'); @@ -7148,4 +7164,4 @@ $("#PaymentMethod").change(function() { } - \ No newline at end of file + diff --git a/application/views/capitalpurchaseorder.php b/application/views/capitalpurchaseorder.php index c246336a..f3374e16 100644 --- a/application/views/capitalpurchaseorder.php +++ b/application/views/capitalpurchaseorder.php @@ -1,7 +1,7 @@ format('Y-m-d'); + $CurrentDate = $dt->format('d-m-Y'); $MaxPoDate = ''; $AvlAmount = 0; $paymentDate=''; @@ -11,6 +11,7 @@ { foreach ($MaxPODate as $date) { + $MaxPoDate = $date->PODate; } } @@ -91,7 +92,9 @@ if(!empty($INRSYMBOL)) statusbar: false, toolbar: false }); + $(document).ready(function(){ + $("#PaymentMethod").select2(); clearTotalItemValues(); $('#CapitalToatlOrder').val(0); @@ -106,19 +109,21 @@ $('#CapitalToatlOrder').val(0); $("#PODate").datepicker({ //minDate : d, maxDate : 'now', - dateFormat: 'mm/dd/yy',changeMonth: true, changeYear: true,yearRange: '-100:+0' + dateFormat: 'dd/mm/yy',changeMonth: true, changeYear: true,yearRange: '-100:+0' }); $("#Deliverydt").datepicker({ minDate : 'now', - dateFormat: 'mm/dd/yy',changeMonth: true, changeYear: true,yearRange: '0:+10' + dateFormat: 'dd/mm/yy',changeMonth: true, changeYear: true,yearRange: '0:+10' }); $('#Date').click(function () { + //for Dispatch range selection $('#Schedulediv').hide(); $('#Deliverydtdiv').show(); $('#deliverydateby').hide(); }); $('#Schedule').click(function () { + //for schedule range selection $('#Deliverydtdiv').hide(); $('#Schedulediv').show(); @@ -126,6 +131,7 @@ $('#CapitalToatlOrder').val(0); }); $('#DeliverycheckDate').click(function () { + //for Delivery Date selection $('#Schedulediv').hide(); $('#deliverydateby').show(); @@ -133,10 +139,12 @@ $('#CapitalToatlOrder').val(0); }); }); + //document.getElementById("Date").checked = true; function openModal() { + if(vaildateBeforeOpenModal()) { $('#CAPITAL').modal('show'); @@ -145,18 +153,37 @@ function openModal() function vaildateBeforeOpenModal() { + + var radioValue = $("input[name='DateRange']:checked").val(); + if($('#PODate').val() == '') { alert('Please Enter the Purchase Order date'); $('#PODate').focus(); return false; } + else if($('#drpSupplier').val() == "0") { alert('Please Select the Supplier details'); $('#drpSupplier').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($('#DeliveryAddr').val() == '') { alert('Please Enter the Delivery Address'); @@ -175,13 +202,19 @@ function vaildateBeforeOpenModal() $('#currencytype').focus(); return false; } + else if(capitalType=='International'){ 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{ return true; } @@ -4426,4 +4459,4 @@ $("#PaymentMethod").change(function() { - \ No newline at end of file + diff --git a/application/views/editCapitalPo.php b/application/views/editCapitalPo.php index 5078e5aa..cef40c56 100644 --- a/application/views/editCapitalPo.php +++ b/application/views/editCapitalPo.php @@ -2,7 +2,7 @@ $requestedBy=$requestedBy[0]->FirstName; $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); - $CurrentDate = $dt->format('Y-m-d'); + $CurrentDate = $dt->format('d-m-Y'); $res_arr_values = array(); $DeliverOption=''; $SupId = ''; @@ -268,11 +268,11 @@ $("#PaymentMethod").select2(); $("#PODate").datepicker({ //minDate : d, maxDate : 'now', - dateFormat: 'mm/dd/yy',changeMonth: true, changeYear: true,yearRange: '-100:+0' + dateFormat: 'dd/mm/yy',changeMonth: true, changeYear: true,yearRange: '-100:+0' }); $("#Deliverydt").datepicker({ minDate : 'now', - dateFormat: 'mm/dd/yy',changeMonth: true, changeYear: true,yearRange: '0:+10' + dateFormat: 'dd/mm/yy',changeMonth: true, changeYear: true,yearRange: '0:+10' }); $('#Date').click(function () { //for Dispatch range selection @@ -5379,4 +5379,4 @@ $("#PaymentMethod").change(function() { } }); - \ No newline at end of file + diff --git a/application/views/editRevenuepurchaseorder.php b/application/views/editRevenuepurchaseorder.php index b8bbb6ad..863b0d15 100644 --- a/application/views/editRevenuepurchaseorder.php +++ b/application/views/editRevenuepurchaseorder.php @@ -1,7 +1,7 @@ format('Y-m-d'); +$CurrentDate = $dt->format('d-m-Y'); $MaxPoDate = ''; $AvlAmount = 0; $DeliverSchedule=''; @@ -4539,4 +4539,4 @@ $("#PaymentTerms").change(function() { $('#Otherpayment').val(''); } }); - \ No newline at end of file + diff --git a/application/views/purchaseorder.php b/application/views/purchaseorder.php index 6b6a0c81..776d3c56 100644 --- a/application/views/purchaseorder.php +++ b/application/views/purchaseorder.php @@ -1,7 +1,7 @@ format('Y-m-d'); +$CurrentDate = $dt->format('d-m-Y'); $MaxPoDate = ''; $AvlAmount = 0; $Value="₹"; @@ -105,6 +105,7 @@ if(!empty($INRSYMBOL)) function vaildateBeforeOpenModal() { + var radioValue = $("input[name='DateRange']:checked").val(); if($('#PODate').val() == '') { alert('Please Enter the Purchase Order date'); @@ -123,19 +124,26 @@ function vaildateBeforeOpenModal() $('#DeliveryAddr').focus(); return false; } - else if($('#Deliverydt').val() == '' && $('#Scheduleby').val() == '') - { - alert('Please Enter the Delivery Date'); - $('#Deliverydt').focus(); + else if(radioValue==0 && $('#Deliverydate').val()==''){ + alert('Please Select the Delivery Date'); + $('#Deliverydate').focus(); + return false; + } + else if(radioValue==1 && $('#Scheduleby').val().trim()==''){ + alert('Please Enter the Schedule By'); + $('#Deliverydate').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().trim()==''){ + alert('Please Enter the Schedule By'); + $('#Deliverydate').focus(); return false; } - else if($('#PayableAT').val()=='') - { - - alert('Please Enter Payable AT Value'); - $('#PayableAT').focus(); - return false; - } else { @@ -167,11 +175,11 @@ $(function() $("#PODate").datepicker({ minDate : d, maxDate : 'now', - dateFormat: 'mm/dd/yy',changeMonth: true, changeYear: true,yearRange: '-100:+0' + dateFormat: 'dd/mm/yy',changeMonth: true, changeYear: true,yearRange: '-100:+0' }); $("#Deliverydt").datepicker({ minDate : 'now', - dateFormat: 'mm/dd/yy',changeMonth: true, changeYear: true,yearRange: '0:+10' + dateFormat: 'dd/mm/yy',changeMonth: true, changeYear: true,yearRange: '0:+10' }); $('#drpSupplier').change(function() { @@ -3997,4 +4005,4 @@ $("#PaymentTerms").change(function() { - \ No newline at end of file + diff --git a/application/views/servicePurchaseorder.php b/application/views/servicePurchaseorder.php index eb87e516..474b65d6 100755 --- a/application/views/servicePurchaseorder.php +++ b/application/views/servicePurchaseorder.php @@ -1,7 +1,7 @@ format('Y-m-d'); +$CurrentDate = $dt->format('d-m-Y'); $MaxPoDate = ''; $AvlAmount = 0; $Value="₹"; @@ -68,11 +68,11 @@ var AvilBudAmt = ''; $("#PODate").datepicker({ minDate : d, maxDate : 'now', - dateFormat: 'mm/dd/yy',changeMonth: true, changeYear: true,yearRange: '-100:+0' + dateFormat: 'dd/mm/yy',changeMonth: true, changeYear: true,yearRange: '-100:+0' }); $("#Deliverydt").datepicker({ minDate : 'now', - dateFormat: 'mm/dd/yy',changeMonth: true, changeYear: true,yearRange: '0:+10' + dateFormat: 'dd/mm/yy',changeMonth: true, changeYear: true,yearRange: '0:+10' }); @@ -2072,18 +2072,6 @@ var AvlBudAmt = ''; } } - - $(function () { - $('#serviceTax').DataTable({ - "paging": false, - "lengthChange": false, - "searching": false, - //"ordering": true, - // "info": true, - "autoWidth": false - - }); - }); var Detail = ; @@ -2112,6 +2100,7 @@ function openModal() function vaildateBeforeOpenModal() { + var radioValue = $("input[name='DateRange']:checked").val(); if($('#PODate').val() == '') { alert('Please Enter the Purchase Order date'); @@ -2130,10 +2119,14 @@ function vaildateBeforeOpenModal() $('#DeliveryAddr').focus(); return false; } - else if($('#Deliverydt').val() == '' && $('#Scheduleby').val() == '') - { - alert('Please Enter the Delivery Date'); - $('#Deliverydt').focus(); + else if(radioValue==0 && $('#Deliverydate').val()==''){ + alert('Please Select the Delivery Date'); + $('#Deliverydate').focus(); + return false; + } + else if(radioValue==1 && $('#Scheduleby').val().trim()==''){ + alert('Please Enter the Schedule By'); + $('#Deliverydate').focus(); return false; } else if($('#workstatus').val()=="0") @@ -2217,4 +2210,4 @@ $("#PaymentTerms").change(function() { } }); - \ No newline at end of file + diff --git a/assets/js/CreatePOValidation.js b/assets/js/CreatePOValidation.js index 0b7f04d4..a8e586c8 100755 --- a/assets/js/CreatePOValidation.js +++ b/assets/js/CreatePOValidation.js @@ -28,6 +28,8 @@ function myFunction() { } function validate() { + var radioValue = $("input[name='DateRange']:checked").val(); + var PoType = $('#POType').val(); var currencyType = $('#currencytype').val(); if($('#PODate').val() == '') @@ -42,18 +44,24 @@ function validate() $('#drpSupplier').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().trim()==''){ + alert('Please Enter the Schedule By'); + $('#Deliverydate').focus(); + return false; + } + else if($('#DeliveryAddr').val() == '') { alert('Please Enter the Delivery Address'); $('#DeliveryAddr').focus(); return false; } - else if($('#Deliverydt').val() == '' && $('#Scheduleby').val() == '') - { - alert('Please Enter the Delivery Date'); - $('#Deliverydt').focus(); - return false; - } + else if(PoType=='CAPITAL' && capitalType=='International'){ if(currencyType=='0'){ @@ -61,6 +69,16 @@ function validate() $('#currencytype').focus(); return false; } + else if(radioValue==2 && $('#Dispatch').val().trim()==''){ + alert('Please Enter the Dispatch Instruction'); + $('#Deliverydate').focus(); + return false; + } + else if($('#PlaceOforigin').val().trim() == ''){ + alert('Please Enter the Place Of Origin'); + $('#PlaceOforigin').focus(); + return false; + } else if($('#ExchangeRt').val()==''){ alert('Please Enter the Exchange Rate'); $('#ExchangeRt').focus();