@pingleware/bestbooks-reports
Advanced tools
Comparing version 1.0.2 to 1.0.3
"use strict" | ||
const core = require('@pingleware/bestbooks-core'); | ||
const { Model } = require('@pingleware/bestbooks-core'); | ||
const Report = require('./report'); | ||
@@ -12,7 +12,19 @@ | ||
createReport(startDate,endDate,format) { | ||
var sql = `SELECT account_code AS code,account_name AS name,SUM(debit)-SUM(credit) AS balance,accounts.base_type AS type FROM ledger JOIN accounts ON accounts.name=ledger.account_name GROUP BY account_name ORDER BY accounts.base_type`; | ||
var data = this.retrieveReportData(startDate, endDate); | ||
if (format == "array") { | ||
return data; | ||
} else { | ||
// process other formats | ||
} | ||
} | ||
retrieveReportData(startDate,endDate) { | ||
var sql = `SELECT account_code AS code, | ||
account_name AS name,SUM(debit)-SUM(credit) AS balance, | ||
accounts.base_type AS type FROM ledger | ||
JOIN accounts ON accounts.name=ledger.account_name | ||
WHERE ledger.txdate BETWEEN ${startDate} AND ${endDate} | ||
GROUP BY account_name ORDER BY accounts.base_type`; | ||
const model = new Model(); | ||
return model.querySync(sql); | ||
} | ||
@@ -19,0 +31,0 @@ } |
"use strict" | ||
const core = require('@pingleware/bestbooks-core'); | ||
const { Model } = require('@pingleware/bestbooks-core'); | ||
const Report = require('./report'); | ||
@@ -12,2 +12,11 @@ | ||
createReport(startDate,endDate,format) { | ||
var data = this.retrieveReportData(startDate, endDate); | ||
if (format == "array") { | ||
return data; | ||
} else { | ||
// process other formats | ||
} | ||
} | ||
retrieveReportData(startDate,endDate) { | ||
var sql = `SELECT account_code AS code,account_name AS name, | ||
@@ -19,9 +28,7 @@ SUM(debit)-SUM(credit) AS balance,accounts.base_type AS type | ||
ORDER BY accounts.base_type`; | ||
const model = new Model(); | ||
return model.querySync(sql); | ||
} | ||
retrieveReportData(startDate,endDate) { | ||
} | ||
} | ||
module.exports = IncomeStatement; |
"use strict" | ||
const core = require('@pingleware/bestbooks-core'); | ||
const { Model } = require('@pingleware/bestbooks-core'); | ||
const Report = require('./report'); | ||
@@ -12,3 +12,8 @@ | ||
createReport(startDate,endDate,format) { | ||
var data = this.retrieveReportData(startDate, endDate); | ||
if (format == "array") { | ||
return data; | ||
} else { | ||
// process other formats | ||
} | ||
} | ||
@@ -15,0 +20,0 @@ |
{ | ||
"name": "@pingleware/bestbooks-reports", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Reports module for BestBooks Accounting Application Framework", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
"use strict" | ||
const core = require('@pingleware/bestbooks-core'); | ||
/** | ||
* Statement of Cash Flows aka Cash Flow Statement | ||
* | ||
* for Cash and Cash Equivalent accounts | ||
* | ||
* 1. Determine the Starting Balance | ||
* 2. Calculate Cash Flow from Operating Activities | ||
* 3. Calculate Cash Flow from Investing Activities | ||
* 4. Calculate Cash Flow from FInancing Activity | ||
* 5. Determine the Ending Balance | ||
* | ||
*/ | ||
const { Model } = require('@pingleware/bestbooks-core'); | ||
const Report = require('./report'); | ||
@@ -12,3 +25,8 @@ | ||
createReport(startDate,endDate,format) { | ||
var data = this.retrieveReportData(startDate, endDate); | ||
if (format == "array") { | ||
return data; | ||
} else { | ||
// process other formats | ||
} | ||
} | ||
@@ -15,0 +33,0 @@ |
"use strict" | ||
const core = require('@pingleware/bestbooks-core'); | ||
const { Model } = require('@pingleware/bestbooks-core'); | ||
const Report = require('./report'); | ||
@@ -12,3 +12,8 @@ | ||
createReport(startDate,endDate,format) { | ||
var data = this.retrieveReportData(startDate, endDate); | ||
if (format == "array") { | ||
return data; | ||
} else { | ||
// process other formats | ||
} | ||
} | ||
@@ -15,0 +20,0 @@ |
"use strict" | ||
const core = require('@pingleware/bestbooks-core'); | ||
const { Model } = require('@pingleware/bestbooks-core'); | ||
const Report = require('./report'); | ||
@@ -12,9 +12,18 @@ | ||
createReport(startDate,endDate,format) { | ||
var sql = `SELECT SUM(debit) AS debit_total,SUM(credit) AS credit_total, | ||
CASE WHEN (SUM(debit)=SUM(credit)) THEN 'in_balance' ELSE 'out_of_balance' END AS trial_balance | ||
FROM ledger;`; | ||
var data = this.retrieveReportData(startDate, endDate); | ||
if (format == "array") { | ||
return data; | ||
} else { | ||
// process other formats | ||
} | ||
} | ||
retrieveReportData(startDate,endDate) { | ||
var sql = `SSELECT account_code AS code, account_name AS name,accounts.base_type AS type,debit,credit, | ||
CASE WHEN (SELECT SUM(debit)=SUM(credit) FROM ledger) | ||
THEN 'in_balance' ELSE 'out_of_balance' END AS trial_balance | ||
FROM ledger JOIN accounts ON accounts.name=ledger.account_name;`; | ||
const model = new Model(); | ||
return model.querySync(sql); | ||
} | ||
@@ -21,0 +30,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6907
161