t8('Update'),
submit => [ '#form', { action => "update" } ],
id => 'update_button',
- checks => [ 'kivi.validate_form' ],
accesskey => 'enter',
],
],
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'),
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;
$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|<textarea name="notes" class="texteditor" wrap="soft" style="width: 350px; height: 150px">| . H($form->{notes}) . qq|</textarea>|;
- $TMPL_VAR->{intnotes} = qq|<textarea name=intnotes rows="$introws" cols="35">| . H($form->{intnotes}) . qq|</textarea>|;
-
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};
"curr", "employee",
"salesman",
"shipvia", "globalprojectnumber",
- "transaction_description", "open",
+ "transaction_description", "department", "open",
"delivered", "periodic_invoices",
"marge_total", "marge_percent",
"vcnumber", "ustid",
'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'), },
%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";
}
$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);