@zauru-sdk/services 2.0.16 → 2.0.19

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.
@@ -301,8 +301,8 @@ export const getGraphQLPurchaseOrderBetweenDates = (session, dates, config = {})
301
301
  agencyFilter: true,
302
302
  consolidateIdFilter: false,
303
303
  useProductionAgencyId: false,
304
- withShipmentToMyAgency: false,
305
- withLotStocksToMyAgency: false,
304
+ onlyWithShipmentToMyAgency: false,
305
+ onlyWithLotStocksToMyAgency: false,
306
306
  betweenIssueDate: false,
307
307
  withPODetails: true,
308
308
  withLots: true,
@@ -310,6 +310,7 @@ export const getGraphQLPurchaseOrderBetweenDates = (session, dates, config = {})
310
310
  withWebAppRows: true,
311
311
  payeeCategoryIds: [],
312
312
  excludePayeeCategoryIds: [],
313
+ withLotStocks: false,
313
314
  };
314
315
  // Combinar config con los valores por defecto
315
316
  const finalConfig = { ...defaultConfig, ...config };
@@ -326,7 +327,7 @@ export const getGraphQLPurchaseOrderBetweenDates = (session, dates, config = {})
326
327
  consolidateIdFilter: finalConfig.consolidateIdFilter,
327
328
  lotItemIdExclusion: finalConfig.lotItemIdExclusion,
328
329
  poDetailTagId: finalConfig.poDetailTagId,
329
- withLotStocks: finalConfig.withLotStocksToMyAgency,
330
+ withLotStocks: finalConfig.withLotStocks,
330
331
  itemId: finalConfig.itemId,
331
332
  payeeCategoryId: finalConfig.payeeCategoryId,
332
333
  betweenIssueDate: finalConfig.betweenIssueDate,
@@ -350,10 +351,13 @@ export const getGraphQLPurchaseOrderBetweenDates = (session, dates, config = {})
350
351
  }
351
352
  //============ Aplicación de filtros
352
353
  let responseData = response.data.data.purchase_orders;
353
- if (finalConfig.withShipmentToMyAgency) {
354
+ if (finalConfig.onlyWithShipmentToMyAgency &&
355
+ finalConfig.withShipmentPurchaseOrders) {
354
356
  responseData = response.data?.data?.purchase_orders.filter((x) => x.shipment_purchase_orders.some((y) => y.shipment.agency_to_id?.toString() == session.get("agency_id")));
355
357
  }
356
- if (finalConfig.withLotStocksToMyAgency && finalConfig.withLots) {
358
+ if (finalConfig.onlyWithLotStocksToMyAgency &&
359
+ finalConfig.withLots &&
360
+ finalConfig.withLotStocks) {
357
361
  responseData = responseData.map((x) => {
358
362
  x.lots = x.lots.map((y) => {
359
363
  y.lot_stocks = y.lot_stocks.filter((z) => z.agency_id == session.get("agency_id"));
@@ -131,8 +131,8 @@ export declare const getGraphQLPurchaseOrderBetweenDates: (session: Session, dat
131
131
  consolidateIdFilter?: boolean;
132
132
  lotItemIdExclusion?: number;
133
133
  poDetailTagId?: number;
134
- withShipmentToMyAgency?: boolean;
135
- withLotStocksToMyAgency?: boolean;
134
+ onlyWithShipmentToMyAgency?: boolean;
135
+ onlyWithLotStocksToMyAgency?: boolean;
136
136
  itemId?: number | string;
137
137
  payeeCategoryId?: number | string;
138
138
  payeeId?: number | string;
@@ -143,6 +143,7 @@ export declare const getGraphQLPurchaseOrderBetweenDates: (session: Session, dat
143
143
  withWebAppRows?: boolean;
144
144
  payeeCategoryIds?: number[];
145
145
  excludePayeeCategoryIds?: number[];
146
+ withLotStocks?: boolean;
146
147
  discountComparisonOperator?: "_eq" | "_neq" | "_gte" | "_lte" | "_gt" | "_lt";
147
148
  discount?: number;
148
149
  }) => Promise<AxiosUtilsResponse<PurchaseOrderGraphQL[]>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zauru-sdk/services",
3
- "version": "2.0.16",
3
+ "version": "2.0.19",
4
4
  "description": "Servicios de consulta a Zauru",
5
5
  "main": "./dist/esm/index.js",
6
6
  "module": "./dist/esm/index.js",
@@ -24,12 +24,12 @@
24
24
  },
25
25
  "dependencies": {
26
26
  "@remix-run/node": "^2.8.1",
27
- "@zauru-sdk/common": "^2.0.16",
27
+ "@zauru-sdk/common": "^2.0.18",
28
28
  "@zauru-sdk/config": "^2.0.0",
29
29
  "@zauru-sdk/graphql": "^2.0.7",
30
- "@zauru-sdk/types": "^2.0.16",
30
+ "@zauru-sdk/types": "^2.0.18",
31
31
  "axios": "^1.6.7",
32
32
  "chalk": "5.3.0"
33
33
  },
34
- "gitHead": "fead735a2c2a1ddad189f67342abe2ea38f1d736"
34
+ "gitHead": "68ff5684747f6fa9616a57dcc8a8ec702dcda3ee"
35
35
  }