@tomei/finance 0.6.98 → 0.6.100
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.
- package/.commitlintrc.json +22 -22
- package/.eslintrc.js +72 -72
- package/.gitlab-ci.yml +16 -16
- package/.husky/commit-msg +4 -4
- package/.husky/pre-commit +4 -4
- package/.prettierrc +4 -4
- package/CONTRIBUTING.md +30 -30
- package/LICENSE +21 -21
- package/README.md +13 -13
- package/configs/config.js +348 -348
- package/dist/document/document.d.ts +3 -1
- package/dist/document/document.js +31 -3
- package/dist/document/document.js.map +1 -1
- package/dist/finance-company/finance-company.js +8 -2
- package/dist/finance-company/finance-company.js.map +1 -1
- package/dist/interfaces/account-system.interface.d.ts +4 -1
- package/dist/payment-item/payment-item.js +4 -4
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/invoice-template/assets/css/style.css.map +12 -12
- package/invoice-template/assets/css/style.min.css +1 -1
- package/invoice-template/assets/img/arrow_bg.svg +11 -11
- package/invoice-template/assets/img/coffy_shop_img.svg +18 -18
- package/invoice-template/assets/img/logo_accent.svg +3 -3
- package/invoice-template/assets/img/logo_white.svg +4 -4
- package/invoice-template/assets/img/sign.svg +12 -12
- package/invoice-template/assets/img/tomei-logo.svg +9 -9
- package/invoice-template/assets/js/html2canvas.min.js +10379 -10379
- package/invoice-template/assets/js/jquery.min.js +1 -1
- package/invoice-template/assets/sass/common/_color_variable.scss +12 -12
- package/invoice-template/assets/sass/common/_typography.scss +178 -178
- package/invoice-template/assets/sass/style.scss +12 -12
- package/migrations/finance-account-migration.js +97 -97
- package/migrations/finance-company-migration.js +29 -29
- package/migrations/finance-customer-migration.js +51 -51
- package/migrations/finance-document-item-migration.js +111 -111
- package/migrations/finance-document-migration.js +122 -122
- package/migrations/finance-journal-entry-migration.js +59 -59
- package/migrations/finance-ledger-transaction-migration.js +89 -89
- package/migrations/finance-payment-item-migration.js +52 -52
- package/migrations/finance-payment-method-migration.js +31 -31
- package/migrations/finance-payment-method-type-migration.js +55 -55
- package/migrations/finance-payment-migration.js +96 -96
- package/migrations/finance-post-history-migration.js +45 -45
- package/migrations/finance-tax-migration.js +52 -52
- package/migrations/refactor-finance-document-migration.js +71 -71
- package/migrations/update-document-item.migration.js +87 -87
- package/nest-cli.json +19 -19
- package/package.json +82 -82
- package/sonar-project.properties +12 -12
- package/src/account/account.repository.ts +11 -11
- package/src/account/account.ts +305 -305
- package/src/account/interfaces/account-attr.interface.ts +31 -31
- package/src/account-system-entity/account-system-entity.ts +66 -66
- package/src/account-system-entity/post-history.repository.ts +11 -11
- package/src/config.ts +382 -382
- package/src/customer/customer.ts +310 -310
- package/src/customer/finance-customer.repository.ts +13 -13
- package/src/customer/interfaces/customer.repository.interface.ts +3 -3
- package/src/customer/interfaces/finance-customer-attr.interface.ts +10 -10
- package/src/customer/interfaces/finance-customer.repository.interface.ts +4 -4
- package/src/database.ts +48 -48
- package/src/document/document-item.repository.ts +11 -11
- package/src/document/document.repository.ts +11 -11
- package/src/document/document.ts +64 -12
- package/src/document/interfaces/document-attr.interface.ts +28 -28
- package/src/document/interfaces/document-item-attr.interface.ts +26 -26
- package/src/document/interfaces/document-item.repository.interface.ts +4 -4
- package/src/enum/collect-payment-type.ts +3 -3
- package/src/enum/doc-type.enum.ts +8 -8
- package/src/enum/index.ts +19 -19
- package/src/enum/payment-method.enum.ts +3 -3
- package/src/enum/payment-type.enum.ts +4 -4
- package/src/enum/quick-book-client-scopes.enum.ts +14 -14
- package/src/finance-company/finance-company.repository.ts +11 -11
- package/src/finance-company/finance-company.ts +2436 -2424
- package/src/helpers/login-user.ts +38 -38
- package/src/helpers/typeof.ts +35 -35
- package/src/index.ts +32 -32
- package/src/interfaces/account-system.interface.ts +51 -36
- package/src/interfaces/index.ts +3 -3
- package/src/models/account.entity.ts +206 -206
- package/src/models/customer.entity.ts +93 -93
- package/src/models/document-item.entity.ts +167 -167
- package/src/models/document.entity.ts +211 -211
- package/src/models/finance-company.entity.ts +69 -69
- package/src/models/journal-entry.entity.ts +110 -110
- package/src/models/ledger-transaction.entity.ts +148 -148
- package/src/models/payment-item.entity.ts +60 -60
- package/src/models/payment-method-type.entity.ts +70 -70
- package/src/models/payment-method.entity.ts +51 -51
- package/src/models/payment.entity.ts +165 -165
- package/src/models/post-history.entity.ts +41 -41
- package/src/models/tax.entity.ts +75 -75
- package/src/payment/interfaces/payment-attr.interface.ts +23 -23
- package/src/payment/interfaces/payment-params.interface.ts +8 -8
- package/src/payment/payment.repository.ts +11 -11
- package/src/payment/payment.ts +236 -236
- package/src/payment-item/interfaces/payment-item-attr.interface.ts +10 -10
- package/src/payment-item/payment-item.repository.ts +11 -11
- package/src/payment-item/payment-item.ts +134 -134
- package/src/payment-method/payment-method.repository.ts +11 -11
- package/src/payment-method-type/payment-method-type.repository.ts +11 -11
- package/src/tax/interfaces/tax-attr.interface.ts +10 -10
- package/src/tax/tax.repository.ts +11 -11
- package/src/tax/tax.ts +69 -69
- package/src/test-document.ts +25 -25
- package/src/test.ts +3 -3
- package/tsconfig.build.json +4 -4
- package/tsconfig.json +22 -22
- package/tslint.json +18 -18
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export interface IFinanceCustomerAttr {
|
|
2
|
-
CustomerId: string;
|
|
3
|
-
CompanyId: string;
|
|
4
|
-
CustSystemCode: string;
|
|
5
|
-
CustSystemRefId: string;
|
|
6
|
-
AccSystemRefId: string;
|
|
7
|
-
PostedToAccSystemYN: string;
|
|
8
|
-
PostedById: string;
|
|
9
|
-
PostedDateTime?: Date;
|
|
10
|
-
}
|
|
1
|
+
export interface IFinanceCustomerAttr {
|
|
2
|
+
CustomerId: string;
|
|
3
|
+
CompanyId: string;
|
|
4
|
+
CustSystemCode: string;
|
|
5
|
+
CustSystemRefId: string;
|
|
6
|
+
AccSystemRefId: string;
|
|
7
|
+
PostedToAccSystemYN: string;
|
|
8
|
+
PostedById: string;
|
|
9
|
+
PostedDateTime?: Date;
|
|
10
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IRepositoryBase } from '@tomei/general';
|
|
2
|
-
import FinanceCustomerModel from '../../models/customer.entity';
|
|
3
|
-
|
|
4
|
-
export type IFinanceCustomerRepository = IRepositoryBase<FinanceCustomerModel>;
|
|
1
|
+
import { IRepositoryBase } from '@tomei/general';
|
|
2
|
+
import FinanceCustomerModel from '../../models/customer.entity';
|
|
3
|
+
|
|
4
|
+
export type IFinanceCustomerRepository = IRepositoryBase<FinanceCustomerModel>;
|
package/src/database.ts
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
import { Sequelize, SequelizeOptions } from 'sequelize-typescript';
|
|
2
|
-
import AccountModel from './models/account.entity';
|
|
3
|
-
import FinanceCustomerModel from './models/customer.entity';
|
|
4
|
-
import DocumentItemModel from './models/document-item.entity';
|
|
5
|
-
import DocumentModel from './models/document.entity';
|
|
6
|
-
import FinanceCompanyModel from './models/finance-company.entity';
|
|
7
|
-
import JournalEntryModel from './models/journal-entry.entity';
|
|
8
|
-
import LedgerTransactionModel from './models/ledger-transaction.entity';
|
|
9
|
-
import PaymentItemModel from './models/payment-item.entity';
|
|
10
|
-
import PaymentMethodTypeModel from './models/payment-method-type.entity';
|
|
11
|
-
import PaymentMethodModel from './models/payment-method.entity';
|
|
12
|
-
import PaymentPaidWithModel from './models/payment-paid-with.entity';
|
|
13
|
-
import PaymentModel from './models/payment.entity';
|
|
14
|
-
import FinancePostHistoryModel from './models/post-history.entity';
|
|
15
|
-
import { MediasModel } from '@tomei/media';
|
|
16
|
-
import ActivityHistoryModel from '@tomei/activity-history/dist/src/models/activity-history.entity';
|
|
17
|
-
import FinanceTaxModel from './models/tax.entity';
|
|
18
|
-
|
|
19
|
-
let sequelize: Sequelize;
|
|
20
|
-
|
|
21
|
-
function init(sequelizeOptions: SequelizeOptions) {
|
|
22
|
-
sequelize = new Sequelize(sequelizeOptions);
|
|
23
|
-
|
|
24
|
-
sequelize.addModels([
|
|
25
|
-
AccountModel,
|
|
26
|
-
FinanceCustomerModel,
|
|
27
|
-
DocumentItemModel,
|
|
28
|
-
DocumentModel,
|
|
29
|
-
FinanceCompanyModel,
|
|
30
|
-
JournalEntryModel,
|
|
31
|
-
LedgerTransactionModel,
|
|
32
|
-
PaymentItemModel,
|
|
33
|
-
PaymentMethodTypeModel,
|
|
34
|
-
PaymentMethodModel,
|
|
35
|
-
PaymentPaidWithModel,
|
|
36
|
-
PaymentModel,
|
|
37
|
-
FinancePostHistoryModel,
|
|
38
|
-
MediasModel,
|
|
39
|
-
ActivityHistoryModel,
|
|
40
|
-
FinanceTaxModel,
|
|
41
|
-
]);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function getConnection() {
|
|
45
|
-
return sequelize;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export { init, getConnection };
|
|
1
|
+
import { Sequelize, SequelizeOptions } from 'sequelize-typescript';
|
|
2
|
+
import AccountModel from './models/account.entity';
|
|
3
|
+
import FinanceCustomerModel from './models/customer.entity';
|
|
4
|
+
import DocumentItemModel from './models/document-item.entity';
|
|
5
|
+
import DocumentModel from './models/document.entity';
|
|
6
|
+
import FinanceCompanyModel from './models/finance-company.entity';
|
|
7
|
+
import JournalEntryModel from './models/journal-entry.entity';
|
|
8
|
+
import LedgerTransactionModel from './models/ledger-transaction.entity';
|
|
9
|
+
import PaymentItemModel from './models/payment-item.entity';
|
|
10
|
+
import PaymentMethodTypeModel from './models/payment-method-type.entity';
|
|
11
|
+
import PaymentMethodModel from './models/payment-method.entity';
|
|
12
|
+
import PaymentPaidWithModel from './models/payment-paid-with.entity';
|
|
13
|
+
import PaymentModel from './models/payment.entity';
|
|
14
|
+
import FinancePostHistoryModel from './models/post-history.entity';
|
|
15
|
+
import { MediasModel } from '@tomei/media';
|
|
16
|
+
import ActivityHistoryModel from '@tomei/activity-history/dist/src/models/activity-history.entity';
|
|
17
|
+
import FinanceTaxModel from './models/tax.entity';
|
|
18
|
+
|
|
19
|
+
let sequelize: Sequelize;
|
|
20
|
+
|
|
21
|
+
function init(sequelizeOptions: SequelizeOptions) {
|
|
22
|
+
sequelize = new Sequelize(sequelizeOptions);
|
|
23
|
+
|
|
24
|
+
sequelize.addModels([
|
|
25
|
+
AccountModel,
|
|
26
|
+
FinanceCustomerModel,
|
|
27
|
+
DocumentItemModel,
|
|
28
|
+
DocumentModel,
|
|
29
|
+
FinanceCompanyModel,
|
|
30
|
+
JournalEntryModel,
|
|
31
|
+
LedgerTransactionModel,
|
|
32
|
+
PaymentItemModel,
|
|
33
|
+
PaymentMethodTypeModel,
|
|
34
|
+
PaymentMethodModel,
|
|
35
|
+
PaymentPaidWithModel,
|
|
36
|
+
PaymentModel,
|
|
37
|
+
FinancePostHistoryModel,
|
|
38
|
+
MediasModel,
|
|
39
|
+
ActivityHistoryModel,
|
|
40
|
+
FinanceTaxModel,
|
|
41
|
+
]);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function getConnection() {
|
|
45
|
+
return sequelize;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export { init, getConnection };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { RepositoryBase, IRepositoryBase } from '@tomei/general';
|
|
2
|
-
import DocumentItemModel from '../models/document-item.entity';
|
|
3
|
-
|
|
4
|
-
export class DocumentItemRepository
|
|
5
|
-
extends RepositoryBase<DocumentItemModel>
|
|
6
|
-
implements IRepositoryBase<DocumentItemModel>
|
|
7
|
-
{
|
|
8
|
-
constructor() {
|
|
9
|
-
super(DocumentItemModel);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
1
|
+
import { RepositoryBase, IRepositoryBase } from '@tomei/general';
|
|
2
|
+
import DocumentItemModel from '../models/document-item.entity';
|
|
3
|
+
|
|
4
|
+
export class DocumentItemRepository
|
|
5
|
+
extends RepositoryBase<DocumentItemModel>
|
|
6
|
+
implements IRepositoryBase<DocumentItemModel>
|
|
7
|
+
{
|
|
8
|
+
constructor() {
|
|
9
|
+
super(DocumentItemModel);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { RepositoryBase, IRepositoryBase } from '@tomei/general';
|
|
2
|
-
import DocumentModel from '../models/document.entity';
|
|
3
|
-
|
|
4
|
-
export class DocumentRepository
|
|
5
|
-
extends RepositoryBase<DocumentModel>
|
|
6
|
-
implements IRepositoryBase<DocumentModel>
|
|
7
|
-
{
|
|
8
|
-
constructor() {
|
|
9
|
-
super(DocumentModel);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
1
|
+
import { RepositoryBase, IRepositoryBase } from '@tomei/general';
|
|
2
|
+
import DocumentModel from '../models/document.entity';
|
|
3
|
+
|
|
4
|
+
export class DocumentRepository
|
|
5
|
+
extends RepositoryBase<DocumentModel>
|
|
6
|
+
implements IRepositoryBase<DocumentModel>
|
|
7
|
+
{
|
|
8
|
+
constructor() {
|
|
9
|
+
super(DocumentModel);
|
|
10
|
+
}
|
|
11
|
+
}
|
package/src/document/document.ts
CHANGED
|
@@ -25,6 +25,7 @@ import { ApplicationConfig } from '@tomei/config';
|
|
|
25
25
|
import { Op } from 'sequelize';
|
|
26
26
|
import { LoginUser } from '../helpers/login-user';
|
|
27
27
|
import { ActionEnum, Activity } from '@tomei/activity-history';
|
|
28
|
+
import { IAccountSystem } from '../interfaces/account-system.interface';
|
|
28
29
|
|
|
29
30
|
export default class Document extends AccountSystemEntity {
|
|
30
31
|
DocNo = 'New';
|
|
@@ -55,6 +56,7 @@ export default class Document extends AccountSystemEntity {
|
|
|
55
56
|
|
|
56
57
|
private static _RepositoryBase = new DocumentRepository();
|
|
57
58
|
private static _DocumentItemRepository = new DocumentItemRepository();
|
|
59
|
+
private static _AccountingSystem: IAccountSystem;
|
|
58
60
|
|
|
59
61
|
private _DbTransaction: any;
|
|
60
62
|
private _IsNewRecord = true;
|
|
@@ -260,9 +262,12 @@ export default class Document extends AccountSystemEntity {
|
|
|
260
262
|
* @returns {void}
|
|
261
263
|
*/
|
|
262
264
|
async reCalculateAmount(): Promise<void> {
|
|
265
|
+
const roundToTwoDecimals = (value: number): number =>
|
|
266
|
+
Math.round(value * 100) / 100;
|
|
267
|
+
|
|
263
268
|
this.Amount = 0;
|
|
264
269
|
for (const documentItem of this._DocumentItems) {
|
|
265
|
-
this.Amount
|
|
270
|
+
this.Amount = roundToTwoDecimals(this.Amount + documentItem.Amount);
|
|
266
271
|
}
|
|
267
272
|
}
|
|
268
273
|
|
|
@@ -643,11 +648,13 @@ export default class Document extends AccountSystemEntity {
|
|
|
643
648
|
<td class="tm_width_4">
|
|
644
649
|
${documentItem.Description}
|
|
645
650
|
</td>
|
|
646
|
-
<td class="tm_width_2">${documentItem.Currency} ${
|
|
647
|
-
|
|
651
|
+
<td class="tm_width_2">${documentItem.Currency} ${
|
|
652
|
+
documentItem.UnitPrice
|
|
653
|
+
}</td>
|
|
648
654
|
<td class="tm_width_1">${documentItem.Quantity}</td>
|
|
649
|
-
<td class="tm_width_2 tm_text_right">${documentItem.Currency} ${
|
|
650
|
-
|
|
655
|
+
<td class="tm_width_2 tm_text_right">${documentItem.Currency} ${
|
|
656
|
+
+documentItem.UnitPrice * +documentItem.Quantity
|
|
657
|
+
}</td>
|
|
651
658
|
</tr>
|
|
652
659
|
`;
|
|
653
660
|
});
|
|
@@ -863,11 +870,13 @@ export default class Document extends AccountSystemEntity {
|
|
|
863
870
|
<td class="tm_width_4">
|
|
864
871
|
${documentItem.Description}
|
|
865
872
|
</td>
|
|
866
|
-
<td class="tm_width_2">${documentItem.Currency} ${
|
|
867
|
-
|
|
873
|
+
<td class="tm_width_2">${documentItem.Currency} ${
|
|
874
|
+
documentItem.UnitPrice
|
|
875
|
+
}</td>
|
|
868
876
|
<td class="tm_width_1">${documentItem.Quantity}</td>
|
|
869
|
-
<td class="tm_width_2 tm_text_right">${documentItem.Currency} ${
|
|
870
|
-
|
|
877
|
+
<td class="tm_width_2 tm_text_right">${documentItem.Currency} ${
|
|
878
|
+
+documentItem.UnitPrice * +documentItem.Quantity
|
|
879
|
+
}</td>
|
|
871
880
|
</tr>
|
|
872
881
|
`;
|
|
873
882
|
});
|
|
@@ -1165,7 +1174,8 @@ export default class Document extends AccountSystemEntity {
|
|
|
1165
1174
|
page?: number,
|
|
1166
1175
|
row?: number,
|
|
1167
1176
|
search?: IDocumentFindAll,
|
|
1168
|
-
order?: [string, string][]
|
|
1177
|
+
order?: [string, string][],
|
|
1178
|
+
accountingSystem?: IAccountSystem,
|
|
1169
1179
|
): Promise<{ count: number; rows: DocumentModel[] }> {
|
|
1170
1180
|
try {
|
|
1171
1181
|
const systemCode =
|
|
@@ -1261,10 +1271,52 @@ export default class Document extends AccountSystemEntity {
|
|
|
1261
1271
|
}
|
|
1262
1272
|
|
|
1263
1273
|
/*Retrieve documents from the database with pagination and search filters applied*/
|
|
1264
|
-
|
|
1274
|
+
let documents = await Document._RepositoryBase.findAllWithPagination(
|
|
1265
1275
|
options,
|
|
1266
1276
|
);
|
|
1267
|
-
|
|
1277
|
+
|
|
1278
|
+
let isChangesExit = false;
|
|
1279
|
+
|
|
1280
|
+
for (let i = 0; i < documents?.rows?.length; i++) {
|
|
1281
|
+
const doc = await documents?.rows[i];
|
|
1282
|
+
if (doc.UseAccSystemDocYN.toLowerCase() === 'y') {
|
|
1283
|
+
console.log(doc.UseAccSystemDocYN.toLowerCase());
|
|
1284
|
+
|
|
1285
|
+
if (accountingSystem === null || accountingSystem === undefined) {
|
|
1286
|
+
throw new ClassError(
|
|
1287
|
+
'Document',
|
|
1288
|
+
'DocumentFindAllErrMsg01',
|
|
1289
|
+
`Accounting System is not set`,
|
|
1290
|
+
);
|
|
1291
|
+
}
|
|
1292
|
+
const invoiceStatus = await accountingSystem.getInvoiceStatus(
|
|
1293
|
+
doc.AccSystemRefId,
|
|
1294
|
+
);
|
|
1295
|
+
if (doc.Status !== invoiceStatus) {
|
|
1296
|
+
doc.Status = invoiceStatus;
|
|
1297
|
+
await this._RepositoryBase.update(
|
|
1298
|
+
{
|
|
1299
|
+
Status: invoiceStatus,
|
|
1300
|
+
},
|
|
1301
|
+
{
|
|
1302
|
+
where: {
|
|
1303
|
+
DocNo: doc.DocNo,
|
|
1304
|
+
},
|
|
1305
|
+
transaction: dbTransaction,
|
|
1306
|
+
},
|
|
1307
|
+
);
|
|
1308
|
+
isChangesExit = true;
|
|
1309
|
+
}
|
|
1310
|
+
}
|
|
1311
|
+
}
|
|
1312
|
+
|
|
1313
|
+
if (isChangesExit) {
|
|
1314
|
+
documents = await Document._RepositoryBase.findAllWithPagination(
|
|
1315
|
+
options,
|
|
1316
|
+
);
|
|
1317
|
+
}
|
|
1318
|
+
|
|
1319
|
+
return documents; // make sure the returned data is updated
|
|
1268
1320
|
} catch (error) {
|
|
1269
1321
|
throw error;
|
|
1270
1322
|
}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { DocType, DocumentStatus } from '../../enum';
|
|
2
|
-
|
|
3
|
-
export class IDocumentAttr {
|
|
4
|
-
DocNo: string;
|
|
5
|
-
DocType: DocType;
|
|
6
|
-
DocDate: Date;
|
|
7
|
-
CompanyId: string;
|
|
8
|
-
Currency: string;
|
|
9
|
-
Amount: number;
|
|
10
|
-
Description: string;
|
|
11
|
-
Status: DocumentStatus;
|
|
12
|
-
IssuedById: string;
|
|
13
|
-
IssuedToId: string;
|
|
14
|
-
IssuedToType: string;
|
|
15
|
-
RelatedObjectId?: string;
|
|
16
|
-
RelatedObjectType?: string;
|
|
17
|
-
CreatedById: string;
|
|
18
|
-
CreatedAt: Date;
|
|
19
|
-
UpdatedById?: string;
|
|
20
|
-
UpdatedAt?: Date;
|
|
21
|
-
DocPDFFileMediaId?: string;
|
|
22
|
-
DocHTMLFileMediaId?: string;
|
|
23
|
-
AccSystemRefId?: string;
|
|
24
|
-
PostedToAccSystemYN: string;
|
|
25
|
-
PostedById?: string;
|
|
26
|
-
PostedDateTime?: Date;
|
|
27
|
-
UseAccSystemDocYN: string;
|
|
28
|
-
}
|
|
1
|
+
import { DocType, DocumentStatus } from '../../enum';
|
|
2
|
+
|
|
3
|
+
export class IDocumentAttr {
|
|
4
|
+
DocNo: string;
|
|
5
|
+
DocType: DocType;
|
|
6
|
+
DocDate: Date;
|
|
7
|
+
CompanyId: string;
|
|
8
|
+
Currency: string;
|
|
9
|
+
Amount: number;
|
|
10
|
+
Description: string;
|
|
11
|
+
Status: DocumentStatus;
|
|
12
|
+
IssuedById: string;
|
|
13
|
+
IssuedToId: string;
|
|
14
|
+
IssuedToType: string;
|
|
15
|
+
RelatedObjectId?: string;
|
|
16
|
+
RelatedObjectType?: string;
|
|
17
|
+
CreatedById: string;
|
|
18
|
+
CreatedAt: Date;
|
|
19
|
+
UpdatedById?: string;
|
|
20
|
+
UpdatedAt?: Date;
|
|
21
|
+
DocPDFFileMediaId?: string;
|
|
22
|
+
DocHTMLFileMediaId?: string;
|
|
23
|
+
AccSystemRefId?: string;
|
|
24
|
+
PostedToAccSystemYN: string;
|
|
25
|
+
PostedById?: string;
|
|
26
|
+
PostedDateTime?: Date;
|
|
27
|
+
UseAccSystemDocYN: string;
|
|
28
|
+
}
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
export class IDocumentItemAttr {
|
|
2
|
-
DocumentItemId: string;
|
|
3
|
-
DocNo: string;
|
|
4
|
-
Name: string;
|
|
5
|
-
NameBM: string;
|
|
6
|
-
Description?: string;
|
|
7
|
-
ItemId?: string;
|
|
8
|
-
ItemType?: string;
|
|
9
|
-
ItemSKU?: string;
|
|
10
|
-
ItemSerialNo?: string;
|
|
11
|
-
Currency: string;
|
|
12
|
-
UnitPrice?: number;
|
|
13
|
-
Quantity?: number;
|
|
14
|
-
QuantityUOM?: string;
|
|
15
|
-
Amount: number;
|
|
16
|
-
TaxCode?: string;
|
|
17
|
-
TaxAmount?: number;
|
|
18
|
-
TaxRate?: number;
|
|
19
|
-
TaxInclusiveYN?: string;
|
|
20
|
-
DtAccountNo?: string;
|
|
21
|
-
CtAccountNo?: string;
|
|
22
|
-
AccSystemRefId?: string;
|
|
23
|
-
PostedToAccSystemYN?: string;
|
|
24
|
-
PostedById?: string;
|
|
25
|
-
PostedDateTime?: Date;
|
|
26
|
-
}
|
|
1
|
+
export class IDocumentItemAttr {
|
|
2
|
+
DocumentItemId: string;
|
|
3
|
+
DocNo: string;
|
|
4
|
+
Name: string;
|
|
5
|
+
NameBM: string;
|
|
6
|
+
Description?: string;
|
|
7
|
+
ItemId?: string;
|
|
8
|
+
ItemType?: string;
|
|
9
|
+
ItemSKU?: string;
|
|
10
|
+
ItemSerialNo?: string;
|
|
11
|
+
Currency: string;
|
|
12
|
+
UnitPrice?: number;
|
|
13
|
+
Quantity?: number;
|
|
14
|
+
QuantityUOM?: string;
|
|
15
|
+
Amount: number;
|
|
16
|
+
TaxCode?: string;
|
|
17
|
+
TaxAmount?: number;
|
|
18
|
+
TaxRate?: number;
|
|
19
|
+
TaxInclusiveYN?: string;
|
|
20
|
+
DtAccountNo?: string;
|
|
21
|
+
CtAccountNo?: string;
|
|
22
|
+
AccSystemRefId?: string;
|
|
23
|
+
PostedToAccSystemYN?: string;
|
|
24
|
+
PostedById?: string;
|
|
25
|
+
PostedDateTime?: Date;
|
|
26
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IRepositoryBase } from '@tomei/general';
|
|
2
|
-
import DocumentItemModel from '../../models/document-item.entity';
|
|
3
|
-
|
|
4
|
-
export type IDocumentItemRepository = IRepositoryBase<DocumentItemModel>;
|
|
1
|
+
import { IRepositoryBase } from '@tomei/general';
|
|
2
|
+
import DocumentItemModel from '../../models/document-item.entity';
|
|
3
|
+
|
|
4
|
+
export type IDocumentItemRepository = IRepositoryBase<DocumentItemModel>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export enum CollectPaymentType {
|
|
2
|
-
MANUAL = 'MANUAL',
|
|
3
|
-
AUTOMATIC = 'AUTOMATIC'
|
|
1
|
+
export enum CollectPaymentType {
|
|
2
|
+
MANUAL = 'MANUAL',
|
|
3
|
+
AUTOMATIC = 'AUTOMATIC'
|
|
4
4
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export enum DocType {
|
|
2
|
-
INVOICE = 'Invoice',
|
|
3
|
-
DEBIT_NOTE = 'Debit Note',
|
|
4
|
-
CREDIT_NOTE = 'Credit Note',
|
|
5
|
-
QUOTATION = 'Quotation',
|
|
6
|
-
PURCHASEORDER = 'Purchase Order',
|
|
7
|
-
RECEIPT = 'Receipt',
|
|
8
|
-
}
|
|
1
|
+
export enum DocType {
|
|
2
|
+
INVOICE = 'Invoice',
|
|
3
|
+
DEBIT_NOTE = 'Debit Note',
|
|
4
|
+
CREDIT_NOTE = 'Credit Note',
|
|
5
|
+
QUOTATION = 'Quotation',
|
|
6
|
+
PURCHASEORDER = 'Purchase Order',
|
|
7
|
+
RECEIPT = 'Receipt',
|
|
8
|
+
}
|
package/src/enum/index.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { ClientScopes } from './quick-book-client-scopes.enum';
|
|
2
|
-
import { PaymentType } from './payment-type.enum';
|
|
3
|
-
import { PaymentMethod } from './payment-method.enum';
|
|
4
|
-
import { TransactionTypeOptions } from './transaction-type.enum';
|
|
5
|
-
import { DocType } from './doc-type.enum';
|
|
6
|
-
import { DocumentStatus } from './document-status.enum';
|
|
7
|
-
import { PaymentStatus } from './payment-status.enum';
|
|
8
|
-
import { PaymentPaidWithStatus } from './payment-status.enum';
|
|
9
|
-
|
|
10
|
-
export {
|
|
11
|
-
ClientScopes,
|
|
12
|
-
PaymentType,
|
|
13
|
-
PaymentMethod,
|
|
14
|
-
TransactionTypeOptions,
|
|
15
|
-
DocType,
|
|
16
|
-
DocumentStatus,
|
|
17
|
-
PaymentStatus,
|
|
18
|
-
PaymentPaidWithStatus,
|
|
19
|
-
};
|
|
1
|
+
import { ClientScopes } from './quick-book-client-scopes.enum';
|
|
2
|
+
import { PaymentType } from './payment-type.enum';
|
|
3
|
+
import { PaymentMethod } from './payment-method.enum';
|
|
4
|
+
import { TransactionTypeOptions } from './transaction-type.enum';
|
|
5
|
+
import { DocType } from './doc-type.enum';
|
|
6
|
+
import { DocumentStatus } from './document-status.enum';
|
|
7
|
+
import { PaymentStatus } from './payment-status.enum';
|
|
8
|
+
import { PaymentPaidWithStatus } from './payment-status.enum';
|
|
9
|
+
|
|
10
|
+
export {
|
|
11
|
+
ClientScopes,
|
|
12
|
+
PaymentType,
|
|
13
|
+
PaymentMethod,
|
|
14
|
+
TransactionTypeOptions,
|
|
15
|
+
DocType,
|
|
16
|
+
DocumentStatus,
|
|
17
|
+
PaymentStatus,
|
|
18
|
+
PaymentPaidWithStatus,
|
|
19
|
+
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export enum PaymentMethod {
|
|
2
|
-
Cash = 'Cash', // example
|
|
3
|
-
}
|
|
1
|
+
export enum PaymentMethod {
|
|
2
|
+
Cash = 'Cash', // example
|
|
3
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export enum PaymentType {
|
|
2
|
-
PAYMENT_RECEIVED = 'Payment Received',
|
|
3
|
-
PAYOUT = 'Payout',
|
|
4
|
-
}
|
|
1
|
+
export enum PaymentType {
|
|
2
|
+
PAYMENT_RECEIVED = 'Payment Received',
|
|
3
|
+
PAYOUT = 'Payout',
|
|
4
|
+
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import * as OAuthClient from 'intuit-oauth';
|
|
2
|
-
export enum ClientScopes {
|
|
3
|
-
ACCOUNTING = OAuthClient.scopes.Accounting,
|
|
4
|
-
PAYMENT = OAuthClient.scopes.Payment,
|
|
5
|
-
PAYROLL = OAuthClient.scopes.Payroll,
|
|
6
|
-
TIMETRACKING = OAuthClient.scopes.TimeTracking,
|
|
7
|
-
BENEFITS = OAuthClient.scopes.Benefits,
|
|
8
|
-
PROFILE = OAuthClient.scopes.Profile,
|
|
9
|
-
EMAIL = OAuthClient.scopes.Email,
|
|
10
|
-
PHONE = OAuthClient.scopes.Phone,
|
|
11
|
-
ADDRESS = OAuthClient.scopes.Address,
|
|
12
|
-
OPENID = OAuthClient.scopes.OpenId,
|
|
13
|
-
INTUIT_NAME = OAuthClient.scopes.Intuit_name,
|
|
14
|
-
}
|
|
1
|
+
import * as OAuthClient from 'intuit-oauth';
|
|
2
|
+
export enum ClientScopes {
|
|
3
|
+
ACCOUNTING = OAuthClient.scopes.Accounting,
|
|
4
|
+
PAYMENT = OAuthClient.scopes.Payment,
|
|
5
|
+
PAYROLL = OAuthClient.scopes.Payroll,
|
|
6
|
+
TIMETRACKING = OAuthClient.scopes.TimeTracking,
|
|
7
|
+
BENEFITS = OAuthClient.scopes.Benefits,
|
|
8
|
+
PROFILE = OAuthClient.scopes.Profile,
|
|
9
|
+
EMAIL = OAuthClient.scopes.Email,
|
|
10
|
+
PHONE = OAuthClient.scopes.Phone,
|
|
11
|
+
ADDRESS = OAuthClient.scopes.Address,
|
|
12
|
+
OPENID = OAuthClient.scopes.OpenId,
|
|
13
|
+
INTUIT_NAME = OAuthClient.scopes.Intuit_name,
|
|
14
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { RepositoryBase, IRepositoryBase } from '@tomei/general';
|
|
2
|
-
import FinanceCompanyModel from '../models/finance-company.entity';
|
|
3
|
-
|
|
4
|
-
export class FinanceCompanyRepository
|
|
5
|
-
extends RepositoryBase<FinanceCompanyModel>
|
|
6
|
-
implements IRepositoryBase<FinanceCompanyModel>
|
|
7
|
-
{
|
|
8
|
-
constructor() {
|
|
9
|
-
super(FinanceCompanyModel);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
1
|
+
import { RepositoryBase, IRepositoryBase } from '@tomei/general';
|
|
2
|
+
import FinanceCompanyModel from '../models/finance-company.entity';
|
|
3
|
+
|
|
4
|
+
export class FinanceCompanyRepository
|
|
5
|
+
extends RepositoryBase<FinanceCompanyModel>
|
|
6
|
+
implements IRepositoryBase<FinanceCompanyModel>
|
|
7
|
+
{
|
|
8
|
+
constructor() {
|
|
9
|
+
super(FinanceCompanyModel);
|
|
10
|
+
}
|
|
11
|
+
}
|