From a97574b881103cc09a48152a4f29f8a2cc1c38a3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Tue, 19 Dec 2017 15:33:15 +0100 Subject: [PATCH] Presenter: Neue Struktur in den restlichen Bereichen umgesetzt --- SL/Controller/BankTransaction.pm | 1 - SL/Controller/Inventory.pm | 16 +++----- SL/Controller/Letter.pm | 3 +- SL/Controller/Project.pm | 2 +- SL/Controller/RecordLinks.pm | 3 +- SL/Controller/ShopOrder.pm | 1 - SL/Controller/YearEndTransactions.pm | 6 ++- bin/mozilla/wh.pl | 9 +++-- templates/webpages/amcvar/render_inputs.html | 7 ++-- .../webpages/amcvar/render_inputs_block.html | 7 ++-- .../webpages/bank_transactions/_problems.html | 2 +- templates/webpages/buchungsgruppen/form.html | 14 +++---- templates/webpages/chart/test_page.html | 37 ++++++++++--------- .../client_config/_default_accounts.html | 22 +++++------ .../webpages/client_config/_features.html | 4 +- .../common/render_cvar_filter_input.html | 8 ++-- .../webpages/common/render_cvar_input.html | 7 ++-- templates/webpages/cp/form_header.html | 2 +- .../webpages/csv_import/_form_parts.html | 2 +- .../webpages/customer_vendor/test_page.html | 10 ++--- .../inventory/warehouse_selection_stock.html | 3 +- templates/webpages/letter/edit.html | 4 +- templates/webpages/letter/search.html | 5 ++- templates/webpages/price_rule/_filter.html | 7 ++-- templates/webpages/price_rule/item.html | 7 ++-- templates/webpages/project/_basic_data.html | 2 +- .../webpages/project/_linked_records.html | 2 +- templates/webpages/project/test_page.html | 5 ++- templates/webpages/record_links/add_list.html | 2 +- templates/webpages/rp/report.html | 5 ++- .../_bank_account_form.html | 4 +- templates/webpages/taxzones/form.html | 10 ++--- templates/webpages/vk/search_invoice.html | 2 +- templates/webpages/wh/journal_filter.html | 2 +- templates/webpages/wh/report_filter.html | 2 +- .../webpages/wh/warehouse_selection.html | 2 +- .../wh/warehouse_selection_assembly.html | 2 +- 37 files changed, 119 insertions(+), 110 deletions(-) diff --git a/SL/Controller/BankTransaction.pm b/SL/Controller/BankTransaction.pm index 7f896461b..692fb701b 100644 --- a/SL/Controller/BankTransaction.pm +++ b/SL/Controller/BankTransaction.pm @@ -25,7 +25,6 @@ use SL::DB::BankAccount; use SL::DB::RecordTemplate; use SL::DB::SepaExportItem; use SL::DBUtils qw(like); -use SL::Presenter; use List::MoreUtils qw(any); use List::Util qw(max); diff --git a/SL/Controller/Inventory.pm b/SL/Controller/Inventory.pm index a95efaddb..866c15353 100644 --- a/SL/Controller/Inventory.pm +++ b/SL/Controller/Inventory.pm @@ -13,7 +13,7 @@ use SL::DB::Unit; use SL::WH; use SL::ReportGenerator; use SL::Locale::String qw(t8); -use SL::Presenter; +use SL::Presenter::Tag qw(select_tag); use SL::DBUtils; use SL::Helper::Flash; use SL::Controller::Helper::ReportGenerator; @@ -21,7 +21,7 @@ use SL::Controller::Helper::ReportGenerator; use English qw(-no_match_vars); use Rose::Object::MakeMethods::Generic ( - 'scalar --get_set_init' => [ qw(warehouses units p) ], + 'scalar --get_set_init' => [ qw(warehouses units) ], 'scalar' => [ qw(warehouse bin unit part) ], ); @@ -505,10 +505,6 @@ sub init_units { SL::DB::Manager::Unit->get_all; } -sub init_p { - SL::Presenter->get; -} - sub set_target_from_part { my ($self) = @_; @@ -554,7 +550,7 @@ sub set_layout { } sub build_warehouse_select { - $_[0]->p->select_tag('warehouse_id', $_[0]->warehouses, + select_tag('warehouse_id', $_[0]->warehouses, title_key => 'description', default => $_[0]->warehouse->id, onchange => 'reload_bin_selection()', @@ -562,7 +558,7 @@ sub build_warehouse_select { } sub build_bin_select { - $_[0]->p->select_tag('bin_id', [ $_[0]->warehouse->bins ], + select_tag('bin_id', [ $_[0]->warehouse->bins ], title_key => 'description', default => $_[0]->bin->id, ); @@ -570,11 +566,11 @@ sub build_bin_select { sub build_unit_select { $_[0]->part->id - ? $_[0]->p->select_tag('unit_id', $_[0]->part->available_units, + ? select_tag('unit_id', $_[0]->part->available_units, title_key => 'name', default => $_[0]->part->unit_obj->id, ) - : $_[0]->p->select_tag('unit_id', $_[0]->units, + : select_tag('unit_id', $_[0]->units, title_key => 'name', ) } diff --git a/SL/Controller/Letter.pm b/SL/Controller/Letter.pm index 780d7f99a..4cc5b5573 100644 --- a/SL/Controller/Letter.pm +++ b/SL/Controller/Letter.pm @@ -20,6 +20,7 @@ use SL::Helper::PrintOptions; use SL::Locale::String qw(t8); use SL::Mailer; use SL::IS; +use SL::Presenter::Tag qw(select_tag); use SL::ReportGenerator; use SL::Webdav; use SL::Webdav::File; @@ -124,7 +125,7 @@ sub action_update_contacts { $self->js ->replaceWith( '#letter_cp_id', - SL::Presenter->get->select_tag('letter.cp_id', $contacts, default => $default, value_key => 'cp_id', title_key => 'full_name') + select_tag('letter.cp_id', $contacts, default => $default, value_key => 'cp_id', title_key => 'full_name') ) ->render; } diff --git a/SL/Controller/Project.pm b/SL/Controller/Project.pm index 59e1034b8..601b245b7 100644 --- a/SL/Controller/Project.pm +++ b/SL/Controller/Project.pm @@ -297,7 +297,7 @@ sub prepare_report { project_type => { sub => sub { $_[0]->project_type->description } }, project_status => { sub => sub { $_[0]->project_status->description }, text => t8('Status') }, customer => { sub => sub { !$_[0]->customer_id ? '' : $_[0]->customer->name }, - raw_data => sub { !$_[0]->customer_id ? '' : $self->presenter->customer($_[0]->customer, display => 'table-cell', callback => $callback) } }, + raw_data => sub { !$_[0]->customer_id ? '' : $_[0]->customer->presenter->customer(display => 'table-cell', callback => $callback) } }, active => { sub => sub { $_[0]->active ? $::locale->text('Active') : $::locale->text('Inactive') }, text => $::locale->text('Active') }, valid => { sub => sub { $_[0]->valid ? $::locale->text('Valid') : $::locale->text('Invalid') }, diff --git a/SL/Controller/RecordLinks.pm b/SL/Controller/RecordLinks.pm index 660909b04..29921c6d3 100644 --- a/SL/Controller/RecordLinks.pm +++ b/SL/Controller/RecordLinks.pm @@ -18,6 +18,7 @@ use SL::DBUtils qw(like); use SL::DB::ShopOrder; use SL::JSON; use SL::Locale::String; +use SL::Presenter::Record qw(grouped_record_list); use Rose::Object::MakeMethods::Generic ( @@ -63,7 +64,7 @@ sub action_ajax_list { my $linked_records = $self->object->linked_records(direction => 'both', recursive => 1, save_path => 1); push @{ $linked_records }, $self->object->sepa_export_items if $self->object->can('sepa_export_items'); - my $output = SL::Presenter->get->grouped_record_list( + my $output = grouped_record_list( $linked_records, with_columns => [ qw(record_link_direction) ], edit_record_links => 1, diff --git a/SL/Controller/ShopOrder.pm b/SL/Controller/ShopOrder.pm index e8d804f27..f88a853bd 100644 --- a/SL/Controller/ShopOrder.pm +++ b/SL/Controller/ShopOrder.pm @@ -12,7 +12,6 @@ use SL::DB::Shop; use SL::DB::History; use SL::DBUtils; use SL::Shop; -use SL::Presenter; use SL::Helper::Flash; use SL::Locale::String; use SL::Controller::Helper::ParseFilter; diff --git a/SL/Controller/YearEndTransactions.pm b/SL/Controller/YearEndTransactions.pm index cab851556..a81fa3bbc 100644 --- a/SL/Controller/YearEndTransactions.pm +++ b/SL/Controller/YearEndTransactions.pm @@ -15,6 +15,8 @@ use SL::DB::GLTransaction; use SL::DB::AccTransaction; use SL::DB::Helper::AccountingPeriod qw(get_balance_starting_date); +use SL::Presenter::Tag qw(checkbox_tag); + use Rose::Object::MakeMethods::Generic ( 'scalar --get_set_init' => [ qw(charts charts9000 cbob_chart cb_date cb_startdate ob_date cb_reference ob_reference cb_description ob_description) ], ); @@ -110,7 +112,7 @@ sub prepare_report { my $idx = 1; my %column_defs = ( - 'ids' => { raw_header_data => $self->presenter->checkbox_tag("", id => "check_all", + 'ids' => { raw_header_data => checkbox_tag("", id => "check_all", checkall => "[data-checkall=1]"), 'align' => 'center' }, 'chart' => { text => $::locale->text('Account'), }, 'description' => { text => $::locale->text('Description'), }, @@ -152,7 +154,7 @@ sub prepare_report { my $chart_id = $chart->id; my $row = { map { $_ => { 'data' => '' } } @columns }; $row->{ids} = { - 'raw_data' => $self->presenter->checkbox_tag("multi_id_${idx}", value => $chart_id, "data-checkall" => 1), + 'raw_data' => checkbox_tag("multi_id_${idx}", value => $chart_id, "data-checkall" => 1), 'valign' => 'center', 'align' => 'center', }; diff --git a/bin/mozilla/wh.pl b/bin/mozilla/wh.pl index a729e3738..6d74a6734 100644 --- a/bin/mozilla/wh.pl +++ b/bin/mozilla/wh.pl @@ -45,6 +45,7 @@ use SL::WH; use SL::OE; use SL::Locale::String qw(t8); use SL::ReportGenerator; +use SL::Presenter::Part; use SL::DB::Part; @@ -700,8 +701,8 @@ sub generate_journal { my $idx = 0; foreach my $entry (@contents) { - $entry->{type_and_classific} = $::request->presenter->type_abbreviation($entry->{part_type}). - $::request->presenter->classification_abbreviation($entry->{classification_id}); + $entry->{type_and_classific} = SL::Presenter::Part::type_abbreviation($entry->{part_type}) . + SL::Presenter::Part::classification_abbreviation($entry->{classification_id}); $entry->{qty} = $form->format_amount(\%myconfig, $entry->{qty}); $entry->{trans_type} = $locale->text($entry->{trans_type}); @@ -915,8 +916,8 @@ sub generate_report { foreach my $entry (@contents) { - $entry->{type_and_classific} = $::request->presenter->type_abbreviation($entry->{part_type}). - $::request->presenter->classification_abbreviation($entry->{classification_id}); + $entry->{type_and_classific} = SL::Presenter::Part::type_abbreviation($entry->{part_type}). + SL::Presenter::Part::classification_abbreviation($entry->{classification_id}); map { $subtotals{$_} += $entry->{$_} } @subtotals_columns; $total_stock_value += $entry->{stock_value} * 1; $entry->{qty} = $form->format_amount(\%myconfig, $entry->{qty}); diff --git a/templates/webpages/amcvar/render_inputs.html b/templates/webpages/amcvar/render_inputs.html index a2f39ac62..880106a99 100644 --- a/templates/webpages/amcvar/render_inputs.html +++ b/templates/webpages/amcvar/render_inputs.html @@ -1,6 +1,7 @@ [%- USE T8 %] [%- USE HTML %] [%- USE L %] +[%- USE P %] [%- SET var_name = HTML.escape(name_prefix) _ "cvar_" _ HTML.escape(var.name) _ HTML.escape(name_postfix) -%] @@ -25,13 +26,13 @@ [%- ELSIF var.type == 'customer' %] -[% L.customer_vendor_picker(var_name, var.value, type='customer') %] +[% P.customer_vendor.picker(var_name, var.value, type='customer') %] [%- ELSIF var.type == 'vendor' %] -[% L.customer_vendor_picker(var_name, var.value, type='vendor') %] +[% P.customer_vendor.picker(var_name, var.value, type='vendor') %] [%- ELSIF var.type == 'part' %] -[% L.part_picker(var_name, var.value) %] +[% P.part.picker(var_name, var.value) %] [%- ELSIF var.type == 'select' %] diff --git a/templates/webpages/amcvar/render_inputs_block.html b/templates/webpages/amcvar/render_inputs_block.html index 8f0b20f3e..73731625a 100644 --- a/templates/webpages/amcvar/render_inputs_block.html +++ b/templates/webpages/amcvar/render_inputs_block.html @@ -1,6 +1,7 @@ [%- USE T8 %] [%- USE HTML %] [%- USE L %] +[%- USE P %] [%- USE LxERP %][%- USE P -%] [%- BLOCK cvar_inputs %] [%- SET render_cvar_tag_options = {}; @@ -56,14 +57,14 @@ [%- ELSIF cvar.var.type == 'customer' %] [%- render_cvar_tag_options.type = 'customer' %] -[%- L.customer_vendor_picker(cvar_tag_name, cvar.value, render_cvar_tag_options) %] +[%- P.customer_vendor.picker(cvar_tag_name, cvar.value, render_cvar_tag_options) %] [%- ELSIF cvar.var.type == 'vendor' %] [%- render_cvar_tag_options.type = 'vendor' %] -[%- L.customer_vendor_picker(cvar_tag_name, cvar.value, render_cvar_tag_options) %] +[%- P.customer_vendor.picker(cvar_tag_name, cvar.value, render_cvar_tag_options) %] [%- ELSIF cvar.var.type == 'part' %] -[% L.part_picker(cvar_tag_name, cvar.value, render_cvar_tag_options) %] +[% P.part.picker(cvar_tag_name, cvar.value, render_cvar_tag_options) %] [%- ELSIF cvar.var.type == 'number' %] [%- L.input_tag(cvar_tag_name, LxERP.format_amount(cvar.value, -2), render_cvar_tag_options) %] diff --git a/templates/webpages/bank_transactions/_problems.html b/templates/webpages/bank_transactions/_problems.html index 9a10fca92..e2796d5c0 100644 --- a/templates/webpages/bank_transactions/_problems.html +++ b/templates/webpages/bank_transactions/_problems.html @@ -29,7 +29,7 @@ [% IF problem.result == 'error' %][% LxERP.t8("Error") %][% ELSE %][% LxERP.t8("Warning") %][% END %] [% FOREACH invoice = problem.invoices %] - [% P.invoice(invoice) %] + [% invoice.presenter.invoice %] [% UNLESS loop.last %]
[% END %] [% END %] diff --git a/templates/webpages/buchungsgruppen/form.html b/templates/webpages/buchungsgruppen/form.html index 05b5e1a47..d068a0796 100644 --- a/templates/webpages/buchungsgruppen/form.html +++ b/templates/webpages/buchungsgruppen/form.html @@ -1,4 +1,4 @@ -[%- USE HTML -%][%- USE LxERP -%][%- USE L -%][%- USE T8 -%] +[%- USE HTML -%][%- USE LxERP -%][%- USE L -%][%- USE T8 -%][%- USE P -%] [% SET style="width: 400px" %]

[% HTML.escape(title) %]

@@ -14,9 +14,9 @@ [% 'Inventory Account' | $T8 %] [%- IF NOT SELF.config.id %] - [% L.chart_picker("config.inventory_accno_id", SELF.defaults.inventory_accno_id, choose=1, type='IC', style=style) %] + [% P.chart.picker("config.inventory_accno_id", SELF.defaults.inventory_accno_id, choose=1, type='IC', style=style) %] [%- ELSIF SELF.config.id AND SELF.config.orphaned %] - [% L.chart_picker("config.inventory_accno_id", SELF.config.inventory_accno_id, choose=1, type='IC', style=style) %] + [% P.chart.picker("config.inventory_accno_id", SELF.config.inventory_accno_id, choose=1, type='IC', style=style) %] [%- ELSE %] [%- CHARTLIST.inventory_accno_description %] [%- END %] @@ -25,9 +25,9 @@ [% 'Revenue' | $T8 %] [% HTML.escape(tz.description) %] [%- IF NOT SELF.config.id %] - [% L.chart_picker('income_accno_id_' _ tz.id, SELF.defaults.income_accno_id, choose=1, type='IC_income,IC_sale', style=style) %] + [% P.chart.picker('income_accno_id_' _ tz.id, SELF.defaults.income_accno_id, choose=1, type='IC_income,IC_sale', style=style) %] [%- ELSIF SELF.config.id AND SELF.config.orphaned %] - [% L.chart_picker('income_accno_id_' _ tz.id, CHARTLIST.${tz.id}.income_accno_id, choose=1, type='IC_income,IC_sale', style=style) %] + [% P.chart.picker('income_accno_id_' _ tz.id, CHARTLIST.${tz.id}.income_accno_id, choose=1, type='IC_income,IC_sale', style=style) %] [%- ELSE %] [% CHARTLIST.${tz.id}.income_accno_description %] [%- END %] @@ -35,9 +35,9 @@ [% 'Expense' | $T8 %] [% HTML.escape(tz.description) %] [%- IF NOT SELF.config.id %] - [% L.chart_picker('expense_accno_id_' _ tz.id, SELF.defaults.expense_accno_id, choose=1, type='IC_expense,IC_cogs', style=style) %] + [% P.chart.picker('expense_accno_id_' _ tz.id, SELF.defaults.expense_accno_id, choose=1, type='IC_expense,IC_cogs', style=style) %] [%- ELSIF SELF.config.id AND SELF.config.orphaned %] - [% L.chart_picker('expense_accno_id_' _ tz.id, CHARTLIST.${tz.id}.expense_accno_id, choose=1, type='IC_expense,IC_cogs', style=style) %] + [% P.chart.picker('expense_accno_id_' _ tz.id, CHARTLIST.${tz.id}.expense_accno_id, choose=1, type='IC_expense,IC_cogs', style=style) %] [%- ELSE %] [% CHARTLIST.${tz.id}.expense_accno_description %] [%- END %] diff --git a/templates/webpages/chart/test_page.html b/templates/webpages/chart/test_page.html index 8d95591d0..721c0661b 100644 --- a/templates/webpages/chart/test_page.html +++ b/templates/webpages/chart/test_page.html @@ -1,4 +1,5 @@ [% USE L %] +[% USE P %] [% SET style="width: 400px" %]

Chart Picker Testpage

@@ -6,48 +7,48 @@

-All charts: [% L.chart_picker('chart_id', '', style=style) %]text after icon
-Only booked charts: [% L.chart_picker('chart_id_booked', '', booked=1, style=style) %]
-All charts choose: [% L.chart_picker('chart_id_choose', '', choose=1, style=style) %]
+All charts: [% P.chart.picker('chart_id', '', style=style) %]text after icon
+Only booked charts: [% P.chart.picker('chart_id_booked', '', booked=1, style=style) %]
+All charts choose: [% P.chart.picker('chart_id_choose', '', choose=1, style=style) %]

Filter by link:
-AR_paid: [% L.chart_picker('chart_id_ar_paid', undef, type='AR_paid', category='I,A' style=style) %]
-AR: [% L.chart_picker('chart_id_ar', undef, type='AR', style=style) %]
-AP: [% L.chart_picker('chart_id_ap', undef, type='AP', style=style) %]
-AR or AP: [% L.chart_picker('chart_id_arap', undef, type='AR,AP', style=style) %]
-IC_income,IC_sale: [% L.chart_picker('chart_id_icis', undef, type='IC_income,IC_sale', style=style) %]
-IC_expense,IC_cogs: [% L.chart_picker('chart_id_icco', undef, type='IC_expense,IC_cogs', style=style) %]
-IC: [% L.chart_picker('chart_id_ic', undef, type='IC', style=style) %]
+AR_paid: [% P.chart.picker('chart_id_ar_paid', undef, type='AR_paid', category='I,A' style=style) %]
+AR: [% P.chart.picker('chart_id_ar', undef, type='AR', style=style) %]
+AP: [% P.chart.picker('chart_id_ap', undef, type='AP', style=style) %]
+AR or AP: [% P.chart.picker('chart_id_arap', undef, type='AR,AP', style=style) %]
+IC_income,IC_sale: [% P.chart.picker('chart_id_icis', undef, type='IC_income,IC_sale', style=style) %]
+IC_expense,IC_cogs: [% P.chart.picker('chart_id_icco', undef, type='IC_expense,IC_cogs', style=style) %]
+IC: [% P.chart.picker('chart_id_ic', undef, type='IC', style=style) %]

Filter by category:
-I: [% L.chart_picker('chart_id_i', undef, category='I', style=style) %]
-IE: [% L.chart_picker('chart_id_ie', undef, category='I,E', style=style) %]
-AQL: [% L.chart_picker('chart_id_aql', undef, category='A,Q,L', style=style) %]
+I: [% P.chart.picker('chart_id_i', undef, category='I', style=style) %]
+IE: [% P.chart.picker('chart_id_ie', undef, category='I,E', style=style) %]
+AQL: [% P.chart.picker('chart_id_aql', undef, category='A,Q,L', style=style) %]

Filter by special type:
-GuV: [% L.chart_picker('chart_id_guv', undef, type='guv', style=style) %]
+GuV: [% P.chart.picker('chart_id_guv', undef, type='guv', style=style) %]

-

bank (fat): [% L.chart_picker('bank_id', '', type='bank', fat_set_item=1, choose=1, style=style) %] +

bank (fat): [% P.chart.picker('bank_id', '', type='bank', fat_set_item=1, choose=1, style=style) %]

[% FOREACH i IN [ 1 2 3 4 5 6 ] %] -S [% i %]: [% L.chart_picker('credit_' _ i) %] -    H [% i %]: [% L.chart_picker('debit' _ i) %]
+S [% i %]: [% P.chart.picker('credit_' _ i) %] -    H [% i %]: [% P.chart.picker('debit' _ i) %]
[% END %]

-Pre-filled chart object: [% L.chart_picker('pre_filled_chart_object', pre_filled_chart, style=style) %]
-Pre-filled chart ID: [% L.chart_picker('pre_filled_chart_id', pre_filled_chart.id, style=style) %]
+Pre-filled chart object: [% P.chart.picker('pre_filled_chart_object', pre_filled_chart, style=style) %]
+Pre-filled chart ID: [% P.chart.picker('pre_filled_chart_id', pre_filled_chart.id, style=style) %]

diff --git a/templates/webpages/client_config/_default_accounts.html b/templates/webpages/client_config/_default_accounts.html index bb92517f2..ee9669c77 100644 --- a/templates/webpages/client_config/_default_accounts.html +++ b/templates/webpages/client_config/_default_accounts.html @@ -1,4 +1,4 @@ -[%- USE HTML -%][%- USE LxERP -%][%- USE L -%][%- USE T8 -%] +[%- USE HTML -%][%- USE LxERP -%][%- USE L -%][%- USE P -%][%- USE T8 -%] [% SET style="width: 500px" %] [%# L.dump( SELF.defaults ) %]
@@ -6,53 +6,53 @@ [% LxERP.t8("Inventory Account") %] - [% L.chart_picker('defaults.inventory_accno_id', SELF.defaults.inventory_accno_id, type='IC', choose=1, style=style) %] + [% P.chart.picker('defaults.inventory_accno_id', SELF.defaults.inventory_accno_id, type='IC', choose=1, style=style) %] [% LxERP.t8("Revenue Account") %] - [% L.chart_picker('defaults.income_accno_id', SELF.defaults.income_accno_id, type='IC_income,IC_sale', choose=1, style=style) %] + [% P.chart.picker('defaults.income_accno_id', SELF.defaults.income_accno_id, type='IC_income,IC_sale', choose=1, style=style) %] [% LxERP.t8("Expense Account") %] - [% L.chart_picker('defaults.expense_accno_id', SELF.defaults.expense_accno_id, type='IC_expense,IC_cogs', choose=1, style=style) %] + [% P.chart.picker('defaults.expense_accno_id', SELF.defaults.expense_accno_id, type='IC_expense,IC_cogs', choose=1, style=style) %] [% LxERP.t8("Foreign Exchange Gain") %] - [% L.chart_picker('defaults.fxgain_accno_id', SELF.defaults.fxgain_accno_id, category='I,A', choose=1, style=style) %] + [% P.chart.picker('defaults.fxgain_accno_id', SELF.defaults.fxgain_accno_id, category='I,A', choose=1, style=style) %] [% LxERP.t8("Foreign Exchange Loss") %] - [% L.chart_picker('defaults.fxloss_accno_id', SELF.defaults.fxloss_accno_id, category='E,A', choose=1, style=style) %] + [% P.chart.picker('defaults.fxloss_accno_id', SELF.defaults.fxloss_accno_id, category='E,A', choose=1, style=style) %] [% LxERP.t8("Rounding Gain") %] - [% L.chart_picker('defaults.rndgain_accno_id', SELF.defaults.rndgain_accno_id, category='I,A', choose=1, style=style) %] + [% P.chart.picker('defaults.rndgain_accno_id', SELF.defaults.rndgain_accno_id, category='I,A', choose=1, style=style) %] [% LxERP.t8("Rounding Loss") %] - [% L.chart_picker('defaults.rndloss_accno_id', SELF.defaults.rndloss_accno_id, category='E,A', choose=1, style=style) %] + [% P.chart.picker('defaults.rndloss_accno_id', SELF.defaults.rndloss_accno_id, category='E,A', choose=1, style=style) %] [% LxERP.t8("Current assets account") %] - [% L.chart_picker('defaults.ar_paid_accno_id', SELF.defaults.ar_paid_accno_id, type='AR_paid', choose=1, style=style) %] + [% P.chart.picker('defaults.ar_paid_accno_id', SELF.defaults.ar_paid_accno_id, type='AR_paid', choose=1, style=style) %] [% LxERP.t8("Payable account") %] - [% L.chart_picker('defaults.ap_chart_id', SELF.defaults.ap_chart_id, type='AP', choose=1, style=style) %] + [% P.chart.picker('defaults.ap_chart_id', SELF.defaults.ap_chart_id, type='AP', choose=1, style=style) %] [% LxERP.t8("Receivable account") %] - [% L.chart_picker('defaults.ar_chart_id', SELF.defaults.ar_chart_id, type='AR', choose=1, style=style) %] + [% P.chart.picker('defaults.ar_chart_id', SELF.defaults.ar_chart_id, type='AR', choose=1, style=style) %] diff --git a/templates/webpages/client_config/_features.html b/templates/webpages/client_config/_features.html index 53422d047..7a952a817 100644 --- a/templates/webpages/client_config/_features.html +++ b/templates/webpages/client_config/_features.html @@ -243,7 +243,7 @@ [% LxERP.t8('Default article for converting into quotations and orders') %] [% IF SELF.h_unit_name %] - [% P.part_picker('defaults.requirement_spec_section_order_part_id', SELF.defaults.requirement_spec_section_order_part_id, convertible_unit=SELF.h_unit_name, style=style) %] + [% P.part.picker('defaults.requirement_spec_section_order_part_id', SELF.defaults.requirement_spec_section_order_part_id, convertible_unit=SELF.h_unit_name, style=style) %] [% ELSE %] [% LxERP.t8("Error: this feature requires that articles with a time-based unit (e.g. 'h' or 'min') exist.") %] [% END %] @@ -253,7 +253,7 @@ [% LxERP.t8('Transport and service costs reminder') %] [% LxERP.t8('Default transport article number') %] - [% L.part_picker('defaults.transport_cost_reminder_article_number_id', SELF.defaults.transport_cost_reminder_article_number_id, style=style) %] + [% P.part.picker('defaults.transport_cost_reminder_article_number_id', SELF.defaults.transport_cost_reminder_article_number_id, style=style) %] [% LxERP.t8('Before saving a sales order, this article will be checked and a warning is generated.') %] diff --git a/templates/webpages/common/render_cvar_filter_input.html b/templates/webpages/common/render_cvar_filter_input.html index 4ec984b76..8654854f6 100644 --- a/templates/webpages/common/render_cvar_filter_input.html +++ b/templates/webpages/common/render_cvar_filter_input.html @@ -1,4 +1,4 @@ -[%- USE HTML -%][%- USE L -%][%- USE LxERP -%][%- USE T8 -%] +[%- USE HTML -%][%- USE L -%][%- USE LxERP -%][%- USE T8 -%][%- USE P -%] [%- SET id__ = cvar_cfg.id name__ = 'filter.cvar.' _ id__ value__ = filter.cvar.$id__ %] @@ -19,13 +19,13 @@ L.select_tag(name__, options__, default=value__, class=cvar_class) %] [% ELSIF cvar_cfg.type == 'customer' %] - [%- L.customer_vendor_picker(name__, value__, type='customer', class=cvar_class) %] + [%- P.customer_vendor.picker(name__, value__, type='customer', class=cvar_class) %] [% ELSIF cvar_cfg.type == 'vendor' %] - [%- L.customer_vendor_picker(name__, value__, type='vendor', class=cvar_class) %] + [%- P.customer_vendor.picker(name__, value__, type='vendor', class=cvar_class) %] [% ELSIF cvar_cfg.type == 'part' %] - [%- L.part_picker(name__, value__, class=cvar_class) %] + [%- P.part.picker(name__, value__, class=cvar_class) %] [%- ELSE %] [% SET value_name__ = id__ _ '_substr__ilike' diff --git a/templates/webpages/common/render_cvar_input.html b/templates/webpages/common/render_cvar_input.html index c7072d455..96b69c627 100644 --- a/templates/webpages/common/render_cvar_input.html +++ b/templates/webpages/common/render_cvar_input.html @@ -1,6 +1,7 @@ [%- USE T8 %] [%- USE HTML %] [%- USE L %] +[%- USE P %] [%- USE LxERP %] [%- DEFAULT var_name = HTML.escape(cvar_name_prefix) _ HTML.escape(var.config.name) _ HTML.escape(cvar_name_postfix) %] @@ -20,11 +21,11 @@ [%- ELSIF ( var.config.type == 'timestamp' ) %] [% L.input_tag(var_name, var.value) %] [%- ELSIF ( var.config.type == 'customer' ) %] - [% L.customer_vendor_picker(var_name, var.value, type='customer') %] + [% P.customer_vendor.picker(var_name, var.value, type='customer') %] [%- ELSIF ( var.config.type == 'vendor' ) %] - [% L.customer_vendor_picker(var_name, var.value, type='vendor') %] + [% P.customer_vendor.picker(var_name, var.value, type='vendor') %] [%- ELSIF ( var.config.type == 'part' ) %] - [% L.part_picker(var_name, var.value) %] + [% P.part.picker(var_name, var.value) %] [%- ELSIF ( var.config.type == 'select' ) %] [% L.select_tag(var_name, var.config.processed_options, default = var.value) %] [%- ELSIF ( var.config.type == 'number' ) %] diff --git a/templates/webpages/cp/form_header.html b/templates/webpages/cp/form_header.html index c41ec96c8..e460924e5 100644 --- a/templates/webpages/cp/form_header.html +++ b/templates/webpages/cp/form_header.html @@ -25,7 +25,7 @@ [% is_customer ? LxERP.t8('Customer') : LxERP.t8('Vendor') %] - [% P.customer_vendor_picker(vc_id, $vc_id, type=vc, class="initial_focus", style=style) %] + [% P.customer_vendor.picker(vc_id, $vc_id, type=vc, class="initial_focus", style=style) %] [% P.hidden_tag("previous_" _ vc_id, $vc_id) %] diff --git a/templates/webpages/csv_import/_form_parts.html b/templates/webpages/csv_import/_form_parts.html index 3aaa81333..9e9101d89 100644 --- a/templates/webpages/csv_import/_form_parts.html +++ b/templates/webpages/csv_import/_form_parts.html @@ -43,7 +43,7 @@ [%- LxERP.t8('Parts Classification') %]: - [% P.select_classification('settings.part_classification', default = SELF.profile.get('part_classification'), style = 'width: 300px') %] + [% P.part.select_classification('settings.part_classification', default = SELF.profile.get('part_classification'), style = 'width: 300px') %] diff --git a/templates/webpages/customer_vendor/test_page.html b/templates/webpages/customer_vendor/test_page.html index c1d26f939..2698cc765 100644 --- a/templates/webpages/customer_vendor/test_page.html +++ b/templates/webpages/customer_vendor/test_page.html @@ -4,21 +4,21 @@
Customer: with preselected id 822
-[% L.customer_vendor_picker('customer_id', 822, type='customer') %]
+[% P.customer_vendor.picker('customer_id', 822, type='customer') %]


Vendor:
-[% L.customer_vendor_picker('vendor_id', '', type='vendor') %]
+[% P.customer_vendor.picker('vendor_id', '', type='vendor') %]


customer with fat change
-[% L.customer_vendor_picker('customer_id2', '', type='customer', fat_set_item=1) %]
+[% P.customer_vendor.picker('customer_id2', '', type='customer', fat_set_item=1) %]
id from change
greeting from fat change


fat vendor with change
-[% L.customer_vendor_picker('vendor_id2', '', type='vendor', fat_set_item=1) %]
+[% P.customer_vendor.picker('vendor_id2', '', type='vendor', fat_set_item=1) %]
id from change
greeting from fat change
@@ -31,7 +31,7 @@ this one will be a reinit_widget after 4s:


this should have three '-' before and after touching:
----[% L.customer_vendor_picker('vendor5_id', '', type='vendor') %]--- +---[% P.customer_vendor.picker('vendor5_id', '', type='vendor') %]--- diff --git a/templates/webpages/record_links/add_list.html b/templates/webpages/record_links/add_list.html index 6ac59e18f..0c97bd682 100644 --- a/templates/webpages/record_links/add_list.html +++ b/templates/webpages/record_links/add_list.html @@ -26,7 +26,7 @@ [% END %] [%- HTML.escape(object.$description_column) %] [% IF project_column %] - [%- P.project(object.$project_column, no_link=1) %] + [%- object.$project_column.presenter.project(no_link=1) %] [% END %] [%- END %] diff --git a/templates/webpages/rp/report.html b/templates/webpages/rp/report.html index 162c59c84..f28684c5b 100644 --- a/templates/webpages/rp/report.html +++ b/templates/webpages/rp/report.html @@ -1,6 +1,7 @@ [%- USE HTML %] [%- USE LxERP %] [%- USE L %] +[%- USE P %] [%- USE T8 %] [%- BLOCK customized_report %] @@ -106,13 +107,13 @@ [%- BLOCK customer %] [% 'Customer' | $T8 %] - [% L.customer_vendor_picker('customer_id', '', type='customer') %] + [% P.customer_vendor.picker('customer_id', '', type='customer') %] [%- END %] [%- BLOCK projectnumber %] [% 'Project' | $T8 %] - [% L.project_picker('project_id', '') %] + [% P.project.picker('project_id', '') %] [%- END %] diff --git a/templates/webpages/simple_system_setting/_bank_account_form.html b/templates/webpages/simple_system_setting/_bank_account_form.html index 63cc87fbf..f3da6cc20 100644 --- a/templates/webpages/simple_system_setting/_bank_account_form.html +++ b/templates/webpages/simple_system_setting/_bank_account_form.html @@ -1,4 +1,4 @@ -[%- USE HTML -%][%- USE LxERP -%][%- USE L -%] +[%- USE HTML -%][%- USE LxERP -%][%- USE L -%][%- USE P -%] [% SET style="width: 400px" %] @@ -29,7 +29,7 @@ [% LxERP.t8('Chart') %] - [% L.chart_picker('object.chart_id', SELF.object.chart_id, type='AR_paid,AP_paid', category='A,L,Q', choose=1, style=style, "data-validate"="required", "data-title"=LxERP.t8("Chart")) %] + [% P.chart.picker('object.chart_id', SELF.object.chart_id, type='AR_paid,AP_paid', category='A,L,Q', choose=1, style=style, "data-validate"="required", "data-title"=LxERP.t8("Chart")) %] [% LxERP.t8('Obsolete') %] diff --git a/templates/webpages/taxzones/form.html b/templates/webpages/taxzones/form.html index 9cddd46e9..b59385a72 100644 --- a/templates/webpages/taxzones/form.html +++ b/templates/webpages/taxzones/form.html @@ -1,4 +1,4 @@ -[%- USE HTML -%][%- USE LxERP -%][%- USE L -%][%- USE T8 -%]

[% HTML.escape(title) %]

+[%- USE HTML -%][%- USE LxERP -%][%- USE L -%][%- USE P -%][%- USE T8 -%]

[% HTML.escape(title) %]

[% SET style="width: 400px" %]
@@ -13,9 +13,9 @@ [% 'Revenue' | $T8 %] [% HTML.escape(bg.description) %] [%- IF NOT SELF.config.id %] - [% L.chart_picker('income_accno_id_' _ bg.id, SELF.defaults.income_accno_id, choose=1, type='IC_income,IC_sale', style=style) %] + [% P.chart.picker('income_accno_id_' _ bg.id, SELF.defaults.income_accno_id, choose=1, type='IC_income,IC_sale', style=style) %] [%- ELSIF SELF.config.id AND SELF.config.orphaned %] - [% L.chart_picker('income_accno_id_' _ bg.id, CHARTLIST.${bg.id}.income_accno_id, choose=1, type='IC_income,IC_sale', style=style) %] + [% P.chart.picker('income_accno_id_' _ bg.id, CHARTLIST.${bg.id}.income_accno_id, choose=1, type='IC_income,IC_sale', style=style) %] [%- ELSE %] [% CHARTLIST.${bg.id}.income_accno_description %] [%- END %] @@ -23,9 +23,9 @@ [% 'Expense' | $T8 %] [% HTML.escape(bg.description) %] [%- IF NOT SELF.config.id %] - [% L.chart_picker('expense_accno_id_' _ bg.id, SELF.defaults.expense_accno_id, choose=1, type='IC_expense,IC_cogs', style=style) %] + [% P.chart.picker('expense_accno_id_' _ bg.id, SELF.defaults.expense_accno_id, choose=1, type='IC_expense,IC_cogs', style=style) %] [%- ELSIF SELF.config.id AND SELF.config.orphaned %] - [% L.chart_picker('expense_accno_id_' _ bg.id, CHARTLIST.${bg.id}.expense_accno_id, choose=1, type='IC_expense,IC_cogs', style=style) %] + [% P.chart.picker('expense_accno_id_' _ bg.id, CHARTLIST.${bg.id}.expense_accno_id, choose=1, type='IC_expense,IC_cogs', style=style) %] [%- ELSE %] [% CHARTLIST.${bg.id}.expense_accno_description %] [%- END %] diff --git a/templates/webpages/vk/search_invoice.html b/templates/webpages/vk/search_invoice.html index fb3825744..6092496fc 100644 --- a/templates/webpages/vk/search_invoice.html +++ b/templates/webpages/vk/search_invoice.html @@ -81,7 +81,7 @@ [% 'Project Number' | $T8 %] - [% P.project_picker("project_id", "", style=style) %] + [% P.project.picker("project_id", "", style=style) %] diff --git a/templates/webpages/wh/journal_filter.html b/templates/webpages/wh/journal_filter.html index 1101d1fa5..cf7581c2d 100644 --- a/templates/webpages/wh/journal_filter.html +++ b/templates/webpages/wh/journal_filter.html @@ -98,7 +98,7 @@ [% 'Parts Classification' | $T8 %]: - [% P.select_classification('classification_id') %] + [% P.part.select_classification('classification_id') %] [% 'Part Description' | $T8 %]: diff --git a/templates/webpages/wh/report_filter.html b/templates/webpages/wh/report_filter.html index b41e905ae..cb3272fef 100644 --- a/templates/webpages/wh/report_filter.html +++ b/templates/webpages/wh/report_filter.html @@ -100,7 +100,7 @@ [% 'Parts Classification' | $T8 %]: - [% P.select_classification('classification_id') %] + [% P.part.select_classification('classification_id') %] [% 'Part Description' | $T8 %]: diff --git a/templates/webpages/wh/warehouse_selection.html b/templates/webpages/wh/warehouse_selection.html index 756e95676..5bfdad940 100644 --- a/templates/webpages/wh/warehouse_selection.html +++ b/templates/webpages/wh/warehouse_selection.html @@ -96,7 +96,7 @@ [% 'Part' | $T8 %] - [% P.part_picker("part_id", '', size="30", part_type="part,assembly") %] + [% P.part.picker("part_id", '', size="30", part_type="part,assembly") %] diff --git a/templates/webpages/wh/warehouse_selection_assembly.html b/templates/webpages/wh/warehouse_selection_assembly.html index 2bbd77323..fba6b7103 100644 --- a/templates/webpages/wh/warehouse_selection_assembly.html +++ b/templates/webpages/wh/warehouse_selection_assembly.html @@ -66,7 +66,7 @@ [% 'Assembly' | $T8 %] - [% P.part_picker("parts_id", parts_id, part_type="assembly", class="initial_focus", fat_set_item="1") %] + [% P.part.picker("parts_id", parts_id, part_type="assembly", class="initial_focus", fat_set_item="1") %] -- 2.20.1