3881 lines
127 KiB
PHP
Executable File
3881 lines
127 KiB
PHP
Executable File
<style>
|
||
.edit-container {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
gap: 10px;
|
||
}
|
||
|
||
.edit-input-field {
|
||
padding: 2px;
|
||
font-size: 14px;
|
||
border: 1px solid #ccc;
|
||
border-radius: 4px;
|
||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
||
width: 150px;
|
||
}
|
||
|
||
.edit-input-field:focus {
|
||
outline: none;
|
||
border-color: #007bff;
|
||
box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
|
||
}
|
||
|
||
.save-btn,
|
||
.cancel-btn {
|
||
border: none;
|
||
background: none;
|
||
cursor: pointer;
|
||
font-size: 16px;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
width: 30px;
|
||
height: 30px;
|
||
border-radius: 50%;
|
||
transition: background-color 0.3s ease;
|
||
}
|
||
|
||
.save-btn {
|
||
color: #28a745;
|
||
background-color: #e8f5e9;
|
||
}
|
||
|
||
.save-btn:hover {
|
||
background-color: #c3e6cb;
|
||
}
|
||
|
||
.cancel-btn {
|
||
color: #dc3545;
|
||
background-color: #f8d7da;
|
||
}
|
||
|
||
.cancel-btn:hover {
|
||
background-color: #f5c6cb;
|
||
}
|
||
</style>
|
||
<script>
|
||
$(document).ready(function() {
|
||
$(document).on('click', '.editable-field', function(e) {
|
||
e.preventDefault();
|
||
const $link = $(this);
|
||
const value = $link.text().trim();
|
||
|
||
// Hide the <a> tag and show the edit container
|
||
$link.hide();
|
||
const $editContainer = $link.siblings('.edit-container');
|
||
$editContainer.find('.edit-input-field').val(value);
|
||
$editContainer.show();
|
||
});
|
||
|
||
// Handle click on the tick (save) button
|
||
$(document).on('click', '.save-btn', function(e) {
|
||
e.preventDefault();
|
||
const $btn = $(this);
|
||
const $editContainer = $btn.closest('.edit-container');
|
||
const $input = $editContainer.find('.edit-input-field');
|
||
|
||
const value = $input.val().trim();
|
||
const $link = $editContainer.siblings('.editable-field');
|
||
const LineItemNoteForAuditor = $link.data('notes');
|
||
const id = $link.data('id');
|
||
var theForm = $(".CreatePO");
|
||
$("#LineItemNoteForAuditor" + id).val(value); // to update the hidden fields
|
||
$link.text(value).show(); // to update table cell
|
||
$editContainer.hide();
|
||
});
|
||
|
||
// Handle click on the close (cancel) button
|
||
$(document).on('click', '.cancel-btn', function(e) {
|
||
e.preventDefault();
|
||
const $btn = $(this);
|
||
const $editContainer = $btn.closest('.edit-container');
|
||
const $link = $editContainer.siblings('.editable-field');
|
||
|
||
// Hide the edit container and show the <a> tag
|
||
$editContainer.hide();
|
||
$link.show();
|
||
});
|
||
});
|
||
</script>
|
||
<?php
|
||
$insuranceStatus = array(
|
||
array("name" => "NO", "value" => "0"),
|
||
array("name" => "YES", "value" => "1")
|
||
);
|
||
$DeliverOption = '';
|
||
$SupId = '';
|
||
$SupName = '';
|
||
$Address = '';
|
||
$PODate = '';
|
||
$DeliveryAddress = '';
|
||
$PONOStatus = '';
|
||
$PONO = '';
|
||
|
||
$TotalCgst = 0.0;
|
||
$TotalSgst = 0.0;
|
||
$TotalIgst = 0.0;
|
||
$TotalSummary = 0.0;
|
||
$TotalBasicAmount = 0.0;
|
||
$ServiceDescription = '';
|
||
$OtherAmt = 0.0;
|
||
|
||
$Deliverydt = '';
|
||
$DeliverSchedule = '';
|
||
$MaxPoDate = '';
|
||
$AvlAmount = 0;
|
||
$Value = "₹";
|
||
|
||
$StatusName = '';
|
||
$ModeOfShipment = '';
|
||
$SupplierReference = '';
|
||
$SuppliersOfferNo = '';
|
||
$OtherReferences = '';
|
||
$InsuranceOptions = '';
|
||
$InsuranceNumber = '';
|
||
$ServiceTypeOptions = '';
|
||
$DescriptionOfPo = '';
|
||
$BudgetType = '';
|
||
$PrePOFile = '';
|
||
$parentPO = '';
|
||
|
||
|
||
if (!empty($INRSYMBOL)) {
|
||
|
||
foreach ($INRSYMBOL as $INRS) {
|
||
$INRSYM = $INRS->FontCode2000;
|
||
}
|
||
}
|
||
|
||
if (!empty($MaxPODate)) {
|
||
foreach ($MaxPODate as $date) {
|
||
$MaxPoDate = $date->PODate;
|
||
}
|
||
}
|
||
|
||
if (!empty($POMaster)) {
|
||
|
||
foreach ($POMaster as $Req) {
|
||
$parentPO = $Req->ParentPO;
|
||
|
||
$SupId = $Req->SupplierID;
|
||
$SupName = $Req->SupplierName;
|
||
$Address = $Req->MSME ? "MSME : " . $Req->MSME . "\n" . $Req->Address : $Req->Address;
|
||
$pdt = new DateTime($Req->PODate);
|
||
$PODate = $pdt->format('d-m-Y');
|
||
$DeliverOption = $Req->DeliveryOption;
|
||
$DeliverSchedule = $Req->DeliverySchedule;
|
||
$Ddt = new DateTime($Req->DeliveryDate);
|
||
$Deliverydt = $Ddt->format('d-m-Y');
|
||
|
||
$DeliveryAddress = $Req->DeliveryAddress;
|
||
$PONOStatus = $Req->StatusCode;
|
||
$PONO = $Req->PONO;
|
||
$ServiceDescription = $Req->ServiceDescription;
|
||
$WrkStatus = $Req->ServiceWorkStatus;
|
||
$StatusName = $Req->StatusName;
|
||
$otherPayment = $Req->PaymentOtherDescription;
|
||
$ModeOfShipment = $Req->Mode_Of_Shipment;
|
||
$SupplierReference = $Req->Supplier_Reference;
|
||
$SuppliersOfferNo = $Req->Supplier_Offer_No;
|
||
$OtherReferences = $Req->Other_Reference;
|
||
$InsuranceOptions = $Req->InsuranceStatus;
|
||
$InsuranceNumber = $Req->InsuranceNumber;
|
||
$ServiceTypeOptions = $Req->POSubType;
|
||
$DescriptionOfPo = $Req->Description_Of_Service;
|
||
$BudgetType = $Req->BudgetType;
|
||
$PrePOFile = $Req->POFile;
|
||
|
||
$IsOpenOrder = isset($Req->IsOpenOrder) ? $Req->IsOpenOrder : null;
|
||
if ($IsOpenOrder !== null && (int)$IsOpenOrder !== 0) {
|
||
$isChecked = true;
|
||
} else {
|
||
$isChecked = false;
|
||
}
|
||
}
|
||
}
|
||
|
||
//echo $PONO;
|
||
|
||
if (!empty($RequistionDetails)) {
|
||
|
||
foreach ($RequistionDetails as $ReqDet) {
|
||
// $Reqon=$ReqDet->ReqDate;
|
||
$Reqonn = new DateTime($ReqDet->ReqDate);
|
||
$Reqon = $Reqonn->format('d-m-Y');
|
||
$Requestedby = $ReqDet->Requestedby;
|
||
$RequesterName = isset($ReqDet->FirstName) ? $ReqDet->FirstName : "";
|
||
//$Status=$ReqDet->Status;
|
||
}
|
||
}
|
||
|
||
//echo "$WrkStatus";
|
||
|
||
if (!empty($AvlBudAmt)) {
|
||
|
||
$AvlAmount = number_format($AvlBudAmt, 2, '.', '');
|
||
}
|
||
|
||
|
||
foreach ($PaymentTerms as $TER) {
|
||
$Terms = $TER->PaymentTerms;
|
||
}
|
||
|
||
if (!empty($getlogpodtl)) {
|
||
foreach ($getlogpodtl as $values) {
|
||
$update = $values->FirstName;
|
||
}
|
||
} else {
|
||
$update = [];
|
||
}
|
||
|
||
// foreach ($POSTATUS as $PST )
|
||
// {
|
||
// $POStatus=$PST->StatusName;
|
||
// }
|
||
?>
|
||
|
||
|
||
<script src="<?php echo base_url() ?>public/assets/tinymce/js/tinymce/tinymce.min.js"></script>
|
||
<script src="<?php echo base_url(); ?>public/assets/js/CreatePOValidation.js" type="text/javascript"></script>
|
||
<script>
|
||
$(document).ready(function() {
|
||
var PODate = '<?php echo $PODate; ?>';
|
||
});
|
||
|
||
$("#PODate").on("change", function() {
|
||
// var minDate = $(this).datepicker("getDate");
|
||
// var maxDate = new Date(minDate.getFullYear() + 1, minDate.getMonth(), minDate.getDate());
|
||
});
|
||
</script>
|
||
|
||
<script type="text/javascript">
|
||
tinymce.init({
|
||
selector: "textarea#ScopeOfWork",
|
||
|
||
menubar: false,
|
||
statusbar: false,
|
||
toolbar: false
|
||
});
|
||
tinymce.init({
|
||
selector: "textarea#txtSpcialInstruction", // Add model SpcialInstruction
|
||
menubar: false,
|
||
statusbar: false,
|
||
toolbar: false
|
||
});
|
||
tinymce.init({
|
||
selector: "textarea#EdittxtSpcialInstruction", // Edit model edit SpcialInstruction
|
||
menubar: false,
|
||
statusbar: false,
|
||
toolbar: false
|
||
});
|
||
tinymce.init({
|
||
selector: "textarea#editdescofpo", //main screen description PO
|
||
menubar: false,
|
||
statusbar: false,
|
||
toolbar: false
|
||
});
|
||
tinymce.init({
|
||
selector: "textarea#ViewtxtSpcialInstruction", //view Spcial Instruction
|
||
|
||
menubar: false,
|
||
statusbar: false,
|
||
toolbar: false
|
||
});
|
||
</script>
|
||
|
||
<script type="text/javascript">
|
||
$('#otherdescription').hide();
|
||
var insuranceOpt = '<?php echo $InsuranceOptions; ?>';
|
||
var DelOpt = '<?php echo $DeliverOption; ?>';
|
||
|
||
var SchName = '<?php echo $DeliverSchedule; ?>';
|
||
var DelDt = '<?php echo $Deliverydt; ?>';
|
||
|
||
var statuscheck = '<?php echo $PONOStatus; ?>';
|
||
|
||
|
||
$(document).ready(function() {
|
||
|
||
$(document).on('click', '.editable-field', function(e) {
|
||
e.preventDefault();
|
||
const $link = $(this);
|
||
const value = $link.text().trim();
|
||
|
||
// Hide the <a> tag and show the edit container
|
||
$link.hide();
|
||
const $editContainer = $link.siblings('.edit-container');
|
||
$editContainer.find('.edit-input-field').val(value);
|
||
$editContainer.show();
|
||
});
|
||
|
||
// Handle click on the tick (save) button
|
||
$(document).on('click', '.save-btn', function(e) {
|
||
e.preventDefault();
|
||
const $btn = $(this);
|
||
const $editContainer = $btn.closest('.edit-container');
|
||
const $input = $editContainer.find('.edit-input-field');
|
||
|
||
const value = $input.val().trim();
|
||
const $link = $editContainer.siblings('.editable-field');
|
||
const LineItemNoteForAuditor = $link.data('notes');
|
||
const id = $link.data('id');
|
||
var theForm = $(".CreatePO");
|
||
$("#LineItemNoteForAuditor" + id).val(value); // to update the hidden fields
|
||
$link.text(value).show(); // to update table cell
|
||
$editContainer.hide();
|
||
});
|
||
|
||
// Handle click on the close (cancel) button
|
||
$(document).on('click', '.cancel-btn', function(e) {
|
||
e.preventDefault();
|
||
const $btn = $(this);
|
||
const $editContainer = $btn.closest('.edit-container');
|
||
const $link = $editContainer.siblings('.editable-field');
|
||
|
||
// Hide the edit container and show the <a> tag
|
||
$editContainer.hide();
|
||
$link.show();
|
||
});
|
||
|
||
if (statuscheck == "<?php echo SPECIAL_PO; ?>") //|| statuscheck=="<?php echo PO_AWAITING_RELEASE; ?>" )
|
||
{
|
||
$('#splpodiv').show();
|
||
} else {
|
||
$('#splpodiv').hide();
|
||
}
|
||
|
||
|
||
/*****************************/
|
||
// var update = '<?php echo json_encode($update) ?>';
|
||
// if (update != 'null')
|
||
// {
|
||
// $('#editpodiv').show();
|
||
// } else {
|
||
// $('#editpodiv').hide();
|
||
// }
|
||
/*****************************/
|
||
|
||
|
||
|
||
|
||
|
||
$('#PoTypeOptions').attr("style", "pointer-events: none;");
|
||
if (insuranceOpt == "1") {
|
||
|
||
} else {
|
||
$('#insuranceTxtDiv').hide();
|
||
}
|
||
if (DelOpt == "0") {
|
||
$('#Deliverydtdiv').show();
|
||
$('#Schedulediv').hide();
|
||
$('#Deliverydt').val(DelDt);
|
||
} else if (DelOpt == "1") {
|
||
$('#Deliverydtdiv').hide();
|
||
$('#Schedulediv').show();
|
||
$('#Deliverydt').val('');
|
||
|
||
$('#Scheduleby').val(SchName);
|
||
}
|
||
var PaymentOther = '<?php echo $otherPayment; ?>';
|
||
var PayTerms = '<?php echo $Terms; ?>';
|
||
if (PayTerms == 'PT08') {
|
||
$('#otheroptiondiv').show();
|
||
$('#Otherpayment').val(PaymentOther);
|
||
} else {
|
||
$('#otheroptiondiv').hide();
|
||
$('#Otherpayment').val('');
|
||
}
|
||
});
|
||
</script>
|
||
|
||
<script>
|
||
var RequistQuantity = '';
|
||
var AvilBudAmt = '';
|
||
var POMaxDate = '<?php echo $MaxPoDate; ?>';
|
||
var d = new Date(POMaxDate);
|
||
var SelectedMaterialList = {
|
||
Mat: []
|
||
};
|
||
$(function() {
|
||
// $("#PODate").datepicker({
|
||
// //minDate : d,
|
||
// //maxDate : 'now',
|
||
// dateFormat: 'dd-mm-yy',
|
||
// changeMonth: true,
|
||
// changeYear: true
|
||
// }); //yearRange: '-100:+0'
|
||
// $("#Deliverydt").datepicker({
|
||
// minDate: 'now',
|
||
// dateFormat: 'dd-mm-yy',
|
||
// changeMonth: true,
|
||
// changeYear: true,
|
||
// yearRange: '0:+10'
|
||
// });
|
||
/* $("#Requeston").datepicker({
|
||
//minDate : d,
|
||
maxDate : 'now',
|
||
dateFormat: 'dd-mm-yy',changeMonth: true, changeYear: true,yearRange: '-100:+0'
|
||
}); */
|
||
$('#drpSupplier').change(function() {
|
||
|
||
var cd = $("#drpSupplier option:selected").text();
|
||
//alert(cd);
|
||
$("#changeSup").val(cd);
|
||
var PaymentOtherData = '<?php echo $otherPayment; ?>';
|
||
var id = $('#drpSupplier').val();
|
||
|
||
$("#SupAddress").val('');
|
||
|
||
if (id != '0') {
|
||
var y = <?php echo json_encode($Suplist, JSON_PRETTY_PRINT) ?>;
|
||
var Payment = <?php echo json_encode($Payment, JSON_PRETTY_PRINT) ?>;
|
||
var PaymentID = '';
|
||
$('#PaymentTerms').empty();
|
||
|
||
$.each(y, function(idx, obj) {
|
||
if (obj.SupplierID === id) {
|
||
if (obj.MSME) {
|
||
$("#SupAddress").val("MSME : " + obj.MSME + "\n" + obj.Address);
|
||
} else {
|
||
$("#SupAddress").val(obj.Address);
|
||
}
|
||
PaymentID = obj.PaymentID;
|
||
|
||
|
||
|
||
}
|
||
|
||
});
|
||
if (PaymentID != 'PT08') {
|
||
$('#otheroptiondiv').hide();
|
||
$('#Otherpayment').val('');
|
||
} else if (PaymentID == 'PT08') {
|
||
$('#otheroptiondiv').show();
|
||
$('#Otherpayment').val(PaymentOtherData);
|
||
|
||
|
||
}
|
||
$.each(Payment, function(pay, payobj) {
|
||
if (payobj.PaymentID == PaymentID) {
|
||
|
||
|
||
$("#PaymentTerms").append($('<option></option>').val(payobj.PaymentID).html(payobj.PaymentTerms));
|
||
|
||
}
|
||
|
||
|
||
});
|
||
$.each(Payment, function(pay, payobj) {
|
||
if (payobj.PaymentID == PaymentID) {
|
||
|
||
} else {
|
||
$("#PaymentTerms").append($('<option></option>').val(payobj.PaymentID).html(payobj.PaymentTerms));
|
||
|
||
}
|
||
|
||
});
|
||
|
||
} else {
|
||
alert('Please select the SupplierID');
|
||
return false;
|
||
}
|
||
|
||
});
|
||
|
||
$('#MaterialCode').change(function() {
|
||
var id = $('#MaterialCode').val();
|
||
RequistQuantity = '';
|
||
clearTaxField();
|
||
if (id != '0') {
|
||
var y = <?php echo json_encode($MaterialList, JSON_PRETTY_PRINT) ?>;
|
||
|
||
for (i = 0; i < y.length; i++) {
|
||
$.each(y[i], function(idx, obj) {
|
||
|
||
if (obj.MaterialCode == id) {
|
||
|
||
|
||
$("#ItemName").val(obj.MaterialName);
|
||
$("#UOM").val(obj.UOM);
|
||
$("#Quantity").val(obj.Quantity);
|
||
$("#Rate").val(obj.material_rate);
|
||
RequistQuantity = obj.Quantity;
|
||
|
||
var materialn = obj.MaterialName;
|
||
var materialname = materialn.toUpperCase();
|
||
|
||
if (materialname == 'SERVICE') {
|
||
$('#otherdescription').show();
|
||
$('#OtheritemDescription').val(obj.MaterialDescription);
|
||
}
|
||
|
||
if (obj.material_rate != 0) {
|
||
Ratechange();
|
||
}
|
||
|
||
|
||
}
|
||
});
|
||
}
|
||
var d = $('#drpSupplier').val();
|
||
$('#loader').show();
|
||
$.ajax({
|
||
url: "<?php echo base_url() ?>VerifyWithSupplierForPendingPO",
|
||
type: 'POST',
|
||
data: {
|
||
supplierid: d,
|
||
materialcode: id
|
||
},
|
||
success: function(response) {
|
||
$('#loader').hide();
|
||
|
||
if (response) alert(response);
|
||
}
|
||
});
|
||
|
||
} else {
|
||
alert('Please select the MaterialCode');
|
||
return false;
|
||
}
|
||
|
||
});
|
||
|
||
$('#EditMaterialCode').change(function() {
|
||
|
||
var id = $('#EditMaterialCode').val();
|
||
|
||
$("#EditItemName").val('');
|
||
$("#EditUOM").val('');
|
||
$("#EditQuantity").val('');
|
||
//$("#EditRate").val('');
|
||
//$("#txtEditBasicValue").val('');
|
||
RequistQuantity = '';
|
||
//clearEditTaxField();
|
||
if (id != '0') {
|
||
var Material = <?php echo json_encode($MaterialList, JSON_PRETTY_PRINT) ?>;
|
||
|
||
for (i = 0; i < Material.length; i++) {
|
||
$.each(Material[i], function(idx, obj) {
|
||
if (obj.MaterialCode === id) {
|
||
|
||
$("#EditItemName").val(obj.MaterialName);
|
||
$("#EditUOM").val(obj.UOM);
|
||
$("#EditQuantity").val(obj.Quantity);
|
||
RequistQuantity = obj.Quantity;
|
||
}
|
||
});
|
||
}
|
||
var d = $('#drpSupplier').val();
|
||
$('#loader').show();
|
||
$.ajax({
|
||
url: "<?php echo base_url() ?>VerifyWithSupplierForPendingPO",
|
||
type: 'POST',
|
||
data: {
|
||
supplierid: d,
|
||
materialcode: id
|
||
},
|
||
success: function(response) {
|
||
$('#loader').hide();
|
||
|
||
if (response) alert(response);
|
||
}
|
||
});
|
||
|
||
} else {
|
||
alert('Please select the MaterialCode');
|
||
return false;
|
||
}
|
||
|
||
});
|
||
|
||
});
|
||
|
||
function ChangeSgst() {
|
||
|
||
$('#Sgst').val($('#Cgst').val());
|
||
Ratechange();
|
||
}
|
||
|
||
function ChangeEditSgst() {
|
||
|
||
$('#EditSgst').val($('#EditCgst').val());
|
||
EditRatechange();
|
||
}
|
||
|
||
function Ratechange() {
|
||
|
||
if ($('#ReqNo').val() == "0") {
|
||
alert('Please select the Requisition Number');
|
||
$('#ReqNo').focus();
|
||
return false;
|
||
} else if ($('#MaterialCode').val() == "0") {
|
||
alert('Please select the Material Code');
|
||
$('#MaterialCode').focus();
|
||
return false;
|
||
} else if ($('#CostCenter').val() == "0") {
|
||
alert('Please select the CostCenterCode');
|
||
$('#CostCenter').focus();
|
||
return false;
|
||
}
|
||
ExceedQuantityCheck();
|
||
|
||
if ($('#Quantity').val() != '' && $('#Rate').val() != '') {
|
||
var txtQuantity = parseFloat($('#Quantity').val());
|
||
var txtUnitPrice = parseFloat($('#Rate').val());
|
||
var frequencyValue = parseFloat($('#FrequencyNo').val());
|
||
var Tot = txtQuantity * frequencyValue * txtUnitPrice;
|
||
$('#txtBasicValue').val(parseFloat(Tot).toFixed(2));
|
||
|
||
//Service Tax calculation
|
||
|
||
$('#AfterCgst').val(calculateCgstTax($('#txtBasicValue').val(), $("#Cgst").val() == '' ? "0.00" : $('#Cgst').val()));
|
||
$('#AfterSgst').val(calculateSgstTax($('#txtBasicValue').val(), $("#Sgst").val() == '' ? "0.00" : $('#Sgst').val()));
|
||
$('#AfterIgst').val(calculateIgstTax($('#txtBasicValue').val(), $("#Igst").val() == '' ? "0.00" : $('#Igst').val()));
|
||
|
||
|
||
calculateTotalOrdervalue();
|
||
|
||
var res = ExceedBudget($('#TotalOrderValue').val(), $('#AvlBudAmt').val());
|
||
if (!res) {
|
||
$('#Rate').focus();
|
||
return false;
|
||
}
|
||
}
|
||
|
||
}
|
||
|
||
function EditRatechange() {
|
||
|
||
if ($('#EditCostCenter').val() == "0") {
|
||
alert('Please select the CostCenterCode');
|
||
$('#EditCostCenter').focus();
|
||
return false;
|
||
}
|
||
EditExceedQuantityCheck();
|
||
|
||
if ($('#EditQuantity').val() != '' && $('#EditRate').val() != '') {
|
||
var txtQuantity = parseFloat($('#EditQuantity').val());
|
||
var txtUnitPrice = parseFloat($('#EditRate').val());
|
||
var frequencyValue = parseFloat($('#EditFrequencyNo').val());
|
||
|
||
var Tot = txtQuantity * frequencyValue * txtUnitPrice
|
||
$('#txtEditBasicValue').val(parseFloat(Tot).toFixed(2));
|
||
ExceedBudget(Tot, $('#EditAvlBudAmt').val());
|
||
|
||
|
||
$('#EditAfterCgst').val(calculateCgstTax($('#txtEditBasicValue').val(), $("#EditCgst").val() == '' ? "0.00" : $('#EditCgst').val()));
|
||
$('#EditAfterSgst').val(calculateSgstTax($('#txtEditBasicValue').val(), $("#EditSgst").val() == '' ? "0.00" : $('#EditSgst').val()));
|
||
$('#EditAfterIgst').val(calculateIgstTax($('#txtEditBasicValue').val(), $("#EditIgst").val() == '' ? "0.00" : $('#EditIgst').val()));
|
||
calculateTotalEditOrdervalue();
|
||
}
|
||
|
||
}
|
||
|
||
function ExceedQuantityCheck() {
|
||
var EnterQuantity = $("#Quantity").val() == '' ? "0.00" : parseFloat($("#Quantity").val());
|
||
var ReqQuantity = parseFloat(RequistQuantity);
|
||
//if(EnterQuantity > ReqQuantity)
|
||
// {
|
||
// alert('Your exceeding the Quantity from the Requisition Quantity:'+ RequistQuantity +'.Please adjust the Quantity to proceed further.');
|
||
|
||
// $('#Quantity').focus();
|
||
// return false;
|
||
// }
|
||
// else
|
||
//{
|
||
return true;
|
||
//}
|
||
}
|
||
|
||
function EditExceedQuantityCheck() {
|
||
// RequistQuantity
|
||
var EnterQuantity = $("#EditQuantity").val() == '' ? "0.00" : parseFloat($("#EditQuantity").val());
|
||
var ReqQuantity = parseFloat(RequistQuantity);
|
||
//alert(ReqQuantity);
|
||
//if(EnterQuantity != ReqQuantity)
|
||
//{
|
||
// alert('Your exceeding the Quantity from the Requisition Quantity:'+ RequistQuantity +'.Please adjust the Quantity to proceed further.');
|
||
|
||
// $('#EditQuantity').focus();
|
||
return true;
|
||
//}
|
||
}
|
||
|
||
function ExceedBudget(ValuetoCheck, budgetAmount) {
|
||
var ReqAmount = parseFloat(ValuetoCheck);
|
||
var BudAmount = parseFloat(budgetAmount);
|
||
|
||
// if(ReqAmount > BudAmount )
|
||
// {
|
||
// alert('Your exceeding the Avaiable Budget :'+ AvilBudAmt +'.Please adjust the Product to proceed further.');
|
||
// return false;
|
||
// }
|
||
// else
|
||
// {
|
||
return true;
|
||
//}
|
||
}
|
||
|
||
function calculateServiceTax(varBasicValue) {
|
||
|
||
var basicValue = parseFloat(varBasicValue);
|
||
|
||
var ServiceTaxValue = 0.0;
|
||
|
||
ServiceTaxValue = <?php echo SERVICETAX_SERVICETAX_14PERCENT; ?>;
|
||
|
||
var TAXval = parseFloat(ServiceTaxValue).toFixed(2);
|
||
|
||
return TAXval; // $('#AfterServiceTax').val(TAXval);
|
||
|
||
}
|
||
|
||
function calculateEduess(varAfterServiceTax) {
|
||
var ServiceTaxAmount = parseFloat(varAfterServiceTax);
|
||
|
||
var ServiceTaxValue = 0.0;
|
||
|
||
ServiceTaxValue = <?php echo SERVICETAX_EDUCESS_2PERCENT; ?>;
|
||
|
||
var TAXval = parseFloat(ServiceTaxValue).toFixed(2);
|
||
|
||
return TAXval; // $('#AfterEduCess').val(TAXval);
|
||
}
|
||
|
||
function calculateHigherEdu(varAfterServiceTax) {
|
||
var ServiceTaxAmount = parseFloat(varAfterServiceTax);
|
||
|
||
var ServiceTaxValue = 0.0;
|
||
|
||
ServiceTaxValue = <?php echo SERVICETAX_HIGHEREDUCESS_1PERCENT; ?>;
|
||
|
||
var TAXval = parseFloat(ServiceTaxValue).toFixed(2);
|
||
|
||
return TAXval; //$('#AfterSecHighTax').val(TAXval);
|
||
}
|
||
|
||
function calculateKrishiKalyantax(varBasicValue) {
|
||
var basicValue = parseFloat(varBasicValue);
|
||
|
||
var ServiceTaxValue = 0.0;
|
||
|
||
ServiceTaxValue = <?php echo SERVICETAX_KRISHIKALYAN; ?>;
|
||
|
||
var TAXval = parseFloat(ServiceTaxValue).toFixed(2);
|
||
|
||
return TAXval; //$('#AfterKrishiTax').val(TAXval);
|
||
}
|
||
|
||
function calculateSwachhBharattax(varBasicValue) {
|
||
var basicValue = parseFloat(varBasicValue);
|
||
|
||
var ServiceTaxValue = 0.0;
|
||
|
||
ServiceTaxValue = <?php echo SERVICETAX_SWACHHBHARAT; ?>;
|
||
|
||
var TAXval = parseFloat(ServiceTaxValue).toFixed(2);
|
||
|
||
return TAXval; //$('#AfterSwachhTax').val(TAXval);
|
||
}
|
||
|
||
function calculateTotalOrdervalue() {
|
||
var basicValue = parseFloat($('#txtBasicValue').val());
|
||
var Cgst = parseFloat($('#AfterCgst').val());
|
||
var Sgst = parseFloat($('#AfterSgst').val());
|
||
var Igst = parseFloat($('#AfterIgst').val());
|
||
var OtherAmt = parseFloat($("#OtherAllowances").val() == '' ? "0.00" : $('#OtherAllowances').val());
|
||
|
||
var TotAmt = basicValue + Cgst + Sgst + Igst + OtherAmt;
|
||
|
||
$('#TotalOrderValue').val(parseFloat(TotAmt).toFixed(2));
|
||
|
||
}
|
||
|
||
function calculateTotalEditOrdervalue() {
|
||
var basicValue = parseFloat($('#txtEditBasicValue').val());
|
||
var Cgst = parseFloat($('#EditAfterCgst').val());
|
||
var Sgst = parseFloat($('#EditAfterSgst').val());
|
||
var Igst = parseFloat($('#EditAfterIgst').val());
|
||
var OtherAmt = parseFloat($("#EditOtherAllowances").val() == '' ? "0.00" : $('#EditOtherAllowances').val());
|
||
|
||
var TotAmt = basicValue + Cgst + Sgst + Igst + OtherAmt;
|
||
|
||
$('#EditTotalOrderValue').val(parseFloat(TotAmt).toFixed(2));
|
||
|
||
|
||
}
|
||
|
||
function calculateTaxValue() {
|
||
var Cgst = parseFloat($('#AfterCgst').val());
|
||
var Sgst = parseFloat($('#AfterSgst').val());
|
||
var Igst = parseFloat($('#AfterIgst').val());
|
||
|
||
var TottaxAmt = Cgst + Sgst + Igst;
|
||
return parseFloat(TottaxAmt).toFixed(2);
|
||
}
|
||
|
||
function clearTaxField() {
|
||
$('#txtBasicValue').val('');
|
||
$('#AfterCgst').val(0);
|
||
$('#AfterSgst').val(0);
|
||
$('#AfterIgst').val(0);
|
||
$('#Cgst').val(0);
|
||
$('#Sgst').val(0);
|
||
$('#Igst').val(0);
|
||
$('#TotalOrderValue ').val('');
|
||
$('#Rate').val(0);
|
||
|
||
$("#ItemName").val('');
|
||
$("#UOM").val('');
|
||
$("#Quantity").val('');
|
||
RequistQuantity = '';
|
||
|
||
}
|
||
|
||
function clearEditTaxField() {
|
||
$('#txtEditBasicValue').val('');
|
||
$('#EditAfterEduCess').val('');
|
||
$('#EditAfterSecHighTax').val('');
|
||
$('#EditAfterServiceTax').val('');
|
||
$('#EditAfterKrishiTax').val('');
|
||
$('#EditAfterSwachhTax').val('');
|
||
$('#EditTotalOrderValue ').val('');
|
||
$('#EditRate').val('');
|
||
|
||
$("#EditItemName").val('');
|
||
$("#EditUOM").val('');
|
||
$("#EditQuantity").val('');
|
||
RequistQuantity = '';
|
||
|
||
}
|
||
|
||
$(document).ready(function() {
|
||
$("#PaymentTerms").select2();
|
||
|
||
$('#Date').click(function() {
|
||
//for Date range selection
|
||
$('#Schedulediv').hide();
|
||
$('#Deliverydtdiv').show();
|
||
});
|
||
$('#Schedule').click(function() {
|
||
//for schedule range selection
|
||
$('#Deliverydtdiv').hide();
|
||
$('#Schedulediv').show();
|
||
});
|
||
});
|
||
</script>
|
||
|
||
<style>
|
||
.num {
|
||
text-align: right;
|
||
}
|
||
|
||
.header-container {
|
||
display: flex;
|
||
justify-content: space-between;
|
||
align-items: center;
|
||
padding: 25px;
|
||
}
|
||
|
||
.header-container h2 {
|
||
flex: 1;
|
||
text-align: center;
|
||
margin: 0;
|
||
}
|
||
|
||
.centered {
|
||
display: flex;
|
||
/* justify-content: center; */
|
||
align-items: center;
|
||
height: 10vh;
|
||
}
|
||
|
||
.centered label,
|
||
.centered input {
|
||
margin: 0 5px;
|
||
}
|
||
</style>
|
||
|
||
<div class="content-page">
|
||
<div class="content">
|
||
<!-- Start Content-->
|
||
<div class="container-fluid">
|
||
<!-- start page title -->
|
||
<div class="row">
|
||
<div class="col-12">
|
||
<div class="page-title-box page-title-box-alt">
|
||
<?php
|
||
if ($PONOStatus != 'ST030') {
|
||
$title = ($parentPO == '') ? "Edit Service Purchase Order - $PONO" : "Amended Service Purchase Order - $PONO";
|
||
} else {
|
||
$title = "View Amended Service Purchase Order - $PONO";
|
||
}
|
||
?>
|
||
<h4><?= $title; ?></h4>
|
||
<a href="<?php echo base_url() ?>purchaseorderListing" class="btn btn-secondary" id="back" value="Back">Back</a>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<!-- end page title -->
|
||
|
||
<!-- Form row -->
|
||
<div class="row">
|
||
<div class="col-12">
|
||
<div class="card">
|
||
<div class="card-body p-4">
|
||
<?php
|
||
$attributes = array('class' => 'form-label-left ServicePO ', 'name' => 'ServicePO', 'id' => 'ServicePO', 'enctype' => 'multipart/form-data');
|
||
echo form_open(base_url() . '/purchaseorder/addPO/', $attributes); ?>
|
||
|
||
<div class="form-row">
|
||
<div class="form-group col-md-3">
|
||
<label>Requistion No</label>
|
||
<?php
|
||
$options = array("0" => 'Selected Requisition Numbers');
|
||
if (!empty($ReqList)) {
|
||
foreach ($ReqList as $SID) :
|
||
|
||
$options[$SID->ReqNo] = $SID->ReqNo;
|
||
endforeach;
|
||
}
|
||
echo form_multiselect('RequistionNo', $options, set_value('RequistionNo', array()), 'id="RequistionNo"', 'required="true"');
|
||
|
||
?>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Purchase Order Type</label>
|
||
<div>
|
||
|
||
<?php
|
||
$data = array('name' => 'POType', 'value' => set_value('POType', SERVICE), 'id' => 'POType', 'class' => 'form-control', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Select Supplier<span class="text-danger">*</span></label>
|
||
<?php
|
||
$options = array("0" => 'Select Supplier');
|
||
//print_r( $options);
|
||
|
||
if (!empty($Suplist)) {
|
||
foreach ($Suplist as $SID) :
|
||
$options[$SID->SupplierID] = $SID->SupplierID . ' - ' . $SID->SupplierName;
|
||
endforeach;
|
||
}
|
||
|
||
echo form_dropdown('drpSupplier', $options, set_value('drpSupplier', $SupId), 'id="drpSupplier" required="true" class="form-control select2"');
|
||
|
||
?> <input type="hidden" name="b4supplier" id="b4supplier" value="<?php echo $SupId; ?>">
|
||
|
||
<input type="hidden" name="newsup" id="changeSup">
|
||
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Supplier Address</label>
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'SupAddress', 'value' => set_value('SupAddress', $Address), 'id' => 'SupAddress', 'class' => 'form-control', 'readonly' => 'true', 'rows' => '3', 'cols' => '40');
|
||
echo Form_textarea($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="form-row">
|
||
<div class="form-group col-md-3">
|
||
<label>Work Status<span class="text-danger">*</span></label>
|
||
<?php
|
||
|
||
|
||
|
||
if (!empty($WorkStatus)) {
|
||
|
||
foreach ($WorkStatus as $WorkSID) :
|
||
if ($WrkStatus == $WorkSID->StatusCode) {
|
||
$optionsWork[$WorkSID->StatusCode] = $WorkSID->StatusName;
|
||
}
|
||
|
||
|
||
endforeach;
|
||
foreach ($WorkStatus as $SID) :
|
||
if ($WrkStatus != $SID->StatusCode) {
|
||
$optionsWork[$SID->StatusCode] = $SID->StatusName;
|
||
}
|
||
|
||
|
||
endforeach;
|
||
}
|
||
|
||
echo form_dropdown('workstatus', $optionsWork, set_value('workstatus'), 'id="workstatus" required="true" class="form-control select2"');
|
||
|
||
?>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<b><u>Select Delivery By<span class="text-danger">*</span></u></b><br />
|
||
<div class="centered">
|
||
<?php echo form_label('Date', 'Date') . " " . form_radio(array('name' => 'DateRange', 'value' => '0', 'checked' => ('0' == $DeliverOption) ? TRUE : FALSE, 'id' => 'Date')); ?>
|
||
<?php echo form_label('Schedule', 'Schedule') . " " . form_radio(array('name' => 'DateRange', 'value' => '1', 'checked' => ('1' == $DeliverOption) ? TRUE : FALSE, 'id' => 'Schedule')); ?>
|
||
</div>
|
||
|
||
</div>
|
||
<div class="form-group col-md-3" id="Deliverydtdiv">
|
||
<label>Delivery Date<span class="text-danger">*</span></label>
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'Deliverydt', 'value' => set_value('Deliverydt', $Deliverydt), 'id' => 'Deliverydt', 'class' => 'form-control num', 'required' => 'true', 'onkeypress' => 'return false;');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3" id="Schedulediv" style="display:none;">
|
||
<label>Schedule By<span class="text-danger">*</span></label>
|
||
<?php
|
||
$data = array('name' => 'Scheduleby', 'value' => set_value('Scheduleby'), 'id' => 'Scheduleby', 'class' => 'form-control', 'required' => 'true', 'rows' => '3', 'cols' => '40', 'maxlength' => '110');
|
||
echo Form_textarea($data);
|
||
?>
|
||
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Delivery Address</label>
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'DeliveryAddr', 'value' => set_value('DeliveryAddr', $DeliveryAddress), 'id' => 'DeliveryAddr', 'class' => 'form-control', 'required' => 'true', 'rows' => '3', 'cols' => '40');
|
||
echo Form_textarea($data);
|
||
?><input type="hidden" name="txtDeliveryAddress" id="txtDeliveryAddress" value="<?php echo $DeliveryAddress; ?>">
|
||
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="form-row">
|
||
<div class="form-group col-md-3">
|
||
<label>Purchase Order Date</label>
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'PODate', 'value' => set_value('PODate', $PODate), 'id' => 'PODate', 'class' => 'form-control num', 'required' => 'true', 'onkeypress' => 'return false;');
|
||
echo form_input($data);
|
||
?> <input type="hidden" name="b4podate" id="b4podate" value="<?php echo $PODate; ?>">
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Mode Of Shipment</label>
|
||
<div>
|
||
|
||
<?php
|
||
$data = array('name' => 'editmodeofshipment', 'value' => set_value('editmodeofshipment', $ModeOfShipment), 'id' => 'editmodeofshipment', 'class' => 'form-control');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Contact Reference</label>
|
||
<div>
|
||
|
||
<?php
|
||
$data = array('name' => 'editsupplierreference', 'value' => set_value('editsupplierreference', $SupplierReference), 'id' => 'editsupplierreference', 'class' => 'form-control', 'maxlength' => '40');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Supplier's Offer No</label>
|
||
<div>
|
||
|
||
<?php
|
||
$data = array('name' => 'editsupplierofferno', 'value' => set_value('editsupplierofferno', $SuppliersOfferNo), 'id' => 'editsupplierofferno', 'class' => 'form-control');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
|
||
</div>
|
||
</div>
|
||
<div class="form-row">
|
||
<div class="form-group col-md-3">
|
||
<div style="padding:0px;">
|
||
|
||
<label>Our Reference(S)</label>
|
||
<div>
|
||
|
||
<?php
|
||
$data = array('name' => 'editotherreference', 'value' => set_value('editotherreference', $OtherReferences), 'id' => 'editotherreference', 'class' => 'form-control');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
|
||
|
||
<label>Service Type Options<span class="text-danger">*</span></label>
|
||
<div>
|
||
|
||
<?php
|
||
|
||
//$optionsWork = array("0"=>'Select Work Status');
|
||
|
||
|
||
if (!empty($PoTypeOptions)) {
|
||
foreach ($PoTypeOptions as $POpt) :
|
||
|
||
if ($ServiceTypeOptions == $POpt->ConfigValue) {
|
||
$optionsPO[$POpt->ConfigValue] = $POpt->ConfigValue;
|
||
}
|
||
endforeach;
|
||
foreach ($PoTypeOptions as $POpt1) :
|
||
|
||
if ($ServiceTypeOptions != $POpt1->ConfigValue) {
|
||
$optionsPO[$POpt1->ConfigValue] = $POpt1->ConfigValue;
|
||
}
|
||
endforeach;
|
||
}
|
||
|
||
echo form_dropdown('PoTypeOptions', $optionsPO, set_value('PoTypeOptions'), 'id="PoTypeOptions" required="true" class="form-control select2"');
|
||
|
||
|
||
?>
|
||
</div>
|
||
|
||
|
||
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Payment Terms<span class="text-danger">*</span></label>
|
||
<?php
|
||
if (!empty($Payment)) {
|
||
foreach ($Payment as $pay2) :
|
||
if ($Terms == $pay2->PaymentID) {
|
||
$optionsPay[$pay2->PaymentID] = $pay2->PaymentTerms;
|
||
}
|
||
endforeach;
|
||
foreach ($Payment as $pay1) :
|
||
if ($Terms != $pay1->PaymentID) {
|
||
$optionsPay[$pay1->PaymentID] = $pay1->PaymentTerms;
|
||
}
|
||
endforeach;
|
||
}
|
||
echo form_dropdown('PaymentTerms', $optionsPay, set_value('PaymentTerms'), 'id="PaymentTerms" required="true" class="form-control select2"');
|
||
?>
|
||
</div>
|
||
<div class="form-group col-md-3" id="otheroptiondiv" style="display:none;">
|
||
<label>Description of Payable Terms<span class="text-danger">*</span></label>
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'Otherpayment', 'Otherpayment' => set_value('Otherpayment'), 'id' => 'Otherpayment', 'class' => 'form-control', 'required' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="form-row">
|
||
<div class="form-group col-md-3">
|
||
<label>Insurance Options<span class="text-danger">*</span></label>
|
||
<div>
|
||
|
||
<?php
|
||
|
||
if (!empty($insuranceStatus)) {
|
||
foreach ($insuranceStatus as $INS) :
|
||
if ($InsuranceOptions == $INS['value']) {
|
||
$optionsInsurance[$INS['value']] = $INS['name'];
|
||
}
|
||
|
||
|
||
|
||
endforeach;
|
||
foreach ($insuranceStatus as $INS1) :
|
||
if ($InsuranceOptions != $INS1['value']) {
|
||
$optionsInsurance[$INS1['value']] = $INS1['name'];
|
||
}
|
||
|
||
|
||
|
||
endforeach;
|
||
}
|
||
|
||
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>
|
||
<?php
|
||
$data = array('name' => 'InsuranceNumber', 'value' => set_value('InsuranceNumber', $InsuranceNumber), 'id' => 'InsuranceNumber', 'class' => 'form-control', 'required' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label for="BudgetType">Budget Type<span class="text-danger">*</span></label>
|
||
<select id='BudgetType' name='BudgetType' class="form-control" required='true'>
|
||
<?php if ($BudgetType == 'CAPITAL') {
|
||
$opt1 = 'CAPITAL';
|
||
$opt2 = 'REVENUE';
|
||
} else {
|
||
$opt1 = 'REVENUE';
|
||
$opt2 = 'CAPITAL';
|
||
} ?>
|
||
<option value=<?php echo $opt1; ?>><?php echo $opt1; ?></option>
|
||
<option value=<?php echo $opt2; ?>><?php echo $opt2; ?></option>
|
||
</select>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-row">
|
||
<div class="form-group col-md-12 text-right">
|
||
<?php if ($PONOStatus == PO_DRAFT || $PONOStatus == PO_CREATED || $PONOStatus == PO_APPROVED || $PONOStatus == REQITEM_Emergency_PO_CREATED) { ?>
|
||
<?php if ($PONOStatus == REQITEM_Emergency_PO_CREATED) { ?>
|
||
<input type="checkbox" id="IsOpenOrder" name="IsOpenOrder" value="1" <?php echo $isChecked ? 'checked' : ''; ?>> IS THIS OPEN ORDER FORMAT
|
||
<?php } ?>
|
||
<a data-toggle="modal"><button type="submit" onclick="myFunction();" class="btn btn-success" id="abcd">Select Line Item</button> </a>
|
||
<?php } ?>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
<div class="form-row">
|
||
<div class="table-responsive" style="padding-bottom: 30px;">
|
||
<table id="ServiceTable" class="table table-bordered table-hover mb-0"
|
||
style="font-size:12px;">
|
||
<thead>
|
||
<tr>
|
||
|
||
<th style="text-align:left !important; white-space: nowrap !important;">SNo</th>
|
||
<th style="text-align:center !important; white-space: nowrap !important;">Requisition No</th>
|
||
<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: 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>
|
||
<th style="text-align: right; white-space: nowrap !important;">Total Order Amount <?php echo "($INRSYM)" ?></th>
|
||
<th>Action</th>
|
||
</tr>
|
||
</thead>
|
||
|
||
<tbody id='ServiceAppend'>
|
||
<?php
|
||
if (!empty($POItem)) {
|
||
|
||
|
||
$index = 0;
|
||
|
||
foreach ($POItem as $record) {
|
||
$index = $index + 1;
|
||
if ($record->Schedule_Type != 'Recurring') {
|
||
$FrequencyNo = intval(1);
|
||
$Frequency = 'One Time';
|
||
} else {
|
||
$FrequencyNo = $record->NumberOfService;
|
||
$Frequency = $record->Service_Period;
|
||
}
|
||
|
||
?>
|
||
<tr id="<?php echo $index; ?>">
|
||
<td style="text-align:left !important;"><?php echo $index; ?></td>
|
||
<td style="text-align:center !important;"><?php echo $record->ReqNo ?></td>
|
||
<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) { ?>
|
||
<a href="#"
|
||
class="editable-field"
|
||
data-id="<?php echo $index ?>" data-notes="<?php echo $record->LineitemAuditorNotes; ?>">
|
||
<?php echo !empty($record->LineitemAuditorNotes) ? $record->LineitemAuditorNotes : "-"; ?>
|
||
</a>
|
||
<div class="edit-container" style="display:none;">
|
||
<input type="text" class="edit-input-field" />
|
||
<button class="save-btn">✔</button>
|
||
<button class="cancel-btn">✖</button>
|
||
</div>
|
||
<?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>
|
||
|
||
<td style="text-align:right !important;"><?php echo $record->Rate ?></td>
|
||
|
||
<td style="text-align:right !important;"><?php echo number_format($record->BasicValue * $FrequencyNo, 2, '.', ''); ?></td>
|
||
|
||
<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> -->
|
||
|
||
<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 'AvilBudget' . $index ?>" id="<?php echo 'AvilBudget' . $index ?>" value="<?php echo $AvlAmount; ?>" />
|
||
|
||
<input type="hidden" name="<?php echo 'LineItemNo' . $index ?>" id="<?php echo 'LineItemNo' . $index ?>" value="<?php echo $record->LineItemNo; ?>" />
|
||
|
||
<input type="hidden" name="<?php echo 'costCode' . $index ?>" id="<?php echo 'costCode' . $index ?>" value="<?php echo $record->CostCenterCode; ?>" />
|
||
|
||
<input type="hidden" name="<?php echo 'materialCode' . $index ?>" id="<?php echo 'materialCode' . $index ?>" value="<?php echo $record->MaterialCode; ?>" />
|
||
|
||
<input type="hidden" name="<?php echo 'materialName' . $index ?>" id="<?php echo 'materialName' . $index ?>" value="<?php echo $record->MaterialName; ?>" />
|
||
|
||
<input type="hidden" name="<?php echo 'uom' . $index ?>" id="<?php echo 'uom' . $index ?>" value="<?php echo $record->UOM; ?>" />
|
||
|
||
<input type="hidden" name="<?php echo 'per' . $index ?>" id="<?php echo 'per' . $index ?>" value="<?php echo $record->Per; ?>" />
|
||
|
||
<input type="hidden" name="<?php echo 'quantity' . $index ?>" id="<?php echo 'quantity' . $index ?>" value="<?php echo $record->Quantity; ?>" />
|
||
<input align="right" type="hidden" name="<?php echo 'b4qty' . $index ?>" id="<?php echo 'b4qty' . $index ?>" value="<?php echo $record->Quantity; ?>" />
|
||
|
||
|
||
<input type="hidden" name="<?php echo 'itemRate' . $index ?>" id="<?php echo 'itemRate' . $index ?>" value="<?php echo $record->Rate; ?>" />
|
||
<input align="right" type="hidden" name="<?php echo 'b4rate' . $index ?>" id="<?php echo 'b4rate' . $index ?>" value="<?php echo $record->Rate; ?>" />
|
||
|
||
<input type="hidden" name="<?php echo 'Cgst' . $index ?>" id="<?php echo 'Cgst' . $index ?>" value="<?php echo $record->CGST; ?>" />
|
||
|
||
<input type="hidden" name="<?php echo 'AfterCgst' . $index ?>" id="<?php echo 'AfterCgst' . $index ?>" value="<?php echo $record->After_CGST; ?>" />
|
||
|
||
<input type="hidden" name="<?php echo 'Sgst' . $index ?>" id="<?php echo 'Sgst' . $index ?>" value="<?php echo $record->SGST; ?>" />
|
||
|
||
<input type="hidden" name="<?php echo 'AfterSgst' . $index ?>" id="<?php echo 'AfterSgst' . $index ?>" value="<?php echo $record->After_SGST; ?>" />
|
||
|
||
<input type="hidden" name="<?php echo 'Igst' . $index ?>" id="<?php echo 'Igst' . $index ?>" value="<?php echo $record->IGST; ?>" />
|
||
|
||
<input type="hidden" name="<?php echo 'AfterIgst' . $index ?>" id="<?php echo 'AfterIgst' . $index ?>" value="<?php echo $record->After_IGST; ?>" />
|
||
|
||
<input type="hidden" name="<?php echo 'TotalOrderValue' . $index ?>" id="<?php echo 'TotalOrderValue' . $index ?>" value="<?php echo $record->TotalValue; ?>" />
|
||
|
||
<input type="hidden" name="<?php echo 'Frequency' . $index ?>" id="<?php echo 'Frequency' . $index ?>" value="<?php echo $Frequency; ?>" />
|
||
|
||
<input type="hidden" name="<?php echo 'FrequencyNo' . $index ?>" id="<?php echo 'FrequencyNo' . $index ?>" value="<?php echo $FrequencyNo; ?>" />
|
||
|
||
<input type="hidden" name="<?php echo 'FrequencyValue' . $index ?>" id="<?php echo 'FrequencyValue' . $index ?>" value="<?php echo $FrequencyNo; ?>" />
|
||
|
||
<input type="hidden" name="<?php echo 'ItemDescription' . $index ?>" id="<?php echo 'ItemDescription' . $index ?>" value="<?php echo $record->ServiceMaterialDescription; ?>" />
|
||
|
||
<input type="hidden" name="<?php echo 'OtherAmt' . $index ?>" id="<?php echo 'OtherAmt' . $index ?>" value="<?php echo $record->otherallowance; ?>" />
|
||
|
||
<input type="hidden" name="<?php echo 'OtherServiceDescription' . $index ?>" id="<?php echo 'OtherServiceDescription' . $index ?>" value="<?php echo $record->MaterialDescription; ?>" />
|
||
<input type="hidden" name="<?php echo 'LineItemNoteForAuditor' . $index ?>" id="<?php echo 'LineItemNoteForAuditor' . $index ?>" value="<?php echo $record->LineitemAuditorNotes; ?>" />
|
||
|
||
|
||
<?php
|
||
|
||
if ($PONOStatus == PO_DRAFT || $PONOStatus == PO_CREATED || $PONOStatus == REQITEM_Emergency_PO_CREATED || $PONOStatus == PO_APPROVED || $PONOStatus == SPECIAL_PO) { ?>
|
||
<td> <a data-target='#EDITSERVICE' data-id="<?php echo $index; ?>" data-userid="<?php echo $index; ?>" data-toggle="modal" href="#EDITSERVICE"><i class="ri-pencil-fill" title="Click here to view/Edit the . <?php echo $record->ReqNo; ?> .Requisition details"></i></a>
|
||
<a href='#' onclick="DeleteRow(<?php echo $index; ?>)" class="link" data-id="<?php echo $index; ?>" data-userid="<?php echo $index; ?>" id="Del"><span class="ri-delete-bin-7-fill"></span></a>
|
||
<?php
|
||
} else { ?>
|
||
<td> <a data-target='#VIEWSERVICE' data-id="<?php echo $index; ?>" data-userid="<?php echo $index; ?>" data-toggle="modal" href="#VIEWSERVICE"><i class="fa fa-eye" title="<?php echo $record->ReqNo; ?> - Click here to view Requistion details"></i> </a> </td>
|
||
<?php
|
||
} ?>
|
||
</tr>
|
||
<?php
|
||
$TotalCgst = $TotalCgst + $record->After_CGST;
|
||
$TotalSgst = $TotalSgst + $record->After_SGST;
|
||
$TotalIgst = $TotalIgst + $record->After_IGST;
|
||
$OtherAmt = $OtherAmt + $record->otherallowance;
|
||
$TotalSummary = $TotalSummary + $record->TotalValue;
|
||
|
||
|
||
$TotalBasicAmount = $TotalBasicAmount + $record->BasicValue * $FrequencyNo;
|
||
}
|
||
?>
|
||
<?php
|
||
|
||
}
|
||
?>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</div>
|
||
|
||
<br>
|
||
|
||
<div class="form-row">
|
||
<div class="form-group col-md-2">
|
||
<label>Basic Amount <?php echo "($INRSYM)" ?> </label>
|
||
<?php
|
||
$data = array('name' => 'txtTotBasicAmount', 'value' => set_value('txtTotBasicAmount', number_format($TotalBasicAmount, 2, '.', '')), 'id' => 'txtTotBasicAmount', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
<div class="form-group col-md-2">
|
||
<label>CGST <?php echo "($INRSYM)" ?></label>
|
||
<?php
|
||
$data = array('name' => 'txtTotCgst', 'value' => set_value('txtTotCgst', number_format($TotalCgst, 2, '.', '')), 'id' => 'txtTotCgst', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
<div class="form-group col-md-2">
|
||
<label>SGST <?php echo "($INRSYM)" ?></label>
|
||
<?php
|
||
$data = array('name' => 'txtTotSgst', 'value' => set_value('txtTotSgst', number_format($TotalSgst, 2, '.', '')), 'id' => 'txtTotSgst', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
<div class="form-group col-md-2">
|
||
<label>IGST <?php echo "($INRSYM)" ?></label>
|
||
<?php
|
||
$data = array('name' => 'txtTotIgst', 'value' => set_value('txtTotIgst', number_format($TotalIgst, 2, '.', '')), 'id' => 'txtTotIgst', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
<div class="form-group col-md-2">
|
||
<label>Other Allowances <?php echo "($INRSYM)" ?> </label>
|
||
<?php
|
||
$data = array('name' => 'ToatalOtherAllowances', 'value' => set_value('ToatalOtherAllowances', number_format($OtherAmt, 2, '.', '')), 'id' => 'ToatalOtherAllowances', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
|
||
</div>
|
||
<div class="form-group col-md-2">
|
||
<label>Total Order Value <?php echo "($INRSYM)" ?> </label>
|
||
<?php
|
||
$data = array('name' => 'txtTotalOrderValueSummary', 'value' => set_value('txtTotalOrderValueSummary', number_format($TotalSummary, 2, '.', '')), 'id' => 'txtTotalOrderValueSummary', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
|
||
<br>
|
||
|
||
|
||
<div class="form-row">
|
||
<!--start new fields 1 sep-->
|
||
<div class="form-group col-md-12">
|
||
<label>Description Of Service <span class="text-danger">*</label>
|
||
|
||
<?php
|
||
$DescriptionOfPo = html_entity_decode($DescriptionOfPo);
|
||
$DescriptionOfPo = strip_tags($DescriptionOfPo);
|
||
$data = array('name' => 'editdescofpo', 'value' => set_value('editdescofpo', $DescriptionOfPo), 'id' => 'editdescofpo', 'class' => 'form-control', 'rows' => '3', 'cols' => '40');
|
||
echo form_textarea($data);
|
||
?>
|
||
|
||
</div><!--end new fields 1 sep-->
|
||
</div>
|
||
|
||
<br>
|
||
|
||
|
||
<div class="form-row">
|
||
<div class="form-group col-md-12">
|
||
<label>Scope Of Work</label>
|
||
<?php
|
||
$ServiceDescription = html_entity_decode($ServiceDescription);
|
||
$ServiceDescription = strip_tags($ServiceDescription);
|
||
$data = array('name' => 'ScopeofWork', 'value' => set_value('ScopeofWork', $ServiceDescription), 'id' => 'ScopeofWork', 'class' => 'form-control', 'rows' => '10', 'cols' => '40');
|
||
echo form_textarea($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
|
||
<br>
|
||
|
||
|
||
<div class="form-row ">
|
||
<div class="form-group col-md-12" id="splpodiv">
|
||
<label>Special po Table List</label>
|
||
<table id="table2" class="table table-striped table-hover mb-0" style="font-size:12px;">
|
||
|
||
<div class="form-group col-md-12">
|
||
|
||
|
||
<div class="col-md-offset-10 col-md-8">
|
||
<button type="button" class="btn btn-success" id="addmorebutton">ADD FILES</button>
|
||
</div>
|
||
|
||
|
||
<div id="newdiv"></div>
|
||
<input type="hidden" name="hidecounter" id="hidecounter" value="0" />
|
||
<input type="hidden" name="hideconstant" id="hideconstant" value="0" />
|
||
|
||
|
||
</div>
|
||
<thead>
|
||
<tr>
|
||
<th>Bill No </th>
|
||
<!-- <th>Materials</th> -->
|
||
<!-- <th>Delivery Challan No</th> -->
|
||
<!-- <th>Delivery Challan Date</th>
|
||
<th>Vehicle No</th>
|
||
<th>Courier No</th> -->
|
||
<!-- <th>Quantity</th> -->
|
||
<th>File</th>
|
||
|
||
<th>Action</th>
|
||
</tr>
|
||
</thead>
|
||
|
||
<tbody id="spl">
|
||
<?php
|
||
if (!empty($getdata)) {
|
||
foreach ($getdata as $row => $gd) {
|
||
|
||
?>
|
||
<tr id="lastvalue">
|
||
<td><?php echo $gd->BillNo ?></td>
|
||
<input type="hidden" id="billnos<?= $row ?>" value="<?= $gd->BillNo ?>">
|
||
<input type="hidden" id="file<?= $row ?>" value="<?= $gd->FilePath ?>">
|
||
<td><?php echo (!empty($gd->FilePath)) ? $gd->FilePath : "No File"; ?></td>
|
||
<td><span onclick="openmodel(<?= $row ?>);"><i class="ri-pencil-fill" data-toggle="tooltip" title="Click here to Edit the Revenue SplPO details"></i></span>
|
||
<?php if (!empty($gd->FilePath)) { ?>
|
||
<a target="_blank" href="<?php echo base_url() . 'public/uploads/BillFiles/' ?><?php echo $gd->FilePath ?>"><i class="fa fa-download"></i></a>
|
||
<?php } ?>
|
||
</td>
|
||
</tr>
|
||
<?php
|
||
}
|
||
}
|
||
?>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
|
||
<?php if (!empty($update)) { ?>
|
||
<!-- <div class="form-group col-md-12" id="editpodiv">
|
||
<div class="form-group col-md-12"><label>Editable POScreen</label>
|
||
<table id="edittable" class="table table-striped table-hover mb-0" style="font-size:12px;">
|
||
|
||
<thead>
|
||
<tr>
|
||
<th>Sno</th>
|
||
<th>PONO</th>
|
||
<!- - <th>Material</th> - ->
|
||
<!- - <th>Date</th> - ->
|
||
<th>LineItemNo</th>
|
||
<th>Entity</th>
|
||
<th>OldValue</th>
|
||
<th>NewValue</th>
|
||
<th>UpdatedBy</th>
|
||
<th>UpdateOn</th>
|
||
|
||
</tr>
|
||
</thead>
|
||
|
||
|
||
<tbody>
|
||
<?php
|
||
if (!empty($getlogpodtl)) {
|
||
//print_r($getlogpodtl); die;
|
||
$inde = 0;
|
||
foreach ($getlogpodtl as $oldpo) {
|
||
$inde = $inde + 1;
|
||
?>
|
||
<tr id="<?php echo $inde; ?>">
|
||
|
||
<td><?php echo $inde; ?></td>
|
||
<td><?php echo $oldpo->PONO ?></td>
|
||
|
||
<!- -
|
||
<?php // if ($oldpo->logDate != '-') {
|
||
// $logdate = date('d-m-Y', strtotime($oldpo->logDate));
|
||
// } else {
|
||
// $logdate = '-';
|
||
// }
|
||
?>
|
||
- ->
|
||
<td><?php echo $oldpo->LineItemNos; ?></td>
|
||
<td><?php echo $oldpo->entity ?></td>
|
||
<?php if ($oldpo->entity == 'PO DateChanged') {
|
||
$oldValue = date('d-m-Y', strtotime($oldpo->oldValue));
|
||
} else {
|
||
$oldValue = $oldpo->oldValue;
|
||
} ?>
|
||
<td><?php echo $oldValue . '-' . $oldpo->SupplierName; ?></td>
|
||
|
||
<?php if ($oldpo->entity == 'PO DateChanged') {
|
||
$newValue = date('d-m-Y', strtotime($oldpo->newValue));
|
||
} else {
|
||
$newValue = $oldpo->newValue;
|
||
} ?>
|
||
<td><?php echo $newValue ?></td>
|
||
<td><?php echo $oldpo->FirstName ?></td>
|
||
|
||
<td><?php $date = new DateTime($oldpo->UpdatedOn);
|
||
echo $date->format('d-m-Y'); ?></td>
|
||
|
||
|
||
</tr>
|
||
<?php
|
||
}
|
||
}
|
||
?>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</div>--> <?php } else {} ?>
|
||
|
||
|
||
<div class="form-row">
|
||
<div class="form-group col-md-12 px-4">
|
||
<label>Select Purchase Order File</label><br>
|
||
<input type="file" name="POFile" id="POFile">
|
||
</div>
|
||
<?php if ($PrePOFile) { ?>
|
||
<div id="deletePreviousPurchaseOrderFileDiv">
|
||
<div class="form-group col-md-12 px-4">
|
||
<label for="deletePreviousPurchaseOrderFile"><a title="previously uploaded PO File"
|
||
href="<?php echo base_url() . 'public/uploads/POfiles/' . $PrePOFile ?>"><span>previously uploaded purchase order file- </span><small><?= $PrePOFile; ?></small></a></label>
|
||
|
||
<button class="btn btn-danger btn-sm " id="deletePreviousPurchaseOrderFile">Delete </button>
|
||
</div>
|
||
</div>
|
||
<?php } ?>
|
||
</div>
|
||
<!-- ends here -->
|
||
|
||
|
||
<div class="form-group col-md-12 px-4">
|
||
|
||
|
||
|
||
<div align="right"><br />
|
||
<div>
|
||
|
||
</div> <input type="hidden" name="txtPONO" id="txtPONO" value="<?php echo $PONO; ?>" />
|
||
<input type="hidden" name="txtStatus" id="txtStatus" />
|
||
<input type="hidden" name="txtRowCount" id="txtRowCount" value="<?php if (isset($index)) {
|
||
echo $index;
|
||
} ?>">
|
||
<input type="hidden" name="txtDeletedRow" id="txtDeletedRow" />
|
||
|
||
<input type="hidden" name="Budget" id="Budget" value="<?php echo $BudgetType; ?>" />
|
||
|
||
<?php if ($PONOStatus == PO_DRAFT || $PONOStatus == PO_CREATED || $PONOStatus == REQITEM_Emergency_PO_CREATED) { ?>
|
||
<a class="btn btn-secondary" 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-success Save" ID="Save" onclick="Save(4)"> <span class="bold">Approve</span></a>
|
||
<?php } else if ($PONOStatus == SPECIAL_PO) { ?>
|
||
<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(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> -->
|
||
<?php } ?>
|
||
|
||
</div>
|
||
|
||
</div>
|
||
|
||
<div class="form-group col-md-12 px-4">
|
||
<div align="left">
|
||
<label>Request On : </label><?php if (isset($Reqon)) {
|
||
echo $Reqon;
|
||
} ?><br />
|
||
<?php if (isset($RequesterName)) {
|
||
if ($RequesterName != '' || $RequesterName != null) { ?>
|
||
<label>Request By : </label><?php echo $RequesterName; ?><br />
|
||
<?php
|
||
}
|
||
} ?>
|
||
<!-- <label>Status : </label><?php echo $StatusName; ?> -->
|
||
<label>Status : </label><?php
|
||
$statusMappings = [
|
||
'PO APPROVED' => 'AWAITING APPROVE',
|
||
'AWAITING RELEASE' => 'AWAITING APPROVE',
|
||
'RELEASER ONHOLD' => 'APPROVER ONHOLD',
|
||
'PO RELEASED' => 'PO APPROVED',
|
||
];
|
||
|
||
if (isset($StatusName) && !empty($StatusName)) {
|
||
if (isset($statusMappings[$StatusName])) {
|
||
echo $statusMappings[$StatusName];
|
||
} else {
|
||
echo $StatusName;
|
||
}
|
||
} else {
|
||
echo "Status not provided";
|
||
}
|
||
?>
|
||
|
||
|
||
|
||
</div>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
</div> <!-- end card body-->
|
||
</div> <!-- end card -->
|
||
</div><!-- end col-->
|
||
</div><!-- end form row -->
|
||
</div> <!-- end container-fluid -->
|
||
</div> <!-- end content -->
|
||
</div><!-- end content-page -->
|
||
<!-- Model for servicepo -->
|
||
<div id="SERVICE" class="modal fade" tabindex="-1" role="dialog"
|
||
aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
|
||
<div class="modal-dialog modal-full-width" style="width: 1060px important;">
|
||
<div class="modal-content">
|
||
<div class="modal-header">
|
||
<h4 class="modal-title">Add Service Purchase Order Item</h4>
|
||
<button type="button" class="close" data-dismiss="modal"
|
||
aria-hidden="true">×</button>
|
||
</div>
|
||
<form>
|
||
<div class="modal-body p-4">
|
||
<div class="row">
|
||
|
||
<div class="form-group col-md-3">
|
||
<label>Req No<span class="text-danger">*</span></label>
|
||
<div>
|
||
<?php
|
||
$RL = array("0" => 'Select Req No');
|
||
if (!empty($RequistionDetails)) {
|
||
foreach ($RequistionDetails as $SID) :
|
||
$RL[$SID->ReqNo] = $SID->ReqNo . ' ' . ' - ' . ' ' . $SID->DepartmentName;
|
||
endforeach;
|
||
}
|
||
|
||
echo form_dropdown('ReqNo', $RL, set_value('ReqNo'), 'id="ReqNo" class="form-control"');
|
||
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Department Name</label>
|
||
<?php
|
||
$data = array('name' => 'deptName', 'value' => set_value('deptName'), 'id' => 'deptName', 'class' => 'form-control', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Cost Center Code</label>
|
||
<?php
|
||
$data = array('name' => 'CostCenter', 'value' => set_value('CostCenter'), 'id' => 'CostCenter', 'class' => 'form-control', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
|
||
?>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Avail Budget Amount <?php echo "($INRSYM)" ?></label>
|
||
<?php
|
||
$data = array('name' => 'AvlBudAmt', 'value' => set_value('AvlBudAmt'), 'id' => 'AvlBudAmt', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="row">
|
||
<div class="form-group col-md-3">
|
||
<label>Item Code<span class="text-danger">*</span></label>
|
||
<?php
|
||
$options = array("0" => 'Item Code');
|
||
//print_r( $options);
|
||
|
||
|
||
|
||
echo form_dropdown('MaterialCode', $options, set_value('MaterialCode'), 'id="MaterialCode" class="form-control"');
|
||
|
||
?>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Item Name</label>
|
||
<?php
|
||
$data = array('name' => 'ItemName', 'value' => set_value('ItemName'), 'id' => 'ItemName', 'class' => 'form-control', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
|
||
|
||
<div class="form-group col-md-3" id="otherdescription">
|
||
<label>Item Description</label>
|
||
<?php
|
||
$data = array('name' => 'OtheritemDescription', 'value' => set_value('OtheritemDescription'), 'id' => 'OtheritemDescription', 'class' => 'form-control', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
|
||
|
||
|
||
|
||
<div class="form-group col-md-3">
|
||
<label>UOM</label>
|
||
<?php
|
||
$data = array('name' => 'UOM', 'value' => set_value('UOM'), 'id' => 'UOM', 'class' => 'form-control', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Service Schedule Type</label>
|
||
<?php
|
||
$data = array('name' => 'Frequency', 'value' => set_value('Frequency'), 'id' => 'Frequency', 'class' => 'form-control', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
<input type="hidden" name="FrequencyNo" id="FrequencyNo" value="FrequencyNo" />
|
||
</div>
|
||
|
||
|
||
</div>
|
||
<div class="row">
|
||
|
||
<div class="form-group col-md-3">
|
||
<label>Quantity<span class="text-danger">*</span></label>
|
||
<?php
|
||
$data = array('name' => 'Quantity', 'value' => set_value('Quantity'), 'id' => 'Quantity', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Ratechange()');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label><?php echo "Rate ($INRSYM)"; ?><span class="text-danger">*</span></label>
|
||
<?php
|
||
$data = array('name' => 'Rate', 'value' => set_value('Rate'), 'id' => 'Rate', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Ratechange()');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Per</label> <?php
|
||
$data = array('name' => 'AddPer', 'value' => set_value('AddPer'), 'id' => 'AddPer', 'class' => 'form-control');
|
||
echo form_input($data); ?>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label><?php echo "Basic Amount ($INRSYM)" ?></label>
|
||
<?php
|
||
$data = array('name' => 'txtBasicValue', 'value' => set_value('txtBasicValue'), 'id' => 'txtBasicValue', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
|
||
</div>
|
||
<div class="row">
|
||
<div class="form-group col-md-6" align="right">
|
||
<label> CGST In % </label>
|
||
|
||
</div>
|
||
|
||
<div class="form-group col-md-3">
|
||
|
||
<?php
|
||
$data = array('name' => 'Cgst', 'value' => set_value('Cgst', 0), 'id' => 'Cgst', 'class' => 'form-control num', 'placeholder' => 'CGST TAX PERCENTAGE', 'onchange' => 'Ratechange();ChangeSgst();', 'onkeypress' => 'return isNumberKey(event);');
|
||
echo form_input($data);
|
||
?>
|
||
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<?php
|
||
$data = array('name' => 'AfterCgst', 'value' => set_value('AfterCgst'), 'id' => 'AfterCgst', 'class' => 'form-control num', 'placeholder' => 'After CGST', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
|
||
</div>
|
||
<div class="row">
|
||
<div class="form-group col-md-6" align="right">
|
||
<label> SGST In % </label>
|
||
|
||
</div>
|
||
|
||
<div class="form-group col-md-3">
|
||
|
||
<?php
|
||
$data = array('name' => 'Sgst', 'value' => set_value('Sgst', 0), 'id' => 'Sgst', 'class' => 'form-control num', 'placeholder' => 'SGST TAX PERCENTAGE', 'onchange' => 'Ratechange()', 'onkeypress' => 'return isNumberKey(event);');
|
||
echo form_input($data);
|
||
?>
|
||
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<?php
|
||
$data = array('name' => 'AfterSgst', 'value' => set_value('AfterSgst'), 'id' => 'AfterSgst', 'class' => 'form-control num', 'placeholder' => 'After SGST');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
|
||
</div>
|
||
<div class="row">
|
||
<div class="form-group col-md-6" align="right">
|
||
<label> IGST In % </label>
|
||
|
||
</div>
|
||
|
||
<div class="form-group col-md-3">
|
||
|
||
<?php
|
||
$data = array('name' => 'Igst', 'value' => set_value('Igst', 0), 'id' => 'Igst', 'class' => 'form-control num', 'placeholder' => 'IGST TAX PERCENTAGE', 'onchange' => 'Ratechange()', 'onkeypress' => 'return isNumberKey(event);');
|
||
echo form_input($data);
|
||
?>
|
||
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
|
||
<?php
|
||
$data = array('name' => 'AfterIgst', 'value' => set_value('AfterIgst'), 'id' => 'AfterIgst', 'class' => 'form-control num', 'placeholder' => 'After IGST', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
|
||
</div>
|
||
|
||
</div>
|
||
<div class="row">
|
||
<div class="form-group col-md-9" align="right">
|
||
<label>Other Allowances <?php echo "($INRSYM)" ?></label>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<?php
|
||
$data = array('name' => 'OtherAllowances', 'value' => set_value('OtherAllowances', 0), 'id' => 'OtherAllowances', 'class' => 'form-control num', 'placeholder' => 'Other Allowances', 'onchange' => 'Ratechange()', 'onkeypress' => 'return isNumberKey(event);');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="row">
|
||
<div class="form-group col-md-9" align="right">
|
||
<label><?php echo "Total Order Value ($INRSYM)"; ?></label>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<?php
|
||
$data = array('name' => 'TotalOrderValue', 'value' => set_value('TotalOrderValue'), 'id' => 'TotalOrderValue', 'class' => 'form-control num', 'placeholder' => 'Total value', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="row">
|
||
<div class="form-group col-md-12">
|
||
<label>Service Description <span class="text-danger">*</span></label>
|
||
<?php
|
||
$data = array('name' => 'txtSpcialInstruction', 'value' => set_value('txtSpcialInstruction'), 'id' => 'txtSpcialInstruction', 'class' => 'form-control', 'rows' => '3', 'cols' => '40');
|
||
echo form_textarea($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="modal-footer">
|
||
<a class="btn btn-success" data-dismiss="modal" value="Cancel" style="margin-right:10px;">Cancel</a>
|
||
<a class="btn btn-success font AddService" ID="AddService"><span class="bold">Add Service</span></a>
|
||
</div>
|
||
</form>
|
||
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<!-- Service Special PO Modal Starts Here -->
|
||
<div id="EditServiceSplPOModel" class="modal fade" tabindex="-1" role="dialog"
|
||
aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
|
||
<div class="modal-dialog modal-full-width">
|
||
<div class="modal-content">
|
||
<div class="modal-header">
|
||
<h4 class="modal-title">Update Bill <span id="bill"><span> Details</h4>
|
||
<button type="button" class="close" data-dismiss="modal"
|
||
aria-hidden="true">×</button>
|
||
</div>
|
||
<form class="tagForm" id="tag-form" method="post" enctype="multipart/form-data">
|
||
|
||
<div class="modal-body p-4">
|
||
<div class="form-group col-md-12">
|
||
<div class="form-group col-md-5">
|
||
<label for="oldimagename">Old file Name :<div class="oldimage"></div></label>
|
||
<input type="file" size="20" input accept=".docx,.pdf,.doc.JPG,.PNG,.jpg" id="imag" name="images" onChange="filecheck();" />
|
||
<label for="images">Select file <br /><small>(only .pdf,.excel,.doc,.png,.jpg)</small></label>
|
||
</div>
|
||
</div>
|
||
<input type="hidden" name="hideoldfile" id="hideoldfile" class="form-control" readonly>
|
||
<input type="hidden" name="hidebillno" id="hidebillno" class="form-control" readonly>
|
||
</div>
|
||
<div class="modal-footer">
|
||
<button type="button" class="btn btn-secondary waves-effect"
|
||
data-dismiss="modal" value="Cancel" onclick="SetExciseCalculationCancel();">Cancel</button>
|
||
<button type="button"
|
||
class="btn btn-info waves-effect waves-light" onclick="splpoupdate()">Update</button>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
</div>
|
||
</div><!-- /.modal -->
|
||
<!-- Service Special PO Modal Ends Here -->
|
||
|
||
<!-- Edit Service Modal content Starts Here-->
|
||
<div id="EDITSERVICE" class="modal fade" tabindex="-1" role="dialog"
|
||
aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
|
||
<div class="modal-dialog modal-full-width" style="width: 1060px !important;">
|
||
<div class="modal-content">
|
||
<div class="modal-header">
|
||
<h4 class="modal-title">Edit Service Purchase Order Item</h4>
|
||
<button type="button" class="close" data-dismiss="modal"
|
||
aria-hidden="true">×</button>
|
||
</div>
|
||
<!-- Modal content-->
|
||
<form>
|
||
<div class="modal-body p-4">
|
||
|
||
<div class="form-row">
|
||
<div class="form-group col-md-3">
|
||
<label>Req No<span class="text-danger">*</span></label>
|
||
<div>
|
||
<?php
|
||
|
||
$data = array('name' => 'EditReqNo', 'value' => set_value('EditReqNo'), 'id' => 'EditReqNo', 'class' => 'form-control', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Department Name</label>
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'EditdeptName', 'value' => set_value('EditdeptName'), 'id' => 'EditdeptName', 'class' => 'form-control', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Cost Center Code</label>
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'EditCostCenter', 'value' => set_value('EditCostCenter'), 'id' => 'EditCostCenter', 'class' => 'form-control', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Avail Budget Amount <?php echo "($INRSYM)" ?></label>
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'EditAvlBudAmt', 'value' => set_value('EditAvlBudAmt'), 'id' => 'EditAvlBudAmt', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="form-row">
|
||
<div class="form-group col-md-3">
|
||
<label>Item Code<span class="text-danger">*</span></label>
|
||
<div>
|
||
<?php
|
||
$options = array("0" => 'Item Code');
|
||
//print_r( $options);
|
||
|
||
echo form_dropdown('EditMaterialCode', $options, set_value('EditMaterialCode'), 'id="EditMaterialCode" class="form-control"');
|
||
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Item Name</label>
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'EditItemName', 'value' => set_value('EditItemName'), 'id' => 'EditItemName', 'class' => 'form-control', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3" id=EditotherDescription>
|
||
<label>Item Description</label>
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'EditOtheritemDescription', 'value' => set_value('EditOtheritemDescription'), 'id' => 'EditOtheritemDescription', 'class' => 'form-control', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>UOM</label>
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'EditUOM', 'value' => set_value('EditUOM'), 'id' => 'EditUOM', 'class' => 'form-control', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Service Schedule Type</label>
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'EditFrequency', 'value' => set_value('EditFrequency'), 'id' => 'EditFrequency', 'class' => 'form-control', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
<input type="hidden" name="EditFrequencyNo" id="EditFrequencyNo" value="EditFrequencyNo" />
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="form-row">
|
||
<div class="form-group col-md-3">
|
||
<label>Quantity<span class="text-danger">*</span></label>
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'EditQuantity', 'value' => set_value('EditQuantity'), 'id' => 'EditQuantity', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange()');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label><?php echo "Rate ($INRSYM)"; ?><span class="text-danger">*</span></label>
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'EditRate', 'value' => set_value('EditRate'), 'id' => 'EditRate', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange()');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Per</label> <?php
|
||
$data = array('name' => 'EditPer', 'value' => set_value('EditPer'), 'id' => 'EditPer', 'class' => 'form-control');
|
||
echo form_input($data); ?>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label><?php echo "Basic Amount ($INRSYM)"; ?></label>
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'txtEditBasicValue', 'value' => set_value('txtEditBasicValue'), 'id' => 'txtEditBasicValue', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
|
||
</div>
|
||
<div class="form-row">
|
||
<div class="form-group col-md-6" align="right">
|
||
<label> CGST In % </label>
|
||
|
||
</div>
|
||
|
||
<div class="form-group col-md-3">
|
||
|
||
<?php
|
||
$data = array('name' => 'EditCgst', 'value' => set_value('EditCgst'), 'id' => 'EditCgst', 'class' => 'form-control num', 'placeholder' => 'CGST TAX PERCENTAGE', 'onchange' => 'EditRatechange();ChangeEditSgst();', 'onkeypress' => 'return isNumberKey(event);');
|
||
echo form_input($data);
|
||
?>
|
||
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
|
||
<?php
|
||
$data = array('name' => 'EditAfterCgst', 'value' => set_value('EditAfterCgst'), 'id' => 'EditAfterCgst', 'class' => 'form-control num', 'placeholder' => 'After CGST', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
|
||
</div>
|
||
|
||
</div>
|
||
<div class="form-row">
|
||
<div class="form-group col-md-6" align="right">
|
||
<label> SGST In % </label>
|
||
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<div>
|
||
|
||
<?php
|
||
$data = array('name' => 'EditSgst', 'value' => set_value('EditSgst'), 'id' => 'EditSgst', 'class' => 'form-control num', 'placeholder' => 'SGST TAX PERCENTAGE', 'onchange' => 'EditRatechange()', 'onkeypress' => 'return isNumberKey(event);');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<div>
|
||
|
||
<?php
|
||
$data = array('name' => 'EditAfterSgst', 'value' => set_value('EditAfterSgst'), 'id' => 'EditAfterSgst', 'class' => 'form-control num', 'placeholder' => 'After SGST', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
|
||
</div>
|
||
</div>
|
||
<div class="form-row">
|
||
<div class="form-group col-md-6" align="right">
|
||
<label> IGST In % </label>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<div>
|
||
|
||
<?php
|
||
$data = array('name' => 'EditIgst', 'value' => set_value('EditIgst'), 'id' => 'EditIgst', 'class' => 'form-control num', 'placeholder' => 'IGST TAX PERCENTAGE', 'onchange' => 'EditRatechange()', 'onkeypress' => 'return isNumberKey(event);');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<div>
|
||
|
||
<?php
|
||
$data = array('name' => 'EditAfterIgst', 'value' => set_value('EditAfterIgst'), 'id' => 'EditAfterIgst', 'class' => 'form-control num', 'placeholder' => 'After IGST', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
|
||
</div>
|
||
</div>
|
||
<div class="form-row">
|
||
<div class="form-group col-md-9" align="right">
|
||
<label>Other Allowances <?php echo "($INRSYM)" ?></label>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<?php
|
||
$data = array('name' => 'EditOtherAllowances', 'value' => set_value('EditOtherAllowances'), 'id' => 'EditOtherAllowances', 'class' => 'form-control num', 'onchange' => 'EditRatechange()');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-row">
|
||
<div class="form-group col-md-9" align="right">
|
||
<label><?php echo "Total Order Value ($INRSYM)"; ?></label>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<?php
|
||
$data = array('name' => 'EditTotalOrderValue', 'value' => set_value('EditTotalOrderValue'), 'id' => 'EditTotalOrderValue', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-row">
|
||
<div class="form-group col-md-12">
|
||
<label>Service Description<span class="text-danger">*</span></label>
|
||
<?php
|
||
$data = array('name' => 'EdittxtSpcialInstruction', 'value' => set_value('EdittxtSpcialInstruction'), 'id' => 'EdittxtSpcialInstruction', 'class' => 'form-control', 'rows' => '3', 'cols' => '40');
|
||
echo form_textarea($data);
|
||
?>
|
||
<input type="hidden" name="SpcialInstruction" id="SpcialInstruction" value="">
|
||
</div>
|
||
</div>
|
||
<br />
|
||
</div>
|
||
<div class="modal-footer">
|
||
<div class="form-row">
|
||
<a class="btn btn-secondary" data-dismiss="modal" value="Cancel" style="margin:10px;">Cancel</a>
|
||
<a class="btn btn-success font EditService" ID="Edit"> <span class="bold">Update Service</span></a>
|
||
</div>
|
||
</div>
|
||
|
||
</form>
|
||
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<!-- Edit Service Modal content Ends Here-->
|
||
<!-- View Service Modal content Starts Here-->
|
||
<div id="VIEWSERVICE" class="modal fade" tabindex="-1" role="dialog"
|
||
aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
|
||
<div class="modal-dialog modal-full-width">
|
||
<div class="modal-content">
|
||
<div class="modal-header">
|
||
<h4 class="modal-title">View Service Purchase Order Item</h4>
|
||
<button type="button" class="close" data-dismiss="modal"
|
||
aria-hidden="true">×</button>
|
||
</div>
|
||
<form>
|
||
<div class="modal-body p-4">
|
||
|
||
<div class="form-row">
|
||
<div class="form-group col-md-3">
|
||
<label>Req No<span class="text-danger">*</span></label>
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'ViewReqNo', 'value' => set_value('ViewReqNo'), 'id' => 'ViewReqNo', 'class' => 'form-control', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Department Name</label>
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'ViewdeptName', 'value' => set_value('ViewdeptName'), 'id' => 'ViewdeptName', 'class' => 'form-control', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Cost Center Code</label>
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'ViewCostCenter', 'value' => set_value('ViewCostCenter'), 'id' => 'ViewCostCenter', 'class' => 'form-control', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Avail Budget Amount <?php echo "($INRSYM)" ?></label>
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'ViewAvlBudAmt', 'value' => set_value('ViewAvlBudAmt'), 'id' => 'ViewAvlBudAmt', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="form-row">
|
||
<div class="form-group col-md-3">
|
||
<label>Item Code<span class="text-danger">*</span></label>
|
||
<div>
|
||
<?php
|
||
//$options = array("0"=>'Item Code');
|
||
//print_r( $options);
|
||
|
||
echo form_dropdown('ViewMaterialCode', $options, set_value('ViewMaterialCode'), 'id="ViewMaterialCode" class="form-control"');
|
||
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Item Name</label>
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'ViewItemName', 'value' => set_value('ViewItemName'), 'id' => 'ViewItemName', 'class' => 'form-control', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3" style="display: none;" id="ViewotherDescription">
|
||
<label>Item Name</label>
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'ViewOtheritemDescription', 'value' => set_value('ViewOtheritemDescription'), 'id' => 'ViewOtheritemDescription', 'class' => 'form-control', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>UOM</label>
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'ViewUOM', 'value' => set_value('ViewUOM'), 'id' => 'ViewUOM', 'class' => 'form-control', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Service Schedule Type</label>
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'ViewFrequency', 'value' => set_value('ViewFrequency'), 'id' => 'ViewFrequency', 'class' => 'form-control', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="form-row">
|
||
<div class="form-group col-md-3">
|
||
<label>Quantity<span class="text-danger">*</span></label>
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'ViewQuantity', 'value' => set_value('ViewQuantity'), 'id' => 'ViewQuantity', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label><?php echo "Rate ($INRSYM)"; ?><span class="text-danger">*</span></label>
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'ViewRate', 'value' => set_value('ViewRate'), 'id' => 'ViewRate', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label>Per</label>
|
||
<?php $data = array('name' => 'ViewPer', 'value' => set_value('ViewPer'), 'id' => 'ViewPer', 'class' => 'form-control');
|
||
echo form_input($data); ?>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label><?php echo "Basic Amount ($INRSYM)"; ?></label>
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'txtViewBasicValue', 'value' => set_value('txtViewBasicValue'), 'id' => 'txtViewBasicValue', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="form-row">
|
||
<div class="form-group col-md-6" align="right">
|
||
CGST In %
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'ViewCgst', 'value' => set_value('ViewCgst'), 'id' => 'ViewCgst', 'class' => 'form-control num', 'placeholder' => 'CGST TAX PERCENTAGE', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'ViewAfterCgst', 'value' => set_value('ViewAfterCgst'), 'id' => 'ViewAfterCgst', 'class' => 'form-control num', 'placeholder' => 'After CGST', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
|
||
</div>
|
||
</div>
|
||
<div class="form-row">
|
||
<div class="form-group col-md-6" align="right">
|
||
SGST In %
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'ViewSgst', 'value' => set_value('ViewSgst'), 'id' => 'ViewSgst', 'class' => 'form-control num', 'placeholder' => 'SGST TAX PERCENTAGE', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'ViewAfterSgst', 'value' => set_value('ViewAfterSgst'), 'id' => 'ViewAfterSgst', 'class' => 'form-control num', 'placeholder' => 'After SGST', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="form-row">
|
||
<div class="form-group col-md-6" align="right">
|
||
IGST In %
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'ViewIgst', 'value' => set_value('ViewIgst'), 'id' => 'ViewIgst', 'class' => 'form-control num', 'placeholder' => 'IGST TAX PERCENTAGE', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'ViewAfterIgst', 'value' => set_value('ViewAfterIgst'), 'id' => 'ViewAfterIgst', 'class' => 'form-control num', 'placeholder' => 'After IGST', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="form-row">
|
||
<div class="form-group col-md-9" align="right">
|
||
<label>Other Allowances <?php echo "($INRSYM)" ?></label>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'ViewOtherAllowances', 'value' => set_value('ViewOtherAllowances'), 'id' => 'ViewOtherAllowances', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="form-row">
|
||
<div class="form-group col-md-9" align="right">
|
||
<label><?php echo "Total Order Value ($INRSYM)"; ?></label>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<div>
|
||
<?php
|
||
$data = array('name' => 'ViewTotalOrderValue', 'value' => set_value('ViewTotalOrderValue'), 'id' => 'ViewTotalOrderValue', 'class' => 'form-control num', 'readonly' => 'true');
|
||
echo form_input($data);
|
||
?>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="form-row">
|
||
<div class="form-group col-md-12">
|
||
<label>Service Description<span class="text-danger">*</span></label>
|
||
<?php $data = array('name' => 'ViewtxtSpcialInstruction', 'value' => set_value('ViewtxtSpcialInstruction'), 'id' => 'ViewtxtSpcialInstruction', 'class' => 'form-control', 'rows' => '3', 'cols' => '40', 'readonly' => 'true');
|
||
echo form_textarea($data); ?>
|
||
</div>
|
||
</div><br>
|
||
<div class="modal-footer">
|
||
<div class="form-row">
|
||
<a class="btn btn-secondary" data-dismiss="modal" value="Cancel">Cancel</a>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
</div>
|
||
</div><!-- /.modal -->
|
||
<!-- View Service Modal content Ends Here-->
|
||
|
||
|
||
|
||
|
||
<!-- <script type="text/html" id="ServiceList">
|
||
<tr id="<%=index%>">
|
||
<td align="left"><%=index%></td>
|
||
<td align="left"><%=ReqNo%></td>
|
||
<td align="left"><%=MaterialCode%></td>
|
||
<td align="left"><%=MaterialName%></td>
|
||
<td align="left"><%=Quantity%></td>
|
||
<td align="left"><%=UOM%></td>
|
||
<td align="left"><%=Rate%></td>
|
||
<td align="left"><%=BasicAmount%></td>
|
||
<td align="left"><%=Taxvalue%></td>
|
||
<td align="left"><%=TotalValue%></td>
|
||
<td>
|
||
<a data-target='#EDITSERVICE' data-id="<%=index%>" data-userid="<%=index%>" data-toggle="modal" href="#EDITSERVICE"><i class="ri-pencil-fill" data-toggle="tooltip" title="Click here to view/Edit the <%=ReqNo%> Requisition details"></i> </a> <a href='#' onclick="DeleteRow(<%=index%>)" class="link" data-id="<%=index%>" data-userid="<%=index%>" id="Del"><span class="ri-delete-bin-7-fill"></span></a>
|
||
</td>
|
||
</tr>
|
||
</script> -->
|
||
<script>
|
||
$(document).ready(function() {
|
||
var PONOStatus = "<?= $PONOStatus ?>";
|
||
console.log(PONOStatus);
|
||
|
||
if (PONOStatus === 'ST030') {
|
||
$('input, textarea, select').attr('readonly', true);
|
||
$('input[type="file"], input[type="radio"], input[type="checkbox"]').attr('disabled', true);
|
||
$("#PaymentTerms,#drpSupplier,#insuranceStatus,#PoTypeOptions,#workstatus").prop("disabled", true);
|
||
}
|
||
});
|
||
</script>
|
||
|
||
<script>
|
||
var index = <?php if (isset($index)) {
|
||
echo $index;
|
||
} ?>;
|
||
var userid = '';
|
||
var SelectedMaterialCode = [];
|
||
var CollIndex = 0;
|
||
var SelectedMaterialList = {
|
||
Mat: []
|
||
};
|
||
|
||
|
||
|
||
$("#BudgetType").change(function() {
|
||
|
||
var aa = $("#BudgetType option:selected").text();
|
||
|
||
$('#Budget').val(aa);
|
||
|
||
|
||
});
|
||
|
||
|
||
|
||
$('#EditotherDescription').hide();
|
||
$('#otherdescription').hide()
|
||
|
||
|
||
|
||
$('.AddService').click(function() {
|
||
|
||
tinyMCE.triggerSave();
|
||
if (validateServiceTax()) {
|
||
// alert('inside Addservice');
|
||
var temp = parseInt(index) + 1;
|
||
var Reqnumber = $('#ReqNo').val();
|
||
var departmentName = $('#deptName').val();
|
||
var AvilBudget = $('#AvlBudAmt').val();
|
||
var costCode = $('#CostCenter').val();
|
||
var materialCode = $('#MaterialCode').val();
|
||
var materialName = $("#ItemName").val();
|
||
var uom = $("#UOM").val();
|
||
var addPer = '';
|
||
if ($("#AddPer").val().trim() == '') {
|
||
addPer = $("#UOM").val();
|
||
} else {
|
||
addPer = $("#AddPer").val();
|
||
}
|
||
var quantity = $("#Quantity").val();
|
||
var itemRate = parseFloat($("#Rate").val()).toFixed(2);
|
||
|
||
|
||
var Cgst = $("#Cgst").val();
|
||
var AfterCgst = $("#AfterCgst").val();
|
||
var Sgst = $("#Sgst").val();
|
||
var AfterSgst = $("#AfterSgst").val();
|
||
var Igst = $("#Igst").val();
|
||
var AfterIgst = $("#AfterIgst").val();
|
||
var FrequencyValue = $("#FrequencyNo").val();
|
||
|
||
var Frequency = $("#Frequency").val();
|
||
var ServiceDescription = $('#txtSpcialInstruction').val();
|
||
var OtherAmt = $('#OtherAllowances').val();
|
||
var TotalOrderValue = $("#TotalOrderValue ").val();
|
||
|
||
|
||
var basicval = $("#txtBasicValue").val();
|
||
|
||
var otherdesc = $('#OtheritemDescription').val();
|
||
|
||
|
||
var TotalTaxValue = calculateTaxValue();
|
||
|
||
$('#MaterialCode option[value=' + materialCode + ']').remove();
|
||
SelectedMaterialCode[CollIndex] = materialCode;
|
||
CollIndex = CollIndex + 1;
|
||
|
||
SelectedMaterialList.Mat.push({
|
||
"materialCode": materialCode,
|
||
"ReqNo": Reqnumber,
|
||
|
||
});
|
||
populateValueMainFormForServiceTax();
|
||
|
||
|
||
index = parseInt(index) + 1;
|
||
|
||
// var template = jQuery("#ServiceList").html();
|
||
|
||
|
||
// $('#ServiceAppend').append(_.template(template, {
|
||
// index: temp,
|
||
// ReqNo: Reqnumber,
|
||
// MaterialCode: materialCode,
|
||
// MaterialName: materialName,
|
||
// Quantity: quantity,
|
||
// UOM: uom,
|
||
// Rate: itemRate,
|
||
// BasicAmount: basicval,
|
||
// Taxvalue: TotalTaxValue,
|
||
// TotalValue: TotalOrderValue
|
||
// }));
|
||
var PONOStatus = "<?php echo $PONOStatus; ?>";
|
||
var shorten = materialName.length > 13 ? materialName.slice(0, 13) + "..." : materialName;
|
||
var rowHtml = `
|
||
<tr id="${temp}">
|
||
<td align="left">${temp}</td>
|
||
<td align="center">${Reqnumber}</td>
|
||
<td align="left">${materialCode}</td>
|
||
<td align="left">${shorten}</td>`;
|
||
if (PONOStatus === "PO_DRAFT" || PONOStatus === "PO_CREATED") {
|
||
rowHtml += `<td><a href="#" class="editable-field"
|
||
data-id="${temp}"
|
||
data-notes="-">-</a>
|
||
<div class="edit-container" style="display:none;">
|
||
<input type="text" class="edit-input-field" />
|
||
<button class="save-btn">✔</button>
|
||
<button class="cancel-btn">✖</button>
|
||
</div></td>`;
|
||
} else {
|
||
rowHtml += `<td>-</td>`;
|
||
}
|
||
rowHtml += `<td align="right">${quantity}</td>
|
||
<td align="left">${uom}</td>
|
||
<td align="right">${itemRate}</td>
|
||
<td align="right">${basicval}</td>
|
||
<td align="right">${TotalTaxValue}</td>
|
||
<td align="right">${TotalOrderValue}</td>
|
||
<td>
|
||
<a data-target='#EDITSERVICE' data-id="${temp}" data-userid="${temp}" data-toggle="modal" href="#EDITSERVICE">
|
||
<i class="ri-pencil-fill" data-toggle="tooltip" ></i>
|
||
</a>
|
||
<a href='#' onclick="DeleteRow(${temp})" class="link" data-id="${temp}" data-userid="${temp}" id="Del">
|
||
<span class="ri-delete-bin-7-fill"></span>
|
||
</a>
|
||
</td>
|
||
</tr>
|
||
`;
|
||
|
||
// Append the generated HTML to your table body
|
||
$('#ServiceAppend').append(rowHtml);
|
||
|
||
|
||
|
||
|
||
var theForm = $(".ServicePO");
|
||
|
||
addHidden(theForm, "Reqnumber" + temp, Reqnumber);
|
||
addHidden(theForm, "departmentName" + temp, departmentName);
|
||
addHidden(theForm, "AvilBudget" + temp, AvilBudget);
|
||
addHidden(theForm, "costCode" + temp, costCode);
|
||
addHidden(theForm, "materialCode" + temp, materialCode);
|
||
addHidden(theForm, "materialName" + temp, materialName);
|
||
addHidden(theForm, "uom" + temp, uom);
|
||
addHidden(theForm, "per" + temp, addPer);
|
||
addHidden(theForm, "quantity" + temp, quantity);
|
||
addHidden(theForm, "itemRate" + temp, itemRate);
|
||
addHidden(theForm, "Cgst" + temp, Cgst);
|
||
addHidden(theForm, "AfterCgst" + temp, AfterCgst);
|
||
addHidden(theForm, "Sgst" + temp, Sgst);
|
||
addHidden(theForm, "AfterSgst" + temp, AfterSgst);
|
||
addHidden(theForm, "Igst" + temp, Igst);
|
||
addHidden(theForm, "AfterIgst" + temp, AfterIgst);
|
||
addHidden(theForm, "Frequency" + temp, Frequency);
|
||
addHidden(theForm, "FrequencyValue" + temp, FrequencyValue);
|
||
addHidden(theForm, "ItemDescription" + temp, ServiceDescription);
|
||
addHidden(theForm, "OtherAmt" + temp, OtherAmt);
|
||
addHidden(theForm, "TotalOrderValue" + temp, TotalOrderValue);
|
||
addHidden(theForm, "LineItemNo" + temp, '');
|
||
|
||
addHidden(theForm, "OtherServiceDescription" + temp, otherdesc);
|
||
|
||
$('#txtRowCount').val(temp);
|
||
clearServiceModalFields();
|
||
setTimeout(() => {
|
||
$('#SERVICE').modal('hide');
|
||
}, 1000);
|
||
}
|
||
|
||
});
|
||
|
||
function openmodel(i) {
|
||
//alert(i);
|
||
var file = $("#file" + i).val();
|
||
//alert(file);
|
||
var Billno = $("#billnos" + i).val();
|
||
//alert(Billno);
|
||
$("#EditServiceSplPOModel").modal("show");
|
||
$(".oldimage").text(file);
|
||
$("#hideoldfile").val(file);
|
||
$("#hidebillno").val(Billno);
|
||
$("#bill").text(Billno);
|
||
}
|
||
$('.EditService').click(function() {
|
||
tinyMCE.triggerSave();
|
||
if (validateEditServiceTax()) {
|
||
var CostCode = $("#EditCostCenter").val();
|
||
var AvilBudget = $('#EditAvlBudAmt').val();
|
||
var editMaterialCode = $("#EditMaterialCode").val();
|
||
var editDescription = $("#EditItemName").val();
|
||
var editUOM = $('#EditUOM').val();
|
||
var editPer = '';
|
||
if ($("#EditPer").val().trim() == '') {
|
||
editPer = $("#EditUOM").val();
|
||
} else {
|
||
editPer = $("#EditPer").val();
|
||
}
|
||
var editQuantity = $('#EditQuantity').val();
|
||
|
||
var itemRate = $("#EditRate").val();
|
||
|
||
|
||
var Cgst = $("#EditCgst").val();
|
||
var AfterCgst = $("#EditAfterCgst").val();
|
||
var Sgst = $("#EditSgst").val();
|
||
var AfterSgst = $("#EditAfterSgst").val();
|
||
var Igst = $("#EditIgst").val();
|
||
var AfterIgst = $("#EditAfterIgst").val();
|
||
|
||
var Frequency = $("#EditFrequency").val();
|
||
var FrequencyValue = $("#EditFrequencyNo").val();
|
||
var ServiceDescription = $('#EdittxtSpcialInstruction').val();
|
||
var OtherAmt = $('#EditOtherAllowances').val();
|
||
var TotalOrderValue = $("#EditTotalOrderValue ").val();
|
||
|
||
|
||
var basicval = $("#txtEditBasicValue").val();
|
||
|
||
var TotalTaxValue = calculateEditTaxValue();
|
||
|
||
|
||
|
||
var tr = document.getElementById(userid);
|
||
var cellval = tr.cells;
|
||
|
||
cellval[2].innerHTML = editMaterialCode;
|
||
cellval[3].innerHTML = editDescription;
|
||
cellval[5].innerHTML = editQuantity;
|
||
cellval[6].innerHTML = editUOM;
|
||
cellval[7].innerHTML = parseFloat(itemRate).toFixed(2);
|
||
cellval[8].innerHTML = parseFloat(basicval).toFixed(2);
|
||
cellval[9].innerHTML = parseFloat(TotalTaxValue).toFixed(2);
|
||
cellval[10].innerHTML = parseFloat(TotalOrderValue).toFixed(2);
|
||
|
||
|
||
$('#materialCode' + userid).val(editMaterialCode);
|
||
$('#materialName' + userid).val(editDescription);
|
||
$('#uom' + userid).val(editUOM);
|
||
$('#per' + userid).val(editPer);
|
||
$('#CostCode' + userid).val(CostCode);
|
||
$('#quantity' + userid).val(editQuantity);
|
||
$('#itemRate' + userid).val(itemRate);
|
||
$('#Cgst' + userid).val(Cgst);
|
||
$('#AfterCgst' + userid).val(AfterCgst);
|
||
$('#Sgst' + userid).val(Sgst);
|
||
$('#AfterSgst' + userid).val(AfterSgst);
|
||
$('#Igst' + userid).val(Igst);
|
||
$('#AfterIgst' + userid).val(AfterIgst);
|
||
$('#TotalOrderValue' + userid).val(TotalOrderValue);
|
||
$('#ItemDescription' + userid).val(ServiceDescription);
|
||
$('#OtherAmt' + userid).val(OtherAmt);
|
||
populateValueMainFormForEditServiceTax();
|
||
$('#EDITSERVICE').modal('hide');
|
||
}
|
||
|
||
});
|
||
|
||
function addHidden(theForm, key, value) {
|
||
// Create a hidden input element, and append it to the form:
|
||
var input = document.createElement('input');
|
||
input.type = 'hidden';
|
||
input.name = key;
|
||
'name-as-seen-at-the-server';
|
||
input.id = key;
|
||
'name-as-seen-at-the-server';
|
||
input.value = value;
|
||
theForm.append(input);
|
||
}
|
||
|
||
function populateValueMainFormForServiceTax() {
|
||
var AfterCgst = $('#AfterCgst').val() == '' ? '0.00' : $('#AfterCgst').val();
|
||
var AfterSgst = $('#AfterSgst').val() == '' ? '0.00' : $('#AfterSgst').val();
|
||
var AfterIgst = $('#AfterIgst').val() == '' ? '0.00' : $('#AfterIgst').val();
|
||
var OtherAmt = $('#OtherAllowances').val() == '' ? '0.00' : $('#OtherAllowances').val();
|
||
var TotalVal = $('#TotalOrderValue ').val() == '' ? '0.00' : $('#TotalOrderValue').val();
|
||
|
||
var BasicVal = $('#txtBasicValue').val() == '' ? '0.00' : $('#txtBasicValue').val();
|
||
|
||
|
||
var TotalOrderValueSummary = $('#txtTotalOrderValueSummary').val() == '' ? '0.00' : $('#txtTotalOrderValueSummary').val();
|
||
|
||
var totBasicAmt = $('#txtTotBasicAmount').val() == '' ? '0.00' : $('#txtTotBasicAmount').val();
|
||
var TotalCgst = $('#txtTotCgst').val() == '' ? '0.00' : $('#txtTotCgst').val();
|
||
var TotSgst = $('#txtTotSgst').val() == '' ? '0.00' : $('#txtTotSgst').val();
|
||
var TotalIgst = $('#txtTotIgst').val() == '' ? '0.00' : $('#txtTotIgst').val();
|
||
var TotalAllowance = $('#ToatalOtherAllowances').val() == '' ? '0.00' : $('#ToatalOtherAllowances').val();
|
||
$('#txtTotBasicAmount').val((parseFloat(totBasicAmt) + parseFloat(BasicVal)).toFixed(2));
|
||
$('#txtTotCgst').val((parseFloat(TotalCgst) + parseFloat(AfterCgst)).toFixed(2));
|
||
$('#txtTotSgst').val((parseFloat(TotSgst) + parseFloat(AfterSgst)).toFixed(2));
|
||
$('#txtTotIgst').val((parseFloat(TotalIgst) + parseFloat(AfterIgst)).toFixed(2));
|
||
$('#ToatalOtherAllowances').val((parseFloat(TotalAllowance) + parseFloat(OtherAmt)).toFixed(2));
|
||
$('#txtTotalOrderValueSummary').val((parseFloat(TotalOrderValueSummary) + parseFloat(TotalVal)).toFixed(2));
|
||
|
||
}
|
||
|
||
function populateValueMainFormForEditServiceTax() {
|
||
|
||
var rows = document.getElementById('ServiceTable').rows.length;
|
||
// alert(rows);
|
||
var editrow = parseFloat(rows) - 1;
|
||
var TotCgst = 0;
|
||
var TotSgst = 0;
|
||
var TotIgst = 0;
|
||
var TotOther = 0;
|
||
var TotSummary = 0;
|
||
var TotBasicAmout = 0;
|
||
var i = 0;
|
||
do {
|
||
i += 1;
|
||
var tr = document.getElementById(i);
|
||
//alert(tr);
|
||
if (tr != null) {
|
||
cells = tr.getElementsByTagName('td');
|
||
|
||
|
||
var rowid = cells[0].innerHTML;
|
||
|
||
var AfterCgst = $('#AfterCgst' + rowid).val() == '' ? '0.00' : $('#AfterCgst' + rowid).val();
|
||
var AfterSgst = $('#AfterSgst' + rowid).val() == '' ? '0.00' : $('#AfterSgst' + rowid).val();
|
||
var AfterIgst = $('#AfterIgst' + rowid).val() == '' ? '0.00' : $('#AfterIgst' + rowid).val();
|
||
var OtherAmt = $('#OtherAmt' + rowid).val() == '' ? '0.00' : $('#OtherAmt' + rowid).val();
|
||
var TotalVal = $('#TotalOrderValue' + rowid).val() == '' ? '0.00' : $('#TotalOrderValue' + rowid).val();
|
||
|
||
var Quantity = $('#quantity' + rowid).val() == '' ? '0.00' : $('#quantity' + rowid).val();
|
||
var ItemRate = $('#itemRate' + rowid).val() == '' ? '0.00' : $('#itemRate' + rowid).val();
|
||
var FrequencyValue = $('#FrequencyValue' + rowid).val() == '' ? '1.00' : $('#FrequencyValue' + rowid).val();
|
||
var BasicVal = parseFloat(Quantity) * parseFloat(ItemRate) * parseFloat(FrequencyValue);
|
||
|
||
TotCgst = parseFloat(TotCgst) + parseFloat(AfterCgst);
|
||
TotSgst = parseFloat(TotSgst) + parseFloat(AfterSgst);
|
||
TotIgst = parseFloat(TotIgst) + parseFloat(AfterIgst);
|
||
TotOther = parseFloat(TotOther) + parseFloat(OtherAmt);
|
||
TotSummary = parseFloat(TotSummary) + parseFloat(TotalVal);
|
||
TotBasicAmout = parseFloat(TotBasicAmout) + parseFloat(BasicVal);
|
||
|
||
}
|
||
|
||
|
||
} while (i < editrow);
|
||
|
||
$('#txtTotBasicAmount').val(parseFloat(TotBasicAmout).toFixed(2));
|
||
$('#txtTotCgst').val(parseFloat(TotCgst).toFixed(2));
|
||
$('#txtTotSgst').val(parseFloat(TotSgst).toFixed(2));
|
||
$('#txtTotIgst').val(parseFloat(TotIgst).toFixed(2));
|
||
$('#ToatalOtherAllowances').val(parseFloat(TotOther).toFixed(2));
|
||
$('#txtTotalOrderValueSummary').val(parseFloat(TotSummary).toFixed(2));
|
||
|
||
}
|
||
|
||
function calculateEditTaxValue() {
|
||
var Cgst = parseFloat($('#EditAfterCgst').val());
|
||
var Sgst = parseFloat($('#EditAfterSgst').val());
|
||
var Igst = parseFloat($('#EditAfterIgst').val());
|
||
|
||
|
||
var TottaxAmt = Cgst + Sgst + Igst;
|
||
return parseFloat(TottaxAmt).toFixed(2);
|
||
}
|
||
|
||
function clearServiceModalFields() {
|
||
// To reset the Modal controls
|
||
$('#ReqNo').val('0');
|
||
$('#deptName').val('');
|
||
$('#CostCenter').val("0");
|
||
$('#AvlBudAmt').val('');
|
||
$('#MaterialCode').val("0");
|
||
$("#ItemName").val('');
|
||
$('#UOM').val('');
|
||
$('#AddPer').val('');
|
||
$('#Quantity').val('');
|
||
$("#Rate").val('');
|
||
|
||
$("#txtBasicValue").val('');
|
||
$("#AfterCgst").val(0);
|
||
$("#AfterSgst").val(0);
|
||
$("#AfterIgst").val(0);
|
||
$("#Cgst").val(0);
|
||
$("#Sgst").val(0);
|
||
$("#Igst").val(0);
|
||
$("#OtherAllowances").val(0);
|
||
$("#txtSpcialInstruction").val('');
|
||
$("#TotalOrderValue ").val('');
|
||
$("#Frequency").val('');
|
||
tinyMCE.get('txtSpcialInstruction').setContent('');
|
||
|
||
$('#OtheritemDescription').val('');
|
||
}
|
||
|
||
function DeleteRow(rowid) {
|
||
|
||
var id = [];
|
||
var DelRows = $('#txtDeletedRow').val();
|
||
|
||
var tr = document.getElementById(rowid);
|
||
|
||
var MaterialCode = $('#materialCode' + rowid).val();
|
||
var LineItemNo = $('#LineItemNo' + rowid).val();
|
||
var ReqNo = $('#Reqnumber' + rowid).val();
|
||
var POType = '<?php echo SERVICE ?>';
|
||
id[0] = LineItemNo;
|
||
id[1] = ReqNo;
|
||
id[2] = MaterialCode;
|
||
id[3] = POType;
|
||
|
||
|
||
var answer = confirm(" Do you want to delete the Item from the List?")
|
||
if (answer) {
|
||
populateValueMainFormForDeleteItem(rowid);
|
||
tr.parentNode.removeChild(tr);
|
||
|
||
var removeItem = $('#materialCode' + rowid).val();
|
||
|
||
var materialCode = $('#materialCode' + rowid).val();
|
||
|
||
|
||
var removeItem = $('#materialCode' + rowid).val();
|
||
var Material = <?php echo json_encode($MaterialList, JSON_PRETTY_PRINT) ?>;
|
||
for (i = 0; i < Material.length; i++) {
|
||
$.each(Material[i], function(index, value) {
|
||
|
||
|
||
if (value.MaterialCode == materialCode) {
|
||
|
||
|
||
// $("#MaterialCode").append( $('<option></option>').val(value.MaterialCode).html(value.MaterialCode + "-" + value.MaterialName) );
|
||
DeletedMaterialCode = $('#materialCode' + rowid).val();
|
||
DeletedMaterialName = $('#materialName' + rowid).val();
|
||
}
|
||
});
|
||
}
|
||
|
||
|
||
SelectedMaterialCode.splice(SelectedMaterialCode.indexOf('removeItem'), 1);
|
||
var x = <?php echo json_encode($POItem, JSON_PRETTY_PRINT) ?>;
|
||
|
||
var result = '0';
|
||
$.each(x, function(idx, obj) {
|
||
|
||
if (obj.LineItemNo === LineItemNo) {
|
||
result = '1';
|
||
return false;
|
||
}
|
||
|
||
});
|
||
|
||
// alert(result);
|
||
if (result == '0') {
|
||
var DelRows = $('#txtDeletedRow').val();
|
||
//tr.parentNode.removeChild(tr);
|
||
if (DelRows != '') {
|
||
DelRows = DelRows + ":" + rowid;
|
||
} else {
|
||
DelRows = "0" + ":" + rowid;
|
||
}
|
||
$('#txtDeletedRow').val(DelRows);
|
||
}
|
||
// To delete the value from Tables
|
||
else if (result == '1') {
|
||
var DelRows = $('#txtDeletedRow').val();
|
||
//tr.parentNode.removeChild(tr);
|
||
if (DelRows != '') {
|
||
DelRows = DelRows + ":" + rowid;
|
||
} else {
|
||
DelRows = "0" + ":" + rowid;
|
||
}
|
||
$('#txtDeletedRow').val(DelRows);
|
||
|
||
$('#loader').show();
|
||
$.ajax({
|
||
data: {
|
||
id: id
|
||
},
|
||
type: "POST",
|
||
url: "<?php echo base_url() ?>purchaseorder/DeletePODetails",
|
||
success: function(data) {
|
||
$('#loader').hide();
|
||
(data) ? alert(response): alert("Error");
|
||
}
|
||
});
|
||
}
|
||
|
||
// populateValueMainFormForDeleteItem(rowid);
|
||
|
||
}
|
||
|
||
}
|
||
|
||
function populateValueMainFormForDeleteItem(rowid) {
|
||
|
||
|
||
// alert(rows);
|
||
var TotCgst = $('#txtTotCgst').val();
|
||
var TotSgst = $('#txtTotSgst').val();
|
||
var TotIgst = $('#txtTotIgst').val();
|
||
var TotOtherAmt = $('#ToatalOtherAllowances').val();
|
||
var TotSummary = $('#txtTotalOrderValueSummary').val();
|
||
var TotBasicAmout = $('#txtTotBasicAmount').val();
|
||
|
||
|
||
|
||
var AfterCgst = $('#AfterCgst' + rowid).val() == '' ? '0.00' : $('#AfterCgst' + rowid).val();
|
||
var AfterSgst = $('#AfterSgst' + rowid).val() == '' ? '0.00' : $('#AfterSgst' + rowid).val();
|
||
var AfterIgst = $('#AfterIgst' + rowid).val() == '' ? '0.00' : $('#AfterIgst' + rowid).val();
|
||
var OtherAmt = $('#OtherAmt' + rowid).val() == '' ? '0.00' : $('#OtherAmt' + rowid).val();
|
||
var TotalVal = $('#TotalOrderValue' + rowid).val() == '' ? '0.00' : $('#TotalOrderValue' + rowid).val();
|
||
|
||
var Quantity = $('#quantity' + rowid).val() == '' ? '0.00' : $('#quantity' + rowid).val();
|
||
var ItemRate = $('#itemRate' + rowid).val() == '' ? '0.00' : $('#itemRate' + rowid).val();
|
||
var FrequencyValue = $('#FrequencyValue' + rowid).val() == '' ? '1.00' : $('#FrequencyValue' + rowid).val();
|
||
var BasicVal = parseFloat(Quantity) * parseFloat(ItemRate) * parseFloat(FrequencyValue);
|
||
//alert(TotalVal);
|
||
|
||
TotCgst = parseFloat(TotCgst) - parseFloat(AfterCgst);
|
||
TotSgst = parseFloat(TotSgst) - parseFloat(AfterSgst);
|
||
TotIgst = parseFloat(TotIgst) - parseFloat(AfterIgst);
|
||
TotOtherAmt = parseFloat(TotOtherAmt) - parseFloat(OtherAmt);
|
||
TotSummary = parseFloat(TotSummary) - parseFloat(TotalVal);
|
||
TotBasicAmout = parseFloat(TotBasicAmout) - parseFloat(BasicVal);
|
||
|
||
|
||
$('#txtTotBasicAmount').val(parseFloat(TotBasicAmout).toFixed(2));
|
||
$('#txtTotCgst').val(parseFloat(TotCgst).toFixed(2));
|
||
$('#txtTotSgst').val(parseFloat(TotSgst).toFixed(2));
|
||
$('#txtTotIgst').val(parseFloat(TotIgst).toFixed(2));
|
||
$('#ToatalOtherAllowances').val(parseFloat(TotOtherAmt).toFixed(2));
|
||
$('#txtTotalOrderValueSummary').val(parseFloat(TotSummary).toFixed(2));
|
||
|
||
|
||
|
||
}
|
||
|
||
function validateServiceTax() {
|
||
|
||
if ($('#ReqNo').val() == "0") {
|
||
alert('Please select the Requisition Number');
|
||
$('#ReqNo').focus();
|
||
return false;
|
||
} else if ($('#CostCenter').val() == "0") {
|
||
alert('Please select the Cost center');
|
||
$('#CostCenter').focus();
|
||
return false;
|
||
} else if ($('#MaterialCode').val() == "0") {
|
||
alert('Please select the Material Code');
|
||
$('#MaterialCode').focus();
|
||
return false;
|
||
} else if ($('#Quantity').val() == '') {
|
||
alert('Please Enter the Quantity value');
|
||
$('#Quantity').focus();
|
||
return false;
|
||
} else if ($('#Quantity').val() == 0) {
|
||
alert('Please Enter the Valid Quantity Value');
|
||
$('#Quantity').focus();
|
||
return false;
|
||
} else if ($('#Rate').val() == '') {
|
||
alert('Please Enter the Rate of the Item');
|
||
$('#Rate').focus();
|
||
return false;
|
||
} else if ($('#Rate').val() == 0) {
|
||
alert('Please Enter the Valid Rate of the Item');
|
||
$('#Rate').focus();
|
||
return false;
|
||
} else if (ExceedQuantityCheck() == false) {
|
||
return false;
|
||
} else if ($('#txtSpcialInstruction').val() == '') {
|
||
alert('Please Enter the Service Description');
|
||
$('#txtSpcialInstruction').focus();
|
||
return false;
|
||
} else if (ExceedBudget($('#txtBasicValue').val(), $('#AvlBudAmt').val()) == false) {
|
||
$('#Rate').focus();
|
||
return false;
|
||
} else {
|
||
return true;
|
||
}
|
||
|
||
}
|
||
|
||
function validateEditServiceTax() {
|
||
|
||
if ($('#EditCostCenter').val() == "0") {
|
||
alert('Please select the Cost center');
|
||
$('#EditCostCenter').focus();
|
||
return false;
|
||
} else if ($('#EditMaterialCode').val() == "0") {
|
||
alert('Please select the Material Code');
|
||
$('#EditMaterialCode').focus();
|
||
return false;
|
||
} else if ($('#EditQuantity').val() == '') {
|
||
alert('Please Enter the Quantity value');
|
||
$('#EditQuantity').focus();
|
||
return false;
|
||
} else if ($('#EditQuantity').val() == 0) {
|
||
alert('Please Enter the Valid Quantity value');
|
||
$('#EditQuantity').focus();
|
||
return false;
|
||
} else if ($('#EditRate').val() == 0) {
|
||
alert('Please Enter the Valid Rate of the Item');
|
||
$('#EditRate').focus();
|
||
return false;
|
||
} else if ($('#EditRate').val() == '') {
|
||
alert('Please Enter the Rate of the Item');
|
||
$('#EditRate').focus();
|
||
return false;
|
||
} else if (EditExceedQuantityCheck() == false) {
|
||
return false;
|
||
} else if ($('#EdittxtSpcialInstruction').val() == '') {
|
||
alert('Please Enter the Service Description');
|
||
$('#EdittxtSpcialInstruction').focus();
|
||
return false;
|
||
} else if (ExceedBudget($('#txtEditBasicValue').val(), $('#EditAvlBudAmt').val()) == false) {
|
||
$('#EditRate').focus();
|
||
return false;
|
||
} else {
|
||
return true;
|
||
}
|
||
|
||
}
|
||
//
|
||
</script>
|
||
<script>
|
||
function Save(status) {
|
||
console.log("serviceValidate",status);
|
||
if (status == '0') {
|
||
stat = '<?php echo PO_DRAFT; ?>';
|
||
} else if (status == '1') {
|
||
stat = '<?php echo PO_CREATED; ?>';
|
||
} else if (status == '2') {
|
||
stat = '<?php echo PO_AWAITING_RELEASE; ?>';
|
||
} else if (status == '3') {
|
||
stat = '<?php echo SPECIAL_PO; ?>';
|
||
} else if (status == '4') {
|
||
stat = '<?php echo PO_RELEASED; ?>';
|
||
}
|
||
var splinstr = $('#txtSpcialInstruction').val();
|
||
var deladd = $('#DeliveryAddr').val();
|
||
$('#txtStatus').val(stat);
|
||
|
||
tinyMCE.triggerSave();
|
||
var splinstr = $('#ScopeOfWork').val();
|
||
$('#ScopeOfWork').val(splinstr);
|
||
$('#txtDeliveryAddress').val(deladd);
|
||
|
||
|
||
AvlBudAmt = '<?php echo number_format($AvlAmount + $TotalBasicAmount, 2, '.', '') ?>';
|
||
|
||
var txtTotalOrderValueSummary = $('#txtTotBasicAmount').val();
|
||
|
||
|
||
if (serviceValidate()) {
|
||
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 {
|
||
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";
|
||
// 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
|
||
$('#Scheduleby').change(function() {
|
||
|
||
// $("#Deliverydt").datepicker({
|
||
// minDate: 'now',
|
||
// dateFormat: 'mm/dd/yy',
|
||
// changeMonth: true,
|
||
// changeYear: true,
|
||
// yearRange: '0:+10'
|
||
// });
|
||
|
||
|
||
});
|
||
$('#Deliverydt').change(function() {
|
||
|
||
$('#Scheduleby').val('');
|
||
|
||
});
|
||
|
||
function calculateCgstTax(varBasicValue, Cgst) {
|
||
|
||
var basicValue = parseFloat(varBasicValue);
|
||
var Cgst = parseFloat(Cgst);
|
||
var ServiceTaxValue = 0.0;
|
||
|
||
ServiceTaxValue = <?php echo SERVICETAX_CGST; ?>;
|
||
|
||
var TAXval = parseFloat(ServiceTaxValue).toFixed(2);
|
||
|
||
return TAXval; // $('#AfterServiceTax').val(TAXval);
|
||
|
||
}
|
||
|
||
function calculateSgstTax(varBasicValue, Sgst) {
|
||
|
||
var basicValue = parseFloat(varBasicValue);
|
||
var Sgst = parseFloat(Sgst);
|
||
var ServiceTaxValue = 0.0;
|
||
|
||
ServiceTaxValue = <?php echo SERVICETAX_SGST; ?>;
|
||
|
||
var TAXval = parseFloat(ServiceTaxValue).toFixed(2);
|
||
|
||
return TAXval; // $('#AfterServiceTax').val(TAXval);
|
||
|
||
}
|
||
|
||
function calculateIgstTax(varBasicValue, Igst) {
|
||
|
||
var basicValue = parseFloat(varBasicValue);
|
||
var Igst = parseFloat(Igst);
|
||
var ServiceTaxValue = 0.0;
|
||
|
||
ServiceTaxValue = <?php echo SERVICETAX_IGST; ?>;
|
||
|
||
var TAXval = parseFloat(ServiceTaxValue).toFixed(2);
|
||
|
||
return TAXval; // $('#AfterServiceTax').val(TAXval);
|
||
|
||
}
|
||
|
||
//If others is the payment terms to display mandatory field
|
||
$(document).ready(function() {
|
||
$("#PaymentTerms").change(function() {
|
||
var otherPayment = '<?php echo $otherPayment; ?>';
|
||
if ($('#PaymentTerms').val().trim() == 'PT08') {
|
||
$('#otheroptiondiv').show();
|
||
$('#Otherpayment').val(otherPayment);
|
||
} else {
|
||
$('#otheroptiondiv').hide();
|
||
$('#Otherpayment').val('');
|
||
}
|
||
});
|
||
})
|
||
|
||
$('#ReqNo').change(function() {
|
||
|
||
var id = $('#ReqNo').val();
|
||
$("#AvlBudAmt").val('');
|
||
$("#CostCenter").val('');
|
||
$("#MaterialCode").empty();
|
||
$("#deptName").val('');
|
||
$("#UOM").val('');
|
||
$("#Quantity").val('');
|
||
$("#ItemName").val('');
|
||
$("#Rate").val('');
|
||
$("#txtBasicValue").val('');
|
||
clearTaxField();
|
||
$("#MaterialCode").empty();
|
||
if (id != '0') {
|
||
var y = <?php echo json_encode($RequistionDetails, JSON_PRETTY_PRINT) ?>;
|
||
|
||
var Material = <?php echo json_encode($MaterialList, JSON_PRETTY_PRINT) ?>;
|
||
|
||
var AvlBudAmt = '<?php echo $AvlAmount ?>';
|
||
|
||
AvlBudAmt = '<?php echo number_format($AvlAmount + $TotalBasicAmount, 2, '.', '') ?>';
|
||
|
||
//ServiceTable
|
||
var rows = document.getElementById('ServiceTable').rows.length;
|
||
var DeletedMaterialCode = '';
|
||
var DeletedMaterialName = '';
|
||
|
||
if (DeletedMaterialCode != undefined && DeletedMaterialCode != '') {
|
||
|
||
$("#MaterialCode").append($('<option></option>').val(DeletedMaterialCode).html(DeletedMaterialCode + "-" + DeletedMaterialName));
|
||
DeletedMaterialCode = '';
|
||
DeletedMaterialName = '';
|
||
}
|
||
|
||
for (i = 2; i <= rows; i++) {
|
||
|
||
//var j=1;
|
||
$.each(Material[i], function(idx, obj) {
|
||
|
||
// j=j+1;
|
||
var materialCode = $('#materialCode' + i);
|
||
|
||
|
||
|
||
|
||
if (obj.materialCode == materialCode) {
|
||
$("#MaterialCode").val('');
|
||
} else {
|
||
$("#MaterialCode").append($('<option></option>').val(obj.MaterialCode).html(obj.MaterialCode + "-" + obj.MaterialName));
|
||
|
||
}
|
||
|
||
|
||
});
|
||
|
||
|
||
|
||
|
||
} // For Binding DepartmentName
|
||
$.each(y, function(idx, obj) {
|
||
if (obj.ReqNo === id) {
|
||
$("#deptName").val(obj.DepartmentName);
|
||
$("#CostCenter").val(obj.CostCenterCode);
|
||
if (obj.Service_Period != '' && obj.Service_Period != null) {
|
||
$("#Frequency").val(obj.Service_Period);
|
||
$("#FrequencyNo").val(obj.NumberOfService);
|
||
|
||
} else {
|
||
var text = 'One Time';
|
||
$("#Frequency").val(text);
|
||
$("#FrequencyNo").val(1);
|
||
}
|
||
}
|
||
});
|
||
$("#AvlBudAmt").val(parseFloat(AvlBudAmt).toFixed(2));
|
||
// For Binding Material list center for the selected Requistion Number
|
||
|
||
$("#MaterialCode").append($('<option></option>').val("0").html("Select Material Code"));
|
||
var isAdded = "0";
|
||
for (i = 0; i < Material.length; i++) {
|
||
$.each(Material[i], function(idx, obj) {
|
||
|
||
if (obj.ReqNo === id) {
|
||
|
||
$.each(SelectedMaterialList.Mat, function(idx1, el) {
|
||
if (id == el.ReqNo) {
|
||
|
||
if (el.materialCode == obj.MaterialCode) {
|
||
isAdded = "1";
|
||
return false;
|
||
} else {
|
||
isAdded = "0";
|
||
}
|
||
|
||
}
|
||
});
|
||
|
||
|
||
if (isAdded == "0") {
|
||
|
||
|
||
$("#MaterialCode").append($('<option></option>').val(obj.MaterialCode).html(obj.MaterialCode + "-" + obj.MaterialName));
|
||
}
|
||
|
||
}
|
||
|
||
|
||
});
|
||
}
|
||
} else {
|
||
alert('Please select the Requisition Number');
|
||
return false;
|
||
}
|
||
id = '';
|
||
|
||
});
|
||
|
||
$(document).ready(function() {
|
||
$("#EDITSERVICE").on("shown.bs.modal", function(e) {
|
||
|
||
|
||
var AvlBudAmt = '<?php echo $AvlAmount ?>';
|
||
|
||
AvlBudAmt = '<?php echo number_format($AvlAmount + $TotalBasicAmount, 2, '.', '') ?>';
|
||
|
||
userid = $(e.relatedTarget).data('userid');
|
||
|
||
var tr = document.getElementById(userid);
|
||
var cellval = tr.cells;
|
||
var id = $('#Reqnumber' + userid).val();
|
||
|
||
$('#EditAvlBudAmt').val(AvlBudAmt);
|
||
$('#EditReqNo').val($('#Reqnumber' + userid).val());
|
||
$('#EditdeptName').val($('#departmentName' + userid).val());
|
||
$("#EditCostCenter").val($('#costCode' + userid).val());
|
||
|
||
|
||
$('#EditItemName').val($('#materialName' + userid).val());
|
||
$('#EditUOM').val($('#uom' + userid).val());
|
||
$('#EditPer').val($('#per' + userid).val());
|
||
$('#EditQuantity').val($('#quantity' + userid).val());
|
||
RequistQuantity = $('#quantity' + userid).val();
|
||
$('#EditRate').val($('#itemRate' + userid).val());
|
||
$('#txtEditBasicValue').val(cellval[8].innerHTML);
|
||
$('#EditCgst').val($('#Cgst' + userid).val());
|
||
$('#EditSgst').val($('#Sgst' + userid).val());
|
||
$('#EditIgst').val($('#Igst' + userid).val());
|
||
$('#EditAfterCgst').val($('#AfterCgst' + userid).val());
|
||
$('#EditAfterSgst').val($('#AfterSgst' + userid).val());
|
||
$('#EditAfterIgst').val($('#AfterIgst' + userid).val());
|
||
|
||
$('#EditOtheritemDescription').val($('#OtherServiceDescription' + userid).val());
|
||
|
||
var res = $('#OtherServiceDescription' + userid).val();
|
||
|
||
|
||
|
||
if (res == '') {
|
||
$('#EditotherDescription').hide();
|
||
} else {
|
||
$('#EditotherDescription').show();
|
||
}
|
||
|
||
|
||
|
||
if ($('#FrequencyValue' + userid).val() == 1) {
|
||
$('#EditFrequency').val($('#Frequency' + userid).val());
|
||
$("#EditFrequencyNo").val(1);
|
||
} else {
|
||
$('#EditFrequency').val($('#Frequency' + userid).val());
|
||
$("#EditFrequencyNo").val($('#FrequencyValue' + userid).val());
|
||
}
|
||
|
||
$('#EditTotalOrderValue').val(cellval[10].innerHTML);
|
||
$('#EditOtherAllowances').val($('#OtherAmt' + userid).val());
|
||
tinyMCE.get('EdittxtSpcialInstruction').setContent($('#ItemDescription' + userid).val());
|
||
RequistQuantity = $('#quantity' + userid).val();
|
||
|
||
|
||
|
||
$("#EditMaterialCode").empty();
|
||
$("#EditMaterialCode").append($('<option></option>')
|
||
.val($('#materialCode' + userid).val())
|
||
.html($('#materialCode' + userid).val() + "-" + $('#materialName' + userid).val())
|
||
.prop('selected', true)
|
||
);
|
||
// Make the select element read-only (disable it)
|
||
$("#EditMaterialCode").prop('disabled', true);
|
||
|
||
|
||
|
||
// For Binding Material list center for the selected Requistion Number
|
||
var Material = <?php echo json_encode($MaterialList, JSON_PRETTY_PRINT) ?>;
|
||
|
||
var isAdded = "0";
|
||
for (i = 0; i < Material.length; i++) {
|
||
$.each(Material[i], function(idx, obj) {
|
||
|
||
if (obj.ReqNo === id) {
|
||
|
||
$.each(SelectedMaterialList.Mat, function(idx1, el) {
|
||
if (id == el.ReqNo) {
|
||
|
||
if (el.materialCode == obj.MaterialCode) {
|
||
|
||
isAdded = "1";
|
||
return false;
|
||
} else {
|
||
isAdded = "0";
|
||
}
|
||
|
||
}
|
||
|
||
|
||
});
|
||
|
||
|
||
if (isAdded == "0") {
|
||
|
||
$("#EditMaterialCode").append($('<option></option>').val(obj.MaterialCode).html(obj.MaterialCode + "-" + obj.MaterialName));
|
||
}
|
||
|
||
}
|
||
|
||
|
||
});
|
||
}
|
||
|
||
});
|
||
|
||
|
||
|
||
|
||
|
||
$("#VIEWSERVICE").on("shown.bs.modal", function(e) {
|
||
|
||
userid = $(e.relatedTarget).data('userid');
|
||
var AvlBudAmt = '<?php echo $AvlAmount ?>';
|
||
|
||
AvlBudAmt = '<?php echo number_format($AvlAmount + $TotalBasicAmount, 2, '.', '') ?>';
|
||
var tr = document.getElementById(userid);
|
||
var cellval = tr.cells;
|
||
var id = $('#Reqnumber' + userid).val();
|
||
$('#ViewPer').val($('#per' + userid).val());
|
||
$('#ViewReqNo').val($('#Reqnumber' + userid).val());
|
||
$('#ViewdeptName').val($('#departmentName' + userid).val());
|
||
$("#ViewCostCenter").val($('#costCode' + userid).val());
|
||
$('#ViewAvlBudAmt').val(AvlBudAmt);
|
||
|
||
$('#ViewItemName').val($('#materialName' + userid).val());
|
||
$('#ViewUOM').val($('#uom' + userid).val());
|
||
$('#ViewQuantity').val($('#quantity' + userid).val());
|
||
RequistQuantity = $('#quantity' + userid).val();
|
||
$('#ViewRate').val($('#itemRate' + userid).val());
|
||
$('#txtViewBasicValue').val(cellval[8].innerHTML);
|
||
$('#ViewCgst').val($('#Cgst' + userid).val());
|
||
$('#ViewSgst').val($('#Sgst' + userid).val());
|
||
$('#ViewIgst').val($('#Igst' + userid).val());
|
||
$('#ViewAfterCgst').val($('#AfterCgst' + userid).val());
|
||
$('#ViewAfterSgst').val($('#AfterSgst' + userid).val());
|
||
$('#ViewAfterIgst').val($('#AfterIgst' + userid).val());
|
||
|
||
$('#ViewOtheritemDescription').val($('#OtherServiceDescription' + userid).val());
|
||
|
||
var res = $('#OtherServiceDescription' + userid).val();
|
||
|
||
if (res == '') {
|
||
$('#ViewotherDescription').hide();
|
||
} else {
|
||
$('#ViewotherDescription').show();
|
||
}
|
||
|
||
|
||
if ($('#FrequencyValue' + userid).val() == 1) {
|
||
$('#ViewFrequency').val($('#Frequency' + userid).val());
|
||
$("#ViewFrequencyNo").val(1);
|
||
} else {
|
||
$('#ViewFrequency').val($('#Frequency' + userid).val());
|
||
$("#ViewFrequencyNo").val($('#FrequencyValue' + userid).val());
|
||
}
|
||
|
||
$('#ViewTotalOrderValue').val(cellval[10].innerHTML);
|
||
$('#ViewOtherAllowances').val($('#OtherAmt' + userid).val());
|
||
|
||
tinyMCE.get('ViewtxtSpcialInstruction').setContent($('#ItemDescription' + userid).val());
|
||
RequistQuantity = $('#quantity' + userid).val();
|
||
|
||
|
||
|
||
$("#ViewMaterialCode").empty();
|
||
var Material = <?php echo json_encode($MaterialList, JSON_PRETTY_PRINT) ?>;
|
||
// For Binding Material list center for the selected Requistion Number
|
||
|
||
$("#ViewMaterialCode").append($('<option></option>').val($('#materialCode' + userid).val()).html($('#materialCode' + userid).val() + "-" + $('#materialName' + userid).val()));
|
||
|
||
var isAdded = "0";
|
||
for (i = 0; i < Material.length; i++) {
|
||
$.each(Material[i], function(idx, obj) {
|
||
|
||
if (obj.ReqNo === id) {
|
||
|
||
$.each(SelectedMaterialList.Mat, function(idx1, el) {
|
||
if (id == el.ReqNo) {
|
||
|
||
if (el.materialCode == obj.MaterialCode) {
|
||
|
||
isAdded = "1";
|
||
return false;
|
||
} else {
|
||
isAdded = "0";
|
||
}
|
||
|
||
}
|
||
|
||
|
||
});
|
||
|
||
|
||
if (isAdded == "0") {
|
||
|
||
//$("#ViewMaterialCode").append( $('<option></option>').val(obj.MaterialCode).html(obj.MaterialCode + "-" + obj.MaterialName));
|
||
}
|
||
|
||
}
|
||
|
||
|
||
});
|
||
}
|
||
|
||
});
|
||
});
|
||
|
||
$("#insuranceStatus").change(function() {
|
||
var InsNo = '<?php echo $InsuranceNumber; ?>';
|
||
|
||
if ($("#insuranceStatus").val() == "1") {
|
||
$('#insuranceTxtDiv').show();
|
||
$('#InsuranceNumber').val('Yes');
|
||
} else {
|
||
$('#insuranceTxtDiv').hide();
|
||
$('#InsuranceNumber').val('');
|
||
}
|
||
});
|
||
|
||
function splpoupdate() {
|
||
// alert();
|
||
var formData = new FormData();
|
||
|
||
var file = $("#imag").prop('files')[0];
|
||
var param1 = $('#hidebillno').val();
|
||
var param2 = $('#hideoldfile').val();
|
||
|
||
// var param3 =$('#ChallanInvNo').val();
|
||
// var param4 =$('#Date').val();
|
||
// var param5 =$('#VehicleNo').val();
|
||
// var param6 =$('#CourierNo').val();
|
||
|
||
//var param7 =$('#hideoldfile').val();
|
||
|
||
|
||
|
||
|
||
var filename = $("#imag").val();
|
||
filename = filename.split('\\');
|
||
|
||
formData.append('file', file);
|
||
formData.append('param1', param1);
|
||
formData.append('param2', param2);
|
||
// formData.append('param3',param3);
|
||
// formData.append('param4',param4);
|
||
// formData.append('param5',param5);
|
||
// formData.append('param6',param6);
|
||
|
||
// $('.content').loader('show');
|
||
$('#loader').show();
|
||
$.ajax({
|
||
data: formData,
|
||
type: "POST",
|
||
url: "<?php echo base_url() ?>servicepurchaseorder/uploadfile",
|
||
cache: false,
|
||
contentType: false,
|
||
processData: false,
|
||
success: function(data) {
|
||
if (data) {
|
||
alert(data);
|
||
$('#loader').hide();
|
||
window.location.reload();
|
||
//$('#spl').find('td').eq(1).text(filename[2]);
|
||
$('#EditServiceSplPOModel').modal('hide');
|
||
}
|
||
|
||
}
|
||
});
|
||
|
||
}
|
||
|
||
function filecheck() {
|
||
var sizef = document.getElementById('imag').files[0].size;
|
||
var file = $('#imag').val();
|
||
|
||
if (file != '' && sizef < 2100000) { // alert('Your file added successfully');
|
||
} else {
|
||
alert('Sorry Your File is Large To 2MB');
|
||
$('#imag').val('');
|
||
}
|
||
}
|
||
</script>
|
||
|
||
<script>
|
||
function fileupload(counter) {
|
||
var formData = new FormData();
|
||
var file = $("#images" + counter).prop('files')[0];
|
||
// console.log(file);
|
||
|
||
|
||
var PONO = $('#txtPONO').val();
|
||
// var igr =$('#hiddenigrno').val();
|
||
//alert(igr);
|
||
|
||
formData.append('file', file);
|
||
formData.append('PONO', PONO);
|
||
formData.append('count', counter);
|
||
// formData.append('igr',igr);
|
||
|
||
// $('.content').loader('show');
|
||
$('#loader').show();
|
||
$.ajax({
|
||
data: formData,
|
||
type: "POST",
|
||
url: "<?php echo base_url() ?>servicepurchaseorder/addfileuplod",
|
||
cache: false,
|
||
contentType: false,
|
||
processData: false,
|
||
success: function(data) {
|
||
if (data) {
|
||
alert(data);
|
||
window.location.reload();
|
||
// $('.content').loader('hide');
|
||
// $('#spl').find('td').eq(5).text(filename[2]);
|
||
$('#EditServiceSplPOModel').modal('hide');
|
||
}
|
||
|
||
}
|
||
});
|
||
}
|
||
|
||
var counter = 0;
|
||
var counterConstant = 0;
|
||
|
||
$("#addmorebutton").click(function() {
|
||
|
||
|
||
counter++;
|
||
|
||
var bill = <?php echo json_encode($getdata) ?>;
|
||
if (bill.length >= 5) {
|
||
|
||
alert("You have to upload five files only"); //this allows only 5 files;
|
||
return false;
|
||
} else {
|
||
var div = document.createElement('div');
|
||
div.id = "divid";
|
||
div.className = "row";
|
||
//alert(counter);
|
||
div.innerHTML = '<div class="form-row">' +
|
||
|
||
'<div class="form-group col">' +
|
||
'<label><br></label>' +
|
||
'<input type="file" name="browseFiles" id="images' + counter + '" onchange="Copyfilename(this.name); "><br>' +
|
||
'<button class="btn btn-success btn-sm add add_this" id="addbtn" onclick="addRow()">ADD</button>'
|
||
'</div>' +
|
||
'</div>' +
|
||
|
||
|
||
$('#newdiv').append(div);
|
||
|
||
|
||
$('#hidecounter').val(counter);
|
||
// $('#hideconstant').val(counterConstant);
|
||
|
||
if (counter > 1) {
|
||
alert("Add button click here"); //this allows only 5 files;
|
||
return false;
|
||
} else {
|
||
$('#addmorebutton').hide();
|
||
}
|
||
}
|
||
|
||
});
|
||
|
||
function addRow() {
|
||
//alert();
|
||
|
||
//var filec= $('#images'+counter).val();
|
||
|
||
|
||
|
||
var file = $('#images' + counter).val();
|
||
//alert("fgh"+file);
|
||
// return false;
|
||
|
||
if (file == '')
|
||
|
||
{
|
||
alert('File not found');
|
||
|
||
} else {
|
||
fileupload(counter);
|
||
}
|
||
|
||
}
|
||
|
||
function Copyfilename(id) {
|
||
|
||
var size = $('input[name=' + id + ']')[0].files[0].size;
|
||
|
||
var number = id.replace(/[^0-9]+/ig, "");
|
||
|
||
if (size > 2100000) {
|
||
//alert(id);
|
||
alert('Sorry Your File is Large To 2MB');
|
||
removeRow(id);
|
||
//$('input[name = browseFiles'+number+']').val(' ');
|
||
} else {
|
||
var name = $('input[name=' + id + ']')[0].files[0].name;
|
||
//alert(name);
|
||
$("#maint_filename" + number).val(name);
|
||
}
|
||
}
|
||
|
||
$('#IsOpenOrder').change(function() {
|
||
if (this.checked) {
|
||
$('#ServiceQuantity').val(0);
|
||
$('#ServiceQuantity').removeAttr('required');
|
||
$('#ServiceQuantity').attr('readonly', true);
|
||
} else {
|
||
$('#ServiceQuantity').val('');
|
||
$('#ServiceQuantity').removeAttr('readonly');
|
||
$('#ServiceQuantity').attr('required', true);
|
||
|
||
}
|
||
});
|
||
</script>
|