diff --git a/.gitignore b/.gitignore index d86875dd..e47b8ec3 100644 --- a/.gitignore +++ b/.gitignore @@ -42,3 +42,6 @@ next-env.d.ts # idea .idea + +# claude +.claude diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c37bfd35..935cac46 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -73,8 +73,8 @@ stages: if [ "$CI_COMMIT_BRANCH" = "development" ]; then ENVIRONMENT_NAME="WEB-LTI-DEV" - elif [ "$CI_COMMIT_BRANCH" = "master" ]; then - ENVIRONMENT_NAME="WEB-LTI-PROD" + elif [ "$CI_COMMIT_BRANCH" = "staging" ]; then + ENVIRONMENT_NAME="WEB-LTI-STAGING" else ENVIRONMENT_NAME="UNKNOWN" fi @@ -122,11 +122,10 @@ build:dev: environment: name: development variables: - # NEXT_PUBLIC_API_BASE_URL: 'https://dev-api-lti.mbugroup.id' - # NEXT_PUBLIC_SSO_LOGIN_URL: 'https://dev-api-sso.mbugroup.id' 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 @@ -140,6 +139,32 @@ deploy:dev: environment: name: development url: https://dev-lti-erp.mbugroup.id + +# ====== STAGING (Branch staging) ====== +build:staging: + <<: *build_template + rules: + - if: '$CI_COMMIT_BRANCH == "staging"' + environment: + name: staging + variables: + NEXT_PUBLIC_LTI_URL: 'https://stg-lti-erp.mbugroup.id' + NEXT_PUBLIC_SSO_LOGIN_URL: 'https://stg-auth-erp.mbugroup.id' + NEXT_PUBLIC_API_BASE_URL: 'https://stg-api-lti.mbugroup.id/api' + NEXT_PUBLIC_CLIENT_ID: 'Lumbung-Telur-Indonesia' + +deploy:staging: + <<: *deploy_template + needs: ['build:staging'] + rules: + - if: '$CI_COMMIT_BRANCH == "staging"' + variables: + S3_BUCKET: 'stg-lti-erp.mbugroup.id' + AWS_REGION: 'ap-southeast-3' + CLOUDFRONT_DISTRIBUTION_ID: 'E2V6PPO1AUIU7H' + environment: + name: staging + url: https://stg-lti-erp.mbugroup.id # ====== PRODUCTION ====== # build:production: # <<: *build_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 01bff9ef..f0212474 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,7 @@ "clsx": "^2.1.1", "formik": "^2.4.6", "moment": "^2.30.1", - "next": "^15.5.7", + "next": "15.5.7", "react": "19.1.0", "react-day-picker": "^9.11.1", "react-dom": "19.1.0", diff --git a/package.json b/package.json index e1f92aaf..52fc6ce2 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "clsx": "^2.1.1", "formik": "^2.4.6", "moment": "^2.30.1", - "next": "^15.5.7", + "next": "15.5.7", "react": "19.1.0", "react-day-picker": "^9.11.1", "react-dom": "19.1.0", diff --git a/src/app/closing/detail/page.tsx b/src/app/closing/detail/page.tsx index 6225b8dd..1b4ebc45 100644 --- a/src/app/closing/detail/page.tsx +++ b/src/app/closing/detail/page.tsx @@ -19,6 +19,11 @@ const ClosingDetailPage = () => { (id: number) => ClosingApi.getGeneralInfo(id) ); + const { data: salesData, isLoading: isLoadingSales } = useSWR( + closingId ? `sales-${closingId}` : null, + () => ClosingApi.getPenjualan(Number(closingId)) + ); + if (!closingId) { router.back(); @@ -34,14 +39,18 @@ const ClosingDetailPage = () => { return; } + const isLoading = isLoadingClosing || isLoadingSales; + 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}
- )} -| {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 | }
|
+
+
+
+
+
+
+
+
+
+
+
+
|