You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 !
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.
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 ?
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
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 :)
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 .
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.
Activity
daN4cat commentedon Nov 16, 2016
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?
AssemRad commentedon Nov 16, 2016
mmm. rather a good point!
let me check up where does the payments come in code first...
daN4cat commentedon Nov 16, 2016
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.
AssemRad commentedon Nov 16, 2016
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 ?
daN4cat commentedon Nov 16, 2016
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.
jekkos commentedon Nov 16, 2016
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
AssemRad commentedon Nov 17, 2016
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 :)
jekkos commentedon Nov 17, 2016
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 .
daN4cat commentedon Nov 17, 2016
See #736 too. There is even a CI based solution that could allow pulling the update from GitHub automatically.
Maybe one day...
jekkos commentedon Apr 1, 2026
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.