codacy and typo fixes
This commit is contained in:
parent
c7f46218d7
commit
fb144303f5
@ -779,7 +779,7 @@ def get_paid_amount(dt, dn, party_type, party, account, due_date):
|
||||
dr_or_cr = "credit_in_account_currency - debit_in_account_currency"
|
||||
else:
|
||||
dr_or_cr = "debit_in_account_currency - credit_in_account_currency"
|
||||
|
||||
|
||||
paid_amount = frappe.db.sql("""
|
||||
select ifnull(sum({dr_or_cr}), 0) as paid_amount
|
||||
from `tabGL Entry`
|
||||
|
@ -3,8 +3,8 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class PaymentSchedule(Document):
|
||||
pass
|
||||
|
@ -1,8 +1,2 @@
|
||||
// Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Payment Term', {
|
||||
refresh: function(frm) {
|
||||
|
||||
}
|
||||
});
|
||||
|
@ -3,8 +3,8 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class PaymentTerm(Document):
|
||||
pass
|
||||
|
@ -2,9 +2,8 @@
|
||||
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
import unittest
|
||||
|
||||
|
||||
class TestPaymentTerm(unittest.TestCase):
|
||||
pass
|
||||
|
@ -3,8 +3,8 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class PaymentTermsTemplate(Document):
|
||||
pass
|
||||
|
@ -2,9 +2,8 @@
|
||||
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
import unittest
|
||||
|
||||
|
||||
class TestPaymentTermsTemplate(unittest.TestCase):
|
||||
pass
|
||||
|
@ -3,8 +3,8 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class PaymentTermsTemplateDetail(Document):
|
||||
pass
|
||||
|
@ -252,6 +252,7 @@ class TestPricingRule(unittest.TestCase):
|
||||
self.assertEquals(so.items[0].rate, 100)
|
||||
|
||||
def test_pricing_rule_with_margin_and_discount(self):
|
||||
frappe.delete_doc_if_exists('Pricing Rule', '_Test Pricing Rule')
|
||||
make_pricing_rule(selling=1, margin_type="Percentage", margin_rate_or_amount=10)
|
||||
si = create_sales_invoice(do_not_save=True)
|
||||
si.items[0].price_list_rate = 1000
|
||||
|
@ -4,7 +4,7 @@
|
||||
from __future__ import unicode_literals
|
||||
import frappe, erpnext
|
||||
import frappe.defaults
|
||||
from frappe.utils import cint, flt, getdate
|
||||
from frappe.utils import cint, flt
|
||||
from frappe import _, msgprint, throw
|
||||
from erpnext.accounts.party import get_party_account, get_due_date
|
||||
from erpnext.controllers.stock_controller import update_gl_entries_after
|
||||
|
@ -616,7 +616,8 @@ def get_outstanding_invoices(party_type, party, account, condition=None):
|
||||
}, as_dict=True)
|
||||
|
||||
for d in invoice_list:
|
||||
print d.voucher_no, d.invoice_amount, d.payment_amount
|
||||
due_date = d.due_date or (frappe.db.get_value(d.voucher_type, d.voucher_no,
|
||||
"posting_date" if party_type=="Employee" else "due_date"))
|
||||
outstanding_invoices.append(frappe._dict({
|
||||
'voucher_no': d.voucher_no,
|
||||
'voucher_type': d.voucher_type,
|
||||
@ -624,8 +625,7 @@ def get_outstanding_invoices(party_type, party, account, condition=None):
|
||||
'invoice_amount': flt(d.invoice_amount),
|
||||
'payment_amount': flt(d.payment_amount),
|
||||
'outstanding_amount': flt(d.invoice_amount - d.payment_amount, precision),
|
||||
'due_date': d.due_date or (frappe.db.get_value(d.voucher_type, d.voucher_no,
|
||||
"posting_date" if party_type=="Employee" else "due_date")),
|
||||
'due_date': due_date
|
||||
}))
|
||||
|
||||
outstanding_invoices = sorted(outstanding_invoices, key=lambda k: k['due_date'] or getdate(nowdate()))
|
||||
|
@ -643,7 +643,7 @@ class AccountsController(TransactionBase):
|
||||
total += flt(d.payment_amount)
|
||||
|
||||
if total != self.grand_total:
|
||||
frappe.throw(_("Total Payment Amount in Payment Schdule must be equal to Grand Total"))
|
||||
frappe.throw(_("Total Payment Amount in Payment Schedule must be equal to Grand Total"))
|
||||
|
||||
|
||||
@frappe.whitelist()
|
||||
@ -824,7 +824,7 @@ def get_payment_terms(terms_template, posting_date=None, grand_total=None):
|
||||
terms_doc = frappe.get_doc("Payment Terms Template", terms_template)
|
||||
|
||||
schedule = []
|
||||
for i, d in enumerate(terms_doc.get("terms")):
|
||||
for d in terms_doc.get("terms"):
|
||||
term_details = get_payment_term_details(d, posting_date, grand_total)
|
||||
schedule.append(term_details)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user