Skip to content
Code-Schnipsel Gruppen Projekte
  1. Mär 27, 2025
    • Henning Leutz's avatar
      fix: use runtime currency instead of default currency · 403f14f2
      verfasst von Henning Leutz
      This commit refractors how product currency is set by replacing the default currency with the
      runtime currency which allows the application to adapt to different user sessions more responsively.
      
      Additionally, a fallback mechanism for setting valueText in PriceFactor has been introduced in case
      if it's given as a language-specific array.
      403f14f2
  2. Mär 25, 2025
    • Henning Leutz's avatar
      fix(phpstan): address issues with product price calculation and caching · b3ff7859
      verfasst von Henning Leutz
      This commit addresses two issues in the product model and utilities.
      
      1) In the product model, changes are made to ensure that the cacheName variable is given a default
      value of false and is later checked to be not false in the if condition. This ensures that we don't
      end up writing null data to the cache.
      
      2) Changes are made in the getPriceFieldForProduct function to fix some potential issues with price
      calculations. Minor refactor includes:
      
      - Added a check to ensure the getOption method exists before calling it, to prevent potential fatal
      errors.
      - Defaulted currencyPrices to an empty array to prevent potential PHP warnings when trying to
      access array keys on a null value.
      - Updated the return statement new QUI\\ERP\\Money\\Price to exclude currencyPrices which was
      causing issues.
      b3ff7859
    • Henning Leutz's avatar
      feat: add currency support for product calculation · 40f63f66
      verfasst von Henning Leutz
      This commit expands product calculations to include support for different currencies. The
      'calc.php' file has been updated to now take a currency input and use it when calculating the
      product cost. If no currency is given, it will default to the current user's currency.
      
      The 'Product.js', 'Products.js' and 'frontend/Product.js' files have also been updated to pass the
      currency when making Ajax calls.
      
      Finally, if no currency is set for the product in 'ViewFrontend.php', the default currency or the
      current user's currency will be used. Additionally, 'UniqueProduct.php' now includes the currency
      code when converting to an article.
      
      This feature enhances the flexibility of product cost calculations and accommodates for
      international users by including their local currency in the calculation process.
      40f63f66
    • Henning Leutz's avatar
      fix: update currency handling in product classes · a9e125bc
      verfasst von Henning Leutz
      Updated several classes in the `ERP/Products` directory to handle currency more efficiently.
      
      - Added currency fetching from user session and set it to product in `Product.php`
      - Updated `UniqueField.php` to get the currency of the associated product for price calculation and
      added `getOption` method.
      - Updated `Model.php` to handle both the default and product-specific currency when creating a
      unique product and fixed a couple of code arrangements.
      - Updated `UniqueProduct.php` to ensure using product's currency instead of default for prices and
      ensure `UniqueField` is linked to the product.
      - Refactored `Products.php` to handle product-specific currency prices and properly parse them in
      `getPriceFieldForProduct` method.
      a9e125bc
  3. Mär 24, 2025
    • Henning Leutz's avatar
      fix(phpstan): remove unnecessary phpstan ignore line in eventhandling · 30477032
      verfasst von Henning Leutz
      This commit removes a redundant phpstan ignore comment which was situated above an if statement in
      the EventHandling.php file, in the setDefaultProductFields function. The ignore command was not
      necessary and hence has been excluded to improve the readability and reduce unnecessary code.
      30477032
    • Henning Leutz's avatar
      fix: consider default currency and change event to price field · 5fc962f9
      verfasst von Henning Leutz
      This commit adds the `getDefaultCurrency` function call and incorporates the default currency in
      the price calculation. It further enhances the price input field to be disabled and auto-filled
      when the default currency is in use. Changes to the primary input field are now also propagated to
      the relevant currency input field.
      
      In addition, the composer.json has been updated to require a minimum version of 2.1 for
      `quiqqer/currency`.
      
      Note: Besides, several function calls have been added to trigger `change` event on main input
      element for accurate price calculation whenever the value changes. Moreover, the `blur` event has
      been added to the input element in `onSubmit` event handler to reflect the changes immediately.
      5fc962f9
    • Henning Leutz's avatar
  4. Mär 22, 2025
    • Henning Leutz's avatar
      fix: improve error logging for product frontend view · b2d08aff
      verfasst von Henning Leutz
      This commit expands on the error handling mechanism in our product model to be more specific during
      logging. If a product is activated in the system but not found in the frontend (HTTP 404 response),
      an error message is now logged using a 'products_not_found' tag. This will make it easier to
      identify and address issues with deactivated products that should be active. This commonly occurs
      when an outdated link through a search engine directs a user to a non-existing product page.
      b2d08aff
    • Henning Leutz's avatar
      fix: update php version and optimize string operations · 2855c70c
      verfasst von Henning Leutz
      Updated the PHP version requirement from 8.0 to 8.1 in composer.json.
      Refactored the string operations functions in category.php and productList.php. Replaced the
      'strpos' function with 'str_contains' for better readability and performance. Also replaced the
      usage of 'strpos' to check for string start with 'str_starts_with' for better readability. Fixed
      some strings formatting.
      2855c70c
  5. Mär 11, 2025
    • Henning Leutz's avatar
      fix: update variable declarations and cache handling · a8ecb4a0
      verfasst von Henning Leutz
      This commit involves refactoring code in Products.js by updating 'var' to 'let' or 'const' for
      proper scoping and better readability. It also introduces a new variable 'inAdministration' to
      handle specific conditions for QUIQQER's administrative state and modifies the condition for using
      cached data, considering 'inAdministration'. Expect no changes in functionality or behavior of the
      software with these changes.
      a8ecb4a0
  6. Mär 03, 2025
  7. Feb 28, 2025
    • Henning Leutz's avatar
      fix: update return type in product model methods · b5baafda
      verfasst von Henning Leutz
      Updated the getFieldValue and getFieldValueByLocale methods' return type in
      src/QUI/ERP/Products/Product/Model.php. Now these methods can return int, float, string, array, or
      null. Also simplified the exception statements.
      b5baafda
  8. Feb 20, 2025
    • Henning Leutz's avatar
      fix: update quiqqer/productsearch version in composer.json · 0a4c45e0
      verfasst von Henning Leutz
      The version of the "quiqqer/productsearch" dependency in `composer.json` was updated from "^1.1" to
      "^2" in order to match with the latest stable release of the library. This will help in making sure
      that the application stays up-to-date with the latest improvements and bug fixes.
      0a4c45e0
    • Henning Leutz's avatar
      chore(phpstan): update ignoreErrors in phpstan-baseline.neon · ca1aed26
      verfasst von Henning Leutz
      Adjusted the ignoreErrors parameter in the phpstan-baseline.neon file. Updated the referenced files
      under this setting to maintain code quality and standards. Further, added a newline at the end of
      the file for adherence to best practices.
      ca1aed26
    • Henning Leutz's avatar
      chore(phpstan): update phpstan-baseline.neon to ignore errors · 34fc1dab
      verfasst von Henning Leutz
      Update `phpstan-baseline.neon` to ignore specific errors related to invalid types, method calls,
      and properties in various parts of the project. This includes errors in `EventHandling.php` and
      `ProductList.php` related to the `AbstractOrder` class.
      34fc1dab
  9. Feb 19, 2025
    • Henning Leutz's avatar
      fix(phpstan): add class existence check before order operation in Calc.php · de683e80
      verfasst von Henning Leutz
      This commit ensures proper order operations in the Calc.php file by adding a class_exists check
      before proceeding. Its main purpose is to prevent errors if a requisite class,
      'QUI\\ERP\\Order\\AbstractOrder', is not available.
      de683e80
    • Henning Leutz's avatar
      refactor(phpcs): clean up code and remove unnecessary lines · 200c6309
      verfasst von Henning Leutz
      This commit includes cleaning up the code in several files directly and indirectly related to the
      product category and variant creation. Specific changes include the removal of unnecessary empty
      lines and import statements across three files: 'createProjectSite.php', 'Categories.php', and
      'VariantParent.php'. No logic has been altered, only code clarity and cleanliness have been
      improved.
      200c6309
    • Henning Leutz's avatar
      fix: added method_exists checks, improved sorting and exception handling · b35dcb3b
      verfasst von Henning Leutz
      - Added method_exists checks before method invocations in categories, fields and products modules
      to prevent potential crashes due to method absence.
      - Improved sorting operations in categories, fields and products modules by changing the comparison
      operator '>' to 'strcmp'.
      - Refined exception handling in categories update and products/frontend/getVariant, adding the
      ability to properly handle and log unexpected exceptions.
      - Fixed a minor issue in getInstalledProductPackages that didn't correctly traverse the package
      array.
      
      Related: #397
      b35dcb3b
    • Henning Leutz's avatar
      fix(phpstan): improve typehints and resolve phpstan errors · 93900c09
      verfasst von Henning Leutz
      - Added spaces in typehints for readability
      - Added `@phpstan-ignore-line` for DEVELOPMENT condition in `setFieldsToAllProducts()` to mitigate
      stan error
      - Cast `max_execution_time` to int before calling `set_time_limit`
      - Typecast integer variables to string in `str_pad` in `execute()` in GenerateProductCache.php for
      PHP compatibility
      - Added a check for `getCustomDataEntry` method existence before using it in `updateProductPrices`
      in UpdatePrices.php for run-time safety.
      
      Related: #397
      93900c09
    • Henning Leutz's avatar
      refactor(phpstan): improve type declarations and condition logic · 2532c540
      verfasst von Henning Leutz
      - Replaced multiple bool|int syntax with bool | int for PSR-12 compliance.
      - Added method_exists checks in some conditionals to avoid errors.
      - Replaced string comparison in `isActive` checks with strict `===`.
      - Cast `ini get` result to integer to match `set_time_limit` syntax.
      - Improved syntax for long conditional statements with multiple && conditions.
      - Fixed passing variable by reference in foreach.
      - Changed variable type passed to string from int in setDefaultVariantFields.
      - Used mb_strlen for string length calculation to prevent datatype error.
      - Improved error handling by adding @phpstan-ignore-line to silence specific PHPStan warnings.
      - Fixed a few minor typographical errors in comments.
      - Partially replaced type comments with typehints for better IDE support.
      
      Related: #397
      2532c540
    • Henning Leutz's avatar
      fix: code cleanup and minor corrections · 0ce4a5f4
      verfasst von Henning Leutz
      Made several code corrections and clean up in `AttributeGroup.php`,
      `AttributeGroupFrontendView.php`, `Folder.php`, `InputMultiLang.php`, `MultilangFrontendView.php`,
      `Price.php`, `ProductAttributeList.php`, `TimePeriod.php`, `VatFrontendView.php`, `UniqueField.php`.
      These changes consist of fixes in unions type declarations, rearrangements of conditions, removal
      of unnecessary typecasts, and small alterations for better readability and performance.
      
      Related: #397
      0ce4a5f4
    • Henning Leutz's avatar
      refactor(phpstan): improve type hinting and minor adjustments in Products Handler · 6fbd1af5
      verfasst von Henning Leutz
      - Typed parameters have been added in function signatures for better readability and type
      enforcement.
      - Replaced QUI\\Exception with just Exception for brevity and better readability.
      - Made corrections in comments for correct grammar and better understanding.
      - Removed redundant null checks and checks for method existence for concise code.
      - Certain unnecessary comments and variables have been removed for cleaner code.
      - Overall these changes contribute to improved readability and maintainability of the code.
      
      Related: #397
      6fbd1af5
    • Henning Leutz's avatar
      fix(phpstan): ensure compatibility with different datatypes · 357c24f1
      verfasst von Henning Leutz
      This commit ensures compatibility with different datatypes by adding necessary checks and type
      conversions in ERP Products module. It also removes unused comments, thus making the code cleaner
      and more efficient.
      
      Changes include:
      - In methods expecting integer parameters, explicit type casting has been added to situations where
      a string could be passed instead.
      - Additional checks are implemented before invoking method_exists(), ensuring safety.
      - Inappropriate comments and annotations have been removed to make the code more readable.
      - getEditableFieldIdsForProduct() and getInheritedFieldIdsForProduct() methods in Products.php had
      a generic parameter $Product, it has been type hinted with the ProductTypeInterface.
      
      Overall, the changes ensure better type stability and increase code reliability.
      
      Related: #397
      357c24f1
    • Henning Leutz's avatar
      refactor(phpstan): improve use of union types and add error checking in PHP files · fe754b84
      verfasst von Henning Leutz
      This commit primarily refines PHP code in multiple classes linked to handling products in the ERP
      module.
      
      These changes:
      - Add a number of error closure checks for method_exists on several method calls.
      - Refine use of union types, allowing for cleaner and clearer type declaration.
      - Amend several git blob file changes that may or may not be relevant depending on the file diff
      output specifics. These changes include variable name changes, function name changes, and code
      reformatting.
      - Update function return types for optimized concise type declarations.
      - Add checks for method existence before calling methods in several places, to ensure valid method
      calls.
      - Correct mismatches in PHPDoc comments and actual function behaviors.
      
      Refactor: #397
      fe754b84
    • Henning Leutz's avatar
      refactor(phpstan): enhance price calculation methods (Calc) · 3b9c4add
      verfasst von Henning Leutz
      Significant improvements have been made on price calculation methods in
      src/QUI/ERP/Products/Utils/Calc.php. Enhancements include:
      - Checking if Product is an instance of UniqueProduct before recalculating and getting product price
      - Handling exceptions for PriceFactor objects that are not of the right instance
      - Improved checks for visibility and existence of `Vat`
      - Affirming method availability before checking for value text in PriceFactor class
      - Broadened round method support to handle different input types
      - More robust error handling during tax type retrieval and tax entry determination for calculating
      both netto and brutto prices.
      3b9c4add
    • Henning Leutz's avatar
      refactor(phpstan): utils classes adapted to phpstan · b3c6fdde
      verfasst von Henning Leutz
      Related: #397
      b3c6fdde
  10. Feb 12, 2025
  11. Feb 07, 2025
  12. Feb 04, 2025
    • Henning Leutz's avatar
      fix: update phpstan version and remove redundant error from baseline · 8b012396
      verfasst von Henning Leutz
      Updated the phpstan version in `.phive/phars.xml` from `1.10.67` to `1.12.13` to use the latest
      features and improvements. Also, altered the specified version pattern to `1.*` to automatically
      pick up the latest minor version releases. In addition, removed a redundant error message in
      `phpstan-baseline.neon` related to the `getUrlRewrittenWithHost` method in `types/category.php`,
      which was causing unnecessary noise in the error report.
      8b012396
    • Henning Leutz's avatar
      refactor: update method parameter type hints in product model · c3956309
      verfasst von Henning Leutz
      This commit refines the type hints in the Product model. Specifically, the
      getUrlRewrittenWithHost() method's $Project parameter type is defined more explicitly, indicating
      that it can accept either a type of QUI\\Projects\\Project or null.
      
      Related: quiqqer/package-feed#15
      c3956309
  13. Dez 18, 2024
  14. Dez 03, 2024
  15. Nov 29, 2024
  16. Nov 14, 2024
  17. Nov 07, 2024
  18. Okt 31, 2024
  19. Okt 30, 2024