@tomei/finance 0.6.97 → 0.6.99
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/account/account.js +37 -13
- package/dist/account/account.js.map +1 -1
- package/dist/customer/customer.js.map +1 -1
- package/dist/document/document.d.ts +3 -1
- package/dist/document/document.js +29 -2
- 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 -278
- 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 -309
- 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 +60 -11
- 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;
|
|
@@ -643,11 +645,13 @@ export default class Document extends AccountSystemEntity {
|
|
|
643
645
|
<td class="tm_width_4">
|
|
644
646
|
${documentItem.Description}
|
|
645
647
|
</td>
|
|
646
|
-
<td class="tm_width_2">${documentItem.Currency} ${
|
|
647
|
-
|
|
648
|
+
<td class="tm_width_2">${documentItem.Currency} ${
|
|
649
|
+
documentItem.UnitPrice
|
|
650
|
+
}</td>
|
|
648
651
|
<td class="tm_width_1">${documentItem.Quantity}</td>
|
|
649
|
-
<td class="tm_width_2 tm_text_right">${documentItem.Currency} ${
|
|
650
|
-
|
|
652
|
+
<td class="tm_width_2 tm_text_right">${documentItem.Currency} ${
|
|
653
|
+
+documentItem.UnitPrice * +documentItem.Quantity
|
|
654
|
+
}</td>
|
|
651
655
|
</tr>
|
|
652
656
|
`;
|
|
653
657
|
});
|
|
@@ -863,11 +867,13 @@ export default class Document extends AccountSystemEntity {
|
|
|
863
867
|
<td class="tm_width_4">
|
|
864
868
|
${documentItem.Description}
|
|
865
869
|
</td>
|
|
866
|
-
<td class="tm_width_2">${documentItem.Currency} ${
|
|
867
|
-
|
|
870
|
+
<td class="tm_width_2">${documentItem.Currency} ${
|
|
871
|
+
documentItem.UnitPrice
|
|
872
|
+
}</td>
|
|
868
873
|
<td class="tm_width_1">${documentItem.Quantity}</td>
|
|
869
|
-
<td class="tm_width_2 tm_text_right">${documentItem.Currency} ${
|
|
870
|
-
|
|
874
|
+
<td class="tm_width_2 tm_text_right">${documentItem.Currency} ${
|
|
875
|
+
+documentItem.UnitPrice * +documentItem.Quantity
|
|
876
|
+
}</td>
|
|
871
877
|
</tr>
|
|
872
878
|
`;
|
|
873
879
|
});
|
|
@@ -1165,7 +1171,8 @@ export default class Document extends AccountSystemEntity {
|
|
|
1165
1171
|
page?: number,
|
|
1166
1172
|
row?: number,
|
|
1167
1173
|
search?: IDocumentFindAll,
|
|
1168
|
-
order?: [string, string][]
|
|
1174
|
+
order?: [string, string][],
|
|
1175
|
+
accountingSystem?: IAccountSystem,
|
|
1169
1176
|
): Promise<{ count: number; rows: DocumentModel[] }> {
|
|
1170
1177
|
try {
|
|
1171
1178
|
const systemCode =
|
|
@@ -1261,10 +1268,52 @@ export default class Document extends AccountSystemEntity {
|
|
|
1261
1268
|
}
|
|
1262
1269
|
|
|
1263
1270
|
/*Retrieve documents from the database with pagination and search filters applied*/
|
|
1264
|
-
|
|
1271
|
+
let documents = await Document._RepositoryBase.findAllWithPagination(
|
|
1265
1272
|
options,
|
|
1266
1273
|
);
|
|
1267
|
-
|
|
1274
|
+
|
|
1275
|
+
let isChangesExit = false;
|
|
1276
|
+
|
|
1277
|
+
for (let i = 0; i < documents?.rows?.length; i++) {
|
|
1278
|
+
const doc = await documents?.rows[i];
|
|
1279
|
+
if (doc.UseAccSystemDocYN.toLowerCase() === 'y') {
|
|
1280
|
+
console.log(doc.UseAccSystemDocYN.toLowerCase());
|
|
1281
|
+
|
|
1282
|
+
if (accountingSystem === null || accountingSystem === undefined) {
|
|
1283
|
+
throw new ClassError(
|
|
1284
|
+
'Document',
|
|
1285
|
+
'DocumentFindAllErrMsg01',
|
|
1286
|
+
`Accounting System is not set`,
|
|
1287
|
+
);
|
|
1288
|
+
}
|
|
1289
|
+
const invoiceStatus = await accountingSystem.getInvoiceStatus(
|
|
1290
|
+
doc.AccSystemRefId,
|
|
1291
|
+
);
|
|
1292
|
+
if (doc.Status !== invoiceStatus) {
|
|
1293
|
+
doc.Status = invoiceStatus;
|
|
1294
|
+
await this._RepositoryBase.update(
|
|
1295
|
+
{
|
|
1296
|
+
Status: invoiceStatus,
|
|
1297
|
+
},
|
|
1298
|
+
{
|
|
1299
|
+
where: {
|
|
1300
|
+
DocNo: doc.DocNo,
|
|
1301
|
+
},
|
|
1302
|
+
transaction: dbTransaction,
|
|
1303
|
+
},
|
|
1304
|
+
);
|
|
1305
|
+
isChangesExit = true;
|
|
1306
|
+
}
|
|
1307
|
+
}
|
|
1308
|
+
}
|
|
1309
|
+
|
|
1310
|
+
if (isChangesExit) {
|
|
1311
|
+
documents = await Document._RepositoryBase.findAllWithPagination(
|
|
1312
|
+
options,
|
|
1313
|
+
);
|
|
1314
|
+
}
|
|
1315
|
+
|
|
1316
|
+
return documents; // make sure the returned data is updated
|
|
1268
1317
|
} catch (error) {
|
|
1269
1318
|
throw error;
|
|
1270
1319
|
}
|
|
@@ -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
|
+
}
|