Comments

gauravjeet created an issue. See original summary.

smccabe’s picture

This was working, we should add a test for it as well so it doesn't break again in the future.

gauravjeet’s picture

Status: Active » Needs work
gauravjeet’s picture

Status: Needs work » Needs review
StatusFileSize
new1.67 KB

The patch ajaxifies "Calculate" button to update the EOD report.

alexpott’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests

Any chance of a test for this fix? As per #2. Also does this only fix for js-enabled browsers or everyone?

travis-bradbury’s picture

StatusFileSize
new16.68 KB
new23.95 KB

The report has two buttons - Calculate and Close Register & Save.

eod report

Pressing Calculate saves stuff, which is surprising since it's the button that says it wont save.

calculate

It looks like Calculate should show calculated values only, but not save them.

jnrfred’s picture

StatusFileSize
new2.51 KB

This patch addresses issue #6.

travis-bradbury’s picture

StatusFileSize
new1.35 KB

#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.

cbanman’s picture

StatusFileSize
new2.15 KB

Created a new submit for the calculate button that rebuilds the form using the "Declared Amount" values in $form_state.

smccabe’s picture

Status: Needs work » Needs review

The last submitted patch, 7: calculate-EOD-report_2950034-7.patch, failed testing. View results

smccabe’s picture

Status: Needs review » Needs work

Calculate 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.

cbanman’s picture

StatusFileSize
new4.68 KB
new3.58 KB

Fixed deposit calculations.

subhojit777’s picture

Assigned: Unassigned » subhojit777

This still needs tests. The patch #13 is working.

subhojit777’s picture

subhojit777’s picture

+++ b/modules/reports/src/Form/EndOfDayForm.php
@@ -275,7 +294,10 @@ class EndOfDayForm extends FormBase {
+            '#validate' => ['::endOfDaySaveValidate'],

This callback is empty. Do we still need it?

subhojit777’s picture

StatusFileSize
new6.79 KB
new2.03 KB

This is incomplete.

subhojit777’s picture

Issue tags: -Needs tests
safallia joseph’s picture

StatusFileSize
new4.14 KB

Re-rolled the patch, added a ajax callback for calculate button and fed the formstate values to 'results' method for populating the results table.

safallia joseph’s picture

Status: Needs work » Needs review
gmem’s picture

StatusFileSize
new3.65 KB

Rerolled patch.

smccabe’s picture

Status: Needs review » Needs work

The payment types need to be dynamic and not hardcoded, see the other parts of the report for how they are loaded dynamically.

gmem’s picture

StatusFileSize
new5.9 KB
new4.56 KB

I 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.

gmem’s picture

Status: Needs work » Needs review
smccabe’s picture

Status: Needs review » Postponed

This 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.

  • smccabe committed 8473ad0 on 8.x-2.x authored by gmem
    Issue #2950034 by gmem, cbanman, subhojit777, gauravjeet, Safallia...
smccabe’s picture

Status: Postponed » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.