chore(payment-entry): drop legacy payment_entry_mod.js; rename boot patch entry
Remove the unused Payment Entry doctype_js (payment_entry_mod.js) and its hook. Rename the boot_session entrypoint to apply_vat_boot_patches and drop the obsolete party_account_types injection. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
0f7a86ff2b
commit
41ebed0c79
|
|
@ -1,18 +1,10 @@
|
|||
import frappe
|
||||
|
||||
def add_company_to_party_account_types(bootinfo):
|
||||
|
||||
def apply_vat_boot_patches(bootinfo):
|
||||
# Применяем VAT monkey patches при загрузке сессии
|
||||
try:
|
||||
from jey_erp.custom.vat_calculations import patch_sales_documents
|
||||
patch_sales_documents()
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
# Проверяем, существует ли объект party_account_types в bootinfo
|
||||
if "party_account_types" in bootinfo:
|
||||
# Если "Company" еще нет в списке, добавляем его
|
||||
if "Company" not in bootinfo["party_account_types"]:
|
||||
bootinfo["party_account_types"]["Company"] = "Company"
|
||||
else:
|
||||
# Инициализируем party_account_types, если его нет
|
||||
bootinfo["party_account_types"] = {"Company": "Company"}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ app_email = "info@jeyerp.az"
|
|||
app_license = "unlicense"
|
||||
# required_apps = []
|
||||
|
||||
boot_session = "jey_erp.extend_party_types.add_company_to_party_account_types"
|
||||
boot_session = "jey_erp.extend_party_types.apply_vat_boot_patches"
|
||||
|
||||
app_include_js = [
|
||||
"/assets/jey_erp/js/vat_calculator.js",
|
||||
|
|
@ -25,7 +25,6 @@ app_include_css = [
|
|||
]
|
||||
|
||||
doctype_js = {
|
||||
"Payment Entry": "/public/js/payment_entry_mod.js",
|
||||
"Sales Invoice": "public/js/sales_invoice.js",
|
||||
"Employee": "public/js/employee.js",
|
||||
"Bank Reconciliation Tool": "public/js/bank_reconciliation_tool.js",
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ msgstr ""
|
|||
"Project-Id-Version: Jey Erp VERSION\n"
|
||||
"Report-Msgid-Bugs-To: info@jeyerp.az\n"
|
||||
"POT-Creation-Date: 2026-04-24 17:20+0000\n"
|
||||
"PO-Revision-Date: 2026-04-24 17:26+0000\n"
|
||||
"PO-Revision-Date: 2026-06-02 21:50+0000\n"
|
||||
"Last-Translator: <jeyerp@jeycloud.az>\n"
|
||||
"Language-Team: Azerbaijani\n"
|
||||
"Language: az\n"
|
||||
|
|
@ -17,6 +17,7 @@ msgstr ""
|
|||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"Generated-By: Babel 2.16.0\n"
|
||||
"X-Generator: Poedit 3.4.2\n"
|
||||
|
||||
#. AI-generated
|
||||
#: jey_erp/public/js/employee.js:32 jey_erp/public/js/employee.js:38
|
||||
|
|
@ -156,7 +157,7 @@ msgstr "Hesablar Planını İxrac Et"
|
|||
#: jey_erp/public/js/company_form.js:3 jey_erp/public/js/leave_type_list.js:3
|
||||
#: jey_erp/public/js/salary_component_list.js:3
|
||||
msgid "Export Defaults"
|
||||
msgstr "İxrac Defolt Dəyərləri"
|
||||
msgstr "Standart Tənzimləmələri ixrac et"
|
||||
|
||||
#. AI-generated
|
||||
#: jey_erp/public/js/currency_exchange_list.js:73
|
||||
|
|
@ -232,7 +233,7 @@ msgstr "Qrupdur"
|
|||
#. AI-generated
|
||||
#: jey_erp/jey_erp/doctype/item_category/item_category.json
|
||||
msgid "Item Category"
|
||||
msgstr "Maddə Kateqoriyası"
|
||||
msgstr "Element Kateqoriyası"
|
||||
|
||||
#. Name of a role
|
||||
#. AI-generated
|
||||
|
|
|
|||
|
|
@ -1,105 +0,0 @@
|
|||
frappe.ui.form.on('Payment Entry', {
|
||||
onload: function(frm) {
|
||||
// Изменяем фильтр для поля Party Type, добавляя "Company"
|
||||
frm.set_query("party_type", function () {
|
||||
return {
|
||||
filters: {
|
||||
name: ["in", Object.keys(frappe.boot.party_account_types).concat("Company")]
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
// Фильтр для поля "Party Bank Account" в зависимости от типа Party Type
|
||||
frm.set_query("party_bank_account", function() {
|
||||
if (frm.doc.party_type === "Company") {
|
||||
// Если Party Type = Company, применяем фильтр Is Company Account = Yes
|
||||
return {
|
||||
filters: {
|
||||
is_company_account: 1, // 1 означает "Yes"
|
||||
company: frm.doc.company
|
||||
}
|
||||
};
|
||||
} else {
|
||||
// Оригинальный фильтр для других типов Party Type
|
||||
return {
|
||||
filters: {
|
||||
is_company_account: 0, // 0 означает "No"
|
||||
party_type: frm.doc.party_type,
|
||||
party: frm.doc.party
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
// Фильтр для поля "Account Paid To" только если Party Type = Company
|
||||
frm.set_query("paid_to", function() {
|
||||
if (frm.doc.party_type === "Company") {
|
||||
// Устанавливаем фильтр для "Account Type in Cash, Bank" только если Party Type = Company
|
||||
return {
|
||||
filters: {
|
||||
account_type: ["in", ["Bank", "Cash"]],
|
||||
is_group: 0, // 0 означает "No"
|
||||
company: frm.doc.company // Фильтрация по компании
|
||||
}
|
||||
};
|
||||
} else {
|
||||
// В других случаях оставляем стандартный фильтр или пустой фильтр
|
||||
return {};
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// // Переопределение received_amount
|
||||
// received_amount: function (frm) {
|
||||
// if (frm.set_paid_amount_based_on_received_amount) return;
|
||||
|
||||
// const company_currency = frappe.get_doc(":Company", frm.doc.company).default_currency;
|
||||
// const from_currency = frm.doc.paid_from_account_currency;
|
||||
// const to_currency = frm.doc.paid_to_account_currency;
|
||||
|
||||
// const from_rate = frm.doc.source_exchange_rate || 1;
|
||||
// const to_rate = frm.doc.target_exchange_rate || 1;
|
||||
|
||||
// const cross_rate = from_currency === to_currency ? 1 : from_rate / to_rate;
|
||||
|
||||
// frm.set_paid_amount_based_on_received_amount = true;
|
||||
// frm.set_value(
|
||||
// "paid_amount",
|
||||
// flt(frm.doc.received_amount / cross_rate, precision("paid_amount"))
|
||||
// );
|
||||
// frm.set_paid_amount_based_on_received_amount = false;
|
||||
|
||||
// frm.set_value("base_received_amount", flt(frm.doc.received_amount * to_rate));
|
||||
// frm.events.hide_unhide_fields(frm);
|
||||
// frm.trigger("set_difference_amount");
|
||||
// },
|
||||
|
||||
// // Переопределение paid_amount
|
||||
// paid_amount: function (frm) {
|
||||
// if (frm.set_paid_amount_based_on_received_amount) return;
|
||||
|
||||
// const company_currency = frappe.get_doc(":Company", frm.doc.company).default_currency;
|
||||
// const from_currency = frm.doc.paid_from_account_currency;
|
||||
// const to_currency = frm.doc.paid_to_account_currency;
|
||||
|
||||
// // Получаем курсы валют относительно базовой валюты компании
|
||||
// const from_rate = frm.doc.source_exchange_rate || 1;
|
||||
// const to_rate = frm.doc.target_exchange_rate || 1;
|
||||
|
||||
// // Рассчитываем кросс-курс между валютами списания и зачисления
|
||||
// const cross_rate = from_currency === to_currency ? 1 : from_rate / to_rate;
|
||||
|
||||
// // Обновляем Received Amount
|
||||
// frm.set_paid_amount_based_on_received_amount = true;
|
||||
// frm.set_value(
|
||||
// "received_amount",
|
||||
// flt(frm.doc.paid_amount * cross_rate, precision("received_amount"))
|
||||
// );
|
||||
// frm.set_paid_amount_based_on_received_amount = false;
|
||||
|
||||
// // Обновляем base_paid_amount (в базовой валюте компании)
|
||||
// frm.set_value("base_paid_amount", flt(frm.doc.paid_amount * from_rate));
|
||||
// frm.events.hide_unhide_fields(frm);
|
||||
// frm.trigger("set_difference_amount");
|
||||
// }
|
||||
});
|
||||
Loading…
Reference in New Issue