[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Vendor post invoice function



Hi Chris,
    I saw in IS.pm at sub cogs function:
    When the project try to handle minus quantity, to return the items to vendor invoices,  the condition is  i.allocated >0 .

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

   Please, if there are any restrictions avoid that in IR.pm file at sub post_invoice
   let me know, and I will be grateful.

Best wishes,
Shaekir,

From: ..hidden..
To: ..hidden..
Date: Fri, 10 Dec 2010 14:56:50 -0600
Subject: [Ledger-smb-devel] Vendor post invoice function

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 ..hidden.. https://lists.sourceforge.net/lists/listinfo/ledger-smb-devel