Commit Graph

827 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
8675aa82df Attribute value encoding fix (#3241) 2021-07-22 19:01:59 +02:00
Jeroen Peelaerts
c6d0582fcb Add category column to item summary report (#3240) 2021-07-21 23:22:53 +02:00
BudsieBuds
2eee6313e0 Converted login to BS5 and other changes
Converted the login view to Bootstrap and Bootswatch 5. Added an option to change the login form style. Shifted some translations around and added new ones. Partially moved from Bower to NPM, added new branding logo's. Some other small changes and optimizations.
2021-07-14 08:35:04 +02:00
Steve Ireland
0147c3a80e Fix Discounted Item Kit bug #3129 (#3186) 2021-05-23 18:30:31 -04:00
Jeroen Peelaerts
b400223c57 Fix discount parsing (#3114) 2021-04-18 21:31:02 +02:00
Jeroen Peelaerts
a3a06fdb07 Fix cash totals in payment summary (#3138) 2021-04-07 08:51:29 +02:00
Jeroen Peelaerts
05942fe2f3 Add hook to validate save HTTP method (#3100) 2021-03-12 13:12:44 +01:00
Jeroen Peelaerts
df45d8baf6 Item kit barcode review fixes (#3090) 2021-02-10 10:27:17 +01:00
Jeroen Peelaerts
6705e5f259 Add item_number to item kits module 2021-02-10 10:27:17 +01:00
Steve Ireland
c5b22a0300 Improved support for cash rounding transactions. 2021-02-07 13:39:51 -05:00
Jeroen Peelaerts
a8e505d668 Use correct mimetype for invoice logo (#3019) 2020-12-29 22:09:27 +01:00
FrancescoUK
030b67224e Reset payments on item remove and sales register mode change (#3043) 2020-12-16 15:36:15 +00:00
FrancescoUK
2ce73993c6 Empty payments when Sales register item is edited (#3042) 2020-12-16 11:14:29 +00:00
Jeroen Peelaerts
36bab70bfd Fix default register mode (#3016) 2020-12-15 09:54:08 +01:00
Jeroen Peelaerts
87ea0c45f7 Update inventory date if sale/receiving is edited (#2844) 2020-12-04 23:48:57 +01:00
Carl Hunter
a54f596ea9 Rename Count column in Payments Summary Report to Transactions 2020-12-03 15:49:16 +01:00
Carl Hunter
516f8f71da Added Transactions column to Customer Summary Report 2020-12-03 15:49:16 +01:00
Carl Hunter
20d78224a4 Added Transactions column to Employees Summary Report and Transactions Summary Report 2020-11-15 15:44:40 +01:00
Carl Hunter
36b0b28109 Add Retail Price to Items Summary Report 2020-11-07 22:40:07 +01:00
Jeroen Peelaerts
5a124ede99 Fix supplier category after update (#2972) 2020-11-07 22:25:56 +01:00
Jeroen Peelaerts
67e1e4ef19 Add takings filtering on credit card (#2983) 2020-11-02 12:42:45 +01:00
Jeroen Peelaerts
e1ff739621 Increase timeout on migration (#2992) 2020-10-29 00:31:48 +01:00
jekkos-t520
760d7490a2 Fix stock location crud (#2965) 2020-10-17 01:05:03 +02:00
Steve Ireland
8e99889174 On document reprint retrieve the taxes originally applied to the reprinted document. 2020-09-19 14:14:01 +02:00
jekkos-t520
10bc0b5720 Fix custom invoice number (#2820) 2020-07-05 23:13:36 +02:00
objecttothis
979ec9fe02 Merge branch 'master' into category_as_dropdown 2020-05-20 13:55:41 +04:00
objecttothis
89a56820d2 Formatting Corrections 2020-05-20 13:52:54 +04:00
objecttothis
145f49d247 Code Review Changes
- Refactored code to include constants
- Fixed comment formatting issues
2020-05-20 13:48:24 +04:00
objecttothis
a155399ec0 Merge branch 'master' into category_as_dropdown 2020-05-19 18:14:31 +04:00
objecttothis
f5424a3ed2 Create Global Constants to clarify code 2020-05-19 18:06:20 +04:00
objecttothis
a154a8705c Fixed indentation issue
Fixed indentation issue
2020-05-08 23:58:40 +04:00
objecttothis
f4a941e209 Removed duplicate variable 2020-05-08 16:08:49 +04:00
objecttothis
75f45bdb47 Corrected variable names 2020-05-08 16:04:37 +04:00
objecttothis
8a9edb8963 Removing variable not yet merged into the master from another PR 2020-05-08 16:02:02 +04:00
objecttothis
68a2489e13 Add Save logic
- Corrected minimum image size value in migration script
- Added save logic to save_general() in Config controller
- Added logic in the index() of the Config controller to properly prep
allowed_image_types data
2020-05-08 15:58:37 +04:00
objecttothis
59142d9f69 Database logic additions
- Migration script to create default values
- Corrected naming of variables in general_config.php
- Replaced hardcoded values with db variables
2020-05-08 14:22:49 +04:00
objecttothis
9557f1c310 Forgotten commit
- This was correct in my code base.  I just forgot to commit it.
2020-05-05 14:47:42 +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
objecttothis
d5d6d6668c Corrected errors 2020-05-04 17:19:03 +04:00
objecttothis
15a987cfd9 Adjust functions related to attributes 2020-05-04 17:00:02 +04:00
objecttothis
96bfa330ba Added the creation and removal of ospos_category attribute
- Added undelete function in Attribute model which could be useful for
adding the ability to restore attributes once deleted.
- Added business logic to Config controller save_general to
create/remove the attribute when the box is checked or unchecked.
2020-05-04 16:45:58 +04:00
objecttothis
231fe483d9 Add Config to enable show Category as dropdown
- Added the config item and label to view.
- Added the language line in en_US and en_GB.
- Added save business to Config controller.
- Fixed formatting issues in Config controller (removed tabs on blank
lines)
2020-05-04 15:23:50 +04:00
jekkos-t520
6bd0d6277b Move parsing to token_lib 2020-04-23 22:50:41 +02:00
objecttothis
4584b7eace Final indentation and formatting fixes 2020-03-24 14:17:36 +04:00
objecttothis
8a0c88b11c More indentation corrections 2020-03-24 14:13:08 +04:00
objecttothis
3281fc9bb0 Correct indentation problems 2020-03-24 14:04:04 +04:00
objecttothis
971ae5ec19 Correcting indentation problems 2020-03-24 13:18:35 +04:00
objecttothis
fb9fec1a10 Merge branch 'master' into pos_bool 2020-03-18 16:19:45 +04:00
objecttothis
c4c475b51f Updated CSV import to handle checkboxes
0, FALSE values create attributes marked as "unchecked"
NULL, "" and spaces do not create an attribute
1, TRUE and ANY other value creates an attribute and marks as checked.

Blank lines in CSV files are skipped with no error.
2020-03-18 15:49:49 +04:00