Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 619afe5

Browse files
committedMay 31, 2021
fix: user RB.memberRate to show weekly rate
1 parent 2949cba commit 619afe5

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed
 

‎src/constants/workPeriods.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,12 @@ export const REQUIRED_FIELDS = [
1919
"projectId",
2020
"startDate",
2121
"endDate",
22-
"customerRate",
22+
"memberRate",
2323
"workPeriods.id",
2424
"workPeriods.projectId",
2525
"workPeriods.userHandle",
2626
"workPeriods.startDate",
2727
"workPeriods.endDate",
28-
"workPeriods.customerRate",
2928
"workPeriods.paymentStatus",
3029
"workPeriods.daysWorked",
3130
];
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export const USER_HANDLE = "workPeriods.userHandle";
22
export const START_DATE = "startDate";
33
export const END_DATE = "endDate";
4-
export const WEEKLY_RATE = "workPeriods.customerRate";
4+
export const WEEKLY_RATE = "memberRate";
55
export const PAYMENT_STATUS = "workPeriods.paymentStatus";
66
export const WORKING_DAYS = "workPeriods.daysWorked";

‎src/routes/WorkPeriods/components/PeriodItem/index.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import Checkbox from "components/Checkbox";
44
import IntegerField from "components/IntegerField";
55
import PaymentStatus from "../PaymentStatus";
66
import { formatUserHandleLink } from "utils/formatters";
7+
import _ from "lodash";
78
import styles from "./styles.module.scss";
89

910
/**
@@ -55,7 +56,7 @@ const PeriodItem = ({ isSelected, item, onToggle, onWorkingDaysChange }) => {
5556
<td className={styles.teamName}>{item.projectId}</td>
5657
<td className={styles.startDate}>{item.startDate}</td>
5758
<td className={styles.endDate}>{item.endDate}</td>
58-
<td>{currencyFormatter.format(item.weeklyRate)}</td>
59+
<td>{_.isNumber(item.weeklyRate) ? currencyFormatter.format(item.weeklyRate) : '-'}</td>
5960
<td>
6061
<PaymentStatus status={item.paymentStatus} />
6162
</td>

‎src/utils/workPeriods.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export function normalizePeriodItems(items) {
2020
? moment(item.startDate).format(DATE_FORMAT_UI)
2121
: "",
2222
endDate: item.endDate ? moment(item.endDate).format(DATE_FORMAT_UI) : "",
23-
weeklyRate: +workPeriod.customerRate || 0,
23+
weeklyRate: item.memberRate,
2424
paymentStatus: paymentStatus
2525
? API_PAYMENT_STATUS_MAP[paymentStatus] || paymentStatus.toUpperCase()
2626
: PAYMENT_STATUS.UNDEFINED,

0 commit comments

Comments
 (0)
This repository has been archived.