|
|
|
@ -22,8 +22,8 @@ import DeleteIcon from "~icons/carbon/trash-can";
|
|
|
|
|
import DragVerticalIcon from "~icons/carbon/drag-vertical";
|
|
|
|
|
import PositionSettingsIcon from "~icons/carbon/settings-adjust";
|
|
|
|
|
import { Checkbox, TextArea, TextInput } from "../Form";
|
|
|
|
|
import { parseOptionalFloat } from "~/util";
|
|
|
|
|
import { MarkdownHelpLabel } from "../Markdown";
|
|
|
|
|
import { createOptionalNumberInputHandler } from "~/util";
|
|
|
|
|
|
|
|
|
|
export const PositionsSettings: Component = () => {
|
|
|
|
|
const [state, setState] = useContext(StoreContext)!;
|
|
|
|
@ -295,25 +295,19 @@ export const PositionsSettings: Component = () => {
|
|
|
|
|
</div>
|
|
|
|
|
<TextInput
|
|
|
|
|
size="xs"
|
|
|
|
|
value={
|
|
|
|
|
position.itemPrice === 0 ? "" : position.itemPrice
|
|
|
|
|
}
|
|
|
|
|
value={position.itemPrice}
|
|
|
|
|
label="Einzelpreis"
|
|
|
|
|
placeholder={
|
|
|
|
|
state.defaultItemPrice
|
|
|
|
|
? state.defaultItemPrice + ""
|
|
|
|
|
: undefined
|
|
|
|
|
}
|
|
|
|
|
step="0.01"
|
|
|
|
|
min="0"
|
|
|
|
|
type="number"
|
|
|
|
|
onInput={(e) => {
|
|
|
|
|
setState(
|
|
|
|
|
"positions",
|
|
|
|
|
idx(),
|
|
|
|
|
"itemPrice",
|
|
|
|
|
parseOptionalFloat(e.currentTarget.value)
|
|
|
|
|
);
|
|
|
|
|
}}
|
|
|
|
|
onInput={createOptionalNumberInputHandler((v) =>
|
|
|
|
|
setState("positions", idx(), "itemPrice", v)
|
|
|
|
|
)}
|
|
|
|
|
/>
|
|
|
|
|
<div
|
|
|
|
|
use:autoAnimate
|
|
|
|
@ -357,15 +351,17 @@ export const PositionsSettings: Component = () => {
|
|
|
|
|
<TextInput
|
|
|
|
|
label="Aktionspreis"
|
|
|
|
|
type="number"
|
|
|
|
|
step="0.01"
|
|
|
|
|
min="0"
|
|
|
|
|
value={position.fixedDiscountPrice}
|
|
|
|
|
onInput={(e) =>
|
|
|
|
|
onInput={createOptionalNumberInputHandler((v) =>
|
|
|
|
|
setState(
|
|
|
|
|
"positions",
|
|
|
|
|
idx(),
|
|
|
|
|
"fixedDiscountPrice",
|
|
|
|
|
parseOptionalFloat(e.currentTarget.value)
|
|
|
|
|
v
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
)}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-span-2">
|
|
|
|
|