import frappe
from frappe import _
from frappe.model.document import Document


class KapitalBankPayment(Document):
	def on_trash(self):
		if self.status in ("Sent", "Confirm Wait"):
			frappe.throw(
				_("Cannot delete {0}: status is {1}. Cancel first.").format(self.name, self.status)
			)
