This commit is contained in:
2024-10-18 20:42:14 +05:00
parent 55d12712e6
commit 87e8c10776

View File

@@ -106,30 +106,29 @@ async function fetchCardHistory(passport_serie, passport_id, card_number, card_e
return;
}
let insideTemplate = ``;
Array.from(result.transactions).map(transaction => {
insideTemplate += `<li style="background: #a3c1f5;color: black;" class="p-3 relative rounded-lg">
<strong>${transaction['actionName']}</strong> <strong>${transaction['opersum']}</strong> <strong>${transaction['currency']}</strong>
<strong style="top: 0; right: 0;" class="absolute p-2">${transaction['opername']}</strong>
<p><strong>${
new Date(transaction['trandate']).toLocaleDateString('en-GB', {
year: 'numeric',
month: '2-digit',
day: '2-digit',
}).replaceAll('/', '.')
}</strong></p>
</li>`
})
cardHistoryDetailContainer.innerHTML = `
<h4>Müşderi: <strong>${result.clientName}</strong></h4>
<h4>Şahamça: <strong>${result.depName}</strong></h4>
<h4 class="mb-4">Şertnama belgisi: <strong>${result.cardAccountNumber}</strong></h4>
<p>
<ul>
${Array.from(result.transactions).map(transaction => {
return `<li style="background: #a3c1f5;color: black;" class="p-3 relative rounded-lg">
<strong>${transaction['actionName']}</strong> <strong>${transaction['opersum']}</strong> <strong>${transaction['currency']}</strong>
<strong style="top: 0; right: 0;" class="absolute p-2">${transaction['opername']}</strong>
<p><strong>${
new Date(transaction['trandate']).toLocaleDateString('en-GB', {
year: 'numeric',
month: '2-digit',
day: '2-digit',
}).replaceAll('/', '.')
}</strong></p>
</li>`;
}) '<br />'}
</ul>
</p>
<p><ul>${insideTemplate}</ul></p>
`;
})
.catch(error => console.log('error', error))