|
Lines 68-79
use C4::Log qw( cronlogaction );
Link Here
|
| 68 |
my $command_line_options = join( " ", @ARGV ); |
68 |
my $command_line_options = join( " ", @ARGV ); |
| 69 |
cronlogaction( { info => $command_line_options } ); |
69 |
cronlogaction( { info => $command_line_options } ); |
| 70 |
|
70 |
|
| 71 |
my ( $help, $verbose, $confirm, $delete ); |
71 |
my ( $help, $verbose, $confirm, $delete, @marc_order_account_ids ); |
| 72 |
GetOptions( |
72 |
GetOptions( |
| 73 |
'h|help' => \$help, |
73 |
'h|help' => \$help, |
| 74 |
'v|verbose' => \$verbose, |
74 |
'v|verbose' => \$verbose, |
| 75 |
'c|confirm' => \$confirm, |
75 |
'c|confirm' => \$confirm, |
| 76 |
'd|delete' => \$delete, |
76 |
'd|delete' => \$delete, |
|
|
77 |
'a|marc-order-account=i' => \@marc_order_account_ids, |
| 77 |
) || pod2usage(1); |
78 |
) || pod2usage(1); |
| 78 |
|
79 |
|
| 79 |
pod2usage(0) if $help; |
80 |
pod2usage(0) if $help; |
|
Lines 81-89
pod2usage(0) if $help;
Link Here
|
| 81 |
$verbose = 1 unless $verbose or $confirm; |
82 |
$verbose = 1 unless $verbose or $confirm; |
| 82 |
print "Test run only\n" unless $confirm; |
83 |
print "Test run only\n" unless $confirm; |
| 83 |
|
84 |
|
| 84 |
print "Fetching MARC ordering accounts\n" if $verbose; |
85 |
if ($verbose) { |
|
|
86 |
print "Fetching MARC ordering accounts"; |
| 87 |
print " " . join( ", ", @marc_order_account_ids ) if @marc_order_account_ids; |
| 88 |
print "\n"; |
| 89 |
} |
| 90 |
|
| 91 |
my $params = {}; |
| 92 |
$params = { id => { '-in' => \@marc_order_account_ids } } if @marc_order_account_ids; |
| 93 |
|
| 85 |
my @accounts = Koha::MarcOrderAccounts->search( |
94 |
my @accounts = Koha::MarcOrderAccounts->search( |
| 86 |
{}, |
95 |
$params, |
| 87 |
{ join => [ 'vendor', 'budget' ] } |
96 |
{ join => [ 'vendor', 'budget' ] } |
| 88 |
)->as_list; |
97 |
)->as_list; |
| 89 |
|
98 |
|
| 90 |
- |
|
|