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