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

(-)a/C4/Acquisition.pm (-12 / +25 lines)
Lines 1415-1437 sub ModReceiveOrder { Link Here
1415
            $order->{ordernumber}
1415
            $order->{ordernumber}
1416
        );
1416
        );
1417
1417
1418
        if ( not $order->{subscriptionid} && defined $order->{order_internalnote} ) {
1419
            $dbh->do(
1420
                q|UPDATE aqorders
1421
                SET order_internalnote = ?
1422
                WHERE ordernumber = ?|, {},
1423
                $order->{order_internalnote}, $order->{ordernumber}
1424
            );
1425
        }
1426
1427
        # Recalculate tax_value
1418
        # Recalculate tax_value
1428
        $dbh->do(q|
1419
        $query = q|
1429
            UPDATE aqorders
1420
            UPDATE aqorders
1430
            SET
1421
            SET
1431
                tax_value_on_ordering = quantity * | . get_rounding_sql(q|ecost_tax_excluded|) . q| * tax_rate_on_ordering,
1422
                tax_value_on_ordering = quantity * | . get_rounding_sql(q|ecost_tax_excluded|) . q| * tax_rate_on_ordering,
1432
                tax_value_on_receiving = quantity * | . get_rounding_sql(q|unitprice_tax_excluded|) . q| * tax_rate_on_receiving
1423
                tax_value_on_receiving = quantity * | . get_rounding_sql(q|unitprice_tax_excluded|) . q| * tax_rate_on_receiving
1424
        |;
1425
1426
        my @params;
1427
        if ( not $order->{subscriptionid} && defined $order->{order_internalnote} )
1428
        {
1429
            $query .= q|, order_internalnote = ?|;
1430
            push @params, $order->{order_internalnote};
1431
        }
1432
        if ( defined $order->{invoice_unitprice} ) {
1433
            $query .= q|, invoice_unitprice = ?, invoice_currency = ?|;
1434
            push @params, $order->{invoice_unitprice}, $order->{invoice_currency};
1435
        }
1436
        $query .= q|
1433
            WHERE ordernumber = ?
1437
            WHERE ordernumber = ?
1434
        |, undef, $order->{ordernumber});
1438
        |;
1439
1440
        $dbh->do($query, undef, @params, $order->{ordernumber});
1435
1441
1436
        delete $order->{ordernumber};
1442
        delete $order->{ordernumber};
1437
        $order->{budget_id} = ( $budget_id || $order->{budget_id} );
1443
        $order->{budget_id} = ( $budget_id || $order->{budget_id} );
Lines 1483-1488 sub ModReceiveOrder { Link Here
1483
            , order_internalnote = ?
1489
            , order_internalnote = ?
1484
        | if defined $order->{order_internalnote};
1490
        | if defined $order->{order_internalnote};
1485
1491
1492
        $query .= q|
1493
            , invoice_unitprice = ?, invoice_currency = ?
1494
        | if defined $order->{invoice_unitprice};
1495
1486
        $query .= q| where biblionumber=? and ordernumber=?|;
1496
        $query .= q| where biblionumber=? and ordernumber=?|;
1487
1497
1488
        my $sth = $dbh->prepare( $query );
1498
        my $sth = $dbh->prepare( $query );
Lines 1508-1513 sub ModReceiveOrder { Link Here
1508
            push @params, $order->{order_internalnote};
1518
            push @params, $order->{order_internalnote};
1509
        }
1519
        }
1510
1520
1521
        if ( defined $order->{invoice_unitprice} ) {
1522
            push @params, $order->{invoice_unitprice}, $order->{invoice_currency};
1523
        }
1524
1511
        push @params, ( $biblionumber, $order->{ordernumber} );
1525
        push @params, ( $biblionumber, $order->{ordernumber} );
1512
1526
1513
        $sth->execute( @params );
1527
        $sth->execute( @params );
1514
- 

Return to bug 25655