Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@pingleware/bestbooks-reports

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pingleware/bestbooks-reports - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

18

balance-sheet.js
"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 @@ }

17

income-statement.js
"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 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc