Skip to content

Commit 280dc23

Browse files
committed
fix: sending new orders always with QTD_PARCELAS: 0
1 parent 466af67 commit 280dc23

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

functions/lib/integration/exports/orders-to-horus.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -321,22 +321,23 @@ module.exports = async ({ appSdk, storeId, auth }, orderId, opts = {}) => {
321321
const paymentMethodCode = transaction && transaction.payment_method.code
322322
subtotal += subtotal ? (amount.freight || 0) : 0
323323

324+
/*
324325
let vlr = subtotal || amount.total
325326
let qnt = 1
326327
if (transaction.installments) {
327328
const { number } = transaction.installments
328329
qnt = number
329330
vlr = (subtotal || amount.total) / number
330331
}
331-
332+
*/
332333
const body = {
333334
COD_EMPRESA: companyCode,
334335
COD_FILIAL: subsidiaryCode,
335336
COD_CLI: customerCodeHorus,
336337
COD_PED_VENDA: saleCodeHorus,
337338
COD_FORMA: getCodePayment(paymentMethodCode, appData.payments, transaction),
338-
VLR_PARCELA: parsePrice(vlr),
339-
QTD_PARCELAS: qnt,
339+
VLR_PARCELA: parsePrice(subtotal || amount.total),
340+
QTD_PARCELAS: 0,
340341
DATA_VENCIMENTO: parseDate(new Date(order.created_at))
341342
}
342343

0 commit comments

Comments
 (0)