On Mon, 21 Mar 2011, Alf Newman wrote:

Statements are not designed to give a full customer transaction history.

Alf,

  I'm familiar with statements from our corporate attorney (who works off a
retainer) and that does have a transaction history for the specific project.
I can see how statements can have multiple purposes depending on the
business (e.g., product selling versus service selling) and it would be
great to be able to select such a major distinction in configuring and using
L123.

... the code below might work. Hope you can improve it too. Alf Note. Replace the perl $variables with something valid

*SELECT transdate AS date, invnumber AS reference, amount*-1 FROM ar
WHERE (ar.customer_id=(SELECT id FROM customer WHERE
customernumber='$customer_number'))
UNION ALL
SELECT acc_trans.transdate AS date, 'Receipt' AS reference, acc_trans.amount
AS amount FROM acc_trans, customer, ar
WHERE (customer.customernumber=**'$customer_number'**)
AND (customer.id=ar.customer_id)
AND (ar.id=acc_trans.trans_id)
AND (acc_trans.chart_id=(SELECT id FROM chart WHERE
accno='$bank_account_code'))
ORDER BY date
*

  I'll give this a try.

Thanks,

Rich
_______________________________________________
SQL-Ledger mailing list
[email protected]
http://lists.ledger123.com/mailman/listinfo/sql-ledger

Reply via email to