| @@ -39,12 +39,17 @@ const ProjectTotalFee: React.FC<Props> = ({ taskGroups }) => { | |||||
| })} | })} | ||||
| <Divider sx={{ paddingBlockStart: 2 }} /> | <Divider sx={{ paddingBlockStart: 2 }} /> | ||||
| <Stack direction="row" justifyContent="space-between"> | <Stack direction="row" justifyContent="space-between"> | ||||
| <Typography variant="h6">{t("Project Total Fee")}</Typography> | |||||
| <Typography variant="h6">{t("Sum of Payment Milestone Fee")}</Typography> | |||||
| <Typography>{moneyFormatter.format(projectTotal)}</Typography> | <Typography>{moneyFormatter.format(projectTotal)}</Typography> | ||||
| </Stack> | </Stack> | ||||
| <Divider sx={{ paddingBlockStart: 2 }} /> | |||||
| <Stack direction="row" justifyContent="space-between"> | |||||
| <Typography variant="h6">{t("Expected Total Fee")}</Typography> | |||||
| <Typography>{moneyFormatter.format(expectedTotalFee)}</Typography> | |||||
| </Stack> | |||||
| {projectTotal !== expectedTotalFee && ( | {projectTotal !== expectedTotalFee && ( | ||||
| <Typography variant="caption" color="warning.main" alignSelf="flex-end"> | <Typography variant="caption" color="warning.main" alignSelf="flex-end"> | ||||
| {t("Project total fee should be same as the expected total fee!")} | |||||
| {t("Sum of Payment Milestone Fee should be same as the expected total fee!")} | |||||
| </Typography> | </Typography> | ||||
| )} | )} | ||||
| </Stack> | </Stack> | ||||
| @@ -526,6 +526,7 @@ const InvoiceSearch: React.FC<Props> = ({ issuedInvoice, receivedInvoice, invoic | |||||
| <SearchResults<invoiceList> | <SearchResults<invoiceList> | ||||
| items={filteredIvoices} | items={filteredIvoices} | ||||
| columns={combinedColumns} | columns={combinedColumns} | ||||
| autoRedirectToFirstPage | |||||
| /> | /> | ||||
| } | } | ||||
| {/* { | {/* { | ||||
| @@ -34,7 +34,7 @@ const ProjectSearch: React.FC<Props> = ({ projects, projectCategories, abilities | |||||
| label: t("Client name"), | label: t("Client name"), | ||||
| paramName: "client", | paramName: "client", | ||||
| type: "autocomplete", | type: "autocomplete", | ||||
| options: uniqBy(projects.map((project) => ({value: project.client, label: project.client})), "value"), | |||||
| options: uniqBy(projects.map((project) => ({value: project.client, label: project.client})), "value").sort((a, b) => a.value >= b.value ? 1 : -1), | |||||
| }, | }, | ||||
| { | { | ||||
| label: t("Project category"), | label: t("Project category"), | ||||
| @@ -43,6 +43,7 @@ interface Props<T extends ResultWithId> { | |||||
| items: T[]; | items: T[]; | ||||
| columns: Column<T>[]; | columns: Column<T>[]; | ||||
| noWrapper?: boolean; | noWrapper?: boolean; | ||||
| autoRedirectToFirstPage?: boolean; | |||||
| } | } | ||||
| function isActionColumn<T extends ResultWithId>( | function isActionColumn<T extends ResultWithId>( | ||||
| @@ -55,6 +56,7 @@ function SearchResults<T extends ResultWithId>({ | |||||
| items, | items, | ||||
| columns, | columns, | ||||
| noWrapper, | noWrapper, | ||||
| autoRedirectToFirstPage, | |||||
| }: Props<T>) { | }: Props<T>) { | ||||
| const [page, setPage] = React.useState(0); | const [page, setPage] = React.useState(0); | ||||
| const [rowsPerPage, setRowsPerPage] = React.useState(10); | const [rowsPerPage, setRowsPerPage] = React.useState(10); | ||||
| @@ -63,7 +65,7 @@ function SearchResults<T extends ResultWithId>({ | |||||
| // When filtering the seraching critera, update the page to 0 | // When filtering the seraching critera, update the page to 0 | ||||
| // Please removce when the search Result has error | // Please removce when the search Result has error | ||||
| useEffect(() => { | useEffect(() => { | ||||
| setPage(0); | |||||
| if (autoRedirectToFirstPage === true) setPage(0); | |||||
| }, [items]); | }, [items]); | ||||
| const handleChangePage: TablePaginationProps["onPageChange"] = ( | const handleChangePage: TablePaginationProps["onPageChange"] = ( | ||||