From: Moritz Bunkus Date: Tue, 7 Jan 2014 10:36:44 +0000 (+0100) Subject: Merge branch 'kunden-lieferantennummernkreise-in-transnumbergenerator-2138' X-Git-Tag: release-3.1.0beta1~22^2~33 X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/commitdiff_plain/2da5d610ce0aeb43428de82e6b5e79acfb502628?hp=1cc2d84b58c54133d8d948d85994736f82f2fc88 Merge branch 'kunden-lieferantennummernkreise-in-transnumbergenerator-2138' --- diff --git a/SL/AR.pm b/SL/AR.pm index 80fc8ef7a..c52a00fd5 100644 --- a/SL/AR.pm +++ b/SL/AR.pm @@ -509,8 +509,8 @@ sub ar_transactions { qq|LEFT JOIN employee e ON (a.employee_id = e.id) | . qq|LEFT JOIN employee e2 ON (a.salesman_id = e2.id) | . qq|LEFT JOIN project pr ON (a.globalproject_id = pr.id)| . - qq|LEFT JOIN tax_zones tz ON (tz.id = c.taxzone_id)| . - qq|LEFT JOIN payment_terms pt ON (pt.id = c.payment_id)| . + qq|LEFT JOIN tax_zones tz ON (tz.id = a.taxzone_id)| . + qq|LEFT JOIN payment_terms pt ON (pt.id = a.payment_id)| . qq|LEFT JOIN business b ON (b.id = c.business_id)| . qq|LEFT JOIN department d ON (d.id = a.department_id)|; diff --git a/SL/Controller/CsvImport.pm b/SL/Controller/CsvImport.pm index 0ebf14164..50b5e4d05 100644 --- a/SL/Controller/CsvImport.pm +++ b/SL/Controller/CsvImport.pm @@ -165,16 +165,16 @@ sub action_report { my $pages = {}; $pages->{per_page} = $::form->{per_page} || 20; $pages->{max} = SL::DB::Helper::Paginated::ceil($num_rows, $pages->{per_page}) || 1; - $pages->{cur} = $page < 1 ? 1 + $pages->{page} = $page < 1 ? 1 : $page > $pages->{max} ? $pages->{max} : $page; - $pages->{common} = [ grep { $_->{visible} } @{ SL::DB::Helper::Paginated::make_common_pages($pages->{cur}, $pages->{max}) } ]; + $pages->{common} = [ grep { $_->{visible} } @{ SL::DB::Helper::Paginated::make_common_pages($pages->{page}, $pages->{max}) } ]; $self->{report_numheaders} = $self->{report}->numheaders; my $first_row_header = 0; my $last_row_header = $self->{report_numheaders} - 1; - my $first_row_data = $pages->{per_page} * ($pages->{cur}-1) + $self->{report_numheaders}; - my $last_row_data = min($pages->{per_page} * $pages->{cur}, $num_rows) + $self->{report_numheaders} - 1; + my $first_row_data = $pages->{per_page} * ($pages->{page}-1) + $self->{report_numheaders}; + my $last_row_data = min($pages->{per_page} * $pages->{page}, $num_rows) + $self->{report_numheaders} - 1; $self->{display_rows} = [ $first_row_header .. diff --git a/SL/Controller/CsvImport/Part.pm b/SL/Controller/CsvImport/Part.pm index 2ca12300a..0cb132f34 100644 --- a/SL/Controller/CsvImport/Part.pm +++ b/SL/Controller/CsvImport/Part.pm @@ -234,14 +234,13 @@ sub check_existing { sub handle_prices { my ($self, $entry) = @_; - foreach my $column (qw(sellprice listprice lastcost)) { - next unless $self->controller->headers->{used}->{ $column }; - + foreach my $column (qw(sellprice)) { + my $object = $entry->{object_to_save} || $entry->{object}; my $adjustment = $self->settings->{sellprice_adjustment}; - my $value = $entry->{object}->$column; + my $value = $object->$column; $value = $self->settings->{sellprice_adjustment_type} eq 'percent' ? $value * (100 + $adjustment) / 100 : $value + $adjustment; - $entry->{object}->$column($::form->round_amount($value, $self->settings->{sellprice_places})); + $object->$column($::form->round_amount($value, $self->settings->{sellprice_places})); } } diff --git a/SL/DB/Helper/PriceTaxCalculator.pm b/SL/DB/Helper/PriceTaxCalculator.pm index af5664694..2478292a4 100644 --- a/SL/DB/Helper/PriceTaxCalculator.pm +++ b/SL/DB/Helper/PriceTaxCalculator.pm @@ -124,6 +124,7 @@ sub _calculate_item { my $chart = $item->part->get_chart(type => $data->{is_sales} ? 'income' : 'expense', taxzone => $self->taxzone_id); $data->{amounts}->{ $chart->id } ||= { taxkey => $taxkey->taxkey_id, tax_id => $taxkey->tax_id, amount => 0 }; $data->{amounts}->{ $chart->id }->{amount} += $linetotal; + $data->{amounts}->{ $chart->id }->{amount} -= $tax_amount if $self->taxincluded; push @{ $data->{assembly_items} }, []; if ($item->part->is_assembly) { diff --git a/bin/mozilla/ic.pl b/bin/mozilla/ic.pl index a696f9c18..f986715eb 100644 --- a/bin/mozilla/ic.pl +++ b/bin/mozilla/ic.pl @@ -1918,7 +1918,7 @@ sub save { } else { $i = $form->{assembly_rows}; } - $form->{"qty_$i"} = 1 unless ($form->{"qty_$i"}); + $form->{"qty_$i"} = 1 unless ($form->{"qty_$i"} > 0); $form->{sellprice} -= $form->{"sellprice_$i"} * $form->{"qty_$i"}; $form->{weight} -= $form->{"weight_$i"} * $form->{"qty_$i"}; @@ -1935,7 +1935,7 @@ sub save { # set values for last invoice/order item $i = $form->{rowcount}; - $form->{"qty_$i"} = 1 unless ($form->{"qty_$i"}); + $form->{"qty_$i"} = 1 unless ($form->{"qty_$i"} > 0); map { $form->{"${_}_$i"} = $newform{$_} } qw(partnumber description bin unit listprice inventory_accno income_accno expense_accno sellprice lastcost price_factor_id); map { $form->{"ic_${_}_$i"} = $newform{$_} } @ic_cvar_fields; diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index 56a0354ef..0ba19916f 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -1196,12 +1196,17 @@ sub print { } $form->{print_and_save} = 1; my $formname = $form->{formname}; - &save(); + save(); $form->{formname} = $formname; - &edit(); + edit(); $::lxdebug->leave_sub(); ::end_of_request(); } + elsif (($form->{type} =~ /_order$/) || ($form->{type} =~ /_quotation$/)) { + $form->{print_and_save} = 1; + save(); + } + &print_form($old_form); diff --git a/bin/mozilla/rp.pl b/bin/mozilla/rp.pl index da60add0d..87fae36ba 100644 --- a/bin/mozilla/rp.pl +++ b/bin/mozilla/rp.pl @@ -375,6 +375,24 @@ sub generate_income_statement { . qq| $longcomparetodate|; } + if ( $::instance_conf->get_profit_determination eq 'balance' ) { + $form->{income_statement_title} = $locale->text('Income Statement'); + } elsif ( $::instance_conf->get_profit_determination eq 'income' ) { + $form->{income_statement_title} = $locale->text('Net Income Statement'); + } else { + $form->{income_statement_title} = ""; + }; + + if ( $form->{method} eq 'cash' ) { + $form->{accounting_method} = $locale->text('Cash accounting'); + } elsif ( $form->{method} eq 'accrual' ) { + $form->{accounting_method} = $locale->text('Accrual accounting'); + } else { + $form->{accounting_method} = ""; + }; + + $::form->{report_date} = $locale->text('Report date') . ": " . $::form->current_date; + $form->{IN} = "income_statement.html"; $form->parse_template; @@ -397,8 +415,9 @@ sub generate_balance_sheet { my $data = RP->balance_sheet(\%::myconfig, $::form); - $::form->{asofdate} ||= $::form->current_date; - $::form->{period} = $::locale->date(\%::myconfig, $::form->current_date, 1); + $::form->{asofdate} ||= $::form->current_date; + $::form->{report_title} = $::locale->text('Balance Sheet'); + $::form->{report_date} ||= $::form->current_date; ($::form->{department}) = split /--/, $::form->{department}; @@ -409,6 +428,8 @@ sub generate_balance_sheet { $::form->{this_period} = $::locale->date(\%::myconfig, $::form->{asofdate}, 0); $::form->{last_period} = $::locale->date(\%::myconfig, $::form->{compareasofdate}, 0); +# balance sheet isn't read from print templates anymore, +# instead use template in rp # $::form->{IN} = "balance_sheet.html"; $::form->header; diff --git a/doc/changelog b/doc/changelog index 28da8968f..240b18347 100644 --- a/doc/changelog +++ b/doc/changelog @@ -107,6 +107,7 @@ Bugfixes: - Punkt in Belegnummer korrekt für WebDAV File Feature escapt (Bug 2394) - Stornierte Rechnungen (sowohl die Stornorechnung als auch das Storno nicht Buchen oder Löschen, egal was in der Mandantenkonfiguration steht) + - Wiederkehrende Rechnung mit Steuer inklusive buchen Erlöse falsch (Bug 2314) 2012-12-10 - Release 3.0.0 diff --git a/locale/de/all b/locale/de/all index 6d60fb809..e7c9de414 100755 --- a/locale/de/all +++ b/locale/de/all @@ -270,6 +270,7 @@ $self->{texts} = { 'Background jobs and task server' => 'Hintergrund-Jobs und Task-Server', 'Balance' => 'Bilanz', 'Balance Sheet' => 'Bilanz', + 'Balance sheet date' => 'Bilanzstichtag', 'Balancing' => 'Bilanzierung', 'Bank' => 'Bank', 'Bank Code' => 'BLZ', @@ -1345,6 +1346,7 @@ $self->{texts} = { 'Name and Street' => 'Name und Straße', 'National Expenses' => 'Aufwand Inland', 'National Revenues' => 'Erlöse Inland', + 'Net Income Statement' => 'Einnahmenüberschußrechnung', 'Net amount' => 'Nettobetrag', 'Net amount (for verification)' => 'Nettobetrag (zur Überprüfung)', 'Netto Terms' => 'Zahlungsziel netto', @@ -1746,6 +1748,7 @@ $self->{texts} = { 'Report about warehouse contents' => 'Lagerbestand anzeigen', 'Report about warehouse transactions' => 'Lagerbuchungen anzeigen', 'Report and misc. Preferences' => 'Sonstige Einstellungen', + 'Report date' => 'Berichtsdatum', 'Report for' => 'Bericht für', 'Reports' => 'Berichte', 'Representative' => 'Vertreter', diff --git a/templates/print/RB/balance_sheet.html b/templates/print/RB/balance_sheet.html deleted file mode 100644 index 985b6eff5..000000000 --- a/templates/print/RB/balance_sheet.html +++ /dev/null @@ -1,100 +0,0 @@ - - - -

-<%company%> -
<%address%> - -

BILANZ -
<%period%> -

- - - - - - - - -<%foreach asset_account%> - - - - - - -<%end asset_account%> - - - - - - - - - - - - - - - - - -<%foreach liability_account%> - - - - - - -<%end liability_account%> - - - - - - - - - - - - - - - - -<%foreach equity_account%> - - - - - - -<%end equity_account%> - - - - - - - - - - - - - - - - - -
AKTIVA

<%this_period%><%last_period%>
<%asset_account%><%asset_this_period%><%asset_last_period%>


TOTAL<%total_assets_this_period%>
<%total_assets_last_period%>
PASSIVA
<%liability_account%><%liability_this_period%><%liability_last_period%>


TOTAL<%total_liabilities_this_period%>

-
<%total_liabilities_last_period%>

-
EIGENTUM

<%equity_account%><%equity_this_period%><%equity_last_period%>


TOTAL<%total_equity_this_period%>

-
<%total_equity_last_period%>

-
TOTAL PASSIVA & EIGENTUM<%total_this_period%>

<%total_last_period%>

- - - diff --git a/templates/print/RB/income_statement.html b/templates/print/RB/income_statement.html deleted file mode 100644 index 36b612b58..000000000 --- a/templates/print/RB/income_statement.html +++ /dev/null @@ -1,291 +0,0 @@ - - -

-Einnahmenüberschußrechnung

-

-EÜR- (Gewinnermittlung nach §4 Abs. 3 EStG) -
<%period%> -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
A. Betriebseinnahmen
- Umsatzerlöse - - <%eur1%> -
- sonstige Erlöse - - <%eur2%> -
- Privatanteile - - <%eur3%> -
- Zinserträge - - <%eur4%> -
- Außerordentliche Erträge - - <%eur5%> -
- Vereinnahmte Umsatzsteuer - - <%eur6%> -
- Umsatzsteuererstattungen - - <%eur7%> -

Summe Einnahmen<%sumeura%>


B. Betriebsausgaben
- Wareneingänge - - <%eur8%> -
- Löhne und Gehäter - - <%eur9%> -
- Gesetzlicher sozialer Aufwand - - <%eur10%> -
- Mieten - - <%eur11%> -
- Gas, Strom, Wasser - - <%eur12%> -
- Instandhaltung - - <%eur13%> -
- Steuern, Versicherungen, Beiträge - - <%eur14%> -
- Kfz-Steuern - - <%eur15%> -
- Kfz-Versicherungen - - <%eur16%> -
- Sonstige Fahrzeugkosten - - <%eur17%> -
- Werbe- und Reisekosten - - <%eur18%> -
- Instandhaltung und Werkzeuge - - <%eur19%> -
- Fachzeitschriften, Bücher - - <%eur20%> -
- Miete für Einrichtungen - - <%eur21%> -
- Rechts- und Beratungskosten - - <%eur22%> -
- Bürobedarf, Porto, Telefon - - <%eur23%> -
- Sonstige Aufwendungen - - <%eur24%> -
- Abschreibungen auf Anlagevermögen - - <%eur25%> -
- Abschreibungen auf GWG - - <%eur26%> -
- Vorsteuer - - <%eur27%> -
- Umsatzsteuerzahlungen - - <%eur28%> -
- Zinsaufwand - - <%eur29%> -
- Außerordentlicher Aufwand - - <%eur30%> -
- Betriebliche Steuern - - <%eur31%> -

Summe Ausgaben<%sumeurb%>

-


GEWINN / VERLUST<%guvsumme%>

- - - - diff --git a/templates/print/RB/income_statement.html b/templates/print/RB/income_statement.html new file mode 120000 index 000000000..3cdf3f191 --- /dev/null +++ b/templates/print/RB/income_statement.html @@ -0,0 +1 @@ +../../../templates/print/Standard/income_statement.html \ No newline at end of file diff --git a/templates/print/Standard/balance_sheet.html b/templates/print/Standard/balance_sheet.html deleted file mode 100644 index 985b6eff5..000000000 --- a/templates/print/Standard/balance_sheet.html +++ /dev/null @@ -1,100 +0,0 @@ - - - -

-<%company%> -
<%address%> - -

BILANZ -
<%period%> -

- - - - - - - - -<%foreach asset_account%> - - - - - - -<%end asset_account%> - - - - - - - - - - - - - - - - - -<%foreach liability_account%> - - - - - - -<%end liability_account%> - - - - - - - - - - - - - - - - -<%foreach equity_account%> - - - - - - -<%end equity_account%> - - - - - - - - - - - - - - - - - -
AKTIVA

<%this_period%><%last_period%>
<%asset_account%><%asset_this_period%><%asset_last_period%>


TOTAL<%total_assets_this_period%>
<%total_assets_last_period%>
PASSIVA
<%liability_account%><%liability_this_period%><%liability_last_period%>


TOTAL<%total_liabilities_this_period%>

-
<%total_liabilities_last_period%>

-
EIGENTUM

<%equity_account%><%equity_this_period%><%equity_last_period%>


TOTAL<%total_equity_this_period%>

-
<%total_equity_last_period%>

-
TOTAL PASSIVA & EIGENTUM<%total_this_period%>

<%total_last_period%>

- - - diff --git a/templates/print/Standard/income_statement.html b/templates/print/Standard/income_statement.html index 36b612b58..1cad89969 100644 --- a/templates/print/Standard/income_statement.html +++ b/templates/print/Standard/income_statement.html @@ -1,9 +1,11 @@ -

-Einnahmenüberschußrechnung

-

-EÜR- (Gewinnermittlung nach §4 Abs. 3 EStG) -
<%period%> +

<%income_statement_title%>

+

+<%period%>
+<%accounting_method%>
+ +
<%report_date%>

diff --git a/templates/print/f-tex/balance_sheet.html b/templates/print/f-tex/balance_sheet.html deleted file mode 100644 index 478caabca..000000000 --- a/templates/print/f-tex/balance_sheet.html +++ /dev/null @@ -1,100 +0,0 @@ - - - -

-<%company%> -
<%address%> - -

BALANCE SHEET -
<%period%> -

- -
- - - - - - -<%foreach asset_account%> - - - - - - -<%end asset_account%> - - - - - - - - - - - - - - - - - -<%foreach liability_account%> - - - - - - -<%end liability_account%> - - - - - - - - - - - - - - - - -<%foreach equity_account%> - - - - - - -<%end equity_account%> - - - - - - - - - - - - - - - - - -
ASSETS

<%this_period%><%last_period%>
<%asset_account%><%asset_this_period%><%asset_last_period%>


TOTAL ASSETS<%total_assets_this_period%>
<%total_assets_last_period%>
LIABILITIES
<%liability_account%><%liability_this_period%><%liability_last_period%>


Total Liabilities<%total_liabilities_this_period%>

-
<%total_liabilities_last_period%>

-
SHAREHOLDER'S EQUITY

<%equity_account%><%equity_this_period%><%equity_last_period%>


Total Equity<%total_equity_this_period%>

-
<%total_equity_last_period%>

-
TOTAL LIABILITIES & EQUITY<%total_this_period%>

<%total_last_period%>

- - - diff --git a/templates/webpages/rp/balance_sheet.html b/templates/webpages/rp/balance_sheet.html index 675790db3..fad142cb4 100644 --- a/templates/webpages/rp/balance_sheet.html +++ b/templates/webpages/rp/balance_sheet.html @@ -5,14 +5,15 @@ [% company %]
[% address %]

[% 'BALANCE SHEET' | $T8 %] -
[% period %] +
[% 'Balance sheet date' | $T8 %]: [% this_period %] +
[% 'Report date' | $T8 %]: [% report_date %] - - + + [% FOREACH row = A %]
[% 'ASSETS' | $T8 %]

[% this_period %][% last_period %][% this_period %][% last_period %]