Skip to content

Conversation

@defendicon
Copy link
Contributor

@defendicon defendicon commented Dec 23, 2025

Now user can enable settings in backend pos settings doctype andit will show in frontend settings page in sales management tab. User can now edit rate of item after enabling it.
fix issue # #71

@engahmed1190
Copy link
Contributor

🔴 Changes Requested

❗ Blocking Issues (Must Fix)

  • Do not overwrite price_list_rate

    • Current logic replaces the original list price when rate is edited.
    • This destroys discount and margin auditability.
    • price_list_rate must remain immutable; manual rate edits should be tracked as discounts and/or explicit flags.
  • Add server-side validation for edited rates

    • Backend must reject:
      • zero or negative rates
      • rates exceeding allowed discount
      • (optionally) rates below cost
    • Client-side validation alone is not sufficient.
  • Add audit logging for manual rate edits

    • Log who changed the rate, when, item code, and old → new value.
    • Use Activity Log, Comment, or a custom log DocType.
  • Remove debug logs from production code

    • console.log statements are present in POS UI and settings store.
  • Restore settings bootstrap cache optimization

    • The preloaded settings logic is commented out, forcing extra API calls and slowing POS startup.
  • Fix resetSettings()

    • allow_user_to_edit_rate must be included to avoid undefined state after reset.

⚠️ High / Medium Issues

  • Missing role-based control

    • If enabled, any POS user can edit rates.
    • Consider role checks or manager approval for large discounts.
  • Incomplete hide-field logic

    • _hide_allow_user_to_edit_rate exists in frontend but backend behavior is unclear or incomplete.
  • Large JSON formatting diffs

    • Formatting-only changes should be isolated in a separate commit or PR.
  • Missing translations

    • New UI labels are not added to i18n files.

✅ Expected Direction

  • Preserve original price_list_rate
  • Track manual rate edits as discount plus audit flag
  • Enforce validation and logging on the backend
  • Keep POS startup fast by using cached or bootstrap settings

🧪 Tests Required (Minimum)

  • Rate edit allowed or blocked based on setting
  • Backend rejects invalid rates
  • price_list_rate remains unchanged
  • Audit log entry is created on manual edit

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants