erpnext-queue-client 1.4.3 → 1.5.0
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.
|
@@ -1,33 +1,11 @@
|
|
|
1
1
|
import { TemporalClient } from "../../client";
|
|
2
2
|
import { ERPNextMethodRequest } from "../methodRequest";
|
|
3
|
-
import { StockProjectedQuantityReportItemType } from "../model/Stock";
|
|
3
|
+
import { StockBalanceReportItemType, StockProjectedQuantityReportItemType } from "../model/Stock";
|
|
4
4
|
export declare class ERPNextStock {
|
|
5
5
|
protected temporalClient: TemporalClient;
|
|
6
6
|
protected methodRequest: ERPNextMethodRequest;
|
|
7
7
|
constructor(temporalClient: TemporalClient);
|
|
8
|
-
getStockBalanceAtDate(date: Date, warehouse?: string): Promise<
|
|
9
|
-
name: string;
|
|
10
|
-
item_code: string;
|
|
11
|
-
description?: string | null | undefined;
|
|
12
|
-
brand?: string | null | undefined;
|
|
13
|
-
company?: string | null | undefined;
|
|
14
|
-
item_name?: string | null | undefined;
|
|
15
|
-
item_group?: string | null | undefined;
|
|
16
|
-
stock_uom?: string | null | undefined;
|
|
17
|
-
warehouse?: string | null | undefined;
|
|
18
|
-
currency?: string | null | undefined;
|
|
19
|
-
bal_qty?: number | null | undefined;
|
|
20
|
-
bal_val?: number | null | undefined;
|
|
21
|
-
in_qty?: number | null | undefined;
|
|
22
|
-
in_val?: number | null | undefined;
|
|
23
|
-
opening_qty?: number | null | undefined;
|
|
24
|
-
opening_val?: number | null | undefined;
|
|
25
|
-
out_qty?: number | null | undefined;
|
|
26
|
-
out_val?: number | null | undefined;
|
|
27
|
-
reorder_level?: number | null | undefined;
|
|
28
|
-
reorder_qty?: number | null | undefined;
|
|
29
|
-
val_rate?: number | null | undefined;
|
|
30
|
-
})[]>;
|
|
8
|
+
getStockBalanceAtDate(date: Date, warehouse?: string): Promise<StockBalanceReportItemType[]>;
|
|
31
9
|
getStockProjectedQuantityReport(warehouse?: string, sku?: string): Promise<StockProjectedQuantityReportItemType[]>;
|
|
32
10
|
getStockFromBin(topLevelWarehouse: string): Promise<any>;
|
|
33
11
|
getBundleStockFromBin(topLevelWarehouse: string): Promise<any>;
|
|
@@ -25,7 +25,7 @@ class ERPNextStock {
|
|
|
25
25
|
var _a;
|
|
26
26
|
const dateString = date.toISOString().substring(0, 10);
|
|
27
27
|
const result = yield this.methodRequest.request({
|
|
28
|
-
methodName: "frappe.
|
|
28
|
+
methodName: "frappe.core.doctype.prepared_report.prepared_report.make_prepared_report",
|
|
29
29
|
requestMethod: "POST",
|
|
30
30
|
params: {
|
|
31
31
|
report_name: "Stock Balance",
|
|
@@ -44,6 +44,8 @@ class ERPNextStock {
|
|
|
44
44
|
requestMethod: "POST",
|
|
45
45
|
responseValidationModel: Stock_1.StockBalanceReport,
|
|
46
46
|
});
|
|
47
|
+
// Casting to correct type since Typescript is not able to infer the type correctly.
|
|
48
|
+
// Type safety is ensured by zod
|
|
47
49
|
if ((reportResponse === null || reportResponse === void 0 ? void 0 : reportResponse.result) && ((_a = reportResponse === null || reportResponse === void 0 ? void 0 : reportResponse.doc) === null || _a === void 0 ? void 0 : _a.name) === name)
|
|
48
50
|
return reportResponse === null || reportResponse === void 0 ? void 0 : reportResponse.result.filter((r) => !(0, lodash_1.isArray)(r));
|
|
49
51
|
yield (0, utils_1.timeout)(1000);
|