User Tools

Site Tools


update_fxpaid

This is an old revision of the document!


 UPDATE ap SET fxamount = amount WHERE fxamount = 0;
 UPDATE ap SET fxpaid = paid WHERE fxpaid = 0;
 
 UPDATE ap SET fxamount = (SELECT SUM(0-amount) FROM acc_trans WHERE
 chart_id IN (SELECT id FROM chart WHERE link LIKE '%AP_amount%' OR
 link LIKE '%IC_expense%' OR link LIKE '%tax%') AND trans_id=ap.id and
 NOT fx_transaction);

UPDATE ap SET fxpaid = (SELECT SUM(amount) FROM acc_trans WHERE

 chart_id IN (SELECT id FROM chart WHERE link LIKE '%_paid%') AND
 trans_id=ap.id AND NOT fx_transaction);
 
 UPDATE ar SET fxamount=round(fxamount), fxpaid=ROUND(fxpaid);
update_fxpaid.1475574311.txt.gz · Last modified: 2016/10/04 09:45 by sweitmann