fix(prestashop): import dates in the shop time zone (1.1.15)

This commit is contained in:
fatequod
2026-09-25 11:46:21 +02:00
parent 93ebfe728d
commit 6b5e03246e
13 changed files with 269 additions and 24 deletions
+4 -3
View File
@@ -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,