IO-1178 Resolve line markup issues.

This commit is contained in:
Patrick Fic
2021-06-01 11:52:09 -07:00
parent bcec0cd902
commit d2bb7121cb
15 changed files with 59 additions and 12 deletions

View File

@@ -28,7 +28,7 @@ import JobsShow from "../jobs/jobs.show";
const httpLink = new HttpLink({
uri: process.env.REACT_APP_GRAPHQL_ENDPOINT,
headers: {
"x-hasura-admin-secret": `Dev-BodyShopAppBySnaptSoftware!`,
"x-hasura-admin-secret": `Dev-BodyShopApp!`,
// 'Authorization': `Bearer xxxx`,
},
});
@@ -67,7 +67,7 @@ const client = new ApolloClient({
// uri: process.env.REACT_APP_GRAPHQL_ENDPOINT,
// cache: new InMemoryCache(),
// headers: {
// "x-hasura-admin-secret": `Dev-BodyShopAppBySnaptSoftware!`,
// "x-hasura-admin-secret": `Dev-BodyShopApp!`,
// // 'Authorization': `Bearer xxxx`,
// },
// });

View File

@@ -15232,6 +15232,27 @@
</translation>
</translations>
</concept_node>
<concept_node>
<name>prt_dsmk_p</name>
<definition_loaded>false</definition_loaded>
<description></description>
<comment></comment>
<default_text></default_text>
<translations>
<translation>
<language>en-US</language>
<approved>false</approved>
</translation>
<translation>
<language>es-MX</language>
<approved>false</approved>
</translation>
<translation>
<language>fr-CA</language>
<approved>false</approved>
</translation>
</translations>
</concept_node>
<concept_node>
<name>status</name>
<definition_loaded>false</definition_loaded>

View File

@@ -157,7 +157,7 @@ export function JobLinesComponent({
render: (text, record) => (
<>
<CurrencyFormatter>{record.act_price}</CurrencyFormatter>
{record.prt_dsmk_p !== 0 && (
{record.prt_dsmk_p && record.prt_dsmk_p !== 0 && (
<span
style={{ marginLeft: ".2rem" }}
>{`(${record.prt_dsmk_p}%)`}</span>

View File

@@ -210,6 +210,13 @@ export default function JobLinesUpsertModalComponent({
>
<InputCurrency precision={2} min={0} />
</Form.Item>
<Form.Item
label={t("joblines.fields.prt_dsmk_p")}
name="prt_dsmk_p"
initialValue={0}
>
<InputCurrency precision={0} min={0} max={100} />
</Form.Item>
</LayoutFormRow>
</Form>
</Modal>

View File

@@ -957,6 +957,7 @@
},
"profitcenter_labor": "Profit Center: Labor",
"profitcenter_part": "Profit Center: Part",
"prt_dsmk_p": "Line Markup %",
"status": "Status",
"total": "Total",
"unq_seq": "Seq #"

View File

@@ -957,6 +957,7 @@
},
"profitcenter_labor": "",
"profitcenter_part": "",
"prt_dsmk_p": "",
"status": "Estado",
"total": "",
"unq_seq": "Seq #"

View File

@@ -957,6 +957,7 @@
},
"profitcenter_labor": "",
"profitcenter_part": "",
"prt_dsmk_p": "",
"status": "Statut",
"total": "",
"unq_seq": "Seq #"

View File

@@ -1,4 +1,3 @@
Must set the environment variables using:
firebase functions:config:set auth.graphql_endpoint="https://bodyshop-dev-db.herokuapp.com/v1/graphql" auth.hasura_secret_admin_key="Dev-BodyShopAppBySnaptSoftware!"
firebase functions:config:set auth.graphql_endpoint="https://bodyshop-dev-db.herokuapp.com/v1/graphql" auth.hasura_secret_admin_key="Dev-BodyShopApp!"

View File

@@ -1,2 +1,2 @@
endpoint: https://bodyshop-dev-db.herokuapp.com
admin_secret: Dev-BodyShopAppBySnaptSoftware!
admin_secret: Dev-BodyShopApp!

View File

@@ -0,0 +1,5 @@
- args:
cascade: false
read_only: false
sql: ALTER TABLE ONLY "public"."joblines" ALTER COLUMN "prt_dsmk_p" DROP DEFAULT;
type: run_sql

View File

@@ -0,0 +1,6 @@
- args:
cascade: false
read_only: false
sql: ALTER TABLE ONLY "public"."joblines" ALTER COLUMN "prt_dsmk_p" SET DEFAULT
0;
type: run_sql

View File

@@ -0,0 +1 @@
[]

View File

@@ -0,0 +1,5 @@
- args:
cascade: false
read_only: false
sql: "update joblines \nset prt_dsmk_p = 0 where joblines.prt_dsmk_p is null;"
type: run_sql

View File

@@ -281,7 +281,7 @@ function GenerateCostingData(job) {
amount: Math.round((val.act_price || 0) * 100),
})
.multiply(val.part_qty || 0)
.percentage(val.prt_dsmk_p)
.percentage(val.prt_dsmk_p || 0)
);
if (!acc.parts[partsProfitCenter])
acc.parts[partsProfitCenter] = Dinero();
@@ -310,7 +310,7 @@ function GenerateCostingData(job) {
amount: Math.round((val.act_price || 0) * 100),
})
.multiply(val.part_qty || 0)
.percentage(val.prt_dsmk_p)
.percentage(val.prt_dsmk_p || 0)
);
if (!acc.parts[partsProfitCenter])

View File

@@ -217,7 +217,7 @@ function CalculatePartsTotals(jobLines) {
amount: Math.round((value.act_price || 0) * 100),
})
.multiply(value.part_qty || 0)
.percentage(value.prt_dsmk_p)
.percentage(value.prt_dsmk_p || 0)
),
list: {
...acc.parts.list,
@@ -248,7 +248,7 @@ function CalculatePartsTotals(jobLines) {
amount: Math.round((value.act_price || 0) * 100),
})
.multiply(value.part_qty || 0)
.percentage(value.prt_dsmk_p)
.percentage(value.prt_dsmk_p || 0)
),
},
};
@@ -382,7 +382,7 @@ function CalculateTaxesTotals(job, otherTotals) {
amount: Math.round((val.act_price || 0) * 100),
})
.multiply(val.part_qty || 0)
.percentage(val.prt_dsmk_p)
.percentage(val.prt_dsmk_p || 0)
)
.percentage(
((job.parts_tax_rates &&