mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-13 10:11:20 +00:00
refactor: introduce fields in popup
(cherry picked from commit 5323bb7bee)
# Conflicts:
# erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.js
This commit is contained in:
@@ -254,6 +254,7 @@ erpnext.accounts.PaymentReconciliationController = class PaymentReconciliationCo
|
|||||||
this.data = [];
|
this.data = [];
|
||||||
const dialog = new frappe.ui.Dialog({
|
const dialog = new frappe.ui.Dialog({
|
||||||
title: __("Select Difference Account"),
|
title: __("Select Difference Account"),
|
||||||
|
size: 'extra-large',
|
||||||
fields: [
|
fields: [
|
||||||
{
|
{
|
||||||
fieldname: "allocation",
|
fieldname: "allocation",
|
||||||
@@ -265,6 +266,7 @@ erpnext.accounts.PaymentReconciliationController = class PaymentReconciliationCo
|
|||||||
get_data: () => {
|
get_data: () => {
|
||||||
return this.data;
|
return this.data;
|
||||||
},
|
},
|
||||||
|
<<<<<<< HEAD
|
||||||
fields: [
|
fields: [
|
||||||
{
|
{
|
||||||
fieldtype: "Data",
|
fieldtype: "Data",
|
||||||
@@ -303,6 +305,48 @@ erpnext.accounts.PaymentReconciliationController = class PaymentReconciliationCo
|
|||||||
read_only: 1,
|
read_only: 1,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
=======
|
||||||
|
fields: [{
|
||||||
|
fieldtype:'Data',
|
||||||
|
fieldname:"docname",
|
||||||
|
in_list_view: 1,
|
||||||
|
hidden: 1
|
||||||
|
}, {
|
||||||
|
fieldtype:'Data',
|
||||||
|
fieldname:"reference_name",
|
||||||
|
label: __("Voucher No"),
|
||||||
|
in_list_view: 1,
|
||||||
|
read_only: 1
|
||||||
|
}, {
|
||||||
|
fieldtype:'Date',
|
||||||
|
fieldname:"gain_loss_posting_date",
|
||||||
|
label: __("Posting Date"),
|
||||||
|
in_list_view: 1,
|
||||||
|
reqd: 1,
|
||||||
|
}, {
|
||||||
|
|
||||||
|
fieldtype:'Link',
|
||||||
|
options: 'Account',
|
||||||
|
in_list_view: 1,
|
||||||
|
label: __("Difference Account"),
|
||||||
|
fieldname: 'difference_account',
|
||||||
|
reqd: 1,
|
||||||
|
get_query: () => {
|
||||||
|
return {
|
||||||
|
filters: {
|
||||||
|
company: this.frm.doc.company,
|
||||||
|
is_group: 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
fieldtype:'Currency',
|
||||||
|
in_list_view: 1,
|
||||||
|
label: __("Difference Amount"),
|
||||||
|
fieldname: 'difference_amount',
|
||||||
|
read_only: 1
|
||||||
|
}]
|
||||||
|
>>>>>>> 5323bb7bee (refactor: introduce fields in popup)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
fieldtype: "HTML",
|
fieldtype: "HTML",
|
||||||
@@ -312,6 +356,7 @@ erpnext.accounts.PaymentReconciliationController = class PaymentReconciliationCo
|
|||||||
primary_action: () => {
|
primary_action: () => {
|
||||||
const args = dialog.get_values()["allocation"];
|
const args = dialog.get_values()["allocation"];
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
args.forEach((d) => {
|
args.forEach((d) => {
|
||||||
frappe.model.set_value(
|
frappe.model.set_value(
|
||||||
"Payment Reconciliation Allocation",
|
"Payment Reconciliation Allocation",
|
||||||
@@ -319,6 +364,12 @@ erpnext.accounts.PaymentReconciliationController = class PaymentReconciliationCo
|
|||||||
"difference_account",
|
"difference_account",
|
||||||
d.difference_account
|
d.difference_account
|
||||||
);
|
);
|
||||||
|
=======
|
||||||
|
args.forEach(d => {
|
||||||
|
frappe.model.set_value("Payment Reconciliation Allocation", d.docname,
|
||||||
|
"difference_account", d.difference_account);
|
||||||
|
|
||||||
|
>>>>>>> 5323bb7bee (refactor: introduce fields in popup)
|
||||||
});
|
});
|
||||||
|
|
||||||
this.reconcile_payment_entries();
|
this.reconcile_payment_entries();
|
||||||
@@ -330,10 +381,18 @@ erpnext.accounts.PaymentReconciliationController = class PaymentReconciliationCo
|
|||||||
this.frm.doc.allocation.forEach((d) => {
|
this.frm.doc.allocation.forEach((d) => {
|
||||||
if (d.difference_amount) {
|
if (d.difference_amount) {
|
||||||
dialog.fields_dict.allocation.df.data.push({
|
dialog.fields_dict.allocation.df.data.push({
|
||||||
|
<<<<<<< HEAD
|
||||||
docname: d.name,
|
docname: d.name,
|
||||||
reference_name: d.reference_name,
|
reference_name: d.reference_name,
|
||||||
difference_amount: d.difference_amount,
|
difference_amount: d.difference_amount,
|
||||||
difference_account: d.difference_account,
|
difference_account: d.difference_account,
|
||||||
|
=======
|
||||||
|
'docname': d.name,
|
||||||
|
'reference_name': d.reference_name,
|
||||||
|
'difference_amount': d.difference_amount,
|
||||||
|
'difference_account': d.difference_account,
|
||||||
|
'gain_loss_posting_date': d.gain_loss_posting_date
|
||||||
|
>>>>>>> 5323bb7bee (refactor: introduce fields in popup)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user