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

(-)a/C4/Acquisition.pm (-4 / +13 lines)
Lines 991-1000 C<$order> are fields from the biblio, biblioitems, aqorders tables of the Koha d Link Here
991
sub GetOrder {
991
sub GetOrder {
992
    my ($ordernumber) = @_;
992
    my ($ordernumber) = @_;
993
    my $dbh      = C4::Context->dbh;
993
    my $dbh      = C4::Context->dbh;
994
    my $query = qq{SELECT biblio.*,biblioitems.*,
994
    my $query = qq{SELECT
995
                aqorders.*,
995
                aqorders.*,
996
                aqbudgets.*,
996
                biblio.title,
997
                aqbasket.*,
997
                biblio.author,
998
                aqbasket.basketname,
999
                borrowers.branchcode,
1000
                biblioitems.publicationyear,
1001
                biblio.copyrightdate,
1002
                biblioitems.editionstatement,
1003
                biblioitems.isbn,
1004
                biblioitems.ean,
1005
                biblio.seriestitle,
1006
                biblioitems.publishercode
998
                aqorders.rrp              AS unitpricesupplier,
1007
                aqorders.rrp              AS unitpricesupplier,
999
                aqorders.ecost            AS unitpricelib,
1008
                aqorders.ecost            AS unitpricelib,
1000
                aqorders.claims_count     AS claims_count,
1009
                aqorders.claims_count     AS claims_count,
Lines 1005-1011 sub GetOrder { Link Here
1005
                biblioitems.publishercode AS publisher,
1014
                biblioitems.publishercode AS publisher,
1006
                ADDDATE(aqbasket.closedate, INTERVAL aqbooksellers.deliverytime DAY) AS estimateddeliverydate,
1015
                ADDDATE(aqbasket.closedate, INTERVAL aqbooksellers.deliverytime DAY) AS estimateddeliverydate,
1007
                DATE(aqbasket.closedate)  AS orderdate,
1016
                DATE(aqbasket.closedate)  AS orderdate,
1008
                aqorders.quantity - IFNULL(aqorders.quantityreceived,0)                 AS quantity,
1017
                aqorders.quantity - IFNULL(aqorders.quantityreceived,0)                  AS quantity_to_receive,
1009
                (aqorders.quantity - IFNULL(aqorders.quantityreceived,0)) * aqorders.rrp AS subtotal,
1018
                (aqorders.quantity - IFNULL(aqorders.quantityreceived,0)) * aqorders.rrp AS subtotal,
1010
                DATEDIFF(CURDATE( ),closedate) AS latesince
1019
                DATEDIFF(CURDATE( ),closedate) AS latesince
1011
                FROM aqorders LEFT JOIN biblio ON biblio.biblionumber = aqorders.biblionumber
1020
                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