Bug 34340

Summary: Point of sale email template is showing 0.00 in the tendered field
Product: Koha Reporter: Laura Escamilla <Laura.escamilla>
Component: Fines and feesAssignee: Laura Escamilla <Laura.escamilla>
Status: RESOLVED FIXED QA Contact: Katrin Fischer <katrin.fischer>
Severity: trivial    
Priority: P5 - low CC: david, fridolin.somers
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.11.00,23.05.04,22.11.10
Circulation function:
Bug Depends on: 34332    
Bug Blocks:    
Attachments: Bug 34340: Changed "Tendered" to the correct input id which is "Collected"
Bug 34340: Changed "Tendered" to the correct input id which is "Collected"
Bug 34340: Changed "Tendered" to the correct input id which is "Collected"
Bug 34340: Changed "Tendered" to the correct input id which is "Collected"

Description Laura Escamilla 2023-07-21 13:28:01 UTC

    
Comment 1 Laura Escamilla 2023-07-21 13:32:54 UTC
Created attachment 153790 [details] [review]
Bug 34340: Changed "Tendered" to the correct input id which is "Collected"

Must also apply bug 34332 - fixed a syntax error for the pos email template

To test: 
1. Configure your Koha to enable the point of sale system (i.e. enable syspref, set up a register, set up an item to sell). 
2. Complete a transaction in the POS system. 
3. Click on the “Email receipt” button next to the “Print receipt” option and enter an email address and confirm that the email is sent. 
4. Check the “Tendered” field. It is showing up as 0.00 and not reflecting the actual amount that was tendered. 
5. Apply patch
6. Repeat steps 2 & 3
7. The emailed receipt is now showing the correct tendered amount. 
8. Sign off!
Comment 2 David Nind 2023-08-10 00:43:15 UTC Comment hidden (obsolete)
Comment 3 David Nind 2023-08-10 00:48:04 UTC
Created attachment 154344 [details] [review]
Bug 34340: Changed "Tendered" to the correct input id which is "Collected"

Must also apply bug 34332 - fixed a syntax error for the pos email template

To test:
1. Configure your Koha to enable the point of sale system (i.e. enable syspref,
   set up a register, set up an item to sell).
2. Complete a transaction in the POS system.
3. Click on the “Email receipt” button next to the “Print receipt” option and
   enter an email address and confirm that the email is sent.
4. Check the “Tendered” field. It is showing up as 0.00 and not reflecting the
   actual amount that was tendered.
5. Apply patch
6. Repeat steps 2 & 3
7. The emailed receipt is now showing the correct tendered amount.
8. Sign off!

Signed-off-by: David Nind <david@davidnind.com>
Comment 4 David Nind 2023-08-10 00:49:33 UTC
Not sure what happened, but when I did the git bz attach -e 34340 HEAD, the text of the bug including the test plan was not included.

I amended the commit message and reattached.
Comment 5 David Nind 2023-08-10 01:00:38 UTC
Testing notes (using KTD):

1. Needed to set up KTD so that email could be sent.[1]

2. For the updated notice to appear, I needed to do a reset_all then setup POS again. I'm not sure how this will affect upgrades, or if there is a way for updated notices to be applied - does this require a database update as well?

3. In additional, while this does fix the problem, all the other fields in the email notice are empty.[2] This was the case before the patch was applied. Does this need a separate bug to fix this? I have also included the notice as it is for me after the patch in KTD.[3]

[1] To test sending emails using a Google account, edit /etc/koha/sites/kohadev/koha-conf.xml file and add this configuration near the end (where <user_name> = your Google email address; <password> = your APP password, not your Google account password):

 <smtp_server>
    <host>smtp.gmail.com</host>
    <port>587</port>
    <timeout>5</timeout>
    <ssl_mode>STARTTLS</ssl_mode>
    <user_name>GOOGLEACCOUNTUSER</user_name>
    <password>GOOGLEAPPPASSWORD</password>
    <debug>1</debug>
 </smtp_server>

[2] Email notice with Tendered amount fixed:

Transaction ID: 	
Operator ID: 	
Payment type:

Payment receipt

Description of charges   Amount
Total:      	         0.00
Tendered: 	         30.00
Change given:    	 0.00

[3] Current email notice (HTRML) for Point of sale receipt:

[% USE KohaDates %]
[% USE Branches %]
[% USE Price %]
[% PROCESS "accounts.inc" %]
<table>
    [% IF ( LibraryName ) %]
    <tr>
      <th colspan="2" class="centerednames">
        <h3>[% LibraryName | html %]</h3>
      </th>
    </tr>
    [% END %]
    [% IF credit.library %]
    <tr>
      <th colspan="2" class="centerednames">
        <h2>[% payment.library.branchname | html %]</h2>
      </th>
    </tr>
    [% END %]
    <tr>
      <th colspan="2" class="centerednames">
        <h3>[% payment.date | $KohaDates %]</h3>
      </th>
    </tr>
    <tr>
      <td>Transaction ID: </td>
      <td>[% payment.accountlines_id %]</td>
    </tr>
    <tr>
      <td>Operator ID: </td>
      <td>[% payment.manager_id %]</td>
    </tr>
    <tr>
      <td>Payment type: </td>
      <td>[% payment.payment_type %]</td>
    </tr>
    <tr>
      <th colspan="2" class="centerednames">
        <h2><u>Payment receipt</u></h2>
      </th>
    </tr>
    <tr>
      <th>Description of charges</th>
      <th>Amount</th>
    </tr>
    [% FOREACH offset IN payment.credit_offsets %]
    <tr>
        <td>[% PROCESS account_type_description account=debit %]</td>
        <td>[% debit.amount * -1 | $Price %]</td>
    </tr>
    [% END %]
  <tfoot>
    <tr class="highlight">
      <td>Total:</td>
      <td>[% payment.amount * -1 | $Price %]</td>
    </tr>
    <tr>
      <td>Tendered: </td>
      <td>[% collected | $Price %]</td>
    </tr>
    <tr>
      <td>Change given:</td>
      <td>[% change | $Price %]</td>
    </tr>
  </tfoot>
</table>
Comment 6 Katrin Fischer 2023-08-24 22:41:54 UTC
Created attachment 154765 [details] [review]
Bug 34340: Changed "Tendered" to the correct input id which is "Collected"

Must also apply bug 34332 - fixed a syntax error for the pos email template

To test:
1. Configure your Koha to enable the point of sale system (i.e. enable syspref,
   set up a register, set up an item to sell).
2. Complete a transaction in the POS system.
3. Click on the “Email receipt” button next to the “Print receipt” option and
   enter an email address and confirm that the email is sent.
4. Check the “Tendered” field. It is showing up as 0.00 and not reflecting the
   actual amount that was tendered.
5. Apply patch
6. Repeat steps 2 & 3
7. The emailed receipt is now showing the correct tendered amount.
8. Sign off!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 7 Tomás Cohen Arazi (tcohen) 2023-08-30 12:04:06 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 8 Fridolin Somers 2023-08-30 20:07:52 UTC
Pushed to 23.05.x for 23.05.04
Comment 9 Matt Blenkinsop 2023-08-31 10:37:12 UTC
Nice work everyone!

Pushed to oldstable for 22.11.x