From b83e94f4624de634b65cda255a2535b5a839ca93 Mon Sep 17 00:00:00 2001 From: PhatPhuckDave Date: Mon, 7 Jul 2025 16:37:35 +0200 Subject: [PATCH] Remove days/item/day wtf? --- src/components/JobCardDetails.tsx | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/src/components/JobCardDetails.tsx b/src/components/JobCardDetails.tsx index 91c04fb..f021b61 100644 --- a/src/components/JobCardDetails.tsx +++ b/src/components/JobCardDetails.tsx @@ -62,15 +62,6 @@ const JobCardDetails: React.FC = ({ job }) => { } }; - const sortedIncome = [...job.income].sort((a, b) => - new Date(b.date).getTime() - new Date(a.date).getTime() - ); - - const itemsSold = sortedIncome.reduce((sum, tx) => sum + tx.quantity, 0); - const saleStartTime = job.saleStart ? new Date(job.saleStart).getTime() : null; - const daysSinceStart = saleStartTime ? Math.max(1, Math.ceil((Date.now() - saleStartTime) / (1000 * 60 * 60 * 24))) : 0; - const itemsPerDay = daysSinceStart > 0 ? itemsSold / daysSinceStart : 0; - const DateField = ({ label, value, fieldName, icon }: { label: string; value: string | null; fieldName: string; icon: React.ReactNode }) => (
{icon} @@ -112,7 +103,7 @@ const JobCardDetails: React.FC = ({ job }) => { Created: {formatDateTime(job.created)}
- + = ({ job }) => { fieldName="jobEnd" icon={} /> - + = ({ job }) => { /> - {itemsPerDay > 0 && ( -
- Items/Day: {itemsPerDay.toFixed(2)} -
- )} - {job.billOfMaterials && job.billOfMaterials.length > 0 && (