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

(-)a/C4/Acquisition.pm (-1 / +1 lines)
Lines 568-574 sub ModBasketgroup { Link Here
568
    my $dbh = C4::Context->dbh;
568
    my $dbh = C4::Context->dbh;
569
    my $query = "UPDATE aqbasketgroups SET ";
569
    my $query = "UPDATE aqbasketgroups SET ";
570
    my @params;
570
    my @params;
571
    foreach my $field (qw(name billingplace deliveryplace deliverycomment closed)) {
571
    foreach my $field (qw(name billingplace deliveryplace freedeliveryplace deliverycomment closed)) {
572
        if ( defined $basketgroupinfo->{$field} ) {
572
        if ( defined $basketgroupinfo->{$field} ) {
573
            $query .= "$field=?, ";
573
            $query .= "$field=?, ";
574
            push(@params, $basketgroupinfo->{$field});
574
            push(@params, $basketgroupinfo->{$field});
(-)a/acqui/basketgroup.pl (-22 / +28 lines)
Lines 273-278 if ( $op eq "add" ) { Link Here
273
        my $basketgroupid = $input->param('basketgroupid');
273
        my $basketgroupid = $input->param('basketgroupid');
274
        my $billingplace;
274
        my $billingplace;
275
        my $deliveryplace;
275
        my $deliveryplace;
276
        my $freedeliveryplace;
276
        if ( $basketgroupid ) {
277
        if ( $basketgroupid ) {
277
            # Get the selected baskets in the basketgroup to display them
278
            # Get the selected baskets in the basketgroup to display them
278
            my $selecteds = GetBasketsByBasketgroup($basketgroupid);
279
            my $selecteds = GetBasketsByBasketgroup($basketgroupid);
Lines 287-295 if ( $op eq "add" ) { Link Here
287
            $template->param(
288
            $template->param(
288
                name            => $basketgroup->{name},
289
                name            => $basketgroup->{name},
289
                deliverycomment => $basketgroup->{deliverycomment},
290
                deliverycomment => $basketgroup->{deliverycomment},
291
                freedeliveryplace => $basketgroup->{freedeliveryplace},
290
            );
292
            );
291
            $billingplace  = $basketgroup->{billingplace};
293
            $billingplace  = $basketgroup->{billingplace};
292
            $deliveryplace = $basketgroup->{deliveryplace};
294
            $deliveryplace = $basketgroup->{deliveryplace};
295
            $freedeliveryplace = $basketgroup->{freedeliveryplace};
293
        }
296
        }
294
297
295
        # determine default billing and delivery places depending on librarian homebranch and existing basketgroup data
298
        # determine default billing and delivery places depending on librarian homebranch and existing basketgroup data
Lines 405-429 if ( $op eq "add" ) { Link Here
405
} elsif ( $op eq 'attachbasket') {
408
} elsif ( $op eq 'attachbasket') {
406
    
409
    
407
    # Getting parameters
410
    # Getting parameters
408
    my $basketgroup = {};
411
    my $basketgroup       = {};
409
    my @baskets         = $input->param('basket');
412
    my @baskets           = $input->param('basket');
410
    my $basketgroupid   = $input->param('basketgroupid');
413
    my $basketgroupid     = $input->param('basketgroupid');
411
    my $basketgroupname = $input->param('basketgroupname');
414
    my $basketgroupname   = $input->param('basketgroupname');
412
    my $booksellerid    = $input->param('booksellerid');
415
    my $booksellerid      = $input->param('booksellerid');
413
    my $billingplace    = $input->param('billingplace');
416
    my $billingplace      = $input->param('billingplace');
414
    my $deliveryplace   = $input->param('deliveryplace');
417
    my $deliveryplace     = $input->param('deliveryplace');
415
    my $deliverycomment = $input->param('deliverycomment');
418
    my $freedeliveryplace = $input->param('freedeliveryplace');
416
    my $close           = $input->param('close') ? 1 : 0;
419
    my $deliverycomment   = $input->param('deliverycomment');
420
    my $close             = $input->param('close') ? 1 : 0;
417
    # If we got a basketgroupname, we create a basketgroup
421
    # If we got a basketgroupname, we create a basketgroup
418
    if ($basketgroupid) {
422
    if ($basketgroupid) {
419
        $basketgroup = {
423
        $basketgroup = {
420
              name            => $basketgroupname,
424
              name              => $basketgroupname,
421
              id              => $basketgroupid,
425
              id                => $basketgroupid,
422
              basketlist      => \@baskets,
426
              basketlist        => \@baskets,
423
              billingplace    => $billingplace,
427
              billingplace      => $billingplace,
424
              deliveryplace   => $deliveryplace,
428
              deliveryplace     => $deliveryplace,
425
              deliverycomment => $deliverycomment,
429
              freedeliveryplace => $freedeliveryplace,
426
              closed          => $close,
430
              deliverycomment   => $deliverycomment,
431
              closed            => $close,
427
        };
432
        };
428
        ModBasketgroup($basketgroup);
433
        ModBasketgroup($basketgroup);
429
        if($close){
434
        if($close){
Lines 431-442 if ( $op eq "add" ) { Link Here
431
        }
436
        }
432
    }else{
437
    }else{
433
        $basketgroup = {
438
        $basketgroup = {
434
            name            => $basketgroupname,
439
            name              => $basketgroupname,
435
            booksellerid    => $booksellerid,
440
            booksellerid      => $booksellerid,
436
            basketlist      => \@baskets,
441
            basketlist        => \@baskets,
437
            deliveryplace   => $deliveryplace,
442
            deliveryplace     => $deliveryplace,
438
            deliverycomment => $deliverycomment,
443
            freedeliveryplace => $freedeliveryplace,
439
            closed          => $close,
444
            deliverycomment   => $deliverycomment,
445
            closed            => $close,
440
        };
446
        };
441
        $basketgroupid = NewBasketgroup($basketgroup);
447
        $basketgroupid = NewBasketgroup($basketgroup);
442
    }
448
    }
(-)a/acqui/pdfformat/layout2pages.pm (-7 / +18 lines)
Lines 146-151 sub printhead { Link Here
146
    # get branch details
146
    # get branch details
147
    my $billingdetails  = GetBranchDetail( $basketgroup->{billingplace} );
147
    my $billingdetails  = GetBranchDetail( $basketgroup->{billingplace} );
148
    my $deliverydetails = GetBranchDetail( $basketgroup->{deliveryplace} );
148
    my $deliverydetails = GetBranchDetail( $basketgroup->{deliveryplace} );
149
    my $freedeliveryplace = $basketgroup->{freedeliveryplace};
149
    # get the subject
150
    # get the subject
150
    my $subject;
151
    my $subject;
151
152
Lines 211-223 sub printhead { Link Here
211
    # print delivery infos
212
    # print delivery infos
212
    $text->font( $pdf->corefont("Times-Bold", -encoding => "utf8"), 4/mm );
213
    $text->font( $pdf->corefont("Times-Bold", -encoding => "utf8"), 4/mm );
213
    $text->translate(50/mm, ($height-237)/mm);
214
    $text->translate(50/mm, ($height-237)/mm);
214
    $text->text($deliverydetails->{branchaddress1});
215
    if ($freedeliveryplace) {
215
    $text->translate(50/mm, ($height-242)/mm);
216
        my $start = 242;
216
    $text->text($deliverydetails->{branchaddress2});
217
        my @fdp = split('\n', $freedeliveryplace);
217
    $text->translate(50/mm, ($height-247)/mm);
218
        foreach (@fdp) {
218
    $text->text($deliverydetails->{branchaddress3});
219
            $text->text($_);
219
    $text->translate(50/mm, ($height-252)/mm);
220
            $text->translate( 50 / mm, ( $height - $start ) / mm );
220
    $text->text(join(' ', $deliverydetails->{branchzip}, $deliverydetails->{branchcity}, $deliverydetails->{branchcountry}));
221
            $start += 5;
222
        }
223
    } else {
224
        $text->text( $deliverydetails->{branchaddress1} );
225
        $text->translate( 50 / mm, ( $height - 242 ) / mm );
226
        $text->text( $deliverydetails->{branchaddress2} );
227
        $text->translate( 50 / mm, ( $height - 247 ) / mm );
228
        $text->text( $deliverydetails->{branchaddress3} );
229
        $text->translate( 50 / mm, ( $height - 252 ) / mm );
230
        $text->text( join( ' ', $deliverydetails->{branchzip}, $deliverydetails->{branchcity}, $deliverydetails->{branchcountry} ) );
231
    }
221
    $text->translate(50/mm, ($height-262)/mm);
232
    $text->translate(50/mm, ($height-262)/mm);
222
    $text->text($basketgroup->{deliverycomment});
233
    $text->text($basketgroup->{deliverycomment});
223
}
234
}
(-)a/acqui/pdfformat/layout3pages.pm (-7 / +18 lines)
Lines 283-288 sub printhead { Link Here
283
    # get branch details
283
    # get branch details
284
    my $billingdetails  = GetBranchDetail( $basketgroup->{billingplace} );
284
    my $billingdetails  = GetBranchDetail( $basketgroup->{billingplace} );
285
    my $deliverydetails = GetBranchDetail( $basketgroup->{deliveryplace} );
285
    my $deliverydetails = GetBranchDetail( $basketgroup->{deliveryplace} );
286
    my $freedeliveryplace = $basketgroup->{freedeliveryplace};
286
    # get the subject
287
    # get the subject
287
    my $subject;
288
    my $subject;
288
289
Lines 348-360 sub printhead { Link Here
348
    # print delivery infos
349
    # print delivery infos
349
    $text->font( $pdf->corefont("Times-Bold", -encoding => "utf8"), 4/mm );
350
    $text->font( $pdf->corefont("Times-Bold", -encoding => "utf8"), 4/mm );
350
    $text->translate(50/mm,  ($height-237)/mm);
351
    $text->translate(50/mm,  ($height-237)/mm);
351
    $text->text($deliverydetails->{branchaddress1});
352
    if ($freedeliveryplace) {
352
    $text->translate(50/mm,  ($height-242)/mm);
353
        my $start = 242;
353
    $text->text($deliverydetails->{branchaddress2});
354
        my @fdp = split('\n', $freedeliveryplace);
354
    $text->translate(50/mm,  ($height-247)/mm);
355
        foreach (@fdp) {
355
    $text->text($deliverydetails->{branchaddress3});
356
            $text->text($_);
356
    $text->translate(50/mm,  ($height-252)/mm);
357
            $text->translate( 50 / mm, ( $height - $start ) / mm );
357
    $text->text(join(' ', $deliverydetails->{branchzip}, $deliverydetails->{branchcity}, $deliverydetails->{branchcountry}));
358
            $start += 5;
359
        }
360
    } else {
361
        $text->text($deliverydetails->{branchaddress1});
362
        $text->translate(50/mm,  ($height-242)/mm);
363
        $text->text($deliverydetails->{branchaddress2});
364
        $text->translate(50/mm,  ($height-247)/mm);
365
        $text->text($deliverydetails->{branchaddress3});
366
        $text->translate(50/mm,  ($height-252)/mm);
367
        $text->text(join(' ', $deliverydetails->{branchzip}, $deliverydetails->{branchcity}, $deliverydetails->{branchcountry}));
368
    }
358
    $text->translate(50/mm,  ($height-262)/mm);
369
    $text->translate(50/mm,  ($height-262)/mm);
359
    $text->text($basketgroup->{deliverycomment});
370
    $text->text($basketgroup->{deliverycomment});
360
}
371
}
(-)a/installer/data/mysql/updatedatabase.pl (+7 lines)
Lines 4209-4214 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
4209
    SetVersion ($DBversion);
4209
    SetVersion ($DBversion);
4210
}
4210
}
4211
4211
4212
$DBversion = 'XXX';
4213
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
4214
    $dbh->do("ALTER TABLE `aqbasketgroups` ADD `freedeliveryplace` TEXT NULL AFTER `deliveryplace`;");
4215
    print "Upgrade to $DBversion done (adding freedeliveryplace to basketgroups)\n";
4216
    SetVersion($DBversion);
4217
}
4218
4212
=head1 FUNCTIONS
4219
=head1 FUNCTIONS
4213
4220
4214
=head2 DropAllForeignKeys($table)
4221
=head2 DropAllForeignKeys($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketgroup.tmpl (-1 / +3 lines)
Lines 232-237 function submitForm(form) { Link Here
232
							<option value="<!-- TMPL_VAR name="value" -->" <!-- TMPL_IF name="selected" -->selected<!-- /TMPL_IF -->><!-- TMPL_VAR name="branchname" --></option>
232
							<option value="<!-- TMPL_VAR name="value" -->" <!-- TMPL_IF name="selected" -->selected<!-- /TMPL_IF -->><!-- TMPL_VAR name="branchname" --></option>
233
							<!-- /TMPL_LOOP -->
233
							<!-- /TMPL_LOOP -->
234
						</select>
234
						</select>
235
                        <p>or</p>
236
                        <h3><label for="freedeliveryplace">Delivery Place:</label></h3>
237
                        <textarea cols="26" name="freedeliveryplace" id="freedeliveryplace"><!-- TMPL_VAR NAME="freedeliveryplace" --></textarea>
235
						<h3><label for="deliverycomment">Delivery comment:</label></h3>
238
						<h3><label for="deliverycomment">Delivery comment:</label></h3>
236
						<textarea cols="26" name="deliverycomment" id="deliverycomment"><!-- TMPL_VAR NAME="deliverycomment" --></textarea>
239
						<textarea cols="26" name="deliverycomment" id="deliverycomment"><!-- TMPL_VAR NAME="deliverycomment" --></textarea>
237
		         		<div class="workarea">
240
		         		<div class="workarea">
238
- 

Return to bug 5970