X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Frp.pl;h=c3117846a8c2961b68127293fbbf31881490e049;hb=8cef58b276ce4005c0e2ada350fecd5d7a103e89;hp=7e931d46803b508869ae835776b7eec1eef0fe0f;hpb=22573a5bbc295ce814d5d121ad5fd105dd4e6ad0;p=kivitendo-erp.git diff --git a/bin/mozilla/rp.pl b/bin/mozilla/rp.pl index 7e931d468..c3117846a 100644 --- a/bin/mozilla/rp.pl +++ b/bin/mozilla/rp.pl @@ -36,9 +36,11 @@ #====================================================================== require "$form->{path}/arap.pl"; +require "bin/mozilla/common.pl"; use SL::PE; use SL::RP; +use SL::USTVA; 1; @@ -130,6 +132,21 @@ sub report { | if $form->{selectdepartment}; + $form->get_lists("projects" => { "key" => "ALL_PROJECTS", + "all" => 1 }); + + my %project_labels = (); + my @project_values = (""); + foreach my $item (@{ $form->{"ALL_PROJECTS"} }) { + push(@project_values, $item->{"id"}); + $project_labels{$item->{"id"}} = $item->{"projectnumber"}; + } + + my $projectnumber = + NTI($cgi->popup_menu('-name' => "project_id", + '-values' => \@project_values, + '-labels' => \%project_labels)); + # use JavaScript Calendar or not $form->{jsscript} = $jscalendar; $jsscript = ""; @@ -183,7 +200,7 @@ sub report { if ($name_1 eq "") { $button1 = qq| - |; + |; $button1_2 = qq| text('button') . qq|>|; @@ -193,12 +210,12 @@ sub report { Form->write_trigger(\%myconfig, "1", "$name_2", "BR", "$trigger_2"); } else { $button1 = qq| - |; + |; $button1_2 = qq| text('button') . qq|>|; $button2 = qq| - |; + |; $button2_2 = qq| text('button') . qq|> @@ -214,19 +231,21 @@ sub report { # without JavaScript Calendar if ($name_1 eq "") { $button1 = - qq||; + qq||; } else { $button1 = - qq||; + qq||; $button2 = - qq||; + qq||; } } - + $form->{javascript} .= qq||; $form->header; - + $onload = qq|focus()|; + $onload .= qq|;setupDateFormat('|. $myconfig{dateformat} .qq|', '|. $locale->text("Falsches Datumsformat!") .qq|')|; + $onload .= qq|;setupPoints('|. $myconfig{numberformat} .qq|', '|. $locale->text("wrongformat") .qq|')|; print qq| - +
{script}> @@ -280,7 +299,7 @@ $jsscript print qq| | . $locale->text('Project') . qq| - + $projectnumber @@ -390,7 +409,7 @@ $jsscript print qq| | . $locale->text('Project') . qq| - + $projectnumber @@ -687,8 +706,6 @@ $jsscript } if ($form->{report} =~ /^tax_/) { - $gifi = ""; - $form->{db} = ($form->{report} =~ /_collected/) ? "ar" : "ap"; RP->get_taxaccounts(\%myconfig, \%$form); @@ -725,32 +742,6 @@ $jsscript -|; - - if (@{ $form->{gifi_taxaccounts} }) { - print qq| - - | . $locale->text('GIFI') . qq| - -|; - - foreach $ref (@{ $form->{gifi_taxaccounts} }) { - - print - qq| $ref->{description} - - - |; - - } - - print qq| - - -|; - } - - print qq| | . $locale->text('Method') . qq| | @@ -807,8 +798,6 @@ $jsscript } if ($form->{report} =~ /^nontaxable_/) { - $gifi = ""; - $form->{db} = ($form->{report} =~ /_sales/) ? "ar" : "ap"; print qq| @@ -872,8 +861,6 @@ $jsscript } if (($form->{report} eq "ar_aging") || ($form->{report} eq "ap_aging")) { - $gifi = ""; - if ($form->{report} eq 'ar_aging') { $label = $locale->text('Customer'); $form->{vc} = 'customer'; @@ -922,8 +909,6 @@ $jsscript # above action can be removed if there is more than one input field if ($form->{report} =~ /(receipts|payments)$/) { - $gifi = ""; - $form->{db} = ($form->{report} =~ /payments$/) ? "ap" : "ar"; RP->paymentaccounts(\%myconfig, \%$form); @@ -1001,9 +986,8 @@ $jsscript . $locale->text('Continue') . qq|"> |; - # Hier Aufruf von get_config aus bin/mozilla/fa.pl zum - # Einlesen der Finanzamtdaten - get_config($userspath, 'finanzamt.ini'); + # Hier Aufruf von get_config zum Einlesen der Finanzamtdaten + USTVA->get_config($userspath, 'finanzamt.ini'); $disabled = qq|disabled="disabled"|; $disabled = '' if ($form->{elster} eq '1'); @@ -1030,7 +1014,7 @@ $jsscript $lxdebug->leave_sub(); } -sub continue { &{ $form->{nextsub} } } +sub continue { call_sub($form->{"nextsub"}); } sub get_project { $lxdebug->enter_sub(); @@ -1062,10 +1046,6 @@ sub generate_income_statement { $form->{endbold} = ""; $form->{br} = "
"; - &get_project(generate_income_statement); - - $form->{projectnumber} = $form->{projectnumber_1}; - if ($form->{reporttype} eq "custom") { #forgotten the year --> thisyear @@ -1346,11 +1326,6 @@ sub list_accounts { $column_header{endbalance} = qq|| . $locale->text('Balance') . qq||; - if ($form->{accounttype} eq 'gifi') { - $column_header{accno} = - qq|| . $locale->text('GIFI') . qq||; - } - $form->header; print qq| @@ -1381,15 +1356,7 @@ sub list_accounts { $description = $form->escape($ref->{description}); $href = - qq|ca.pl?path=$form->{path}&action=list_transactions&accounttype=$form->{accounttype}&login=$form->{login}&password=$form->{password}&fromdate=$form->{fromdate}&todate=$form->{todate}&sort=transdate&l_heading=$form->{l_heading}&l_subtotal=$form->{l_subtotal}&department=$department&eur=$form->{eur}&projectnumber=$projectnumber&project_id=$form->{project_id}&title=$title&nextsub=$form->{nextsub}|; - - if ($form->{accounttype} eq 'gifi') { - $href .= "&gifi_accno=$ref->{accno}&gifi_description=$description"; - $na = $locale->text('N/A'); - map { $ref->{$_} = $na } qw(accno description) unless $ref->{accno}; - } else { - $href .= "&accno=$ref->{accno}&description=$description"; - } + qq|ca.pl?path=$form->{path}&action=list_transactions&accounttype=$form->{accounttype}&login=$form->{login}&password=$form->{password}&fromdate=$form->{fromdate}&todate=$form->{todate}&sort=transdate&l_heading=$form->{l_heading}&l_subtotal=$form->{l_subtotal}&department=$department&eur=$form->{eur}&projectnumber=$projectnumber&project_id=$form->{project_id}&title=$title&nextsub=$form->{nextsub}&accno=$ref->{accno}&description=$description|; $ml = ($ref->{category} =~ /(A|C|E)/) ? -1 : 1; @@ -1851,16 +1818,10 @@ sub aging { -|; - } - - if ($form->{menubar}) { - require "$form->{path}/menu.pl"; - &menubar; - } + . $locale->text('E-mail') . qq|">|; +} - print qq| +print qq|
@@ -2044,21 +2005,36 @@ sub print { sub print_form { $lxdebug->enter_sub(); + my %replacements = + ( + "ä" => "ae", "ö" => "oe", "ü" => "ue", + "Ä" => "Ae", "Ö" => "Oe", "Ü" => "Ue", + "ß" => "ss", + " " => "_" + ); + $form->{statementdate} = $locale->date(\%myconfig, $form->{todate}, 1); $form->{templates} = "$myconfig{templates}"; - $form->{IN} = "$form->{type}.html"; - + my $suffix = "html"; + my $attachment_suffix = "html"; if ($form->{format} eq 'postscript') { $form->{postscript} = 1; - $form->{IN} =~ s/html$/tex/; - } - if ($form->{format} eq 'pdf') { + $suffix = "tex"; + $attachment_suffix = "ps"; + } elsif ($form->{format} eq 'pdf') { $form->{pdf} = 1; - $form->{IN} =~ s/html$/tex/; + $suffix = "tex"; + $attachment_suffix = "pdf"; } + $form->{IN} = "$form->{type}.$suffix"; + + + # Save $form->{email} because it will be overwritten. + $form->{EMAIL_RECIPIENT} = $form->{email}; + $i = 0; while (@{ $form->{AG} }) { @@ -2115,12 +2091,22 @@ sub print_form { $form->format_amount(\%myconfig, $form->{"${_}total"}, 2) } (c0, c30, c60, c90, ""); + $form->{attachment_filename} = $locale->text("Statement") . "_$form->{todate}.$attachment_suffix"; + map({ $form->{attachment_filename} =~ s/$_/$replacements{$_}/g; } keys(%replacements)); + $form->parse_template(\%myconfig, $userspath); } } } - + # saving the history + if(!exists $form->{addition} && $form->{id} ne "") { + $form->{snumbers} = qq|ordnumber_| . $form->{ordnumber}; + $form->{addition} = "PRINTED"; + $form->{what_done} = $form->{type}; + $form->save_history($form->dbconnect(\%myconfig)); + } + # /saving the history $lxdebug->leave_sub(); } @@ -2133,10 +2119,10 @@ sub statement_details { push @{ $form->{duedate} }, $ref->{duedate}; foreach $item (qw(c0 c30 c60 c90)) { - eval { + if ($ref->{exchangerate} * 1) { $ref->{$item} = $form->round_amount($ref->{$item} / $ref->{exchangerate}, 2); - }; + } $form->{"${item}total"} += $ref->{$item}; $form->{total} += $ref->{$item}; push @{ $form->{$item} }, @@ -2155,12 +2141,6 @@ sub generate_tax_report { $description = $form->escape($form->{$descvar}); $ratevar = "$form->{accno}_rate"; - if ($form->{accno} =~ /^gifi_/) { - $descvar = "gifi_$form->{accno}_description"; - $description = $form->escape($form->{$descvar}); - $ratevar = "gifi_$form->{accno}_rate"; - } - $department = $form->escape($form->{department}); # construct href @@ -2173,9 +2153,6 @@ sub generate_tax_report { $callback = "$form->{script}?path=$form->{path}&action=generate_tax_report&login=$form->{login}&password=$form->{password}&fromdate=$form->{fromdate}&todate=$form->{todate}&db=$form->{db}&method=$form->{method}&accno=$form->{accno}&$descvar=$description&department=$department&$ratevar=$taxrate&report=$form->{report}"; - $form->{title} = $locale->text('GIFI') . " - " - if ($form->{accno} =~ /^gifi_/); - $title = $form->escape($form->{title}); $href .= "&title=$title"; $title = $form->escape($form->{title}, 1); @@ -2720,8 +2697,6 @@ sub generate_bwa { $form->{endbold} = ""; $form->{br} = "
"; - # &get_project(generate_bwa); - if ($form->{reporttype} eq "custom") { #forgotten the year --> thisyear @@ -2910,9 +2885,8 @@ sub generate_bwa { sub generate_ustva { $lxdebug->enter_sub(); - # Hier Aufruf von get_config aus bin/mozilla/fa.pl zum - # Einlesen der Finanzamtdaten - get_config($userspath, 'finanzamt.ini'); + # Hier Aufruf von get_config zum Einlesen der Finanzamtdaten + USTVA->get_config($userspath, 'finanzamt.ini'); # &get_project(generate_bwa); @anmeldungszeitraum =