Repay Groceries
COMMENT
🛒 **Grocery Repayment Shortcut**
This Shortcut helps streamline the process of calculating and sending a repayment request for groceries bought on behalf of someone else, specifically if the receipt includes both their purchases and personal items, along with optional purchases of koopzegels (savings stamps).
SCRIPTING
Ask
How much is paid for groceries?

Provided Input
VARIABLES
Set variable
totalAmount
to
Ask for Input
SCRIPTING
Ask
How much is paid for Koopzegels?

Provided Input
VARIABLES
Set variable
koopZegels
to
Ask for Input
SCRIPTING
Ask
How many items are personal purchases?

Provided Input
SCRIPTING
If
Ask for Input
is
0
NOTHING
Nothing
SCRIPTING
Otherwise
NUMBER
0

Number
VARIABLES
Set variable
itemNumber
to
Number
SCRIPTING
Repeat
Ask for Input

Repeat Results
MATHS
itemNumber
+
1
Options Under Construction

Calculation Result
VARIABLES
Set variable
itemNumber
to
Calculation Result
SCRIPTING
Ask
Price paid for item #
itemNumber
:

Provided Input
VARIABLES
Add
Ask for Input
to
itemPrices
SCRIPTING
End Repeat

Repeat Results
SCRIPTING
End If

If Result
VARIABLES
Get
itemPrices
MATHS
Calculate the
Sum
of
itemPrices

Statistics
VARIABLES
Set variable
privatePurchases
to
Sum
MATHS
koopZegels
+
privatePurchases
Options Under Construction

Calculation Result
VARIABLES
Set variable
reduction
to
Calculation Result
MATHS
totalAmount
-
reduction
Options Under Construction

Calculation Result
VARIABLES
Set variable
Refund
to
Calculation Result
LIST

List
SCRIPTING
Choose from
List
Prompt
To which account should be refunded?

Chosen Item
VARIABLES
Set variable
account
to
Selected Item
TEXT
Hi Mom! Please repay €
Refund
to
account
for the #groceries. Thank you!

Text
NULL
Under Construction
SCRIPTING
Choose from Menu

Menu Result
SCRIPTING
Yes

Menu Result
CAMERA
Take
1 photo
photo
Back
camera

Photo
NULL
Under Construction
SCRIPTING
No

Menu Result
NOTHING
Nothing
SCRIPTING
End Menu

Menu Result
Showcuts