mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-24 15:39:20 +00:00
Merge branch 'develop' of github.com:aerele/erpnext into pricing_rule
This commit is contained in:
@@ -117,14 +117,17 @@ erpnext.financial_statements = {
|
||||
erpnext.financial_statements.filters = get_filters();
|
||||
|
||||
let fiscal_year = erpnext.utils.get_fiscal_year(frappe.datetime.get_today());
|
||||
var filters = report.get_values();
|
||||
|
||||
frappe.model.with_doc("Fiscal Year", fiscal_year, function (r) {
|
||||
var fy = frappe.model.get_doc("Fiscal Year", fiscal_year);
|
||||
frappe.query_report.set_filter_value({
|
||||
period_start_date: fy.year_start_date,
|
||||
period_end_date: fy.year_end_date,
|
||||
if (!filters.period_start_date || !filters.period_end_date) {
|
||||
frappe.model.with_doc("Fiscal Year", fiscal_year, function (r) {
|
||||
var fy = frappe.model.get_doc("Fiscal Year", fiscal_year);
|
||||
frappe.query_report.set_filter_value({
|
||||
period_start_date: fy.year_start_date,
|
||||
period_end_date: fy.year_end_date,
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
if (report.page) {
|
||||
const views_menu = report.page.add_custom_button_group(__("Financial Statements"));
|
||||
|
||||
@@ -20,7 +20,11 @@ $.extend(erpnext, {
|
||||
},
|
||||
|
||||
toggle_naming_series: function () {
|
||||
if (cur_frm && cur_frm.fields_dict.naming_series) {
|
||||
if (
|
||||
cur_frm &&
|
||||
cur_frm.fields_dict.naming_series &&
|
||||
cur_frm.meta.naming_rule == 'By "Naming Series" field'
|
||||
) {
|
||||
cur_frm.toggle_display("naming_series", cur_frm.doc.__islocal ? true : false);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -368,8 +368,28 @@ erpnext.SerialBatchPackageSelector = class SerialNoBatchBundleUpdate {
|
||||
];
|
||||
}
|
||||
|
||||
get_batch_qty(batch_no, callback) {
|
||||
let warehouse = this.item.s_warehouse || this.item.t_warehouse || this.item.warehouse;
|
||||
frappe.call({
|
||||
method: "erpnext.stock.doctype.batch.batch.get_batch_qty",
|
||||
args: {
|
||||
batch_no: batch_no,
|
||||
warehouse: warehouse,
|
||||
item_code: this.item.item_code,
|
||||
posting_date: this.frm.doc.posting_date,
|
||||
posting_time: this.frm.doc.posting_time,
|
||||
},
|
||||
callback: (r) => {
|
||||
if (r.message) {
|
||||
callback(flt(r.message));
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
get_dialog_table_fields() {
|
||||
let fields = [];
|
||||
let me = this;
|
||||
|
||||
if (this.item.has_serial_no) {
|
||||
fields.push({
|
||||
@@ -395,6 +415,15 @@ erpnext.SerialBatchPackageSelector = class SerialNoBatchBundleUpdate {
|
||||
fieldname: "batch_no",
|
||||
label: __("Batch No"),
|
||||
in_list_view: 1,
|
||||
change() {
|
||||
let doc = this.doc;
|
||||
if (!doc.qty && me.item.type_of_transaction === "Outward") {
|
||||
me.get_batch_qty(doc.batch_no, (qty) => {
|
||||
doc.qty = qty;
|
||||
this.grid.set_value("qty", qty, doc);
|
||||
});
|
||||
}
|
||||
},
|
||||
get_query: () => {
|
||||
let is_inward = false;
|
||||
if (
|
||||
|
||||
Reference in New Issue
Block a user