Commit Graph

135 Commits

Author SHA1 Message Date
objecttothis
e1fedab9b7 Bugfix: constraint migration fixes (#4230)
- Refactored function names for PSR-12 compliance
- Programmatically cascade delete attribute_link rows when a drop-down attribute is deleted but leave attribute_link rows associated with transactions.
- Added `WHERE item_id IS NOT NULL` to migration to prevent failure on MySQL databases during migration
- Retroactive correction of migration to prevent MySQL databases from failing.
- Refactored generic functions to helper
- Reverted attribute_links foreign key to ON DELETE RESTRICT which is required for a unique constraint on this table. Cascading deletes are now handled programmatically.
- Migration Session table to match Code Igniter 4.6
- Add index to attribute_links to prevent query timeout in items view on large databases
- Added overridePrefix() function to the migration_helper. Any time QueryBuilder is adding a prefix to the query when we don't want it to, this query can be used to override the prefix then set it back after you're done.
- Added dropAllForeignKeyConstraints() helper function.
- Added deleteIndex() helper function.
- Added indexExists() helper function.
- Added primaryKeyExists() helper function.
- Added recreateForeignKeyConstraints() helper function.
- Added CRUD section headings to the Attribute model.
- Replaced `==` with `===` to prevent type juggling.
- Removed unused delete_value function.
- Reworked deleteDefinition() and deleteDefinitionList() functions to delete rows from the attribute_links table which are associated.
- Added deleteAttributeLinksByDefinitionId() function

Implement Cascading Delete
- Function to delete attribute links with one or more attribute definitions.
- Call function to implement an effective cascading delete.
- Refactor function naming to meet PSR-12 conventions

Fix Migration
- Add drop of Generated Column to prevent failure of migration on MySQL databases.

Fix Migration
- Removed blank lines
- Refactored function naming for PSR compliance
- Reformatted code for PSR compliance
- Added logic to drop dependent foreign key constraints before deleting an index then recreating them.

Migrate ospos_sessions table
- DROP and CREATE session table to prevent migration problems on populated databases

Fixed Bug in Migration
- In the event that item_id = null (e.g., it's a dropdown) it should not be included in the results.

Fixed bug in Dropdown deletes
- Removed delete_value function in Attributes Controller as it is unused.
- Renamed postDelete_attribute_value function for PSR-12 compliance.
- Renamed delete_value Attribute model function for PSR-12 compliance.
- Refactored out function to getAttributeIdByValue
- Replaced == with === to prevent type juggling
- Reorganized parts of model to make it easier to find CRUD functions.

Refactoring
- PSR-12 Compliance formatting changes
- Refactored several generic functions into the migration_helper.php
- First check if primary key exists before attempting to create it.
- Grouped functions together in migration_helper.php
- phpdoc commenting functions

Optimizing Indices
- There are two queries run while opening the Items view which time out on large databases with weak hardware. These indices cut the query execution in half or better.

Add Unique constraint back into attribute_links
- This migration reverts ospos_attribute_links_ibfk_1 and 2 to ON DELETE RESTRICT. Cascade delete is done programmatically. This is needed to have a unique column on the attribute_links table which prevents duplicate attributes from begin created with the same item_id-attribute_id-definition_id combination

Correct spacing after if for PSR-12

Minor code cleanup.
- Removed Comments separating sections of code in Attribute model
- Removed extra log line to prevent cluttering of the log
2025-05-29 15:24:08 +04:00
Maxime
3c846e6324 Fixed broken escape string for success & warning messages (#4253)
* Fixed broken escape string for success & warning messages

* Fixed issue in sales register

---------

Co-authored-by: Franchovy <franchovy@pm.me>
2025-05-27 23:27:27 +02:00
diego-ramos
85120fa4be Fix encoding issue for payment types with special characters (#4232) 2025-05-22 22:34:39 +02:00
BudsieBuds
e83c23cf0c Improve code style and PSR-12 compliance (#4204)
* Improve code style and PSR-12 compliance
- refactored code formatting to adhere to PSR-12 guidelines
- standardized coding conventions across the codebase
- added missing framework files and reverted markup changes
- reformatted arrays for enhanced readability
- updated language files for consistent styling and clarity
- minor miscellaneous improvements
2025-05-02 19:37:06 +02:00
odiea
7fb75dbea9 Fix reports to show table details (#4231) 2025-04-22 17:51:31 +02:00
jekkos
e0cb950083 Fix datetime rendering (#4226) (#4227) 2025-04-20 18:42:12 +02:00
BudsieBuds
9c963814dd Some bug fixes (#4225)
- use unminified login css since gulp doesn't minify it
- adjust container max width to bootstrap 5's container-xxl
- add rtl css to bootstrap theme, to match bootswatch standards
2025-04-20 18:27:36 +02:00
BudsieBuds
2fec49e7df Enhance license handling (#4223)
- automate license updates
- license text rendered in monospace font
- removed old bower license generation code
2025-04-19 20:20:50 +02:00
BudsieBuds
1bdc19f14f Convert menu icons to SVG (#4220)
* Convert menu icons to SVG
- replaced png images with svg
- 20% decrease in file size, improving load times
- removed 384 unused files from repo

* Transferred package to organisation
2025-04-18 19:48:19 +02:00
objecttothis
09530c1609 Feature bump ci to 4.6.0 (#4197)
* Replace tabs with spaces

Signed-off-by: objecttothis <objecttothis@gmail.com>

* Composer package bumps

- Bump codeigniter4/framework to 4.6.0
- Bump codeIgniter/coding-standard to ^1.8
- Bump codeigniter4/devkit to ^1.3
- Updated framework files required by CI4.6.0
- Removed Deprecated variables
- Added new file in the repo from framework

Signed-off-by: objecttothis <objecttothis@gmail.com>

* Reflect PHP 8.4 support
Updates for PHP 8.4 support introduced with the upgrade to CodeIgniter 4.6.x

* Update INSTALL.md

- Revert PHP 8.4 support for now.
- Removed extra space before comma

---------

Signed-off-by: objecttothis <objecttothis@gmail.com>
Co-authored-by: BudsieBuds <bas_hubers@hotmail.com>
2025-04-03 14:16:06 +04:00
objecttothis
e90b5b87da Replace tabs with spaces (#4196)
Signed-off-by: objecttothis <objecttothis@gmail.com>
2025-03-28 21:24:21 +04:00
Chathura Dilushanka
2bd38737e1 Update locale_config.php 2025-03-04 21:36:39 +01:00
jekkos
8516ffe216 Add php-json to dependency list (#4168) 2025-02-07 23:59:59 +01:00
jekkos
c6c5fcac26 Fix sales tax summary with time filter (#4166) 2025-02-05 22:01:59 +01:00
BudsieBuds
4d9cd80f8b Random fixes #2
- change old directories to new (ci4)
- updated documentation for clarity
2025-02-05 21:58:28 +01:00
BudsieBuds
beb18ff96b Random fixes (#4144)
Random fixes in time for the 3.4.0 release.
- corrects typo in the items controller
- small update to login view
- removes deprecated code from header view
- ospos license updated to end 2024
- moved gulp packages to dev dependencies
- updated gulp-zip and npm-check-updates to latest version
- updated readme for consistency
- makes ospos license in config fully readable
- fixes composer libraries license view in config
- gulp now updates composer libraries license and ospos license
- updated other license views in config
2025-01-28 23:48:45 +01:00
El_Coloso
7ad1bfa0fb Fix requisitions (#4147)
* Fix data types on null values
* Fix receiving receipt image tag
* Fix error on Receiving Model
2025-01-28 23:32:05 +01:00
El_Coloso
9cc24f0c70 Send receipt by email as PDF (#2682) 2025-01-26 22:13:27 +01:00
El_Coloso
a5b2b5f771 Fixes for receipt + invoice (#2682)
* Email invoice bar code
* Send invoice by email
* Remove default comment on invoice if comment was set
2025-01-24 00:17:25 +01:00
odiea
4d65bd6c92 Fix sticky header issue in reports (#3854) 2024-12-05 21:08:59 +01:00
objecttothis
2d895b4a9e Adapt Configuration checker for CI4 (#4108)
- Removed $import variable as it is never used and the code generates the csv file for item imports
- Refactored import_customers.csv to match PSR-12 standard file names
- Refactored variable names to match PSR-12 standard variable names
- Updated .editorconfig to reflect PSR-12 requirement for spaces rather than tab symbols. https://www.php-fig.org/psr/psr-12/#24-indenting
- Added version number to browser reporting
- Corrected timezone reporting

Signed-off-by: objecttothis <objecttothis@gmail.com>

* Revert .editorconfig (#3708)

---------

Signed-off-by: objecttothis <objecttothis@gmail.com>
Co-authored-by: jekkos <jeroen.peelaerts@gmail.com>
2024-11-10 09:23:42 +01:00
jekkos
0f7d0a7903 Fix expenses entry (#4075) 2024-10-06 01:29:52 +02:00
jekkos
c606bde733 More giftcard fixes (#2935) 2024-09-23 00:54:46 +02:00
jekkos
822bebaf64 Giftcard modal improvements (#2935) 2024-09-20 00:41:34 +02:00
jekkos
7d04371425 Fix checkNumeric validation (#3872) 2024-09-17 02:02:05 +02:00
jekkos
d69e7be848 Fix bugs in expenses form (#3840) 2024-09-17 01:50:35 +02:00
jekkos
9a032d1891 Add refresh after submit in expenses (#3840) 2024-09-17 01:39:34 +02:00
Steve Ireland
82aac4ec79 Resolving issue #3997 for discount type toggle not staying put. 2024-07-26 21:36:19 +02:00
Steve Ireland
034f79e157 Start Daily Sales with selected customer (#4019) 2024-07-08 20:48:31 -04:00
objecttothis
52723ceeec Updated PHPDocs
- Added @noinspection PhpUnused to AJAX-called functions to remove weak warning that the function is unused. This will be needed for the linter.
- Referenced where the function is called in the PHPdocs.
- Removed redundant transaction. batch_save() is already being run in a transaction.
- Fixed function name in controller and view.
- Removed form helper load because it's autoloaded.
- Corrected variable reference in Secure_Controller.php

Signed-off-by: objecttothis <objecttothis@gmail.com>
2024-06-15 17:19:15 +02:00
objecttothis
8408bb0d80 Revert push
Signed-off-by: objecttothis <objecttothis@gmail.com>
2024-06-15 17:19:15 +02:00
objecttothis
14248edc06 HTMLPurifier filtering
- Replaced == with === to avoid type juggling
- Removed unneeded TODO
- Added HTMLPurifier to composer.json
- Added Service to allow singleton instance of purifier.
- Implemented use in Customer Controller Search function.

Signed-off-by: objecttothis <objecttothis@gmail.com>
2024-06-15 17:19:15 +02:00
jekkos
dfe614efaf Fix pie charts (#3773) 2024-06-15 17:19:15 +02:00
jekkos
07e09e1948 Fix register functionality
Fix controller method names
2024-06-15 17:19:15 +02:00
jekkos
f81dfe1b0b Fix permissions checkbox state (#3993) 2024-06-15 17:19:15 +02:00
BudsieBuds
9fe578504c Update login screen
- Updated deprecated BS5 classes
- Throw errors in separate alert boxes and not as an <ul>
- Make error translatable
- Small updates/fixes
2024-06-15 17:19:15 +02:00
objecttothis
1328b4d9b8 - Removed TODOs that had been completed
- Added TODO where we need to convert to querybuilder
- Converted to switch statement.
- Removed unnecessary local variable
- Replaced Qualifiers with imports
- Replaced isset() call with null coalescing operator
- Replaced strpos function calls in if statements with str_contains calls
- Removed unnecessary leading \ in use statement
- Replaced deprecated functions
- Updated PHPdocs to match function signature
- Added missing type declarations
- Made class variables private.
- Explicitly declared dynamic properties
- use https:// links instead of http://
- Fixed type error from sending null when editing transactions
- Fixed Search Suggestion function name in Employees, Persons, Suppliers controller
- Fixed function name on Receivings Controller

Signed-off-by: objecttothis <objecttothis@gmail.com>
2024-06-15 17:19:15 +02:00
jekkos
3963b2c924 Fix redirect + no permission error message 2024-06-15 17:19:15 +02:00
jekkos
bd1af2b854 Fix delete payment (#3983) 2024-06-15 17:19:15 +02:00
objecttothis
c60d81dd88 Removed escaping of data
Signed-off-by: objecttothis <objecttothis@gmail.com>
2024-06-15 17:19:15 +02:00
SpookedByRoaches
3d163e1969 Fix for attribute addition for items 2024-06-15 17:19:15 +02:00
WShells
a105308ad4 Fix for Edit Sales Receipt Details
Modal not displaying
2024-06-15 17:19:15 +02:00
WShells
32c05b475d Fix for Receivings Edit form
Receiving form wasn't popping up for update.
2024-06-15 17:19:15 +02:00
WShells
e779ac8a79 Fix for Low Inventory Report
. Param count in the URI are greater than the controller method params.
Now displaying and listing items as needed
2024-06-15 17:19:15 +02:00
objecttothis
35e3adeca8 Fixing Reports
- Added checks for array keys not set
- Renamed functions so that reports would generate
- Minor reformatting
- Added sale_id to the groupBy() call to remove error when only full group by is enabled.

Signed-off-by: objecttothis <objecttothis@gmail.com>
2024-06-15 17:19:15 +02:00
objecttothis
658a9ce553 Fixing routes
- Refactored function name to match the route.
- Added null check on sale date.
- enabled escaping in bootstrap-tables
- removed the esc() function from the

Signed-off-by: objecttothis <objecttothis@gmail.com>
2024-06-15 17:19:15 +02:00
WShells
9c0d597159 Fix for invoice barcode 2024-06-15 17:19:15 +02:00
WShells
128ac0c63e Fix for New Kit
Fix new kit modal not displaying expecting int
2024-06-15 17:19:15 +02:00
WShells
77420083ef Fix for Gift Card Number Display
Gift card number field wasn't displaying
2024-06-15 17:19:15 +02:00
WShells
e07cfd4143 Fix for Shortcuts
Keyboard Shortcuts Help modl returning 404 / not displaying
2024-06-15 17:19:15 +02:00