diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c37bfd35..6028a8cb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -127,6 +127,7 @@ build:dev: NEXT_PUBLIC_LTI_URL: 'https://dev-lti-erp.mbugroup.id' NEXT_PUBLIC_SSO_LOGIN_URL: 'https://dev-auth-erp.mbugroup.id' NEXT_PUBLIC_API_BASE_URL: 'https://dev-api-lti.mbugroup.id/api' + NEXT_PUBLIC_CLIENT_ID: 'Lumbung-Telur-Indonesia' deploy:dev: <<: *deploy_template diff --git a/next.config.ts b/next.config.ts index c781a8ac..b2d25eb6 100644 --- a/next.config.ts +++ b/next.config.ts @@ -3,6 +3,7 @@ import type { NextConfig } from 'next'; const nextConfig: NextConfig = { output: 'export', images: { unoptimized: true }, + trailingSlash: true, }; export default nextConfig; diff --git a/package-lock.json b/package-lock.json index 535bb986..f960d1c5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -36,9 +36,9 @@ "@types/node": "^20", "@types/react": "^19", "@types/react-dom": "^19", - "daisyui": "^5.1.12", + "daisyui": "^5.5.8", "eslint": "^9", - "eslint-config-next": "15.5.3", + "eslint-config-next": "^15.5.7", "husky": "^9.1.7", "prettier": "^3.6.2", "tailwindcss": "^4", @@ -1088,9 +1088,9 @@ "license": "MIT" }, "node_modules/@next/eslint-plugin-next": { - "version": "15.5.3", - "resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-15.5.3.tgz", - "integrity": "sha512-SdhaKdko6dpsSr0DldkESItVrnPYB1NS2NpShCSX5lc7SSQmLZt5Mug6t2xbiuVWEVDLZSuIAoQyYVBYp0dR5g==", + "version": "15.5.7", + "resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-15.5.7.tgz", + "integrity": "sha512-DtRU2N7BkGr8r+pExfuWHwMEPX5SD57FeA6pxdgCHODo+b/UgIgjE+rgWKtJAbEbGhVZ2jtHn4g3wNhWFoNBQQ==", "dev": true, "license": "MIT", "dependencies": { @@ -3067,9 +3067,9 @@ "peer": true }, "node_modules/daisyui": { - "version": "5.3.10", - "resolved": "https://registry.npmjs.org/daisyui/-/daisyui-5.3.10.tgz", - "integrity": "sha512-vmjyPmm0hvFhA95KB6uiGmWakziB2pBv6CUcs5Ka/3iMBMn9S+C3SZYx9G9l2JrgTZ1EFn61F/HrPcwaUm2kLQ==", + "version": "5.5.8", + "resolved": "https://registry.npmjs.org/daisyui/-/daisyui-5.5.8.tgz", + "integrity": "sha512-6psL9jIEOFOw68V10j/BKCWcRgx8dh81mmNxShr+g7HDM6UHNoPharlp9zq/PQkHNuGU1ZQsajR3HgpvavbRKQ==", "dev": true, "license": "MIT", "funding": { @@ -3576,13 +3576,13 @@ } }, "node_modules/eslint-config-next": { - "version": "15.5.3", - "resolved": "https://registry.npmjs.org/eslint-config-next/-/eslint-config-next-15.5.3.tgz", - "integrity": "sha512-e6j+QhQFOr5pfsc8VJbuTD9xTXJaRvMHYjEeLPA2pFkheNlgPLCkxdvhxhfuM4KGcqSZj2qEnpHisdTVs3BxuQ==", + "version": "15.5.7", + "resolved": "https://registry.npmjs.org/eslint-config-next/-/eslint-config-next-15.5.7.tgz", + "integrity": "sha512-nU/TRGHHeG81NeLW5DeQT5t6BDUqbpsNQTvef1ld/tqHT+/zTx60/TIhKnmPISTTe++DVo+DLxDmk4rnwHaZVw==", "dev": true, "license": "MIT", "dependencies": { - "@next/eslint-plugin-next": "15.5.3", + "@next/eslint-plugin-next": "15.5.7", "@rushstack/eslint-patch": "^1.10.3", "@typescript-eslint/eslint-plugin": "^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0", "@typescript-eslint/parser": "^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0", diff --git a/package.json b/package.json index 85485ee3..e1f92aaf 100644 --- a/package.json +++ b/package.json @@ -39,9 +39,9 @@ "@types/node": "^20", "@types/react": "^19", "@types/react-dom": "^19", - "daisyui": "^5.1.12", + "daisyui": "^5.5.8", "eslint": "^9", - "eslint-config-next": "15.5.3", + "eslint-config-next": "^15.5.7", "husky": "^9.1.7", "prettier": "^3.6.2", "tailwindcss": "^4", diff --git a/src/app/_closing/detail/page.tsx b/src/app/_closing/detail/page.tsx deleted file mode 100644 index fd11eeee..00000000 --- a/src/app/_closing/detail/page.tsx +++ /dev/null @@ -1,82 +0,0 @@ -'use client'; - -import { useRouter, useSearchParams } from 'next/navigation'; -import useSWR from 'swr'; -import { useId } from 'react'; -import SalesReportTable from '@/components/pages/closing/sale/SalesReportTable'; -import CosExpeditionReportTable from '@/components/pages/closing/hpp-ekspedisi/CosExpeditionReportTable'; -import { ClosingApi } from '@/services/api/closing'; -import { isResponseSuccess, isResponseError } from '@/lib/api-helper'; - -const ClosingDetailPage = () => { - const router = useRouter(); - const searchParams = useSearchParams(); - const penjualanId = useId(); - const hppEkspedisiId = useId(); - - const closingId = searchParams.get('closingId'); - - const { data: closing, isLoading: isLoadingClosing } = useSWR( - closingId ? `${closingId}-${penjualanId}` : null, - (id: string) => { - const numericId = parseInt(id.split('-')[0], 10); - if (isNaN(numericId) || numericId <= 0) { - throw new Error('Invalid closing ID'); - } - return ClosingApi.getPenjualan(numericId); - } - ); - - const { data: hpp_ekspedisi, isLoading: isLoadingHppEkspedisi } = useSWR( - closingId ? `${closingId}-${hppEkspedisiId}` : null, - (id: string) => { - const numericId = parseInt(id.split('-')[0], 10); - if (isNaN(numericId) || numericId <= 0) { - throw new Error('Invalid closing ID'); - } - return ClosingApi.getHppEkspedisi(numericId); - } - ); - - const isLoading = isLoadingClosing || isLoadingHppEkspedisi; - - if (!closingId) { - router.back(); - - return ( -
+ Please try refreshing the page or contact support if the problem + persists. +
+ +{bottomLabel}
+ )} + + {/* Pesan error */} + {isError && errorMessage && ( +{errorMessage}
+ )}{bottomLabel}
- )} - - {/* Pesan error */} - {isError && errorMessage && ( -{errorMessage}
- )} -| Lokasi | +: | +{initialValue?.location_name} | +
| Periode | +: | +{initialValue?.period} | +
| Kategori | +: | +{initialValue?.project_category} | +
| Populasi | +: | +{initialValue?.population} Ekor | +
| Jenis Project | +: | +{initialValue?.project_type} | +
| Kandang Aktif | +: | +{initialValue?.active_house_count} Kandang | +
| Status Pembayaran Penjualan | +: | +{initialValue?.sales_payment_status} | +
| Status Project | +: | +{initialValue?.project_status} | +
| Status Closing | +: | +{initialValue?.closing_status} | +
| Kandang Aktif | +: | +{initialValue?.active_house_count} Kandang | +
| Status Pembayaran Penjualan | +: | +{initialValue?.sales_payment_status} | +
| Status Project | +: | +{initialValue?.project_status} | +
| Status Closing | +: | +{initialValue?.closing_status} | +
| {pengajuanItem.nonstock.name} | {pengajuanItem.qty} | -{formatCurrency(pengajuanItem.total_price)} | +{formatCurrency(pengajuanItem.price)} | {pengajuanItem.note ?? '-'} | |||||||||||||||||||||||||||||||||||||
| {realisasiItem.nonstock.name} | {realisasiItem.qty} | -{formatCurrency(realisasiItem.total_price)} | +{formatCurrency(realisasiItem.price)} | {realisasiItem.note ?? '-'} | Tanggal Transaksi | : | - {formatDate(initialValues?.expense_date, 'DD MMMM YYYY')} + {formatDate( + initialValues?.transaction_date, + 'DD MMMM YYYY' + )} | ||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Nonstock | Total Kuantitas | -Total Biaya | +Harga Satuan | Catatan | |||||||||||||||||||||||||||||||||||||
| {pengajuanItem.nonstock.name} | {pengajuanItem.qty} | -- {formatCurrency(pengajuanItem.total_price)} - | +{formatCurrency(pengajuanItem.price)} | {pengajuanItem.note ?? '-'} | diff --git a/src/components/pages/expense/ExpensesTable.tsx b/src/components/pages/expense/ExpensesTable.tsx index 3a50f233..bbcb6c4e 100644 --- a/src/components/pages/expense/ExpensesTable.tsx +++ b/src/components/pages/expense/ExpensesTable.tsx @@ -263,11 +263,11 @@ const ExpensesTable = () => { }, }, { - accessorKey: 'expense_date', + accessorKey: 'transaction_date', header: 'Tanggal Pengajuan', cell: (props) => - props.row.original.expense_date - ? formatDate(props.row.original.expense_date, 'DD MMM YYYY') + props.row.original.transaction_date + ? formatDate(props.row.original.transaction_date, 'DD MMM YYYY') : '-', }, { diff --git a/src/components/pages/expense/form/ExpenseRealizationForm.schema.ts b/src/components/pages/expense/form/ExpenseRealizationForm.schema.ts index 863238b9..77db761c 100644 --- a/src/components/pages/expense/form/ExpenseRealizationForm.schema.ts +++ b/src/components/pages/expense/form/ExpenseRealizationForm.schema.ts @@ -27,7 +27,7 @@ type ExpenseRealizationFormSchemaType = { label: string; }; quantity?: number; - total_cost?: number; + price?: number; notes?: string; }[]; }[]; @@ -82,7 +82,7 @@ export const ExpenseRealizationFormSchema: Yup.ObjectSchema|||||||||||||||||||||||||||||||||||||
| Nonstock | Total Kuantitas | -Total Biaya | +Harga Satuan | Catatan |
- {(formik.values.cost_per_kandangs.length === 0 ||
+ {(formik.values.expense_nonstocks.length === 0 ||
!formik.values.supplier?.value) && (
@@ -122,9 +122,9 @@ const ExpenseRequestKandangDetailExpense: React.FC< Nonstock |
Total Kuantitas |
- Total Biaya |
+ Harga Satuan |
Catatan |
{type !== 'detail' && Aksi | }
|
+
+
+
+
+
+
+
+
+
+
+
+
|