If there is a situation where you frequently receive less than the PO quantity, is there a way to close the PO?
close means remove from PO not from the Base Table ??
Close means to remove the PO as it get deleted when the total amount is received and invoiced. The main purpose of this requirement is to prevent open POs getting piled up unnecessarily for stock not to be received for ever..
Ever have an instance where the "Delete Invoice Purchase Orders" doesn't delete the purchase order? I have one client that is having this problem. The Qty is the same as the Qty Received and Qty Invoiced. Nothing is oustanding.
Ever have an instance where the "Delete Invoice Purchase Orders" doesn't delete the purchase order? I have one client that is having this problem. The Qty is the same as the Qty Received and Qty Invoiced. Nothing is oustanding.
Ever have an instance where the "Delete Invoice Purchase Orders" doesn't delete the purchase order? I have one client that is having this problem. The Qty is the same as the Qty Received and Qty Invoiced. Nothing is oustanding.
Any ideas?
yes I have seen this often.
The problem is that the code in the "Delete Invoice Purchase Orders" function is not the same as the code used to determine if an order can actually be deleted or not. It done this way to make it a bit faster, but I really would prefer the code to be rewritten so it tests everything the same as in the ondelete triggers. The code does things like filter on a couple of fields and do a find to see if it can delete that sometimes fails, BUT luckily it fails by not deleting, I haven't seen the other way of it deleting something it shouldn't.
To apply this hotfix, change the code in the Purchase Header - OnAfterGetRecord() trigger in the Delete Invoiced Purch. Orders report (499) as follows.
Existing code
...
IF PurchLine.FIND('-') THEN
REPEAT
PurchLine.CALCFIELDS("Qty. Assigned");
IF ((PurchLine."Qty. Assigned" = PurchLine."Quantity Invoiced") OR
// Delete the following lines.
(PurchLine.Type <> PurchLine.Type::"Charge (Item)")) AND
(PurchLine."Qty. Assigned" <> 0)
THEN BEGIN
...
Replacement code
...
IF PurchLine.FIND('-') THEN
REPEAT
PurchLine.CALCFIELDS("Qty. Assigned");
// Modify the following line.
IF ((PurchLine."Qty. Assigned" = PurchLine."Quantity Invoiced") AND
// Add the following lines.
(PurchLine."Qty. Assigned" <> 0)) OR
(PurchLine.Type <> PurchLine.Type::"Charge (Item)")
Comments
close means remove from PO not from the Base Table ??
viewtopic.php?f=23&t=30546
Deep
India
Close means to remove the PO as it get deleted when the total amount is received and invoiced. The main purpose of this requirement is to prevent open POs getting piled up unnecessarily for stock not to be received for ever..
Thanks
But still, the PO remains, it will not get deleted as it does when you receive and invoice the total amount..
Thanks
Deep
India
Any ideas?
You should debug the Code to get the Reason.
yes I have seen this often.
The problem is that the code in the "Delete Invoice Purchase Orders" function is not the same as the code used to determine if an order can actually be deleted or not. It done this way to make it a bit faster, but I really would prefer the code to be rewritten so it tests everything the same as in the ondelete triggers. The code does things like filter on a couple of fields and do a find to see if it can delete that sometimes fails, BUT luckily it fails by not deleting, I haven't seen the other way of it deleting something it shouldn't.
After receiving & invoicing the partial quantity, archieve the PO and delete the PO from pending PO list.
Praveen
Can you please post the code here, (if its just a few lines) and a link to the KB. It will be of use to help those that have helped you.
Here's the link: https://mbs.microsoft.com/knowledgebase ... OQRZLRXVOU
Here's the change:
To apply this hotfix, change the code in the Purchase Header - OnAfterGetRecord() trigger in the Delete Invoiced Purch. Orders report (499) as follows.
Existing code
...
IF PurchLine.FIND('-') THEN
REPEAT
PurchLine.CALCFIELDS("Qty. Assigned");
IF ((PurchLine."Qty. Assigned" = PurchLine."Quantity Invoiced") OR
// Delete the following lines.
(PurchLine.Type <> PurchLine.Type::"Charge (Item)")) AND
(PurchLine."Qty. Assigned" <> 0)
THEN BEGIN
...
Replacement code
...
IF PurchLine.FIND('-') THEN
REPEAT
PurchLine.CALCFIELDS("Qty. Assigned");
// Modify the following line.
IF ((PurchLine."Qty. Assigned" = PurchLine."Quantity Invoiced") AND
// Add the following lines.
(PurchLine."Qty. Assigned" <> 0)) OR
(PurchLine.Type <> PurchLine.Type::"Charge (Item)")
THEN BEGIN
...