Fixed merge conflict

This commit is contained in:
Nabin Hait 2018-03-29 13:57:39 +05:30
commit ff2e4c898a
8 changed files with 44 additions and 17 deletions

View File

@ -5,7 +5,7 @@ import frappe
from erpnext.hooks import regional_overrides from erpnext.hooks import regional_overrides
from frappe.utils import getdate from frappe.utils import getdate
__version__ = '10.1.17' __version__ = '10.1.18'
def get_default_company(user=None): def get_default_company(user=None):
'''Get default company for user''' '''Get default company for user'''

View File

@ -4,12 +4,21 @@
.print-format { .print-format {
padding: 8mm; padding: 8mm;
margin:4mm; margin:4mm;
font-size:10px; font-size: 10.0pt !important;
font-family: Tahoma, sans-serif; font-family: Tahoma, sans-serif;
} }
} }
</style> </style>
{% } %} {% } %}
<style>
.print-format {
padding: 8mm;
margin:4mm;
font-size: 10.0pt !important;
font-family: Tahoma, sans-serif;
}
</style>
<h2 class="text-center">{%= __(report.report_name) %}</h2> <h2 class="text-center">{%= __(report.report_name) %}</h2>
<h4 class="text-center">{%= filters.customer || filters.supplier %} </h4> <h4 class="text-center">{%= filters.customer || filters.supplier %} </h4>
@ -126,8 +135,13 @@
{% if(report.report_name === "Accounts Receivable" || report.report_name === "Accounts Payable") { %} {% if(report.report_name === "Accounts Receivable" || report.report_name === "Accounts Payable") { %}
{% if(data[i][__("Customer")] || data[i][__("Supplier")]) { %} {% if(data[i][__("Customer")] || data[i][__("Supplier")]) { %}
<td>{%= dateutil.str_to_user(data[i]["posting_date"]) %}</td> <td>{%= dateutil.str_to_user(data[i]["posting_date"]) %}</td>
<td>{%= data[i]["voucher_type"] %} <td>
<br>{%= data[i]["voucher_no"] %}</td> {% if(!filters.show_pdc_in_print) { %}
{%= data[i]["voucher_type"] %}
<br>
{% } %}
{%= data[i]["voucher_no"] %}
</td>
{% if(!filters.show_pdc_in_print) { %} {% if(!filters.show_pdc_in_print) { %}
<td> <td>
{% if(!(filters.customer || filters.supplier)) { %} {% if(!(filters.customer || filters.supplier)) { %}

View File

@ -136,7 +136,7 @@ class ReceivablePayableReport(object):
return_entries = self.get_return_entries(args.get("party_type")) return_entries = self.get_return_entries(args.get("party_type"))
data = [] data = []
pdc_details = get_pdc_details(args.get("party_type")) pdc_details = get_pdc_details(args.get("party_type"), self.filters.report_date)
for gle in self.get_entries_till(self.filters.report_date, args.get("party_type")): for gle in self.get_entries_till(self.filters.report_date, args.get("party_type")):
if self.is_receivable_or_payable(gle, dr_or_cr, future_vouchers): if self.is_receivable_or_payable(gle, dr_or_cr, future_vouchers):
@ -182,6 +182,7 @@ class ReceivablePayableReport(object):
row.append(company_currency) row.append(company_currency)
pdc = pdc_details.get((gle.voucher_no, gle.party), {}) pdc = pdc_details.get((gle.voucher_no, gle.party), {})
remaining_balance = outstanding_amount - flt(pdc.get("pdc_amount")) remaining_balance = outstanding_amount - flt(pdc.get("pdc_amount"))
row += [pdc.get("pdc_date"), pdc.get("pdc_ref"), row += [pdc.get("pdc_date"), pdc.get("pdc_ref"),
flt(pdc.get("pdc_amount")), remaining_balance] flt(pdc.get("pdc_amount")), remaining_balance]
@ -414,7 +415,7 @@ def get_ageing_data(first_range, second_range, third_range, age_as_on, entry_dat
return [age] + outstanding_range return [age] + outstanding_range
def get_pdc_details(party_type): def get_pdc_details(party_type, report_date):
pdc_details = frappe._dict() pdc_details = frappe._dict()
for pdc in frappe.db.sql(""" for pdc in frappe.db.sql("""
@ -427,13 +428,14 @@ def get_pdc_details(party_type):
on on
(pref.parent = pent.name) (pref.parent = pent.name)
where where
pent.docstatus < 2 and pent.reference_date >= pent.posting_date pent.docstatus < 2 and pent.reference_date >= %s
and pent.party_type = %s and pent.party_type = %s
group by pent.party, pref.reference_name""", party_type, as_dict=1): group by pent.party, pref.reference_name""", (report_date, party_type), as_dict=1):
pdc_details.setdefault((pdc.invoice_no, pdc.party), pdc) pdc_details.setdefault((pdc.invoice_no, pdc.party), pdc)
if scrub(party_type): if scrub(party_type):
amount_field = "jea.debit_in_account_currency + jea.credit_in_account_currency" amount_field = ("jea.debit_in_account_currency"
if party_type == 'Supplier' else "jea.credit_in_account_currency")
else: else:
amount_field = "jea.debit + jea.credit" amount_field = "jea.debit + jea.credit"
@ -447,9 +449,9 @@ def get_pdc_details(party_type):
on on
(jea.parent = je.name) (jea.parent = je.name)
where where
je.docstatus < 2 and je.cheque_date >= je.posting_date je.docstatus < 2 and je.cheque_date >= %s
and jea.party_type = %s and jea.party_type = %s
group by jea.party, jea.reference_name""".format(amount_field), party_type, as_dict=1): group by jea.party, jea.reference_name""".format(amount_field), (report_date, party_type), as_dict=1):
if (pdc.invoice_no, pdc.party) in pdc_details: if (pdc.invoice_no, pdc.party) in pdc_details:
pdc_details[(pdc.invoice_no, pdc.party)]["pdc_amount"] += pdc.pdc_amount pdc_details[(pdc.invoice_no, pdc.party)]["pdc_amount"] += pdc.pdc_amount
else: else:

View File

@ -607,6 +607,9 @@ def validate_bom_no(item, bom_no):
for d in bom.items: for d in bom.items:
if (d.item_code.lower() == item.lower()): if (d.item_code.lower() == item.lower()):
rm_item_exists = True rm_item_exists = True
for d in bom.scrap_items:
if (d.item_code.lower() == item.lower()):
rm_item_exists = True
if bom.item.lower() == item.lower() or \ if bom.item.lower() == item.lower() or \
bom.item.lower() == cstr(frappe.db.get_value("Item", item, "variant_of")).lower(): bom.item.lower() == cstr(frappe.db.get_value("Item", item, "variant_of")).lower():
rm_item_exists = True rm_item_exists = True

View File

@ -319,7 +319,8 @@ frappe.ui.form.ItemQuickEntryForm = frappe.ui.form.QuickEntryForm.extend({
["parent", "=", $(e.target).attr("data-fieldname")], ["parent", "=", $(e.target).attr("data-fieldname")],
["attribute_value", "like", e.target.value + "%"] ["attribute_value", "like", e.target.value + "%"]
], ],
fields: ["attribute_value"] fields: ["attribute_value"],
parent: "Item"
}, },
callback: function(r) { callback: function(r) {
if (r.message) { if (r.message) {

View File

@ -456,7 +456,8 @@ $.extend(erpnext.item, {
], ],
fields: ["attribute_value"], fields: ["attribute_value"],
limit_start: 0, limit_start: 0,
limit_page_length: 500 limit_page_length: 500,
parent: "Item"
} }
}).then((r) => { }).then((r) => {
if(r.message) { if(r.message) {
@ -598,7 +599,8 @@ $.extend(erpnext.item, {
["parent","=", i], ["parent","=", i],
["attribute_value", "like", term + "%"] ["attribute_value", "like", term + "%"]
], ],
fields: ["attribute_value"] fields: ["attribute_value"],
parent: "Item"
}, },
callback: function(r) { callback: function(r) {
if (r.message) { if (r.message) {

View File

@ -320,7 +320,7 @@ def get_price_list_rate(args, item_doc, out):
out.price_list_rate = flt(price_list_rate) * flt(args.plc_conversion_rate) \ out.price_list_rate = flt(price_list_rate) * flt(args.plc_conversion_rate) \
/ flt(args.conversion_rate) / flt(args.conversion_rate)
if not args.price_list_uom_dependant: if not args.price_list_uom_dependant:
out.price_list_rate = flt(out.price_list_rate * (args.conversion_factor or 1.0)) out.price_list_rate = flt(out.price_list_rate * (flt(args.conversion_factor) or 1.0))
if not out.price_list_rate and args.transaction_type=="buying": if not out.price_list_rate and args.transaction_type=="buying":
from erpnext.stock.doctype.item.item import get_last_purchase_details from erpnext.stock.doctype.item.item import get_last_purchase_details

View File

@ -14,10 +14,15 @@ def get_data(item):
if not item: if not item:
return [] return []
item_dicts = [] item_dicts = []
variants = None
variant_results = frappe.db.sql("""select name from `tabItem` variant_results = frappe.db.sql("""select name from `tabItem`
where variant_of = %s""", item, as_dict=1) where variant_of = %s""", item, as_dict=1)
variants = ",".join(['"' + frappe.db.escape(variant['name']) + '"' for variant in variant_results]) if not variant_results:
frappe.msgprint(_("There isn't any item variant for the selected item"))
return []
else:
variants = ",".join(['"' + frappe.db.escape(variant['name']) + '"' for variant in variant_results])
order_count_map = get_open_sales_orders_map(variants) order_count_map = get_open_sales_orders_map(variants)
stock_details_map = get_stock_details_map(variants) stock_details_map = get_stock_details_map(variants)