Bugzilla – Attachment 28363 Details for
Bug 3050
Add an option to upload scanned invoices
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Add an option to upload scanned invoices #2/3
0002-Bug-3050-Add-an-option-to-upload-scanned-invoices-2-.patch (text/plain), 4.86 KB, created by
Paola Rossi
on 2014-05-20 13:22:49 UTC
(
hide
)
Description:
Add an option to upload scanned invoices #2/3
Filename:
MIME Type:
Creator:
Paola Rossi
Created:
2014-05-20 13:22:49 UTC
Size:
4.86 KB
patch
obsolete
>From b530b8e8feeb8f9ba1ae7d1acc7aafd3f23dea64 Mon Sep 17 00:00:00 2001 >From: Jacek Ablewicz <abl@biblos.pk.edu.pl> >Date: Fri, 9 May 2014 11:45:29 +0200 >Subject: [PATCH 2/3] Bug 3050 - Add an option to upload scanned invoices #2/3 > >(part #2: changes to existing acqui scripts & templates) > >Signed-off-by: Paola Rossi <paola.rossi@cineca.it> >--- > acqui/invoice.pl | 11 ++++++ > .../intranet-tmpl/prog/en/modules/acqui/invoice.tt | 38 +++++++++++++++++++- > 2 files changed, 48 insertions(+), 1 deletion(-) > >diff --git a/acqui/invoice.pl b/acqui/invoice.pl >index 95065c9..c39a7d8 100755 >--- a/acqui/invoice.pl >+++ b/acqui/invoice.pl >@@ -35,6 +35,7 @@ use C4::Output; > use C4::Acquisition; > use C4::Bookseller qw/GetBookSellerFromId/; > use C4::Budgets; >+use Koha::Misc::Files; > > my $input = new CGI; > my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user( >@@ -51,6 +52,12 @@ my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user( > my $invoiceid = $input->param('invoiceid'); > my $op = $input->param('op'); > >+my $invoice_files; >+if ( C4::Context->preference('AcqEnableFiles') ) { >+ $invoice_files = Koha::Misc::Files->new( >+ tabletag => 'aqinvoices', recordid => $invoiceid ); >+} >+ > if ( $op && $op eq 'close' ) { > CloseInvoice($invoiceid); > my $referer = $input->param('referer'); >@@ -86,11 +93,13 @@ elsif ( $op && $op eq 'mod' ) { > } elsif ($input->param('merge')) { > my @sources = $input->param('merge'); > MergeInvoices($invoiceid, \@sources); >+ defined($invoice_files) && $invoice_files->MergeFileRecIds(@sources); > } > $template->param( modified => 1 ); > } > elsif ( $op && $op eq 'delete' ) { > DelInvoice($invoiceid); >+ defined($invoice_files) && $invoice_files->DelAllFiles(); > my $referer = $input->param('referer') || 'invoices.pl'; > if ($referer) { > print $input->redirect($referer); >@@ -166,6 +175,8 @@ $template->param( > budgets_loop => \@budgets_loop, > ); > >+defined( $invoice_files ) && $template->param( files => $invoice_files->GetFilesInfo() ); >+ > # FIXME > # Fonction dupplicated from basket.pl > # Code must to be exported. Where ?? >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt >index 35bc2da..911ff81 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt >@@ -1,3 +1,4 @@ >+[% USE Koha %] > [% USE KohaDates %] > > [% INCLUDE 'doc-head-open.inc' %] >@@ -27,7 +28,17 @@ > bFilter: false, > sDom: "t" > })); >- >+[% IF ( (Koha.Preference('AcqEnableFiles')) && files ) %] >+ $("#invoice_files_table").dataTable($.extend(true, {}, dataTablesDefaults, { >+ "aoColumnDefs": [ >+ { "aTargets": [ 3 ], "sType": "natural" } >+ ], >+ bInfo: false, >+ bPaginate: false, >+ bFilter: false, >+ sDom: "t" >+ })); >+[% END %] > $("#show_all_details").click(function(){ > updateColumnsVisibility($(this+":checked").val()); > }); >@@ -108,6 +119,7 @@ > </form> > <p> > <a href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid %]">Go to receipt page</a> >+ [% IF Koha.Preference('AcqEnableFiles') %]| <a href="/cgi-bin/koha/acqui/invoice-files.pl?invoiceid=[% invoiceid %]">Manage invoice files</a>[% END %] > </p> > <h2>Invoice details</h2> > [% IF orders_loop.size %] >@@ -199,6 +211,30 @@ > [% ELSE %] > <div class="dialog message"><p>No orders yet</p></div> > [% END %] >+ [% IF ( (Koha.Preference('AcqEnableFiles')) && files ) %] >+ <br /> >+ <h2>Files attached to invoice</h2> >+ <table id="invoice_files_table"> >+ <thead> >+ <tr> >+ <th>Name</th> >+ <th>Type</th> >+ <th>Description</th> >+ <th>Uploaded</th> >+ </tr> >+ </thead> >+ <tbody> >+ [% FOREACH f IN files %] >+ <tr> >+ <td><a href="/cgi-bin/koha/acqui/invoice-files.pl?invoiceid=[% invoiceid %]&op=download&view=1&file_id=[% f.file_id %]">[% f.file_name | html %]</a></td> >+ <td>[% f.file_type | html %]</td> >+ <td>[% f.file_description | html %]</td> >+ <td><!-- [% f.date_uploaded %] -->[% f.date_uploaded | $KohaDates %]</td> >+ </tr> >+ [% END %] >+ </tbody> >+ </table> >+ [% END %] > </div> > </div> > <div class="yui-b"> >-- >1.7.10.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 3050
:
25253
|
25306
|
26724
|
28123
|
28124
|
28125
|
28362
|
28363
|
28364
|
28391
|
28392
|
28393
|
28394