From f371b749afd444579caca5a51e33ef557e9dce45 Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Mon, 20 Feb 2012 00:12:13 +0100 Subject: [PATCH] Bug 7235: Add order date and checks for permissions - Adds order date above vendor - Reordered fields to reflect history of the item - Order information (order date, vendor) is only shown, when an order exists - Accession date is only linked, when item was received in acquisition - Links to basket and invoice are only shown when user has the correct permission - order date: manage_order - accession date: receive_shipment for invoice - Changes all dates to use the KohaDates TT plugin - Corrects display of rental price, removing additional zeros To test: 1) Create a record with - 1 item created in cataloguing - 1 item ordered - 1 item ordered and received - 1 item checked out 2) Verify the correct information is shown for each 3) Verify links on the dates work correctly 4) Toggle permissions for the user Signed-off-by: Nicole C. Engard Followed the test plan and all tests pass. Signed-off-by: Marijana Glavica changed supplierid to booksellerid Signed-off-by: Paul Poulain --- catalogue/moredetail.pl | 7 +-- .../prog/en/modules/catalogue/moredetail.tt | 60 ++++++++++--------- 2 files changed, 34 insertions(+), 33 deletions(-) diff --git a/catalogue/moredetail.pl b/catalogue/moredetail.pl index d75e36fb1d..c9d202ced1 100755 --- a/catalogue/moredetail.pl +++ b/catalogue/moredetail.pl @@ -31,7 +31,6 @@ use C4::Bookseller qw(GetBookSellerFromId); use C4::Output; # contains gettemplate use C4::Auth; use C4::Serials; -use C4::Dates qw/format_date/; use C4::Circulation; # to use itemissues use C4::Members; # to use GetMember use C4::Search; # enabled_staff_search_views @@ -120,7 +119,7 @@ my $ccodes= GetKohaAuthorisedValues('items.ccode',$fw); my $itemtypes = GetItemTypes; $data->{'itemtypename'} = $itemtypes->{$data->{'itemtype'}}->{'description'}; - +$data->{'rentalcharge'} = sprintf( "%.2f", $data->{'rentalcharge'} ); foreach ( keys %{$data} ) { $template->param( "$_" => defined $data->{$_} ? $data->{$_} : '' ); } @@ -132,10 +131,8 @@ foreach my $item (@items){ $item->{'collection'} = $ccodes->{ $item->{ccode} } if ($ccodes); $item->{'itype'} = $itemtypes->{ $item->{'itype'} }->{'description'}; $item->{'replacementprice'} = sprintf( "%.2f", $item->{'replacementprice'} ); - $item->{$_} = format_date( $item->{$_} ) foreach qw/datelastborrowed dateaccessioned datelastseen lastreneweddate/; $item->{'copyvol'} = $item->{'copynumber'}; - # item has a host number if its biblio number does not match the current bib if ($item->{biblionumber} ne $biblionumber){ $item->{hostbiblionumber} = $item->{biblionumber}; @@ -148,6 +145,7 @@ foreach my $item (@items){ $item->{'ordernumber'} = $order->{'ordernumber'}; $item->{'basketno'} = $order->{'basketno'}; $item->{'booksellerinvoicenumber'} = $order->{'booksellerinvoicenumber'}; + $item->{'orderdate'} = $order->{'entrydate'}; if ($item->{'basketno'}){ my $basket = GetBasket($item->{'basketno'}); my $bookseller = GetBookSellerFromId($basket->{'booksellerid'}); @@ -169,7 +167,6 @@ foreach my $item (@items){ $item->{'homebranchname'} = GetBranchName($item->{'homebranch'}); $item->{'holdingbranchname'} = GetBranchName($item->{'holdingbranch'}); if ($item->{'datedue'}) { - $item->{'datedue'} = format_date($item->{'datedue'}); $item->{'issue'}= 1; } else { $item->{'issue'}= 0; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt index 579265fb6a..e7e25d1e8e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt @@ -4,7 +4,7 @@ - +[% USE KohaDates %] [% INCLUDE 'header.inc' %] [% INCLUDE 'cat-search.inc' %] @@ -69,7 +69,7 @@
  1. Current Location: [% ITEM_DAT.holdingbranchname %] 
  2. -
  3. Checkout Status: [% IF ( ITEM_DAT.issue ) %]Checked out to [% ITEM_DAT.cardnumber %][% IF ( ITEM_DAT.lastreneweddate ) %], Last renewed [% ITEM_DAT.lastreneweddate %][% END %], Due back on [% ITEM_DAT.datedue %][% ELSE %]Not Checked out [% END %]
  4. +
  5. Checkout Status: [% IF ( ITEM_DAT.issue ) %]Checked out to [% ITEM_DAT.cardnumber %][% IF ( ITEM_DAT.lastreneweddate ) %], Last renewed [% ITEM_DAT.lastreneweddate | $KohaDates %][% END %], Due back on [% ITEM_DAT.datedue | $KohaDates %][% ELSE %]Not Checked out [% END %]
  6. Current Renewals: [% ITEM_DAT.renewals %] 
  7. [% IF ( ITEM_DAT.itemlostloop ) %]
  8. Lost Status: @@ -153,51 +153,55 @@

    History

      -
    1. - [% IF ( CAN_user_editcatalogue_edit_catalogue ) %] - - Accession Date: - [% IF ( ITEM_DAT.basketno ) %] - [% ITEM_DAT.dateaccessioned %] + [% IF ITEM_DAT.basketno %] +
    2. Order date: + [% IF ( CAN_user_acquisition_order_manage ) %] + [% ITEM_DAT.orderdate | $KohaDates %] [% ELSE %] - [% ITEM_DAT.dateaccessioned %] + [% ITEM_DAT.orderdate | $KohaDates %] [% END %] - [% ELSE %] - [% ITEM_DAT.dateaccessioned %] - [% END %] +
    3. +
    4. Vendor: + [% ITEM_DAT.vendor %]
    5. - [% IF ITEM_DAT.vendor %] -
    6. Vendor - [% ITEM_DAT.vendor %] + [% END %] + + [% IF ITEM_DAT.dateaccessioned %] +
    7. Accession date: + [% IF ( CAN_user_acquisition_order_receive && ITEM_DAT.booksellerinvoicenumber ) %] + [% ITEM_DAT.dateaccessioned | $KohaDates %] + [% ELSE %] + [% ITEM_DAT.dateaccessioned | $KohaDates %] + [% END %]
    8. - [% IF ITEM_DAT.booksellerinvoicenumber %] -
    9. Invoice number - [% ITEM_DAT.booksellerinvoicenumber %] + [% END %] + [% IF ( ITEM_DAT.booksellerinvoicenumber ) %] +
    10. Invoice number: + [% ITEM_DAT.booksellerinvoicenumber %]
    11. - [% END %] - [% END %] - + [% END %] +
    12. Total Checkouts:[% IF ( ITEM_DAT.issues ) %][% ITEM_DAT.issues %][% ELSE %]0[% END %] (View item's checkout history)
    13. -
    14. Last seen: [% ITEM_DAT.datelastseen %] 
    15. -
    16. Last borrowed: [% ITEM_DAT.datelastborrowed %] 
    17. +
    18. Last seen: [% ITEM_DAT.datelastseen | $KohaDates %] 
    19. +
    20. Last borrowed: [% ITEM_DAT.datelastborrowed | $KohaDates %] 
    21. [% IF ( ITEM_DAT.card0 ) %]
    22. Last Borrower: [% ITEM_DAT.card0 %] 
    23. [% END %] [% IF ( ITEM_DAT.card1 ) %]
    24. Previous Borrower: [% ITEM_DAT.card1 %] 
    25. [% END %] - [% IF ( ITEM_DAT.card2 ) %]
    26. Previous Borrower: [% ITEM_DAT.card2 %] 
    27. [% END %] + [% IF ( ITEM_DAT.card2 ) %]
    28. Previous Borrower: [% ITEM_DAT.card2 %] 
    29. [% END %]
    30. Paid for?: [% ITEM_DAT.paidfor %] 
    31. Serial enumeration: [% ITEM_DAT.enumchron %] 
    32. Public Note: [% IF ( CAN_user_editcatalogue_edit_items ) %] -
      + -
      -
    33. -
    + [% ELSE %] [% ITEM_DAT.itemnotes %]   [% END %] +
  9. +
[% END %] -- 2.39.5