Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 7e0ea1c2

Von Udo Spallek vor mehr als 17 Jahren hinzugefügt

  • ID 7e0ea1c23859d1839c9ce4574de45ec7fcf92c15
  • Vorgänger d890f886
  • Nachfolger acaca478

Diverse Bugs im Zusammenhang mit Steuerautomatiken, mit chart_id=0 oder mit rate=0.
Beides sollte jedoch moeglich sein fuer Konten wie 'steuerfrei'.

Unterschiede anzeigen:

SL/AM.pm
2068 2068
                   t.taxkey,
2069 2069
                   t.taxdescription,
2070 2070
                   round(t.rate * 100, 2) AS rate,
2071
                   c.accno AS taxnumber,
2072
                   c.description AS account_description
2071
                   (SELECT accno FROM chart WHERE id = chart_id) AS taxnumber,
2072
                   (SELECT description FROM chart WHERE id = chart_id) AS account_description
2073 2073
                 FROM tax t
2074
                 JOIN chart c on (chart_id = c.id)
2075 2074
                 ORDER BY taxkey|;
2076 2075

  
2077 2076
  $sth = $dbh->prepare($query);
......
2146 2145

  
2147 2146
  # see if it is used by a taxkey
2148 2147
  $query = qq|SELECT count(*) FROM taxkeys
2149
              WHERE tax_id = ?|;
2148
              WHERE tax_id = ? AND chart_id >0|;
2150 2149

  
2151 2150
  ($form->{orphaned}) = selectrow_query($form, $dbh, $query, $form->{id});
2152 2151

  
......
2156 2155
  if (!$form->{orphaned} ) {
2157 2156
    $query = qq|SELECT DISTINCT c.id, c.accno
2158 2157
                FROM taxkeys tk
2159
                LEFT JOIN   tax t ON (t.id = tk.tax_id)
2160
                LEFT JOIN chart c ON (c.id = tk.chart_id)
2158
                JOIN   tax t ON (t.id = tk.tax_id)
2159
                JOIN chart c ON (c.id = tk.chart_id)
2161 2160
                WHERE tk.tax_id = ?|;
2162 2161

  
2163 2162
    $sth = $dbh->prepare($query);
......
2187 2186
  $form->{rate} = $form->{rate} / 100;
2188 2187

  
2189 2188
  my @values = ($form->{taxkey}, $form->{taxdescription}, $form->{rate}, $form->{chart_id}, $form->{chart_id} );
2190
  if ($form->{id}) {
2189
  if ($form->{id} ne "") {
2191 2190
    $query = qq|UPDATE tax SET
2192 2191
                  taxkey         = ?,
2193 2192
                  taxdescription = ?,
bin/mozilla/am.pl
3216 3216
sub save_tax {
3217 3217
  $lxdebug->enter_sub();
3218 3218

  
3219
  $form->isblank("chart_id", $locale->text('Tax-O-Matic account missing!'));
3220 3219
  $form->isblank("rate", $locale->text('Taxrate missing!'));
3221 3220
  $form->isblank("taxdescription", $locale->text('Taxdescription  missing!'));
3222 3221
  $form->isblank("taxkey", $locale->text('Taxkey  missing!'));
3223 3222

  
3224 3223
  $form->{rate} = $form->parse_amount(\%myconfig, $form->{rate});
3225 3224

  
3226
  if ( $form->{rate} <= 0 || $form->{rate} >= 100 ) {
3225
  if ( $form->{rate} < 0 || $form->{rate} >= 100 ) {
3227 3226
    $form->error($locale->text('Tax Percent is a number between 0 and 100'));
3228 3227
  }
3229 3228

  
3230
  if ( $form->{rate} <= 0.99 && $form->{rate} >= 0 ) {
3229
  if ( $form->{rate} <= 0.99 && $form->{rate} > 0 ) {
3231 3230
    $form->error($locale->text('Tax Percent is a number between 0 and 100'));
3232 3231
  }  
3233 3232

  
locale/de/all
1085 1085
  'Tax paid'                    => 'Vorsteuer',
1086 1086
  'Tax saved!'                  => 'Steuer gespeichert!',
1087 1087
  'Tax-O-Matic'                 => 'Steuer',
1088
  'Tax-O-Matic account missing!' => 'Automatikkonto fehlt!',
1089 1088
  'Tax-o-matic Account'         => 'Automatikbuchung auf Konto',
1090 1089
  'Taxaccount_coa'              => 'Automatikkonto',
1091 1090
  'Taxation'                    => 'Versteuerungs Verfahren',
locale/de/am
252 252
  'Tax deleted!'                => 'Steuer gel?scht!',
253 253
  'Tax saved!'                  => 'Steuer gespeichert!',
254 254
  'Tax-O-Matic'                 => 'Steuer',
255
  'Tax-O-Matic account missing!' => 'Automatikkonto fehlt!',
256 255
  'Tax-o-matic Account'         => 'Automatikbuchung auf Konto',
257 256
  'Taxdescription  missing!'    => 'Steuername fehlt!',
258 257
  'Taxkey  missing!'            => 'Steuerschl?ssel fehlt!',
templates/webpages/am/edit_tax_de.html
23 23

  
24 24
   <tr>
25 25
    <td>Automatikkonto</td>
26
    <td><select name="chart_id">[% FOREACH row = ACCOUNTS %]<option value="[% HTML.escape(row.id) %]" [% IF row.selected %]selected[% END %]>[% HTML.escape(row.taxaccount) %]</option>[% END %]</select></td>
26
    <td><select name="chart_id"><option value="0">Kein</option>[% FOREACH row = ACCOUNTS %]<option value="[% HTML.escape(row.id) %]" [% IF row.selected %]selected[% END %]>[% HTML.escape(row.taxaccount) %]</option>[% END %]</select></td>
27 27
   </tr>
28 28

  
29 29
  </table>
30 30

  
31
  [% IF id %]
32 31
  [% UNLESS orphaned %]
33 32
  <br />
34 33
  Konten, die mit dieser Steuer verkn?pft sind:
......
37 36
  [% END %]
38 37
  <br />
39 38
  [% END %]
40
  [% END %]
41 39

  
42 40
  <input type="hidden" name="callback" value="[% HTML.escape(callback) %]">
43 41
  <input type="hidden" name="login" value="[% HTML.escape(login) %]">
......
45 43

  
46 44
  <input type="submit" class="submit" name="action" value="Speichern">
47 45

  
48
  [% IF orphaned %][% IF id %]
46
  [% IF orphaned %]
49 47
  <input type="submit" class="submit" name="action" value="L?schen">
50
  [% END %][% END %]
48
  [% END %]
51 49

  
52 50
</form>
53 51
</body>
templates/webpages/am/edit_tax_master.html
23 23

  
24 24
   <tr>
25 25
    <td><translate>tax_chartaccno</translate></td>
26
    <td><select name="chart_id">[% FOREACH row = ACCOUNTS %]<option value="[% HTML.escape(row.id) %]" [% IF row.selected %]selected[% END %]>[% HTML.escape(row.taxaccount) %]</option>[% END %]</select></td>
26
    <td><select name="chart_id"><option value="0"><translate>None</translate></option>[% FOREACH row = ACCOUNTS %]<option value="[% HTML.escape(row.id) %]" [% IF row.selected %]selected[% END %]>[% HTML.escape(row.taxaccount) %]</option>[% END %]</select></td>
27 27
   </tr>
28 28

  
29 29
  </table>
30 30

  
31
  [% IF id %]
32 31
  [% UNLESS orphaned %]
33 32
  <br />
34 33
  <translate>Chartaccounts connected to this Tax:</translate>
......
37 36
  [% END %]
38 37
  <br />
39 38
  [% END %]
40
  [% END %]
41 39

  
42 40
  <input type="hidden" name="callback" value="[% HTML.escape(callback) %]">
43 41
  <input type="hidden" name="login" value="[% HTML.escape(login) %]">
......
45 43

  
46 44
  <input type="submit" class="submit" name="action" value="<translate>Save</translate>">
47 45

  
48
  [% IF orphaned %][% IF id %]
46
  [% IF orphaned %]
49 47
  <input type="submit" class="submit" name="action" value="<translate>Delete</translate>">
50
  [% END %][% END %]
48
  [% END %]
51 49

  
52 50
</form>
53 51
</body>

Auch abrufbar als: Unified diff