import po edit
This commit is contained in:
parent
9196389d56
commit
3974533a8d
@ -253,6 +253,22 @@ class purchaseorder extends BaseController
|
||||
Start here */
|
||||
$ReqDetails = $this->purchaseorder_model->getRequistDetails($ReqArray);
|
||||
$data['RequistionDetails'] = $ReqDetails;
|
||||
foreach ($data['RequistionDetails'] as $ReqDet)
|
||||
{
|
||||
|
||||
$Status=$ReqDet->Status;
|
||||
}
|
||||
|
||||
//print_r($Status);
|
||||
$data['POSTATUS']=$this->purchaseorder_model->GetPOStatus($Status);
|
||||
//print_r($data['POSTATUS']);
|
||||
|
||||
foreach ($data['POSTATUS'] as $POST)
|
||||
{
|
||||
$Status=$POST->StatusName;
|
||||
}
|
||||
|
||||
//print_r($Status);
|
||||
$CostCode = '';
|
||||
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
|
||||
|
||||
@ -272,6 +288,8 @@ class purchaseorder extends BaseController
|
||||
/* End Here */
|
||||
|
||||
$data['POMaster'] = $this->purchaseorder_model->GetServicePurchaseOrder($PONO);
|
||||
|
||||
//$data['POSTATUS']=$this->purchaseorder_model->GetServicePurchaseOrder($PONO);
|
||||
//print_r($data['POMaster']);
|
||||
foreach ($data['POMaster'] as $Exc)
|
||||
{
|
||||
@ -964,7 +982,20 @@ function addNewImportPurchaseOrder()
|
||||
$Deliverydt = $this->getDateformat($dt);
|
||||
$DeliverySchedule = '';
|
||||
}
|
||||
|
||||
|
||||
$PaymentDate=$this->input->post('Payment');
|
||||
if($PaymentDate==1)
|
||||
{
|
||||
$PaymentDays='After';
|
||||
}
|
||||
else
|
||||
{
|
||||
$PaymentDays='Before';
|
||||
}
|
||||
|
||||
//echo $PaymentDays;
|
||||
//die();
|
||||
|
||||
$SpcialInstruction = $this->input->post('txtSpcialInstruction');
|
||||
$TotalOrder = $this->input->post('txtToatlOrder');
|
||||
$POStatus = $this->input->post('textStatus');
|
||||
@ -988,9 +1019,9 @@ function addNewImportPurchaseOrder()
|
||||
|
||||
|
||||
|
||||
$POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ExchangeRate'=>$Exchangerate,'ExchangeRateCalculatedon'=>$ExchangeRateCalculatedon,'CurrencyType'=>$CurrencyType,'PaymentTerms'=>$PaymentTerms,'PayableAT'=>$Payableat);
|
||||
$POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ExchangeRate'=>$Exchangerate,'ExchangeRateCalculatedon'=>$ExchangeRateCalculatedon,'CurrencyType'=>$CurrencyType,'PaymentTerms'=>$PaymentTerms,'PayableAT'=>$Payableat,'PaymentDays'=>$PaymentDays);
|
||||
|
||||
//print_r($POList);
|
||||
//print_r($POList);PaymentDays
|
||||
//die();
|
||||
$POMaster = $this->purchaseorder_model->addPOMaster($POList);
|
||||
|
||||
@ -1129,7 +1160,15 @@ $createddt='';
|
||||
$Deliverydt = $this->getDateformat($dt);
|
||||
$DeliverySchedule = '';
|
||||
}
|
||||
|
||||
$PaymentDate=$this->input->post('Payment');
|
||||
if($PaymentDate==1)
|
||||
{
|
||||
$PaymentDays='After';
|
||||
}
|
||||
else
|
||||
{
|
||||
$PaymentDays='Before';
|
||||
}
|
||||
|
||||
$SpcialInstruction = $this->input->post('txtSpcialInstruction');
|
||||
$TotalOrder = $this->input->post('txtToatlOrder');
|
||||
@ -1147,7 +1186,7 @@ $createddt='';
|
||||
$Payableat=$this->input->post('PayableAT');
|
||||
// PO Master
|
||||
// PO Master
|
||||
$POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ExchangeRate'=>$Exchangerate,'ExchangeRateCalculatedon'=>$ExchangeRateCalculatedon,'CurrencyType'=>$CurrencyType,'PaymentTerms'=>$PaymentTerms,'PayableAT'=>$Payableat);
|
||||
$POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ExchangeRate'=>$Exchangerate,'ExchangeRateCalculatedon'=>$ExchangeRateCalculatedon,'CurrencyType'=>$CurrencyType,'PaymentTerms'=>$PaymentTerms,'PayableAT'=>$Payableat,'PaymentDays'=>$PaymentDays);
|
||||
//echo $PONO;
|
||||
//echo $TotalOrder;
|
||||
//print_r($POList);
|
||||
|
||||
@ -188,7 +188,7 @@ function purchaseorderListing()
|
||||
function getRequistDetails($ReqNoList='')
|
||||
{
|
||||
$this->db->distinct();
|
||||
$this->db->select('ReqNo,ReqType,Status,Requestedby,mast.CreatedDate,emp.FirstName,emp.EmpID,emp.Designation, Dept.DEPCode,Dept.DepartmentName,mast.ReqDate,mast.CostCenterCode');
|
||||
$this->db->select('ReqNo,ReqType,Status,Requestedby,mast.CreatedDate,emp.FirstName,emp.EmpID,emp.Designation, Dept.DEPCode,Dept.DepartmentName,mast.ReqDate,mast.CostCenterCode,mast.Status');
|
||||
$this->db->from('T_Requestion_Master mast');
|
||||
$this->db->join('T_Employee_Details emp', 'mast.Requestedby = emp.EmpID');
|
||||
$this->db->join('T_DepartmentDetails Dept', 'emp.Departmentcode = Dept.DEPCode');
|
||||
@ -443,7 +443,7 @@ function purchaseorderListing()
|
||||
function GetServicePurchaseOrder($PONO = '')
|
||||
{
|
||||
$this->db->distinct();
|
||||
$this->db->select('ReqNo,POMast.PONO,ServiceDescription,supp.SupplierID,supp.SupplierName,supp.Address,PODate,Stat.StatusName,DeliveryOption,DeliverySchedule,DeliveryDate,DeliveryAddress,Stat.StatusCode,POMast.ExchangeRateCalculatedon,POMast.ExchangeRate,POMast.CurrencyType,POMast.PaymentTerms,POMast.PayableAT');
|
||||
$this->db->select('ReqNo,POMast.PONO,ServiceDescription,supp.SupplierID,supp.SupplierName,supp.Address,PODate,Stat.StatusName,DeliveryOption,DeliverySchedule,DeliveryDate,DeliveryAddress,Stat.StatusCode,POMast.ExchangeRateCalculatedon,POMast.ExchangeRate,POMast.CurrencyType,POMast.PaymentTerms,POMast.PayableAT,POMast.PaymentDays');
|
||||
$this->db->from('T_PurchaseOrder_Master POMast');
|
||||
$this->db->join('T_SupplierDetailsN supp', 'supp.SupplierID = POMast.SupplierID');
|
||||
$this->db->join('T_Status Stat', 'Stat.StatusCode = POMast.Status');
|
||||
@ -571,6 +571,15 @@ function GetImportPurchaseOrderDetailsForPDF($PONO = '')
|
||||
}
|
||||
|
||||
|
||||
function GetPOStatus($Status='')
|
||||
{
|
||||
$subQuery='SELECT StatusName from T_Status where StatusCode=?';
|
||||
$query=$this->db->query($subQuery,array($Status));
|
||||
return $query->result();
|
||||
|
||||
}
|
||||
|
||||
|
||||
function GetPaymentTerms($PONO='')
|
||||
{
|
||||
$subQuery='SELECT PaymentTerms from T_PurchaseOrder_Master where PONO=?';
|
||||
|
||||
@ -107,9 +107,32 @@ if(!empty($POMaster))
|
||||
$ExchangeRateCalculatedon=$Req->ExchangeRateCalculatedon;
|
||||
$PaymentTerms=$Req->PaymentTerms;
|
||||
$PayableAT=$Req->PayableAT;
|
||||
$PaymentDays=$Req->PaymentDays;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//echo $PaymentDays;
|
||||
|
||||
|
||||
if(!empty($RequistionDetails))
|
||||
{
|
||||
|
||||
foreach ($RequistionDetails as $ReqDet)
|
||||
{
|
||||
$Reqon=$ReqDet->ReqDate;
|
||||
$Requestedby=$ReqDet->Requestedby;
|
||||
//$Status=$ReqDet->Status;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
foreach ($POSTATUS as $PST )
|
||||
{
|
||||
$POStatus=$PST->StatusName;
|
||||
}
|
||||
|
||||
//echo "$POStatus";
|
||||
?>
|
||||
|
||||
<style>
|
||||
@ -1889,22 +1912,22 @@ if(!empty($POMaster))
|
||||
<div class="col-md-4">
|
||||
<span>Request On</span>
|
||||
<?php
|
||||
$data = array('name' => 'Requeston','value' => set_value('Requeston'),'id'=>'Requeston', 'class' => 'form-control num' ,'required' => 'true', 'onkeypress'=>'return false;');
|
||||
$data = array('name' => 'Requeston','value' => set_value('Requeston',$Reqon),'id'=>'Requeston', 'class' => 'form-control num' ,'required' => 'true', 'onkeypress'=>'return false;');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<span>Request By</span>
|
||||
<?php
|
||||
$data = array('name' => 'RequestBy','value' => set_value('RequestBy'),'id'=>'RequestBy', 'class' => 'form-control' ,'required' => 'true');
|
||||
$data = array('name' => 'RequestBy','value' => set_value('RequestBy',$Requestedby),'id'=>'RequestBy', 'class' => 'form-control' ,'required' => 'true');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<span>Status</span>
|
||||
<?php
|
||||
$options = array("0"=>'Select Status');
|
||||
echo form_dropdown('Status', $options,set_value('Status'),'id="Status"' ,'required="true"' ,'class="form-control select2')
|
||||
$options = array("0"=>$POStatus);
|
||||
echo form_dropdown('Status', $options,set_value('Status',$POStatus),'id="Status"' ,'required="true"' ,'class="form-control select2')
|
||||
?>
|
||||
</div><br/>
|
||||
</div>
|
||||
@ -1951,6 +1974,18 @@ var NilType = '<?php echo NILTYPE;?>';
|
||||
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;
|
||||
}
|
||||
|
||||
// $('#ExchangeRate').val(<?php echo $ExchangeRate;?>);
|
||||
$('#EditAvlBudAmt').val(<?php echo $AvlAmount; ?>);
|
||||
|
||||
@ -1997,8 +2032,6 @@ $('#currencytype').change(function()
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
$('#drpSupplier').change(function() {
|
||||
|
||||
var id = $('#drpSupplier').val();
|
||||
@ -2015,7 +2048,17 @@ $('#drpSupplier').change(function() {
|
||||
{
|
||||
$("#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;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -377,7 +377,10 @@ function vaildateBeforeOpenModal()
|
||||
Payment Date <br/>
|
||||
<tr>
|
||||
<td>
|
||||
<?php echo form_label('Before', 'Before') ." ". form_radio(array("name"=>"Payment", "id"=>"Before", "value"=>"0", 'checked'=>set_radio('Payment', '0', TRUE))); ?> </td>
|
||||
<?php echo form_label('Before', 'Before') ." ". form_radio(array("name"=>"Payment", "id"=>"Before", "value"=>"0", 'checked'=>'checked')); ?> </td>
|
||||
|
||||
|
||||
<!-- <?php echo form_label('Date', 'Date') ." ". form_radio(array("name"=>"DateRange", "id"=>"Date", "value"=>"0", 'checked'=>'checked')); ?> </td> -->
|
||||
<td>
|
||||
<?php echo form_label('After', 'After') ." ". form_radio(array("name"=>"Payment", "id"=>"After", "value"=>"1", 'checked'=>set_radio('Payment', '1', FALSE))); ?>
|
||||
|
||||
@ -517,7 +520,7 @@ function vaildateBeforeOpenModal()
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<label>Rate </label>
|
||||
<P id=labelRate> <label><?php echo "Rate in";?> </label></P>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'Rate','value' => set_value('Rate'),'id'=>'Rate', 'class' => 'form-control' ,'onkeypress'=>'return isNumberKey(event);' ,'onchange'=>'Ratechange()' );
|
||||
@ -541,11 +544,10 @@ function vaildateBeforeOpenModal()
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="col-md-3">
|
||||
<p id=labelBasicpriceus> <label><?php echo "Basic Price In";?></label></p>
|
||||
|
||||
Basic Price in US $ per Ton :
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<!-- Basic Price in US $ per Ton : -->
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'imBasicPrice','value' => set_value('imBasicPrice'),'id'=>'imBasicPrice', 'class' => 'form-control' ,'placeholder '=>'basic price','onkeypress'=>'return isNumberKey(event);','onchange'=>'USRate()');
|
||||
echo form_input($data);
|
||||
@ -568,8 +570,9 @@ function vaildateBeforeOpenModal()
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<P id=labelBasicINR> <label><?php echo "Basic value in INR";?> </label></P>
|
||||
|
||||
Basic value in INR :
|
||||
<!-- Basic value in INR : -->
|
||||
|
||||
|
||||
|
||||
@ -1054,7 +1057,8 @@ function vaildateBeforeOpenModal()
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<label>Rate </label>
|
||||
<P id=labelEditRate> <label><?php echo "Rate in";?> </label></P>
|
||||
<!-- <label>Rate </label> -->
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'EditRate','value' => set_value('EditRate'),'id'=>'EditRate', 'class' => 'form-control' ,'onkeypress'=>'return isNumberKey(event);' ,'onchange'=>'Ratechange()' );
|
||||
@ -1077,8 +1081,8 @@ function vaildateBeforeOpenModal()
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="col-md-3">
|
||||
|
||||
Basic Price in US $ per Ton :
|
||||
<p id=labelEditBasicPriceUs><label><?php echo "Basic Value In";?></label></p>
|
||||
<!-- Basic Price in US $ per Ton : -->
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
@ -1104,8 +1108,8 @@ function vaildateBeforeOpenModal()
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
|
||||
Basic value in INR :
|
||||
<p id=labelEditBasicINR><label><?php echo "Basic value in INR :";?></label></p>
|
||||
<!-- Basic value in INR : -->
|
||||
|
||||
|
||||
|
||||
@ -1725,8 +1729,19 @@ $('#drpSupplier').change(function() {
|
||||
$("#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;
|
||||
|
||||
//var a=$("PayableAT").val();
|
||||
console.log(obj.PaymentTerms);
|
||||
|
||||
//$("#PaymentTerms").append( $('<option></option>').val(obj.PaymentTerms).html(obj.PaymentTerms) );
|
||||
|
||||
|
||||
@ -1742,10 +1757,6 @@ $('#drpSupplier').change(function() {
|
||||
|
||||
});
|
||||
|
||||
// $('#PaymentTerms').change(function()
|
||||
// {
|
||||
// //alert();
|
||||
// });
|
||||
|
||||
|
||||
$('#currencytype').change(function(){
|
||||
@ -1891,9 +1902,16 @@ $.each(symbol,function(idx,obj)
|
||||
{
|
||||
var sign=obj.FontCode2000;
|
||||
//alert(sign);
|
||||
document.getElementById("label1").innerHTML ='Exchange Rate in '+sign;
|
||||
document.getElementById("label2").innerHTML ='Basic Value in '+sign;
|
||||
document.getElementById("label1").innerHTML ='Exchange Rate in '+sign;
|
||||
document.getElementById("label2").innerHTML ='Basic Value in '+sign;
|
||||
document.getElementById("label3").innerHTML ='Basic Value in '+sign;
|
||||
document.getElementById("labelRate").innerHTML ='Rate in '+sign;
|
||||
document.getElementById("labelBasicpriceus").innerHTML ='Basic Price In '+sign+' per Ton';
|
||||
document.getElementById("labelBasicINR").innerHTML ='Basic Price in INR:'+sign;
|
||||
document.getElementById("labelEditRate").innerHTML ='Rate in '+sign;
|
||||
document.getElementById("labelEditBasicPriceUs").innerHTML ='Basic Price In '+sign+' per Ton';
|
||||
document.getElementById("labelEditBasicINR").innerHTML ='Basic Price in INR:'+sign;
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
@ -96,6 +96,8 @@ $('#drpSupplier').change(function() {
|
||||
if(obj.SupplierID === id)
|
||||
{
|
||||
$("#SupAddress").val(obj.Address);
|
||||
$("#PayableAT").val(obj.PayableAT);
|
||||
$("#PaymentTerms").val(obj.PaymentTerms);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user