Compare commits
79 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a975fea3ac | ||
|
|
8e2d76bd63 | ||
|
|
34af16140e | ||
|
|
b3a68c3f40 | ||
|
|
9f2fd009b0 | ||
|
|
3858d12f1d | ||
|
|
adc93b797a | ||
|
|
b6de519571 | ||
|
|
58c4646199 | ||
|
|
4fbf01fd9d | ||
|
|
1ed82834ce | ||
|
|
cd87e76d88 | ||
|
|
834b3e6f83 | ||
|
|
95d025f9aa | ||
|
|
90c6d7bb47 | ||
|
|
59ba9e3d56 | ||
|
|
c1531e7008 | ||
|
|
511421b6a3 | ||
|
|
26c54bb4fb | ||
|
|
2c93d67463 | ||
|
|
d4b05fbd51 | ||
|
|
d65a03d437 | ||
|
|
fd288d4211 | ||
|
|
f774f75c63 | ||
|
|
e34a1b5fa2 | ||
|
|
5f6546c8a5 | ||
|
|
ca5b593e38 | ||
|
|
cea5479f4d | ||
|
|
6303f84d45 | ||
|
|
5dd00a7e89 | ||
|
|
87c0e9f03a | ||
|
|
d40d1e9a59 | ||
|
|
e19abfbe70 | ||
|
|
3fc1c44334 | ||
|
|
bb347f5afa | ||
|
|
938b530ebf | ||
|
|
28962f26d4 | ||
|
|
0b5489ca88 | ||
|
|
adebf31041 | ||
|
|
7fbab12c5d | ||
|
|
11cc43a5a6 | ||
|
|
61fb7ee5b8 | ||
|
|
37b4d75e4a | ||
|
|
f71ecbba2c | ||
|
|
c5c6c0669f | ||
|
|
fe85b2ea17 | ||
|
|
1c1eb7018c | ||
|
|
8df5b5e3a1 | ||
|
|
39982a5f02 | ||
|
|
8f228dd7f9 | ||
|
|
739aa4d51a | ||
|
|
f9ef0e4e15 | ||
|
|
fc51ec7f58 | ||
|
|
7ba4d02444 | ||
|
|
87b5fcb3b5 | ||
|
|
7489d29813 | ||
|
|
268d300030 | ||
|
|
7f77002015 | ||
|
|
b28573ab03 | ||
|
|
c756ff67b0 | ||
|
|
4e72ef1421 | ||
|
|
6b173f3a67 | ||
|
|
bbcce8cca0 | ||
|
|
c438c1dec7 | ||
|
|
fcfced624a | ||
|
|
64949bfc4b | ||
|
|
438c4fb279 | ||
|
|
ae4c8a6a48 | ||
|
|
0d7213122a | ||
|
|
4268b0092a | ||
|
|
64e31e9a4e | ||
|
|
0a0c267edb | ||
|
|
1a8d4b6ea7 | ||
|
|
97426776bd | ||
|
|
60e7f01fd4 | ||
|
|
169089bdde | ||
|
|
c14f80838b | ||
|
|
915778fb69 | ||
|
|
e9b445c853 |
@@ -1,2 +1,2 @@
|
||||
from __future__ import unicode_literals
|
||||
__version__ = '6.7.2'
|
||||
__version__ = '6.9.0'
|
||||
|
||||
@@ -6,6 +6,7 @@ import frappe
|
||||
from frappe.utils import flt
|
||||
from frappe import msgprint, _
|
||||
from frappe.model.document import Document
|
||||
from erpnext.accounts.utils import get_outstanding_invoices
|
||||
|
||||
class PaymentReconciliation(Document):
|
||||
def get_unreconciled_entries(self):
|
||||
@@ -17,7 +18,7 @@ class PaymentReconciliation(Document):
|
||||
dr_or_cr = "credit_in_account_currency" if self.party_type == "Customer" \
|
||||
else "debit_in_account_currency"
|
||||
|
||||
cond = self.check_condition(dr_or_cr)
|
||||
cond = self.check_condition()
|
||||
|
||||
bank_account_condition = "t2.against_account like %(bank_cash_account)s" \
|
||||
if self.bank_cash_account else "1=1"
|
||||
@@ -65,65 +66,11 @@ class PaymentReconciliation(Document):
|
||||
|
||||
def get_invoice_entries(self):
|
||||
#Fetch JVs, Sales and Purchase Invoices for 'invoices' to reconcile against
|
||||
non_reconciled_invoices = []
|
||||
dr_or_cr = "debit_in_account_currency" if self.party_type == "Customer" else "credit_in_account_currency"
|
||||
cond = self.check_condition(dr_or_cr)
|
||||
|
||||
invoice_list = frappe.db.sql("""
|
||||
select
|
||||
voucher_no, voucher_type, posting_date,
|
||||
ifnull(sum({dr_or_cr}), 0) as invoice_amount
|
||||
from
|
||||
`tabGL Entry`
|
||||
where
|
||||
party_type = %(party_type)s and party = %(party)s
|
||||
and account = %(account)s and {dr_or_cr} > 0 {cond}
|
||||
and (CASE
|
||||
WHEN voucher_type = 'Journal Entry'
|
||||
THEN ifnull(against_voucher, '') = ''
|
||||
ELSE 1=1
|
||||
END)
|
||||
group by voucher_type, voucher_no
|
||||
""".format(**{
|
||||
"cond": cond,
|
||||
"dr_or_cr": dr_or_cr
|
||||
}), {
|
||||
"party_type": self.party_type,
|
||||
"party": self.party,
|
||||
"account": self.receivable_payable_account,
|
||||
}, as_dict=True)
|
||||
condition = self.check_condition()
|
||||
|
||||
for d in invoice_list:
|
||||
payment_amount = frappe.db.sql("""
|
||||
select
|
||||
ifnull(sum(ifnull({0}, 0)), 0)
|
||||
from
|
||||
`tabGL Entry`
|
||||
where
|
||||
party_type = %(party_type)s and party = %(party)s
|
||||
and account = %(account)s and {0} > 0
|
||||
and against_voucher_type = %(against_voucher_type)s
|
||||
and ifnull(against_voucher, '') = %(against_voucher)s
|
||||
""".format("credit_in_account_currency" if self.party_type == "Customer"
|
||||
else "debit_in_account_currency"), {
|
||||
"party_type": self.party_type,
|
||||
"party": self.party,
|
||||
"account": self.receivable_payable_account,
|
||||
"against_voucher_type": d.voucher_type,
|
||||
"against_voucher": d.voucher_no
|
||||
}
|
||||
)
|
||||
|
||||
payment_amount = payment_amount[0][0] if payment_amount else 0
|
||||
|
||||
if d.invoice_amount - payment_amount > 0.005:
|
||||
non_reconciled_invoices.append({
|
||||
'voucher_no': d.voucher_no,
|
||||
'voucher_type': d.voucher_type,
|
||||
'posting_date': d.posting_date,
|
||||
'invoice_amount': flt(d.invoice_amount),
|
||||
'outstanding_amount': flt(d.invoice_amount - payment_amount, 2)
|
||||
})
|
||||
non_reconciled_invoices = get_outstanding_invoices(self.party_type, self.party,
|
||||
self.receivable_payable_account, condition=condition)
|
||||
|
||||
self.add_invoice_entries(non_reconciled_invoices)
|
||||
|
||||
@@ -210,13 +157,18 @@ class PaymentReconciliation(Document):
|
||||
if not invoices_to_reconcile:
|
||||
frappe.throw(_("Please select Allocated Amount, Invoice Type and Invoice Number in atleast one row"))
|
||||
|
||||
def check_condition(self, dr_or_cr):
|
||||
cond = self.from_date and " and posting_date >= '" + self.from_date + "'" or ""
|
||||
cond += self.to_date and " and posting_date <= '" + self.to_date + "'" or ""
|
||||
def check_condition(self):
|
||||
cond = " and posting_date >= {0}".format(frappe.db.escape(self.from_date)) if self.from_date else ""
|
||||
cond += " and posting_date <= {0}".format(frappe.db.escape(self.to_date)) if self.to_date else ""
|
||||
|
||||
if self.party_type == "Customer":
|
||||
dr_or_cr = "debit_in_account_currency"
|
||||
else:
|
||||
dr_or_cr = "credit_in_account_currency"
|
||||
|
||||
if self.minimum_amount:
|
||||
cond += " and {0} >= %s".format(dr_or_cr) % self.minimum_amount
|
||||
cond += " and `{0}` >= {1}".format(dr_or_cr, flt(self.minimum_amount))
|
||||
if self.maximum_amount:
|
||||
cond += " and {0} <= %s".format(dr_or_cr) % self.maximum_amount
|
||||
cond += " and `{0}` <= {1}".format(dr_or_cr, flt(self.maximum_amount))
|
||||
|
||||
return cond
|
||||
|
||||
@@ -63,20 +63,18 @@ def get_outstanding_vouchers(args):
|
||||
party_account_currency = get_account_currency(args.get("party_account"))
|
||||
company_currency = frappe.db.get_value("Company", args.get("company"), "default_currency")
|
||||
|
||||
if args.get("party_type") == "Customer" and args.get("received_or_paid") == "Received":
|
||||
amount_query = "ifnull(debit_in_account_currency, 0) - ifnull(credit_in_account_currency, 0)"
|
||||
elif args.get("party_type") == "Supplier" and args.get("received_or_paid") == "Paid":
|
||||
amount_query = "ifnull(credit_in_account_currency, 0) - ifnull(debit_in_account_currency, 0)"
|
||||
else:
|
||||
if ((args.get("party_type") == "Customer" and args.get("received_or_paid") == "Paid")
|
||||
or (args.get("party_type") == "Supplier" and args.get("received_or_paid") == "Received")):
|
||||
|
||||
frappe.throw(_("Please enter the Against Vouchers manually"))
|
||||
|
||||
# Get all outstanding sales /purchase invoices
|
||||
outstanding_invoices = get_outstanding_invoices(amount_query, args.get("party_account"),
|
||||
args.get("party_type"), args.get("party"))
|
||||
outstanding_invoices = get_outstanding_invoices(args.get("party_type"), args.get("party"), args.get("party_account"))
|
||||
|
||||
# Get all SO / PO which are not fully billed or aginst which full advance not paid
|
||||
orders_to_be_billed = get_orders_to_be_billed(args.get("party_type"), args.get("party"),
|
||||
party_account_currency, company_currency)
|
||||
|
||||
return outstanding_invoices + orders_to_be_billed
|
||||
|
||||
def get_orders_to_be_billed(party_type, party, party_account_currency, company_currency):
|
||||
|
||||
@@ -59,7 +59,7 @@ class PricingRule(Document):
|
||||
self.set(f, None)
|
||||
|
||||
def validate_price_or_discount(self):
|
||||
for field in ["Price", "Discount Percentage"]:
|
||||
for field in ["Price"]:
|
||||
if flt(self.get(frappe.scrub(field))) < 0:
|
||||
throw(_("{0} can not be negative").format(field))
|
||||
|
||||
@@ -168,7 +168,11 @@ def get_pricing_rules(args):
|
||||
field = frappe.scrub(parenttype)
|
||||
condition = ""
|
||||
if args.get(field):
|
||||
lft, rgt = frappe.db.get_value(parenttype, args[field], ["lft", "rgt"])
|
||||
try:
|
||||
lft, rgt = frappe.db.get_value(parenttype, args[field], ["lft", "rgt"])
|
||||
except TypeError:
|
||||
frappe.throw(_("Invalid {0}").format(args[field]))
|
||||
|
||||
parent_groups = frappe.db.sql_list("""select name from `tab%s`
|
||||
where lft<=%s and rgt>=%s""" % (parenttype, '%s', '%s'), (lft, rgt))
|
||||
|
||||
|
||||
@@ -98,16 +98,17 @@ class GrossProfitGenerator(object):
|
||||
|
||||
row.base_amount = flt(row.base_net_amount)
|
||||
|
||||
product_bundles = []
|
||||
if row.update_stock:
|
||||
product_bundles = self.product_bundles.get(row.parenttype, {}).get(row.parent, frappe._dict())
|
||||
elif row.dn_detail:
|
||||
product_bundles = self.product_bundles.get("Delivery Note", {})\
|
||||
.get(row.delivery_note, frappe._dict())
|
||||
row.item_row = row.dn_detail
|
||||
|
||||
|
||||
# get buying amount
|
||||
if row.item_code in product_bundles:
|
||||
row.buying_amount = self.get_buying_amount_from_product_bundle(row,
|
||||
row.buying_amount = self.get_buying_amount_from_product_bundle(row,
|
||||
product_bundles[row.item_code])
|
||||
else:
|
||||
row.buying_amount = self.get_buying_amount(row, row.item_code)
|
||||
@@ -184,7 +185,7 @@ class GrossProfitGenerator(object):
|
||||
parenttype, parent = row.parenttype, row.parent
|
||||
if row.dn_detail:
|
||||
parenttype, parent = "Delivery Note", row.delivery_note
|
||||
|
||||
|
||||
for i, sle in enumerate(my_sle):
|
||||
# find the stock valution rate from stock ledger entry
|
||||
if sle.voucher_type == parenttype and parent == sle.voucher_no and \
|
||||
|
||||
@@ -211,7 +211,7 @@ def update_against_doc(d, jv_obj):
|
||||
|
||||
if d['allocated_amt'] < d['unadjusted_amt']:
|
||||
jvd = frappe.db.sql("""
|
||||
select cost_center, balance, against_account, is_advance,
|
||||
select cost_center, balance, against_account, is_advance,
|
||||
account_type, exchange_rate, account_currency
|
||||
from `tabJournal Entry Account` where name = %s
|
||||
""", d['voucher_detail_no'], as_dict=True)
|
||||
@@ -415,47 +415,63 @@ def get_stock_rbnb_difference(posting_date, company):
|
||||
# Amount should be credited
|
||||
return flt(stock_rbnb) + flt(sys_bal)
|
||||
|
||||
def get_outstanding_invoices(amount_query, account, party_type, party):
|
||||
all_outstanding_vouchers = []
|
||||
outstanding_voucher_list = frappe.db.sql("""
|
||||
select
|
||||
voucher_no, voucher_type, posting_date,
|
||||
ifnull(sum({amount_query}), 0) as invoice_amount
|
||||
def get_outstanding_invoices(party_type, party, account, condition=None):
|
||||
outstanding_invoices = []
|
||||
precision = frappe.get_precision("Sales Invoice", "outstanding_amount")
|
||||
|
||||
if party_type=="Customer":
|
||||
dr_or_cr = "ifnull(debit_in_account_currency, 0) - ifnull(credit_in_account_currency, 0)"
|
||||
payment_dr_or_cr = "ifnull(payment_gl_entry.credit_in_account_currency, 0) - ifnull(payment_gl_entry.debit_in_account_currency, 0)"
|
||||
else:
|
||||
dr_or_cr = "ifnull(credit_in_account_currency, 0) - ifnull(debit_in_account_currency, 0)"
|
||||
payment_dr_or_cr = "ifnull(payment_gl_entry.debit_in_account_currency, 0) - ifnull(payment_gl_entry.credit_in_account_currency, 0)"
|
||||
|
||||
invoice_list = frappe.db.sql("""select
|
||||
voucher_no, voucher_type, posting_date,
|
||||
ifnull(sum({dr_or_cr}), 0) as invoice_amount,
|
||||
(
|
||||
select
|
||||
ifnull(sum(ifnull({payment_dr_or_cr}, 0)), 0)
|
||||
from `tabGL Entry` payment_gl_entry
|
||||
where
|
||||
payment_gl_entry.against_voucher_type = invoice_gl_entry.voucher_type
|
||||
and payment_gl_entry.against_voucher = invoice_gl_entry.voucher_no
|
||||
and payment_gl_entry.party_type = invoice_gl_entry.party_type
|
||||
and payment_gl_entry.party = invoice_gl_entry.party
|
||||
and payment_gl_entry.account = invoice_gl_entry.account
|
||||
and {payment_dr_or_cr} > 0
|
||||
) as payment_amount
|
||||
from
|
||||
`tabGL Entry`
|
||||
`tabGL Entry` invoice_gl_entry
|
||||
where
|
||||
account = %s and party_type=%s and party=%s and {amount_query} > 0
|
||||
and (CASE
|
||||
WHEN voucher_type = 'Journal Entry'
|
||||
THEN ifnull(against_voucher, '') = ''
|
||||
ELSE 1=1
|
||||
END)
|
||||
party_type = %(party_type)s
|
||||
and party = %(party)s
|
||||
and account = %(account)s
|
||||
and {dr_or_cr} > 0
|
||||
{condition}
|
||||
and ((voucher_type = 'Journal Entry'
|
||||
and (against_voucher = ''
|
||||
or against_voucher is null))
|
||||
or (voucher_type != 'Journal Entry'))
|
||||
group by voucher_type, voucher_no
|
||||
""".format(amount_query = amount_query), (account, party_type, party), as_dict = True)
|
||||
having (invoice_amount - payment_amount) > 0.005""".format(
|
||||
dr_or_cr = dr_or_cr,
|
||||
payment_dr_or_cr = payment_dr_or_cr,
|
||||
condition = condition or ""
|
||||
), {
|
||||
"party_type": party_type,
|
||||
"party": party,
|
||||
"account": account,
|
||||
}, as_dict=True)
|
||||
|
||||
for d in outstanding_voucher_list:
|
||||
payment_amount = frappe.db.sql("""
|
||||
select ifnull(sum({amount_query}), 0)
|
||||
from
|
||||
`tabGL Entry`
|
||||
where
|
||||
account = %s and party_type=%s and party=%s and {amount_query} < 0
|
||||
and against_voucher_type = %s and ifnull(against_voucher, '') = %s
|
||||
""".format(**{
|
||||
"amount_query": amount_query
|
||||
}), (account, party_type, party, d.voucher_type, d.voucher_no))
|
||||
for d in invoice_list:
|
||||
outstanding_invoices.append({
|
||||
'voucher_no': d.voucher_no,
|
||||
'voucher_type': d.voucher_type,
|
||||
'posting_date': d.posting_date,
|
||||
'invoice_amount': flt(d.invoice_amount),
|
||||
'payment_amount': flt(d.payment_amount),
|
||||
'outstanding_amount': flt(d.invoice_amount - d.payment_amount, precision)
|
||||
})
|
||||
|
||||
payment_amount = -1*payment_amount[0][0] if payment_amount else 0
|
||||
precision = frappe.get_precision("Sales Invoice", "outstanding_amount")
|
||||
|
||||
if d.invoice_amount > payment_amount:
|
||||
|
||||
all_outstanding_vouchers.append({
|
||||
'voucher_no': d.voucher_no,
|
||||
'voucher_type': d.voucher_type,
|
||||
'posting_date': d.posting_date,
|
||||
'invoice_amount': flt(d.invoice_amount, precision),
|
||||
'outstanding_amount': flt(d.invoice_amount - payment_amount, precision)
|
||||
})
|
||||
|
||||
return all_outstanding_vouchers
|
||||
return outstanding_invoices
|
||||
|
||||
@@ -21,11 +21,13 @@ erpnext.buying.PurchaseOrderController = erpnext.buying.BuyingController.extend(
|
||||
|
||||
if(doc.docstatus == 1 && !in_list(["Stopped", "Closed", "Delivered"], doc.status)) {
|
||||
|
||||
if(flt(doc.per_billed, 2) < 100 || doc.per_received < 100) {
|
||||
cur_frm.add_custom_button(__('Stop'), this.stop_purchase_order);
|
||||
}
|
||||
if (this.frm.has_perm("submit")) {
|
||||
if(flt(doc.per_billed, 2) < 100 || doc.per_received < 100) {
|
||||
cur_frm.add_custom_button(__('Stop'), this.stop_purchase_order);
|
||||
}
|
||||
|
||||
cur_frm.add_custom_button(__('Close'), this.close_purchase_order);
|
||||
cur_frm.add_custom_button(__('Close'), this.close_purchase_order);
|
||||
}
|
||||
|
||||
if(doc.delivered_by_supplier && doc.status!="Delivered"){
|
||||
cur_frm.add_custom_button(__('Mark as Delivered'), this.delivered_by_supplier);
|
||||
@@ -35,7 +37,7 @@ erpnext.buying.PurchaseOrderController = erpnext.buying.BuyingController.extend(
|
||||
cur_frm.add_custom_button(__('Payment'), cur_frm.cscript.make_bank_entry);
|
||||
}
|
||||
|
||||
if(flt(doc.per_received, 2) < 100) {
|
||||
if(flt(doc.per_received, 2) < 100 && this.frm.doc.__onload.has_stock_item) {
|
||||
cur_frm.add_custom_button(__('Receive'), this.make_purchase_receipt).addClass("btn-primary");
|
||||
|
||||
if(doc.is_subcontracted==="Yes") {
|
||||
@@ -53,7 +55,9 @@ erpnext.buying.PurchaseOrderController = erpnext.buying.BuyingController.extend(
|
||||
}
|
||||
|
||||
if(doc.docstatus == 1 && in_list(["Stopped", "Closed", "Delivered"], doc.status)) {
|
||||
cur_frm.add_custom_button(__('Re-open'), this.unstop_purchase_order);
|
||||
if (this.frm.has_perm("submit")) {
|
||||
cur_frm.add_custom_button(__('Re-open'), this.unstop_purchase_order);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -33,6 +33,9 @@ class PurchaseOrder(BuyingController):
|
||||
'overflow_type': 'order'
|
||||
}]
|
||||
|
||||
def onload(self):
|
||||
self.set_onload("has_stock_item", len(self.get_stock_items()) > 0)
|
||||
|
||||
def validate(self):
|
||||
super(PurchaseOrder, self).validate()
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ cur_frm.cscript.refresh = function(doc, dt, dn) {
|
||||
|
||||
if(doc.__islocal){
|
||||
hide_field(['address_html','contact_html']);
|
||||
erpnext.utils.clear_address_and_contact(cur_frm);
|
||||
}
|
||||
else{
|
||||
unhide_field(['address_html','contact_html']);
|
||||
|
||||
@@ -1 +1 @@
|
||||
- **[Multi-currency Accounting](https://manual.erpnext.com/contents/accounts/multi-currency-accounting)**: You can now have an Account in a different currency than your Company's currency
|
||||
- **[Multi-currency Accounting](https://frappe.github.io/erpnext/user/guides/accounts/multi-currency-accounting)**: You can now have an Account in a different currency than your Company's currency
|
||||
|
||||
2
erpnext/change_log/v6/v6_8_0.md
Normal file
@@ -0,0 +1,2 @@
|
||||
- Removed Stock UOM Replace Utility
|
||||
Replacing UOM and Conversion Factor in existing transactions broke the integrity of data. The cleaner solution is to create new Items for a different Stock UOM, and keep existing transactions as they are.
|
||||
28
erpnext/config/docs.py
Normal file
@@ -0,0 +1,28 @@
|
||||
source_link = "https://github.com/frappe/erpnext"
|
||||
docs_base_url = "https://frappe.github.io/erpnext"
|
||||
headline = "Learn ERPNext Inside Out"
|
||||
sub_heading = "Find detailed explanation for all ERPNext features"
|
||||
long_description = """
|
||||
ERPNext helps you to manage all your business information in one application and use it to manage operations and take decisions based on data.
|
||||
|
||||
Among other things, ERPNext will help you to:
|
||||
|
||||
- Track all Invoices and Payments.
|
||||
- Know what quantity of which product is available in stock.
|
||||
- Identify open customer queries.
|
||||
- Manage payroll.
|
||||
- Assign tasks and follow up on them.
|
||||
- Maintain a database of all your customers, suppliers and their contacts.
|
||||
- Prepare quotes.
|
||||
- Get reminders on maintenance schedules.
|
||||
- Publish your website.
|
||||
|
||||
And a lot lot lot more."""
|
||||
|
||||
def get_context(context):
|
||||
context.top_bar_items = [
|
||||
{"label": "Contents", "url": context.docs_base_url + "/contents.html", "right": 1},
|
||||
{"label": "User Guide", "url": context.docs_base_url + "/user/guides", "right": 1},
|
||||
{"label": "Videos", "url": context.docs_base_url + "/user/videos", "right": 1},
|
||||
{"label": "Developer Docs", "url": context.docs_base_url + "/current", "right": 1}
|
||||
]
|
||||
@@ -398,17 +398,18 @@ class calculate_taxes_and_totals(object):
|
||||
return
|
||||
|
||||
self.doc.round_floats_in(self.doc, ["grand_total", "total_advance", "write_off_amount"])
|
||||
total_amount_to_pay = flt(self.doc.grand_total - self.doc.total_advance - self.doc.write_off_amount,
|
||||
self.doc.precision("grand_total"))
|
||||
if self.doc.party_account_currency == self.doc.currency:
|
||||
total_amount_to_pay = flt(self.doc.grand_total - self.doc.total_advance
|
||||
- flt(self.doc.write_off_amount), self.doc.precision("grand_total"))
|
||||
else:
|
||||
total_amount_to_pay = flt(self.doc.base_grand_total - self.doc.total_advance
|
||||
- flt(self.doc.base_write_off_amount), self.doc.precision("grand_total"))
|
||||
|
||||
if self.doc.doctype == "Sales Invoice":
|
||||
self.doc.round_floats_in(self.doc, ["paid_amount"])
|
||||
outstanding_amount = flt(total_amount_to_pay - self.doc.paid_amount, self.doc.precision("outstanding_amount"))
|
||||
paid_amount = self.doc.paid_amount \
|
||||
if self.doc.party_account_currency == self.doc.currency else self.doc.base_paid_amount
|
||||
self.doc.outstanding_amount = flt(total_amount_to_pay - flt(paid_amount),
|
||||
self.doc.precision("outstanding_amount"))
|
||||
elif self.doc.doctype == "Purchase Invoice":
|
||||
outstanding_amount = flt(total_amount_to_pay, self.doc.precision("outstanding_amount"))
|
||||
|
||||
if self.doc.party_account_currency == self.doc.currency:
|
||||
self.doc.outstanding_amount = outstanding_amount
|
||||
else:
|
||||
self.doc.outstanding_amount = flt(outstanding_amount * self.doc.conversion_rate,
|
||||
self.doc.precision("outstanding_amount"))
|
||||
self.doc.outstanding_amount = flt(total_amount_to_pay, self.doc.precision("outstanding_amount"))
|
||||
@@ -37,6 +37,8 @@ erpnext.LeadController = frappe.ui.form.Controller.extend({
|
||||
|
||||
if(!this.frm.doc.__islocal) {
|
||||
erpnext.utils.render_address_and_contact(cur_frm);
|
||||
} else {
|
||||
erpnext.utils.clear_address_and_contact(cur_frm);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
BIN
erpnext/docs/assets/img/accounts/account-settings.png
Normal file
|
After Width: | Height: | Size: 95 KiB |
BIN
erpnext/docs/assets/img/accounts/accounts-receivable.png
Normal file
|
After Width: | Height: | Size: 74 KiB |
BIN
erpnext/docs/assets/img/accounts/advance-payment-1.png
Normal file
|
After Width: | Height: | Size: 91 KiB |
BIN
erpnext/docs/assets/img/accounts/advance-payment-2.png
Normal file
|
After Width: | Height: | Size: 56 KiB |
BIN
erpnext/docs/assets/img/accounts/advance-payment-3.png
Normal file
|
After Width: | Height: | Size: 52 KiB |
BIN
erpnext/docs/assets/img/accounts/bank-reconciliation.png
Normal file
|
After Width: | Height: | Size: 81 KiB |
BIN
erpnext/docs/assets/img/accounts/chart-of-accounts-1.png
Normal file
|
After Width: | Height: | Size: 143 KiB |
BIN
erpnext/docs/assets/img/accounts/chart-of-accounts-2.png
Normal file
|
After Width: | Height: | Size: 96 KiB |
BIN
erpnext/docs/assets/img/accounts/chart-of-accounts-3.png
Normal file
|
After Width: | Height: | Size: 88 KiB |
BIN
erpnext/docs/assets/img/accounts/credit-limit-1.png
Normal file
|
After Width: | Height: | Size: 56 KiB |
BIN
erpnext/docs/assets/img/accounts/credit-limit-2.png
Normal file
|
After Width: | Height: | Size: 92 KiB |
BIN
erpnext/docs/assets/img/accounts/financial-analytics-bl.png
Normal file
|
After Width: | Height: | Size: 105 KiB |
BIN
erpnext/docs/assets/img/accounts/financial-analytics-pl.png
Normal file
|
After Width: | Height: | Size: 115 KiB |
BIN
erpnext/docs/assets/img/accounts/fiscal-year.png
Normal file
|
After Width: | Height: | Size: 52 KiB |
BIN
erpnext/docs/assets/img/accounts/general-ledger.png
Normal file
|
After Width: | Height: | Size: 98 KiB |
BIN
erpnext/docs/assets/img/accounts/journal-entry.png
Normal file
|
After Width: | Height: | Size: 96 KiB |
BIN
erpnext/docs/assets/img/accounts/make-payment.png
Normal file
|
After Width: | Height: | Size: 70 KiB |
BIN
erpnext/docs/assets/img/accounts/multi-currency/account.png
Normal file
|
After Width: | Height: | Size: 199 KiB |
|
After Width: | Height: | Size: 166 KiB |
|
After Width: | Height: | Size: 265 KiB |
|
After Width: | Height: | Size: 242 KiB |
BIN
erpnext/docs/assets/img/accounts/multi-currency/customer.png
Normal file
|
After Width: | Height: | Size: 183 KiB |
|
After Width: | Height: | Size: 221 KiB |
|
After Width: | Height: | Size: 197 KiB |
|
After Width: | Height: | Size: 192 KiB |
|
After Width: | Height: | Size: 256 KiB |
|
After Width: | Height: | Size: 241 KiB |
BIN
erpnext/docs/assets/img/accounts/new-bank-entry.png
Normal file
|
After Width: | Height: | Size: 72 KiB |
BIN
erpnext/docs/assets/img/accounts/opening-account-1.png
Normal file
|
After Width: | Height: | Size: 38 KiB |
BIN
erpnext/docs/assets/img/accounts/payment-reconcile-tool.png
Normal file
|
After Width: | Height: | Size: 113 KiB |
BIN
erpnext/docs/assets/img/accounts/payment-tool-1.png
Normal file
|
After Width: | Height: | Size: 54 KiB |
BIN
erpnext/docs/assets/img/accounts/payment-tool-2.png
Normal file
|
After Width: | Height: | Size: 95 KiB |
BIN
erpnext/docs/assets/img/accounts/payment-tool-3.png
Normal file
|
After Width: | Height: | Size: 93 KiB |
BIN
erpnext/docs/assets/img/accounts/period-closing-voucher.png
Normal file
|
After Width: | Height: | Size: 69 KiB |
BIN
erpnext/docs/assets/img/accounts/purchase-invoice.png
Normal file
|
After Width: | Height: | Size: 103 KiB |
BIN
erpnext/docs/assets/img/accounts/sales-invoice.png
Normal file
|
After Width: | Height: | Size: 108 KiB |
BIN
erpnext/docs/assets/img/accounts/sales-register.png
Normal file
|
After Width: | Height: | Size: 114 KiB |
BIN
erpnext/docs/assets/img/accounts/tax-rule-1.png
Normal file
|
After Width: | Height: | Size: 97 KiB |
BIN
erpnext/docs/assets/img/accounts/tax-rule-2.png
Normal file
|
After Width: | Height: | Size: 98 KiB |
BIN
erpnext/docs/assets/img/accounts/tax-rule.png
Normal file
|
After Width: | Height: | Size: 91 KiB |
BIN
erpnext/docs/assets/img/accounts/trial-balance.png
Normal file
|
After Width: | Height: | Size: 126 KiB |
BIN
erpnext/docs/assets/img/buying/buying-settings.png
Normal file
|
After Width: | Height: | Size: 54 KiB |
BIN
erpnext/docs/assets/img/buying/material-request.png
Normal file
|
After Width: | Height: | Size: 52 KiB |
BIN
erpnext/docs/assets/img/buying/purchase-order-uom.png
Normal file
|
After Width: | Height: | Size: 78 KiB |
BIN
erpnext/docs/assets/img/buying/purchase-order.png
Normal file
|
After Width: | Height: | Size: 85 KiB |
BIN
erpnext/docs/assets/img/buying/supplier-master.png
Normal file
|
After Width: | Height: | Size: 106 KiB |
BIN
erpnext/docs/assets/img/buying/supplier-quotation.png
Normal file
|
After Width: | Height: | Size: 133 KiB |
BIN
erpnext/docs/assets/img/buying/supplier-type.png
Normal file
|
After Width: | Height: | Size: 74 KiB |
BIN
erpnext/docs/assets/img/crm/campaign-new-lead.png
Normal file
|
After Width: | Height: | Size: 82 KiB |
BIN
erpnext/docs/assets/img/crm/campaign-view-leads.png
Normal file
|
After Width: | Height: | Size: 74 KiB |
BIN
erpnext/docs/assets/img/crm/campaign.png
Normal file
|
After Width: | Height: | Size: 58 KiB |
BIN
erpnext/docs/assets/img/crm/contact-from-cust.png
Normal file
|
After Width: | Height: | Size: 92 KiB |
BIN
erpnext/docs/assets/img/crm/contact.png
Normal file
|
After Width: | Height: | Size: 77 KiB |
BIN
erpnext/docs/assets/img/crm/customer-group-tree.png
Normal file
|
After Width: | Height: | Size: 44 KiB |
BIN
erpnext/docs/assets/img/crm/customer.png
Normal file
|
After Width: | Height: | Size: 67 KiB |
BIN
erpnext/docs/assets/img/crm/lead-to-opportunity.png
Normal file
|
After Width: | Height: | Size: 90 KiB |
BIN
erpnext/docs/assets/img/crm/lead.png
Normal file
|
After Width: | Height: | Size: 89 KiB |
BIN
erpnext/docs/assets/img/crm/newsletter-new.png
Normal file
|
After Width: | Height: | Size: 81 KiB |
BIN
erpnext/docs/assets/img/crm/newsletter-test.png
Normal file
|
After Width: | Height: | Size: 48 KiB |
BIN
erpnext/docs/assets/img/crm/opportunity.png
Normal file
|
After Width: | Height: | Size: 75 KiB |
BIN
erpnext/docs/assets/img/crm/sales-person-tree.png
Normal file
|
After Width: | Height: | Size: 33 KiB |
BIN
erpnext/docs/assets/img/crm/territory-tree.png
Normal file
|
After Width: | Height: | Size: 42 KiB |
BIN
erpnext/docs/assets/img/customize/customize-title.gif
Normal file
|
After Width: | Height: | Size: 401 KiB |
BIN
erpnext/docs/assets/img/customize/editable-title.gif
Normal file
|
After Width: | Height: | Size: 546 KiB |
BIN
erpnext/docs/assets/img/home.png
Normal file
|
After Width: | Height: | Size: 275 KiB |
BIN
erpnext/docs/assets/img/human-resources/appraisal-employee.png
Normal file
|
After Width: | Height: | Size: 108 KiB |
BIN
erpnext/docs/assets/img/human-resources/appraisal.png
Normal file
|
After Width: | Height: | Size: 43 KiB |
BIN
erpnext/docs/assets/img/human-resources/attendence-upload.png
Normal file
|
After Width: | Height: | Size: 86 KiB |
BIN
erpnext/docs/assets/img/human-resources/attendence.png
Normal file
|
After Width: | Height: | Size: 58 KiB |
BIN
erpnext/docs/assets/img/human-resources/branch.png
Normal file
|
After Width: | Height: | Size: 32 KiB |
BIN
erpnext/docs/assets/img/human-resources/deduction-type.png
Normal file
|
After Width: | Height: | Size: 25 KiB |
BIN
erpnext/docs/assets/img/human-resources/department.png
Normal file
|
After Width: | Height: | Size: 125 KiB |
BIN
erpnext/docs/assets/img/human-resources/designation.png
Normal file
|
After Width: | Height: | Size: 114 KiB |
BIN
erpnext/docs/assets/img/human-resources/earning-type.png
Normal file
|
After Width: | Height: | Size: 33 KiB |
BIN
erpnext/docs/assets/img/human-resources/email-account.png
Normal file
|
After Width: | Height: | Size: 92 KiB |
|
After Width: | Height: | Size: 39 KiB |
|
After Width: | Height: | Size: 83 KiB |
|
After Width: | Height: | Size: 76 KiB |
|
After Width: | Height: | Size: 58 KiB |
BIN
erpnext/docs/assets/img/human-resources/employee.png
Normal file
|
After Width: | Height: | Size: 103 KiB |
BIN
erpnext/docs/assets/img/human-resources/employment-type.png
Normal file
|
After Width: | Height: | Size: 87 KiB |
BIN
erpnext/docs/assets/img/human-resources/expense_claim.png
Normal file
|
After Width: | Height: | Size: 101 KiB |
BIN
erpnext/docs/assets/img/human-resources/holiday-list.png
Normal file
|
After Width: | Height: | Size: 93 KiB |
BIN
erpnext/docs/assets/img/human-resources/hr-settings.png
Normal file
|
After Width: | Height: | Size: 96 KiB |
BIN
erpnext/docs/assets/img/human-resources/job-applicant.png
Normal file
|
After Width: | Height: | Size: 60 KiB |
BIN
erpnext/docs/assets/img/human-resources/job-opening.png
Normal file
|
After Width: | Height: | Size: 108 KiB |