Commit Graph

192 Commits

Author SHA1 Message Date
objecttothis
3d65c3fffa CSV import optimizations and code cleanup (#3150)
Optimizations and CSV Import Rework
- Replaced " with ' where possible to prevent the parser from being called when not needed.
- Replaced == and != with === and !== where possible for bug prevention and speed.
- Replaced -1 with NEW_ITEM global constant for code clarity.
- Added NEW_ITEM global constant to constants.php.
- Refactored CSV import function names for clarity.
- Added capability to import a CSV file containing updates.
- Replaced array() with [] for speed and consistency.
- Removed hungarian notation from two private functions.
- Refactored QueryBuilder functions to place table name in the get() function call.
- Replaced (int) cast with call to intval() for speed.
- Replaced == and != with === and !== where possible to prevent bugs and for speed.
- Replaced array() with [] for speed and consistency.
- Fixed search_custom call

Optimizations and bugfixes for attributes used in csv_import
- Reordered where statements in queries to match composite index on attribute_links table.
- fixed value_exists() to account for different attribute types.
- Removed hungarian notation on private function.
- Replaced array() with [] for speed and consistency.
- Replaced != with <> in SQL for consistency.
- Removed from() calls in querybuilder where possible to reduce function calls.
- Add get_items_by_value()
- Reworked check_data_validity()
- Remove unneeded comments
- Refactor functions for code clarity.
- Use $this->db->dbprefix() where possible instead of hand-writing ospos_...
- Removed unneeded column from query.
- Replaced (int) cast with intval() call for speed.
- Added get_attribute_values()
- Fixed issue with date format locale not being used
- Refactored save_value to respect different attribute_types
- Added delete_orphaned_links() to remove attribute_links that are no longer linked to any items
- Added get_attributes_by_definition()
- Added attribute_cleanup()

Optimizations used in csv_import
- replaced array() with [] for consistency and speed.
- Removed hungarian notation in private functions.
- Replaced " with ' where possible to prevent the parser from being called.
- Minor formatting
- Refactored if statement to tertiary notation for cleaner implementation.
- Replaced " for ' where possible to prevent the parser from being called.
- Added the Id column in the generate_import_items_csv() template so that users can submit an update to an existing item.
- Removed unused key=>value pairs in foreach loops for speed.
- Removed unneeded comments where the function name was self-explanatory.
- Rework get_csv_file() for speed.
- Rework bom_exists() for speed.
- Replaced array() with [] for speed and consistency.
- Replaced == with === where possible to prevent bugs and for speed.
- Reworked valid_date() and valid_decimal helper functions for speed and accuracy according to the locale_format instead of a fixed format.
- Minor Reformatting for clarity.
- Replaced " for ' to prevent the parser from being called.
- Refactored function call names to reflect new names.
- Added missing ; in &nbsp;
- Used String interpolation where useful.

- Spelling fix in comment

Requested Review Changes
- Fixed indentation in Items.php
- Fixed indentation in Attribute.php
- Refactored variable out of long line of code to make it more readable.
2021-07-29 22:22:59 +02:00
Jeroen Peelaerts
aee186b2a6 Bump to 3.4.0-dev (#2942) 2021-05-26 00:48:42 +02:00
Jeroen Peelaerts
5cac9bb5ed Bump to 3.3.4 2021-04-21 21:47:33 +02:00
Jeroen Peelaerts
05942fe2f3 Add hook to validate save HTTP method (#3100) 2021-03-12 13:12:44 +01:00
Steve Ireland
c5b22a0300 Improved support for cash rounding transactions. 2021-02-07 13:39:51 -05:00
Jeroen Peelaerts
485c24a123 Fix cookie secure flag (#3082) 2021-01-20 20:35:01 +01:00
Jeroen Peelaerts
f7d06c1da4 Enable secure flag to make SameSite effective 2020-12-25 22:19:59 +01:00
Jeroen Peelaerts
49ef2a2105 Enable httpOnly for session cookie only (#1903) 2020-12-25 22:19:59 +01:00
Jeroen Peelaerts
625fb584ed Fix migration errors on clean install 2020-10-28 21:31:31 +01:00
jekkos-t520
632e25abe3 Email config (#2968) 2020-10-17 01:19:12 +02:00
jekkos-t520
eb9e9ddd38 Prepare 3.3.3 release 2020-10-05 22:45:20 +02:00
jekkos-t520
1709be588f Bump to 3.4.0 (#2942) 2020-09-14 18:17:36 +02:00
objecttothis
2cd90ccb17 Update constants.php
Correcting missing '
2020-06-04 11:11:50 +04:00
objecttothis
a3fb05b566 Change the locations of global constants to make them global across
files

- Items Constants
- Attributes Constants
- Sale Constants
2020-06-03 14:15:05 +04:00
jekkos-t520
783de92707 Revert migration version 2020-04-06 21:19:37 +02:00
jekkos-t520
7c33159a38 Fix config.php in testing mode 2020-03-07 15:21:45 +01:00
jekkos-t520
1c76edfc01 Fix config.php (#2751) 2020-03-06 23:22:34 +01:00
jekkos-t520
99bd6570b9 Load testing dotenv if environment is set 2020-03-06 21:32:51 +01:00
jekkos-t520
2110692664 Overwrite backupGlobals + base_url generation in testing mode 2020-03-06 21:32:51 +01:00
jekkos-t520
bc4a5570a5 Disable globals + fixup base_url 2020-03-06 21:32:51 +01:00
FrancescoUK
6b07d8ee21 Fix wrong tax amount with tax included 2020-02-04 21:25:37 +00:00
FrancescoUK
472e15ab0a Add detailed supplier report 2020-01-12 20:28:55 +00:00
FrancescoUK
3b628bed45 Prepare Release 3.3.2 2020-01-03 22:38:57 +00:00
FrancescoUK
970d2d1f42 Bump version to 3.4.0 2019-12-14 18:42:40 +00:00
FrancescoUK
ac1c6b2286 Minor fixes, add CI_ENV to docker-compose 2019-10-26 17:42:30 +01:00
FrancescoUK
19eb1cab59 Bump version to 3.3.1 to contain bug fixing 2019-10-01 20:09:55 +01:00
FrancescoUK
dbf3114267 Attributes csv import integration 2019-06-03 21:13:21 +01:00
Steve Ireland
09432c6450 Improve the summary payments report. 2019-03-06 19:27:58 -05:00
objecttothis
fe4b6dc640 Update config.php
Security Restriction per #2377
2019-02-27 11:27:05 +04:00
jekkos
9527ad4f33 Use dev as default commit hash (#2324) 2019-02-02 18:44:12 +01:00
jekkos
2674fbd03f Disable .gitattributes ident (#2324) 2019-02-02 14:08:20 +01:00
Steve Ireland
3220469837 Add support for India GST 2018-12-23 09:16:10 -05:00
jekkos
df61ee09bb Add item attributes functionality (#68) 2018-10-15 19:32:29 +02:00
FrancescoUK
b3bfc51ee8 Add cashup feature 2018-09-09 11:09:43 +01:00
Erastus
858f7614f9 merge branch 2018-09-03 01:10:28 -05:00
FrancescoUK
26e33dddec Check FORCE_HTTPS env to be true, upgrade MariaDB vs in docker-compose 2018-08-25 16:03:07 +01:00
Erastus
8b29fc7fea reports graphical discount 2018-08-20 23:42:47 -05:00
erastus
325ce79bed Change to 3.3.0 2018-08-20 15:03:09 -05:00
Erastus
85bbbe835c Discount on Sales 2018-08-20 13:41:56 -05:00
FrancescoUK
ebdc1880d9 Bump version to 3.3.0 for next phase 2018-06-13 22:11:00 +01:00
FrancescoUK
f1cf3d3c87 Release 3.2.3 2018-06-13 21:37:15 +01:00
FrancescoUK
c5632a2f5a Release 3.2.2 2018-06-06 21:35:52 +01:00
FrancescoUK
5ce7fcf5ed Bump version to 3.3.0 for next phase 2018-06-04 22:01:10 +01:00
FrancescoUK
0ba225cafd Fix CSRF error at login time (#1535) 2018-05-02 22:04:50 +01:00
FrancescoUK
9384b53a22 Bump version to 3.2.1 for next phase 2018-04-14 15:24:47 +01:00
jekkos
1b0eb0d936 Add migration_helper to config.php (#1927) 2018-04-05 18:10:19 +02:00
FrancescoUK
ae472d0176 Print reports date in different formats, remove sorting (#1896) 2018-03-25 13:57:20 +01:00
FrancescoUK
5edfed5bfc Enable https for proxy offloading 2018-03-04 16:48:36 +00:00
FrancescoUK
33cc7e3f9c Remove the "crap" (#1875) 2018-03-04 14:47:29 +00:00
FrancescoUK
2cde603949 Add Expenses support (#1235) 2017-11-26 20:45:57 +00:00