Lines 98-111
our ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
Link Here
|
98 |
} |
98 |
} |
99 |
); |
99 |
); |
100 |
|
100 |
|
|
|
101 |
my $invoicenumber = $input->param('invoice'); |
102 |
my $shipmentdate = $input->param('shipmentdate'); |
103 |
my $shipmentcost = $input->param('shipmentcost'); |
104 |
my $shipmentcost_budgetid = $input->param('shipmentcost_budgetid'); |
105 |
if($shipmentdate) { |
106 |
$shipmentdate = C4::Dates->new($shipmentdate)->output('iso'); |
107 |
} |
108 |
|
101 |
if($op and $op eq 'new') { |
109 |
if($op and $op eq 'new') { |
102 |
my $invoicenumber = $input->param('invoice'); |
110 |
my @invoices = GetInvoices( |
103 |
my $shipmentdate = $input->param('shipmentdate'); |
111 |
supplierid => $booksellerid, |
104 |
my $shipmentcost = $input->param('shipmentcost'); |
112 |
invoicenumber => $invoicenumber, |
105 |
my $shipmentcost_budgetid = $input->param('shipmentcost_budgetid'); |
113 |
); |
106 |
if($shipmentdate) { |
114 |
if ($#invoices > 0 && C4::Context->preference('AcqWarnOnDuplicateInvoice')) { |
107 |
$shipmentdate = C4::Dates->new($shipmentdate)->output('iso'); |
115 |
$template->{'VARS'}->{'duplicate_invoices'} = \@invoices; |
|
|
116 |
$template->{'VARS'}->{'invoicenumber'} = $invoicenumber; |
117 |
$template->{'VARS'}->{'shipmentdate'} = $shipmentdate; |
118 |
$template->{'VARS'}->{'shipmentcost'} = $shipmentcost; |
119 |
$template->{'VARS'}->{'shipmentcost_budgetid'} = $shipmentcost_budgetid; |
120 |
} else { |
121 |
$op = 'confirm'; |
108 |
} |
122 |
} |
|
|
123 |
} |
124 |
if ($op and $op eq 'confirm') { |
109 |
my $invoiceid = AddInvoice( |
125 |
my $invoiceid = AddInvoice( |
110 |
invoicenumber => $invoicenumber, |
126 |
invoicenumber => $invoicenumber, |
111 |
booksellerid => $booksellerid, |
127 |
booksellerid => $booksellerid, |
Lines 114-120
if($op and $op eq 'new') {
Link Here
|
114 |
shipmentcost_budgetid => $shipmentcost_budgetid, |
130 |
shipmentcost_budgetid => $shipmentcost_budgetid, |
115 |
); |
131 |
); |
116 |
if(defined $invoiceid) { |
132 |
if(defined $invoiceid) { |
117 |
# Successful 'Add' |
133 |
# Successful 'Add' |
118 |
print $input->redirect("/cgi-bin/koha/acqui/parcel.pl?invoiceid=$invoiceid"); |
134 |
print $input->redirect("/cgi-bin/koha/acqui/parcel.pl?invoiceid=$invoiceid"); |
119 |
exit 0; |
135 |
exit 0; |
120 |
} else { |
136 |
} else { |