@tomei/finance 0.6.99 → 0.6.102

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (223) hide show
  1. package/.husky/commit-msg +12 -3
  2. package/.husky/pre-commit +4 -4
  3. package/configs/config.js +1 -1
  4. package/dist/account/account.d.ts +37 -37
  5. package/dist/account/account.js +251 -263
  6. package/dist/account/account.js.map +1 -1
  7. package/dist/account/account.repository.d.ts +5 -5
  8. package/dist/account/account.repository.js +11 -11
  9. package/dist/account/interfaces/account-attr.interface.d.ts +29 -29
  10. package/dist/account/interfaces/account-attr.interface.js +2 -2
  11. package/dist/account-system-entity/account-system-entity.d.ts +12 -12
  12. package/dist/account-system-entity/account-system-entity.js +55 -66
  13. package/dist/account-system-entity/account-system-entity.js.map +1 -1
  14. package/dist/account-system-entity/post-history.repository.d.ts +5 -5
  15. package/dist/account-system-entity/post-history.repository.js +11 -11
  16. package/dist/config.d.ts +1888 -1888
  17. package/dist/config.js +331 -331
  18. package/dist/config.js.map +1 -1
  19. package/dist/customer/customer.d.ts +44 -44
  20. package/dist/customer/customer.js +212 -234
  21. package/dist/customer/customer.js.map +1 -1
  22. package/dist/customer/finance-customer.repository.d.ts +5 -5
  23. package/dist/customer/finance-customer.repository.js +25 -25
  24. package/dist/customer/finance-customer.repository.js.map +1 -1
  25. package/dist/customer/interfaces/customer.repository.interface.d.ts +3 -3
  26. package/dist/customer/interfaces/customer.repository.interface.js +2 -2
  27. package/dist/customer/interfaces/finance-customer-attr.interface.d.ts +10 -10
  28. package/dist/customer/interfaces/finance-customer-attr.interface.js +2 -2
  29. package/dist/customer/interfaces/finance-customer.repository.interface.d.ts +3 -3
  30. package/dist/customer/interfaces/finance-customer.repository.interface.js +2 -2
  31. package/dist/database.d.ts +4 -4
  32. package/dist/database.js +46 -47
  33. package/dist/database.js.map +1 -1
  34. package/dist/document/document-item.d.ts +46 -46
  35. package/dist/document/document-item.js +122 -132
  36. package/dist/document/document-item.js.map +1 -1
  37. package/dist/document/document-item.repository.d.ts +5 -5
  38. package/dist/document/document-item.repository.js +11 -11
  39. package/dist/document/document.d.ts +87 -88
  40. package/dist/document/document.js +735 -766
  41. package/dist/document/document.js.map +1 -1
  42. package/dist/document/document.repository.d.ts +5 -5
  43. package/dist/document/document.repository.js +11 -11
  44. package/dist/document/interfaces/document-attr.interface.d.ts +27 -27
  45. package/dist/document/interfaces/document-attr.interface.js +6 -6
  46. package/dist/document/interfaces/document-find-all.interface.d.ts +13 -13
  47. package/dist/document/interfaces/document-find-all.interface.js +2 -2
  48. package/dist/document/interfaces/document-item-attr.interface.d.ts +26 -26
  49. package/dist/document/interfaces/document-item-attr.interface.js +6 -6
  50. package/dist/document/interfaces/document-item.repository.interface.d.ts +3 -3
  51. package/dist/document/interfaces/document-item.repository.interface.js +2 -2
  52. package/dist/enum/collect-payment-type.d.ts +4 -4
  53. package/dist/enum/collect-payment-type.js +8 -8
  54. package/dist/enum/collect-payment-type.js.map +1 -1
  55. package/dist/enum/doc-type.enum.d.ts +8 -8
  56. package/dist/enum/doc-type.enum.js +12 -12
  57. package/dist/enum/doc-type.enum.js.map +1 -1
  58. package/dist/enum/document-status.enum.d.ts +6 -6
  59. package/dist/enum/document-status.enum.js +10 -10
  60. package/dist/enum/document-status.enum.js.map +1 -1
  61. package/dist/enum/index.d.ts +9 -9
  62. package/dist/enum/index.js +19 -19
  63. package/dist/enum/payment-method.enum.d.ts +3 -3
  64. package/dist/enum/payment-method.enum.js +7 -7
  65. package/dist/enum/payment-method.enum.js.map +1 -1
  66. package/dist/enum/payment-status.enum.d.ts +10 -10
  67. package/dist/enum/payment-status.enum.js +15 -16
  68. package/dist/enum/payment-status.enum.js.map +1 -1
  69. package/dist/enum/payment-type.enum.d.ts +4 -4
  70. package/dist/enum/payment-type.enum.js +8 -8
  71. package/dist/enum/payment-type.enum.js.map +1 -1
  72. package/dist/enum/quick-book-client-scopes.enum.d.ts +13 -13
  73. package/dist/enum/quick-book-client-scopes.enum.js +18 -18
  74. package/dist/enum/quick-book-client-scopes.enum.js.map +1 -1
  75. package/dist/enum/transaction-type.enum.d.ts +4 -4
  76. package/dist/enum/transaction-type.enum.js +8 -8
  77. package/dist/enum/transaction-type.enum.js.map +1 -1
  78. package/dist/finance-company/finance-company.d.ts +88 -88
  79. package/dist/finance-company/finance-company.js +1533 -1576
  80. package/dist/finance-company/finance-company.js.map +1 -1
  81. package/dist/finance-company/finance-company.repository.d.ts +5 -5
  82. package/dist/finance-company/finance-company.repository.js +11 -11
  83. package/dist/helpers/login-user.d.ts +13 -13
  84. package/dist/helpers/login-user.js +28 -28
  85. package/dist/helpers/login-user.js.map +1 -1
  86. package/dist/helpers/typeof.d.ts +1 -1
  87. package/dist/helpers/typeof.js +28 -29
  88. package/dist/helpers/typeof.js.map +1 -1
  89. package/dist/index.d.ts +17 -17
  90. package/dist/index.js +32 -32
  91. package/dist/interfaces/account-system.interface.d.ts +30 -30
  92. package/dist/interfaces/account-system.interface.js +2 -2
  93. package/dist/interfaces/index.d.ts +2 -2
  94. package/dist/interfaces/index.js +2 -2
  95. package/dist/journal-entry/interfaces/journal-entry-attr.interface.d.ts +12 -12
  96. package/dist/journal-entry/interfaces/journal-entry-attr.interface.js +2 -2
  97. package/dist/journal-entry/journal-entry.d.ts +42 -42
  98. package/dist/journal-entry/journal-entry.js +216 -233
  99. package/dist/journal-entry/journal-entry.js.map +1 -1
  100. package/dist/journal-entry/journal-entry.repository.d.ts +6 -6
  101. package/dist/journal-entry/journal-entry.repository.js +16 -27
  102. package/dist/journal-entry/journal-entry.repository.js.map +1 -1
  103. package/dist/ledger-transaction/interfaces/ledger-transaction-attr.interface.d.ts +17 -17
  104. package/dist/ledger-transaction/interfaces/ledger-transaction-attr.interface.js +2 -2
  105. package/dist/ledger-transaction/interfaces/ledger-transaction.repository.interface.d.ts +5 -5
  106. package/dist/ledger-transaction/interfaces/ledger-transaction.repository.interface.js +2 -2
  107. package/dist/ledger-transaction/ledger-transaction.d.ts +54 -54
  108. package/dist/ledger-transaction/ledger-transaction.js +143 -164
  109. package/dist/ledger-transaction/ledger-transaction.js.map +1 -1
  110. package/dist/ledger-transaction/ledger-transaction.repository.d.ts +6 -6
  111. package/dist/ledger-transaction/ledger-transaction.repository.js +16 -27
  112. package/dist/ledger-transaction/ledger-transaction.repository.js.map +1 -1
  113. package/dist/models/account.entity.d.ts +30 -30
  114. package/dist/models/account.entity.js +232 -232
  115. package/dist/models/account.entity.js.map +1 -1
  116. package/dist/models/customer.entity.d.ts +13 -13
  117. package/dist/models/customer.entity.js +109 -109
  118. package/dist/models/customer.entity.js.map +1 -1
  119. package/dist/models/document-item.entity.d.ts +31 -31
  120. package/dist/models/document-item.entity.js +200 -200
  121. package/dist/models/document-item.entity.js.map +1 -1
  122. package/dist/models/document.entity.d.ts +36 -36
  123. package/dist/models/document.entity.js +242 -242
  124. package/dist/models/document.entity.js.map +1 -1
  125. package/dist/models/finance-company.entity.d.ts +15 -15
  126. package/dist/models/finance-company.entity.js +93 -93
  127. package/dist/models/finance-company.entity.js.map +1 -1
  128. package/dist/models/journal-entry.entity.d.ts +16 -16
  129. package/dist/models/journal-entry.entity.js +127 -127
  130. package/dist/models/journal-entry.entity.js.map +1 -1
  131. package/dist/models/ledger-transaction.entity.d.ts +24 -24
  132. package/dist/models/ledger-transaction.entity.js +172 -172
  133. package/dist/models/ledger-transaction.entity.js.map +1 -1
  134. package/dist/models/payment-item.entity.d.ts +12 -12
  135. package/dist/models/payment-item.entity.js +75 -75
  136. package/dist/models/payment-item.entity.js.map +1 -1
  137. package/dist/models/payment-method-type.entity.d.ts +13 -13
  138. package/dist/models/payment-method-type.entity.js +85 -85
  139. package/dist/models/payment-method-type.entity.js.map +1 -1
  140. package/dist/models/payment-method.entity.d.ts +10 -10
  141. package/dist/models/payment-method.entity.js +62 -62
  142. package/dist/models/payment-method.entity.js.map +1 -1
  143. package/dist/models/payment-paid-with.entity.d.ts +24 -24
  144. package/dist/models/payment-paid-with.entity.js +158 -158
  145. package/dist/models/payment-paid-with.entity.js.map +1 -1
  146. package/dist/models/payment.entity.d.ts +29 -29
  147. package/dist/models/payment.entity.js +193 -193
  148. package/dist/models/payment.entity.js.map +1 -1
  149. package/dist/models/post-history.entity.d.ts +11 -11
  150. package/dist/models/post-history.entity.js +63 -63
  151. package/dist/models/post-history.entity.js.map +1 -1
  152. package/dist/models/tax.entity.d.ts +13 -13
  153. package/dist/models/tax.entity.js +89 -89
  154. package/dist/models/tax.entity.js.map +1 -1
  155. package/dist/payment/interfaces/payment-attr.interface.d.ts +22 -22
  156. package/dist/payment/interfaces/payment-attr.interface.js +6 -6
  157. package/dist/payment/interfaces/payment-params.interface.d.ts +7 -7
  158. package/dist/payment/interfaces/payment-params.interface.js +2 -2
  159. package/dist/payment/payment.d.ts +53 -53
  160. package/dist/payment/payment.js +186 -201
  161. package/dist/payment/payment.js.map +1 -1
  162. package/dist/payment/payment.repository.d.ts +5 -5
  163. package/dist/payment/payment.repository.js +11 -11
  164. package/dist/payment-item/interfaces/payment-item-attr.interface.d.ts +10 -10
  165. package/dist/payment-item/interfaces/payment-item-attr.interface.js +6 -6
  166. package/dist/payment-item/payment-item.d.ts +25 -25
  167. package/dist/payment-item/payment-item.js +111 -122
  168. package/dist/payment-item/payment-item.js.map +1 -1
  169. package/dist/payment-item/payment-item.repository.d.ts +5 -5
  170. package/dist/payment-item/payment-item.repository.js +11 -11
  171. package/dist/payment-method/interfaces/payment-method-attr.interface.d.ts +5 -5
  172. package/dist/payment-method/interfaces/payment-method-attr.interface.js +2 -2
  173. package/dist/payment-method/payment-method.d.ts +21 -21
  174. package/dist/payment-method/payment-method.js +104 -117
  175. package/dist/payment-method/payment-method.js.map +1 -1
  176. package/dist/payment-method/payment-method.repository.d.ts +5 -5
  177. package/dist/payment-method/payment-method.repository.js +11 -11
  178. package/dist/payment-method-type/interfaces/payment-method-type-attr.interface.d.ts +8 -8
  179. package/dist/payment-method-type/interfaces/payment-method-type-attr.interface.js +2 -2
  180. package/dist/payment-method-type/payment-method-type.d.ts +18 -18
  181. package/dist/payment-method-type/payment-method-type.js +65 -76
  182. package/dist/payment-method-type/payment-method-type.js.map +1 -1
  183. package/dist/payment-method-type/payment-method-type.repository.d.ts +5 -5
  184. package/dist/payment-method-type/payment-method-type.repository.js +11 -11
  185. package/dist/payment-paid-with/interfaces/payment-paid-with.interface.d.ts +19 -19
  186. package/dist/payment-paid-with/interfaces/payment-paid-with.interface.js +6 -6
  187. package/dist/payment-paid-with/payment-paid-with.d.ts +33 -33
  188. package/dist/payment-paid-with/payment-paid-with.js +56 -56
  189. package/dist/payment-paid-with/payment-paid-with.js.map +1 -1
  190. package/dist/payment-paid-with/payment-paid-with.repository.d.ts +5 -5
  191. package/dist/payment-paid-with/payment-paid-with.repository.js +11 -11
  192. package/dist/tax/interfaces/tax-attr.interface.d.ts +10 -10
  193. package/dist/tax/interfaces/tax-attr.interface.js +2 -2
  194. package/dist/tax/tax.d.ts +26 -26
  195. package/dist/tax/tax.js +51 -51
  196. package/dist/tax/tax.js.map +1 -1
  197. package/dist/tax/tax.repository.d.ts +5 -5
  198. package/dist/tax/tax.repository.js +11 -11
  199. package/dist/test-document.d.ts +3 -3
  200. package/dist/test-document.js +18 -18
  201. package/dist/test.d.ts +1 -1
  202. package/dist/test.js +6 -7
  203. package/dist/test.js.map +1 -1
  204. package/dist/tsconfig.tsbuildinfo +1 -1
  205. package/eslint.config.mjs +58 -0
  206. package/invoice-template/assets/js/html2canvas.min.js +16 -16
  207. package/package.json +35 -41
  208. package/src/account/account.ts +2 -1
  209. package/src/customer/customer.ts +8 -7
  210. package/src/document/document-item.ts +3 -2
  211. package/src/document/document.ts +20 -13
  212. package/src/enum/collect-payment-type.ts +3 -3
  213. package/src/enum/payment-status.enum.ts +1 -1
  214. package/src/finance-company/finance-company.ts +5 -7
  215. package/src/journal-entry/journal-entry.ts +0 -1
  216. package/src/ledger-transaction/ledger-transaction.ts +4 -4
  217. package/src/payment-method-type/payment-method-type.ts +1 -1
  218. package/src/tax/tax.ts +0 -1
  219. package/tsconfig.json +4 -3
  220. package/.eslintrc.js +0 -72
  221. package/img.png +0 -0
  222. package/img_1.png +0 -0
  223. package/tslint.json +0 -18
@@ -0,0 +1,58 @@
1
+ import eslintPlugin from "@typescript-eslint/eslint-plugin";
2
+ import parser from "@typescript-eslint/parser";
3
+ import importPlugin from 'eslint-plugin-import'
4
+ import path from 'path';
5
+ import { fileURLToPath } from 'url';
6
+
7
+ const __filename = fileURLToPath(import.meta.url);
8
+ const __dirname = path.dirname(__filename);
9
+
10
+ export default [
11
+ {
12
+ languageOptions: {
13
+ parser: parser,
14
+ ecmaVersion: "latest", // Allows modern ECMAScript features
15
+ sourceType: "module", // Allows for the use of imports
16
+ parserOptions: {
17
+ tsconfigRootDir: __dirname,
18
+ project: './tsconfig.json'
19
+ },
20
+ },
21
+ plugins: {
22
+ "@typescript-eslint": eslintPlugin,
23
+ import: importPlugin
24
+ },
25
+ rules: {
26
+ "no-console": "off",
27
+ "@typescript-eslint/no-explicit-any": "off",
28
+ "@typescript-eslint/no-var-requires": "off",
29
+ "@typescript-eslint/explicit-module-boundary-types": "off",
30
+ "import/prefer-default-export": "off",
31
+ "@typescript-eslint/no-unused-vars": "warn",
32
+ "no-useless-catch": "off",
33
+ "@typescript-eslint/no-non-null-assertion": "off",
34
+ "@typescript-eslint/no-empty-function": "off",
35
+ "@typescript-eslint/no-empty-interface": "off",
36
+ "@typescript-eslint/no-inferrable-types": "off",
37
+ "@typescript-eslint/no-namespace": "off",
38
+ "@typescript-eslint/no-use-before-define": "off",
39
+ "@typescript-eslint/no-unsafe-assignment": "off",
40
+ "@typescript-eslint/no-unsafe-call": "off",
41
+ "@typescript-eslint/no-unsafe-member-access": "off",
42
+ "@typescript-eslint/no-unsafe-return": "off",
43
+ "@typescript-eslint/restrict-template-expressions": "off",
44
+ "no-useless-escape": "off",
45
+ "import/no-relative-parent-imports": "error", // Enforce relative imports only
46
+ "import/no-absolute-path": "error", // Block absolute imports outside aliases
47
+ "import/no-unresolved": ["error", { commonjs: true }],
48
+ },
49
+ settings: {
50
+ "import/resolver": {
51
+ typescript: {
52
+ alwaysTryTypes: true,
53
+ }
54
+ }
55
+ },
56
+ ignores: ["node_modules", "dist/**/*", "eslint.config.mjs", "invoice-template/**/*", "configs/**/*"],
57
+ },
58
+ ];
@@ -4417,7 +4417,7 @@
4417
4417
  }
4418
4418
  return CSSParsedCounterDeclaration;
4419
4419
  })();
4420
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
4420
+
4421
4421
  var parse = function (context, descriptor, style) {
4422
4422
  var tokenizer = new Tokenizer();
4423
4423
  var value =
@@ -6964,7 +6964,7 @@
6964
6964
  function Cache(context, _options) {
6965
6965
  this.context = context;
6966
6966
  this._options = _options;
6967
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
6967
+
6968
6968
  this._cache = {};
6969
6969
  }
6970
6970
  Cache.prototype.addImage = function (src) {
@@ -6980,7 +6980,7 @@
6980
6980
  }
6981
6981
  return result;
6982
6982
  };
6983
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
6983
+
6984
6984
  Cache.prototype.match = function (src) {
6985
6985
  return this._cache[src];
6986
6986
  };
@@ -8727,7 +8727,7 @@
8727
8727
  styles.webkitTextStrokeColor
8728
8728
  );
8729
8729
  _this.ctx.lineWidth = styles.webkitTextStrokeWidth;
8730
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
8730
+
8731
8731
  _this.ctx.lineJoin = !!window.chrome ? 'miter' : 'round';
8732
8732
  _this.ctx.strokeText(
8733
8733
  text.text,
@@ -10004,20 +10004,20 @@
10004
10004
  this.enabled = enabled;
10005
10005
  this.start = Date.now();
10006
10006
  }
10007
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
10007
+
10008
10008
  Logger.prototype.debug = function () {
10009
10009
  var args = [];
10010
10010
  for (var _i = 0; _i < arguments.length; _i++) {
10011
10011
  args[_i] = arguments[_i];
10012
10012
  }
10013
10013
  if (this.enabled) {
10014
- // eslint-disable-next-line no-console
10014
+
10015
10015
  if (
10016
10016
  typeof window !== 'undefined' &&
10017
10017
  window.console &&
10018
10018
  typeof console.debug === 'function'
10019
10019
  ) {
10020
- // eslint-disable-next-line no-console
10020
+
10021
10021
  console.debug.apply(
10022
10022
  console,
10023
10023
  __spreadArray([this.id, this.getTime() + 'ms'], args)
@@ -10030,20 +10030,20 @@
10030
10030
  Logger.prototype.getTime = function () {
10031
10031
  return Date.now() - this.start;
10032
10032
  };
10033
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
10033
+
10034
10034
  Logger.prototype.info = function () {
10035
10035
  var args = [];
10036
10036
  for (var _i = 0; _i < arguments.length; _i++) {
10037
10037
  args[_i] = arguments[_i];
10038
10038
  }
10039
10039
  if (this.enabled) {
10040
- // eslint-disable-next-line no-console
10040
+
10041
10041
  if (
10042
10042
  typeof window !== 'undefined' &&
10043
10043
  window.console &&
10044
10044
  typeof console.info === 'function'
10045
10045
  ) {
10046
- // eslint-disable-next-line no-console
10046
+
10047
10047
  console.info.apply(
10048
10048
  console,
10049
10049
  __spreadArray([this.id, this.getTime() + 'ms'], args)
@@ -10051,20 +10051,20 @@
10051
10051
  }
10052
10052
  }
10053
10053
  };
10054
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
10054
+
10055
10055
  Logger.prototype.warn = function () {
10056
10056
  var args = [];
10057
10057
  for (var _i = 0; _i < arguments.length; _i++) {
10058
10058
  args[_i] = arguments[_i];
10059
10059
  }
10060
10060
  if (this.enabled) {
10061
- // eslint-disable-next-line no-console
10061
+
10062
10062
  if (
10063
10063
  typeof window !== 'undefined' &&
10064
10064
  window.console &&
10065
10065
  typeof console.warn === 'function'
10066
10066
  ) {
10067
- // eslint-disable-next-line no-console
10067
+
10068
10068
  console.warn.apply(
10069
10069
  console,
10070
10070
  __spreadArray([this.id, this.getTime() + 'ms'], args)
@@ -10074,20 +10074,20 @@
10074
10074
  }
10075
10075
  }
10076
10076
  };
10077
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
10077
+
10078
10078
  Logger.prototype.error = function () {
10079
10079
  var args = [];
10080
10080
  for (var _i = 0; _i < arguments.length; _i++) {
10081
10081
  args[_i] = arguments[_i];
10082
10082
  }
10083
10083
  if (this.enabled) {
10084
- // eslint-disable-next-line no-console
10084
+
10085
10085
  if (
10086
10086
  typeof window !== 'undefined' &&
10087
10087
  window.console &&
10088
10088
  typeof console.error === 'function'
10089
10089
  ) {
10090
- // eslint-disable-next-line no-console
10090
+
10091
10091
  console.error.apply(
10092
10092
  console,
10093
10093
  __spreadArray([this.id, this.getTime() + 'ms'], args)
package/package.json CHANGED
@@ -1,21 +1,20 @@
1
1
  {
2
2
  "name": "@tomei/finance",
3
- "version": "0.6.99",
3
+ "version": "0.6.102",
4
4
  "description": "NestJS package for finance module",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
7
7
  "start:dev": "tsc -w",
8
8
  "build": "tsc",
9
- "prepare": "npm run build",
9
+ "prepare": "husky install",
10
10
  "format": "prettier --write \"src/**/*.ts\"",
11
- "lint": "tslint -p tsconfig.json -c tslint.json",
11
+ "lint": "npx eslint . --fix",
12
12
  "test": "jest",
13
13
  "test:watch": "jest --watch",
14
14
  "test:cov": "jest --coverage",
15
15
  "test:e2e": "jest --config ./test/jest-e2e.json"
16
16
  },
17
17
  "keywords": [
18
- "nestjs",
19
18
  "tomei",
20
19
  "finance"
21
20
  ],
@@ -29,46 +28,41 @@
29
28
  "access": "public"
30
29
  },
31
30
  "peerDependencies": {
32
- "@nestjs/common": ">=9.0.5",
33
- "@nestjs/config": ">=2.2.0",
34
- "@nestjs/core": ">=9.0.8",
35
- "@nestjs/platform-express": ">=9.0.8",
36
- "@nestjs/sequelize": ">=9.0.0",
37
- "@nestjs/swagger": ">=6.1.4",
38
- "@tomei/activity-history": "^0.2.15",
39
- "@tomei/config": "^0.3.10",
40
- "@tomei/general": "^0.11.8",
41
- "@tomei/media": "^0.7.0",
42
- "@tomei/sso": "^0.21.13",
43
- "axios": "^1.6.0",
44
- "class-transformer": "^0.5.1",
45
- "class-validator": "^0.14.0",
31
+ "@nestjs/common": "^10.4.11",
32
+ "@nestjs/swagger": "^8.0.7",
33
+ "@tomei/activity-history": "^0.2.23",
34
+ "@tomei/config": "^0.3.21",
35
+ "@tomei/general": "^0.21.3",
36
+ "@tomei/media": "^0.7.10",
37
+ "@tomei/sso": "^0.51.6",
38
+ "axios": "^1.7.8",
46
39
  "cuid": "^3.0.0",
47
- "dotenv": "^16.0.3",
48
- "intuit-oauth": "^4.0.0",
49
- "mariadb": "^3.0.2",
50
- "puppeteer": "^18.1.0",
51
- "sequelize-typescript": "^2.1.5",
52
- "uniqid": "^5.4.0"
40
+ "dotenv": "^16.4.5",
41
+ "intuit-oauth": "^4.1.3",
42
+ "puppeteer": "^23.9.0",
43
+ "sequelize-typescript": "^2.1.6"
53
44
  },
54
45
  "devDependencies": {
55
- "@types/multer": "^1.4.7",
56
- "@types/node": "^18.0.6",
57
- "@types/sequelize": "^4.28.14",
58
- "@types/uniqid": "^5.3.2",
59
- "@typescript-eslint/eslint-plugin": "^5.33.0",
60
- "eslint": "^8.21.0",
61
- "eslint-config-prettier": "^8.5.0",
62
- "eslint-plugin-prettier": "^4.2.1",
63
- "husky": "^8.0.3",
64
- "lint-staged": "^11.1.2",
65
- "mariadb": "^3.0.2",
66
- "prettier": "^2.7.1",
67
- "ts-node": "^10.9.1",
68
- "tsc-watch": "^5.0.3",
69
- "tsconfig-paths": "^4.0.0",
70
- "tslint": "^6.1.3",
71
- "typescript": "^4.7.4"
46
+ "@commitlint/cli": "^19.6.0",
47
+ "@commitlint/config-conventional": "^19.6.0",
48
+ "@eslint/js": "^9.15.0",
49
+ "@types/multer": "^1.4.12",
50
+ "@types/node": "^22.10.0",
51
+ "@types/sequelize": "^4.28.20",
52
+ "@typescript-eslint/eslint-plugin": "^8.16.0",
53
+ "eslint": "^9.15.0",
54
+ "eslint-config-prettier": "^9.1.0",
55
+ "eslint-plugin-import": "^2.31.0",
56
+ "eslint-plugin-prettier": "^5.2.1",
57
+ "globals": "^15.12.0",
58
+ "husky": "^9.1.7",
59
+ "lint-staged": "^15.2.10",
60
+ "prettier": "^3.4.1",
61
+ "ts-node": "^10.9.2",
62
+ "tsc-watch": "^6.2.1",
63
+ "tsconfig-paths": "^4.2.0",
64
+ "typescript": "^5.7.2",
65
+ "typescript-eslint": "^8.16.0"
72
66
  },
73
67
  "lint-staged": {
74
68
  "*/**/*.{js,ts,tsx}": [
@@ -237,7 +237,8 @@ export default class Account extends AccountSystemEntity {
237
237
  this.OwnerType = this.OwnerType || data.OwnerType;
238
238
  this.RelatedObjectId = this.RelatedObjectId || data.RelatedObjectId;
239
239
  this.RelatedObjectType = this.RelatedObjectType || data.RelatedObjectType;
240
- this.PostedToAccSystemYN = this.PostedToAccSystemYN || data.PostedToAccSystemYN;
240
+ this.PostedToAccSystemYN =
241
+ this.PostedToAccSystemYN || data.PostedToAccSystemYN;
241
242
  this.ParentAccountNo = this.ParentAccountNo || data.ParentAccountNo;
242
243
  this.CreatedAt = data.CreatedAt;
243
244
  this.CreatedById = data.CreatedById;
@@ -17,7 +17,8 @@ import { LedgerTransactionRepository } from '../ledger-transaction/ledger-transa
17
17
  // const AccountSystemEntity = import('../account-system-entity').then(({AccountSystemEntity}) => AccountSystemEntity);
18
18
  export default abstract class FinanceCustomerBase
19
19
  extends AccountSystemEntity
20
- implements IPerson {
20
+ implements IPerson
21
+ {
21
22
  CustomerId = 'New';
22
23
  CustSystemCode = '';
23
24
  CustSystemRefId = '';
@@ -141,7 +142,8 @@ export default abstract class FinanceCustomerBase
141
142
  this._AccountReceivable.OwnerId = accountData.OwnerId;
142
143
  this._AccountReceivable.OwnerType = accountData.OwnerType;
143
144
  this._AccountReceivable.RelatedObjectId = accountData.RelatedObjectId;
144
- this._AccountReceivable.RelatedObjectType = accountData.RelatedObjectType;
145
+ this._AccountReceivable.RelatedObjectType =
146
+ accountData.RelatedObjectType;
145
147
  this._AccountReceivable.CreatedById = accountData.CreatedById;
146
148
  this._AccountReceivable.CreatedAt = accountData.CreatedAt;
147
149
  this._AccountReceivable.UpdatedById = accountData.UpdatedById;
@@ -154,7 +156,6 @@ export default abstract class FinanceCustomerBase
154
156
  this._AccountReceivable.AccountType = 'Account Receivable';
155
157
  this._AccountReceivable.OwnerId = this.CustomerId;
156
158
  this._AccountReceivable.OwnerType = type(this);
157
-
158
159
  }
159
160
  return this._AccountReceivable;
160
161
  }
@@ -227,13 +228,13 @@ export default abstract class FinanceCustomerBase
227
228
  this.CustSystemCode = custSystemCode;
228
229
  this.CustSystemRefId = custSystemRefId;
229
230
  this.AccSystemRefId = accSystemRefId;
230
- if (accSystemRefId !== "REF") {
231
- this.PostedToAccSystemYN = "Y";
231
+ if (accSystemRefId !== 'REF') {
232
+ this.PostedToAccSystemYN = 'Y';
232
233
  this.PostedDateTime = new Date();
233
234
  } else {
234
- this.PostedToAccSystemYN = "N";
235
+ this.PostedToAccSystemYN = 'N';
235
236
  }
236
- this.CustomerId = this.createId()
237
+ this.CustomerId = this.createId();
237
238
  const data = await FinanceCustomerBase._FinanceCustomerRepository.create(
238
239
  {
239
240
  CompanyId: this.CompanyId,
@@ -103,8 +103,9 @@ export default class DocumentItem extends ObjectBase {
103
103
  this.TaxInclusiveYN = params.TaxInclusiveYN || this.TaxInclusiveYN;
104
104
  this.DtAccountNo = params.DtAccountNo || this.DtAccountNo;
105
105
  this.CtAccountNo = params.CtAccountNo || this.CtAccountNo;
106
- this.AccSystemRefId = params.AccSystemRefId || this.AccSystemRefId;
107
- this.PostedToAccSystemYN = params.PostedToAccSystemYN || this.PostedToAccSystemYN;
106
+ this.AccSystemRefId = params.AccSystemRefId || this.AccSystemRefId;
107
+ this.PostedToAccSystemYN =
108
+ params.PostedToAccSystemYN || this.PostedToAccSystemYN;
108
109
  this.PostedById = params.PostedById || this.PostedById;
109
110
  this.PostedDateTime = params.PostedDateTime || this.PostedDateTime;
110
111
  }
@@ -262,9 +262,12 @@ export default class Document extends AccountSystemEntity {
262
262
  * @returns {void}
263
263
  */
264
264
  async reCalculateAmount(): Promise<void> {
265
+ const roundToTwoDecimals = (value: number): number =>
266
+ Math.round(value * 100) / 100;
267
+
265
268
  this.Amount = 0;
266
269
  for (const documentItem of this._DocumentItems) {
267
- this.Amount += documentItem.Amount;
270
+ this.Amount = roundToTwoDecimals(this.Amount + documentItem.Amount);
268
271
  }
269
272
  }
270
273
 
@@ -646,12 +649,12 @@ export default class Document extends AccountSystemEntity {
646
649
  ${documentItem.Description}
647
650
  </td>
648
651
  <td class="tm_width_2">${documentItem.Currency} ${
649
- documentItem.UnitPrice
650
- }</td>
652
+ documentItem.UnitPrice
653
+ }</td>
651
654
  <td class="tm_width_1">${documentItem.Quantity}</td>
652
655
  <td class="tm_width_2 tm_text_right">${documentItem.Currency} ${
653
- +documentItem.UnitPrice * +documentItem.Quantity
654
- }</td>
656
+ +documentItem.UnitPrice * +documentItem.Quantity
657
+ }</td>
655
658
  </tr>
656
659
  `;
657
660
  });
@@ -671,8 +674,11 @@ export default class Document extends AccountSystemEntity {
671
674
  },
672
675
  });
673
676
 
677
+ // Convert Uint8Array to Buffer
678
+ const pdfBufferAsBuffer = Buffer.from(pdfBuffer);
679
+
674
680
  const pdfStream: Express.Multer.File = {
675
- buffer: pdfBuffer,
681
+ buffer: pdfBufferAsBuffer,
676
682
  fieldname: 'FileStream',
677
683
  originalname: 'sample-invoice.pdf',
678
684
  mimetype: 'application/pdf',
@@ -907,8 +913,11 @@ export default class Document extends AccountSystemEntity {
907
913
  },
908
914
  });
909
915
 
916
+ // Convert Uint8Array to Buffer
917
+ const pdfBufferAsBuffer = Buffer.from(pdfBuffer);
918
+
910
919
  const pdfStream: Express.Multer.File = {
911
- buffer: pdfBuffer,
920
+ buffer: pdfBufferAsBuffer,
912
921
  fieldname: 'FileStream',
913
922
  originalname: 'sample-invoice.pdf',
914
923
  mimetype: 'application/pdf',
@@ -1268,9 +1277,8 @@ export default class Document extends AccountSystemEntity {
1268
1277
  }
1269
1278
 
1270
1279
  /*Retrieve documents from the database with pagination and search filters applied*/
1271
- let documents = await Document._RepositoryBase.findAllWithPagination(
1272
- options,
1273
- );
1280
+ let documents =
1281
+ await Document._RepositoryBase.findAllWithPagination(options);
1274
1282
 
1275
1283
  let isChangesExit = false;
1276
1284
 
@@ -1308,9 +1316,8 @@ export default class Document extends AccountSystemEntity {
1308
1316
  }
1309
1317
 
1310
1318
  if (isChangesExit) {
1311
- documents = await Document._RepositoryBase.findAllWithPagination(
1312
- options,
1313
- );
1319
+ documents =
1320
+ await Document._RepositoryBase.findAllWithPagination(options);
1314
1321
  }
1315
1322
 
1316
1323
  return documents; // make sure the returned data is updated
@@ -1,4 +1,4 @@
1
1
  export enum CollectPaymentType {
2
- MANUAL = 'MANUAL',
3
- AUTOMATIC = 'AUTOMATIC'
4
- }
2
+ MANUAL = 'MANUAL',
3
+ AUTOMATIC = 'AUTOMATIC',
4
+ }
@@ -8,4 +8,4 @@ export enum PaymentStatus {
8
8
  export enum PaymentPaidWithStatus {
9
9
  SUCCESSFUL = 'Successful',
10
10
  FAILED = 'Failed',
11
- };
11
+ }
@@ -433,7 +433,7 @@ export default class FinanceCompany extends ObjectBase {
433
433
 
434
434
  const activity = new Activity();
435
435
  activity.ActivityId = this._createId().toUpperCase();
436
- activity.Action = ActionEnum.ADD;
436
+ activity.Action = ActionEnum.CREATE;
437
437
  activity.Description = 'Add Finance Customer';
438
438
  activity.EntityType = 'FinanceCustomer';
439
439
  activity.EntityId = newCustomer.CustomerId;
@@ -1970,9 +1970,8 @@ export default class FinanceCompany extends ObjectBase {
1970
1970
  //Method to collect payment for multiple customer.
1971
1971
  try {
1972
1972
  //Part 1: Privilege Checking\
1973
- const systemCode = await ApplicationConfig.getComponentConfigValue(
1974
- 'system-code',
1975
- );
1973
+ const systemCode =
1974
+ await ApplicationConfig.getComponentConfigValue('system-code');
1976
1975
  const isPrivileged = await loginUser.checkPrivileges(
1977
1976
  systemCode,
1978
1977
  'Collect Payment For Multiple Customers',
@@ -2355,9 +2354,8 @@ export default class FinanceCompany extends ObjectBase {
2355
2354
 
2356
2355
  /*Registering the Journal Entries for the transaction*/
2357
2356
  const transactionDate = new Date();
2358
- const paymentPaidWithItems = await payment.getPaymentPaidWith(
2359
- dbTransaction,
2360
- );
2357
+ const paymentPaidWithItems =
2358
+ await payment.getPaymentPaidWith(dbTransaction);
2361
2359
 
2362
2360
  for (const paymentPaidWith of paymentPaidWithItems) {
2363
2361
  let paymentMethodType = await PaymentMethodType.initMethodType(
@@ -1,4 +1,3 @@
1
-
2
1
  import { IJournalEntryAttr } from './interfaces/journal-entry-attr.interface';
3
2
  import { TransactionTypeOptions } from '../enum';
4
3
  import JournalEntryModel from '../models/journal-entry.entity';
@@ -1,4 +1,3 @@
1
-
2
1
  import { ILedgerTransactionAttr } from './interfaces/ledger-transaction-attr.interface';
3
2
  import { TransactionTypeOptions } from '../enum/transaction-type.enum';
4
3
  import { LedgerTransactionRepository } from './ledger-transaction.repository';
@@ -89,9 +88,10 @@ export default class LedgerTransaction extends ObjectBase {
89
88
 
90
89
  async save(dbTransaction?: any): Promise<LedgerTransactionModel> {
91
90
  try {
92
- const count = await LedgerTransaction._LedgerTransactionRepository.count(
93
- dbTransaction,
94
- );
91
+ const count =
92
+ await LedgerTransaction._LedgerTransactionRepository.count(
93
+ dbTransaction,
94
+ );
95
95
  this.LedgerNo = `${count + 1}`;
96
96
 
97
97
  return await LedgerTransaction._LedgerTransactionRepository.create(
@@ -45,7 +45,7 @@ export default class PaymentMethodType extends ObjectBase {
45
45
  dbTransaction,
46
46
  methodTypeId,
47
47
  );
48
- paymentMethodType.MethodId = paymentMethodTypeData.MethodId
48
+ paymentMethodType.MethodId = paymentMethodTypeData.MethodId;
49
49
  paymentMethodType.Name = paymentMethodTypeData.Name;
50
50
  paymentMethodType.AccountNo = paymentMethodTypeData.AccountNo;
51
51
  paymentMethodType.ProcessingFeeRate =
package/src/tax/tax.ts CHANGED
@@ -24,7 +24,6 @@ export class Tax extends ObjectBase {
24
24
  this.ObjectId = code;
25
25
  }
26
26
 
27
-
28
27
  constructor(taxAttr?: ITaxAttr) {
29
28
  super();
30
29
  if (taxAttr) {
package/tsconfig.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "experimentalDecorators": true,
8
8
  "allowSyntheticDefaultImports": true,
9
9
  "moduleResolution": "node",
10
- "target": "es6",
10
+ "target": "es2017",
11
11
  "sourceMap": true,
12
12
  "outDir": "./dist",
13
13
  "baseUrl": "./",
@@ -18,5 +18,6 @@
18
18
  "strictBindCallApply": false,
19
19
  "forceConsistentCasingInFileNames": false,
20
20
  "noFallthroughCasesInSwitch": false,
21
- }
22
- }
21
+ },
22
+ "exclude": ["node_modules", "dist", "invoice-template", "configs"]
23
+ }
package/.eslintrc.js DELETED
@@ -1,72 +0,0 @@
1
- module.exports = {
2
- parser: '@typescript-eslint/parser',
3
- parserOptions: {
4
- project: 'tsconfig.json',
5
- sourceType: 'module',
6
- },
7
- plugins: ['@typescript-eslint/eslint-plugin'],
8
- extends: [
9
- 'plugin:@typescript-eslint/recommended',
10
- 'plugin:prettier/recommended',
11
- ],
12
- root: true,
13
- env: {
14
- node: true,
15
- jest: true,
16
- },
17
- ignorePatterns: ['.eslintrc.js', 'db/config.js'],
18
- rules: {
19
- "no-unused-vars": "off",
20
- "@typescript-eslint/no-unused-vars": ["error"],
21
- '@typescript-eslint/interface-name-prefix': 'off',
22
- '@typescript-eslint/explicit-function-return-type': 'off',
23
- '@typescript-eslint/explicit-module-boundary-types': 'off',
24
- '@typescript-eslint/no-explicit-any': 'off',
25
- '@typescript-eslint/naming-convention': [
26
- "error",
27
- {
28
- "selector": ["variable", "function"],
29
- "format": ["camelCase"],
30
- "leadingUnderscore": "forbid",
31
- "trailingUnderscore": "forbid",
32
- },
33
- {
34
- "selector": ["class"],
35
- "format": ["PascalCase"],
36
- "leadingUnderscore": "forbid",
37
- "trailingUnderscore": "forbid",
38
- },
39
- {
40
- "selector": "variable",
41
- "types": ["boolean"],
42
- "format": ["PascalCase"],
43
- "leadingUnderscore": "forbid",
44
- "trailingUnderscore": "forbid",
45
- "prefix": ["is", "should", "has", "can", "did", "will"]
46
- },
47
- {
48
- "selector": "interface",
49
- "format": ["PascalCase"],
50
- "leadingUnderscore": "forbid",
51
- "trailingUnderscore": "forbid",
52
- "custom": {
53
- "regex": "^I[A-Z]",
54
- "match": true
55
- }
56
- },
57
- {
58
- "selector": "variable",
59
- "modifiers": ["const"],
60
- "format": ["camelCase","UPPER_CASE", "PascalCase"],
61
- "leadingUnderscore": "forbid",
62
- "trailingUnderscore": "forbid",
63
- }
64
- ],
65
- "prettier/prettier": [
66
- "error",
67
- {
68
- "endOfLine": "auto"
69
- },
70
- ],
71
- },
72
- };
package/img.png DELETED
Binary file
package/img_1.png DELETED
Binary file
package/tslint.json DELETED
@@ -1,18 +0,0 @@
1
- {
2
- "defaultSeverity": "error",
3
- "extends": ["tslint:recommended"],
4
- "jsRules": {
5
- "no-unused-expression": true
6
- },
7
- "rules": {
8
- "quotemark": [true, "single"],
9
- "member-access": [false],
10
- "ordered-imports": [false],
11
- "max-line-length": [true, 150],
12
- "member-ordering": [false],
13
- "interface-name": [false],
14
- "arrow-parens": false,
15
- "object-literal-sort-keys": false
16
- },
17
- "rulesDirectory": []
18
- }