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

(-)a/C4/Acquisition.pm (+3 lines)
Lines 1266-1271 sub NewOrder { Link Here
1266
    my $dbh = C4::Context->dbh;
1266
    my $dbh = C4::Context->dbh;
1267
    my @params;
1267
    my @params;
1268
1268
1269
    croak "The ordernumber parameter should not be provided on calling NewOrder"
1270
      if $orderinfo->{ordernumber};
1269
1271
1270
    # if these parameters are missing, we can't continue
1272
    # if these parameters are missing, we can't continue
1271
    for my $key (qw/basketno quantity biblionumber budget_id/) {
1273
    for my $key (qw/basketno quantity biblionumber budget_id/) {
Lines 1281-1286 sub NewOrder { Link Here
1281
    my $schema = Koha::Database->new()->schema;
1283
    my $schema = Koha::Database->new()->schema;
1282
    my $columns = ' '.join(' ', $schema->source('Aqorder')->columns).' ';
1284
    my $columns = ' '.join(' ', $schema->source('Aqorder')->columns).' ';
1283
    my $new_order = { map { $columns =~ / $_ / ? ($_ => $orderinfo->{$_}) : () } keys(%$orderinfo) };
1285
    my $new_order = { map { $columns =~ / $_ / ? ($_ => $orderinfo->{$_}) : () } keys(%$orderinfo) };
1286
    $new_order->{ordernumber} ||= undef;
1284
1287
1285
    my $rs = $schema->resultset('Aqorder');
1288
    my $rs = $schema->resultset('Aqorder');
1286
    my $ordernumber = $rs->create($new_order)->id;
1289
    my $ordernumber = $rs->create($new_order)->id;
(-)a/t/db_dependent/Acquisition.t (-2 / +2 lines)
Lines 195-201 my @order_content = ( Link Here
195
            budget_id      => $budget->{budget_id},
195
            budget_id      => $budget->{budget_id},
196
            uncertainprice => 0,
196
            uncertainprice => 0,
197
            order_internalnote => "internal note",
197
            order_internalnote => "internal note",
198
            order_vendornote   => "vendor note"
198
            order_vendornote   => "vendor note",
199
            ordernumber => '',
199
        },
200
        },
200
        num => {
201
        num => {
201
            quantity  => 24,
202
            quantity  => 24,
202
- 

Return to bug 12891