Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 43f9b1c5

Von G. Richardson vor mehr als 13 Jahren hinzugefügt

  • ID 43f9b1c512be9bc2199369c2f5accea32b8bd423
  • Vorgänger 45de0008
  • Nachfolger 306fad80

Umstellung von eur zu 3 Variablen in defaults

accounting_method inventory_system profit_determination

Details siehe doc/umstellung_eur.txt

Unterschiede anzeigen:

SL/DB/Helper/PriceTaxCalculator.pm
167 167
sub _calculate_assembly_item {
168 168
  my ($self, $data, $part, $total_qty, $base_factor) = @_;
169 169

  
170
  return 0 if $::lx_office_conf{system}->{eur} || !$data->{is_invoice};
170
  return 0 if $::instance_conf->get_inventory_system eq 'periodic' || !$data->{is_invoice};
171 171

  
172 172
  foreach my $assembly_entry (@{ $part->assemblies }) {
173 173
    push @{ $data->{assembly_items}->[-1] }, { part      => $assembly_entry->part,
......
188 188

  
189 189
  _dbg("cpsi tq " . $total_qty);
190 190

  
191
  return 0 if $::lx_office_conf{system}->{eur} || !$data->{is_invoice} || !$total_qty;
191
  return 0 if $::instance_conf->get_inventory_system eq 'periodic' || !$data->{is_invoice} || !$total_qty;
192 192

  
193 193
  my ($entry);
194 194
  $base_factor           ||= 1;
SL/DB/MetaSetup/Default.pm
43 43
    sdonumber                  => { type => 'text' },
44 44
    ar_paid_accno_id           => { type => 'integer' },
45 45
    id                         => { type => 'serial', not_null => 1 },
46
    accounting_method          => { type => 'text' },
47
    inventory_system           => { type => 'text' },
48
    profit_determination       => { type => 'text' },
46 49
  ],
47 50

  
48 51
  primary_key_columns => [ 'id' ],
SL/IR.pm
103 103
    $form->{"qty_$i"}  = $form->parse_amount($myconfig, $form->{"qty_$i"});
104 104
    $form->{"qty_$i"} *= -1 if $form->{storno};
105 105

  
106
    $form->{"inventory_accno_$i"} = $form->{"expense_accno_$i"} if $::lx_office_conf{system}->{eur};
106
    if ( $::instance_conf->get_inventory_system eq 'periodic') {
107
      # inventory account number is overwritten with expense account number, so
108
      # never book incoming to inventory account but always to expense account
109
      $form->{"inventory_accno_$i"} = $form->{"expense_accno_$i"} 
110
    };
107 111

  
108 112
    # get item baseunit
109 113
    if (!$item_units{$form->{"id_$i"}}) {
......
211 215
      # check if we sold the item already and
212 216
      # make an entry for the expense and inventory
213 217
      $query =
214
        qq|SELECT i.id, i.qty, i.allocated, i.trans_id,
218
        qq|SELECT i.id, i.qty, i.allocated, i.trans_id, i.base_qty,
215 219
             p.inventory_accno_id, p.expense_accno_id, a.transdate
216 220
           FROM invoice i, ar a, parts p
217 221
           WHERE (i.parts_id = p.id)
......
219 223
             AND ((i.base_qty + i.allocated) > 0)
220 224
             AND (i.trans_id = a.id)
221 225
           ORDER BY transdate|;
226
           # ORDER BY transdate guarantees FIFO
227

  
228
# sold two items without having bought them yet, example result of query:
229
# id | qty | allocated | trans_id | inventory_accno_id | expense_accno_id | transdate  
230
# ---+-----+-----------+----------+--------------------+------------------+------------
231
#  9 |   2 |         0 |        9 |                 15 |              151 | 2011-01-05
232

  
233
# base_qty + allocated > 0 if article has already been sold but not bought yet
234

  
235
# select qty,allocated,base_qty,sellprice from invoice where trans_id = 9;
236
#  qty | allocated | base_qty | sellprice  
237
# -----+-----------+----------+------------
238
#    2 |         0 |        2 | 1000.00000
239

  
222 240
      $sth = prepare_execute_query($form, $dbh, $query, conv_i($form->{"id_$i"}));
223 241

  
224 242
      my $totalqty = $baseqty;
......
227 245
        my $qty    = min $totalqty, ($ref->{base_qty} + $ref->{allocated});
228 246
        $linetotal = $form->round_amount(($form->{"sellprice_$i"} * $qty) / $basefactor, 2);
229 247

  
230
        if ($ref->{allocated} < 0) {
231

  
232
          # we have an entry for it already, adjust amount
233
          $form->update_balance($dbh, "acc_trans", "amount",
234
                                qq|    (trans_id = $ref->{trans_id})
235
                                   AND (chart_id = $ref->{inventory_accno_id})
236
                                   AND (transdate = '$ref->{transdate}')|,
237
                                $linetotal);
238

  
239
          $form->update_balance($dbh, "acc_trans", "amount",
240
                                qq|    (trans_id = $ref->{trans_id})
241
                                   AND (chart_id = $ref->{expense_accno_id})
242
                                   AND (transdate = '$ref->{transdate}')|,
243
                                $linetotal * -1);
244

  
245
        } elsif ($linetotal != 0) {
246
          # add entry for inventory, this one is for the sold item
247
          $query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, taxkey) VALUES (?, ?, ?, ?, (SELECT taxkey_id FROM chart WHERE id = ?))|;
248
          @values = ($ref->{trans_id},  $ref->{inventory_accno_id}, $linetotal, $ref->{transdate}, $ref->{inventory_accno_id});
249
          do_query($form, $dbh, $query, @values);
250

  
251
          # add expense
252
          $query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, taxkey) VALUES (?, ?, ?, ?, (SELECT taxkey from tax WHERE chart_id = ?))|;
253
          @values = ($ref->{trans_id},  $ref->{expense_accno_id}, ($linetotal * -1), $ref->{transdate}, $ref->{expense_accno_id});
254
          do_query($form, $dbh, $query, @values);
255
        }
248
        if  ( $::instance_conf->get_inventory_system eq 'perpetual' ) {
249
        # Warenbestandsbuchungen nur bei Bestandsmethode
250

  
251
          if ($ref->{allocated} < 0) {
252

  
253
# we have an entry for it already, adjust amount
254
            $form->update_balance($dbh, "acc_trans", "amount",
255
                qq|    (trans_id = $ref->{trans_id})
256
                AND (chart_id = $ref->{inventory_accno_id})
257
                AND (transdate = '$ref->{transdate}')|,
258
                $linetotal);
259

  
260
            $form->update_balance($dbh, "acc_trans", "amount",
261
                qq|    (trans_id = $ref->{trans_id})
262
                AND (chart_id = $ref->{expense_accno_id})
263
                AND (transdate = '$ref->{transdate}')|,
264
                $linetotal * -1);
265

  
266
          } elsif ($linetotal != 0) {
267

  
268
            # allocated >= 0
269
            # add entry for inventory, this one is for the sold item
270
            $query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, taxkey) VALUES (?, ?, ?, ?, (SELECT taxkey_id FROM chart WHERE id = ?))|;
271
            @values = ($ref->{trans_id},  $ref->{inventory_accno_id}, $linetotal, $ref->{transdate}, $ref->{inventory_accno_id});
272
            do_query($form, $dbh, $query, @values);
273

  
274
# add expense
275
            $query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, taxkey) VALUES (?, ?, ?, ?, (SELECT taxkey from tax WHERE chart_id = ?))|;
276
            @values = ($ref->{trans_id},  $ref->{expense_accno_id}, ($linetotal * -1), $ref->{transdate}, $ref->{expense_accno_id});
277
            do_query($form, $dbh, $query, @values);
278
          }
279
        };
256 280

  
257 281
        # update allocated for sold item
258 282
        $form->update_balance($dbh, "invoice", "allocated", qq|id = $ref->{id}|, $qty * -1);
......
265 289
      $sth->finish();
266 290

  
267 291
    } else {                    # if ($form->{"inventory_accno_id_$i"})
292
      # part doesn't have an inventory_accno_id
293
      # lastcost of the part is updated at the end
268 294

  
269 295
      $linetotal = $form->round_amount($form->{"sellprice_$i"} * $form->{"qty_$i"} / $price_factor, 2);
270 296

  
SL/IS.pm
1256 1256
  my $allocated = 0;
1257 1257
  my $qty;
1258 1258

  
1259
# all invoice entries of an example part:
1260

  
1261
# id | trans_id | base_qty | allocated | sellprice | inventory_accno | income_accno | expense_accno 
1262
# ---+----------+----------+-----------+-----------+-----------------+--------------+---------------
1263
#  4 |        4 |       -5 |         5 |  20.00000 | 1140            | 4400         | 5400     bought 5 for 20
1264
#  5 |        5 |        4 |        -4 |  50.00000 | 1140            | 4400         | 5400     sold   4 for 50
1265
#  6 |        6 |        1 |        -1 |  50.00000 | 1140            | 4400         | 5400     sold   1 for 50
1266
#  7 |        7 |       -5 |         1 |  20.00000 | 1140            | 4400         | 5400     bought 5 for 20
1267
#  8 |        8 |        1 |        -1 |  50.00000 | 1140            | 4400         | 5400     sold   1 for 50
1268

  
1269
# AND ((i.base_qty + i.allocated) < 0) filters out all but line with id=7, elsewhere i.base_qty + i.allocated has already reached 0
1270
# and all parts have been allocated
1271

  
1272
# so transaction 8 only sees transaction 7 with unallocated parts and adjusts allocated for that transaction, before allocated was 0
1273
#  7 |        7 |       -5 |         1 |  20.00000 | 1140            | 4400         | 5400     bought 5 for 20
1274

  
1275
# in this example there are still 4 unsold articles
1276

  
1277

  
1278
  # search all invoice entries for the part in question, adjusting "allocated"
1279
  # until the total number of sold parts has been reached
1280

  
1281
  # ORDER BY trans_id ensures FIFO
1282

  
1283

  
1259 1284
  while (my $ref = $sth->fetchrow_hashref('NAME_lc')) {
1260 1285
    if (($qty = (($ref->{base_qty} * -1) - $ref->{allocated})) > $totalqty) {
1261 1286
      $qty = $totalqty;
1262 1287
    }
1263 1288

  
1289
    # update allocated in invoice
1264 1290
    $form->update_balance($dbh, "invoice", "allocated", qq|id = $ref->{id}|, $qty);
1265 1291

  
1266 1292
    # total expenses and inventory
1267 1293
    # sellprice is the cost of the item
1268 1294
    my $linetotal = $form->round_amount(($ref->{sellprice} * $qty) / ( ($ref->{price_factor} || 1) * ( $basefactor || 1 )), 2);
1269 1295

  
1270
    if (!$::lx_office_conf{system}->{eur}) {
1296
    if ( $::instance_conf->get_inventory_system eq 'perpetual' ) {
1297
      # Bestandsmethode: when selling parts, deduct their purchase value from the inventory account
1271 1298
      $ref->{expense_accno} = ($form->{"expense_accno_$row"}) ? $form->{"expense_accno_$row"} : $ref->{expense_accno};
1272 1299
      # add to expense
1273 1300
      $form->{amount_cogs}{ $form->{id} }{ $ref->{expense_accno} } += -$linetotal;
SL/InstanceConfiguration.pm
34 34
  return $self->{currencies} ? @{ $self->{currencies} } : ();
35 35
}
36 36

  
37
sub get_accounting_method {
38
  my ($self) = @_;
39
  return $self->{data}->{accounting_method};
40
}
41

  
42
sub get_inventory_system {
43
  my ($self) = @_;
44
  return $self->{data}->{inventory_system};
45
}
46

  
47
sub get_profit_determination {
48
  my ($self) = @_;
49
  return $self->{data}->{profit_determination};
50
}
51

  
37 52
1;
38 53

  
39 54
__END__
......
74 89
Returns the default currency or undef if no currency has been
75 90
configured.
76 91

  
92
=item C<get_accounting_method>
93

  
94
Returns the default accounting method, accrual or cash
95

  
96
=item C<get_inventory_system>
97

  
98
Returns the default inventory system, perpetual or periodic
99

  
100
=item C<get_profit_determination>
101

  
102
Returns the default profit determination method, balance or income
103

  
77 104
=back
78 105

  
79 106
=head1 BUGS
SL/User.pm
404 404

  
405 405
  $query = "UPDATE defaults SET coa = ?";
406 406
  do_query($form, $dbh, $query, $form->{chart});
407
  $query = "UPDATE defaults SET accounting_method = ?";
408
  do_query($form, $dbh, $query, $form->{accounting_method});
409
  $query = "UPDATE defaults SET profit_determination = ?";
410
  do_query($form, $dbh, $query, $form->{profit_determination});
411
  $query = "UPDATE defaults SET inventory_system = ?";
412
  do_query($form, $dbh, $query, $form->{inventory_system});
407 413

  
408 414
  $dbh->disconnect;
409 415

  
bin/mozilla/admin.pl
774 774
  }
775 775
  closedir SQLDIR;
776 776

  
777
  $form->{ACCOUNTING_METHODS} = [];
778
  foreach my $item ( qw(accrual cash) ) {
779
    push @{ $form->{ACCOUNTING_METHODS} }, { "name"     => $item,
780
                                 "selected" => $item eq "cash" };
781
  };
782

  
783
  $form->{INVENTORY_SYSTEMS} = [];
784
  foreach my $item ( qw(perpetual periodic) ) {
785
    push @{ $form->{INVENTORY_SYSTEMS} }, { "name"     => $item,
786
                                 "selected" => $item eq "periodic" };
787
  };
788

  
789
  $form->{PROFIT_DETERMINATIONS} = [];
790
  foreach my $item ( qw(balance income) ) {
791
    push @{ $form->{PROFIT_DETERMINATIONS} }, { "name"     => $item,
792
                                 "selected" => $item eq "income" };
793
  };
794

  
777 795
  my $default_charset = $::lx_office_conf{system}->{dbcharset};
778 796
  $default_charset ||= Common::DEFAULT_CHARSET;
779 797

  
bin/mozilla/am.pl
46 46
use CGI::Ajax;
47 47
use CGI;
48 48

  
49
use Data::Dumper;
50

  
51 49
require "bin/mozilla/common.pl";
52 50

  
53 51
use strict;
......
1392 1390
  }
1393 1391

  
1394 1392
  my $linkaccounts;
1395
  if (!$::lx_office_conf{system}->{eur}) {
1393
  if ( $::instance_conf->get_inventory_system eq 'perpetual' ) { # was !$::lx_office_conf{system}->{eur}) {
1396 1394
    $linkaccounts = qq|
1397 1395
               <tr>
1398 1396
                <th align=right>| . $locale->text('Inventory') . qq|</th>
1399 1397
                <td><select name=inventory_accno_id>$form->{selectIC}</select></td>
1400 1398
                <input name=selectIC type=hidden value="$form->{selectIC}">
1401 1399
              </tr>|;
1402
  } else {
1400
  } elsif ( $::instance_conf->get_inventory_system eq 'periodic' ) {
1401
    # don't allow choice of inventory accno and don't show that line
1403 1402
    $linkaccounts = qq|
1404 1403
                <input type=hidden name=inventory_accno_id value=$form->{inventory_accno_id}>|;
1405
  }
1404
  };
1406 1405

  
1407 1406

  
1408 1407
  $linkaccounts .= qq|
......
1550 1549

  
1551 1550
  map { $form->{"defaults_${_}"} = $form->{defaults}->{$_} } keys %{ $form->{defaults} };
1552 1551

  
1552
# EÜR = cash, Bilanzierung = accrual 
1553

  
1553 1554
  foreach my $key (keys %{ $form->{IC} }) {
1554 1555
    foreach my $accno (sort keys %{ $form->{IC}->{$key} }) {
1555 1556
      my $array = "ACCNOS_" . uc($key);
bin/mozilla/ca.pl
84 84

  
85 85
  $form->{title} = $locale->text('Chart of Accounts');
86 86

  
87
  if ($::lx_office_conf{system}->{eur}) {
87
  if ( $::instance_conf->get_accounting_method eq 'cash' ) {
88
    # $form->{method} can probably be made redundant now that we have get_accounting_method
88 89
    $form->{method} = "cash";
89 90
  }
90 91

  
......
177 178
          <td colspan=3><select name=department>$form->{selectdepartment}</select></td>
178 179
        </tr>
179 180
| if $form->{selectdepartment};
180
  my $accrual = $::lx_office_conf{system}->{eur} ? ""        : "checked";
181
  my $cash    = $::lx_office_conf{system}->{eur} ? "checked" : "";
181
  my $accrual =  $::instance_conf->get_accounting_method eq 'cash' ? ""        : "checked";
182
  my $cash    =  $::instance_conf->get_accounting_method eq 'cash' ? "checked" : "";
182 183

  
183 184
  my $name_1    = "fromdate";
184 185
  my $id_1      = "fromdate";
......
246 247

  
247 248
  $form->{description} =~ s/\"/&quot;/g;
248 249

  
249
  my $eur = $::lx_office_conf{system}->{eur};
250
  my $eur =  $::instance_conf->get_accounting_method eq 'cash' ? 1 : 0;
250 251

  
251 252
  print qq|
252 253
<body onLoad="$onload">
bin/mozilla/ic.pl
1528 1528

  
1529 1529
  $auth->assert('part_service_assembly_edit');
1530 1530

  
1531
  $form->{eur}              = $::lx_office_conf{system}->{eur}; # config dumps into namespace - yuck
1531
  # what does eur set here? why is it in namespace?
1532
  # call of get_accounting_method preserves format of $form->{eur}, which expects 1 or 0
1533
  $form->{eur}              = $::instance_conf->get_accounting_method eq 'cash' ? 1 : 0; # config dumps into namespace - yuck
1532 1534
  $form->{pg_keys}          = sub { "$_[0]->{partsgroup}--$_[0]->{id}" };
1533 1535
  $form->{description_area} = ($form->{rows} = $form->numtextrows($form->{description}, 40)) > 1;
1534 1536
  $form->{notes_rows}       =  max 4, $form->numtextrows($form->{notes}, 40), $form->numtextrows($form->{formel}, 40);
bin/mozilla/rp.pl
146 146

  
147 147
  $form->{title} = $locale->text($title{ $form->{report} });
148 148

  
149
  my $accrual = $::lx_office_conf{system}->{eur} ? ""        : "checked";
150
  my $cash    = $::lx_office_conf{system}->{eur} ? "checked" : "";
149
  my $accrual =  $::instance_conf->get_accounting_method eq 'cash' ? ""        : "checked";
150
  my $cash    =  $::instance_conf->get_accounting_method eq 'cash' ? "checked" : "";
151 151

  
152 152
  my $year = (localtime)[5] + 1900;
153 153

  
doc/changelog
2 2
# Veränderungen von Lx-Office ERP #
3 3
###################################
4 4

  
5
- Umstellung der Variablen eur in lx_office.conf zu drei neuen Variablen in
6
  Tabelle defaults, zur Einstellung von Gewinnermittlungsart, Versteuerungsart
7
  und Warenbuchungsmethode. Siehe Datei doc/umstellung_eur.txt
8

  
5 9
2011-06-15 - Release 2.6.3
6 10

  
7 11
  Größere neue Features:
doc/umstellung_eur.txt
1
Anstelle des Parameters eur in lx_office.conf werden drei neue Parameter
2
eingeführt, die in defaults bereitgehalten werden, und damit mandantenabhängig
3
konfiguriert werden können.
4

  
5
Die drei Parameter regeln Gewinnermittlungsart, Versteuerungsart und
6
Warenbuchungsmethode:
7

  
8
profit_determination (Gewinnermittlung)
9
* balance (Betriebsvermögensvergleich/Bilanzierung)
10
* income (Einnahmen-Überschuß-Rechnung)
11

  
12
accounting_method (Versteuerungsart)
13
* accrual (Sollversteuerung)
14
* cash (Istversteuerung)
15

  
16
inventory_system (Warenbuchungsmethode)
17
* perpetual (Bestandsmethode)
18
* periodic (Aufwandsmethode)
19

  
20
Beim Anlegen eines neuen Mandanten können diese Optionen nun unabhängig
21
voneinander eingestellt werden.
22

  
23
Beim Upgrade bestehender Mandanten wird eur ausgelesen und die Variablen werden
24
so gesetzt, daß sich an der Funktionalität nichts ändert.
25

  
26
Bisher galt:
27
eur = 1: cash + periodic + income
28
eur = 0: accrual + perpetual + balance
29

  
30
Die aktuelle Konfiguration wird unter Nummernkreise und Standardkonten unter
31
dem neuen Punkt "Einstellungen" angezeigt (read-only).
32

  
33
Für die Umstellung eines bestehenden Mandanten gibt es an der Oberfläche
34
derzeit keine Möglichkeit (gab es aber vorher auch nicht).
35

  
36
Die Konfiguration "eur" unter [system] in lx_office.conf wird nun nicht mehr
37
benötigt und kann aus der Konfigurationsdatei gelöscht werden (dies muß manuell
38
geschehen).
39

  
40
TODO:
41

  
42
* bei bestimmten Berichten kann man derzeit noch inviduell einstellen, ob man
43
  nach Ist- oder Sollversteuerung auswertet, und es werden im Code Variablen
44
  wie $accrual oder $cash gesetzt. Diese Codestellen wurden noch nicht
45
  angefasst, sondern nur die wo bisher $::lx_office_conf{system}->{eur}
46
  ausgewertet wurde.
47

  
48
* Hilfetext beim Neuanlegen eines Mandanten, was die Optionen bedeuten, z.B.
49
  mit zwei Standardfällen
locale/de/all
95 95
  'Account saved!'              => 'Konto gespeichert!',
96 96
  'Accounting Group deleted!'   => 'Buchungsgruppe gel&ouml;scht!',
97 97
  'Accounting Group saved!'     => 'Buchungsgruppe gespeichert!',
98
  'Accounting method'           => 'Versteuerungsart',
98 99
  'Accrual'                     => 'Bilanzierung',
99 100
  'Active'                      => 'Aktiv',
100 101
  'Active?'                     => 'Aktiviert?',
......
401 402
  'Company'                     => 'Firma',
402 403
  'Company Name'                => 'Firmenname',
403 404
  'Compare to'                  => 'Gegenüberstellen zu',
405
  'Configuration'               => 'Einstellungen',
404 406
  'Configuration of individual TODO items' => 'Konfiguration f&uuml;r die einzelnen Aufgabenlistenpunkte',
405 407
  'Configure'                   => 'Konfigurieren',
406 408
  'Confirm'                     => 'Best&auml;tigen',
......
651 653
  'EAN-Code'                    => 'EAN-Code',
652 654
  'EB-Wert'                     => 'EB-Wert',
653 655
  'EK'                          => 'EK',
656
  'EK-Preis'                    => '',
654 657
  'ELSE'                        => 'Zusatz',
655 658
  'ELSTER Export (Taxbird)'     => 'ELSTER-Export nach Taxbird',
656 659
  'ELSTER Export (Winston)'     => 'ELSTER Export nach Winston',
......
921 924
  'Include in Report'           => 'In Bericht aufnehmen',
922 925
  'Include in drop-down menus'  => 'In Aufklappmenü aufnehmen',
923 926
  'Includeable in reports'      => 'In Berichten anzeigbar',
927
  'income'                      => 'Einnahmen-/Überschussrechnung',
924 928
  'Income Statement'            => 'GuV',
925 929
  'Income accno'                => 'Erl&ouml;skonto',
926 930
  'Incoming Payments'           => 'Zahlungseingänge',
......
949 953
  'Inventory Account'           => 'Warenbestand',
950 954
  'Inventory quantity must be zero before you can set this assembly obsolete!' => 'Bevor dieses Erzeugnis als ungültig markiert werden kann, muß das Inventar auf Null sein!',
951 955
  'Inventory quantity must be zero before you can set this part obsolete!' => 'Bevor diese Ware als ungültig markiert werden kann, muß das Inventar Null sein!',
956
  'Inventory system'            => 'Warenbuchungsmethode',
952 957
  'Invno.'                      => 'Rg. Nr.',
953 958
  'Invnumber'                   => 'Rechnungsnummer',
954 959
  'Invnumber missing!'          => 'Rechnungsnummer fehlt!',
......
1266 1271
  'POSTED'                      => 'Gebucht',
1267 1272
  'POSTED AS NEW'               => 'Als neu gebucht',
1268 1273
  'PRINTED'                     => 'Gedruckt',
1274
  'Packing List'                => '',
1275
  'Packing List Date missing!'  => '',
1276
  'Packing List Number missing!' => '',
1269 1277
  'Packing Lists'               => 'Lieferschein',
1270 1278
  'Page #1/#2'                  => 'Seite #1/#2',
1271 1279
  'Paid'                        => 'bezahlt',
......
1302 1310
  'Per. Inv.'                   => 'Wied. Rech.',
1303 1311
  'Period'                      => 'Zeitraum',
1304 1312
  'Period:'                     => 'Zeitraum:',
1313
  'periodic'                    => 'Aufwandsmethode',
1305 1314
  'Periodic Invoices'           => 'Wiederkehrende Rechnungen',
1306 1315
  'Periodic invoices active'    => 'Wiederkehrende Rechnungen aktiv',
1307 1316
  'Periodic invoices inactive'  => 'Wiederkehrende Rechnungen inaktiv',
1308 1317
  'Periodicity'                 => 'Periodizität',
1318
  'perpetual'                   => 'Bestandsmethode',
1309 1319
  'Personal settings'           => 'Pers&ouml;nliche Einstellungen',
1310 1320
  'Pg Database Administration'  => 'Datenbankadministration',
1311 1321
  'Phone'                       => 'Telefon',
......
1391 1401
  'Produce Assembly'            => 'Erzeugnis fertigen',
1392 1402
  'Productivity'                => 'Produktivität',
1393 1403
  'Profit Center'               => 'Erfolgsbereich',
1404
  'Profit determination'        => 'Gewinnermittlung',
1394 1405
  'Proforma Invoice'            => 'Proformarechnung',
1395 1406
  'Program'                     => 'Programm',
1396 1407
  'Project'                     => 'Projekt',
......
1644 1655
  'Storno'                      => 'Storno',
1645 1656
  'Storno (one letter abbreviation)' => 'S',
1646 1657
  'Storno Invoice'              => 'Stornorechnung',
1658
  'Storno Packing List'         => '',
1647 1659
  'Street'                      => 'Straße',
1648 1660
  'Stylesheet'                  => 'Stilvorlage',
1649 1661
  'Subject'                     => 'Betreff',
......
2112 2124
  '[email]'                     => '[email]',
2113 2125
  'absolute'                    => 'absolut',
2114 2126
  'account_description'         => 'Beschreibung',
2115
  'accrual'                     => 'Bilanzierung (Soll-Versteuerung)',
2127
  'accrual'                     => 'Soll-Versteuerung',
2116 2128
  'action= not defined!'        => 'action= nicht definiert!',
2117 2129
  'active'                      => 'aktiv',
2118 2130
  'all entries'                 => 'alle Einträge',
......
2121 2133
  'as at'                       => 'zum Stand',
2122 2134
  'assembly_list'               => 'erzeugnisliste',
2123 2135
  'back'                        => 'zurück',
2136
  'balance'                     => 'Betriebsvermögensvergleich',
2124 2137
  'bank_collection_payment_list_#1' => 'bankeinzugszahlungsliste_#1',
2125 2138
  'bank_transfer_payment_list_#1' => 'ueberweisungszahlungsliste_#1',
2126 2139
  'bankaccounts'                => 'Bankkonten',
......
2129 2142
  'bin_list'                    => 'Lagerliste',
2130 2143
  'bis'                         => 'bis',
2131 2144
  'button'                      => '?',
2132
  'cash'                        => 'E/Ü-Rechnung (Ist-Versteuerung)',
2145
  'cash'                        => 'Ist-Versteuerung',
2133 2146
  'chargenumber #1'             => 'Chargennummer #1',
2134 2147
  'chart_of_accounts'           => 'kontenuebersicht',
2135 2148
  'choice'                      => 'auswählen',
locale/en/all
105 105
  'Account saved!'              => '',
106 106
  'Accounting Group deleted!'   => '',
107 107
  'Accounting Group saved!'     => '',
108
  'Accounting method'           => '',
108 109
  'Accrual'                     => '',
109 110
  'Active'                      => '',
110 111
  'Active?'                     => '',
......
388 389
  'Company'                     => '',
389 390
  'Company Name'                => '',
390 391
  'Compare to'                  => '',
392
  'Configuration'               => '',
391 393
  'Configuration of individual TODO items' => '',
392 394
  'Configure'                   => '',
393 395
  'Confirm'                     => '',
......
857 859
  'Include in Report'           => '',
858 860
  'Include in drop-down menus'  => '',
859 861
  'Includeable in reports'      => '',
862
  'income'                      => 'Income statement',
860 863
  'Income Statement'            => '',
861 864
  'Income accno'                => '',
862 865
  'Incoming Payments'           => '',
......
883 886
  'Inventory Account'           => '',
884 887
  'Inventory quantity must be zero before you can set this assembly obsolete!' => '',
885 888
  'Inventory quantity must be zero before you can set this part obsolete!' => '',
889
  'Inventory system'            => '',
886 890
  'Invno.'                      => '',
887 891
  'Invnumber'                   => '',
888 892
  'Invnumber missing!'          => '',
......
1212 1216
  'Per. Inv.'                   => '',
1213 1217
  'Period'                      => '',
1214 1218
  'Period:'                     => '',
1219
  'periodic'                   => '',
1215 1220
  'Periodic Invoices'           => '',
1216 1221
  'Periodic invoices active'    => '',
1217 1222
  'Periodic invoices inactive'  => '',
1218 1223
  'Periodicity'                 => '',
1224
  'perpetual:'                  => '',
1219 1225
  'Personal settings'           => '',
1220 1226
  'Pg Database Administration'  => '',
1221 1227
  'Phone'                       => '',
......
1299 1305
  'Produce Assembly'            => '',
1300 1306
  'Productivity'                => '',
1301 1307
  'Profit Center'               => '',
1308
  'Profit determination'        => '',
1302 1309
  'Proforma Invoice'            => '',
1303 1310
  'Program'                     => '',
1304 1311
  'Project'                     => '',
......
1980 1987
  'bankaccounts'                => '',
1981 1988
  'banktransfers'               => '',
1982 1989
  'bestbefore #1'               => '',
1990
  'balance'                     => '',
1983 1991
  'bin_list'                    => '',
1984 1992
  'bis'                         => '',
1985 1993
  'button'                      => '',
sql/Pg-upgrade2/umstellung_eur.pl
1
# @tag: umstellung_eur
2
# @description: Variable eur umstellen: bitte doc/umstellung_eur.txt lesen
3
# @depends: units_id
4
# @charset: utf-8
5

  
6
# this script relies on $eur still being set in lx_office.conf, and the
7
# variable available in $::lx_office_conf{system}->{eur}
8
# better @depends would be release_2_6_3
9

  
10
use utf8;
11
#use strict;
12
use Data::Dumper;
13
die("This script cannot be run from the command line.") unless ($main::form);
14

  
15
sub mydberror {
16
  my ($msg) = @_;
17
  die($dbup_locale->text("Database update error:") .
18
      "<br>$msg<br>" . $DBI::errstr);
19
}
20

  
21
sub do_query {
22
  my ($query, $may_fail) = @_;
23

  
24
  if (!$dbh->do($query)) {
25
    mydberror($query) unless ($may_fail);
26
    $dbh->rollback();
27
    $dbh->begin_work();
28
  }
29
}
30

  
31
sub do_update {
32

  
33
  # check if accounting_method has already been set (new database), if so return
34
  # only set variables according to eur for update of existing database
35

  
36

  
37
  foreach my $column (qw(accounting_method inventory_system profit_determination)) {
38
    # this query will fail if columns already exist (new database)
39
    do_query(qq|ALTER TABLE defaults ADD COLUMN ${column} TEXT|, 1);
40
  }
41

  
42
  my $accounting_method;
43
  my $inventory_system;
44
  my $profit_determination;
45

  
46
  # check current configuration and set default variables accordingly, so that
47
  # Lx-Office behaviour isn't changed by this update
48

  
49
  if ($::lx_office_conf{system}->{eur} == 0 ) {
50
    $accounting_method = 'accrual';
51
    $inventory_system = 'perpetual';
52
    $profit_determination = 'balance';
53
  } elsif ( $::lx_office_conf{system}->{eur} == 1 ) {
54
    $accounting_method = 'cash';
55
    $inventory_system = 'periodic';
56
    $profit_determination = 'income';
57
  } else {
58
    die "illegal configuration of eur, must be 0 or 1, not " . $::lx_office_conf{system}->{eur} . "\n";
59
    # or maybe just return 1, dont do anything, because we assume everything is
60
    # already set, or has maybe already been deleted
61
  };
62

  
63
  # only set parameters if they haven't already been set (this in only the case
64
  # when upgrading)
65

  
66
  my $update_eur = "UPDATE defaults set accounting_method = '$accounting_method' where accounting_method is null;" . 
67
                   "UPDATE defaults set inventory_system = '$inventory_system' where inventory_system is null; " .
68
                   "UPDATE defaults set profit_determination = '$profit_determination' where profit_determination is null;";
69
  do_query($update_eur);
70

  
71
  return 1;
72
}
73

  
74
return do_update();
75

  
sql/lx-office.sql
177 177
    itime timestamp without time zone DEFAULT now(),
178 178
    mtime timestamp without time zone,
179 179
    rmanumber text,
180
    cnnumber text
180
    cnnumber text,
181
    accounting_method text,
182
    inventory_system text,
183
    profit_determination text
181 184
);
182 185

  
183 186

  
templates/webpages/admin/create_dataset.html
44 44
     </td>
45 45
    </tr>
46 46

  
47
    <tr>
48
     <th valign="top" align="right" nowrap>[% 'Accounting method' | $T8 %]</th>
49
     <td>
50
      <select name="accounting_method">
51
       [% FOREACH row = ACCOUNTING_METHODS %]<option value=[% HTML.escape(row.name) %] [% IF row.selected %]selected[% END %]>[% HTML.escape(row.name) | $T8 %]</option>[% END %]
52
      </select>
53
     </td>
54
    </tr>
55
    <tr>
56
     <th valign="top" align="right" nowrap>[% 'Inventory system' | $T8 %]</th>
57
     <td>
58
      <select name="inventory_system">
59
       [% FOREACH row = INVENTORY_SYSTEMS %]<option value=[% HTML.escape(row.name) %] [% IF row.selected %]selected[% END %]>[% HTML.escape(row.name) | $T8 %]</option>[% END %]
60
      </select>
61
     </td>
62
    </tr>
63

  
64
    <tr>
65
     <th valign="top" align="right" nowrap>[% 'Profit determination' | $T8 %]</th>
66
     <td>
67
      <select name="profit_determination">
68
       [% FOREACH row = PROFIT_DETERMINATIONS %]<option value=[% HTML.escape(row.name) %] [% IF row.selected %]selected[% END %]>[% HTML.escape(row.name) | $T8 %]</option>[% END %]
69
      </select>
70
     </td>
71
    </tr>
72

  
47 73
   </table>
48 74

  
49 75
   <input type="hidden" name="dbdriver"  value="[% HTML.escape(dbdriver) %]">
templates/webpages/am/edit_defaults.html
156 156
      </td>
157 157
    </tr>
158 158

  
159
    <tr class="listheading">
160
     <th colspan="4">[% 'Configuration' | $T8 %]</th>
161
    </tr>
162

  
163
    <tr>
164
     <th align="right">[% 'Accounting method' | $T8 %] </th>
165
     <td colspan="3"><input name="accounting_method" size="20" readonly="readonly" value="[% HTML.escape(defaults_accounting_method) | $T8 %]"></td>
166
    </tr>
167

  
168
    <tr>
169
     <th align="right">[% 'Inventory system' | $T8 %] </th>
170
     <td colspan="3"><input name="inventory_system" size="20" readonly="readonly" value="[% HTML.escape(defaults_inventory_system) | $T8 %]"></td>
171
    </tr>
172

  
173
    <tr>
174
     <th align="right">[% 'Profit determination' | $T8 %] </th>
175
     <td colspan="3"><input name="profit_determination" size="20" readonly="readonly" value="[% HTML.escape(defaults_profit_determination) | $T8 %]"></td>
176
    </tr>
177

  
178
    <tr>
179
     <th align="right">[% 'Chart of accounts' | $T8 %] </th>
180
     <td colspan="3"><input name="coa" size="20" readonly="readonly" value="[% HTML.escape(defaults_coa) | $T8 %]"></td>
181
    </tr>
182

  
183

  
159 184
   </table>
160 185
  </p>
161 186

  

Auch abrufbar als: Unified diff