Merge branch 'staging' into develop
This commit is contained in:
commit
f3f997f232
@ -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.65'
|
__version__ = '10.1.66'
|
||||||
|
|
||||||
def get_default_company(user=None):
|
def get_default_company(user=None):
|
||||||
'''Get default company for user'''
|
'''Get default company for user'''
|
||||||
|
@ -16,6 +16,7 @@ import copy
|
|||||||
class BankStatementTransactionEntry(Document):
|
class BankStatementTransactionEntry(Document):
|
||||||
def autoname(self):
|
def autoname(self):
|
||||||
self.name = self.bank_account + "-" + self.from_date + "-" + self.to_date
|
self.name = self.bank_account + "-" + self.from_date + "-" + self.to_date
|
||||||
|
if self.bank:
|
||||||
mapper_name = self.bank + "-Statement-Settings"
|
mapper_name = self.bank + "-Statement-Settings"
|
||||||
if not frappe.db.exists("Bank Statement Settings", mapper_name):
|
if not frappe.db.exists("Bank Statement Settings", mapper_name):
|
||||||
self.create_settings(self.bank)
|
self.create_settings(self.bank)
|
||||||
|
@ -747,9 +747,11 @@ class SalesInvoice(SellingController):
|
|||||||
self.get_gl_dict({
|
self.get_gl_dict({
|
||||||
"account": tax.account_head,
|
"account": tax.account_head,
|
||||||
"against": self.customer,
|
"against": self.customer,
|
||||||
"credit": flt(tax.base_tax_amount_after_discount_amount),
|
"credit": flt(tax.base_tax_amount_after_discount_amount,
|
||||||
"credit_in_account_currency": flt(tax.base_tax_amount_after_discount_amount) \
|
tax.precision("tax_amount_after_discount_amount")),
|
||||||
if account_currency==self.company_currency else flt(tax.tax_amount_after_discount_amount),
|
"credit_in_account_currency": (flt(tax.base_tax_amount_after_discount_amount,
|
||||||
|
tax.precision("base_tax_amount_after_discount_amount")) if account_currency==self.company_currency else
|
||||||
|
flt(tax.tax_amount_after_discount_amount, tax.precision("tax_amount_after_discount_amount"))),
|
||||||
"cost_center": tax.cost_center
|
"cost_center": tax.cost_center
|
||||||
}, account_currency)
|
}, account_currency)
|
||||||
)
|
)
|
||||||
@ -757,7 +759,7 @@ class SalesInvoice(SellingController):
|
|||||||
def make_item_gl_entries(self, gl_entries):
|
def make_item_gl_entries(self, gl_entries):
|
||||||
# income account gl entries
|
# income account gl entries
|
||||||
for item in self.get("items"):
|
for item in self.get("items"):
|
||||||
if flt(item.base_net_amount):
|
if flt(item.base_net_amount, item.precision("base_net_amount")):
|
||||||
if item.is_fixed_asset:
|
if item.is_fixed_asset:
|
||||||
asset = frappe.get_doc("Asset", item.asset)
|
asset = frappe.get_doc("Asset", item.asset)
|
||||||
|
|
||||||
@ -774,9 +776,10 @@ class SalesInvoice(SellingController):
|
|||||||
self.get_gl_dict({
|
self.get_gl_dict({
|
||||||
"account": item.income_account if not item.enable_deferred_revenue else item.deferred_revenue_account,
|
"account": item.income_account if not item.enable_deferred_revenue else item.deferred_revenue_account,
|
||||||
"against": self.customer,
|
"against": self.customer,
|
||||||
"credit": item.base_net_amount,
|
"credit": flt(item.base_net_amount, item.precision("base_net_amount")),
|
||||||
"credit_in_account_currency": item.base_net_amount \
|
"credit_in_account_currency": (flt(item.base_net_amount, item.precision("base_net_amount"))
|
||||||
if account_currency==self.company_currency else item.net_amount,
|
if account_currency==self.company_currency
|
||||||
|
else flt(item.net_amount, item.precision("net_amount"))),
|
||||||
"cost_center": item.cost_center
|
"cost_center": item.cost_center
|
||||||
}, account_currency)
|
}, account_currency)
|
||||||
)
|
)
|
||||||
@ -875,7 +878,7 @@ class SalesInvoice(SellingController):
|
|||||||
|
|
||||||
def make_write_off_gl_entry(self, gl_entries):
|
def make_write_off_gl_entry(self, gl_entries):
|
||||||
# write off entries, applicable if only pos
|
# write off entries, applicable if only pos
|
||||||
if self.write_off_account and self.write_off_amount:
|
if self.write_off_account and flt(self.write_off_amount, self.precision("write_off_amount")):
|
||||||
write_off_account_currency = get_account_currency(self.write_off_account)
|
write_off_account_currency = get_account_currency(self.write_off_account)
|
||||||
default_cost_center = frappe.get_cached_value('Company', self.company, 'cost_center')
|
default_cost_center = frappe.get_cached_value('Company', self.company, 'cost_center')
|
||||||
|
|
||||||
@ -885,10 +888,11 @@ class SalesInvoice(SellingController):
|
|||||||
"party_type": "Customer",
|
"party_type": "Customer",
|
||||||
"party": self.customer,
|
"party": self.customer,
|
||||||
"against": self.write_off_account,
|
"against": self.write_off_account,
|
||||||
"credit": self.base_write_off_amount,
|
"credit": flt(self.base_write_off_amount, self.precision("base_write_off_amount")),
|
||||||
"credit_in_account_currency": self.base_write_off_amount \
|
"credit_in_account_currency": (flt(self.base_write_off_amount,
|
||||||
if self.party_account_currency==self.company_currency else self.write_off_amount,
|
self.precision("base_write_off_amount")) if self.party_account_currency==self.company_currency
|
||||||
"against_voucher": self.return_against if cint(self.is_return) and self.return_against else self.name,
|
else flt(self.write_off_amount, self.precision("write_off_amount"))),
|
||||||
|
"against_voucher": self.return_against if cint(self.is_return) else self.name,
|
||||||
"against_voucher_type": self.doctype,
|
"against_voucher_type": self.doctype,
|
||||||
"cost_center": self.cost_center
|
"cost_center": self.cost_center
|
||||||
}, self.party_account_currency)
|
}, self.party_account_currency)
|
||||||
@ -897,15 +901,16 @@ class SalesInvoice(SellingController):
|
|||||||
self.get_gl_dict({
|
self.get_gl_dict({
|
||||||
"account": self.write_off_account,
|
"account": self.write_off_account,
|
||||||
"against": self.customer,
|
"against": self.customer,
|
||||||
"debit": self.base_write_off_amount,
|
"debit": flt(self.base_write_off_amount, self.precision("base_write_off_amount")),
|
||||||
"debit_in_account_currency": self.base_write_off_amount \
|
"debit_in_account_currency": (flt(self.base_write_off_amount,
|
||||||
if write_off_account_currency==self.company_currency else self.write_off_amount,
|
self.precision("base_write_off_amount")) if write_off_account_currency==self.company_currency
|
||||||
|
else flt(self.write_off_amount, self.precision("write_off_amount"))),
|
||||||
"cost_center": self.cost_center or self.write_off_cost_center or default_cost_center
|
"cost_center": self.cost_center or self.write_off_cost_center or default_cost_center
|
||||||
}, write_off_account_currency)
|
}, write_off_account_currency)
|
||||||
)
|
)
|
||||||
|
|
||||||
def make_gle_for_rounding_adjustment(self, gl_entries):
|
def make_gle_for_rounding_adjustment(self, gl_entries):
|
||||||
if self.rounding_adjustment:
|
if flt(self.rounding_adjustment, self.precision("rounding_adjustment")):
|
||||||
round_off_account, round_off_cost_center = \
|
round_off_account, round_off_cost_center = \
|
||||||
get_round_off_account_and_cost_center(self.company)
|
get_round_off_account_and_cost_center(self.company)
|
||||||
|
|
||||||
@ -913,8 +918,10 @@ class SalesInvoice(SellingController):
|
|||||||
self.get_gl_dict({
|
self.get_gl_dict({
|
||||||
"account": round_off_account,
|
"account": round_off_account,
|
||||||
"against": self.customer,
|
"against": self.customer,
|
||||||
"credit_in_account_currency": self.base_rounding_adjustment,
|
"credit_in_account_currency": flt(self.rounding_adjustment,
|
||||||
"credit": self.base_rounding_adjustment,
|
self.precision("rounding_adjustment")),
|
||||||
|
"credit": flt(self.base_rounding_adjustment,
|
||||||
|
self.precision("base_rounding_adjustment")),
|
||||||
"cost_center": self.cost_center or round_off_cost_center,
|
"cost_center": self.cost_center or round_off_cost_center,
|
||||||
}
|
}
|
||||||
))
|
))
|
||||||
|
@ -75,7 +75,7 @@
|
|||||||
<td class="text-right">{%= format_currency(balance_row[range3]) %}</td>
|
<td class="text-right">{%= format_currency(balance_row[range3]) %}</td>
|
||||||
<td class="text-right">{%= format_currency(balance_row[range4]) %}</td>
|
<td class="text-right">{%= format_currency(balance_row[range4]) %}</td>
|
||||||
<td class="text-right">
|
<td class="text-right">
|
||||||
{%= format_currency(flt(balance_row[__("Outstanding Amount")]), data[data.length-1]["currency"]) %}
|
{%= format_currency(flt(balance_row[("outstanding_amount")]), data[data.length-1]["currency"]) %}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<td>{%= __("PDC/LC") %}</td>
|
<td>{%= __("PDC/LC") %}</td>
|
||||||
@ -84,7 +84,7 @@
|
|||||||
<td></td>
|
<td></td>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td class="text-right">
|
<td class="text-right">
|
||||||
{%= format_currency(flt(balance_row[__("PDC/LC Amount")]), data[data.length-1]["currency"]) %}
|
{%= format_currency(flt(balance_row[("pdc/lc_amount")]), data[data.length-1]["currency"]) %}
|
||||||
</td>
|
</td>
|
||||||
<tr class="cvs-footer">
|
<tr class="cvs-footer">
|
||||||
<th class="text-left">{%= __("Cheques Required") %}</th>
|
<th class="text-left">{%= __("Cheques Required") %}</th>
|
||||||
@ -93,7 +93,7 @@
|
|||||||
<th></th>
|
<th></th>
|
||||||
<th></th>
|
<th></th>
|
||||||
<th class="text-right">
|
<th class="text-right">
|
||||||
{%= format_currency(flt(balance_row[__("Outstanding Amount")]-balance_row[__("PDC/LC Amount")]), data[data.length-1]["currency"]) %}</th>
|
{%= format_currency(flt(balance_row[("outstanding_amount")]-balance_row[("pdc/lc_amount")]), data[data.length-1]["currency"]) %}</th>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
||||||
@ -177,10 +177,10 @@
|
|||||||
<td style="text-align: right">
|
<td style="text-align: right">
|
||||||
{%= data[i]["po_no"] %}</td>
|
{%= data[i]["po_no"] %}</td>
|
||||||
{% } %}
|
{% } %}
|
||||||
<td style="text-align: right">{%= frappe.datetime.str_to_user(data[i][__("PDC/LC Date")]) %}</td>
|
<td style="text-align: right">{%= frappe.datetime.str_to_user(data[i][("pdc/lc_date")]) %}</td>
|
||||||
<td style="text-align: right">{%= data[i][__("PDC/LC Ref")] %}</td>
|
<td style="text-align: right">{%= data[i][("pdc/lc_ref")] %}</td>
|
||||||
<td style="text-align: right">{%= format_currency(data[i][__("PDC/LC Amount")], data[i]["currency"]) %}</td>
|
<td style="text-align: right">{%= format_currency(data[i][("pdc/lc_amount")], data[i]["currency"]) %}</td>
|
||||||
<td style="text-align: right">{%= format_currency(data[i][__("Remaining Balance")], data[i]["currency"]) %}</td>
|
<td style="text-align: right">{%= format_currency(data[i][("remaining_balance")], data[i]["currency"]) %}</td>
|
||||||
{% } %}
|
{% } %}
|
||||||
{% } else { %}
|
{% } else { %}
|
||||||
<td></td>
|
<td></td>
|
||||||
@ -205,9 +205,9 @@
|
|||||||
{%= data[i][__("Customer LPO")] %}</td>
|
{%= data[i][__("Customer LPO")] %}</td>
|
||||||
{% } %}
|
{% } %}
|
||||||
<td style="text-align: right">{%= frappe.datetime.str_to_user(data[i][__("PDC/LC Date")]) %}</td>
|
<td style="text-align: right">{%= frappe.datetime.str_to_user(data[i][__("PDC/LC Date")]) %}</td>
|
||||||
<td style="text-align: right">{%= data[i][__("PDC/LC Ref")] %}</td>
|
<td style="text-align: right">{%= data[i][("pdc/lc_ref")] %}</td>
|
||||||
<td style="text-align: right">{%= format_currency(data[i][__("PDC/LC Amount")], data[i]["currency"]) %}</td>
|
<td style="text-align: right">{%= format_currency(data[i][("pdc/lc_amount")], data[i]["currency"]) %}</td>
|
||||||
<td style="text-align: right">{%= format_currency(data[i][__("Remaining Balance")], data[i]["currency"]) %}</td>
|
<td style="text-align: right">{%= format_currency(data[i][("remaining_balance")], data[i]["currency"]) %}</td>
|
||||||
{% } %}
|
{% } %}
|
||||||
{% } %}
|
{% } %}
|
||||||
{% } else { %}
|
{% } else { %}
|
||||||
@ -228,10 +228,10 @@
|
|||||||
{% } else { %}
|
{% } else { %}
|
||||||
<td><b>{%= __("Total") %}</b></td>
|
<td><b>{%= __("Total") %}</b></td>
|
||||||
{% } %}
|
{% } %}
|
||||||
<td style="text-align: right">{%= format_currency(data[i][__("Total Invoiced Amt")], data[i]["currency"]) %}</td>
|
<td style="text-align: right">{%= format_currency(data[i][("total_invoiced_amt")], data[i]["currency"]) %}</td>
|
||||||
<td style="text-align: right">{%= format_currency(data[i][__("Total Paid Amt")], data[i]["currency"]) %}</td>
|
<td style="text-align: right">{%= format_currency(data[i][("total_paid_amt")], data[i]["currency"]) %}</td>
|
||||||
<td style="text-align: right">{%= report.report_name === "Accounts Receivable Summary" ? format_currency(data[i][__("Credit Note Amt")], data[i]["currency"]) : format_currency(data[i][__("Debit Note Amt")], data[i]["currency"]) %}</td>
|
<td style="text-align: right">{%= report.report_name === "Accounts Receivable Summary" ? format_currency(data[i][__("Credit Note Amt")], data[i]["currency"]) : format_currency(data[i][__("Debit Note Amt")], data[i]["currency"]) %}</td>
|
||||||
<td style="text-align: right">{%= format_currency(data[i][__("Total Outstanding Amt")], data[i]["currency"]) %}</td>
|
<td style="text-align: right">{%= format_currency(data[i][("total_outstanding_amt")], data[i]["currency"]) %}</td>
|
||||||
{% } %}
|
{% } %}
|
||||||
{% } %}
|
{% } %}
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -89,20 +89,40 @@ class ReceivablePayableReport(object):
|
|||||||
"width": 120
|
"width": 120
|
||||||
})
|
})
|
||||||
|
|
||||||
columns.append({
|
columns += [
|
||||||
|
{
|
||||||
"fieldname": "currency",
|
"fieldname": "currency",
|
||||||
"label": _("Currency"),
|
"label": _("Currency"),
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"options": "Currency",
|
"options": "Currency",
|
||||||
"width": 100
|
"width": 100
|
||||||
})
|
},
|
||||||
|
{
|
||||||
columns += [
|
"fieldname": "pdc/lc_date",
|
||||||
_("PDC/LC Date") + ":Date:110",
|
"label": _("PDC/LC Date"),
|
||||||
_("PDC/LC Ref") + ":Data:110",
|
"fieldtype": "Date",
|
||||||
_("PDC/LC Amount") + ":Currency/currency:130",
|
"width": 110
|
||||||
_("Remaining Balance") + ":Currency/currency:130"
|
},
|
||||||
]
|
{
|
||||||
|
"fieldname": "pdc/lc_ref",
|
||||||
|
"label": _("PDC/LC Ref"),
|
||||||
|
"fieldtype": "Data",
|
||||||
|
"width": 110
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "pdc/lc_amount",
|
||||||
|
"label": _("PDC/LC Amount"),
|
||||||
|
"fieldtype": "Currency",
|
||||||
|
"options": "Currency",
|
||||||
|
"width": 130
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "remaining_balance",
|
||||||
|
"label": _("Remaining Balance"),
|
||||||
|
"fieldtype": "Currency",
|
||||||
|
"options": "Currency",
|
||||||
|
"width": 130
|
||||||
|
}]
|
||||||
|
|
||||||
if args.get('party_type') == 'Customer':
|
if args.get('party_type') == 'Customer':
|
||||||
columns.append({
|
columns.append({
|
||||||
@ -140,7 +160,6 @@ class ReceivablePayableReport(object):
|
|||||||
|
|
||||||
data = []
|
data = []
|
||||||
pdc_details = get_pdc_details(args.get("party_type"), self.filters.report_date)
|
pdc_details = get_pdc_details(args.get("party_type"), self.filters.report_date)
|
||||||
|
|
||||||
gl_entries_data = self.get_entries_till(self.filters.report_date, args.get("party_type"))
|
gl_entries_data = self.get_entries_till(self.filters.report_date, args.get("party_type"))
|
||||||
|
|
||||||
if gl_entries_data:
|
if gl_entries_data:
|
||||||
@ -464,7 +483,6 @@ def get_pdc_details(party_type, report_date):
|
|||||||
and pent.party_type = %s
|
and pent.party_type = %s
|
||||||
group by pent.party, pref.reference_name""", (report_date, 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"
|
amount_field = ("jea.debit_in_account_currency"
|
||||||
if party_type == 'Supplier' else "jea.credit_in_account_currency")
|
if party_type == 'Supplier' else "jea.credit_in_account_currency")
|
||||||
|
@ -14,10 +14,6 @@
|
|||||||
margin-bottom: -4px;
|
margin-bottom: -4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.medical_record-row > * {
|
|
||||||
z-index: -999;
|
|
||||||
}
|
|
||||||
|
|
||||||
.date-indicator {
|
.date-indicator {
|
||||||
background:none;
|
background:none;
|
||||||
font-size:12px;
|
font-size:12px;
|
||||||
|
@ -12,7 +12,7 @@ app_license = "GNU General Public License (v3)"
|
|||||||
source_link = "https://github.com/frappe/erpnext"
|
source_link = "https://github.com/frappe/erpnext"
|
||||||
|
|
||||||
develop_version = '12.x.x-develop'
|
develop_version = '12.x.x-develop'
|
||||||
staging_version = '11.0.3-beta.16'
|
staging_version = '11.0.3-beta.17'
|
||||||
|
|
||||||
error_report_email = "support@erpnext.com"
|
error_report_email = "support@erpnext.com"
|
||||||
|
|
||||||
|
@ -178,6 +178,7 @@ def validate_overlap(doc, from_date, to_date, company = None):
|
|||||||
}, as_dict = 1)
|
}, as_dict = 1)
|
||||||
|
|
||||||
if overlap_doc:
|
if overlap_doc:
|
||||||
|
if doc.get("employee"):
|
||||||
exists_for = doc.employee
|
exists_for = doc.employee
|
||||||
if company:
|
if company:
|
||||||
exists_for = company
|
exists_for = company
|
||||||
|
@ -15,19 +15,24 @@ class SMSCenter(Document):
|
|||||||
def create_receiver_list(self):
|
def create_receiver_list(self):
|
||||||
rec, where_clause = '', ''
|
rec, where_clause = '', ''
|
||||||
if self.send_to == 'All Customer Contact':
|
if self.send_to == 'All Customer Contact':
|
||||||
where_clause = self.customer and " and customer = '%s'" % \
|
where_clause = " and dl.link_doctype = 'Customer'"
|
||||||
self.customer.replace("'", "\'") or " and ifnull(customer, '') != ''"
|
if self.customer:
|
||||||
|
where_clause += " and dl.link_name = '%s'" % \
|
||||||
|
self.customer.replace("'", "\'") or " and ifnull(dl.link_name, '') != ''"
|
||||||
if self.send_to == 'All Supplier Contact':
|
if self.send_to == 'All Supplier Contact':
|
||||||
where_clause = self.supplier and " and supplier = '%s'" % \
|
where_clause = " and dl.link_doctype = 'Supplier'"
|
||||||
self.supplier.replace("'", "\'") or " and ifnull(supplier, '') != ''"
|
if self.supplier:
|
||||||
|
where_clause += " and dl.link_name = '%s'" % \
|
||||||
|
self.supplier.replace("'", "\'") or " and ifnull(dl.link_name, '') != ''"
|
||||||
if self.send_to == 'All Sales Partner Contact':
|
if self.send_to == 'All Sales Partner Contact':
|
||||||
where_clause = self.sales_partner and " and sales_partner = '%s'" % \
|
where_clause = " and dl.link_doctype = 'Sales Partner'"
|
||||||
self.sales_partner.replace("'", "\'") or " and ifnull(sales_partner, '') != ''"
|
if self.sales_partner:
|
||||||
|
where_clause += "and dl.link_name = '%s'" % \
|
||||||
|
self.sales_partner.replace("'", "\'") or " and ifnull(dl.link_name, '') != ''"
|
||||||
if self.send_to in ['All Contact', 'All Customer Contact', 'All Supplier Contact', 'All Sales Partner Contact']:
|
if self.send_to in ['All Contact', 'All Customer Contact', 'All Supplier Contact', 'All Sales Partner Contact']:
|
||||||
rec = frappe.db.sql("""select CONCAT(ifnull(first_name,''), ' ', ifnull(last_name,'')),
|
rec = frappe.db.sql("""select CONCAT(ifnull(c.first_name,''), ' ', ifnull(c.last_name,'')),
|
||||||
mobile_no from `tabContact` where ifnull(mobile_no,'')!='' and
|
c.mobile_no from `tabContact` c, `tabDynamic Link` dl where ifnull(c.mobile_no,'')!='' and
|
||||||
docstatus != 2 %s""" % where_clause)
|
c.docstatus != 2 and dl.parent = c.name%s""" % where_clause)
|
||||||
|
|
||||||
elif self.send_to == 'All Lead (Open)':
|
elif self.send_to == 'All Lead (Open)':
|
||||||
rec = frappe.db.sql("""select lead_name, mobile_no from `tabLead` where
|
rec = frappe.db.sql("""select lead_name, mobile_no from `tabLead` where
|
||||||
@ -50,7 +55,6 @@ class SMSCenter(Document):
|
|||||||
where ifnull(tabEmployee.cell_number,'')!=''""")
|
where ifnull(tabEmployee.cell_number,'')!=''""")
|
||||||
|
|
||||||
rec_list = ''
|
rec_list = ''
|
||||||
|
|
||||||
for d in rec:
|
for d in rec:
|
||||||
rec_list += d[0] + ' - ' + d[1] + '\n'
|
rec_list += d[0] + ' - ' + d[1] + '\n'
|
||||||
self.receiver_list = rec_list
|
self.receiver_list = rec_list
|
||||||
|
@ -85,6 +85,14 @@ def get_suppliers_details(filters):
|
|||||||
is_stock_item=1 and name=pri.item_code)""", as_dict=1):
|
is_stock_item=1 and name=pri.item_code)""", as_dict=1):
|
||||||
item_supplier_map.setdefault(d.item_code, []).append(d.supplier)
|
item_supplier_map.setdefault(d.item_code, []).append(d.supplier)
|
||||||
|
|
||||||
|
for d in frappe.db.sql("""select pr.supplier, pri.item_code from
|
||||||
|
`tabPurchase Invoice` pr, `tabPurchase Invoice Item` pri
|
||||||
|
where pr.name=pri.parent and pr.docstatus=1 and
|
||||||
|
ifnull(pr.update_stock, 0) = 1 and pri.item_code=(select name from `tabItem`
|
||||||
|
where is_stock_item=1 and name=pri.item_code)""", as_dict=1):
|
||||||
|
if d.item_code not in item_supplier_map:
|
||||||
|
item_supplier_map.setdefault(d.item_code, []).append(d.supplier)
|
||||||
|
|
||||||
if supplier:
|
if supplier:
|
||||||
for item_code, suppliers in iteritems(item_supplier_map):
|
for item_code, suppliers in iteritems(item_supplier_map):
|
||||||
if supplier not in suppliers:
|
if supplier not in suppliers:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user