|
Lines 8-14
use POSIX qw(strftime);
Link Here
|
| 8 |
|
8 |
|
| 9 |
use C4::Bookseller qw( GetBookSellerFromId ); |
9 |
use C4::Bookseller qw( GetBookSellerFromId ); |
| 10 |
|
10 |
|
| 11 |
use Test::More tests => 63; |
11 |
use Test::More tests => 66; |
| 12 |
|
12 |
|
| 13 |
BEGIN { |
13 |
BEGIN { |
| 14 |
use_ok('C4::Acquisition'); |
14 |
use_ok('C4::Acquisition'); |
|
Lines 167-177
my ($datereceived, $new_ordernumber) = ModReceiveOrder(
Link Here
|
| 167 |
12, |
167 |
12, |
| 168 |
$invoiceid, |
168 |
$invoiceid, |
| 169 |
42, |
169 |
42, |
|
|
170 |
undef, |
| 171 |
undef, |
| 172 |
undef, |
| 173 |
"my notes", |
| 170 |
); |
174 |
); |
| 171 |
my $order2 = GetOrder( $ordernumber2 ); |
175 |
my $order2 = GetOrder( $ordernumber2 ); |
| 172 |
is($order2->{'quantityreceived'}, 0, 'Splitting up order did not receive any on original order'); |
176 |
is($order2->{'quantityreceived'}, 0, 'Splitting up order did not receive any on original order'); |
| 173 |
is($order2->{'quantity'}, 40, '40 items on original order'); |
177 |
is($order2->{'quantity'}, 40, '40 items on original order'); |
| 174 |
is($order2->{'budget_id'}, $budgetid, 'Budget on original order is unchanged'); |
178 |
is($order2->{'budget_id'}, $budgetid, 'Budget on original order is unchanged'); |
|
|
179 |
is($order2->{notes}, "my notes", 'ModReceiveOrder and GetOrder deal with notes'); |
| 175 |
|
180 |
|
| 176 |
$neworder = GetOrder( $new_ordernumber ); |
181 |
$neworder = GetOrder( $new_ordernumber ); |
| 177 |
is($neworder->{'quantity'}, 2, '2 items on new order'); |
182 |
is($neworder->{'quantity'}, 2, '2 items on new order'); |
|
Lines 194-206
my $budgetid2 = C4::Budgets::AddBudget(
Link Here
|
| 194 |
12, |
199 |
12, |
| 195 |
$invoiceid, |
200 |
$invoiceid, |
| 196 |
42, |
201 |
42, |
| 197 |
$budgetid2 |
202 |
$budgetid2, |
|
|
203 |
undef, |
| 204 |
undef, |
| 205 |
"my other notes", |
| 198 |
); |
206 |
); |
| 199 |
|
207 |
|
| 200 |
my $order3 = GetOrder( $ordernumber3 ); |
208 |
my $order3 = GetOrder( $ordernumber3 ); |
| 201 |
is($order3->{'quantityreceived'}, 0, 'Splitting up order did not receive any on original order'); |
209 |
is($order3->{'quantityreceived'}, 0, 'Splitting up order did not receive any on original order'); |
| 202 |
is($order3->{'quantity'}, 2, '2 items on original order'); |
210 |
is($order3->{'quantity'}, 2, '2 items on original order'); |
| 203 |
is($order3->{'budget_id'}, $budgetid, 'Budget on original order is unchanged'); |
211 |
is($order3->{'budget_id'}, $budgetid, 'Budget on original order is unchanged'); |
|
|
212 |
is($order3->{notes}, "my other notes", 'ModReceiveOrder and GetOrder deal with notes'); |
| 204 |
|
213 |
|
| 205 |
$neworder = GetOrder( $new_ordernumber ); |
214 |
$neworder = GetOrder( $new_ordernumber ); |
| 206 |
is($neworder->{'quantity'}, 2, '2 items on new order'); |
215 |
is($neworder->{'quantity'}, 2, '2 items on new order'); |
|
Lines 216-227
is($neworder->{'budget_id'}, $budgetid2, 'Budget on new order is changed');
Link Here
|
| 216 |
12, |
225 |
12, |
| 217 |
$invoiceid, |
226 |
$invoiceid, |
| 218 |
42, |
227 |
42, |
| 219 |
$budgetid2 |
228 |
$budgetid2, |
|
|
229 |
undef, |
| 230 |
undef, |
| 231 |
"my third notes", |
| 220 |
); |
232 |
); |
| 221 |
|
233 |
|
| 222 |
$order3 = GetOrder( $ordernumber3 ); |
234 |
$order3 = GetOrder( $ordernumber3 ); |
| 223 |
is($order3->{'quantityreceived'}, 2, 'Order not split up'); |
235 |
is($order3->{'quantityreceived'}, 2, 'Order not split up'); |
| 224 |
is($order3->{'quantity'}, 2, '2 items on order'); |
236 |
is($order3->{'quantity'}, 2, '2 items on order'); |
| 225 |
is($order3->{'budget_id'}, $budgetid2, 'Budget has changed'); |
237 |
is($order3->{'budget_id'}, $budgetid2, 'Budget has changed'); |
|
|
238 |
is($order3->{notes}, "my third notes", 'ModReceiveOrder and GetOrder deal with notes'); |
| 226 |
|
239 |
|
| 227 |
$dbh->rollback; |
240 |
$dbh->rollback; |
| 228 |
- |
|
|