@zauru-sdk/graphql 1.0.66 → 1.0.69

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,4 +1,4 @@
1
- export declare const getLast100ReceptionsStringQuery = "\nquery getLast100Receptions($agencyId: Int) @cached {\n purchase_orders(limit: 100, order_by: {created_at: desc}, where: {voided: {_eq: false}, agency_id: {_eq: $agencyId}}) {\n id\n created_at\n due\n id_number\n memo\n payee_id\n issue_date\n discount\n authorized\n received\n transport_type\n purchase_order_details {\n item_id\n id\n reference\n booked_quantity\n delivered_quantity\n }\n lots(where: {active: {_eq: true}}) {\n id\n name\n description\n item_id\n }\n }\n}\n";
1
+ export declare const getLast100ReceptionsStringQuery = "\nquery getLast100Receptions($agencyId: Int) @cached {\n purchase_orders(limit: 100, order_by: {created_at: desc}, where: {voided: {_eq: false}, agency_id: {_eq: $agencyId}}) {\n id\n created_at\n due\n id_number\n memo\n payee_id\n issue_date\n discount\n other_charges\n authorized\n received\n transport_type\n purchase_order_details {\n item_id\n id\n reference\n booked_quantity\n delivered_quantity\n }\n lots(where: {active: {_eq: true}}) {\n id\n name\n description\n item_id\n }\n }\n}\n";
2
2
  export declare const getPurchaseOrderByIdNumberStringQuery = "\nquery getPurchaseOrderByIdNumber($id_number: String) @cached {\n purchase_orders(where: {id_number: {_eq: $id_number}}) {\n id\n created_at\n due\n id_number\n memo\n payee_id\n transport_type\n reference\n incoterm_destination\n issue_date\n voided\n received\n discount\n other_charges\n webapp_table_rowables {\n webapp_rows {\n data\n }\n }\n purchase_order_details {\n item_id\n id\n reference\n booked_quantity\n delivered_quantity\n }\n lots(where: {active: {_eq: true}}) {\n id\n description\n }\n receptions {\n id\n received\n voided\n }\n shipments {\n shipment_id\n }\n }\n}\n";
3
3
  export declare const getPurchaseOrderStringQuery: (config?: {
4
4
  withLotStocks: boolean;
@@ -15,6 +15,7 @@ export declare const getPurchaseOrdersBetweenDatesStringQuery: (config?: {
15
15
  poDetailTagId?: number;
16
16
  withLotStocks?: boolean;
17
17
  betweenIssueDate?: boolean;
18
+ id_number?: string;
18
19
  }) => string;
19
20
  export declare const getPayeesStringQuery = "\nquery getPayees {\n payees {\n id\n id_number\n name\n tin\n vendor\n address_line_1\n }\n}\n";
20
21
  export declare const getProvidersStringQuery = "\nquery getProviders {\n payees (where: {vendor: {_eq: true}}) {\n id\n id_number\n name\n tin\n address_line_1\n }\n}\n";
@@ -12,6 +12,7 @@ query getLast100Receptions($agencyId: Int) @cached {
12
12
  payee_id
13
13
  issue_date
14
14
  discount
15
+ other_charges
15
16
  authorized
16
17
  received
17
18
  transport_type
@@ -208,13 +209,13 @@ const getPurchaseOrdersBetweenDatesStringQuery = (config = {
208
209
  withLotStocks: false,
209
210
  betweenIssueDate: false,
210
211
  }) => `
211
- query getPurchaseOrdersBetweenDates(
212
- $startDate: ${config?.betweenIssueDate ? "date" : "timestamp"},
213
- $endDate: ${config?.betweenIssueDate ? "date" : "timestamp"},
214
- $lotItemIdExclusion: Int = null,
215
- $poDetailTagId: Int = null
216
- ) {
217
- purchase_orders(
212
+ query getPurchaseOrdersBetweenDates ${config.id_number
213
+ ? ""
214
+ : `(
215
+ $startDate: ${config?.betweenIssueDate ? "date" : "timestamp"},
216
+ $endDate: ${config?.betweenIssueDate ? "date" : "timestamp"}
217
+ )`} {
218
+ purchase_orders (
218
219
  order_by: {id: desc},
219
220
  where: {
220
221
  ${config.agencyId
@@ -237,15 +238,18 @@ query getPurchaseOrdersBetweenDates(
237
238
  },`
238
239
  : ""}
239
240
  ${config.lotItemIdExclusion
240
- ? "lots: {item_id: {_neq: $lotItemIdExclusion}},"
241
+ ? `lots: {item_id: {_neq: ${config.lotItemIdExclusion}}},`
241
242
  : ""}
242
243
  ${config.poDetailTagId
243
- ? "purchase_order_details: {tag_id: {_eq: $poDetailTagId}},"
244
+ ? `purchase_order_details: {tag_id: {_eq: ${config.poDetailTagId}}},`
244
245
  : ""}
245
246
  ${config.consolidateIdFilter ? "consolidate_id: {_is_null: true}," : ""}
246
- ${config.betweenIssueDate
247
- ? "issue_date: {_gte: $startDate, _lte: $endDate}"
248
- : "created_at: {_gte: $startDate, _lte: $endDate}"}
247
+ ${config.id_number ? `id_number: {_ilike: "%${config.id_number}%"}` : ""}
248
+ ${config.id_number
249
+ ? ""
250
+ : config.betweenIssueDate
251
+ ? "issue_date: {_gte: $startDate, _lte: $endDate}"
252
+ : "created_at: {_gte: $startDate, _lte: $endDate}"}
249
253
  }
250
254
  ) {
251
255
  id
@@ -257,6 +261,7 @@ query getPurchaseOrdersBetweenDates(
257
261
  issue_date
258
262
  agency_id
259
263
  discount
264
+ other_charges
260
265
  consolidate_id
261
266
  purchase_order_details {
262
267
  item_id
@@ -12,6 +12,7 @@ query getLast100Receptions($agencyId: Int) @cached {
12
12
  payee_id
13
13
  issue_date
14
14
  discount
15
+ other_charges
15
16
  authorized
16
17
  received
17
18
  transport_type
@@ -208,13 +209,13 @@ const getPurchaseOrdersBetweenDatesStringQuery = (config = {
208
209
  withLotStocks: false,
209
210
  betweenIssueDate: false,
210
211
  }) => `
211
- query getPurchaseOrdersBetweenDates(
212
- $startDate: ${config?.betweenIssueDate ? "date" : "timestamp"},
213
- $endDate: ${config?.betweenIssueDate ? "date" : "timestamp"},
214
- $lotItemIdExclusion: Int = null,
215
- $poDetailTagId: Int = null
216
- ) {
217
- purchase_orders(
212
+ query getPurchaseOrdersBetweenDates ${config.id_number
213
+ ? ""
214
+ : `(
215
+ $startDate: ${config?.betweenIssueDate ? "date" : "timestamp"},
216
+ $endDate: ${config?.betweenIssueDate ? "date" : "timestamp"}
217
+ )`} {
218
+ purchase_orders (
218
219
  order_by: {id: desc},
219
220
  where: {
220
221
  ${config.agencyId
@@ -237,15 +238,18 @@ query getPurchaseOrdersBetweenDates(
237
238
  },`
238
239
  : ""}
239
240
  ${config.lotItemIdExclusion
240
- ? "lots: {item_id: {_neq: $lotItemIdExclusion}},"
241
+ ? `lots: {item_id: {_neq: ${config.lotItemIdExclusion}}},`
241
242
  : ""}
242
243
  ${config.poDetailTagId
243
- ? "purchase_order_details: {tag_id: {_eq: $poDetailTagId}},"
244
+ ? `purchase_order_details: {tag_id: {_eq: ${config.poDetailTagId}}},`
244
245
  : ""}
245
246
  ${config.consolidateIdFilter ? "consolidate_id: {_is_null: true}," : ""}
246
- ${config.betweenIssueDate
247
- ? "issue_date: {_gte: $startDate, _lte: $endDate}"
248
- : "created_at: {_gte: $startDate, _lte: $endDate}"}
247
+ ${config.id_number ? `id_number: {_ilike: "%${config.id_number}%"}` : ""}
248
+ ${config.id_number
249
+ ? ""
250
+ : config.betweenIssueDate
251
+ ? "issue_date: {_gte: $startDate, _lte: $endDate}"
252
+ : "created_at: {_gte: $startDate, _lte: $endDate}"}
249
253
  }
250
254
  ) {
251
255
  id
@@ -257,6 +261,7 @@ query getPurchaseOrdersBetweenDates(
257
261
  issue_date
258
262
  agency_id
259
263
  discount
264
+ other_charges
260
265
  consolidate_id
261
266
  purchase_order_details {
262
267
  item_id
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zauru-sdk/graphql",
3
- "version": "1.0.66",
3
+ "version": "1.0.69",
4
4
  "description": "Queries de uso común para las aplicación de Zauru.",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",
@@ -22,5 +22,5 @@
22
22
  "devDependencies": {
23
23
  "typescript": "^5.1.6"
24
24
  },
25
- "gitHead": "7640aacff44c60067dc41d92fa08d2fb582f7acb"
25
+ "gitHead": "46dd382e956e8b34c2a65ef078d8fddb2cdd434c"
26
26
  }