[ 
https://issues.apache.org/jira/browse/OFBIZ-5649?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15379300#comment-15379300
 ] 

Sharan Foga commented on OFBIZ-5649:
------------------------------------

I think this could be partially a process implementation issue, where the total 
outstanding payment value is showing as zero because it has been applied. An 
unpaid payment applied to an invoice should still have an outstanding amount to 
be paid. Need to look at the process flow to see how it could work and if any 
changes are needed - where the best place to put them could be.

> Purchase Invoice Outstanding Amount is zero when payment to Supplier has not 
> been made
> --------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-5649
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-5649
>             Project: OFBiz
>          Issue Type: Bug
>          Components: accounting
>            Reporter: Sharan Foga
>            Assignee: Sharan Foga
>            Priority: Minor
>
> I have come across an issue with payments. The outstanding amount is set to 
> zero when the Purchase Invoice hasnt yet been paid so is never displayed as 
> an invoice that is due for payment.
> To replicate it the example I used was to:
> 1. Create a Purchase Order created for 2 GZ-1000 at $7.50 each to DemoSupplier
> 2. Approve the PO
> 3. Quick Receive the PO
> When you receive Purchase Order into inventory a “payment” is created under 
> the “Payment Information” section of the Purchase Order.
> The Payment is created for an amount of $15 with a status of “Not Paid”
> At receipt , the Pro Forma invoice is also created and is displayed below the 
> payment on the view order screen.
> If you click the link to the Pro Forma Invoice and look at the “Terms” 
> section which shows the “Outstanding Amount” you will see that it is now 
> showing zero. (I don’t think this is correct because you haven’t paid the 
> supplier yet! I think the Outstanding Amount on the Pro Forma invoice should 
> still be $15.)
> If you then go to Accounting Manager / Payments to locate Purchase Invoices 
> by Due Date then this invoice isnt displayed even though the Due Date is the 
> current date. I think this is because the Outstanding Amount is zero, OFBiz 
> thinks that the invoice has already been paid (when it hasn't).
> I’ve done some more testing and found the following:
> The only options that create the pro forma invoice are:
> "Quick Receive PO" and select the shipment to receive using the shipment 
> number 
> “Receive” and select the shipment to receive using the shipment number
> In both of the cases above if you don’t select the shipment number and use 
> the “No Specific Shipment” instead then only the payment is created and not 
> the invoice. So the invoice creation appears to be linked to selecting a 
> specific shipment number.
> Also if you use “Receive Inventory” from Facility Manager, this only gives 
> you the option for “No Specific Shipment” so once again the payment is 
> created but not the invoice.
> Steve added a comment with some additional details as follows.
> The issue seems to be related to the shipment creation as the invoice is 
> correctly created if the product is "service" :
> 1. If you enter purchase order for a product type "raw material" -> approve 
> the order -> the payment is created. Receive against inventory (quick or 
> complete) -> shipment created -> receive -> invoice created with outstanding 
> payment 0$ (actual issue)
> 2. If you enter purchase order for a product type "service" (in our case we 
> had to create "painting" service for our products) -> approve the order -> 
> payment AND invoice are created at the same time -> invoice is OK with 
> outstanding value of the order (ex. 15$).
> But if you create an agreement with the vendor e.g including payment in 30 
> days, the problem is solved and the outstanding payment value is the correct 
> value irrespective of the product type (Raw Material, Finished Good, Service 
> etc)
> I've re-done the tests and can confirm what Steve has highlighted is correct. 
> Also if you add a payment term of net days (e.g 5 net days) during purchase 
> order creation the outstanding value is reported correctly (and not zero).
> This seems to narrow down the issue to be to the shipment creation if the 
> product is not a service product and no agreement is linked to the purchase 
> order at creation. 
>  
> ----------------
> Data and Tests to Replicate the Issue
> -----------------
> As requested I’ve included some xml for a ‘test service product’ but it isnt 
> anything special. The product is type ‘service’ has a default price and it 
> has a main supplier (DemoSupplier).
> <entity-engine-xml>
>     <Product billOfMaterialLevel="0" createdByUserLogin="admin" 
> createdDate="2014-08-11 20:17:31.489" createdStamp="2014-08-11 20:17:31.489" 
> createdTxStamp="2014-08-11 20:17:31.401" inShippingBox="N" internalName="Test 
> Service Product for PO" isVariant="N" isVirtual="N" 
> lastModifiedByUserLogin="admin" lastModifiedDate="2014-08-11 20:17:31.489" 
> lastUpdatedStamp="2014-08-11 20:17:31.489" lastUpdatedTxStamp="2014-08-11 
> 20:17:31.401" lotIdFilledIn="Allowed" productId="1111" 
> productTypeId="SERVICE"/>
>     <SupplierProduct availableFromDate="2014-08-11 10:17:59.0" 
> canDropShip="N" createdStamp="2014-08-11 20:18:40.306" 
> createdTxStamp="2014-08-11 20:18:40.282" currencyUomId="USD" 
> lastPrice="30.000" lastUpdatedStamp="2014-08-11 20:18:40.306" 
> lastUpdatedTxStamp="2014-08-11 20:18:40.282" minimumOrderQuantity="0.000000" 
> partyId="DemoSupplier" productId="1111" supplierPrefOrderId="10_MAIN_SUPPL" 
> supplierProductId="SERV-123"/>
>     <ProductPrice createdByUserLogin="admin" createdDate="2014-08-11 
> 20:18:03.777" createdStamp="2014-08-11 20:18:03.777" 
> createdTxStamp="2014-08-11 20:18:03.692" currencyUomId="USD" 
> fromDate="2014-08-11 10:17:43.0" lastModifiedByUserLogin="admin" 
> lastModifiedDate="2014-08-11 20:18:03.777" lastUpdatedStamp="2014-08-11 
> 20:18:03.777" lastUpdatedTxStamp="2014-08-11 20:18:03.692" price="50.000" 
> productId="1111" productPricePurposeId="PURCHASE" 
> productPriceTypeId="DEFAULT_PRICE" productStoreGroupId="_NA_" taxInPrice="Y"/>
> </entity-engine-xml>
> There isnt any special agreement for the tests. I use the existing demo data 
> agreement  (AGR_TEST) for Demo Supplier. 
> See below for the tests if you want to replicate the issue.
> Test 1: Create PO for Service Product with No Purchase Agreement
> The expected Result is that the Outstanding Amount shown for the invoice is 
> correct.
> a)    Upload the XML data for the service product
> b)    Using Order Manager – create a PO to DemoSupplier
> c)    DO NOT select an agreement for the Order
> d)    Add the service product to the order with quantity 5
> e)    Finalise the order and Create it
> f)    Approve the Purchase Order and the Invoice should be automatically 
> created
> g)    Click the Invoice link and look under the “Terms” section and the “Paid 
> Amount” should be zero and the “Outstanding Amount” should be the same as the 
> purchase order value.
> This test is correct and working as expected
> Test 2: Create a PO for a Finished Good with No Purchase Agreement
> The expected result is that the Outstanding Amount shown on the invoice is 
> incorrect (it will be zero instead of the same value as the purchase order 
> value)
> a)    Using Order Manager – create a PO to DemoSupplier
> b)    DO NOT select an agreement for the Order
> c)    Add the product GZ-1000 (Tiny Gizmo) to the order with quantity 5
> d)    Finalise the order and Create it
> e)    Approve the Purchase Order
> f)    Click “Quick Receive Purchase Order”  (As it is a Finished Good we need 
> to receive it to create the invoice)
> g)     Click the Purchase Shipment Number and Receive the Selected Products
> h)    Click back into the Purchase and the Invoice should be created
> i)    Click the Invoice link and look under the “Terms” section and the “Paid 
> Amount”. This value is incorrect - it should be zero but it will have the 
> purchase value. Look at the “Outstanding Amount” – this is incorrect – it 
> will be zero and it should be the purchase order value.
> This test shows the error.
> Test 3: Create a PO for a Finished Good with a Purchase Agreement
> The expected result is that the Outstanding Amount shown on the invoice is 
> correct.
> a)    Do exactly the same test as for Test 2 but at (b) – select  the 
> DemoSupplier agreement “AGR_TEST” 
> Click the Invoice link and look under the “Terms” section and the “Paid 
> Amount” should be zero and the “Outstanding Amount” should be the same as the 
> purchase order value.
> This test is correct and working as expected. The only difference between 
> this and the previous test is that an agreement has been selected which 
> affects the date that the invoice payment is due.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to