View | Details | Raw Unified | Return to bug 20150
Collapse All | Expand All

(-)a/reports/acquisitions_stats.pl (-3 / +6 lines)
Lines 445-452 sub calculate { Link Here
445
        $strcalc .= "COUNT(*) ";
445
        $strcalc .= "COUNT(*) ";
446
    } elsif ( $process == 2 ) {
446
    } elsif ( $process == 2 ) {
447
        $strcalc .= "COUNT(DISTINCT(aqorders.biblionumber)) ";
447
        $strcalc .= "COUNT(DISTINCT(aqorders.biblionumber)) ";
448
    } elsif ( $process == 3 || $process == 4 || $process == 5 ) {
448
    } elsif ( $process == 3 ) { # Amount
449
        $strcalc .= "SUM(aqorders.listprice) ";
449
        $strcalc .= q|SUM(| . C4::Acquisition::get_rounding_sql(q|ecost_tax_included|) . q| * quantity ) + SUM(| . C4::Acquisition::get_rounding_sql(q|COALESCE(unitprice_tax_included, ecost_tax_included)|) . q| * quantity ) AS budget_total |;
450
    } elsif ( $process == 4 ) { # Ordered
451
        $strcalc .= q|SUM(| . C4::Acquisition::get_rounding_sql(q|ecost_tax_included|) . q| * quantity ) AS budget_ordered |
452
    } elsif ( $process == 5 ) { # Spent
453
        $strcalc .= q|SUM(| . C4::Acquisition::get_rounding_sql(q|COALESCE(unitprice_tax_included, ecost_tax_included)|) . q| * quantity ) AS budget_spent |
450
    } else {
454
    } else {
451
        $strcalc .= "NULL ";
455
        $strcalc .= "NULL ";
452
    }
456
    }
453
- 

Return to bug 20150