From 0e34fc42a0a42851caa1816bde3a85c1db546435 Mon Sep 17 00:00:00 2001 From: Ivaylo Ivanov Date: Wed, 10 Nov 2021 17:34:08 +0100 Subject: [PATCH] Fix variable definitions in UE4 A.2 --- code/Angabe4.lhs | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/code/Angabe4.lhs b/code/Angabe4.lhs index 6f05c16..9843c4e 100644 --- a/code/Angabe4.lhs +++ b/code/Angabe4.lhs @@ -323,17 +323,22 @@ 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) -> where -> 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 g = +> let +> sum = toInteger(cents (gutschrift g)) +> bills = fromIntegral(sum `div` 100) :: Nat1 +> coins = fromIntegral(sum `mod` 100) :: Nat1 +> res = EC bills coins +> in +> K_Gutschrift res (gutschriftsdatum g) +> | otherwise = +> let +> sum = toInteger(cents (netto g)) +> bills = fromIntegral(sum `div` 100) :: Nat1 +> coins = fromIntegral(sum `mod` 100) :: Nat1 +> res = EC bills coins +> in +> K_Zahlung res (zahlungsdatum g) > is_p_credit :: AP_Geschaeftsvorfall -> Bool > is_p_credit g =