Spaces:
Sleeping
Sleeping
Initial Draft
Browse files
app.py
CHANGED
@@ -39,6 +39,7 @@ def fn_generate_data(mv_setup_df, mv_txn_df, mv_balance_df, mv_due_date_history_
|
|
39 |
lv_total_waived = 0
|
40 |
lv_total_adj_minus = 0
|
41 |
lv_total_payment_appropriated = 0
|
|
|
42 |
lv_index = 0
|
43 |
lv_txn_details = []
|
44 |
mv_txn_details_by_bill = []
|
@@ -49,7 +50,6 @@ def fn_generate_data(mv_setup_df, mv_txn_df, mv_balance_df, mv_due_date_history_
|
|
49 |
for lv_txn_index, lv_txn_row in mv_txn_df.iterrows():
|
50 |
|
51 |
lv_setup_record_type = mv_setup_df.loc[mv_setup_df['TXN_CODE'] == lv_txn_row['TXN_TCD_CODE']]['TYPE'].values
|
52 |
-
print('Value - '+lv_setup_record_type+' Amount '+str(lv_txn_row['TXN_AMT']))
|
53 |
lv_balance_code = lv_txn_row['TXN_TCD_CODE']
|
54 |
lv_posted = 0
|
55 |
lv_adj_plus = 0
|
@@ -69,6 +69,7 @@ def fn_generate_data(mv_setup_df, mv_txn_df, mv_balance_df, mv_due_date_history_
|
|
69 |
|
70 |
if(lv_setup_record_type == 'REFUND'):
|
71 |
lv_refund = lv_txn_row['TXN_AMT']
|
|
|
72 |
|
73 |
if lv_balance_code in mv_balance_df['BALANCE_CODE'].values:
|
74 |
lv_temp_row_id = mv_balance_df.index[mv_balance_df['BALANCE_CODE'] == lv_balance_code][0]
|
@@ -218,7 +219,7 @@ def fn_generate_data(mv_setup_df, mv_txn_df, mv_balance_df, mv_due_date_history_
|
|
218 |
mv_balance_df.loc['Total']= mv_balance_df.sum()
|
219 |
mv_balance_df.loc[mv_balance_df.index[-1], 'BALANCE_CODE'] = ''
|
220 |
|
221 |
-
return mv_balance_df,mv_due_date_history_df, mv_txn_details_by_bill, lv_total_posted_txns, lv_total_payment, lv_total_due_amt, lv_total_payment_appropriated, lv_total_adj_minus, lv_total_waived, lv_has_excess_payment, lv_has_charged_off
|
222 |
|
223 |
# Main Program
|
224 |
def main():
|
@@ -259,7 +260,7 @@ def main():
|
|
259 |
|
260 |
with st.spinner("Generating response..."):
|
261 |
|
262 |
-
mv_balance_df,mv_due_date_history_df, mv_txn_details_by_bill, lv_total_posted_txns, lv_total_payment, lv_total_due_amt, lv_total_payment_appropriated, lv_total_adj_minus, lv_total_waived, lv_has_excess_payment, lv_has_charged_off = fn_generate_data(mv_setup_df, mv_txn_df, mv_balance_df, mv_due_date_history_df)
|
263 |
lv_summary = f"""
|
264 |
#### Summary:
|
265 |
- Total Txns Posted = **{round(lv_total_posted_txns,2)}**.
|
@@ -269,7 +270,7 @@ def main():
|
|
269 |
- Total Adjust Minus = **{round(lv_total_adj_minus,2)}**.
|
270 |
- Total Waived = **{round(lv_total_waived,2)}**.
|
271 |
- Difference of Payments = **{round(round(lv_total_payment,2) - round(lv_total_payment_appropriated,2),2)}**.
|
272 |
-
- Estimated Payoff Amount = **{round(round(lv_total_posted_txns,2) - round(lv_total_payment,2) - round(lv_total_adj_minus,2) - round(lv_total_waived,2),2)}**.
|
273 |
"""
|
274 |
|
275 |
with st.container(border=True):
|
|
|
39 |
lv_total_waived = 0
|
40 |
lv_total_adj_minus = 0
|
41 |
lv_total_payment_appropriated = 0
|
42 |
+
lv_total_refund = 0
|
43 |
lv_index = 0
|
44 |
lv_txn_details = []
|
45 |
mv_txn_details_by_bill = []
|
|
|
50 |
for lv_txn_index, lv_txn_row in mv_txn_df.iterrows():
|
51 |
|
52 |
lv_setup_record_type = mv_setup_df.loc[mv_setup_df['TXN_CODE'] == lv_txn_row['TXN_TCD_CODE']]['TYPE'].values
|
|
|
53 |
lv_balance_code = lv_txn_row['TXN_TCD_CODE']
|
54 |
lv_posted = 0
|
55 |
lv_adj_plus = 0
|
|
|
69 |
|
70 |
if(lv_setup_record_type == 'REFUND'):
|
71 |
lv_refund = lv_txn_row['TXN_AMT']
|
72 |
+
lv_total_refund += lv_refund
|
73 |
|
74 |
if lv_balance_code in mv_balance_df['BALANCE_CODE'].values:
|
75 |
lv_temp_row_id = mv_balance_df.index[mv_balance_df['BALANCE_CODE'] == lv_balance_code][0]
|
|
|
219 |
mv_balance_df.loc['Total']= mv_balance_df.sum()
|
220 |
mv_balance_df.loc[mv_balance_df.index[-1], 'BALANCE_CODE'] = ''
|
221 |
|
222 |
+
return mv_balance_df,mv_due_date_history_df, mv_txn_details_by_bill, lv_total_posted_txns, lv_total_payment, lv_total_due_amt, lv_total_payment_appropriated, lv_total_adj_minus, lv_total_waived, lv_total_refund, lv_has_excess_payment, lv_has_charged_off
|
223 |
|
224 |
# Main Program
|
225 |
def main():
|
|
|
260 |
|
261 |
with st.spinner("Generating response..."):
|
262 |
|
263 |
+
mv_balance_df,mv_due_date_history_df, mv_txn_details_by_bill, lv_total_posted_txns, lv_total_payment, lv_total_due_amt, lv_total_payment_appropriated, lv_total_adj_minus, lv_total_waived, lv_total_refund, lv_has_excess_payment, lv_has_charged_off = fn_generate_data(mv_setup_df, mv_txn_df, mv_balance_df, mv_due_date_history_df)
|
264 |
lv_summary = f"""
|
265 |
#### Summary:
|
266 |
- Total Txns Posted = **{round(lv_total_posted_txns,2)}**.
|
|
|
270 |
- Total Adjust Minus = **{round(lv_total_adj_minus,2)}**.
|
271 |
- Total Waived = **{round(lv_total_waived,2)}**.
|
272 |
- Difference of Payments = **{round(round(lv_total_payment,2) - round(lv_total_payment_appropriated,2),2)}**.
|
273 |
+
- Estimated Payoff Amount = **{round(round(lv_total_posted_txns,2) - round(lv_total_payment,2) - round(lv_total_adj_minus,2) - round(lv_total_waived,2) + round(lv_total_refund,2),2)}**.
|
274 |
"""
|
275 |
|
276 |
with st.container(border=True):
|