@appcorp/fusion-storybook 0.2.97 → 0.2.99
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -102,10 +102,9 @@ export const useStudentFeeModule = () => {
|
|
|
102
102
|
}, [dispatch]);
|
|
103
103
|
const resetRecordFormState = useCallback(() => {
|
|
104
104
|
var _a, _b;
|
|
105
|
-
const
|
|
105
|
+
const dueDay = (_a = workspace === null || workspace === void 0 ? void 0 : workspace.dueDateLength) !== null && _a !== void 0 ? _a : 1;
|
|
106
106
|
const dueDate = new Date();
|
|
107
|
-
|
|
108
|
-
dueDate.setDate(dueDate.getDate() + days);
|
|
107
|
+
dueDate.setDate(dueDay);
|
|
109
108
|
dispatch({
|
|
110
109
|
type: STUDENT_FEE_ACTION_TYPES.SET_ERRORS,
|
|
111
110
|
payload: { errors: {} },
|
|
@@ -184,7 +183,7 @@ export const useStudentFeeModule = () => {
|
|
|
184
183
|
const fee = data;
|
|
185
184
|
const rawDueDate = fee.dueDate;
|
|
186
185
|
const dueDate = rawDueDate instanceof Date
|
|
187
|
-
? rawDueDate.
|
|
186
|
+
? `${rawDueDate.getFullYear()}-${String(rawDueDate.getMonth() + 1).padStart(2, "0")}-${String(rawDueDate.getDate()).padStart(2, "0")}`
|
|
188
187
|
: String(rawDueDate).slice(0, 10);
|
|
189
188
|
const originalFee = Number(fee.amount) + Number(fee.discountAmount || 0);
|
|
190
189
|
dispatch({
|
|
@@ -15,7 +15,7 @@ import { useStudentFeeModule } from "./context";
|
|
|
15
15
|
import { PAYMENT_STATUS_OPTIONS } from "./constants";
|
|
16
16
|
import { STUDENT_FEE_API_ROUTES, DISCOUNT_CODE_API_ROUTES, FEE_STRUCTURE_API_ROUTES, STUDENT_PROFILE_API_ROUTES, } from "../../constants";
|
|
17
17
|
import { getCachedWorkspaceSync } from "../workspace/cache";
|
|
18
|
-
import { API_METHODS,
|
|
18
|
+
import { API_METHODS, } from "@react-pakistan/util-functions";
|
|
19
19
|
import { DISCOUNT_TYPE, } from "../../type";
|
|
20
20
|
import { useTranslations } from "next-intl";
|
|
21
21
|
import { useFetch } from "@react-pakistan/util-functions/hooks/use-fetch";
|
|
@@ -148,5 +148,5 @@ export const StudentFeeForm = () => {
|
|
|
148
148
|
},
|
|
149
149
|
value: status,
|
|
150
150
|
});
|
|
151
|
-
return (_jsxs("div", { className: "grid grid-cols-1 gap-4", children: [studentProfileIdCombo, feeStructureIdCombo, discountCodeIdCombo, _jsx(EnhancedInput, { error: errors.discountAmount, id: "discountAmount", info: t("formDiscountAmountInfo"), label: t("formDiscountAmountLabel"), min: "0", onChange: (e) => handleChange("discountAmount", Number(e.target.value)), placeholder: "0.00", required: true, step: "0.01", type: "number", value: discountAmount || 0 }), _jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "amount", t }), id: "amount", info: t("formTotalAmountInfo"), label: t("formTotalAmountLabel"), min: "0", onChange: (e) => handleChange("amount", Number(e.target.value)), placeholder: "0.00", required: true, step: "0.01", type: "number", value: amount }), _jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "amountPaid", t }), id: "amountPaid", info: t("formAmountPaidInfo"), label: t("formAmountPaidLabel"), min: "0", onChange: (e) => handleChange("amountPaid", Number(e.target.value)), placeholder: "0.00", step: "0.01", type: "number", value: amountPaid }), _jsx(EnhancedInput, { disabled: true, error: getTranslatedError({ errors, key: "amountDue", t }), id: "amountDue", info: t("formAmountDueInfo"), label: t("formAmountDueLabel"), min: "0", onChange: (e) => handleChange("amountDue", Number(e.target.value)), placeholder: "0.00", step: "0.01", type: "number", value: amountDue }), _jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "dueDate", t }), id: "dueDate", info: t("formDueDateInfo"), label: t("formDueDateLabel"), onChange: (e) => handleChange("dueDate", e.target.value), required: true, type: "date", value:
|
|
151
|
+
return (_jsxs("div", { className: "grid grid-cols-1 gap-4", children: [studentProfileIdCombo, feeStructureIdCombo, discountCodeIdCombo, _jsx(EnhancedInput, { error: errors.discountAmount, id: "discountAmount", info: t("formDiscountAmountInfo"), label: t("formDiscountAmountLabel"), min: "0", onChange: (e) => handleChange("discountAmount", Number(e.target.value)), placeholder: "0.00", required: true, step: "0.01", type: "number", value: discountAmount || 0 }), _jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "amount", t }), id: "amount", info: t("formTotalAmountInfo"), label: t("formTotalAmountLabel"), min: "0", onChange: (e) => handleChange("amount", Number(e.target.value)), placeholder: "0.00", required: true, step: "0.01", type: "number", value: amount }), _jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "amountPaid", t }), id: "amountPaid", info: t("formAmountPaidInfo"), label: t("formAmountPaidLabel"), min: "0", onChange: (e) => handleChange("amountPaid", Number(e.target.value)), placeholder: "0.00", step: "0.01", type: "number", value: amountPaid }), _jsx(EnhancedInput, { disabled: true, error: getTranslatedError({ errors, key: "amountDue", t }), id: "amountDue", info: t("formAmountDueInfo"), label: t("formAmountDueLabel"), min: "0", onChange: (e) => handleChange("amountDue", Number(e.target.value)), placeholder: "0.00", step: "0.01", type: "number", value: amountDue }), _jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "dueDate", t }), id: "dueDate", info: t("formDueDateInfo"), label: t("formDueDateLabel"), onChange: (e) => handleChange("dueDate", e.target.value), required: true, type: "date", value: dueDate || "" }), statusCombo, _jsx(EnhancedTextarea, { error: getTranslatedError({ errors, key: "remarks", t }), id: "remarks", label: t("formRemarksLabel"), onChange: (e) => handleChange("remarks", e.target.value), placeholder: t("formRemarksPlaceholder"), value: remarks || "" }), _jsx(EnhancedCheckbox, { checked: enabled, error: getTranslatedError({ errors, key: "enabled", t }), id: "enabled", info: t("formEnabledInfo"), label: t("formEnabledLabel"), onCheckedChange: (checked) => handleChange("enabled", !!checked) })] }));
|
|
152
152
|
};
|