asv-hlps-market 1.0.0 → 1.0.1

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 (89) hide show
  1. package/package.json +1 -1
  2. package/lib/cjs/bills/bill.d.ts +0 -19
  3. package/lib/cjs/bills/bill.js +0 -79
  4. package/lib/cjs/bills/models/Bill.d.ts +0 -21
  5. package/lib/cjs/bills/models/Bill.js +0 -2
  6. package/lib/cjs/models/Gender.d.ts +0 -6
  7. package/lib/cjs/models/Gender.js +0 -2
  8. package/lib/cjs/models/Sale.d.ts +0 -34
  9. package/lib/cjs/models/Sale.js +0 -2
  10. package/lib/cjs/models/SaleProduct.d.ts +0 -18
  11. package/lib/cjs/models/SaleProduct.js +0 -6
  12. package/lib/cjs/models/Ste.d.ts +0 -8
  13. package/lib/cjs/models/Ste.js +0 -2
  14. package/lib/cjs/models/SteGrp.d.ts +0 -7
  15. package/lib/cjs/models/SteGrp.js +0 -2
  16. package/lib/cjs/models/Titr.d.ts +0 -5
  17. package/lib/cjs/models/Titr.js +0 -2
  18. package/lib/cjs/models/User.d.ts +0 -38
  19. package/lib/cjs/models/User.js +0 -2
  20. package/lib/cjs/models/UserGrp.d.ts +0 -4
  21. package/lib/cjs/models/UserGrp.js +0 -2
  22. package/lib/cjs/models/UserRole.d.ts +0 -5
  23. package/lib/cjs/models/UserRole.js +0 -2
  24. package/lib/cjs/models/shared/NaAc.d.ts +0 -6
  25. package/lib/cjs/models/shared/NaAc.js +0 -2
  26. package/lib/cjs/models/shared/NaCoAc.d.ts +0 -4
  27. package/lib/cjs/models/shared/NaCoAc.js +0 -2
  28. package/lib/cjs/models/shared/NaCoShortAc.d.ts +0 -4
  29. package/lib/cjs/models/shared/NaCoShortAc.js +0 -2
  30. package/lib/cjs/pdfs/invoices/amountInvoice.d.ts +0 -66
  31. package/lib/cjs/pdfs/invoices/amountInvoice.js +0 -144
  32. package/lib/cjs/pdfs/invoices/infoInvoice.d.ts +0 -32
  33. package/lib/cjs/pdfs/invoices/infoInvoice.js +0 -80
  34. package/lib/cjs/pdfs/tools/tools.d.ts +0 -34
  35. package/lib/cjs/pdfs/tools/tools.js +0 -53
  36. package/lib/cjs/products/interfaces/Product.d.ts +0 -53
  37. package/lib/cjs/products/interfaces/Product.js +0 -2
  38. package/lib/cjs/products/interfaces/ProductCat.d.ts +0 -6
  39. package/lib/cjs/products/interfaces/ProductCat.js +0 -2
  40. package/lib/cjs/products/interfaces/ProductStore.d.ts +0 -24
  41. package/lib/cjs/products/interfaces/ProductStore.js +0 -2
  42. package/lib/cjs/products/product.d.ts +0 -3
  43. package/lib/cjs/products/product.js +0 -22
  44. package/lib/cjs/sales/sale.d.ts +0 -18
  45. package/lib/cjs/sales/sale.js +0 -129
  46. package/lib/esm/bills/bill.d.ts +0 -19
  47. package/lib/esm/bills/bill.js +0 -58
  48. package/lib/esm/bills/models/Bill.d.ts +0 -21
  49. package/lib/esm/bills/models/Bill.js +0 -1
  50. package/lib/esm/models/Gender.d.ts +0 -6
  51. package/lib/esm/models/Gender.js +0 -1
  52. package/lib/esm/models/Sale.d.ts +0 -34
  53. package/lib/esm/models/Sale.js +0 -1
  54. package/lib/esm/models/SaleProduct.d.ts +0 -18
  55. package/lib/esm/models/SaleProduct.js +0 -2
  56. package/lib/esm/models/Ste.d.ts +0 -8
  57. package/lib/esm/models/Ste.js +0 -1
  58. package/lib/esm/models/SteGrp.d.ts +0 -7
  59. package/lib/esm/models/SteGrp.js +0 -1
  60. package/lib/esm/models/Titr.d.ts +0 -5
  61. package/lib/esm/models/Titr.js +0 -1
  62. package/lib/esm/models/User.d.ts +0 -38
  63. package/lib/esm/models/User.js +0 -1
  64. package/lib/esm/models/UserGrp.d.ts +0 -4
  65. package/lib/esm/models/UserGrp.js +0 -1
  66. package/lib/esm/models/UserRole.d.ts +0 -5
  67. package/lib/esm/models/UserRole.js +0 -1
  68. package/lib/esm/models/shared/NaAc.d.ts +0 -6
  69. package/lib/esm/models/shared/NaAc.js +0 -1
  70. package/lib/esm/models/shared/NaCoAc.d.ts +0 -4
  71. package/lib/esm/models/shared/NaCoAc.js +0 -1
  72. package/lib/esm/models/shared/NaCoShortAc.d.ts +0 -4
  73. package/lib/esm/models/shared/NaCoShortAc.js +0 -1
  74. package/lib/esm/pdfs/invoices/amountInvoice.d.ts +0 -66
  75. package/lib/esm/pdfs/invoices/amountInvoice.js +0 -137
  76. package/lib/esm/pdfs/invoices/infoInvoice.d.ts +0 -26
  77. package/lib/esm/pdfs/invoices/infoInvoice.js +0 -75
  78. package/lib/esm/pdfs/tools/tools.d.ts +0 -34
  79. package/lib/esm/pdfs/tools/tools.js +0 -47
  80. package/lib/esm/products/interfaces/Product.d.ts +0 -53
  81. package/lib/esm/products/interfaces/Product.js +0 -1
  82. package/lib/esm/products/interfaces/ProductCat.d.ts +0 -6
  83. package/lib/esm/products/interfaces/ProductCat.js +0 -1
  84. package/lib/esm/products/interfaces/ProductStore.d.ts +0 -24
  85. package/lib/esm/products/interfaces/ProductStore.js +0 -1
  86. package/lib/esm/products/product.d.ts +0 -3
  87. package/lib/esm/products/product.js +0 -17
  88. package/lib/esm/sales/sale.d.ts +0 -19
  89. package/lib/esm/sales/sale.js +0 -112
@@ -1,38 +0,0 @@
1
- import { Gender } from "./Gender";
2
- import { Ste } from "./Ste";
3
- import { Titr } from "./Titr";
4
- import { UserGrp } from "./UserGrp";
5
- import { UserRole } from "./UserRole";
6
- export interface User {
7
- id: number;
8
- codeCompta?: string | number;
9
- firstname?: string;
10
- lastname?: string;
11
- username?: string;
12
- birthday?: Date | string;
13
- password?: string;
14
- approval?: string;
15
- approvalExpDate?: Date;
16
- ip?: string;
17
- isActive?: boolean;
18
- isSpecial?: boolean;
19
- hasBillCredit?: boolean;
20
- isValided?: boolean;
21
- disabled?: boolean;
22
- isBadPayer?: boolean;
23
- isEqeerUser?: boolean;
24
- ifDarkMode?: boolean;
25
- foto?: string;
26
- clp?: string;
27
- periodBill?: string;
28
- limitAmountSaleByMonth?: number;
29
- hasLimitSaleSafe?: boolean;
30
- hasBillSafe?: boolean;
31
- gender?: Gender;
32
- titr?: Titr;
33
- clientId?: number;
34
- grp?: UserGrp;
35
- role?: UserRole;
36
- ste?: Ste;
37
- fullname: string;
38
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,4 +0,0 @@
1
- import { NaCoShortAc } from "./shared/NaCoShortAc";
2
- export interface UserGrp extends NaCoShortAc {
3
- coef?: number;
4
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,5 +0,0 @@
1
- import { NaCoShortAc } from "./shared/NaCoShortAc";
2
- export interface UserRole extends NaCoShortAc {
3
- extern?: boolean;
4
- intern?: boolean;
5
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,6 +0,0 @@
1
- export interface NaAc {
2
- id?: number;
3
- name: string;
4
- isActive?: boolean;
5
- disabled?: boolean;
6
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,4 +0,0 @@
1
- import { NaAc } from './NaAc';
2
- export interface NaCoAc extends NaAc {
3
- code: string;
4
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,4 +0,0 @@
1
- import { NaCoAc } from './NaCoAc';
2
- export interface NaCoShortAc extends NaCoAc {
3
- shortname: string;
4
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,66 +0,0 @@
1
- import { Bill } from "asv-hlps-models";
2
- import { Sale } from "asv-hlps-models";
3
- export declare const infoAmountOnBl: (tob: Sale) => {
4
- width: string;
5
- table: {
6
- headerRows: number;
7
- widths: string[];
8
- heights: number[];
9
- body: ({
10
- text: string;
11
- style: string;
12
- }[] | {
13
- text: string | number;
14
- style: string;
15
- alignment: string;
16
- }[])[];
17
- };
18
- };
19
- export declare const infoAmountOnProforma: (tob: Sale) => {
20
- width: string;
21
- table: {
22
- headerRows: number;
23
- widths: string[];
24
- heights: number[];
25
- body: ({
26
- text: string;
27
- style: string;
28
- }[] | {
29
- text: string | number;
30
- style: string;
31
- alignment: string;
32
- }[])[];
33
- };
34
- };
35
- export declare const infoAmounOntSale: (tob: Sale) => {
36
- width: string;
37
- table: {
38
- headerRows: number;
39
- widths: string[];
40
- heights: number[];
41
- body: ({
42
- text: string;
43
- style: string;
44
- }[] | {
45
- text: string | number;
46
- style: string;
47
- alignment: string;
48
- }[])[];
49
- };
50
- };
51
- export declare const infoAmountOnBill: (tob: Bill) => {
52
- width: string;
53
- table: {
54
- headerRows: number;
55
- widths: string[];
56
- heights: number[];
57
- body: ({
58
- text: string;
59
- style: string;
60
- }[] | {
61
- text: string;
62
- style: string;
63
- alignment: string;
64
- }[])[];
65
- };
66
- };
@@ -1,137 +0,0 @@
1
- import { formatToStringCfa } from "asv-hlps";
2
- import { getTotalAmountAllIncludedOnBill, getTotalAmountTvaOnBill, getTotalAmountWithoutTvaOnBill } from "../../bills/bill";
3
- import { getTotalAmountAllIncludedOnSale, getTotalAmountWithoutTvaOnSale, getTotalShippingOnSale, getTotalTvaOnSale } from '../../sales/sale';
4
- export const infoAmountOnBl = (tob) => {
5
- const totalAmountWithoutTva = (tob.isBack && (tob.backChoice.toLowerCase() === 'autre' || tob.rejectedReason)) ? 0 : formatToStringCfa(getTotalAmountWithoutTvaOnSale(tob, true));
6
- // const totalPort = formatToStringCfa(HlpSale.getTotalShipping(tob));
7
- const totalTva = formatToStringCfa(getTotalTvaOnSale(tob, true));
8
- const totalAmountAllIncluded = (tob.isBack && (tob.backChoice.toLowerCase() === 'autre' || tob.rejectedReason)) ? 0 : formatToStringCfa(getTotalAmountAllIncludedOnSale(tob, true));
9
- const tabFooter = {
10
- width: '50%',
11
- table: {
12
- headerRows: 1,
13
- // widths: [ 100, 100, 100, 100 ],
14
- widths: ['*', '*', '*', '*'],
15
- heights: [6],
16
- body: [
17
- [
18
- { text: 'TOTAL HT', style: 'headerText' },
19
- // {text: 'PORT HT', style: 'headerText'},
20
- { text: 'TOTAL TVA', style: 'headerText' },
21
- { text: 'TOTAL TTC', style: 'headerText' },
22
- { text: 'NET A PAYER', style: 'headerText' }
23
- ],
24
- [
25
- { text: totalAmountWithoutTva, style: 'rowText', alignment: 'center' },
26
- // { text: totalPort, style: 'rowText', alignment: 'center' },
27
- { text: totalTva, style: 'rowText', alignment: 'center' },
28
- { text: totalAmountAllIncluded, style: 'rowText', alignment: 'center' },
29
- { text: totalAmountAllIncluded, style: 'rowText', alignment: 'center' },
30
- ]
31
- ]
32
- }
33
- };
34
- return tabFooter;
35
- };
36
- export const infoAmountOnProforma = (tob) => {
37
- const totalAmountWithoutTva = (tob.isBack && tob.backChoice.toLowerCase() === 'autre') ? 0 : formatToStringCfa(getTotalAmountWithoutTvaOnSale(tob));
38
- // const totalPort = formatToStringCfa(HlpSale.getTotalShipping(tob));
39
- const totalTva = formatToStringCfa(getTotalTvaOnSale(tob));
40
- const totalAmountAllIncluded = (tob.isBack && tob.backChoice.toLowerCase() === 'autre') ? 0 : formatToStringCfa(getTotalAmountAllIncludedOnSale(tob));
41
- const tabFooter = {
42
- width: '50%',
43
- table: {
44
- headerRows: 1,
45
- // widths: [ 100, 100, 100, 100 ],
46
- widths: ['*', '*', '*', '*'],
47
- heights: [6],
48
- body: [
49
- [
50
- { text: 'TOTAL HT', style: 'headerText' },
51
- // {text: 'PORT HT', style: 'headerText'},
52
- { text: 'TOTAL TVA', style: 'headerText' },
53
- { text: 'TOTAL TTC', style: 'headerText' },
54
- { text: 'NET A PAYER', style: 'headerText' }
55
- ],
56
- [
57
- { text: totalAmountWithoutTva, style: 'rowText', alignment: 'center' },
58
- // { text: totalPort, style: 'rowText', alignment: 'center' },
59
- { text: totalTva, style: 'rowText', alignment: 'center' },
60
- { text: totalAmountAllIncluded, style: 'rowText', alignment: 'center' },
61
- { text: totalAmountAllIncluded, style: 'rowText', alignment: 'center' },
62
- ]
63
- ]
64
- }
65
- };
66
- return tabFooter;
67
- };
68
- export const infoAmounOntSale = (tob) => {
69
- const totalAmountWithoutTva = (tob.isBack && (tob.backChoice.toLowerCase() === 'autre' || tob.rejectedReason)) ? 0 : formatToStringCfa(getTotalAmountWithoutTvaOnSale(tob, true));
70
- const totalPort = formatToStringCfa(getTotalShippingOnSale(tob));
71
- const totalTva = formatToStringCfa(getTotalTvaOnSale(tob, true));
72
- const totalAmountAllIncluded = (tob.isBack && (tob.backChoice.toLowerCase() === 'autre' || tob.rejectedReason)) ? 0 : formatToStringCfa(getTotalAmountAllIncludedOnSale(tob, true));
73
- const tabFooter = {
74
- width: '50%',
75
- table: {
76
- headerRows: 1,
77
- // widths: [ 100, 100, 100, 100 ],
78
- widths: ['*', '*', '*', '*', '*'],
79
- heights: [6],
80
- body: [
81
- [
82
- { text: 'TOTAL HT', style: 'headerText' },
83
- { text: 'PORT HT', style: 'headerText' },
84
- { text: 'TOTAL TVA', style: 'headerText' },
85
- { text: 'TOTAL TTC', style: 'headerText' },
86
- { text: 'NET A PAYER', style: 'headerText' }
87
- ],
88
- [
89
- { text: totalAmountWithoutTva, style: 'rowText', alignment: 'center' },
90
- { text: totalPort, style: 'rowText', alignment: 'center' },
91
- { text: totalTva, style: 'rowText', alignment: 'center' },
92
- { text: totalAmountAllIncluded, style: 'rowText', alignment: 'center' },
93
- { text: totalAmountAllIncluded, style: 'rowText', alignment: 'center' },
94
- ]
95
- ]
96
- }
97
- };
98
- return tabFooter;
99
- };
100
- export const infoAmountOnBill = (tob) => {
101
- const totalAmountAllAndBackInclused = getTotalAmountAllIncludedOnBill(tob.sales);
102
- const totalAmountWithoutTvaAllAndBack = getTotalAmountWithoutTvaOnBill(tob.sales);
103
- const totalAmountTvaAllAndBack = getTotalAmountTvaOnBill(tob.sales);
104
- // const totalAmountWithoutTva = formatToStringCfa(HlpSale.getTotalAmountWithoutTvaOnBill(tob.sales));
105
- const totalAmountWithoutTva = formatToStringCfa(totalAmountWithoutTvaAllAndBack);
106
- // const totalPort = formatToStringCfa(HlpSale.getTotalShipping(tob));
107
- const totalTva = formatToStringCfa(totalAmountTvaAllAndBack);
108
- // const totalTva = formatToStringCfa(HlpSale.getTotalAmountTvaOnBill(tob.sales));
109
- // const totalAmountAllIncluded = formatToStringCfa(HlpSale.getTotalAmountOnBill(tob.sales));
110
- const totalAmountAllIncluded = formatToStringCfa(totalAmountAllAndBackInclused);
111
- const tabFooter = {
112
- width: '50%',
113
- table: {
114
- headerRows: 1,
115
- // widths: [ 100, 100, 100, 100 ],
116
- widths: ['*', '*', '*', '*'],
117
- heights: [6],
118
- body: [
119
- [
120
- { text: 'TOTAL HT', style: 'headerText' },
121
- // {text: 'PORT HT', style: 'headerText'},
122
- { text: 'TOTAL TVA', style: 'headerText' },
123
- { text: 'TOTAL TTC', style: 'headerText' },
124
- { text: 'NET A PAYER', style: 'headerText' }
125
- ],
126
- [
127
- { text: totalAmountWithoutTva, style: 'rowText', alignment: 'center' },
128
- // { text: totalPort, style: 'rowText', alignment: 'center' },
129
- { text: totalTva, style: 'rowText', alignment: 'center' },
130
- { text: totalAmountAllIncluded, style: 'rowText', alignment: 'center' },
131
- { text: totalAmountAllIncluded, style: 'rowText', alignment: 'center' },
132
- ]
133
- ]
134
- }
135
- };
136
- return tabFooter;
137
- };
@@ -1,26 +0,0 @@
1
- import { Bill } from 'asv-hlps-models';
2
- import { Sale } from "asv-hlps-models";
3
- export declare const infoSale: (tob: Sale) => {
4
- width: string;
5
- table: {
6
- headerRows: number;
7
- widths: (string | number)[];
8
- heights: number[];
9
- body: {
10
- text: any;
11
- style: string;
12
- }[][];
13
- };
14
- };
15
- export declare const infoBill: (tob: Bill) => {
16
- width: string;
17
- table: {
18
- headerRows: number;
19
- widths: (string | number)[];
20
- heights: number[];
21
- body: {
22
- text: any;
23
- style: string;
24
- }[][];
25
- };
26
- };
@@ -1,75 +0,0 @@
1
- import { convertEnDateToFr } from 'asv-hlps';
2
- import { getNbFreezeOnBill, getNbPackagesOnBill, getNbProductsOnBill, getTotalQtityOnBill } from '../../bills/bill';
3
- import { getNbProductsOnSale, getTotalQtityOnSale } from '../../sales/sale';
4
- export const infoSale = (tob) => {
5
- const totalQtity = getTotalQtityOnSale(tob);
6
- const nbProducts = getNbProductsOnSale(tob);
7
- const nbColis = tob.nbPackages;
8
- const nbFreeze = tob.nbFreeze;
9
- // const oWidth = [ '*', '*', 75, 75, 75, 75];
10
- const tabTop = {
11
- width: '50%',
12
- table: {
13
- headerRows: 1,
14
- widths: ['*', '*', 75, 75, 75, 75],
15
- heights: [6],
16
- body: [
17
- [
18
- { text: 'FACTURE N°', style: 'headerText' },
19
- { text: 'DATE', style: 'headerText' },
20
- { text: 'NBRE DE PDTS', style: 'headerText' },
21
- { text: 'QUANTITE TOTALE', style: 'headerText' },
22
- { text: 'NBRE COLIS', style: 'headerText' },
23
- { text: 'NBRE FROID', style: 'headerText' }
24
- ],
25
- [
26
- { text: tob.ref, style: 'rowText' },
27
- // { text: moment(tob.createdAt ).format('DD/MM/YYYY'), style: 'rowText'},
28
- { text: convertEnDateToFr(tob.createdAt, '/'), style: 'rowText' },
29
- { text: nbProducts, style: 'rowText' },
30
- { text: totalQtity, style: 'rowText' },
31
- { text: nbColis, style: 'rowText' },
32
- { text: nbFreeze, style: 'rowText' },
33
- ]
34
- ]
35
- }
36
- };
37
- return tabTop;
38
- };
39
- export const infoBill = (tob) => {
40
- const totalQtity = getTotalQtityOnBill(tob.sales);
41
- const nbProducts = getNbProductsOnBill(tob.sales);
42
- const nbColis = getNbPackagesOnBill(tob.sales);
43
- const nbFreeze = getNbFreezeOnBill(tob.sales);
44
- const oWidth = ['*', '*', 75, 75, 75, 75];
45
- const tabTop = {
46
- width: '50%',
47
- table: {
48
- headerRows: 1,
49
- // widths: [ 125, 125, 125, '*' ],
50
- widths: oWidth,
51
- heights: [6],
52
- // widths: [ '16%', '16%', '16%', '16%' ],
53
- body: [
54
- [
55
- { text: 'FACTURE N°', style: 'headerText' },
56
- { text: 'DATE', style: 'headerText' },
57
- { text: 'NBRE DE PDTS', style: 'headerText' },
58
- { text: 'QUANTITE TOTALE', style: 'headerText' },
59
- { text: 'NBRE COLIS', style: 'headerText' },
60
- { text: 'NBRE FROID', style: 'headerText' }
61
- ],
62
- [
63
- { text: tob.ref, style: 'rowText' },
64
- // { text: moment(tob.createdAt ).format('DD/MM/YYYY'), style: 'rowText'},
65
- { text: convertEnDateToFr(tob.createdAt, '/'), style: 'rowText' },
66
- { text: nbProducts, style: 'rowText' },
67
- { text: totalQtity, style: 'rowText' },
68
- { text: nbColis, style: 'rowText' },
69
- { text: nbFreeze, style: 'rowText' },
70
- ]
71
- ]
72
- }
73
- };
74
- return tabTop;
75
- };
@@ -1,34 +0,0 @@
1
- import { User } from 'asv-hlps-models';
2
- export declare const displayPdfDate: (label: string, fromDate: string, toDate: string) => string;
3
- export declare const displayTitle: (title: string) => {
4
- width: string;
5
- alignment: string;
6
- text: string;
7
- bold: boolean;
8
- margin: number[];
9
- fontSize: number;
10
- };
11
- export declare const displayClient: (user: User) => {
12
- absolutePosition: {
13
- x: number;
14
- y: number;
15
- };
16
- text: ({
17
- text: string;
18
- fontSize: number;
19
- bold?: undefined;
20
- } | {
21
- text: string;
22
- bold: boolean;
23
- fontSize: number;
24
- } | {
25
- text: string;
26
- fontSize?: undefined;
27
- bold?: undefined;
28
- })[];
29
- color: string;
30
- width: string;
31
- fontSize: number;
32
- bold: boolean;
33
- alignment: string;
34
- };
@@ -1,47 +0,0 @@
1
- import { convertEnDateToFr, formatDateYmdHypen, getSteShortname } from "asv-hlps";
2
- export const displayPdfDate = (label, fromDate, toDate) => {
3
- fromDate = (!fromDate) ? formatDateYmdHypen(new Date()) : fromDate;
4
- toDate = (!toDate) ? fromDate : toDate;
5
- return label + ' du ' + convertEnDateToFr(fromDate) + ' au ' + convertEnDateToFr(toDate);
6
- };
7
- export const displayTitle = (title) => {
8
- return {
9
- width: '100%',
10
- alignment: 'center',
11
- text: title,
12
- bold: true,
13
- margin: [0, 10, 0, 10],
14
- fontSize: 15,
15
- };
16
- };
17
- export const displayClient = (user) => {
18
- // const clientSte = user.ste ? HlpUser.getSteShortname(user.ste) : '';
19
- const clientSte = user.ste ? getSteShortname(user.ste, ['pharmacie', 'clinique', 'hopital']) : '';
20
- /* const clientLastname = (user.lastname) ? user.lastname : '';
21
- const clientFirstname = (user.firstname) ? user.firstname : '';
22
- const clientGender = (user.gender) ? user.gender.abr : ''; */
23
- const clientName = user.ste ? clientSte : user.fullname;
24
- const cp = user.cp ? user.cp : '';
25
- const city = user.city ? user.city : '';
26
- const nif = user.ste.nif ? user.ste.nif : '';
27
- const address = user.address ? user.address : '';
28
- const client = {
29
- absolutePosition: { x: 310, y: 30 },
30
- text: [
31
- { text: 'CLIENT: ', fontSize: 8 },
32
- { text: user.username + '\n', bold: true, fontSize: 10 },
33
- { text: clientName + '\n' },
34
- { text: address + ' ' },
35
- { text: cp + '\n' },
36
- { text: city + '\n' },
37
- // {text: nif + '\n'}
38
- ],
39
- color: '#000',
40
- width: 'auto',
41
- fontSize: 12,
42
- bold: true,
43
- alignment: 'left',
44
- // margin: [100, 0, 0, 0],
45
- };
46
- return client;
47
- };
@@ -1,53 +0,0 @@
1
- import { ProductCat } from "./ProductCat";
2
- import { ProductStore } from "./ProductStore";
3
- export interface Product {
4
- id: number;
5
- ref?: string;
6
- designation?: string;
7
- unitPrice?: number;
8
- salePrice?: number;
9
- pght?: number;
10
- pghtPrice?: number;
11
- codeHs?: string;
12
- codeCip?: string;
13
- codeCip7?: string;
14
- codeEan?: string;
15
- condeInam?: string;
16
- codeCompta?: number;
17
- codeAmm?: string;
18
- codeAmmStart?: Date | string;
19
- codeAmmEnd?: Date | string;
20
- pvdPrice?: number;
21
- fees?: number;
22
- profit?: number;
23
- profitPhcie?: number;
24
- publicPrice?: number;
25
- qtityLimit?: number;
26
- stockLimit?: number;
27
- stockMax?: number;
28
- stockReap?: number;
29
- stock?: number;
30
- stockReserved?: number;
31
- stockSalable?: number;
32
- qtityPerPackaging?: number;
33
- qtityPerBox?: number;
34
- promo?: number;
35
- isInOrder?: boolean;
36
- coef?: number;
37
- promoPerQtity?: number;
38
- promoEndAt?: Date;
39
- image?: string;
40
- description?: string;
41
- isActive?: boolean;
42
- tva?: number;
43
- discountRate?: number;
44
- createdAt?: Date;
45
- updatedAt?: Date;
46
- hasPromo?: boolean;
47
- inEqeer?: boolean;
48
- qtityWarning?: boolean;
49
- isPublished?: boolean;
50
- isAvailable?: boolean;
51
- cat?: ProductCat;
52
- stores?: ProductStore[];
53
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,6 +0,0 @@
1
- export interface ProductCat {
2
- id: number;
3
- name: string;
4
- code: string;
5
- isActive: boolean;
6
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,24 +0,0 @@
1
- export interface ProductStore {
2
- id?: number;
3
- name?: string;
4
- qtityLimit?: number;
5
- stockLimit?: number;
6
- stockMax?: number;
7
- stock?: number;
8
- stockReap?: number;
9
- stockReserved?: number;
10
- stockSalable?: number;
11
- fees?: number;
12
- pght?: number;
13
- pvdPrice?: number;
14
- pghtPrice?: number;
15
- costPrice?: number;
16
- salePrice?: number;
17
- profitPhcie?: number;
18
- publicPrice?: number;
19
- isActive?: boolean;
20
- isAvailable?: boolean;
21
- isPublished?: boolean;
22
- hasPromo?: boolean;
23
- discountRate?: number;
24
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,3 +0,0 @@
1
- import { Product, User } from "asv-hlps-models";
2
- export declare const unitPriceByClientCat: (product: Product, client: User, speUnitPrice?: number, addDiscount?: boolean) => number;
3
- export declare const productCatCode: (product: Product, catCodes: string[]) => boolean;
@@ -1,17 +0,0 @@
1
- import { calculPercent, userCoef } from "asv-hlps";
2
- export const unitPriceByClientCat = (product, client, speUnitPrice = 0, addDiscount = false) => {
3
- if (speUnitPrice > 0) {
4
- return speUnitPrice;
5
- }
6
- // const store = await getCustomRepository(ProductStoreRepository).getOneStoreByParams({storeName: 'cpa', productId: product.id})
7
- if (product.stores[0].discountRate && addDiscount) {
8
- return Math.ceil(product.stores[0].salePrice) - Math.ceil(calculPercent(product.stores[0].salePrice, product.stores[0].discountRate));
9
- }
10
- const clientCoef = (!client) ? 1 : userCoef(client);
11
- return (productCatCode(product, ['spe', 'para'])) ?
12
- Math.ceil(product.stores[0].salePrice) :
13
- Math.ceil(product.stores[0].salePrice * clientCoef);
14
- };
15
- export const productCatCode = (product, catCodes) => {
16
- return catCodes.includes(product.cat.code && product.cat.code.toLowerCase());
17
- };
@@ -1,19 +0,0 @@
1
- import { Sale } from "asv-hlps-models";
2
- export declare const getNbProductsOnSale: (sale: Sale) => any;
3
- export declare const getTotalTvaOnSale: (sale: Sale, dlvr?: boolean) => any;
4
- export declare const getSubTotalAmountOnSale: (sale: Sale, dlvr?: boolean) => any;
5
- export declare const getSubTotalAmountBackOnSale: (sale: Sale) => any;
6
- export declare const getTotalAmountWithoutTvaOnSale: (sale: Sale, dlvr?: boolean) => any;
7
- export declare const getTotalAmountWithoutTvaBackOnSale: (sale: Sale) => any;
8
- export declare const getTotalTvaOnSaleOnSale: (sale: Sale, dlvr?: boolean) => any;
9
- export declare const getTotalTvaBackOnSale: (sale: Sale) => any;
10
- export declare const getTotalAmountOnSale: (sale: Sale, dlvr?: boolean) => any;
11
- export declare const getTotalAmountBackOnSale: (sale: Sale) => any;
12
- export declare const getTotalAmountAllIncludedOnSale: (sale: Sale, dlvr?: boolean) => number;
13
- export declare const getTotalShippingOnSale: (sale: Sale) => number;
14
- export declare const getTotalAmountDiscountOnSale: (sale: Sale, dlvr?: boolean) => number;
15
- export declare const getTotalQtityOnSale: (sale: Sale, dlvr?: boolean) => any;
16
- export declare const getTotalQtityFreeOnSale: (sale: Sale) => any;
17
- export declare const getTotalQtityOdrOrDlvrOnSale: (sale: Sale, dlvr?: boolean) => any;
18
- export declare const tabLabel: (sale: Sale) => any[];
19
- export declare const refSaleGenerator: () => string;