@pingleware/bestbooks-reports
Advanced tools
Comparing version 1.0.7 to 1.0.8
68
index.js
"use strict" | ||
const os = require('os'); | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
function init() { | ||
const { Model } = require('@pingleware/bestbooks-core'); | ||
const model = new Model(); | ||
model.insertSync(`CREATE TABLE IF NOT EXISTS "report" ( | ||
"id" INTEGER, | ||
"txdate" TIMESTAMP, | ||
"name" TEXT, | ||
"contents" TEXT, | ||
PRIMARY KEY("id" AUTOINCREMENT) | ||
)`) | ||
const xslt_list = [ | ||
"balance-sheet.xslt", | ||
"customer-estimate.xslt", | ||
"income-statement.xslt", | ||
"note-to-financial-statements.xslt", | ||
"purchase-order.xslt", | ||
"statement-in-change-in-equity.xslt", | ||
"statement-of-cash-flows.xslt", | ||
"trial-balance.xslt", | ||
"retained-earnings.xslt" | ||
]; | ||
let copied = 0; | ||
xslt_list.forEach(function(file){ | ||
if (!fs.existsSync(path.join(os.homedir(),`.bestbooks/${file}`))) { | ||
try { | ||
fs.copyFileSync(path.join('xslt',file),path.join(os.homedir(),`.bestbooks/${file}`)); | ||
copied++; | ||
} catch(error) { | ||
console.error(error); | ||
} | ||
} | ||
}); | ||
return copied; | ||
} | ||
function copy(src,dest) { | ||
fs.copyFileSync(path.join('xslt',src),path.join(os.homedir(),`.bestbooks/${dest}`)); | ||
} | ||
const BalanceSheet = require('./balance-sheet'); | ||
@@ -10,4 +55,17 @@ const IncomeStatement = require('./income-statement'); | ||
const RetainedEarnings = require('./retained-earnings'); | ||
const PurchaseOrder = require('./purchase-order'); | ||
const CustomerEstimate = require('./customer-estimate'); | ||
const parseString = require('xml2js').parseString; | ||
const { | ||
getReportFileName, | ||
getReportRootFileName, | ||
transform_xml_xslt, | ||
format, | ||
array2xml | ||
} = require('./formatReport'); | ||
module.exports = { | ||
init, | ||
copy, | ||
BalanceSheet, | ||
@@ -19,3 +77,11 @@ IncomeStatement, | ||
StatementChangeInEquity, | ||
RetainedEarnings | ||
RetainedEarnings, | ||
PurchaseOrder, | ||
CustomerEstimate, | ||
parseString, | ||
getReportFileName, | ||
getReportRootFileName, | ||
transform_xml_xslt, | ||
format, | ||
array2xml | ||
} |
{ | ||
"name": "@pingleware/bestbooks-reports", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "Reports module for BestBooks Accounting Application Framework", | ||
"main": "index.js", | ||
"files": [ | ||
"xslt/**" | ||
], | ||
"scripts": { | ||
@@ -22,7 +25,11 @@ "test": "mocha" | ||
"devDependencies": { | ||
"chai": "^4.3.7", | ||
"mocha": "^10.1.0" | ||
}, | ||
"dependencies": { | ||
"@pingleware/bestbooks-core": "^1.1.11" | ||
"@pingleware/bestbooks-core": "^1.1.11", | ||
"js2xmlparser": "^5.0.0", | ||
"xml2js": "^0.4.23", | ||
"xslt-processor": "^0.11.7" | ||
} | ||
} |
# BestBooks Accounting Application Framework - Reports | ||
There are no free options for creating reports from content received from a database. jsreports, jasperreports have limited free options. | ||
@@ -9,1 +10,14 @@ | ||
During initialization (invoking the init() function)), will copy the xslt template files to the user's home directory in the bestbooks system directory. | ||
The js2xmlparser package is used to convert an object to xml, while the xslt-processor package will transform the XML data and XSLT template to HTML format. | ||
HTML can be converted to other forms like PDF. | ||
## Reporting in Accounting | ||
Reporting is the most important feature of any accounting system, because reporting permits the communication to interested parties. Using test driven development (TDD) allows the implementation of the reports module first. | ||
## GAAP Compliance | ||
There is much discussion concerning GAAP compliance and accounting sofftware with some commentors stating that accounting software can never be GAAP compliance. First, GAAP compliance has to do with reporting and involves an accountant statement or notes added to the financial statements, this where the component noteToFinancialStatements permits the addition of a notes fields to the report XML data, thus making BestBooks GAAP compliance with the addition of a notes field on reports. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
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
30665
23
4
2
12
76
2
1
+ Addedjs2xmlparser@^5.0.0
+ Addedxml2js@^0.4.23
+ Addedxslt-processor@^0.11.7
+ Addedhe@1.2.0(transitive)
+ Addedjs2xmlparser@5.0.0(transitive)
+ Addedsax@1.4.1(transitive)
+ Addedxml2js@0.4.23(transitive)
+ Addedxmlbuilder@11.0.1(transitive)
+ Addedxmlcreate@2.0.4(transitive)
+ Addedxslt-processor@0.11.7(transitive)