asv-hlps 1.4.7 → 1.4.8
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/cashs/models/PaymentMode.d.ts +5 -0
- package/lib/cjs/cashs/models/PaymentMode.js +2 -0
- package/lib/cjs/markets/models/UMarket.d.ts +1 -1
- package/lib/cjs/markets/products/hlpProduct.d.ts +13 -0
- package/lib/cjs/markets/products/hlpProduct.js +49 -0
- package/lib/cjs/markets/products/index.d.ts +2 -0
- package/lib/cjs/markets/products/index.js +23 -0
- package/lib/cjs/markets/products/models/Product.d.ts +4 -4
- package/lib/cjs/markets/products/models/ProductAsset.d.ts +1 -1
- package/lib/cjs/markets/products/models/ProductCat.d.ts +1 -1
- package/lib/cjs/markets/products/models/ProductCollection.d.ts +1 -1
- package/lib/cjs/markets/products/models/ProductDepot.d.ts +2 -2
- package/lib/cjs/markets/products/models/ProductElt.d.ts +1 -1
- package/lib/cjs/markets/products/models/ProductGrp.d.ts +1 -1
- package/lib/cjs/markets/products/models/ProductImage.d.ts +3 -2
- package/lib/cjs/markets/products/models/ProductImage.js +0 -4
- package/lib/cjs/markets/products/models/ProductIn.d.ts +3 -3
- package/lib/cjs/markets/products/models/ProductIn.js +0 -4
- package/lib/cjs/markets/products/models/ProductVariant.d.ts +1 -1
- package/lib/cjs/markets/sales/index.d.ts +1 -0
- package/lib/cjs/markets/sales/index.js +17 -0
- package/lib/cjs/markets/sales/models/Sale.d.ts +8 -0
- package/lib/cjs/markets/sales/models/Sale.js +2 -0
- package/lib/cjs/markets/sales/models/SalePayment.d.ts +23 -0
- package/lib/cjs/markets/sales/models/SalePayment.js +2 -0
- package/lib/cjs/markets/sales/models/SaleProduct.d.ts +8 -0
- package/lib/cjs/markets/sales/models/SaleProduct.js +2 -0
- package/lib/cjs/markets/sales/models/index.d.ts +3 -0
- package/lib/cjs/markets/sales/models/index.js +19 -0
- package/lib/cjs/markets/shops/models/Shop.d.ts +2 -2
- package/lib/cjs/markets/users/models/User.d.ts +1 -1
- package/lib/esm/cashs/models/PaymentMode.d.ts +5 -0
- package/lib/esm/cashs/models/PaymentMode.js +1 -0
- package/lib/esm/markets/models/UMarket.d.ts +1 -1
- package/lib/esm/markets/products/hlpProduct.d.ts +13 -0
- package/lib/esm/markets/products/hlpProduct.js +47 -0
- package/lib/esm/markets/products/index.d.ts +2 -0
- package/lib/esm/markets/products/index.js +2 -0
- package/lib/esm/markets/products/models/Product.d.ts +4 -4
- package/lib/esm/markets/products/models/ProductAsset.d.ts +1 -1
- package/lib/esm/markets/products/models/ProductCat.d.ts +1 -1
- package/lib/esm/markets/products/models/ProductCollection.d.ts +1 -1
- package/lib/esm/markets/products/models/ProductDepot.d.ts +2 -2
- package/lib/esm/markets/products/models/ProductElt.d.ts +1 -1
- package/lib/esm/markets/products/models/ProductGrp.d.ts +1 -1
- package/lib/esm/markets/products/models/ProductImage.d.ts +3 -2
- package/lib/esm/markets/products/models/ProductImage.js +1 -2
- package/lib/esm/markets/products/models/ProductIn.d.ts +3 -3
- package/lib/esm/markets/products/models/ProductIn.js +1 -2
- package/lib/esm/markets/products/models/ProductVariant.d.ts +1 -1
- package/lib/esm/markets/sales/index.d.ts +1 -0
- package/lib/esm/markets/sales/index.js +1 -0
- package/lib/esm/markets/sales/models/Sale.d.ts +8 -0
- package/lib/esm/markets/sales/models/Sale.js +1 -0
- package/lib/esm/markets/sales/models/SalePayment.d.ts +23 -0
- package/lib/esm/markets/sales/models/SalePayment.js +1 -0
- package/lib/esm/markets/sales/models/SaleProduct.d.ts +8 -0
- package/lib/esm/markets/sales/models/SaleProduct.js +1 -0
- package/lib/esm/markets/sales/models/index.d.ts +3 -0
- package/lib/esm/markets/sales/models/index.js +3 -0
- package/lib/esm/markets/shops/models/Shop.d.ts +2 -2
- package/lib/esm/markets/users/models/User.d.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import Product from "./models/Product";
|
|
2
|
+
import { ProductStock } from "./models/ProductStock";
|
|
3
|
+
declare class HlpProduct {
|
|
4
|
+
qtityInAllDepots(stock: ProductStock, prms?: {
|
|
5
|
+
exceptDepots?: string[];
|
|
6
|
+
main?: "master" | "slave";
|
|
7
|
+
}): number;
|
|
8
|
+
getStockSalable(product: Product): number;
|
|
9
|
+
stock: (product: Product, param: "salable" | "packs" | "units") => number;
|
|
10
|
+
extraFiilters: (row: Product) => string;
|
|
11
|
+
}
|
|
12
|
+
declare const _default: HlpProduct;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
class HlpProduct {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.stock = (product, param) => {
|
|
6
|
+
const salable = (+product.stock.sumIns || 0) - (+product.stock.sumOuts || 0);
|
|
7
|
+
const packs = Math.trunc(salable / product.stock.qtityPerPackaging || 0);
|
|
8
|
+
const units = salable % product.stock.qtityPerPackaging || 0;
|
|
9
|
+
switch (param) {
|
|
10
|
+
case "salable":
|
|
11
|
+
return salable;
|
|
12
|
+
case "packs":
|
|
13
|
+
return packs;
|
|
14
|
+
case "units":
|
|
15
|
+
return units;
|
|
16
|
+
default:
|
|
17
|
+
return salable;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
this.extraFiilters = (row) => row.designation; /* +
|
|
21
|
+
row.codeCompta +
|
|
22
|
+
(row.tva > 0 ? "@tva" : "") +
|
|
23
|
+
(row.isAvailable ? "@dispo" : "") +
|
|
24
|
+
(!row.isAvailable ? "@indispo" : "") +
|
|
25
|
+
(row.isActive ? "@actif" : "") +
|
|
26
|
+
(!row.isActive ? "@inactif" : "") +
|
|
27
|
+
(row.isPrivate ? "@private" : "") +
|
|
28
|
+
(!row.isPrivate ? "@noprivate" : ""); */
|
|
29
|
+
}
|
|
30
|
+
qtityInAllDepots(stock, prms) {
|
|
31
|
+
const ins = stock.sumIns - stock.sumOuts;
|
|
32
|
+
return ins <= 0 ? 0 : ins;
|
|
33
|
+
}
|
|
34
|
+
getStockSalable(product) {
|
|
35
|
+
const stockAllSalable = +this.qtityInAllDepots(product.stock);
|
|
36
|
+
const stockProduct = Math.trunc(stockAllSalable / product.qtityUnit);
|
|
37
|
+
/* let stockSalable: number = 0;
|
|
38
|
+
|
|
39
|
+
if (stockAllSalable <= stockStore) {
|
|
40
|
+
stockSalable = stockAllSalable;
|
|
41
|
+
}
|
|
42
|
+
if (stockAllSalable > stockStore) {
|
|
43
|
+
stockSalable = stockStore;
|
|
44
|
+
} */
|
|
45
|
+
// return stockSalable || 0;
|
|
46
|
+
return stockProduct || 0;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.default = new HlpProduct();
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.HlpProduct = void 0;
|
|
21
|
+
var hlpProduct_1 = require("./hlpProduct");
|
|
22
|
+
Object.defineProperty(exports, "HlpProduct", { enumerable: true, get: function () { return __importDefault(hlpProduct_1).default; } });
|
|
23
|
+
__exportStar(require("./models"), exports);
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Market } from "../../models/Market";
|
|
2
2
|
import { Shop } from "../../shops/models/Shop";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
3
|
+
import ProductCat from "./ProductCat";
|
|
4
|
+
import ProductImage from "./ProductImage";
|
|
5
|
+
import ProductIn from "./ProductIn";
|
|
6
6
|
interface Stock {
|
|
7
7
|
sumIns: number;
|
|
8
8
|
sumOuts: number;
|
|
9
9
|
qtityPerPackaging: number;
|
|
10
10
|
}
|
|
11
|
-
export interface Product {
|
|
11
|
+
export default interface Product {
|
|
12
12
|
capacity: string;
|
|
13
13
|
cat: ProductCat;
|
|
14
14
|
createdAt: Date;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import EInOutMotive from "../../../shared/models/EInOutMotive";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
export
|
|
2
|
+
import Product from "./Product";
|
|
3
|
+
import ProductDepot from "./ProductDepot";
|
|
4
|
+
export default interface ProductIn {
|
|
5
5
|
id: number;
|
|
6
6
|
createdAt: Date;
|
|
7
7
|
lot: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./models";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./models"), exports);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import Bank from "../../../cashs/models/Bank";
|
|
2
|
+
import BankAccount from "../../../cashs/models/BankAccount";
|
|
3
|
+
import PaymentMode from "../../../cashs/models/PaymentMode";
|
|
4
|
+
import User from "../../users/models/User";
|
|
5
|
+
import Sale from "./Sale";
|
|
6
|
+
export interface SalePayment {
|
|
7
|
+
id: number;
|
|
8
|
+
ref: string;
|
|
9
|
+
createdAt: Date;
|
|
10
|
+
paymentDate: Date;
|
|
11
|
+
prevAmount: number;
|
|
12
|
+
paidAmount: number;
|
|
13
|
+
cashReceived: number;
|
|
14
|
+
cashReturned: number;
|
|
15
|
+
restAmount: number;
|
|
16
|
+
checkNumber: string;
|
|
17
|
+
checkDate: string;
|
|
18
|
+
sale: Sale;
|
|
19
|
+
encoder: User;
|
|
20
|
+
account: BankAccount;
|
|
21
|
+
bank: Bank;
|
|
22
|
+
mode: PaymentMode;
|
|
23
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./Sale"), exports);
|
|
18
|
+
__exportStar(require("./SalePayment"), exports);
|
|
19
|
+
__exportStar(require("./SaleProduct"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import Product from "./models/Product";
|
|
2
|
+
import { ProductStock } from "./models/ProductStock";
|
|
3
|
+
declare class HlpProduct {
|
|
4
|
+
qtityInAllDepots(stock: ProductStock, prms?: {
|
|
5
|
+
exceptDepots?: string[];
|
|
6
|
+
main?: "master" | "slave";
|
|
7
|
+
}): number;
|
|
8
|
+
getStockSalable(product: Product): number;
|
|
9
|
+
stock: (product: Product, param: "salable" | "packs" | "units") => number;
|
|
10
|
+
extraFiilters: (row: Product) => string;
|
|
11
|
+
}
|
|
12
|
+
declare const _default: HlpProduct;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
class HlpProduct {
|
|
2
|
+
constructor() {
|
|
3
|
+
this.stock = (product, param) => {
|
|
4
|
+
const salable = (+product.stock.sumIns || 0) - (+product.stock.sumOuts || 0);
|
|
5
|
+
const packs = Math.trunc(salable / product.stock.qtityPerPackaging || 0);
|
|
6
|
+
const units = salable % product.stock.qtityPerPackaging || 0;
|
|
7
|
+
switch (param) {
|
|
8
|
+
case "salable":
|
|
9
|
+
return salable;
|
|
10
|
+
case "packs":
|
|
11
|
+
return packs;
|
|
12
|
+
case "units":
|
|
13
|
+
return units;
|
|
14
|
+
default:
|
|
15
|
+
return salable;
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
this.extraFiilters = (row) => row.designation; /* +
|
|
19
|
+
row.codeCompta +
|
|
20
|
+
(row.tva > 0 ? "@tva" : "") +
|
|
21
|
+
(row.isAvailable ? "@dispo" : "") +
|
|
22
|
+
(!row.isAvailable ? "@indispo" : "") +
|
|
23
|
+
(row.isActive ? "@actif" : "") +
|
|
24
|
+
(!row.isActive ? "@inactif" : "") +
|
|
25
|
+
(row.isPrivate ? "@private" : "") +
|
|
26
|
+
(!row.isPrivate ? "@noprivate" : ""); */
|
|
27
|
+
}
|
|
28
|
+
qtityInAllDepots(stock, prms) {
|
|
29
|
+
const ins = stock.sumIns - stock.sumOuts;
|
|
30
|
+
return ins <= 0 ? 0 : ins;
|
|
31
|
+
}
|
|
32
|
+
getStockSalable(product) {
|
|
33
|
+
const stockAllSalable = +this.qtityInAllDepots(product.stock);
|
|
34
|
+
const stockProduct = Math.trunc(stockAllSalable / product.qtityUnit);
|
|
35
|
+
/* let stockSalable: number = 0;
|
|
36
|
+
|
|
37
|
+
if (stockAllSalable <= stockStore) {
|
|
38
|
+
stockSalable = stockAllSalable;
|
|
39
|
+
}
|
|
40
|
+
if (stockAllSalable > stockStore) {
|
|
41
|
+
stockSalable = stockStore;
|
|
42
|
+
} */
|
|
43
|
+
// return stockSalable || 0;
|
|
44
|
+
return stockProduct || 0;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
export default new HlpProduct();
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Market } from "../../models/Market";
|
|
2
2
|
import { Shop } from "../../shops/models/Shop";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
3
|
+
import ProductCat from "./ProductCat";
|
|
4
|
+
import ProductImage from "./ProductImage";
|
|
5
|
+
import ProductIn from "./ProductIn";
|
|
6
6
|
interface Stock {
|
|
7
7
|
sumIns: number;
|
|
8
8
|
sumOuts: number;
|
|
9
9
|
qtityPerPackaging: number;
|
|
10
10
|
}
|
|
11
|
-
export interface Product {
|
|
11
|
+
export default interface Product {
|
|
12
12
|
capacity: string;
|
|
13
13
|
cat: ProductCat;
|
|
14
14
|
createdAt: Date;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
}
|
|
1
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import EInOutMotive from "../../../shared/models/EInOutMotive";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
export
|
|
2
|
+
import Product from "./Product";
|
|
3
|
+
import ProductDepot from "./ProductDepot";
|
|
4
|
+
export default interface ProductIn {
|
|
5
5
|
id: number;
|
|
6
6
|
createdAt: Date;
|
|
7
7
|
lot: string;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
}
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./models";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./models";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import Bank from "../../../cashs/models/Bank";
|
|
2
|
+
import BankAccount from "../../../cashs/models/BankAccount";
|
|
3
|
+
import PaymentMode from "../../../cashs/models/PaymentMode";
|
|
4
|
+
import User from "../../users/models/User";
|
|
5
|
+
import Sale from "./Sale";
|
|
6
|
+
export interface SalePayment {
|
|
7
|
+
id: number;
|
|
8
|
+
ref: string;
|
|
9
|
+
createdAt: Date;
|
|
10
|
+
paymentDate: Date;
|
|
11
|
+
prevAmount: number;
|
|
12
|
+
paidAmount: number;
|
|
13
|
+
cashReceived: number;
|
|
14
|
+
cashReturned: number;
|
|
15
|
+
restAmount: number;
|
|
16
|
+
checkNumber: string;
|
|
17
|
+
checkDate: string;
|
|
18
|
+
sale: Sale;
|
|
19
|
+
encoder: User;
|
|
20
|
+
account: BankAccount;
|
|
21
|
+
bank: Bank;
|
|
22
|
+
mode: PaymentMode;
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|