Merge branch 'develop' into FIX-ISS-23-24-00145

This commit is contained in:
Sagar Sharma 2023-04-19 19:22:42 +05:30 committed by GitHub
commit 45c27e4e3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 42 additions and 16 deletions

View File

@ -19,6 +19,8 @@
"column_break_17", "column_break_17",
"enable_common_party_accounting", "enable_common_party_accounting",
"allow_multi_currency_invoices_against_single_party_account", "allow_multi_currency_invoices_against_single_party_account",
"journals_section",
"merge_similar_account_heads",
"report_setting_section", "report_setting_section",
"use_custom_cash_flow", "use_custom_cash_flow",
"deferred_accounting_settings_section", "deferred_accounting_settings_section",
@ -369,6 +371,18 @@
"fieldname": "book_tax_discount_loss", "fieldname": "book_tax_discount_loss",
"fieldtype": "Check", "fieldtype": "Check",
"label": "Book Tax Loss on Early Payment Discount" "label": "Book Tax Loss on Early Payment Discount"
},
{
"fieldname": "journals_section",
"fieldtype": "Section Break",
"label": "Journals"
},
{
"default": "0",
"description": "Rows with Same Account heads will be merged on Ledger",
"fieldname": "merge_similar_account_heads",
"fieldtype": "Check",
"label": "Merge Similar Account Heads"
} }
], ],
"icon": "icon-cog", "icon": "icon-cog",
@ -376,7 +390,7 @@
"index_web_pages_for_search": 1, "index_web_pages_for_search": 1,
"issingle": 1, "issingle": 1,
"links": [], "links": [],
"modified": "2023-04-14 17:22:03.680886", "modified": "2023-04-17 11:45:42.049247",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Accounts Settings", "name": "Accounts Settings",

View File

@ -885,6 +885,8 @@ class JournalEntry(AccountsController):
def make_gl_entries(self, cancel=0, adv_adj=0): def make_gl_entries(self, cancel=0, adv_adj=0):
from erpnext.accounts.general_ledger import make_gl_entries from erpnext.accounts.general_ledger import make_gl_entries
merge_entries = frappe.db.get_single_value("Accounts Settings", "merge_similar_account_heads")
gl_map = self.build_gl_map() gl_map = self.build_gl_map()
if self.voucher_type in ("Deferred Revenue", "Deferred Expense"): if self.voucher_type in ("Deferred Revenue", "Deferred Expense"):
update_outstanding = "No" update_outstanding = "No"
@ -892,7 +894,13 @@ class JournalEntry(AccountsController):
update_outstanding = "Yes" update_outstanding = "Yes"
if gl_map: if gl_map:
make_gl_entries(gl_map, cancel=cancel, adv_adj=adv_adj, update_outstanding=update_outstanding) make_gl_entries(
gl_map,
cancel=cancel,
adv_adj=adv_adj,
merge_entries=merge_entries,
update_outstanding=update_outstanding,
)
@frappe.whitelist() @frappe.whitelist()
def get_balance(self, difference_account=None): def get_balance(self, difference_account=None):

View File

@ -495,6 +495,7 @@
"allow_bulk_edit": 1, "allow_bulk_edit": 1,
"fieldname": "items", "fieldname": "items",
"fieldtype": "Table", "fieldtype": "Table",
"label": "Items",
"oldfieldname": "po_details", "oldfieldname": "po_details",
"oldfieldtype": "Table", "oldfieldtype": "Table",
"options": "Purchase Order Item", "options": "Purchase Order Item",
@ -1100,8 +1101,7 @@
{ {
"fieldname": "before_items_section", "fieldname": "before_items_section",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"hide_border": 1, "hide_border": 1
"label": "Items"
}, },
{ {
"fieldname": "items_col_break", "fieldname": "items_col_break",
@ -1271,7 +1271,7 @@
"idx": 105, "idx": 105,
"is_submittable": 1, "is_submittable": 1,
"links": [], "links": [],
"modified": "2023-01-28 18:59:16.322824", "modified": "2023-04-14 16:42:29.448464",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Buying", "module": "Buying",
"name": "Purchase Order", "name": "Purchase Order",

View File

@ -310,7 +310,6 @@
"fieldname": "items_section", "fieldname": "items_section",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"hide_border": 1, "hide_border": 1,
"label": "Items",
"oldfieldtype": "Section Break", "oldfieldtype": "Section Break",
"options": "fa fa-shopping-cart" "options": "fa fa-shopping-cart"
}, },
@ -318,6 +317,7 @@
"allow_bulk_edit": 1, "allow_bulk_edit": 1,
"fieldname": "items", "fieldname": "items",
"fieldtype": "Table", "fieldtype": "Table",
"label": "Items",
"oldfieldname": "po_details", "oldfieldname": "po_details",
"oldfieldtype": "Table", "oldfieldtype": "Table",
"options": "Supplier Quotation Item", "options": "Supplier Quotation Item",
@ -844,7 +844,7 @@
"index_web_pages_for_search": 1, "index_web_pages_for_search": 1,
"is_submittable": 1, "is_submittable": 1,
"links": [], "links": [],
"modified": "2022-12-12 18:35:39.740974", "modified": "2023-04-14 16:43:41.714832",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Buying", "module": "Buying",
"name": "Supplier Quotation", "name": "Supplier Quotation",

View File

@ -327,6 +327,7 @@ erpnext.patches.v15_0.update_asset_value_for_manual_depr_entries
erpnext.patches.v15_0.update_gpa_and_ndb_for_assdeprsch erpnext.patches.v15_0.update_gpa_and_ndb_for_assdeprsch
erpnext.patches.v14_0.create_accounting_dimensions_for_closing_balance erpnext.patches.v14_0.create_accounting_dimensions_for_closing_balance
erpnext.patches.v14_0.update_closing_balances erpnext.patches.v14_0.update_closing_balances
execute:frappe.db.set_single_value("Accounts Settings", "merge_similar_account_heads", 0)
# below migration patches should always run last # below migration patches should always run last
erpnext.patches.v14_0.migrate_gl_to_payment_ledger erpnext.patches.v14_0.migrate_gl_to_payment_ledger
execute:frappe.delete_doc_if_exists("Report", "Tax Detail") execute:frappe.delete_doc_if_exists("Report", "Tax Detail")

View File

@ -416,7 +416,6 @@
"fieldname": "items_section", "fieldname": "items_section",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"hide_border": 1, "hide_border": 1,
"label": "Items",
"oldfieldtype": "Section Break", "oldfieldtype": "Section Break",
"options": "fa fa-shopping-cart" "options": "fa fa-shopping-cart"
}, },
@ -424,6 +423,7 @@
"allow_bulk_edit": 1, "allow_bulk_edit": 1,
"fieldname": "items", "fieldname": "items",
"fieldtype": "Table", "fieldtype": "Table",
"label": "Items",
"oldfieldname": "quotation_details", "oldfieldname": "quotation_details",
"oldfieldtype": "Table", "oldfieldtype": "Table",
"options": "Quotation Item", "options": "Quotation Item",
@ -1072,7 +1072,7 @@
"idx": 82, "idx": 82,
"is_submittable": 1, "is_submittable": 1,
"links": [], "links": [],
"modified": "2022-12-12 18:32:28.671332", "modified": "2023-04-14 16:50:44.550098",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Selling", "module": "Selling",
"name": "Quotation", "name": "Quotation",

View File

@ -559,8 +559,10 @@ erpnext.PointOfSale.Controller = class {
item_row = this.frm.add_child('items', new_item); item_row = this.frm.add_child('items', new_item);
if (field === 'qty' && value !== 0 && !this.allow_negative_stock) if (field === 'qty' && value !== 0 && !this.allow_negative_stock) {
await this.check_stock_availability(item_row, value, this.frm.doc.set_warehouse); const qty_needed = value * item_row.conversion_factor;
await this.check_stock_availability(item_row, qty_needed, this.frm.doc.set_warehouse);
}
await this.trigger_new_item_events(item_row); await this.trigger_new_item_events(item_row);

View File

@ -6,7 +6,7 @@ import frappe
from frappe import _ from frappe import _
from frappe.model.document import Document from frappe.model.document import Document
from frappe.model.naming import make_autoname, revert_series_if_last from frappe.model.naming import make_autoname, revert_series_if_last
from frappe.query_builder.functions import CurDate, Sum, Timestamp from frappe.query_builder.functions import CombineDatetime, CurDate, Sum
from frappe.utils import cint, flt, get_link_to_form, nowtime from frappe.utils import cint, flt, get_link_to_form, nowtime
from frappe.utils.data import add_days from frappe.utils.data import add_days
from frappe.utils.jinja import render_template from frappe.utils.jinja import render_template
@ -192,7 +192,8 @@ def get_batch_qty(
posting_time = nowtime() posting_time = nowtime()
query = query.where( query = query.where(
Timestamp(sle.posting_date, sle.posting_time) <= Timestamp(posting_date, posting_time) CombineDatetime(sle.posting_date, sle.posting_time)
<= CombineDatetime(posting_date, posting_time)
) )
out = query.run(as_list=True)[0][0] or 0 out = query.run(as_list=True)[0][0] or 0
@ -376,7 +377,7 @@ def get_pos_reserved_batch_qty(filters):
p = frappe.qb.DocType("POS Invoice").as_("p") p = frappe.qb.DocType("POS Invoice").as_("p")
item = frappe.qb.DocType("POS Invoice Item").as_("item") item = frappe.qb.DocType("POS Invoice Item").as_("item")
sum_qty = frappe.query_builder.functions.Sum(item.qty).as_("qty") sum_qty = frappe.query_builder.functions.Sum(item.stock_qty).as_("qty")
reserved_batch_qty = ( reserved_batch_qty = (
frappe.qb.from_(p) frappe.qb.from_(p)

View File

@ -5,7 +5,7 @@
import frappe import frappe
from frappe import _ from frappe import _
from frappe.query_builder import Field from frappe.query_builder import Field
from frappe.query_builder.functions import Min, Timestamp from frappe.query_builder.functions import CombineDatetime, Min
from frappe.utils import add_days, getdate, today from frappe.utils import add_days, getdate, today
import erpnext import erpnext
@ -75,7 +75,7 @@ def get_data(report_filters):
& (sle.company == report_filters.company) & (sle.company == report_filters.company)
& (sle.is_cancelled == 0) & (sle.is_cancelled == 0)
) )
.orderby(Timestamp(sle.posting_date, sle.posting_time), sle.creation) .orderby(CombineDatetime(sle.posting_date, sle.posting_time), sle.creation)
).run(as_dict=True) ).run(as_dict=True)
for d in data: for d in data: