วันพุธที่ 27 มิถุนายน พ.ศ. 2555
lastestPurInvPrice
Display real lastestPurInvPrice()
{
VendInvoiceTrans vendInvoiceTrans;
InventTrans inventTrans;
real ret;
;
// while loop for last record to get last price of invoiced purchase
WHILE SELECT PurchPrice FROM vendInvoiceTrans
WHERE vendInvoiceTrans.ItemId == InventSumDateTrans.ItemId
{
ret = vendInvoiceTrans.PurchPrice;
}
// if item have not purched(invoiced) then get cost price
if(!ret)
{
SELECT firstonly inventTrans
WHERE inventTrans.ItemId == InventSumDateTrans.ItemId;
ret = inventTrans.CostAmountPhysical;
}
return ret;
}
สมัครสมาชิก:
ส่งความคิดเห็น (Atom)
Display real lastestPurInvPrice()
ตอบลบ{
VendInvoiceTrans vendInvoiceTrans;
InventTrans inventTrans;
InventTable inventTable2;
real ret;
;
// while loop for last record to get last price of invoiced purchase
WHILE SELECT PurchPrice FROM vendInvoiceTrans
WHERE vendInvoiceTrans.ItemId == InventTable.ItemId
{
ret = vendInvoiceTrans.PurchPrice;
}
// if item have not purched(invoiced) then get cost price
if(!ret)
{
SELECT firstonly inventTrans
WHERE inventTrans.ItemId == InventTable.ItemId;
ret = inventTrans.CostAmountPhysical;
}
//
SELECT firstonly inventTable2
WHERE inventTable2.ItemId == inventTable.ItemId
&& inventTable2.ItemId Like "s*" ;
if(!inventTable2.RecId)
{
ret = 0.00;
}
return ret;
}
display PurchPrice purchPrice()
ตอบลบ{
PurchPrice ret;
InventTable inventTable;
InventTable inventTable2;
InventTable inventTable3;
;
select firstonly inventTable
where inventTable.ItemId == PurchLine.ItemId;
ret = PurchLine.PurchPrice;
select firstonly inventTable2
where inventTable2.ItemId == PurchLine.ItemId
&& inventTable2.ItemId Like "FG*";
if(inventTable2.RecId)
{
ret = 0.00;
}
select firstonly inventTable3
where inventTable3.ItemId == PurchLine.ItemId
&& inventTable3.ItemId Like "R*";
if(inventTable3.RecId)
{
ret = 0.00;
}
return ret;
}