mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-07 07:02:54 +00:00
chore: resolve conflicts
This commit is contained in:
@@ -3860,63 +3860,6 @@ class TestSalesInvoice(FrappeTestCase):
|
|||||||
doc = frappe.get_doc("Project", project.name)
|
doc = frappe.get_doc("Project", project.name)
|
||||||
self.assertEqual(doc.total_billed_amount, si.grand_total)
|
self.assertEqual(doc.total_billed_amount, si.grand_total)
|
||||||
|
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
def check_gl_entries(doc, voucher_no, expected_gle, posting_date):
|
|
||||||
gl_entries = frappe.db.sql(
|
|
||||||
"""select account, debit, credit, posting_date
|
|
||||||
from `tabGL Entry`
|
|
||||||
where voucher_type='Sales Invoice' and voucher_no=%s and posting_date > %s
|
|
||||||
and is_cancelled = 0
|
|
||||||
order by posting_date asc, account asc""",
|
|
||||||
(voucher_no, posting_date),
|
|
||||||
as_dict=1,
|
|
||||||
=======
|
|
||||||
si = create_sales_invoice(do_not_submit=True)
|
|
||||||
|
|
||||||
project = frappe.new_doc("Project")
|
|
||||||
project.company = "_Test Company"
|
|
||||||
project.project_name = "Test Total Billed Amount"
|
|
||||||
project.save()
|
|
||||||
|
|
||||||
si.project = project.name
|
|
||||||
si.items.append(copy(si.items[0]))
|
|
||||||
si.items.append(copy(si.items[0]))
|
|
||||||
si.items[0].project = project.name
|
|
||||||
si.items[1].project = project.name
|
|
||||||
# Not setting project on last item
|
|
||||||
si.items[1].insert()
|
|
||||||
si.items[2].insert()
|
|
||||||
si.submit()
|
|
||||||
|
|
||||||
project.reload()
|
|
||||||
self.assertIsNone(si.items[2].project)
|
|
||||||
self.assertEqual(project.total_billed_amount, 300)
|
|
||||||
|
|
||||||
def test_pos_returns_with_party_account_currency(self):
|
|
||||||
from erpnext.accounts.doctype.sales_invoice.sales_invoice import make_sales_return
|
|
||||||
|
|
||||||
pos_profile = make_pos_profile()
|
|
||||||
pos_profile.payments = []
|
|
||||||
pos_profile.append("payments", {"default": 1, "mode_of_payment": "Cash"})
|
|
||||||
pos_profile.save()
|
|
||||||
|
|
||||||
pos = create_sales_invoice(
|
|
||||||
customer="_Test Customer USD",
|
|
||||||
currency="USD",
|
|
||||||
conversion_rate=86.595000000,
|
|
||||||
qty=2,
|
|
||||||
do_not_save=True,
|
|
||||||
)
|
|
||||||
pos.is_pos = 1
|
|
||||||
pos.pos_profile = pos_profile.name
|
|
||||||
pos.debit_to = "_Test Receivable USD - _TC"
|
|
||||||
pos.append("payments", {"mode_of_payment": "Cash", "account": "_Test Bank - _TC", "amount": 20.35})
|
|
||||||
pos.save().submit()
|
|
||||||
|
|
||||||
pos_return = make_sales_return(pos.name)
|
|
||||||
self.assertEqual(abs(pos_return.payments[0].amount), pos.payments[0].amount)
|
|
||||||
|
|
||||||
def test_create_return_invoice_for_self_update(self):
|
def test_create_return_invoice_for_self_update(self):
|
||||||
from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry
|
from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry
|
||||||
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
|
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
|
||||||
@@ -3946,30 +3889,16 @@ def check_gl_entries(doc, voucher_no, expected_gle, posting_date):
|
|||||||
|
|
||||||
self.assertEqual(invoice.outstanding_amount, 0)
|
self.assertEqual(invoice.outstanding_amount, 0)
|
||||||
|
|
||||||
def test_prevents_fully_returned_invoice_with_zero_quantity(self):
|
|
||||||
from erpnext.controllers.sales_and_purchase_return import StockOverReturnError, make_return_doc
|
|
||||||
|
|
||||||
invoice = create_sales_invoice(qty=10)
|
def check_gl_entries(doc, voucher_no, expected_gle, posting_date):
|
||||||
|
gl_entries = frappe.db.sql(
|
||||||
return_doc = make_return_doc(invoice.doctype, invoice.name)
|
"""select account, debit, credit, posting_date
|
||||||
return_doc.items[0].qty = -10
|
from `tabGL Entry`
|
||||||
return_doc.save().submit()
|
where voucher_type='Sales Invoice' and voucher_no=%s and posting_date > %s
|
||||||
|
and is_cancelled = 0
|
||||||
return_doc = make_return_doc(invoice.doctype, invoice.name)
|
order by posting_date asc, account asc""",
|
||||||
return_doc.items[0].qty = 0
|
(voucher_no, posting_date),
|
||||||
|
as_dict=1,
|
||||||
self.assertRaises(StockOverReturnError, return_doc.save)
|
|
||||||
|
|
||||||
|
|
||||||
def set_advance_flag(company, flag, default_account):
|
|
||||||
frappe.db.set_value(
|
|
||||||
"Company",
|
|
||||||
company,
|
|
||||||
{
|
|
||||||
"book_advance_payments_in_separate_party_account": flag,
|
|
||||||
"default_advance_received_account": default_account,
|
|
||||||
},
|
|
||||||
>>>>>>> 7b0882600a (test: add unit test to validate outstanding amount for update_outstanding_for_self checkbox enabled)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
for i, gle in enumerate(gl_entries):
|
for i, gle in enumerate(gl_entries):
|
||||||
|
|||||||
@@ -252,23 +252,6 @@ class AccountsController(TransactionBase):
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
if self.get("is_return") and self.get("return_against") and not self.get("is_pos"):
|
|
||||||
if self.get("update_outstanding_for_self"):
|
|
||||||
document_type = "Credit Note" if self.doctype == "Sales Invoice" else "Debit Note"
|
|
||||||
frappe.msgprint(
|
|
||||||
_(
|
|
||||||
"We can see {0} is made against {1}. If you want {1}'s outstanding to be updated, uncheck '{2}' checkbox. <br><br> Or you can use {3} tool to reconcile against {1} later."
|
|
||||||
).format(
|
|
||||||
frappe.bold(document_type),
|
|
||||||
get_link_to_form(self.doctype, self.get("return_against")),
|
|
||||||
frappe.bold("Update Outstanding for Self"),
|
|
||||||
get_link_to_form("Payment Reconciliation", "Payment Reconciliation"),
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
=======
|
|
||||||
>>>>>>> 222f1834f1 (fix(accounting): update outstanding amount based on update_outstanding_for_self)
|
|
||||||
pos_check_field = "is_pos" if self.doctype == "Sales Invoice" else "is_paid"
|
pos_check_field = "is_pos" if self.doctype == "Sales Invoice" else "is_paid"
|
||||||
if cint(self.allocate_advances_automatically) and not cint(self.get(pos_check_field)):
|
if cint(self.allocate_advances_automatically) and not cint(self.get(pos_check_field)):
|
||||||
self.set_advances()
|
self.set_advances()
|
||||||
|
|||||||
Reference in New Issue
Block a user