|
Lines 37-42
use C4::Budgets;
Link Here
|
| 37 |
|
37 |
|
| 38 |
use Koha::Acquisition::Booksellers; |
38 |
use Koha::Acquisition::Booksellers; |
| 39 |
use Koha::Acquisition::Currencies; |
39 |
use Koha::Acquisition::Currencies; |
|
|
40 |
use Koha::Acquisition::Budgets; |
| 41 |
use Koha::Acquisition::Budget; |
| 40 |
use Koha::DateUtils; |
42 |
use Koha::DateUtils; |
| 41 |
use Koha::Misc::Files; |
43 |
use Koha::Misc::Files; |
| 42 |
|
44 |
|
|
Lines 146-163
foreach my $order (@$orders) {
Link Here
|
| 146 |
|
148 |
|
| 147 |
push @foot_loop, map {$_} values %foot; |
149 |
push @foot_loop, map {$_} values %foot; |
| 148 |
|
150 |
|
| 149 |
my $budgets = GetBudgets(); |
151 |
my $budgets = Koha::Acquisition::Budgets->search(); |
| 150 |
my @budgets_loop; |
152 |
my @budgets_loop; |
|
|
153 |
my @inactive_budgets_loop; |
| 151 |
my $shipmentcost_budgetid = $details->{shipmentcost_budgetid}; |
154 |
my $shipmentcost_budgetid = $details->{shipmentcost_budgetid}; |
| 152 |
foreach my $budget (@$budgets) { |
155 |
while ( my $budget = $budgets->next ) { |
| 153 |
next unless CanUserUseBudget( $loggedinuser, $budget, $flags ); |
156 |
next unless CanUserUseBudget( $loggedinuser, $budget->budget_id, $flags ); |
| 154 |
my %line = %{$budget}; |
157 |
my $line = $budget->unblessed; |
| 155 |
if ( $shipmentcost_budgetid |
158 |
if ( $shipmentcost_budgetid |
| 156 |
and $budget->{budget_id} == $shipmentcost_budgetid ) |
159 |
and $budget->budget_id == $shipmentcost_budgetid ) |
| 157 |
{ |
160 |
{ |
| 158 |
$line{selected} = 1; |
161 |
$line->{selected} = 1; |
| 159 |
} |
162 |
} |
| 160 |
push @budgets_loop, \%line; |
163 |
if ( $budget->active ) { |
|
|
164 |
push @budgets_loop, \%$line; |
| 165 |
} |
| 166 |
else { |
| 167 |
push @inactive_budgets_loop, \%$line; |
| 168 |
} |
| 169 |
|
| 161 |
} |
170 |
} |
| 162 |
|
171 |
|
| 163 |
$template->param( |
172 |
$template->param( |
|
Lines 180-185
$template->param(
Link Here
|
| 180 |
invoiceincgst => $bookseller->invoiceincgst, |
189 |
invoiceincgst => $bookseller->invoiceincgst, |
| 181 |
currency => Koha::Acquisition::Currencies->get_active, |
190 |
currency => Koha::Acquisition::Currencies->get_active, |
| 182 |
budgets_loop => \@budgets_loop, |
191 |
budgets_loop => \@budgets_loop, |
|
|
192 |
inactive_budgets_loop => \@inactive_budgets_loop, |
| 183 |
); |
193 |
); |
| 184 |
|
194 |
|
| 185 |
defined( $invoice_files ) && $template->param( files => $invoice_files->GetFilesInfo() ); |
195 |
defined( $invoice_files ) && $template->param( files => $invoice_files->GetFilesInfo() ); |