my $rows = scalar @{ $form->{item_list} };
if ($rows) {
- $form->{"qty_$i"} = 1 unless ($form->{"qty_$i"});
+ $form->{"qty_$i"} = 1 unless $form->parse_amount(\%myconfig, $form->{"qty_$i"});
if ($rows > 1) {
'donumber' => { 'text' => $locale->text('Delivery Order'), },
'ordnumber' => { 'text' => $locale->text('Order'), },
'name' => { 'text' => $form->{vc} eq 'customer' ? $locale->text('Customer') : $locale->text('Vendor'), },
- 'employee' => { 'text' => $locale->text('Salesperson'), },
+ 'employee' => { 'text' => $locale->text('Employee'), },
'shipvia' => { 'text' => $locale->text('Ship via'), },
'globalprojectnumber' => { 'text' => $locale->text('Project Number'), },
'transaction_description' => { 'text' => $locale->text('Transaction description'), },
# $locale->text('Customer missing!');
# $locale->text('Vendor missing!');
+ remove_emptied_rows();
validate_items();
# if the name changed get new values
}
$form->{id} = 0 if $form->{saveasnew};
-
+ # best case fix für bug 1079. Einkaufsrabatt wird nicht richtig
+ # aus Lieferantenauftrag -> Lieferschein -> Rechnung übernommen
+ # Tritt nur auf, wenn man direkt über Lieferschein -> speichern ->
+ # Workflow Rechnung geht (beim Aufruf über edit() i.O.)
+ # Gut. DO-save() speichert den Discount im DB-Format 0.12 für
+ # 12%, die Konvertierung wird leider in $form gemacht und daher
+ # wird die Maske mit dem falschen Rabatt wieder aufgebaut.
+ # Wie immer: backup_vars verwenden um nichts anderes kaputt zu
+ # machen. jan 03.03.2010
+ for my $i (1 .. $form->{rowcount}) {
+ $form->{"backup_discount_$i"} = $form->{"discount_$i"};
+ };
DO->save();
-
+ for my $i (1 .. $form->{rowcount}) {
+ $form->{"discount_$i"} = $form->{"backup_discount_$i"};
+ delete $form->{"backup_discount_$i"};
+ };
# saving the history
if(!exists $form->{addition}) {
$form->{snumbers} = qq|donumber_| . $form->{donumber};
$form->{closed} = 0;
$form->{delivered} = 0;
map { delete $form->{$_} } qw(printed emailed queued);
+ delete @{ $form }{ grep { m/^stock_(?:in|out)_\d+/ } keys %{ $form } };
# Let Lx-Office assign a new order number if the user hasn't changed the
# previous one. If it has been changed manually then use it as-is.
my $do_base_qty = $form->parse_amount(\%myconfig, $form->{"qty_$i"}) * $units->{$form->{"unit_$i"}}->{factor} / $base_unit_factor;
- if ($do_base_qty != $row_sum_base_qty) {
- push @{ $form->{ERRORS} }, $locale->text('Error in position #1: You must either assign no stock at all or the full quantity of #2 #3.',
- $i, $form->{"qty_$i"}, $form->{"unit_$i"});
- }
+# if ($do_base_qty != $row_sum_base_qty) {
+# push @{ $form->{ERRORS} }, $locale->text('Error in position #1: You must either assign no stock at all or the full quantity of #2 #3.',
+# $i, $form->{"qty_$i"}, $form->{"unit_$i"});
+# }
}
if (@{ $form->{ERRORS} }) {
my $do_base_qty = $form->parse_amount(\%myconfig, $form->{"qty_$i"}) * $units->{$form->{"unit_$i"}}->{factor} / $base_unit_factor;
- if ($do_base_qty != $row_sum_base_qty) {
- push @{ $form->{ERRORS} }, $locale->text('Error in position #1: You must either assign no transfer at all or the full quantity of #2 #3.',
- $i, $form->{"qty_$i"}, $form->{"unit_$i"});
- }
+# if ($do_base_qty != $row_sum_base_qty) {
+# push @{ $form->{ERRORS} }, $locale->text('Error in position #1: You must either assign no transfer at all or the full quantity of #2 #3.',
+# $i, $form->{"qty_$i"}, $form->{"unit_$i"});
+# }
}
if (%request_map) {