fix(prestashop): import dates in the shop time zone (1.1.15)
This commit is contained in:
@@ -325,12 +325,13 @@ async function importFromPSOrder(orderId, api, config) {
|
||||
}
|
||||
|
||||
const totalPaidReal = parseFloat(order.total_paid_real) || 0;
|
||||
const createdAt = parsePrestashopDate(order.date_add, new Date(), config.timeZone);
|
||||
const payments = [];
|
||||
if (totalPaidReal > 0) {
|
||||
payments.push({
|
||||
amount: Math.round(totalPaidReal * 100) / 100,
|
||||
method: order.payment || 'PrestaShop',
|
||||
date: new Date(order.date_add),
|
||||
date: createdAt,
|
||||
transactionId: paymentTransactionId(config, order.id, totalPaidReal),
|
||||
});
|
||||
}
|
||||
@@ -386,7 +387,7 @@ async function importFromPSOrder(orderId, api, config) {
|
||||
discounts,
|
||||
invoice: invoiceDataForOrder,
|
||||
notes: customerNotes.map(text => ({ text, type: 'customer_message' })),
|
||||
createdAt: new Date(order.date_add),
|
||||
createdAt,
|
||||
});
|
||||
|
||||
if (!coreOrder?._id) {
|
||||
@@ -399,7 +400,7 @@ async function importFromPSOrder(orderId, api, config) {
|
||||
psOrderId: parseInt(order.id),
|
||||
orbitoOrderId: coreOrder._id,
|
||||
reference: order.reference || '',
|
||||
syncedAt: parsePrestashopDate(order.date_add, now),
|
||||
syncedAt: createdAt,
|
||||
paymentTotalSynced: totalPaidReal,
|
||||
paymentSyncedAt: totalPaidReal > 0 ? now : undefined,
|
||||
paymentCheckedAt: now,
|
||||
|
||||
Reference in New Issue
Block a user