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