Template:Account

From MediaWiki

(Difference between revisions)
Jump to: navigation, search
(re-wrote to use window functions)
Line 169: Line 169:
     CONCAT('$', FORMAT(IF(Destination = {{{1}}}, exp.Amount, NULL), 2)) AS `Dest Amount`,
     CONCAT('$', FORMAT(IF(Destination = {{{1}}}, exp.Amount, NULL), 2)) AS `Dest Amount`,
     CONCAT('$', FORMAT(
     CONCAT('$', FORMAT(
-
    (SELECT SUM(
+
      SUM(
-
    CASE
+
        CASE
-
    WHEN exp1.Destination = {{{1}}} THEN exp1.`Amount`
+
      WHEN exp.Destination = {{{1}}} THEN exp.`Amount`
-
    ELSE -exp1.`Amount`
+
    ELSE -exp.`Amount`
-
    END)
+
      END) OVER (ORDER BY exp.`Date`, exp.Name, exp.Item)
-
    FROM sa_general_journal exp1
+
-
    WHERE (Destination = {{{1}}}
+
-
    OR Source = {{{1}}}) AND exp1.`Date` <= exp.`Date`)
+
    , 2)) AS `Balance`,
    , 2)) AS `Balance`,
     exp.Clr,
     exp.Clr,

Revision as of 02:53, 30 March 2020

Usage

This template is used to display expense information for a given account

This is typically used in a page named: "Account:nn", where "nn" is an account number. The following will parse the page name into "Accounts" and an account number: {{{{NAMESPACE}}|{{PAGENAME}}}}

Parameters

  1. a numeric account number.

Example

as entered 
{{account|46}}
as displayed 

Other account statistics:

Other statistics:

A page with all statistics is available.

Account number 1000001:

Reconciled as of

This information is only available to logged-in users. Please log in or ask for an account to see this information.


Template

Share your opinion


blog comments powered by Disqus
Personal tools
Get our newsletter!
Name:
Email Address:

disturbance
entry points
help (off site)
Environmental jobs, green volunteering, good work! Powered by the wind! This server and other
EcoReality operations
are 100% wind powered.
Powered by Mac OS X Powered by Mac MediaWiki Powered by MariaDB Powered by Valentina Studio Pro