@things-factory/sales-ui 4.0.37 → 4.0.41

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.
@@ -912,7 +912,7 @@ class PurchaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
912
912
  purchaseOrder.orderProducts = this._getOrderProducts()
913
913
  purchaseOrder.otherCharges = this._getPoOtherCharges()
914
914
 
915
- const attachments = this._document?.files ? this._document.files : undefined
915
+ const fileUploader = this._document?.files ? this._document.files : undefined
916
916
 
917
917
  const objectNames = [
918
918
  'bizplace|name',
@@ -931,36 +931,25 @@ class PurchaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
931
931
  delete purchaseOrder[objectName]
932
932
  })
933
933
 
934
- const args = {
935
- purchaseOrder: {
936
- ...purchaseOrder,
937
- status,
938
- ownTransport: this._purchaseOrderData?.importCargo ? true : this._purchaseOrderData?.ownTransport,
939
- supplier: { id: purchaseOrder?.supplier?.id }
940
- }
941
- }
942
-
943
934
  const response = await client.mutate({
944
935
  mutation: gql`
945
- mutation upsertPurchaseOrder($purchaseOrder: PurchaseOrderPatch!, $attachments: [Upload!]) {
946
- upsertPurchaseOrder(purchaseOrder: $purchaseOrder, file: $attachments) {
936
+ mutation upsertPurchaseOrder($purchaseOrder: PurchaseOrderPatch!, $files: [Upload!]) {
937
+ upsertPurchaseOrder(purchaseOrder: $purchaseOrder, files: $files) {
947
938
  id
948
939
  name
949
940
  }
950
941
  }
951
942
  `,
952
943
  variables: {
953
- attachments,
954
944
  purchaseOrder: {
955
945
  ...purchaseOrder,
956
946
  status,
957
947
  ownTransport: this._purchaseOrderData?.importCargo ? true : this._purchaseOrderData?.ownTransport,
958
948
  supplier: { id: purchaseOrder?.supplier?.id }
959
- }
949
+ },
950
+ files: fileUploader
960
951
  },
961
- context: {
962
- hasUpload: true
963
- }
952
+ context: { hasUpload: true }
964
953
  })
965
954
 
966
955
  if (!response.errors) {
@@ -1081,9 +1070,7 @@ class PurchaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
1081
1070
  }
1082
1071
  }
1083
1072
  `,
1084
- variables: {
1085
- name: this._poNo
1086
- }
1073
+ variables: { name: this._poNo }
1087
1074
  })
1088
1075
 
1089
1076
  if (!response.errors) {
@@ -1283,7 +1270,7 @@ class PurchaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
1283
1270
  html`
1284
1271
  <contact-points-popup
1285
1272
  type="SUPPLIER"
1286
- partnerBizplaceId=${this.partnerBizplaceId}
1273
+ partnerBizplaceId=${this.partnerBizplaceId ? this.partnerBizplaceId : this._purchaseOrderData.bizplace?.id}
1287
1274
  @selected="${e => {
1288
1275
  this._purchaseOrderData = {
1289
1276
  ...this._purchaseOrderData,
@@ -1,13 +1,14 @@
1
- import { getCodeByName } from '@things-factory/code-base'
2
1
  import '@things-factory/form-ui'
3
2
  import '@things-factory/grist-ui'
3
+
4
+ import gql from 'graphql-tag'
5
+ import { css, html } from 'lit-element'
6
+
7
+ import { getCodeByName } from '@things-factory/code-base'
4
8
  import { i18next, localize } from '@things-factory/i18n-base'
5
9
  import { client, navigate, PageView } from '@things-factory/shell'
6
- import { ScrollbarStyles, CommonButtonStyles } from '@things-factory/styles'
10
+ import { CommonButtonStyles, ScrollbarStyles } from '@things-factory/styles'
7
11
  import { isMobileDevice } from '@things-factory/utils'
8
- import gql from 'graphql-tag'
9
- import { css, html } from 'lit-element'
10
- // import { ORDER_STATUS } from '../../constants'
11
12
 
12
13
  class PurchaseOrderList extends localize(i18next)(PageView) {
13
14
  static get styles() {
@@ -318,7 +319,7 @@ class PurchaseOrderList extends localize(i18next)(PageView) {
318
319
  async _fetchContactPoints() {
319
320
  const response = await client.query({
320
321
  query: gql`
321
- query contactPoints($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
322
+ query contactPoints($filters: [Filter!]!, $pagination: Pagination, $sortings: [Sorting!]!) {
322
323
  contactPoints(filters: $filters, pagination: $pagination, sortings: $sortings) {
323
324
  items {
324
325
  id
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/sales-ui",
3
- "version": "4.0.37",
3
+ "version": "4.0.41",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -24,15 +24,15 @@
24
24
  "migration:create": "node ../../node_modules/typeorm/cli.js migration:create -d ./server/migrations"
25
25
  },
26
26
  "dependencies": {
27
- "@things-factory/code-base": "^4.0.37",
28
- "@things-factory/form-ui": "^4.0.37",
29
- "@things-factory/grist-ui": "^4.0.37",
30
- "@things-factory/i18n-base": "^4.0.37",
31
- "@things-factory/import-ui": "^4.0.37",
32
- "@things-factory/sales-base": "^4.0.37",
33
- "@things-factory/setting-ui": "^4.0.37",
34
- "@things-factory/shell": "^4.0.37",
35
- "@things-factory/warehouse-ui": "^4.0.37"
27
+ "@things-factory/code-base": "^4.0.41",
28
+ "@things-factory/form-ui": "^4.0.41",
29
+ "@things-factory/grist-ui": "^4.0.41",
30
+ "@things-factory/i18n-base": "^4.0.41",
31
+ "@things-factory/import-ui": "^4.0.41",
32
+ "@things-factory/sales-base": "^4.0.41",
33
+ "@things-factory/setting-ui": "^4.0.41",
34
+ "@things-factory/shell": "^4.0.41",
35
+ "@things-factory/warehouse-ui": "^4.0.41"
36
36
  },
37
- "gitHead": "7abd5ee06f7329c7fbb0c305f7b075a990bc2c18"
37
+ "gitHead": "1dd445b5b5e5b9e37291dc274886131199d7bf6a"
38
38
  }