Lines 44-55
my $budgetid = C4::Budgets::AddBudget(
Link Here
|
44 |
my $budget = C4::Budgets::GetBudget( $budgetid ); |
44 |
my $budget = C4::Budgets::GetBudget( $budgetid ); |
45 |
|
45 |
|
46 |
my $bibrec1 = MARC::Record->new(); |
46 |
my $bibrec1 = MARC::Record->new(); |
47 |
$bibrec1->append_fields( |
47 |
if (C4::Context->preference('marcflavour') eq 'UNIMARC') { |
48 |
MARC::Field->new('020', '', '', 'a' => '1234567890'), |
48 |
$bibrec1->append_fields( |
49 |
MARC::Field->new('100', '', '', 'a' => 'Shakespeare, Billy'), |
49 |
MARC::Field->new('010', '', '', 'a' => '1234567890'), |
50 |
MARC::Field->new('245', '', '', 'a' => 'Bug 8854'), |
50 |
MARC::Field->new('200', '', '', 'f' => 'Shakespeare, Billy'), |
51 |
MARC::Field->new('260', '', '', 'b' => 'Scholastic Publishing', c => 'c2012'), |
51 |
MARC::Field->new('200', '', '', 'a' => 'Bug 8854'), |
52 |
); |
52 |
MARC::Field->new('210', '', '', 'c' => 'Scholastic Publishing', d => '2012'), |
|
|
53 |
); |
54 |
} else { |
55 |
$bibrec1->append_fields( |
56 |
MARC::Field->new('020', '', '', 'a' => '1234567890'), |
57 |
MARC::Field->new('100', '', '', 'a' => 'Shakespeare, Billy'), |
58 |
MARC::Field->new('245', '', '', 'a' => 'Bug 8854'), |
59 |
MARC::Field->new('260', '', '', 'b' => 'Scholastic Publishing', c => '2012'), |
60 |
); |
61 |
} |
62 |
|
53 |
my ($biblionumber1, $biblioitemnumber1) = AddBiblio($bibrec1, ''); |
63 |
my ($biblionumber1, $biblioitemnumber1) = AddBiblio($bibrec1, ''); |
54 |
my ($biblionumber2, $biblioitemnumber2) = AddBiblio(MARC::Record->new, ''); |
64 |
my ($biblionumber2, $biblioitemnumber2) = AddBiblio(MARC::Record->new, ''); |
55 |
my ($biblionumber3, $biblioitemnumber3) = AddBiblio(MARC::Record->new, ''); |
65 |
my ($biblionumber3, $biblioitemnumber3) = AddBiblio(MARC::Record->new, ''); |
Lines 61-68
my $order1 = Koha::Acquisition::Order->new(
Link Here
|
61 |
biblionumber => $biblionumber1, |
71 |
biblionumber => $biblionumber1, |
62 |
budget_id => $budget->{budget_id}, |
72 |
budget_id => $budget->{budget_id}, |
63 |
} |
73 |
} |
64 |
)->insert; |
74 |
)->store; |
65 |
my $ordernumber1 = $order1->{ordernumber}; |
|
|
66 |
|
75 |
|
67 |
my $order2 = Koha::Acquisition::Order->new( |
76 |
my $order2 = Koha::Acquisition::Order->new( |
68 |
{ |
77 |
{ |
Lines 71-78
my $order2 = Koha::Acquisition::Order->new(
Link Here
|
71 |
biblionumber => $biblionumber2, |
80 |
biblionumber => $biblionumber2, |
72 |
budget_id => $budget->{budget_id}, |
81 |
budget_id => $budget->{budget_id}, |
73 |
} |
82 |
} |
74 |
)->insert; |
83 |
)->store; |
75 |
my $ordernumber2 = $order2->{ordernumber}; |
|
|
76 |
|
84 |
|
77 |
my $order3 = Koha::Acquisition::Order->new( |
85 |
my $order3 = Koha::Acquisition::Order->new( |
78 |
{ |
86 |
{ |
Lines 83-90
my $order3 = Koha::Acquisition::Order->new(
Link Here
|
83 |
ecost => 42, |
91 |
ecost => 42, |
84 |
rrp => 42, |
92 |
rrp => 42, |
85 |
} |
93 |
} |
86 |
)->insert; |
94 |
)->store; |
87 |
my $ordernumber3 = $order3->{ordernumber}; |
|
|
88 |
|
95 |
|
89 |
my $invoiceid1 = AddInvoice(invoicenumber => 'invoice1', booksellerid => $booksellerid, unknown => "unknown"); |
96 |
my $invoiceid1 = AddInvoice(invoicenumber => 'invoice1', booksellerid => $booksellerid, unknown => "unknown"); |
90 |
my $invoiceid2 = AddInvoice(invoicenumber => 'invoice2', booksellerid => $booksellerid, unknown => "unknown", |
97 |
my $invoiceid2 = AddInvoice(invoicenumber => 'invoice2', booksellerid => $booksellerid, unknown => "unknown", |
Lines 97-103
my $invoice2 = GetInvoice( $invoiceid2 );
Link Here
|
97 |
my ( $datereceived, $new_ordernumber ) = ModReceiveOrder( |
104 |
my ( $datereceived, $new_ordernumber ) = ModReceiveOrder( |
98 |
{ |
105 |
{ |
99 |
biblionumber => $biblionumber1, |
106 |
biblionumber => $biblionumber1, |
100 |
order => $order1, |
107 |
order => $order1->unblessed, |
101 |
quantityreceived => 2, |
108 |
quantityreceived => 2, |
102 |
invoice => $invoice1, |
109 |
invoice => $invoice1, |
103 |
} |
110 |
} |
Lines 106-112
my ( $datereceived, $new_ordernumber ) = ModReceiveOrder(
Link Here
|
106 |
( $datereceived, $new_ordernumber ) = ModReceiveOrder( |
113 |
( $datereceived, $new_ordernumber ) = ModReceiveOrder( |
107 |
{ |
114 |
{ |
108 |
biblionumber => $biblionumber2, |
115 |
biblionumber => $biblionumber2, |
109 |
order => $order2, |
116 |
order => $order2->unblessed, |
110 |
quantityreceived => 1, |
117 |
quantityreceived => 1, |
111 |
invoice => $invoice2, |
118 |
invoice => $invoice2, |
112 |
rrp => 42 |
119 |
rrp => 42 |
Lines 116-122
my ( $datereceived, $new_ordernumber ) = ModReceiveOrder(
Link Here
|
116 |
( $datereceived, $new_ordernumber ) = ModReceiveOrder( |
123 |
( $datereceived, $new_ordernumber ) = ModReceiveOrder( |
117 |
{ |
124 |
{ |
118 |
biblionumber => $biblionumber3, |
125 |
biblionumber => $biblionumber3, |
119 |
order => $order3, |
126 |
order => $order3->unblessed, |
120 |
quantityreceived => 1, |
127 |
quantityreceived => 1, |
121 |
invoice => $invoice2, |
128 |
invoice => $invoice2, |
122 |
} |
129 |
} |