X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fct.pl;h=49672ab54e8ecf1a084dee22fdf1c1a1a24eac70;hb=a14a3ff56b00e22c39a2cfb0e465f8c7764a4cd4;hp=beefcc1fb7d014a518427c3bcd518cb40be3d406;hpb=54e4131e091831e00a861fe2c4f53e344b87ddca;p=kivitendo-erp.git diff --git a/bin/mozilla/ct.pl b/bin/mozilla/ct.pl index beefcc1fb..49672ab54 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 +855,8 @@ sub form_header { $form->{selectpricegroup} =~ s/( - - + + + @@ -1180,7 +966,7 @@ sub form_header { - + $customer @@ -1207,9 +993,6 @@ sub form_header { - - $taxzone
- - -|; - - 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| @@ -892,14 +675,15 @@ sub form_header { my $pjy = new CGI::Ajax( 'get_shipto' => $get_shipto_url ); $form->{selectshipto} = ""; + $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('Credit Limit') . qq| | . $locale->text('Terms: Net') . qq|| - . $locale->text('days') . qq|| . $locale->text('Payment Terms') . qq| | . $locale->text('Discount') . qq| %| . $locale->text('Tax Number / SSN') . qq| | . $locale->text('USt-IdNr.') . qq|
| . $locale->text('Obsolete') . qq| {obsolete}>| . $locale->text('Payment Terms') . qq|
@@ -1383,9 +1166,11 @@ $shipto $delivery | . $locale->text('From') . qq| - - | . $locale->text('Bis') . qq| - + + + | . $locale->text('To (time)') . qq| + + @@ -1398,7 +1183,8 @@ $shipto -|; +| . $form->write_trigger(\%myconfig, 2, "from", "BL", "trigger_from", + "to", "BL", "trigger_to"); $lxdebug->leave_sub(); } @@ -1429,7 +1215,7 @@ sub form_footer { ## print qq| -{id}> +{id}> @@ -1439,7 +1225,7 @@ sub form_footer { {password}> -{db}> +{db}> @@ -1486,6 +1272,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); @@ -1571,8 +1360,10 @@ sub save_and_close { if ($vertreter && $form->{db} eq "customer") { $form->isblank("salesman_id", $locale->text("Salesman missing!")); } - &{"CT::save_$form->{db}"}("", \%myconfig, \%$form); - + $rc = &{"CT::save_$form->{db}"}("", \%myconfig, \%$form); + if ($rc == 3) { + $form->error($locale->text('customernumber not unique!')); + } $form->redirect($locale->text($msg)); $lxdebug->leave_sub(); @@ -1836,7 +1627,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, @@ -1844,7 +1635,6 @@ sub get_delivery { ordnumber, transdate, description, - adr_code, qty, unit); @@ -1860,8 +1650,6 @@ sub get_delivery { qq|| . $locale->text('Invdate') . qq||; $column_header{description} = qq|| . $locale->text('Description') . qq||; - $column_header{adr_code} = - qq|| . $locale->text('ADR') . qq||; $column_header{qty} = qq|| . $locale->text('Qty') . qq||; $column_header{unit} =