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

(-)a/admin/aqcontract.pl (-6 / +9 lines)
Lines 27-33 use C4::Auth qw( get_template_and_user ); Link Here
27
use C4::Output   qw( output_html_with_http_headers );
27
use C4::Output   qw( output_html_with_http_headers );
28
use C4::Contract qw(
28
use C4::Contract qw(
29
    DelContract
29
    DelContract
30
    ModContract
31
);
30
);
32
use Koha::DateUtils qw( dt_from_string );
31
use Koha::DateUtils qw( dt_from_string );
33
32
Lines 103-118 elsif ( $op eq 'cud-add_validate' ) { Link Here
103
    }
102
    }
104
103
105
    if ($is_a_modif) {
104
    if ($is_a_modif) {
106
        ModContract(
105
        my $contractnumber = $input->param('contractnumber');
106
        my $contract       = Koha::Acquisition::Contracts->find($contractnumber);
107
        if ( !$contract ) {
108
            $template->param( blocking_error => "Contract $contractnumber not found" );
109
            output_html_with_http_headers $input, $cookie, $template->output;
110
        }
111
112
        $contract->set(
107
            {
113
            {
108
                contractstartdate   => $contractstart_dt,
114
                contractstartdate   => $contractstart_dt,
109
                contractenddate     => $contractend_dt,
115
                contractenddate     => $contractend_dt,
110
                contractname        => scalar $input->param('contractname'),
116
                contractname        => scalar $input->param('contractname'),
111
                contractdescription => scalar $input->param('contractdescription'),
117
                contractdescription => scalar $input->param('contractdescription'),
112
                booksellerid        => scalar $input->param('booksellerid'),
118
                booksellerid        => scalar $input->param('booksellerid'),
113
                contractnumber      => scalar $input->param('contractnumber'),
114
            }
119
            }
115
        );
120
        )->store;
116
    } else {
121
    } else {
117
        my $contract = Koha::Acquisition::Contract->new(
122
        my $contract = Koha::Acquisition::Contract->new(
118
            {
123
            {
Lines 124-130 elsif ( $op eq 'cud-add_validate' ) { Link Here
124
            }
129
            }
125
        )->store;
130
        )->store;
126
    }
131
    }
127
128
    print $input->redirect("/cgi-bin/koha/acquisition/vendors/$booksellerid");
132
    print $input->redirect("/cgi-bin/koha/acquisition/vendors/$booksellerid");
129
    exit;
133
    exit;
130
134
131
- 

Return to bug 39711