commit alterpurchaseorder.php
This commit is contained in:
parent
6e05f847ab
commit
969b3089a5
@ -94,9 +94,9 @@ if(!empty($CompanyDetails))
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
var SelectedMaterialList = {
|
var SelectedMaterialList = {
|
||||||
Mat: []
|
Mat: []
|
||||||
};
|
};
|
||||||
|
|
||||||
/* $('#drpSupplier').change(function() {
|
/* $('#drpSupplier').change(function() {
|
||||||
|
|
||||||
@ -326,7 +326,7 @@ var SelectedMaterialList = {
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* To calcuate the Discount */
|
* To calcuate the Discount */
|
||||||
function calculateDiscount(isEdit)
|
function calculateDiscount(isEdit)
|
||||||
{
|
{
|
||||||
if(isEdit == '0')
|
if(isEdit == '0')
|
||||||
{
|
{
|
||||||
@ -447,7 +447,7 @@ function calculateDiscount(isEdit)
|
|||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* To calcuate the Packaging */
|
* To calcuate the Packaging */
|
||||||
function calculatePackaging(isEdit)
|
function calculatePackaging(isEdit)
|
||||||
{
|
{
|
||||||
if(isEdit == '0')
|
if(isEdit == '0')
|
||||||
{
|
{
|
||||||
@ -1463,10 +1463,10 @@ function calculatePackaging(isEdit)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
function change(){
|
function change(){
|
||||||
var isEdit=0;
|
var isEdit=0;
|
||||||
// ExceedEditQuantityCheck();
|
//ExceedEditQuantityCheck();
|
||||||
if($('#Quantity').val() != '' && $('#Rate').val() != '')
|
if($('#Quantity').val() != '' && $('#Rate').val() != '')
|
||||||
{
|
{
|
||||||
var txtQuantity = parseFloat( $('#Quantity').val());
|
var txtQuantity = parseFloat( $('#Quantity').val());
|
||||||
@ -1515,7 +1515,7 @@ function calculatePackaging(isEdit)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function ExceedQuantityCheck()
|
function ExceedQuantityCheck()
|
||||||
@ -1550,7 +1550,7 @@ function calculatePackaging(isEdit)
|
|||||||
var tot = parseFloat(totvalue).toFixed(2);
|
var tot = parseFloat(totvalue).toFixed(2);
|
||||||
|
|
||||||
$('#txtEditRevenueTotalOrderValue').val(tot);
|
$('#txtEditRevenueTotalOrderValue').val(tot);
|
||||||
validateEditExceedLimit();
|
// validateEditExceedLimit();
|
||||||
}
|
}
|
||||||
// calculate vat rate
|
// calculate vat rate
|
||||||
|
|
||||||
@ -1658,7 +1658,7 @@ function calculatePackaging(isEdit)
|
|||||||
$("#CostCenterName").select2();
|
$("#CostCenterName").select2();
|
||||||
});
|
});
|
||||||
function DeleteRevenueRow(rowid)
|
function DeleteRevenueRow(rowid)
|
||||||
{
|
{
|
||||||
var DelRows = $('#txtDeletedRow1').val();
|
var DelRows = $('#txtDeletedRow1').val();
|
||||||
|
|
||||||
//alertMaterialListrowid);
|
//alertMaterialListrowid);
|
||||||
@ -1696,10 +1696,10 @@ function calculatePackaging(isEdit)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function populateValueMainFormForDeleteItem(rowid)
|
function populateValueMainFormForDeleteItem(rowid)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
// alert(rows);
|
// alert(rows);
|
||||||
@ -1757,12 +1757,12 @@ function populateValueMainFormForDeleteItem(rowid)
|
|||||||
$('#txtTotalInsurance').val(parseFloat(totInsuranceAmt).toFixed(2) );
|
$('#txtTotalInsurance').val(parseFloat(totInsuranceAmt).toFixed(2) );
|
||||||
$('#txtTotalOrderValueSummary').val(parseFloat(totOrderSummaryAmt).toFixed(2) );
|
$('#txtTotalOrderValueSummary').val(parseFloat(totOrderSummaryAmt).toFixed(2) );
|
||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style>
|
||||||
.num{
|
.num{
|
||||||
text-align:right;
|
text-align:right;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<div class="content-wrapper">
|
<div class="content-wrapper">
|
||||||
<?php
|
<?php
|
||||||
@ -1786,11 +1786,12 @@ function populateValueMainFormForDeleteItem(rowid)
|
|||||||
|
|
||||||
if(!empty($RequestType))
|
if(!empty($RequestType))
|
||||||
{
|
{
|
||||||
|
|
||||||
foreach ($RequestType as $RID):
|
foreach ($RequestType as $RID):
|
||||||
|
if($RID->ConfigValue=="SERVICE" || $RID->ConfigValue=="REVENUE")
|
||||||
|
{
|
||||||
$options[$RID->ConfigValue] = $RID->ConfigValue;
|
$options[$RID->ConfigValue] = $RID->ConfigValue;
|
||||||
|
}
|
||||||
endforeach;
|
endforeach;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1803,7 +1804,7 @@ function populateValueMainFormForDeleteItem(rowid)
|
|||||||
<label>Purchase Order Date</label>
|
<label>Purchase Order Date</label>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<?php
|
<?php
|
||||||
$data = array('name' => 'PODate','value' => set_value('PODate'),'id'=>'PODate', 'class' => 'form-control num' ,'required' => 'true');
|
$data = array('name' => 'PODate','value' => set_value('PODate',$CurrentDate),'id'=>'PODate', 'class' => 'form-control num' ,'required' => 'true');
|
||||||
echo form_input($data);
|
echo form_input($data);
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
@ -1893,7 +1894,7 @@ function populateValueMainFormForDeleteItem(rowid)
|
|||||||
<label>Delivery Date</label>
|
<label>Delivery Date</label>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$data = array('name' => 'Deliverydt','value' => set_value('Deliverydt'),'id'=>'Deliverydt', 'class' => 'form-control num' ,'required' => 'true');
|
$data = array('name' => 'Deliverydt','value' => set_value('Deliverydt',$CurrentDate),'id'=>'Deliverydt', 'class' => 'form-control num' ,'required' => 'true');
|
||||||
echo form_input($data);
|
echo form_input($data);
|
||||||
?>
|
?>
|
||||||
|
|
||||||
@ -4528,10 +4529,10 @@ function populateValueMainFormForDeleteItem(rowid)
|
|||||||
<br/>
|
<br/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div> </div>
|
</div> </div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<script type="text/html" id="RevenueList">
|
<script type="text/html" id="RevenueList">
|
||||||
<tr id="<%=index%>">
|
<tr id="<%=index%>">
|
||||||
<td align="left"><%=index%></td>
|
<td align="left"><%=index%></td>
|
||||||
<td align="left"><%=ReqNo%></td>
|
<td align="left"><%=ReqNo%></td>
|
||||||
@ -4550,13 +4551,14 @@ function populateValueMainFormForDeleteItem(rowid)
|
|||||||
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
var index = '1';
|
var index = '1';
|
||||||
var userid = '';
|
var userid = '';
|
||||||
$('.AddRevenue').click(function(){
|
$('.AddRevenue').click(function(){
|
||||||
|
|
||||||
if(validateRevenueTax() && validateExceedLimit())
|
|
||||||
|
if(validateRevenueTax() && ExceedBudget($('#txtTotalOrderValue').val(), $('#AvalBuget').val()))
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
@ -4768,8 +4770,8 @@ function populateValueMainFormForDeleteItem(rowid)
|
|||||||
$("#txtInsurance").val('');
|
$("#txtInsurance").val('');
|
||||||
$("#txtTotalOrderValue").val('');
|
$("#txtTotalOrderValue").val('');
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
var SelectedMaterialCode = [];
|
var SelectedMaterialCode = [];
|
||||||
var CollIndex = 0;
|
var CollIndex = 0;
|
||||||
function Save()
|
function Save()
|
||||||
@ -5047,10 +5049,10 @@ function populateValueMainFormForDeleteItem(rowid)
|
|||||||
$('#purpose').change(function(){
|
$('#purpose').change(function(){
|
||||||
var input='';
|
var input='';
|
||||||
input=$("#purpose").val();
|
input=$("#purpose").val();
|
||||||
if(input == -1){
|
if(input == -1){
|
||||||
$("#POType").val('');
|
$("#POType").val('');
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$("#POType").val(input);
|
$("#POType").val(input);
|
||||||
// $('#content').loader('show');
|
// $('#content').loader('show');
|
||||||
@ -5498,7 +5500,7 @@ if(input == -1){
|
|||||||
type:"POST",
|
type:"POST",
|
||||||
url:"<?php echo base_url() ?>emergencypurchaseorder/getMaterialCode?input="+EditPoType,
|
url:"<?php echo base_url() ?>emergencypurchaseorder/getMaterialCode?input="+EditPoType,
|
||||||
success:function(data) {
|
success:function(data) {
|
||||||
$('#content').loader('hide');
|
$('#content').loader('hide');
|
||||||
if(data)
|
if(data)
|
||||||
{
|
{
|
||||||
EditGetMaterialData=data;
|
EditGetMaterialData=data;
|
||||||
@ -5709,7 +5711,7 @@ $('#content').loader('hide');
|
|||||||
var TotSwachhTax = 0;
|
var TotSwachhTax = 0;
|
||||||
var TotSummary = 0;
|
var TotSummary = 0;
|
||||||
var TotBasicAmout = 0;
|
var TotBasicAmout = 0;
|
||||||
for (i = 1; i < rows-1; i++) {
|
for (i = 1; i < rows; i++) {
|
||||||
|
|
||||||
var AfterServiceTax = $('#ServiceTax'+i).val() == '' ? '0.00' : $('#ServiceTax'+i).val();
|
var AfterServiceTax = $('#ServiceTax'+i).val() == '' ? '0.00' : $('#ServiceTax'+i).val();
|
||||||
var AfterEduCess = $('#EduCess'+i).val() == '' ? '0.00' : $('#EduCess'+i).val();
|
var AfterEduCess = $('#EduCess'+i).val() == '' ? '0.00' : $('#EduCess'+i).val();
|
||||||
@ -5814,12 +5816,17 @@ $('#content').loader('hide');
|
|||||||
if(validate())
|
if(validate())
|
||||||
{
|
{
|
||||||
|
|
||||||
if(document.getElementById('serviceTax').rows.length < 3)
|
if(document.getElementById('serviceTax').rows.length < 2)
|
||||||
{
|
{
|
||||||
alert('Please Select Line item to Create PO');
|
alert('Please Select Line item to Create PO');
|
||||||
$('#Deliverydt').focus();
|
$('#Deliverydt').focus();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
else if($('#AvalBuget').val() < TextTotalOrderValueSummaryService) {
|
||||||
|
alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.');
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$('#content').loader('show');
|
$('#content').loader('show');
|
||||||
@ -5882,12 +5889,17 @@ $('#content').loader('hide');
|
|||||||
|
|
||||||
if(validate())
|
if(validate())
|
||||||
{
|
{
|
||||||
if(document.getElementById('serviceTax').rows.length < 3)
|
if(document.getElementById('serviceTax').rows.length < 2)
|
||||||
{
|
{
|
||||||
alert('Please Select Line item to Create PO');
|
alert('Please Select Line item to Create PO');
|
||||||
$('#Deliverydt').focus();
|
$('#Deliverydt').focus();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
else if($('#AvalBuget').val() < txtTotalOrderValueSummary) {
|
||||||
|
alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.');
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$('#content').loader('show');
|
$('#content').loader('show');
|
||||||
@ -5925,7 +5937,8 @@ $('#content').loader('hide');
|
|||||||
*/
|
*/
|
||||||
function populateValueMainFormForDeleteServiceTax(deletedRow)
|
function populateValueMainFormForDeleteServiceTax(deletedRow)
|
||||||
{
|
{
|
||||||
var rows = document.getElementById('serviceTax').rows.length+1;
|
|
||||||
|
var rows = document.getElementById('serviceTax').rows.length;
|
||||||
var TotServiceTax = 0;
|
var TotServiceTax = 0;
|
||||||
var TotEduCess = 0;
|
var TotEduCess = 0;
|
||||||
var TotSecHighTax = 0;
|
var TotSecHighTax = 0;
|
||||||
@ -5933,7 +5946,8 @@ $('#content').loader('hide');
|
|||||||
var TotSwachhTax = 0;
|
var TotSwachhTax = 0;
|
||||||
var TotSummary = 0;
|
var TotSummary = 0;
|
||||||
var TotBasicAmout = 0;
|
var TotBasicAmout = 0;
|
||||||
for (var i = 1; i < rows; i++) {
|
for (var i = 1; i <= rows; i++) {
|
||||||
|
|
||||||
if(deletedRow==i){
|
if(deletedRow==i){
|
||||||
$('#ServiceTax'+i).val('');
|
$('#ServiceTax'+i).val('');
|
||||||
$('#EduCess'+i).val('');
|
$('#EduCess'+i).val('');
|
||||||
@ -6176,7 +6190,7 @@ $('#content').loader('hide');
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
$('#EditRevenueMaterialCode').change(function(){
|
$('#EditRevenueMaterialCode').change(function(){
|
||||||
|
|
||||||
var editselectedMaterialCode='';
|
var editselectedMaterialCode='';
|
||||||
@ -6193,7 +6207,7 @@ $('#content').loader('hide');
|
|||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
$('.EditRevenue').click(function(){
|
$('.EditRevenue').click(function(){
|
||||||
|
|
||||||
|
|
||||||
if(validateEditRevenueTax() && validateEditExceedLimit())
|
if(validateEditRevenueTax() && validateEditExceedLimit())
|
||||||
@ -6345,7 +6359,7 @@ $('.EditRevenue').click(function(){
|
|||||||
|
|
||||||
}
|
}
|
||||||
function populateValueMainFormForEditRevenueTax()
|
function populateValueMainFormForEditRevenueTax()
|
||||||
{
|
{
|
||||||
|
|
||||||
var rows = document.getElementById('serviceTax').rows.length;
|
var rows = document.getElementById('serviceTax').rows.length;
|
||||||
//alert(rows);
|
//alert(rows);
|
||||||
@ -6416,9 +6430,9 @@ $('.EditRevenue').click(function(){
|
|||||||
$('#txtTotalInsurance').val(parseFloat(totInsuranceAmt).toFixed(2) );
|
$('#txtTotalInsurance').val(parseFloat(totInsuranceAmt).toFixed(2) );
|
||||||
$('#txtTotalOrderValueSummary').val(parseFloat(totOrderSummaryAmt).toFixed(2) );
|
$('#txtTotalOrderValueSummary').val(parseFloat(totOrderSummaryAmt).toFixed(2) );
|
||||||
|
|
||||||
}
|
}
|
||||||
// this function is used to clear data changing schedule option
|
// this function is used to clear data changing schedule option
|
||||||
$('#Scheduleby').change(function(){
|
$('#Scheduleby').change(function(){
|
||||||
|
|
||||||
$("#Deliverydt").datepicker({
|
$("#Deliverydt").datepicker({
|
||||||
minDate : 'now',
|
minDate : 'now',
|
||||||
@ -6433,5 +6447,5 @@ $('#Scheduleby').change(function(){
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user