Skip to content

Commit

Permalink
Merge pull request #746 from odisha-muktasoft/UCEM-843-6-UAT
Browse files Browse the repository at this point in the history
filtering with projectId in view page and amount format changed
  • Loading branch information
Tulika-eGov authored Oct 23, 2024
2 parents d36f67e + dfd9f99 commit 7d6aa45
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"@egovernments/digit-ui-module-estimate": "0.4.21",
"@egovernments/digit-ui-module-masters": "0.4.20",
"@egovernments/digit-ui-module-project": "0.4.16",
"@egovernments/digit-ui-module-expenditure": "0.4.19",
"@egovernments/digit-ui-module-expenditure": "0.4.20",
"@egovernments/digit-ui-customisation-mukta": "0.2.13",
"@egovernments/digit-ui-module-rate-analysis": "0.4.16",
"http-proxy-middleware": "^1.0.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3267,31 +3267,31 @@ export const UICustomizations = {
}
if (key === "EXP_ESTIMATED_AMT") {
value = value || 0;
return <Amount customStyle={{ textAlign: "right", minWidth: "120px" }} value={value?.toFixed(2)} roundOff={false} sameDisplay={true} rupeeSymbol={true} t={t}></Amount>;
return <Amount customStyle={{ textAlign: "right", minWidth: "120px" }} value={value?.toFixed(2)} roundOff={false} decimalPlaces={2} rupeeSymbol={true} t={t}></Amount>;
}
if (key === "EXP_WAGE_PAYMENT_SUCCESS") {
value = value || 0;
return <Amount customStyle={{ textAlign: "right", minWidth: "120px" }} value={value?.toFixed(2)} roundOff={false} sameDisplay={true} rupeeSymbol={true} t={t}></Amount>;
return <Amount customStyle={{ textAlign: "right", minWidth: "120px" }} value={value?.toFixed(2)} roundOff={false} decimalPlaces={2} rupeeSymbol={true} t={t}></Amount>;
}
if (key === "EXP_WAGE_PAYMENT_FAILED") {
value = value || 0;
return <Amount customStyle={{ textAlign: "right", minWidth: "120px" }} value={value?.toFixed(2)} roundOff={false} sameDisplay={true} rupeeSymbol={true} t={t}></Amount>;
return <Amount customStyle={{ textAlign: "right", minWidth: "120px" }} value={value?.toFixed(2)} roundOff={false} decimalPlaces={2} rupeeSymbol={true} t={t}></Amount>;
}
if (key === "EXP_PUR_PAYMENT_SUCCESS") {
value = value || 0;
return <Amount customStyle={{ textAlign: "right", minWidth: "120px" }} value={value?.toFixed(2)} roundOff={false} sameDisplay={true} rupeeSymbol={true} t={t}></Amount>;
return <Amount customStyle={{ textAlign: "right", minWidth: "120px" }} value={value?.toFixed(2)} roundOff={false} decimalPlaces={2} rupeeSymbol={true} t={t}></Amount>;
}
if (key === "EXP_PUR_PAYMENT_FAILED") {
value = value || 0;
return <Amount customStyle={{ textAlign: "right", minWidth: "120px" }} value={value?.toFixed(2)} roundOff={false} sameDisplay={true} rupeeSymbol={true} t={t}></Amount>;
return <Amount customStyle={{ textAlign: "right", minWidth: "120px" }} value={value?.toFixed(2)} roundOff={false} decimalPlaces={2} rupeeSymbol={true} t={t}></Amount>;
}
if (key === "EXP_SUP_PAYMENT_SUCCESS") {
value = value || 0;
return <Amount customStyle={{ textAlign: "right", minWidth: "120px" }} value={value?.toFixed(2)} roundOff={false} sameDisplay={true} rupeeSymbol={true} t={t}></Amount>;
return <Amount customStyle={{ textAlign: "right", minWidth: "120px" }} value={value?.toFixed(2)} roundOff={false} decimalPlaces={2} rupeeSymbol={true} t={t}></Amount>;
}
if (key === "EXP_SUP_PAYMENT_FAILED") {
value = value || 0;
return <Amount customStyle={{ textAlign: "right", minWidth: "120px" }} value={value?.toFixed(2)} roundOff={false} sameDisplay={true} rupeeSymbol={true} t={t}></Amount>;
return <Amount customStyle={{ textAlign: "right", minWidth: "120px" }} value={value?.toFixed(2)} roundOff={false} decimalPlaces={2} rupeeSymbol={true} t={t}></Amount>;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const paymentTrackerReport = (props) => {
})
})
for (let i = 2; i < data.stickyFooterRow.length; i++) {
data.stickyFooterRow[i].value = "₹" + data.stickyFooterRow[i].value?.toFixed(2);
data.stickyFooterRow[i].value = "₹" + Digit.Utils.dss.formatterWithoutRound(parseFloat(data.stickyFooterRow[i].value || 0).toFixed(2),"number",undefined,true,undefined,2);
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@egovernments/digit-ui-module-expenditure",
"version": "0.4.19",
"version": "0.4.20",
"description": "Expenditure Management Module UI",
"main": "dist/index.js",
"module": "dist/index.modern.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ const PaymentTrackerTable = ({excludeFailed, setExcludeFailed, ...props}) => {
const history = useHistory();

const [tableRows, setTableRows] = useState(props?.tableRows);

const amountFormatter = (amount) => {
return Digit.Utils.dss.formatterWithoutRound(parseFloat(amount).toFixed(2),"number",undefined,true,undefined,2);
}

const tableColumns = useMemo(()=>{
return [
Expand Down Expand Up @@ -42,7 +38,7 @@ const PaymentTrackerTable = ({excludeFailed, setExcludeFailed, ...props}) => {
Cell: ({ value, column, row }) => {
return (
<div style={{ textAlign: 'right' }}>
{amountFormatter(value)}
{Digit.Utils.dss.formatterWithoutRound(parseFloat(value || 0).toFixed(2),"number",undefined,true,undefined,2)}
</div>
);
}
Expand Down Expand Up @@ -106,7 +102,7 @@ const PaymentTrackerTable = ({excludeFailed, setExcludeFailed, ...props}) => {
Cell: ({ value, column, row }) => {
return (
<div style={{ textAlign: 'right' }}>
{amountFormatter(value)}
{Digit.Utils.dss.formatterWithoutRound(parseFloat(value || 0).toFixed(2),"number",undefined,true,undefined,2)}
</div>
);
}
Expand Down Expand Up @@ -143,7 +139,7 @@ const PaymentTrackerTable = ({excludeFailed, setExcludeFailed, ...props}) => {
Cell: ({ value, column, row }) => {
return (
<div style={{ textAlign: 'right' }}>
{amountFormatter(value)}
{Digit.Utils.dss.formatterWithoutRound(parseFloat(value || 0).toFixed(2),"number",undefined,true,undefined,2)}
</div>
);
}
Expand All @@ -158,7 +154,7 @@ const PaymentTrackerTable = ({excludeFailed, setExcludeFailed, ...props}) => {
Cell: ({ value, column, row }) => {
return (
<div style={{ textAlign: 'right' }}>
{amountFormatter(value)}
{Digit.Utils.dss.formatterWithoutRound(parseFloat(value || 0).toFixed(2),"number",undefined,true,undefined,2)}
</div>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const ViewTotalPaymentAmount = (props) => {
<div style={{ display: "flex", justifyContent: "flex-end", marginTop: "16px"}}>
<CardSectionHeader style={{ marginRight: "2rem", marginTop: "1rem", fontWeight:"700" }}>{t("TOTAL")}</CardSectionHeader>
<div style={{ display: "flex", flexDirection: 'row', justifyContent: "space-between", padding: "1rem", border: "1px solid #D6D5D4", borderRadius: "5px" }}>
<CardSectionHeader style={{ fontSize:"24px", fontWeight:"700"}}>{`₹ ${Digit.Utils.dss.formatterWithoutRound(Math.round(parseFloat(amount)).toFixed(2),"number",undefined,true,undefined,2)}`}</CardSectionHeader>
<CardSectionHeader style={{ fontSize:"24px", fontWeight:"700"}}>{`₹ ${Digit.Utils.dss.formatterWithoutRound(parseFloat(amount || 0).toFixed(2),"number",undefined,true,undefined,2)}`}</CardSectionHeader>
</div>
</div>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const paymentTrackerViewConfig = (project, projectBillPaidData ,projectBi
const tableRows = transformBillData({projectBillData});

const amountFormatter = (amount) => {
return Digit.Utils.dss.formatterWithoutRound(Math.round(parseFloat(amount)).toFixed(2),"number",undefined,true,undefined,2);
return Digit.Utils.dss.formatterWithoutRound(parseFloat(amount).toFixed(2),"number",undefined,true,undefined,2);
}

return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const PaymentTrackerView = () => {
Digit.Utils.downloadEgovPDF("paymentTracker/payment-tracker", { projectId : projectId, tenantId }, `project-payments-${projectId}.pdf`);
};

const config = paymentTrackerViewConfig(projectData?.Project?.[0], billPaidData?.aggsResponse?.projects?.[0], billData?.items, projectId);
const config = paymentTrackerViewConfig(projectData?.Project?.[0], billPaidData?.aggsResponse?.projects?.filter((ob) => ob?.projectNumber === projectId)?.[0], billData?.items, projectId);

if (isProjectLoading || isBillPaidLoading || isBillLoading) {
return <Loader />;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const getBreakupDetails = ({projectBillPaidData}) => {

if (projectBillPaidData) {
projectBillPaidData?.paymentDetails?.map(bill => {
if (bill?.billType === "EXPENSE.WAGE") {
if (bill?.billType === "EXPENSE.WAGES") {
wageAmountPaid += bill?.paidAmount;
} else if (bill?.billType === "EXPENSE.PURCHASE") {
purchaseAmountPaid += bill?.paidAmount;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import React from "react";
const Amount = ({t,roundOff=true,...props}) => {
const value=roundOff?Math.round(props?.value):props?.value;
return (
<p style={props?.customStyle}>{props?.rupeeSymbol ? "₹" : ""}{value !== undefined && value !== null ? (props?.sameDisplay ? value : `${Digit?.Utils?.dss?.formatterWithoutRound(value, "number")}`) : t("ES_COMMON_NA")}</p>
<p style={props?.customStyle}>{props?.rupeeSymbol ? "₹" : ""}{value !== undefined && value !== null ? (props?.sameDisplay ? value : `${Digit?.Utils?.dss?.formatterWithoutRound(value, "number", undefined, true, undefined, props?.decimalPlaces)}`) : t("ES_COMMON_NA")}</p>
)
}

Expand Down
2 changes: 1 addition & 1 deletion frontend/micro-ui/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@egovernments/digit-ui-module-estimate": "0.4.21",
"@egovernments/digit-ui-module-masters": "0.4.20",
"@egovernments/digit-ui-module-project": "0.4.16",
"@egovernments/digit-ui-module-expenditure": "0.4.19",
"@egovernments/digit-ui-module-expenditure": "0.4.20",
"@egovernments/digit-ui-customisation-mukta": "0.2.13",
"@egovernments/digit-ui-module-rate-analysis": "0.4.16",
"babel-loader": "8.1.0",
Expand Down

0 comments on commit 7d6aa45

Please sign in to comment.