Amendment issue
This commit is contained in:
parent
5d90214dfe
commit
c119edbe84
@ -43,6 +43,11 @@ function purchaseorderListing($forwhat='')
|
|||||||
{
|
{
|
||||||
$this->db->where('POMast.Status',PO_RELEASED);
|
$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();
|
$query = $this->db->get();
|
||||||
//print_r( $this->db->last_query());
|
//print_r( $this->db->last_query());
|
||||||
$result = $query->result();
|
$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
|
* 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=?';
|
$subQuery='SELECT * from T_Currency_Details where Currency_Code=?';
|
||||||
$query=$this->db->query($subQuery,array($Currencycode));
|
$query=$this->db->query($subQuery,array($Currencycode));
|
||||||
|
//print_r($this->db->last_query());
|
||||||
return $query->result();
|
return $query->result();
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -670,8 +693,7 @@ function GetImportPurchaseOrderDetails($PONO = '')
|
|||||||
|
|
||||||
$subQuery ='SELECT distinct LineItem.LineItemNo,Req.ReqNo,Mat.MaterialCode,Mat.MaterialName,
|
$subQuery ='SELECT distinct LineItem.LineItemNo,Req.ReqNo,Mat.MaterialCode,Mat.MaterialName,
|
||||||
Mat.UOM,Quantity,Rate,Req.Status,ROUND((Quantity *Rate),2 ) as BasicValue ,
|
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
|
Req.CostCenterCode,Dept.DepartmentName FROM T_PurchaseOrder_LineItem LineItem
|
||||||
join T_PurchaseOrder_Master POMast on POMast.PONO = LineItem.PONO
|
join T_PurchaseOrder_Master POMast on POMast.PONO = LineItem.PONO
|
||||||
join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode
|
join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode
|
||||||
@ -727,7 +749,7 @@ function GetCurrencytype()
|
|||||||
// To update Parent PO as Amended PO
|
// To update Parent PO as Amended PO
|
||||||
function updateAmendPOMaster($PONO,$PODetail)
|
function updateAmendPOMaster($PONO,$PODetail)
|
||||||
{
|
{
|
||||||
//echo $PONO."from model";
|
echo $PONO."from model";
|
||||||
|
|
||||||
|
|
||||||
$this->db->where('PONO', $PONO);
|
$this->db->where('PONO', $PONO);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user