mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-23 15:08:22 +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>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td className="px-6 py-4 whitespace-nowrap text-center">
|
<td className="px-6 py-4 whitespace-nowrap text-center">
|
||||||
{(() => {
|
<div className="flex justify-center">
|
||||||
const blAmount = delivery.blAmount ? parseFloat(delivery.blAmount) : 0;
|
{(() => {
|
||||||
const invoiceAmount = delivery.invoiceAmount ? parseFloat(delivery.invoiceAmount) : 0;
|
const blAmount = delivery.blAmount ? parseFloat(delivery.blAmount) : 0;
|
||||||
if (blAmount && invoiceAmount) {
|
const invoiceAmount = delivery.invoiceAmount ? parseFloat(delivery.invoiceAmount) : 0;
|
||||||
const diff = blAmount - invoiceAmount;
|
if (blAmount && invoiceAmount) {
|
||||||
const diffAbs = Math.abs(diff);
|
const diff = blAmount - invoiceAmount;
|
||||||
return (
|
const diffAbs = Math.abs(diff);
|
||||||
<div className={`font-medium ${
|
return (
|
||||||
diff === 0 ? 'text-green-600' :
|
<div className={`font-medium text-right ${
|
||||||
diffAbs > 10 ? 'text-red-600' : 'text-orange-600'
|
diff === 0 ? 'text-green-600' :
|
||||||
}`}>
|
diffAbs > 10 ? 'text-red-600' : 'text-orange-600'
|
||||||
{diff > 0 ? '+' : ''}{diff.toFixed(2)}€
|
}`}>
|
||||||
</div>
|
{diff > 0 ? '+' : ''}{diff.toFixed(2)}€
|
||||||
);
|
</div>
|
||||||
}
|
);
|
||||||
return <span className="text-gray-400 italic text-xs">-</span>;
|
}
|
||||||
})()}
|
return <span className="text-gray-400 italic text-xs">-</span>;
|
||||||
|
})()}
|
||||||
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td className="px-6 py-4 whitespace-nowrap">
|
<td className="px-6 py-4 whitespace-nowrap">
|
||||||
<div className="text-sm text-gray-900">
|
<div className="text-sm text-gray-900">
|
||||||
|
|||||||
@@ -411,15 +411,16 @@ export default function Orders() {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Pagination */}
|
{/* Pagination */}
|
||||||
<Pagination
|
<div className="p-4 border-t border-gray-200">
|
||||||
currentPage={currentPage}
|
<Pagination
|
||||||
totalPages={totalPages}
|
currentPage={currentPage}
|
||||||
totalItems={totalItems}
|
totalPages={totalPages}
|
||||||
itemsPerPage={itemsPerPage}
|
totalItems={totalItems}
|
||||||
onPageChange={setCurrentPage}
|
itemsPerPage={itemsPerPage}
|
||||||
onItemsPerPageChange={setItemsPerPage}
|
onPageChange={setCurrentPage}
|
||||||
className="mt-4 p-4 border-t border-gray-200"
|
onItemsPerPageChange={setItemsPerPage}
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|||||||
Reference in new issue
Block a user