Difference between revisions of "Accounting exports 4"
(→Global non null account balance) |
(→List of all account debit, credit) |
||
(18 intermediate revisions by 2 users not shown) | |||
Line 41: | Line 41: | ||
AND account_type.activated=1 | AND account_type.activated=1 | ||
AND accounting.id=$accountingId</sql> | AND accounting.id=$accountingId</sql> | ||
+ | |||
+ | =Breakdown by resource accounts of customer invoices= | ||
+ | *Variable '''$startDate''' should be defined first and should be of value type '''Date and time''' value type. | ||
+ | *Variable '''$endDate''' should be defined first and should be of value type '''Date and time''' value type. | ||
+ | |||
+ | <sql>SELECT customer_bill_entry.bill_date AS _tr(DATE), | ||
+ | CONCAT(resource_account_type.name, ' - ', resource_account.name) AS _tr(RESOURCE_ACCOUNT), | ||
+ | product.label AS _tr(PRODUCT), | ||
+ | customer_bill_entry.debit AS _tr(DEBIT), | ||
+ | customer_bill_entry.credit AS _tr(CREDIT), | ||
+ | CONCAT(person_account_type.name, ' - ', person.last_name, ' ', IFNULL(person.first_name, '')) AS _tr(ACCOUNT_MEMBER_ACCOUNT) | ||
+ | FROM customer_bill_entry | ||
+ | |||
+ | LEFT JOIN person ON person.id = customer_bill_entry.owner_id AND customer_bill_entry.owner_category = 2 | ||
+ | |||
+ | LEFT JOIN account_entry AS person_account_entry ON person_account_entry.id = customer_bill_entry.account_entry_id | ||
+ | LEFT JOIN account AS person_account ON person_account.id = person_account_entry.account_id | ||
+ | LEFT JOIN account_type AS person_account_type ON person_account_type.id = person_account.account_type | ||
+ | |||
+ | LEFT JOIN product ON product.id = customer_bill_entry.product_id | ||
+ | |||
+ | INNER JOIN account_entry AS resource_account_entry ON resource_account_entry.flow_id = customer_bill_entry.account_entry_flow_id | ||
+ | INNER JOIN account AS resource_account ON resource_account.id = resource_account_entry.account_id AND resource_account.category = 3 | ||
+ | LEFT JOIN account_type AS resource_account_type ON resource_account_type.id = resource_account.account_type | ||
+ | |||
+ | WHERE bill_date >= $startDate AND bill_date < $endDate | ||
+ | ORDER BY bill_date;</sql> | ||
=Carry forwards= | =Carry forwards= | ||
Line 77: | Line 104: | ||
<sql>SELECT | <sql>SELECT | ||
CASE | CASE | ||
− | WHEN account.category=1 THEN | + | WHEN account.category=1 THEN _tr(OTHER_ACCOUNT) |
− | WHEN account_type.name IS NOT NULL AND (account.category=2) THEN CONCAT( | + | WHEN account_type.name IS NOT NULL AND (account.category=2) THEN CONCAT(_tr(MEMBER_ACCOUNT), ' - ', account_type.name) |
− | WHEN account_type.name IS NOT NULL AND (account.category=3) THEN CONCAT( | + | WHEN account_type.name IS NOT NULL AND (account.category=3) THEN CONCAT(_tr(RESOURCE_ACCOUNT), ' - ', account_type.name) |
− | WHEN account.category=4 THEN | + | WHEN account.category=4 THEN _tr(SUPPLIER_ACCOUNT) |
− | WHEN account.category=6 THEN | + | WHEN account.category=6 THEN _tr(ACCOUNT_VAT_ACCOUNT) |
− | WHEN account.category=7 THEN | + | WHEN account.category=7 THEN _tr(ACCOUNT_EXPENSE_ACCOUNT) |
− | WHEN account.category=8 THEN | + | WHEN account.category=8 THEN _tr(TREASURY_ACCOUNT) |
− | WHEN account.category=9 THEN | + | WHEN account.category=9 THEN _tr(PRODUCT_ACCOUNT) |
− | WHEN account.category=10 THEN | + | WHEN account.category=10 THEN _tr(BALANCE_SHEET_ACCOUNT) |
− | WHEN account.category=11 THEN | + | WHEN account.category=11 THEN _tr(CUSTOMER_ACCOUNT) |
ELSE account.name | ELSE account.name | ||
− | END AS | + | END AS _tr(ACCOUNT_TYPE), |
− | IFNULL(SUM( sumAccountEntry(account.id,NOW())),0) AS | + | IFNULL(SUM( sumAccountEntry(account.id,NOW())),0) AS _tr(ACCOUNT_BALANCE) |
FROM account | FROM account | ||
LEFT JOIN accounting ON accounting.id=account.accounting_id | LEFT JOIN accounting ON accounting.id=account.accounting_id | ||
Line 96: | Line 123: | ||
LEFT JOIN resource ON (account.owner_id = resource.id AND account.category=3) | LEFT JOIN resource ON (account.owner_id = resource.id AND account.category=3) | ||
WHERE account.activated = 1 | WHERE account.activated = 1 | ||
− | AND accounting.id= | + | AND accounting.id=$accountingId |
AND ( | AND ( | ||
(person.id IS NULL AND resource.id IS NULL) | (person.id IS NULL AND resource.id IS NULL) | ||
Line 121: | Line 148: | ||
* Variable '''$startDate''' should be defined first and should be of '''Date and time''' value type | * Variable '''$startDate''' should be defined first and should be of '''Date and time''' value type | ||
− | <sql>SELECT customer_bill_entry.bill_date AS | + | <sql>SELECT customer_bill_entry.bill_date AS _tr(DATE), CONCAT( '[LINK=index.php[QUESTION_MARK]menuAction=download_customer_bill&menuParameter=', customer_bill_entry.flow_id, ']', customer_bill_entry.customer_bill_id, '[/LINK]' ) AS _tr(BILL) |
FROM customer_bill_entry | FROM customer_bill_entry | ||
− | WHERE customer_bill_entry.bill_date >= | + | WHERE customer_bill_entry.bill_date >= $startDate AND customer_bill_entry.bill_date < $endDate |
GROUP BY customer_bill_entry.customer_bill_id | GROUP BY customer_bill_entry.customer_bill_id | ||
ORDER BY customer_bill_entry.customer_bill_id</sql> | ORDER BY customer_bill_entry.customer_bill_id</sql> | ||
Line 216: | Line 243: | ||
*Variable '''$accountingId''' should be defined first and should be of '''dbObject::Accounting''' value type. | *Variable '''$accountingId''' should be defined first and should be of '''dbObject::Accounting''' value type. | ||
− | <sql>SELECT CONCAT( '[LINK=index.php | + | <sql>[OF_DYNAMIC_SQL] |
− | + | SELECT CONCAT( | |
− | + | 'SELECT | |
− | + | CONCAT( \'[LINK=index.php?menuAction=account_journal&menuParameter=\', accountsSum.account_id, \']\', accountsSum.account_id, \'[/LINK]\' ) AS _tr(ID), | |
− | + | accountLayout.export_account AS _tr(ACCOUNT_EXPORT), | |
− | + | CASE | |
− | + | WHEN account_type.name IS NOT NULL AND accountLayout.category=2 THEN CONCAT(_tr(MEMBER_ACCOUNT), \' \', account_type.name, \' \', _tr(REPORTS_OF), \' \', person.last_name, \' \', IFNULL(person.first_name, \'\')) | |
− | + | WHEN account_type.name IS NOT NULL AND accountLayout.category=3 THEN CONCAT(_tr(AIRCRAFT_ACCOUNT), \' \', account_type.name, \' \', _tr(REPORTS_OF), \' \', resource.name) | |
− | + | WHEN accountLayout.category=1 THEN CONCAT(_tr(OTHER_ACCOUNT), \' \', accountLayout.name) | |
− | + | WHEN accountLayout.category=4 THEN CONCAT(_tr(SUPPLIER_ACCOUNT), \' \', accountLayout.name) | |
− | + | WHEN accountLayout.category=6 THEN CONCAT(_tr(VAT_ACCOUNT), \' \', accountLayout.name) | |
− | ORDER BY export_account | + | WHEN accountLayout.category=7 THEN CONCAT(_tr(EXPENSE_ACCOUNT), \' \', accountLayout.name) |
− | ) | + | WHEN accountLayout.category=8 THEN CONCAT(_tr(TREASURY_ACCOUNT), \' \', accountLayout.name) |
+ | WHEN accountLayout.category=9 THEN CONCAT(_tr(PRODUCT_ACCOUNT), \' \', accountLayout.name) | ||
+ | WHEN accountLayout.category=10 THEN CONCAT(_tr(BALANCE_SHEET_ACCOUNT), \' \', accountLayout.name) | ||
+ | WHEN accountLayout.category=11 THEN CONCAT(_tr(CUSTOMER_ACCOUNT), \' \', accountLayout.name) | ||
+ | ELSE accountLayout.name | ||
+ | END AS _tr(ACCOUNT), | ||
+ | accountsSum.SOLDE AS _tr(ACCOUNT_BALANCE) | ||
+ | FROM ( | ||
+ | SELECT accountEntriesExtract.account_id, | ||
+ | (IFNULL(SUM(accountEntriesExtract.credit), 0.00) - IFNULL(SUM(accountEntriesExtract.debit), 0.00) ) AS SOLDE | ||
+ | FROM ( | ||
+ | (SELECT account_entry.account_id, | ||
+ | IFNULL(account_entry.debit, 0.00) AS debit, | ||
+ | IFNULL(account_entry.credit, 0.00) AS credit | ||
+ | FROM account_entry | ||
+ | INNER JOIN account ON (account.id = account_entry.account_id AND account.accounting_id=$accountingId AND (account.activated = 1 OR (account.activated=0 AND account.deactivated_date >= $endDate))) | ||
+ | WHERE account_date >= \'', balance_date.balance_date ,'\' AND account_date < $endDate | ||
+ | ) | ||
+ | UNION ALL | ||
+ | ( | ||
+ | SELECT | ||
+ | account_id, | ||
+ | IFNULL(balance.debit, 0.00) AS debit, | ||
+ | IFNULL(balance.credit, 0.00) AS credit | ||
+ | FROM balance | ||
+ | INNER JOIN account ON (account.id = balance.account_id AND account.accounting_id=$accountingId AND (account.activated = 1 OR (account.activated=0 AND account.deactivated_date >= $endDate))) | ||
+ | WHERE balance_date_id = ', balance_date.id, ' | ||
+ | ) | ||
+ | ) AS accountEntriesExtract | ||
+ | GROUP BY accountEntriesExtract.account_id | ||
+ | HAVING SOLDE NOT IN (\'0 \', \'0.00\', \'0,00\') | ||
+ | ) AS accountsSum | ||
+ | INNER JOIN account accountLayout ON (accountLayout.id = accountsSum.account_id AND accountLayout.accounting_id=$accountingId AND (accountLayout.activated = 1 OR (accountLayout.activated=0 AND accountLayout.deactivated_date >= $endDate))) | ||
+ | LEFT JOIN account_type ON (accountLayout.account_type = account_type.id AND accountLayout.category IN(2,3)) | ||
+ | LEFT JOIN person ON (person.id=accountLayout.owner_id AND accountLayout.category=2) | ||
+ | LEFT JOIN resource ON (resource.id=accountLayout.owner_id AND accountLayout.category=3) | ||
+ | GROUP BY accountLayout.id | ||
+ | ORDER BY accountLayout.export_account ASC | ||
+ | ' | ||
+ | ) | ||
+ | FROM balance_date | ||
+ | WHERE balance_date.balance_date < $endDate | ||
+ | ORDER BY balance_date DESC | ||
+ | LIMIT 1 | ||
+ | </sql> | ||
=List of all account debit, credit= | =List of all account debit, credit= | ||
Line 234: | Line 305: | ||
*Variable '''$endDate''' should be defined first and should be of '''Date and time''' value type. | *Variable '''$endDate''' should be defined first and should be of '''Date and time''' value type. | ||
− | <sql>SELECT | + | <sql>[OF_DYNAMIC_SQL] |
− | + | SELECT CONCAT( | |
− | + | 'SELECT accountLayout.export_account AS _tr(ACCOUNT_EXPORT), | |
− | + | CASE | |
− | + | WHEN account_type.name IS NOT NULL AND accountLayout.category=2 THEN CONCAT(_tr(MEMBER_ACCOUNT), \' \', account_type.name, \' \', _tr(REPORTS_OF), \' \', person.last_name, \' \', IFNULL(person.first_name, \'\')) | |
− | + | WHEN account_type.name IS NOT NULL AND accountLayout.category=3 THEN CONCAT(_tr(AIRCRAFT_ACCOUNT), \' \', account_type.name, \' \', _tr(REPORTS_OF), \' \', resource.name) | |
− | + | WHEN accountLayout.category=1 THEN CONCAT(_tr(OTHER_ACCOUNT), \' \', accountLayout.name) | |
− | + | WHEN accountLayout.category=4 THEN CONCAT(_tr(SUPPLIER_ACCOUNT), \' \', accountLayout.name) | |
− | + | WHEN accountLayout.category=6 THEN CONCAT(_tr(VAT_ACCOUNT), \' \', accountLayout.name) | |
− | + | WHEN accountLayout.category=7 THEN CONCAT(_tr(EXPENSE_ACCOUNT), \' \', accountLayout.name) | |
− | + | WHEN accountLayout.category=8 THEN CONCAT(_tr(TREASURY_ACCOUNT), \' \', accountLayout.name) | |
− | + | WHEN accountLayout.category=9 THEN CONCAT(_tr(PRODUCT_ACCOUNT), \' \', accountLayout.name) | |
− | + | WHEN accountLayout.category=10 THEN CONCAT(_tr(BALANCE_SHEET_ACCOUNT), \' \', accountLayout.name) | |
− | + | WHEN accountLayout.category=11 THEN CONCAT(_tr(CUSTOMER_ACCOUNT), \' \', accountLayout.name) | |
− | + | ELSE accountLayout.name | |
− | + | END AS _tr(ACCOUNT), | |
− | + | IF((@sumAccountEntry := (accountsSum.CREDIT - accountsSum.DEBIT)) < 0, @sumAccountEntry, 0) AS _tr(DEBIT), | |
− | FROM | + | IF(@sumAccountEntry < 0, 0, @sumAccountEntry) AS _tr(CREDIT) |
− | + | FROM ( | |
− | + | SELECT accountEntriesExtract.account_id, | |
− | + | IFNULL(SUM(accountEntriesExtract.debit), 0.00) AS DEBIT, | |
− | + | IFNULL(SUM(accountEntriesExtract.credit), 0.00) AS CREDIT | |
− | WHERE | + | FROM ( |
− | + | (SELECT account_entry.account_id, | |
− | GROUP BY | + | IFNULL(account_entry.debit, 0.00) AS debit, |
− | ORDER BY | + | IFNULL(account_entry.credit, 0.00) AS credit |
+ | FROM account_entry | ||
+ | INNER JOIN account ON (account.id = account_entry.account_id AND account.accounting_id=$accountingId AND (account.activated = 1 OR (account.activated=0 AND account.deactivated_date >= \'', balance_date.balance_date ,'\'))) | ||
+ | WHERE account_date >= \'', balance_date.balance_date ,'\' AND account_date < $endDate | ||
+ | ) | ||
+ | UNION ALL | ||
+ | ( | ||
+ | SELECT | ||
+ | account_id, | ||
+ | IFNULL(balance.debit, 0.00) AS debit, | ||
+ | IFNULL(balance.credit, 0.00) AS credit | ||
+ | FROM balance | ||
+ | INNER JOIN account ON (account.id = balance.account_id AND account.accounting_id=$accountingId AND (account.activated = 1 OR (account.activated=0 AND account.deactivated_date >= \'', balance_date.balance_date ,'\'))) | ||
+ | WHERE balance_date_id = ', balance_date.id, ' | ||
+ | ) | ||
+ | ) AS accountEntriesExtract | ||
+ | GROUP BY accountEntriesExtract.account_id | ||
+ | ) AS accountsSum | ||
+ | INNER JOIN account accountLayout ON (accountLayout.id = accountsSum.account_id AND accountLayout.accounting_id=$accountingId AND (accountLayout.activated = 1 OR (accountLayout.activated=0 AND accountLayout.deactivated_date >= \'', balance_date.balance_date ,'\'))) | ||
+ | LEFT JOIN account_type ON (accountLayout.account_type = account_type.id AND accountLayout.category IN(2,3)) | ||
+ | LEFT JOIN person ON (person.id=accountLayout.owner_id AND accountLayout.category=2) | ||
+ | LEFT JOIN resource ON (resource.id=accountLayout.owner_id AND accountLayout.category=3) | ||
+ | GROUP BY accountLayout.id | ||
+ | ORDER BY accountLayout.export_account ASC | ||
+ | ' | ||
+ | ) | ||
+ | FROM balance_date | ||
+ | WHERE balance_date.balance_date < $endDate | ||
+ | ORDER BY balance_date DESC | ||
+ | LIMIT 1 | ||
+ | </sql> | ||
=Monthly distribution of revenue= | =Monthly distribution of revenue= | ||
Line 307: | Line 408: | ||
LEFT JOIN accounting ON accounting.id=account.accounting_id | LEFT JOIN accounting ON accounting.id=account.accounting_id | ||
LEFT JOIN account_entry ON (account.id=account_entry.account_id) | LEFT JOIN account_entry ON (account.id=account_entry.account_id) | ||
− | WHERE accounting.id= | + | WHERE accounting.id=$accountingId |
− | AND account_entry.account_date >= | + | AND account_entry.account_date >= $startDate AND account_entry.account_date < $endDate |
− | AND ( account.activated=1 OR (account.activated=0 AND account.deactivated_date >= | + | AND ( account.activated=1 OR (account.activated=0 AND account.deactivated_date >= $startDate) ) |
GROUP BY account.id | GROUP BY account.id | ||
UNION | UNION | ||
Line 316: | Line 417: | ||
LEFT JOIN accounting ON accounting.id=account.accounting_id | LEFT JOIN accounting ON accounting.id=account.accounting_id | ||
LEFT JOIN account_entry ON (account.id=account_entry.account_id) | LEFT JOIN account_entry ON (account.id=account_entry.account_id) | ||
− | WHERE accounting.id= | + | WHERE accounting.id=$accountingId |
− | AND account_entry.account_date >= | + | AND account_entry.account_date >= $startDate AND account_entry.account_date < $endDate |
− | AND ( account.activated=1 OR (account.activated=0 AND account.deactivated_date >= | + | AND ( account.activated=1 OR (account.activated=0 AND account.deactivated_date >= $startDate) ) |
ORDER BY 2, 3</sql> | ORDER BY 2, 3</sql> | ||
Line 334: | Line 435: | ||
<sql>SELECT psp_transaction.transaction_date, account.name, psp_transaction.amount, psp_transaction.state FROM psp_transaction | <sql>SELECT psp_transaction.transaction_date, account.name, psp_transaction.amount, psp_transaction.state FROM psp_transaction | ||
LEFT JOIN account ON account.id=psp_transaction.credit_account_id | LEFT JOIN account ON account.id=psp_transaction.credit_account_id | ||
− | WHERE psp_transaction.transaction_date >= | + | WHERE psp_transaction.transaction_date >= $startDate AND psp_transaction.transaction_date<=$endDate |
ORDER BY psp_transaction.transaction_date DESC</sql> | ORDER BY psp_transaction.transaction_date DESC</sql> | ||
Line 374: | Line 475: | ||
*Variable '''$paymentType''' should be defined first and should be of '''dbObject::PaymentType''' value type. | *Variable '''$paymentType''' should be defined first and should be of '''dbObject::PaymentType''' value type. | ||
− | <sql>SELECT payment_type.name AS | + | <sql>SELECT payment_type.name AS _tr(ENCASHMENT_TYPE), |
− | IF(account.category = 2, CONCAT( person.last_name, ' ', person.first_name), account.name) AS | + | IF(account.category = 2, CONCAT( person.last_name, ' ', person.first_name), account.name) AS _tr(NAME), |
− | DATE(account_entry.account_date) AS | + | DATE(account_entry.account_date) AS _tr(DATE), |
− | account_entry.payment_description AS | + | account_entry.payment_description AS _tr(DESCRIPTION), account_entry.credit AS _tr(AMOUNT) |
FROM account_entry | FROM account_entry | ||
LEFT JOIN payment_type ON payment_type.id = account_entry.payment_type | LEFT JOIN payment_type ON payment_type.id = account_entry.payment_type | ||
Line 384: | Line 485: | ||
WHERE | WHERE | ||
CASE | CASE | ||
− | WHEN ( | + | WHEN ($paymentType='') THEN account_entry.payment_type IS NOT NULL |
− | ELSE account_entry.payment_type= | + | ELSE account_entry.payment_type=$paymentType |
END | END | ||
− | AND credit > 0 AND account_entry.account_date >= | + | AND credit > 0 AND account_entry.account_date >= $startDate AND account_entry.account_date <= $endDate |
ORDER BY 1, 3, 2</sql> | ORDER BY 1, 3, 2</sql> | ||
Line 597: | Line 698: | ||
<sql>SELECT | <sql>SELECT | ||
− | CONCAT( '[LINK=index.php | + | CONCAT( '[LINK=index.php[QUESTION_MARK]menuAction=account_journal&menuParameter=', account.id, ']', account.id, '[/LINK]' ) AS _tr(ID), |
− | CONCAT( personWithProfile.last_name, ' ', personWithProfile.first_name) AS | + | CONCAT( personWithProfile.last_name, ' ', personWithProfile.first_name) AS _tr(LAST_NAME), |
− | personWithProfile.person_profile AS | + | personWithProfile.person_profile AS _tr(PROFILE), |
− | account_type.name AS | + | account_type.name AS _tr(ACCOUNT_TYPE), |
− | IFNULL(sumAccountEntry(account.id, | + | IFNULL(sumAccountEntry(account.id,$endDate),0) AS _tr(BALANCE) |
FROM account | FROM account | ||
LEFT JOIN accounting ON accounting.id=account.accounting_id | LEFT JOIN accounting ON accounting.id=account.accounting_id | ||
Line 613: | Line 714: | ||
) AS personWithProfile ON personWithProfile.id=account.owner_id | ) AS personWithProfile ON personWithProfile.id=account.owner_id | ||
WHERE account.category=2 | WHERE account.category=2 | ||
− | AND ( account.activated=1 OR (account.activated=0 AND account.deactivated_date >= | + | AND ( account.activated=1 OR (account.activated=0 AND account.deactivated_date >= $endDate) ) |
− | AND CAST(accounting.id AS CHAR) = | + | AND CAST(accounting.id AS CHAR) = $accountingId |
AND personWithProfile.id IS NOT NULL | AND personWithProfile.id IS NOT NULL | ||
ORDER BY personWithProfile.last_name, personWithProfile.first_name</sql> | ORDER BY personWithProfile.last_name, personWithProfile.first_name</sql> | ||
− | =Validated entries for an account between two dates= | + | =Validated only or all entries for an account between two dates= |
*Variable '''$startDate''' should be defined first and should be of '''Date and time''' value type. | *Variable '''$startDate''' should be defined first and should be of '''Date and time''' value type. | ||
Line 624: | Line 725: | ||
*Variable '''$accountId''' should be defined first and should be of '''dbObject::Account''' value type. | *Variable '''$accountId''' should be defined first and should be of '''dbObject::Account''' value type. | ||
− | <sql>SELECT '' AS | + | <sql>SELECT '' AS _tr(DATE), '' AS _tr(FLOW_NUMBER), '' AS _tr(AFFECTED_ACCOUNTS), CONCAT( _tr(TEXT_BALANCE), $startDate ) AS _tr(COMMENTS), |
− | IF( (@startBalance := sumValidatedAccountEntry($accountId, $startDate)) < 0, @startBalance, '' ) AS | + | IF( (@startBalance := sumValidatedAccountEntry($accountId, $startDate)) < 0, @startBalance, '' ) AS _tr(DEBIT), |
− | IF( @startBalance >= 0, @startBalance, '' ) AS | + | IF( @startBalance >= 0, @startBalance, '' ) AS _tr(CREDIT) |
UNION | UNION | ||
SELECT account_entry.account_date, account_entry.flow_id, | SELECT account_entry.account_date, account_entry.flow_id, | ||
Line 657: | Line 758: | ||
WHERE account_entry.account_id=$accountId | WHERE account_entry.account_id=$accountId | ||
AND account_entry.account_date>=$startDate AND account_entry.account_date<$endDate | AND account_entry.account_date>=$startDate AND account_entry.account_date<$endDate | ||
− | AND account_entry.validated=1 | + | AND (account_entry.validated=1 OR $validatedOnly=0) |
AND account.id <> affected_account.id | AND account.id <> affected_account.id | ||
GROUP BY account_entry.id | GROUP BY account_entry.id | ||
Line 671: | Line 772: | ||
GROUP BY account_entry.id | GROUP BY account_entry.id | ||
UNION | UNION | ||
− | SELECT '_', '', '', CONCAT( | + | SELECT '_', '', '', CONCAT( _tr(TEXT_BALANCE), $endDate ), |
IF( (@endBalance := sumValidatedAccountEntry($accountId, $endDate)) < 0, @endBalance, '' ), | IF( (@endBalance := sumValidatedAccountEntry($accountId, $endDate)) < 0, @endBalance, '' ), | ||
IF( @endBalance >= 0, @endBalance, '' ) | IF( @endBalance >= 0, @endBalance, '' ) | ||
ORDER BY 1, 2</sql> | ORDER BY 1, 2</sql> |
Latest revision as of 18:40, 27 February 2023
Contents
- 1 Introduction
- 2 Balances of resource accounts
- 3 Breakdown by resource accounts of customer invoices
- 4 Carry forwards
- 5 Category account balance
- 6 Cheque deposit slip
- 7 Customer bill between date
- 8 Customer bill per month and per accounting
- 9 Get the details (specially the id) of an account according its name
- 10 Get the user owner of an account
- 11 Global account balance
- 12 Global account balance last subscription