Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 40316525

Von G. Richardson vor etwa 14 Jahren hinzugefügt

Bugfix: Datenbankabfragen anpassen

schema_normalization_2.sql hat eine neue Column "id" in acc_trans eingefügt,
dadurch wurden bestimmte SQL-Abfragen bei den Finanzreports nicht mehr eindeutig.

Unterschiede anzeigen:

SL/RP.pm
233 233
           AND ac.trans_id IN
234 234
             (
235 235
               SELECT trans_id
236
               FROM acc_trans
237
               JOIN chart ON (chart_id = id)
236
               FROM acc_trans a
237
               JOIN chart c ON (a.chart_id = c.id)
238 238
               WHERE (link LIKE '%AR_paid%')
239 239
               $subwhere
240 240
             )
......
254 254
           AND ac.trans_id IN
255 255
             (
256 256
               SELECT trans_id
257
               FROM acc_trans
258
               JOIN chart ON (chart_id = id)
257
               FROM acc_trans a
258
               JOIN chart c ON (a.chart_id = c.id)
259 259
               WHERE (link LIKE '%AP_paid%')
260 260
               $subwhere
261 261
             )
......
296 296
           AND ac.trans_id IN
297 297
             (
298 298
               SELECT trans_id
299
               FROM acc_trans
300
               JOIN chart ON (chart_id = id)
299
               FROM acc_trans a
300
               JOIN chart c ON (a.chart_id = c.id)
301 301
               WHERE (link LIKE '%AR_paid%')
302 302
               $subwhere
303 303
             )
......
318 318
           AND ac.trans_id IN
319 319
             (
320 320
               SELECT trans_id
321
               FROM acc_trans
322
               JOIN chart ON (chart_id = id)
321
               FROM acc_trans a
322
               JOIN chart c ON (a.chart_id = c.id)
323 323
               WHERE link LIKE '%AP_paid%'
324 324
               $subwhere
325 325
             )
......
519 519
         JOIN ar a ON (a.id = ac.trans_id)
520 520
         $dpt_join
521 521
         WHERE $where $dpt_where
522
           AND ac.trans_id IN ( SELECT trans_id FROM acc_trans JOIN chart ON (chart_id = id) WHERE (link LIKE '%AR_paid%') $subwhere)
522
           AND ac.trans_id IN ( SELECT trans_id FROM acc_trans a JOIN chart c ON (a.chart_id = c.id) WHERE (link LIKE '%AR_paid%') $subwhere)
523 523
           $project
524 524
         GROUP BY c.$category
525 525
*/
......
531 531
         JOIN ap a ON (a.id = ac.trans_id)
532 532
         $dpt_join
533 533
         WHERE $where $dpt_where
534
           AND ac.trans_id IN ( SELECT trans_id FROM acc_trans JOIN chart ON (chart_id = id) WHERE (link LIKE '%AP_paid%') $subwhere)
534
           AND ac.trans_id IN ( SELECT trans_id FROM acc_trans a JOIN chart c ON (a.chart_id = c.id) WHERE (link LIKE '%AP_paid%') $subwhere)
535 535
           $project
536 536
         GROUP BY c.$category
537 537

  
......
559 559
         JOIN chart c on (p.income_accno_id = c.id)
560 560
         $dpt_join
561 561
         WHERE (c.category = 'I') $prwhere $dpt_where
562
           AND ac.trans_id IN ( SELECT trans_id FROM acc_trans JOIN chart ON (chart_id = id) WHERE (link LIKE '%AR_paid%') $subwhere)
562
           AND ac.trans_id IN ( SELECT trans_id FROM acc_trans a JOIN chart c ON (a.chart_id = c.id) WHERE (link LIKE '%AR_paid%') $subwhere)
563 563
           $project
564 564
         GROUP BY c.$category
565 565

  
......
572 572
         JOIN chart c on (p.expense_accno_id = c.id)
573 573
         $dpt_join
574 574
         WHERE (c.category = 'E') $prwhere $dpt_where
575
           AND ac.trans_id IN ( SELECT trans_id FROM acc_trans JOIN chart ON (chart_id = id) WHERE (link LIKE '%AP_paid%') $subwhere)
575
           AND ac.trans_id IN ( SELECT trans_id FROM acc_trans a JOIN chart c ON (a.chart_id = c.id) WHERE (link LIKE '%AP_paid%') $subwhere)
576 576
         $project
577 577
         GROUP BY c.$category
578 578
         |;
......
1334 1334
      AND ac.trans_id IN
1335 1335
        (
1336 1336
          SELECT trans_id
1337
          FROM acc_trans
1338
          JOIN chart ON (chart_id = id)
1337
          FROM acc_trans a
1338
          JOIN chart c ON (a.chart_id = c.id)
1339 1339
          WHERE (link LIKE '%${ARAP}_paid%')
1340 1340
          AND (transdate <= $todate)
1341 1341
        )

Auch abrufbar als: Unified diff