Commit Graph

9 Commits

Author SHA1 Message Date
objec
f915a6de1f - Remove unneeded comment
- Rollback transaction on failure before returning false
- Rollback transaction and return 0 on failure to save attribute link.
- Account for '0' being an acceptable TEXT or DECIMAL attributeValue.
- Add transaction to storeCSVAttributeValue function to prevent deleting the attribute links before confirming the new value successfully saved.
- Exclude the itemId in the check to see if the barcode number exists
- Add error checking to failed row insert
- Fail the import if an invalid stock location is found in the CSV
- Reworked &= to && logic so that it short-circuits the function call after if success is already false.
- Added logic to not ignore failed saveItemAttributes calls

Signed-off-by: objec <objecttothis@gmail.com>
2026-04-02 15:08:19 +04:00
objec
8e25e59b88 Correct test problems
- Correct mocking of dropdowns
- Correct expected value in test.
- Correct return value of function
- Remove whitespace

Signed-off-by: objec <objecttothis@gmail.com>
2026-04-02 13:52:36 +04:00
objec
4ff7899bed Replaced precision test with one reflecting testing of actual value.
- This test does not test cash rounding rules. That should go into a different test.

Signed-off-by: objec <objecttothis@gmail.com>
2026-04-02 11:12:44 +04:00
objec
426322da77 Corrected bug in stock_location->save_value()
- Like other save_value() functions, the location_data variable is passed by reference.
- Unlike other save_value() functions, the location_data variable is not being updated with the primary key id.
- Corrected the logic in itemUpdate test

Signed-off-by: objec <objecttothis@gmail.com>
2026-04-02 10:44:49 +04:00
objec
02dcf29627 Resolved incorrect array key
Signed-off-by: objec <objecttothis@gmail.com>
2026-03-31 23:27:57 +04:00
objec
65d5f3b1f0 Fix Unit Tests
- Corrected several tests that were failing

Signed-off-by: objec <objecttothis@gmail.com>
2026-03-31 23:18:18 +04:00
objec
34811c1eaf Fix Unit Tests
- Refactored for PSR naming
- Corrected errors in unit tests preventing them from passing. save_value() returns a bool, not the itemId

Signed-off-by: objec <objecttothis@gmail.com>
2026-03-31 21:45:05 +04:00
objec
86c62893cc UnitTest Seeder and tests
- Modified generate_message in Db_log.php to be defensive.
- Created a seeder to automatically prepare the test database.
- Modified the Unit Test setup to properly seed the test database.
- Wrote a unit test to test deleting an attribute from an item through the CSV.

Signed-off-by: objec <objecttothis@gmail.com>
2026-03-17 01:16:03 +04:00
jekkos
b1819b3b36 dd validation for invalid stock locations in CSV import (#4399)
- Add validateCSVStockLocations() method to check CSV columns against allowed locations
- Log error when invalid stock location columns are detected
- Tests for valid, invalid, and mixed stock location columns
- Tests for location name case sensitivity
- Tests for CSV parsing and detecting location columns
- Add error message language string for invalid locations

Co-authored-by: objecttothis <17935339+objecttothis@users.noreply.github.com>
2026-03-06 13:17:52 +01:00