X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fct.pl;h=923a18a1aed5a97f3d40f49eac24d2e80c2951e4;hb=7e6bdfc6728ec15377f5b78dd1fb4eaefed84962;hp=31f18d70c5806174100202a822452f2e193df927;hpb=f300c4815b05d897ae6c55594ebf09d339ab553a;p=kivitendo-erp.git diff --git a/bin/mozilla/ct.pl b/bin/mozilla/ct.pl index 31f18d70c..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}) { @@ -1431,7 +1213,7 @@ sub form_footer { ## print qq| -{id}> +{id}> @@ -1441,7 +1223,7 @@ sub form_footer { {password}> -{db}> +{db}> @@ -1488,6 +1270,9 @@ sub add_transaction { $lxdebug->enter_sub(); $form->isblank("name", $locale->text("Name missing!")); + if ($vertreter && $form->{db} eq "customer") { + $form->isblank("salesman_id", $locale->text("Salesman missing!")); + } &{"CT::save_$form->{db}"}("", \%myconfig, \%$form); $form->{callback} = $form->escape($form->{callback}, 1); @@ -1840,7 +1625,7 @@ sub get_shipto { sub get_delivery { $lxdebug->enter_sub(); - CT->get_delivery(\%myconfig, \%$form); + CT->get_delivery(\%myconfig, \%$form ); @column_index = $form->sort_columns(shiptoname, @@ -1848,7 +1633,6 @@ sub get_delivery { ordnumber, transdate, description, - adr_code, qty, unit); @@ -1864,8 +1648,6 @@ sub get_delivery { qq||; $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(); @@ -895,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|