mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-15 23:54:59 +00:00
Merge branch 'frappe:develop' into add-employee-name-to-session-user
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
<h2 class="text-center">{{ _("STATEMENT OF ACCOUNTS") }}</h2>
|
||||
<h2 class="text-center">{{ _("GENERAL LEDGER") }}</h2>
|
||||
<div>
|
||||
{% if filters.party[0] == filters.party_name[0] %}
|
||||
<h5 style="float: left;">{{ _("Customer: ") }} <b>{{ filters.party_name[0] }}</b></h5>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"actions": [],
|
||||
"allow_rename": 1,
|
||||
"autoname": "Prompt",
|
||||
"creation": "2020-05-22 16:46:18.712954",
|
||||
"doctype": "DocType",
|
||||
@@ -69,7 +70,7 @@
|
||||
"fieldname": "frequency",
|
||||
"fieldtype": "Select",
|
||||
"label": "Frequency",
|
||||
"options": "Weekly\nMonthly\nQuarterly"
|
||||
"options": "Daily\nWeekly\nBiweekly\nMonthly\nQuarterly"
|
||||
},
|
||||
{
|
||||
"fieldname": "company",
|
||||
@@ -416,7 +417,7 @@
|
||||
}
|
||||
],
|
||||
"links": [],
|
||||
"modified": "2025-09-03 14:24:43.608565",
|
||||
"modified": "2025-10-07 12:19:20.719898",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Process Statement Of Accounts",
|
||||
|
||||
@@ -8,7 +8,7 @@ import frappe
|
||||
from frappe import _
|
||||
from frappe.desk.reportview import get_match_cond
|
||||
from frappe.model.document import Document
|
||||
from frappe.utils import add_days, add_months, format_date, getdate, today
|
||||
from frappe.utils import add_days, add_months, add_to_date, format_date, getdate, today
|
||||
from frappe.utils.jinja import validate_template
|
||||
from frappe.utils.pdf import get_pdf
|
||||
from frappe.www.printview import get_print_style
|
||||
@@ -55,7 +55,7 @@ class ProcessStatementOfAccounts(Document):
|
||||
enable_auto_email: DF.Check
|
||||
filter_duration: DF.Int
|
||||
finance_book: DF.Link | None
|
||||
frequency: DF.Literal["Weekly", "Monthly", "Quarterly"]
|
||||
frequency: DF.Literal["Daily", "Weekly", "Biweekly", "Monthly", "Quarterly"]
|
||||
from_date: DF.Date | None
|
||||
ignore_cr_dr_notes: DF.Check
|
||||
ignore_exchange_rate_revaluation_journals: DF.Check
|
||||
@@ -555,8 +555,9 @@ def send_emails(document_name, from_scheduler=False, posting_date=None):
|
||||
|
||||
if doc.enable_auto_email and from_scheduler:
|
||||
new_to_date = getdate(posting_date or today())
|
||||
if doc.frequency == "Weekly":
|
||||
new_to_date = add_days(new_to_date, 7)
|
||||
if doc.frequency in ("Daily", "Weekly", "Biweekly"):
|
||||
frequency = {"Daily": 1, "Weekly": 7, "Biweekly": 14}
|
||||
new_to_date = add_days(new_to_date, frequency[doc.frequency])
|
||||
else:
|
||||
new_to_date = add_months(new_to_date, 1 if doc.frequency == "Monthly" else 3)
|
||||
new_from_date = add_months(new_to_date, -1 * doc.filter_duration)
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<h2 class="text-center" style="margin-top:0">{{ _(report.report_name) }}</h2>
|
||||
<h2 class="text-center" style="margin-top:0">{{ _("STATEMENT OF ACCOUNTS") }}</h2>
|
||||
<h4 class="text-center">
|
||||
{{ filters.customer_name }}
|
||||
</h4>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.model.document import Document
|
||||
from frappe.utils import get_link_to_form
|
||||
from frappe.utils import cstr, get_link_to_form
|
||||
|
||||
from erpnext.assets.doctype.asset_activity.asset_activity import add_asset_activity
|
||||
|
||||
@@ -143,8 +143,8 @@ class AssetMovement(Document):
|
||||
def update_asset_location_and_custodian(self, asset_id, location, employee):
|
||||
asset = frappe.get_doc("Asset", asset_id)
|
||||
|
||||
if employee and employee != asset.custodian:
|
||||
frappe.db.set_value("Asset", asset_id, "custodian", employee)
|
||||
if cstr(employee) != asset.custodian:
|
||||
frappe.db.set_value("Asset", asset_id, "custodian", cstr(employee))
|
||||
if location and location != asset.location:
|
||||
frappe.db.set_value("Asset", asset_id, "location", location)
|
||||
|
||||
|
||||
@@ -202,6 +202,9 @@ class SubcontractingController(StockController):
|
||||
self.set(self.raw_material_table, [])
|
||||
return
|
||||
|
||||
if not self.get(self.raw_material_table):
|
||||
return
|
||||
|
||||
item_dict = self.__get_data_before_save()
|
||||
if not item_dict:
|
||||
return True
|
||||
@@ -657,6 +660,9 @@ class SubcontractingController(StockController):
|
||||
from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos_for_outward
|
||||
from erpnext.stock.get_item_details import get_filtered_serial_nos
|
||||
|
||||
if self.is_return:
|
||||
return
|
||||
|
||||
for row in self.supplied_items:
|
||||
item_details = frappe.get_cached_value(
|
||||
"Item", row.rm_item_code, ["has_batch_no", "has_serial_no"], as_dict=1
|
||||
|
||||
@@ -1692,6 +1692,17 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe
|
||||
);
|
||||
|
||||
var company_currency = this.get_company_currency();
|
||||
|
||||
if (
|
||||
this._last_company_currency === company_currency &&
|
||||
this._last_price_list_currency === this.frm.doc.price_list_currency
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._last_company_currency = company_currency;
|
||||
this._last_price_list_currency = this.frm.doc.price_list_currency;
|
||||
|
||||
this.change_form_labels(company_currency);
|
||||
this.change_grid_labels(company_currency);
|
||||
this.frm.refresh_fields();
|
||||
|
||||
@@ -158,7 +158,7 @@ class Batch(Document):
|
||||
|
||||
@frappe.whitelist()
|
||||
def recalculate_batch_qty(self):
|
||||
batches = get_batch_qty(batch_no=self.name, item_code=self.item)
|
||||
batches = get_batch_qty(batch_no=self.name, item_code=self.item, for_stock_levels=True)
|
||||
batch_qty = 0.0
|
||||
if batches:
|
||||
for row in batches:
|
||||
|
||||
@@ -2337,15 +2337,15 @@ def get_reserved_batches_for_sre(kwargs) -> dict:
|
||||
|
||||
if kwargs.batch_no:
|
||||
if isinstance(kwargs.batch_no, list):
|
||||
query = query.where(sb_entry.batch_no.notin(kwargs.batch_no))
|
||||
query = query.where(sb_entry.batch_no.isin(kwargs.batch_no))
|
||||
else:
|
||||
query = query.where(sb_entry.batch_no != kwargs.batch_no)
|
||||
query = query.where(sb_entry.batch_no == kwargs.batch_no)
|
||||
|
||||
if kwargs.warehouse:
|
||||
if isinstance(kwargs.warehouse, list):
|
||||
query = query.where(sre.warehouse.notin(kwargs.warehouse))
|
||||
query = query.where(sre.warehouse.isin(kwargs.warehouse))
|
||||
else:
|
||||
query = query.where(sre.warehouse != kwargs.warehouse)
|
||||
query = query.where(sre.warehouse == kwargs.warehouse)
|
||||
|
||||
if kwargs.ignore_voucher_nos:
|
||||
query = query.where(sre.name.notin(kwargs.ignore_voucher_nos))
|
||||
|
||||
@@ -1074,16 +1074,15 @@ class update_entries_after:
|
||||
|
||||
for d in sabb_data:
|
||||
incoming_rate = get_incoming_rate_for_serial_and_batch(self.item_code, d, sn_obj)
|
||||
|
||||
if flt(incoming_rate, self.currency_precision) == flt(
|
||||
d.valuation_rate, self.currency_precision
|
||||
) and not getattr(d, "stock_queue", None):
|
||||
continue
|
||||
|
||||
amount = incoming_rate * flt(d.qty)
|
||||
tot_amt += flt(amount)
|
||||
total_qty += flt(d.qty)
|
||||
|
||||
if flt(incoming_rate, self.currency_precision) == flt(
|
||||
d.incoming_rate, self.currency_precision
|
||||
) and not getattr(d, "stock_queue", None):
|
||||
continue
|
||||
|
||||
values_to_update = {
|
||||
"incoming_rate": incoming_rate,
|
||||
"stock_value_difference": amount,
|
||||
|
||||
@@ -336,6 +336,10 @@ frappe.ui.form.on("Subcontracting Receipt", {
|
||||
|
||||
reset_raw_materials_table: (frm) => {
|
||||
frm.clear_table("supplied_items");
|
||||
frm.doc.__unsaved = true;
|
||||
if (!frm.doc.set_posting_time) {
|
||||
frm.set_value("posting_time", frappe.datetime.now_time());
|
||||
}
|
||||
|
||||
frm.call({
|
||||
method: "reset_raw_materials",
|
||||
|
||||
@@ -649,6 +649,7 @@
|
||||
"label": "Raw Materials Actions"
|
||||
},
|
||||
{
|
||||
"description": "Click this button if you encounter a negative stock error for a serial or batch item. The system will fetch the available serials or batches automatically.",
|
||||
"fieldname": "reset_raw_materials_table",
|
||||
"fieldtype": "Button",
|
||||
"label": "Reset Raw Materials Table"
|
||||
@@ -678,7 +679,7 @@
|
||||
"in_create": 1,
|
||||
"is_submittable": 1,
|
||||
"links": [],
|
||||
"modified": "2024-12-06 15:24:38.384232",
|
||||
"modified": "2025-10-08 21:43:27.065640",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Subcontracting",
|
||||
"name": "Subcontracting Receipt",
|
||||
@@ -739,6 +740,7 @@
|
||||
"write": 1
|
||||
}
|
||||
],
|
||||
"row_format": "Dynamic",
|
||||
"search_fields": "status, posting_date, supplier",
|
||||
"show_name_in_global_search": 1,
|
||||
"sort_field": "creation",
|
||||
@@ -747,4 +749,4 @@
|
||||
"timeline_field": "supplier",
|
||||
"title_field": "title",
|
||||
"track_changes": 1
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user