Merge pull request 'Issues_Expense_2W Changes of Expense, Payment Request and Recurring Expense.' (#505) from Issues_Expense_2W into upgrade_Expense

Reviewed-on: #505
Merged
This commit is contained in:
pramod.mahajan 2025-11-07 11:29:53 +00:00
commit 4cbac98986
5 changed files with 259 additions and 255 deletions

View File

@ -35,7 +35,7 @@ const ExpenseByProject = () => {
const getSelectedTypeName = () => {
if (!selectedType) return "All Types";
const found = ExpenseTypes.find((t) => t.id === selectedType);
const found = ExpenseCategories.find((t) => t.id === selectedType);
return found ? found.name : "All Types";
};
@ -69,8 +69,8 @@ const ExpenseByProject = () => {
const ExpenseCategoryType = [
{id:1,category:"Category",label:"Category"},
{id:2,category:"Project",label:"Project"}
{ id: 1, category: "Category", label: "Category" },
{ id: 2, category: "Project", label: "Project" }
]
return (
@ -92,7 +92,7 @@ const ExpenseByProject = () => {
{viewMode}
</button>
<ul className="dropdown-menu dropdown-menu-end ">
{ExpenseCategoryType.map((cat)=>(
{ExpenseCategoryType.map((cat) => (
<li>
<button
className="dropdown-item"

View File

@ -19,6 +19,12 @@ const DocumentFilterPanel = forwardRef(
const { data, isError, isLoading, error } =
useDocumentFilterEntities(entityTypeId);
useEffect(() => {
return () => {
closePanel();
};
}, []);
//changes
const dynamicDocumentFilterDefaultValues = useMemo(() => {
@ -237,6 +243,6 @@ const DocumentFilterPanel = forwardRef(
</form>
</FormProvider>
);
});
});
export default DocumentFilterPanel;

View File

@ -519,7 +519,7 @@ function ManagePaymentRequest({ closeModal, requestToEdit = null }) {
? "Please Wait..."
: requestToEdit
? "Update"
: "Save as Draft"}
: "Submit"}
</button>
</div>
</form>

View File

@ -43,8 +43,7 @@ const PaymentRequestList = ({ filters, groupBy = "submittedBy", search }) => {
displayField = "Status";
break;
case "submittedBy":
key = `${item?.createdBy?.firstName ?? ""} ${
item.createdBy?.lastName ?? ""
key = `${item?.createdBy?.firstName ?? ""} ${item.createdBy?.lastName ?? ""
}`.trim();
displayField = "Submitted By";
break;
@ -98,8 +97,7 @@ const PaymentRequestList = ({ filters, groupBy = "submittedBy", search }) => {
label: "Submitted By",
align: "text-start",
getValue: (e) =>
`${e.createdBy?.firstName ?? ""} ${
e.createdBy?.lastName ?? ""
`${e.createdBy?.firstName ?? ""} ${e.createdBy?.lastName ?? ""
}`.trim() || "N/A",
customRender: (e) => (
<div
@ -113,8 +111,7 @@ const PaymentRequestList = ({ filters, groupBy = "submittedBy", search }) => {
lastName={e.createdBy?.lastName}
/>
<span className="text-truncate">
{`${e.createdBy?.firstName ?? ""} ${
e.createdBy?.lastName ?? ""
{`${e.createdBy?.firstName ?? ""} ${e.createdBy?.lastName ?? ""
}`.trim() || "N/A"}
</span>
</div>
@ -128,15 +125,12 @@ const PaymentRequestList = ({ filters, groupBy = "submittedBy", search }) => {
},
{
key: "amount",
label: " Amount",
align: "text-start",
getValue: (e) => (
<>
{formatCurrency(e?.amount)}&nbsp;{e.currency.currencyCode}
</>
),
align: "text-end px-3",
label: "Amount",
align: "text-end",
getValue: (e) =>
e?.amount
? `${e?.currency?.symbol ? e.currency.symbol + " " : ""}${e.amount.toLocaleString()}`
: "N/A",
},
{
key: "expenseStatus",
@ -144,8 +138,7 @@ const PaymentRequestList = ({ filters, groupBy = "submittedBy", search }) => {
align: "text-center",
getValue: (e) => (
<span
className={`badge bg-label-${
getColorNameFromHex(e?.expenseStatus?.color) || "secondary"
className={`badge bg-label-${getColorNameFromHex(e?.expenseStatus?.color) || "secondary"
}`}
>
{e?.expenseStatus?.name || "Unknown"}
@ -181,8 +174,13 @@ const PaymentRequestList = ({ filters, groupBy = "submittedBy", search }) => {
if (isLoading) return <ExpenseTableSkeleton headers={header} />;
const grouped = groupBy
? groupByField(data?.data ?? [], groupBy)
? Object.fromEntries(
Object.entries(groupByField(data?.data ?? [], groupBy)).sort(([keyA], [keyB]) =>
keyA.localeCompare(keyB)
)
)
: { All: data?.data ?? [] };
const IsGroupedByDate = [
{ key: "transactionDate", displayField: "Transaction Date" },
{ key: "createdAt", displayField: "created Date" },

View File

@ -68,7 +68,7 @@ const RecurringExpenseList = ({ search, filterStatuses }) => {
align: "text-end",
getValue: (e) =>
e?.amount
? `${e?.currency?.symbol || ""}${e.amount.toLocaleString()}`
? `${e?.currency?.symbol ? e.currency.symbol + " " : ""}${e.amount.toLocaleString()}`
: "N/A",
},
{