@things-factory/sales-base 3.8.28 → 3.8.32
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.
- package/dist-server/entities/index.js +6 -3
- package/dist-server/entities/index.js.map +1 -1
- package/dist-server/entities/invoice-product.js +94 -0
- package/dist-server/entities/invoice-product.js.map +1 -0
- package/dist-server/entities/invoice.js +163 -24
- package/dist-server/entities/invoice.js.map +1 -1
- package/dist-server/graphql/resolvers/index.js +3 -0
- package/dist-server/graphql/resolvers/index.js.map +1 -1
- package/dist-server/graphql/resolvers/invoice/create-invoice.js +17 -2
- package/dist-server/graphql/resolvers/invoice/create-invoice.js.map +1 -1
- package/dist-server/graphql/resolvers/invoice-product/create-invoice-product.js +12 -0
- package/dist-server/graphql/resolvers/invoice-product/create-invoice-product.js.map +1 -0
- package/dist-server/graphql/resolvers/invoice-product/delete-invoice-product.js +13 -0
- package/dist-server/graphql/resolvers/invoice-product/delete-invoice-product.js.map +1 -0
- package/dist-server/graphql/resolvers/invoice-product/delete-invoice-products.js +16 -0
- package/dist-server/graphql/resolvers/invoice-product/delete-invoice-products.js.map +1 -0
- package/dist-server/graphql/resolvers/invoice-product/index.js +12 -0
- package/dist-server/graphql/resolvers/invoice-product/index.js.map +1 -0
- package/dist-server/graphql/resolvers/invoice-product/invoice-product-query.js +33 -0
- package/dist-server/graphql/resolvers/invoice-product/invoice-product-query.js.map +1 -0
- package/dist-server/graphql/resolvers/invoice-product/update-invoice-product.js +16 -0
- package/dist-server/graphql/resolvers/invoice-product/update-invoice-product.js.map +1 -0
- package/dist-server/graphql/resolvers/invoice-product/update-multiple-invoice-product.js +31 -0
- package/dist-server/graphql/resolvers/invoice-product/update-multiple-invoice-product.js.map +1 -0
- package/dist-server/graphql/resolvers/release-good/confirm-release-good.js +14 -20
- package/dist-server/graphql/resolvers/release-good/confirm-release-good.js.map +1 -1
- package/dist-server/graphql/types/index.js +4 -0
- package/dist-server/graphql/types/index.js.map +1 -1
- package/dist-server/graphql/types/invoice/invoice-patch.js +38 -5
- package/dist-server/graphql/types/invoice/invoice-patch.js.map +1 -1
- package/dist-server/graphql/types/invoice/invoice.js +38 -4
- package/dist-server/graphql/types/invoice/invoice.js.map +1 -1
- package/dist-server/graphql/types/invoice/new-invoice.js +42 -8
- package/dist-server/graphql/types/invoice/new-invoice.js.map +1 -1
- package/dist-server/graphql/types/invoice-product/index.js +21 -0
- package/dist-server/graphql/types/invoice-product/index.js.map +1 -0
- package/dist-server/graphql/types/invoice-product/invoice-product-list.js +14 -0
- package/dist-server/graphql/types/invoice-product/invoice-product-list.js.map +1 -0
- package/dist-server/graphql/types/invoice-product/invoice-product-patch.js +21 -0
- package/dist-server/graphql/types/invoice-product/invoice-product-patch.js.map +1 -0
- package/dist-server/graphql/types/invoice-product/invoice-product.js +27 -0
- package/dist-server/graphql/types/invoice-product/invoice-product.js.map +1 -0
- package/dist-server/graphql/types/invoice-product/new-invoice-product.js +21 -0
- package/dist-server/graphql/types/invoice-product/new-invoice-product.js.map +1 -0
- package/dist-server/graphql/types/invoice-product/product-input.js +13 -0
- package/dist-server/graphql/types/invoice-product/product-input.js.map +1 -0
- package/dist-server/utils/order-no-generator.js +7 -0
- package/dist-server/utils/order-no-generator.js.map +1 -1
- package/package.json +6 -6
- package/server/entities/index.ts +6 -3
- package/server/entities/invoice-product.ts +64 -0
- package/server/entities/invoice.ts +127 -19
- package/server/graphql/resolvers/index.ts +3 -0
- package/server/graphql/resolvers/invoice/create-invoice.ts +43 -6
- package/server/graphql/resolvers/invoice-product/create-invoice-product.ts +16 -0
- package/server/graphql/resolvers/invoice-product/delete-invoice-product.ts +13 -0
- package/server/graphql/resolvers/invoice-product/delete-invoice-products.ts +16 -0
- package/server/graphql/resolvers/invoice-product/index.ts +18 -0
- package/server/graphql/resolvers/invoice-product/invoice-product-query.ts +38 -0
- package/server/graphql/resolvers/invoice-product/update-invoice-product.ts +19 -0
- package/server/graphql/resolvers/invoice-product/update-multiple-invoice-product.ts +46 -0
- package/server/graphql/resolvers/release-good/confirm-release-good.ts +17 -20
- package/server/graphql/types/index.ts +4 -0
- package/server/graphql/types/invoice/invoice-patch.ts +38 -5
- package/server/graphql/types/invoice/invoice.ts +38 -4
- package/server/graphql/types/invoice/new-invoice.ts +42 -8
- package/server/graphql/types/invoice-product/index.ts +20 -0
- package/server/graphql/types/invoice-product/invoice-product-list.ts +8 -0
- package/server/graphql/types/invoice-product/invoice-product-patch.ts +15 -0
- package/server/graphql/types/invoice-product/invoice-product.ts +21 -0
- package/server/graphql/types/invoice-product/new-invoice-product.ts +15 -0
- package/server/graphql/types/invoice-product/product-input.ts +7 -0
- package/server/utils/order-no-generator.ts +11 -0
|
@@ -5,12 +5,46 @@ export const Invoice = gql`
|
|
|
5
5
|
id: String
|
|
6
6
|
domain: Domain
|
|
7
7
|
name: String
|
|
8
|
-
|
|
8
|
+
refNo1: String
|
|
9
|
+
refNo2: String
|
|
10
|
+
refNo3: String
|
|
9
11
|
issuedOn: String
|
|
12
|
+
contactPointRefId: String
|
|
13
|
+
from: String
|
|
14
|
+
fromContactPhone: String
|
|
15
|
+
fromAddress1: String
|
|
16
|
+
fromAddress2: String
|
|
17
|
+
fromAddress3: String
|
|
18
|
+
fromAddress4: String
|
|
19
|
+
fromAddress5: String
|
|
20
|
+
fromPostcode: String
|
|
21
|
+
fromCity: String
|
|
22
|
+
fromState: String
|
|
23
|
+
fromCountry: String
|
|
24
|
+
deliverTo: String
|
|
25
|
+
deliverToPhone: String
|
|
26
|
+
deliveryAddress1: String
|
|
27
|
+
deliveryAddress2: String
|
|
28
|
+
deliveryAddress3: String
|
|
29
|
+
deliveryAddress4: String
|
|
30
|
+
deliveryAddress5: String
|
|
31
|
+
deliveryCity: String
|
|
32
|
+
deliveryState: String
|
|
33
|
+
deliveryCountry: String
|
|
34
|
+
billTo: String
|
|
35
|
+
billToPhone: String
|
|
36
|
+
billingAddress1: String
|
|
37
|
+
billingAddress2: String
|
|
38
|
+
billingAddress3: String
|
|
39
|
+
billingAddress4: String
|
|
40
|
+
billingAddress5: String
|
|
41
|
+
billingPostcode: String
|
|
42
|
+
billingCity: String
|
|
43
|
+
billingState: String
|
|
44
|
+
billingCountry: String
|
|
10
45
|
paymentDue: String
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
state: String
|
|
46
|
+
invoiceProducts: [InvoiceProduct]
|
|
47
|
+
releaseGood: ReleaseGood
|
|
14
48
|
description: String
|
|
15
49
|
creator: User
|
|
16
50
|
updater: User
|
|
@@ -2,13 +2,47 @@ import gql from 'graphql-tag'
|
|
|
2
2
|
|
|
3
3
|
export const NewInvoice = gql`
|
|
4
4
|
input NewInvoice {
|
|
5
|
-
name: String
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
name: String
|
|
6
|
+
refNo1: String
|
|
7
|
+
refNo2: String
|
|
8
|
+
refNo3: String
|
|
9
|
+
issuedOn: String
|
|
10
|
+
contactPointRefId: String
|
|
11
|
+
from: String
|
|
12
|
+
fromContactPhone: String
|
|
13
|
+
fromAddress1: String
|
|
14
|
+
fromAddress2: String
|
|
15
|
+
fromAddress3: String
|
|
16
|
+
fromAddress4: String
|
|
17
|
+
fromAddress5: String
|
|
18
|
+
fromPostcode: String
|
|
19
|
+
fromCity: String
|
|
20
|
+
fromState: String
|
|
21
|
+
fromCountry: String
|
|
22
|
+
deliverTo: String
|
|
23
|
+
deliverToPhone: String
|
|
24
|
+
deliveryAddress1: String
|
|
25
|
+
deliveryAddress2: String
|
|
26
|
+
deliveryAddress3: String
|
|
27
|
+
deliveryAddress4: String
|
|
28
|
+
deliveryAddress5: String
|
|
29
|
+
deliveryCity: String
|
|
30
|
+
deliveryState: String
|
|
31
|
+
deliveryCountry: String
|
|
32
|
+
deliveryPostcode: String
|
|
33
|
+
billTo: String
|
|
34
|
+
billToPhone: String
|
|
35
|
+
billingAddress1: String
|
|
36
|
+
billingAddress2: String
|
|
37
|
+
billingAddress3: String
|
|
38
|
+
billingAddress4: String
|
|
39
|
+
billingAddress5: String
|
|
40
|
+
billingPostcode: String
|
|
41
|
+
billingCity: String
|
|
42
|
+
billingState: String
|
|
43
|
+
billingCountry: String
|
|
44
|
+
paymentDue: String
|
|
45
|
+
invoiceProducts: [NewInvoiceProduct]
|
|
46
|
+
releaseGood: ObjectRef
|
|
13
47
|
}
|
|
14
48
|
`
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { InvoiceProduct } from './invoice-product'
|
|
2
|
+
import { InvoiceProductList } from './invoice-product-list'
|
|
3
|
+
import { InvoiceProductPatch } from './invoice-product-patch'
|
|
4
|
+
import { NewInvoiceProduct } from './new-invoice-product'
|
|
5
|
+
import { ProductInput } from './product-input'
|
|
6
|
+
|
|
7
|
+
export const Mutation = `
|
|
8
|
+
createInvoiceProduct (invoiceProduct: NewInvoiceProduct!): InvoiceProduct
|
|
9
|
+
updateInvoiceProduct (name: String! patch: InvoiceProductPatch!): InvoiceProduct
|
|
10
|
+
updateMultipleInvoiceProduct (patches: [InvoiceProductPatch]!): [InvoiceProduct]
|
|
11
|
+
deleteInvoiceProduct (name: String!): Boolean
|
|
12
|
+
deleteInvoiceProducts (names: [String]!): Boolean
|
|
13
|
+
`
|
|
14
|
+
|
|
15
|
+
export const Query = `
|
|
16
|
+
invoiceProducts(filters: [Filter], pagination: Pagination, sortings: [Sorting]): InvoiceProductList
|
|
17
|
+
invoiceProduct(name: String!): InvoiceProduct
|
|
18
|
+
`
|
|
19
|
+
|
|
20
|
+
export const Types = [InvoiceProduct, NewInvoiceProduct, InvoiceProductPatch, InvoiceProductList, ProductInput]
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import gql from 'graphql-tag'
|
|
2
|
+
|
|
3
|
+
export const InvoiceProductPatch = gql`
|
|
4
|
+
input InvoiceProductPatch {
|
|
5
|
+
id: String
|
|
6
|
+
name: String
|
|
7
|
+
description: String
|
|
8
|
+
invoice: ObjectRef
|
|
9
|
+
product: ObjectRef
|
|
10
|
+
qty: Int
|
|
11
|
+
otherCharges: Float
|
|
12
|
+
unitPrice: Float
|
|
13
|
+
paidPrice: Float
|
|
14
|
+
}
|
|
15
|
+
`
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import gql from 'graphql-tag'
|
|
2
|
+
|
|
3
|
+
export const InvoiceProduct = gql`
|
|
4
|
+
type InvoiceProduct {
|
|
5
|
+
id: String
|
|
6
|
+
sku: String
|
|
7
|
+
name: String
|
|
8
|
+
domain: Domain
|
|
9
|
+
description: String
|
|
10
|
+
invoice: Invoice
|
|
11
|
+
product: Product
|
|
12
|
+
qty: Int
|
|
13
|
+
otherCharges: Float
|
|
14
|
+
unitPrice: Float
|
|
15
|
+
paidPrice: Float
|
|
16
|
+
updater: User
|
|
17
|
+
creator: User
|
|
18
|
+
updatedAt: String
|
|
19
|
+
createdAt: String
|
|
20
|
+
}
|
|
21
|
+
`
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import gql from 'graphql-tag'
|
|
2
|
+
|
|
3
|
+
export const NewInvoiceProduct = gql`
|
|
4
|
+
input NewInvoiceProduct {
|
|
5
|
+
sku: String
|
|
6
|
+
name: String!
|
|
7
|
+
description: String
|
|
8
|
+
invoice: ObjectRef
|
|
9
|
+
product: ProductInput
|
|
10
|
+
qty: Int
|
|
11
|
+
otherCharges: Float
|
|
12
|
+
unitPrice: Float
|
|
13
|
+
paidPrice: Float
|
|
14
|
+
}
|
|
15
|
+
`
|
|
@@ -58,6 +58,10 @@ export class OrderNoGenerator {
|
|
|
58
58
|
return `OP-${uuid()}`
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
+
static invoiceProduct() {
|
|
62
|
+
return `IP-${uuid()}`
|
|
63
|
+
}
|
|
64
|
+
|
|
61
65
|
static orderVas() {
|
|
62
66
|
return `OV-${uuid()}`
|
|
63
67
|
}
|
|
@@ -121,4 +125,11 @@ export class OrderNoGenerator {
|
|
|
121
125
|
currentDate.getMonth() + 1
|
|
122
126
|
}${currentDate.getDate()}${currentDate.getHours()}${currentDate.getMinutes()}${currentDate.getSeconds()}${currentDate.getMilliseconds()}`
|
|
123
127
|
}
|
|
128
|
+
|
|
129
|
+
static invoice() {
|
|
130
|
+
const currentDate = new Date()
|
|
131
|
+
return `INV-${currentDate.getFullYear()}${
|
|
132
|
+
currentDate.getMonth() + 1
|
|
133
|
+
}${currentDate.getDate()}${currentDate.getHours()}${currentDate.getMinutes()}${currentDate.getSeconds()}${currentDate.getMilliseconds()}`
|
|
134
|
+
}
|
|
124
135
|
}
|