Closed (fixed)
Project:
Commerce Point of Sale (POS)
Version:
8.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
5 Mar 2018 at 12:55 UTC
Updated:
14 Sep 2018 at 17:49 UTC
Jump to comment: Most recent, Most recent file

Comments
Comment #2
smccabe commentedThis was working, we should add a test for it as well so it doesn't break again in the future.
Comment #3
gauravjeet commentedComment #4
gauravjeet commentedThe patch ajaxifies "Calculate" button to update the EOD report.
Comment #5
alexpottAny chance of a test for this fix? As per #2. Also does this only fix for js-enabled browsers or everyone?
Comment #6
travis-bradbury commentedThe report has two buttons - Calculate and Close Register & Save.
Pressing Calculate saves stuff, which is surprising since it's the button that says it wont save.
It looks like Calculate should show calculated values only, but not save them.
Comment #7
jnrfred commentedThis patch addresses issue #6.
Comment #8
travis-bradbury commented#7 changes the message that's shown but it doesn't actually stop saving, so it has the same issue.
An issue introduced in #7 is that it compares the translated version of 'Update Report' or 'Calculate' against the static values 'Update Report' or 'Calculate'.
It also no longer states that the values were saved when doing Close Register & Save instead of Update Report.
Comment #9
cbanman commentedCreated a new submit for the calculate button that rebuilds the form using the "Declared Amount" values in $form_state.
Comment #10
smccabe commentedComment #12
smccabe commentedCalculate doesn't play nicely with the Cash Deposit, sometimes the deposit doesn't seem to update and then even if I hit calculate it is still stuck.
Comment #13
cbanman commentedFixed deposit calculations.
Comment #14
subhojit777This still needs tests. The patch #13 is working.
Comment #15
subhojit777Comment #16
subhojit777This callback is empty. Do we still need it?
Comment #17
subhojit777This is incomplete.
Comment #18
subhojit777Comment #19
safallia joseph commentedRe-rolled the patch, added a ajax callback for calculate button and fed the formstate values to 'results' method for populating the results table.
Comment #20
safallia joseph commentedComment #21
gmem commentedRerolled patch.
Comment #22
smccabe commentedThe payment types need to be dynamic and not hardcoded, see the other parts of the report for how they are loaded dynamically.
Comment #23
gmem commentedI went ahead and rewrote the for loop for the calculate button, and removed the calculateSubmit function in favour of the new ajaxRefresh() method. I removed the message for when values are calculated since it doesn't appear until the page is refreshed (probably because it's not a submit type and doesn't refresh the page itself?). Also re-added the test which went missing in a reroll and verified it works properly, while adding a few other asserts.
Comment #24
gmem commentedComment #25
smccabe commentedThis patch is just held up on some insufferable config issue with a new field from commerce, I'll fix that and then this can be merged in.
Comment #27
smccabe commented