Open pierre opened 1 year ago
⚡ Sweep Free Trial: I used GPT-4 to create this ticket. You have 5 GPT-4 tickets left. For more GPT-4 tickets, visit our payment portal.To get Sweep to recreate this ticket, leave a comment prefixed with "sweep:" or edit the issue.
I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.
I also found the following external resources that might be helpful:
The given page does not contain any content or code snippets.
From looking through the relevant snippets, I decided to make the following modifications:
File Path | Proposed Changes |
---|---|
app/views/deposit/collection/_invoices_table.html.erb |
In the DataTables initialization code, set the default value of the payment amount input field to 0. Add a condition to check if the invoice balance is 0, and if so, disable the corresponding payment amount input field. |
test/integration/navigation_test.rb |
Add a new test case to verify the changes in the view. Use mock invoices and mock payments to check if the payment amount field is auto-populated with 0 and is disabled when the invoice balance is 0. |
I have created a plan for writing the pull request. I am now working my plan and coding the required changes to address this issue. Here is the planned pull request:
Pre-populate a 0 amount for all invoice payment lines
sweep/pre-populate-0-amount
Description
This PR addresses the issue #1 by modifying the
_invoices_table.html.erb
view. The changes include setting the default value of the payment amount input field to 0 and disabling it if the invoice balance is 0. Additionally, a new Rails view test is added to verify these changes using mock invoices and mock payments.Summary of Changes
- Modified
app/views/deposit/collection/_invoices_table.html.erb
to set the default value of the payment amount input field to 0 and disable it if the invoice balance is 0.- Added a new test case in
test/integration/navigation_test.rb
to verify the changes in the view. The test uses mock invoices and mock payments to check if the payment amount field is auto-populated with 0 and is disabled when the invoice balance is 0.
I have finished coding the issue. I am now reviewing it for completeness.
Success! 🚀
To recreate the pull request, leave a comment prefixed with "sweep:" or edit the issue. Join Our Discord
For all line items on the form https://github.com/killbill/killbill-deposit-ui/blob/main/app/views/deposit/collection/_invoices_table.html.erb:
Write a Rails view test using mock invoices and mock payments to verify the above.