@zauru-sdk/services 2.0.52 → 2.0.53

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.
@@ -10,10 +10,7 @@ export async function getInvoicesByAgencyId(session, id) {
10
10
  return handlePossibleAxiosErrors(async () => {
11
11
  const headers = await getGraphQLAPIHeaders(session);
12
12
  const response = await httpGraphQLAPI.post("", {
13
- query: getInvoicesByAgencyIdStringQuery,
14
- variables: {
15
- id,
16
- },
13
+ query: getInvoicesByAgencyIdStringQuery(Number(id ?? 0)),
17
14
  }, { headers });
18
15
  if (response.data.errors) {
19
16
  throw new Error(response.data.errors.map((x) => x.message).join(";"));
@@ -371,10 +371,10 @@ export const getGraphQLPurchaseOrderBetweenDates = (session, dates, config = {})
371
371
  //Esto se aplica porque hay veces que hay mas de un lote,
372
372
  //esto se debe a que en el momento que se hace una actualización sobre
373
373
  //una orden de compra, se crea una recepción nueva lo que genera también un nuevo lote.
374
- if (finalConfig.onlyLastLot) {
374
+ if (finalConfig.onlyFirstLot) {
375
375
  responseData = responseData.map((x) => {
376
376
  if (x.lots.length > 0) {
377
- x.lots = [x.lots[x.lots.length - 1]];
377
+ x.lots = [x.lots[0]];
378
378
  }
379
379
  return x;
380
380
  });
@@ -145,7 +145,7 @@ export declare const getGraphQLPurchaseOrderBetweenDates: (session: Session, dat
145
145
  payeeCategoryIds?: number[];
146
146
  excludePayeeCategoryIds?: number[];
147
147
  withLotStocks?: boolean;
148
- onlyLastLot?: boolean;
148
+ onlyFirstLot?: boolean;
149
149
  discountComparisonOperator?: "_eq" | "_neq" | "_gte" | "_lte" | "_gt" | "_lt";
150
150
  discount?: number;
151
151
  }) => Promise<AxiosUtilsResponse<PurchaseOrderGraphQL[]>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zauru-sdk/services",
3
- "version": "2.0.52",
3
+ "version": "2.0.53",
4
4
  "description": "Servicios de consulta a Zauru",
5
5
  "main": "./dist/esm/index.js",
6
6
  "module": "./dist/esm/index.js",
@@ -31,5 +31,5 @@
31
31
  "axios": "^1.6.7",
32
32
  "chalk": "5.3.0"
33
33
  },
34
- "gitHead": "3176c02389ca24a162796ddba4c149a3500383dc"
34
+ "gitHead": "7052c88abd3f37cbe402ed396bdc4c7ee8242556"
35
35
  }