diff --git a/invoice_az/client/employee.js b/invoice_az/client/employee.js index 915c10b..cbe0624 100644 --- a/invoice_az/client/employee.js +++ b/invoice_az/client/employee.js @@ -529,17 +529,19 @@ function show_employee_selection(listview, asan_login_name, organization_name, e const existing_count = employees.length - new_count; // Build table (e-taxes style) - let invoiceTable = '
' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + + // Таблица сотрудников — единственная прокручиваемая область. Высота привязана + // к вьюпорту (calc), чтобы модал целиком помещался в экран. Шапка «липкая». + let invoiceTable = '
' + + '
' + __('Full Name') + '' + __('FIN') + '' + __('Position') + '' + __('Salary') + '' + __('Status') + '' + __('Begin Date') + '' + __('In System') + '
' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + ''; employees.forEach(function(emp, idx) { @@ -563,9 +565,19 @@ function show_employee_selection(listview, asan_login_name, organization_name, e invoiceTable += '
' + __('Full Name') + '' + __('FIN') + '' + __('Position') + '' + __('Salary') + '' + __('Status') + '' + __('Begin Date') + '' + __('In System') + '
'; - const infoMessage = '
' + - __('Employees found: ') + employees.length + - ' (' + __('New') + ': ' + new_count + ', ' + __('Already in system') + ': ' + existing_count + ')' + + // Компактная шапка: счётчик сотрудников слева + организация справа в одну + // строку. Заменяет alert со счётчиком и убирает пустые Section Break-лейблы. + const headerHtml = + '
' + + '' + + __('Employees found: ') + '' + employees.length + '' + + ' (' + __('New') + ': ' + new_count + ', ' + __('Already in system') + ': ' + existing_count + ')' + + '' + + (organization_name + ? '' + + __('Organization: ') + '' + frappe.utils.escape_html(organization_name) + '' + + '' + : '') + '
'; const default_company = frappe.defaults.get_user_default('Company') || frappe.defaults.get_global_default('company'); @@ -575,9 +587,9 @@ function show_employee_selection(listview, asan_login_name, organization_name, e size: 'large', fields: [ { - fieldname: 'settings_section', - fieldtype: 'Section Break', - label: __('Settings') + fieldname: 'header_html', + fieldtype: 'HTML', + options: headerHtml }, { fieldname: 'create_designation', @@ -585,16 +597,6 @@ function show_employee_selection(listview, asan_login_name, organization_name, e label: __('Create Designation if not found'), default: 1 }, - { - fieldname: 'employees_section', - fieldtype: 'Section Break', - label: __('Employees') - }, - { - fieldname: 'info_html', - fieldtype: 'HTML', - options: infoMessage - }, { fieldname: 'employees_html', fieldtype: 'HTML', diff --git a/invoice_az/client/journal_entry.js b/invoice_az/client/journal_entry.js index 663897c..ab94c45 100644 --- a/invoice_az/client/journal_entry.js +++ b/invoice_az/client/journal_entry.js @@ -1142,17 +1142,21 @@ VATETaxes.import = { // Показать диалог выбора операций showOperationSelection: function(operations, token, company, createAsDraft = 0) { VATETaxes.dialogs.hide(); - let operationTable = '
'; - operationTable += '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + + // Таблица операций — единственная прокручиваемая область. Высота привязана к + // вьюпорту (calc), чтобы модал целиком помещался в экран без внешнего скролла. + // Шапка таблицы «липкая» (sticky), чтобы заголовки колонок оставались видны + // при прокрутке списка. + let operationTable = '
' + __('Date') + '' + __('TIN') + '' + __('Name') + '' + __('Operation Type') + '' + __('Classification Code') + '' + __('Explanation') + '' + __('Income') + '' + __('Expense') + '
'; + operationTable += '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + ''; operations.forEach(function(operation) { @@ -1188,23 +1192,27 @@ VATETaxes.import = { operationTable += '
' + __('Date') + '' + __('TIN') + '' + __('Name') + '' + __('Operation Type') + '' + __('Classification Code') + '' + __('Explanation') + '' + __('Income') + '' + __('Expense') + '
'; - const infoMessage = '
' + - __('New VAT operations found: ') + operations.length + - '
'; + // Компактная шапка: количество операций + компания в одной строке. + // Заменяет два отдельных alert'а (верхний со счётчиком и нижний с компанией, + // который раньше уезжал под таблицу и требовал скролла). + const headerHtml = + '
' + + '' + + __('New VAT operations found: ') + '' + operations.length + '' + + '' + + '' + + __('Company: ') + '' + frappe.utils.escape_html(company) + '' + + '' + + '
'; const d = new frappe.ui.Dialog({ title: __('Select VAT Operations'), size: 'large', fields: [ { - fieldname: 'info_html', + fieldname: 'header_html', fieldtype: 'HTML', - options: infoMessage - }, - { - fieldname: 'settings_section', - fieldtype: 'Section Break', - label: __('Import Settings') + options: headerHtml }, { fieldname: 'create_as_draft', @@ -1213,6 +1221,10 @@ VATETaxes.import = { default: createAsDraft, description: __('If checked, Journal Entries will be created in Draft status instead of being submitted automatically') }, + { + fieldname: 'settings_col_break', + fieldtype: 'Column Break' + }, { fieldname: 'auto_create_customers', fieldtype: 'Check', @@ -1222,19 +1234,12 @@ VATETaxes.import = { }, { fieldname: 'operations_section', - fieldtype: 'Section Break', - label: __('Operations') + fieldtype: 'Section Break' }, { fieldname: 'operations_html', fieldtype: 'HTML', options: operationTable - }, - { - fieldname: 'company_display', - fieldtype: 'HTML', - options: '
' + - __('Selected company: ') + '' + company + '
' } ], primary_action_label: __('Load Selected'), diff --git a/invoice_az/client/purchase_order.js b/invoice_az/client/purchase_order.js index b4600ea..c332e39 100644 --- a/invoice_az/client/purchase_order.js +++ b/invoice_az/client/purchase_order.js @@ -1094,13 +1094,13 @@ ETaxes.import = { // Показать диалог выбора инвойсов showInvoiceSelection: function(invoices, token, warehouse) { - let invoiceTable = '
'; - invoiceTable += '' + - '' + - '' + - '' + - '' + - '' + + let invoiceTable = '
' + __('Number') + '' + __('Date') + '' + __('Supplier') + '' + __('Amount') + '
'; + invoiceTable += '' + + '' + + '' + + '' + + '' + + '' + ''; invoices.forEach(function(invoice) { @@ -1127,10 +1127,16 @@ ETaxes.import = { invoiceTable += '
' + __('Number') + '' + __('Date') + '' + __('Supplier') + '' + __('Amount') + '
'; - const infoMessage = '
' + - __('New invoices found: ') + invoices.length + - '
'; - + const infoMessage = + '
' + + '' + + __('New invoices found: ') + '' + invoices.length + '' + + '' + + '' + + __('Selected warehouse: ') + '' + frappe.utils.escape_html(warehouse) + '' + + '' + + '
'; + const d = new frappe.ui.Dialog({ title: __('Select invoice'), size: 'large', @@ -1144,12 +1150,6 @@ ETaxes.import = { fieldname: 'invoices_html', fieldtype: 'HTML', options: invoiceTable - }, - { - fieldname: 'warehouse_display', - fieldtype: 'HTML', - options: '
' + - __('Selected warehouse: ') + '' + warehouse + '
' } ], primary_action_label: __('Load selected'), diff --git a/invoice_az/client/sales_invoice.js b/invoice_az/client/sales_invoice.js index da4db8b..3a457a4 100644 --- a/invoice_az/client/sales_invoice.js +++ b/invoice_az/client/sales_invoice.js @@ -1113,13 +1113,13 @@ ETaxes.import = { // Показать диалог выбора инвойсов showInvoiceSelection: function(invoices, token, warehouse) { - let invoiceTable = '
'; - invoiceTable += '' + - '' + - '' + - '' + - '' + - '' + + let invoiceTable = '
' + __('Number') + '' + __('Date') + '' + __('Supplier') + '' + __('Amount') + '
'; + invoiceTable += '' + + '' + + '' + + '' + + '' + + '' + ''; invoices.forEach(function(invoice) { @@ -1146,29 +1146,29 @@ ETaxes.import = { invoiceTable += '
' + __('Number') + '' + __('Date') + '' + __('Supplier') + '' + __('Amount') + '
'; - const infoMessage = '
' + - __('New invoices found: ') + invoices.length + - '
'; - + const headerHtml = + '
' + + '' + + __('New invoices found: ') + '' + invoices.length + '' + + '' + + '' + + __('Selected warehouse: ') + '' + frappe.utils.escape_html(warehouse) + '' + + '' + + '
'; + const d = new frappe.ui.Dialog({ title: __('Select invoice'), size: 'large', fields: [ { - fieldname: 'info_html', + fieldname: 'header_html', fieldtype: 'HTML', - options: infoMessage + options: headerHtml }, { fieldname: 'invoices_html', fieldtype: 'HTML', options: invoiceTable - }, - { - fieldname: 'warehouse_display', - fieldtype: 'HTML', - options: '
' + - __('Selected warehouse: ') + '' + warehouse + '
' } ], primary_action_label: __('Load selected'), diff --git a/invoice_az/client/sales_order.js b/invoice_az/client/sales_order.js index 478723d..bc9960b 100644 --- a/invoice_az/client/sales_order.js +++ b/invoice_az/client/sales_order.js @@ -1111,13 +1111,13 @@ SalesETaxes.import = { // Показать диалог выбора инвойсов showInvoiceSelection: function(invoices, token, warehouse) { SalesETaxes.dialogs.hide(); - let invoiceTable = '
'; - invoiceTable += '' + - '' + - '' + - '' + - '' + - '' + + let invoiceTable = '
' + __('Number') + '' + __('Date') + '' + __('Customer') + '' + __('Amount') + '
'; + invoiceTable += '' + + '' + + '' + + '' + + '' + + '' + ''; invoices.forEach(function(invoice) { @@ -1144,29 +1144,32 @@ SalesETaxes.import = { invoiceTable += '
' + __('Number') + '' + __('Date') + '' + __('Customer') + '' + __('Amount') + '
'; - const infoMessage = '
' + - __('Sales invoices found: ') + invoices.length + - '
'; - + // Компактная шапка: количество инвойсов + склад в одной строке. + // Заменяет два отдельных alert'а (верхний со счётчиком и нижний со складом, + // который раньше уезжал под таблицу и требовал скролла). + const headerHtml = + '
' + + '' + + __('Sales invoices found: ') + '' + invoices.length + '' + + '' + + '' + + __('Selected delivery warehouse: ') + '' + frappe.utils.escape_html(warehouse) + '' + + '' + + '
'; + const d = new frappe.ui.Dialog({ title: __('Select sales invoice'), size: 'large', fields: [ { - fieldname: 'info_html', + fieldname: 'header_html', fieldtype: 'HTML', - options: infoMessage + options: headerHtml }, { fieldname: 'invoices_html', fieldtype: 'HTML', options: invoiceTable - }, - { - fieldname: 'warehouse_display', - fieldtype: 'HTML', - options: '
' + - __('Selected delivery warehouse: ') + '' + warehouse + '
' } ], primary_action_label: __('Load selected'),