mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-11 17:27:31 +02:00
Merge pull request #69 from R0m1k3/1.1
Add pagination to orders and center the difference column with right-…
This commit is contained in:
2 files changed
+29
-26
No files matched your search
@@ -434,23 +434,25 @@ export default function BLReconciliation() {
|
||||
</div>
|
||||
</td>
|
||||
<td className="px-6 py-4 whitespace-nowrap text-center">
|
||||
{(() => {
|
||||
const blAmount = delivery.blAmount ? parseFloat(delivery.blAmount) : 0;
|
||||
const invoiceAmount = delivery.invoiceAmount ? parseFloat(delivery.invoiceAmount) : 0;
|
||||
if (blAmount && invoiceAmount) {
|
||||
const diff = blAmount - invoiceAmount;
|
||||
const diffAbs = Math.abs(diff);
|
||||
return (
|
||||
<div className={`font-medium ${
|
||||
diff === 0 ? 'text-green-600' :
|
||||
diffAbs > 10 ? 'text-red-600' : 'text-orange-600'
|
||||
}`}>
|
||||
{diff > 0 ? '+' : ''}{diff.toFixed(2)}€
|
||||
</div>
|
||||
);
|
||||
}
|
||||
return <span className="text-gray-400 italic text-xs">-</span>;
|
||||
})()}
|
||||
<div className="flex justify-center">
|
||||
{(() => {
|
||||
const blAmount = delivery.blAmount ? parseFloat(delivery.blAmount) : 0;
|
||||
const invoiceAmount = delivery.invoiceAmount ? parseFloat(delivery.invoiceAmount) : 0;
|
||||
if (blAmount && invoiceAmount) {
|
||||
const diff = blAmount - invoiceAmount;
|
||||
const diffAbs = Math.abs(diff);
|
||||
return (
|
||||
<div className={`font-medium text-right ${
|
||||
diff === 0 ? 'text-green-600' :
|
||||
diffAbs > 10 ? 'text-red-600' : 'text-orange-600'
|
||||
}`}>
|
||||
{diff > 0 ? '+' : ''}{diff.toFixed(2)}€
|
||||
</div>
|
||||
);
|
||||
}
|
||||
return <span className="text-gray-400 italic text-xs">-</span>;
|
||||
})()}
|
||||
</div>
|
||||
</td>
|
||||
<td className="px-6 py-4 whitespace-nowrap">
|
||||
<div className="text-sm text-gray-900">
|
||||
|
||||
@@ -411,15 +411,16 @@ export default function Orders() {
|
||||
</div>
|
||||
|
||||
{/* Pagination */}
|
||||
<Pagination
|
||||
currentPage={currentPage}
|
||||
totalPages={totalPages}
|
||||
totalItems={totalItems}
|
||||
itemsPerPage={itemsPerPage}
|
||||
onPageChange={setCurrentPage}
|
||||
onItemsPerPageChange={setItemsPerPage}
|
||||
className="mt-4 p-4 border-t border-gray-200"
|
||||
/>
|
||||
<div className="p-4 border-t border-gray-200">
|
||||
<Pagination
|
||||
currentPage={currentPage}
|
||||
totalPages={totalPages}
|
||||
totalItems={totalItems}
|
||||
itemsPerPage={itemsPerPage}
|
||||
onPageChange={setCurrentPage}
|
||||
onItemsPerPageChange={setItemsPerPage}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
Reference in new issue
Block a user