Skip to content

Daily Sales overall Cash total changes when switching pages #3138

Closed

Description

@chunter2

Background information

IMPORTANT: If you choose to ignore this issue report template, your issue will be closed as we cannot help without the requested information.

Please make sure you tick (add an x between the square brackets with no spaces) the following check boxes:

  • [] Reporting an issue of an unmodified OSPOS installation
  • [] Checked open and closed issues and no similar issue was already reported (please make sure you searched!)
  • [] Read README, WHATS_NEW, INSTALL.md and UPGRADE
  • [] Read the FAQ for any known install and/or upgrade gotchas (in specific PHP extensions installed)
  • [] Read the wiki
  • [] Executed any database upgrade scripts if an upgrade pre 3.0.0 (e.g. database/2.4_to_3.0.sql)
  • [] Aware the installation code is in bintray (see README), and GitHub master is for developers only and therefore not complete nor stable

Installation information

  • OSPOS version is:
  • OSPOS git commit hash is:
  • PHP version is:
  • MySQL or MariaDB version is:
  • OS and version is:
  • WebServer is:
  • Selected language is:
  • (If applicable) Docker installation:
  • (If applicable) Installation package for the LAMP/LEMP stack is:

Issue / Bug / Question / New Feature

Looks like when I have more than 10 sales showing in the daily sales and I choose to switch to the next page the total for Cash changes but the others don't. These aren't the "Total" row values. They're the ones below that. I believe it should be the overall total, not the total for the page. I think the row named "Total" is for that. I tested this on dev.opensourcepos.org.

Thanks

Activity

  1. SteveIreland commented on Mar 21, 2021

    @SteveIreland
    Collaborator

    I never noticed that, but I can't say I ever looked at it closely. My test sets are rather small and rarely go to a second page. I believe the values should change only if the search criteria changes. I'll take a look at it this week.

  2. self-assigned this
    on Mar 21, 2021
  3. added this to the 3.3.4 milestone on Mar 21, 2021
  4. SteveIreland commented on Mar 21, 2021

    @SteveIreland
    Collaborator

    @chunter2 I just went through a couple of test scenarios but could not replicate the issue. Can you provide a bit more information about the types of sales and your configuration? Such as what type of taxing are you using? Internal tax or Sales tax? Do your sales involve tax rounding? (I tested with tax rounding an nothing seemed to change.) Do you have an idea of where the differences might be? (You understand your data better than me, so your guesses are most likely better educated.)

  5. chunter2 commented on Mar 22, 2021

    @chunter2
    ContributorAuthor

    @SteveIreland I just checked the dev server and it looks like it was updated or cleared so my tests are gone. I just recreated 11 sales there. If you go to the daily sales for today and choose 10 per page and then switch pages you'll see the cash total change per page but the other two don't. I didn't use tax or discounts for this test.

  6. SteveIreland commented on Mar 22, 2021

    @SteveIreland
    Collaborator

    Okay, thanks for the info. The difference in the cash reported between the first page and the second page was 40.08 which is the amount of the change due.
    According to the code, amount refunded from cash transactions should be deducted from the payment amounts before display the payment summary at the bottom of the page. So the first page is correct and for some reason the cash refund isn't being subtracted on the second page Now that I know what's happening I can debug it and hopefully figure out the resolution for it. I can't find anything in the code that looks like an opportunity for that bug.

  7. jekkos commented on Apr 5, 2021

    @jekkos
    Member

    So @SteveIreland were you able to reproduce the issue, or do you have any idea why it would happen that on the second page totals are off?

  8. SteveIreland commented on Apr 5, 2021

    @SteveIreland
    Collaborator

    I was able to reproduce the error but I have absolutely no idea what is triggering it.

  9. chunter2 commented on Apr 6, 2021

    @chunter2
    ContributorAuthor

    @SteveIreland If it's any help my "production" system is at version 3.3.2 and the bug is there as well. I'm pretty sure I noticed it before manually hand picking some commits along the way.

  10. jekkos commented on Apr 6, 2021

    @jekkos
    Member

    The reason why this amount changes is because the sale transactions have a different offset while the totals do not. So in this summary we substract the change due for cash transactions, but only for the resultset you are currently viewing. So that's the reason why you see the values changing when you switch pages.

    So conclusion is that this correction can't be done correctly in the current setup. We should query the amount - cash refund in SQL directly instead (cfr the fix @SteveIreland did recently)

  11. self-assigned this
    on Apr 6, 2021
  12. jekkos commented on Apr 6, 2021

    @jekkos
    Member

    Ok if someone can review / test this last patch, then we can close and release.

  13. jekkos commented on Apr 6, 2021

    @jekkos
    Member

    Screenshot from 2021-04-06 10-40-34

    In attachment an example of my local version with the fix applied. So in this case the sale was paid with 40$ of cash, and amount was 20$. We show that there is change due, and payments for cash in total are 20$ (so refunds subtracted).

  14. chunter2 commented on Apr 6, 2021

    @chunter2
    ContributorAuthor

    @jekkos Just tested out your changes on my system and it looks like it's fixed. Switching pages now keeps the values at the bottom fixed. I also checked the summary payments report for the daily sales day I tested and the numbers match.

    One more request if it's not too much. Would it be an idea to include a "Total" line as well? It would just be the total of the above (in my case 3) line. It would save us having to go to the summary payments report.

    Thanks again for looking into this.

  15. jekkos commented on Apr 6, 2021

    @jekkos
    Member

    @chunter2 thanks for testing and quick confirmation.

    Not sure where you want this total exactly?

    I was mainly focusing on bugfixing for now, you can open a new issue to ask for this enhancement if you want. My time is a bit limited atm.

  16. chunter2 commented on Apr 6, 2021

    @chunter2
    ContributorAuthor

    @jekkos Just for clarity, so an example of the bottom of the daily sales page looks like this for me.

    Cash: $308.18
    Credit Card: $258.20
    Debit Card: $577.12

    I was just looking for one more line under Debit Card like this.

    Total: $1143.50

    Just figured I'd mention this since you were in the code at that point. No need to rush on this. I can open a new ticket for this, maybe after 3.3.4 is released.

    Thanks again.

  17. jekkos commented on Apr 6, 2021

    @jekkos
    Member

    @chunter2 thanks for the example, all clear now. Find this improvement in my last commit here. I hope it'll save you some time.

  18. chunter2 commented on Apr 6, 2021

    @chunter2
    ContributorAuthor

    @jekkos Works great. :) Thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions