Skip to content

Commit

Permalink
remove useless required bundle_cost_float_ttc
Browse files Browse the repository at this point in the history
  • Loading branch information
BaptTF committed Apr 27, 2024
1 parent 739d503 commit aa66232
Show file tree
Hide file tree
Showing 4 changed files with 107 additions and 108 deletions.
200 changes: 100 additions & 100 deletions backend/autogen/bar.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions bar.openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5440,7 +5440,6 @@ components:
- amount_per_bundle
- bundle_cost_ht
- bundle_cost_ttc
- bundle_cost_float_ttc
- tva
NewRestock:
type: object
Expand Down Expand Up @@ -5484,7 +5483,7 @@ components:
bundle_cost_ht:
type: integer
format: uint64
bundle_cost_ttc:
bundle_cost_ttc:
type: integer
format: uint64
tva:
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lib/api/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1502,7 +1502,7 @@ export interface NewRestockItem {
* @type {number}
* @memberof NewRestockItem
*/
'bundle_cost_float_ttc': number;
'bundle_cost_float_ttc'?: number;
/**
*
* @type {number}
Expand Down
10 changes: 5 additions & 5 deletions frontend/src/routes/panel/products/reappro/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
amount_of_bundle: 'Nombre de lots',
amount_per_bundle: 'Nombre de produits par lots',
bundle_cost_ht: "Prix d'un lot HT",
tva: "0",
tva: '0',
bundle_cost_ttc: "Prix d'un lot TTC"
};
Expand Down Expand Up @@ -90,7 +90,7 @@
if (item.bundle_cost_float_ttc === 0.0) {
newRestock.total_cost_ttc += item.amount_of_bundle * item.bundle_cost_ttc;
} else {
newRestock.total_cost_ttc += item.amount_of_bundle * item.bundle_cost_float_ttc;
newRestock.total_cost_ttc += item.amount_of_bundle * (item.bundle_cost_float_ttc ?? item.bundle_cost_ttc);
}
});
}
Expand Down Expand Up @@ -119,7 +119,7 @@
amount_of_bundle: 'Nombre de lots',
amount_per_bundle: 'Nombre de produits par lots',
bundle_cost_ht: "Prix d'un lot HT",
tva: "0",
tva: '0',
bundle_cost_ttc: "Prix d'un lot TTC"
};
newItem = {
Expand Down Expand Up @@ -438,9 +438,9 @@
amount_of_bundle: 'Nombre de lots',
amount_per_bundle: 'Nombre de produits par lots',
bundle_cost_ht: "Prix d'un lot HT",
tva: "0",
tva: '0',
bundle_cost_ttc: "Prix d'un lot TTC"
};
};
newItem = {
item_id: '',
amount_of_bundle: 0,
Expand Down

0 comments on commit aa66232

Please sign in to comment.