|
|
|
|
@ -6,10 +6,13 @@ import SearchForm from '@/components/SearchForm';
|
|
|
|
|
import dayjs from 'dayjs';
|
|
|
|
|
import useInvoiceStore from '@/stores/Invoice';
|
|
|
|
|
import { usingStorage } from "@/hooks/usingStorage";
|
|
|
|
|
import useFormStore from "@/stores/Form";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Index() {
|
|
|
|
|
const {travelAgencyId, } = usingStorage();
|
|
|
|
|
const [{agency, ...formValues}] = useFormStore(state => [state.formValuesToSub]);
|
|
|
|
|
const { travelAgencyId: myAgencyId } = usingStorage();
|
|
|
|
|
const travelAgencyId = agency || myAgencyId;
|
|
|
|
|
const [invoiceList, fetchInvoiceList] = useInvoiceStore((state) => [state.invoiceList, state.fetchInvoiceList]);
|
|
|
|
|
const navigate = useNavigate();
|
|
|
|
|
const { notification } = App.useApp();
|
|
|
|
|
@ -20,7 +23,7 @@ function Index() {
|
|
|
|
|
title: "Ref.No",
|
|
|
|
|
dataIndex: "GroupName",
|
|
|
|
|
key: "GroupName",
|
|
|
|
|
render: (text, record) => <NavLink to={`/invoice/detail/${record.key}/${record.gmd_gri_sn}`}>{text}</NavLink>,
|
|
|
|
|
render: (text, record) => <NavLink to={`/invoice/detail/${record.key}/${record.gmd_gri_sn}/${record.gmd_vei_sn}`}>{text}</NavLink>,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "Arrival Date",
|
|
|
|
|
@ -72,7 +75,7 @@ function Index() {
|
|
|
|
|
return (
|
|
|
|
|
<Space direction="vertical" style={{ width: "100%" }}>
|
|
|
|
|
<Row gutter={16}>
|
|
|
|
|
<Col md={16} sm={16} xs={24} >
|
|
|
|
|
<Col md={18} sm={18} xs={24} >
|
|
|
|
|
<SearchForm
|
|
|
|
|
initialValue={{
|
|
|
|
|
dates: [dayjs().subtract(2, 'M').startOf('M'), dayjs().endOf('M')],
|
|
|
|
|
@ -86,13 +89,13 @@ function Index() {
|
|
|
|
|
},
|
|
|
|
|
}}
|
|
|
|
|
onSubmit={(err, formVal, filedsVal) => {
|
|
|
|
|
fetchInvoiceList(travelAgencyId, formVal.referenceNo, formVal.startdate, formVal.enddate, formVal.invoiceStatus);
|
|
|
|
|
fetchInvoiceList(formVal.agency || travelAgencyId, formVal.referenceNo, formVal.startdate, formVal.enddate, formVal.invoiceStatus);
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
</Col>
|
|
|
|
|
<Col md={8} sm={8} xs={24} >
|
|
|
|
|
<Col md={6} sm={6} xs={24} >
|
|
|
|
|
<Space>
|
|
|
|
|
<Button icon={<AuditOutlined />} onClick={() => navigate(`/invoice/detail/0/395074`)}>
|
|
|
|
|
<Button icon={<AuditOutlined />} onClick={() => navigate(`/invoice/detail/0/395074/0`)}>
|
|
|
|
|
Misc. Invoice
|
|
|
|
|
</Button>
|
|
|
|
|
<Button icon={<AuditOutlined />} onClick={() => navigate(`/invoice/paid`)}>
|
|
|
|
|
|