Skip to content

Instantly share code, notes, and snippets.

@thinkphp
Created July 5, 2025 09:34
Show Gist options
  • Save thinkphp/27a9dd6bb68c4ff9aabea04fea6f6e11 to your computer and use it in GitHub Desktop.
Save thinkphp/27a9dd6bb68c4ff9aabea04fea6f6e11 to your computer and use it in GitHub Desktop.
+-------------------------------+
| Start |
+-------------------------------+
|
v
+-------------------------------+
| For each transaction in |
| TRANSACTIONS |
+-------------------------------+
|
v
+-------------------------------+
| Get property_code and amount |
+-------------------------------+
|
v
+-------------------------------+
| Is amount > 0 ? |
+--------+--------------+------+
| |
Yes No
| |
v v
+----------------+ +-------------------------------+
| summary[prop_code] | | summary[prop_code] |
| ["total_rents"] | | ["total_repairs"] |
| += amount | | += abs(amount) |
+----------------+ +-------------------------------+
| |
+-------+------+
|
v
+-------------------------------+
| Next transaction? |
+-------------------------------+
|
v
[End]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment