$additional_params->{"conf_lizenzen"} = $main::lizenzen;
$additional_params->{"conf_latex_templates"} = $main::latex;
$additional_params->{"conf_opendocument_templates"} = $main::opendocument_templates;
+ $additional_params->{"conf_vertreter"} = $main::vertreter;
if (%main::debug_options) {
map { $additional_params->{'DEBUG_' . uc($_)} = $main::debug_options{$_} } keys %main::debug_options;
my ($self, $dbh, $key) = @_;
- $key = "all_business_types" unless ($key);
- $self->{$key} =
- selectall_hashref_query($self, $dbh, qq|SELECT * FROM business|);
+ my $options = ref $key eq 'HASH' ? $key : { key => $key };
+ $options->{key} ||= "all_business_types";
+ my $where = '';
+
+ if (exists $options->{salesman}) {
+ $where = 'WHERE ' . ($options->{salesman} ? '' : 'NOT ') . 'COALESCE(salesman)';
+ }
+
+ $self->{ $options->{key} } = selectall_hashref_query($self, $dbh, qq|SELECT * FROM business $where ORDER BY lower(description)|);
$main::lxdebug->leave_sub();
}
sub current_date {
$main::lxdebug->enter_sub();
- my ($self, $myconfig, $thisdate, $days) = @_;
+ my $self = shift;
+ my $myconfig = shift || \%::myconfig;
+ my ($thisdate, $days) = @_;
my $dbh = $self->get_standard_dbh($myconfig);
my $query;
my %formname_setup =
(
- "balance_sheet" => { "translation" => $locale->text('Balance Sheet'), "html" => 1 },
+# "balance_sheet" => { "translation" => $locale->text('Balance Sheet'), "html" => 1 },
"bin_list" => $locale->text('Bin List'),
"bwa" => { "translation" => $locale->text('BWA'), "html" => 1 },
"check" => { "translation" => $locale->text('Check'), "html" => 1 },
my %myconfig = %main::myconfig;
my $locale = $main::locale;
- $form->get_lists("employees" => "ALL_EMPLOYEES",
- "taxzones" => "ALL_TAXZONES");
+ $form->get_lists(employees => "ALL_EMPLOYEES",
+ taxzones => "ALL_TAXZONES",
+ business_types => { key => 'ALL_SALESMAN_BUSINESSES', salesman => 1 });
$form->get_pricegroup(\%myconfig, { all => 1 });
$form->{ALL_SALESMEN} = $form->{ALL_EMPLOYEES};
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) {
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) {
}
sub generate_balance_sheet {
- $main::lxdebug->enter_sub();
-
- $main::auth->assert('report');
-
- my $form = $main::form;
- my %myconfig = %main::myconfig;
- my $locale = $main::locale;
+ $::lxdebug->enter_sub;
+ $::auth->assert('report');
- $form->{decimalplaces} = $form->{decimalplaces} * 1 || 2;
- $form->{padding} = " ";
- $form->{bold} = "<b>";
- $form->{endbold} = "</b>";
- $form->{br} = "<br>";
+ $::form->{decimalplaces} = $::form->{decimalplaces} * 1 || 2;
+ $::form->{padding} = " ";
+ $::form->{bold} = "<b>";
+ $::form->{endbold} = "</b>";
+ $::form->{br} = "<br>";
- my $data = RP->balance_sheet(\%myconfig, \%$form);
+ my $data = RP->balance_sheet(\%::myconfig, $::form);
- $form->{asofdate} = $form->current_date(\%myconfig) unless $form->{asofdate};
- $form->{period} = $locale->date(\%myconfig, $form->current_date(\%myconfig), 1);
+ $::form->{asofdate} ||= $::form->current_date;
+ $::form->{period} = $::locale->date(\%::myconfig, $::form->current_date, 1);
- ($form->{department}) = split /--/, $form->{department};
+ ($::form->{department}) = split /--/, $::form->{department};
# define Current Earnings account
- my $padding = ($form->{l_heading}) ? $form->{padding} : "";
- push(@{ $form->{equity_account} }, $padding . $locale->text('Current Earnings'));
+ my $padding = $::form->{l_heading} ? $::form->{padding} : "";
+ push @{ $::form->{equity_account} }, $padding . $::locale->text('Current Earnings');
- $form->{this_period} = $locale->date(\%myconfig, $form->{asofdate}, 0);
- $form->{last_period} = $locale->date(\%myconfig, $form->{compareasofdate}, 0);
+ $::form->{this_period} = $::locale->date(\%::myconfig, $::form->{asofdate}, 0);
+ $::form->{last_period} = $::locale->date(\%::myconfig, $::form->{compareasofdate}, 0);
- $form->{IN} = "balance_sheet.html";
+# $::form->{IN} = "balance_sheet.html";
# setup company variables for the form
- map { $form->{$_} = $myconfig{$_}; } (qw(company address businessnumber nativecurr));
+ map { $::form->{$_} = $::myconfig{$_} } qw(company address businessnumber nativecurr);
- $form->{templates} = $myconfig{templates};
+ $::form->{templates} = $::myconfig{templates};
- $form->header();
- print $form->parse_html_template('rp/balance_sheet', $data);
-# $form->parse_template();
+ $::form->header;
+ print $::form->parse_html_template('rp/balance_sheet', $data);
- $main::lxdebug->leave_sub();
+ $::lxdebug->leave_sub;
}
sub generate_projects {
}
} else {
# die konvertierungen nur dann durchführen, wenn auch daten gesetzt sind.
- # ansonsten ist die prüfung in RP.pm
+ # ansonsten ist die prüfung in RP.pm
# if (defined ($form->{fromdate|todate}=='..'))
# immer wahr
if ($form->{fromdate}){
Liste gefixter Bugs aus dem Bugtracker:
922 940 1017 1024 1025 1028 1030 1031 1034 1035 1036 1037 1040 1043
- 1044 1046 1051 1055 1057 1058 1071 1072 1073 1077 1079 1081 1082 1095
- 1098 1100 1101 1108 1110 1118 1125 1127 1130 1133 1135 1136 1138 1144
- 1146 1147 1150 1151 1155 1164 1173 1177 1186 1188 1190 1191 1195 1197
- 1199 1201
+ 1044 1046 1051 1055 1057 1058 1072 1073 1077 1079 1081 1082 1095 1098
+ 1100 1101 1108 1110 1118 1125 1127 1130 1133 1135 1136 1138 1144
+ 1146 1147 1150 1151 1155 1164 1173 1177 1186 1188 1190 1191 1195
+ 1197 1199 1200 1201 1250
2009-06-02 - Version 2.6.0
'Report and misc. Preferences' => 'Sonstige Einstellungen',
'Report for' => 'Bericht für',
'Reports' => 'Berichte',
+ 'Representative' => 'Vertreter',
'Reqdate' => 'Lieferdatum',
'Request for Quotation' => 'Anfrage',
'Request for Quotations' => 'Anfragen',
'Trying to call a sub without a name' => 'Es wurde versucht, eine Unterfunktion ohne Namen aufzurufen.',
'Type' => 'Typ',
'Type of Business' => 'Kunden-/Lieferantentyp',
+ 'Type of Customer' => 'Kundentyp',
+ 'Type of Vendor' => 'Lieferantentyp',
'USTVA' => 'USTVA',
'USTVA 2004' => 'USTVA 2004',
'USTVA 2005' => 'USTVA 2005',
'User migration complete' => 'Benutzermigration abgeschlossen',
'User name' => 'Benutzername',
'User saved!' => 'Benutzer gespeichert!',
+ 'Username' => 'Benutzername',
'Users in<br>this group' => 'Benutzer in<br>dieser Gruppe',
'Users not in this group' => 'Benutzer nicht in dieser Gruppe',
'Ust-IDNr' => 'USt-IdNr.',
'quotation' => 'quotation',
'reformat_numbers' => 'reformat_numbers',
'relink_accounts' => 'relink_accounts',
+ 'remove_emptied_rows' => 'remove_emptied_rows',
'report_generator_back' => 'report_generator_back',
'report_generator_dispatcher' => 'report_generator_dispatcher',
'report_generator_do' => 'report_generator_do',
'redo_stock_info' => 'redo_stock_info',
'reformat_numbers' => 'reformat_numbers',
'relink_accounts' => 'relink_accounts',
+ 'remove_emptied_rows' => 'remove_emptied_rows',
'report_generator_back' => 'report_generator_back',
'report_generator_dispatcher' => 'report_generator_dispatcher',
'report_generator_do' => 'report_generator_do',
'quotation' => 'quotation',
'reformat_numbers' => 'reformat_numbers',
'relink_accounts' => 'relink_accounts',
+ 'remove_emptied_rows' => 'remove_emptied_rows',
'report_generator_back' => 'report_generator_back',
'report_generator_dispatcher' => 'report_generator_dispatcher',
'report_generator_do' => 'report_generator_do',
'quotation' => 'quotation',
'reformat_numbers' => 'reformat_numbers',
'relink_accounts' => 'relink_accounts',
+ 'remove_emptied_rows' => 'remove_emptied_rows',
'request_for_quotation' => 'request_for_quotation',
'retrieve_partunits' => 'retrieve_partunits',
'sales_invoice' => 'sales_invoice',
'reformat_numbers' => 'reformat_numbers',
'relink_accounts' => 'relink_accounts',
'remove_draft' => 'remove_draft',
+ 'remove_emptied_rows' => 'remove_emptied_rows',
'request_for_quotation' => 'request_for_quotation',
'retrieve_partunits' => 'retrieve_partunits',
'sales_invoice' => 'sales_invoice',
'reformat_numbers' => 'reformat_numbers',
'relink_accounts' => 'relink_accounts',
'remove_draft' => 'remove_draft',
+ 'remove_emptied_rows' => 'remove_emptied_rows',
'request_for_quotation' => 'request_for_quotation',
'retrieve_partunits' => 'retrieve_partunits',
'sales_invoice' => 'sales_invoice',
'redo_stock_info' => 'redo_stock_info',
'reformat_numbers' => 'reformat_numbers',
'relink_accounts' => 'relink_accounts',
+ 'remove_emptied_rows' => 'remove_emptied_rows',
'report' => 'report',
'report_for_todo_list' => 'report_for_todo_list',
'report_generator_back' => 'report_generator_back',
'redo_stock_info' => 'redo_stock_info',
'reformat_numbers' => 'reformat_numbers',
'relink_accounts' => 'relink_accounts',
+ 'remove_emptied_rows' => 'remove_emptied_rows',
'report_for_todo_list' => 'report_for_todo_list',
'report_generator_back' => 'report_generator_back',
'report_generator_dispatcher' => 'report_generator_dispatcher',
'redo_stock_info' => 'redo_stock_info',
'reformat_numbers' => 'reformat_numbers',
'relink_accounts' => 'relink_accounts',
+ 'remove_emptied_rows' => 'remove_emptied_rows',
'report' => 'report',
'report_for_todo_list' => 'report_for_todo_list',
'report_generator_back' => 'report_generator_back',
-[% USE HTML %][% USE LxERP %]<body onLoad="fokus()">
+[% USE HTML %][% USE LxERP %]
+<body onLoad="fokus()">
<div class="listtop">[% title %]</div>
<table width="100%">
<tr height="5"></tr>
+ [% IF conf_vertreter %]
+ <tr>
+ <th align="right">[% IF is_customer %]Kundentyp[%- ELSE %]Lieferantentyp[%- END %]</th>
+ <td>
+ [%- INCLUDE generic/multibox.html
+ name = 'business',
+ DATA = all_business,
+ show_empty = 1,
+ id_key = 'id',
+ label_key = 'description',
+ -%]
+ </td>
+ </tr>
+ <tr>
+ <th align="right">Vertreter</th>
+ <td>
+ [%- INCLUDE generic/multibox.html
+ name = 'salesman_id',
+ DATA = ALL_SALESMAN_BUSINESSES,
+ show_empty = 1,
+ id_key = 'id',
+ label_key = 'description',
+ -%]
+ </td>
+ </tr>
+ [%- END %]
<tr>
[%- IF is_customer %]
<th align="right" nowrap>Kundennummer</th>
<td><input name="bic" size="10" maxlength="100" value="[% HTML.escape(bic) %]"></td>
</tr>
+ [%- IF conf_vertreter %]
+ <tr>
+ <th align="right">Benutzername</th>
+ <td><input name="username" maxlength="50" value="[% HTML.escape(username) %]"></td>
+ <th align="right">Passwort</th>
+ <td><input name="user_password" value="[% HTML.escape(user_password) %]"></td>
+ </tr>
+ [%- END %]
+
<tr>
- <th align="right">Kunden-/Lieferantentyp</th>
- <td>
- [%- INCLUDE generic/multibox.html
- name = 'business',
- DATA = all_business,
- show_empty = 1,
- id_key = 'id',
- label_key = 'description',
- -%]
- </td>
+ [% UNLESS conf_vertreter %]
+ <th align="right">[% IF is_customer %]Kundentyp[% ELSE %]Lieferantentyp[%- END %]</th>
+ <td>
+ [%- INCLUDE generic/multibox.html
+ name = 'business',
+ DATA = all_business,
+ show_empty = 1,
+ id_key = 'id',
+ label_key = 'description',
+ -%]
+ </td>
+ [%- END %]
<th align="right">Sprache</th>
<td>
[%- INCLUDE generic/multibox.html
label_key = 'description',
-%]
</td>
- [%- IF is_customer %]
+ [%- IF is_customer && !use_vertreter %]
<th align="right">Verkäufer/in</th>
<td>
[%- INCLUDE generic/multibox.html
-[% USE HTML %][% USE LxERP %]<body onLoad="fokus()">
+[% USE HTML %][% USE LxERP %]
+<body onLoad="fokus()">
<div class="listtop">[% title %]</div>
<table width="100%">
<tr height="5"></tr>
+ [% IF conf_vertreter %]
+ <tr>
+ <th align="right">[% IF is_customer %]<translate>Type of Customer</translate>[%- ELSE %]<translate>Type of Vendor</translate>[%- END %]</th>
+ <td>
+ [%- INCLUDE generic/multibox.html
+ name = 'business',
+ DATA = all_business,
+ show_empty = 1,
+ id_key = 'id',
+ label_key = 'description',
+ -%]
+ </td>
+ </tr>
+ <tr>
+ <th align="right"><translate>Representative</translate></th>
+ <td>
+ [%- INCLUDE generic/multibox.html
+ name = 'salesman_id',
+ DATA = ALL_SALESMAN_BUSINESSES,
+ show_empty = 1,
+ id_key = 'id',
+ label_key = 'description',
+ -%]
+ </td>
+ </tr>
+ [%- END %]
<tr>
[%- IF is_customer %]
<th align="right" nowrap><translate>Customer Number</translate></th>
<td><input name="bic" size="10" maxlength="100" value="[% HTML.escape(bic) %]"></td>
</tr>
+ [%- IF conf_vertreter %]
+ <tr>
+ <th align="right"><translate>Username</translate></th>
+ <td><input name="username" maxlength="50" value="[% HTML.escape(username) %]"></td>
+ <th align="right"><translate>Password</translate></th>
+ <td><input name="user_password" value="[% HTML.escape(user_password) %]"></td>
+ </tr>
+ [%- END %]
+
<tr>
- <th align="right"><translate>Type of Business</translate></th>
- <td>
- [%- INCLUDE generic/multibox.html
- name = 'business',
- DATA = all_business,
- show_empty = 1,
- id_key = 'id',
- label_key = 'description',
- -%]
- </td>
+ [% UNLESS conf_vertreter %]
+ <th align="right">[% IF is_customer %]<translate>Type of Customer</translate>[% ELSE %]<translate>Type of Vendor</translate>[%- END %]</th>
+ <td>
+ [%- INCLUDE generic/multibox.html
+ name = 'business',
+ DATA = all_business,
+ show_empty = 1,
+ id_key = 'id',
+ label_key = 'description',
+ -%]
+ </td>
+ [%- END %]
<th align="right"><translate>Language</translate></th>
<td>
[%- INCLUDE generic/multibox.html
label_key = 'description',
-%]
</td>
- [%- IF is_customer %]
+ [%- IF is_customer && !use_vertreter %]
<th align="right"><translate>Salesman</translate></th>
<td>
[%- INCLUDE generic/multibox.html