PO Create sections only

This commit is contained in:
VE10-Sanjeev 2024-08-31 03:27:40 +00:00
parent 481d6b1cfe
commit 86fb6b5099
7 changed files with 2598 additions and 2760 deletions

View File

@ -563,7 +563,7 @@ $mpdf->use_kwt = true;
$ReqDetails = $this->purchaseorder_model->getRequistDetails($ReqArray);
$data['RequistionDetails'] = $ReqDetails;
$Status = "";
foreach ($data['RequistionDetails'] as $ReqDet) {
$Status = $ReqDet->Status;

View File

@ -1074,28 +1074,21 @@ if (!empty($getlogpodtl)) {
</select>
</div>
</div>
<div class="form-row">
<div align="right">
<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) { ?>
<div class="form-group col-md-12">
<?php if ($PONOStatus == REQITEM_Emergency_PO_CREATED) { ?>
<div class="form-group col-md-3 col-md-offset-7" align="right" style="padding:5px">
<input type="checkbox" id="IsOpenOrder" name="IsOpenOrder" value="1" <?php echo $isChecked ? 'checked' : ''; ?>> IS THIS OPEN ORDER FORMAT
</div>
<div class="form-group col-md-1" align="right">
<?php } else { ?>
<div class="form-group col-md-12" align="right">
<?php } ?>
<a data-toggle="modal"><button type="submit" onclick="myFunction();" class="btn btn-success" id="abcd">Select Line Item</button> </a>
</div>
</div>
<input type="checkbox" id="IsOpenOrder" name="IsOpenOrder" value="1" <?php echo $isChecked ? 'checked' : ''; ?>> IS THIS OPEN ORDER FORMAT
<?php } ?>
</div>
<div class="form-row">
<table id="ServiceTable" class="table table-striped table-hover mb-0" style="font-size:12px;">
<thead>
<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">
<table id="ServiceTable" class="table table-striped table-hover mb-0" style="font-size:12px;">
<thead>
<tr>
<th>SNo</th>
<th>Requisition No</th>
@ -1108,11 +1101,11 @@ if (!empty($getlogpodtl)) {
<th>Tax Amount <?php echo "($INRSYM)" ?></th>
<th>Total Order Amount <?php echo "($INRSYM)" ?></th>
<!-- <th>Actual Quantity</th>
<th>Received Quantity</th>
<th>Pending Quantity</th> -->
<th>Received Quantity</th>
<th>Pending Quantity</th> -->
<th>Action</th>
</tr>
</thead>
</thead>
<tbody id='ServiceAppend'>
<?php
@ -1228,8 +1221,9 @@ if (!empty($getlogpodtl)) {
}
?>
</tbody>
</table>
</div>
</table>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-2">
<label>Basic Amount <?php echo "($INRSYM)" ?> </label>
@ -1279,14 +1273,16 @@ if (!empty($getlogpodtl)) {
<!--start new fields 1 sep-->
<div class="form-group col-md-12">
<label>Description Of Service <span class="text-danger">*</label>
<div>
<?php
$data = array('name' => 'editdescofpo', 'value' => set_value('editdescofpo', strip_tags($DescriptionOfPo)), 'id' => 'editdescofpo', 'class' => 'form-control', 'rows' => '3', 'cols' => '40');
echo form_textarea($data);
?>
</div>
</div><!--end new fields 1 sep-->
</div>
<div class="form-row">
<div class="form-group col-md-12">
<label>Scope Of Work</label>
<?php
@ -1294,8 +1290,8 @@ if (!empty($getlogpodtl)) {
echo form_textarea($data);
?>
</div>
</div>
<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;">
@ -1447,12 +1443,12 @@ if (!empty($getlogpodtl)) {
<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-cancel Save" ID="Cancel" href="<?php echo base_url() . 'purchaseorderListing'; ?>">&nbsp;&nbsp;<span class="bold">Cancel</span></a>
<a class="btn btn-success Save" ID="Cancel" href="<?php echo base_url() . 'purchaseorderListing'; ?>">&nbsp;&nbsp;<span class="bold">Cancel</span></a>
<?php if ($PONOStatus == PO_DRAFT) { ?>
<a class="btn btn-success Save" ID="Save" onclick="Save(0)">&nbsp;&nbsp;<span class="bold">Save</span></a>
<?php } ?>
<a class="btn btn-success Save" ID="Submit" onclick="Save(1)">&nbsp;&nbsp;<span class="bold">Submit</span></a>
<a class="btn btn btn-soft-primary waves-effect waves-light Save" ID="Save" onclick="Save(4)">&nbsp;&nbsp;<span class="bold">Approve</span></a>
<a class="btn btn-success Save" ID="Save" onclick="Save(4)">&nbsp;&nbsp;<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'; ?>">&nbsp;&nbsp;<span class="bold">OK</span></a>
<a class="btn btn-success Save" ID="Submit" onclick="Save(3)">&nbsp;&nbsp;<span class="bold">Submit</span></a>

File diff suppressed because it is too large Load Diff

View File

@ -8,6 +8,8 @@ $DeliverSchedule = '';
$DeliverOption = '';
$RowCount = 0;
$PrePOFile = '';
$Reqon = '';
$RequesterName = '';
if (!empty($MaxPODate)) {
foreach ($MaxPODate as $date) {
@ -924,7 +926,6 @@ if (!empty($INRSYMBOL)) {
?>
<div class="form-row">
<div class="form-group col-md-12">
<div class="form-group col-md-3">
<label>Requistion No</label>
<?php
@ -958,7 +959,7 @@ if (!empty($INRSYMBOL)) {
endforeach;
}
echo form_dropdown('drpSupplier', $options, set_value('drpSupplier', $SupId), 'id="drpSupplier"', 'required="true"', 'class="form-control select2', 'disabled=disabled', 'readonly=readonly');
echo form_dropdown('drpSupplier', $options, set_value('drpSupplier', $SupId), 'id="drpSupplier" required="true" class="form-control select2" disabled readonly');
?>
</div>
@ -971,7 +972,6 @@ if (!empty($INRSYMBOL)) {
?>
</div>
</div>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-3">
@ -1094,8 +1094,9 @@ if (!empty($INRSYMBOL)) {
endforeach;
}
// $revenuesubtype
echo form_dropdown('PoTypeOptions', $optionsPO, set_value('PoTypeOptions'), 'id="PoTypeOptions" required="true" class="form-control select2"');
echo form_dropdown('PoTypeOptions', $optionsPO, $revenuesubtype, set_value('PoTypeOptions'), 'id="PoTypeOptions"', 'required="true"', 'class="form-control');
?>
@ -1137,7 +1138,7 @@ if (!empty($INRSYMBOL)) {
endforeach;
}
echo form_dropdown('PaymentTerms', $optionsPay, set_value('PaymentTerms'), 'id="PaymentTerms"', 'required="true"', 'class="form-control select2');
echo form_dropdown('PaymentTerms', $optionsPay, set_value('PaymentTerms'), 'id="PaymentTerms" required="true" class="form-control select2"');
?>
@ -1157,7 +1158,7 @@ if (!empty($INRSYMBOL)) {
<label for="insurance">Insurance<span class="text-danger">*</span></label>
<?php
$optionsnew = array('1' => 'Yes', '0' => 'No');
echo form_dropdown('insurancestatus', $optionsnew, set_value('insurancestatus'), 'id="insurancestatus"', 'required="true"', 'class="form-control select2', 'readonly ="true"');
echo form_dropdown('insurancestatus', $optionsnew, set_value('insurancestatus'), 'id="insurancestatus" required="true" class="form-control select2"');
?>
</div>
<div class="form-group col-md-3" id="InsuranceNumberdiv" style="display:block;">
@ -1171,7 +1172,7 @@ if (!empty($INRSYMBOL)) {
</div>
<div class="form-group col-md-3">
<label for="BudgetType">Budget Type<span class="text-danger">*</span></label>
<select id='BudgetType' name='BudgetType'>
<select id='BudgetType' name='BudgetType' class="form-control">
<?php if ($BudgetType == 'CAPITAL') {
$opt1 = 'CAPITAL';
$opt2 = 'REVENUE';
@ -1192,8 +1193,10 @@ if (!empty($INRSYMBOL)) {
</div>
</div>
<div class="form-row">
<table id="revenueTax" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;">
<thead style="background-color: #ddd;">
<div class="table-responsive">
<table id="revenueTax" class="table table-striped table-hover mb-0" style="font-size:12px;">
<thead>
<tr>
<th>SNo</th>
<th>Requisition No</th>
@ -1317,6 +1320,7 @@ if (!empty($INRSYMBOL)) {
?>
</tbody>
</table>
</div>
</div>
<br>
<div class="form-row">
@ -1672,7 +1676,7 @@ if (!empty($INRSYMBOL)) {
endforeach;
}
echo form_dropdown('EditDiscountType', $options, set_value('EditDiscountType'), 'id="EditDiscountType"', 'class="form-control"');
echo form_dropdown('EditDiscountType', $options, set_value('EditDiscountType'), 'id="EditDiscountType" class="form-control"');
?>
</div>
@ -1714,7 +1718,7 @@ if (!empty($INRSYMBOL)) {
endforeach;
}
echo form_dropdown('drpEditFreight', $options, set_value('drpEditFreight'), 'id="drpEditFreight"', 'class="form-control "');
echo form_dropdown('drpEditFreight', $options, set_value('drpEditFreight'), 'id="drpEditFreight" class="form-control "');
?>
</div>
@ -1765,7 +1769,7 @@ if (!empty($INRSYMBOL)) {
endforeach;
}
echo form_dropdown('EditPackagingType', $options, set_value('EditPackagingType'), 'id="EditPackagingType"', 'class="form-control "');
echo form_dropdown('EditPackagingType', $options, set_value('EditPackagingType'), 'id="EditPackagingType" class="form-control "');
?>
</div>
@ -2517,15 +2521,15 @@ if (!empty($INRSYMBOL)) {
// < !--script for table, It works uned the datatable plugin-- >
$(function() {
$('#revenueTax').DataTable({
"paging": false,
"lengthChange": false,
"searching": false,
"ordering": false,
// "info": true,
"autoWidth": true
// $('#revenueTax').DataTable({
// "paging": false,
// "lengthChange": false,
// "searching": false,
// "ordering": false,
// // "info": true,
// "autoWidth": true
});
// });
});
//If others is the payment terms , display mandatory field
$("#PaymentTerms").change(function() {

File diff suppressed because it is too large Load Diff

View File

@ -29,7 +29,7 @@ if (!empty($INRSYMBOL)) {
<style>
#packagingcalmodel {
/* #packagingcalmodel {
margin-top: 200px;
z-index: 1080 !important;
}
@ -42,9 +42,9 @@ if (!empty($INRSYMBOL)) {
#ExciseDutyCalModel {
margin-top: 200px;
z-index: 1080 !important;
}
} */
#VatCalModel {
/* #VatCalModel {
margin-top: 200px;
z-index: 1080 !important;
}
@ -56,7 +56,7 @@ if (!empty($INRSYMBOL)) {
.modal {
padding-right: 30% ! important;
}
} */
</style>
<!-- Rich text -->
@ -166,22 +166,22 @@ if (!empty($INRSYMBOL)) {
// alert(new Date(year,month,day));
$(function() {
$("#PODate").datepicker({
minDate: d,
maxDate: 'now',
dateFormat: 'dd-mm-yy',
changeMonth: true,
changeYear: true,
yearRange: '-100:+0'
});
// $("#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'
});
// $("#Deliverydt").datepicker({
// minDate: 'now',
// dateFormat: 'dd-mm-yy',
// changeMonth: true,
// changeYear: true,
// yearRange: '0:+10'
// });
$('#PoTypeOptions').change(function() {
var potypeval = $('#PoTypeOptions').val();
@ -1868,12 +1868,14 @@ if (!empty($INRSYMBOL)) {
</div>
<div class="form-group col-md-3" id="Deliverydtdiv">
<label>Delivery Date<span class="badge mandatory">*</span></label>
<div>
<input type="date" class="form-control num" data-provide="datepicker" data-date-format="dd/mm/yyyy" data-date-autoclose="true" id="Deliverydt" name="Deliverydt" data-date-end-date="<?= date('d/m/Y'); ?>" required autocomplete="off" value="<?= date('d/m/Y'); ?>">
<!-- <div>
<?php
$data = array('name' => 'Deliverydt', 'value' => set_value('Deliverydt', $CurrentDate), 'id' => 'Deliverydt', 'class' => 'form-control num', 'required' => 'true', 'onkeypress' => 'return false;');
echo form_input($data);
// $data = array('name' => 'Deliverydt', 'value' => set_value('Deliverydt', $CurrentDate), 'id' => 'Deliverydt', 'class' => 'form-control num', 'required' => 'true', 'onkeypress' => 'return false;');
// echo form_input($data);
?>
</div>
</div> -->
</div>
<div class="form-group col-md-3" id="Schedulediv" style="display:none;">
<label>Schedule By<span class="badge mandatory">*</span></label>
@ -1896,12 +1898,14 @@ if (!empty($INRSYMBOL)) {
<div class="form-row">
<div class="form-group col-md-3">
<label>Purchase Order Date</label>
<div>
<input type="date" class="form-control num" data-provide="datepicker" data-date-format="dd/mm/yyyy" data-date-autoclose="true" id="PODate" name="PODate" data-date-end-date="<?= date('d/m/Y'); ?>" required autocomplete="off" value="<?= date('d/m/Y'); ?>">
<!-- <div>
<?php
$data = array('name' => 'PODate', 'value' => set_value('PODate', $CurrentDate), 'id' => 'PODate', 'class' => 'form-control num', 'required' => 'true', 'onkeypress' => 'return false;');
echo form_input($data);
?>
</div>
</div> -->
</div>
<div class="form-group col-md-3">
<label>Mode Of Shipment</label>
@ -2154,8 +2158,9 @@ if (!empty($INRSYMBOL)) {
</div>
</div>
<div class="form-row">
<div class="form-group col-md-4 col-md-offset-8"><br />
<input type="file" name="POFile" id="POFile"><br>
<div class="form-group col-md-12">
<div align="right" style="padding-right:10px">
<input type="file" name="POFile" id="POFile"><br>
<input type="hidden" name="txtPoRange" id="txtPoRange" />
<input type="hidden" name="isEdit" id="isEdit" value="0" />
<input type="hidden" name="txtStatus" id="txtStatus" />
@ -2163,10 +2168,11 @@ if (!empty($INRSYMBOL)) {
<input type="hidden" name="txtDeletedRow" id="txtDeletedRow" />
<input type="hidden" name="Budget" id="Budget" />
<div class="btn-container" style="text-align: right;">
<a class="btn btn-reset Save" ID="Cancel" onclick="Reset();">&nbsp;&nbsp;<span class="bold">Reset</span></a>
<a class="btn btn-success Save" ID="Cancel" onclick="Reset();">&nbsp;&nbsp;<span class="bold">Reset</span></a>
<a class="btn btn-success Save" ID="Save" onclick="Save(0)">&nbsp;&nbsp;<span class="bold">Save as Draft</span></a>
<a class="btn btn-success Submit" ID="Submit" onclick="Save(1)">&nbsp;&nbsp;<span class="bold">Submit</span></a>
</div>
</div>
</div>
</div><br />
</div>
</div> <!-- end card body-->
@ -2341,7 +2347,7 @@ if (!empty($INRSYMBOL)) {
<div class="form-row">
<div class="col-md-3">
<div class="form-group col-md-3">
<label>Req No<span class="text-danger" style="color:red;text-align:right;background-color: #fff;">*</span></label>
<div>
<?php
@ -2352,109 +2358,99 @@ if (!empty($INRSYMBOL)) {
endforeach;
}
echo form_dropdown('ReqNo', $RL, set_value('ReqNo'), 'id="ReqNo"', 'class="form-control"');
echo form_dropdown('ReqNo', $RL, set_value('ReqNo'), 'id="ReqNo" class="form-control"');
?>
</div>
</div>
<div class="col-md-3">
<div class="form-group col-md-3">
<label>Department Name</label>
<div class="form-group">
<?php
$data = array('name' => 'deptName', 'value' => set_value('deptName'), 'id' => 'deptName', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="col-md-3">
<div class="form-group col-md-3">
<label>Cost Center Code</label>
<div class="form-group">
<?php
$data = array('name' => 'CostCenter', 'value' => set_value('CostCenter'), 'id' => 'CostCenter', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="col-md-3">
<div class="form-group col-md-3">
<label>Avl Bud Amt <?php echo "($INRSYM)" ?></label>
<div class="form-group">
<?php
$data = array('name' => 'AvlBudAmt', 'value' => set_value('AvlBudAmt'), 'id' => 'AvlBudAmt', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div>
<div class="form-row">
<div class="col-md-2">
<div class="form-group col-md-2">
<label>Item Code<span class="text-danger" style="color:red;text-align:right;background-color: #fff;">*</span></label>
<div>
<?php
$options = array("0" => 'Item Code');
echo form_dropdown('MaterialCode', $options, set_value('MaterialCode'), 'id="MaterialCode"', 'class="form-control"');
echo form_dropdown('MaterialCode', $options, set_value('MaterialCode'), 'id="MaterialCode" class="form-control"');
?>
</div>
</div>
<div class="col-md-2">
<div class="form-group col-md-2">
<label>Item Name</label>
<div class="form-group">
<?php
$data = array('name' => 'ItemName', 'value' => set_value('ItemName'), 'id' => 'ItemName', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="col-md-2">
<div class="form-group col-md-1">
<label>UOM</label>
<div class="form-group">
<?php
$data = array('name' => 'UOM', 'value' => set_value('UOM'), 'id' => 'UOM', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="col-md-6" style="padding:0px;">
<div class="col-md-3">
<div class="form-group col-md-2">
<label>Qty<span class="text-danger" style="color:red;text-align:right;background-color: #fff;">*</span></label>
<div class="form-group">
<?php
$data = array('name' => 'Quantity', 'value' => set_value('Quantity'), 'id' => 'Quantity', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'change()');
echo form_input($data);
?>
</div>
</div>
<div class="col-md-3">
<div class="form-group col-md-1">
<label><?php echo "Rate ($INRSYM)"; ?><span class="text-danger" style="color:red;text-align:right;background-color: #fff;">*</span></label>
<!-- <label>Rate</label> -->
<div class="form-group">
<?php
$data = array('name' => 'Rate', 'value' => set_value('Rate'), 'id' => 'Rate', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'change()');
echo form_input($data);
?>
</div>
</div>
<div class="col-md-3">
<div class="form-group col-md-2">
<label>Per</label> <?php
$data = array('name' => 'AddPer', 'value' => set_value('AddPer'), 'id' => 'AddPer', 'class' => 'form-control');
echo form_input($data); ?>
</div>
<div class="col-md-3">
<div class="form-group col-md-2">
<label><?php echo "Basic Amt ($INRSYM)"; ?></label>
<!-- <label>Basic Amount</label> -->
<div class="form-group">
<?php
$data = array('name' => 'txtBasicValue', 'value' => set_value('txtBasicValue'), 'id' => 'txtBasicValue', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div>
</div>
<div class="form-row" style="padding:0px;">
<div class="form-group col-md-4"></div>
@ -2474,7 +2470,7 @@ if (!empty($INRSYMBOL)) {
endforeach;
}
echo form_dropdown('DiscountType', $options, set_value('DiscountType'), 'id="DiscountType"', 'class="form-control"');
echo form_dropdown('DiscountType', $options, set_value('DiscountType'), 'id="DiscountType" class="form-control"');
?>
</div>
@ -2515,7 +2511,7 @@ if (!empty($INRSYMBOL)) {
endforeach;
}
echo form_dropdown('PackagingType', $options, set_value('PackagingType'), 'id="PackagingType"', 'class="form-control "');
echo form_dropdown('PackagingType', $options, set_value('PackagingType'), 'id="PackagingType" class="form-control "');
?>
</div>
@ -2554,7 +2550,7 @@ if (!empty($INRSYMBOL)) {
endforeach;
}
echo form_dropdown('drpFreight', $options, set_value('drpFreight'), 'id="drpFreight"', 'class="form-control "');
echo form_dropdown('drpFreight', $options, set_value('drpFreight'), 'id="drpFreight" class="form-control "');
?>
</div>
@ -2608,10 +2604,9 @@ if (!empty($INRSYMBOL)) {
</div>
<!-- sgst -->
<div class="form-row">
<div class="form-group col-md-8"></div>
<div id="SGSTAddModel">
<div class="form-group col-md-2">
<div class="form-row" id="SGSTAddModel">
<div class="form-group col-md-8"></div>
<div class="form-group col-md-2" >
<label>SGST In %</label>
<?php
$data = array('name' => 'Sgst', 'value' => set_value('Sgst', 0), 'id' => 'Sgst', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'change();');
@ -2625,8 +2620,9 @@ if (!empty($INRSYMBOL)) {
echo form_input($data);
?>
</div>
</div>
<div id="IGSTAddModel" style="display:none;">
</div>
<div class="form-row" id="IGSTAddModel" style="display:none;">
<div class="form-group col-md-8"></div>
<div class="form-group col-md-2">
<label>IGST In %</label>
<?php
@ -2641,7 +2637,6 @@ if (!empty($INRSYMBOL)) {
echo form_input($data);
?>
</div>
</div>
</div>
<div class="form-row">
@ -2677,10 +2672,6 @@ if (!empty($INRSYMBOL)) {
</div>
<br /><br />
</div>
<div class="modal-footer">
<a class="btn btn-secondary waves-effect" data-dismiss="modal" value="Cancel">Cancel</a>&nbsp;&nbsp;&nbsp;&nbsp;
@ -2706,7 +2697,7 @@ if (!empty($INRSYMBOL)) {
<div class="modal-body p-4">
<div class="form-row">
<div class="form-group col-md-3">
<label>Req No<span class="text-danger" style="color:red;text-align:right;background-color: #fff;">*</span></label>
<label>Req No<span class="text-danger">*</span></label>
<div>
<?php
@ -2753,12 +2744,11 @@ if (!empty($INRSYMBOL)) {
$options = array("0" => 'Item Code');
echo form_dropdown('EditMaterialCode', $options, set_value('EditMaterialCode'), 'id="EditMaterialCode"', 'class="form-control"');
echo form_dropdown('EditMaterialCode', $options, set_value('EditMaterialCode'), 'id="EditMaterialCode" class="form-control"');
?>
</div>
</div>
<div class="form-group col-md-2">
<label>Item Name</label>
<div class="form-group">
@ -2777,7 +2767,6 @@ if (!empty($INRSYMBOL)) {
?>
</div>
</div>
<div class="col-md-6" style="padding: 0px;">
<div class="form-group col-md-3">
<label>Quantity<span class="text-danger" style="color:red;text-align:right;background-color: #fff;">*</span></label>
<div class="form-group">
@ -2810,7 +2799,7 @@ if (!empty($INRSYMBOL)) {
?>
</div>
</div>
</div>
</div>
<div class="form-row">
@ -2831,7 +2820,7 @@ if (!empty($INRSYMBOL)) {
endforeach;
}
echo form_dropdown('EditDiscountType', $options, set_value('EditDiscountType'), 'id="EditDiscountType"', 'class="form-control"');
echo form_dropdown('EditDiscountType', $options, set_value('EditDiscountType'), 'id="EditDiscountType" class="form-control"');
?>
</div>
@ -2873,7 +2862,7 @@ if (!empty($INRSYMBOL)) {
endforeach;
}
echo form_dropdown('EditPackagingType', $options, set_value('EditPackagingType'), 'id="EditPackagingType"', 'class="form-control "');
echo form_dropdown('EditPackagingType', $options, set_value('EditPackagingType'), 'id="EditPackagingType" class="form-control "');
?>
</div>
@ -2915,7 +2904,7 @@ if (!empty($INRSYMBOL)) {
endforeach;
}
echo form_dropdown('drpEditFreight', $options, set_value('drpEditFreight'), 'id="drpEditFreight"', 'class="form-control "');
echo form_dropdown('drpEditFreight', $options, set_value('drpEditFreight'), 'id="drpEditFreight" class="form-control "');
?>
</div>
@ -2949,7 +2938,7 @@ if (!empty($INRSYMBOL)) {
</div>
</div>
<div class="form-row">
<div class="col-md-8"></div>
<div class="form-group col-md-8"></div>
<div class="form-group col-md-2">
<label>CGST In %</label>
<div class="form-group">
@ -2971,9 +2960,9 @@ if (!empty($INRSYMBOL)) {
</div>
<div class="form-row" style="text-align:left;">
<div id="SGSTEditModel">
<div class="col-md-8"></div>
<div class="form-row" id="SGSTEditModel">
<div class="form-group col-md-8"></div>
<div class="form-group col-md-2">
<label>SGST In %</label>
<div class="form-group">
@ -2992,7 +2981,7 @@ if (!empty($INRSYMBOL)) {
?>
</div>
</div>
</div>
</div>
<div class="form-row" style="text-align:left;">
<div id="IGSTEditModel" style="display:none;">
@ -3019,8 +3008,8 @@ if (!empty($INRSYMBOL)) {
</div>
<div class="form-row">
<div class="col-md-8"></div>
<div class="col-md-4">
<div class="form-group col-md-8"></div>
<div class="form-group col-md-4">
<label> Insurance Amt <?php echo "($INRSYM)" ?> (if Any)</label>
<div class="form-group">
<?php
@ -3033,8 +3022,8 @@ if (!empty($INRSYMBOL)) {
</div>
<div class="form-row">
<div class="col-md-8"></div>
<div class="col-md-4">
<div class="form-group col-md-8"></div>
<div class="form-group col-md-4">
<div class="form-group">
<label><?php echo "Total Order Amt ($INRSYM)"; ?></label>
<?php
@ -3068,7 +3057,7 @@ if (!empty($INRSYMBOL)) {
<script type="text/html" id="RevenueList">
<!-- <script type="text/html" id="RevenueList">
<tr id="<%=index%>">
<td align="left"><%=index%></td>
<td align="left"><%=ReqNo%></td>
@ -3084,7 +3073,7 @@ if (!empty($INRSYMBOL)) {
<a data-target='#EDITREVENUE' data-id="<%=index%>" data-userid="<%=index%>" data-toggle="modal" href="#EDITREVENUE"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit the <%=ReqNo%> Requisition details"></i>&nbsp;&nbsp;&nbsp;</a> <a href='#' onclick="DeleteRow('<%=index%>')" class="link" data-id="<%=index%>" data-userid="<%=index%>" id="Del"><span class="glyphicon glyphicon-trash"></span></a>
</td>
</tr>
</script>
</script> -->
<script>
var index = '1';
var userid = '';
@ -3292,21 +3281,50 @@ if (!empty($INRSYMBOL)) {
index = parseInt(index) + 1;
var template = jQuery("#RevenueList").html();
// var template = jQuery("#RevenueList").html();
$('#RevenueAppend').append(_.template(template, {
index: temp,
ReqNo: Reqnumber,
MaterialCode: materialCode,
MaterialName: materialName,
Quantity: quantity,
UOM: uom,
Rate: itemRate,
BasicAmount: basicval,
Taxvalue: TotalTaxValue,
TotalValue: TotalOrderValue
}));
// $('#RevenueAppend').append(_.template(template, {
// index: temp,
// ReqNo: Reqnumber,
// MaterialCode: materialCode,
// MaterialName: materialName,
// Quantity: quantity,
// UOM: uom,
// Rate: itemRate,
// BasicAmount: basicval,
// Taxvalue: TotalTaxValue,
// TotalValue: TotalOrderValue
// }));
// Define your template using ES6 template literals
var rowHtml = `
<tr id="${temp}">
<td align="left">${temp}</td>
<td align="left">${Reqnumber}</td>
<td align="left">${materialCode}</td>
<td align="left">${materialName}</td>
<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='#EDITREVENUE' data-id="${temp}" data-userid="${temp}" data-toggle="modal" href="#EDITREVENUE">
<i class="ri-pencil-fill" data-toggle="tooltip" title="Click here to view/Edit the ${Reqnumber} Requisition details"></i>
</a>
&nbsp;&nbsp;&nbsp;
<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 the target container
$('#RevenueAppend').append(rowHtml);
var theForm = $(".CreatePO");
@ -3793,26 +3811,25 @@ if (!empty($INRSYMBOL)) {
$(function() {
$('#revenueTax').DataTable({
"paging": false,
"lengthChange": false,
"searching": false,
"ordering": false,
// "info": true,
"autoWidth": false
});
// $('#revenueTax').DataTable({
// "paging": false,
// "lengthChange": false,
// "searching": false,
// "ordering": false,
// // "info": true,
// "autoWidth": false
// });
});
// 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").datepicker({
// minDate: 'now',
// dateFormat: 'mm/dd/yy',
// changeMonth: true,
// changeYear: true,
// yearRange: '0:+10'
// });
});
$('#Deliverydt').change(function() {

View File

@ -76,21 +76,21 @@ if (!empty($INRSYMBOL)) {
};
$(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'
});
// $("#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'
// });
$('#PoTypeOptions').change(function() {
var potypeval = $('#PoTypeOptions').val();
@ -116,66 +116,52 @@ if (!empty($INRSYMBOL)) {
document.getElementById("Date").checked = true;
$('#drpSupplier').change(function() {
var id = $('#drpSupplier').val();
var id = $('#drpSupplier').val();
console.log(id);
$("#SupAddress").val('');
var PaymentID = '';
$("#SupAddress").val('');
if (id != '0') {
var suppliers = <?php echo json_encode($Suplist, JSON_PRETTY_PRINT); ?>;
var payments = <?php echo json_encode($Payment, JSON_PRETTY_PRINT); ?>;
// Find the selected supplier and set address and PaymentID
$.each(suppliers, function(idx, supplier) {
if (supplier.SupplierID === id) {
PaymentID = supplier.PaymentID; // Set PaymentID
if (supplier.MSME) {
$("#SupAddress").val("MSME : " + supplier.MSME + "\n" + supplier.Address);
} else {
$("#SupAddress").val(supplier.Address);
}
console.log(PaymentID); // Debugging PaymentID value
}
});
if (id != '0') {
// Conditional logic for PaymentID
if (PaymentID === 'PT08') {
$('#otheroptiondiv').show();
$('#Otherpayment').val('');
} else {
$('#otheroptiondiv').hide();
$('#Otherpayment').val('');
}
var y = <?php echo json_encode($Suplist, JSON_PRETTY_PRINT) ?>;
var Payment = <?php echo json_encode($Payment, JSON_PRETTY_PRINT) ?>;
var PaymentID = '';
$('#PaymentTerms').empty();
// Populate Payment Terms
$('#PaymentTerms').empty();
$.each(payments, function(pay, payobj) {
$("#PaymentTerms").append($('<option></option>').val(payobj.PaymentID).html(payobj.PaymentTerms));
});
$.each(y, function(idx, obj) {
if (obj.SupplierID === id) {
} else {
alert('Please select a Supplier.');
return false;
}
});
if (obj.MSME) {
$("#SupAddress").val("MSME : " + obj.MSME + "\n" + obj.Address);
} else {
$("#SupAddress").val(obj.Address);
}
console.log(obj.PaymentID);
}
});
if (PaymentID != 'PT08') {
$('#otheroptiondiv').hide();
$('#Otherpayment').val('');
} else if (PaymentID == 'PT08') {
$('#otheroptiondiv').show();
$('#Otherpayment').val('');
}
$.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;
}
});
$('#ReqNo').change(function() {
@ -648,18 +634,19 @@ if (!empty($INRSYMBOL)) {
<label>Select Supplier<span class="text-danger">*</span></label>
<?php
$options = array("0" => 'Select Supplier');
//print_r( $options);
$options = array("0" => 'Select Supplier');
if (!empty($Suplist)) {
foreach ($Suplist as $SID) :
$options[$SID->SupplierID] = $SID->SupplierID . ' - ' . $SID->SupplierName;
endforeach;
}
if (!empty($Suplist)) {
foreach ($Suplist as $SID) :
$options[$SID->SupplierID] = $SID->SupplierID . ' - ' . $SID->SupplierName;
endforeach;
}
echo form_dropdown('drpSupplier', $options, set_value('drpSupplier'), 'id="drpSupplier" required="true" class="form-control select2');
echo form_dropdown('drpSupplier', $options, set_value('drpSupplier'), 'id="drpSupplier" required="true" class="form-control select2"');
?>
?>
</div> <!-- 1.3. col-md-3 div closed here -->
<div class="form-group col-md-3">
@ -676,7 +663,6 @@ if (!empty($INRSYMBOL)) {
<div class="form-group col-md-3">
<label>Work Status<span class="text-danger">*</span></label>
<?php
$optionsWork = array("0" => 'Select Work Status');
//print_r( $options);
@ -701,14 +687,9 @@ if (!empty($INRSYMBOL)) {
<?php echo form_label('Schedule', 'Schedule') . "&nbsp;&nbsp;" . form_radio(array("name" => "DateRange", "id" => "Schedule", "value" => "1", 'checked' => set_radio('DateRange', '1', FALSE))); ?>
</div>
</div>
<div class="form-group col-md-3" id="Deliverydtdiv">
<div class="form-group col-md-3" id="Deliverydtdiv"> <!-- // $CurrentDate -->
<label>Delivery Date<span class="text-danger">*</span></label>
<div>
<?php
$data = array('name' => 'Deliverydt', 'value' => set_value('Deliverydt', $CurrentDate), 'id' => 'Deliverydt', 'class' => 'form-control num', 'required' => 'true', 'onkeypress' => 'return false;');
echo form_input($data);
?>
</div>
<input type="date" class="form-control num" data-provide="datepicker" data-date-format="dd/mm/yyyy" data-date-autoclose="true" id="Deliverydt" name="Deliverydt" data-date-end-date="<?= date('d/m/Y'); ?>" required autocomplete="off" value="<?= date('d/m/Y'); ?>">
</div>
<div class="form-group col-md-3" id="Schedulediv" style="display:none;">
<label>Schedule By<span class="text-danger">*</span></label>
@ -732,12 +713,7 @@ if (!empty($INRSYMBOL)) {
<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', $CurrentDate), 'id' => 'PODate', 'class' => 'form-control num', 'required' => 'true', 'onkeypress' => 'return false;');
echo form_input($data);
?>
</div>
<input type="date" class="form-control num" data-provide="datepicker" data-date-format="dd/mm/yyyy" data-date-autoclose="true" id="PODate" name="PODate" data-date-end-date="<?= date('d/m/Y'); ?>" required autocomplete="off" value="<?= date('d/m/Y'); ?>">
</div>
<div class="form-group col-md-3">
<label>Mode Of Shipment</label>
@ -827,24 +803,23 @@ if (!empty($INRSYMBOL)) {
<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) :
$optionsInsurance = array(); // Initialize the options array
if (!empty($insuranceStatus)) {
foreach ($insuranceStatus as $INS) {
$optionsInsurance[$INS['value']] = $INS['name'];
}
}
$optionsInsurance[$INS['value']] = $INS['name'];
endforeach;
}
echo form_dropdown('insuranceStatus', $optionsInsurance, set_value('insuranceStatus'), 'id="insuranceStatus" required="true" class="form-control select2');
echo form_dropdown('insuranceStatus', $optionsInsurance, set_value('insuranceStatus'), 'id="insuranceStatus" required="true" class="form-control select2"');
?>
</div>
</div>
<div class="form-group col-md-3" id="insuranceTxtDiv" style="display:block;">
<label>Insurance No / Insurance Details<span class="text-danger">*</span></label>
@ -965,7 +940,7 @@ if (!empty($INRSYMBOL)) {
</div><!-- div closed here -->
</div><!-- 10 form-row div closed here -->
<div class="form-row">
<div class="row">
<div class="form-group col-md-12">
<br />
<div align="right" style="padding-right:10px">
<input type="file" name="POFile" id="POFile"><br>
@ -977,7 +952,7 @@ if (!empty($INRSYMBOL)) {
<input type="hidden" name="Budget" id="Budget" />
<div class="btn-container" style="text-align: right;">
<a class="btn btn-reset Save" ID="Cancel" onclick="Reset();">&nbsp;&nbsp;<span class="bold">Reset</span></a>
<a class="btn btn-success Save" ID="Cancel" onclick="Reset();">&nbsp;&nbsp;<span class="bold">Reset</span></a>
<a class="btn btn-success Save" ID="Save" onclick="Save(0)">&nbsp;&nbsp;<span class="bold">Save as Draft</span></a>
<a class="btn btn-success Submit" ID="Submit" onclick="Save(1)">&nbsp;&nbsp;<span class="bold">Submit</span></a>
</div><!-- 7.4 btn-container div closed here -->
@ -1234,7 +1209,7 @@ if (!empty($INRSYMBOL)) {
</div><!-- SERVICE.6 closed here -->
<div class="form-row">
<div class="col-md-5 col-md-offset-4" align="right">
<div class="form-group col-md-9" align="right">
<label>Other Allowances <?php echo "($INRSYM)" ?></label>
</div>
<div class="form-group col-md-3">
@ -1247,7 +1222,7 @@ if (!empty($INRSYMBOL)) {
</div>
</div><!-- SERVICE.7 closed here -->
<div class="form-row">
<div class="col-md-5 col-md-offset-4" align="right">
<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">
@ -1262,20 +1237,21 @@ if (!empty($INRSYMBOL)) {
<div class="form-row">
<div class="form-group col-md-12">
<label>Service Description </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><!-- SERVICE -->
</div>
<div class="modal-footer">
<div class="form-row">
<a class="btn btn-secondary waves-effect" data-dismiss="modal" value="Cancel">Cancel</a>
<a class="btn btn-info waves-effect waves-light font AddService" ID="AddService"> &nbsp;&nbsp;<span class="bold">Add Service</span></a>
<a class="btn btn-info waves-effect waves-light font AddService" id="AddService"> &nbsp;&nbsp;<span class="bold">Add Service</span></a>
</div>
</div><!-- SERVICE modal-footer closed here -->
</div>
@ -1355,7 +1331,7 @@ if (!empty($INRSYMBOL)) {
echo form_input($data);
?>
</div>
</div><!-- EDITSERVICE.2.2 col-md-3 closed here -->
</div><!-- EDITSERVICE.2.2 col-md-3 closed here
<div class="form-group col-md-3" id=EditotherDescription>
<label>Item Description</label>
<div>
@ -1364,7 +1340,7 @@ if (!empty($INRSYMBOL)) {
echo form_input($data);
?>
</div>
</div><!-- EDITSERVICE.2.3 col-md-3 closed here -->
</div> EDITSERVICE.2.3 col-md-3 closed here -->
<div class="form-group col-md-3">
<label>UOM</label>
<div>
@ -1528,12 +1504,14 @@ if (!empty($INRSYMBOL)) {
</div>
</div>
</div><!-- EDITSERVICE.8 form-row closed here -->
<div class="form-row" style="padding: 0px 30px 10px 30px;">
<div class="form-row">
<div class="form-group col-md-12">
<label>Service Description </label>
<?php
$data = array('name' => 'EdittxtSpcialInstruction', 'value' => set_value('EdittxtSpcialInstruction'), 'id' => 'EdittxtSpcialInstruction', 'class' => 'form-control', 'rows' => '3', 'cols' => '40');
echo form_textarea($data); ?>
</div>
</div><!-- EDITSERVICE.9 form-row closed here -->
</div>
@ -1550,7 +1528,7 @@ if (!empty($INRSYMBOL)) {
</div><!-- /.modal -->
<script type="text/html" id="ServiceList">
<!-- <script type="text/html" id="ServiceList">
<tr id="<%=index%>">
<td align="left"><%=index%></td>
<td align="left"><%=ReqNo%></td>
@ -1569,7 +1547,7 @@ if (!empty($INRSYMBOL)) {
</td>
</tr>
</script>
</script> -->
<script>
$('#otherdescription').hide();
var index = '1';
@ -1749,21 +1727,48 @@ if (!empty($INRSYMBOL)) {
index = parseInt(index) + 1;
var template = jQuery("#ServiceList").html();
// 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 rowHtml = `
<tr id="${temp}">
<td align="left">${temp}</td>
<td align="left">${Reqnumber}</td>
<td align="left">${materialCode}</td>
<td align="left">${materialName}</td>
<td align="left">${quantity}</td>
<td align="left">${uom}</td>
<td align="left">${itemRate}</td>
<td align="left">${basicval}</td>
<td align="left">${TotalTaxValue}</td>
<td align="left">${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" title="Click here to view/Edit the ${Reqnumber} Requisition details"></i>
</a>
&nbsp;&nbsp;&nbsp;
<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);
$('#ServiceAppend').append(_.template(template, {
index: temp,
ReqNo: Reqnumber,
MaterialCode: materialCode,
MaterialName: materialName,
Quantity: quantity,
UOM: uom,
Rate: itemRate,
BasicAmount: basicval,
Taxvalue: TotalTaxValue,
TotalValue: TotalOrderValue
}));