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

(-)a/C4/Acquisition.pm (-5 / +27 lines)
Lines 1473-1485 sub GetLateOrders { Link Here
1473
    my $delay      = shift;
1473
    my $delay      = shift;
1474
    my $supplierid = shift;
1474
    my $supplierid = shift;
1475
    my $branch     = shift;
1475
    my $branch     = shift;
1476
    my $estimateddeliverydatefrom = shift;
1477
    my $estimateddeliverydateto = shift;
1476
1478
1477
    my $dbh = C4::Context->dbh;
1479
    my $dbh = C4::Context->dbh;
1478
1480
1479
    #BEWARE, order of parenthesis and LEFT JOIN is important for speed
1481
    #BEWARE, order of parenthesis and LEFT JOIN is important for speed
1480
    my $dbdriver = C4::Context->config("db_scheme") || "mysql";
1482
    my $dbdriver = C4::Context->config("db_scheme") || "mysql";
1481
1483
1482
    my @query_params = ($delay);	# delay is the first argument regardless
1484
    my @query_params = ();
1483
    my $select = "
1485
    my $select = "
1484
    SELECT aqbasket.basketno,
1486
    SELECT aqbasket.basketno,
1485
        aqorders.ordernumber,
1487
        aqorders.ordernumber,
Lines 1495-1500 sub GetLateOrders { Link Here
1495
        biblio.author, biblio.title,
1497
        biblio.author, biblio.title,
1496
        biblioitems.publishercode AS publisher,
1498
        biblioitems.publishercode AS publisher,
1497
        biblioitems.publicationyear,
1499
        biblioitems.publicationyear,
1500
        ADDDATE(aqbasket.closedate, INTERVAL aqbooksellers.deliverytime DAY) AS estimateddeliverydate,
1498
    ";
1501
    ";
1499
    my $from = "
1502
    my $from = "
1500
    FROM
1503
    FROM
Lines 1508-1513 sub GetLateOrders { Link Here
1508
            OR datereceived IS NULL
1511
            OR datereceived IS NULL
1509
            OR aqorders.quantityreceived < aqorders.quantity
1512
            OR aqorders.quantityreceived < aqorders.quantity
1510
        )
1513
        )
1514
        AND aqbasket.closedate IS NOT NULL
1511
        AND (aqorders.datecancellationprinted IS NULL OR aqorders.datecancellationprinted='0000-00-00')
1515
        AND (aqorders.datecancellationprinted IS NULL OR aqorders.datecancellationprinted='0000-00-00')
1512
    ";
1516
    ";
1513
    my $having = "";
1517
    my $having = "";
Lines 1515-1523 sub GetLateOrders { Link Here
1515
        $select .= "
1519
        $select .= "
1516
        aqorders.quantity - IFNULL(aqorders.quantityreceived,0)                 AS quantity,
1520
        aqorders.quantity - IFNULL(aqorders.quantityreceived,0)                 AS quantity,
1517
        (aqorders.quantity - IFNULL(aqorders.quantityreceived,0)) * aqorders.rrp AS subtotal,
1521
        (aqorders.quantity - IFNULL(aqorders.quantityreceived,0)) * aqorders.rrp AS subtotal,
1518
        DATEDIFF(CURDATE( ),closedate) AS latesince
1522
        DATEDIFF(CAST(now() AS date),closedate) AS latesince
1519
        ";
1523
        ";
1520
        $from .= " AND (closedate <= DATE_SUB(CURDATE( ),INTERVAL ? DAY)) ";
1524
        if ( defined $delay ) {
1525
            $from .= " AND (closedate <= DATE_SUB(CAST(now() AS date),INTERVAL ? DAY)) " ;
1526
            push @query_params, $delay;
1527
        }
1521
        $having = "
1528
        $having = "
1522
        HAVING quantity          <> 0
1529
        HAVING quantity          <> 0
1523
            AND unitpricesupplier <> 0
1530
            AND unitpricesupplier <> 0
Lines 1528-1536 sub GetLateOrders { Link Here
1528
        $select .= "
1535
        $select .= "
1529
                aqorders.quantity                AS quantity,
1536
                aqorders.quantity                AS quantity,
1530
                aqorders.quantity * aqorders.rrp AS subtotal,
1537
                aqorders.quantity * aqorders.rrp AS subtotal,
1531
                (CURDATE - closedate)            AS latesince
1538
                (CAST(now() AS date) - closedate)            AS latesince
1532
        ";
1539
        ";
1533
        $from .= " AND (closedate <= (CURDATE -(INTERVAL ? DAY)) ";
1540
        if ( defined $delay ) {
1541
            $from .= " AND (closedate <= (CAST(now() AS date) -(INTERVAL ? DAY)) ";
1542
            push @query_params, $delay;
1543
        }
1534
    }
1544
    }
1535
    if (defined $supplierid) {
1545
    if (defined $supplierid) {
1536
        $from .= ' AND aqbasket.booksellerid = ? ';
1546
        $from .= ' AND aqbasket.booksellerid = ? ';
Lines 1540-1545 sub GetLateOrders { Link Here
1540
        $from .= ' AND borrowers.branchcode LIKE ? ';
1550
        $from .= ' AND borrowers.branchcode LIKE ? ';
1541
        push @query_params, $branch;
1551
        push @query_params, $branch;
1542
    }
1552
    }
1553
    if ( defined $estimateddeliverydatefrom ) {
1554
        $from .= '
1555
            AND aqbooksellers.deliverytime IS NOT NULL
1556
            AND ADDDATE(aqbasket.closedate, INTERVAL aqbooksellers.deliverytime DAY) >= ?';
1557
        push @query_params, $estimateddeliverydatefrom;
1558
    }
1559
    if ( defined $estimateddeliverydatefrom and defined $estimateddeliverydateto ) {
1560
        $from .= ' AND ADDDATE(aqbasket.closedate, INTERVAL aqbooksellers.deliverytime DAY) <= ?';
1561
        push @query_params, $estimateddeliverydateto;
1562
    } elsif ( defined $estimateddeliverydatefrom ) {
1563
        $from .= ' AND ADDDATE(aqbasket.closedate, INTERVAL aqbooksellers.deliverytime DAY) <= CAST(now() AS date)';
1564
    }
1543
    if (C4::Context->preference("IndependantBranches")
1565
    if (C4::Context->preference("IndependantBranches")
1544
            && C4::Context->userenv
1566
            && C4::Context->userenv
1545
            && C4::Context->userenv->{flags} != 1 ) {
1567
            && C4::Context->userenv->{flags} != 1 ) {
(-)a/C4/Bookseller.pm (-15 / +46 lines)
Lines 102-120 Searches for suppliers with late orders. Link Here
102
=cut
102
=cut
103
103
104
sub GetBooksellersWithLateOrders {
104
sub GetBooksellersWithLateOrders {
105
    my $delay = shift;
105
    my ( $delay, $branch, $estimateddeliverydatefrom, $estimateddeliverydateto ) = @_;    # FIXME: Branch argument unused.
106
    my $dbh   = C4::Context->dbh;
106
    my $dbh = C4::Context->dbh;
107
107
108
    # TODO delay should be verified
108
    # FIXME NOT quite sure that this operation is valid for DBMs different from Mysql, HOPING so
109
    my $query_string =
109
    # should be tested with other DBMs
110
      "SELECT DISTINCT aqbasket.booksellerid, aqbooksellers.name
110
111
    FROM aqorders LEFT JOIN aqbasket ON aqorders.basketno=aqbasket.basketno
111
    my $strsth;
112
    LEFT JOIN aqbooksellers ON aqbasket.booksellerid = aqbooksellers.id
112
    my @query_params = ();
113
    WHERE (closedate < DATE_SUB(CURDATE( ),INTERVAL $delay DAY)
113
    my $dbdriver = C4::Context->config("db_scheme") || "mysql";
114
    AND (datereceived = '' OR datereceived IS NULL))";
114
    $strsth = "
115
115
        SELECT DISTINCT aqbasket.booksellerid, aqbooksellers.name
116
    my $sth = $dbh->prepare($query_string);
116
        FROM aqorders LEFT JOIN aqbasket ON aqorders.basketno=aqbasket.basketno
117
    $sth->execute;
117
        LEFT JOIN aqbooksellers ON aqbasket.booksellerid = aqbooksellers.id
118
        WHERE 
119
            ( datereceived = ''
120
            OR datereceived IS NULL
121
            OR aqorders.quantityreceived < aqorders.quantity
122
            )
123
            AND aqorders.rrp <> 0
124
            AND aqorders.ecost <> 0
125
            AND aqorders.quantity - IFNULL(aqorders.quantityreceived,0) <> 0
126
            AND aqbasket.closedate IS NOT NULL
127
    ";
128
    if ( defined $delay ) {
129
        $strsth .= " AND (closedate <= DATE_SUB(CAST(now() AS date),INTERVAL ? DAY)) ";
130
        push @query_params, $delay;
131
    }
132
    if ( defined $estimateddeliverydatefrom ) {
133
        $strsth .= '
134
            AND aqbooksellers.deliverytime IS NOT NULL
135
            AND ADDDATE(aqbasket.closedate, INTERVAL aqbooksellers.deliverytime DAY) >= ?';
136
        push @query_params, $estimateddeliverydatefrom;
137
    }
138
    if ( defined $estimateddeliverydatefrom and defined $estimateddeliverydateto ) {
139
        $strsth .= ' AND ADDDATE(aqbasket.closedate, INTERVAL aqbooksellers.deliverytime DAY) <= ?';
140
        push @query_params, $estimateddeliverydateto;
141
    } elsif ( defined $estimateddeliverydatefrom ) {
142
        $strsth .= ' AND ADDDATE(aqbasket.closedate, INTERVAL aqbooksellers.deliverytime DAY) <= CAST(now() AS date)';
143
    }
144
145
    my $sth = $dbh->prepare($strsth);
146
    $sth->execute( @query_params );
118
    my %supplierlist;
147
    my %supplierlist;
119
    while ( my ( $id, $name ) = $sth->fetchrow ) {
148
    while ( my ( $id, $name ) = $sth->fetchrow ) {
120
        $supplierlist{$id} = $name;
149
        $supplierlist{$id} = $name;
Lines 201-207 sub ModBookseller { Link Here
201
            contphone=?,contfax=?,contaltphone=?,contemail=?,
230
            contphone=?,contfax=?,contaltphone=?,contemail=?,
202
            contnotes=?,active=?,listprice=?, invoiceprice=?,
231
            contnotes=?,active=?,listprice=?, invoiceprice=?,
203
            gstreg=?,listincgst=?,invoiceincgst=?,
232
            gstreg=?,listincgst=?,invoiceincgst=?,
204
            discount=?,notes=?,gstrate=?
233
            discount=?,notes=?,gstrate=?,deliverytime=?
205
        WHERE id=?';
234
        WHERE id=?';
206
    my $sth = $dbh->prepare($query);
235
    my $sth = $dbh->prepare($query);
207
    $sth->execute(
236
    $sth->execute(
Lines 218-224 sub ModBookseller { Link Here
218
        $data->{'invoiceprice'}, $data->{'gstreg'},
247
        $data->{'invoiceprice'}, $data->{'gstreg'},
219
        $data->{'listincgst'},   $data->{'invoiceincgst'},
248
        $data->{'listincgst'},   $data->{'invoiceincgst'},
220
        $data->{'discount'},     $data->{'notes'},
249
        $data->{'discount'},     $data->{'notes'},
221
        $data->{'gstrate'},      $data->{'id'}
250
        $data->{'gstrate'},
251
        $data->{deliverytime},
252
        $data->{'id'}
222
    );
253
    );
223
    return;
254
    return;
224
}
255
}
(-)a/acqui/basket.pl (+11 lines)
Lines 34-39 use C4::Biblio; Link Here
34
use C4::Members qw/GetMember/;  #needed for permissions checking for changing basketgroup of a basket
34
use C4::Members qw/GetMember/;  #needed for permissions checking for changing basketgroup of a basket
35
use C4::Items;
35
use C4::Items;
36
use C4::Suggestions;
36
use C4::Suggestions;
37
use Date::Calc qw/Add_Delta_Days/;
37
38
38
=head1 NAME
39
=head1 NAME
39
40
Lines 213-218 if ( $op eq 'delete_confirm' ) { Link Here
213
        }
214
        }
214
        unshift( @$basketgroups, \%emptygroup );
215
        unshift( @$basketgroups, \%emptygroup );
215
    }
216
    }
217
218
    # if the basket is closed, calculate estimated delivery date
219
    my $estimateddeliverydate;
220
    if( $basket->{closedate} ) {
221
        my ($year, $month, $day) = ($basket->{closedate} =~ /(\d+)-(\d+)-(\d+)/);
222
        ($year, $month, $day) = Add_Delta_Days($year, $month, $day, $bookseller->{deliverytime});
223
        $estimateddeliverydate = "$year-$month-$day";
224
    }
225
216
    # if new basket, pre-fill infos
226
    # if new basket, pre-fill infos
217
    $basket->{creationdate} = ""            unless ( $basket->{creationdate} );
227
    $basket->{creationdate} = ""            unless ( $basket->{creationdate} );
218
    $basket->{authorisedby} = $loggedinuser unless ( $basket->{authorisedby} );
228
    $basket->{authorisedby} = $loggedinuser unless ( $basket->{authorisedby} );
Lines 367-372 my $total_est_gste; Link Here
367
        authorisedby         => $basket->{authorisedby},
377
        authorisedby         => $basket->{authorisedby},
368
        authorisedbyname     => $basket->{authorisedbyname},
378
        authorisedbyname     => $basket->{authorisedbyname},
369
        closedate            => $basket->{closedate},
379
        closedate            => $basket->{closedate},
380
        estimateddeliverydate=> $estimateddeliverydate,
370
        active               => $bookseller->{'active'},
381
        active               => $bookseller->{'active'},
371
        booksellerid         => $bookseller->{'id'},
382
        booksellerid         => $bookseller->{'id'},
372
        name                 => $bookseller->{'name'},
383
        name                 => $bookseller->{'name'},
(-)a/acqui/lateorders.pl (-6 / +21 lines)
Lines 66-79 my ($template, $loggedinuser, $cookie) = get_template_and_user({ Link Here
66
66
67
my $booksellerid = $input->param('booksellerid') || undef; # we don't want "" or 0
67
my $booksellerid = $input->param('booksellerid') || undef; # we don't want "" or 0
68
my $delay      = $input->param('delay');
68
my $delay      = $input->param('delay');
69
my $estimateddeliverydatefrom = $input->param('estimateddeliverydatefrom');
70
my $estimateddeliverydateto   = $input->param('estimateddeliverydateto');
69
my $branch     = $input->param('branch');
71
my $branch     = $input->param('branch');
70
my $op         = $input->param('op');
72
my $op         = $input->param('op');
71
73
72
my @errors = ();
74
my @errors = ();
73
$delay = 30 unless defined $delay;
75
if ( defined $delay and not $delay =~ /^\d{1,3}$/ ) {
74
unless ($delay =~ /^\d{1,3}$/) {
76
    push @errors, {delay_digits => 1, bad_delay => $delay};
75
	push @errors, {delay_digits => 1, bad_delay => $delay};
76
	$delay = 30;	#default value for delay
77
}
77
}
78
78
79
if ($op and $op eq "send_alert"){
79
if ($op and $op eq "send_alert"){
Lines 92-98 if ($op and $op eq "send_alert"){ Link Here
92
    }
92
    }
93
}
93
}
94
94
95
my %supplierlist = GetBooksellersWithLateOrders($delay);
95
my %supplierlist = GetBooksellersWithLateOrders(
96
    $delay,
97
    $branch,
98
    C4::Dates->new($estimateddeliverydatefrom)->output("iso"),
99
    C4::Dates->new($estimateddeliverydateto)->output("iso")
100
);
101
96
my (@sloopy);	# supplier loop
102
my (@sloopy);	# supplier loop
97
foreach (keys %supplierlist){
103
foreach (keys %supplierlist){
98
	push @sloopy, (($booksellerid and $booksellerid eq $_ )            ?
104
	push @sloopy, (($booksellerid and $booksellerid eq $_ )            ?
Lines 104-110 $template->param(SUPPLIER_LOOP => \@sloopy); Link Here
104
$template->param(Supplier=>$supplierlist{$booksellerid}) if ($booksellerid);
110
$template->param(Supplier=>$supplierlist{$booksellerid}) if ($booksellerid);
105
$template->param(booksellerid=>$booksellerid) if ($booksellerid);
111
$template->param(booksellerid=>$booksellerid) if ($booksellerid);
106
112
107
my @lateorders = GetLateOrders($delay,$booksellerid,$branch);
113
my @lateorders = GetLateOrders(
114
    $delay,
115
    $booksellerid,
116
    $branch,
117
    C4::Dates->new($estimateddeliverydatefrom)->output("iso"),
118
    C4::Dates->new($estimateddeliverydateto)->output("iso")
119
);
108
120
109
my $total;
121
my $total;
110
foreach (@lateorders){
122
foreach (@lateorders){
Lines 122-128 $template->param(ERROR_LOOP => \@errors) if (@errors); Link Here
122
$template->param(
134
$template->param(
123
	lateorders => \@lateorders,
135
	lateorders => \@lateorders,
124
	delay => $delay,
136
	delay => $delay,
137
    estimateddeliverydatefrom => $estimateddeliverydatefrom,
138
    estimateddeliverydateto   => $estimateddeliverydateto,
125
	total => $total,
139
	total => $total,
126
	intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"),
140
	intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"),
141
    DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(),
127
);
142
);
128
output_html_with_http_headers $input, $cookie, $template->output;
143
output_html_with_http_headers $input, $cookie, $template->output;
(-)a/acqui/supplier.pl (+2 lines)
Lines 103-108 if ( $op eq 'display' ) { Link Here
103
        listincgst    => $supplier->{'listincgst'},
103
        listincgst    => $supplier->{'listincgst'},
104
        invoiceincgst => $supplier->{'invoiceincgst'},
104
        invoiceincgst => $supplier->{'invoiceincgst'},
105
        discount      => $supplier->{'discount'},
105
        discount      => $supplier->{'discount'},
106
        deliverytime  => $supplier->{deliverytime},
106
        invoiceprice  => $supplier->{'invoiceprice'},
107
        invoiceprice  => $supplier->{'invoiceprice'},
107
        listprice     => $supplier->{'listprice'},
108
        listprice     => $supplier->{'listprice'},
108
        GST           => $tax_rate,
109
        GST           => $tax_rate,
Lines 170-175 if ( $op eq 'display' ) { Link Here
170
        invoiceincgst => $supplier->{'invoiceincgst'},
171
        invoiceincgst => $supplier->{'invoiceincgst'},
171
        gstrate       => $gstrate,
172
        gstrate       => $gstrate,
172
        discount      => $supplier->{'discount'},
173
        discount      => $supplier->{'discount'},
174
        deliverytime  => $supplier->{deliverytime},
173
        loop_currency => $loop_currency,
175
        loop_currency => $loop_currency,
174
        GST           => $tax_rate,
176
        GST           => $tax_rate,
175
        enter         => 1,
177
        enter         => 1,
(-)a/acqui/updatesupplier.pl (+1 lines)
Lines 107-112 if ($gstrate eq '') { Link Here
107
    $data{'gstrate'} = $input->param('gstrate')/100;
107
    $data{'gstrate'} = $input->param('gstrate')/100;
108
}
108
}
109
$data{'discount'}=$input->param('discount');
109
$data{'discount'}=$input->param('discount');
110
$data{deliverytime} = $input->param('deliverytime');
110
$data{'active'}=$input->param('status');
111
$data{'active'}=$input->param('status');
111
if($data{'name'}) {
112
if($data{'name'}) {
112
	if ($data{'id'}){
113
	if ($data{'id'}){
(-)a/installer/data/mysql/kohastructure.sql (+1 lines)
Lines 2597-2602 CREATE TABLE `aqbooksellers` ( -- information about the vendors listed in acquis Link Here
2597
  `gstrate` decimal(6,4) default NULL, -- the tax rate the library is charged
2597
  `gstrate` decimal(6,4) default NULL, -- the tax rate the library is charged
2598
  `discount` float(6,4) default NULL, -- discount offered on all items ordered from this vendor
2598
  `discount` float(6,4) default NULL, -- discount offered on all items ordered from this vendor
2599
  `fax` varchar(50) default NULL, -- vendor fax number
2599
  `fax` varchar(50) default NULL, -- vendor fax number
2600
  `deliverytime` int(11) default NULL, -- vendor delivery time
2600
  PRIMARY KEY  (`id`),
2601
  PRIMARY KEY  (`id`),
2601
  KEY `listprice` (`listprice`),
2602
  KEY `listprice` (`listprice`),
2602
  KEY `invoiceprice` (`invoiceprice`),
2603
  KEY `invoiceprice` (`invoiceprice`),
(-)a/installer/data/mysql/updatedatabase.pl (+7 lines)
Lines 5036-5041 if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { Link Here
5036
    SetVersion($DBversion);
5036
    SetVersion($DBversion);
5037
}
5037
}
5038
5038
5039
$DBversion = "3.07.00.XXX";
5040
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
5041
    $dbh->do("ALTER TABLE aqbooksellers ADD deliverytime INT DEFAULT NULL");
5042
    print "Upgrade to $DBversion done (Add deliverytime field in aqbooksellers table)";
5043
    SetVersion($DBversion);
5044
}
5045
5039
=head1 FUNCTIONS
5046
=head1 FUNCTIONS
5040
5047
5041
=head2 DropAllForeignKeys($table)
5048
=head2 DropAllForeignKeys($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt (+1 lines)
Lines 181-186 Link Here
181
                [% IF ( authorisedbyname ) %]<li><span class="label">Managed by:</span>  [% authorisedbyname %]</li>[% END %]
181
                [% IF ( authorisedbyname ) %]<li><span class="label">Managed by:</span>  [% authorisedbyname %]</li>[% END %]
182
                [% IF ( creationdate ) %]<li><span class="label">Opened on:</span>  [% creationdate | $KohaDates %]</li>[% END %]
182
                [% IF ( creationdate ) %]<li><span class="label">Opened on:</span>  [% creationdate | $KohaDates %]</li>[% END %]
183
                [% IF ( closedate ) %]<li><span class="label">Closed on:</span> [% closedate | $KohaDates %]</li>[% END %]
183
                [% IF ( closedate ) %]<li><span class="label">Closed on:</span> [% closedate | $KohaDates %]</li>[% END %]
184
                [% IF ( estimateddeliverydate ) %]<li><span class="label">Estimated delivery date:</span> [% estimateddeliverydate | $KohaDates  %]</li>[% END %]
184
185
185
                </ol>
186
                </ol>
186
                </div>
187
                </div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt (-2 / +41 lines)
Lines 1-7 Link Here
1
[% USE KohaDates %]
1
[% INCLUDE 'doc-head-open.inc' %]
2
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Acquisitions &rsaquo; Late orders</title>
3
<title>Koha &rsaquo; Acquisitions &rsaquo; Late orders</title>
3
[% INCLUDE 'doc-head-close.inc' %]
4
[% INCLUDE 'doc-head-close.inc' %]
4
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
5
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
6
[% INCLUDE 'calendar.inc' %]
5
<script type="text/javascript">
7
<script type="text/javascript">
6
//<![CDATA[
8
//<![CDATA[
7
$(document).ready(function() {
9
$(document).ready(function() {
Lines 60-65 $(document).ready(function() { Link Here
60
    <table id="late_orders">
62
    <table id="late_orders">
61
        <tr>
63
        <tr>
62
            <th>Order Date</th>
64
            <th>Order Date</th>
65
            <th>Estimated delivery date</th>
63
            <th>Vendor</th>
66
            <th>Vendor</th>
64
            <th>Information</th>
67
            <th>Information</th>
65
            <th>Total cost</th>
68
            <th>Total cost</th>
Lines 81-86 $(document).ready(function() { Link Here
81
                ([% lateorder.latesince %] days)
84
                ([% lateorder.latesince %] days)
82
            </td>
85
            </td>
83
            <td>
86
            <td>
87
                [% IF ( lateorder.estimateddeliverydate ) %]
88
                    [% lateorder.estimateddeliverydate | $KohaDates  %]
89
                [% END %]
90
            </td>
91
            <td>
84
                [% lateorder.supplier %]
92
                [% lateorder.supplier %]
85
            </td>
93
            </td>
86
            <td>
94
            <td>
Lines 117-123 $(document).ready(function() { Link Here
117
        [% END %]
125
        [% END %]
118
        <tr> 
126
        <tr> 
119
            <th>Total</th>
127
            <th>Total</th>
120
            <th colspan="2">&nbsp;</th>
128
            <th colspan="3">&nbsp;</th>
121
            <th>[% total %]</th>
129
            <th>[% total %]</th>
122
            <th>&nbsp;</th>
130
            <th>&nbsp;</th>
123
            <th>&nbsp;</th>
131
            <th>&nbsp;</th>
Lines 140-146 $(document).ready(function() { Link Here
140
[% FOREACH ERROR_LOO IN ERROR_LOOP %]
148
[% FOREACH ERROR_LOO IN ERROR_LOOP %]
141
[% IF ( ERROR_LOO.delay_digits ) %]<p class="error">The number of days ([% ERROR_LOO.bad_delay %]) must be a number between 0 and 999.</p>[% END %]
149
[% IF ( ERROR_LOO.delay_digits ) %]<p class="error">The number of days ([% ERROR_LOO.bad_delay %]) must be a number between 0 and 999.</p>[% END %]
142
[% END %]
150
[% END %]
143
<ol><li><label for="delay">Order date:</label><input size="3" maxlength="3" id="delay" type="text" name="delay" value="[% delay %]" /> days ago</li>
151
<ol>
152
    <li><label for="delay">Order date:</label><input size="3" maxlength="3" id="delay" type="text" name="delay" value="[% delay %]" /> days ago</li>
153
    <li><label for="delay">Estimated Delivery date from: </label>
154
        <input type="text" size="10" id="estimateddeliverydatefrom" name="estimateddeliverydatefrom" value="[% estimateddeliverydatefrom %]" />
155
        <img src="[% themelang %]/lib/calendar/cal.gif" id="openCalendarFrom" style="cursor: pointer;" alt="Show Calendar" />
156
        <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
157
    </li>
158
    <li><label for="delay">To: </label>
159
        <input type="text" size="10" id="estimateddeliverydateto" name="estimateddeliverydateto" value="[% estimateddeliverydateto %]" />
160
        <img src="[% themelang %]/lib/calendar/cal.gif" id="openCalendarTo" style="cursor: pointer;" alt="Show Calendar" />
161
        <script type="text/javascript">
162
            // return true if the date is blocked.
163
            function disable_from(date) {var limit = get_Calendar_limit(date,'estimateddeliverydatefrom'); return (limit && limit < date);}
164
            function disable_to(date) {var limit = get_Calendar_limit(date,'estimateddeliverydateto'); return (limit && limit < date);}
165
            Calendar.setup({
166
                inputField : "estimateddeliverydatefrom",
167
                ifFormat : "[% DHTMLcalendar_dateformat %]",
168
                button : "openCalendarFrom",
169
                disableFunc : disable_from,
170
                dateStatusFunc : disable_from
171
            });
172
            Calendar.setup({
173
                inputField : "estimateddeliverydateto",
174
                ifFormat : "[% DHTMLcalendar_dateformat %]",
175
                button : "openCalendarTo",
176
                disableFunc : disable_to,
177
                dateStatusFunc : disable_to
178
             });
179
        </script>
180
        <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
181
    </li>
182
144
	<li><label for="booksellerid">Vendor:</label>
183
	<li><label for="booksellerid">Vendor:</label>
145
		<select id="booksellerid" size="1" tabindex="" name="booksellerid">
184
		<select id="booksellerid" size="1" tabindex="" name="booksellerid">
146
			<option value=""/>
185
			<option value=""/>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt (-1 / +8 lines)
Lines 138-143 if (f.company.value == "") { Link Here
138
            <li><label for="discount">Discount</label>
138
            <li><label for="discount">Discount</label>
139
                <input type="text" size="6" id="discount" name="discount" value="[% discount %]" />%</li>
139
                <input type="text" size="6" id="discount" name="discount" value="[% discount %]" />%</li>
140
            <li><label for="gstrate">Tax rate</label><input type="text" name="gstrate" id="gstrate" size="6" value="[% gstrate %]"/>% (leave blank for default tax of [% default_gst_rate %]%)</li>
140
            <li><label for="gstrate">Tax rate</label><input type="text" name="gstrate" id="gstrate" size="6" value="[% gstrate %]"/>% (leave blank for default tax of [% default_gst_rate %]%)</li>
141
            <li>
142
                <label for="deliverytime">Delivery time</label>
143
                <input type="text" size="2" id="deliverytime" name="deliverytime" value="[% deliverytime %]" /> days
144
            </li>
141
            <li><label for="notes">Notes</label>
145
            <li><label for="notes">Notes</label>
142
                <textarea cols="40" rows="4" id="notes" name="notes" >[% notes %]</textarea></li></ol>
146
                <textarea cols="40" rows="4" id="notes" name="notes" >[% notes %]</textarea></li></ol>
143
        </fieldset>
147
        </fieldset>
Lines 198-203 if (f.company.value == "") { Link Here
198
                [% discount %] %</p>
202
                [% discount %] %</p>
199
            <p><strong>Tax rate: </strong>
203
            <p><strong>Tax rate: </strong>
200
                [% GST %]%[% UNLESS ( default_tax ) %] (default)[% END %]</p>
204
                [% GST %]%[% UNLESS ( default_tax ) %] (default)[% END %]</p>
205
            [% IF deliverytime.defined %]
206
                <p><strong>Delivery time: </strong>
207
                    [% deliverytime %] days</p>
208
            [% END %]
201
            [% IF ( notes ) %]<p><strong>Notes: </strong>
209
            [% IF ( notes ) %]<p><strong>Notes: </strong>
202
                [% notes %]</p>[% END %]
210
                [% notes %]</p>[% END %]
203
        </div>
211
        </div>
204
- 

Return to bug 7291