Exemplo n.º 1
0
	def test_clear_sales_invoice(self):
		bank_transaction = frappe.get_doc("Bank Transaction", dict(description="I2015000011 VD/000002514 ATWWXXX AT4701345000003510057 Bio"))
		payment = frappe.get_doc("Sales Invoice", dict(customer="Fayva", status=["=", "Paid"]))
		reconcile(bank_transaction.name, "Sales Invoice", payment.name)

		self.assertEqual(frappe.db.get_value("Bank Transaction", bank_transaction.name, "unallocated_amount"), 0)
		self.assertTrue(frappe.db.get_value("Sales Invoice Payment", dict(parent=payment.name), "clearance_date") is not None)
Exemplo n.º 2
0
	def test_clear_sales_invoice(self):
		bank_transaction = frappe.get_doc("Bank Transaction", dict(description="I2015000011 VD/000002514 ATWWXXX AT4701345000003510057 Bio"))
		payment = frappe.get_doc("Sales Invoice", dict(customer="Fayva", status=["=", "Paid"]))
		reconcile(bank_transaction.name, "Sales Invoice", payment.name)

		self.assertEqual(frappe.db.get_value("Bank Transaction", bank_transaction.name, "unallocated_amount"), 0)
		self.assertTrue(frappe.db.get_value("Sales Invoice Payment", dict(parent=payment.name), "clearance_date") is not None)
Exemplo n.º 3
0
	def test_already_reconciled(self):
		bank_transaction = frappe.get_doc("Bank Transaction", dict(description="1512567 BG/000002918 OPSKATTUZWXXX AT776000000098709837 Herr G"))
		payment = frappe.get_doc("Payment Entry", dict(party="Mr G", paid_amount=1200))
		reconcile(bank_transaction.name, "Payment Entry", payment.name)

		bank_transaction = frappe.get_doc("Bank Transaction", dict(description="1512567 BG/000002918 OPSKATTUZWXXX AT776000000098709837 Herr G"))
		payment = frappe.get_doc("Payment Entry", dict(party="Mr G", paid_amount=1200))
		self.assertRaises(frappe.ValidationError, reconcile, bank_transaction=bank_transaction.name, payment_doctype="Payment Entry", payment_name=payment.name)
Exemplo n.º 4
0
	def test_already_reconciled(self):
		bank_transaction = frappe.get_doc("Bank Transaction", dict(description="1512567 BG/000002918 OPSKATTUZWXXX AT776000000098709837 Herr G"))
		payment = frappe.get_doc("Payment Entry", dict(party="Mr G", paid_amount=1200))
		reconcile(bank_transaction.name, "Payment Entry", payment.name)

		bank_transaction = frappe.get_doc("Bank Transaction", dict(description="1512567 BG/000002918 OPSKATTUZWXXX AT776000000098709837 Herr G"))
		payment = frappe.get_doc("Payment Entry", dict(party="Mr G", paid_amount=1200))
		self.assertRaises(frappe.ValidationError, reconcile, bank_transaction=bank_transaction.name, payment_doctype="Payment Entry", payment_name=payment.name)
Exemplo n.º 5
0
	def test_reconcile(self):
		bank_transaction = frappe.get_doc("Bank Transaction", dict(description="1512567 BG/000002918 OPSKATTUZWXXX AT776000000098709837 Herr G"))
		payment = frappe.get_doc("Payment Entry", dict(party="Mr G", paid_amount=1200))
		reconcile(bank_transaction.name, "Payment Entry", payment.name)

		unallocated_amount = frappe.db.get_value("Bank Transaction", bank_transaction.name, "unallocated_amount")
		self.assertTrue(unallocated_amount == 0)

		clearance_date = frappe.db.get_value("Payment Entry", payment.name, "clearance_date")
		self.assertTrue(clearance_date is not None)
Exemplo n.º 6
0
	def test_reconcile(self):
		bank_transaction = frappe.get_doc("Bank Transaction", dict(description="1512567 BG/000002918 OPSKATTUZWXXX AT776000000098709837 Herr G"))
		payment = frappe.get_doc("Payment Entry", dict(party="Mr G", paid_amount=1200))
		reconcile(bank_transaction.name, "Payment Entry", payment.name)

		unallocated_amount = frappe.db.get_value("Bank Transaction", bank_transaction.name, "unallocated_amount")
		self.assertTrue(unallocated_amount == 0)

		clearance_date = frappe.db.get_value("Payment Entry", payment.name, "clearance_date")
		self.assertTrue(clearance_date is not None)