asv-hlps 1.4.50 → 1.4.52
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/cjs/comptas/hlpEntry.d.ts +21 -2
- package/lib/cjs/comptas/hlpEntry.js +3 -3
- package/lib/cjs/comptas/models/Entry.d.ts +1 -1
- package/lib/cjs/comptas/models/EntryAccount.d.ts +2 -2
- package/lib/cjs/comptas/models/EntryLine.d.ts +2 -2
- package/lib/cjs/comptas/models/EntryLine.js +1 -0
- package/lib/cjs/comptas/models/index.d.ts +1 -1
- package/lib/cjs/utils.js +4 -0
- package/lib/esm/comptas/hlpEntry.d.ts +21 -2
- package/lib/esm/comptas/hlpEntry.js +3 -3
- package/lib/esm/comptas/models/Entry.d.ts +1 -1
- package/lib/esm/comptas/models/EntryAccount.d.ts +2 -2
- package/lib/esm/comptas/models/EntryLine.d.ts +2 -2
- package/lib/esm/comptas/models/EntryLine.js +1 -0
- package/lib/esm/comptas/models/index.d.ts +1 -1
- package/lib/esm/utils.js +4 -0
- package/package.json +4 -1
|
@@ -1,7 +1,26 @@
|
|
|
1
1
|
import Entry from "./models/Entry";
|
|
2
|
-
import EntryLine from "./models/EntryLine";
|
|
2
|
+
import { EntryLine } from "./models/EntryLine";
|
|
3
3
|
declare class HlpEntry {
|
|
4
|
-
sortAccount: (tobs: EntryLine[], accountDirection: boolean) =>
|
|
4
|
+
sortAccount: (tobs: EntryLine[], accountDirection: boolean) => Partial<{
|
|
5
|
+
id: number;
|
|
6
|
+
createdAt?: Date;
|
|
7
|
+
bill: import("..").Bill;
|
|
8
|
+
amountTva?: number;
|
|
9
|
+
amountProductHt?: number;
|
|
10
|
+
accountTva: number;
|
|
11
|
+
accountClient: number;
|
|
12
|
+
product: import("..").Product;
|
|
13
|
+
client: import("..").User;
|
|
14
|
+
designation: string;
|
|
15
|
+
account?: number;
|
|
16
|
+
accountDebit?: number;
|
|
17
|
+
accountCredit?: number;
|
|
18
|
+
amountDebit: number;
|
|
19
|
+
amountCredit: number;
|
|
20
|
+
isCredit?: boolean;
|
|
21
|
+
isDebit?: boolean;
|
|
22
|
+
lines: EntryLine[];
|
|
23
|
+
}>[];
|
|
5
24
|
amountSold: (tob: any) => number;
|
|
6
25
|
amountSoldDebit: (tob: any) => number;
|
|
7
26
|
amountSoldCredit: (tob: any) => number;
|
|
@@ -47,17 +47,17 @@ class HlpEntry {
|
|
|
47
47
|
// return this.amountSold(tob) >= 0 ? this.amountSold(tob): '' ;
|
|
48
48
|
};
|
|
49
49
|
this.entriesTotalAmountCredit = (entries) => {
|
|
50
|
-
entries.map(
|
|
50
|
+
entries.map(entry => {
|
|
51
51
|
return this.totalAmountCredit(entry.lines);
|
|
52
52
|
});
|
|
53
53
|
};
|
|
54
54
|
this.entriesTotalAmountSold = (entries) => {
|
|
55
|
-
entries.map(
|
|
55
|
+
entries.map(entry => {
|
|
56
56
|
return this.totalAmountSold(entry.lines);
|
|
57
57
|
});
|
|
58
58
|
};
|
|
59
59
|
this.entriesTotalAmountDedit = (entries) => {
|
|
60
|
-
entries.map(
|
|
60
|
+
entries.map(entry => {
|
|
61
61
|
return this.totalAmountDebit(entry.lines);
|
|
62
62
|
});
|
|
63
63
|
};
|
|
@@ -4,7 +4,7 @@ import Spent from "../../cashs/models/Spent";
|
|
|
4
4
|
import Product from "../../products/models/Product";
|
|
5
5
|
import User from "../../users/models/User";
|
|
6
6
|
import EntryCat from "./EntryCat";
|
|
7
|
-
import EntryLine from "./EntryLine";
|
|
7
|
+
import { EntryLine } from "./EntryLine";
|
|
8
8
|
import OhadaCat from "./ohada/OhadaCat";
|
|
9
9
|
export default interface Entry {
|
|
10
10
|
id?: number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Bill from "../../bills/models/Bill";
|
|
2
2
|
import Product from "../../products/models/Product";
|
|
3
3
|
import User from "../../users/models/User";
|
|
4
|
-
export
|
|
4
|
+
export type EntryLine = Partial<{
|
|
5
5
|
id: number;
|
|
6
6
|
createdAt?: Date;
|
|
7
7
|
bill: Bill;
|
|
@@ -20,4 +20,4 @@ export default interface EntryLine {
|
|
|
20
20
|
isCredit?: boolean;
|
|
21
21
|
isDebit?: boolean;
|
|
22
22
|
lines: EntryLine[];
|
|
23
|
-
}
|
|
23
|
+
}>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { default as Entry } from "./Entry";
|
|
2
2
|
export { default as EntryAccount } from "./EntryAccount";
|
|
3
3
|
export { default as EntryCat } from "./EntryCat";
|
|
4
|
-
export {
|
|
4
|
+
export { EntryLine } from "./EntryLine";
|
|
5
5
|
export * from "./ohada";
|
package/lib/cjs/utils.js
CHANGED
|
@@ -11,6 +11,7 @@ const isSameOrBefore_1 = __importDefault(require("dayjs/plugin/isSameOrBefore"))
|
|
|
11
11
|
const relativeTime_1 = __importDefault(require("dayjs/plugin/relativeTime"));
|
|
12
12
|
const weekOfYear_1 = __importDefault(require("dayjs/plugin/weekOfYear"));
|
|
13
13
|
const lodash_1 = __importDefault(require("lodash"));
|
|
14
|
+
const remove_accents_1 = __importDefault(require("remove-accents"));
|
|
14
15
|
require("dayjs/locale/fr");
|
|
15
16
|
dayjs_1.default.extend(relativeTime_1.default);
|
|
16
17
|
dayjs_1.default.extend(isSameOrBefore_1.default);
|
|
@@ -223,6 +224,9 @@ const sequencesToNumbers = (arr) => {
|
|
|
223
224
|
return seqs;
|
|
224
225
|
};
|
|
225
226
|
exports.sequencesToNumbers = sequencesToNumbers;
|
|
227
|
+
const removeAccent = (str) => {
|
|
228
|
+
return (0, remove_accents_1.default)(str);
|
|
229
|
+
};
|
|
226
230
|
const findSequencesMissing = (arr) => {
|
|
227
231
|
const seqs = [];
|
|
228
232
|
for (const item of arr) {
|
|
@@ -1,7 +1,26 @@
|
|
|
1
1
|
import Entry from "./models/Entry";
|
|
2
|
-
import EntryLine from "./models/EntryLine";
|
|
2
|
+
import { EntryLine } from "./models/EntryLine";
|
|
3
3
|
declare class HlpEntry {
|
|
4
|
-
sortAccount: (tobs: EntryLine[], accountDirection: boolean) =>
|
|
4
|
+
sortAccount: (tobs: EntryLine[], accountDirection: boolean) => Partial<{
|
|
5
|
+
id: number;
|
|
6
|
+
createdAt?: Date;
|
|
7
|
+
bill: import("..").Bill;
|
|
8
|
+
amountTva?: number;
|
|
9
|
+
amountProductHt?: number;
|
|
10
|
+
accountTva: number;
|
|
11
|
+
accountClient: number;
|
|
12
|
+
product: import("..").Product;
|
|
13
|
+
client: import("..").User;
|
|
14
|
+
designation: string;
|
|
15
|
+
account?: number;
|
|
16
|
+
accountDebit?: number;
|
|
17
|
+
accountCredit?: number;
|
|
18
|
+
amountDebit: number;
|
|
19
|
+
amountCredit: number;
|
|
20
|
+
isCredit?: boolean;
|
|
21
|
+
isDebit?: boolean;
|
|
22
|
+
lines: EntryLine[];
|
|
23
|
+
}>[];
|
|
5
24
|
amountSold: (tob: any) => number;
|
|
6
25
|
amountSoldDebit: (tob: any) => number;
|
|
7
26
|
amountSoldCredit: (tob: any) => number;
|
|
@@ -45,17 +45,17 @@ class HlpEntry {
|
|
|
45
45
|
// return this.amountSold(tob) >= 0 ? this.amountSold(tob): '' ;
|
|
46
46
|
};
|
|
47
47
|
this.entriesTotalAmountCredit = (entries) => {
|
|
48
|
-
entries.map(
|
|
48
|
+
entries.map(entry => {
|
|
49
49
|
return this.totalAmountCredit(entry.lines);
|
|
50
50
|
});
|
|
51
51
|
};
|
|
52
52
|
this.entriesTotalAmountSold = (entries) => {
|
|
53
|
-
entries.map(
|
|
53
|
+
entries.map(entry => {
|
|
54
54
|
return this.totalAmountSold(entry.lines);
|
|
55
55
|
});
|
|
56
56
|
};
|
|
57
57
|
this.entriesTotalAmountDedit = (entries) => {
|
|
58
|
-
entries.map(
|
|
58
|
+
entries.map(entry => {
|
|
59
59
|
return this.totalAmountDebit(entry.lines);
|
|
60
60
|
});
|
|
61
61
|
};
|
|
@@ -4,7 +4,7 @@ import Spent from "../../cashs/models/Spent";
|
|
|
4
4
|
import Product from "../../products/models/Product";
|
|
5
5
|
import User from "../../users/models/User";
|
|
6
6
|
import EntryCat from "./EntryCat";
|
|
7
|
-
import EntryLine from "./EntryLine";
|
|
7
|
+
import { EntryLine } from "./EntryLine";
|
|
8
8
|
import OhadaCat from "./ohada/OhadaCat";
|
|
9
9
|
export default interface Entry {
|
|
10
10
|
id?: number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Bill from "../../bills/models/Bill";
|
|
2
2
|
import Product from "../../products/models/Product";
|
|
3
3
|
import User from "../../users/models/User";
|
|
4
|
-
export
|
|
4
|
+
export type EntryLine = Partial<{
|
|
5
5
|
id: number;
|
|
6
6
|
createdAt?: Date;
|
|
7
7
|
bill: Bill;
|
|
@@ -20,4 +20,4 @@ export default interface EntryLine {
|
|
|
20
20
|
isCredit?: boolean;
|
|
21
21
|
isDebit?: boolean;
|
|
22
22
|
lines: EntryLine[];
|
|
23
|
-
}
|
|
23
|
+
}>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { default as Entry } from "./Entry";
|
|
2
2
|
export { default as EntryAccount } from "./EntryAccount";
|
|
3
3
|
export { default as EntryCat } from "./EntryCat";
|
|
4
|
-
export {
|
|
4
|
+
export { EntryLine } from "./EntryLine";
|
|
5
5
|
export * from "./ohada";
|
package/lib/esm/utils.js
CHANGED
|
@@ -4,6 +4,7 @@ import isSameOrBefore from "dayjs/plugin/isSameOrBefore";
|
|
|
4
4
|
import relativeTime from "dayjs/plugin/relativeTime";
|
|
5
5
|
import weekOfYear from "dayjs/plugin/weekOfYear";
|
|
6
6
|
import lodash from "lodash";
|
|
7
|
+
import removeAccents from "remove-accents";
|
|
7
8
|
import "dayjs/locale/fr";
|
|
8
9
|
dayjs.extend(relativeTime);
|
|
9
10
|
dayjs.extend(isSameOrBefore);
|
|
@@ -196,6 +197,9 @@ export const sequencesToNumbers = (arr) => {
|
|
|
196
197
|
}
|
|
197
198
|
return seqs;
|
|
198
199
|
};
|
|
200
|
+
const removeAccent = (str) => {
|
|
201
|
+
return removeAccents(str);
|
|
202
|
+
};
|
|
199
203
|
export const findSequencesMissing = (arr) => {
|
|
200
204
|
const seqs = [];
|
|
201
205
|
for (const item of arr) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "asv-hlps",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.52",
|
|
4
4
|
"description": "helpers",
|
|
5
5
|
"main": "./lib/cjs/index.js",
|
|
6
6
|
"module": "./lib/esm/index.js",
|
|
@@ -30,10 +30,13 @@
|
|
|
30
30
|
"classnames": "^2.5.1",
|
|
31
31
|
"dayjs": "^1.11.13",
|
|
32
32
|
"express": "^4.21.2",
|
|
33
|
+
"i": "^0.3.7",
|
|
33
34
|
"jwt-decode": "^4.0.0",
|
|
34
35
|
"lodash": "^4.17.21",
|
|
36
|
+
"npm": "^11.4.2",
|
|
35
37
|
"pdfmake": "^0.2.20",
|
|
36
38
|
"randomatic": "^3.1.1",
|
|
39
|
+
"remove-accents": "^0.5.0",
|
|
37
40
|
"typeorm": "^0.3.25",
|
|
38
41
|
"typescript": "^5.8.3",
|
|
39
42
|
"yup": "^1.6.1",
|