CHANGE_PURCHASE_ORDER_SERVICE_REVENUE__CAPITAL_IMPORT_ADD_EDIT_CHECK_MODAL

This commit is contained in:
aadhavan valli 2024-09-21 13:30:51 +05:30
parent 71f2de282d
commit 65aa4fb078
8 changed files with 958 additions and 791 deletions

View File

@ -1330,6 +1330,7 @@ class Purchaseorder extends BaseController
}
//echo "OUT";
// print_r($this->request->getPost());die;
for ($i = 1; $i <= $RowCount; $i++) {
//echo "IN";
$MaterialCode = $this->request->getPost('materialCode' . $i);
@ -1444,7 +1445,20 @@ class Purchaseorder extends BaseController
if ($SkipInsert == "False") {
if (strlen((string)$POLineItemNo) == 0) {
$this->requistion_model = new requistion_model();
$RetItemNo = $this->requistion_model->getItemNumber($Reqnumber, $MaterialCode);
$ItemNo = '';
if (count($RetItemNo) > 0) {
$ItemNo = $RetItemNo[0]['ItemNo'];
}
$POLineItemList = array('PONO' => $PONO, 'ReqNo' => $Reqnumber, 'MaterialCode' => $MaterialCode, 'Quantity' => $Quantity, 'ReceivedQuantity' => $recqty, 'Rate' => $itemRate, 'Status' => $LineItemStatus, 'CreatedBy' => $updatedBy, 'CreatedDate' => $updateddt, 'CostCenterCode' => $CostCenter);
$POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList);
if (count($POLineItem) > 0) {
$LineItemNo = $POLineItem[0]['LineItemNo'];
}
} else {
$LineItemNo = $POLineItemNo;
@ -1453,13 +1467,63 @@ class Purchaseorder extends BaseController
$POLineItem = $this->purchaseorder_model->updatePOLineItem($PONO, $POLineItemNo, $POLineItemList);
}
$isExists = $this->purchaseorder_model->LineItemExistsinRevenueTax($LineItemNo);
if (is_array($isExists) && count($isExists) == 0) {
$isExists = $this->purchaseorder_model->LineItemExistsinRevenueTax($LineItemNo);
// Ensure $isExists is an array, or initialize it as an empty array
if (!is_array($isExists)) {
$isExists = [];
}
if (count($isExists) == 0) {
$RevenueTaxList = array(
'LineItemNo' => $LineItemNo,
'DiscountType' => $DiscountType,
'DiscountValue' => $DiscountValue,
'AfterDiscount' => $AfterDiscount,
'PackagingType' => $PackagingType,
'PackagingValue' => $PackagingValue,
'PackagingCalulatedOn' => $PackagingOption,
'AfterPackagingValue' => $AfterPackagingValue,
'FreightType' => $FreightType,
'FreightValue' => $FreightValue,
'AfterFreightValue' => $AfterFreightValue,
'Insurance' => $InsuranceValue,
'TotalValue' => $TotalOrderValue,
'CGST' => $Cgst,
'AfterCGST' => $AfterCgst,
'SGST' => $Sgst,
'AfterSGST' => $AfterSgst,
'IGST' => $Igst,
'AfterIGST' => $AfterIgst,
'NoOfTrip' => $NOOfTrip
);
$RevenueList = $this->purchaseorder_model->addRevenueTax($RevenueTaxList);
} else {
$RevenueTaxList = array('DiscountType' => $DiscountType, 'DiscountValue' => $DiscountValue, 'AfterDiscount' => $AfterDiscount, 'PackagingType' => $PackagingType, 'PackagingValue' => $PackagingValue, 'PackagingCalulatedOn' => $PackagingOption, 'AfterPackagingValue' => $AfterPackagingValue, 'FreightType' => $FreightType, 'FreightValue' => $FreightValue, 'AfterFreightValue' => $AfterFreightValue, 'Insurance' => $InsuranceValue, 'TotalValue' => $TotalOrderValue, 'UpdateBY' => $updatedBy, 'UpdatedOn' => $updateddt, 'CGST' => $Cgst, 'AfterCGST' => $AfterCgst, 'SGST' => $Sgst, 'AfterSGST' => $AfterSgst, 'IGST' => $Igst, 'AfterIGST' => $AfterIgst, 'CreatedBy' => $updatedBy, 'NoOfTrip' => $NOOfTrip);
$RevenueTaxList = array(
'DiscountType' => $DiscountType,
'DiscountValue' => $DiscountValue,
'AfterDiscount' => $AfterDiscount,
'PackagingType' => $PackagingType,
'PackagingValue' => $PackagingValue,
'PackagingCalulatedOn' => $PackagingOption,
'AfterPackagingValue' => $AfterPackagingValue,
'FreightType' => $FreightType,
'FreightValue' => $FreightValue,
'AfterFreightValue' => $AfterFreightValue,
'Insurance' => $InsuranceValue,
'TotalValue' => $TotalOrderValue,
'UpdateBY' => $updatedBy,
'UpdatedOn' => $updateddt,
'CGST' => $Cgst,
'AfterCGST' => $AfterCgst,
'SGST' => $Sgst,
'AfterSGST' => $AfterSgst,
'IGST' => $Igst,
'AfterIGST' => $AfterIgst,
'CreatedBy' => $updatedBy,
'NoOfTrip' => $NOOfTrip
);
$this->purchaseorder_model->updateRevenueTax($LineItemNo, $RevenueTaxList);
}
}
@ -2366,7 +2430,10 @@ class Purchaseorder extends BaseController
// print_r($isExists);
// die();
if (is_array($isExists) && count($isExists) == 0) {
if (!is_array($isExists)) {
$isExists = [];
}
if (count($isExists) == 0) {
// print_r(count($isExists));
// echo $isExists;
// die();
@ -2751,8 +2818,6 @@ class Purchaseorder extends BaseController
/*Edit Capital po*/
function EditCapitalPurchaseOrder()
{
$PONO = $this->request->getPost('txtPONO');
$POdt = $this->request->getPost('PODate');
$PODate = get_date_time_format($POdt);
@ -2879,7 +2944,6 @@ class Purchaseorder extends BaseController
}
}
}
$POMaster = $this->purchaseorder_model->updatePOMaster($PONO, $POList);
$LineItemStatus = REQITEM_NEW;
@ -2901,7 +2965,7 @@ class Purchaseorder extends BaseController
$this->purchaseorder_model->insertlogpo($logpo);
}
}
// print_r($this->request->getPost());die;
for ($i = 1; $i <= $RowCount; $i++) {
$MaterialCode = $this->request->getPost('materialCode' . $i);
@ -3056,7 +3120,7 @@ class Purchaseorder extends BaseController
// print_r(strlen((string)$POLineItemNo));die;
if ($SkipInsert == "False") {
@ -3064,6 +3128,11 @@ class Purchaseorder extends BaseController
$POLineItemList = array('PONO' => $PONO, 'ReqNo' => $Reqnumber, 'MaterialCode' => $MaterialCode, 'Quantity' => $Quantity, 'Rate' => $itemRate, 'Status' => $LineItemStatus, 'CreatedBy' => $CreateBy, 'CreatedDate' => $createddt, 'CostCenterCode' => $CostCenter, 'ServiceMaterialDescription' => $CapitalItemDescription, 'Per' => $Per);
$POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList);
// if($i != 1){
// print_r(value:$POLineItem);
// die;
// }
$LineItemNo = '';
if (count($POLineItem) > 0) {

View File

@ -3306,26 +3306,26 @@
// }));
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">${Total}</td>
<td>
<a data-target='#EDITCAPITAL' id="edit${temp}" data-id="${temp}" data-userid="${temp}" data-toggle="modal" href="#EDITREVENUE">
<i class="ri-pencil-fill" data-toggle="tooltip" ></i>&nbsp;&nbsp;&nbsp;
</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>`;
<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">${Total}</td>
<td>
<a data-target='#EDITCAPITAL' id="edit${temp}" data-id="${temp}" data-userid="${temp}" data-toggle="modal" href="#EDITREVENUE">
<i class="ri-pencil-fill" data-toggle="tooltip" ></i>&nbsp;&nbsp;&nbsp;
</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>`;
$('#capitalAppend').append(rowHtml);

File diff suppressed because it is too large Load Diff

View File

@ -510,11 +510,14 @@ if (!empty($getlogpodtl)) {
Editchange();
});
var edit = '';
$('#PackagingType').change(function() {
$('#txtPackaging').val('');
$('#txtAfterPackaging').val('');
selValue = $("#PackagingType").val();
if (selValue == PercentageType) {
$('#REVENUE').modal('hide');
edit = 'PackingCalculationOn';
var PackagingCalculation = '';
$('#packagingcalmodel').modal('show');
$('#txtPackaging').removeAttr('readonly', 'true');
@ -531,12 +534,22 @@ if (!empty($getlogpodtl)) {
calculatePackaging(0);
});
$('#packagingcalmodel').on('hidden.bs.modal', function() {
// Reopen the first modal when the second modal is closed
if (edit == 'PackingCalculationOn') {
$('#REVENUE').modal('show');
} else if (edit == 'EditPackingCalculationOn') {
$('#EDITREVENUE').modal('show');
}
});
$('#EditPackagingType').change(function() {
$('#txtEditPackaging').val('');
$('#txtEditAfterPackaging').val('');
selValue = $("#EditPackagingType").val();
if (selValue == PercentageType) {
$('#EDITREVENUE').modal('hide');
var PackagingCalculation = '';
edit = 'EditPackingCalculationOn';
$('#packagingcalmodel').modal('show');
$('#txtEditPackaging').removeAttr('readonly', 'true');
} else {
@ -588,6 +601,7 @@ if (!empty($getlogpodtl)) {
$('#CSTCalModel').modal('show');
});
var freight = '';
$('#drpFreight').change(function() {
var FreightType = $("#drpFreight").val();
@ -603,6 +617,8 @@ if (!empty($getlogpodtl)) {
$('#txtFreight').val('');
$('#txtAfterFreight').val('');
if (selValue == PercentageType) {
$('#REVENUE').modal('hide');
freight = 'FreightCalculationOn';
var FreightCalculation = '';
$('#freightcalmodel').modal('show');
$('#txtFreight').removeAttr('readonly', 'true');
@ -632,6 +648,14 @@ if (!empty($getlogpodtl)) {
$('#ViewTripsValue').hide();
}
}); */
$('#freightcalmodel').on('hidden.bs.modal', function() {
// Reopen the first modal when the second modal is closed
if (freight == 'FreightCalculationOn') {
$('#REVENUE').modal('show');
} else if (freight == 'EditFreightCalculationOn') {
$('#EDITREVENUE').modal('show');
}
});
$('#drpEditFreight').change(function() {
var FreightType = $("#drpEditFreight").val();
@ -647,6 +671,7 @@ if (!empty($getlogpodtl)) {
$('#txtEditFreight').val('');
$('#txtEditAfterFreight').val('');
if (selValue == PercentageType) {
freight = 'EditFreightCalculationOn';
var FreightCalculation = '';
$('#freightcalmodel').modal('show');
$('#txtEditFreight').removeAttr('readonly', 'true');
@ -663,6 +688,7 @@ if (!empty($getlogpodtl)) {
calculateFreight(1);
});
$('#drpViewFreight').change(function() {
var FreightType = $("#drpViewFreight").val();
@ -2185,12 +2211,12 @@ if (!empty($getlogpodtl)) {
<td><?php echo $record->MaterialName ?></td>
<td align="left"><?php echo $record->Quantity ?></td>
<td><?php echo $record->UOM ?></td>
<td align="left"><?php echo $record->Rate ?></td>
<td align="right"><?php echo $record->Rate ?></td>
<td align="left"><?php echo number_format($record->BasicValue, 2, '.', ''); ?></td>
<td align="right"><?php echo number_format($record->BasicValue, 2, '.', ''); ?></td>
<td align="left"><?php echo $record->Taxamount ?></td>
<td align="left"><?php echo $record->TotalValue ?></td>
<td align="right"><?php echo $record->Taxamount ?></td>
<td align="right"><?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> -->
@ -2556,7 +2582,7 @@ if (!empty($getlogpodtl)) {
<input type="hidden" name="txtPoRange" id="txtPoRange" />
<input type="hidden" name="isEdit" id="isEdit" value="0" />
<input type="hidden" name="txtStatus" id="txtStatus" />
<input type="hidden" name="txtRowCount" id="txtRowCount" value="<?php echo $index; ?>">
<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="txtPONO" id="txtPONO" value="<?php echo $PONO; ?>" />
<input type="hidden" name="txttaxcheck" id="txttaxcheck" value="" />
@ -3812,6 +3838,66 @@ if (!empty($getlogpodtl)) {
</div>
</div>
</div><!-- /.modal -->
<!-- Modal for freight Calculation-->
<div id="freightcalmodel" class="modal fade" tabindex="-1" role="dialog"
aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Freight Calculation On</h4>
<button type="button" class="close" data-dismiss="modal"
aria-hidden="true">×</button>
</div>
<div class="modal-body p-4">
<form>
<div>
<label><input type="radio" name="optFreight" checked="checked" value='0' id="optFreight"> Basic Amount</label>
</div>
<div>
<label><input type="radio" name="optFreight" id="optFreight" value='1'> After Discount Amount</label>
</div>
</form>
</div>
<div class="modal-footer" style="border:none;">
<a class="btn btn-secondary waves-effect" data-dismiss="modal" style="margin-top: -24px;" value="Cancel">Cancel</a>
<a class="btn btn-info waves-effect waves-light" ID="FreightOption" onclick="SetfreightOption();" style="margin-top: -24px;">&nbsp;&nbsp;<span class="bold">Ok</span></a>
</div>
</div>
</div>
</div><!-- /.modal -->
<div id="packagingcalmodel" class="modal fade" role="dialog"
aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Packing Calculation On</h4>
<button type="button" class="close" data-dismiss="modal"
aria-hidden="true">×</button>
</div>
<div class="modal-body p-4">
<form>
<div>
<label>
<input type="radio" name="optPackaging" checked="checked" value='0' id="optPackaging"> Basic Amount
</label>
</div>
<div>
<label>
<input type="radio" name="optPackaging" id="optPackaging" value='1'> After Discount Amount
</label>
</div>
</form>
</div>
<div class="modal-footer" style="border:none;">
<a class="btn btn-secondary waves-effect" data-dismiss="modal" style="margin-top: -24px;" value="Cancel">Cancel</a>
<a class="btn btn-info waves-effect waves-light" ID="PackagingOption" onclick="SetPackagingOption();" style="margin-top: -24px;">&nbsp;&nbsp;<span class="bold">Ok</span></a>
</div>
</div>
</div>
</div><!-- /.modal -->
<!-- Revenue Special PO Modal Ends Here -->
<!-- Revenue bill Modal Starts Here -->
<div id="billModel" class="modal fade" tabindex="-1" role="dialog"
@ -3876,7 +3962,7 @@ if (!empty($getlogpodtl)) {
</div>
</script>
<script>
var index = <?php echo $index; ?>;
var index = <?php if(isset($index)){ echo $index; } ?>;
var userid = '';
var taxcheck = 0;
$("#BudgetType").change(function() {
@ -3958,7 +4044,7 @@ if (!empty($getlogpodtl)) {
var Insval = $("#txtInsurance").val();
var TotalOrderValue = $("#txtTotalOrderValue").val();
var service_description = $("#Add_Service_Description").val();
//alert(service_description);
// alert(service_description);
var TotalTaxValue = calculateTaxValue();
@ -4002,10 +4088,10 @@ if (!empty($getlogpodtl)) {
<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 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"></i>
@ -4742,12 +4828,12 @@ if (!empty($getlogpodtl)) {
var Freight = $('#txtAfterFreight').val() == '' ? '0.00' : $('#txtAfterFreight').val();
var Insurance = $('#txtInsurance').val() == '' ? '0.00' : $('#txtInsurance').val();
var Discount = $('#txtAfterDiscount').val() == '' ? '0.00' : $('#txtAfterDiscount').val();
var txtEditAfterPackaging = $('#txtEditAfterPackaging').val() == '' ? '0.00' : $('#txtEditAfterPackaging').val();
var totvalue = parseFloat(AfterCgst) + parseFloat(AfterSgst) + parseFloat(AfterIgst);
var totvalue = parseFloat(AfterCgst) + parseFloat(AfterSgst) + parseFloat(AfterIgst) ;
var tot = parseFloat(totvalue).toFixed(2);
//alert('tot:'+tot);
// alert('tot:'+tot);
return tot;
}
//If others is the payment terms to display mandatory field
@ -4885,15 +4971,15 @@ if (!empty($getlogpodtl)) {
processData: false,
contentType: false,
success: function(data) {
console.log(data);
// console.log(data);
if (data) {
// alert(data);
// $('#txtRowCount').val('');
// $('#txtDeletedRow').val('');
// $('#txtStatus').val('');
// $('#SpcialInstruction').val('');
// $('#txtDeliveryAddress').val('')
// window.location = "purchaseorderListing";
alert(data);
$('#txtRowCount').val('');
$('#txtDeletedRow').val('');
$('#txtStatus').val('');
$('#SpcialInstruction').val('');
$('#txtDeliveryAddress').val('')
window.location = "purchaseorderListing";
} else {
alert("Something went wrong");

View File

@ -754,7 +754,6 @@ if (!empty($getlogpodtl)) {
<?php
if (!empty($POItem)) {
foreach ($POItem as $record) {
$index = $index + 1;
//echo $record->Rate;
@ -1390,6 +1389,42 @@ if (!empty($getlogpodtl)) {
</div>
</div>
<div class="form-row">
<div class="form-group col-md-3">
</div>
<div class="form-group col-md-3">
<!-- <P id=labelRate> --> <label id=labelRate><?php echo "Rate in"; ?> <span class="text-danger">*</span></label><!-- </P> -->
<div>
<?php
$data = array('name' => 'Rate', 'value' => set_value('Rate'), 'id' => 'Rate', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Ratechange(),validateExceedLimit(),calculateFreight(0)');
echo form_input($data);
?>
</div>
</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>Basic Amount </label>-->
<!-- <p id=label2> --> <label id=label2><?php echo "Basic Value In"; ?></label><!-- </p> -->
<div>
<?php
//$data = array('name' => 'imTotalAmount','value' => set_value('imTotalAmount'),'id'=>'imTotalAmount', 'class' => 'form-control' ,'readonly' => 'true');
$data = array('name' => 'txtBasicValue', 'value' => set_value('txtBasicValue'), 'id' => 'txtBasicValue', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div>
<div class="form-row ">
<div class="form-group col-md-3">
@ -1902,7 +1937,7 @@ if (!empty($getlogpodtl)) {
</div>
</div>
<div class="form-row">
<div class="form-group col-md-2">
<div class="form-group col-md-3">
<label>Item Code<span class="text-danger" style="color:red;text-align:right;background-color: #fff;">*</span></label>
<!--In this item code the value should come from DB , so it getting error , so i am disabling this div , once get the data from DB uncommand this div-->
@ -1933,7 +1968,7 @@ if (!empty($getlogpodtl)) {
</div>
</div>
<div class="form-group col-md-2">
<div class="form-group col-md-3">
<label>Item Name</label>
<div>
<?php
@ -1942,7 +1977,7 @@ if (!empty($getlogpodtl)) {
?>
</div>
</div>
<div class="form-group col-md-1">
<div class="form-group col-md-3">
<label>UOM</label>
<div>
<?php
@ -1951,7 +1986,7 @@ if (!empty($getlogpodtl)) {
?>
</div>
</div>
<div class="form-group col-md-2">
<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>
<?php
@ -1961,7 +1996,12 @@ if (!empty($getlogpodtl)) {
?>
</div>
</div>
<div class="form-group col-md-2">
</div>
<div class="form-row">
<div class="form-group col-md-3">
</div>
<div class="form-group col-md-3">
<!-- <label>Rate </label> -->
<!-- <P id=labelEditRate> --> <label id=labelEditRate><?php echo "Rate in $Currencycode ($Value)"; ?> <span class="text-danger" style="color:red;text-align:right;background-color: #fff;">*</span></label>
@ -1972,12 +2012,12 @@ if (!empty($getlogpodtl)) {
?>
</div>
</div>
<div class="form-group col-md-1">
<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-2" style="padding: 0px;">
<div class="form-group col-md-3" style="padding: 0px;">
<!-- <label><?php echo "Basic Value In"; ?></label>-->
<!-- <p id=label3> --><label id=label3><?php echo "Basic Value In $Currencycode ($Value)"; ?></label><!-- </p> -->
<div>
@ -1991,6 +2031,8 @@ if (!empty($getlogpodtl)) {
</div>
</div>
<div class="form-row">
<div class="form-group col-md-3">
</div>
<div class="form-group col-md-3">
@ -2550,9 +2592,7 @@ if (!empty($getlogpodtl)) {
</div>
</div>
<div class="form-group col-md-2">
<!-- <label>Rate </label> -->
<!-- <P id=labelEditRate> --> <label id=labelEditRate><?php echo "Rate in $Currencycode ($Value)"; ?><span class="text-danger" style="color:red;text-align:right;background-color: #fff;">*</span> </label>
<label id=labelEditRate><?php echo "Rate in $Currencycode ($Value)"; ?><span class="text-danger" style="color:red;text-align:right;background-color: #fff;">*</span> </label>
<div>
<?php
$data = array('name' => 'ViewRate', 'value' => set_value('ViewRate'), 'id' => 'ViewRate', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'readonly' => true, 'onchange' => 'EditRatechange()');
@ -4899,7 +4939,6 @@ if (!empty($getlogpodtl)) {
$('.EditImport').click(function() {
// alert('inside edit');
if (validateEditExceedLimit() && ExceedEditQuantityCheck() && EditQtyZerocheck()) {
alert('inside edit if');
var CostCode = $("#EditCostCenter").val();
var AvilBudget = $('#EditAvlBudAmt').val();
var editMaterialCode = $("#EditMaterialCode").val();
@ -5463,7 +5502,6 @@ if (!empty($getlogpodtl)) {
function Save(status) {
//alert();
if (status == '0') {
@ -5477,30 +5515,24 @@ if (!empty($getlogpodtl)) {
$('#txtStatus').val(stat);
//var txtRowCount = $('#txtRowCount').val();
//var Row=$('#txtRow').val();
//alert(Row);
//exit();
tinyMCE.triggerSave();
var Row = $('#txtRow').val();
//alert(Row);
var txtDeletedRow = $('#txtDeletedRow').val();
//alert(Row);
//alert(txtRowCount);
//exit();
//var TotalOrder=$('#txtToatlOrder').val();
//alert(TotalOrder);
//exit();
if (validate() && Budgetcheck()) { //alert();
if (validate() && Budgetcheck()) {
if (document.getElementById('ImportTax').rows.length <= 0) {
alert('Please Select Line item to Create PO');
$('#Deliverydt').focus();
return false;
} else {
//alert();
// $('#content').loader('show');
var formData = new FormData($('.ImportPO')[0]);
formData.append('txtRowCount', Row);
@ -5515,19 +5547,19 @@ if (!empty($getlogpodtl)) {
type: "POST",
url: "<?php echo base_url() ?>purchaseorder/EditImportPurchaseOrder",
success: function(data) {
console.log(data);
// if (data) {
// // $('#content').loader('hide');
// alert(data);
// $('#txtRowCount').val('');
// $('#txtDeletedRow').val('');
// //$('#SpcialInstruction').val('');
// //$('#txtDeliveryAddress').val('');
// window.location = "purchaseorderListing";
// console.log(data);
if (data) {
// // $('#content').loader('hide');
alert(data);
$('#txtRowCount').val('');
$('#txtDeletedRow').val('');
//$('#SpcialInstruction').val('');
//$('#txtDeliveryAddress').val('');
window.location = "purchaseorderListing";
// } else {
// alert("Error");
// }
} else {
alert("Error");
}
}
@ -5685,10 +5717,7 @@ if (!empty($getlogpodtl)) {
function calculateFreight(isEdit) {
//alert();
if (isEdit == '0') { //alert();
if (isEdit == '0') {
if ($('#MaterialCode').val() == "0") {
alert('Please Select the Material Code');
$('#MaterialCode').focus();
@ -5711,7 +5740,6 @@ if (!empty($getlogpodtl)) {
var FreightValue = parseFloat($('#addtxtFreight').val());
var UOM = parseFloat($('#UOM').val());
var Quantity = parseFloat($('#Quantity').val());
//alert(FreightType);
var AfterFreight = 0.0;
if (FreightType == PercentageType) {
AfterFreight = <?php echo FREIGHT_PERCENTAGE; ?>;
@ -5754,7 +5782,6 @@ if (!empty($getlogpodtl)) {
// alert('af');
if ($('#EditMaterialCode').val() == '') {
alert('Please Select the Material Code');
$('#EditMaterialCode').focus();
@ -5776,7 +5803,6 @@ if (!empty($getlogpodtl)) {
var FreightValue = parseFloat($('#edittxtFreight').val());
var UOM = parseFloat($('#EditUOM').val());
var Quantity = parseFloat($('#EditQuantity').val());
//alert(FreightType);
var AfterFreight = 0.0;
if (FreightType == PercentageType) {
AfterFreight = <?php echo FREIGHT_PERCENTAGE; ?>;
@ -5814,7 +5840,6 @@ if (!empty($getlogpodtl)) {
// calculateEditTotalValue();
} else {
//alert();
var basicValue = parseFloat($('#ViewINRBasicvalue').val());
///console.log(basicValue);
@ -5827,7 +5852,6 @@ if (!empty($getlogpodtl)) {
var FreightValue = parseFloat($('#viewtxtFreight').val());
var UOM = parseFloat($('#ViewUOM').val());
var Quantity = parseFloat($('#ViewQuantity').val());
//alert(FreightType);
var AfterFreight = 0.0;
if (FreightType == PercentageType) {
AfterFreight = <?php echo FREIGHT_PERCENTAGE; ?>;

View File

@ -732,9 +732,9 @@ if (isset($AvlimportBudAmt) && !empty($AvlimportBudAmt)) {
<th>UOM</th>
<th>Rate<?php echo $INR ?></th>
<th>Basic Amount<?php echo $INR ?></th>
<th>Received Qty</th>
<th>Rejected Qty</th>
<th>Pending Qty</th>
<!-- <th>Received Qty</th> -->
<!-- <th>Rejected Qty</th> -->
<!-- <th>Pending Qty</th> -->
<!-- <th>Tax Amount</th>
<th>Total Order Amount</th> -->
<th>Action</th>
@ -3461,9 +3461,6 @@ if (isset($AvlimportBudAmt) && !empty($AvlimportBudAmt)) {
<td align="left">${uom}</td>
<td align="left">${itemRate}</td>
<td align="left">${BasicAmt}</td>
<td align="left">${receivedqty}</td>
<td align="left">${rejectedqty}</td>
<td align="left">${pendingqty}</td>
<td>
<a data-target='#editimportpomodel' data-id="${temp}" data-userid="${temp}" data-toggle="modal" href="#editimportpomodel">
<i class="ri-pencil-fill" data-toggle="tooltip"></i>
@ -3475,6 +3472,9 @@ if (isset($AvlimportBudAmt) && !empty($AvlimportBudAmt)) {
</tr>
`;
// <td align="left">${receivedqty}</td>
// <td align="left">${rejectedqty}</td>
// <td align="left">${pendingqty}</td>
// Append the generated row HTML to the target element
$('#ImportAppend').append(rowHtml);

View File

@ -59,6 +59,7 @@
<script src="<?php echo base_url(); ?>public/new_assets/js/pages/form-wizard.init.js"></script>
<script>
$(document).ready(function() {
$('select').addClass('form-control');
form = $(".form-date-search")
.datepicker({
autoclose: true,

View File

@ -494,9 +494,9 @@ if (!empty($INRSYMBOL)) {
});
$('#packagingcalmodel').on('hidden.bs.modal', function() {
// Reopen the first modal when the second modal is closed
if(edit == 'PackingCalculationOn'){
if (edit == 'PackingCalculationOn') {
$('#REVENUE').modal('show');
}else if(edit == 'EditPackingCalculationOn'){
} else if (edit == 'EditPackingCalculationOn') {
$('#EDITREVENUE').modal('show');
}
});
@ -633,7 +633,7 @@ if (!empty($INRSYMBOL)) {
if (selValue == PercentageType) {
var freightCalculation = '';
$('#REVENUE').modal('hide');
edit = 'FreightCalculationOn';
freight = 'FreightCalculationOn';
$('#freightcalmodel').modal('show');
//$('#freightcalmodel').modal('blur');
$('#txtFreight').removeAttr('readonly', 'true');
@ -656,9 +656,9 @@ if (!empty($INRSYMBOL)) {
$('#freightcalmodel').on('hidden.bs.modal', function() {
// Reopen the first modal when the second modal is closed
if(edit == 'FreightCalculationOn'){
if (freight == 'FreightCalculationOn') {
$('#REVENUE').modal('show');
}else if(edit == 'EditFreightCalculationOn'){
} else if (freight == 'EditFreightCalculationOn') {
$('#EDITREVENUE').modal('show');
}
});
@ -677,7 +677,7 @@ if (!empty($INRSYMBOL)) {
if (selValue == PercentageType) {
var FreightCalculation = '';
// $('#freight').modal('show');
edit = 'EditFreightCalculationOn';
freight = 'EditFreightCalculationOn';
$('#EDITREVENUE').modal('hide');
$('#freightcalmodel').modal('show');
$('#txtEditFreight').removeAttr('readonly', 'true');
@ -3077,7 +3077,7 @@ if (!empty($INRSYMBOL)) {
</div>
</div>
<div class="modal-footer" style="border:none;>
<a class="btn btn-secondary waves-effect" data-dismiss="modal" value="Cancel">Cancel</a>&nbsp;&nbsp;&nbsp;&nbsp;
<a class=" btn btn-secondary waves-effect" data-dismiss="modal" value="Cancel">Cancel</a>&nbsp;&nbsp;&nbsp;&nbsp;
<a class="btn btn-info waves-effect waves-light EditRevenue" ID="EditRevenue"> &nbsp;&nbsp;<span class="bold">Edit Revenue</span></a>
</div>
</form>
@ -4036,12 +4036,11 @@ if (!empty($INRSYMBOL)) {
var Freight = $('#txtAfterFreight').val() == '' ? '0.00' : $('#txtAfterFreight').val();
var Insurance = $('#txtInsurance').val() == '' ? '0.00' : $('#txtInsurance').val();
var Discount = $('#txtAfterDiscount').val() == '' ? '0.00' : $('#txtAfterDiscount').val();
var txtEditAfterPackaging = $('#txtEditAfterPackaging').val() == '' ? '0.00' : $('#txtEditAfterPackaging').val();
var totvalue = parseFloat(AfterCgst) + parseFloat(AfterSgst) + parseFloat(AfterIgst);
var tot = parseFloat(totvalue).toFixed(2);
//alert('tot:'+tot);
// alert('tot:'+tot);
return tot;
}