IO-829 Resolve Parts Order Calculations issues.

This commit is contained in:
Patrick Fic
2021-03-31 11:35:08 -07:00
parent 315b816e50
commit eca5bd21ae
2 changed files with 19 additions and 6 deletions

13
client/.env.development2 Normal file
View File

@@ -0,0 +1,13 @@
FAST_REFRESH=false
REACT_APP_GRAPHQL_ENDPOINT=https://bodyshop-dev-db.herokuapp.com/v1/graphql
REACT_APP_GRAPHQL_ENDPOINT_WS=wss://bodyshop-dev-db.herokuapp.com/v1/graphql
REACT_APP_GA_CODE=231099835
REACT_APP_FIREBASE_CONFIG={"apiKey":"AIzaSyDPLT8GiDHDR1R4nI66Qi0BY1aYviDPioc","authDomain":"imex-dev.firebaseapp.com","databaseURL":"https://imex-dev.firebaseio.com","projectId":"imex-dev","storageBucket":"imex-dev.appspot.com","messagingSenderId":"759548147434","appId":"1:759548147434:web:e8239868a48ceb36700993","measurementId":"G-K5XRBVVB4S"}
REACT_APP_CLOUDINARY_ENDPOINT_API=https://api.cloudinary.com/v1_1/bodyshop
REACT_APP_CLOUDINARY_ENDPOINT=https://res.cloudinary.com/bodyshop
REACT_APP_CLOUDINARY_API_KEY=473322739956866
REACT_APP_CLOUDINARY_THUMB_TRANSFORMATIONS=c_fill,f_auto,h_250,w_250
REACT_APP_FIREBASE_PUBLIC_VAPID_KEY='BG3tzU7L2BXlGZ_3VLK4PNaRceoEXEnmHfxcVbRMF5o5g05ejslhVPki9kBM9cBBT-08Ad9kN3HSpS6JmrWD6h4'
REACT_APP_STRIPE_PUBLIC_KEY=pk_test_51GqB4TJl3nQjrZ0wCQWAxAhlNF8jKe0tipIa6ExBaxwJGitwvFsIZUEua4dUzaMIAuXp4qwYHXx7lgjyQSwP0Pe900vzm38C7g
REACT_APP_AXIOS_BASE_API_URL=https://api.imex.online/
REACT_APP_REPORTS_SERVER_URL=https://reports.bodyshop.app

View File

@@ -32,7 +32,7 @@ export default function JobBillsTotalComponent({
if (p.return) {
totalReturns = totalReturns.add(
Dinero({
amount: Math.round((pol.cost || 0) * 100),
amount: Math.round((pol.act_price || 0) * 100),
}).multiply(pol.quantity)
);
}
@@ -74,7 +74,7 @@ export default function JobBillsTotalComponent({
const discrepWithLbrAdj = discrepancy.add(lbrAdjustments);
const discrepWithCms = discrepWithLbrAdj.subtract(billCms);
const creditsNotReceived = totalReturns.subtract(billCms);
const creditsNotReceived = totalReturns.add(billCms); //billCms is tracked as a negative number.
return (
<Card title={t("jobs.labels.jobtotals")}>
<Space wrap size="large">
@@ -89,7 +89,7 @@ export default function JobBillsTotalComponent({
<Statistic
title={t("bills.labels.discrepancy")}
valueStyle={{
color: discrepancy.getAmount === 0 ? "green" : "red",
color: discrepancy.getAmount() === 0 ? "green" : "red",
}}
value={discrepancy.toFormat()}
/>
@@ -100,7 +100,7 @@ export default function JobBillsTotalComponent({
<Statistic
title={t("bills.labels.discrepwithlbradj")}
valueStyle={{
color: discrepWithLbrAdj.getAmount === 0 ? "green" : "red",
color: discrepWithLbrAdj.getAmount() === 0 ? "green" : "red",
}}
value={discrepWithLbrAdj.toFormat()}
/>
@@ -111,7 +111,7 @@ export default function JobBillsTotalComponent({
<Statistic
title={t("bills.labels.discrepwithcms")}
valueStyle={{
color: discrepWithCms.getAmount === 0 ? "green" : "red",
color: discrepWithCms.getAmount() === 0 ? "green" : "red",
}}
value={discrepWithCms.toFormat()}
/>
@@ -126,7 +126,7 @@ export default function JobBillsTotalComponent({
<Statistic
title={t("bills.labels.creditsnotreceived")}
valueStyle={{
color: creditsNotReceived.getAmount === 0 ? "green" : "red",
color: creditsNotReceived.getAmount() === 0 ? "green" : "red",
}}
value={creditsNotReceived.toFormat()}
/>