X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Foe.pl;h=012914d036dbc7fd0876a6dbce11050ca7cdf6b8;hb=affd886bff7af48273af3dad20ea0680398489a3;hp=b5f3eb6b6e28b0f608197142d1ef439ba03e4e77;hpb=65b2387a54494a8cbc1d011602ae3f8d7208ea4d;p=kivitendo-erp.git diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index b5f3eb6b6..012914d03 100644 --- a/bin/mozilla/oe.pl +++ b/bin/mozilla/oe.pl @@ -331,7 +331,6 @@ sub setup_oe_action_bar { t8('Update'), submit => [ '#form', { action => "update" } ], id => 'update_button', - checks => [ 'kivi.validate_form' ], accesskey => 'enter', ], @@ -420,8 +419,9 @@ sub setup_oe_action_bar { ], action => [ t8('E Mail'), - call => [ 'kivi.SalesPurchase.show_email_dialog' ], - checks => [ 'kivi.validate_form' ], + call => [ 'kivi.SalesPurchase.show_email_dialog' ], + checks => [ 'kivi.validate_form' ], + disabled => !$form->{id} ? t8('This record has not been saved yet.') : undef, ], action => [ t8('Download attachments of all parts'), @@ -652,7 +652,7 @@ sub form_header { taxpart taxservice taxaccounts cursor_fokus show_details useasnew), @custom_hiddens, - map { $_.'_rate', $_.'_description', $_.'_taxnumber' } split / /, $form->{taxaccounts} ]; # deleted: discount + map { $_.'_rate', $_.'_description', $_.'_taxnumber', $_.'_tax_id' } split / /, $form->{taxaccounts} ]; # deleted: discount $TMPL_VAR->{$_} = $type_check_vars{$_} for keys %type_check_vars; @@ -681,13 +681,8 @@ sub form_footer { $form->{invtotal} = $form->{invsubtotal}; - my $introws = max 5, $form->numtextrows($form->{intnotes}, 35, 8); - my $TMPL_VAR = $::request->cache('tmpl_var', {}); - $TMPL_VAR->{notes} = qq||; - $TMPL_VAR->{intnotes} = qq||; - if( $form->{customer_id} && !$form->{taxincluded_changed_by_user} ) { my $customer = SL::DB::Customer->new(id => $form->{customer_id})->load(); $form->{taxincluded} = defined($customer->taxincluded_checked) ? $customer->taxincluded_checked : $myconfig{taxincluded_checked}; @@ -1032,7 +1027,7 @@ sub orders { "curr", "employee", "salesman", "shipvia", "globalprojectnumber", - "transaction_description", "open", + "transaction_description", "department", "open", "delivered", "periodic_invoices", "marge_total", "marge_percent", "vcnumber", "ustid", @@ -1117,6 +1112,7 @@ sub orders { 'shipvia' => { 'text' => $locale->text('Ship via'), }, 'globalprojectnumber' => { 'text' => $locale->text('Project Number'), }, 'transaction_description' => { 'text' => $locale->text('Transaction description'), }, + 'department' => { 'text' => $locale->text('Department'), }, 'open' => { 'text' => $locale->text('Open'), }, 'delivered' => { 'text' => $locale->text('Delivery Order created'), }, 'marge_total' => { 'text' => $locale->text('Ertrag'), }, @@ -1135,7 +1131,7 @@ sub orders { %column_defs_cvars, ); - foreach my $name (qw(id transdate reqdate quonumber ordnumber cusordnumber name employee salesman shipvia transaction_description shippingpoint taxzone insertdate payment_terms)) { + foreach my $name (qw(id transdate reqdate quonumber ordnumber cusordnumber name employee salesman shipvia transaction_description shippingpoint taxzone insertdate payment_terms department)) { my $sortdir = $form->{sort} eq $name ? 1 - $form->{sortdir} : $form->{sortdir}; $column_defs{$name}->{link} = $href . "&sort=$name&sortdir=$sortdir"; } @@ -2175,18 +2171,18 @@ sub edit_periodic_invoices_config { $config = SL::YAML::Load($::form->{periodic_invoices_config}) if $::form->{periodic_invoices_config}; if ('HASH' ne ref $config) { - my $lang_id = $::form->{language_id}; $config = { periodicity => 'm', order_value_periodicity => 'p', # = same as periodicity start_date_as_date => $::form->{transdate} || $::form->current_date, extend_automatically_by => 12, active => 1, - email_subject => GenericTranslations->get(language_id => $lang_id, - translation_type =>"preset_text_periodic_invoices_email_subject"), - email_body => GenericTranslations->get(language_id => $lang_id, - translation_type =>"preset_text_periodic_invoices_email_body"), }; } + # for older configs, replace email preset text if not yet set. + $config->{email_subject} ||= GenericTranslations->get(language_id => $::form->{lanuage_id}, + translation_type =>"preset_text_periodic_invoices_email_subject"); + $config->{email_body} ||= GenericTranslations->get(language_id => $::form->{lanuage_id}, + translation_type =>"preset_text_periodic_invoices_email_body"); $config->{periodicity} = 'm' if none { $_ eq $config->{periodicity} } @SL::DB::PeriodicInvoicesConfig::PERIODICITIES; $config->{order_value_periodicity} = 'p' if none { $_ eq $config->{order_value_periodicity} } ('p', @SL::DB::PeriodicInvoicesConfig::ORDER_VALUE_PERIODICITIES); @@ -2200,6 +2196,7 @@ sub edit_periodic_invoices_config { if ($::form->{customer_id}) { $::form->{ALL_CONTACTS} = SL::DB::Manager::Contact->get_all_sorted(where => [ cp_cv_id => $::form->{customer_id} ]); + $::form->{email_recipient_invoice_address} = SL::DB::Manager::Customer->find_by(id => $::form->{customer_id})->invoice_mail; } $::form->header(no_layout => 1);