mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-22 22:49:19 +00:00
Merge branch 'hotfix' into accounts_receivable_summary_print_issue
This commit is contained in:
@@ -194,7 +194,7 @@
|
|||||||
{% if(!filters.show_pdc_in_print) { %}
|
{% if(!filters.show_pdc_in_print) { %}
|
||||||
<td style="text-align: right">
|
<td style="text-align: right">
|
||||||
{%= format_currency(data[i]["paid_amount"], data[i]["currency"]) %}</td>
|
{%= 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">
|
<td style="text-align: right">
|
||||||
{%= format_currency(data[i]["outstanding_amount"], data[i]["currency"]) %}</td>
|
{%= format_currency(data[i]["outstanding_amount"], data[i]["currency"]) %}</td>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import frappe
|
import frappe
|
||||||
from frappe import _
|
from frappe import _, scrub
|
||||||
from frappe.utils import flt
|
from frappe.utils import flt
|
||||||
from erpnext.accounts.report.accounts_receivable.accounts_receivable import ReceivablePayableReport
|
from erpnext.accounts.report.accounts_receivable.accounts_receivable import ReceivablePayableReport
|
||||||
|
|
||||||
@@ -18,24 +18,92 @@ class AccountsReceivableSummary(ReceivablePayableReport):
|
|||||||
if party_naming_by == "Naming Series":
|
if party_naming_by == "Naming Series":
|
||||||
columns += [ args.get("party_type") + " Name::140"]
|
columns += [ args.get("party_type") + " Name::140"]
|
||||||
|
|
||||||
credit_debit_label = _("Credit Note Amt") if args.get('party_type') == 'Customer' else _("Debit Note Amt")
|
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",
|
||||||
|
"fieldtype": "Currency",
|
||||||
|
"options": "currency",
|
||||||
|
"width": 100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Total Paid Amt"),
|
||||||
|
"fieldname": "total_paid_amt",
|
||||||
|
"fieldtype": "Currency",
|
||||||
|
"options": "currency",
|
||||||
|
"width": 100
|
||||||
|
}]
|
||||||
|
|
||||||
columns += [
|
columns += [
|
||||||
_("Total Invoiced Amt") + ":Currency/currency:140",
|
{
|
||||||
_("Total Paid Amt") + ":Currency/currency:140",
|
"label": _(credit_debit_label),
|
||||||
credit_debit_label + ":Currency/currency:140",
|
"fieldname": scrub(credit_debit_label),
|
||||||
_("Total Outstanding Amt") + ":Currency/currency:160",
|
"fieldtype": "Currency",
|
||||||
"0-" + str(self.filters.range1) + ":Currency/currency:100",
|
"options": "currency",
|
||||||
str(self.filters.range1) + "-" + str(self.filters.range2) + ":Currency/currency:100",
|
"width": 140
|
||||||
str(self.filters.range2) + "-" + str(self.filters.range3) + ":Currency/currency:100",
|
},
|
||||||
str(self.filters.range3) + _("-Above") + ":Currency/currency:100"]
|
{
|
||||||
|
"label": _("Total Outstanding Amt"),
|
||||||
|
"fieldname": "total_outstanding_amt",
|
||||||
|
"fieldtype": "Currency",
|
||||||
|
"options": "currency",
|
||||||
|
"width": 160
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("0-" + str(self.filters.range1)),
|
||||||
|
"fieldname": scrub("0-" + str(self.filters.range1)),
|
||||||
|
"fieldtype": "Currency",
|
||||||
|
"options": "currency",
|
||||||
|
"width": 160
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _(str(self.filters.range1) + "-" + str(self.filters.range2)),
|
||||||
|
"fieldname": scrub(str(self.filters.range1) + "-" + str(self.filters.range2)),
|
||||||
|
"fieldtype": "Currency",
|
||||||
|
"options": "currency",
|
||||||
|
"width": 160
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _(str(self.filters.range2) + "-" + str(self.filters.range3)),
|
||||||
|
"fieldname": scrub(str(self.filters.range2) + "-" + str(self.filters.range3)),
|
||||||
|
"fieldtype": "Currency",
|
||||||
|
"options": "currency",
|
||||||
|
"width": 160
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _(str(self.filters.range3) + _("-Above")),
|
||||||
|
"fieldname": scrub(str(self.filters.range3) + _("-Above")),
|
||||||
|
"fieldtype": "Currency",
|
||||||
|
"options": "currency",
|
||||||
|
"width": 160
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
if args.get("party_type") == "Customer":
|
if args.get("party_type") == "Customer":
|
||||||
columns += [
|
columns += [{
|
||||||
_("Territory") + ":Link/Territory:80",
|
"label": _("Territory"),
|
||||||
_("Customer Group") + ":Link/Customer Group:120"
|
"fieldname": "territory",
|
||||||
]
|
"fieldtype": "Link",
|
||||||
|
"options": "Territory",
|
||||||
|
"width": 80
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Customer Group"),
|
||||||
|
"fieldname": "customer_group",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"options": "Customer Group",
|
||||||
|
"width": 80
|
||||||
|
}]
|
||||||
|
|
||||||
if args.get("party_type") == "Supplier":
|
if args.get("party_type") == "Supplier":
|
||||||
columns += [_("Supplier Type") + ":Link/Supplier Type:80"]
|
columns += [{
|
||||||
|
"label": _("Supplier Group"),
|
||||||
|
"fieldname": "supplier_group",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"options": "Supplier Group",
|
||||||
|
"width": 80
|
||||||
|
}]
|
||||||
|
|
||||||
columns.append({
|
columns.append({
|
||||||
"fieldname": "currency",
|
"fieldname": "currency",
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ from erpnext.accounts.party import get_party_details
|
|||||||
from erpnext.stock.get_item_details import get_conversion_factor
|
from erpnext.stock.get_item_details import get_conversion_factor
|
||||||
from erpnext.buying.utils import validate_for_items, update_last_purchase_rate
|
from erpnext.buying.utils import validate_for_items, update_last_purchase_rate
|
||||||
from erpnext.stock.stock_ledger import get_valuation_rate
|
from erpnext.stock.stock_ledger import get_valuation_rate
|
||||||
|
from frappe.contacts.doctype.address.address import get_address_display
|
||||||
|
|
||||||
from erpnext.controllers.stock_controller import StockController
|
from erpnext.controllers.stock_controller import StockController
|
||||||
|
|
||||||
@@ -39,6 +40,7 @@ class BuyingController(StockController):
|
|||||||
self.set_qty_as_per_stock_uom()
|
self.set_qty_as_per_stock_uom()
|
||||||
self.validate_stock_or_nonstock_items()
|
self.validate_stock_or_nonstock_items()
|
||||||
self.validate_warehouse()
|
self.validate_warehouse()
|
||||||
|
self.set_supplier_address()
|
||||||
|
|
||||||
if self.doctype=="Purchase Invoice":
|
if self.doctype=="Purchase Invoice":
|
||||||
self.validate_purchase_receipt_if_update_stock()
|
self.validate_purchase_receipt_if_update_stock()
|
||||||
@@ -96,6 +98,16 @@ class BuyingController(StockController):
|
|||||||
if not d.cost_center and lc_voucher_data and lc_voucher_data[0][1]:
|
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])
|
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):
|
def set_total_in_words(self):
|
||||||
from frappe.utils import money_in_words
|
from frappe.utils import money_in_words
|
||||||
if self.meta.get_field("base_in_words"):
|
if self.meta.get_field("base_in_words"):
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ from frappe import _, throw
|
|||||||
from erpnext.stock.get_item_details import get_bin_details
|
from erpnext.stock.get_item_details import get_bin_details
|
||||||
from erpnext.stock.utils import get_incoming_rate
|
from erpnext.stock.utils import get_incoming_rate
|
||||||
from erpnext.stock.get_item_details import get_conversion_factor
|
from erpnext.stock.get_item_details import get_conversion_factor
|
||||||
|
from frappe.contacts.doctype.address.address import get_address_display
|
||||||
|
|
||||||
from erpnext.controllers.stock_controller import StockController
|
from erpnext.controllers.stock_controller import StockController
|
||||||
|
|
||||||
@@ -40,6 +41,7 @@ class SellingController(StockController):
|
|||||||
self.validate_selling_price()
|
self.validate_selling_price()
|
||||||
self.set_qty_as_per_stock_uom()
|
self.set_qty_as_per_stock_uom()
|
||||||
self.set_po_nos()
|
self.set_po_nos()
|
||||||
|
self.set_customer_address()
|
||||||
check_active_sales_items(self)
|
check_active_sales_items(self)
|
||||||
|
|
||||||
def set_missing_values(self, for_validate=False):
|
def set_missing_values(self, for_validate=False):
|
||||||
@@ -344,6 +346,17 @@ class SellingController(StockController):
|
|||||||
po_nos = frappe.get_all('Sales Order', 'po_no', filters = {'name': ('in', sales_orders)})
|
po_nos = frappe.get_all('Sales Order', 'po_no', filters = {'name': ('in', sales_orders)})
|
||||||
self.po_no = ', '.join(list(set([d.po_no for d in po_nos if d.po_no])))
|
self.po_no = ', '.join(list(set([d.po_no for d in po_nos if d.po_no])))
|
||||||
|
|
||||||
|
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):
|
def validate_items(self):
|
||||||
# validate items to see if they have is_sales_item enabled
|
# validate items to see if they have is_sales_item enabled
|
||||||
from erpnext.controllers.buying_controller import validate_item_type
|
from erpnext.controllers.buying_controller import validate_item_type
|
||||||
|
|||||||
@@ -346,6 +346,11 @@ body[data-route="pos"] .btn-more {
|
|||||||
body[data-route="pos"] .collapse-btn {
|
body[data-route="pos"] .collapse-btn {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
@media (max-width: 767px) {
|
||||||
|
body[data-route="pos"] .page-actions {
|
||||||
|
max-width: 110px;
|
||||||
|
}
|
||||||
|
}
|
||||||
.price-info {
|
.price-info {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 0;
|
left: 0;
|
||||||
|
|||||||
@@ -49,8 +49,9 @@ def update_packing_list_item(doc, packing_item_code, qty, main_item_row, descrip
|
|||||||
pi.qty = flt(qty)
|
pi.qty = flt(qty)
|
||||||
pi.description = description
|
pi.description = description
|
||||||
if not pi.warehouse:
|
if not pi.warehouse:
|
||||||
pi.warehouse = (main_item_row.warehouse
|
pi.warehouse = (main_item_row.warehouse if ((doc.get('is_pos')
|
||||||
if (doc.get('is_pos') or not item.default_warehouse) else item.default_warehouse)
|
or not item.default_warehouse) and main_item_row.warehouse) else item.default_warehouse)
|
||||||
|
|
||||||
if not pi.batch_no:
|
if not pi.batch_no:
|
||||||
pi.batch_no = cstr(main_item_row.get("batch_no"))
|
pi.batch_no = cstr(main_item_row.get("batch_no"))
|
||||||
if not pi.target_warehouse:
|
if not pi.target_warehouse:
|
||||||
|
|||||||
@@ -176,7 +176,11 @@ class update_entries_after(object):
|
|||||||
# rounding as per precision
|
# rounding as per precision
|
||||||
self.stock_value = flt(self.stock_value, self.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
|
self.prev_stock_value = self.stock_value
|
||||||
|
|
||||||
# update current sle
|
# update current sle
|
||||||
|
|||||||
Reference in New Issue
Block a user