mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-20 13:32:00 +00:00
Merge branch 'development' into 'staging'
Development See merge request mbugroup/lti-web-client!291
This commit is contained in:
@@ -1,10 +1,17 @@
|
|||||||
|
import Button from '@/components/Button';
|
||||||
|
|
||||||
const PermissionNotFound = () => {
|
const PermissionNotFound = () => {
|
||||||
return (
|
return (
|
||||||
<div className='w-full h-screen flex flex-col justify-center items-center gap-4'>
|
<div className='w-full h-screen flex flex-col justify-center items-center gap-4'>
|
||||||
<h2 className='text-2xl font-bold text-error'>Permission Not Found</h2>
|
<h2 className='text-2xl font-bold text-error'>
|
||||||
|
Hak Akses Tidak Ditemukan
|
||||||
|
</h2>
|
||||||
<p className='text-gray-600 text-center'>
|
<p className='text-gray-600 text-center'>
|
||||||
You do not have permission to access this page.
|
Anda tidak memiliki hak akses untuk mengakses halaman ini.
|
||||||
</p>
|
</p>
|
||||||
|
<Button href='/dashboard' className='text-base-100'>
|
||||||
|
Kembali ke Dashboard
|
||||||
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -86,6 +86,15 @@ const MovementForm = ({ type = 'add', initialValues }: MovementFormProps) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ===== USE SELECT HOOKS =====
|
// ===== USE SELECT HOOKS =====
|
||||||
|
const {
|
||||||
|
setInputValue: setSourceWarehouseSelectInputValue,
|
||||||
|
isLoadingOptions: isLoadingSourceWarehouses,
|
||||||
|
loadMore: loadMoreSourceWarehouses,
|
||||||
|
rawData: sourceWarehouses,
|
||||||
|
} = useSelect<Warehouse>(WarehouseApi.basePath, 'id', 'name', 'search', {
|
||||||
|
transfer_context: 'inventory_transfer',
|
||||||
|
});
|
||||||
|
|
||||||
const {
|
const {
|
||||||
setInputValue: setWarehouseSelectInputValue,
|
setInputValue: setWarehouseSelectInputValue,
|
||||||
isLoadingOptions: isLoadingWarehouses,
|
isLoadingOptions: isLoadingWarehouses,
|
||||||
@@ -136,6 +145,25 @@ const MovementForm = ({ type = 'add', initialValues }: MovementFormProps) => {
|
|||||||
return stockMap;
|
return stockMap;
|
||||||
}, [allProductWarehouses]);
|
}, [allProductWarehouses]);
|
||||||
|
|
||||||
|
const sourceWarehouseOptions = useMemo(() => {
|
||||||
|
if (!isResponseSuccess(sourceWarehouses)) return [];
|
||||||
|
|
||||||
|
return (
|
||||||
|
sourceWarehouses?.data.map((w) => {
|
||||||
|
warehouseStockMap.get(w.id);
|
||||||
|
return {
|
||||||
|
value: w.id,
|
||||||
|
label: w.name,
|
||||||
|
area: w.area?.name,
|
||||||
|
location:
|
||||||
|
'type' in w && (w.type === 'LOKASI' || w.type === 'KANDANG')
|
||||||
|
? w.location?.name
|
||||||
|
: undefined,
|
||||||
|
};
|
||||||
|
}) || []
|
||||||
|
);
|
||||||
|
}, [sourceWarehouses, warehouseStockMap]);
|
||||||
|
|
||||||
const warehouseOptions = useMemo(() => {
|
const warehouseOptions = useMemo(() => {
|
||||||
if (!isResponseSuccess(warehouses)) return [];
|
if (!isResponseSuccess(warehouses)) return [];
|
||||||
|
|
||||||
@@ -1354,10 +1382,10 @@ const MovementForm = ({ type = 'add', initialValues }: MovementFormProps) => {
|
|||||||
placeholder='Pilih gudang asal...'
|
placeholder='Pilih gudang asal...'
|
||||||
value={formik.values.source_warehouse}
|
value={formik.values.source_warehouse}
|
||||||
onChange={handleSourceWarehouseChange}
|
onChange={handleSourceWarehouseChange}
|
||||||
options={warehouseOptions}
|
options={sourceWarehouseOptions}
|
||||||
onInputChange={setWarehouseSelectInputValue}
|
onInputChange={setSourceWarehouseSelectInputValue}
|
||||||
onMenuScrollToBottom={loadMoreWarehouses}
|
onMenuScrollToBottom={loadMoreSourceWarehouses}
|
||||||
isLoading={isLoadingWarehouses}
|
isLoading={isLoadingSourceWarehouses}
|
||||||
isError={
|
isError={
|
||||||
formik.touched.source_warehouse_id &&
|
formik.touched.source_warehouse_id &&
|
||||||
Boolean(formik.errors.source_warehouse_id)
|
Boolean(formik.errors.source_warehouse_id)
|
||||||
|
|||||||
@@ -98,6 +98,7 @@ const TransferToLayingFormModal = () => {
|
|||||||
'search',
|
'search',
|
||||||
{
|
{
|
||||||
category: 'GROWING',
|
category: 'GROWING',
|
||||||
|
transfer_context: 'transfer_to_laying',
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,13 @@ import DebouncedTextInput from '@/components/input/DebouncedTextInput';
|
|||||||
import Card from '@/components/Card';
|
import Card from '@/components/Card';
|
||||||
import Collapse from '@/components/Collapse';
|
import Collapse from '@/components/Collapse';
|
||||||
|
|
||||||
import { cn, formatCurrency, formatDate, formatNumber } from '@/lib/helper';
|
import {
|
||||||
|
cn,
|
||||||
|
formatCurrency,
|
||||||
|
formatDate,
|
||||||
|
formatNumber,
|
||||||
|
formatVechicleNumber,
|
||||||
|
} from '@/lib/helper';
|
||||||
import { isResponseSuccess } from '@/lib/api-helper';
|
import { isResponseSuccess } from '@/lib/api-helper';
|
||||||
import { DailyMarketingRow } from '@/types/api/report/marketing';
|
import { DailyMarketingRow } from '@/types/api/report/marketing';
|
||||||
import { MarketingReportApi } from '@/services/api/report/marketing-report';
|
import { MarketingReportApi } from '@/services/api/report/marketing-report';
|
||||||
@@ -94,7 +100,9 @@ const DailyMarketingsTable = ({
|
|||||||
accessorKey: 'vehicle_number',
|
accessorKey: 'vehicle_number',
|
||||||
header: 'No. Polisi',
|
header: 'No. Polisi',
|
||||||
cell: (props) => (
|
cell: (props) => (
|
||||||
<span className='text-nowrap'>{props.row.original.vehicle_number}</span>
|
<span className='text-nowrap'>
|
||||||
|
{formatVechicleNumber(props.row.original.vehicle_number)}
|
||||||
|
</span>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ export const MAIN_DRAWER_LINKS: SidebarMenuItem[] = [
|
|||||||
text: 'Dashboard',
|
text: 'Dashboard',
|
||||||
link: '/dashboard',
|
link: '/dashboard',
|
||||||
icon: 'heroicons-outline:chart-bar-square',
|
icon: 'heroicons-outline:chart-bar-square',
|
||||||
|
permission: ['lti.dashboard.list'],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: 'Daily Checklist',
|
text: 'Daily Checklist',
|
||||||
@@ -138,26 +139,46 @@ export const MAIN_DRAWER_LINKS: SidebarMenuItem[] = [
|
|||||||
text: 'Laporan',
|
text: 'Laporan',
|
||||||
link: '/report',
|
link: '/report',
|
||||||
icon: 'mdi:chart-box-outline',
|
icon: 'mdi:chart-box-outline',
|
||||||
|
permission: [
|
||||||
|
'lti.repport.debtsupplier.list',
|
||||||
|
'lti.repport.customerpayment.list',
|
||||||
|
'lti.repport.purchasesupplier.list',
|
||||||
|
'lti.repport.expense.list',
|
||||||
|
'lti.repport.delivery.list',
|
||||||
|
'lti.repport.gethppperkandang.list',
|
||||||
|
'lti.repport.production_result.list',
|
||||||
|
],
|
||||||
submenu: [
|
submenu: [
|
||||||
{
|
{
|
||||||
text: 'Keuangan',
|
text: 'Keuangan',
|
||||||
link: '/report/finance',
|
link: '/report/finance',
|
||||||
|
permission: [
|
||||||
|
'lti.repport.debtsupplier.list',
|
||||||
|
'lti.repport.customerpayment.list',
|
||||||
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: 'Logistik & Persediaan',
|
text: 'Logistik & Persediaan',
|
||||||
link: '/report/logistic-stock',
|
link: '/report/logistic-stock',
|
||||||
|
permission: ['lti.repport.purchasesupplier.list'],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: 'Biaya Operasional',
|
text: 'Biaya Operasional',
|
||||||
link: '/report/expense',
|
link: '/report/expense',
|
||||||
|
permission: ['lti.repport.expense.list'],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: 'Penjualan',
|
text: 'Penjualan',
|
||||||
link: '/report/marketing',
|
link: '/report/marketing',
|
||||||
|
permission: [
|
||||||
|
'lti.repport.delivery.list',
|
||||||
|
'lti.repport.gethppperkandang.list',
|
||||||
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: 'Hasil Produksi',
|
text: 'Hasil Produksi',
|
||||||
link: '/report/production-result',
|
link: '/report/production-result',
|
||||||
|
permission: ['lti.repport.production_result.list'],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -206,6 +227,7 @@ export const MAIN_DRAWER_LINKS: SidebarMenuItem[] = [
|
|||||||
'lti.master.suppliers.list',
|
'lti.master.suppliers.list',
|
||||||
'lti.master.uoms.list',
|
'lti.master.uoms.list',
|
||||||
'lti.master.warehouses.list',
|
'lti.master.warehouses.list',
|
||||||
|
'lti.master.production_standards.list',
|
||||||
],
|
],
|
||||||
submenu: [
|
submenu: [
|
||||||
{
|
{
|
||||||
@@ -276,6 +298,7 @@ export const MAIN_DRAWER_LINKS: SidebarMenuItem[] = [
|
|||||||
{
|
{
|
||||||
text: 'Standar Produksi',
|
text: 'Standar Produksi',
|
||||||
link: '/master-data/production-standard',
|
link: '/master-data/production-standard',
|
||||||
|
permission: ['lti.master.production_standards.list'],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -116,7 +116,10 @@ export const ROUTE_PERMISSIONS: Record<string, string[]> = {
|
|||||||
// Report
|
// Report
|
||||||
'/report/logistic-stock/': ['lti.repport.purchasesupplier.list'],
|
'/report/logistic-stock/': ['lti.repport.purchasesupplier.list'],
|
||||||
'/report/expense/': ['lti.repport.expense.list'],
|
'/report/expense/': ['lti.repport.expense.list'],
|
||||||
'/report/marketing/': ['lti.repport.delivery.list'],
|
'/report/marketing/': [
|
||||||
|
'lti.repport.delivery.list',
|
||||||
|
'lti.repport.gethppperkandang.list',
|
||||||
|
],
|
||||||
'/report/production-result/': ['lti.repport.production_result.list'],
|
'/report/production-result/': ['lti.repport.production_result.list'],
|
||||||
'/report/finance/': [
|
'/report/finance/': [
|
||||||
'lti.repport.finance.list',
|
'lti.repport.finance.list',
|
||||||
|
|||||||
@@ -1478,6 +1478,8 @@ export function DailyChecklistContent() {
|
|||||||
inputWrapper: 'flex items-center',
|
inputWrapper: 'flex items-center',
|
||||||
label: 'font-semibold text-gray-900',
|
label: 'font-semibold text-gray-900',
|
||||||
}}
|
}}
|
||||||
|
maxSize={5242880} // 5 MB
|
||||||
|
bottomLabel='Ukuran file maksimal 5MB'
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
|
|||||||
Reference in New Issue
Block a user