User Tools

Site Tools


update_fxpaid

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
update_fxpaid [2016/12/13 10:53] sweitmannupdate_fxpaid [2016/12/13 11:35] sweitmann
Line 2: Line 2:
    SELECT invnumber, amount, paid, fxamount, fxpaid FROM ap WHERE amount=paid AND fxamount <>     SELECT invnumber, amount, paid, fxamount, fxpaid FROM ap WHERE amount=paid AND fxamount <> 
    fxpaid AND fxpaid <> 0 OR fxpaid is NULL;    fxpaid AND fxpaid <> 0 OR fxpaid is NULL;
-    
-    
        
    UPDATE ap SET fxamount = (SELECT SUM(0-amount) FROM acc_trans WHERE    UPDATE ap SET fxamount = (SELECT SUM(0-amount) FROM acc_trans WHERE
Line 10: Line 8:
    NOT fx_transaction);    NOT fx_transaction);
        
-   UPDATE ap SET fxpaid = paid WHERE fxpaid is NULL; +   UPDATE ar SET fxpaid = paid WHERE fxpaid is NULL; 
 +   
    UPDATE ap SET fxamount = fxpaid WHERE amount = paid;    UPDATE ap SET fxamount = fxpaid WHERE amount = paid;
        
    UPDATE ar SET fxamount = fxpaid WHERE amount = paid;       UPDATE ar SET fxamount = fxpaid WHERE amount = paid;   
        
-   + Ignore below  
        
        
update_fxpaid.txt · Last modified: 2016/12/13 11:57 by sweitmann