Bug 10618 - Acq claim email not formatting correctly and missing information
Summary: Acq claim email not formatting correctly and missing information
Status: RESOLVED DUPLICATE of bug 12505
Alias: None
Product: Koha
Classification: Unclassified
Component: Notices (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Bugs List
QA Contact: Testopia
Depends on:
Reported: 2013-07-20 18:12 UTC by Katrin Fischer
Modified: 2014-07-25 14:04 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2013-07-20 18:12:41 UTC
The sample notice for Acquisition claims looks like this:

<order>Ordernumber <<aqorders.ordernumber>> (<<biblio.title>>) (<<aqorders.quantity>> ordered) ($<<aqorders.listprice>> each) has not been received.</order>

But this will give you the following output in an email:
<order>Ordernumber 928 (Learning Perl  (1 ordered) ($EUR each) has not been received.</order>
<order>Ordernumber 1690 (FIZ Technik) (1 ordered) ($EUR each) has not been received.</order> 

The listprice is missing and the <order> tags are printed into the email. lisprice was empty in the database for ordernumber 928, but 10.00 for 1690.

Note: The notice still works when you remove the <order></order> from the template. 

Tested with text emails, not HTML.
Comment 1 Katrin Fischer 2013-09-22 10:17:37 UTC
This is still a problem on current master.
Comment 2 Holger Meißner 2014-07-01 15:02:54 UTC
I took a look at this and found out where it goes wrong. But I have no idea how to fix it. The problem is in C4::Letters.

In sub SendAlerts there's this bit of SQL:

            SELECT aqorders.*,aqbasket.*,biblio.*,biblioitems.*,aqbooksellers.*,
            aqbooksellers.id AS booksellerid
            FROM aqorders
            LEFT JOIN aqbasket ON aqbasket.basketno=aqorders.basketno
            LEFT JOIN biblio ON aqorders.biblionumber=biblio.biblionumber
            LEFT JOIN biblioitems ON aqorders.biblionumber=biblioitems.biblionumber
            LEFT JOIN aqbooksellers ON aqbasket.booksellerid=aqbooksellers.id
            WHERE aqorders.ordernumber IN (

The result of this query is stored in hash refs.

my $dataorders = $sthorders->fetchall_arrayref( {} );

But among the resulting columns there are aqorders.listprice and aqbooksellers.listprice. And the hash keys only consist of field names, without the table names, so one of them gets lost.

So in Katrins example, it's really aqbooksellers.listprice that is displayed instead of aqorders.listprice, which is dropped.
Comment 3 simith.doliveira 2014-07-02 12:58:17 UTC

*** This bug has been marked as a duplicate of bug 12505 ***