X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fct.pl;h=923a18a1aed5a97f3d40f49eac24d2e80c2951e4;hb=7c15cba2557382a9f99134873026217f036b00b1;hp=beefcc1fb7d014a518427c3bcd518cb40be3d406;hpb=54e4131e091831e00a861fe2c4f53e344b87ddca;p=kivitendo-erp.git diff --git a/bin/mozilla/ct.pl b/bin/mozilla/ct.pl index beefcc1fb..923a18a1a 100644 --- a/bin/mozilla/ct.pl +++ b/bin/mozilla/ct.pl @@ -307,224 +307,6 @@ sub search_delivery { $lxdebug->leave_sub(); } -sub search_adr { - $lxdebug->enter_sub(); - - $form->{title} = $locale->text('ADR Report'); - - # use JavaScript Calendar or not - $form->{jsscript} = $jscalendar; - $jsscript = ""; - - if ($form->{jsscript}) { - - # with JavaScript Calendar - $button1 = qq| - {from}> - text('button') . qq|> - |; - $button2 = qq| - {to}> - text('button') . qq|> - |; - - - #write Trigger - $jsscript = - Form->write_trigger(\%myconfig, "2", - "from", "BL", - "trigger1", "to", - "BL", "trigger2"); - } else { - - # without JavaScript Calendar - $button1 = - qq|{from}>|; - $button2 = - qq|{to}>|; - } - - $form->header; - - print qq| - - -
{script}> - - - - - - - - - - - - - -
$form->{title}
- - - - - - - $button1 - - - - $button2 - - - - - -
| . $locale->text('Year') . qq|{year}>
| . $locale->text('From') . qq|
| . $locale->text('Bis') . qq|
 | - . $locale->text('HTML') . qq| -  | - . $locale->text('CSV') . qq|
-

-$jsscript - - -{path}> -{login}> -{password}> - -
- -
- - - -|; - $lxdebug->leave_sub(); -} -sub adr_report { - $lxdebug->enter_sub(); - - CT->adr(\%myconfig, \%$form); - - $form->{title} = $locale->text('ADR Report'); - if ($form->{from} || $form->{to}) { - $option = "Für den Zeitraum $form->{from} bis $form->{to}"; - } elsif ($form->{year}) { - $option = "Für das Jahr $form->{year}"; - } - - if ($form->{format} eq "html") { - $form->header(); - print qq| - - - - - - - - - - -
$form->{title}
$option
|; - - - @column_index = - $form->sort_columns(adr_code, - adr_description, - sum, - unit); - - - - $column_header{adr_code} = - qq|| . $locale->text('ADR Code') . qq||; - $column_header{adr_description} = - qq||. $locale->text('ADR Description'). qq||; - $column_header{sum} = - qq||. $locale->text('Quantity'). qq||; - $column_header{unit} = - qq|| . $locale->text('Unit') . qq||; - - print qq| - - - - - + |; foreach $item (split / /, $form->{taxaccounts}) { @@ -1071,7 +854,8 @@ sub form_header { $form->{selectpricegroup} =~ s/(|; $column_header{description} = qq||; - $column_header{adr_code} = - qq||; $column_header{qty} = qq||; $column_header{unit} =
- - -|; - - map { print "$column_header{$_}\n" } @column_index; - - print qq| - -|; - - - foreach $ref (@{ $form->{ADR} }) { - - map { $column_data{$_} = "" } @column_index; - - - $i++; - $i %= 2; - print " - -"; - - map { print "$column_data{$_}\n" } @column_index; - - print qq| - -|; - - - } - - print qq| -
$ref->{$_} 
- - -|; - } else { - my $filename = "adr-report-$form->{from}-$form->{to}.csv"; - if ($form->{year}) { - $filename = "adr-report-$form->{year}.csv"; - } - @column_index = - $form->sort_columns(adr_code, - adr_description, - sum, - unit); - - $tmpfile = qq|ADR Code;ADR Beschreibung;Menge;Einheit\n|; - foreach $ref (@{ $form->{ADR} }) { - - map { $column_data{$_} = qq|"$ref->{$_}"| } @column_index; - - $line = ""; - map { $line .= "$column_data{$_};" } @column_index; - chomp($line); - $tmpfile .= qq|$line\n|;; - } - - my $size = length($tmpfile); - # launch application - print qq|Content-Type: application/csv -Content-Disposition: attachment; filename="$filename" -Content-Length: $size - -$tmpfile -|; - } - - $lxdebug->leave_sub(); -} - sub list_names { $lxdebug->enter_sub(); @@ -806,6 +588,7 @@ sub form_header { $form->{taxincluded} = ($form->{taxincluded}) ? "checked" : ""; $form->{creditlimit} = $form->format_amount(\%myconfig, $form->{creditlimit}, 0); + $form->{discount} = $form->format_amount(\%myconfig, $form->{discount}); if ($myconfig{role} eq 'admin') { $bcc = qq| @@ -894,12 +677,12 @@ sub form_header { $form->{selectshipto} = ""; if (@{ $form->{SHIPTO} }) { foreach $item (@{ $form->{SHIPTO} }) { - if ($item->{id} == $form->{shipto_id}) { + if ($item->{shipto_id} == $form->{shipto_id}) { $form->{selectshipto} .= - "
| . $locale->text('Shipping Address') . qq|
| . $locale->text('Invdate') . qq|| . $locale->text('Description') . qq|| . $locale->text('ADR') . qq|| . $locale->text('Qty') . qq|