Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 030c2086

Von Rolf Fluehmann vor mehr als 8 Jahren hinzugefügt

  • ID 030c208648ddd8137d8fab33bb8b2eb87f5c080f
  • Vorgänger fc1e3973
  • Nachfolger 39b80fd2

Belege runden, und Rundungsdifferenzen auf Extrakonten buchen.

Unterschiede anzeigen:

SL/IS.pm
968 968
    }
969 969
  }
970 970

  
971
  $form->{amount}{ $form->{id} }{ $form->{AR} } = $netamount + $tax;
972
  $form->{paid} =
973
    $form->round_amount($form->{paid} * $form->{exchangerate} + $diff, 2);
971
  # Invoice Summary includes Rounding
972
  my $grossamount = $netamount + $tax;
973
  my $rounding = $form->round_amount(
974
    $form->round_amount($grossamount, 2, 1) - $form->round_amount($grossamount, 2),
975
    2
976
  );
977
  my $rnd_accno = $rounding == 0 ? 0
978
                : $rounding > 0  ? $form->{rndgain_accno}
979
                :                  $form->{rndloss_accno}
980
  ;
981
  $form->{amount}{ $form->{id} }{ $form->{AR} } = $form->round_amount($grossamount, 2, 1);
982
  $form->{paid} = $form->round_amount(
983
    $form->{paid} * $form->{exchangerate} + $diff,
984
    2
985
  );
974 986

  
975 987
  # reverse AR
976 988
  $form->{amount}{ $form->{id} }{ $form->{AR} } *= -1;
......
1073 1085
        do_query($form, $dbh, $query, @values);
1074 1086
      }
1075 1087
    }
1088
    if (!$payments_only && ($rnd_accno != 0)) {
1089
      $query =
1090
        qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, tax_id, taxkey, project_id, chart_link)
1091
             VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, (SELECT id FROM tax WHERE taxkey=0), 0, ?, (SELECT link FROM chart WHERE accno = ?))|;
1092
      @values = (conv_i($trans_id), $rnd_accno, $rounding, conv_date($form->{invdate}), conv_i($project_id), $rnd_accno);
1093
      do_query($form, $dbh, $query, @values);
1094
      $rnd_accno = 0;
1095
    }
1076 1096
  }
1077 1097

  
1078 1098
  # deduct payment differences from diff
......
1237 1257
    return;
1238 1258
  }
1239 1259

  
1240
  $amount = $netamount + $tax;
1260
  $amount = $form->round_amount( $netamount + $tax, 2, 1);
1241 1261

  
1242 1262
  # save AR record
1243 1263
  #erweiterung fuer lieferscheinnummer (donumber) 12.02.09 jb
......
1882 1902
         (SELECT c.accno FROM chart c WHERE d.income_accno_id = c.id)    AS income_accno,
1883 1903
         (SELECT c.accno FROM chart c WHERE d.expense_accno_id = c.id)   AS expense_accno,
1884 1904
         (SELECT c.accno FROM chart c WHERE d.fxgain_accno_id = c.id)    AS fxgain_accno,
1885
         (SELECT c.accno FROM chart c WHERE d.fxloss_accno_id = c.id)    AS fxloss_accno
1905
         (SELECT c.accno FROM chart c WHERE d.fxloss_accno_id = c.id)    AS fxloss_accno,
1906
         (SELECT c.accno FROM chart c WHERE d.rndgain_accno_id = c.id)   AS rndgain_accno,
1907
         (SELECT c.accno FROM chart c WHERE d.rndloss_accno_id = c.id)   AS rndloss_accno
1886 1908
         ${query_transdate}
1887 1909
       FROM defaults d|;
1888 1910

  

Auch abrufbar als: Unified diff