Beispiel #1
0
    def validate_currency(self):
        company_currency = get_company_currency(self.company)
        account_currency = get_account_currency(self.account)

        if not self.account_currency:
            self.account_currency = company_currency

        if account_currency != self.account_currency:
            frappe.throw(
                _("Accounting Entry for {0} can only be made in currency: {1}"
                  ).format(self.account,
                           (account_currency or company_currency)),
                InvalidAccountCurrency)

        if self.party_type and self.party:
            party_account_currency = get_party_account_currency(
                self.party_type, self.party, self.company)

            if party_account_currency != self.account_currency:
                frappe.throw(
                    _("Accounting Entry for {0}: {1} can only be made in currency: {2}"
                      ).format(self.party_type, self.party,
                               party_account_currency), InvalidAccountCurrency)

            validate_party_gle_currency(self.party_type, self.party,
                                        self.company)
	def validate_currency(self):
		company_currency = get_company_currency(self.company)
		account_currency = get_account_currency(self.account)

		if not self.account_currency:
			self.account_currency = company_currency

		if account_currency != self.account_currency:
			frappe.throw(_("Accounting Entry for {0} can only be made in currency: {1}")
				.format(self.account, (account_currency or company_currency)), InvalidAccountCurrency)

		if self.party_type and self.party:
			validate_party_gle_currency(self.party_type, self.party, self.company, self.account_currency)
Beispiel #3
0
	def validate_currency(self):
		company_currency = erpnext.get_company_currency(self.company)
		account_currency = get_account_currency(self.account)

		if not self.account_currency:
			self.account_currency = company_currency

		if account_currency != self.account_currency:
			frappe.throw(_("{0} {1}: Accounting Entry for {2} can only be made in currency: {3}")
				.format(self.voucher_type, self.voucher_no, self.account,
				(account_currency or company_currency)), InvalidAccountCurrency)

		if self.party_type and self.party:
			validate_party_gle_currency(self.party_type, self.party, self.company, self.account_currency)