mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-25 07:45:47 +00:00
refactor(FE-364): Refactor purchases export to use supplier reports
This commit is contained in:
@@ -313,7 +313,7 @@ const PurchasesPerSupplierTab = () => {
|
||||
end_date: tableFilterState.end_date || undefined,
|
||||
sort_by: tableFilterState.sort_by || undefined,
|
||||
filter_by: tableFilterState.filter_by || undefined,
|
||||
limit: 10000,
|
||||
limit: 100,
|
||||
page: 1,
|
||||
};
|
||||
|
||||
@@ -459,10 +459,6 @@ const PurchasesPerSupplierTab = () => {
|
||||
return;
|
||||
}
|
||||
|
||||
const allRows = allDataForExport.flatMap(
|
||||
(supplierReport) => supplierReport.rows
|
||||
);
|
||||
|
||||
const areaName =
|
||||
tableFilterState.area_id.length > 0
|
||||
? tableFilterState.area_id
|
||||
@@ -518,7 +514,7 @@ const PurchasesPerSupplierTab = () => {
|
||||
end_date: tableFilterState.end_date || '',
|
||||
};
|
||||
|
||||
await generatePurchasesPerSupplierPDF(allRows, exportParams);
|
||||
await generatePurchasesPerSupplierPDF(allDataForExport, exportParams);
|
||||
toast.success('PDF berhasil dibuat dan diunduh.');
|
||||
} catch {
|
||||
toast.error('Gagal membuat PDF. Silakan coba lagi.');
|
||||
@@ -821,7 +817,7 @@ const PurchasesPerSupplierTab = () => {
|
||||
/>
|
||||
<SelectInput
|
||||
label='Urutkan Berdasarkan'
|
||||
placeholder='Pilih Urutkan Berdasarkan'
|
||||
placeholder='Urutkan Berdasarkan'
|
||||
options={sortByOptions}
|
||||
value={
|
||||
sortByOptions?.find(
|
||||
|
||||
Reference in New Issue
Block a user