Merge branch 'staging-fixes' of https://github.com/frappe/erpnext into analytics-fix
diff --git a/erpnext/__init__.py b/erpnext/__init__.py
index 92efe8e..c00d90e 100644
--- a/erpnext/__init__.py
+++ b/erpnext/__init__.py
@@ -5,7 +5,7 @@
from erpnext.hooks import regional_overrides
from frappe.utils import getdate
-__version__ = '10.1.72'
+__version__ = '10.1.73'
def get_default_company(user=None):
'''Get default company for user'''
diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.html b/erpnext/accounts/report/accounts_receivable/accounts_receivable.html
index dfcf64c..4930207 100644
--- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.html
+++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.html
@@ -194,7 +194,7 @@
{% if(!filters.show_pdc_in_print) { %}
<td style="text-align: right">
{%= format_currency(data[i]["paid_amount"], data[i]["currency"]) %}</td>
- <td style="text-align: right">{%= report.report_name === "Accounts Receivable" ? format_currency(data[i]["credit_note"], data[i]["currency"]) : format_currency(data[i]["Debit Note"], data[i]["currency"]) %} </td>
+ <td style="text-align: right">{%= report.report_name === "Accounts Receivable" ? format_currency(data[i]["credit_note"], data[i]["currency"]) : format_currency(data[i]["debit_note"], data[i]["currency"]) %} </td>
{% } %}
<td style="text-align: right">
{%= format_currency(data[i]["outstanding_amount"], data[i]["currency"]) %}</td>
diff --git a/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.py b/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.py
index 7b0072c..7bf9972 100644
--- a/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.py
+++ b/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.py
@@ -22,7 +22,7 @@
columns += [ args.get("party_type") + " Name::140"]
credit_debit_label = "Credit Note Amt" if args.get('party_type') == 'Customer' else "Debit Note Amt"
-
+
columns += [{
"label": _("Total Invoiced Amt"),
"fieldname": "total_invoiced_amt",
@@ -107,7 +107,7 @@
"options": "Supplier Group",
"width": 80
}]
-
+
columns.append({
"fieldname": "currency",
"label": _("Currency"),
@@ -138,7 +138,7 @@
row += [self.get_territory(party), self.get_customer_group(party)]
if args.get("party_type") == "Supplier":
row += [self.get_supplier_group(party)]
-
+
row.append(party_dict.currency)
data.append(row)
@@ -162,7 +162,7 @@
for k in list(party_total[d.party]):
if k != "currency":
party_total[d.party][k] += flt(d.get(k, 0))
-
+
party_total[d.party].currency = d.currency
return party_total
diff --git a/erpnext/controllers/buying_controller.py b/erpnext/controllers/buying_controller.py
index dbde304..ee6dc2a 100644
--- a/erpnext/controllers/buying_controller.py
+++ b/erpnext/controllers/buying_controller.py
@@ -12,6 +12,7 @@
from erpnext.stock.stock_ledger import get_valuation_rate
from erpnext.stock.doctype.stock_entry.stock_entry import get_used_alternative_items
from erpnext.stock.doctype.serial_no.serial_no import get_auto_serial_nos, auto_make_serial_nos, get_serial_nos
+from frappe.contacts.doctype.address.address import get_address_display
from erpnext.accounts.doctype.budget.budget import validate_expense_against_budget
from erpnext.controllers.stock_controller import StockController
@@ -42,6 +43,7 @@
self.set_qty_as_per_stock_uom()
self.validate_stock_or_nonstock_items()
self.validate_warehouse()
+ self.set_supplier_address()
if self.doctype=="Purchase Invoice":
self.validate_purchase_receipt_if_update_stock()
@@ -113,6 +115,16 @@
if not d.cost_center and lc_voucher_data and lc_voucher_data[0][1]:
d.db_set('cost_center', lc_voucher_data[0][1])
+ def set_supplier_address(self):
+ address_dict = {
+ 'supplier_address': 'address_display',
+ 'shipping_address': 'shipping_address_display'
+ }
+
+ for address_field, address_display_field in address_dict.items():
+ if self.get(address_field):
+ self.set(address_display_field, get_address_display(self.get(address_field)))
+
def set_total_in_words(self):
from frappe.utils import money_in_words
if self.meta.get_field("base_in_words"):
diff --git a/erpnext/controllers/selling_controller.py b/erpnext/controllers/selling_controller.py
index 7739592..684a2cd 100644
--- a/erpnext/controllers/selling_controller.py
+++ b/erpnext/controllers/selling_controller.py
@@ -9,6 +9,7 @@
from erpnext.stock.utils import get_incoming_rate
from erpnext.stock.get_item_details import get_conversion_factor
from erpnext.stock.doctype.item.item import get_item_defaults, set_item_default
+from frappe.contacts.doctype.address.address import get_address_display
from erpnext.controllers.stock_controller import StockController
@@ -16,7 +17,7 @@
def __setup__(self):
if hasattr(self, "taxes"):
self.flags.print_taxes_with_zero_amount = cint(frappe.db.get_single_value("Print Settings",
- "print_taxes_with_zero_amount"))
+ "print_taxes_with_zero_amount"))
self.flags.show_inclusive_tax_in_print = self.is_inclusive_tax()
self.print_templates = {
@@ -43,6 +44,7 @@
self.set_po_nos()
self.set_gross_profit()
set_default_income_account_for_item(self)
+ self.set_customer_address()
def set_missing_values(self, for_validate=False):
@@ -355,6 +357,17 @@
item.gross_profit = flt(((item.base_rate - item.valuation_rate) * item.stock_qty), self.precision("amount", item))
+ def set_customer_address(self):
+ address_dict = {
+ 'customer_address': 'address_display',
+ 'shipping_address_name': 'shipping_address',
+ 'company_address': 'company_address_display'
+ }
+
+ for address_field, address_display_field in address_dict.items():
+ if self.get(address_field):
+ self.set(address_display_field, get_address_display(self.get(address_field)))
+
def validate_items(self):
# validate items to see if they have is_sales_item enabled
from erpnext.controllers.buying_controller import validate_item_type
diff --git a/erpnext/hooks.py b/erpnext/hooks.py
index 43afa2a..cbd3939 100644
--- a/erpnext/hooks.py
+++ b/erpnext/hooks.py
@@ -12,7 +12,7 @@
source_link = "https://github.com/frappe/erpnext"
develop_version = '12.x.x-develop'
-staging_version = '11.0.3-beta.24'
+staging_version = '11.0.3-beta.25'
error_report_email = "support@erpnext.com"
diff --git a/erpnext/public/css/erpnext.css b/erpnext/public/css/erpnext.css
index 460efbf..c55e422 100644
--- a/erpnext/public/css/erpnext.css
+++ b/erpnext/public/css/erpnext.css
@@ -346,6 +346,11 @@
body[data-route="pos"] .collapse-btn {
cursor: pointer;
}
+@media (max-width: 767px) {
+ body[data-route="pos"] .page-actions {
+ max-width: 110px;
+ }
+}
.price-info {
position: absolute;
left: 0;
diff --git a/erpnext/stock/doctype/packed_item/packed_item.py b/erpnext/stock/doctype/packed_item/packed_item.py
index fc53794..cf72527 100644
--- a/erpnext/stock/doctype/packed_item/packed_item.py
+++ b/erpnext/stock/doctype/packed_item/packed_item.py
@@ -53,8 +53,9 @@
pi.qty = flt(qty)
pi.description = description
if not pi.warehouse:
- pi.warehouse = (main_item_row.warehouse
- if (doc.get('is_pos') or not item.default_warehouse) else item.default_warehouse)
+ pi.warehouse = (main_item_row.warehouse if ((doc.get('is_pos')
+ or not item.default_warehouse) and main_item_row.warehouse) else item.default_warehouse)
+
if not pi.batch_no:
pi.batch_no = cstr(main_item_row.get("batch_no"))
if not pi.target_warehouse:
diff --git a/erpnext/stock/stock_ledger.py b/erpnext/stock/stock_ledger.py
index 928dd88..0c83529 100644
--- a/erpnext/stock/stock_ledger.py
+++ b/erpnext/stock/stock_ledger.py
@@ -178,7 +178,11 @@
# rounding as per precision
self.stock_value = flt(self.stock_value, self.precision)
- stock_value_difference = self.stock_value - self.prev_stock_value
+ if self.prev_stock_value < 0 and self.stock_value >= 0:
+ stock_value_difference = sle.actual_qty * self.valuation_rate
+ else:
+ stock_value_difference = self.stock_value - self.prev_stock_value
+
self.prev_stock_value = self.stock_value
# update current sle