答案 0 :(得分:0)
如果已收到所有项目或手动关闭了行,则认为QuickBooks中的采购订单已关闭。如果已收到所有项目,则IsFullyReceived将为真(并且PO将显示“已完整收到”标记)。如果用户手动“关闭”未清项目,则PO将关闭,IsManuallyClosed将为true。请记住,如果两者都是假的,并不意味着整个采购订单都是开放的,因为可能会对订单进行部分接收。
IPurchaseOrderRet poRet = poRetList.GetAt(0);
if(poRet.IsFullyReceived == true || poRet.IsManuallyClosed == true)
{
// The PO is 'closed'
}
else
{
// There are still some open items on the PO
for(int index=0;index<poRet.ORPurchaseOrderLineRetList.Count;index++)
{
IORPurchaseOrderLineRet poLine = poRet.ORPurchaseOrderLineRetList.GetAt(index);
if(poLine.ortype == ENORPurchaseOrderLineRet.orpolrPurchaseOrderLineRet)
{
// Check if the received quantity matches the ordered quantity
if(poLine.PurchaseOrderLineRet.Quantity.GetValue() == poLine.PurchaseOrderLineRet.ReceivedQuantity.GetValue())
{
// Line has been fully received
}
if(poLine.PurchaseOrderLineRet.IsManuallyClosed.GetValue() == true)
{
// Line has been manually closed, but could still have
// partial received quantity
}
}
else
{
// Check the GroupLineRet
}
}
}