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

(-)a/C4/Acquisition.pm (-4 / +13 lines)
Lines 992-1001 C<$order> are fields from the biblio, biblioitems, aqorders tables of the Koha d Link Here
992
sub GetOrder {
992
sub GetOrder {
993
    my ($ordernumber) = @_;
993
    my ($ordernumber) = @_;
994
    my $dbh      = C4::Context->dbh;
994
    my $dbh      = C4::Context->dbh;
995
    my $query = qq{SELECT biblio.*,biblioitems.*,
995
    my $query = qq{SELECT
996
                aqorders.*,
996
                aqorders.*,
997
                aqbudgets.*,
997
                biblio.title,
998
                aqbasket.*,
998
                biblio.author,
999
                aqbasket.basketname,
1000
                borrowers.branchcode,
1001
                biblioitems.publicationyear,
1002
                biblio.copyrightdate,
1003
                biblioitems.editionstatement,
1004
                biblioitems.isbn,
1005
                biblioitems.ean,
1006
                biblio.seriestitle,
1007
                biblioitems.publishercode,
999
                aqorders.rrp              AS unitpricesupplier,
1008
                aqorders.rrp              AS unitpricesupplier,
1000
                aqorders.ecost            AS unitpricelib,
1009
                aqorders.ecost            AS unitpricelib,
1001
                aqorders.claims_count     AS claims_count,
1010
                aqorders.claims_count     AS claims_count,
Lines 1006-1012 sub GetOrder { Link Here
1006
                biblioitems.publishercode AS publisher,
1015
                biblioitems.publishercode AS publisher,
1007
                ADDDATE(aqbasket.closedate, INTERVAL aqbooksellers.deliverytime DAY) AS estimateddeliverydate,
1016
                ADDDATE(aqbasket.closedate, INTERVAL aqbooksellers.deliverytime DAY) AS estimateddeliverydate,
1008
                DATE(aqbasket.closedate)  AS orderdate,
1017
                DATE(aqbasket.closedate)  AS orderdate,
1009
                aqorders.quantity - COALESCE(aqorders.quantityreceived,0)                 AS quantity,
1018
                aqorders.quantity - COALESCE(aqorders.quantityreceived,0)                 AS quantity_to_receive,
1010
                (aqorders.quantity - COALESCE(aqorders.quantityreceived,0)) * aqorders.rrp AS subtotal,
1019
                (aqorders.quantity - COALESCE(aqorders.quantityreceived,0)) * aqorders.rrp AS subtotal,
1011
                DATEDIFF(CURDATE( ),closedate) AS latesince
1020
                DATEDIFF(CURDATE( ),closedate) AS latesince
1012
                FROM aqorders LEFT JOIN biblio ON biblio.biblionumber = aqorders.biblionumber
1021
                FROM aqorders LEFT JOIN biblio ON biblio.biblionumber = aqorders.biblionumber
(-)a/acqui/lateorders-export.pl (-9 / +8 lines)
Lines 48-61 print "ORDER DATE,ESTIMATED DELIVERY DATE,VENDOR,INFORMATION,TOTAL COST,BASKET,C Link Here
48
for my $ordernumber ( @ordernumbers ) {
48
for my $ordernumber ( @ordernumbers ) {
49
    my $order = GetOrder $ordernumber;
49
    my $order = GetOrder $ordernumber;
50
    $csv->combine(
50
    $csv->combine(
51
        "(" . $$order{supplierid} . ") " . $$order{orderdate} . " (" . $$order{latesince} . " days)",
51
        "(" . $order->{supplierid} . ") " . $order->{orderdate} . " (" . $order->{latesince} . " days)",
52
        $$order{estimateddeliverydate},
52
        $order->{estimateddeliverydate},
53
        $$order{supplier},
53
        $order->{supplier},
54
        $$order{title} . ( $$order{author} ? " Author: $$order{author}" : "" ) . ( $$order{publisher} ? " Published by: $$order{publisher}" : "" ),
54
        $order->{title} . ( $order->{author} ? " Author: $order->{author}" : "" ) . ( $order->{publisher} ? " Published by: $order->{publisher}" : "" ),
55
        $$order{unitpricesupplier} . "x" . $$order{quantity} . " = " . $$order{subtotal} . " (" . $$order{budget} . ")",
55
        $order->{unitpricesupplier} . "x" . $order->{quantity_to_receive} . " = " . $order->{subtotal} . " (" . $order->{budget} . ")",
56
        $$order{basketname} . " (" . $$order{basketno} . ")",
56
        $order->{basketname} . " (" . $order->{basketno} . ")",
57
        $$order{claims_count},
57
        $order->{claims_count},
58
        $$order{claimed_date}
58
        $order->{claimed_date}
59
    );
59
    );
60
    my $string = $csv->string;
60
    my $string = $csv->string;
61
    print $string, "\n";
61
    print $string, "\n";
62
- 

Return to bug 7298