Economic invoice booking finalized

This commit is contained in:
olivermrbl
2020-07-11 12:20:35 +02:00
parent 9f17ab5861
commit 2e54c5627b
4 changed files with 5594 additions and 6 deletions

View File

@@ -38,6 +38,7 @@
"express": "^4.17.1", "express": "^4.17.1",
"medusa-core-utils": "^0.3.0", "medusa-core-utils": "^0.3.0",
"medusa-interfaces": "^0.3.0", "medusa-interfaces": "^0.3.0",
"medusa-test-utils": "^0.3.0" "medusa-test-utils": "^0.3.0",
"moment": "^2.27.0"
} }
} }

View File

@@ -3,7 +3,7 @@ import moment from "moment"
import { BaseService } from "medusa-interfaces" import { BaseService } from "medusa-interfaces"
import { MedusaError } from "medusa-core-utils" import { MedusaError } from "medusa-core-utils"
ECONOMIC_BASE_URL = "https://restapi.e-conomic.com" const ECONOMIC_BASE_URL = "https://restapi.e-conomic.com"
class EconomicService extends BaseService { class EconomicService extends BaseService {
/** /**
@@ -16,7 +16,6 @@ class EconomicService extends BaseService {
* customer_number_world: 678, * customer_number_world: 678,
* unit_number: 42, * unit_number: 42,
* payment_terms_number: 42, * payment_terms_number: 42,
* shipping_product_number: 42,
* layout_number: 42, * layout_number: 42,
* vatzone_number_eu: 42, * vatzone_number_eu: 42,
* vatzone_number_dk: 42, * vatzone_number_dk: 42,
@@ -198,7 +197,7 @@ class EconomicService extends BaseService {
async bookEconomicInvoice(orderId) { async bookEconomicInvoice(orderId) {
try { try {
const order = await this.orderService_.retrieve(orderId) const order = await this.orderService_.retrieve(orderId)
const { economicDraftId } = order.setMetadata const { economicDraftId } = order.metadata
if (!economicDraftId) { if (!economicDraftId) {
throw new MedusaError( throw new MedusaError(

File diff suppressed because it is too large Load Diff

View File

@@ -32,7 +32,7 @@
}, },
"scripts": { "scripts": {
"start": "nodemon --watch plugins/ --watch src/ --exec babel-node src/app.js", "start": "nodemon --watch plugins/ --watch src/ --exec babel-node src/app.js",
"watch": "babel -w src --out-dir dist --ignore **/__tests__", "watch": "babel -w src --out-dir dist/ --ignore **/__tests__",
"prepare": "cross-env NODE_ENV=production npm run build", "prepare": "cross-env NODE_ENV=production npm run build",
"build": "babel src -d dist", "build": "babel src -d dist",
"serve": "node dist/app.js", "serve": "node dist/app.js",
@@ -70,4 +70,4 @@
"winston": "^3.2.1" "winston": "^3.2.1"
}, },
"gitHead": "35e0930650d5f4aedf2610749cd131ae8b7e17cc" "gitHead": "35e0930650d5f4aedf2610749cd131ae8b7e17cc"
} }