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