diff --git a/application/views/servicePurchaseorder.php b/application/views/servicePurchaseorder.php
index ffca1158..2034e25f 100755
--- a/application/views/servicePurchaseorder.php
+++ b/application/views/servicePurchaseorder.php
@@ -64,6 +64,9 @@ var AvilBudAmt = '';
+
+
+
$('#drpSupplier').change(function() {
@@ -786,7 +789,7 @@ $(document).ready(function () {
-
+
@@ -2071,5 +2074,59 @@ $('#txtStatus').val(stat);
+
+
+
+function openModal()
+{
+ if(vaildateBeforeOpenModal())
+ {
+ $('#SERVICE').modal('show');
+ }
+}
+
+function vaildateBeforeOpenModal()
+{
+ 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($('#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($('#workstatus').val()=="0")
+ {
+ alert('Please Enter WorkStatus');
+ $('#workstatus').focus();
+ return false;
+
+ }
+
+
+ else
+ {
+ return true;
+ }
+}
+
+
+