Changeset 87c9f1e for src/sections
- Timestamp:
- 02/27/25 00:42:38 (5 weeks ago)
- Branches:
- main
- Children:
- 32e9876
- Parents:
- 3c5302a
- Location:
- src/sections
- Files:
-
- 7 edited
- 8 moved
Legend:
- Unmodified
- Added
- Removed
-
src/sections/invoice/invoice-details.tsx
r3c5302a r87c9f1e 261 261 Date Issued 262 262 </Typography> 263 {fDate(invoice. createDate)}263 {fDate(invoice.issueDate)} 264 264 </Stack> 265 265 -
src/sections/invoice/invoice-ee-pdf.tsx
r3c5302a r87c9f1e 129 129 discount, 130 130 invoiceTo, 131 createDate,131 issueDate, 132 132 totalAmount, 133 133 invoiceFrom, … … 229 229 <View style={styles.col6}> 230 230 <Text style={[styles.subtitle1, styles.mb4]}>Date Issued</Text> 231 <Text style={styles.body2}>{fDate( createDate)}</Text>231 <Text style={styles.body2}>{fDate(issueDate)}</Text> 232 232 </View> 233 233 <View style={styles.col6}> -
src/sections/invoice/invoice-mk-pdf.tsx
r3c5302a r87c9f1e 113 113 discount, 114 114 invoiceTo, 115 createDate,115 issueDate, 116 116 totalAmount, 117 117 invoiceFrom, … … 179 179 <View style={styles.col6}> 180 180 <Text style={[styles.subtitle1, styles.mb4]}>Date Issued</Text> 181 <Text style={styles.body2}>{fDate( createDate)}</Text>181 <Text style={styles.body2}>{fDate(issueDate)}</Text> 182 182 </View> 183 183 <View style={styles.col6}> -
src/sections/invoice/invoice-new-edit-form.tsx
r3c5302a r87c9f1e 81 81 const NewInvoiceSchema = Yup.object().shape({ 82 82 invoiceNumber: Yup.string().nullable().required('Invoice number is required'), 83 createDate: Yup.mixed<any>().nullable().required('Create date is required'),83 issueDate: Yup.mixed<any>().nullable().required('Create date is required'), 84 84 dueDate: Yup.mixed<any>() 85 85 .required('Due date is required') … … 87 87 'date-min', 88 88 'Due date must be later than create date', 89 (value, { parent }) => value.getTime() > parent. createDate.getTime()89 (value, { parent }) => value.getTime() > parent.issueDate.getTime() 90 90 ), 91 91 invoiceFrom: Yup.mixed<any>().nullable().required('Invoice from is required'), … … 117 117 ? currentInvoice?.invoiceNumber 118 118 : incrementInvoiceNumber(tenant?.lastInvoiceNumber), 119 createDate: currentInvoice?.createDate ? new Date(currentInvoice.createDate) : new Date(),119 issueDate: currentInvoice?.issueDate ? new Date(currentInvoice.issueDate) : new Date(), 120 120 dueDate: currentInvoice?.dueDate 121 121 ? new Date(currentInvoice.dueDate) … … 175 175 176 176 // Ensure dates are valid Date objects 177 const createDate = 178 data.createDate instanceof Date ? data.createDate : new Date(data.createDate); 177 const issueDate = data.issueDate instanceof Date ? data.issueDate : new Date(data.issueDate); 179 178 const dueDate = data.dueDate instanceof Date ? data.dueDate : new Date(data.dueDate); 180 179 181 180 const currentTime = new Date(); 182 createDate.setHours(181 issueDate.setHours( 183 182 currentTime.getHours(), 184 183 currentTime.getMinutes(), … … 197 196 invoiceNumber: incrementInvoiceNumber(tenant?.lastInvoiceNumber), 198 197 status: 'draft', 199 createDate,198 issueDate, 200 199 dueDate, 201 200 items: items.filter((item) => item.service !== null) as CreateInvoice['items'], … … 246 245 if (currentInvoice) { 247 246 // Ensure dates are valid Date objects 248 const createDate =249 data. createDate instanceof Date ? data.createDate : new Date(data.createDate);247 const issueDate = 248 data.issueDate instanceof Date ? data.issueDate : new Date(data.issueDate); 250 249 const dueDate = data.dueDate instanceof Date ? data.dueDate : new Date(data.dueDate); 251 250 … … 259 258 const writeData = { 260 259 ...data, 261 createDate,260 issueDate, 262 261 dueDate, 263 262 items, … … 312 311 313 312 // Ensure dates are valid Date objects 314 const createDate =315 data. createDate instanceof Date ? data.createDate : new Date(data.createDate);313 const issueDate = 314 data.issueDate instanceof Date ? data.issueDate : new Date(data.issueDate); 316 315 const dueDate = data.dueDate instanceof Date ? data.dueDate : new Date(data.dueDate); 317 316 … … 325 324 const writeData = { 326 325 ...data, 327 createDate,326 issueDate, 328 327 dueDate, 329 328 items, -
src/sections/invoice/invoice-new-edit-status-date.tsx
r3c5302a r87c9f1e 109 109 110 110 <Controller 111 name=" createDate"111 name="issueDate" 112 112 control={control} 113 113 render={({ field, fieldState: { error } }) => ( -
src/sections/invoice/invoice-table-row.tsx
r3c5302a r87c9f1e 51 51 sent, 52 52 invoiceNumber, 53 createDate,53 issueDate, 54 54 dueDate, 55 55 status, … … 60 60 } = row; 61 61 62 console.log( createDate);62 console.log(issueDate); 63 63 64 64 const confirmSend = useBoolean(); … … 107 107 <TableCell> 108 108 <ListItemText 109 primary={format(new Date( createDate), 'dd MMM yyyy')}110 secondary={format(new Date( createDate), 'p')}109 primary={format(new Date(issueDate), 'dd MMM yyyy')} 110 secondary={format(new Date(issueDate), 'p')} 111 111 primaryTypographyProps={{ typography: 'body2', noWrap: true }} 112 112 secondaryTypographyProps={{ -
src/sections/invoice/view/invoice-list-view.tsx
r3c5302a r87c9f1e 59 59 { id: 'currency', label: 'Currency' }, 60 60 { id: 'invoicePeriod', label: 'Invoice Period' }, 61 { id: ' createDate', label: 'Create' },61 { id: 'issueDate', label: 'Create' }, 62 62 { id: 'dueDate', label: 'Due' }, 63 63 { id: 'sent', label: 'Sent', align: 'center' }, … … 152 152 153 153 const table = useTable({ 154 defaultOrderBy: ' createDate',154 defaultOrderBy: 'issueDate', 155 155 defaultOrder: 'desc', 156 156 defaultDense: true, … … 166 166 collections.invoice, 167 167 JSON.stringify({ 168 where: [[' createDate', '>=', filters.startDate]],169 orderBy: ' createDate',168 where: [['issueDate', '>=', filters.startDate]], 169 orderBy: 'issueDate', 170 170 direction: 'desc', 171 171 }), … … 275 275 async (invoice: Invoice) => { 276 276 const serializedParams = JSON.stringify({ 277 where: [[' createDate', '>=', filters.startDate]],278 orderBy: ' createDate',277 where: [['issueDate', '>=', filters.startDate]], 278 orderBy: 'issueDate', 279 279 direction: 'desc', 280 280 }); … … 671 671 inputData = inputData.filter( 672 672 (invoice) => 673 fTimestamp(invoice. createDate.getTime()) >= fTimestamp(startDate.getTime()) &&674 fTimestamp(invoice. createDate.getTime()) <= fTimestamp(endDate.getTime())673 fTimestamp(invoice.issueDate.getTime()) >= fTimestamp(startDate.getTime()) && 674 fTimestamp(invoice.issueDate.getTime()) <= fTimestamp(endDate.getTime()) 675 675 ); 676 676 }
Note:
See TracChangeset
for help on using the changeset viewer.