Amendment issue

This commit is contained in:
gandhimathi Bharathirajan 2017-07-12 15:22:00 +05:30
parent 5d90214dfe
commit c119edbe84

View File

@ -43,6 +43,11 @@ function purchaseorderListing($forwhat='')
{
$this->db->where('POMast.Status',PO_RELEASED);
}
else
{
$this->db->where('POMast.Status !=',PO_AMENDED);
// $this->db->order_by('POMast.Status !=',PO_AMENDED);
}
$query = $this->db->get();
//print_r( $this->db->last_query());
$result = $query->result();
@ -377,6 +382,24 @@ function purchaseorderListing($forwhat='')
}
function addAmendPOMaster($POMaster,$CreatedBy,$ParentPO)
{
// print_r($POMaster);
$this->db->trans_start();
$this->db->insert('T_PurchaseOrder_Master', $POMaster);
$insert_id = $this->db->affected_rows();
$this->db->trans_complete();
// print_r($this->db->last_query());
if($insert_id>0)
{
$subQuery = 'select max(PONO) as PONO from T_PurchaseOrder_Master where CreatedBy=? and ParentPO=?';
$query = $this->db->query($subQuery,array($CreatedBy,$ParentPO));
return $query->result_array();
}
}
/**
* This function is used to add New Purchase order Line Item to the system
*/
@ -605,7 +628,7 @@ function GetImportPurchaseOrderDetailsForPDF($PONO = '')
{
$subQuery='SELECT * from T_Currency_Details where Currency_Code=?';
$query=$this->db->query($subQuery,array($Currencycode));
//print_r($this->db->last_query());
return $query->result();
}
@ -670,8 +693,7 @@ function GetImportPurchaseOrderDetails($PONO = '')
$subQuery ='SELECT distinct LineItem.LineItemNo,Req.ReqNo,Mat.MaterialCode,Mat.MaterialName,
Mat.UOM,Quantity,Rate,Req.Status,ROUND((Quantity *Rate),2 ) as BasicValue ,
ROUND((RMCIncludingCustomersPerKG*Quantity),2)as Taxamount,LandingCharge,HighSeasSalesCharge,CustomDuty,ExciseDuty,ExciseDutyEdCess,CustomEdCess,POMast.ExchangeRate,AfterLandingCharge,AfterHighSeasSalesCharge,AfterCustomDuty,AfterExciseDuty,AfterExciseDutyEdCess,AddlExciseDuty,AfterAddlExciseDuty,Grossdutypayable,AvailableModvat,Grossexpensesduetocustomduty,purchaseratePerKG,CustomDutyExpensesPerKG,RMCIncludingCustomersPerKG,QuantityKG,BasicPriceInMTon,ProductPrice,CustomSHCess,AfterCustomSHCess,AfterExciseDutySHCess,ExciseDutySHCess,AfterCustomEdCess,ROUND((Quantity *Rate)+(RMCIncludingCustomersPerKG*Quantity),2)as TotalOrderValue,ROUND((POMast.ExchangeRate*BasicPriceInMTon),2) as BasicINRValue,TotalValue,CurrencyType,ReceivedQuantity,
ROUND((RMCIncludingCustomersPerKG*Quantity),2)as Taxamount,LandingCharge,HighSeasSalesCharge,CustomDuty,ExciseDuty,ExciseDutyEdCess,CustomEdCess,POMast.ExchangeRate,AfterLandingCharge,AfterHighSeasSalesCharge,AfterCustomDuty,AfterExciseDuty,AfterExciseDutyEdCess,AddlExciseDuty,AfterAddlExciseDuty,Grossdutypayable,AvailableModvat,Grossexpensesduetocustomduty,purchaseratePerKG,CustomDutyExpensesPerKG,RMCIncludingCustomersPerKG,QuantityKG,BasicPriceInMTon,ProductPrice,CustomSHCess,AfterCustomSHCess,AfterExciseDutySHCess,ExciseDutySHCess,AfterCustomEdCess,ROUND((Quantity *Rate)+(RMCIncludingCustomersPerKG*Quantity),2)as TotalOrderValue,ROUND((POMast.ExchangeRate*BasicPriceInMTon),2) as BasicINRValue,TotalValue,CurrencyType,
Req.CostCenterCode,Dept.DepartmentName FROM T_PurchaseOrder_LineItem LineItem
join T_PurchaseOrder_Master POMast on POMast.PONO = LineItem.PONO
join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode
@ -727,7 +749,7 @@ function GetCurrencytype()
// To update Parent PO as Amended PO
function updateAmendPOMaster($PONO,$PODetail)
{
//echo $PONO."from model";
echo $PONO."from model";
$this->db->where('PONO', $PONO);