Minor Bug Fixes : ps
This commit is contained in:
parent
31581be9cc
commit
19ef9022be
@ -95,7 +95,7 @@ class Inwardgateregister extends BaseController
|
||||
$data['transporter'] = $this->inwardgateregister_model->transporter();
|
||||
$data['fromDate'] = date('d-m-Y', strtotime($fromDate));
|
||||
$data['toDate'] = date('d-m-Y', strtotime($toDate));
|
||||
|
||||
$data['driverlist'] = $this->inwardgateregister_model->getdriverlist();
|
||||
$this->loadViews("viewinwardgateregister", $this->global, $data, NULL);
|
||||
}
|
||||
|
||||
|
||||
@ -159,6 +159,7 @@ class Supplier extends BaseController
|
||||
$file1 = $this->request->getFile('Cert_MSME');
|
||||
$file2 = $this->request->getFile('Cert_GST');
|
||||
$file3 = $this->request->getFile('Cert_BANK');
|
||||
$file4 = $this->request->getFile('Cert_PAN');
|
||||
$path = ROOTPATH.'public/uploads/images/';
|
||||
|
||||
if ($file2 && $file2->isValid() && !$file2->hasMoved()) {
|
||||
@ -190,6 +191,17 @@ class Supplier extends BaseController
|
||||
else{
|
||||
$supplier['Cert_BANK'] = NULL;
|
||||
}
|
||||
|
||||
if ($file4 && $file4->isValid() && !$file4->hasMoved()) {
|
||||
if(!is_dir($path)) { mkdir($path, 0777, true); }
|
||||
$PAN_DOC = $file4->getName();
|
||||
$file4->move($path,$PAN_DOC);
|
||||
$supplier['Cert_PAN'] = $PAN_DOC;
|
||||
}
|
||||
else{
|
||||
$supplier['Cert_PAN'] = NULL;
|
||||
}
|
||||
|
||||
$result = $this->supplier_model->addNewsupplier($supplier);
|
||||
|
||||
if ($result > 0) {
|
||||
|
||||
@ -511,12 +511,30 @@ class Inwardgateregister_model extends Model
|
||||
|
||||
$builder = $this->db->table('t_igr_master igr')
|
||||
->distinct()
|
||||
->select('igr.IGRNO,igr.*,igrd.*,MM.MaterialName,MM.UOM,sup.Address,sup.SupplierName,POM.ServiceDescription,POL.Quantity,POL.Rate,POM.POType,POM.IsOpenOrder')
|
||||
->select("igr.IGRNO,igr.*,igrd.*,MM.MaterialName,MM.UOM,sup.Address,sup.SupplierName,POM.ServiceDescription,POL.Quantity,POL.Rate,POM.POType,POM.IsOpenOrder,
|
||||
SUM(
|
||||
CASE
|
||||
WHEN POM.POType = 'IMPORT'
|
||||
THEN COALESCE(it.IGST, 0)
|
||||
WHEN POM.POType = 'CAPITAL' AND POM.CapitalRange = 0
|
||||
THEN COALESCE(it.IGST, 0)
|
||||
WHEN POM.POType = 'CAPITAL' AND POM.CapitalRange = 1
|
||||
THEN COALESCE(st.CGST, 0) + COALESCE(st.SGST, 0) + COALESCE(st.IGST, 0)
|
||||
WHEN POM.POType = 'REVENUE'
|
||||
THEN COALESCE(rt.CGST, 0) + COALESCE(rt.SGST, 0) + COALESCE(rt.IGST, 0)
|
||||
WHEN POM.POType = 'SERVICE'
|
||||
THEN COALESCE(st.CGST, 0) + COALESCE(st.SGST, 0) + COALESCE(st.IGST, 0)
|
||||
ELSE 0
|
||||
END
|
||||
) AS TaxInPercentage", false)
|
||||
->join('t_igr_details igrd', 'igrd.IGRNO = igr.IGRNO')
|
||||
->join('t_purchaseorder_master POM', 'igr.PONO = POM.PONO')
|
||||
->join('t_purchaseorder_lineitem POL', 'igr.PONO = POL.PONO and POL.MaterialCode=igrd.MaterialCode ')
|
||||
->join('t_supplierdetailsn sup', 'sup.SupplierID = POM.SupplierID')
|
||||
->join('t_materialmaster MM', 'MM.MaterialCode = igrd.MaterialCode')
|
||||
->join('t_service_tax st', 'st.LineItemNo = POL.LineItemNo' , 'left')
|
||||
->join('t_revenue_tax rt', 'rt.LineItemNo = POL.LineItemNo' , 'left')
|
||||
->join('t_import_tax it', 'it.LineItemNo = POL.LineItemNo' , 'left')
|
||||
->where('igr.IGRNO', $IGRNO);
|
||||
|
||||
$query = $builder->get();
|
||||
|
||||
@ -109,23 +109,28 @@
|
||||
<legend style="margin-left:-10px;color: #4f7c97;">Tax Related Data</legend>
|
||||
<!-- Text input-->
|
||||
<div class="col-md-12" style="margin-bottom: 27px;">
|
||||
<div class="form-row" style="margin-bottom: 20px;">
|
||||
<div class="form-row">
|
||||
<div class=" col-md-4">
|
||||
<label class="col-form-label" for="GSTNo">GST Number</label>
|
||||
<input type="text" id="GSTNo" name="GSTNo" class="form-control" maxlength="15" onchange="validateGST();" style="text-transform:uppercase;" pattern="([0-9]){2}([A-Za-z]){5}([0-9]){4}([A-Za-z]){1}([0-9]){1}([Zz]){1}([A-Za-z0-9]){1}" title="Please Enter 2 Digit Number and 5 Character and 4 Digit Numbers and 1 Character and 1 Number and 'Z' and 1 Number or Character" onkeypress="return alphaNumberic(event)">
|
||||
</div>
|
||||
<div class=" col-md-4">
|
||||
<label class="col-form-label" for="PAN">PAN</label>
|
||||
<input type="text" id="panno" maxlength="10" pattern="([A-Za-z]){5}([0-9]){4}([A-Za-z]){1}" name="panno" style="text-transform:uppercase;" onchange="validatePAN();" class="form-control" title="Please Enter 5 Character and 4 digit numbers and 1 Character format (Character should be in caps)" onkeypress="return alphaNumberic(event)">
|
||||
</div>
|
||||
<div class=" col-md-4">
|
||||
<label class="col-form-label" for="Cert_GST">Select GST Document<small> (only .pdf, .doc, .png, .jpg)</small></label>
|
||||
<input style="margin-top: 5px;" type="file" size="20" accept=".docx,.pdf,.doc,.jpg,.png" id="Cert_GST" name="Cert_GST" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class=" col-md-8">
|
||||
<div class=" col-md-4">
|
||||
<label class="col-form-label" for="PAN">PAN</label>
|
||||
<input type="text" id="panno" maxlength="10" pattern="([A-Za-z]){5}([0-9]){4}([A-Za-z]){1}" name="panno" style="text-transform:uppercase;" onchange="validatePAN();" class="form-control" title="Please Enter 5 Character and 4 digit numbers and 1 Character format (Character should be in caps)" onkeypress="return alphaNumberic(event)">
|
||||
</div>
|
||||
<div class=" col-md-4">
|
||||
<label class="col-form-label" for="Cert_MSME">Select PAN Document<small> (only .pdf, .doc, .png, .jpg)</small></label>
|
||||
<input style="margin-top: 5px;" type="file" size="20" accept=".docx,.pdf,.doc,.jpg,.png" id="Cert_PAN" name="Cert_PAN" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class=" col-md-4">
|
||||
<label class="col-form-label" for="MSME">MSME</label>
|
||||
<input type="text" id="MSMENo" name="MSME" class="form-control" maxlength="30">
|
||||
</div>
|
||||
|
||||
@ -113,6 +113,7 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th align="left" style="width: 10%;">Created Date</th>
|
||||
<th align="left" style="width: 6%;">Created By</th>
|
||||
<th align="left" style="width: 10%;">Non-IGRNO</th>
|
||||
<th align="left" style="width: 20%;">Supplier Name</th>
|
||||
<th align="left" style="width: 25%;">Item Description</th>
|
||||
@ -124,7 +125,6 @@
|
||||
<th align="left" style="width: 2%;">IGST</th>
|
||||
<th align="left" style="width: 7%;">Total</th>
|
||||
<th align="left" style="width: 7%;">Status</th>
|
||||
<th align="left" style="width: 6%;">Created By</th>
|
||||
<th align="left" style="width: 8%;">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@ -152,6 +152,7 @@
|
||||
}
|
||||
?>
|
||||
<td><?php echo $cdate; ?></td>
|
||||
<td><?php echo $record['created_name']; ?></td>
|
||||
<td><?php echo $record['serial_number']; ?></td>
|
||||
<td class="expandable-td">
|
||||
<div class="text-container" style="max-height: 20px; overflow: hidden;">
|
||||
@ -178,7 +179,6 @@
|
||||
<td><?php echo $record['igst']; ?></td>
|
||||
<td><?php echo $record['total']; ?></td>
|
||||
<td><?php echo $record['status']; ?></td>
|
||||
<td><?php echo $record['created_name']; ?></td>
|
||||
<td>
|
||||
<?php if ($fileExists == 1) { ?>
|
||||
<button title="Download FIle" class="download_button" onclick="downloadFile('<?php echo $record['id']; ?>', '<?php echo $record['transporter_file']; ?>')" style="border: none;background-color: white;color: #02a8b5;">
|
||||
|
||||
@ -432,8 +432,13 @@
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<label class="col-form-label">Driver Name </label>
|
||||
<?php $data = array('name' => 'DriverName', 'value' => set_value('DriverName'), 'id' => 'Driver_Name', 'class' => 'form-control');
|
||||
<?php $data = array('name' => 'DriverName', 'value' => set_value('DriverName'), 'id' => 'Driver_Name', 'class' => 'form-control', 'maxlength' => '50', 'autocomplete' => 'off','list' => 'driverlist','onchange' => "fetchMobileNumber(this.value)");
|
||||
echo form_input($data);
|
||||
echo '<datalist id="driverlist">';
|
||||
foreach ($driverlist as $driver) {
|
||||
echo '<option value="' . $driver['DriverName'] . ( ( $driver['DriverMobileNumber'] ) ? ' - ' . $driver['DriverMobileNumber'] : '' ) . '" >';
|
||||
}
|
||||
echo '</datalist>';
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
@ -458,10 +463,13 @@
|
||||
<th style="width: 100px;">Item Code</th>
|
||||
<th style="width: 150px; word-wrap: break-word; word-break: break-all; white-space: normal;">Item Description</th>
|
||||
<th style="width: 50px;">Rate</th>
|
||||
<th style="width: 50px;">Tax (%)</th>
|
||||
<th style="width: 50px;">UOM</th>
|
||||
<th style="width: 100px;">Ordered Qty</th>
|
||||
<th style="width: 100px;">Received Qty</th>
|
||||
<th id="pendingQuantityHeader" style="display:none; width: 100px;">Pending Qty</th>
|
||||
<th style="width: 50px;">Taxable Amt</th>
|
||||
<th style="width: 50px;">Total Amt</th>
|
||||
<th style="width: 150px;">Remarks</th>
|
||||
<th style="width: 50px;"></th>
|
||||
</tr>
|
||||
@ -671,7 +679,7 @@
|
||||
$("#DriverMobileNumber").on('input', function(e) {
|
||||
this.value = this.value.replace(/\D/g, '');
|
||||
});
|
||||
|
||||
|
||||
$(document).on('click', '#save_remark', function(e) {
|
||||
$('#loader').show();
|
||||
e.preventDefault();
|
||||
@ -922,22 +930,28 @@
|
||||
console.log(item.MaterialRcvdDate)
|
||||
var gross_rcv_date = (item.GrossWeightDate == 'null') ? ' ' : formatDateTime(item.GrossWeightDate, 2);
|
||||
$("#ser").val(item.ServiceDescription);
|
||||
|
||||
var amount = item.Rate*item.QuantityAsPerInvoice;
|
||||
var tax_percentage = item.TaxInPercentage;
|
||||
var taxable_amount = (amount * tax_percentage) / 100;
|
||||
var total_with_tax = amount + taxable_amount;
|
||||
|
||||
i = i + 1;
|
||||
// userrole is system admin also know as admin (if)
|
||||
if (userRole == 1) {
|
||||
$("#pendingQuantityHeader").css("display", "table-cell");
|
||||
|
||||
trIGRHTML += '<tr>' +
|
||||
'<td style="width: 50px;" >' + i + '</td>' +
|
||||
'<td style="width: 100px;" name="MaterialName" onchange="test(' + i + ')">' + item.MaterialCode + '</td>' +
|
||||
'<td style="width: 150px; word-wrap: break-word; word-break: break-all; white-space: normal;">' + item.MaterialName + '</td>' +
|
||||
'<td style="width: 50px;" name="Rate" id="Rate" >' + Number(item.Rate).toFixed(2) + '</td>' +
|
||||
'<td style="width: 50px;" name="tax">' + tax_percentage + '</td>' +
|
||||
'<td style="width: 50px;" name="UOM">' + item.UOM + '</td>' +
|
||||
'<td style="width: 100px;" id="Quantity' + i + '" name="Quantity">' + parseInt(item.Quantity) + '</td>' +
|
||||
'<td style="width: 100px;" data-name="sel" ><input type="text" onchange="validateReceivedQuantity(' + i + ',' + isOpenOrder + ')"id="QuantityAsPerInvoice' + i + '" name="QuantityAsPerInvoice' + i + '" value="' + parseInt(item.QuantityAsPerInvoice) + '" onkeypress="return isNumberKey(event);" style="width: 75px;"></td>' +
|
||||
'<td style="width: 100px;" name="PendingQuantity' + i + '" id="PendingQuantity' + i + '">' + ((isOpenOrder) ? 0 : parseInt(item.Quantity - item.QuantityAsPerInvoice)) + '</td>' +
|
||||
'<td style="width: 150px;"><input type="text" id="Remark' + i + '" name="Remark' + i + '" class="form" onchange="SetRemarks(' + i + ')" style="width: 75px;"> </td>' +
|
||||
'<td style="width: 50px;" name="amount">' + amount + '</td>' +
|
||||
'<td style="width: 50px;" name="tax_amount">' + total_with_tax + '</td>' +
|
||||
'<td style="width: 100px;"><input type="text" id="Remark' + i + '" name="Remark' + i + '" class="form" onchange="SetRemarks(' + i + ')" style="width: 75px;"> </td>' +
|
||||
'<td style="width: 50px;"><a target="_blank" data-toggle="modal" data-target="#WeightCalculator" title="Weight Calculator" data-index="' + i + '" data-material="' + item.MaterialName + '" data-igrstatus = "' + igrstatus + '"><i class="fa fa-solid fa-truck" style="text-align: center;"></i></a> </td>' +
|
||||
'<input type="hidden" id="IGRNO' + i + '" name="IGRNO' + i + '" value="' + item.IGRNO + '">' +
|
||||
'<input type="hidden" id="MaterialCode' + i + '" name="MaterialCode' + i + '" value="' + item.MaterialCode + '">' +
|
||||
@ -961,19 +975,26 @@
|
||||
}
|
||||
// userrole is security based on status we show and here (else if)
|
||||
else if (userRole !== 1) {
|
||||
|
||||
var amount = item.Rate*item.QuantityAsPerInvoice;
|
||||
var tax_percentage = item.TaxInPercentage;
|
||||
var taxable_amount = (amount * tax_percentage) / 100;
|
||||
var total_with_tax = amount + taxable_amount;
|
||||
if (igrstatus === "ST074") {
|
||||
$("#pendingQuantityHeader").css("display", "table-cell");
|
||||
|
||||
trIGRHTML += '<tr>' +
|
||||
'<td style="width: 50px;" >' + i + '</td>' +
|
||||
'<td style="width: 100px;" name="MaterialName" onchange="test(' + i + ')">' + item.MaterialCode + '</td>' +
|
||||
'<td style="width: 150px; word-wrap: break-word; word-break: break-all; white-space: normal;">' + item.MaterialName + '</td>' +
|
||||
'<td style="width: 50px;" name="Rate" id="Rate" >' + Number(item.Rate).toFixed(2) + '</td>' +
|
||||
'<td style="width: 50px;" name="tax">' + tax_percentage + '</td>' +
|
||||
'<td style="width: 50px;" name="UOM">' + item.UOM + '</td>' +
|
||||
'<td style="width: 100px;" id="Quantity' + i + '" name="Quantity">' + parseInt(item.Quantity) + '</td>' +
|
||||
'<td style="width: 100px;" data-name="sel" ><input type="text" onchange="validateReceivedQuantity(' + i + ',' + isOpenOrder + ')"id="QuantityAsPerInvoice' + i + '" name="QuantityAsPerInvoice' + i + '" value="' + parseInt(item.QuantityAsPerInvoice) + '" onkeypress="return isNumberKey(event);" style="width: 75px;"></td>' +
|
||||
'<td style="width: 100px;" name="PendingQuantity' + i + '" id="PendingQuantity' + i + '">' + ((isOpenOrder) ? 0 : parseInt(item.Quantity - item.QuantityAsPerInvoice)) + '</td>' +
|
||||
'<td style="width: 150px;"><input type="text" id="Remark' + i + '" name="Remark' + i + '" class="form" onchange="SetRemarks(' + i + ')" style="width: 75px;"> </td>' +
|
||||
'<td style="width: 50px;" name="amount">' + amount + '</td>' +
|
||||
'<td style="width: 50px;" name="tax_amount">' + total_with_tax + '</td>' +
|
||||
'<td style="width: 100px;"><input type="text" id="Remark' + i + '" name="Remark' + i + '" class="form" onchange="SetRemarks(' + i + ')" style="width: 75px;"> </td>' +
|
||||
'<td style="width: 50px;"><a target="_blank" data-toggle="modal" data-target="#WeightCalculator" title="Weight Calculator" data-index="' + i + '" data-material="' + item.MaterialName + '" data-igrstatus = "' + igrstatus + '"><i class="fa fa-solid fa-truck" style="text-align: center;"></i></a> </td>' +
|
||||
'<input type="hidden" id="IGRNO' + i + '" name="IGRNO' + i + '" value="' + item.IGRNO + '">' +
|
||||
'<input type="hidden" id="MaterialCode' + i + '" name="MaterialCode' + i + '" value="' + item.MaterialCode + '">' +
|
||||
@ -993,18 +1014,26 @@
|
||||
if ((item.Quantity - item.QuantityAsPerInvoice) == 0.00) {
|
||||
$('#QuantityAsPerInvoice' + i).attr('readonly', 'true');
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
var amount = item.Rate*item.QuantityAsPerInvoice;
|
||||
var tax_percentage = item.TaxInPercentage;
|
||||
var taxable_amount = (amount * tax_percentage) / 100;
|
||||
var total_with_tax = amount + taxable_amount;
|
||||
$("#pendingQuantityHeader").css("display", "none");
|
||||
trIGRHTML += '<tr>' +
|
||||
'<td style="width: 50px;" >' + i + '</td>' +
|
||||
'<td style="width: 100px;" name="MaterialName" id="MaterialCode" onchange="test(' + i + ')">' + item.MaterialCode + '</td>' +
|
||||
'<td style="width: 150px; word-wrap: break-word; word-break: break-all; white-space: normal;">' + item.MaterialName + '</td>' +
|
||||
'<td style="width: 50px;" name="Rate" id="Rate" >' + Number(item.Rate).toFixed(2) + '</td>' +
|
||||
'<td style="width: 50px;" name="tax">' + tax_percentage + '</td>' +
|
||||
'<td style="width: 50px;" name="UOM">' + item.UOM + '</td>' +
|
||||
'<td style="width: 100px;" name="Quantity">' + item.Quantity + '</td>' +
|
||||
'<td style="width: 100px;" data-name="sel" >' + item.QuantityAsPerInvoice + '</td>' +
|
||||
'<td style="width: 150px;">' + item.Remarks + '</td>' +
|
||||
'<td style="width: 50px;" name="tax_amount">' + total_with_tax + '</td>' +
|
||||
'<td style="width: 50px;" name="amount">' + amount + '</td>' +
|
||||
'<td style="width: 50px;" name="tax_amount">' + total_with_tax + '</td>' +
|
||||
'<td style="width: 50px;"><a target="_blank" data-toggle="modal" data-target="#WeightCalculator" title="Weight Calculator" data-index="' + i + '" data-material="' + item.MaterialName + '" data-igrstatus = "' + igrstatus + '"><i class="fa fa-solid fa-truck" style="text-align: center;"></i></a> </td>' +
|
||||
'<input type="hidden" id="IGRNO' + i + '" name="IGRNO' + i + '" value="' + item.IGRNO + '">' +
|
||||
'<input type="hidden" id="MaterialCode' + i + '" name="MaterialCode' + i + '" value="' + item.MaterialCode + '">' +
|
||||
@ -1947,5 +1976,16 @@
|
||||
}
|
||||
});
|
||||
});
|
||||
function fetchMobileNumber(selectedValue) {
|
||||
let parts = selectedValue.split(" - ");
|
||||
console.log(parts);
|
||||
console.log(parts[0]);
|
||||
if (parts.length === 2) {
|
||||
document.getElementById("Driver_Name").value = parts[0];
|
||||
document.getElementById("DriverMobileNumber").value = parts[1];
|
||||
}else{
|
||||
document.getElementById("Driver_Name").value = parts[0];
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
Loading…
Reference in New Issue
Block a user