Merge branch 'develop' into unit-price-contract-2

This commit is contained in:
Marica
2025-04-28 16:15:41 +05:30
committed by GitHub
116 changed files with 76874 additions and 92108 deletions

View File

@@ -795,6 +795,10 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe
return;
}
if (item.serial_no) {
item.use_serial_batch_fields = 1
}
if (item && item.serial_no) {
if (!item.item_code) {
this.frm.trigger("item_code", cdt, cdn);
@@ -1130,13 +1134,14 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe
currency() {
// The transaction date be either transaction_date (from orders) or posting_date (from invoices)
let transaction_date = this.frm.doc.transaction_date || this.frm.doc.posting_date;
let inter_company_reference = this.frm.doc.inter_company_order_reference || this.frm.doc.inter_company_invoice_reference;
let me = this;
this.set_dynamic_labels();
let company_currency = this.get_company_currency();
// Added `load_after_mapping` to determine if document is loading after mapping from another doc
if(this.frm.doc.currency && this.frm.doc.currency !== company_currency
&& !this.frm.doc.__onload?.load_after_mapping) {
&& (!this.frm.doc.__onload?.load_after_mapping || inter_company_reference)) {
this.get_exchange_rate(transaction_date, this.frm.doc.currency, company_currency,
function(exchange_rate) {
@@ -1357,13 +1362,6 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe
}
}
batch_no(doc, cdt, cdn) {
let item = frappe.get_doc(cdt, cdn);
if (!this.is_a_mapped_document(item)) {
this.apply_price_list(item, true);
}
}
toggle_conversion_factor(item) {
// toggle read only property for conversion factor field if the uom and stock uom are same
if(this.frm.get_field('items').grid.fields_map.conversion_factor) {
@@ -1589,7 +1587,12 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe
batch_no(frm, cdt, cdn) {
let row = locals[cdt][cdn];
if (row.use_serial_batch_fields && row.batch_no) {
if (row.batch_no) {
row.use_serial_batch_fields = 1
}
if (row.batch_no) {
var params = this._get_args(row);
params.batch_no = row.batch_no;
params.uom = row.uom;