@bisondesk/core-sdk 1.0.680 → 1.0.682
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/lib/apis/exchange-rates.d.ts +3 -0
- package/lib/apis/exchange-rates.d.ts.map +1 -1
- package/lib/apis/exchange-rates.js +29 -0
- package/lib/apis/exchange-rates.js.map +1 -1
- package/lib/types/intercompany-payments.d.ts.map +1 -1
- package/lib/types/intercompany-payments.js.map +1 -1
- package/lib/types/offers.d.ts +2 -1
- package/lib/types/offers.d.ts.map +1 -1
- package/lib/types/offers.js.map +1 -1
- package/lib/types/opportunities.d.ts +8 -0
- package/lib/types/opportunities.d.ts.map +1 -1
- package/lib/types/opportunities.js.map +1 -1
- package/lib/types/opportunity-payments.d.ts +9 -0
- package/lib/types/opportunity-payments.d.ts.map +1 -1
- package/lib/types/opportunity-payments.js.map +1 -1
- package/lib/types/tenants.d.ts +1 -0
- package/lib/types/tenants.d.ts.map +1 -1
- package/lib/types/tenants.js.map +1 -1
- package/lib/types/vehicle-purchase-payments.d.ts +23 -1
- package/lib/types/vehicle-purchase-payments.d.ts.map +1 -1
- package/lib/types/vehicle-purchase-payments.js +6 -0
- package/lib/types/vehicle-purchase-payments.js.map +1 -1
- package/lib/types/vehicles.d.ts +7 -0
- package/lib/types/vehicles.d.ts.map +1 -1
- package/lib/types/vehicles.js.map +1 -1
- package/lib/utils/opportunity-payments.d.ts +3 -0
- package/lib/utils/opportunity-payments.d.ts.map +1 -0
- package/lib/utils/opportunity-payments.js +5 -0
- package/lib/utils/opportunity-payments.js.map +1 -0
- package/lib/utils/opportunity-payments.test.d.ts +2 -0
- package/lib/utils/opportunity-payments.test.d.ts.map +1 -0
- package/lib/utils/opportunity-payments.test.js +23 -0
- package/lib/utils/opportunity-payments.test.js.map +1 -0
- package/lib/utils/tenants.d.ts +3 -0
- package/lib/utils/tenants.d.ts.map +1 -1
- package/lib/utils/tenants.js +3 -0
- package/lib/utils/tenants.js.map +1 -1
- package/lib/utils/tenants.test.js +27 -1
- package/lib/utils/tenants.test.js.map +1 -1
- package/package.json +1 -1
- package/src/apis/exchange-rates.ts +49 -0
- package/src/types/activities.js +13 -0
- package/src/types/activities.js.map +1 -0
- package/src/types/comparables.js +2 -0
- package/src/types/comparables.js.map +1 -0
- package/src/types/crm.js +58 -0
- package/src/types/crm.js.map +1 -0
- package/src/types/dashboard.js +2 -0
- package/src/types/dashboard.js.map +1 -0
- package/src/types/definitions.js +2 -0
- package/src/types/definitions.js.map +1 -0
- package/src/types/fields.js +2 -0
- package/src/types/fields.js.map +1 -0
- package/src/types/insights.js +2 -0
- package/src/types/insights.js.map +1 -0
- package/src/types/intercompany-payments.ts +4 -3
- package/src/types/interests.js +6 -0
- package/src/types/interests.js.map +1 -0
- package/src/types/internal-events.js +18 -0
- package/src/types/internal-events.js.map +1 -0
- package/src/types/internet-opportunities.js +2 -0
- package/src/types/internet-opportunities.js.map +1 -0
- package/src/types/internet-vehicles.js +2 -0
- package/src/types/internet-vehicles.js.map +1 -0
- package/src/types/leasing-administration.js +2 -0
- package/src/types/leasing-administration.js.map +1 -0
- package/src/types/leasing-debtors.js +2 -0
- package/src/types/leasing-debtors.js.map +1 -0
- package/src/types/leasing-search.js +2 -0
- package/src/types/leasing-search.js.map +1 -0
- package/src/types/leasing-settings.js +7 -0
- package/src/types/leasing-settings.js.map +1 -0
- package/src/types/leasing.js +38 -0
- package/src/types/leasing.js.map +1 -0
- package/src/types/marketing.js +35 -0
- package/src/types/marketing.js.map +1 -0
- package/src/types/offers.js +56 -0
- package/src/types/offers.ts +2 -0
- package/src/types/opportunities.js +107 -0
- package/src/types/opportunities.js.map +1 -0
- package/src/types/opportunities.ts +15 -0
- package/src/types/opportunity-payments.ts +23 -0
- package/src/types/payments.js +7 -0
- package/src/types/picklists.js +2 -0
- package/src/types/picklists.js.map +1 -0
- package/src/types/quotes.js +42 -0
- package/src/types/recently-viewed.js +2 -0
- package/src/types/recently-viewed.js.map +1 -0
- package/src/types/reservations.js +5 -0
- package/src/types/reservations.js.map +1 -0
- package/src/types/roi-ratings.js +5 -0
- package/src/types/roi-ratings.js.map +1 -0
- package/src/types/saved-filters.js +9 -0
- package/src/types/saved-filters.js.map +1 -0
- package/src/types/search.js +2 -0
- package/src/types/search.js.map +1 -0
- package/src/types/settings.js +2 -0
- package/src/types/settings.js.map +1 -0
- package/src/types/templates.js +2 -0
- package/src/types/templates.js.map +1 -0
- package/src/types/tenants.js +21 -0
- package/src/types/tenants.js.map +1 -0
- package/src/types/tenants.ts +6 -0
- package/src/types/user-performance.js +7 -0
- package/src/types/user-performance.js.map +1 -0
- package/src/types/utils.js +2 -0
- package/src/types/validation.js +2 -0
- package/src/types/validation.js.map +1 -0
- package/src/types/vehicle-purchase-payments.ts +52 -6
- package/src/types/vehicle-sales.js +6 -0
- package/src/types/vehicle-sales.js.map +1 -0
- package/src/types/vehicles.js +98 -0
- package/src/types/vehicles.js.map +1 -0
- package/src/types/vehicles.ts +15 -1
- package/src/utils/leasing.js +6 -0
- package/src/utils/leasing.js.map +1 -0
- package/src/utils/opportunities.js +48 -0
- package/src/utils/opportunities.js.map +1 -0
- package/src/utils/opportunity-payments.test.ts +31 -0
- package/src/utils/opportunity-payments.ts +15 -0
- package/src/utils/tenants.test.ts +39 -1
- package/src/utils/tenants.ts +17 -0
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { UTCDate } from '@date-fns/utc';
|
|
2
|
+
import { format } from 'date-fns';
|
|
3
|
+
import { last, map, sortBy, uniqBy } from 'lodash-es';
|
|
4
|
+
export const sortContractClients = (clients) => sortBy(map(uniqBy(clients, (c) => c.takeoverId), (c) => ({ ...c, since: format(new UTCDate(c.since), 'yyyy-MM-dd') })), (cli) => cli.since, (cli) => (cli.takeoverId ? parseInt(cli.takeoverId.replace(/[^0-9]/g, '')) : 0));
|
|
5
|
+
export const getDealRef = ({ conditions, opportunities, }) => last(conditions) ?? last(opportunities);
|
|
6
|
+
//# sourceMappingURL=leasing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"leasing.js","sourceRoot":"","sources":["leasing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAStD,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,OAAgC,EAA2B,EAAE,CAC/F,MAAM,CACJ,GAAG,CACD,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,EACpC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,YAAY,CAAC,EAAE,CAAC,CACrE,EACD,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,EAClB,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAChF,CAAC;AAEJ,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EACzB,UAAU,EACV,aAAa,GACyC,EAAkC,EAAE,CAC1F,IAAI,CAAC,UAAU,CAAC,IAAI,IAAI,CAAC,aAAa,CAAE,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { OpportunityStatus, OpportunityStatusOrder } from '../types/opportunities.js';
|
|
2
|
+
const compareOpportunityStatus = (input) => {
|
|
3
|
+
const { currentStatus, referenceStatus } = input;
|
|
4
|
+
const currentStatusIdx = OpportunityStatusOrder.indexOf(currentStatus);
|
|
5
|
+
const referenceStatusIdx = OpportunityStatusOrder.indexOf(referenceStatus);
|
|
6
|
+
return {
|
|
7
|
+
currentStatusIdx,
|
|
8
|
+
referenceStatusIdx,
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export const getPreviousStatus = (currentStatus) => {
|
|
12
|
+
const currentIndex = OpportunityStatusOrder.indexOf(currentStatus);
|
|
13
|
+
if (currentIndex === 0) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
return OpportunityStatusOrder[currentIndex - 1];
|
|
17
|
+
};
|
|
18
|
+
export const getNextStatus = (status) => {
|
|
19
|
+
const statusIndex = OpportunityStatusOrder.indexOf(status);
|
|
20
|
+
if (statusIndex >= OpportunityStatusOrder.length - 1) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
return OpportunityStatusOrder[statusIndex + 1];
|
|
24
|
+
};
|
|
25
|
+
export const isSameOrAfterReferenceOpportunityStatus = (input) => {
|
|
26
|
+
const { currentStatusIdx, referenceStatusIdx } = compareOpportunityStatus(input);
|
|
27
|
+
return currentStatusIdx >= referenceStatusIdx;
|
|
28
|
+
};
|
|
29
|
+
export const isAfterReferenceOpportunityStatus = (input) => {
|
|
30
|
+
const { currentStatusIdx, referenceStatusIdx } = compareOpportunityStatus(input);
|
|
31
|
+
return currentStatusIdx > referenceStatusIdx;
|
|
32
|
+
};
|
|
33
|
+
export const isSameOrBeforeReferenceOpportunityStatus = (input) => {
|
|
34
|
+
const { currentStatusIdx, referenceStatusIdx } = compareOpportunityStatus(input);
|
|
35
|
+
return currentStatusIdx <= referenceStatusIdx;
|
|
36
|
+
};
|
|
37
|
+
export const isBeforeReferenceOpportunityStatus = (input) => {
|
|
38
|
+
const { currentStatusIdx, referenceStatusIdx } = compareOpportunityStatus(input);
|
|
39
|
+
return currentStatusIdx < referenceStatusIdx;
|
|
40
|
+
};
|
|
41
|
+
export const isOpportunityLost = (input) => input.lostAt != null;
|
|
42
|
+
export const getOpportunityReservedStatus = () => [
|
|
43
|
+
OpportunityStatus.REVIEW,
|
|
44
|
+
OpportunityStatus.PREPARATION,
|
|
45
|
+
OpportunityStatus.DELIVERY,
|
|
46
|
+
];
|
|
47
|
+
export const isOpportunityReserved = (input) => getOpportunityReservedStatus().includes(input.status);
|
|
48
|
+
//# sourceMappingURL=opportunities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opportunities.js","sourceRoot":"","sources":["opportunities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAOnG,MAAM,wBAAwB,GAAG,CAAC,KAAmB,EAAE,EAAE;IACvD,MAAM,EAAE,aAAa,EAAE,eAAe,EAAE,GAAG,KAAK,CAAC;IAEjD,MAAM,gBAAgB,GAAG,sBAAsB,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IACvE,MAAM,kBAAkB,GAAG,sBAAsB,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;IAE3E,OAAO;QACL,gBAAgB;QAChB,kBAAkB;KACnB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,aAAgC,EACD,EAAE;IACjC,MAAM,YAAY,GAAG,sBAAsB,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IACnE,IAAI,YAAY,KAAK,CAAC,EAAE,CAAC;QACvB,OAAO;IACT,CAAC;IACD,OAAO,sBAAsB,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC;AAClD,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,MAAyB,EAAiC,EAAE;IACxF,MAAM,WAAW,GAAG,sBAAsB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAC3D,IAAI,WAAW,IAAI,sBAAsB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACrD,OAAO;IACT,CAAC;IACD,OAAO,sBAAsB,CAAC,WAAW,GAAG,CAAC,CAAC,CAAC;AACjD,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,uCAAuC,GAAG,CAAC,KAAmB,EAAW,EAAE;IACtF,MAAM,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,GAAG,wBAAwB,CAAC,KAAK,CAAC,CAAC;IAEjF,OAAO,gBAAgB,IAAI,kBAAkB,CAAC;AAChD,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,KAAmB,EAAW,EAAE;IAChF,MAAM,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,GAAG,wBAAwB,CAAC,KAAK,CAAC,CAAC;IAEjF,OAAO,gBAAgB,GAAG,kBAAkB,CAAC;AAC/C,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,wCAAwC,GAAG,CAAC,KAAmB,EAAW,EAAE;IACvF,MAAM,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,GAAG,wBAAwB,CAAC,KAAK,CAAC,CAAC;IAEjF,OAAO,gBAAgB,IAAI,kBAAkB,CAAC;AAChD,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC,KAAmB,EAAW,EAAE;IACjF,MAAM,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,GAAG,wBAAwB,CAAC,KAAK,CAAC,CAAC;IAEjF,OAAO,gBAAgB,GAAG,kBAAkB,CAAC;AAC/C,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,KAAkB,EAAW,EAAE,CAAC,KAAK,CAAC,MAAM,IAAI,IAAI,CAAC;AAEvF,MAAM,CAAC,MAAM,4BAA4B,GAAG,GAAwB,EAAE,CAAC;IACrE,iBAAiB,CAAC,MAAM;IACxB,iBAAiB,CAAC,WAAW;IAC7B,iBAAiB,CAAC,QAAQ;CAC3B,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,KAAkB,EAAW,EAAE,CACnE,4BAA4B,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { OpportunityPayment } from '../types/opportunity-payments.js';
|
|
2
|
+
import { isPaidInAlternativeCurrency } from './opportunity-payments.js';
|
|
3
|
+
|
|
4
|
+
const dollarPayment: Pick<OpportunityPayment, 'foreign' | 'deletedAt'> = {
|
|
5
|
+
foreign: { amount: '30000', currencyCode: 'USD', exchangeRate: '0.861804' },
|
|
6
|
+
};
|
|
7
|
+
const euroPayment: Pick<OpportunityPayment, 'foreign' | 'deletedAt'> = {};
|
|
8
|
+
|
|
9
|
+
describe('isPaidInAlternativeCurrency', () => {
|
|
10
|
+
it('shows the alternative currency before any payment arrived', () => {
|
|
11
|
+
expect(isPaidInAlternativeCurrency('USD', [])).toBe(true);
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
it('shows the alternative currency while every payment arrived in it', () => {
|
|
15
|
+
expect(isPaidInAlternativeCurrency('USD', [dollarPayment, dollarPayment])).toBe(true);
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('switches to branch currency once one payment arrived in branch currency', () => {
|
|
19
|
+
expect(isPaidInAlternativeCurrency('USD', [dollarPayment, euroPayment])).toBe(false);
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('leaves deleted payments out', () => {
|
|
23
|
+
expect(
|
|
24
|
+
isPaidInAlternativeCurrency('USD', [dollarPayment, { deletedAt: '2026-09-30T10:00:00Z' }]),
|
|
25
|
+
).toBe(true);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it('shows branch currency when the quote has no alternative currency', () => {
|
|
29
|
+
expect(isPaidInAlternativeCurrency(undefined, [dollarPayment])).toBe(false);
|
|
30
|
+
});
|
|
31
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { OpportunityPayment } from '../types/opportunity-payments.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Whether a deal's payments are shown in the quote's alternative currency: every payment so far
|
|
5
|
+
* arrived in it. One payment in branch currency switches the deal to branch currency, because
|
|
6
|
+
* only the branch currency amounts then add up to the whole.
|
|
7
|
+
*/
|
|
8
|
+
export const isPaidInAlternativeCurrency = (
|
|
9
|
+
alternativeCurrency: string | undefined,
|
|
10
|
+
payments: Pick<OpportunityPayment, 'foreign' | 'deletedAt'>[],
|
|
11
|
+
): boolean =>
|
|
12
|
+
alternativeCurrency != null &&
|
|
13
|
+
payments
|
|
14
|
+
.filter((payment) => payment.deletedAt == null)
|
|
15
|
+
.every((payment) => payment.foreign?.currencyCode === alternativeCurrency);
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { Branch, Tenant } from '../types/tenants.js';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
areBranchesQuoteCompatible,
|
|
4
|
+
getBranchAskingVies,
|
|
5
|
+
getBranchPaymentCurrencies,
|
|
6
|
+
hasForeignPaymentCurrency,
|
|
7
|
+
isForeignPaymentCurrency,
|
|
8
|
+
} from './tenants.js';
|
|
3
9
|
|
|
4
10
|
const createBranch = (override?: Partial<Branch>): Branch => ({
|
|
5
11
|
id: 'TTC',
|
|
@@ -65,3 +71,35 @@ describe('getBranchAskingVies', () => {
|
|
|
65
71
|
expect(getBranchAskingVies(tenantOf([bolivia]), 'BO')).toBeUndefined();
|
|
66
72
|
});
|
|
67
73
|
});
|
|
74
|
+
|
|
75
|
+
describe('payment currencies of a branch', () => {
|
|
76
|
+
const southAmerica = createBranch({
|
|
77
|
+
id: 'HPA South America',
|
|
78
|
+
paymentCurrencies: ['EUR', 'USD'],
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
test('a branch without a list is paid in its own currency only', () => {
|
|
82
|
+
expect(getBranchPaymentCurrencies(createBranch())).toEqual(['EUR']);
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
test('a branch with a list is paid in the currencies it lists', () => {
|
|
86
|
+
expect(getBranchPaymentCurrencies(southAmerica)).toEqual(['EUR', 'USD']);
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
test.each([
|
|
90
|
+
['a listed currency other than its own', 'USD', true],
|
|
91
|
+
['its own currency', 'EUR', false],
|
|
92
|
+
['a currency it does not list', 'BOB', false],
|
|
93
|
+
])('%s is a foreign payment currency: %s', (_label, currencyCode, expected) => {
|
|
94
|
+
expect(isForeignPaymentCurrency(southAmerica, currencyCode)).toBe(expected);
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
test('a branch without a list has no foreign payment currency', () => {
|
|
98
|
+
expect(isForeignPaymentCurrency(createBranch(), 'USD')).toBe(false);
|
|
99
|
+
expect(hasForeignPaymentCurrency(createBranch())).toBe(false);
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
test('a branch listing another currency has a foreign payment currency', () => {
|
|
103
|
+
expect(hasForeignPaymentCurrency(southAmerica)).toBe(true);
|
|
104
|
+
});
|
|
105
|
+
});
|
package/src/utils/tenants.ts
CHANGED
|
@@ -24,6 +24,23 @@ export const getBranchAskingVies = (tenant: Tenant, branchId?: string): Branch |
|
|
|
24
24
|
return europeanBranches.find((branch) => branch.id === branchId) ?? europeanBranches.at(0);
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
+
/** The currencies money moves in at the branch, its own currency included. */
|
|
28
|
+
export const getBranchPaymentCurrencies = (branch: Branch): string[] =>
|
|
29
|
+
branch.paymentCurrencies ?? [branch.currency];
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Whether the branch can be paid, price a purchase or receive a supplier invoice in a currency
|
|
33
|
+
* other than its own. Its own currency is never a foreign one.
|
|
34
|
+
*/
|
|
35
|
+
export const isForeignPaymentCurrency = (branch: Branch, currencyCode: string): boolean =>
|
|
36
|
+
currencyCode !== branch.currency && getBranchPaymentCurrencies(branch).includes(currencyCode);
|
|
37
|
+
|
|
38
|
+
/** Whether the branch lists any payment currency other than its own. */
|
|
39
|
+
export const hasForeignPaymentCurrency = (branch: Branch): boolean =>
|
|
40
|
+
getBranchPaymentCurrencies(branch).some((currencyCode) =>
|
|
41
|
+
isForeignPaymentCurrency(branch, currencyCode),
|
|
42
|
+
);
|
|
43
|
+
|
|
27
44
|
/** The source invoices the end customer directly; this branch collects payment and earns
|
|
28
45
|
* commission (see {@link Branch.dropshipping}). */
|
|
29
46
|
export const isDropshippingBranch = (branch: Branch): boolean => branch.dropshipping === true;
|