taxtank-core 0.28.11 → 0.28.14

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 (162) hide show
  1. package/bundles/taxtank-core.umd.js +1800 -1534
  2. package/bundles/taxtank-core.umd.js.map +1 -1
  3. package/esm2015/lib/collections/collection-dictionary.js +5 -2
  4. package/esm2015/lib/collections/sole/sole-invoice-item.collection.js +7 -0
  5. package/esm2015/lib/db/Enums/chart-accounts-list.enum.js +3 -1
  6. package/esm2015/lib/db/Enums/document-type.enum.js +5 -0
  7. package/esm2015/lib/db/Enums/index.js +3 -0
  8. package/esm2015/lib/db/Enums/sole-invoice-tax-type.enum.js +7 -0
  9. package/esm2015/lib/db/Enums/sole-invoice-template-tax-type.enum.js +4 -4
  10. package/esm2015/lib/db/Models/sole/sole-invoice-item.js +1 -1
  11. package/esm2015/lib/db/Models/sole/sole-invoice.js +1 -1
  12. package/esm2015/lib/forms/bank/bank-account/bank-account-add-manual.form.js +10 -6
  13. package/esm2015/lib/forms/bank/bank-account/bank-account-allocation.form.js +5 -4
  14. package/esm2015/lib/forms/sole/sole-business.form.js +21 -2
  15. package/esm2015/lib/forms/sole/sole-invoice-item.form.js +3 -31
  16. package/esm2015/lib/forms/sole/sole-invoice-template.form.js +4 -5
  17. package/esm2015/lib/forms/sole/sole-invoice.form.js +93 -18
  18. package/esm2015/lib/interceptors/basiq-client-id.interceptor.js +3 -3
  19. package/esm2015/lib/interceptors/basiq-token.interceptor.js +3 -3
  20. package/esm2015/lib/interceptors/corelogic-interceptor.js +3 -3
  21. package/esm2015/lib/interceptors/financial-year-interceptor.js +3 -3
  22. package/esm2015/lib/interceptors/interceptors.module.js +4 -4
  23. package/esm2015/lib/interceptors/jwt-interceptor.js +3 -3
  24. package/esm2015/lib/interceptors/preloader.interceptor.js +3 -3
  25. package/esm2015/lib/interceptors/user-switcher-interceptor.js +3 -3
  26. package/esm2015/lib/models/dictionary/dictionary.js +2 -2
  27. package/esm2015/lib/models/document/index.js +3 -0
  28. package/esm2015/lib/models/income-source/income-source.js +3 -3
  29. package/esm2015/lib/models/index.js +2 -1
  30. package/esm2015/lib/models/sole/sole-details.js +1 -3
  31. package/esm2015/lib/models/sole/sole-invoice-item.js +10 -2
  32. package/esm2015/lib/models/sole/sole-invoice-template.js +13 -10
  33. package/esm2015/lib/models/sole/sole-invoice.js +82 -28
  34. package/esm2015/lib/services/account-setup/account-setup.service.js +3 -3
  35. package/esm2015/lib/services/affiliate/rewardful/rewardful.service.js +3 -3
  36. package/esm2015/lib/services/asset/assets.service.js +3 -3
  37. package/esm2015/lib/services/auth/auth.service.js +3 -3
  38. package/esm2015/lib/services/auth/jwt.service.js +3 -3
  39. package/esm2015/lib/services/bank/bank-account-calculation.service.js +3 -3
  40. package/esm2015/lib/services/bank/bank-transaction-calculation.service.js +3 -3
  41. package/esm2015/lib/services/event/event-dispatcher.service.js +3 -3
  42. package/esm2015/lib/services/event/sse.service.js +3 -3
  43. package/esm2015/lib/services/export/export-formatter.service.js +3 -3
  44. package/esm2015/lib/services/header-title/header-title.service.js +3 -3
  45. package/esm2015/lib/services/http/address/address.service.js +3 -3
  46. package/esm2015/lib/services/http/bank/bank-account/bank-account.service.js +3 -3
  47. package/esm2015/lib/services/http/bank/bank-connection/bank-connection.service.js +3 -3
  48. package/esm2015/lib/services/http/bank/bank-transaction/bank-transaction.service.js +3 -3
  49. package/esm2015/lib/services/http/bank/bank.service.js +3 -3
  50. package/esm2015/lib/services/http/bank/basiq/basiq-token.service.js +3 -3
  51. package/esm2015/lib/services/http/bank/basiq/basiq.service.js +3 -3
  52. package/esm2015/lib/services/http/chart-accounts/chart-accounts-depreciations/chart-accounts-depreciations.service.js +3 -3
  53. package/esm2015/lib/services/http/chart-accounts/chart-accounts.service.js +3 -3
  54. package/esm2015/lib/services/http/chat/chat.service.js +3 -3
  55. package/esm2015/lib/services/http/chat/message/message.service.js +3 -3
  56. package/esm2015/lib/services/http/chat/message-document/message-document.service.js +3 -3
  57. package/esm2015/lib/services/http/depreciation/depreciation-capital-project/depreciation-capital-project.service.js +3 -3
  58. package/esm2015/lib/services/http/depreciation/depreciation-receipt/depreciation-receipt.service.js +3 -3
  59. package/esm2015/lib/services/http/depreciation/depreciation.service.js +3 -3
  60. package/esm2015/lib/services/http/document/document-folder/document-folder.service.js +4 -4
  61. package/esm2015/lib/services/http/document/document.service.js +20 -0
  62. package/esm2015/lib/services/http/document/index.js +3 -0
  63. package/esm2015/lib/services/http/facebook/facebook.service.js +3 -3
  64. package/esm2015/lib/services/http/firm/client-income/client-income-types.service.js +3 -3
  65. package/esm2015/lib/services/http/firm/client-invite/client-invite.service.js +3 -3
  66. package/esm2015/lib/services/http/firm/client-movement/client-movement.service.js +3 -3
  67. package/esm2015/lib/services/http/firm/employee/employee.service.js +3 -3
  68. package/esm2015/lib/services/http/firm/employee-invite/employee-invite.service.js +3 -3
  69. package/esm2015/lib/services/http/firm/firm.service.js +3 -3
  70. package/esm2015/lib/services/http/firm/portfolio-report/client-portfolio-report.service.js +3 -3
  71. package/esm2015/lib/services/http/income-source/income-source-forecast/income-source-forecast.service.js +3 -3
  72. package/esm2015/lib/services/http/income-source/income-source.service.js +5 -4
  73. package/esm2015/lib/services/http/income-source/salary-forecast/salary-forecast.service.js +3 -3
  74. package/esm2015/lib/services/http/income-source/sole-forecast/sole-forecast.service.js +3 -3
  75. package/esm2015/lib/services/http/index.js +2 -1
  76. package/esm2015/lib/services/http/loan/borrowing-expense/borrowing-expense.service.js +3 -3
  77. package/esm2015/lib/services/http/loan/loan.service.js +3 -3
  78. package/esm2015/lib/services/http/property/property-category/property-category.service.js +3 -3
  79. package/esm2015/lib/services/http/property/property-category-movement/property-category-movement.service.js +3 -3
  80. package/esm2015/lib/services/http/property/property-document/property-document.service.js +3 -3
  81. package/esm2015/lib/services/http/property/property-sale/property-sale.service.js +3 -3
  82. package/esm2015/lib/services/http/property/property-sale/tax-exemption/tax-exemption.service.js +3 -3
  83. package/esm2015/lib/services/http/property/property-share/property-share.service.js +3 -3
  84. package/esm2015/lib/services/http/property/property.service.js +3 -3
  85. package/esm2015/lib/services/http/receipt/receipt.service.js +3 -3
  86. package/esm2015/lib/services/http/rest/rest.service.js +26 -10
  87. package/esm2015/lib/services/http/service-notification/service-notification.service.js +3 -3
  88. package/esm2015/lib/services/http/sole/sole-business/sole-business.service.js +3 -3
  89. package/esm2015/lib/services/http/sole/sole-business-activity/sole-business-activity.service.js +3 -3
  90. package/esm2015/lib/services/http/sole/sole-business-loss/sole-business-loss.service.js +3 -3
  91. package/esm2015/lib/services/http/sole/sole-contact/sole-contact.service.js +3 -3
  92. package/esm2015/lib/services/http/sole/sole-depreciation-method/sole-depreciation-method.service.js +3 -3
  93. package/esm2015/lib/services/http/sole/sole-details/sole-details.service.js +3 -3
  94. package/esm2015/lib/services/http/sole/sole-invoice/sole-invoice.service.js +18 -4
  95. package/esm2015/lib/services/http/sole/sole-invoice-template/sole-invoice-template.service.js +3 -3
  96. package/esm2015/lib/services/http/subscription/service-price.service.js +3 -3
  97. package/esm2015/lib/services/http/subscription/subscription.service.js +3 -3
  98. package/esm2015/lib/services/http/tax-review/tax-review-history/tax-review-history.service.js +3 -3
  99. package/esm2015/lib/services/http/tax-review/tax-review.service.js +3 -3
  100. package/esm2015/lib/services/http/tax-summary/tax-summary.service.js +3 -3
  101. package/esm2015/lib/services/http/transaction/transaction-allocation/transaction-allocation.service.js +3 -3
  102. package/esm2015/lib/services/http/transaction/transaction-receipt/transaction-receipt.service.js +3 -3
  103. package/esm2015/lib/services/http/transaction/transaction.service.js +3 -3
  104. package/esm2015/lib/services/http/tutorial-video/tutorial-video.service.js +3 -3
  105. package/esm2015/lib/services/http/user/occupation/occupation.service.js +3 -3
  106. package/esm2015/lib/services/http/user/user-event-setting/user-event-setting.service.js +3 -3
  107. package/esm2015/lib/services/http/user/user-event-type/user-event-type.service.js +3 -3
  108. package/esm2015/lib/services/http/user/user.service.js +3 -3
  109. package/esm2015/lib/services/http/user/users-invite/users-invite.service.js +3 -3
  110. package/esm2015/lib/services/http/vehicle/vehicle-claim-details.service.js +3 -3
  111. package/esm2015/lib/services/http/vehicle/vehicle-claim.service.js +3 -3
  112. package/esm2015/lib/services/http/vehicle/vehicle-logbook.service.js +3 -3
  113. package/esm2015/lib/services/http/vehicle/vehicle.service.js +3 -3
  114. package/esm2015/lib/services/intercom/intercom.service.js +3 -3
  115. package/esm2015/lib/services/kompassify/kompassify.service.js +3 -3
  116. package/esm2015/lib/services/pdf/pdf-from-dom-element/pdf-from-dom-element.service.js +20 -8
  117. package/esm2015/lib/services/pdf/pdf-from-table/pdf-from-data-table/pdf-from-data-table.service.js +3 -3
  118. package/esm2015/lib/services/pdf/pdf-from-table/pdf-from-html-table/pdf-from-html-table.service.js +3 -3
  119. package/esm2015/lib/services/pdf/pdf-from-table/pdf-from-table.service.js +3 -3
  120. package/esm2015/lib/services/preloader/preloader.service.js +3 -3
  121. package/esm2015/lib/services/property/corelogic/corelogic.service.js +3 -3
  122. package/esm2015/lib/services/property/equity-position-chart/equity-position-chart.service.js +3 -3
  123. package/esm2015/lib/services/property/property-calculation/property-calculation.service.js +3 -3
  124. package/esm2015/lib/services/report/property/property-transaction-report.service.js +3 -3
  125. package/esm2015/lib/services/toast/toast.service.js +3 -3
  126. package/esm2015/lib/services/transaction/transaction-calculation.service.js +16 -4
  127. package/esm2015/lib/services/user/user-switcher.service.js +3 -3
  128. package/esm2015/lib/services/vehicle/logbook-best-period.service.js +3 -3
  129. package/esm2015/lib/services/xlsx/xlsx.service.js +3 -3
  130. package/esm2015/lib/tt-core.module.js +4 -4
  131. package/esm2015/public-api.js +3 -2
  132. package/fesm2015/taxtank-core.js +1476 -1257
  133. package/fesm2015/taxtank-core.js.map +1 -1
  134. package/lib/collections/sole/sole-invoice-item.collection.d.ts +5 -0
  135. package/lib/db/Enums/chart-accounts-list.enum.d.ts +3 -1
  136. package/lib/db/Enums/document-type.enum.d.ts +3 -0
  137. package/lib/db/Enums/index.d.ts +1 -0
  138. package/lib/db/Enums/sole-invoice-tax-type.enum.d.ts +5 -0
  139. package/lib/db/Enums/sole-invoice-template-tax-type.enum.d.ts +3 -3
  140. package/lib/db/Models/sole/sole-invoice-item.d.ts +3 -1
  141. package/lib/db/Models/sole/sole-invoice.d.ts +8 -5
  142. package/lib/forms/bank/bank-account/bank-account-add-manual.form.d.ts +3 -1
  143. package/lib/forms/bank/bank-account/bank-account-allocation.form.d.ts +4 -1
  144. package/lib/forms/sole/sole-business.form.d.ts +10 -1
  145. package/lib/forms/sole/sole-invoice-item.form.d.ts +2 -7
  146. package/lib/forms/sole/sole-invoice-template.form.d.ts +2 -3
  147. package/lib/forms/sole/sole-invoice.form.d.ts +19 -2
  148. package/lib/models/document/index.d.ts +2 -0
  149. package/lib/models/index.d.ts +1 -0
  150. package/lib/models/sole/sole-details.d.ts +0 -2
  151. package/lib/models/sole/sole-invoice-item.d.ts +7 -1
  152. package/lib/models/sole/sole-invoice-template.d.ts +10 -3
  153. package/lib/models/sole/sole-invoice.d.ts +49 -5
  154. package/lib/services/http/document/document.service.d.ts +10 -0
  155. package/lib/services/http/document/index.d.ts +2 -0
  156. package/lib/services/http/index.d.ts +1 -0
  157. package/lib/services/http/rest/rest.service.d.ts +13 -4
  158. package/lib/services/http/sole/sole-invoice/sole-invoice.service.d.ts +6 -1
  159. package/lib/services/pdf/pdf-from-dom-element/pdf-from-dom-element.service.d.ts +5 -1
  160. package/lib/services/transaction/transaction-calculation.service.d.ts +6 -0
  161. package/package.json +1 -1
  162. package/public-api.d.ts +2 -1
@@ -0,0 +1,5 @@
1
+ import { Collection } from '../collection';
2
+ import { SoleInvoiceItem } from '../../models';
3
+ export declare class SoleInvoiceItemCollection extends Collection<SoleInvoiceItem> {
4
+ get gstPrice(): number;
5
+ }
@@ -52,5 +52,7 @@ export declare enum ChartAccountsListEnum {
52
52
  FORESTRY_MANAGED_INVESTMENT_SCHEMES_DEDUCTION = 593,
53
53
  ASSESSABLE_AMOUNT_CAPPED_DEFINED_BENEFIT = 639,
54
54
  CODE_B_SUPERANNUATION_INCOME_STREAMS_DISABILITY = 558,
55
- CODE_A_SUPERANNUATION_INCOME_STREAMS_DEATH = 640
55
+ CODE_A_SUPERANNUATION_INCOME_STREAMS_DEATH = 640,
56
+ PERSONAL_EXPENSES = 628,
57
+ PERSONAL_INCOME = 630
56
58
  }
@@ -0,0 +1,3 @@
1
+ export declare enum DocumentTypeEnum {
2
+ INVOICE = 1
3
+ }
@@ -0,0 +1 @@
1
+ export * from './document-type.enum';
@@ -0,0 +1,5 @@
1
+ export declare enum SoleInvoiceTaxTypeEnum {
2
+ TAX_EXCLUSIVE = 0,
3
+ TAX_INCLUSIVE = 1,
4
+ NO_TAX = 2
5
+ }
@@ -1,5 +1,5 @@
1
1
  export declare enum SoleInvoiceTemplateTaxTypeEnum {
2
- EXCLUSIVE = 0,
3
- INCLUSIVE = 1,
4
- NONE = 2
2
+ TAX_EXCLUSIVE = 0,
3
+ TAX_INCLUSIVE = 1,
4
+ NO_TAX = 2
5
5
  }
@@ -1,12 +1,14 @@
1
1
  import { SoleInvoice } from './sole-invoice';
2
2
  import { ChartAccounts } from '../chart-accounts/chart-accounts';
3
3
  import { AbstractModel } from '../abstract-model';
4
+ import { Transaction } from '../transaction/transaction';
4
5
  export declare class SoleInvoiceItem extends AbstractModel {
6
+ isGST?: boolean;
5
7
  description?: string;
6
8
  quantity?: number;
7
9
  price?: number;
8
10
  id?: number;
9
- isGST?: boolean;
10
11
  invoice?: SoleInvoice;
11
12
  chartAccounts?: ChartAccounts;
13
+ transaction?: Transaction;
12
14
  }
@@ -1,19 +1,22 @@
1
1
  import { User } from '../user/user';
2
- import { SoleBusiness } from './sole-business';
3
2
  import { SoleInvoiceItem } from './sole-invoice-item';
4
3
  import { SoleContact } from './sole-contact';
5
- import { SoleInvoiceTemplate } from './sole-invoice-template';
6
4
  import { AbstractModel } from '../abstract-model';
7
5
  import { SoleInvoiceStatusesEnum } from '../../Enums/sole-invoice-statuses.enum';
6
+ import { SoleInvoiceTaxTypeEnum } from '../../Enums/sole-invoice-tax-type.enum';
7
+ import { SoleBusiness } from './sole-business';
8
+ import { BankAccount } from '../bank/bank-account';
8
9
  export declare class SoleInvoice extends AbstractModel {
9
- number?: string;
10
+ status?: SoleInvoiceStatusesEnum;
11
+ number?: number;
12
+ reference?: string;
10
13
  dateFrom?: Date;
11
14
  dateTo?: Date;
15
+ taxType?: SoleInvoiceTaxTypeEnum;
12
16
  id?: number;
13
- status?: SoleInvoiceStatusesEnum;
14
17
  user?: User;
15
18
  business?: SoleBusiness;
16
19
  items?: SoleInvoiceItem[];
17
20
  payer?: SoleContact;
18
- template?: SoleInvoiceTemplate;
21
+ bankAccount?: BankAccount;
19
22
  }
@@ -1,13 +1,15 @@
1
1
  import { BankAccount } from '../../../models/bank/bank-account';
2
2
  import { BankConnection } from '../../../models/bank/bank-connection';
3
3
  import { BankAccountAllocationForm } from './bank-account-allocation.form';
4
+ import { IEventListener } from '../../../interfaces/event-listener.interface';
4
5
  /**
5
6
  * Form is using for single manual bank account creation (not Basiq)
6
7
  */
7
- export declare class BankAccountAddManualForm extends BankAccountAllocationForm {
8
+ export declare class BankAccountAddManualForm extends BankAccountAllocationForm implements IEventListener {
8
9
  private connection;
9
10
  static accountNumberPattern: string;
10
11
  constructor(connection: BankConnection);
12
+ listenEvents(): void;
11
13
  /**
12
14
  * Add/Remove loan form depends on selected bank account type
13
15
  */
@@ -1,9 +1,12 @@
1
1
  import { AbstractForm } from '../../abstract.form';
2
2
  import { BankAccount } from '../../../models/bank/bank-account';
3
+ import { AbstractControl } from '@angular/forms';
3
4
  import { IEventListener } from '../../../interfaces/event-listener.interface';
4
5
  export declare class BankAccountAllocationForm extends AbstractForm<BankAccount> implements IEventListener {
5
6
  private bankAccount?;
6
- constructor(bankAccount?: BankAccount);
7
+ constructor(bankAccount?: BankAccount, controls?: {
8
+ [key: string]: AbstractControl;
9
+ });
7
10
  listenEvents(): void;
8
11
  listenTankTypeChanges(): void;
9
12
  }
@@ -1,8 +1,17 @@
1
1
  import { AbstractForm } from '../abstract.form';
2
2
  import { SoleBusiness } from '../../models';
3
3
  import { FormGroup } from '@angular/forms';
4
- export declare class SoleBusinessForm extends AbstractForm<SoleBusiness> {
4
+ import { IEventListener } from '../../interfaces/event-listener.interface';
5
+ export declare class SoleBusinessForm extends AbstractForm<SoleBusiness> implements IEventListener {
5
6
  constructor(business?: SoleBusiness);
7
+ listenEvents(): void;
8
+ /**
9
+ * We take the first forecast because income sources available only for new business, so we have only one forecast
10
+ */
6
11
  get forecastFormGroup(): FormGroup;
12
+ /**
13
+ * We take the first loss because losses available only for new business, so we have only one loss
14
+ */
7
15
  get lossFormGroup(): FormGroup;
16
+ private listenNameChanges;
8
17
  }
@@ -1,10 +1,5 @@
1
1
  import { AbstractForm } from '../abstract.form';
2
- import { SoleInvoiceItem, SoleInvoiceTemplate } from '../../models';
3
- import { IEventListener } from '../../interfaces/event-listener.interface';
4
- export declare class SoleInvoiceItemForm extends AbstractForm<SoleInvoiceItem> implements IEventListener {
5
- private template;
2
+ import { SoleInvoiceItem } from '../../models';
3
+ export declare class SoleInvoiceItemForm extends AbstractForm<SoleInvoiceItem> {
6
4
  constructor(item: SoleInvoiceItem);
7
- listenEvents(): void;
8
- onTemplateChanged(template: SoleInvoiceTemplate): void;
9
- private listenChartAccountsChanges;
10
5
  }
@@ -1,6 +1,5 @@
1
1
  import { AbstractForm } from '../abstract.form';
2
- import { SoleDetails, SoleInvoiceTemplate } from '../../models';
2
+ import { SoleInvoiceTemplate } from '../../models';
3
3
  export declare class SoleInvoiceTemplateForm extends AbstractForm<SoleInvoiceTemplate> {
4
- private soleDetails;
5
- constructor(invoiceTemplate: SoleInvoiceTemplate, soleDetails: SoleDetails);
4
+ constructor(invoiceTemplate: SoleInvoiceTemplate);
6
5
  }
@@ -3,12 +3,29 @@ import { SoleInvoice } from '../../models';
3
3
  import { FormArray } from '@angular/forms';
4
4
  import { IEventListener } from '../../interfaces/event-listener.interface';
5
5
  export declare class SoleInvoiceForm extends AbstractForm<SoleInvoice> implements IEventListener {
6
- constructor(invoice: SoleInvoice);
6
+ private soleDetailsGST;
7
+ constructor(invoice: SoleInvoice, soleDetailsGST: boolean);
7
8
  get items(): FormArray;
8
9
  listenEvents(): void;
9
10
  addItem(): void;
10
11
  removeItem(index: number): void;
11
12
  submit(data?: object): SoleInvoice;
13
+ /**
14
+ * Update default values from selected invoice template
15
+ */
12
16
  private listenTemplateChanges;
13
- private updateItemsForm;
17
+ /**
18
+ * GST is not available for items when invoice.taxType === NONE
19
+ */
20
+ private listenTaxTypeChanges;
21
+ /**
22
+ * GST availability depends of chart accounts isGST flag
23
+ */
24
+ private listenItemChartAccountsChanges;
25
+ private disableItemGST;
26
+ /**
27
+ * Enable GST field for passed item form. Value is always true by default because only case when this field is enabled is
28
+ * when ChartAccounts.isGST === true, so we just use default value from chartAccounts.isGST
29
+ */
30
+ private enableItemGST;
14
31
  }
@@ -0,0 +1,2 @@
1
+ export * from './document';
2
+ export * from './document-folder';
@@ -1,2 +1,3 @@
1
1
  export * from './sole';
2
2
  export * from './vehicle';
3
+ export * from './document';
@@ -1,7 +1,5 @@
1
1
  import { SoleDetails as SoleDetailsBase } from '../../db/Models/sole/sole-details';
2
2
  import { User } from '../user/user';
3
3
  export declare class SoleDetails extends SoleDetailsBase {
4
- static GSTPercentMultiplier: number;
5
- static GSTPercentDivider: number;
6
4
  user: User;
7
5
  }
@@ -1,9 +1,15 @@
1
1
  import { SoleInvoiceItem as SoleInvoiceItemBase } from '../../db/Models/sole/sole-invoice-item';
2
2
  import { SoleInvoice } from './sole-invoice';
3
3
  import { ChartAccounts } from '../chart-accounts/chart-accounts';
4
+ import { Transaction } from '../transaction/transaction';
4
5
  export declare class SoleInvoiceItem extends SoleInvoiceItemBase {
6
+ /**
7
+ * GST percent value
8
+ */
9
+ static GSTRatio: number;
5
10
  invoice: SoleInvoice;
6
11
  chartAccounts: ChartAccounts;
12
+ transaction: Transaction;
7
13
  isGST: boolean;
8
- get amount(): number;
14
+ get totalPrice(): number;
9
15
  }
@@ -5,8 +5,15 @@ import { SoleInvoiceTemplateTaxTypeEnum } from '../../db/Enums/sole-invoice-temp
5
5
  export declare class SoleInvoiceTemplate extends SoleInvoiceTemplateBase {
6
6
  business: SoleBusiness;
7
7
  bankAccount: BankAccount;
8
+ /**
9
+ * Affects to SoleInvoiceItem.isGST flag availability.
10
+ * When NONE: isGST is unavailable
11
+ * When EXCLUSIVE: GST amount added additionaly to invoice total price
12
+ * When INCLUSIVE: GST amount is already included to invoice total price
13
+ */
8
14
  taxType: SoleInvoiceTemplateTaxTypeEnum;
9
- isNoTax(): boolean;
10
- isTaxExclusive(): boolean;
11
- isTaxInclusive(): boolean;
15
+ /**
16
+ * Get term duration in milliseconds
17
+ */
18
+ get termTime(): number;
12
19
  }
@@ -5,7 +5,11 @@ import { SoleInvoiceItem } from './sole-invoice-item';
5
5
  import { SoleContact } from './sole-contact';
6
6
  import { SoleInvoiceTemplate } from './sole-invoice-template';
7
7
  import { SoleInvoiceStatusesEnum } from '../../db/Enums/sole-invoice-statuses.enum';
8
+ import { BankAccount } from '../bank/bank-account';
9
+ import { SoleInvoiceTaxTypeEnum } from '../../db/Enums/sole-invoice-tax-type.enum';
10
+ import { SoleInvoiceItemCollection } from '../../collections/sole/sole-invoice-item.collection';
8
11
  export declare class SoleInvoice extends SoleInvoiceBase {
12
+ static NUMBER_LENGTH: number;
9
13
  dateFrom: Date;
10
14
  dateTo: Date;
11
15
  user: User;
@@ -13,17 +17,57 @@ export declare class SoleInvoice extends SoleInvoiceBase {
13
17
  items: SoleInvoiceItem[];
14
18
  payer: SoleContact;
15
19
  template: SoleInvoiceTemplate;
20
+ bankAccount: BankAccount;
16
21
  status: SoleInvoiceStatusesEnum;
17
- get amount(): number;
18
- getGSTItems(): SoleInvoiceItem[];
19
- getGSTItemsAmount(): number;
20
- get subtotal(): number;
22
+ taxType: SoleInvoiceTaxTypeEnum;
23
+ /**
24
+ * Get items array as collection
25
+ */
26
+ get itemsCollection(): SoleInvoiceItemCollection;
27
+ /**
28
+ * Total price of all items
29
+ */
30
+ private get price();
31
+ /**
32
+ * Total invoice price without GST
33
+ */
34
+ get netPrice(): number;
35
+ /**
36
+ * Total final price (net + GST)
37
+ */
38
+ get grossPrice(): number;
39
+ /**
40
+ * Total GST amount
41
+ */
21
42
  get GSTAmount(): number;
22
- get total(): number;
43
+ /**
44
+ * When tax inclusive, GST amount is included to total price
45
+ */
46
+ private get inclusiveGSTAmount();
47
+ /**
48
+ * When tax exclusive, GST amount should be added additionally to total price
49
+ */
50
+ private get exclusiveGSTAmount();
23
51
  isDraft(): boolean;
24
52
  isCancelled(): boolean;
25
53
  isPending(): boolean;
26
54
  isPaid(): boolean;
27
55
  isOverdue(): boolean;
28
56
  isUnpaid(): boolean;
57
+ /**
58
+ * GST is not available for invoices without taxes
59
+ */
60
+ isNoTax(): boolean;
61
+ /**
62
+ * GST amount is not included in items prices for invoices with tax exclusive,
63
+ * we should add GST amount additionaly to subtotal price to get total price
64
+ */
65
+ isTaxExclusive(): boolean;
66
+ /**
67
+ * GST amount already included in items prices for invoices with tax inclusive,
68
+ * we should subtract GST amount from total price to get subtotal price
69
+ */
70
+ isTaxInclusive(): boolean;
71
+ getNumber(): string;
72
+ get name(): string;
29
73
  }
@@ -0,0 +1,10 @@
1
+ import { Document as DocumentBase } from '../../../db/Models/document/document';
2
+ import { Document } from '../../../models';
3
+ import { RestService } from '../rest/rest.service';
4
+ import * as i0 from "@angular/core";
5
+ export declare class DocumentService extends RestService<DocumentBase, Document> {
6
+ url: string;
7
+ modelClass: typeof Document;
8
+ static ɵfac: i0.ɵɵFactoryDeclaration<DocumentService, never>;
9
+ static ɵprov: i0.ɵɵInjectableDeclaration<DocumentService>;
10
+ }
@@ -0,0 +1,2 @@
1
+ export * from './document.service';
2
+ export * from './document-folder/document-folder.service';
@@ -1,3 +1,4 @@
1
1
  export * from './sole';
2
2
  export * from './vehicle';
3
3
  export * from './user';
4
+ export * from './document';
@@ -44,28 +44,37 @@ export declare abstract class RestService<BaseModel, Model extends BaseModel> im
44
44
  find(id: number): Model;
45
45
  /**
46
46
  * add new instance and update cache
47
- * @TODO rename to post
47
+ */
48
+ private create;
49
+ /**
50
+ * @TODO Alex TT-1777 rename to post
48
51
  */
49
52
  add(model: Model, shouldUpdateCache?: boolean): Observable<Model>;
53
+ /**
54
+ * @TODO Alex TT-1777 rename to upload
55
+ */
56
+ postForm(file: File, params?: {
57
+ [key: string]: string;
58
+ }): Observable<Model>;
50
59
  /**
51
60
  * Add several new items
52
61
  * @param models Array of new items for saving
53
62
  * @param queryParams query parameters for request
54
- * @TODO rename to postBatch
63
+ * @TODO Alex TT-1777 rename to postBatch
55
64
  */
56
65
  addBatch(models: Model[], queryParams?: object): Observable<Model[]>;
57
66
  /**
58
67
  * Update item
59
68
  * @param model Existing instance for updating
60
69
  * @param queryParams query parameters for request
61
- * @TODO rename to put
70
+ * @TODO Alex TT-1777 rename to put
62
71
  */
63
72
  update(model: Model, queryParams?: object): Observable<Model>;
64
73
  /**
65
74
  * Update several items
66
75
  * @param models Array of items for updating
67
76
  * @param queryParams query parameters for request
68
- * TODO rename to putBatch
77
+ * TODO Alex TT-1777 rename to putBatch
69
78
  */
70
79
  updateBatch(models: Model[], queryParams?: object): Observable<Model[]>;
71
80
  /**
@@ -1,11 +1,16 @@
1
1
  import { RestService } from '../../rest/rest.service';
2
2
  import { SoleInvoice as SoleInvoiceBase } from '../../../../db/Models/sole/sole-invoice';
3
- import { SoleInvoice } from '../../../../models';
3
+ import { SoleInvoice, Document } from '../../../../models';
4
+ import { SoleInvoiceStatusesEnum } from '../../../../db/Enums/sole-invoice-statuses.enum';
5
+ import { Observable } from 'rxjs';
4
6
  import * as i0 from "@angular/core";
5
7
  export declare class SoleInvoiceService extends RestService<SoleInvoiceBase, SoleInvoice> {
6
8
  modelClass: typeof SoleInvoice;
7
9
  url: string;
8
10
  isHydra: boolean;
11
+ updateStatus(invoice: SoleInvoice, status: SoleInvoiceStatusesEnum): Observable<SoleInvoice>;
12
+ publish(invoice: SoleInvoice, document: Document): Observable<SoleInvoice>;
13
+ sendEmail(invoice: SoleInvoice): Observable<Object>;
9
14
  static ɵfac: i0.ɵɵFactoryDeclaration<SoleInvoiceService, never>;
10
15
  static ɵprov: i0.ɵɵInjectableDeclaration<SoleInvoiceService>;
11
16
  }
@@ -2,12 +2,16 @@ import { PdfSettings } from '../../../models/pdf/pdf-settings';
2
2
  import { Observable } from 'rxjs';
3
3
  import * as i0 from "@angular/core";
4
4
  /**
5
+ * @TODO mikhail better typehint
6
+ *
5
7
  * Service to generate and export PDF file from provided HTML elements
6
8
  * The file is generated using the html2pdf library in order to get a canvas at the output,
7
9
  * in which all the styles that the user sees on the page will be saved
8
10
  */
9
11
  export declare class PdfFromDomElementService {
10
- export(elements: NodeListOf<HTMLElement>, fileSettings: PdfSettings): Observable<unknown>;
12
+ private init;
13
+ download(elements: NodeListOf<HTMLElement>, fileSettings?: PdfSettings): Observable<unknown>;
14
+ export(elements: NodeListOf<HTMLElement>, filename?: string): Observable<unknown>;
11
15
  static ɵfac: i0.ɵɵFactoryDeclaration<PdfFromDomElementService, never>;
12
16
  static ɵprov: i0.ɵɵInjectableDeclaration<PdfFromDomElementService>;
13
17
  }
@@ -1,6 +1,8 @@
1
1
  import { TransactionAllocationCollection } from '../../collections/transaction/transaction-allocation.collection';
2
2
  import { TransactionCollection } from '../../collections/transaction/transaction.collection';
3
3
  import { Transaction } from '../../models/transaction/transaction';
4
+ import { Dictionary } from '../../models/dictionary/dictionary';
5
+ import { SoleInvoiceCollection } from '../../collections';
4
6
  import * as i0 from "@angular/core";
5
7
  /**
6
8
  * @TODO move to collection
@@ -24,6 +26,10 @@ export declare class TransactionCalculationService {
24
26
  * @TODO Alex: consider to move to collection
25
27
  */
26
28
  getUnallocatedTransactions(transactions: TransactionCollection, allocations: TransactionAllocationCollection): TransactionCollection;
29
+ /**
30
+ * Get invoices allocated amounts grouped bu invoice id
31
+ */
32
+ getAllocationsAmountsByInvoiceId(allocations: TransactionAllocationCollection, invoices: SoleInvoiceCollection): Dictionary<number>;
27
33
  static ɵfac: i0.ɵɵFactoryDeclaration<TransactionCalculationService, never>;
28
34
  static ɵprov: i0.ɵɵInjectableDeclaration<TransactionCalculationService>;
29
35
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taxtank-core",
3
- "version": "0.28.11",
3
+ "version": "0.28.14",
4
4
  "private": false,
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^12.2.3 || ~13.0.0",
package/public-api.d.ts CHANGED
@@ -49,6 +49,7 @@ export * from './lib/models/chart-accounts/chart-accounts-category.e-collection'
49
49
  /**
50
50
  * DB enums
51
51
  */
52
+ export * from './lib/db/Enums';
52
53
  export * from './lib/db/Enums/address-type.enum';
53
54
  export * from './lib/db/Enums/bank-account-status.enum';
54
55
  export * from './lib/db/Enums/bank-account-type.enum';
@@ -101,6 +102,7 @@ export * from './lib/db/Enums/service-notification-status.enum';
101
102
  export * from './lib/db/Enums/service-notification-type.enum';
102
103
  export * from './lib/db/Enums/sole-depreciation-method.enum';
103
104
  export * from './lib/db/Enums/sole-invoice-statuses.enum';
105
+ export * from './lib/db/Enums/sole-invoice-tax-type.enum';
104
106
  export * from './lib/db/Enums/sole-invoice-template-tax-type.enum';
105
107
  export * from './lib/db/Enums/subscription/service-payment-status.enum';
106
108
  export * from './lib/db/Enums/subscription/service-price-recurring-interval.enum';
@@ -309,7 +311,6 @@ export * from './lib/services/http/firm/client-movement/client-movement.service'
309
311
  export * from './lib/services/http/firm/portfolio-report/client-portfolio-report.service';
310
312
  export * from './lib/services/http/firm/portfolio-report/client-portfolio-report.service';
311
313
  export * from './lib/services/http/depreciation';
312
- export * from './lib/services/http/document/document-folder/document-folder.service';
313
314
  export * from './lib/services/http/firm/employee/employee.service';
314
315
  export * from './lib/services/http/firm/employee-invite/employee-invite.service';
315
316
  export * from './lib/services/http/firm/client-income/client-income-types.service';