Capital and emergency po changes done

This commit is contained in:
venbatechnologies@gmail.com 2017-08-02 16:24:12 +05:30
parent 316943bbfc
commit 48d78227c9
9 changed files with 358 additions and 76 deletions

View File

@ -91,7 +91,7 @@ class emergencypurchaseorder extends BaseController
}
//This used to Create Service Purchase Order
function addNewServicePurchaseOrder()
function addNewServicePurchaseOrder()
{
@ -128,7 +128,7 @@ class emergencypurchaseorder extends BaseController
$createddt = $dt->format('Y-m-d H:i:s');
$PaymentTerms=$this->input->post('PaymentMethod');
$OtherPayment=$this->input->post('Otherpayment');
$ServiceWorkStatus=$this->input->post('workStatus');
@ -149,7 +149,7 @@ class emergencypurchaseorder extends BaseController
// PO Master
$POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'Status'=>$POStatus,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'PaymentTerms'=>$PaymentTerms,'ServiceWorkStatus'=>$ServiceWorkStatus,'POType'=>$POType);
$POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'Status'=>$POStatus,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'PaymentTerms'=>$PaymentTerms,'ServiceWorkStatus'=>$ServiceWorkStatus,'POType'=>$POType,'PaymentOtherDescription'=>$OtherPayment);
$POMaster = $this->purchaseorder_model->addPOMaster($POList);
$PONO = '';
@ -288,7 +288,7 @@ class emergencypurchaseorder extends BaseController
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
$createddt = $dt->format('Y-m-d H:i:s');
$PaymentTerms=$this->input->post('PaymentMethod');
$OtherPayment=$this->input->post('Otherpayment');
//add requistion
@ -302,7 +302,7 @@ class emergencypurchaseorder extends BaseController
$RegNo = $Req[0]['ReqNo'];
}
// PO Master
$POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'Status'=>$POStatus,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'PORange'=>$PoRange,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'PaymentTerms'=>$PaymentTerms,'POType'=>$POType,'CapitalRange'=>$Local_Interstate );
$POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'Status'=>$POStatus,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'PORange'=>$PoRange,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'PaymentTerms'=>$PaymentTerms,'POType'=>$POType,'CapitalRange'=>$Local_Interstate,'PaymentOtherDescription'=>$OtherPayment);
$POMaster = $this->purchaseorder_model->addPOMaster($POList);
@ -335,6 +335,7 @@ class emergencypurchaseorder extends BaseController
$FreightType = $this->input->post('FreightType'.$i);
$FreightValue = $this->input->post('FreightVal'.$i);
$AfterFreightValue = $this->input->post('AfterFreightVal'.$i);
$NOOfTrip = $this->input->post('NoOfTrip'.$i);
$InsuranceValue = $this->input->post('Insval'.$i);
$TotalOrderValue = $this->input->post('TotalOrderValue'.$i);
$CostCenter = $this->input->post('costCode'.$i);
@ -381,7 +382,7 @@ class emergencypurchaseorder extends BaseController
if(trim($POType) == REVENUE )
{
// echo 'Success';
$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, 'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt, 'CGST'=>$Cgst,'AfterCGST'=>$AfterCgst,'SGST'=>$Sgst,'AfterSGST'=>$AfterSgst,'IGST'=>$Igst,'AfterIGST'=>$AfterIgst);
$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, 'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt, 'CGST'=>$Cgst,'AfterCGST'=>$AfterCgst,'SGST'=>$Sgst,'AfterSGST'=>$AfterSgst,'IGST'=>$Igst,'AfterIGST'=>$AfterIgst,'NoOfTrip'=>$NOOfTrip);
$RevenueList = $this->purchaseorder_model->addRevenueTax($RevenueTaxList);
//echo 'Revenue tax Success';

View File

@ -2076,7 +2076,7 @@ function addNewImportPurchaseOrder()
}
$PaymentMethod = $this->input->post('PaymentMethod');
$OtherPayment=$this->input->post('Otherpayment');
@ -2097,7 +2097,7 @@ function addNewImportPurchaseOrder()
$createddt = $dt->format('Y-m-d H:i:s');
$currencytypeID = $this->input->post('currencytype');
$POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ExchangeRateCalculatedon'=>$ExchangeRateOn,'ExchangeRate'=>$ExchangeRate,'PaymentTerms'=>$PaymentMethod,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'CapitalRange'=>$CapitalRange,'POType'=>$POType,'CurrencyType'=>$currencytypeID,'DeliverySchedule'=>$DeliverySchedule,'Import_PlaceofOrgin'=>$Palaceoforigin,'Import_DispatchDetails'=>$Dispatch,'DeliveryDate'=>$Deliverydt);
$POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ExchangeRateCalculatedon'=>$ExchangeRateOn,'ExchangeRate'=>$ExchangeRate,'PaymentTerms'=>$PaymentMethod,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'CapitalRange'=>$CapitalRange,'POType'=>$POType,'CurrencyType'=>$currencytypeID,'DeliverySchedule'=>$DeliverySchedule,'Import_PlaceofOrgin'=>$Palaceoforigin,'Import_DispatchDetails'=>$Dispatch,'DeliveryDate'=>$Deliverydt,'PaymentOtherDescription'=>$OtherPayment);
// $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'Import_DispatchDetails'=>$Dispatch,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ExchangeRate'=>$Exchangerate,'ExchangeRateCalculatedon'=>$ExchangeRateCalculatedon,'CurrencyType'=>$CurrencyType,'PaymentTerms'=>$PaymentTerms,'POType'=>$POType,'Import_PlaceofOrgin'=>$Palaceoforigin);
@ -2301,7 +2301,7 @@ function addNewImportPurchaseOrder()
$ExchangeRate=$this->input->post('ExchangeRt');
}
$PaymentMethod = $this->input->post('PaymentMethod');
$OtherPayment=$this->input->post('Otherpayment');
@ -2323,7 +2323,7 @@ function addNewImportPurchaseOrder()
$updateddt = $dt->format('Y-m-d H:i:s');
$POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ExchangeRate'=>$ExchangeRate,'ExchangeRateCalculatedon'=>$ExchangeRateOn,'PaymentTerms'=>$PaymentMethod,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'CurrencyType'=>$currencytypeID,'DeliverySchedule'=>$DeliverySchedule,'Import_PlaceofOrgin'=>$Palaceoforigin,'Import_DispatchDetails'=>$Dispatch,'DeliveryDate'=>$Deliverydt);
$POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ExchangeRate'=>$ExchangeRate,'ExchangeRateCalculatedon'=>$ExchangeRateOn,'PaymentTerms'=>$PaymentMethod,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'CurrencyType'=>$currencytypeID,'DeliverySchedule'=>$DeliverySchedule,'Import_PlaceofOrgin'=>$Palaceoforigin,'Import_DispatchDetails'=>$Dispatch,'DeliveryDate'=>$Deliverydt,'PaymentOtherDescription'=>$OtherPayment);
$POMaster = $this->purchaseorder_model->updatePOMaster($PONO,$POList);

View File

@ -62,7 +62,7 @@ if(!empty($POMaster))
$DeliveryAddress =$Req->DeliveryAddress;
$PONOStatus = $Req->StatusCode;
$PONO = $Req->PONO;
$PONO = $Req->PONO;
$ServiceDescription = $Req->ServiceDescription;
@ -2728,6 +2728,8 @@ tinyMCE.triggerSave();
var splinstr = $('#ScopeOfWork').val();
$('#ScopeOfWork').val(splinstr);
$('#txtDeliveryAddress').val(deladd);
var AvlBudAmt = '<?php echo $AvlAmount ?>';
var txtTotalOrderValueSummary = $('#txtTotalOrderValueSummary').val();
if(validate())
{
@ -2737,6 +2739,11 @@ $('#txtDeliveryAddress').val(deladd);
$('#Deliverydt').focus();
return false;
}
else if(parseInt(AvlBudAmt) < parseInt(txtTotalOrderValueSummary)) {
alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.');
return false;
}
else if($('#Otherpayment').val()=='' && $('#PaymentTerms').val()=='PT08'){
alert('Please Enter Other Payment Details');
$('#Otherpayment').focus();

View File

@ -1,4 +1,3 @@
<?php $ReqType =''; ?>
<?php $ReqType ='';
$CompanyAddress = '';
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
@ -279,8 +278,38 @@ var SelectedMaterialList = {
$('#txtDiscount').val('');
$('#txtAfterDiscount').val('');
}
calculatePackaging(0);
});
$('#EditDiscountType').change(function() {
if($('#EditRevenueRate').val() != '' && $('#EditRevenueMaterialCode').val() != "0" )
{
selValue = $("#EditDiscountType").val();
$('#txtEditDiscount').val('');
$('#txtEditAfterDiscount').val('');
if (selValue == NilType)
{
$('#txtEditDiscount').attr('readonly', 'true');
$('#txtEditDiscount').val('0.00');
$('#txtEditAfterDiscount').val('0.00');
}
else
{
$('#txtEditDiscount').removeAttr( 'readonly','true' );
$('#txtEditDiscount').val('');
$('#txtEditAfterDiscount').val('');
}
}
else
{
alert('Please Select MaterialCode and Rate Field Value');
$('#EditDiscountType').val("0");
$('#EditRate').focus();
}
calculateDiscount(1);
});
$('#PackagingType').change(function() {
$('#txtPackaging').val('');
@ -306,8 +335,34 @@ var SelectedMaterialList = {
$('#txtPackaging').removeAttr( 'readonly','true' );
}
}
calculatePackaging(0);
});
$('#EditPackagingType').change(function() {
$('#txtEditPackaging').val('');
$('#txtEditAfterPackaging').val('');
selValue = $("#EditPackagingType").val() ;
if(selValue == PercentageType)
{
var PackagingCalculation = '';
$('#packagingcalmodel').modal('show');
$('#txtEditPackaging').removeAttr( 'readonly','true' );
}
else
{
if (selValue == NilType)
{
$('#txtEditPackaging').attr('readonly', 'true');
$('#txtEditPackaging').val('0.00');
}
else
{
$('#txtEditPackaging').removeAttr( 'readonly','true' );
}
}
calculatePackaging(1);
});
$('#txtExciseDuty').change(function() {
if(ExciseCalculation == '')
@ -335,7 +390,7 @@ var SelectedMaterialList = {
});
$('#drpEditFreight').change(function() {
var FreightType =$("#drpEditFreight").val();
alert(FreightType);
if (FreightType == "PER TRIP")
{
@ -344,11 +399,12 @@ var SelectedMaterialList = {
else {
$('#EditTripsValue').hide();
}
}
calculateFreight(1);
});
$('#drpFreight').change(function() {
var FreightType =$("#drpFreight").val();
alert(FreightType);
if (FreightType == "PER TRIP")
{
@ -376,6 +432,7 @@ var SelectedMaterialList = {
}
calculateFreight(0);
});
});
@ -1411,8 +1468,23 @@ function calculatePackaging(isEdit)
AfterFreight = <?php echo FREIGHT_PERUOM;?>;
}
else if(FreightType == '<?php echo PERTRIP;?>')
{
AfterFreight = <?php echo FREIGHT_PERTRIP;?>;
{
if($('#NOOfTrips').val()==''){
alert('Please Enter No of Trip');
$("#NOOfTrips").focus();
$('#txtFreight').val(0)
AfterFreight=0;
$('#txtAfterFreight').val("0.00");
return false;
}
else{
var noOftrip = $("#NOOfTrips").val();
AfterFreight = <?php echo FREIGHT_PERTRIP;?>;
AfterFreight = parseFloat(AfterFreight * noOftrip).toFixed(2);
}
}
else {
AfterFreight = $("#txtFreight").val();
@ -1480,7 +1552,20 @@ function calculatePackaging(isEdit)
}
else if(FreightType == '<?php echo PERTRIP;?>')
{
AfterFreight = <?php echo FREIGHT_PERTRIP;?>;
if($('#EditNOOfTrips').val()==''){
alert('Please Enter No of Trip');
$("#EditNOOfTrips").focus();
$('#txtEditFreight').val(0)
AfterFreight=0;
$('#txtEditAfterFreight').val("0.00");
return false;
}
else{
var noOftrip = $("#EditNOOfTrips").val();
AfterFreight = <?php echo FREIGHT_PERTRIP;?>;
AfterFreight = parseFloat(AfterFreight * noOftrip).toFixed(2);
}
}
else {
AfterFreight = $("#txtEditFreight").val();
@ -2978,7 +3063,7 @@ function populateValueMainFormForDeleteItem(rowid)
<label>NO Of Trips</label>
<div class="form-group">
<?php
$data = array('name' => 'EditNOOfTrips','value' => set_value('EditNOOfTrips'),'id'=>'EditNOOfTrips', 'class' => 'form-control num' );
$data = array('name' => 'EditNOOfTrips','value' => set_value('EditNOOfTrips'),'id'=>'EditNOOfTrips', 'class' => 'form-control num' ,'onchange'=>'calculateFreight(1);');
echo form_input($data);
?>
</div>
@ -3299,7 +3384,7 @@ function populateValueMainFormForDeleteItem(rowid)
<label>NO Of Trips</label>
<div class="form-group">
<?php
$data = array('name' => 'NOOfTrips','value' => set_value('NOOfTrips'),'id'=>'NOOfTrips', 'class' => 'form-control num' );
$data = array('name' => 'NOOfTrips','value' => set_value('NOOfTrips'),'id'=>'NOOfTrips', 'class' => 'form-control num' ,'onchange'=>'calculateFreight(0);');
echo form_input($data);
?>
</div>
@ -4923,7 +5008,7 @@ function populateValueMainFormForDeleteItem(rowid)
var FreightType = $("#drpFreight").val();
var FreightVal = $("#txtFreight").val();
var AfterFreightVal = $("#txtAfterFreight").val();
var NoOfTrip = $("#NOOfTrips").val();
var basicval = $("#txtBasicValue").val();
var Insval = $("#txtInsurance").val();
var TotalOrderValue = $("#txtTotalOrderValue").val();
@ -4948,7 +5033,7 @@ function populateValueMainFormForDeleteItem(rowid)
$('#RevenueAppend').append(_.template(template,{index:temp,ReqNo:Reqnumber,MaterialCode:materialCode,MaterialName:materialName,Quantity:quantity,UOM:uom,Rate:itemRate,BasicAmount:basicval,Taxvalue:TotalTaxValue,TotalValue:TotalOrderValue}));
clearRevenueModalFields();
var theForm = $(".CreatealterPO");
addHidden(theForm,"Reqnumber"+temp,Reqnumber );
@ -4971,6 +5056,7 @@ function populateValueMainFormForDeleteItem(rowid)
addHidden(theForm,"FreightType"+temp,FreightType);
addHidden(theForm,"FreightVal"+temp,FreightVal);
addHidden(theForm,"AfterFreightVal"+temp,AfterFreightVal);
addHidden(theForm,"NoOfTrip"+temp,NoOfTrip);
addHidden(theForm,"basicval"+temp,basicval);
addHidden(theForm,"Insval"+temp,Insval);
@ -4984,7 +5070,7 @@ function populateValueMainFormForDeleteItem(rowid)
addHidden(theForm,"RevenueIgst"+temp,Igst);
addHidden(theForm,"RevenueAfterIgst"+temp,AfterIgst);
$('#txtRowCount1').val(temp);
clearRevenueModalFields();
// $('#REVENUE').modal('hide');
}
@ -5073,7 +5159,7 @@ function populateValueMainFormForDeleteItem(rowid)
$("#drpFreight").val('0');
$("#txtFreight").val('');
$("#txtAfterFreight").val('');
$("#NOOfTrips").val('');
$("#txtBasicValue").val('');
$("#txtInsurance").val('');
$("#txtTotalOrderValue").val('');
@ -5183,6 +5269,7 @@ function populateValueMainFormForDeleteItem(rowid)
$("#workstatus").hide();
}
});
clearTotalItemValues();
});
$(document).ready(function () {
$('#Local').click(function () {
@ -6252,6 +6339,7 @@ $('#content').loader('hide');
*/
function Save(status)
{
if(status == '0')
{
stat = '<?php echo PO_DRAFT; ?>';
@ -6295,6 +6383,11 @@ $('#content').loader('hide');
return false;
}
else if($('#Otherpayment').val()=='' && $('#PaymentMethod').val()=='PT08'){
alert('Please Enter Other Payable Terms Description');
$('#Otherpayment').focus();
return false;
}
else
{
$('#content').loader('show');
@ -6357,14 +6450,8 @@ $('#SpcialInstruction').val(splinstr);
var TextSpcialInstruction = $('#txtSpcialInstruction').val();
var TextStatus = stat;
var PaymentMethod = $('#PaymentMethod').val();
var PayableAT = $('#PayableAT').val();
var paymentDateOptions ='';
if($("input:radio[name='Payment']:checked").val=='0'){
paymentDateOptions="Before";
}
else{
paymentDateOptions="After";
}
if(validate())
{
if(document.getElementById('serviceTax').rows.length < 2)
@ -6382,7 +6469,7 @@ $('#SpcialInstruction').val(splinstr);
{
$('#content').loader('show');
$.ajax({
data:$('.CreatealterPO').serialize()+"&TextRowCount="+TextRowCount+"&TextDeletedRowCount="+TextDeletedRowCount+"&txtTotalOrderValueSummary="+txtTotalOrderValueSummary+"&TextSpcialInstruction="+TextSpcialInstruction+"&TextStatus="+TextStatus+"&PaymentMethod="+PaymentMethod+"&PayableAT="+PayableAT+"&paymentDateOptions="+paymentDateOptions,
data:$('.CreatealterPO').serialize()+"&TextRowCount="+TextRowCount+"&TextDeletedRowCount="+TextDeletedRowCount+"&txtTotalOrderValueSummary="+txtTotalOrderValueSummary+"&TextSpcialInstruction="+TextSpcialInstruction+"&TextStatus="+TextStatus+"&PaymentMethod="+PaymentMethod,
type:"POST",
url:"<?php echo base_url() ?>emergencypurchaseorder/addNewRevenuePurchaseOrder",
success:function(data) {
@ -6604,6 +6691,18 @@ $('#SpcialInstruction').val(splinstr);
$('#txtEditFreight').val($('#FreightVal'+userid).val());
$('#txtEditAfterFreight').val($('#AfterFreightVal'+userid).val());
$('#EditNOOfTrips').val($('#NoOfTrip'+userid).val());
var FreightType =$('#FreightType'+userid).val();
if (FreightType == "PER TRIP"){
$('#EditTripsValue').show();
}
else{
$('#EditTripsValue').hide();
}
$('#txtEditInsurance').val($('#Insval'+userid).val());
$('#RevenueEditAfterCgst').val($('#RevenueAfterCgst'+userid).val());
$('#RevenueEditAfterSgst').val($('#RevenueAfterSgst'+userid).val());
@ -6689,7 +6788,7 @@ $('.EditRevenue').click(function(){
var FreightType = $("#drpEditFreight").val();
var FreightVal = $("#txtEditFreight").val();
var AfterFreightVal = $("#txtEditAfterFreight").val();
var NoOfTrip = $("#EditNOOfTrips").val();
var basicval = $("#txtEditRevenueBasicValue").val();
var Insval = $("#txtEditInsurance").val();
@ -6733,6 +6832,7 @@ $('.EditRevenue').click(function(){
$('#FreightType'+userid).val(FreightType);
$('#FreightVal'+userid).val(FreightVal);
$('#AfterFreightVal'+userid).val(AfterFreightVal);
$('#NoOfTrip'+userid).val(NoOfTrip);
$('#basicval'+userid).val(basicval);
$('#Insval'+userid).val(Insval);
$('#RevenueCgst'+userid).val(Cgst);
@ -7002,4 +7102,27 @@ $("#PaymentMethod").change(function() {
}
});
// set default null value
function clearTotalItemValues(){
$('#txtTotBasicAmount').val('');
$('#txtTotCgst').val('');
$('#txtTotSgst').val('');
$('#txtTotIgst').val('');
$('#txtTotOtherAllo').val('');
$('#txtTotalOrderValueSummaryService').val('');
$('#txtTotBasicAmountRevenue').val('');
$('#txtTotalDiscount').val('');
$('#txtTotalPackaing').val('');
$('#txtTotalCGST').val('');
$('#txtTotalSGST').val('');
$('#txtTotalIGST').val('');
$('#txtTotalFreight').val('');
$('#txtTotalInsurance').val('');
$('#txtTotalOrderValueSummary').val('');
}
</script>

View File

@ -24,7 +24,7 @@
if(!empty($AvlBudAmt))
{
$AvlAmount = $AvlBudAmt;
$AvlAmount = number_format($AvlBudAmt, 2, '.', '');
}
@ -85,6 +85,7 @@ if(!empty($INRSYMBOL))
toolbar: false
});
$(document).ready(function(){
clearTotalItemValues();
$('#CapitalToatlOrder').val(0);
//Initialize Select2 Elements
$("#drpSupplier").select2();
@ -166,12 +167,17 @@ function vaildateBeforeOpenModal()
$('#currencytype').focus();
return false;
}
/* else if($('#ExchangeRt').val() == '')
else if(capitalType=='International'){
if($('#ExchangeRt').val() == '')
{
alert('Please Enter the Exchange Rate');
$('#ExchangeRt').focus();
return false;
} */
}
else{
return true;
}
}
else
@ -459,6 +465,15 @@ function vaildateBeforeOpenModal()
?>
</div>
<div class="col-md-4" id="otheroptiondiv" style="display:none;">
<label>Description of Payable Terms<span class="badge" style="color:red;text-align:right;background-color: #ecf0f5 ;">*</span></label>
<div class="form-group">
<?php
$data = array('name' => 'Otherpayment','Otherpayment' => set_value('Otherpayment'),'id'=>'Otherpayment', 'class' => 'form-control' ,'required' => 'true');
echo form_input($data);
?>
</div>
</div>
@ -548,7 +563,7 @@ function vaildateBeforeOpenModal()
</div>
<div class="col-md-5">
<div class="col-md-6">
<label>Cost Center Name</label>
<label>Cost Center Code</label>
<div>
<?php
@ -751,7 +766,7 @@ function vaildateBeforeOpenModal()
<div class="col-md-4" >
Basic Price In <?php echo "($INR)"?>:
</div>
<div class="col-md-4">
<div class="col-md-4" style="display:none;">
<div class="form-group">
<?php
$data = array('name' => 'BasicPriceTax','value' => set_value('BasicPriceTax'),'id'=>'BasicPriceTax', 'class' => 'form-control' ,'onkeypress'=>'return isNumberKey(event);');
@ -1338,7 +1353,7 @@ function vaildateBeforeOpenModal()
<div class="col-md-4" >
Basic Price In <?php echo "($INR)"?>
</div>
<div class="col-md-4">
<div class="col-md-4" style="display:none;">
<div class="form-group">
<?php
$data = array('name' => 'EditBasicPriceTax','value' => set_value('EditBasicPriceTax'),'id'=>'EditBasicPriceTax', 'class' => 'form-control' ,'onkeypress'=>'return isNumberKey(event);');
@ -3454,7 +3469,7 @@ function DeleteRow(rowid)
$("#EditMaterialCode").empty();
$("#EditMaterialCode").append( $('<option></option>').val($('#materialCode'+userid).val()).html($('#materialCode'+userid).val() + "-" + $('#materialName'+userid).val()) );
$('#EditRateIn').html('Rate(in' + " "+DisplayCurrencySymbol + '/'+EditUOM+')');
for(i=0;i<Material.length;i++)
{
$.each(Material[i], function(idx, obj) {
@ -3566,7 +3581,7 @@ var PaymentMethod = $('#PaymentMethod').val();
$('#SpcialInstruction').val(splinstr);
$('#txtDeliveryAddress').val(deladd);
$('#txtStatus').val(stat);
var AvlBudAmt = '<?php echo $AvlAmount ?>';
if(validate())
{
@ -3576,6 +3591,16 @@ $('#txtStatus').val(stat);
$('#Deliverydt').focus();
return false;
}
else if($('#Otherpayment').val()=='' && $('#PaymentMethod').val()=='PT08'){
alert('Please Enter Other Payable Terms Description');
$('#Otherpayment').focus();
return false;
}
else if(parseInt(AvlBudAmt) < parseInt($('#CapitalToatlOrder').val())) {
alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.');
return false;
}
else
{
$('#content').loader('show');
@ -4202,8 +4227,8 @@ var currency = <?php echo json_encode($Currency, JSON_PRETTY_PRINT) ?>;
$("#CurrencySymbol").val(obj.FontCode2000);
$('#CurrencySymbol').html('Exchange Rate In' + " "+obj.FontCode2000);
$('#RateIn').html('Rate(in' + " "+obj.FontCode2000);
$('#EditRateIn').html('Rate(in' + " "+obj.FontCode2000);
$('#RateIn').html('Rate in' + " "+obj.FontCode2000);
$('#EditRateIn').html('Rate in' + " "+obj.FontCode2000);
$('#TotalAmount').html('Basic value in' + " "+obj.FontCode2000);
$('#EditTotalAmount').html('Basic value in' + " "+obj.FontCode2000);
DisplayCurrencySymbol=obj.FontCode2000;
@ -4313,6 +4338,39 @@ function calculateIgstTax(varBasicValue,Igst)
return TAXval;// $('#AfterServiceTax').val(TAXval);
}
//If others is the payment terms to display mandatory field
$("#PaymentMethod").change(function() {
if ($('#PaymentMethod').val().trim()=='PT08')
{
$('#otheroptiondiv').show();
}
else {
$('#otheroptiondiv').hide();
$('#Otherpayment').val('');
}
});
function clearTotalItemValues(){
$('#txtTotCgst').val('');
$('#txtTotSgst').val('');
$('#txtTotIgst').val('');
$('#TotalOtherAllowances').val('');
$('#txttotallanding').val('');
$('#txttotalhighseas').val('');
$('#txttotalcustom').val('');
$('#txttotalexcise').val('');
$('#txttotalexciseED').val('');
$('#txttotalexciseSH').val('');
$('#txttotalcustomED').val('');
$('#txttotalcustomSH').val('');
$('#txttotalAdditionalExciseduty').val('');
$('#txttotalgrossduty').val('');
$('#txttotalavlmodvat').val('');
$('#txttotalgrossexpense').val('');
$('#txtToatlOrder').val(0);
$('#CapitalToatlOrder').val(0);
}
</script>

View File

@ -29,6 +29,7 @@
$Deliverydt='';
$DeliverSchedule='';
$PONOStatus='';
$MaxPoDate = '';
$AvlAmount = 0;
$currentCurrencyType='';
@ -59,7 +60,7 @@
$UpdatedOn;
$CapitalRange='';
$PoStatusName='';
$otherPayment='';
$INR='';
$INRSYM='';
if(!empty($INRSYMBOL))
@ -101,15 +102,17 @@ if(!empty($POMaster))
$Deliverydt = $Ddt->format('Y-m-d');
$DeliveryAddress =$Req->DeliveryAddress;
$PONOStatus = $Req->StatusCode;
$POStatus = $Req->StatusCode;
$PoStatusName=$Req->StatusName;
$PONO = $Req->PONO;
$ServiceDescription = $Req->ServiceDescription;
$PayableAT=$Req->PayableAT;
$ExchangeRateOn=$Req->ExchangeRateCalculatedon;
$PaymentDays=$Req->PaymentDays;
$PaymentTerms=$Req->PaymentTerms;
$otherPayment = $Req->PaymentOtherDescription;
$UpdatedOn=$Req->UpdatedOn;
$CapitalRange=$Req->CapitalRange;
$Import_DispatchDetails=$Req->Import_DispatchDetails;
@ -124,7 +127,7 @@ if(!empty($POMaster))
if(!empty($AvlBudAmt))
{
$AvlAmount = $AvlBudAmt;
$AvlAmount = number_format($AvlBudAmt, 2, '.', '');
}
?>
@ -179,6 +182,16 @@ $('#Deliverydt').val('');
$('#Scheduleby').val(SchName);
}
var PaymentOther = '<?php echo $otherPayment; ?>';
var PayTerms = '<?php echo $PaymentTerms; ?>';
if(PayTerms=='PT08'){
$('#otheroptiondiv').show();
$('#Otherpayment').val(PaymentOther);
}
else{
$('#otheroptiondiv').hide();
$('#Otherpayment').val('');
}
});
@ -289,7 +302,7 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
<div style="border:2px solid #333">
<div class="col-md-12">
<center><b><h2>Siddharth Industries - Edit Capital Purchase Order</h2></b></center>
<center><b><h2>Siddharth Industries - Edit Capital Purchase Order- <?php echo $PONO;?></h2></b></center>
<!-- <div class="col-md-1"><br/>
<a class="btn btn-primary" href="<?php echo base_url(); ?>purchaseorder/CreatecapitalPOPrint" target="_blank">Print</a>
@ -550,7 +563,16 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
</div>
<div class="col-md-4" id="otheroptiondiv" style="display:none;">
<label>Description of Payable Terms<span class="badge" style="color:red;text-align:right;background-color: #ecf0f5 ;">*</span></label>
<div class="form-group">
<?php
$data = array('name' => 'Otherpayment','Otherpayment' => set_value('Otherpayment'),'id'=>'Otherpayment', 'class' => 'form-control' ,'required' => 'true');
echo form_input($data);
?>
</div>
</div>
</div>
@ -713,7 +735,7 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
<?php
if($POStatus == PO_DRAFT)
if($POStatus == PO_DRAFT || PO_CREATED)
{?>
<td> <a data-target='#EDITCAPITAL' data-id="<?php echo $index ; ?>" data-userid="<?php echo $index ; ?>" data-toggle="modal" href="#EDITCAPITAL"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit the <?php echo $record->ReqNo ; ?> Requisition details"></i>&nbsp;&nbsp;&nbsp;</a> <a href='#' onclick = "DeleteRow(<?php echo $index ; ?>)" class="link" data-id="<?php echo $index ; ?>" data-userid="<?php echo $index ; ?>" id="Del" ><span class="glyphicon glyphicon-trash"></span></a>
<?php
@ -821,7 +843,7 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
</div>
<div class="col-md-5">
<div class="col-md-6">
<label>Cost Center Name</label>
<label>Cost Center Code</label>
<div>
<?php
@ -1021,7 +1043,7 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
<div class="col-md-4" >
Basic Price In<?php echo "($INR)"?>
</div>
<div class="col-md-4">
<div class="col-md-4" style="display:none;">
<div class="form-group">
<?php
$data = array('name' => 'BasicPriceTax','value' => set_value('BasicPriceTax'),'id'=>'BasicPriceTax', 'class' => 'form-control' ,'onkeypress'=>'return isNumberKey(event);');
@ -1409,7 +1431,7 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
</div>
<div class="col-md-5">
<div class="col-md-6">
<label>Cost Center Name</label>
<label>Cost Center Code</label>
<div>
<?php
@ -1609,7 +1631,7 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
<div class="col-md-4" >
Basic Price In<?php echo "($INR)"?>
</div>
<div class="col-md-4">
<div class="col-md-4" style="display:none;">
<div class="form-group">
<?php
$data = array('name' => 'EditBasicPriceTax','value' => set_value('EditBasicPriceTax'),'id'=>'EditBasicPriceTax', 'class' => 'form-control' ,'onkeypress'=>'return isNumberKey(event);');
@ -1991,9 +2013,9 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
</div>
</div>
<div class="col-md-3">
<div class="col-md-2">
<label>Cost Center Name</label>
<label>Cost Center Code</label>
<div>
<?php
@ -2005,7 +2027,7 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
</div>
<div class="col-md-3" id="ExchangeRateModalViewDiv" style="display:none;">
<div class="col-md-2" id="ExchangeRateModalViewDiv" style="display:none;">
<label> Exchange Rate</label>
<div class="form-group">
<?php
@ -2014,6 +2036,15 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
?>
</div>
</div>
<div class="col-md-2">
<label>Avail Bud Amount<?php echo "($INR)"?></label>
<div class="form-group">
<?php
$data = array('name' => 'ViewCapitalbudAmt','value' => set_value('ViewCapitalbudAmt'),'id'=>'ViewCapitalbudAmt', 'class' => 'form-control' ,'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div>
</div>
<div class="col-md-12">
@ -2059,7 +2090,7 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
</div>
</div>
<div class="col-md-2">
<label id="EditRateIn">Rate(in INR/UOM)</label>
<label id="ViewRateIn">Rate(in INR/UOM)</label>
<div class="form-group">
<?php
$data = array('name' => 'ViewCPRate','value' => set_value('ViewCPRate'),'id'=>'ViewCPRate', 'class' => 'form-control' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>'EditRatechange();' );
@ -2186,7 +2217,7 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
<div class="col-md-4" >
Basic Price In<?php echo "$INR"?>
</div>
<div class="col-md-4">
<div class="col-md-4" style="display:none;">
<div class="form-group">
<?php
$data = array('name' => 'ViewBasicPriceTax','value' => set_value('ViewBasicPriceTax'),'id'=>'ViewBasicPriceTax', 'class' => 'form-control' ,'onkeypress'=>'return isNumberKey(event);','readonly' => 'true');
@ -2750,7 +2781,7 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
<?php if($PONOStatus == PO_DRAFT || $PONOStatus == PO_CREATED ) {
if($PONOStatus == PO_DRAFT){?>
if($PONOStatus == PO_DRAFT || $PONOStatus == PO_CREATED){?>
<a class="btn btn-primary Save" ID="Save" onclick="Save(0)" >&nbsp;&nbsp;<span class="bold">Save</span></a> <?php }?>
<a class="btn btn-primary Save" ID="Submit" onclick="Save(1)" >&nbsp;&nbsp;<span class="bold">Submit</span></a>
<input type="reset" class="btn btn-primary" value="Reset">
@ -2993,7 +3024,7 @@ var myArray = <?php echo json_encode($res_arr_values); ?>;
var CPUOMDisplay=obj.UOM;
$('#RateIn').html('Rate(in' + " "+DisplayCurrencySymbol + '/'+CPUOMDisplay+')');
$('#EditRateIn').html('Rate(in' + " "+DisplayCurrencySymbol + '/Ton)');
$('#EditRateIn').html('Rate(in' + " "+DisplayCurrencySymbol + '/'+CPUOMDisplay+')');
@ -3038,7 +3069,7 @@ var myArray = <?php echo json_encode($res_arr_values); ?>;
var CPUOMDisplay=obj.UOM;
$('#RateIn').html('Rate(in' + " "+DisplayCurrencySymbol + '/'+CPUOMDisplay+')');
$('#EditRateIn').html('Rate(in' + " "+DisplayCurrencySymbol + '/Ton)');
$('#EditRateIn').html('Rate(in' + " "+DisplayCurrencySymbol + '/'+CPUOMDisplay+')');
}
});
}
@ -4373,7 +4404,7 @@ function DeleteRow(rowid)
var EditUOM = $('#uom'+userid).val();
$('#RateIn').html('Rate(in' + " "+DisplayCurrencySymbol + '/'+EditUOM+')');
$('#EditRateIn').html('Rate(in' + " "+DisplayCurrencySymbol + '/'+EditUOM+')');
$('#EditRateIn').html('Rate(in' + " "+DisplayCurrencySymbol + '/'+EditUOM+')');
@ -4417,7 +4448,7 @@ $('#EditRateIn').html('Rate(in' + " "+DisplayCurrencySymbol + '/'+EditUOM+')');
$('#ViewReqnumber').val($('#Reqnumber'+userid).val());
$('#ViewCapitalDepartmentName').val($('#departmentName'+userid).val());
$("#ViewCostCenter").val($('#CPCostCode'+userid).val());
$('#ViewCapitalbudAmt').val($('#AvilBudget'+userid).val());
$('#ViewCapitalbudAmt').val(parseFloat($('#AvilBudget'+userid).val()).toFixed(2));
$('#ViewExchangeRtModal').val($('#echangeRate'+userid).val());
$('#ViewCapitalItemName').val($('#materialName'+userid).val());
@ -4509,8 +4540,10 @@ $('#EditRateIn').html('Rate(in' + " "+DisplayCurrencySymbol + '/'+EditUOM+')');
{
$("#EditCapitalItemName").val(obj.MaterialName);
$("#EditCPUOM").val(obj.UOM);
var EDITUOMDisplay=obj.UOM;
$("#EditCPQuantity").val(obj.Quantity);
RequistQuantity = obj.Quantity;
RequistQuantity = obj.Quantity;
$('#EditRateIn').html('Rate(in' + " "+DisplayCurrencySymbol + '/'+EDITUOMDisplay+')');
}
});
}
@ -4579,6 +4612,7 @@ else
{
stat = '<?php echo PO_CREATED; ?>';
}
var AvlBudAmt = '<?php echo $AvlAmount ?>';
tinyMCE.triggerSave();
var splinstr = $('#txtSpcialInstruction').val();
var deladd = $('#DeliveryAddr').val();
@ -4601,6 +4635,16 @@ $('#txtStatus').val(stat);
$('#Deliverydt').focus();
return false;
}
else if($('#Otherpayment').val()=='' && $('#PaymentMethod').val()=='PT08'){
alert('Please Enter Other Payable Terms Description');
$('#Otherpayment').focus();
return false;
}
else if(parseInt(AvlBudAmt) < parseInt($('#CapitalToatlOrder').val())) {
alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.');
return false;
}
else
{
@ -5306,5 +5350,16 @@ function calculateIgstTax(varBasicValue,Igst)
return TAXval;// $('#AfterServiceTax').val(TAXval);
}
//If others is the payment terms to display mandatory field
$("#PaymentMethod").change(function() {
if ($('#PaymentMethod').val().trim()=='PT08')
{
$('#otheroptiondiv').show();
}
else {
$('#otheroptiondiv').hide();
$('#Otherpayment').val('');
}
});
</script>

View File

@ -4372,7 +4372,8 @@ var splinstr = $('#txtSpcialInstruction').val();
$('#SpcialInstruction').val(splinstr);
$('#txtDeliveryAddress').val(deladd);
var AvlBudAmt = '<?php echo $AvlAmount ?>';
var txtTotalOrderValueSummary = $('#txtTotalOrderValueSummary').val();
if(validate())
{
@ -4382,10 +4383,16 @@ $('#txtDeliveryAddress').val(deladd);
$('#Deliverydt').focus();
return false;
}
else if(validateBudgetExceedLimit())
{
return false;
}
//else if(validateBudgetExceedLimit())
//{
// return false;
//}
else if(parseInt(AvlBudAmt) < parseInt(txtTotalOrderValueSummary)) {
alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.');
return false;
}
else if($('#Otherpayment').val()=='' && $('#PaymentTerms').val()=='PT08'){
alert('Please Enter Payable Terms Description');
$('#Otherpayment').focus();

View File

@ -22,7 +22,7 @@ if(!empty($CompanyDetails))
if(!empty($AvlBudAmt))
{
$AvlAmount = $AvlBudAmt;
$AvlAmount = number_format($AvlBudAmt, 2, '.', '');
}
@ -90,7 +90,7 @@ if(!empty($INRSYMBOL))
$(document).ready(function(){
$("#PaymentTerms").select2();
clearTotalItemValues();
});
function openModal()
@ -3731,6 +3731,8 @@ $('#txtStatus').val(stat);
tinyMCE.triggerSave();
var splinstr = $('#txtSpcialInstruction').val();
$('#SpcialInstruction').val(splinstr);
var AvlBudAmt = '<?php echo $AvlAmount ?>';
var txtTotalOrderValueSummary = $('#txtTotalOrderValueSummary').val();
if(validate())
{
if(document.getElementById('revenueTax').rows.length < 3)
@ -3739,6 +3741,11 @@ $('#SpcialInstruction').val(splinstr);
$('#Deliverydt').focus();
return false;
}
else if(parseInt(AvlBudAmt) < parseInt(txtTotalOrderValueSummary)) {
alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.');
return false;
}
else if($('#Otherpayment').val()=='' && $('#PaymentTerms').val()=='PT08'){
alert('Please Enter Payable Terms Description');
$('#Otherpayment').focus();
@ -3941,6 +3948,23 @@ $("#PaymentTerms").change(function() {
$('#Otherpayment').val('');
}
});
// set default null value
function clearTotalItemValues(){
$('#txtTotBasicAmount').val('');
$('#txtTotalDiscount').val('');
$('#txtTotalPackaing').val('');
$('#txtTotalCGST').val('');
$('#txtTotalSGST').val('');
$('#txtTotalIGST').val('');
$('#txtTotalFreight').val('');
$('#txtTotalInsurance').val('');
$('#txtTotalOrderValueSummary').val('');
}
</script>

View File

@ -22,7 +22,7 @@ if(!empty($CompanyDetails))
if(!empty($AvlBudAmt))
{
$AvlAmount = $AvlBudAmt;
$AvlAmount = number_format($AvlBudAmt, 2, '.', '');
}
@ -1980,6 +1980,8 @@ var deladd = $('#DeliveryAddr').val();
$('#txtDeliveryAddress').val(deladd);
$('#txtStatus').val(stat);
var AvlBudAmt = '<?php echo $AvlAmount ?>';
var txtTotalOrderValueSummary = $('#txtTotalOrderValueSummary').val();
if(validate())
{
if(document.getElementById('serviceTax').rows.length < 2)
@ -1988,8 +1990,13 @@ $('#txtStatus').val(stat);
$('#Deliverydt').focus();
return false;
}
else if(parseInt(AvlBudAmt) < parseInt(txtTotalOrderValueSummary)) {
alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.');
return false;
}
else if($('#Otherpayment').val()=='' && $('#PaymentTerms').val()=='PT08'){
alert('Please Enter Other Payment Details');
alert('Please Enter Other Payable Terms Description');
$('#Otherpayment').focus();
return false;
}