Skip to content

Commit 52b3416

Browse files
committed
fix: Modify the UI of the price history modal
1 parent 0c96937 commit 52b3416

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

frontend/src/pages/Products/ProductManager/PriceHistoryModal.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,9 @@ const PriceHistoryModal = ({ isOpen, onClose, variant, onStatusChanged }) => {
123123
<th className="px-4 py-3 text-right font-semibold text-gray-600">Giá bán</th>
124124
<th className="px-4 py-3 text-right font-semibold text-gray-600">Thuế (%)</th>
125125
<th className="px-4 py-3 text-center font-semibold text-gray-600">Ngày hiệu lực</th>
126+
<th className="px-4 py-3 text-center font-semibold text-gray-600">Ngày tạo</th>
126127
<th className="px-4 py-3 text-center font-semibold text-gray-600">Ngày hết hiệu lực</th>
127128
<th className="px-4 py-3 text-center font-semibold text-gray-600">Trạng thái</th>
128-
<th className="px-4 py-3 text-center font-semibold text-gray-600">Ngày tạo</th>
129129
<th className="px-4 py-3 text-center font-semibold text-gray-600">Thao tác</th>
130130
</tr>
131131
</thead>
@@ -144,6 +144,9 @@ const PriceHistoryModal = ({ isOpen, onClose, variant, onStatusChanged }) => {
144144
</td>
145145
<td className="px-4 py-3 text-right">{price.taxPercent ?? 0}%</td>
146146
<td className="px-4 py-3 text-center">{formatDate(price.effectiveDate)}</td>
147+
<td className="px-4 py-3 text-center text-gray-400 text-xs">
148+
{formatDate(price.createdAt)}
149+
</td>
147150
<td className="px-4 py-3 text-center">{formatDate(price.expiryDate)}</td>
148151
<td className="px-4 py-3 text-center">
149152
{price.status === 'ACTIVE' ? (
@@ -156,9 +159,6 @@ const PriceHistoryModal = ({ isOpen, onClose, variant, onStatusChanged }) => {
156159
</span>
157160
)}
158161
</td>
159-
<td className="px-4 py-3 text-center text-gray-400 text-xs">
160-
{formatDate(price.createdAt)}
161-
</td>
162162
<td className="px-4 py-3 text-center">
163163
<button
164164
onClick={() => handleToggle(price.id)}

frontend/src/pages/Products/ProductManager/PriceSetting.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,8 @@ const PriceSetting = () => {
182182
bV = Number(b.activeSellingPrice) || 0;
183183
break;
184184
case "profit":
185-
aV = calculateProfit(Number(a.activePurchasePrice) || 0, Number(a.activeSellingPrice) || 0);
186-
bV = calculateProfit(Number(b.activePurchasePrice) || 0, Number(b.activeSellingPrice) || 0);
185+
aV = calculateProfit(Number(a.costPrice) || 0, Number(a.activeSellingPrice) || 0);
186+
bV = calculateProfit(Number(b.costPrice) || 0, Number(b.activeSellingPrice) || 0);
187187
break;
188188
default:
189189
aV = 0; bV = 0;

0 commit comments

Comments
 (0)