/doc/online/*/*.html
pod2html*
/doc/build/dobudish*
+/spool/*
my $pricegroup_old = $form->{"pricegroup_old_$i"};
- # sellprice has format 13,0000 or 0,00000, can't check for 0 numerically
+ # sellprice has format 13,0000 or 0,00000, can't check for 0 numerically
my $sellprice = $form->{"sellprice_$i"};
my $pricegroup_id = $form->{"pricegroup_id_$i"};
$form->{"new_pricegroup_$i"} = $selectedpricegroup_id;
$pkr->{selected} = ' selected'; # unless $form->{selected};
# no customer pricesgroup set
- if ($pkr->{price_unfmt} == $pkr->{default_sellprice}) {
+ if ($pkr->{price_unfmt} == $pkr->{default_sellprice} || $form->{'sellprice_'.$i} * 1 > 1) {
$pkr->{price} = $form->{"sellprice_$i"};
} else {
-# this sub should not set anything and only return. --sschoeling, 20090506
-# is this correct? put in again... -- grichardson 20110119
$form->{"sellprice_$i"} = $pkr->{price};
}
}
sub menuitem_new {
- $main::lxdebug->enter_sub();
+ $main::lxdebug->enter_sub(LXDebug::DEBUG2());
my ($self, $name, $item) = @_;
$item->{href} .= "&" . $form->escape($key) . "=" . $form->escape($value);
}
- $main::lxdebug->leave_sub();
+ $main::lxdebug->leave_sub(LXDebug::DEBUG2());
}
sub access_control {
}
$form->{id} = 0;
- if ($form->{"original_accno"} &&
- ($form->{"accno"} eq $form->{"original_accno"})) {
- $form->error($locale->text('Account Number already used!'));
- }
$form->redirect($locale->text('Account saved!'))
if (AM->save_account(\%myconfig, \%$form));
$form->error($locale->text('Cannot save account!'));
$form->{"${name}_id"} = $new_id;
+ _reset_salesman_id();
IS->get_customer(\%myconfig, \%$form) if ($name eq 'customer');
IR->get_vendor(\%myconfig, \%$form) if ($name eq 'vendor');
$form->{$name} = $form->{name_list}[0]->{name};
$form->{"old$name"} = qq|$form->{$name}--$form->{"${name}_id"}|;
+ _reset_salesman_id();
IS->get_customer(\%myconfig, \%$form) if ($name eq 'customer');
IR->get_vendor(\%myconfig, \%$form) if ($name eq 'vendor');
# index for new item
my $i = $form->{ndx};
+ _reset_salesman_id();
+
$form->{ $form->{vc} } = $form->{"new_name_$i"};
$form->{"$form->{vc}_id"} = $form->{"new_id_$i"};
$form->{"old$form->{vc}"} =
$main::lxdebug->leave_sub();
}
+# Reset the $::form field 'salesman_id' to the ID of the currently
+# logged in user. Useful when changing to a customer/vendor that has
+# no salesman listed in their master data.
+sub _reset_salesman_id {
+ my $current_employee = SL::DB::Manager::Employee->current;
+ $::form->{salesman_id} = $current_employee->id if $current_employee && exists $::form->{salesman_id};
+}
+
sub check_project {
$main::lxdebug->enter_sub();
use SL::DB::Language;
use SL::DB::Printer;
+use SL::Helper::Flash;
require "bin/mozilla/common.pl";
# check if items are valid
if ($form->{rowcount} == 1) {
+ flash('warning', $::locale->text('The action you\'ve chosen has not been executed because the document does not contain any item yet.'));
&update;
::end_of_request();
}
my $emailed = $form->{emailed};
if ($form->{media} eq 'queue') {
- my %queued = map { s|.*/|| } split / /, $form->{queued};
+ my %queued = map { s|.*[/\\]||; $_ } split / /, $form->{queued};
my $filename;
my $suffix = ($form->{postscript}) ? '.ps' : '.pdf';
if ($filename = $queued{ $form->{formname} }) {
- $form->{queued} =~ s/\Q$form->{formname} $filename\E//;
unlink $::lx_office_conf{paths}->{spool} . "/$filename";
- $filename =~ s/\..*$//g;
- $filename .= $suffix;
- $form->{OUT} = $::lx_office_conf{paths}->{spool} . "/$filename";
- $form->{OUT_MODE} = '>';
+ delete $queued{ $form->{formname} };
+
+ $form->{queued} = join ' ', %queued;
+ $filename =~ s/\..*$//g;
+ $filename .= $suffix;
+ $form->{OUT} = $::lx_office_conf{paths}->{spool} . "/$filename";
+ $form->{OUT_MODE} = '>';
+
} else {
my $temp_fh;
($temp_fh, $filename) = File::Temp::tempfile(
'kivitendo-spoolXXXXXX',
SUFFIX => "$suffix",
- DIR => $::lx_office_conf{paths}->{spool},
+ DIR => $::lx_office_conf{paths}->{spool},
+ UNLINK => 0,
);
close $temp_fh;
$form->{OUT} = "$filename";
'The access rights have been saved.' => 'Die Zugriffsrechte wurden gespeichert.',
'The account 3804 already exists, the update will be skipped.' => 'Das Konto 3804 existiert schon, das Update wird übersprungen.',
'The account 3804 will not be added automatically.' => 'Das Konto 3804 wird nicht automatisch hinzugefügt.',
+ 'The action you\'ve chosen has not been executed because the document does not contain any item yet.' => 'Die von Ihnen ausgewählte Aktion wurde nicht ausgeführt, weil der Beleg noch keine Positionen enthält.',
'The application "#1" was not found on the system.' => 'Die Anwendung "#1" wurde auf dem System nicht gefunden.',
'The assembly has been created.' => 'Das Erzeugnis wurde hergestellt.',
'The assistant could not find anything wrong with #1. Maybe the problem has been solved in the meantime.' => 'Der Korrekturassistent konnte kein Problem bei #1 feststellen. Eventuell wurde das Problem in der Zwischenzeit bereits behoben.',
'Weight unit' => 'Gewichtseinheit',
'What <b>term</b> you are looking for?' => 'Nach welchem <b>Begriff</b> wollen Sie suchen?',
'What type of item is this?' => 'Was ist dieser Artikel?',
- 'Which is located at doc/Lx-Office-Dokumentation.pdf. Click here: ' => 'Zu finden in doc/Lx-Office-Dokumentation.pdf. Oder hier klicken: ',
+ 'Which is located at doc/kivitendo-Dokumentation.pdf. Click here: ' => 'Zu finden in doc/kivitendo-Dokumentation.pdf. Oder hier klicken: ',
'With Extension Of Time' => 'mit Dauerfristverlängerung',
'Workflow Delivery Order' => 'Workflow Lieferschein',
'Workflow purchase_order' => 'Workflow Lieferantenauftrag',
<select name="inventory_system">
[% FOREACH row = INVENTORY_SYSTEMS %]<option value=[% HTML.escape(row.name) %] [% IF row.selected %]selected[% END %]>[% HTML.escape(row.name) | $T8 %]</option>[% END %]
</select>
- [% '* there are restrictions for the perpetual method, look at chapter "Bemerkungen zu Bestandsmethode" in' | $T8 %] <a href="doc/Lx-Office-Dokumentation.pdf">Lx-Office-Dokumentation.pdf</a>.
+ [% '* there are restrictions for the perpetual method, look at chapter "Bemerkungen zu Bestandsmethode" in' | $T8 %] <a href="doc/kivitendo-Dokumentation.pdf">kivitendo-Dokumentation.pdf</a>.
</td>
</tr>
<input type="hidden" name="type" value="account">
<input type="hidden" name="orphaned" value="[% HTML.escape(orphaned) %]">
<input type="hidden" name="new_chart_valid" value="[% HTML.escape(new_chart_valid) %]">
-<input type="hidden" name="original_accno" value="[% HTML.escape(accno) %]">
<input type="hidden" name="inventory_accno_id" value="[% HTML.escape(inventory_accno_id) %]">
<input type="hidden" name="income_accno_id" value="[% HTML.escape(income_accno_id) %]">
<input type="hidden" name="expense_accno_id" value="[% HTML.escape(expense_accno_id) %]">