Parcourir la source

[May Revert] Fix Thomas Feedback 157 & Email on 10/10/2025

main
cyril.tsui il y a 2 mois
Parent
révision
bafe481fb4
2 fichiers modifiés avec 6 ajouts et 5 suppressions
  1. +4
    -3
      src/components/CreateProject/CreateProject.tsx
  2. +2
    -2
      src/components/Report/FinancialStatusReportGen/FinancialStatusReportGen.tsx

+ 4
- 3
src/components/CreateProject/CreateProject.tsx Voir le fichier

@@ -533,6 +533,7 @@ const CreateProject: React.FC<Props> = ({
const expectedProjectFee = formProps.watch("expectedProjectFee"); const expectedProjectFee = formProps.watch("expectedProjectFee");
const ratePerManhour = formProps.watch("ratePerManhour"); const ratePerManhour = formProps.watch("ratePerManhour");
const totalManhour = formProps.watch("totalManhour"); const totalManhour = formProps.watch("totalManhour");
const subContractFee = formProps.watch("subContractFee");
const firstLoadedRef = useRef(false); const firstLoadedRef = useRef(false);
useEffect(() => { useEffect(() => {
if ( if (
@@ -542,12 +543,12 @@ const CreateProject: React.FC<Props> = ({
) { ) {
formProps.setValue( formProps.setValue(
"totalManhour", "totalManhour",
Math.ceil(expectedProjectFee / ratePerManhour),
Math.ceil((expectedProjectFee - (subContractFee ?? 0)) / ratePerManhour),
); );
} else { } else {
firstLoadedRef.current = true; firstLoadedRef.current = true;
} }
}, [expectedProjectFee, ratePerManhour]);
}, [expectedProjectFee, subContractFee, ratePerManhour]);


useEffect(() => { useEffect(() => {
if ( if (
@@ -557,7 +558,7 @@ const CreateProject: React.FC<Props> = ({
) { ) {
formProps.setValue( formProps.setValue(
"totalManhour", "totalManhour",
Math.ceil(expectedProjectFee / ratePerManhour),
Math.ceil((expectedProjectFee - (subContractFee ?? 0)) / ratePerManhour),
); );
} }
}, [totalManhour]); }, [totalManhour]);


+ 2
- 2
src/components/Report/FinancialStatusReportGen/FinancialStatusReportGen.tsx Voir le fichier

@@ -58,8 +58,8 @@ const GenFinancialStatusReport: React.FC<Props> & SubComponents = ({ projects, t
setLoading(true) setLoading(true)
let postData = { let postData = {
teamLeadId: -1, teamLeadId: -1,
startMonth: "1970-01-01",
endMonth: dayjs().format("YYYY-MM-DD").toString()
startMonth: "1970-01",
endMonth: dayjs().format("YYYY-MM").toString()
} }
if(query.targetDate){ if(query.targetDate){
postData.startMonth = query.targetDate postData.startMonth = query.targetDate


Chargement…
Annuler
Enregistrer