Commit Graph

13 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
Steve Ireland
c5b22a0300 Improved support for cash rounding transactions. 2021-02-07 13:39:51 -05: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
FrancescoUK
c76109ab0a Update to Code Igniter 3.1.0 (#782) 2016-08-04 22:25:17 +01:00
jekkos
d8e4bf48d8 Check if payments cover sale with exact precision (#733)
Set bc-operation style scale globally
Add location filtering in graphical and summary reports (#742)
2016-07-20 20:43:31 +02:00
FrancescoUK
007598df6a Fix merge miss in constants.php (#120) 2016-03-08 17:44:59 +00:00
FrancescoUK
9a71bbc620 Complete CI 3.0.3 upgrade since it wasn't done in full (#120) 2016-03-08 17:44:59 +00:00
jekkos
0788f4eef9 Set precision to 5 decimals (constants.php)
Show item description if serialized (invoice.php)
2015-06-28 14:20:39 +02:00
jekkos-t520
eb51b680aa Show stock location names in employee form 2014-10-03 00:27:50 +02:00
pappastech
ecdf3a5aa1 Version 2.0_RC1. Upgrade to CI 2.1.0.
Tom

git-svn-id: svn+ssh://jekkos@svn.code.sf.net/p/opensourcepos/code/@24 c3eb156b-1dc0-44e1-88ae-e38439141b53
2012-01-16 02:16:01 +00:00
pappastech
335982638e Upgrading to CI 2.1.0
git-svn-id: svn+ssh://jekkos@svn.code.sf.net/p/opensourcepos/code/@23 c3eb156b-1dc0-44e1-88ae-e38439141b53
2012-01-16 02:11:50 +00:00
pappastech
b089d5b73f Initial commit of release 1.0.
~ Tom

git-svn-id: svn+ssh://jekkos@svn.code.sf.net/p/opensourcepos/code/@5 c3eb156b-1dc0-44e1-88ae-e38439141b53
2011-06-08 13:21:52 +00:00