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

(-)a/acqui/addorder.pl (+38 lines)
Lines 128-133 use C4::Budgets qw( GetBudget GetBudgetSpent GetBudgetOrdered FieldsForCalcu Link Here
128
use C4::Items       qw( AddItemFromMarc );
128
use C4::Items       qw( AddItemFromMarc );
129
use C4::Log         qw( logaction );
129
use C4::Log         qw( logaction );
130
use C4::Output      qw( output_html_with_http_headers );
130
use C4::Output      qw( output_html_with_http_headers );
131
use C4::Search      qw( FindDuplicate );
131
use C4::Suggestions qw( ModSuggestion );
132
use C4::Suggestions qw( ModSuggestion );
132
use Koha::Acquisition::Baskets;
133
use Koha::Acquisition::Baskets;
133
use Koha::Acquisition::Currencies qw( get_active );
134
use Koha::Acquisition::Currencies qw( get_active );
Lines 147-152 my $op = $input->param('op') // q{}; Link Here
147
if ( $op eq 'cud-order' ) {
148
if ( $op eq 'cud-order' ) {
148
    my $use_ACQ_framework = $input->param('use_ACQ_framework');
149
    my $use_ACQ_framework = $input->param('use_ACQ_framework');
149
150
151
    my $confirm_not_duplicate = $input->param('confirm_not_duplicate') || 0;
152
150
    # Check if order total amount exceed allowed budget
153
    # Check if order total amount exceed allowed budget
151
    my $confirm_budget_exceeding = $input->param('confirm_budget_exceeding');
154
    my $confirm_budget_exceeding = $input->param('confirm_budget_exceeding');
152
    unless ($confirm_budget_exceeding) {
155
    unless ($confirm_budget_exceeding) {
Lines 328-333 if ( $op eq 'cud-order' ) { Link Here
328
            }
331
            }
329
            C4::Acquisition::FillWithDefaultValues($record);
332
            C4::Acquisition::FillWithDefaultValues($record);
330
333
334
            if ( !$confirm_not_duplicate ) {
335
                my ( $dupe_biblionumber, $dupe_title ) = FindDuplicate($record);
336
337
                if ($dupe_biblionumber) {
338
                    my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
339
                        {
340
                            template_name => "acqui/neworderempty_duplicate.tt",
341
                            query         => $input,
342
                            type          => "intranet",
343
                            flagsrequired => { acquisition => 'order_manage' },
344
                        }
345
                    );
346
347
                    my $vars = $input->Vars;
348
                    my @vars_loop;
349
                    foreach ( keys %$vars ) {
350
                        push @vars_loop, { name => $_, values => [ $input->multi_param($_) ] };
351
                    }
352
353
                    my $booksellerid = $input->param('booksellerid') // '';
354
                    my $basketno     = $input->param('basketno')     // '';
355
356
                    $template->param(
357
                        biblionumber   => $dupe_biblionumber,
358
                        duplicatetitle => $dupe_title,
359
                        booksellerid   => $booksellerid,
360
                        basketno       => $basketno,
361
                        vars_loop      => \@vars_loop,
362
                    );
363
364
                    output_html_with_http_headers $input, $cookie, $template->output;
365
                    exit;
366
                }
367
            }
368
331
            # create the record in catalogue, with framework ''
369
            # create the record in catalogue, with framework ''
332
            my ( $biblionumber, $bibitemnum ) = AddBiblio( $record, '' );
370
            my ( $biblionumber, $bibitemnum ) = AddBiblio( $record, '' );
333
371
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty_duplicate.tt (-15 / +34 lines)
Lines 33-42 Link Here
33
[% WRAPPER 'main-container.inc' aside='acquisitions-menu' %]
33
[% WRAPPER 'main-container.inc' aside='acquisitions-menu' %]
34
    <div class="alert alert-warning">
34
    <div class="alert alert-warning">
35
        <h1>Duplicate warning</h1>
35
        <h1>Duplicate warning</h1>
36
        <p
36
        [% IF breedingid %]
37
            >You selected a record from an external source that matches an existing record in your catalog:
37
            <p>You selected a record from an external source that matches an existing record in your catalog:</p>
38
            <a target="_blank" title="Open in new window" href="[% PROCESS biblio_a_href biblionumber => biblionumber %]"><i class="fa-solid fa-window-restore"></i> [% duplicatetitle | html %]</a></p
38
        [% ELSE %]
39
        >
39
            <p>The details you entered match an existing record in your catalog:</p>
40
        [% END %]
41
        <a target="_blank" title="Open in new window" href="[% PROCESS biblio_a_href biblionumber => biblionumber %]"><i class="fa-solid fa-window-restore"></i> [% duplicatetitle | html %]</a>
40
    </div>
42
    </div>
41
43
42
    <div class="row">
44
    <div class="row">
Lines 66-81 Link Here
66
68
67
        <div class="col-sm-4">
69
        <div class="col-sm-4">
68
            <div style="border: 1px solid #DDD; padding:1em;">
70
            <div style="border: 1px solid #DDD; padding:1em;">
69
                <form method="post" action="/cgi-bin/koha/acqui/neworderempty.pl">
71
                [% IF breedingid %]
70
                    [% INCLUDE 'csrf-token.inc' %]
72
                    <form method="post" action="/cgi-bin/koha/acqui/neworderempty.pl">
71
                    <h4>Create new record</h4>
73
                        [% INCLUDE 'csrf-token.inc' %]
72
                    <p>Create a new record by importing the external (duplicate) record.</p>
74
                        <h4>Create new record</h4>
73
                    <input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
75
                        <p>Create a new record by importing the external (duplicate) record.</p>
74
                    <input type="hidden" name="basketno" value="[% basketno | html %]" />
76
                        <input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
75
                    <input type="hidden" name="breedingid" value="[% breedingid | html %]" />
77
                        <input type="hidden" name="basketno" value="[% basketno | html %]" />
76
                    <input type="hidden" name="op" value="cud-use_external_source" />
78
                        <input type="hidden" name="breedingid" value="[% breedingid | html %]" />
77
                    <input type="submit" class="btn btn-primary" value="Create new" />
79
                        <input type="hidden" name="op" value="cud-use_external_source" />
78
                </form>
80
                        <input type="submit" class="btn btn-primary" value="Create new" />
81
                    </form>
82
                [% ELSE %]
83
                    <form method="post" action="/cgi-bin/koha/acqui/addorder.pl">
84
                        [% INCLUDE 'csrf-token.inc' %]
85
                        <h4>Create new record</h4>
86
                        <p>Create a new record with the details you entered.</p>
87
                        <input type="hidden" name="op" value="cud-order" />
88
                        <input type="hidden" name="confirm_not_duplicate" value="1" />
89
                        [% FOREACH var IN vars_loop %]
90
                            [% FOREACH val IN var.values %]
91
                                [% IF var.name != 'confirm_not_duplicate' %]
92
                                    <input type="hidden" name="[% var.name | html %]" value="[% val | html %]" />
93
                                [% END %]
94
                            [% END %]
95
                        [% END %]
96
                        <button type="submit" class="btn btn-primary">Create new</button>
97
                    </form>
98
                [% END %]
79
            </div>
99
            </div>
80
        </div>
100
        </div>
81
    </div>
101
    </div>
82
- 

Return to bug 7132