Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: pos payment methods not setting rounded_total #27251

Merged
merged 2 commits into from
Aug 31, 2021

Conversation

sunhoww
Copy link
Contributor

@sunhoww sunhoww commented Aug 31, 2021

The deleted code block is a duplicate of

auto_set_remaining_amount() {
const doc = this.events.get_frm().doc;
const grand_total = cint(frappe.sys_defaults.disable_rounded_total) ? doc.grand_total : doc.rounded_total;
const remaining_amount = grand_total - doc.paid_amount;
const current_value = this.selected_mode ? this.selected_mode.get_value() : undefined;
if (!current_value && remaining_amount > 0 && this.selected_mode) {
this.selected_mode.set_value(remaining_amount);
}
}

This block contains changes from #24738 that already fixes the mentioned issue. Therefore, as the removed block was defined below this block, its existence was making the changes in the previous PR have no effect.

@nextchamp-saqib nextchamp-saqib changed the base branch from version-13-hotfix to develop August 31, 2021 08:55
@nextchamp-saqib nextchamp-saqib changed the base branch from develop to version-13-hotfix August 31, 2021 08:55
@nextchamp-saqib nextchamp-saqib added the backport develop instructs mergify to frontport PR to develop branch label Aug 31, 2021
@sunhoww
Copy link
Contributor Author

sunhoww commented Aug 31, 2021

Found more duplicate code.

@nextchamp-saqib nextchamp-saqib merged commit 63cf012 into frappe:version-13-hotfix Aug 31, 2021
frappe-pr-bot pushed a commit to frappe-pr-bot/erpnext that referenced this pull request Aug 31, 2021
@ChillarAnand
Copy link
Contributor

@sunhoww Did you use any tool to find the duplicate code or did you stumble on it accidentally?

@sunhoww
Copy link
Contributor Author

sunhoww commented Sep 1, 2021

I stumbled upon it while investigating the OP issue.

@sunhoww sunhoww deleted the patch-3 branch September 1, 2021 08:58
sunhoww added a commit to libermatic/posx that referenced this pull request Sep 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport develop instructs mergify to frontport PR to develop branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants