complete UE4 A.2
This commit is contained in:
parent
c31798f66c
commit
bf7c7251a4
@ -282,7 +282,7 @@ Aufgabe A.1
|
||||
> | is_credit g = P_Gutschrift (gutschriftsbetrag g) (gutschrift_vom g)
|
||||
> | otherwise = AP_Zahlung n (zahlung_vom g)
|
||||
> where
|
||||
> b = fromInteger (toInteger (cents (brutto g))) :: Float -- convert b to float
|
||||
> b = fromIntegral(cents (brutto g)) :: Float -- convert b to float
|
||||
> s = skonto_to_num (skonto g)
|
||||
> n = C ((round(b - (b * s))) :: Nat1)
|
||||
|
||||
@ -323,13 +323,17 @@ Nur Werte zwischen 0 und 99 fuer cent!
|
||||
|
||||
> consolidate_payment_sum :: AP_Geschaeftsvorfall -> K_Geschaeftsvorfall
|
||||
> consolidate_payment_sum g
|
||||
> | is_p_credit g = K_Gutschrift (res) (gutschriftsdatum g)
|
||||
> | otherwise = K_Zahlung (res') (zahlungsdatum g)
|
||||
> | is_p_credit g = K_Gutschrift res (gutschriftsdatum g)
|
||||
> | otherwise = K_Zahlung res' (zahlungsdatum g)
|
||||
> where
|
||||
> sum = gutschrift g
|
||||
> sum' = netto g
|
||||
> res = EuroCent (sum/100) (sum `mod` 100)
|
||||
> res' = EuroCent (sum'/100) (sum' `mod` 100)
|
||||
> sum = toInteger(cents (gutschrift g))
|
||||
> sum' = toInteger(cents (netto g))
|
||||
> bills = fromIntegral(sum `div` 100) :: Nat1
|
||||
> bills' = fromIntegral(sum' `div` 100) :: Nat1
|
||||
> coins = fromIntegral(sum `mod` 100) :: Nat1
|
||||
> coins' = fromIntegral(sum `mod` 100) :: Nat1
|
||||
> res = EC bills coins
|
||||
> res' = EC bills' coins'
|
||||
|
||||
> is_p_credit :: AP_Geschaeftsvorfall -> Bool
|
||||
> is_p_credit g =
|
||||
|
Reference in New Issue
Block a user