Hi Chris,
    Hope everything is O.K.ً

When the user posted AP invoice, with minus quantity.

In sub post_invoice function at IR.pm File:

If the quantity is minus, you will try to return the items to the AP invoices 
that sold this item, order by transdate and i.qty  + i.allocated <0.

$query = qq|
                                  SELECT i.id, i.qty, i.allocated, a.transdate
                                    FROM invoice i
                                    JOIN parts p ON (p.id = i.parts_id)
                                    JOIN ap a ON (a.id = i.trans_id)
                                   WHERE i.parts_id = ? AND (i.qty +  
i.allocated) < 0 AND i.sellprice = ?
                                ORDER BY transdate
                                    |;

my question:
     Is there availability to make the condition is [order by a.transdate, 
i.trans_id, i.id and i.qty +  i.allocated <0 or i.qty  + i.allocated = 0 ]

to recover the case, If I have i.qty  + i.allocated = 0 and I don't have i.qty 
+i.allocated < 0

or there are some restriction avoid that.

Brest wishes,
Shaekir,
                                          
------------------------------------------------------------------------------
Oracle to DB2 Conversion Guide: Learn learn about native support for PL/SQL,
new data types, scalar functions, improved concurrency, built-in packages, 
OCI, SQL*Plus, data movement tools, best practices and more.
http://p.sf.net/sfu/oracle-sfdev2dev 
_______________________________________________
Ledger-smb-devel mailing list
Ledger-smb-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ledger-smb-devel

Reply via email to