Merged in hotfix/2021-06-01 (pull request #87)

Emergency Hotfix for line markup issues. IO-1178
This commit is contained in:
Patrick Fic
2021-06-01 19:15:47 +00:00
8 changed files with 30 additions and 6 deletions

View File

@@ -160,7 +160,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

@@ -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

@@ -314,7 +314,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();
@@ -343,7 +343,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 &&