capital po view for finance

This commit is contained in:
venbatechnologies@gmail.com 2017-09-20 13:34:36 +05:30
parent 65e679e84b
commit 7d20ecbbff
4 changed files with 110 additions and 14 deletions

View File

@ -528,7 +528,7 @@ class purchaseorder extends BaseController
$data['INRSYMBOL']=$this->purchaseorder_model->GetINRCurrencytype('INR');
/* Cost code from Requisition - Client Review Fix
Start here */
$data['PoTypeOptions'] = $this->purchaseorder_model->getConfigValue('C026');
$ReqDetails = $this->purchaseorder_model->getRequistDetails($ReqArray);
$data['RequistionDetails'] = $ReqDetails;
@ -631,6 +631,62 @@ class purchaseorder extends BaseController
$this->loadViews("editimportpo", $this->global, $data, NULL);
}
else if($POType == CAPITAL)
{
$CapitalRange = $_GET['CapitalRange'];
$CapitalAvlBudget = $this->purchaseorder_model->GetAvailableCapitalBudgetAmount($CostCode,$FYdt,$ReqType);
if(count($CapitalAvlBudget)>0)
{
$data['AvlCapitalBudAmt'] = $CapitalAvlBudget[0]['BudgetAmount'] - $CapitalAvlBudget[0]['Totalvalue'];
}
if($CapitalRange=='0'){
$data['POItem'] = $this->purchaseorder_model->getCapitalPurchaseOrderDetails($PONO);
}
else if($CapitalRange=='1'){
$data['POItem'] = $this->purchaseorder_model->getDomesticCapitalPurchaseOrderDetails($PONO);
}
$data['requestedBy'] = $this->purchaseorder_model->GetRequesedByDetails($PONO);
//$CapitalRange='';
foreach($data['POItem'] as $Rate)
{
$exRate=$Rate->ExchangeRate;
$CapitalRange=$Rate->CapitalRange;
}
foreach($data['POItem'] as $CUR)
{
$Currency=$CUR->CurrencyType;
}
if($CapitalRange=='0'){
$data['CurrencyDetail']=$this->purchaseorder_model->GetCurrencyDetail($Currency);
$data['ExchangeRate']=$exRate;
$data['Currency']=$this->purchaseorder_model->GetCurrencytype();
}
else if($CapitalRange=='1'){
$data['CurrencyDetail']=$this->purchaseorder_model->GetCurrencyDetail('INR');
$data['ExchangeRate']=$exRate;
$data['Currency']=$this->purchaseorder_model->GetCurrencytype();
}
$this->global['pageTitle'] = 'Siddharth : Edit Capital Purchase order form';
$this->loadViews("editCapitalPo", $this->global, $data, NULL);
}
}
// To get the Material value based on the MaterialCode

View File

@ -1251,7 +1251,7 @@ function GetCurrencytype()
{
$this->db->distinct();
$this->db->select('mast.PONO,mast.TotalOrderValue,st.StatusCode,st.StatusName,emp.FirstName,mast.CreatedDate,ccm.CostCenterName,ccm.CostCenterCode,mast.POType as RType,mast.Remarks,DepartmentName,mast.ApprovedBy,(select EmpID from tbl_users where userId=mast.ApprovedBy )as EID,rmast.ReqType,mast.Status,
$this->db->select('mast.PONO,mast.TotalOrderValue,st.StatusCode,st.StatusName,emp.FirstName,mast.CreatedDate,ccm.CostCenterName,ccm.CostCenterCode,mast.POType as RType,mast.Remarks,DepartmentName,mast.ApprovedBy,(select EmpID from tbl_users where userId=mast.ApprovedBy )as EID,rmast.ReqType,mast.Status,mast.CapitalRange,
(select FirstName from T_Employee_Details where EmpID=EID)as Approver');
$this->db->from('T_PurchaseOrder_Master mast');
// $this->db->order_by('mast.Status',"PO_CREATED");

View File

@ -3356,15 +3356,46 @@ $("#PaymentMethod").select2();
<input type="hidden" name="txtDeletedRow" id="txtDeletedRow" />
<?php if($PONOStatus == PO_DRAFT || $PONOStatus == PO_CREATED ) {
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>
<a class="btn btn-primary Save" ID="Cancel" href="<?php echo base_url().'purchaseorderListing'; ?>">&nbsp;&nbsp;<span class="bold">Cancel</span></a>
<?php }else { if($CapitalRange!=1){?>
<a class="btn btn-primary Save" ID="Save" onclick="Save(2)" >&nbsp;&nbsp;<span class="bold">Submit</span></a>
<?php } ?><a class="btn btn-primary" ID="OK" href="<?php echo base_url().'purchaseorderListing'; ?>">&nbsp;&nbsp;<span class="bold">OK</span></a> <?php } ?>
<?php if($PONOStatus == PO_DRAFT || $PONOStatus == PO_CREATED )
{
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>
<a class="btn btn-primary Save" ID="Cancel" href="<?php echo base_url().'purchaseorderListing'; ?>">&nbsp;&nbsp;<span class="bold">Cancel</span></a>
<?php }
else
{
if($DEPCode== FINANCE){?>
<a class="btn btn-primary" ID="OK" onclick="PageRedirect()">OK</a>
<?php }
else if($DEPCode!= FINANCE){
if(($CapitalRange!=1))
{?>
<a class="btn btn-primary Save" ID="Save" onclick="Save(2)" >&nbsp;&nbsp;<span class="bold">Submit</span></a>
<a class="btn btn-primary" ID="OK" href="<?php echo base_url().'purchaseorderListing'; ?>">&nbsp;&nbsp;<span class="bold">OK</span></a>
<?php
}} ?>
<!-- <a class="btn btn-primary" ID="OK" href="<?php echo base_url().'purchaseorderListing'; ?>">&nbsp;&nbsp;<span class="bold">OK</span></a> --> <?php
} ?>
</div>
@ -6988,6 +7019,15 @@ function updateDiscountValuesChange(totAmt,disType,disAmt){
return discount;
}
function PageRedirect()
{
window.location = "poapproval";
}
</script>

View File

@ -58,13 +58,13 @@ if(empty($Status))
<tr id="<?php echo $index ?>" >
<td><a target="_blank" href="<?php echo base_url() ?>purchaseorder/CreatePOPrint?PONO=<?php echo $record->PONO ?>&ReqType=<?php echo $record->ReqType ?>" data-id="<%=index%>" data-userid="<?php echo $record->PONO ?>" ><u><?php echo $record->PONO ?>
<td><a target="_blank" href="<?php echo base_url() ?>purchaseorder/CreatePOPrint?PONO=<?php echo $record->PONO ?>&ReqType=<?php echo $record->ReqType ?>" data-id="<%=index%>" data-userid="<?php echo $record->PONO ?>" ><u><?php echo $record->PONO ?></u>&nbsp;&nbsp;&nbsp;&nbsp;
<?php if(($record->RType=='IMPORT')&&($record->StatusCode!='ST015'))
<?php if(($record->RType=='IMPORT' || $record->RType=='CAPITAL')&&($record->StatusCode!='ST015'))
{?>
<a target="_blank" href="<?php echo base_url() ?>purchaseorder/PurchaseOrderFinanceView?PONO=<?php echo $record->PONO ?>&ReqType=<?php echo $record->ReqType ?>&POType=<?php echo $record->RType ?>" data-id="<%=index%>" data-userid="" ><u><i class="fa fa-eye" data-toggle="tooltip" title="<?php echo $record->PONO; ?> - Click here to View the Purchase Order details"></i>
<a target="_blank" href="<?php echo base_url() ?>purchaseorder/PurchaseOrderFinanceView?PONO=<?php echo $record->PONO ?>&ReqType=<?php echo $record->ReqType ?>&POType=<?php echo $record->RType.'&CapitalRange='.$record->CapitalRange; ?>" data-id="<%=index%>" data-userid="" ><u><i class="fa fa-eye" data-toggle="tooltip" title="<?php echo $record->PONO; ?> - Click here to View the Purchase Order details"></i>
<?php }?>