taxtank-core 0.30.70 → 0.30.72
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/esm2020/lib/forms/sole/sole-invoice-item.form.mjs +3 -9
- package/esm2020/lib/forms/sole/sole-invoice.form.mjs +2 -2
- package/esm2020/lib/services/http/bank/basiq/basiq.service.mjs +4 -3
- package/fesm2015/taxtank-core.mjs +6 -11
- package/fesm2015/taxtank-core.mjs.map +1 -1
- package/fesm2020/taxtank-core.mjs +6 -11
- package/fesm2020/taxtank-core.mjs.map +1 -1
- package/lib/forms/sole/sole-invoice-item.form.d.ts +1 -1
- package/lib/services/http/bank/basiq/basiq.service.d.ts +3 -2
- package/package.json +1 -1
|
@@ -10027,11 +10027,12 @@ class BasiqService extends RestService$1 {
|
|
|
10027
10027
|
}
|
|
10028
10028
|
/**
|
|
10029
10029
|
* Open basiq consent ui to allow user to log in to bank
|
|
10030
|
+
* More info: https://api.basiq.io/docs/consent-ui
|
|
10030
10031
|
* @param token User's basiq token
|
|
10031
10032
|
* @param bankId External id of selected bank
|
|
10032
|
-
* @param action 'connect' -
|
|
10033
|
+
* @param action 'connect' - create a new connection when consent already signed, null - user have to sign consent first
|
|
10033
10034
|
*/
|
|
10034
|
-
redirectToBasiqConsent(token, bankId, action =
|
|
10035
|
+
redirectToBasiqConsent(token, bankId, action = 'connect') {
|
|
10035
10036
|
// keep bank id because we need it after redirect from basiq
|
|
10036
10037
|
localStorage.setItem('basiqBankId', bankId);
|
|
10037
10038
|
window.location.replace(`${BasiqService.basiqConsentUrl}?token=${token}&institutionId=${bankId}${action ? '&action=' + action : ''}`);
|
|
@@ -18335,21 +18336,15 @@ class SoleDetailsForm extends AbstractForm {
|
|
|
18335
18336
|
}
|
|
18336
18337
|
|
|
18337
18338
|
class SoleInvoiceItemForm extends AbstractForm {
|
|
18338
|
-
constructor(item,
|
|
18339
|
+
constructor(item, isExpense) {
|
|
18339
18340
|
super({
|
|
18340
|
-
|
|
18341
|
+
isExpense: new UntypedFormControl(isExpense),
|
|
18341
18342
|
description: new UntypedFormControl(item.description, [Validators.required, Validators.maxLength(SoleInvoiceItemForm.maxDescriptionLength)]),
|
|
18342
18343
|
quantity: new UntypedFormControl(item.quantity, Validators.required),
|
|
18343
18344
|
price: new UntypedFormControl(item.price, Validators.required),
|
|
18344
18345
|
isGST: new UntypedFormControl({ value: item.isGST || false, disabled: !item.chartAccounts?.isGST }),
|
|
18345
18346
|
chartAccounts: new UntypedFormControl(item.chartAccounts, Validators.required),
|
|
18346
18347
|
}, item);
|
|
18347
|
-
this.get('price').valueChanges.subscribe((value) => {
|
|
18348
|
-
// expense should be negative
|
|
18349
|
-
if (!this.get('isIncome').value && value > 0) {
|
|
18350
|
-
this.get('price').setValue(-value);
|
|
18351
|
-
}
|
|
18352
|
-
});
|
|
18353
18348
|
}
|
|
18354
18349
|
}
|
|
18355
18350
|
SoleInvoiceItemForm.maxDescriptionLength = 255;
|
|
@@ -18372,7 +18367,7 @@ class SoleInvoiceForm extends AbstractForm {
|
|
|
18372
18367
|
reference: new UntypedFormControl(invoice.reference)
|
|
18373
18368
|
}),
|
|
18374
18369
|
items: new UntypedFormArray((invoice.items || [plainToClass(SoleInvoiceItem, {})])
|
|
18375
|
-
.map((item) => new SoleInvoiceItemForm(item, item.chartAccounts?.
|
|
18370
|
+
.map((item) => new SoleInvoiceItemForm(item, item.chartAccounts?.isExpense() ?? false))),
|
|
18376
18371
|
}, invoice);
|
|
18377
18372
|
this.invoice = invoice;
|
|
18378
18373
|
this.soleDetailsGST = soleDetailsGST;
|