Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision cb8d5a5d

Von Philip Reetz vor mehr als 16 Jahren hinzugefügt

  • ID cb8d5a5de66b7743b9253d477c7c28e573175e87
  • Vorgänger 8c94b0ea
  • Nachfolger f0135672

Kontenuebersicht und SuSa die Unterscheidung von EUR und Blianzierung beigebracht

Unterschiede anzeigen:

SL/RP.pm
803 803
    $project = qq| AND (ac.project_id = | . conv_i($form->{project_id}, 'NULL') . qq|) |;
804 804
  }
805 805

  
806
  my $acc_cash_where = "";
807
  my $ar_cash_where = "";
808
  my $ap_cash_where = "";
809

  
810

  
811
  if ($form->{method} eq "cash") {
812
    $acc_cash_where = qq| AND (ac.trans_id IN (SELECT id FROM ar WHERE datepaid>='$form->{fromdate}' AND datepaid<='$form->{todate}' UNION SELECT id FROM ap WHERE datepaid>='$form->{fromdate}' AND datepaid<='$form->{todate}' UNION SELECT id FROM gl WHERE transdate>='$form->{fromdate}' AND transdate<='$form->{todate}')) |;
813
    $ar_ap_cash_where = qq| AND (a.datepaid>='$form->{fromdate}' AND a.datepaid<='$form->{todate}') |;
814
  }
815

  
806 816
  # get beginning balances
807 817
  $query =
808 818
    qq|SELECT c.accno, c.category, SUM(ac.amount) AS amount, c.description
809 819
        FROM acc_trans ac
810
        JOIN chart c ON (ac.chart_id = c.id)
820
        LEFT JOIN chart c ON (ac.chart_id = c.id)
811 821
        $dpt_join
812
        WHERE ((select date_trunc('year', ac.transdate::date)) = (select date_trunc('year', ?::date))) AND ac.ob_transaction 
822
        WHERE ((select date_trunc('year', ac.transdate::date)) = (select date_trunc('year', ?::date))) AND ac.ob_transaction $acc_cash_where
813 823
          $dpt_where
814 824
          $project
815 825
        GROUP BY c.accno, c.category, c.description |;
......
821 831
    if ($ref->{amount} != 0 || $form->{all_accounts}) {
822 832
      $trb{ $ref->{accno} }{description} = $ref->{description};
823 833
      $trb{ $ref->{accno} }{charttype}   = 'A';
824
      if ($ref->{category} ne "I" &&  $ref->{category} ne "E") {
825
        if ($ref->{amount} > 0) {
826
          $trb{ $ref->{accno} }{haben_eb}   = $ref->{amount};
827
        } else {
828
          $trb{ $ref->{accno} }{soll_eb}   = $ref->{amount} * -1;
829
        }
834
   
835
      if ($ref->{amount} > 0) {
836
        $trb{ $ref->{accno} }{haben_eb}   = $ref->{amount};
837
      } else {
838
        $trb{ $ref->{accno} }{soll_eb}   = $ref->{amount} * -1;
830 839
      }
831 840
      $trb{ $ref->{accno} }{category}    = $ref->{category};
832 841
    }

Auch abrufbar als: Unified diff