fix(webshipper): only add invoices if invoice generator produces a file (#1749)
This commit is contained in:
@@ -287,19 +287,21 @@ class WebshipperFulfillmentService extends FulfillmentService {
|
|||||||
fulfillmentItems
|
fulfillmentItems
|
||||||
)
|
)
|
||||||
|
|
||||||
invoice = await this.client_.documents
|
if (base64Invoice) {
|
||||||
.create({
|
invoice = await this.client_.documents
|
||||||
type: "documents",
|
.create({
|
||||||
attributes: {
|
type: "documents",
|
||||||
document_size: this.options_.document_size || "A4",
|
attributes: {
|
||||||
document_format: "PDF",
|
document_size: this.options_.document_size || "A4",
|
||||||
base64: base64Invoice,
|
document_format: "PDF",
|
||||||
document_type: "invoice",
|
base64: base64Invoice,
|
||||||
},
|
document_type: "invoice",
|
||||||
})
|
},
|
||||||
.catch((err) => {
|
})
|
||||||
throw err
|
.catch((err) => {
|
||||||
})
|
throw err
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
const cooCountries = this.options_.coo_countries
|
const cooCountries = this.options_.coo_countries
|
||||||
if (
|
if (
|
||||||
|
|||||||
Reference in New Issue
Block a user