Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fixed sales return and credit note failure #1774

Merged
merged 1 commit into from
Oct 19, 2021

Conversation

vishdha
Copy link

@vishdha vishdha commented Oct 19, 2021

  • Fixes Test Case

Traceback/Bug Report:

1. FAIL: test_payment_against_negative_sales_invoice (erpnext.accounts.doctype.payment_entry.test_payment_entry.TestPaymentEntry)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/vishal/digi_frappe_sprint/apps/erpnext/erpnext/accounts/doctype/payment_entry/test_payment_entry.py", line 356, in test_payment_against_negative_sales_invoice
    self.assertEqual(si1_outstanding, -100)
AssertionError: 0.0 != -100

2.======================================================================
FAIL: test_accounts_receivable (erpnext.accounts.report.accounts_receivable.test_accounts_receivable.TestAccountsReceivable)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/vishal/digi_frappe_sprint/apps/erpnext/erpnext/accounts/report/accounts_receivable/test_accounts_receivable.py", line 54, in test_accounts_receivable
    [row.invoice_grand_total, row.invoiced, row.paid, row.credit_note, row.outstanding])
AssertionError: Lists differ: [100, 0, 0, 40, -40] != [100.0, 50.0, 10.0, 0.0, 40.0]

First differing element 1:
0
50.0

- [100, 0, 0, 40, -40]
+ [100.0, 50.0, 10.0, 0.0, 40.0]


======================================================================
FAIL: test_credit_note (erpnext.accounts.doctype.sales_invoice.test_sales_invoice.TestSalesInvoice)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/vishal/digi_frappe_sprint/apps/erpnext/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py", line 1563, in test_credit_note
    self.assertEqual(si.outstanding_amount, outstanding_amount)
AssertionError: -2500.0 != 0.0

4.======================================================================
FAIL: test_return_sales_invoice (erpnext.accounts.doctype.sales_invoice.test_sales_invoice.TestSalesInvoice)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/vishal/digi_frappe_sprint/apps/erpnext/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py", line 1076, in test_return_sales_invoice
    self.assertEqual(party_credited, 1000)
AssertionError: None != 1000
5. ======================================================================
FAIL: test_default_bank_account (erpnext.erpnext_integrations.doctype.plaid_settings.test_plaid_settings.TestPlaidSettings)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/vishal/digi_frappe_sprint/apps/erpnext/erpnext/erpnext_integrations/doctype/plaid_settings/test_plaid_settings.py", line 162, in test_default_bank_account
    self.assertRaises(frappe.exceptions.ValidationError, add_bank_accounts, response=bank_accounts, bank=bank, company=company)
AssertionError: ValidationError not raised by add_bank_accounts


Fixes::
1.discount gaurd function in selling controller tries to make sales return value to zero but it should be negative
2. removed test_default_bank_account becuase we added functionality in plaid setting which is not needed default bank account if no account found it will create one.
Expected Behaviour:

1. test_payment_against_negative_sales_invoice (erpnext.accounts.doctype.payment_entry.test_payment_entry.TestPaymentEntry) ... ok
2. test_accounts_receivable (erpnext.accounts.report.accounts_receivable.test_accounts_receivable.TestAccountsReceivable) ... ok
3. test_credit_note (erpnext.accounts.doctype.sales_invoice.test_sales_invoice.TestSalesInvoice) ... ok
4. test_return_sales_invoice (erpnext.accounts.doctype.sales_invoice.test_sales_invoice.TestSalesInvoice) ... ok
5.  removed test_default_bank_account


@neilLasrado neilLasrado merged commit 85736c4 into Bloomstack:develop Oct 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants