Skip to content

Payment type enhancement suggestion #978

Closed

Description

@AssemRad

Hello,

What about adding simple payment_type kind of table in the database. so the payment holds an ID.
I believe this will overcome the problem mentioned in #973 (نقدي and cash are the same payment types but in different languages)

I guess this will assist in reporting later (refer to payment_type field in sales_payments table). such as if debt ( #24 ) comes ready to be implemented. Also, it may be a seed to start a payments module or a config tab at least.

This is a suggestion, but I have no idea if it has bad implications/side effects !

Thanks,
Assem

Activity

  1. daN4cat commented on Nov 16, 2016

    @daN4cat
    Collaborator

    It's a nice to have and the issue is how to manage the upgrade.
    How do we translate from existing to the IDs using a simple database upgrade script?

  2. AssemRad commented on Nov 16, 2016

    @AssemRad
    Author

    mmm. rather a good point!
    let me check up where does the payments come in code first...

  3. daN4cat commented on Nov 16, 2016

    @daN4cat
    Collaborator

    It's all set in text, a database upgrade script cannot take into account the translations in different languages. I know this is not ideal.
    The only other way would be to implement something in the code that does an upgrade step working out the language issue.

  4. AssemRad commented on Nov 16, 2016

    @AssemRad
    Author

    Isn't there such a location in code that would trigger "Upgrade" scripts/functions once at the first run of the system (so it will read the values from Language files then does alter/update payments_types table) ? or it must be done manually by user interaction from say config pages ?

  5. daN4cat commented on Nov 16, 2016

    @daN4cat
    Collaborator

    There is no upgrade feature in code at the moment.
    In general it's a manual step involving a run of a database script in phpMyAdmin or command line.

  6. jekkos commented on Nov 16, 2016

    @jekkos
    Member

    There is some kind of upgrade functionality in CI but currently it's no priority to work on that. If you feel up to it then give it a try and send PR once you have something going @AssemRad

  7. AssemRad commented on Nov 17, 2016

    @AssemRad
    Author

    I'm C++ desktop developer in fact. However, I'll give it a try for sure as soon as I have spare time @jekkos .
    BTW. I use your system for my own newly opened home improvement supplies and hardware tools store :)

  8. jekkos commented on Nov 17, 2016

    @jekkos
    Member

    Ok great. I think PHP shouldn't be too hard for a C programmer. Nice to hear that ospos is working out there. Right now we are maintaining upgrade scripts in the form of plain SQL file. A nice alternative would be to convert those to using the built in CI upgrade mechanism.

    In this case we could try to find a way to load existing upgrade scripts with the migration class so that we don't have to convert all of the older upgrade scripts into dbforge code.
    Another challenge might be determining which schema version a user is on without having the migrations table in the schema .

  9. daN4cat commented on Nov 17, 2016

    @daN4cat
    Collaborator

    See #736 too. There is even a CI based solution that could allow pulling the update from GitHub automatically.
    Maybe one day...

  10. added this to the 3.1.0 milestone on Nov 17, 2016
  11. modified the milestones: 3.2.0, 3.1.0 on Feb 19, 2017
  12. removed this from the 3.2.0 milestone on Oct 14, 2017
  13. jekkos commented on Apr 1, 2026

    @jekkos
    Member

    Payment type database refactoring was requested 7 years ago. Payment types still use language-based keys but work as designed. Major refactor would be needed. Closing as stale.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions