service po
This commit is contained in:
parent
71ca4fd272
commit
c14197ac33
@ -116,6 +116,19 @@ class purchaseorder extends BaseController
|
||||
$data['FreightType'] = $this->purchaseorder_model->getConfigValue('C018');
|
||||
$data['Suplist'] = $this->purchaseorder_model->getSupplierName();
|
||||
$data['Payment']=$this->purchaseorder_model->getSupplierPayment();
|
||||
$data['WorkStatus']=$this->purchaseorder_model->GetWorkStatus('C019');
|
||||
|
||||
|
||||
foreach ($data['WorkStatus'] as $WST)
|
||||
{
|
||||
|
||||
$WStatus=$WST->ConfigValue;
|
||||
//print_r($WStatus);
|
||||
|
||||
}
|
||||
|
||||
|
||||
//print_r($data['WorkStatus']);
|
||||
// foreach ($data['Suplist'] as $SUP)
|
||||
// {
|
||||
// $Detail=$SUP->PaymentTerms;
|
||||
@ -310,6 +323,8 @@ class purchaseorder extends BaseController
|
||||
{
|
||||
|
||||
$data['POItem'] = $this->purchaseorder_model->GetServicePurchaseOrderDetails($PONO);
|
||||
$data['PaymentTerms']=$this->purchaseorder_model->GetPaymentTerms($PONO);
|
||||
$data['WorkStatus']=$this->purchaseorder_model->GetWorkStatus('C019');
|
||||
$this->global['pageTitle'] = 'Siddharth : Edit Service Purchase order form';
|
||||
$this->loadViews("EditservicePurchaseorder", $this->global, $data, NULL);
|
||||
}
|
||||
@ -318,6 +333,7 @@ class purchaseorder extends BaseController
|
||||
|
||||
$data['POItem'] = $this->purchaseorder_model->GetRevenuePurchaseOrderDetails($PONO);
|
||||
$data['PaymentTerms']=$this->purchaseorder_model->GetPaymentTerms($PONO);
|
||||
//$data['WorkStatus']=$this->purchaseorder_model->GetWorkStatus('C019');
|
||||
$this->global['pageTitle'] = 'Siddharth : Edit Revenue Purchase order form';
|
||||
$this->loadViews("editRevenuepurchaseorder", $this->global, $data, NULL);
|
||||
}
|
||||
|
||||
@ -80,6 +80,22 @@ class servicepurchaseorder extends BaseController
|
||||
$Deliverydt = $this->getDateformat($dt);
|
||||
$DeliverySchedule = '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
$PaymentDate=$this->input->post('Payment');
|
||||
if($PaymentDate==1)
|
||||
{
|
||||
$PaymentDays='After';
|
||||
}
|
||||
else
|
||||
{
|
||||
$PaymentDays='Before';
|
||||
}
|
||||
|
||||
$PaymentTerms=$this->input->post('PaymentTerms');
|
||||
$Payableat=$this->input->post('PayableAT');
|
||||
|
||||
$POType = $this->input->post('POType');
|
||||
|
||||
$SpcialInstruction = $this->input->post('txtSpcialInstruction');
|
||||
@ -95,7 +111,7 @@ class servicepurchaseorder extends BaseController
|
||||
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
|
||||
$createddt = $dt->format('Y-m-d H:i:s');
|
||||
// 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 );
|
||||
$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,'PayableAT'=>$Payableat,'PaymentDays'=>$PaymentDays );
|
||||
|
||||
$POMaster = $this->purchaseorder_model->addPOMaster($POList);
|
||||
|
||||
@ -187,6 +203,20 @@ class servicepurchaseorder extends BaseController
|
||||
$Deliverydt = $this->getDateformat($dt);
|
||||
$DeliverySchedule = '';
|
||||
}
|
||||
|
||||
|
||||
$PaymentDate=$this->input->post('Payment');
|
||||
if($PaymentDate==1)
|
||||
{
|
||||
$PaymentDays='After';
|
||||
}
|
||||
else
|
||||
{
|
||||
$PaymentDays='Before';
|
||||
}
|
||||
|
||||
$PaymentTerms=$this->input->post('PaymentTerms');
|
||||
$Payableat=$this->input->post('PayableAT');
|
||||
|
||||
$POType = $this->input->post('POType');
|
||||
|
||||
@ -204,7 +234,7 @@ class servicepurchaseorder extends BaseController
|
||||
|
||||
|
||||
// PO Master
|
||||
$POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'Status'=>$POStatus,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ServiceDescription'=>$SpcialInstruction,'UpdateBY'=>$updatedBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'UpdatedOn'=>$updateddt );
|
||||
$POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'Status'=>$POStatus,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ServiceDescription'=>$SpcialInstruction,'UpdateBY'=>$updatedBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'UpdatedOn'=>$updateddt,'PaymentTerms'=>$PaymentTerms,'PayableAT'=>$Payableat,'PaymentDays'=>$PaymentDays );
|
||||
|
||||
$POMaster = $this->purchaseorder_model->updatePOMaster($PONO,$POList);
|
||||
|
||||
|
||||
@ -295,6 +295,9 @@ function purchaseorderListing()
|
||||
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* This function is used to get the Company information from T_Company_Details table
|
||||
@ -589,6 +592,9 @@ function GetImportPurchaseOrderDetailsForPDF($PONO = '')
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function getSupplierPayment($Currency='')
|
||||
{
|
||||
|
||||
@ -599,6 +605,14 @@ function GetImportPurchaseOrderDetailsForPDF($PONO = '')
|
||||
|
||||
}
|
||||
|
||||
function GetWorkStatus($Config_ID='')
|
||||
{
|
||||
$subQuery = 'select ConfigValue from T_ConfigDetails where Config_ID=?';
|
||||
$query=$this->db->query($subQuery,array($Config_ID));
|
||||
//print_r($query);
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -628,15 +642,15 @@ Mat.UOM,Quantity,Rate,Req.Status,ROUND((Quantity *Rate),2 ) as BasicValue ,
|
||||
|
||||
|
||||
function GetCurrencytype()
|
||||
{
|
||||
{
|
||||
|
||||
$subQuery = 'select * from T_Currency_Details';
|
||||
$subQuery = 'select * from T_Currency_Details';
|
||||
|
||||
$query = $this->db->query($subQuery);
|
||||
$query = $this->db->query($subQuery);
|
||||
|
||||
|
||||
return $query->result();
|
||||
}
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -22,6 +22,7 @@ $Deliverydt='';
|
||||
$DeliverSchedule='';
|
||||
$MaxPoDate = '';
|
||||
$AvlAmount = 0;
|
||||
$Value="₹";
|
||||
if(!empty($MaxPODate))
|
||||
{
|
||||
foreach ($MaxPODate as $date)
|
||||
@ -49,6 +50,9 @@ if(!empty($POMaster))
|
||||
$POStatus = $Req->StatusCode;
|
||||
$PONO = $Req->PONO;
|
||||
$ServiceDescription = $Req->ServiceDescription;
|
||||
//$PaymentTerms=$Req->PaymentTerms;
|
||||
$PayableAT=$Req->PayableAT;
|
||||
$PaymentDays=$Req->PaymentDays;
|
||||
}
|
||||
}
|
||||
|
||||
@ -58,6 +62,12 @@ if(!empty($AvlBudAmt))
|
||||
$AvlAmount = $AvlBudAmt;
|
||||
|
||||
}
|
||||
|
||||
|
||||
foreach ($PaymentTerms as $TER)
|
||||
{
|
||||
$Terms=$TER->PaymentTerms;
|
||||
}
|
||||
?>
|
||||
|
||||
<script src="<?php echo base_url(); ?>assets/js/CreatePOValidation.js" type="text/javascript"></script>
|
||||
@ -122,6 +132,17 @@ $('#drpSupplier').change(function() {
|
||||
if(obj.SupplierID === id)
|
||||
{
|
||||
$("#SupAddress").val(obj.Address);
|
||||
$("#PayableAT").val(obj.PayableAT);
|
||||
var a=obj.PaymentDays;
|
||||
console.log(a);
|
||||
if (a=="After")
|
||||
{
|
||||
//alert();
|
||||
document.getElementById("After").checked = true;
|
||||
|
||||
}
|
||||
else
|
||||
document.getElementById("Before").checked = true;
|
||||
|
||||
}
|
||||
|
||||
@ -734,7 +755,7 @@ $(document).ready(function () {
|
||||
<div class="col-md-3">
|
||||
<span for="payablefrom">Payable Terms</span>
|
||||
<select class="form-control required" id="PaymentTerms" name="PaymentTerms">
|
||||
<option value="Date of invoice" >Select Payment method</option>
|
||||
<option value="" ><?php echo $Terms;?></option>
|
||||
<?php
|
||||
if(!empty($payment))
|
||||
{
|
||||
@ -753,7 +774,7 @@ $(document).ready(function () {
|
||||
<span>Payable AT</span>
|
||||
|
||||
<?php
|
||||
$data = array('name' => 'PayableAT','value' => set_value('PayableAT'),'id'=>'PayableAT', 'class' => 'form-control' ,'required' => 'true');
|
||||
$data = array('name' => 'PayableAT','value' => set_value('PayableAT',$PayableAT),'id'=>'PayableAT', 'class' => 'form-control' ,'required' => 'true');
|
||||
echo form_input($data);
|
||||
?>
|
||||
|
||||
@ -891,7 +912,7 @@ $(document).ready(function () {
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label>Rate</label>
|
||||
<label><?php echo "Rate ($Value)";?></label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'Rate','value' => set_value('Rate'),'id'=>'Rate', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);' ,'onchange'=>'Ratechange()' );
|
||||
@ -900,7 +921,7 @@ $(document).ready(function () {
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label>Basic Amount</label>
|
||||
<label><?php echo "Basic Amount ($Value);"?></label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'txtBasicValue','value' => set_value('txtBasicValue'),'id'=>'txtBasicValue', 'class' => 'form-control num' ,'readonly' => 'true');
|
||||
@ -999,7 +1020,7 @@ $(document).ready(function () {
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-5 col-md-offset-4" align="right">
|
||||
Total Order value :
|
||||
<label><?php echo "Total Order Value ($Value)";?></label>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
@ -1132,7 +1153,7 @@ $(document).ready(function () {
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label>Rate</label>
|
||||
<label><?php echo "Rate ($Value)";?></label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'EditRate','value' => set_value('EditRate'),'id'=>'EditRate', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);' ,'onchange'=>'EditRatechange()' );
|
||||
@ -1141,7 +1162,7 @@ $(document).ready(function () {
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label>Basic Amount</label>
|
||||
<label><?php echo "Basic Amount ($Value)";?></label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'txtEditBasicValue','value' => set_value('txtEditBasicValue'),'id'=>'txtEditBasicValue', 'class' => 'form-control num' ,'readonly' => 'true');
|
||||
@ -1240,7 +1261,7 @@ $(document).ready(function () {
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-5 col-md-offset-4" align="right">
|
||||
Total Order value :
|
||||
<label><?php echo "Total Order Value ($Value)";?></label>>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
@ -1503,6 +1524,17 @@ var userid = '';
|
||||
Mat: []
|
||||
};
|
||||
|
||||
var paymentday=<?php echo json_encode($PaymentDays,JSON_PRETTY_PRINT)?>;
|
||||
if (paymentday=="After")
|
||||
{
|
||||
//alert();
|
||||
document.getElementById("After").checked = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
document.getElementById("Before").checked = true;
|
||||
}
|
||||
|
||||
$("#EDITSERVICE").on("shown.bs.modal", function(e) {
|
||||
userid = $(e.relatedTarget).data('userid');
|
||||
|
||||
@ -2201,4 +2233,17 @@ $('#Scheduleby').change(function(){
|
||||
});
|
||||
|
||||
|
||||
|
||||
var Detail = <?php echo json_encode($Payment, JSON_PRETTY_PRINT) ?>;
|
||||
//console.log(Detail);
|
||||
|
||||
$.each(Detail, function (index, value)
|
||||
{
|
||||
$("#PaymentTerms").append( $('<option></option>').val(value.PaymentTerms).html(value.PaymentTerms) );
|
||||
|
||||
|
||||
|
||||
} );
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
@ -4,6 +4,7 @@ $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
|
||||
$CurrentDate = $dt->format('Y-m-d');
|
||||
$MaxPoDate = '';
|
||||
$AvlAmount = 0;
|
||||
$Value="₹";
|
||||
if(!empty($MaxPODate))
|
||||
{
|
||||
foreach ($MaxPODate as $date)
|
||||
@ -24,6 +25,8 @@ if(!empty($AvlBudAmt))
|
||||
$AvlAmount = $AvlBudAmt;
|
||||
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
<script src="<?php echo base_url(); ?>assets/js/CreatePOValidation.js" type="text/javascript"></script>
|
||||
<script>
|
||||
@ -63,6 +66,20 @@ $('#drpSupplier').change(function() {
|
||||
if(obj.SupplierID === id)
|
||||
{
|
||||
$("#SupAddress").val(obj.Address);
|
||||
|
||||
$("#SupAddress").val(obj.Address);
|
||||
$("#PayableAT").val(obj.PayableAT);
|
||||
$("#PaymentTerms").val(obj.PaymentTerms);
|
||||
var a=obj.PaymentDays;
|
||||
console.log(a);
|
||||
if (a=="After")
|
||||
{
|
||||
//alert();
|
||||
document.getElementById("After").checked = true;
|
||||
|
||||
}
|
||||
else
|
||||
document.getElementById("Before").checked = true;
|
||||
|
||||
}
|
||||
|
||||
@ -661,7 +678,9 @@ $(document).ready(function () {
|
||||
<div class="col-md-6">
|
||||
<label>Work Status</label>
|
||||
<?php
|
||||
$options = array("0"=>'Select Status');
|
||||
|
||||
$options = array("0"=>'Select Status');
|
||||
|
||||
echo form_dropdown('workstatus', $options,set_value('workstatus'),'id="workstatus"' ,'required="true"' ,'class="form-control select2');
|
||||
|
||||
?>
|
||||
@ -692,7 +711,7 @@ $(document).ready(function () {
|
||||
<div class="col-md-3">
|
||||
<span for="payablefrom">Payable Terms</span>
|
||||
<select class="form-control required" id="PaymentTerms" name="PaymentTerms">
|
||||
<option value="Date of invoice" >Select Payment method</option>
|
||||
<option value="" >Select Payment method</option>
|
||||
<?php
|
||||
if(!empty($payment))
|
||||
{
|
||||
@ -858,7 +877,7 @@ $(document).ready(function () {
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label>Rate</label>
|
||||
<label><?php echo "Rate ($Value)";?></label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'Rate','value' => set_value('Rate'),'id'=>'Rate', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);' ,'onchange'=>'Ratechange()' );
|
||||
@ -867,7 +886,7 @@ $(document).ready(function () {
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label>Basic Amount</label>
|
||||
<label><?php echo "Basic Amount ($Value)";?></label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'txtBasicValue','value' => set_value('txtBasicValue'),'id'=>'txtBasicValue', 'class' => 'form-control num' ,'readonly' => 'true');
|
||||
@ -966,7 +985,7 @@ $(document).ready(function () {
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-5 col-md-offset-4" align="right">
|
||||
Total Order value :
|
||||
<label><?php echo "Total Order value ($Value)";?></label>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
@ -1101,7 +1120,7 @@ $(document).ready(function () {
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label>Rate</label>
|
||||
<label><?php echo "Rate($Value)";?></label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'EditRate','value' => set_value('EditRate'),'id'=>'EditRate', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);' ,'onchange'=>'EditRatechange()' );
|
||||
@ -1110,7 +1129,7 @@ $(document).ready(function () {
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label>Basic Amount</label>
|
||||
<label><?php echo "Basic Amount ($Value)";?></label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'txtEditBasicValue','value' => set_value('txtEditBasicValue'),'id'=>'txtEditBasicValue', 'class' => 'form-control num' ,'readonly' => 'true');
|
||||
@ -1210,7 +1229,7 @@ $(document).ready(function () {
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-5 col-md-offset-4" align="right">
|
||||
Total Order value :
|
||||
<label><?php echo "Total Order value ($Value)";?></label>>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
@ -2006,6 +2025,18 @@ $('#txtStatus').val(stat);
|
||||
});
|
||||
|
||||
|
||||
var Detail = <?php echo json_encode($Payment, JSON_PRETTY_PRINT) ?>;
|
||||
//console.log(Detail);
|
||||
|
||||
$.each(Detail, function (index, value)
|
||||
{
|
||||
$("#PaymentTerms").append( $('<option></option>').val(value.PaymentTerms).html(value.PaymentTerms) );
|
||||
|
||||
|
||||
|
||||
} );
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user