Commit Graph

222 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
objecttothis
ec587cc8a8 Correct formatting errors 2021-02-25 00:02:35 +01:00
objecttothis
d4f273e306 Grey out/disable Submit button after validation to prevent double submissions.
Change to a centralized method of greying out the submit button.
Rollback previous decentralized changes.
2021-02-25 00:02:35 +01:00
objecttothis
b0ed2bd34f Grey out/disable Submit button after validation to prevent double submissions. 2021-02-25 00:02:35 +01:00
objecttothis
18bdb5d854 Modify input validator
- Matched the allowed inputs to what is found in the validator for the
Attribute form (/views/attributes/form.php) for consistency.
- Removed the restriction on colon and added the restriction on
underscore.
- Modified the language line to indicate correct error.
2020-07-28 16:58:43 +04:00
objecttothis
a155399ec0 Merge branch 'master' into category_as_dropdown 2020-05-19 18:14:31 +04:00
objecttothis
35023e648f Force Travis-CI to rebuild to demo 2020-05-14 19:35:55 +04:00
objecttothis
b3b7b227a9 Fixed problem with Images not deleting 2020-05-08 16:52:35 +04:00
objecttothis
1dc3e15a55 Implement dropdown into item form view
- Created business logic in view to show dropdown if enabled
- Created business logic in controller to calculate key/value pairs of
dropdown
- Adjusted attribute model get_definition values to send values also if
definition_id is -1 or > 0 but not 0 which is what we are now using as
no definition instead of -1
2020-05-05 11:59:03 +04:00
FrancescoUK
e0620e1a3e Add more onClick select the text content 2020-02-15 22:44:03 +00:00
FrancescoUK
7739994eda Minor indentation adjustment 2020-01-19 20:51:41 +00:00
FrancescoUK
e03ee00e61 Merge pull request #2639 from opensourcepos/refresh-after-import
Refresh tables after import + close after invoice email (#478)
2019-12-29 20:31:23 +00:00
andriux1990
59bf8d0a45 item selection 2019-12-29 17:55:35 +01:00
jekkos
b8f255cc50 Refresh tables after import + close after invoice email (#478) 2019-12-29 17:50:17 +01:00
objecttothis
619742de4e Refactoring files and variable names in Customer/People 2019-11-25 17:27:59 +04:00
objecttothis
6294079ce3 File rename and variable refactor to correct error in import. 2019-11-25 15:51:31 +04:00
SteveIreland
fffb70933d Fix item type maintenance issue regardless. 2019-11-10 19:40:57 -05:00
jekkos
0ca766e9c9 Trigger validation when creating items in bulk (#2521) 2019-09-25 00:17:55 +02:00
Steve Ireland
03fe400e9e Allow user excluded from item kit maintenance to maintain stock type. 2019-02-09 11:56:49 -05:00
jekkos
4261613316 Fix migration message, add UK translation (#2247) 2018-12-30 18:27:58 +01:00
Steve Ireland
3220469837 Add support for India GST 2018-12-23 09:16:10 -05:00
jekkos
9f386b003b Keep attributes selected when creating new items (#2221) 2018-11-26 13:06:25 +01:00
jekkos
fd00a74225 Refactor + fix detailed reports (#68) 2018-10-15 19:32:29 +02:00
jekkos
9cdfc0ce8a Fix css overflow + form refresh 2018-10-15 19:32:29 +02:00
jekkos
e2147d8b00 Update language files (#68) 2018-10-15 19:32:29 +02:00
FrancescoUK
27122a8578 Update form.php 2018-10-15 19:32:29 +02:00
jekkos
500a8d7a8f Work in progress, still testing items form (#68) 2018-10-15 19:32:29 +02:00
jekkos
df61ee09bb Add item attributes functionality (#68) 2018-10-15 19:32:29 +02:00
FrancescoUK
baebd237e5 Fix review feedback 2018-07-14 09:29:10 +01:00
jekkos
a4e135eb92 Add support for multi-pack items. 2018-07-05 19:05:54 -04:00
FrancescoUK
683ef75162 Code refactoring 2018-07-05 18:09:42 +02:00
FrancescoUK
a34f152153 Revert "Fix Item form issue (#2021)" 2018-06-13 22:30:37 +01:00
Steve Ireland
5ef8a88000 Add support for temporary items. 2018-06-13 22:11:00 +01:00
FrancescoUK
8138db1a80 Fix Item form issue (#2021) 2018-06-13 21:19:55 +01:00
FrancescoUK
fe2ae55e94 Minor tidy up 2018-05-30 11:49:26 +02:00
FrancescoUK
fea0462407 Remove additional csrf_form_base calls, general tidy up 2018-05-30 11:49:26 +02:00
FrancescoUK
4079e44572 Allow password change with no restrictions + code reorg (#1894) 2018-03-25 19:18:03 +01:00
Steve Ireland
62f34663ae Provide a way to enter a line total and have the quantity sold automatically calculated. 2017-12-31 16:22:04 -05:00
FrancescoUK
c96c2a69a6 Fix Reports and few other minor things 2017-12-12 20:58:36 +00:00
FrancescoUK
8e86fbdc2a Fix comparisons in constant substitution of magic numbers (#1450) 2017-08-07 20:11:21 +01:00
jekkos
6c714b2dc4 Add constants for magic numbers 2017-08-06 14:33:26 +01:00
FrancescoUK
aa0e250250 Fixed styling issues and inventory missing translation 2017-08-06 02:10:18 +02:00
Steve Ireland
effba9d102 Add support for customer sales tax and cash rounding 2017-04-14 21:21:44 -04:00
Steve Ireland
e4955027d1 Hide stock_type and item_type if the employee isn't authorized to item kits. On register if item type is non-stock don't display the zero stock balance message, and correct the default quote format when initializing the field. 2017-02-19 13:41:04 -05:00
Steve Ireland
f9c1dde054 Changes to support Item Kits, support for MySQL 5.7, and a tweak for PHP 7 2017-01-29 22:23:46 -05:00
FrancescoUK
737980c041 Fix wrong items import model dialog title (#969) 2016-11-13 16:57:22 +00:00
jekkos
8b08bf5daa Add frontside support for locale dependent number validation (#788) 2016-08-09 18:20:52 +02:00
jekkos
3af19daa0e Fix decimal parsing, add php5-intl locale support (#458) 2016-07-07 20:56:51 +02:00
FrancescoUK
4618af352c Fixed New button in items form: visible in New Item not Edit/Update Item 2016-07-05 20:20:33 +01:00
jekkos
8002694c96 Make csrf token generation more generic using dataFilter in ajaxSetup (#597, #599) 2016-07-05 17:53:11 +02:00