diff --git a/components/admin/lists/filterable.tsx b/components/admin/lists/filterable.tsx index 345dc1ab..9e42b2e1 100644 --- a/components/admin/lists/filterable.tsx +++ b/components/admin/lists/filterable.tsx @@ -51,8 +51,15 @@ export const filterItems = (items, filters) => { } else if (filter.field == 'passes') { const matches = person[filter.field].map((pass) => pass.toLowerCase()).join(', ').includes(filterValue.toLowerCase()) excludePerson = excludePerson || (invertFilter ? matches : !matches) - } else if (filter.field == 'signed_in') { - excludePerson = excludePerson || (filterValue == true && !person[filter.field]) || (person[filter.field] && format(new Date(person[filter.field]), 'eee') != filterValue) + } else if (filter.field == 'checkin_at') { + excludePerson = excludePerson + || (true == filterValue && false == person[filter.field]) // Exclude anyone who hasn't checked in + || (false == filterValue && false != person[filter.field]) // Exclude anyone who has checked in + || (!invertFilter && ![true,false].includes(filterValue) && (person[filter.field] == false || format(new Date(person[filter.field]), 'eee').toLowerCase() != filterValue.toLowerCase())) // Exlude anyone if we're not search for true or false and the day matches + || (invertFilter && ![true,false].includes(filterValue) && (person[filter.field] == false || format(new Date(person[filter.field]), 'eee').toLowerCase() == filterValue.toLowerCase())) // Exlude anyonee if we're not search for true or false and the day DOESNT matche and we've inverted the filter + if(['2212652493','5060423521'].includes(person.ticket_number)) { + console.log("FILTER",person.name,filter.field,filterValue,person[filter.field],excludePerson,format(new Date(person[filter.field]), 'eee')) + } } else if (filter.field == 'active') { excludePerson = excludePerson || person[filter.field] != filterValue } else { diff --git a/components/admin/scan/ScanSuccessDialog.tsx b/components/admin/scan/ScanSuccessDialog.tsx index 119a3835..c318d89a 100644 --- a/components/admin/scan/ScanSuccessDialog.tsx +++ b/components/admin/scan/ScanSuccessDialog.tsx @@ -26,10 +26,10 @@ const accessToWristbands = (accesCode: number[], line_items: line_item[]) => { const classPass = line_items.filter((li) => { return /Class\sPass/.test(li.description)}).length > 0 || (accesCode[1] > 0 && accesCode[4] > 0) && !fullPassLike const saturdayPass = line_items.filter((li) => { return /Saturday\sPass/.test(li.description) }).length > 0 || (accesCode[1] > 0 && accesCode[3] > 0) && !fullPassLike const sundayPass = line_items.filter((li) => { return /Sunday\sPass/.test(li.description) }).length > 0 || (accesCode[4] > 0 && accesCode[5] > 0) && !fullPassLike - const saturdayClass = line_items.filter((li) => { return /Saturday\s-\sClass/.test(li.description) }).length > 0 || (accesCode[1] > 0 && !saturdayPass) && !fullPassLike - const saturdayParty = line_items.filter((li) => { return /Saturday\s-\sParty/.test(li.description) || /Dine\sand\sDance\sPass/.test(li.description) }).length > 0 || (accesCode[3] > 0 && !saturdayPass) && !fullPassLike - const sundayClass = line_items.filter((li) => { return /Sunday\s-\sClass/.test(li.description) }).length > 0 || (accesCode[4] > 0 && !sundayPass) && !fullPassLike - const sundayParty = line_items.filter((li) => { return /Sunday\s-\sParty/.test(li.description) }).length > 0 || (accesCode[5] > 0 && !sundayPass) && !fullPassLike + const saturdayClass = line_items.filter((li) => { return /Saturday\s-\sClass/.test(li.description) }).length > 0 || (accesCode[1] > 0 && !saturdayPass && !classPass) && !fullPassLike + const saturdayParty = line_items.filter((li) => { return /Saturday\s-\sParty/.test(li.description) || /Dine\sand\sDance\sPass/.test(li.description) }).length > 0 || (accesCode[3] > 0 && !saturdayPass && !partyPass) && !fullPassLike + const sundayClass = line_items.filter((li) => { return /Sunday\s-\sClass/.test(li.description) }).length > 0 || (accesCode[4] > 0 && !sundayPass && !classPass) && !fullPassLike + const sundayParty = line_items.filter((li) => { return /Sunday\s-\sParty/.test(li.description) }).length > 0 || (accesCode[5] > 0 && !sundayPass && !partyPass) && !fullPassLike if(meal) { wristBands.push({ colour: "bg-white text-black", diff --git a/components/admin/ticketList.tsx b/components/admin/ticketList.tsx index 67ad77dc..c2af80de 100644 --- a/components/admin/ticketList.tsx +++ b/components/admin/ticketList.tsx @@ -150,10 +150,10 @@ export default function TicketList() { - + Check-in? - { sortFieldToggler('signed_in') } + { sortFieldToggler('checkin_at') } diff --git a/components/admin/till.tsx b/components/admin/till.tsx index 67d01404..46fd088d 100644 --- a/components/admin/till.tsx +++ b/components/admin/till.tsx @@ -33,7 +33,12 @@ const Till = ({fullPassFunction,scrollToElement}:{fullPassFunction?:Function,scr const [payments,setPayments] = useState([] as any[]) const [ticket,setTicket] = useState(false as any) const [selectedAccessArray, setSelectedAccessArray] = useState([]) - + + const tillColours = { + TILL1: "bg-chillired-500 text-white", + TILL2: "bg-blue-400 text-white", + TILL3: "bg-gold-400 text-black", + } // const router = useRouter() @@ -216,7 +221,7 @@ const Till = ({fullPassFunction,scrollToElement}:{fullPassFunction?:Function,scr md:grid-cols-4 md:pt-12 md:mx-3 md:text-base "> { ticket ?
{setTicket(false); console.log("Checkin")}}/>
: null } -

{till}

+

{till}

) :
-

Select Till

-
- - - +

Select Till

+
+ + + {/* */}