Ignore:
Timestamp:
02/26/25 10:05:32 (5 weeks ago)
Author:
Naum Shapkarovski <naumshapkarovski@…>
Branches:
main
Children:
299af01
Parents:
5d6f37a
Message:

feat: implement employees

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sections/invoice/invoice-details.tsx

    r5d6f37a r057453c  
    1818import { fCurrency } from 'src/utils/format-number';
    1919// types
    20 import { Invoice } from 'mvpmasters-shared';
     20import { Invoice } from 'src/schemas';
    2121// components
    2222import Label from 'src/components/label';
     
    2828import { getQuantityType } from 'src/utils/get-invoice-quantity-type';
    2929import InvoiceToolbar from './invoice-toolbar';
     30import { updateInvoice } from 'src/api/invoice';
    3031
    3132// ----------------------------------------------------------------------
     
    5960  const handleChangeStatus = useCallback(
    6061    async (event: React.ChangeEvent<HTMLInputElement>) => {
    61       await updateDocument(collections.invoice, invoice.id, { status: event.target.value });
     62      // await updateDocument(collections.invoice, invoice.id, { status: event.target.value });
     63      await updateInvoice(invoice.id, {
     64        status: event.target.value as 'draft' | 'processing' | 'pending' | 'overdue' | 'paid',
     65      });
    6266      mutate([collections.invoice, invoice.id]);
    6367    },
     
    240244            {invoice.invoiceTo.name}
    241245            <br />
    242             {!!invoice.invoiceTo.companyId && (
     246            {!!invoice.invoiceTo.companyNumber && (
    243247              <>
    244                 Company ID: {invoice.invoiceTo.companyId}
     248                Company ID: {invoice.invoiceTo.companyNumber}
    245249                <br />
    246250              </>
     
    257261              Date Issued
    258262            </Typography>
    259             {fDate(invoice.createDate.toDate())}
     263            {fDate(invoice.createDate)}
    260264          </Stack>
    261265
     
    264268              Due Date
    265269            </Typography>
    266             {fDate(invoice.dueDate.toDate())}
     270            {fDate(invoice.dueDate)}
    267271          </Stack>
    268272        </Box>
Note: See TracChangeset for help on using the changeset viewer.