Purchase order submit button : ps
This commit is contained in:
parent
bdcfe0c01e
commit
e6eb446a81
@ -266,7 +266,8 @@ class Amendmentpurchaseorder extends BaseController
|
||||
}
|
||||
|
||||
$POType = $this->request->getPost('POType');
|
||||
$PoRange = $this->request->getPost('Range');
|
||||
$Local_Interstate = $this->request->getPost('Range');
|
||||
|
||||
$PaymentTermsText = $this->request->getPost('beforePaymentTermsText');
|
||||
$PaymentTerms = $this->request->getPost('PaymentTerms');
|
||||
$Otherpayment = $this->request->getPost('Otherpayment');
|
||||
@ -308,7 +309,7 @@ class Amendmentpurchaseorder extends BaseController
|
||||
}
|
||||
$AmendmentNewPoNo = generate_amendment_po_number($PONO);
|
||||
|
||||
$POMaster = array('PONO' => $AmendmentNewPoNo, 'ParentPO' => $PONO, 'SupplierID' => $SupplierID, 'POType' => $POType, 'PORange' => $PoRange, 'TotalOrderValue' => $TotalOrderValueSummary, 'PODate' => $PODate, 'Status' => $changeStatus , 'PaymentTerms' => $PaymentTerms, 'PaymentOtherDescription' => $Otherpayment, 'Mode_Of_Shipment' => $Modeofshipment, 'Supplier_Reference' => $supplierreference, 'Supplier_Offer_No' => $supplieroffno, 'Other_Reference' => $otherreference, 'Fincap' => $fincap, 'InsuranceStatus' => $insurancestatus, 'InsuranceNumber' => $InsuranceNumber, 'POSubType' => $revenuetype, 'DeliverySchedule' => $DeliverySchedule, 'DeliveryOption' => $DeliveryOption, 'ServiceDescription' => $SpecialInstruction, 'CreatedBy' => $updatedBy, 'DeliveryAddress' => $DeliveryAddr, 'DeliveryDate' => $Deliverydt, 'UpdatedOn' => $updateddt, 'ReleasedBy' => $updatedBy, 'ReleasedOn' => $updateddt, 'AmendedDetails' => $MAD, 'IsQualityChkReqired' => $qtycheckresult);
|
||||
$POMaster = array('PONO' => $AmendmentNewPoNo, 'ParentPO' => $PONO, 'SupplierID' => $SupplierID, 'POType' => $POType, 'PORange' => $Local_Interstate, 'TotalOrderValue' => $TotalOrderValueSummary, 'PODate' => $PODate, 'Status' => $changeStatus , 'PaymentTerms' => $PaymentTerms, 'PaymentOtherDescription' => $Otherpayment, 'Mode_Of_Shipment' => $Modeofshipment, 'Supplier_Reference' => $supplierreference, 'Supplier_Offer_No' => $supplieroffno, 'Other_Reference' => $otherreference, 'Fincap' => $fincap, 'InsuranceStatus' => $insurancestatus, 'InsuranceNumber' => $InsuranceNumber, 'POSubType' => $revenuetype, 'DeliverySchedule' => $DeliverySchedule, 'DeliveryOption' => $DeliveryOption, 'ServiceDescription' => $SpecialInstruction, 'CreatedBy' => $updatedBy, 'DeliveryAddress' => $DeliveryAddr, 'DeliveryDate' => $Deliverydt, 'UpdatedOn' => $updateddt, 'ReleasedBy' => $updatedBy, 'ReleasedOn' => $updateddt, 'AmendedDetails' => $MAD, 'IsQualityChkReqired' => $qtycheckresult);
|
||||
$file = $this->request->getFile('POFile');
|
||||
$requestfilename = $file->getName();
|
||||
$PrePOFile = $this->request->getPost('PrePOFile');
|
||||
|
||||
@ -435,6 +435,7 @@ class Assetdetails extends BaseController
|
||||
$User = $this->request->getPost('User');
|
||||
$SupplierName = $this->request->getPost('SupplierName');
|
||||
$DateOfPurchase = $this->request->getPost('DateOfPurchase');
|
||||
$DOpurchase = "";
|
||||
if ($DateOfPurchase != '') {
|
||||
$DOpurchase = get_date_time_format($DateOfPurchase);
|
||||
}
|
||||
|
||||
@ -1251,8 +1251,8 @@ if (!empty($getlogpodtl)) {
|
||||
<th style="text-align:left !important; white-space: nowrap !important;">Item Code</th>
|
||||
<th style="white-space: nowrap !important;">Item Description</th>
|
||||
<th style="white-space: nowrap !important;">Line Item Specs</th>
|
||||
<th style="text-align: left; white-space: nowrap !important;">Quantity</th>
|
||||
<th style="white-space: nowrap !important;">UOM</th>
|
||||
<th style="text-align: left; white-space: nowrap !important;">Quantity</th>
|
||||
<th style="text-align: right; white-space: nowrap !important;">Rate <?php echo "($INRSYM)" ?></th>
|
||||
<th style="text-align: right; white-space: nowrap !important;">Basic Amount <?php echo "($INRSYM)" ?></th>
|
||||
<th style="text-align: right; white-space: nowrap !important;">Tax Amount <?php echo "($INRSYM)" ?></th>
|
||||
@ -1285,7 +1285,8 @@ if (!empty($getlogpodtl)) {
|
||||
<td style="text-align:left !important;"><?php echo $record->MaterialCode ?></td>
|
||||
<td style="text-align:left !important;"><?php $shortName = mb_strimwidth($record->MaterialName, 0, 13, "...");
|
||||
echo $shortName; ?></td>
|
||||
<td style="text-align:left !important;"><?php if ($PONOStatus === PO_DRAFT || $PONOStatus === PO_CREATED) { ?>
|
||||
<td style="text-align:left !important;">
|
||||
<?php if ($PONOStatus === PO_DRAFT || $PONOStatus === PO_CREATED) { ?>
|
||||
<a href="#"
|
||||
class="editable-field"
|
||||
data-id="<?php echo $index ?>" data-notes="<?php echo $record->LineitemAuditorNotes; ?>">
|
||||
@ -1296,9 +1297,7 @@ if (!empty($getlogpodtl)) {
|
||||
<button class="save-btn">✔</button>
|
||||
<button class="cancel-btn">✖</button>
|
||||
</div>
|
||||
<?php } else {
|
||||
echo !empty($record->LineitemAuditorNotes) ? $record->LineitemAuditorNotes : "-";
|
||||
} ?>
|
||||
<?php } else { echo !empty($record->LineitemAuditorNotes) ? $record->LineitemAuditorNotes : "-"; } ?>
|
||||
</td>
|
||||
<td style="text-align:left !important;"><?php echo $record->Quantity ?></td>
|
||||
<td><?php echo $record->UOM ?></td>
|
||||
@ -1309,9 +1308,9 @@ if (!empty($getlogpodtl)) {
|
||||
|
||||
<td style="text-align:right !important;"><?php echo $record->Taxamount ?></td>
|
||||
<td style="text-align:right !important;"><?php echo $record->TotalValue ?></td>
|
||||
<!-- <td align="right"><?php echo $record->Quantity ?></td>
|
||||
<td align="right"><?php echo $record->ReceivedQuantity ?></td>
|
||||
<td align="right"><?php echo number_format($record->Quantity - $record->ReceivedQuantity, 2, '.', ''); ?></td> -->
|
||||
<!-- <td align="right"><?php // echo $record->Quantity ?></td> -->
|
||||
<!-- <td align="right"><?php // echo $record->ReceivedQuantity ?></td> -->
|
||||
<!-- <td align="right"><?php // echo number_format($record->Quantity - $record->ReceivedQuantity, 2, '.', ''); ?></td> -->
|
||||
|
||||
<input type="hidden" name="<?php echo 'Reqnumber' . $index ?>" id="<?php echo 'Reqnumber' . $index ?>" value="<?php echo $record->ReqNo; ?>" />
|
||||
|
||||
@ -1660,7 +1659,7 @@ if (!empty($getlogpodtl)) {
|
||||
<a class="btn btn-success Save" ID="Submit" onclick="Save(3)"> <span class="bold">Submit</span></a>
|
||||
<?php } else { ?>
|
||||
<a class="btn btn-success" ID="OK" href="<?php echo base_url() . 'purchaseorderListing'; ?>"> <span class="bold">OK</span></a>
|
||||
<a class="btn btn-success Save" ID="Submit" onclick="Save(2)"> <span class="bold">Submit</span></a>
|
||||
<!-- <a class="btn btn-success Save" ID="Submit" onclick="Save(2)"> <span class="bold">Submit</span></a> -->
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
@ -2622,7 +2621,7 @@ if (!empty($getlogpodtl)) {
|
||||
// Taxvalue: TotalTaxValue,
|
||||
// TotalValue: TotalOrderValue
|
||||
// }));
|
||||
PONOStatus = <?php echo $PONOStatus; ?>
|
||||
var PONOStatus = "<?php echo $PONOStatus; ?>";
|
||||
var shorten = materialName.length > 13 ? materialName.slice(0, 13) + "..." : materialName;
|
||||
var rowHtml = `
|
||||
<tr id="${temp}">
|
||||
@ -2917,8 +2916,6 @@ if (!empty($getlogpodtl)) {
|
||||
|
||||
$('#OtheritemDescription').val('');
|
||||
}
|
||||
var DeletedMaterialCode = '';
|
||||
var DeletedMaterialName = '';
|
||||
|
||||
function DeleteRow(rowid) {
|
||||
|
||||
@ -3152,6 +3149,7 @@ if (!empty($getlogpodtl)) {
|
||||
</script>
|
||||
<script>
|
||||
function Save(status) {
|
||||
console.log("serviceValidate",status);
|
||||
if (status == '0') {
|
||||
stat = '<?php echo PO_DRAFT; ?>';
|
||||
} else if (status == '1') {
|
||||
@ -3179,71 +3177,72 @@ if (!empty($getlogpodtl)) {
|
||||
|
||||
|
||||
if (serviceValidate()) {
|
||||
if (document.getElementById('ServiceTable').rows.length < 2) {
|
||||
alert('Atleast One Line needed');
|
||||
return false;
|
||||
}
|
||||
console.log("serviceValidate");
|
||||
if ($('#ServiceTable tbody tr').length < 1) {
|
||||
alert('Atleast One Line needed');
|
||||
return false;
|
||||
}
|
||||
// else if(parseInt(AvlBudAmt) < parseInt(txtTotalOrderValueSummary)) {
|
||||
// alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.');
|
||||
// return false;
|
||||
// }
|
||||
// else if ($('#Otherpayment').val() == '' && $('#PaymentTerms').val() == 'PT08') {
|
||||
// alert('Please Enter Payable Terms');
|
||||
// $('#Otherpayment').focus();
|
||||
// return false;
|
||||
else if ($('#editdescofpo').val().trim() == '') {
|
||||
alert('Please Enter Description Of Service');
|
||||
$('#editdescofpo').focus();
|
||||
return false;
|
||||
} else {
|
||||
// $('#content').loader('show');
|
||||
var formData = new FormData($('.ServicePO')[0]);
|
||||
$('#loader').show();
|
||||
// disableButtons();
|
||||
$.ajax({
|
||||
// data: $('.ServicePO').serialize(),
|
||||
type: "POST",
|
||||
url: "<?php echo base_url() ?>servicepurchaseorder/UpdateServicePurchaseOrder",
|
||||
data: formData,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(data) {
|
||||
else if ($('#Otherpayment').val() == '' && $('#PaymentTerms').val() == 'PT08') {
|
||||
alert('Please Enter Payable Terms');
|
||||
$('#Otherpayment').focus();
|
||||
return false;
|
||||
} else if ($('#editdescofpo').val().trim() == '') {
|
||||
alert('Please Enter Description Of Service');
|
||||
$('#editdescofpo').focus();
|
||||
return false;
|
||||
} else {
|
||||
console.log("serviceValidate else");
|
||||
// $('#content').loader('show');
|
||||
var formData = new FormData($('.ServicePO')[0]);
|
||||
$('#loader').show();
|
||||
// disableButtons();
|
||||
$.ajax({
|
||||
// data: $('.ServicePO').serialize(),
|
||||
type: "POST",
|
||||
url: "<?php echo base_url() ?>servicepurchaseorder/UpdateServicePurchaseOrder",
|
||||
data: formData,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(data) {
|
||||
|
||||
|
||||
|
||||
// var newWindow = window.open("", "_blank", "toolbar=yes,scrollbars=yes,resizable=yes,width=1024,height=768");
|
||||
// newWindow.document.write("<html><head><title>Response</title></head><body>");
|
||||
// newWindow.document.write("<pre>" + data + "</pre>"); // Using <pre> to preserve formatting
|
||||
// newWindow.document.write("</body></html>");
|
||||
// newWindow.document.close();
|
||||
// newWindow.moveTo(0, 0);
|
||||
// newWindow.resizeTo(screen.width, screen.height);
|
||||
if (data) {
|
||||
$('#loader').hide();
|
||||
alert(data);
|
||||
$('#txtRowCount').val('');
|
||||
$('#txtDeletedRow').val('');
|
||||
$('#txtStatus').val('');
|
||||
$('#SpcialInstruction').val('');
|
||||
$('#txtDeliveryAddress').val('')
|
||||
window.location = "purchaseorderListing";
|
||||
// var newWindow = window.open("", "_blank", "toolbar=yes,scrollbars=yes,resizable=yes,width=1024,height=768");
|
||||
// newWindow.document.write("<html><head><title>Response</title></head><body>");
|
||||
// newWindow.document.write("<pre>" + data + "</pre>"); // Using <pre> to preserve formatting
|
||||
// newWindow.document.write("</body></html>");
|
||||
// newWindow.document.close();
|
||||
// newWindow.moveTo(0, 0);
|
||||
// newWindow.resizeTo(screen.width, screen.height);
|
||||
if (data) {
|
||||
$('#loader').hide();
|
||||
alert(data);
|
||||
$('#txtRowCount').val('');
|
||||
$('#txtDeletedRow').val('');
|
||||
$('#txtStatus').val('');
|
||||
$('#SpcialInstruction').val('');
|
||||
$('#txtDeliveryAddress').val('')
|
||||
window.location = "purchaseorderListing";
|
||||
// setTimeout(function() { enableButtons(); }, 2000);
|
||||
} else {
|
||||
$('#loader').hide();
|
||||
// setTimeout(function() { enableButtons(); }, 2000);
|
||||
alert("Error");
|
||||
}
|
||||
|
||||
},
|
||||
error: function(jqXHR, textStatus, errorThrown) {
|
||||
console.error("AJAX Error: " + textStatus + ": " + errorThrown);
|
||||
alert("Error: " + textStatus);
|
||||
// setTimeout(function() { enableButtons(); }, 2000);
|
||||
} else {
|
||||
$('#loader').hide();
|
||||
// setTimeout(function() { enableButtons(); }, 2000);
|
||||
alert("Error");
|
||||
}
|
||||
|
||||
},
|
||||
error: function(jqXHR, textStatus, errorThrown) {
|
||||
console.error("AJAX Error: " + textStatus + ": " + errorThrown);
|
||||
alert("Error: " + textStatus);
|
||||
// setTimeout(function() { enableButtons(); }, 2000);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
// this function is used to clear data changing schedule option
|
||||
@ -3346,12 +3345,14 @@ if (!empty($getlogpodtl)) {
|
||||
|
||||
//ServiceTable
|
||||
var rows = $('#ServiceTable tbody tr').length;
|
||||
var DeletedMaterialCode = '';
|
||||
var DeletedMaterialName = '';
|
||||
|
||||
if (DeletedMaterialCode != undefined && DeletedMaterialCode != '') {
|
||||
|
||||
$("#MaterialCode").append($('<option></option>').val(DeletedMaterialCode).html(DeletedMaterialCode + "-" + DeletedMaterialName));
|
||||
DeletedMaterialCode = '';
|
||||
DeletedMaterialCode = '';
|
||||
DeletedMaterialName = '';
|
||||
}
|
||||
|
||||
for (i = 2; i <= rows; i++) {
|
||||
|
||||
@ -1839,14 +1839,18 @@ if (!empty($INRSYMBOL)) {
|
||||
function showsubmit() {
|
||||
var isChecked = $('#IsOpenOrder').is(':checked');
|
||||
console.log("Step 1 = SS");
|
||||
var PO = $('#POType').val();
|
||||
var POTy = $('#POType').val();
|
||||
|
||||
if (PO == 'SERVICE') {
|
||||
if ($('#emergdescofpo').val().trim() == '') {
|
||||
alert('Please Enter Description Of Service');
|
||||
$('#emergdescofpo').focus();
|
||||
return false;
|
||||
}
|
||||
if (POTy == 'SERVICE') {
|
||||
|
||||
var descValue = tinymce.get('emergdescofpo').getContent().trim();
|
||||
descValue = $.trim(descValue);
|
||||
|
||||
if (descValue == '') {
|
||||
alert('Please Enter Description Of Service');
|
||||
$('#emergdescofpo').focus();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (isChecked) {
|
||||
@ -3026,10 +3030,9 @@ if (!empty($INRSYMBOL)) {
|
||||
<label>Description Of Service <span
|
||||
class="badge mandatory">*</span></label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'emergdescofpo', 'value' => set_value('emergdescofpo'), 'id' => 'emergdescofpo', 'class' => 'form-control', 'rows' => '3', 'cols' => '40');
|
||||
echo form_textarea($data);
|
||||
?>
|
||||
<textarea name="emergdescofpo" id="emergdescofpo" class="form-control" rows="3" cols="40">
|
||||
<?php echo set_value('emergdescofpo'); ?>
|
||||
</textarea>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@ -1583,17 +1583,12 @@ if (!empty($getlogpodtl)) {
|
||||
|
||||
|
||||
<?php if ($PONOStatus == PO_DRAFT || $PONOStatus == PO_CREATED) { ?>
|
||||
<a class="btn btn-success Save" ID="Cancel"
|
||||
href="<?php echo base_url() . 'purchaseorderListing'; ?>"> <span
|
||||
class="bold">Cancel</span></a>
|
||||
<?php if ($PONOStatus == PO_DRAFT || $PONOStatus == PO_CREATED) { ?>
|
||||
<a class="btn btn-success Save" ID="Save" onclick="Save(0)"> <span class="bold">Save as
|
||||
Draft</span></a>
|
||||
<a class="btn btn-success Save" ID="Cancel" href="<?php echo base_url() . 'purchaseorderListing'; ?>"> <span class="bold">Cancel</span></a>
|
||||
<?php if ($PONOStatus == PO_DRAFT) { ?>
|
||||
<a class="btn btn-success Save" ID="Save" onclick="Save(0)"> <span class="bold">Save as Draft</span></a>
|
||||
<?php } ?>
|
||||
<a class="btn btn-success Save" ID="Submit" onclick="Save(1)"> <span
|
||||
class="bold">Submit</span></a>
|
||||
<a class="btn btn btn-soft-primary waves-effect waves-light Save" ID="Submit"
|
||||
onclick="Save(4)"> <span class="bold">Approve</span></a>
|
||||
<a class="btn btn-success Save" ID="Submit" onclick="Save(1)"> <span class="bold">Submit</span></a>
|
||||
<a class="btn btn btn-soft-primary waves-effect waves-light Save" ID="Submit" onclick="Save(4)"> <span class="bold">Approve</span></a>
|
||||
<?php } else {
|
||||
if ($DEPCode == FINANCE) { ?>
|
||||
<a class="btn btn-success" ID="OK" onclick="PageRedirect()">OK</a>
|
||||
|
||||
@ -1202,11 +1202,6 @@ if (!empty($RequistionDetails)) {
|
||||
<table id="ImportTax" class="table nowrap table-bordered table-hover mb-0" style="font-size:12px;">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<th style="white-space: nowrap !important; text-align:left !important">SNo</th>
|
||||
<th style="white-space: nowrap !important; text-align:center !important">Requisition No</th>
|
||||
<th style="white-space: nowrap !important; text-align:left !important">Item Description</th>
|
||||
@ -1215,7 +1210,7 @@ if (!empty($RequistionDetails)) {
|
||||
<th style="white-space: nowrap !important; text-align:right !important">Rate<?php echo $INR ?></th>
|
||||
<th style="white-space: nowrap !important; text-align:right !important">Basic Amount<?php echo $INR ?></th>
|
||||
<!-- <th>Tax Amount</th>
|
||||
<th>Total Order Amount</th> -->
|
||||
<th>Total Order Amount</th> -->
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@ -1239,7 +1234,7 @@ if (!empty($RequistionDetails)) {
|
||||
<td style="text-align:right !important"><?php echo $record->Rate ?></td>
|
||||
<td style="text-align:right !important"><?php echo $record->BasicValue ?></td>
|
||||
<!-- <td><?php echo $record->Taxamount ?></td>
|
||||
<td><?php echo $record->TotalOrderValue ?></td> -->
|
||||
<td><?php echo $record->TotalOrderValue ?></td> -->
|
||||
<input type="hidden" name="<?php echo 'Reqnumber' . $index ?>" id="<?php echo 'Reqnumber' . $index ?>" value="<?php echo $record->ReqNo; ?>" />
|
||||
<input type="hidden" name="<?php echo 'departmentName' . $index ?>" id="<?php echo 'departmentName' . $index ?>" value="<?php echo $record->DepartmentName; ?>" />
|
||||
<!-- <input type="hidden" name="<?php //echo 'AvlBudAmt'.$index
|
||||
@ -1352,7 +1347,7 @@ if (!empty($RequistionDetails)) {
|
||||
<?php
|
||||
// } else {
|
||||
?>
|
||||
<td> <!-- <a data-toggle="tooltip" href="#"><i class="fa fa-eye" data-toggle="tooltip" title="<?php echo $record->ReqNo; ?> - Click here to view Requistion details"></i> </a> </td> -->
|
||||
</td> <!-- <a data-toggle="tooltip" href="#"><i class="fa fa-eye" data-toggle="tooltip" title="<?php echo $record->ReqNo; ?> - Click here to view Requistion details"></i> </a> </td> -->
|
||||
<?php
|
||||
// }
|
||||
?>
|
||||
|
||||
@ -64,7 +64,7 @@ $insurenceno = '';
|
||||
$BudgetType = '';
|
||||
|
||||
if (!empty($POMaster)) {
|
||||
// print_r($POMaster);
|
||||
// dd($POMaster);
|
||||
|
||||
// print_r($Payment);
|
||||
// echo "****";
|
||||
@ -1219,7 +1219,7 @@ if (!empty($INRSYMBOL)) {
|
||||
<br>
|
||||
<div class="form-row">
|
||||
<div class="table-responsive" style="padding-bottom: 30px;">
|
||||
<table id="ServiceTable" class="table table-bordered table-hover" style="font-size:12px;">
|
||||
<table id="revenueTax" class="table table-bordered table-hover" style="font-size:12px;">
|
||||
<thead>
|
||||
|
||||
<tr>
|
||||
|
||||
@ -952,7 +952,7 @@ foreach ($PaymentTerms as $TER) {
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-3">
|
||||
<label>Insurance Options<span class="text-danger">*</span></label>
|
||||
<div class="form-group">
|
||||
<div>
|
||||
|
||||
<?php
|
||||
|
||||
@ -975,15 +975,19 @@ foreach ($PaymentTerms as $TER) {
|
||||
endforeach;
|
||||
}
|
||||
|
||||
echo form_dropdown('insuranceStatus', $optionsInsurance, set_value('insuranceStatus'), 'id="insuranceStatus" required="true" class="form-control select2');
|
||||
echo form_dropdown('insuranceStatus', $optionsInsurance, set_value('insuranceStatus'), 'id="insuranceStatus" required="true" class="form-control select2"');
|
||||
|
||||
|
||||
?>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group col-md-3" id="insuranceTxtDiv" style="display:block;">
|
||||
<label>Insurance No / Insurance Details<span class="text-danger">*</span></label>
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<?php
|
||||
$data = array('name' => 'InsuranceNumber', 'value' => set_value('InsuranceNumber', $InsuranceNumber), 'id' => 'InsuranceNumber', 'class' => 'form-control', 'required' => 'true');
|
||||
echo form_input($data);
|
||||
|
||||
@ -4277,7 +4277,7 @@ if (!empty($getlogpodtl)) {
|
||||
|
||||
|
||||
//alert('in');
|
||||
PONOStatus = <?php echo $PONOStatus; ?>
|
||||
var PONOStatus = "<?php echo $PONOStatus; ?>";
|
||||
var shorten = materialName.length > 13 ? materialName.slice(0, 13) + "..." : materialName;
|
||||
var rowHtml = `
|
||||
<tr id="${temp}">
|
||||
|
||||
@ -311,8 +311,14 @@
|
||||
}
|
||||
|
||||
function Save() {
|
||||
$('#loader').show();
|
||||
if (validate()) {
|
||||
$('#IGRForm').submit();
|
||||
// $('#IGRForm').submit();
|
||||
$('#loader').hide();
|
||||
alert("###");
|
||||
}else{
|
||||
$('#loader').hide();
|
||||
alert("***");
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -411,7 +417,7 @@
|
||||
var status = '';
|
||||
var isOpenOrder = 0;
|
||||
if (id != '-1') {
|
||||
$('#content').loader('show');
|
||||
$('#loader').show();
|
||||
var y = <?php echo json_encode($PO_NO, JSON_PRETTY_PRINT) ?>;
|
||||
$.each(y, function(idx, obj) {
|
||||
if (id == obj.PONO) {
|
||||
@ -443,7 +449,7 @@
|
||||
type: "POST",
|
||||
url: "<?php echo base_url() ?>GetIGRLineItemDetails",
|
||||
success: function(data) {
|
||||
$('#content').loader('hide');
|
||||
$('#loader').hide();
|
||||
//alert(data);
|
||||
var trHTML = '';
|
||||
var j = 0;
|
||||
|
||||
@ -2385,7 +2385,7 @@ if (!empty($INRSYMBOL)) {
|
||||
var AvlBudAmt = '<?php echo $AvlAmount ?>';
|
||||
var txtTotalOrderValueSummary = $('#txtTotBasicAmount').val();
|
||||
if (serviceValidate()) {
|
||||
if (document.getElementById('ServiceTable').rows.length < 1) {
|
||||
if ($('#ServiceTable tbody tr').length < 1) {
|
||||
alert('Atleast One Line needed');
|
||||
return false;
|
||||
}
|
||||
@ -2397,7 +2397,7 @@ if (!empty($INRSYMBOL)) {
|
||||
// alert('Please Enter Other Payable Terms Description');
|
||||
// $('#Otherpayment').focus();
|
||||
// return false;
|
||||
} else if ($('#descofpo').val().trim() == '') {
|
||||
else if ($('#descofpo').val().trim() == '') {
|
||||
alert('Please Enter Description Of Service');
|
||||
$('#descofpo').focus();
|
||||
return false;
|
||||
@ -2443,7 +2443,7 @@ if (!empty($INRSYMBOL)) {
|
||||
}
|
||||
|
||||
});
|
||||
// }
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -43,7 +43,7 @@ function enableButtons() {
|
||||
|
||||
function revenueValidate(){
|
||||
var radioValue = parseInt($("input[name='DateRange']:checked").val());
|
||||
|
||||
var scheduleBy = $('#Scheduleby').val(); // Get the value
|
||||
if ($('#drpSupplier').val() == "0") {
|
||||
alert('Please Select the Supplier details');
|
||||
$('#drpSupplier').focus();
|
||||
@ -60,13 +60,10 @@ function revenueValidate(){
|
||||
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
|
||||
}else if (radioValue == 1 && (!scheduleBy || scheduleBy.trim() == '')) {
|
||||
alert('Please Enter the Schedule By');
|
||||
$('#Scheduleby').focus();
|
||||
return false;
|
||||
}
|
||||
}else if($('#PODate').val() == ''){
|
||||
alert('Please Enter the Purchase Order date');
|
||||
$('#PODate').focus();
|
||||
@ -97,54 +94,68 @@ function revenueValidate(){
|
||||
|
||||
function serviceValidate(){
|
||||
var radioValue = parseInt($("input[name='DateRange']:checked").val());
|
||||
var scheduleBy = $('#Scheduleby').val(); // Get the value
|
||||
|
||||
if ($('#drpSupplier').val() == "0") {
|
||||
console.log('Please Select the Supplier details');
|
||||
alert('Please Select the Supplier details');
|
||||
$('#drpSupplier').focus();
|
||||
return false;
|
||||
}else if ($('#workstatus').val() == "0") {
|
||||
console.log('Please Select the Work Status');
|
||||
alert('Please Select the Work Status');
|
||||
$('#workstatus').focus();
|
||||
return false;
|
||||
}else if ($('#PODate').val().trim() == '') {
|
||||
console.log('Please Enter the Purchase Order date');
|
||||
alert('Please Enter the Purchase Order date');
|
||||
$('#PODate').focus();
|
||||
return false;
|
||||
}else if ($('#DeliveryAddr').val().trim() == '') {
|
||||
console.log('Please Enter the Delivery Address');
|
||||
alert('Please Enter the Delivery Address');
|
||||
$('#DeliveryAddr').focus();
|
||||
return false;
|
||||
}else if (radioValue === 0 && $('#Deliverydt').val() == '') {
|
||||
console.log('Please Select the Delivery Date');
|
||||
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
|
||||
}else if (radioValue == 1 && (!scheduleBy || scheduleBy.trim() == '')) {
|
||||
console.log('Please Enter the Schedule By');
|
||||
alert('Please Enter the Schedule By');
|
||||
$('#Scheduleby').focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
}else if($('#PODate').val() == ''){
|
||||
console.log('Please Enter the Purchase Order date');
|
||||
alert('Please Enter the Purchase Order date');
|
||||
$('#PODate').focus();
|
||||
return false;
|
||||
}else if ($('#PoTypeOptions').val() == "0") {
|
||||
console.log('Please Select Service Type');
|
||||
alert('Please Select Service Type');
|
||||
$('#PoTypeOptions').focus();
|
||||
return false;
|
||||
}else if ($('#Otherpayment').val() == '' && $('#PaymentTerms').val() == 'PT08') {
|
||||
console.log('Please Enter Payable Terms Description');
|
||||
alert('Please Enter Payable Terms Description');
|
||||
$('#Otherpayment').focus();
|
||||
return false;
|
||||
}else if($('#insuranceStatus').val() == "1" && $('#InsuranceNumber').val().trim() == ''){
|
||||
console.log('Please Enter the Insurance No / Insurance Details');
|
||||
alert('Please Enter the Insurance No / Insurance Details');
|
||||
$('#InsuranceNumber').focus();
|
||||
return false;
|
||||
}else if ($('#BudgetType').val() == "0") {
|
||||
console.log('Please Select Budget Type');
|
||||
alert('Please Select Budget Type');
|
||||
$('#BudgetType').focus();
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
console.log("JS else part");
|
||||
return true;
|
||||
}
|
||||
// else if ($('#ServiceTable tbody tr').length < 1) {
|
||||
// alert('Atleast One Line needed');
|
||||
@ -154,9 +165,7 @@ function serviceValidate(){
|
||||
// $('#descofpo').focus();
|
||||
// return false;
|
||||
// }
|
||||
else {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function capitalValidate(){
|
||||
@ -332,21 +341,21 @@ function importValidate(){
|
||||
function validate()
|
||||
{
|
||||
var radioValue = $("input[name='DateRange']:checked").val();
|
||||
|
||||
var PoType = $('#POType').val();
|
||||
var currencyType = $('#currencytype').val();
|
||||
if($('#PODate').val() == '')
|
||||
var PoType = $('#POType').val();
|
||||
var currencyType = $('#currencytype').val();
|
||||
|
||||
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($('#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();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user