Compare commits
No commits in common. "18abd38987bb8dcb160e4501f6d3d6c88c4849c7" and "6c7bb1042cd3dfebc897ecdd06212963b5be9318" have entirely different histories.
18abd38987
...
6c7bb1042c
@ -36,4 +36,3 @@ ssh -nNTvL 5432:fsmi-db.fsmi.org:5432 fsmi-login.fsmi.uni-karlsruhe.de
|
|||||||
- [ ] Make it print nicely
|
- [ ] Make it print nicely
|
||||||
- [ ] Make it possible to edit entries
|
- [ ] Make it possible to edit entries
|
||||||
- [ ] Improve project structure
|
- [ ] Improve project structure
|
||||||
- [ ] Figure out/Add documentation about building `entry.js`
|
|
||||||
|
@ -1,103 +0,0 @@
|
|||||||
module Calculator exposing (..)
|
|
||||||
|
|
||||||
import Html exposing (..)
|
|
||||||
import Html.Attributes exposing (..)
|
|
||||||
import Html.Events exposing (..)
|
|
||||||
|
|
||||||
import NumberInput
|
|
||||||
import Select
|
|
||||||
|
|
||||||
type Tax = Net | Gross
|
|
||||||
|
|
||||||
ctShow ct = case ct of
|
|
||||||
Gross -> "Brutto"
|
|
||||||
Net -> "Netto"
|
|
||||||
|
|
||||||
type alias Model =
|
|
||||||
{ tax : Select.Model Tax
|
|
||||||
, bundlePrice : NumberInput.Model Float
|
|
||||||
, bundleSize : NumberInput.Model Int
|
|
||||||
}
|
|
||||||
|
|
||||||
init bundlePrice = Model
|
|
||||||
(Select.init ctShow ctShow Net [Net, Gross])
|
|
||||||
(NumberInput.fromFloat bundlePrice)
|
|
||||||
(NumberInput.fromInt 1)
|
|
||||||
|
|
||||||
getResult model taxGroup =
|
|
||||||
case (NumberInput.get model.bundlePrice, NumberInput.get model.bundleSize) of
|
|
||||||
(Just bundlePrice, Just bundleSize) ->
|
|
||||||
Just <| roundTo 2 <|
|
|
||||||
if Select.get model.tax == Gross then
|
|
||||||
(bundlePrice / toFloat bundleSize) / (1 + taxGroup.percentage)
|
|
||||||
else
|
|
||||||
bundlePrice / toFloat bundleSize
|
|
||||||
_ ->
|
|
||||||
Nothing
|
|
||||||
|
|
||||||
|
|
||||||
type Msg
|
|
||||||
= SetTax String
|
|
||||||
| SetBundlePrice String
|
|
||||||
| SetBundleSize String
|
|
||||||
|
|
||||||
update msg model = case msg of
|
|
||||||
SetTax key ->
|
|
||||||
{ model | tax = Select.update key model.tax }
|
|
||||||
SetBundlePrice str ->
|
|
||||||
{ model | bundlePrice = NumberInput.update str model.bundlePrice }
|
|
||||||
SetBundleSize str ->
|
|
||||||
{ model | bundleSize = NumberInput.update str model.bundleSize }
|
|
||||||
|
|
||||||
view model taxGroup =
|
|
||||||
let
|
|
||||||
mainPart =
|
|
||||||
[ text "("
|
|
||||||
, input
|
|
||||||
[ class "formula-input", placeholder "Gebindepreis"
|
|
||||||
, value <| NumberInput.show model.bundlePrice
|
|
||||||
, onInput SetBundlePrice
|
|
||||||
]
|
|
||||||
[]
|
|
||||||
, text " ÷ "
|
|
||||||
, input
|
|
||||||
[ class "formula-input", placeholder "Gebindegröße"
|
|
||||||
, value <| NumberInput.show model.bundleSize
|
|
||||||
, onInput SetBundleSize
|
|
||||||
]
|
|
||||||
[]
|
|
||||||
, text ") "
|
|
||||||
]
|
|
||||||
taxPart =
|
|
||||||
[ text " ÷ "
|
|
||||||
, input
|
|
||||||
[ class "formula-input"
|
|
||||||
, disabled True
|
|
||||||
, value <| String.fromFloat <| 1 + taxGroup.percentage
|
|
||||||
]
|
|
||||||
[]
|
|
||||||
]
|
|
||||||
resultPart =
|
|
||||||
[ text " = "
|
|
||||||
, input
|
|
||||||
[ class "formula-input"
|
|
||||||
, disabled True
|
|
||||||
, value <| Maybe.withDefault "?" <| Maybe.map String.fromFloat <| getResult model taxGroup
|
|
||||||
]
|
|
||||||
[]
|
|
||||||
]
|
|
||||||
in
|
|
||||||
fieldset []
|
|
||||||
[ legend [] [ text "Preisrechner" ]
|
|
||||||
, div [] <| List.concat <| List.filterMap identity
|
|
||||||
[ Just mainPart
|
|
||||||
, if Select.get model.tax == Gross then Just taxPart else Nothing
|
|
||||||
, Just resultPart
|
|
||||||
]
|
|
||||||
, div [ class "form-input" ]
|
|
||||||
[ label [ for "calculator-tax" ] [ text "Gebindepreis ist" ]
|
|
||||||
, Select.view SetTax model.tax
|
|
||||||
]
|
|
||||||
]
|
|
||||||
|
|
||||||
roundTo places x = toFloat (round <| x * 10 ^ places) / 10 ^ places
|
|
@ -10,7 +10,6 @@ import Html exposing (..)
|
|||||||
import Html.Attributes exposing (..)
|
import Html.Attributes exposing (..)
|
||||||
import Html.Events exposing (..)
|
import Html.Events exposing (..)
|
||||||
|
|
||||||
import Calculator
|
|
||||||
import NumberInput
|
import NumberInput
|
||||||
import Select
|
import Select
|
||||||
|
|
||||||
@ -70,16 +69,6 @@ type alias TaxGroup =
|
|||||||
, percentage : Float
|
, percentage : Float
|
||||||
}
|
}
|
||||||
|
|
||||||
type alias NewItem =
|
|
||||||
{ barcode : String
|
|
||||||
, name : String
|
|
||||||
, salesUnits : Int
|
|
||||||
, group : Group
|
|
||||||
, location : Location
|
|
||||||
, netUnitPrice : Float
|
|
||||||
, taxGroup : TaxGroup
|
|
||||||
}
|
|
||||||
|
|
||||||
type alias Context =
|
type alias Context =
|
||||||
{ globals : Globals
|
{ globals : Globals
|
||||||
, state : State
|
, state : State
|
||||||
@ -100,7 +89,6 @@ type State
|
|||||||
{ barcode : String
|
{ barcode : String
|
||||||
, name : String
|
, name : String
|
||||||
, salesUnits : NumberInput.Model Int
|
, salesUnits : NumberInput.Model Int
|
||||||
, calculator : Calculator.Model
|
|
||||||
, netUnitPrice : NumberInput.Model Float
|
, netUnitPrice : NumberInput.Model Float
|
||||||
, grossUnitPrice : NumberInput.Model Float
|
, grossUnitPrice : NumberInput.Model Float
|
||||||
, group : Select.Model Group
|
, group : Select.Model Group
|
||||||
@ -116,7 +104,6 @@ type Msg
|
|||||||
| SetBarcode String
|
| SetBarcode String
|
||||||
| SetName String
|
| SetName String
|
||||||
| SetSalesUnits String
|
| SetSalesUnits String
|
||||||
| CalculatorMsg Calculator.Msg
|
|
||||||
| SetNetUnitPrice String
|
| SetNetUnitPrice String
|
||||||
| SetGrossUnitPrice String
|
| SetGrossUnitPrice String
|
||||||
| SetGroup String
|
| SetGroup String
|
||||||
@ -148,13 +135,11 @@ updateState msg globals state = case state of
|
|||||||
case find (\tg -> tg.id == searchResult.taxGroupId) globals.taxGroups of
|
case find (\tg -> tg.id == searchResult.taxGroupId) globals.taxGroups of
|
||||||
Nothing -> (state, Cmd.none)
|
Nothing -> (state, Cmd.none)
|
||||||
Just taxGroup ->
|
Just taxGroup ->
|
||||||
( ItemEditor
|
( ItemEditor <| updateGrossUnitPrice
|
||||||
{ barcode = searchResult.barcode
|
{ barcode = searchResult.barcode
|
||||||
, name = searchResult.name
|
, name = searchResult.name
|
||||||
, calculator = Calculator.init searchResult.netUnitPrice
|
|
||||||
, netUnitPrice = NumberInput.fromFloat searchResult.netUnitPrice
|
, netUnitPrice = NumberInput.fromFloat searchResult.netUnitPrice
|
||||||
, grossUnitPrice = NumberInput.fromFloat
|
, grossUnitPrice = NumberInput.fromFloat 0
|
||||||
(suggestedGrossPrice searchResult.netUnitPrice taxGroup.percentage)
|
|
||||||
, salesUnits = NumberInput.fromInt searchResult.salesUnits
|
, salesUnits = NumberInput.fromInt searchResult.salesUnits
|
||||||
, group = Select.init (.id >> String.fromInt) (.name) { id = searchResult.groupId, name = searchResult.groupName } globals.groups
|
, group = Select.init (.id >> String.fromInt) (.name) { id = searchResult.groupId, name = searchResult.groupName } globals.groups
|
||||||
, location = Select.init (.id >> String.fromInt) (.name) { id = searchResult.locationId, name = searchResult.locationName } globals.locations
|
, location = Select.init (.id >> String.fromInt) (.name) { id = searchResult.locationId, name = searchResult.locationName } globals.locations
|
||||||
@ -171,29 +156,27 @@ updateState msg globals state = case state of
|
|||||||
(ItemEditor { model | name = name }, Cmd.none)
|
(ItemEditor { model | name = name }, Cmd.none)
|
||||||
SetSalesUnits str ->
|
SetSalesUnits str ->
|
||||||
(ItemEditor { model | salesUnits = NumberInput.update str model.salesUnits }, Cmd.none)
|
(ItemEditor { model | salesUnits = NumberInput.update str model.salesUnits }, Cmd.none)
|
||||||
CalculatorMsg msg_ ->
|
|
||||||
(ItemEditor { model | calculator = Calculator.update msg_ model.calculator }, Cmd.none)
|
|
||||||
SetNetUnitPrice str ->
|
SetNetUnitPrice str ->
|
||||||
( ItemEditor { model | netUnitPrice = NumberInput.update str model.netUnitPrice }
|
( ItemEditor <| updateGrossUnitPrice { model | netUnitPrice = NumberInput.update str model.netUnitPrice }
|
||||||
, Cmd.none
|
, Cmd.none
|
||||||
)
|
)
|
||||||
SetGrossUnitPrice str ->
|
SetGrossUnitPrice str ->
|
||||||
( ItemEditor { model | grossUnitPrice = NumberInput.update str model.grossUnitPrice }
|
(ItemEditor { model | grossUnitPrice = NumberInput.update str model.grossUnitPrice }, Cmd.none)
|
||||||
, Cmd.none
|
|
||||||
)
|
|
||||||
SetGroup key ->
|
SetGroup key ->
|
||||||
(ItemEditor { model | group = Select.update key model.group }, Cmd.none)
|
(ItemEditor { model | group = Select.update key model.group }, Cmd.none)
|
||||||
SetLocation key ->
|
SetLocation key ->
|
||||||
(ItemEditor { model | location = Select.update key model.location }, Cmd.none)
|
(ItemEditor { model | location = Select.update key model.location }, Cmd.none)
|
||||||
SetTaxGroup key ->
|
SetTaxGroup key ->
|
||||||
( ItemEditor { model | taxGroup = Select.update key model.taxGroup }
|
( ItemEditor <| updateGrossUnitPrice { model | taxGroup = Select.update key model.taxGroup }
|
||||||
, Cmd.none
|
, Cmd.none
|
||||||
)
|
)
|
||||||
_ ->
|
_ ->
|
||||||
(state, Cmd.none)
|
(state, Cmd.none)
|
||||||
|
|
||||||
suggestedGrossPrice netPrice percentage =
|
updateGrossUnitPrice model =
|
||||||
roundTo 2 <| netPrice * (1 + percentage) + 0.01
|
{ model
|
||||||
|
| grossUnitPrice = Maybe.withDefault model.grossUnitPrice <| Maybe.map NumberInput.fromFloat <| calculateGarfieldPrice model
|
||||||
|
}
|
||||||
|
|
||||||
-- View stuff
|
-- View stuff
|
||||||
|
|
||||||
@ -234,12 +217,7 @@ view { globals, state } = case state of
|
|||||||
, Select.view SetLocation model.location
|
, Select.view SetLocation model.location
|
||||||
]
|
]
|
||||||
, div [ class "form-input" ]
|
, div [ class "form-input" ]
|
||||||
[ label [ for "tax-group" ] [ text "Steuergruppe" ]
|
[ label [ for "net-unit-price" ] [ text "Stückpreis (Netto)" ]
|
||||||
, Select.view SetTaxGroup model.taxGroup
|
|
||||||
]
|
|
||||||
, Html.map CalculatorMsg <| Calculator.view model.calculator (Select.get model.taxGroup)
|
|
||||||
, div [ class "form-input" ]
|
|
||||||
[ label [ for "net-unit-price" ] [ text "Einkaufspreis (Netto)" ]
|
|
||||||
, input
|
, input
|
||||||
[ value <| NumberInput.show model.netUnitPrice
|
[ value <| NumberInput.show model.netUnitPrice
|
||||||
, onInput SetNetUnitPrice
|
, onInput SetNetUnitPrice
|
||||||
@ -248,50 +226,33 @@ view { globals, state } = case state of
|
|||||||
, step "0.01"
|
, step "0.01"
|
||||||
]
|
]
|
||||||
[]
|
[]
|
||||||
, viewSetCalculatedPriceButton model
|
|
||||||
]
|
]
|
||||||
, div [ class "form-input" ]
|
, div [ class "form-input" ]
|
||||||
[ label [ for "gross-unit-price" ] [ text "Verkaufspreis (Brutto)" ]
|
[ label [ for "tax-group" ] [ text "Steuergruppe" ]
|
||||||
, input
|
, Select.view SetTaxGroup model.taxGroup
|
||||||
[ value <| NumberInput.show model.grossUnitPrice
|
|
||||||
, onInput SetGrossUnitPrice
|
|
||||||
, type_ "number"
|
|
||||||
, id "gross-unit-price"
|
|
||||||
, step "0.01"
|
|
||||||
]
|
]
|
||||||
[]
|
|
||||||
, viewSetSuggestedPriceButton model
|
|
||||||
]
|
]
|
||||||
|
, fieldset []
|
||||||
|
[ legend [] [ text "Neuer Snackeintrag" ]
|
||||||
|
, div [ class "form-input" ]
|
||||||
|
[ label [ for "snack-name" ] [ text "Name" ]
|
||||||
|
, input [ value model.name, disabled True, id "snack-name" ] []
|
||||||
|
]
|
||||||
|
, viewGrossUnitPriceInput model
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|
||||||
viewSetCalculatedPriceButton model =
|
viewGrossUnitPriceInput model =
|
||||||
case Calculator.getResult model.calculator (Select.get model.taxGroup) of
|
|
||||||
Nothing ->
|
|
||||||
button [ disabled True ] [ text "Auf ? setzen" ]
|
|
||||||
Just calculatedPrice ->
|
|
||||||
button
|
|
||||||
[ onClick <| SetNetUnitPrice <| String.fromFloat calculatedPrice
|
|
||||||
-- Prevent submitting the form
|
|
||||||
, type_ "button"
|
|
||||||
]
|
|
||||||
[ text <| "Auf " ++ String.fromFloat calculatedPrice ++ " setzen"
|
|
||||||
]
|
|
||||||
|
|
||||||
viewSetSuggestedPriceButton model =
|
|
||||||
case NumberInput.get model.netUnitPrice of
|
|
||||||
Nothing ->
|
|
||||||
button [ disabled True ] [ text "Auf ? setzen" ]
|
|
||||||
Just netUnitPrice ->
|
|
||||||
let
|
let
|
||||||
grossUnitPrice = suggestedGrossPrice netUnitPrice (Select.get model.taxGroup).percentage
|
suggestedPriceStr = case calculateGarfieldPrice model of
|
||||||
|
Nothing -> "?"
|
||||||
|
Just suggestedPrice -> String.fromFloat suggestedPrice
|
||||||
in
|
in
|
||||||
button
|
div [ class "form-input" ]
|
||||||
[ onClick <| SetGrossUnitPrice <| String.fromFloat grossUnitPrice
|
[ label [ for "gross-unit-price" ]
|
||||||
-- Prevent submitting the form
|
[ text <| "Stückpreis (Brutto), Vorschlag: " ++ suggestedPriceStr
|
||||||
, type_ "button"
|
|
||||||
]
|
]
|
||||||
[ text <| "Auf " ++ String.fromFloat grossUnitPrice ++ " setzen"
|
, input [ onInput SetGrossUnitPrice, value <| NumberInput.show model.grossUnitPrice, id "gross-unit-price", type_ "number", step "0.01" ] []
|
||||||
]
|
]
|
||||||
|
|
||||||
searchResultHeaders =
|
searchResultHeaders =
|
||||||
|
@ -11037,37 +11037,11 @@ var $elm$http$Http$get = function (r) {
|
|||||||
return $elm$http$Http$request(
|
return $elm$http$Http$request(
|
||||||
{body: $elm$http$Http$emptyBody, expect: r.expect, headers: _List_Nil, method: 'GET', timeout: $elm$core$Maybe$Nothing, tracker: $elm$core$Maybe$Nothing, url: r.url});
|
{body: $elm$http$Http$emptyBody, expect: r.expect, headers: _List_Nil, method: 'GET', timeout: $elm$core$Maybe$Nothing, tracker: $elm$core$Maybe$Nothing, url: r.url});
|
||||||
};
|
};
|
||||||
var $author$project$Calculator$Gross = {$: 'Gross'};
|
|
||||||
var $author$project$Calculator$Model = F3(
|
|
||||||
function (tax, bundlePrice, bundleSize) {
|
|
||||||
return {bundlePrice: bundlePrice, bundleSize: bundleSize, tax: tax};
|
|
||||||
});
|
|
||||||
var $author$project$Calculator$Net = {$: 'Net'};
|
|
||||||
var $author$project$Calculator$ctShow = function (ct) {
|
|
||||||
if (ct.$ === 'Gross') {
|
|
||||||
return 'Brutto';
|
|
||||||
} else {
|
|
||||||
return 'Netto';
|
|
||||||
}
|
|
||||||
};
|
|
||||||
var $author$project$Select$Model = F4(
|
var $author$project$Select$Model = F4(
|
||||||
function (identify, show, selected, options) {
|
function (identify, show, selected, options) {
|
||||||
return {identify: identify, options: options, selected: selected, show: show};
|
return {identify: identify, options: options, selected: selected, show: show};
|
||||||
});
|
});
|
||||||
var $author$project$Select$init = $author$project$Select$Model;
|
var $author$project$Select$init = $author$project$Select$Model;
|
||||||
var $author$project$Calculator$init = function (bundlePrice) {
|
|
||||||
return A3(
|
|
||||||
$author$project$Calculator$Model,
|
|
||||||
A4(
|
|
||||||
$author$project$Select$init,
|
|
||||||
$author$project$Calculator$ctShow,
|
|
||||||
$author$project$Calculator$ctShow,
|
|
||||||
$author$project$Calculator$Net,
|
|
||||||
_List_fromArray(
|
|
||||||
[$author$project$Calculator$Net, $author$project$Calculator$Gross])),
|
|
||||||
$author$project$NumberInput$fromFloat(bundlePrice),
|
|
||||||
$author$project$NumberInput$fromInt(1));
|
|
||||||
};
|
|
||||||
var $author$project$Entry$SearchResult = function (barcode) {
|
var $author$project$Entry$SearchResult = function (barcode) {
|
||||||
return function (name) {
|
return function (name) {
|
||||||
return function (netUnitPrice) {
|
return function (netUnitPrice) {
|
||||||
@ -11145,17 +11119,6 @@ var $author$project$Entry$searchResultDecoder = A3(
|
|||||||
'item_barcode',
|
'item_barcode',
|
||||||
$elm$json$Json$Decode$string,
|
$elm$json$Json$Decode$string,
|
||||||
$elm$json$Json$Decode$succeed($author$project$Entry$SearchResult))))))))))));
|
$elm$json$Json$Decode$succeed($author$project$Entry$SearchResult))))))))))));
|
||||||
var $elm$core$Basics$pow = _Basics_pow;
|
|
||||||
var $elm$core$Basics$round = _Basics_round;
|
|
||||||
var $author$project$Entry$roundTo = F2(
|
|
||||||
function (places, x) {
|
|
||||||
return $elm$core$Basics$round(
|
|
||||||
x * A2($elm$core$Basics$pow, 10, places)) / A2($elm$core$Basics$pow, 10, places);
|
|
||||||
});
|
|
||||||
var $author$project$Entry$suggestedGrossPrice = F2(
|
|
||||||
function (netPrice, percentage) {
|
|
||||||
return A2($author$project$Entry$roundTo, 2, (netPrice * (1 + percentage)) + 0.01);
|
|
||||||
});
|
|
||||||
var $author$project$NumberInput$update = F2(
|
var $author$project$NumberInput$update = F2(
|
||||||
function (str, model) {
|
function (str, model) {
|
||||||
return _Utils_update(
|
return _Utils_update(
|
||||||
@ -11189,32 +11152,53 @@ var $author$project$Select$update = F2(
|
|||||||
{selected: x});
|
{selected: x});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
var $author$project$Calculator$update = F2(
|
var $author$project$NumberInput$get = function ($) {
|
||||||
function (msg, model) {
|
return $.value;
|
||||||
switch (msg.$) {
|
};
|
||||||
case 'SetTax':
|
var $author$project$Select$get = function ($) {
|
||||||
var key = msg.a;
|
return $.selected;
|
||||||
return _Utils_update(
|
};
|
||||||
model,
|
var $elm$core$Maybe$map = F2(
|
||||||
{
|
function (f, maybe) {
|
||||||
tax: A2($author$project$Select$update, key, model.tax)
|
if (maybe.$ === 'Just') {
|
||||||
});
|
var value = maybe.a;
|
||||||
case 'SetBundlePrice':
|
return $elm$core$Maybe$Just(
|
||||||
var str = msg.a;
|
f(value));
|
||||||
return _Utils_update(
|
} else {
|
||||||
model,
|
return $elm$core$Maybe$Nothing;
|
||||||
{
|
|
||||||
bundlePrice: A2($author$project$NumberInput$update, str, model.bundlePrice)
|
|
||||||
});
|
|
||||||
default:
|
|
||||||
var str = msg.a;
|
|
||||||
return _Utils_update(
|
|
||||||
model,
|
|
||||||
{
|
|
||||||
bundleSize: A2($author$project$NumberInput$update, str, model.bundleSize)
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
var $elm$core$Basics$pow = _Basics_pow;
|
||||||
|
var $elm$core$Basics$round = _Basics_round;
|
||||||
|
var $author$project$Entry$roundTo = F2(
|
||||||
|
function (places, x) {
|
||||||
|
return $elm$core$Basics$round(
|
||||||
|
x * A2($elm$core$Basics$pow, 10, places)) / A2($elm$core$Basics$pow, 10, places);
|
||||||
|
});
|
||||||
|
var $author$project$Entry$calculateGarfieldPrice = function (model) {
|
||||||
|
return A2(
|
||||||
|
$elm$core$Maybe$map,
|
||||||
|
function (netUnitPrice) {
|
||||||
|
return A2(
|
||||||
|
$author$project$Entry$roundTo,
|
||||||
|
2,
|
||||||
|
(netUnitPrice * (1 + $author$project$Select$get(model.taxGroup).percentage)) + 0.01);
|
||||||
|
},
|
||||||
|
$author$project$NumberInput$get(model.netUnitPrice));
|
||||||
|
};
|
||||||
|
var $author$project$Entry$updateGrossUnitPrice = function (model) {
|
||||||
|
return _Utils_update(
|
||||||
|
model,
|
||||||
|
{
|
||||||
|
grossUnitPrice: A2(
|
||||||
|
$elm$core$Maybe$withDefault,
|
||||||
|
model.grossUnitPrice,
|
||||||
|
A2(
|
||||||
|
$elm$core$Maybe$map,
|
||||||
|
$author$project$NumberInput$fromFloat,
|
||||||
|
$author$project$Entry$calculateGarfieldPrice(model)))
|
||||||
|
});
|
||||||
|
};
|
||||||
var $author$project$Entry$updateState = F3(
|
var $author$project$Entry$updateState = F3(
|
||||||
function (msg, globals, state) {
|
function (msg, globals, state) {
|
||||||
if (state.$ === 'ItemSearch') {
|
if (state.$ === 'ItemSearch') {
|
||||||
@ -11267,11 +11251,10 @@ var $author$project$Entry$updateState = F3(
|
|||||||
var taxGroup = _v2.a;
|
var taxGroup = _v2.a;
|
||||||
return _Utils_Tuple2(
|
return _Utils_Tuple2(
|
||||||
$author$project$Entry$ItemEditor(
|
$author$project$Entry$ItemEditor(
|
||||||
|
$author$project$Entry$updateGrossUnitPrice(
|
||||||
{
|
{
|
||||||
barcode: searchResult.barcode,
|
barcode: searchResult.barcode,
|
||||||
calculator: $author$project$Calculator$init(searchResult.netUnitPrice),
|
grossUnitPrice: $author$project$NumberInput$fromFloat(0),
|
||||||
grossUnitPrice: $author$project$NumberInput$fromFloat(
|
|
||||||
A2($author$project$Entry$suggestedGrossPrice, searchResult.netUnitPrice, taxGroup.percentage)),
|
|
||||||
group: A4(
|
group: A4(
|
||||||
$author$project$Select$init,
|
$author$project$Select$init,
|
||||||
A2(
|
A2(
|
||||||
@ -11314,7 +11297,7 @@ var $author$project$Entry$updateState = F3(
|
|||||||
},
|
},
|
||||||
taxGroup,
|
taxGroup,
|
||||||
globals.taxGroups)
|
globals.taxGroups)
|
||||||
}),
|
})),
|
||||||
$elm$core$Platform$Cmd$none);
|
$elm$core$Platform$Cmd$none);
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
@ -11351,25 +11334,16 @@ var $author$project$Entry$updateState = F3(
|
|||||||
salesUnits: A2($author$project$NumberInput$update, str, model.salesUnits)
|
salesUnits: A2($author$project$NumberInput$update, str, model.salesUnits)
|
||||||
})),
|
})),
|
||||||
$elm$core$Platform$Cmd$none);
|
$elm$core$Platform$Cmd$none);
|
||||||
case 'CalculatorMsg':
|
|
||||||
var msg_ = msg.a;
|
|
||||||
return _Utils_Tuple2(
|
|
||||||
$author$project$Entry$ItemEditor(
|
|
||||||
_Utils_update(
|
|
||||||
model,
|
|
||||||
{
|
|
||||||
calculator: A2($author$project$Calculator$update, msg_, model.calculator)
|
|
||||||
})),
|
|
||||||
$elm$core$Platform$Cmd$none);
|
|
||||||
case 'SetNetUnitPrice':
|
case 'SetNetUnitPrice':
|
||||||
var str = msg.a;
|
var str = msg.a;
|
||||||
return _Utils_Tuple2(
|
return _Utils_Tuple2(
|
||||||
$author$project$Entry$ItemEditor(
|
$author$project$Entry$ItemEditor(
|
||||||
|
$author$project$Entry$updateGrossUnitPrice(
|
||||||
_Utils_update(
|
_Utils_update(
|
||||||
model,
|
model,
|
||||||
{
|
{
|
||||||
netUnitPrice: A2($author$project$NumberInput$update, str, model.netUnitPrice)
|
netUnitPrice: A2($author$project$NumberInput$update, str, model.netUnitPrice)
|
||||||
})),
|
}))),
|
||||||
$elm$core$Platform$Cmd$none);
|
$elm$core$Platform$Cmd$none);
|
||||||
case 'SetGrossUnitPrice':
|
case 'SetGrossUnitPrice':
|
||||||
var str = msg.a;
|
var str = msg.a;
|
||||||
@ -11405,11 +11379,12 @@ var $author$project$Entry$updateState = F3(
|
|||||||
var key = msg.a;
|
var key = msg.a;
|
||||||
return _Utils_Tuple2(
|
return _Utils_Tuple2(
|
||||||
$author$project$Entry$ItemEditor(
|
$author$project$Entry$ItemEditor(
|
||||||
|
$author$project$Entry$updateGrossUnitPrice(
|
||||||
_Utils_update(
|
_Utils_update(
|
||||||
model,
|
model,
|
||||||
{
|
{
|
||||||
taxGroup: A2($author$project$Select$update, key, model.taxGroup)
|
taxGroup: A2($author$project$Select$update, key, model.taxGroup)
|
||||||
})),
|
}))),
|
||||||
$elm$core$Platform$Cmd$none);
|
$elm$core$Platform$Cmd$none);
|
||||||
default:
|
default:
|
||||||
return _Utils_Tuple2(state, $elm$core$Platform$Cmd$none);
|
return _Utils_Tuple2(state, $elm$core$Platform$Cmd$none);
|
||||||
@ -11427,15 +11402,9 @@ var $author$project$Entry$update = F2(
|
|||||||
{globals: globals, state: state_},
|
{globals: globals, state: state_},
|
||||||
cmd);
|
cmd);
|
||||||
});
|
});
|
||||||
var $author$project$Entry$CalculatorMsg = function (a) {
|
|
||||||
return {$: 'CalculatorMsg', a: a};
|
|
||||||
};
|
|
||||||
var $author$project$Entry$SetBarcode = function (a) {
|
var $author$project$Entry$SetBarcode = function (a) {
|
||||||
return {$: 'SetBarcode', a: a};
|
return {$: 'SetBarcode', a: a};
|
||||||
};
|
};
|
||||||
var $author$project$Entry$SetGrossUnitPrice = function (a) {
|
|
||||||
return {$: 'SetGrossUnitPrice', a: a};
|
|
||||||
};
|
|
||||||
var $author$project$Entry$SetGroup = function (a) {
|
var $author$project$Entry$SetGroup = function (a) {
|
||||||
return {$: 'SetGroup', a: a};
|
return {$: 'SetGroup', a: a};
|
||||||
};
|
};
|
||||||
@ -11470,9 +11439,6 @@ var $elm$html$Html$Attributes$disabled = $elm$html$Html$Attributes$boolProperty(
|
|||||||
var $elm$html$Html$fieldset = _VirtualDom_node('fieldset');
|
var $elm$html$Html$fieldset = _VirtualDom_node('fieldset');
|
||||||
var $elm$html$Html$Attributes$for = $elm$html$Html$Attributes$stringProperty('htmlFor');
|
var $elm$html$Html$Attributes$for = $elm$html$Html$Attributes$stringProperty('htmlFor');
|
||||||
var $elm$html$Html$form = _VirtualDom_node('form');
|
var $elm$html$Html$form = _VirtualDom_node('form');
|
||||||
var $author$project$Select$get = function ($) {
|
|
||||||
return $.selected;
|
|
||||||
};
|
|
||||||
var $elm$html$Html$label = _VirtualDom_node('label');
|
var $elm$html$Html$label = _VirtualDom_node('label');
|
||||||
var $elm$html$Html$legend = _VirtualDom_node('legend');
|
var $elm$html$Html$legend = _VirtualDom_node('legend');
|
||||||
var $elm$html$Html$Events$alwaysPreventDefault = function (msg) {
|
var $elm$html$Html$Events$alwaysPreventDefault = function (msg) {
|
||||||
@ -11569,53 +11535,6 @@ var $elm$html$Html$Attributes$step = function (n) {
|
|||||||
return A2($elm$html$Html$Attributes$stringProperty, 'step', n);
|
return A2($elm$html$Html$Attributes$stringProperty, 'step', n);
|
||||||
};
|
};
|
||||||
var $elm$html$Html$table = _VirtualDom_node('table');
|
var $elm$html$Html$table = _VirtualDom_node('table');
|
||||||
var $author$project$Calculator$SetBundlePrice = function (a) {
|
|
||||||
return {$: 'SetBundlePrice', a: a};
|
|
||||||
};
|
|
||||||
var $author$project$Calculator$SetBundleSize = function (a) {
|
|
||||||
return {$: 'SetBundleSize', a: a};
|
|
||||||
};
|
|
||||||
var $author$project$Calculator$SetTax = function (a) {
|
|
||||||
return {$: 'SetTax', a: a};
|
|
||||||
};
|
|
||||||
var $author$project$NumberInput$get = function ($) {
|
|
||||||
return $.value;
|
|
||||||
};
|
|
||||||
var $author$project$Calculator$roundTo = F2(
|
|
||||||
function (places, x) {
|
|
||||||
return $elm$core$Basics$round(
|
|
||||||
x * A2($elm$core$Basics$pow, 10, places)) / A2($elm$core$Basics$pow, 10, places);
|
|
||||||
});
|
|
||||||
var $author$project$Calculator$getResult = F2(
|
|
||||||
function (model, taxGroup) {
|
|
||||||
var _v0 = _Utils_Tuple2(
|
|
||||||
$author$project$NumberInput$get(model.bundlePrice),
|
|
||||||
$author$project$NumberInput$get(model.bundleSize));
|
|
||||||
if ((_v0.a.$ === 'Just') && (_v0.b.$ === 'Just')) {
|
|
||||||
var bundlePrice = _v0.a.a;
|
|
||||||
var bundleSize = _v0.b.a;
|
|
||||||
return $elm$core$Maybe$Just(
|
|
||||||
A2(
|
|
||||||
$author$project$Calculator$roundTo,
|
|
||||||
2,
|
|
||||||
_Utils_eq(
|
|
||||||
$author$project$Select$get(model.tax),
|
|
||||||
$author$project$Calculator$Gross) ? ((bundlePrice / bundleSize) / (1 + taxGroup.percentage)) : (bundlePrice / bundleSize)));
|
|
||||||
} else {
|
|
||||||
return $elm$core$Maybe$Nothing;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
var $elm$core$Maybe$map = F2(
|
|
||||||
function (f, maybe) {
|
|
||||||
if (maybe.$ === 'Just') {
|
|
||||||
var value = maybe.a;
|
|
||||||
return $elm$core$Maybe$Just(
|
|
||||||
f(value));
|
|
||||||
} else {
|
|
||||||
return $elm$core$Maybe$Nothing;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
var $elm$html$Html$Attributes$placeholder = $elm$html$Html$Attributes$stringProperty('placeholder');
|
|
||||||
var $elm$html$Html$option = _VirtualDom_node('option');
|
var $elm$html$Html$option = _VirtualDom_node('option');
|
||||||
var $elm$html$Html$select = _VirtualDom_node('select');
|
var $elm$html$Html$select = _VirtualDom_node('select');
|
||||||
var $elm$html$Html$Attributes$selected = $elm$html$Html$Attributes$boolProperty('selected');
|
var $elm$html$Html$Attributes$selected = $elm$html$Html$Attributes$boolProperty('selected');
|
||||||
@ -11647,98 +11566,20 @@ var $author$project$Select$view = F2(
|
|||||||
]),
|
]),
|
||||||
A2($elm$core$List$map, viewOption, model.options));
|
A2($elm$core$List$map, viewOption, model.options));
|
||||||
});
|
});
|
||||||
var $author$project$Calculator$view = F2(
|
var $author$project$Entry$SetGrossUnitPrice = function (a) {
|
||||||
function (model, taxGroup) {
|
return {$: 'SetGrossUnitPrice', a: a};
|
||||||
var taxPart = _List_fromArray(
|
};
|
||||||
[
|
var $author$project$Entry$viewGrossUnitPriceInput = function (model) {
|
||||||
$elm$html$Html$text(' ÷ '),
|
var suggestedPriceStr = function () {
|
||||||
A2(
|
var _v0 = $author$project$Entry$calculateGarfieldPrice(model);
|
||||||
$elm$html$Html$input,
|
if (_v0.$ === 'Nothing') {
|
||||||
_List_fromArray(
|
return '?';
|
||||||
[
|
} else {
|
||||||
$elm$html$Html$Attributes$class('formula-input'),
|
var suggestedPrice = _v0.a;
|
||||||
$elm$html$Html$Attributes$disabled(true),
|
return $elm$core$String$fromFloat(suggestedPrice);
|
||||||
$elm$html$Html$Attributes$value(
|
}
|
||||||
$elm$core$String$fromFloat(1 + taxGroup.percentage))
|
}();
|
||||||
]),
|
|
||||||
_List_Nil)
|
|
||||||
]);
|
|
||||||
var resultPart = _List_fromArray(
|
|
||||||
[
|
|
||||||
$elm$html$Html$text(' = '),
|
|
||||||
A2(
|
|
||||||
$elm$html$Html$input,
|
|
||||||
_List_fromArray(
|
|
||||||
[
|
|
||||||
$elm$html$Html$Attributes$class('formula-input'),
|
|
||||||
$elm$html$Html$Attributes$disabled(true),
|
|
||||||
$elm$html$Html$Attributes$value(
|
|
||||||
A2(
|
|
||||||
$elm$core$Maybe$withDefault,
|
|
||||||
'?',
|
|
||||||
A2(
|
|
||||||
$elm$core$Maybe$map,
|
|
||||||
$elm$core$String$fromFloat,
|
|
||||||
A2($author$project$Calculator$getResult, model, taxGroup))))
|
|
||||||
]),
|
|
||||||
_List_Nil)
|
|
||||||
]);
|
|
||||||
var mainPart = _List_fromArray(
|
|
||||||
[
|
|
||||||
$elm$html$Html$text('('),
|
|
||||||
A2(
|
|
||||||
$elm$html$Html$input,
|
|
||||||
_List_fromArray(
|
|
||||||
[
|
|
||||||
$elm$html$Html$Attributes$class('formula-input'),
|
|
||||||
$elm$html$Html$Attributes$placeholder('Gebindepreis'),
|
|
||||||
$elm$html$Html$Attributes$value(
|
|
||||||
$author$project$NumberInput$show(model.bundlePrice)),
|
|
||||||
$elm$html$Html$Events$onInput($author$project$Calculator$SetBundlePrice)
|
|
||||||
]),
|
|
||||||
_List_Nil),
|
|
||||||
$elm$html$Html$text(' ÷ '),
|
|
||||||
A2(
|
|
||||||
$elm$html$Html$input,
|
|
||||||
_List_fromArray(
|
|
||||||
[
|
|
||||||
$elm$html$Html$Attributes$class('formula-input'),
|
|
||||||
$elm$html$Html$Attributes$placeholder('Gebindegröße'),
|
|
||||||
$elm$html$Html$Attributes$value(
|
|
||||||
$author$project$NumberInput$show(model.bundleSize)),
|
|
||||||
$elm$html$Html$Events$onInput($author$project$Calculator$SetBundleSize)
|
|
||||||
]),
|
|
||||||
_List_Nil),
|
|
||||||
$elm$html$Html$text(') ')
|
|
||||||
]);
|
|
||||||
return A2(
|
return A2(
|
||||||
$elm$html$Html$fieldset,
|
|
||||||
_List_Nil,
|
|
||||||
_List_fromArray(
|
|
||||||
[
|
|
||||||
A2(
|
|
||||||
$elm$html$Html$legend,
|
|
||||||
_List_Nil,
|
|
||||||
_List_fromArray(
|
|
||||||
[
|
|
||||||
$elm$html$Html$text('Preisrechner')
|
|
||||||
])),
|
|
||||||
A2(
|
|
||||||
$elm$html$Html$div,
|
|
||||||
_List_Nil,
|
|
||||||
$elm$core$List$concat(
|
|
||||||
A2(
|
|
||||||
$elm$core$List$filterMap,
|
|
||||||
$elm$core$Basics$identity,
|
|
||||||
_List_fromArray(
|
|
||||||
[
|
|
||||||
$elm$core$Maybe$Just(mainPart),
|
|
||||||
_Utils_eq(
|
|
||||||
$author$project$Select$get(model.tax),
|
|
||||||
$author$project$Calculator$Gross) ? $elm$core$Maybe$Just(taxPart) : $elm$core$Maybe$Nothing,
|
|
||||||
$elm$core$Maybe$Just(resultPart)
|
|
||||||
])))),
|
|
||||||
A2(
|
|
||||||
$elm$html$Html$div,
|
$elm$html$Html$div,
|
||||||
_List_fromArray(
|
_List_fromArray(
|
||||||
[
|
[
|
||||||
@ -11750,16 +11591,26 @@ var $author$project$Calculator$view = F2(
|
|||||||
$elm$html$Html$label,
|
$elm$html$Html$label,
|
||||||
_List_fromArray(
|
_List_fromArray(
|
||||||
[
|
[
|
||||||
$elm$html$Html$Attributes$for('calculator-tax')
|
$elm$html$Html$Attributes$for('gross-unit-price')
|
||||||
]),
|
]),
|
||||||
_List_fromArray(
|
_List_fromArray(
|
||||||
[
|
[
|
||||||
$elm$html$Html$text('Gebindepreis ist')
|
$elm$html$Html$text('Stückpreis (Brutto), Vorschlag: ' + suggestedPriceStr)
|
||||||
])),
|
])),
|
||||||
A2($author$project$Select$view, $author$project$Calculator$SetTax, model.tax)
|
A2(
|
||||||
]))
|
$elm$html$Html$input,
|
||||||
|
_List_fromArray(
|
||||||
|
[
|
||||||
|
$elm$html$Html$Events$onInput($author$project$Entry$SetGrossUnitPrice),
|
||||||
|
$elm$html$Html$Attributes$value(
|
||||||
|
$author$project$NumberInput$show(model.grossUnitPrice)),
|
||||||
|
$elm$html$Html$Attributes$id('gross-unit-price'),
|
||||||
|
$elm$html$Html$Attributes$type_('number'),
|
||||||
|
$elm$html$Html$Attributes$step('0.01')
|
||||||
|
]),
|
||||||
|
_List_Nil)
|
||||||
]));
|
]));
|
||||||
});
|
};
|
||||||
var $author$project$Entry$GotoItemEditor = function (a) {
|
var $author$project$Entry$GotoItemEditor = function (a) {
|
||||||
return {$: 'GotoItemEditor', a: a};
|
return {$: 'GotoItemEditor', a: a};
|
||||||
};
|
};
|
||||||
@ -11861,75 +11712,6 @@ var $author$project$Entry$viewSearchResult = function (model) {
|
|||||||
]))
|
]))
|
||||||
]));
|
]));
|
||||||
};
|
};
|
||||||
var $author$project$Entry$viewSetCalculatedPriceButton = function (model) {
|
|
||||||
var _v0 = A2(
|
|
||||||
$author$project$Calculator$getResult,
|
|
||||||
model.calculator,
|
|
||||||
$author$project$Select$get(model.taxGroup));
|
|
||||||
if (_v0.$ === 'Nothing') {
|
|
||||||
return A2(
|
|
||||||
$elm$html$Html$button,
|
|
||||||
_List_fromArray(
|
|
||||||
[
|
|
||||||
$elm$html$Html$Attributes$disabled(true)
|
|
||||||
]),
|
|
||||||
_List_fromArray(
|
|
||||||
[
|
|
||||||
$elm$html$Html$text('Auf ? setzen')
|
|
||||||
]));
|
|
||||||
} else {
|
|
||||||
var calculatedPrice = _v0.a;
|
|
||||||
return A2(
|
|
||||||
$elm$html$Html$button,
|
|
||||||
_List_fromArray(
|
|
||||||
[
|
|
||||||
$elm$html$Html$Events$onClick(
|
|
||||||
$author$project$Entry$SetNetUnitPrice(
|
|
||||||
$elm$core$String$fromFloat(calculatedPrice))),
|
|
||||||
$elm$html$Html$Attributes$type_('button')
|
|
||||||
]),
|
|
||||||
_List_fromArray(
|
|
||||||
[
|
|
||||||
$elm$html$Html$text(
|
|
||||||
'Auf ' + ($elm$core$String$fromFloat(calculatedPrice) + ' setzen'))
|
|
||||||
]));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
var $author$project$Entry$viewSetSuggestedPriceButton = function (model) {
|
|
||||||
var _v0 = $author$project$NumberInput$get(model.netUnitPrice);
|
|
||||||
if (_v0.$ === 'Nothing') {
|
|
||||||
return A2(
|
|
||||||
$elm$html$Html$button,
|
|
||||||
_List_fromArray(
|
|
||||||
[
|
|
||||||
$elm$html$Html$Attributes$disabled(true)
|
|
||||||
]),
|
|
||||||
_List_fromArray(
|
|
||||||
[
|
|
||||||
$elm$html$Html$text('Auf ? setzen')
|
|
||||||
]));
|
|
||||||
} else {
|
|
||||||
var netUnitPrice = _v0.a;
|
|
||||||
var grossUnitPrice = A2(
|
|
||||||
$author$project$Entry$suggestedGrossPrice,
|
|
||||||
netUnitPrice,
|
|
||||||
$author$project$Select$get(model.taxGroup).percentage);
|
|
||||||
return A2(
|
|
||||||
$elm$html$Html$button,
|
|
||||||
_List_fromArray(
|
|
||||||
[
|
|
||||||
$elm$html$Html$Events$onClick(
|
|
||||||
$author$project$Entry$SetGrossUnitPrice(
|
|
||||||
$elm$core$String$fromFloat(grossUnitPrice))),
|
|
||||||
$elm$html$Html$Attributes$type_('button')
|
|
||||||
]),
|
|
||||||
_List_fromArray(
|
|
||||||
[
|
|
||||||
$elm$html$Html$text(
|
|
||||||
'Auf ' + ($elm$core$String$fromFloat(grossUnitPrice) + ' setzen'))
|
|
||||||
]));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
var $author$project$Entry$view = function (_v0) {
|
var $author$project$Entry$view = function (_v0) {
|
||||||
var globals = _v0.globals;
|
var globals = _v0.globals;
|
||||||
var state = _v0.state;
|
var state = _v0.state;
|
||||||
@ -12141,33 +11923,6 @@ var $author$project$Entry$view = function (_v0) {
|
|||||||
])),
|
])),
|
||||||
A2(
|
A2(
|
||||||
$elm$html$Html$div,
|
$elm$html$Html$div,
|
||||||
_List_fromArray(
|
|
||||||
[
|
|
||||||
$elm$html$Html$Attributes$class('form-input')
|
|
||||||
]),
|
|
||||||
_List_fromArray(
|
|
||||||
[
|
|
||||||
A2(
|
|
||||||
$elm$html$Html$label,
|
|
||||||
_List_fromArray(
|
|
||||||
[
|
|
||||||
$elm$html$Html$Attributes$for('tax-group')
|
|
||||||
]),
|
|
||||||
_List_fromArray(
|
|
||||||
[
|
|
||||||
$elm$html$Html$text('Steuergruppe')
|
|
||||||
])),
|
|
||||||
A2($author$project$Select$view, $author$project$Entry$SetTaxGroup, model.taxGroup)
|
|
||||||
])),
|
|
||||||
A2(
|
|
||||||
$elm$html$Html$map,
|
|
||||||
$author$project$Entry$CalculatorMsg,
|
|
||||||
A2(
|
|
||||||
$author$project$Calculator$view,
|
|
||||||
model.calculator,
|
|
||||||
$author$project$Select$get(model.taxGroup))),
|
|
||||||
A2(
|
|
||||||
$elm$html$Html$div,
|
|
||||||
_List_fromArray(
|
_List_fromArray(
|
||||||
[
|
[
|
||||||
$elm$html$Html$Attributes$class('form-input')
|
$elm$html$Html$Attributes$class('form-input')
|
||||||
@ -12182,7 +11937,7 @@ var $author$project$Entry$view = function (_v0) {
|
|||||||
]),
|
]),
|
||||||
_List_fromArray(
|
_List_fromArray(
|
||||||
[
|
[
|
||||||
$elm$html$Html$text('Einkaufspreis (Netto)')
|
$elm$html$Html$text('Stückpreis (Netto)')
|
||||||
])),
|
])),
|
||||||
A2(
|
A2(
|
||||||
$elm$html$Html$input,
|
$elm$html$Html$input,
|
||||||
@ -12195,8 +11950,7 @@ var $author$project$Entry$view = function (_v0) {
|
|||||||
$elm$html$Html$Attributes$id('net-unit-price'),
|
$elm$html$Html$Attributes$id('net-unit-price'),
|
||||||
$elm$html$Html$Attributes$step('0.01')
|
$elm$html$Html$Attributes$step('0.01')
|
||||||
]),
|
]),
|
||||||
_List_Nil),
|
_List_Nil)
|
||||||
$author$project$Entry$viewSetCalculatedPriceButton(model)
|
|
||||||
])),
|
])),
|
||||||
A2(
|
A2(
|
||||||
$elm$html$Html$div,
|
$elm$html$Html$div,
|
||||||
@ -12210,26 +11964,56 @@ var $author$project$Entry$view = function (_v0) {
|
|||||||
$elm$html$Html$label,
|
$elm$html$Html$label,
|
||||||
_List_fromArray(
|
_List_fromArray(
|
||||||
[
|
[
|
||||||
$elm$html$Html$Attributes$for('gross-unit-price')
|
$elm$html$Html$Attributes$for('tax-group')
|
||||||
]),
|
]),
|
||||||
_List_fromArray(
|
_List_fromArray(
|
||||||
[
|
[
|
||||||
$elm$html$Html$text('Verkaufspreis (Brutto)')
|
$elm$html$Html$text('Steuergruppe')
|
||||||
|
])),
|
||||||
|
A2($author$project$Select$view, $author$project$Entry$SetTaxGroup, model.taxGroup)
|
||||||
|
]))
|
||||||
|
])),
|
||||||
|
A2(
|
||||||
|
$elm$html$Html$fieldset,
|
||||||
|
_List_Nil,
|
||||||
|
_List_fromArray(
|
||||||
|
[
|
||||||
|
A2(
|
||||||
|
$elm$html$Html$legend,
|
||||||
|
_List_Nil,
|
||||||
|
_List_fromArray(
|
||||||
|
[
|
||||||
|
$elm$html$Html$text('Neuer Snackeintrag')
|
||||||
|
])),
|
||||||
|
A2(
|
||||||
|
$elm$html$Html$div,
|
||||||
|
_List_fromArray(
|
||||||
|
[
|
||||||
|
$elm$html$Html$Attributes$class('form-input')
|
||||||
|
]),
|
||||||
|
_List_fromArray(
|
||||||
|
[
|
||||||
|
A2(
|
||||||
|
$elm$html$Html$label,
|
||||||
|
_List_fromArray(
|
||||||
|
[
|
||||||
|
$elm$html$Html$Attributes$for('snack-name')
|
||||||
|
]),
|
||||||
|
_List_fromArray(
|
||||||
|
[
|
||||||
|
$elm$html$Html$text('Name')
|
||||||
])),
|
])),
|
||||||
A2(
|
A2(
|
||||||
$elm$html$Html$input,
|
$elm$html$Html$input,
|
||||||
_List_fromArray(
|
_List_fromArray(
|
||||||
[
|
[
|
||||||
$elm$html$Html$Attributes$value(
|
$elm$html$Html$Attributes$value(model.name),
|
||||||
$author$project$NumberInput$show(model.grossUnitPrice)),
|
$elm$html$Html$Attributes$disabled(true),
|
||||||
$elm$html$Html$Events$onInput($author$project$Entry$SetGrossUnitPrice),
|
$elm$html$Html$Attributes$id('snack-name')
|
||||||
$elm$html$Html$Attributes$type_('number'),
|
|
||||||
$elm$html$Html$Attributes$id('gross-unit-price'),
|
|
||||||
$elm$html$Html$Attributes$step('0.01')
|
|
||||||
]),
|
]),
|
||||||
_List_Nil),
|
_List_Nil)
|
||||||
$author$project$Entry$viewSetSuggestedPriceButton(model)
|
])),
|
||||||
]))
|
$author$project$Entry$viewGrossUnitPriceInput(model)
|
||||||
]))
|
]))
|
||||||
]));
|
]));
|
||||||
}
|
}
|
||||||
@ -12318,4 +12102,4 @@ _Platform_export({'Entry':{'init':$author$project$Entry$main(
|
|||||||
},
|
},
|
||||||
A2($elm$json$Json$Decode$field, 'id', $elm$json$Json$Decode$int));
|
A2($elm$json$Json$Decode$field, 'id', $elm$json$Json$Decode$int));
|
||||||
},
|
},
|
||||||
A2($elm$json$Json$Decode$field, 'percentage', $elm$json$Json$Decode$float))))))({"versions":{"elm":"0.19.1"},"types":{"message":"Entry.Msg","aliases":{"Entry.SearchResult":{"args":[],"type":"{ barcode : String.String, name : String.String, netUnitPrice : Basics.Float, bought : String.String, salesUnits : Basics.Int, available : Basics.Bool, locationName : String.String, locationId : Basics.Int, groupName : String.String, groupId : Basics.Int, taxGroupId : Basics.Int }"}},"unions":{"Entry.Msg":{"args":[],"tags":{"SetSearchTerm":["String.String"],"SubmitSearch":[],"ReceiveSearchResults":["Result.Result Http.Error (List.List Entry.SearchResult)"],"GotoItemEditor":["Entry.SearchResult"],"SetBarcode":["String.String"],"SetName":["String.String"],"SetSalesUnits":["String.String"],"CalculatorMsg":["Calculator.Msg"],"SetNetUnitPrice":["String.String"],"SetGrossUnitPrice":["String.String"],"SetGroup":["String.String"],"SetLocation":["String.String"],"SetTaxGroup":["String.String"]}},"Basics.Bool":{"args":[],"tags":{"True":[],"False":[]}},"Http.Error":{"args":[],"tags":{"BadUrl":["String.String"],"Timeout":[],"NetworkError":[],"BadStatus":["Basics.Int"],"BadBody":["String.String"]}},"Basics.Float":{"args":[],"tags":{"Float":[]}},"Basics.Int":{"args":[],"tags":{"Int":[]}},"List.List":{"args":["a"],"tags":{}},"Calculator.Msg":{"args":[],"tags":{"SetTax":["String.String"],"SetBundlePrice":["String.String"],"SetBundleSize":["String.String"]}},"Result.Result":{"args":["error","value"],"tags":{"Ok":["value"],"Err":["error"]}},"String.String":{"args":[],"tags":{"String":[]}}}}})}});}(this));
|
A2($elm$json$Json$Decode$field, 'percentage', $elm$json$Json$Decode$float))))))({"versions":{"elm":"0.19.1"},"types":{"message":"Entry.Msg","aliases":{"Entry.SearchResult":{"args":[],"type":"{ barcode : String.String, name : String.String, netUnitPrice : Basics.Float, bought : String.String, salesUnits : Basics.Int, available : Basics.Bool, locationName : String.String, locationId : Basics.Int, groupName : String.String, groupId : Basics.Int, taxGroupId : Basics.Int }"}},"unions":{"Entry.Msg":{"args":[],"tags":{"SetSearchTerm":["String.String"],"SubmitSearch":[],"ReceiveSearchResults":["Result.Result Http.Error (List.List Entry.SearchResult)"],"GotoItemEditor":["Entry.SearchResult"],"SetBarcode":["String.String"],"SetName":["String.String"],"SetSalesUnits":["String.String"],"SetNetUnitPrice":["String.String"],"SetGrossUnitPrice":["String.String"],"SetGroup":["String.String"],"SetLocation":["String.String"],"SetTaxGroup":["String.String"]}},"Basics.Bool":{"args":[],"tags":{"True":[],"False":[]}},"Http.Error":{"args":[],"tags":{"BadUrl":["String.String"],"Timeout":[],"NetworkError":[],"BadStatus":["Basics.Int"],"BadBody":["String.String"]}},"Basics.Float":{"args":[],"tags":{"Float":[]}},"Basics.Int":{"args":[],"tags":{"Int":[]}},"List.List":{"args":["a"],"tags":{}},"Result.Result":{"args":["error","value"],"tags":{"Ok":["value"],"Err":["error"]}},"String.String":{"args":[],"tags":{"String":[]}}}}})}});}(this));
|
@ -63,6 +63,3 @@ th {
|
|||||||
.form-input > select {
|
.form-input > select {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
.formula-input {
|
|
||||||
width: 10em;
|
|
||||||
}
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user