Compare commits

...

63 Commits

Author SHA1 Message Date
jekkos
86e150ad96 Update INSTALL.md with opensourcepos.org short URL
- Preferred install URL: https://opensourcepos.org/install
- Falls back to direct GitHub URL if redirect unavailable
- More professional and easier to remember
2026-03-06 10:21:22 +00:00
jekkos
8f4055c711 Add one-line Ubuntu installation script
- Creates scripts/install-ubuntu.sh for automated fresh Ubuntu server setup
- Installs Apache, MariaDB, PHP 8.2 with required extensions
- Downloads and configures OSPOS from GitHub
- Sets up Apache virtual host with proper permissions
- Generates secure random database password
- Supports environment variables for customization
- Updates INSTALL.md with curl pipe to bash instructions

This provides an alternative to cloud-specific instructions and
allows users to quickly set up OSPOS on any fresh Ubuntu server.
2026-03-05 15:11:06 +00:00
jekkos
3c25fd77e2 Add validation for invalid stock locations in CSV import
- 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
2026-03-05 15:06:28 +00:00
jekkos
3f7ea18f18 Add unit tests for CSV import functionality
- Add comprehensive test suite for CSV import in ItemsCsvImportTest.php
- Test CSV header generation (locations, attributes, BOM handling)
- Test CSV file parsing (multiple rows, BOM detection)
- Test item import (basic fields, quantities, inventory records)
- Test item updates, taxes, and attributes
- Test edge cases (zero quantities, negative values, precision)
- Add GitHub Actions workflow for unit tests
- Tests verify data ends up correctly in items/item_quantities tables
2026-03-05 12:57:37 +00:00
jekkos
36bf130bdd Add comprehensive unit tests for PR #4384
This commit adds unit tests for the case-sensitive attribute updates
and CSV import attribute deletion capability features introduced in PR #4384.

Test Coverage:
- Attribute Model Tests (tests/Models/AttributeTest.php):
  - testCaseSensitiveAttributeValueUpdate: Verifies case-insensitive check then case-sensitive update
  - testDeleteAttributeLinks: Tests deletion of attribute links
  - testCategoryDropdownCanBeEnabled: Verifies dropdown enablement bug fix
  - testDropdownAttributeValueSave: Tests DROPDOWN type attributes
  - testDateAttributeValueSave/Update: Tests DATE type attributes
  - testDecimalAttributeValueSave: Tests DECIMAL type attributes
  - testCheckboxAttributeValueSave: Tests CHECKBOX type attributes
  - testCategoryDropdownWithConstant: Tests CATEGORY_DEFINITION_ID usage
  - testDeleteAttributeLinksPreservesSalesAndReceivings: Ensures sales/receivings links protected
  - testDeleteOrphanedValues: Tests orphan value cleanup
  - testUnicodeCaseComparison: Tests Unicode handling in case comparisons
  - testGetAttributeValueByAttributeId: Tests new utility method
  - testAttributeLinkWithNullAttributeId: Tests null attribute_id handling
  - testCategoryDropdownUpdatesItemCategory: Tests category dropdown behavior

- Attribute Helper Tests (tests/Helpers/AttributeHelperTest.php):
  - Test getAttributeDataType for all attribute types (TEXT, DECIMAL, DATE, DROPDOWN, CHECKBOX)
  - Test getAttributeDataType returns 'attribute_value' as fallback for invalid types
  - Test validateAttributeValueType throws InvalidArgumentException for invalid types
  - Test validateAttributeValueType accepts valid data types

- Import File Helper Tests (tests/Helpers/ImportFileHelperTest.php):
  - Tests _DELETE_ magic word case-insensitive comparison using strcasecmp
  - Tests that _DELETE_ does not match similar-looking strings (security)
  - Tests empty string does not match _DELETE_
  - Tests null safety considerations for strcasecmp usage

Test Configuration:
- Updated phpunit.xml to include Models and Controllers test suites
- Uses DatabaseTestTrait for database migration between tests
- Tests cover positive and negative cases
- Tests include edge cases: Unicode, null values, empty strings, similar strings

Files Added:
- tests/Models/AttributeTest.php (26,541 bytes, 16 test methods)
- tests/Helpers/AttributeHelperTest.php (3,331 bytes, 8 test methods)
- tests/Helpers/ImportFileHelperTest.php (2,906 bytes, 4 test methods)

Total: 28 test methods covering all new features and edge cases

Note: Tests currently designed; will run once PHP environment is configured.
2026-03-04 20:48:10 +00:00
objec
088ad47c99 CSV Barcode Update Bug
- Refactored variable names for PSR compliance
- Removed bug preventing updates in CSV import files from updating the barcode number.
- Corrected duplicate saveAttributeLink() calls with attribute type was not DROPDOWN.

Signed-off-by: objec <objecttothis@gmail.com>
2026-02-27 18:00:30 +04:00
objec
808840b2e9 Implement Magic word deletion in CSV import
- Corrected spacing
- Added business logic to delete an attribute_link if the import contains `_DELETE_` in that space.
- Removed unneeded PHPdoc comments
- Improved PHPdoc to clarify behavior of function
- Refactor variable names for PSR compliance
- Add logic in validation code for magic word

Signed-off-by: objec <objecttothis@gmail.com>
2026-02-27 16:53:03 +04:00
objec
2ed74c5c0e Resolve review comments
- Replaced -1 for CATEGORY_DEFINITION_ID constant for readability

Signed-off-by: objec <objecttothis@gmail.com>
2026-02-27 00:31:51 +04:00
objec
c935fc7a2a Resolve review comments
- Move validation function to attribute_helper.php
- Removed extra line in security_helper.php
- Corrected some calls to helper() that included `_helper`

Signed-off-by: objec <objecttothis@gmail.com>
2026-02-26 23:16:39 +04:00
objec
89012054b4 Resolve review comments
- Fixed call to deleteOrphanedValues that refactor missed.
- Removed unused import.
- Fixed issue preventing DROPDOWN values from being added.
- Updated logic to fix potential TypeError being thrown by strcasecmp()

Signed-off-by: objec <objecttothis@gmail.com>
2026-02-26 15:16:51 +04:00
objec
89572aa289 Resolve review comments
- Replaced unneeded case-sensitive database search with case-insensitive variant.
- Added input validation.
- Added logic to properly check for case changes in CSV import.
- Moved deleteOrphanedValues() to outside a foreach loop to prevent it running redundantly.

Signed-off-by: objec <objecttothis@gmail.com>
2026-02-26 13:52:14 +04:00
objec
2b56d56072 Resolve business logic bugs
- Fixed logic causing attribute_value to be updated to a value that already exists for a different attribute_id.
- Added logic for edge case where an attribute_value was updated due to capitalization that had a row in attribute_links for category_dropdown definitions (definition_id = -1). This will also update the items.category values to correct the capitalization of those.

Signed-off-by: objec <objecttothis@gmail.com>
2026-02-26 12:28:48 +04:00
objec
2fc9fc09a4 Comment Resolutions
- Removed redundant variable declaration.
- Refactored local variables for PSR compliance.
- Add back in Date Formatting and corrected business logic
- Corrected spacing in comments.
- Corrected business logic of function call in Attribute model and refactored redundant code to a private function.

Signed-off-by: objec <objecttothis@gmail.com>
2026-02-26 00:19:57 +04:00
objec
932b612c9e Case-sensitive attribute update in Item view
- Refactored local variables for PSR compliance
- Added business logic to Attribute->saveAttributeValue so that the attribute value gets overwritten if the only difference is capitalization.
- Added PHPdocs
- Fixed bug in Attribute->saveDefinition preventing category as dropdown from working.
- Modified Attribute->saveAttributeLink() to account for dropdown attributes.

Signed-off-by: objec <objecttothis@gmail.com>
2026-02-25 19:22:02 +04:00
objec
ab6e8ee083 Case-sensitive attributes in CSV imports
- Added attribute_helper.php and getAttributeDataType function for quick translation in the code.
- Refactored code for PSR compliance
- Added getAttributeValueByAttributeId() to the attribute model.
- Added PHPdocs where it was missing
- Updated business logic to check for capitalization differences on CSV import of an item.

Signed-off-by: objec <objecttothis@gmail.com>
2026-02-25 16:30:21 +04:00
jekkos
79427481b3 Fix XSS vulnerabilities in invoices + receipts (#3965) (#4363) 2026-02-23 20:14:55 +01:00
dependabot[bot]
b23351a45c Bump jspdf and jspdf-autotable (#4373)
Bumps [jspdf](https://github.com/parallax/jsPDF) and [jspdf-autotable](https://github.com/simonbengtsson/jsPDF-AutoTable). These dependencies needed to be updated together.

Updates `jspdf` from 3.0.2 to 4.1.0
- [Release notes](https://github.com/parallax/jsPDF/releases)
- [Changelog](https://github.com/parallax/jsPDF/blob/master/RELEASE.md)
- [Commits](https://github.com/parallax/jsPDF/compare/v3.0.2...v4.1.0)

Updates `jspdf-autotable` from 5.0.2 to 5.0.7
- [Release notes](https://github.com/simonbengtsson/jsPDF-AutoTable/releases)
- [Commits](https://github.com/simonbengtsson/jsPDF-AutoTable/compare/v5.0.2...v5.0.7)

---
updated-dependencies:
- dependency-name: jspdf
  dependency-version: 4.1.0
  dependency-type: direct:production
- dependency-name: jspdf-autotable
  dependency-version: 5.0.7
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-07 11:46:11 +00:00
dependabot[bot]
bee0c8e364 Bump lodash from 4.17.21 to 4.17.23 (#4369)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.21 to 4.17.23.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.21...4.17.23)

---
updated-dependencies:
- dependency-name: lodash
  dependency-version: 4.17.23
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-22 20:51:03 +01:00
jekkos
849439c71e Fix multiple XSS vulnerabilities (#3965) (#4356) 2025-12-22 17:21:49 +01:00
Chathura Dilushanka
25680f05db Add equals as permitted URI character (#4329)
This should resolve the 400 error when deleting payments with base64 encoded IDs containing `=`.
2025-12-21 22:41:36 +01:00
jekkos
a11fb099e2 Fix travis build after merge (#4130) 2025-12-21 19:51:21 +01:00
BhojKamal
aee5f31cf5 Add show/hide cost price & profit feature - in reports #4130 (#4350)
* Add show/hide cost price & profit feature

* .env should be ignored.

* js code formatted. .vscode folder ignore for vscode user settings.json

* style is replaced with bootstrap class, formatted and .env.example

* toggle button on table to like in other

* comment corrected.

* class re-factored

* minor refactor

* formatted with 4 space

---------

Co-authored-by: Lotussoft Youngtech <lotussoftyoungtech@gmail.com>
2025-12-21 15:23:39 +05:45
jekkos
643b0ac499 Fix for detailed suppliers report (#4351) 2025-12-17 22:46:59 +01:00
jekkos
3e844f2f89 Escape return_policy in receipt + invoice (#4349)
* Escape return_policy in receipt + invoice

* Enable CSRF using session token (#3632)
2025-12-17 20:39:58 +01:00
jekkos
2acdec431f Fix wrong migration script location (#4285) 2025-12-08 23:06:48 +01:00
jekkos
f245f585da Fix creation of date attribute value (#4310) (#4344)
Fix type hints in case search string is empty in sales
2025-12-02 07:19:14 +01:00
jekkos
e48ab45094 Fix toast notifications in config (#4341) (#4343) 2025-11-28 09:01:07 +01:00
jekkos
46e31b1c16 Allow anonymous giftcard creation (#4278)
* Allow giftcard without person (#4276)

* Update giftcard form validation (#4276)
2025-11-24 22:54:52 +01:00
jekkos
bea69c7aa1 Add DOMPurify to JS includes (#4341) 2025-11-23 22:20:40 +01:00
jekkos
30da69a382 Fix attachment cid (#4314)
* Add attachment cid when sending emails (#4308)

Also check if an encryption key is set before decrypting the SMTP
password.

* Upgrade to CI 4.6.3 (#4308)

* Fix for changing invoice id in email (#4308)
2025-11-23 21:37:32 +01:00
jekkos
6dd5a9162f Add DOMpurify + fix XSS (#4341) 2025-11-23 21:35:47 +01:00
jekkos
26a398f7d2 Add recent releases to issue template (#4317) 2025-11-21 23:55:24 +01:00
jekkos
ce73d9bb31 Add env variable to disallow pwd change (#4325) 2025-11-21 23:46:48 +01:00
jekkos
83af580d40 Add server side validation for password (#4335) 2025-11-21 23:45:47 +01:00
jekkos
ca7adf76c1 Update SECURITY.md contact (#4335) 2025-11-21 23:22:39 +01:00
jekkos
832db664e5 Fix tax configuration pages (#4331) 2025-11-21 22:13:35 +01:00
jekkos
36e73a84af Clean up docker compose setup (#4308) 2025-10-27 21:57:12 +01:00
Joe Williams
bcddf482fe [Feature] Add logging to migrations (#4327)
* `execute_script()` now returns a boolean for error handling.

* Added transaction to `Migration_MissingConfigKeys.up()`.

* Added logging to various migrations.

* Added transaction to `Migration_MissingConfigKeys.up()`.

* Added logging to various migrations.

* Formatting and function call fixes

Fixed a minor formatting issue in the migration helper.
Replaced a few remaining error_log() calls.
Updated executeScriptWithTransaction() to use log_message()

* Function call fix

Replaced the last error_log() calls with log_message().

---------

Co-authored-by: Joe Williams <hey-there-joe@outlook.com>
2025-10-19 22:10:28 -07:00
Joe Williams
759356288b Add transactions to missing config keys migration. (#4318)
* `execute_script()` now returns a boolean for error handling.

* Added transaction to `Migration_MissingConfigKeys.up()`.

* Added `executeScriptWithTransaction()` to migration helpers.

* Many changes for testing; also minor formatting fixes.

* Removed test code and pointed the `NullableTaxCategoryId` migration at the right SQL file.

* Fixed header.php

* Code cleanup from code review:
- Added IGNORE to SQL scripts.
- Added try-catch to executeScriptWithTransaction().
- Various comment changes.

* Fixed naming issue

Nullable tax category ID migration now runs the correct script.

* Updated SQL

Replaced INSERT WHERE NOT EXISTS in missing config keys sql script to use a single INSERT IGNORE.

* Updated migration helper

Updated executeScriptWithTransaction to use transRollback

---------

Co-authored-by: Joe Williams <hey-there-joe@outlook.com>
2025-10-15 22:53:14 -07:00
j2272850861-pixel
d1e5575ac1 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (8 of 8 strings)

Translation: opensourcepos/bootstrap_tables
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/bootstrap_tables/pt_BR/
2025-10-10 12:58:48 +02:00
j2272850861-pixel
b3f67a5e0f Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (85 of 85 strings)

Translation: opensourcepos/common
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/common/pt_BR/
2025-10-10 12:58:48 +02:00
j2272850861-pixel
41b349134a Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (12 of 12 strings)

Translation: opensourcepos/login
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/login/pt_BR/
2025-10-10 12:58:48 +02:00
jekkos
b1f6ae6d35 Fix mount path for uploads (#4308)
Remove duplicated compose sections in nginx version.  We will include
parts of the main file instead of duplicating it here.
2025-08-29 09:12:02 +02:00
dependabot[bot]
4153c69ccd Bump jspdf from 3.0.1 to 3.0.2 (#4309)
Bumps [jspdf](https://github.com/parallax/jsPDF) from 3.0.1 to 3.0.2.
- [Release notes](https://github.com/parallax/jsPDF/releases)
- [Changelog](https://github.com/parallax/jsPDF/blob/master/RELEASE.md)
- [Commits](https://github.com/parallax/jsPDF/compare/v3.0.1...v3.0.2)

---
updated-dependencies:
- dependency-name: jspdf
  dependency-version: 3.0.2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-29 07:32:54 +02:00
jekkos
87fbd72478 Add generic try/catch in import (#4302) 2025-08-28 00:05:58 +02:00
jekkos
a4ac42b4ad Fix reference to uploads folder (#4270) (#4286) 2025-08-18 21:19:36 +02:00
jekkos
2eff79a8b6 Fix for suspended sales (#4283) (#4303) 2025-08-15 23:12:35 +02:00
Aril Apria Susanto
880fb8faef Translated using Weblate (Indonesian)
Currently translated at 100.0% (327 of 327 strings)

Translation: opensourcepos/config
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/config/id/
2025-08-11 10:27:22 +02:00
Aril Apria Susanto
4d2347173b Translated using Weblate (Indonesian)
Currently translated at 100.0% (85 of 85 strings)

Translation: opensourcepos/common
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/common/id/
2025-08-11 10:27:22 +02:00
Aril Apria Susanto
82d36d01fb Translated using Weblate (Indonesian)
Currently translated at 100.0% (45 of 45 strings)

Translation: opensourcepos/module
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/module/id/
2025-08-11 10:27:22 +02:00
Aril Apria Susanto
13314b7da1 Translated using Weblate (Indonesian)
Currently translated at 100.0% (53 of 53 strings)

Translation: opensourcepos/customers
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/customers/id/
2025-08-11 10:27:22 +02:00
jekkos
43808c5970 Revert toast message sanitization (#4302) 2025-08-07 23:49:54 +02:00
jekkos
1615ef3832 Set release version to 3.4.2 2025-08-07 21:06:11 +02:00
jekkos
e089dc5e2c Fix item kits update (#4294) 2025-08-06 23:40:00 +02:00
jekkos
4cf70a95e6 Fix security incident email address (#4298) 2025-07-30 08:05:58 +02:00
jekkos
e08367aaae Allow empty tax category id (#4285) (#4288) 2025-07-29 23:59:23 +02:00
jekkos
9cd2f685ff Fix barcode generation in items (#4270) 2025-07-29 23:56:50 +02:00
jekkos
6800f338e7 Upgrade to ci 4.6.2 (#4296) (#4298) 2025-07-29 23:20:24 +02:00
jekkos
d4ab56b742 Fix migration 20250522000000 (#4284)
* Fix migration errors

Add dropColumnIfExists to migration_helper

* Add config key/values if missing (#4282)
2025-07-16 23:28:24 +02:00
jekkos
1eb75d6e05 Fix typo in writeable (#4270) 2025-07-11 23:23:13 +02:00
jekkos
8833420917 Upgrade github workflow (#3708) (#4280)
Co-authored-by: El_Coloso <diegoramosp@gmail.com>
2025-07-11 23:13:44 +02:00
jekkos
0d1f4efe3c Extended payment delete fix (#4274)
* Create a  Base64 URL-Safe encoding and decoding helper

* Rename web_helper to url_helper

---------

Co-authored-by: El_Coloso <diegoramosp@gmail.com>
2025-07-07 13:57:03 +02:00
jekkos
b9e17daac7 Fix writable folder permission check (#4270) (#4273) 2025-07-06 22:04:17 +02:00
125 changed files with 4600 additions and 5046 deletions

87
.env
View File

@@ -1,87 +0,0 @@
#--------------------------------------------------------------------
# ENVIRONMENT
#--------------------------------------------------------------------
CI_ENVIRONMENT = production
CI_DEBUG = false
#--------------------------------------------------------------------
# APP
#--------------------------------------------------------------------
app.appTimezone = 'UTC'
#--------------------------------------------------------------------
# DATABASE
#--------------------------------------------------------------------
database.default.hostname = 'localhost'
database.default.database = 'ospos'
database.default.username = 'admin'
database.default.password = 'pointofsale'
database.default.DBDriver = 'MySQLi'
database.default.DBPrefix = 'ospos_'
database.default.port = 3306
database.development.hostname = 'localhost'
database.development.database = 'ospos'
database.development.username = 'admin'
database.development.password = 'pointofsale'
database.development.DBDriver = 'MySQLi'
database.development.DBPrefix = 'ospos_'
database.development.port = 3306
database.tests.hostname = 'localhost'
database.tests.database = 'ospos'
database.tests.username = 'admin'
database.tests.password = 'pointofsale'
database.tests.DBDriver = 'MySQLi'
database.tests.DBPrefix = 'ospos_'
database.tests.charset = utf8mb4
database.tests.DBCollat = utf8mb4_general_ci
database.tests.port = 3306
#--------------------------------------------------------------------
# EMAIL
#--------------------------------------------------------------------
email.SMTPHost = ''
email.SMTPUser = ''
email.SMTPPass = ''
email.SMTPPort =
email.SMTPTimeout = 5
email.SMTPCrypto = 'tls'
#--------------------------------------------------------------------
# ENCRYPTION
#--------------------------------------------------------------------
encryption.key = ''
#--------------------------------------------------------------------
# HONEYPOT
#--------------------------------------------------------------------
honeypot.hidden = true
honeypot.label = 'Fill This Field'
honeypot.name = 'honeypot'
honeypot.template = '<label>{label}</label><input type="text" name="{name}" value="">'
honeypot.container = '<div style="display:none">{template}</div>'
#--------------------------------------------------------------------
# LOGGER
# - 0 = Disables logging, Error logging TURNED OFF
# - 1 = Emergency Messages - System is unusable
# - 2 = Alert Messages - Action Must Be Taken Immediately
# - 3 = Critical Messages - Application component unavailable, unexpected exception.
# - 4 = Runtime Errors - Don't need immediate action, but should be monitored.
# - 5 = Warnings - Exceptional occurrences that are not errors.
# - 6 = Notices - Normal but significant events.
# - 7 = Info - Interesting events, like user logging in, etc.
# - 8 = Debug - Detailed debug information.
# - 9 = All Messages
#--------------------------------------------------------------------
logger.threshold = 0
app.db_log_enabled = false
app.db_log_only_long = false

View File

View File

@@ -42,10 +42,12 @@ body:
label: OpensourcePOS Version
description: What version of our software are you running?
options:
- development (unreleased)
- opensourcepos 3.4.1
- opensourcepos 3.4.0
- opensourcepos 3.3.9
- opensourcepos 3.3.8
- opensourcepos 3.3.7
- development (unreleased)
default: 0
validations:
required: true

View File

@@ -28,8 +28,10 @@ jobs:
fail-fast: false
matrix:
php-version:
- '7.4'
- '8.0'
- '8.1'
- '8.2'
- '8.3'
- '8.4'
steps:
- name: Checkout

116
.github/workflows/unit-tests.yml vendored Normal file
View File

@@ -0,0 +1,116 @@
name: Unit Tests
on:
push:
paths:
- 'app/**/*.php'
- 'tests/**/*.php'
- '.github/workflows/unit-tests.yml'
pull_request:
paths:
- 'app/**/*.php'
- 'tests/**/*.php'
- '.github/workflows/unit-tests.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions:
contents: read
jobs:
test:
name: PHP ${{ matrix.php-version }} Unit Tests
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
php-version:
- '8.1'
- '8.2'
- '8.3'
services:
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: ospos_test
MYSQL_USER: ospos
MYSQL_PASSWORD: ospos
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping --silent"
--health-interval=10s
--health-timeout=5s
--health-retries=5
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: intl, mysqli, pdo_mysql, mbstring, json, dom, xml
coverage: xdebug
- name: Get composer cache directory
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ${{ env.COMPOSER_CACHE_FILES_DIR }}
key: ${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.php-version }}-
${{ runner.os }}-
- name: Install dependencies
run: composer install --no-progress --ansi --no-interaction
- name: Wait for MySQL
run: |
while ! mysqladmin ping -h"127.0.0.1" --silent; do
echo "Waiting for MySQL..."
sleep 1
done
- name: Setup test database
run: |
mysql -h 127.0.0.1 -u root -proot -e "CREATE DATABASE IF NOT EXISTS ospos_test CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
mysql -h 127.0.0.1 -u root -proot -e "GRANT ALL PRIVILEGES ON ospos_test.* TO 'ospos'@'%' IDENTIFIED BY 'ospos';"
mysql -h 127.0.0.1 -u root -proot -e "FLUSH PRIVILEGES;"
- name: Copy test environment config
run: |
if [ -f ".env.testing" ]; then
cp .env.testing .env
else
cp .env.example .env
fi
- name: Run migrations
run: php spark migrate --all || true
- name: Run unit tests
run: vendor/bin/phpunit --configuration tests/phpunit.xml --testsuite Helpers,Models,Controllers --colors=always --verbose
- name: Generate test report
if: always()
run: |
vendor/bin/phpunit --configuration tests/phpunit.xml --testsuite Helpers,Models,Controllers --log-junit build/logs/junit.xml --coverage-clover build/logs/clover.xml || true
echo "Test run completed"
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results-php-${{ matrix.php-version }}
path: build/logs/
retention-days: 30

1
.gitignore vendored
View File

@@ -8,6 +8,7 @@ public/license/*
!public/license/.gitkeep
app/Config/email.php
npm-debug.log*
.vscode
# Docker
!docker/.env

View File

@@ -15,13 +15,15 @@ script:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker run --rm -u $(id -u) -v $(pwd):/app opensourcepos/composer:ci4 composer install
- version=$(grep application_version app/Config/App.php | sed "s/.*=\s'\(.*\)';/\1/g")
- sed -i 's/production/development/g' .env
- cp .env.example .env && sed -i 's/production/development/g' .env
- sed -i "s/commit_sha1 = 'dev'/commit_sha1 = '$rev'/g" app/Config/OSPOS.php
- echo "$version-$branch-$rev"
- npm version "$version-$branch-$rev" --force || true
- sed -i 's/opensourcepos.tar.gz/opensourcepos.$version.tgz/g' package.json
- npm ci && npm install -g gulp && npm run build
- docker build . --target ospos -t ospos
- docker build . --target ospos_test -t ospos_test
- docker run --rm ospos_test /app/vendor/bin/phpunit --testdox
- docker build app/Database/ -t "jekkos/opensourcepos:sql-$TAG"
env:
global:

View File

@@ -1,4 +1,5 @@
[unreleased]: https://github.com/opensourcepos/opensourcepos/compare/3.4.0...HEAD
[3.4.2]: https://github.com/opensourcepos/opensourcepos/compare/3.4.1...3.4.2
[3.4.1]: https://github.com/opensourcepos/opensourcepos/compare/3.4.0...3.4.1
[3.4.0]: https://github.com/opensourcepos/opensourcepos/compare/3.3.9...3.4.0
[3.3.9]: https://github.com/opensourcepos/opensourcepos/compare/3.3.8...3.3.9

View File

@@ -22,7 +22,7 @@ RUN composer install -d/app
#RUN sed -i 's/backupGlobals="true"/backupGlobals="false"/g' /app/tests/phpunit.xml
WORKDIR /app/tests
CMD ["/app/vendor/phpunit/phpunit/phpunit"]
CMD ["/app/vendor/phpunit/phpunit/phpunit", "/app/test/helpers"]
FROM ospos AS ospos_dev

View File

@@ -14,7 +14,7 @@ First of all, if you're seeing the message `system folder missing` after launchi
2. Create/locate a new MySQL database to install Open Source Point of Sale into.
3. Execute the file `app/Database/database.sql` to create the tables needed.
4. Unzip and upload Open Source Point of Sale files to the web-server.
5. Open `.env` file and modify credentials to connect to your database if needed.
5. Open `.env` file and modify credentials to connect to your database if needed. (First copy .env.example to .env and update)
7. Go to your install `public` dir via the browser.
8. Log in using
- Username: admin
@@ -63,3 +63,39 @@ Do **not** use below command on live deployments unless you want to tear everyth
If you choose DigitalOcean:
[Through this link](https://m.do.co/c/ac38c262507b), you will get a [**free $100, 60-day credit**](https://m.do.co/c/ac38c262507b). [Check the wiki](https://github.com/opensourcepos/opensourcepos/wiki/Getting-Started-installations) for further instructions on how to install the necessary components.
## One-line Ubuntu Installation
For a fresh Ubuntu server (20.04 LTS or newer), you can install OSPOS directly with:
```bash
curl -sSL https://opensourcepos.org/install | sudo bash
```
> **Note:** This URL redirects to the latest installation script from the official repository. If the redirect is unavailable, use the direct GitHub URL:
> ```bash
> curl -sSL https://raw.githubusercontent.com/opensourcepos/opensourcepos/master/scripts/install-ubuntu.sh | sudo bash
> ```
This script will:
- Install Apache, MariaDB, PHP 8.2 and required extensions
- Create a MySQL database and user with a secure random password
- Download and configure OSPOS
- Set up Apache virtual host with proper permissions
- Display login credentials after completion
**Environment Variables (optional):**
- `DB_NAME` - Database name (default: ospos)
- `DB_USER` - Database user (default: ospos)
- `DB_PASS` - Database password (default: auto-generated)
- `OSPOS_DIR` - Installation directory (default: /var/www/ospos)
- `OSPOS_BRANCH` - Git branch to install (default: master)
- `PHP_VERSION` - PHP version (default: 8.2)
- `APACHE_SERVER_NAME` - Server hostname (default: localhost)
Example with custom settings:
```bash
curl -sSL https://opensourcepos.org/install | DB_PASS=mypassword APACHE_SERVER_NAME=pos.example.com sudo -E bash
```
**Note:** This script is designed for fresh servers. For production use, ensure you configure SSL/TLS certificates after installation.

View File

@@ -18,7 +18,8 @@ We release patches for security vulnerabilities. Which versions are eligible to
| --------- | -------------------------------------------------- |
| 7.3 | 3.3.5 |
| 9.8 | 3.3.6 |
| 6.8 | 3.4.2 |
## Reporting a Vulnerability
Please report (suspected) security vulnerabilities to **[jekkos@opensourcepos.org](mailto:jekkos@opensourcepos.org)**. You will receive a response from us within 48 hours. If the issue is confirmed, we will release a patch as soon as possible depending on complexity but historically within a few days.
Please report (suspected) security vulnerabilities to **[jeroen@steganos.dev](mailto:jeroen@steganos.dev)**. You will receive a response from us within 48 hours. If the issue is confirmed, we will release a patch as soon as possible depending on complexity but historically within a few days.

View File

@@ -12,7 +12,7 @@ class App extends BaseConfig
*
* @var string
*/
public string $application_version = '3.4.1';
public string $application_version = '3.4.2';
/**
* This is the commit hash for the version you are currently using.
@@ -117,7 +117,7 @@ class App extends BaseConfig
| DO NOT CHANGE THIS UNLESS YOU FULLY UNDERSTAND THE REPERCUSSIONS!!
|
*/
public string $permittedURIChars = 'a-z 0-9~%.:_\-';
public string $permittedURIChars = 'a-z 0-9~%.:_\-=';
/**
* --------------------------------------------------------------------------

View File

@@ -100,6 +100,7 @@ const CHECKBOX = 'CHECKBOX';
const NO_DEFINITION_ID = 0;
const CATEGORY_DEFINITION_ID = -1;
const DEFINITION_TYPES = [GROUP, DROPDOWN, DECIMAL, TEXT, DATE, CHECKBOX];
const ATTRIBUTE_VALUE_TYPES = ['attribute_value', 'attribute_decimal', 'attribute_date'];
/**
* Item Related Constants.

View File

@@ -70,7 +70,7 @@ class Filters extends BaseFilters
public array $globals = [
'before' => [
'honeypot',
// 'csrf' => ['except' => 'login'], // TODO: Temporarily disable CSRF until we get everything sorted
'csrf' => ['except' => 'login'],
'invalidchars',
],
'after' => [

View File

@@ -15,7 +15,7 @@ class Security extends BaseConfig
*
* @var string 'cookie' or 'session'
*/
public string $csrfProtection = 'cookie';
public string $csrfProtection = 'session';
/**
* --------------------------------------------------------------------------
@@ -71,7 +71,7 @@ class Security extends BaseConfig
*
* Regenerate CSRF Token on every submission.
*/
public bool $regenerate = true;
public bool $regenerate = false;
/**
* --------------------------------------------------------------------------

View File

@@ -2,11 +2,12 @@
namespace Config;
use CodeIgniter\Config\BaseService;
use CodeIgniter\HTTP\IncomingRequest;
use Config\Services as AppServices;
use Locale;
use HTMLPurifier;
use HTMLPurifier_Config;
use CodeIgniter\Config\BaseService;
use Config\Services as AppServices;
use CodeIgniter\HTTP\IncomingRequest;
/**
* Services Configuration file.

View File

@@ -119,7 +119,7 @@ class Attributes extends Secure_Controller
$definition_name = $definition_data['definition_name'];
if ($this->attribute->save_definition($definition_data, $definition_id)) {
if ($this->attribute->saveDefinition($definition_data, $definition_id)) {
// New definition
if ($definition_id == NO_DEFINITION_ID) {
$definition_values = json_decode(html_entity_decode($this->request->getPost('definition_values')));

View File

@@ -362,7 +362,7 @@ class Config extends Secure_Controller
*/
public function postSaveGeneral(): void
{
$batch_save_data = [
$batchSaveData = [
'theme' => $this->request->getPost('theme'),
'login_form' => $this->request->getPost('login_form'),
'default_sales_discount_type' => $this->request->getPost('default_sales_discount_type') != null,
@@ -393,19 +393,19 @@ class Config extends Secure_Controller
$this->module->set_show_office_group($this->request->getPost('show_office_group') != null);
if ($batch_save_data['category_dropdown'] == 1) {
$definition_data['definition_name'] = 'ospos_category';
$definition_data['definition_flags'] = 0;
$definition_data['definition_type'] = 'DROPDOWN';
$definition_data['definition_id'] = CATEGORY_DEFINITION_ID;
$definition_data['deleted'] = 0;
if ($batchSaveData['category_dropdown']) {
$definitionData['definition_name'] = 'ospos_category';
$definitionData['definition_flags'] = 0;
$definitionData['definition_type'] = 'DROPDOWN';
$definitionData['definition_id'] = CATEGORY_DEFINITION_ID;
$definitionData['deleted'] = 0;
$this->attribute->save_definition($definition_data, CATEGORY_DEFINITION_ID);
} elseif ($batch_save_data['category_dropdown'] == NO_DEFINITION_ID) {
$this->attribute->saveDefinition($definitionData, CATEGORY_DEFINITION_ID);
} elseif ($batchSaveData['category_dropdown'] == NO_DEFINITION_ID) {
$this->attribute->deleteDefinition(CATEGORY_DEFINITION_ID);
}
$success = $this->appconfig->batch_save($batch_save_data);
$success = $this->appconfig->batch_save($batchSaveData);
echo json_encode(['success' => $success, 'message' => lang('Config.saved_' . ($success ? '' : 'un') . 'successfully')]);
}

View File

@@ -125,7 +125,7 @@ class Giftcards extends Secure_Controller
'record_time' => date('Y-m-d H:i:s'),
'giftcard_number' => $giftcard_number,
'value' => parse_decimals($this->request->getPost('giftcard_amount')),
'person_id' => $this->request->getPost('person_id') == '' ? null : $this->request->getPost('person_id', FILTER_SANITIZE_NUMBER_INT)
'person_id' => empty($this->request->getPost('person_id')) ? null : $this->request->getPost('person_id', FILTER_SANITIZE_NUMBER_INT)
];
if ($this->giftcard->save_value($giftcard_data, $giftcard_id)) {
@@ -160,9 +160,12 @@ class Giftcards extends Secure_Controller
*/
public function postCheckNumberGiftcard(): void
{
$giftcard_amount = parse_decimals($this->request->getPost('giftcard_amount'));
$parsed_value = filter_var($giftcard_amount, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);
echo json_encode(['success' => $parsed_value !== false && $parsed_value > 0 && $giftcard_amount !== false, 'giftcard_amount' => to_currency_no_money($parsed_value)]);
$existing_id = $this->request->getPost('giftcard_id', FILTER_SANITIZE_NUMBER_INT);
$giftcard_number = $this->request->getPost('giftcard_number', FILTER_SANITIZE_NUMBER_INT);
$giftcard_id = $this->giftcard->get_giftcard_id($giftcard_number);
$success = ($giftcard_id == (int) $existing_id || !$giftcard_id );
echo $success ? 'true' : 'false';
}
/**

View File

@@ -61,7 +61,7 @@ class Home extends Secure_Controller
'hash_version' => 2
];
if ($this->employee->change_password($employee_data, $employee_id)) {
if ($this->employee->change_password($employee_data, $employee_id) && strlen($employee_data['password']) >= 8) {
echo json_encode([
'success' => true,
'message' => lang('Employees.successful_change_password'),

View File

@@ -165,7 +165,7 @@ class Item_kits extends Secure_Controller
$item_kit_data = [
'name' => $this->request->getPost('name'),
'item_kit_number' => $this->request->getPost('item_kit_number'),
'item_id' => $this->request->getPost('kit_item_id') ? null : intval($this->request->getPost('kit_item_id')),
'item_id' => $this->request->getPost('kit_item_id'),
'kit_discount' => parse_decimals($this->request->getPost('kit_discount')),
'kit_discount_type' => $this->request->getPost('kit_discount_type') === null ? PERCENT : intval($this->request->getPost('kit_discount_type')),
'price_option' => $this->request->getPost('price_option') === null ? PRICE_ALL : intval($this->request->getPost('price_option')),

View File

@@ -4,7 +4,6 @@ namespace App\Controllers;
use App\Libraries\Barcode_lib;
use App\Libraries\Item_lib;
use App\Models\Attribute;
use App\Models\Inventory;
use App\Models\Item;
@@ -14,11 +13,11 @@ use App\Models\Item_taxes;
use App\Models\Stock_location;
use App\Models\Supplier;
use App\Models\Tax_category;
use CodeIgniter\Images\Handlers\BaseHandler;
use CodeIgniter\HTTP\DownloadResponse;
use Config\OSPOS;
use Config\Services;
use Exception;
use ReflectionException;
require_once('Secure_Controller.php');
@@ -493,7 +492,7 @@ class Items extends Secure_Controller
$data['definition_names'] = $this->attribute->get_definition_names();
foreach ($data['definition_values'] as $definition_id => $definition_value) {
$attribute_value = $this->attribute->get_attribute_value($item_id, $definition_id);
$attribute_value = $this->attribute->getAttributeValue($item_id, $definition_id);
$attribute_id = (empty($attribute_value) || empty($attribute_value->attribute_id)) ? null : $attribute_value->attribute_id;
$values = &$data['definition_values'][$definition_id];
$values['attribute_id'] = $attribute_id;
@@ -529,7 +528,7 @@ class Items extends Secure_Controller
$data['definition_names'] = $this->attribute->get_definition_names();
foreach ($data['definition_values'] as $definition_id => $definition_value) {
$attribute_value = $this->attribute->get_attribute_value($item_id, $definition_id);
$attribute_value = $this->attribute->getAttributeValue($item_id, $definition_id);
$attribute_id = (empty($attribute_value) || empty($attribute_value->attribute_id)) ? null : $attribute_value->attribute_id;
$values = &$data['definition_values'][$definition_id];
$values['attribute_id'] = $attribute_id;
@@ -635,10 +634,10 @@ class Items extends Secure_Controller
$item_data['reorder_level'] = 0;
}
$tax_category_id = intval($this->request->getPost('tax_category_id'));
$tax_category_id = $this->request->getPost('tax_category_id');
if (!isset($tax_category_id)) {
$item_data['tax_category_id'] = '';
$item_data['tax_category_id'] = null;
} else {
$item_data['tax_category_id'] = empty($this->request->getPost('tax_category_id')) ? null : intval($this->request->getPost('tax_category_id'));
}
@@ -918,7 +917,7 @@ class Items extends Secure_Controller
*/
public function getGenerateCsvFile(): DownloadResponse
{
helper('importfile_helper');
helper('importfile');
$name = 'import_items.csv';
$allowed_locations = $this->stock_location->get_allowed_locations();
$allowed_attributes = $this->attribute->get_definition_names();
@@ -938,169 +937,207 @@ class Items extends Secure_Controller
/**
* Imports items from CSV formatted file.
* @throws ReflectionException
* @noinspection PhpUnused
*/
public function postImportCsvFile(): void
{
helper('importfile_helper');
if ($_FILES['file_path']['error'] !== UPLOAD_ERR_OK) {
echo json_encode(['success' => false, 'message' => lang('Items.csv_import_failed')]);
} else {
if (file_exists($_FILES['file_path']['tmp_name'])) {
set_time_limit(240);
$failCodes = [];
$csv_rows = get_csv_file($_FILES['file_path']['tmp_name']);
$employee_id = $this->employee->get_logged_in_employee_info()->person_id;
$allowed_stock_locations = $this->stock_location->get_allowed_locations();
$attribute_definition_names = $this->attribute->get_definition_names();
unset($attribute_definition_names[NEW_ENTRY]); // Removes the common_none_selected_text from the array
$attribute_data = [];
foreach ($attribute_definition_names as $definition_name) {
$attribute_data[$definition_name] = $this->attribute->get_definition_by_name($definition_name)[0];
if ($attribute_data[$definition_name]['definition_type'] === DROPDOWN) {
$attribute_data[$definition_name]['dropdown_values'] = $this->attribute->get_definition_values($attribute_data[$definition_name]['definition_id']);
}
}
$db = db_connect();
$db->transBegin(); // TODO: This section needs to be reworked so that the data array is being created then passed to the Item model because $db doesn't exist in the controller without being instantiated, but database operations should be restricted to the model
foreach ($csv_rows as $key => $row) {
$is_failed_row = false;
$item_id = (int)$row['Id'];
$is_update = ($item_id > 0);
$item_data = [
'item_id' => $item_id,
'name' => $row['Item Name'],
'description' => $row['Description'],
'category' => $row['Category'],
'cost_price' => $row['Cost Price'],
'unit_price' => $row['Unit Price'],
'reorder_level' => $row['Reorder Level'],
'deleted' => false,
'hsn_code' => $row['HSN'],
'pic_filename' => $row['Image']
];
if (!empty($row['supplier ID'])) {
$item_data['supplier_id'] = $this->supplier->exists($row['Supplier ID']) ? $row['Supplier ID'] : null;
}
if ($is_update) {
$item_data['allow_alt_description'] = empty($row['Allow Alt Description']) ? null : $row['Allow Alt Description'];
$item_data['is_serialized'] = empty($row['Item has Serial Number']) ? null : $row['Item has Serial Number'];
} else {
$item_data['allow_alt_description'] = empty($row['Allow Alt Description']) ? '0' : '1';
$item_data['is_serialized'] = empty($row['Item has Serial Number']) ? '0' : '1';
}
if (!empty($row['Barcode']) && !$is_update) {
$item_data['item_number'] = $row['Barcode'];
$is_failed_row = $this->item->item_number_exists($item_data['item_number']);
}
if (!$is_failed_row) {
$is_failed_row = $this->data_error_check($row, $item_data, $allowed_stock_locations, $attribute_definition_names, $attribute_data);
}
// Remove false, null, '' and empty strings but keep 0
$item_data = array_filter($item_data, function ($value) {
return $value !== null && strlen($value);
});
if (!$is_failed_row && $this->item->save_value($item_data, $item_id)) {
$this->save_tax_data($row, $item_data);
$this->save_inventory_quantities($row, $item_data, $allowed_stock_locations, $employee_id);
$is_failed_row = $this->save_attribute_data($row, $item_data, $attribute_data); // TODO: $is_failed_row never gets used after this.
if ($is_update) {
$item_data = array_merge($item_data, get_object_vars($this->item->get_info_by_id_or_number($item_id)));
}
} else {
$failed_row = $key + 2;
$failCodes[] = $failed_row;
log_message('error', "CSV Item import failed on line $failed_row. This item was not imported.");
}
unset($csv_rows[$key]);
}
$csv_rows = null;
if (count($failCodes) > 0) {
$message = lang('Items.csv_import_partially_failed', [count($failCodes), implode(', ', $failCodes)]);
$db->transRollback();
echo json_encode(['success' => false, 'message' => $message]);
} else {
$db->transCommit();
echo json_encode(['success' => true, 'message' => lang('Items.csv_import_success')]);
}
helper('importfile');
try {
if ($_FILES['file_path']['error'] !== UPLOAD_ERR_OK) {
echo json_encode(['success' => false, 'message' => lang('Items.csv_import_failed')]);
} else {
echo json_encode(['success' => false, 'message' => lang('Items.csv_import_nodata_wrongformat')]);
if (file_exists($_FILES['file_path']['tmp_name'])) {
set_time_limit(240);
$failCodes = [];
$csvRows = get_csv_file($_FILES['file_path']['tmp_name']);
$employeeId = $this->employee->get_logged_in_employee_info()->person_id;
$allowedStockLocations = $this->stock_location->get_allowed_locations();
$attributeDefinitionNames = $this->attribute->get_definition_names();
unset($attributeDefinitionNames[NEW_ENTRY]); // Removes the common_none_selected_text from the array
$attributeData = [];
foreach ($attributeDefinitionNames as $definitionName) {
$attributeData[$definitionName] = $this->attribute->get_definition_by_name($definitionName)[0];
if ($attributeData[$definitionName]['definition_type'] === DROPDOWN) {
$attributeData[$definitionName]['dropdown_values'] = $this->attribute->get_definition_values($attributeData[$definitionName]['definition_id']);
}
}
$db = db_connect();
$db->transBegin(); // TODO: This section needs to be reworked so that the data array is being created then passed to the Item model because $db doesn't exist in the controller without being instantiated, but database operations should be restricted to the model
foreach ($csvRows as $key => $row) {
$isFailedRow = false;
$itemId = (int)$row['Id'];
$isUpdate = ($itemId > 0);
$itemData = [
'item_id' => $itemId,
'name' => $row['Item Name'],
'description' => $row['Description'],
'category' => $row['Category'],
'cost_price' => $row['Cost Price'],
'unit_price' => $row['Unit Price'],
'reorder_level' => $row['Reorder Level'],
'deleted' => false,
'hsn_code' => $row['HSN'],
'pic_filename' => $row['Image']
];
if (!empty($row['supplier ID'])) {
$itemData['supplier_id'] = $this->supplier->exists($row['Supplier ID']) ? $row['Supplier ID'] : null;
}
if ($isUpdate) {
$itemData['allow_alt_description'] = empty($row['Allow Alt Description']) ? null : $row['Allow Alt Description'];
$itemData['is_serialized'] = empty($row['Item has Serial Number']) ? null : $row['Item has Serial Number'];
} else {
$itemData['allow_alt_description'] = empty($row['Allow Alt Description']) ? '0' : '1';
$itemData['is_serialized'] = empty($row['Item has Serial Number']) ? '0' : '1';
}
if (!empty($row['Barcode'])) {
$itemData['item_number'] = $row['Barcode'];
$isFailedRow = $this->item->item_number_exists($itemData['item_number']);
}
if (!$isFailedRow) {
$invalidLocations = $this->validateCSVStockLocations($row, $allowedStockLocations);
if (!empty($invalidLocations)) {
$isFailedRow = true;
log_message('error', 'CSV import: Invalid stock location(s) found: ' . implode(', ', $invalidLocations));
}
}
if (!$isFailedRow) {
$isFailedRow = $this->validateCSVData($row, $itemData, $allowedStockLocations, $attributeDefinitionNames, $attributeData);
}
// Remove false, null, '' and empty strings but keep 0
$itemData = array_filter($itemData, function ($value) {
return $value !== null && strlen($value);
});
if (!$isFailedRow && $this->item->save_value($itemData, $itemId)) {
$this->save_tax_data($row, $itemData);
$this->save_inventory_quantities($row, $itemData, $allowedStockLocations, $employeeId);
$isFailedRow = $this->saveAttributeData($row, $itemData, $attributeData); // TODO: $is_failed_row never gets used after this.
if ($isUpdate) {
$itemData = array_merge($itemData, get_object_vars($this->item->get_info_by_id_or_number($itemId)));
}
} else {
$failedRow = $key + 2;
$failCodes[] = $failedRow;
log_message('error', "CSV Item import failed on line $failedRow. This item was not imported.");
}
unset($csvRows[$key]);
}
$csvRows = null;
if (count($failCodes) > 0) {
$message = lang('Items.csv_import_partially_failed', [count($failCodes), implode(', ', $failCodes)]);
$db->transRollback();
echo json_encode(['success' => false, 'message' => $message]);
} else {
$db->transCommit();
$this->attribute->deleteOrphanedValues();
echo json_encode(['success' => true, 'message' => lang('Items.csv_import_success')]);
}
} else {
echo json_encode(['success' => false, 'message' => lang('Items.csv_import_nodata_wrongformat')]);
}
}
} catch (Exception $e) {
echo json_encode(['success' => false, 'message' => $e->getMessage()]);
return;
}
}
/**
* Validates that stock location columns in CSV row are valid locations
*
* @param array $row
* @param array $allowedLocations
* @return array Returns array of invalid location names, empty if all valid
*/
private function validateCSVStockLocations(array $row, array $allowedLocations): array
{
$invalidLocations = [];
$allowedLocationNames = array_values($allowedLocations);
foreach (array_keys($row) as $key) {
if (str_starts_with($key, 'location_')) {
$locationName = substr($key, 9);
if (!in_array($locationName, $allowedLocationNames)) {
$invalidLocations[] = $locationName;
}
}
}
return $invalidLocations;
}
/**
* Checks the entire line of data in an import file for errors
*
* @param array $row
* @param array $item_data
* @param array $allowed_locations
* @param array $definition_names
* @param array $attribute_data
* @param array $itemData
* @param array $allowedLocations
* @param array $definitionNames
* @param array $attributeData
* @return bool Returns false if all data checks out and true when there is an error in the data
*/
private function data_error_check(array $row, array $item_data, array $allowed_locations, array $definition_names, array $attribute_data): bool // TODO: Long function and large number of parameters in the declaration... perhaps refactoring is needed
private function validateCSVData(array $row, array $itemData, array $allowedLocations, array $definitionNames, array $attributeData): bool // TODO: Long function and large number of parameters in the declaration... perhaps refactoring is needed
{
$item_id = $row['Id'];
$is_update = (bool)$item_id;
$itemId = $row['Id'];
$isUpdate = (bool)$itemId;
// Check for empty required fields
$check_for_empty = [
'name' => $item_data['name'],
'category' => $item_data['category'],
'unit_price' => $item_data['unit_price']
$valuesToCheckForEmpty = [
'name' => $itemData['name'],
'category' => $itemData['category'],
'unit_price' => $itemData['unit_price']
];
foreach ($check_for_empty as $key => $val) {
if (empty($val) && !$is_update) {
foreach ($valuesToCheckForEmpty as $key => $val) {
if (empty($val) && !$isUpdate) {
log_message('error', "Empty required value in $key.");
return true;
}
}
if (!$is_update) {
$item_data['cost_price'] = empty($item_data['cost_price']) ? 0 : $item_data['cost_price']; // Allow for zero wholesale price
if (!$isUpdate) {
$itemData['cost_price'] = empty($itemData['cost_price']) ? 0 : $itemData['cost_price']; // Allow for zero wholesale price
} else {
if (!$this->item->exists($item_id)) {
log_message('error', "non-existent item_id: '$item_id' when either existing item_id or no item_id is required.");
if (!$this->item->exists($itemId)) {
log_message('error', "non-existent item_id: '$itemId' when either existing item_id or no item_id is required.");
return true;
}
}
// Build array of fields to check for numerics
$check_for_numeric_values = [
'cost_price' => $item_data['cost_price'],
'unit_price' => $item_data['unit_price'],
'reorder_level' => $item_data['reorder_level'],
$valuesToCheckForNumeric = [
'cost_price' => $itemData['cost_price'],
'unit_price' => $itemData['unit_price'],
'reorder_level' => $itemData['reorder_level'],
'supplier_id' => $row['Supplier ID'],
'Tax 1 Percent' => $row['Tax 1 Percent'],
'Tax 2 Percent' => $row['Tax 2 Percent']
];
foreach ($allowed_locations as $location_name) {
$check_for_numeric_values[] = $row["location_$location_name"];
foreach ($allowedLocations as $location_name) {
$valuesToCheckForNumeric[] = $row["location_$location_name"];
}
// Check for non-numeric values which require numeric
foreach ($check_for_numeric_values as $key => $value) {
foreach ($valuesToCheckForNumeric as $key => $value) {
if (!is_numeric($value) && !empty($value)) {
log_message('error', "non-numeric: '$value' for '$key' when numeric is required");
return true;
@@ -1108,30 +1145,34 @@ class Items extends Secure_Controller
}
// Check Attribute Data
foreach ($definition_names as $definition_name) {
if (!empty($row["attribute_$definition_name"])) {
$definition_type = $attribute_data[$definition_name]['definition_type'];
$attribute_value = $row["attribute_$definition_name"];
foreach ($definitionNames as $definitionName) {
if (!empty($row["attribute_$definitionName"])) {
$definitionType = $attributeData[$definitionName]['definition_type'];
$attributeValue = $row["attribute_$definitionName"];
switch ($definition_type) {
if (strcasecmp($attributeValue, '_DELETE_') === 0) {
continue;
}
switch ($definitionType) {
case DROPDOWN:
$dropdown_values = $attribute_data[$definition_name]['dropdown_values'];
$dropdown_values[] = '';
$dropdownValues = $attributeData[$definitionName]['dropdown_values'];
$dropdownValues[] = '';
if (!empty($attribute_value) && !in_array($attribute_value, $dropdown_values)) {
log_message('error', "Value: '$attribute_value' is not an acceptable DROPDOWN value");
if (!empty($attributeValue) && !in_array($attributeValue, $dropdownValues)) {
log_message('error', "Value: '$attributeValue' is not an acceptable DROPDOWN value");
return true;
}
break;
case DECIMAL:
if (!is_numeric($attribute_value) && !empty($attribute_value)) {
log_message('error', "'$attribute_value' is not an acceptable DECIMAL value");
if (!is_numeric($attributeValue) && !empty($attributeValue)) {
log_message('error', "'$attributeValue' is not an acceptable DECIMAL value");
return true;
}
break;
case DATE:
if (!valid_date($attribute_value) && !empty($attribute_value)) {
log_message('error', "'$attribute_value' is not an acceptable DATE value. The value must match the set locale.");
if (!valid_date($attributeValue) && !empty($attributeValue)) {
log_message('error', "'$attributeValue' is not an acceptable DATE value. The value must match the set locale.");
return true;
}
break;
@@ -1143,28 +1184,36 @@ class Items extends Secure_Controller
}
/**
* Saves attribute data found in the CSV import.
* Saves attribute data found in one row of a CSV import file. Loops through all attribute definitions and checks
* if there is data for that attribute in the row. If there is, it saves the attribute value and link to the item.
*
* @param array $row
* @param array $item_data
* @param array $definitions
* @return bool
* @param array $row Contains all parsed data from one row of the CSV import file
* @param array $itemData Contains data for the item being imported/updated from the CSV file.
* @param array $definitions Contains all attribute definitions in the system.
* @return bool Returns false if all attribute data saves correctly and true if there is an error saving any of
* the attribute data.
*/
private function save_attribute_data(array $row, array $item_data, array $definitions): bool
private function saveAttributeData(array $row, array $itemData, array $definitions): bool
{
helper('attribute');
foreach ($definitions as $definition) {
$attribute_name = $definition['definition_name'];
$attribute_value = $row["attribute_$attribute_name"];
$attributeName = $definition['definition_name'];
$attributeValue = $row["attribute_$attributeName"];
if (isset($attributeValue) && strcasecmp($attributeValue, '_DELETE_') === 0) {
$this->attribute->deleteAttributeLinks($itemData['item_id'], $definition['definition_id']);
continue;
}
// Create attribute value
if (!empty($attribute_value) || $attribute_value === '0') {
if (!empty($attributeValue) || $attributeValue === '0') {
if ($definition['definition_type'] === CHECKBOX) {
$checkbox_is_unchecked = (strcasecmp($attribute_value, 'false') === 0 || $attribute_value === '0');
$attribute_value = $checkbox_is_unchecked ? '0' : '1';
$checkbox_is_unchecked = (strcasecmp($attributeValue, 'false') === 0 || $attributeValue === '0');
$attributeValue = $checkbox_is_unchecked ? '0' : '1';
$attribute_id = $this->store_attribute_value($attribute_value, $definition, $item_data['item_id']);
} elseif (!empty($attribute_value)) {
$attribute_id = $this->store_attribute_value($attribute_value, $definition, $item_data['item_id']);
$attribute_id = $this->storeAttributeValue($attributeValue, $definition, $itemData['item_id']);
} elseif (!empty($attributeValue)) {
$attribute_id = $this->storeAttributeValue($attributeValue, $definition, $itemData['item_id']);
} else {
return true;
}
@@ -1179,20 +1228,36 @@ class Items extends Secure_Controller
/**
* Saves the attribute_value and attribute_link if necessary
* @param string $value
* @param array $attributeData
* @param int $itemId
* @return bool|int
*/
private function store_attribute_value(string $value, array $attribute_data, int $item_id)
private function storeAttributeValue(string $value, array $attributeData, int $itemId): bool|int
{
$attribute_id = $this->attribute->attributeValueExists($value, $attribute_data['definition_type']);
$attributeId = $this->attribute->attributeValueExists($value, $attributeData['definition_type']);
$this->attribute->deleteAttributeLinks($item_id, $attribute_data['definition_id']);
$this->attribute->deleteAttributeLinks($itemId, $attributeData['definition_id']);
if (!$attribute_id) {
$attribute_id = $this->attribute->saveAttributeValue($value, $attribute_data['definition_id'], $item_id, false, $attribute_data['definition_type']);
} elseif (!$this->attribute->saveAttributeLink($item_id, $attribute_data['definition_id'], $attribute_id)) {
return false;
if (!$attributeId) {
$attributeId = $this->attribute->saveAttributeValue($value, $attributeData['definition_id'], $itemId, false, $attributeData['definition_type']);
} else {
helper('attribute');
$dataType = getAttributeDataType($attributeData['definition_type']);
$storedValue = $this->attribute->getAttributeValueByAttributeId($attributeId, $dataType);
// Update attribute value if only the case has changed and only for text values.
if ($dataType === 'attribute_value'
&& is_string($storedValue)
&& strcasecmp($storedValue, $value) === 0
&& $storedValue !== $value) {
$attributeId = $this->attribute->saveAttributeValue($value, $attributeData['definition_id'], $itemId, $attributeId, $attributeData['definition_type']);
} elseif (!$this->attribute->saveAttributeLink($itemId, $attributeData['definition_id'], $attributeId)) {
return false;
}
}
return $attribute_id;
return $attributeId;
}
/**
@@ -1303,16 +1368,17 @@ class Items extends Secure_Controller
switch ($definitionType) {
case DROPDOWN:
$attributeId = $attributeValue;
$this->attribute->saveAttributeLink($itemId, $definitionId, $attributeId);
break;
case DECIMAL:
$attributeValue = parse_decimals($attributeValue);
// Fall through to save the attribute value
// no break
default:
$attributeId = $this->attribute->saveAttributeValue($attributeValue, $definitionId, $itemId, $attributeIds[$definitionId], $definitionType);
break;
}
$this->attribute->saveAttributeLink($itemId, $definitionId, $attributeId);
}
$this->attribute->deleteOrphanedValues();
}
}

View File

@@ -1727,7 +1727,7 @@ class Reports extends Secure_Controller
];
}
$supplier_info = $this->supplier->get_info($supplier_id);
$supplier_info = $this->supplier->get_info((int) $supplier_id);
$data = [
'title' => $supplier_info->company_name . ' (' . $supplier_info->first_name . ' ' . $supplier_info->last_name . ') ' . lang('Reports.report'),
'subtitle' => $this->_get_subtitle_report(['start_date' => $start_date, 'end_date' => $end_date]),

View File

@@ -399,7 +399,7 @@ class Sales extends Secure_Controller
$cur_giftcard_customer = $giftcard->get_giftcard_customer($giftcard_num);
$customer_id = $this->sale_lib->get_customer();
if (isset($cur_giftcard_customer) && $cur_giftcard_customer != $customer_id) {
if (isset($cur_giftcard_customer) && $cur_giftcard_customer != $customer_id && $cur_giftcard_customer != null) {
$data['error'] = lang('Giftcards.cannot_use', [$giftcard_num]);
} elseif (($cur_giftcard_value - $current_payments_with_giftcard) <= 0 && $this->sale_lib->get_mode() === 'sale') {
$data['error'] = lang('Giftcards.remaining_balance', [$giftcard_num, $cur_giftcard_value]);
@@ -417,7 +417,6 @@ class Sales extends Secure_Controller
$customer_id = $this->sale_lib->get_customer();
$package_id = $this->customer->get_info($customer_id)->package_id;
if (!empty($package_id)) {
$package_name = $this->customer_rewards->get_name($package_id); // TODO: this variable is never used.
$points = $this->customer->get_info($customer_id)->points;
$points = ($points == null ? 0 : $points);
@@ -466,7 +465,9 @@ class Sales extends Secure_Controller
*/
public function getDeletePayment(string $payment_id): void
{
$this->sale_lib->delete_payment(base64_decode($payment_id));
helper('url');
$this->sale_lib->delete_payment(base64url_decode($payment_id));
$this->_reload(); // TODO: Hungarian notation
}

View File

@@ -3,7 +3,7 @@
namespace App\Controllers;
use App\Libraries\Tax_lib;
use App\Models\enums\Rounding_mode;
use App\Models\Enums\Rounding_mode;
use App\Models\Tax;
use App\Models\Tax_category;
use App\Models\Tax_code;
@@ -150,7 +150,7 @@ class Taxes extends Secure_Controller
$data['default_tax_type'] = Tax_lib::TAX_TYPE_EXCLUDED;
}
$data['rounding_options'] = rounding_mode::get_rounding_options();
$data['rounding_options'] = Rounding_mode::get_rounding_options();
$data['html_rounding_options'] = $this->get_html_rounding_options();
if ($tax_code == NEW_ENTRY) { // TODO: Duplicated code
@@ -205,7 +205,7 @@ class Taxes extends Secure_Controller
$tax_rate_info = $this->tax->get_info($tax_rate_id);
$data['tax_rate_id'] = $tax_rate_id;
$data['rounding_options'] = rounding_mode::get_rounding_options();
$data['rounding_options'] = Rounding_mode::get_rounding_options();
$data['tax_code_options'] = $this->tax_lib->get_tax_code_options();
$data['tax_category_options'] = $this->tax_lib->get_tax_category_options();
@@ -215,7 +215,7 @@ class Taxes extends Secure_Controller
$data['rate_tax_code_id'] = $this->config['default_tax_code'];
$data['rate_tax_category_id'] = $this->config['default_tax_category'];
$data['rate_jurisdiction_id'] = $this->config['default_tax_jurisdiction'];
$data['tax_rounding_code'] = rounding_mode::HALF_UP;
$data['tax_rounding_code'] = Rounding_mode::HALF_UP;
$data['tax_rate'] = '0.0000';
} else {
$data['rate_tax_code_id'] = $tax_rate_info->rate_tax_code_id;
@@ -242,7 +242,7 @@ class Taxes extends Secure_Controller
$tax_rate_info = $this->tax->get_rate_info($tax_code, $default_tax_category_id);
$data['rounding_options'] = rounding_mode::get_rounding_options();
$data['rounding_options'] = Rounding_mode::get_rounding_options();
$data['html_rounding_options'] = $this->get_html_rounding_options();
if ($this->config['tax_included']) {
@@ -306,7 +306,7 @@ class Taxes extends Secure_Controller
$tax_rate_info = $this->tax->get_rate_info($tax_code, $default_tax_category_id);
$data['rounding_options'] = rounding_mode::get_rounding_options();
$data['rounding_options'] = Rounding_mode::get_rounding_options();
$data['html_rounding_options'] = $this->get_html_rounding_options();
if ($this->config['tax_included']) {
@@ -362,7 +362,7 @@ class Taxes extends Secure_Controller
*/
public static function get_html_rounding_options(): string
{
return rounding_mode::get_html_rounding_options();
return Rounding_mode::get_html_rounding_options();
}
/**
@@ -431,7 +431,7 @@ class Taxes extends Secure_Controller
* @return void
* @noinspection PhpUnused
*/
public function save_tax_codes(): void
public function postSave_tax_codes(): void
{
$tax_code_id = $this->request->getPost('tax_code_id', FILTER_SANITIZE_NUMBER_INT);
$tax_code = $this->request->getPost('tax_code', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
@@ -464,7 +464,7 @@ class Taxes extends Secure_Controller
* @return void
* @noinspection PhpUnused
*/
public function save_tax_jurisdictions(): void
public function postSave_tax_jurisdictions(): void
{
$jurisdiction_id = $this->request->getPost('jurisdiction_id', FILTER_SANITIZE_NUMBER_INT);
$jurisdiction_name = $this->request->getPost('jurisdiction_name', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
@@ -513,7 +513,7 @@ class Taxes extends Secure_Controller
* @return void
* @noinspection PhpUnused
*/
public function save_tax_categories(): void
public function postSave_tax_categories(): void
{
$tax_category_id = $this->request->getPost('tax_category_id', FILTER_SANITIZE_NUMBER_INT);
$tax_category = $this->request->getPost('tax_category', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
@@ -543,7 +543,7 @@ class Taxes extends Secure_Controller
* @return void
* @noinspection PhpUnused
*/
public function ajax_tax_codes(): void
public function getAjax_tax_codes(): void
{
$tax_codes = $this->tax_code->get_all()->getResultArray();
@@ -556,7 +556,7 @@ class Taxes extends Secure_Controller
* @return void
* @noinspection PhpUnused
*/
public function ajax_tax_categories(): void
public function getAjax_tax_categories(): void
{
$tax_categories = $this->tax_category->get_all()->getResultArray();
@@ -569,7 +569,7 @@ class Taxes extends Secure_Controller
* @return void
* @noinspection PhpUnused
*/
public function ajax_tax_jurisdictions(): void
public function getAjax_tax_jurisdictions(): void
{
$tax_jurisdictions = $this->tax_jurisdiction->get_all()->getResultArray();

View File

@@ -34,7 +34,7 @@ class Migration_Sales_Tax_Data extends Migration
public function up(): void
{
$number_of_unmigrated = $this->get_count_of_unmigrated();
error_log("Migrating sales tax history. The number of sales that will be migrated is $number_of_unmigrated");
log_message('info', "Migrating sales tax history. The number of sales that will be migrated is $number_of_unmigrated");
if ($number_of_unmigrated > 0) {
$unmigrated_invoices = $this->get_unmigrated($number_of_unmigrated)->getResultArray();
@@ -44,7 +44,7 @@ class Migration_Sales_Tax_Data extends Migration
}
}
error_log('Migrating sales tax history. The number of sales that will be migrated is finished.');
log_message('info', 'Migrating sales tax history. The number of sales that will be migrated is finished.');
}
/**
@@ -146,7 +146,7 @@ class Migration_Sales_Tax_Data extends Migration
. ' ORDER BY SIT.sale_id) as US')->getResultArray();
if (!$result) {
error_log('Database error in 20170502221506_sales_tax_data.php related to sales_taxes or sales_items_taxes.');
log_message('info', 'Database error in 20170502221506_sales_tax_data.php related to sales_taxes or sales_items_taxes.');
return 0;
}

View File

@@ -19,8 +19,6 @@ class Migration_IndiaGST extends Migration
helper('migration');
execute_script(APPPATH . 'Database/Migrations/sqlscripts/3.3.0_indiagst.sql');
error_log('Migrating tax configuration');
$count_of_tax_codes = $this->get_count_of_tax_code_entries();
if ($count_of_tax_codes > 0) {
@@ -42,8 +40,6 @@ class Migration_IndiaGST extends Migration
}
$this->drop_backups();
error_log('Migrating tax configuration completed');
}
/**

View File

@@ -13,10 +13,6 @@ class Migration_IndiaGST1 extends Migration
{
helper('migration');
execute_script(APPPATH . 'Database/Migrations/sqlscripts/3.3.0_indiagst1.sql');
error_log('Fix definition of Supplier.Tax Id');
error_log('Definition of Supplier.Tax Id corrected');
}
/**

View File

@@ -11,6 +11,8 @@ class Migration_fix_empty_reports extends Migration
*/
public function up(): void
{
log_message('info', 'Starting migration: Fix empty reports.');
$builder = $this->db->table('stock_locations');
$builder->select('location_name');
$builder->where('location_id', 1);
@@ -23,6 +25,8 @@ class Migration_fix_empty_reports extends Migration
$builder->where('permission_id', 'receivings_' . $location_name);
$builder->orWhere('permission_id', 'sales_' . $location_name);
$builder->update();
log_message('info', 'Finished migration: Fix empty reports.');
}
/**

View File

@@ -11,6 +11,7 @@ class Migration_receipttaxindicator extends Migration
*/
public function up(): void
{
log_message('info', 'Migrating receipt tax indicator.');
$this->db->query('INSERT INTO ' . $this->db->prefixTable('app_config') . ' (`key`, `value`)
VALUES (\'receipt_show_tax_ind\', \'0\')');
}

View File

@@ -41,7 +41,7 @@ class Migration_TaxAmount extends Migration
$tax_decimals = $this->appconfig->get_value('tax_decimals', 2);
$number_of_unmigrated = $this->get_count_of_unmigrated();
error_log('Migrating sales tax fixing. The number of sales that will be migrated is ' . $number_of_unmigrated);
log_message('info', 'Migrating sales tax fixing. The number of sales that will be migrated is ' . $number_of_unmigrated);
if ($number_of_unmigrated > 0) {
$unmigrated_invoices = $this->get_unmigrated($number_of_unmigrated)->getResultArray();
@@ -54,7 +54,7 @@ class Migration_TaxAmount extends Migration
$this->db->query('DROP TABLE ' . $this->db->prefixTable('sales_taxes_backup'));
}
error_log('Migrating sales tax fixing. The number of sales that will be migrated is finished.');
log_message('info', 'Migrating sales tax fixing. The number of sales that will be migrated is finished.');
}
}
@@ -126,7 +126,7 @@ class Migration_TaxAmount extends Migration
. ' ORDER BY SIT.sale_id) as US')->getResultArray();
if (!$result) {
error_log('Database error in 20200202000000_taxamount.php related to sales_taxes or sales_items_taxes.');
log_message('info', 'Database error in 20200202000000_taxamount.php related to sales_taxes or sales_items_taxes.');
return 0;
}

View File

@@ -11,6 +11,7 @@ class Migration_taxgroupconstraint extends Migration
*/
public function up(): void
{
log_message('info', 'Migrating tax group constraints.');
$this->db->query('ALTER TABLE ' . $this->db->prefixTable('tax_jurisdictions') . ' ADD CONSTRAINT tax_jurisdictions_uq1 UNIQUE (tax_group)');
}

View File

@@ -11,6 +11,7 @@ class Migration_image_upload_defaults extends Migration
*/
public function up(): void
{
log_message('info', 'Migrating image upload defaults.');
$image_values = [
['key' => 'image_allowed_types', 'value' => 'gif|jpg|png'],
['key' => 'image_max_height', 'value' => '480'],

View File

@@ -11,12 +11,8 @@ class Migration_modify_attr_links_constraint extends Migration
*/
public function up(): void
{
error_log('Migrating modify_attr_links_constraint');
helper('migration');
execute_script(APPPATH . 'Database/Migrations/sqlscripts/3.3.2_modify_attr_links_constraint.sql');
error_log('Migrating modify_attr_links_constraint');
}
/**

View File

@@ -11,6 +11,7 @@ class Migration_cashrounding extends Migration
*/
public function up(): void
{
log_message('info', 'Migrating cash rounding.');
$this->db->query('ALTER TABLE ' . $this->db->prefixTable('sales_payments') . ' ADD COLUMN `cash_adjustment` tinyint NOT NULL DEFAULT 0 AFTER `cash_refund`');
}

View File

@@ -11,12 +11,8 @@ class Migration_add_item_kit_number extends Migration
*/
public function up(): void
{
error_log('Migrating add_item_kit_number');
helper('migration');
execute_script(APPPATH . 'Database/Migrations/sqlscripts/3.3.3_add_kits_item_number.sql');
error_log('Migrating add_item_kit_number');
}
/**

View File

@@ -11,12 +11,8 @@ class Migration_modify_session_datatype extends Migration
*/
public function up(): void
{
error_log('Migrating modify_session_datatype');
helper('migration');
execute_script(APPPATH . 'Database/Migrations/sqlscripts/3.3.4_modify_session_datatype.sql');
error_log('Migrating modify_session_datatype');
}
/**

View File

@@ -16,11 +16,11 @@ class Migration_database_optimizations extends Migration
*/
public function up(): void
{
error_log('Migrating database_optimizations');
log_message('info', 'Migrating database optimizations.');
$attribute = model(Attribute::class);
$attribute->delete_orphaned_values();
$attribute->deleteOrphanedValues();
$this->migrate_duplicate_attribute_values(DECIMAL);
$this->migrate_duplicate_attribute_values(DATE);
@@ -82,7 +82,7 @@ class Migration_database_optimizations extends Migration
helper('migration');
execute_script(APPPATH . 'Database/Migrations/sqlscripts/3.4.0_database_optimizations.sql');
error_log('Migrating database_optimizations completed');
log_message('info', 'Finished migrating database optimizations.');
}
/**

View File

@@ -12,11 +12,11 @@ class Migration_remove_duplicate_links extends Migration
*/
public function up(): void
{
error_log('Migrating remove_duplicate_links');
log_message('info', 'Removing duplicate links.');
$this->migrate_duplicate_attribute_links();
error_log('Migrating remove_duplicate_links completed');
log_message('info', 'Duplicate links removed.');
}
/**

View File

@@ -11,11 +11,11 @@ class Migration_move_expenses_categories extends Migration
*/
public function up(): void
{
error_log('Migrating expense categories module');
log_message('info', 'Migrating expense categories module');
$this->db->simpleQuery("UPDATE ospos_grants SET menu_group = 'office' WHERE permission_id = 'expenses_categories'");
error_log('Migrating expense categories module completed');
log_message('info', 'Migrating expense categories module completed');
}
/**

View File

@@ -27,8 +27,6 @@ class Convert_to_ci4 extends Migration
*/
public function up(): void
{
error_log('Migrating database to CodeIgniter4 formats');
helper('migration');
execute_script(APPPATH . 'Database/Migrations/sqlscripts/3.4.0_ci4_conversion.sql');
@@ -39,8 +37,6 @@ class Convert_to_ci4 extends Migration
}
remove_backup();
error_log('Migrating to CodeIgniter4 formats completed');
}
/**

View File

@@ -11,6 +11,7 @@ class IntToTinyint extends Migration
*/
public function up(): void
{
log_message('info', 'Converting ints to tinyints.');
$this->db->query('ALTER TABLE ' . $this->db->prefixTable('customers') . ' MODIFY `consent` tinyint NOT NULL DEFAULT 0');
$this->db->query('ALTER TABLE ' . $this->db->prefixTable('cash_up') . ' MODIFY `note` tinyint NOT NULL DEFAULT 0');
}
@@ -20,6 +21,7 @@ class IntToTinyint extends Migration
*/
public function down(): void
{
log_message('info', 'Converting tinyints to ints.');
$this->db->query('ALTER TABLE ' . $this->db->prefixTable('customers') . ' MODIFY `consent` int NOT NULL DEFAULT 0');
$this->db->query('ALTER TABLE ' . $this->db->prefixTable('cash_up') . ' MODIFY `note` int NOT NULL DEFAULT 0');
}

View File

@@ -11,6 +11,7 @@ class Migration_add_missing_config extends Migration
*/
public function up(): void
{
log_message('info', 'Adding missing configs.');
$image_values = [
['key' => 'account_number', 'value' => ''], // This has no current maintenance, but it's used in Sales
['key' => 'category_dropdown', 'value' => ''],

View File

@@ -11,6 +11,7 @@ class Migration_drop_account_number_index extends Migration
*/
public function up(): void
{
log_message('info', 'Dropping account number index.');
$this->db->query('ALTER TABLE ' . $this->db->prefixTable('customers') . ' DROP INDEX account_number');
$this->db->query('ALTER TABLE ' . $this->db->prefixTable('customers') . ' ADD INDEX account_number (account_number)');
}

View File

@@ -25,7 +25,7 @@ class Migration_Convert_Barcode_Types extends Migration
*/
public function up(): void
{
log_message('info', 'Converting barcode types.');
$old_barcode_type = $this->config['barcode_type'];
switch ($old_barcode_type) {
@@ -52,6 +52,7 @@ class Migration_Convert_Barcode_Types extends Migration
*/
public function down(): void
{
log_message('info', 'Converting barcode types.');
$new_barcode_type = $this->config['barcode_type'];
switch ($new_barcode_type) {

View File

@@ -12,6 +12,7 @@ class Migration_fix_keys_for_db_upgrade extends Migration
*/
public function up(): void
{
log_message('info', 'Fixing keys for database upgrade.');
helper('migration');
$forge = Database::forge();

View File

@@ -13,6 +13,7 @@ class Migration_Attributes_fix_cascading_delete extends Migration
*/
public function up(): void
{
log_message('info', 'Fixing cascading deletes.');
helper('migration');
$this->db->query("ALTER TABLE `ospos_attribute_links` DROP INDEX `attribute_links_uq3`");

View File

@@ -11,12 +11,8 @@ class Migration_sessions_migration extends Migration
*/
public function up(): void
{
error_log('Migrating sessions table');
helper('migration');
execute_script(APPPATH . 'Database/Migrations/sqlscripts/3.4.1_migrate_sessions_table.sql');
error_log('Migrating sessions table');
}
/**

View File

@@ -12,7 +12,7 @@ class MigrationOptimizationIndices extends Migration
*/
public function up(): void
{
error_log('Migrating Optimization Indices');
log_message('info', 'Migrating Optimization Indices');
helper('migration');
$forge = Database::forge();
@@ -33,8 +33,6 @@ class MigrationOptimizationIndices extends Migration
$forge->addKey(['trans_items', 'trans_date'], false, false, 'trans_items_trans_date');
$forge->processIndexes('inventory');
}
error_log('Migrating Optimization Indices');
}
/**

View File

@@ -12,7 +12,14 @@ class AttributeLinksUniqueConstraint extends Migration
*/
public function up(): void
{
error_log('Migrating attribute_links unique constraint started');
helper('migration');
$foreignKeys = [
'ospos_attribute_links_ibfk_1',
'ospos_attribute_links_ibfk_2',
];
dropForeignKeyConstraints($foreignKeys, 'attribute_links');
dropColumnIfExists('ospos_attribute_links', 'generated_unique_column');
execute_script(APPPATH . 'Database/Migrations/sqlscripts/3.4.1_attribute_links_unique_constraint.sql');
}

View File

@@ -0,0 +1,24 @@
<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
class Migration_MissingConfigKeys extends Migration
{
/**
* Perform a migration step.
*/
public function up(): void
{
helper('migration');
executeScriptWithTransaction(APPPATH . 'Database/Migrations/sqlscripts/3.4.2_missing_config_keys.sql');
}
/**
* Revert a migration step.
*/
public function down(): void
{
}
}

View File

@@ -0,0 +1,24 @@
<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
class Migration_NullableTaxCategoryId extends Migration
{
/**
* Perform a migration step.
*/
public function up(): void
{
helper('migration');
execute_script(APPPATH . 'Database/Migrations/sqlscripts/3.4.2_nullable_tax_category_id.sql');
}
/**
* Revert a migration step.
*/
public function down(): void
{
}
}

View File

@@ -1,8 +1,6 @@
ALTER TABLE `ospos_attribute_links` DROP CONSTRAINT `ospos_attribute_links_ibfk_1`;
ALTER TABLE `ospos_attribute_links` DROP CONSTRAINT `ospos_attribute_links_ibfk_2`;
# Prevents duplicate attribute links with the same definition_id and item_id.
# This accounts for dropdown rows (null item_id) and rows associated with sales or receivings.
ALTER TABLE `ospos_attribute_links`
ADD COLUMN `generated_unique_column` VARCHAR(255) GENERATED ALWAYS AS (
CASE

View File

@@ -0,0 +1,11 @@
INSERT IGNORE INTO ospos_app_config (`key`, `value`)
VALUES
('msg_msg', ''),
('msg_pwd', ''),
('msg_uid', ''),
('msg_src', ''),
('smtp_timeout', 5000),
('smtp_crypto', 'tls'),
('smtp_port', 587),
('mailpath', '/usr/bin/sendmail'),
('protocol', 'sendmail');

View File

@@ -0,0 +1,3 @@
-- Migration to make tax_category_id nullable in ospos_items
ALTER TABLE ospos_items
MODIFY COLUMN tax_category_id INT NULL;

View File

@@ -0,0 +1,33 @@
<?php
/**
* Translates the attribute type to the corresponding database column name.
*
* Maps attribute type constants to their corresponding attribute_values table columns.
* Defaults to 'attribute_value' for TEXT, DROPDOWN and CHECKBOX attribute types.
*
* @param string $input The attribute type constant (DATE, DECIMAL, etc.)
* @return string The database column name for storing this attribute type
*/
function getAttributeDataType(string $input): string
{
$columnMap = [
DATE => 'attribute_date',
DECIMAL => 'attribute_decimal',
];
return $columnMap[$input] ?? 'attribute_value';
}
/**
* Validates that the provided data type is an allowed attribute value type.
*
* @param string $dataType
* @return void
*/
function validateAttributeValueType(string $dataType): void
{
if (!in_array($dataType, ATTRIBUTE_VALUE_TYPES, true)) {
throw new InvalidArgumentException('Invalid data type');
}
}

View File

@@ -1,10 +1,10 @@
<?php
/**
* @param array $stock_locations
* @param array $attributes
* @return string
*/
function generate_import_items_csv(array $stock_locations, array $attributes): string
{
$csv_headers = pack('CCC', 0xef, 0xbb, 0xbf); // Encode the Byte-Order Mark (BOM) so that UTF-8 File headers display properly in Microsoft Excel

View File

@@ -3,12 +3,14 @@
use Config\Database;
/**
* Migration helper
* Migration helper.
* @param string $path Path to migration script.
* @return bool Whether the migration executed successfully.
*/
function execute_script(string $path): void
function execute_script(string $path): bool
{
$version = preg_replace("/(.*_)?(.*).sql/", "$2", $path);
error_log("Migrating to $version (file: $path)");
log_message('info', "Migrating to $version (file: $path)");
$sql = file_get_contents($path);
$sqls = explode(';', $sql);
@@ -16,17 +18,73 @@ function execute_script(string $path): void
$db = Database::connect();
$success = true; // whether *all* queries succeeded
foreach ($sqls as $statement) {
$statement = "$statement;";
$hadError = !$db->simpleQuery($statement);
if (!$db->simpleQuery($statement)) {
if ($hadError) {
$success = false;
foreach ($db->error() as $error) {
error_log("error: $error");
log_message('error', "error: $error");
}
}
}
error_log("Migrated to $version");
if ($success) {
log_message('info', "Successfully migrated to $version");
}
else {
log_message('info', "Could not migrate to $version.");
}
return $success;
}
/**
* Migration helper that uses a transaction.
* @param string $path Path to migration script.
* @return bool Whether the migration executed successfully.
*/
function executeScriptWithTransaction(string $path): bool
{
$version = preg_replace("/(.*_)?(.*).sql/", "$2", $path);
log_message('info', "Migrating to $version (file: $path) with transaction");
$sql = file_get_contents($path);
$sqls = explode(';', $sql);
array_pop($sqls);
$db = Database::connect();
$db->transStart();
$success = true;
try {
foreach ($sqls as $statement) {
$statement = "$statement;";
$hadError = !$db->query($statement);
if ($hadError) {
$success = false;
foreach ($db->error() as $error) {
log_message('info', "error: $error");
}
}
}
} catch (Exception $e) {
log_message('info', "Could not migrate to $version: " . $e->getMessage());
$db->transRollback();
return false;
}
if ($success) {
log_message('info', "Successfully migrated to $version");
} else {
log_message('info', "Could not migrate to $version.");
}
$db->transComplete();
return $success;
}
/**
@@ -212,6 +270,36 @@ function foreignKeyExists(string $constraintName, string $tableName): bool {
return $query->getNumRows() > 0;
}
/**
* Drops a column from a table if it exists.
*
* @param string $table The name of the table.
* @param string $column The name of the column to drop.
* @return void
*/
function dropColumnIfExists(string $table, string $column): void
{
$prefix = overridePrefix();
$db = Database::connect();
$builder = $db->table('information_schema.COLUMNS');
// Check if the column exists in the table
$builder->select('COLUMN_NAME')
->where('TABLE_SCHEMA', $db->database)
->where('TABLE_NAME', $prefix . $table)
->where('COLUMN_NAME', $column);
$query = $builder->get();
if ($query->getNumRows() > 0)
{
// Drop the column if it exists
$db->query("ALTER TABLE `" . $prefix . "$table` DROP COLUMN `$column`");
}
overridePrefix($prefix);
}
/**
* Checks if the current database is MariaDB.
*

View File

@@ -108,14 +108,3 @@ function remove_backup(): void
}
log_message('info', "File $backup_path has been removed");
}
function purifyHtml($data)
{
if (is_array($data)) {
return array_map('purifyHtml', $data);
} elseif (is_string($data)) {
return Services::HtmlPurifier()->purify($data);
}
return $data;
}

View File

@@ -48,7 +48,7 @@ function transform_headers(array $headers, bool $readonly = false, bool $editabl
'field' => key($element),
'title' => current($element),
'switchable' => $element['switchable'] ?? !preg_match('(^$|&nbsp)', current($element)),
'escape' => !preg_match("/(edit|phone_number|email|messages|item_pic|customer_name|note)/", key($element)) && !(isset($element['escape']) && !$element['escape']),
'escape' => !preg_match("/(edit|email|messages|item_pic|customer_name|note)/", key($element)) && !(isset($element['escape']) && !$element['escape']),
'sortable' => $element['sortable'] ?? current($element) != '',
'checkbox' => $element['checkbox'] ?? false,
'class' => isset($element['checkbox']) || preg_match('(^$|&nbsp)', current($element)) ? 'print_hide' : '',

View File

@@ -0,0 +1,31 @@
<?php
if (!function_exists('base64url_encode')) {
/**
* Encode data to Base64 URL-safe string.
*
* @param string $data
* @return string
*/
function base64url_encode($data)
{
return rtrim(strtr(base64_encode($data), '+/', '-_'), '=');
}
}
if (!function_exists('base64url_decode')) {
/**
* Decode Base64 URL-safe string to original data.
*
* @param string $data
* @return string|false
*/
function base64url_decode($data)
{
$remainder = strlen($data) % 4;
if ($remainder) {
$data .= str_repeat('=', 4 - $remainder);
}
return base64_decode(strtr($data, '-_', '+/'));
}
}

View File

@@ -146,4 +146,5 @@ return [
"used" => "Points Used",
"work_orders" => "Work Orders",
"zero_and_less" => "Zero and Less",
"toggle_cost_and_profit" => "Toggle Cost & Profit",
];

View File

@@ -26,6 +26,7 @@ return [
"cost_price_required" => "Wholesale Price is a required field.",
"count" => "Update Inventory",
"csv_import_failed" => "CSV import failed",
"csv_import_invalid_location" => "Invalid stock location(s) found: {0}. Only valid stock locations are allowed.",
"csv_import_nodata_wrongformat" => "The uploaded CSV file has no data or is formatted incorrectly.",
"csv_import_partially_failed" => "There were {0} item import failure(s) on line(s): {1}. No rows were imported.",
"csv_import_success" => "Item CSV import successful.",

View File

@@ -146,4 +146,5 @@ return [
"used" => "Points Used",
"work_orders" => "Work Orders",
"zero_and_less" => "Zero and less",
"toggle_cost_and_profit" => "Toggle Cost & Profit",
];

View File

@@ -1,89 +1,89 @@
<?php
return [
"address_1" => "Alamat 1",
"address_2" => "Alamat 2",
"admin" => "",
"city" => "Kota",
"clerk" => "",
"close" => "Tutup",
"color" => "",
"comments" => "Komentar",
"common" => "umum",
"confirm_search" => "Anda telah memilih satu atau beberapa baris, ini tidak akan dipilih lagi setelah pencarian Anda. Apakah Anda yakin ingin mengirimkan pencarian ini?",
"copyrights" => "© 2010 - {0}",
"correct_errors" => "Silahkan perbaiki kesalahan sebelum menyimpan",
"country" => "Negara",
"dashboard" => "",
"date" => "Tanggal",
"delete" => "Hapus",
"det" => "detil",
"download_import_template" => "Unduh yang Diimpor dalam format CSV (CSV)",
"edit" => "ubah",
"email" => "Email",
"email_invalid_format" => "Alamat email tidak dalam format yang benar.",
"export_csv" => "Ekspor ke CSV",
"export_csv_no" => "Tidak",
"export_csv_yes" => "Ya",
"fields_required_message" => "Bagian yang berwarna merah harus diisi",
"fields_required_message_unique" => "",
"first_name" => "Nama Depan",
"first_name_required" => "Nama Depan harus diisi.",
"first_page" => "Pertama",
"gender" => "Jenis Kelamin",
"gender_female" => "P",
"gender_male" => "L",
"gender_undefined" => "",
"icon" => "ikon",
"id" => "Nomor ID",
"import" => "Impor",
"import_change_file" => "Ubah",
"import_csv" => "Impor dari CSV",
"import_full_path" => "Diperlukan alamat lengkap file CSV",
"import_remove_file" => "Hapus",
"import_select_file" => "Pilih file",
"inv" => "Persediaan",
"last_name" => "Nama Belakang",
"last_name_required" => "Nama belakang harus diisi.",
"last_page" => "Akhir",
"learn_about_project" => "Untuk mempelajari informasi terbaru tentang proyek ini.",
"list_of" => "Daftar",
"logo" => "Logo",
"logo_mark" => "Tanda",
"logout" => "Keluar",
"manager" => "",
"migration_needed" => "Migrasi data ke {0} akan dimulai setelah masuk.",
"new" => "Baru",
"no" => "Tidak",
"no_persons_to_display" => "Tidak ada orang yang ditampilkan.",
"none_selected_text" => "[Pilih]",
"or" => "ATAU",
"people" => "",
"phone_number" => "Nomor Telepon",
"phone_number_required" => "Nomer Telepon Wajib Diisi",
"please_visit_my" => "Silahkan kunjungi",
"position" => "",
"powered_by" => "Diberdayakan oleh",
"price" => "Harga",
"print" => "Cetak",
"remove" => "Hapus",
"required" => "Diperlukan",
"restore" => "Kembalikan",
"return_policy" => "Kebijakan Retur",
"search" => "Cari",
"search_options" => "Pilihan pencarian",
"searched_for" => "Mencari untuk",
"software_short" => "OSPOS",
"software_title" => "Sumber Terbuka Titik Penjualan",
"state" => "Provinsi",
"submit" => "Kirim",
"total_spent" => "Total",
"unknown" => "Tidak diketahui",
"view_recent_sales" => "Lihat Penjualan Terkini",
"website" => "Situs",
"welcome" => "Selamat Datang",
"welcome_message" => "Selamat Datang di OSPOS, klik modul di bawah ini untuk memulai.",
"yes" => "Iya",
"you_are_using_ospos" => "Anda menggunakan Open Source Point Of Sale Versi",
"zip" => "Kode POS",
'address_1' => "Alamat 1",
'address_2' => "Alamat 2",
'admin' => "",
'city' => "Kota",
'clerk' => "",
'close' => "Tutup",
'color' => "",
'comments' => "Komentar",
'common' => "umum",
'confirm_search' => "Anda telah memilih satu atau beberapa baris, ini tidak akan dipilih lagi setelah pencarian Anda. Apakah Anda yakin ingin mengirimkan pencarian ini?",
'copyrights' => "© 2010 - {0}",
'correct_errors' => "Silahkan perbaiki kesalahan sebelum menyimpan",
'country' => "Negara",
'dashboard' => "",
'date' => "Tanggal",
'delete' => "Hapus",
'det' => "detail",
'download_import_template' => "Unduh yang Diimpor dalam format CSV (CSV)",
'edit' => "ubah",
'email' => "Surel",
'email_invalid_format' => "Alamat surel tidak dalam format yang benar.",
'export_csv' => "Ekspor ke CSV",
'export_csv_no' => "Tidak",
'export_csv_yes' => "Ya",
'fields_required_message' => "Bagian yang berwarna merah harus diisi",
'fields_required_message_unique' => "",
'first_name' => "Nama Depan",
'first_name_required' => "Nama Depan harus diisi.",
'first_page' => "Pertama",
'gender' => "Jenis Kelamin",
'gender_female' => "P",
'gender_male' => "L",
'gender_undefined' => "",
'icon' => "Ikon",
'id' => "ID",
'import' => "Impor",
'import_change_file' => "Ubah",
'import_csv' => "Impor dari CSV",
'import_full_path' => "Diperlukan alamat lengkap file CSV",
'import_remove_file' => "Hapus",
'import_select_file' => "Pilih file",
'inv' => "Persediaan",
'last_name' => "Nama Belakang",
'last_name_required' => "Nama belakang harus diisi.",
'last_page' => "Akhir",
'learn_about_project' => "Untuk mempelajari informasi terbaru tentang proyek ini.",
'list_of' => "Daftar",
'logo' => "Logo",
'logo_mark' => "Tanda",
'logout' => "Keluar",
'manager' => "",
'migration_needed' => "Migrasi data ke {0} akan dimulai setelah masuk.",
'new' => "Baru",
'no' => "Tidak",
'no_persons_to_display' => "Tidak ada orang yang ditampilkan.",
'none_selected_text' => "[Pilih]",
'or' => "ATAU",
'people' => "",
'phone_number' => "Nomor Telepon",
'phone_number_required' => "Nomer Telepon Wajib Diisi",
'please_visit_my' => "Silahkan kunjungi",
'position' => "",
'powered_by' => "Diberdayakan oleh",
'price' => "Harga",
'print' => "Cetak",
'remove' => "Hapus",
'required' => "Diperlukan",
'restore' => "Kembalikan",
'return_policy' => "Kebijakan Retur",
'search' => "Cari",
'search_options' => "Pilihan pencarian",
'searched_for' => "Mencari untuk",
'software_short' => "OSPOS",
'software_title' => "Sumber Terbuka Titik Penjualan",
'state' => "Provinsi",
'submit' => "Kirim",
'total_spent' => "Total",
'unknown' => "Tidak diketahui",
'view_recent_sales' => "Lihat Penjualan Terkini",
'website' => "Situs",
'welcome' => "Selamat Datang",
'welcome_message' => "Selamat Datang di OSPOS, klik modul di bawah ini untuk memulai.",
'yes' => "Iya",
'you_are_using_ospos' => "Anda menggunakan Open Source Point Of Sale Versi",
'zip' => "Kode POS",
];

View File

@@ -1,331 +1,331 @@
<?php
return [
"address" => "Alamat Perusahaan",
"address_required" => "Alamat Perusahaan wajib diisi.",
"all_set" => "Semua perizinan file diatur dengan benar!",
"allow_duplicate_barcodes" => "Ijinkan kode batang ganda",
"apostrophe" => "Tanda petik (')",
"backup_button" => "Cadangkan",
"backup_database" => "Cadangkan basis data",
"barcode" => "Kode batang",
"barcode_company" => "Nama Perusahaan",
"barcode_configuration" => "Pengaturan kode batang",
"barcode_content" => "Isi kode batang",
"barcode_first_row" => "Baris 1",
"barcode_font" => "Jenis huruf",
"barcode_formats" => "Format masukan",
"barcode_generate_if_empty" => "Buatkan kode batang otomatis jika kosong.",
"barcode_height" => "Tinggi (px)",
"barcode_id" => "Item Id/Nama",
"barcode_info" => "Informasi pengaturan kode batang",
"barcode_layout" => "Tata letak kode batang",
"barcode_name" => "Nama",
"barcode_number" => "Kode batang",
"barcode_number_in_row" => "Jumlah baris",
"barcode_page_cellspacing" => "Tampilkan jarak antar sel pada halaman.",
"barcode_page_width" => "Lebar halaman",
"barcode_price" => "Harga",
"barcode_second_row" => "Baris 2",
"barcode_third_row" => "Baris 3",
"barcode_tooltip" => "Peringatan: Fitur ini dapat meyebabkan duplikasi item yang diimpor atau dibuat. Jangan digunakan jika Anda tidak ingin menggandakan kode batang.",
"barcode_type" => "Jenis kode batang",
"barcode_width" => "Lebar (px)",
"bottom" => "Bawah",
"cash_button" => "",
"cash_button_1" => "",
"cash_button_2" => "",
"cash_button_3" => "",
"cash_button_4" => "",
"cash_button_5" => "",
"cash_button_6" => "",
"cash_decimals" => "Desimal Tunai",
"cash_decimals_tooltip" => "Jika Desimal Tunai dan Desimal Mata Uang sama, maka pembulatan uang tidak akan dilakukan.",
"cash_rounding" => "Pembulatan tunai",
"category_dropdown" => "Tampilkan menu tarik turun untuk Kategori",
"center" => "Tengah",
"change_apperance_tooltip" => "",
"comma" => "koma",
"company" => "Nama Perusahaan",
"company_avatar" => "",
"company_change_image" => "Ubah gambar",
"company_logo" => "Logo perusahaan",
"company_remove_image" => "Hapus gambar",
"company_required" => "Nama Perusahaan wajib diisi",
"company_select_image" => "Pilih gambar",
"company_website_url" => "Situs Perusahaan bukan URL yang benar(http://...).",
"country_codes" => "Kode negara",
"country_codes_tooltip" => "Daftar kode negara format CSV untuk lookup alamat.",
"currency_code" => "Kode Mata uang",
"currency_decimals" => "Angka desimal",
"currency_symbol" => "Simbol Mata Uang",
"current_employee_only" => "",
"customer_reward" => "Hadiah",
"customer_reward_duplicate" => "Masukkan nama unik untuk hadiah.",
"customer_reward_enable" => "Aktifkan Hadiah Konsumen",
"customer_reward_invalid_chars" => "Nama hadiah tidak boleh berisi '_'",
"customer_reward_required" => "Kolom hadiah tidak boleh kosong",
"customer_sales_tax_support" => "Dukungan Pajak Penjualan Pelanggan",
"date_or_time_format" => "Penyaring tanggal dan waktu",
"datetimeformat" => "Format tanggal dan waktu",
"decimal_point" => "Titik Desimal",
"default_barcode_font_size_number" => "Pengaturan ukuran kode batang default harus berupa angka.",
"default_barcode_font_size_required" => "Pengaturan ukuran kode batang default harus diisi.",
"default_barcode_height_number" => "Pengaturan tinggi kode batang harus berupa angka.",
"default_barcode_height_required" => "Pengaturan tinggi kode batang harus diisi.",
"default_barcode_num_in_row_number" => "Kode batang harus berupa angka.",
"default_barcode_num_in_row_required" => "Kode batang harus diisi.",
"default_barcode_page_cellspacing_number" => "Pengaturan spasi sel kode batang harus berupa angka.",
"default_barcode_page_cellspacing_required" => "Pengaturan spasi sel kode batang harus diisi.",
"default_barcode_page_width_number" => "Lebar halaman kode batang harus berupa angka.",
"default_barcode_page_width_required" => "Lebar halaman kode batang harus diisi.",
"default_barcode_width_number" => "Lebar kode batang harus berupa angka.",
"default_barcode_width_required" => "Lebar kode batang harus diisi.",
"default_item_columns" => "Kolom item terlihat bawaan",
"default_origin_tax_code" => "Kode Pajak Asal Default",
"default_receivings_discount" => "Diskon pembelian bawaan",
"default_receivings_discount_number" => "Diskon pembelian bawaaan harus berupa angka.",
"default_receivings_discount_required" => "Diskon oembelian harus diisi.",
"default_sales_discount" => "Diskon penjualan bawaan",
"default_sales_discount_number" => "Diskon penjualan harus berupa angka.",
"default_sales_discount_required" => "Diskon penjualan harus diisi.",
"default_tax_category" => "Kategori pajak bawaan",
"default_tax_code" => "Kode pajak bawaan",
"default_tax_jurisdiction" => "Yuridiksi Pajak bawaan",
"default_tax_name_number" => "Nama Pajak Default harus berupa string.",
"default_tax_name_required" => "Jenis pajak harus diisi.",
"default_tax_rate" => "Tarif Pajak %",
"default_tax_rate_1" => "Tarif Pajak 1",
"default_tax_rate_2" => "Tarif Pajak 2",
"default_tax_rate_3" => "",
"default_tax_rate_number" => "Tarif Pajak harus berupa angkat.",
"default_tax_rate_required" => "Tarif Pajak Biasa harus diisi.",
"derive_sale_quantity" => "Ijinkan Kuantitas Penjulan Diturunkan",
"derive_sale_quantity_tooltip" => "Jika dicentang maka jenis barang baru akan disediakan untuk barang yang dipesan dengan jumlah yang diperpanjang",
"dinner_table" => "Meja",
"dinner_table_duplicate" => "Masukkan nama meja (harus unik).",
"dinner_table_enable" => "Aktifkan meja",
"dinner_table_invalid_chars" => "Nama meja tidak dapat berisi karater '_'.",
"dinner_table_required" => "Meja adalah kolom yang harus diisi.",
"dot" => "titik",
"email" => "Email",
"email_configuration" => "Konfigurasi Email",
"email_mailpath" => "Direktori untuk Sendmail",
"email_protocol" => "Protocol",
"email_receipt_check_behaviour" => "Kotak centang Penerimaan Email",
"email_receipt_check_behaviour_always" => "Selalu dicentang",
"email_receipt_check_behaviour_last" => "Ingat pilihan terakhir",
"email_receipt_check_behaviour_never" => "Selalu tidak tercentang",
"email_smtp_crypto" => "Enkripsi SMTP",
"email_smtp_host" => "Server SMTP",
"email_smtp_pass" => "Kata Sandi SMTP",
"email_smtp_port" => "Port SMTP",
"email_smtp_timeout" => "Masa Aktif SMTP",
"email_smtp_user" => "Nama Pengguna SMTP",
"enable_avatar" => "",
"enable_avatar_tooltip" => "",
"enable_dropdown_tooltip" => "",
"enable_new_look" => "",
"enable_right_bar" => "",
"enable_right_bar_tooltip" => "",
"enforce_privacy" => "Berlakukan privasi",
"enforce_privacy_tooltip" => "Lindungi privasi Pelanggan yang menegakkan data dalam hal data mereka dihapus",
"fax" => "Fax",
"file_perm" => "Perizinan berkas bermasalah, Silakan perbaiki dan muat ulang halaman ini.",
"financial_year" => "Tahun Awal Fiskal",
"financial_year_apr" => "1 April",
"financial_year_aug" => "1 Agustus",
"financial_year_dec" => "1 Desember",
"financial_year_feb" => "1 Februari",
"financial_year_jan" => "1 Januari",
"financial_year_jul" => "1 Juli",
"financial_year_jun" => "1 Juni",
"financial_year_mar" => "1 Maret",
"financial_year_may" => "1 Mei",
"financial_year_nov" => "1 November",
"financial_year_oct" => "1 Oktober",
"financial_year_sep" => "1 September",
"floating_labels" => "Label mengambang",
"gcaptcha_enable" => "Halaman login reCHAPTCHA",
"gcaptcha_secret_key" => "Kunci Rahasia reCHAPTCHA",
"gcaptcha_secret_key_required" => "Kunci Rahasia reCHAPTCHA adalah bidang yang harus diisi",
"gcaptcha_site_key" => "Kunci Situs reCHAPTCHA",
"gcaptcha_site_key_required" => "Kunci Situs reCHAPTCHA adalah bidang yang dibutuhkan",
"gcaptcha_tooltip" => "Lindungi Halaman Login dengan reCAPTCHA Google, klik pada ikon untuk pasangan kunci API.",
"general" => "Umum",
"general_configuration" => "Pengaturan Umum",
"giftcard_number" => "Nomor Kartu Hadiah",
"giftcard_random" => "Hasilkan acak",
"giftcard_series" => "Hasilkan dalam seri",
"image_allowed_file_types" => "Jenis berkas yang diizinkan",
"image_max_height_tooltip" => "Tinggi maksimum unggahan gambar yang diizinkan dalam piksel (px).",
"image_max_size_tooltip" => "ukuran berkas maksimum yang diijinkan untuk mengunggah gambar dalam kilobyte (kb).",
"image_max_width_tooltip" => "Lebar maksimum yang diunggah dari pengunggahan gambar dalam piksel (px).",
"image_restrictions" => "Pembatasan Pengunggahan Gambar",
"include_hsn" => "Termasuk dukungan kode HSN",
"info" => "Informasi",
"info_configuration" => "Informasi Toko",
"input_groups" => "Grup masukan",
"integrations" => "Integrasi",
"integrations_configuration" => "Integrasi pihak ketiga",
"invoice" => "Faktur",
"invoice_configuration" => "Pengaturan cetak faktur",
"invoice_default_comments" => "Komentar faktur",
"invoice_email_message" => "Templat email faktur",
"invoice_enable" => "Mengaktifkan faktur",
"invoice_printer" => "Pencetak Faktur",
"invoice_type" => "Tipe Faktur",
"is_readable" => "dapat dibaca, tetapi izin tidak disetel dengan benar. Setel ke 640 atau 660, kemudian segarkan.",
"is_writable" => "bisa ditulis, tetapi izin tidak disetel dengan benar. Setel ke 750 dan segarkan.",
"item_markup" => "",
"jsprintsetup_required" => "Perhatian! Fungsi ini hanya berjalan jika anda menggunakan Firefox yang memiliki tambahan jsPrintSetup. Tetap simpan?",
"language" => "Bahasa",
"last_used_invoice_number" => "Nomor terakhir faktur",
"last_used_quote_number" => "Nomor Penawaran yang terakhir digunakan",
"last_used_work_order_number" => "Nomor W/O yang terakhir dipakai",
"left" => "Kiri",
"license" => "Lisensi",
"license_configuration" => "Pernyataan Lisensi",
"line_sequence" => "Urutan baris",
"lines_per_page" => "Baris per halaman",
"lines_per_page_number" => "Baris per halaman harus berupa angka.",
"lines_per_page_required" => "Baris per halaman tidak boleh kosong.",
"locale" => "Terjemahan",
"locale_configuration" => "Konfigurasi Terjemahan",
"locale_info" => "Informasi Konfigurasi Terjemahan",
"location" => "Lokasi Stock",
"location_configuration" => "Lokasi Stock",
"location_info" => "Informasi konfigurasi lokasi stock",
"login_form" => "Gaya Formulir Log Masuk",
"logout" => "Apakah Anda akan membuat cadangan sebelum anda keluar? Klik [OK] untuk pencadangan, [Batal] untuk keluar.",
"mailchimp" => "MailChimp",
"mailchimp_api_key" => "Kunci API MailChimp",
"mailchimp_configuration" => "Pengaturan MailChimp",
"mailchimp_key_successfully" => "Kunci API benar.",
"mailchimp_key_unsuccessfully" => "Kunci API tidak valid.",
"mailchimp_lists" => "Daftar MailChimp",
"mailchimp_tooltip" => "Klik pada ikon untuk KUnci API.",
"message" => "Pesan",
"message_configuration" => "Pengaturan Pesan",
"msg_msg" => "Pesan teks tersimpan",
"msg_msg_placeholder" => "Apakah Anda ingin menggunakan template SMS menyimpan pesan Anda disini? Jika tidak, biarkan kosong.",
"msg_pwd" => "SMS-API Password",
"msg_pwd_required" => "SMS-API Password harus diisi",
"msg_src" => "ID pengirim SMS-API",
"msg_src_required" => "SMS-API Sender ID harus diisi",
"msg_uid" => "SMS-API User Name",
"msg_uid_required" => "SMS-API Username harus diisi",
"multi_pack_enabled" => "Multi paket per item",
"no_risk" => "Tidak ada risiko keamanan / kerentanan.",
"none" => "none",
"notify_alignment" => "Posisi notifikasi Popup",
"number_format" => "Format Nomor",
"number_locale" => "Terjemahan",
"number_locale_invalid" => "Kode bahasa salah. Cek tautan pada tooltip untuk mendapatkan kode bahasa yang benar.",
"number_locale_required" => "Kode Lokal wajib diisi.",
"number_locale_tooltip" => "Menemukan kode lokal melalui link ini.",
"os_timezone" => "Zona waktu OSPOS:",
"ospos_info" => "Info pemasangan OSPOS",
"payment_options_order" => "Urutan pilihan pembayaran",
"perm_risk" => "Setelan izin yang salah berbahaya bagi keamanan perangkat lunak.",
"phone" => "Telepon Perusahaan",
"phone_required" => "Telepon Perusahaan wajib diisi.",
"print_bottom_margin" => "Margin Bawah",
"print_bottom_margin_number" => "Default margin bawah harus angka.",
"print_bottom_margin_required" => "Default margin Bawah harus di isi.",
"print_delay_autoreturn" => "Otomatis Retur pada penundaan Penjualan",
"print_delay_autoreturn_number" => "Kolom Otomatis Retur pada Penundaan Penjualan harus diisi.",
"print_delay_autoreturn_required" => "Pengembalian otomatis untuk Penjualan tertunda harus berupa angka.",
"print_footer" => "Mencetak Footer Browser",
"print_header" => "Mencetak Browser Header",
"print_left_margin" => "Margin Kiri",
"print_left_margin_number" => "Margin kiri harus berupa angka.",
"print_left_margin_required" => "Margin kiri wajib di isi.",
"print_receipt_check_behaviour" => "Centang Cetak Struk",
"print_receipt_check_behaviour_always" => "Selalu dicentang",
"print_receipt_check_behaviour_last" => "Ingat pilihan terakhir",
"print_receipt_check_behaviour_never" => "Selalu tidak dicentang",
"print_right_margin" => "Margin kanan",
"print_right_margin_number" => "Margin kiri harus berupa angka.",
"print_right_margin_required" => "Margin kanan wajib di isi.",
"print_silently" => "Tampilkan Print Dialog",
"print_top_margin" => "Margin atas",
"print_top_margin_number" => "Nilai margin atas harus di isi angka.",
"print_top_margin_required" => "Margin atas wajib di isi.",
"quantity_decimals" => "Desimal untuk Jumlah",
"quick_cash_enable" => "",
"quote_default_comments" => "Komentar faktur",
"receipt" => "Struk Penerimaan",
"receipt_category" => "",
"receipt_configuration" => "Struk Print Settings",
"receipt_default" => "Default",
"receipt_font_size" => "Ukuran Font",
"receipt_font_size_number" => "Ukuran font harus berupa angka.",
"receipt_font_size_required" => "Ukuran font harus diisi.",
"receipt_info" => "Struk Konfigurasi Informasi",
"receipt_printer" => "Tiket Printer",
"receipt_short" => "Ringkas",
"receipt_show_company_name" => "Tampilkan nama perusahaan",
"receipt_show_description" => "Tampilkan deskripsi",
"receipt_show_serialnumber" => "Tampilkan nomor seri",
"receipt_show_tax_ind" => "Tampilkan Indikator Pajak",
"receipt_show_taxes" => "Tampilkan pajak",
"receipt_show_total_discount" => "Tampilkan total diskon",
"receipt_template" => "Template struk",
"receiving_calculate_average_price" => "Menghitung harga rata-rata (Penerimaan)",
"recv_invoice_format" => "Format Faktur",
"register_mode_default" => "Default register mode",
"report_an_issue" => "Laporkan masalah",
"return_policy_required" => "Kebijakan retur wajib diisi.",
"reward" => "Hadiah",
"reward_configuration" => "Konfigurasi Hadiah",
"right" => "Kanan",
"sales_invoice_format" => "Format Faktur Penjualan",
"sales_quote_format" => "Format Penawaran Penjualan",
"saved_successfully" => "Konfigurasi berhasil disimpan.",
"saved_unsuccessfully" => "Konfigurasi tidak berhasil disimpan.",
"security_issue" => "Peringatan Kerentanan Keamanan",
"server_notice" => "Silakan gunakan info di bawah ini untuk pelaporan masalah.",
"service_charge" => "",
"show_due_enable" => "",
"show_office_group" => "Tampilkan ikon kantor",
"statistics" => "Kirim statistik",
"statistics_tooltip" => "Kirim statistik untuk pengembangan dan peningkatan fitur.",
"stock_location" => "Lokasi Stock",
"stock_location_duplicate" => "Gunakan nama yang unik untuk lokasi stock.",
"stock_location_invalid_chars" => "Nama lokasi tidak boleh berisi karakter '_'.",
"stock_location_required" => "Nomor lokasi stock harus diisi.",
"suggestions_fifth_column" => "",
"suggestions_first_column" => "Kolom 1",
"suggestions_fourth_column" => "",
"suggestions_layout" => "Tampilan Saran Pencarian",
"suggestions_second_column" => "Kolom 2",
"suggestions_third_column" => "Kolom 3",
"system_conf" => "Setting & Conf",
"system_info" => "System Info",
"table" => "Meja",
"table_configuration" => "Konfigurasi Meja",
"takings_printer" => "Struk Printer",
"tax" => "Pajak",
"tax_category" => "Kategori Pajak",
"tax_category_duplicate" => "Kategori pajak yang dimasukkan sudah ada.",
"tax_category_invalid_chars" => "Kategori pajak yang dimasukkan tidak valid.",
"tax_category_required" => "Kategori pajak dibutuhkan.",
"tax_category_used" => "Kategori pajak tidak bisa dihapus karena sedang digunakan.",
"tax_configuration" => "Konfigurasi Pajak",
"tax_decimals" => "Pajak Decimals",
"tax_id" => "Id Pajak",
"tax_included" => "Dikenakan Pajak",
"theme" => "Tema",
"theme_preview" => "Pratinjau Tema:",
"thousands_separator" => "Pemisah Ribuan",
"timezone" => "Zona Waktu",
"timezone_error" => "Zona Waktu OSPOS berbeda dari Zona Waktu Anda.",
"top" => "Atas",
"use_destination_based_tax" => "Gunakan Pajak Berdasarkan Tujuan",
"user_timezone" => "Zona waktu lokal:",
"website" => "Situs Perusahaan",
"wholesale_markup" => "",
"work_order_enable" => "Dukungan Work Order",
"work_order_format" => "Format Work Order",
'address' => "Alamat Perusahaan",
'address_required' => "Alamat Perusahaan wajib diisi.",
'all_set' => "Semua perizinan file diatur dengan benar!",
'allow_duplicate_barcodes' => "Ijinkan kode batang ganda",
'apostrophe' => "Tanda petik (')",
'backup_button' => "Cadangkan",
'backup_database' => "Cadangkan basis data",
'barcode' => "Kode batang",
'barcode_company' => "Nama Perusahaan",
'barcode_configuration' => "Pengaturan kode batang",
'barcode_content' => "Isi kode batang",
'barcode_first_row' => "Baris 1",
'barcode_font' => "Jenis huruf",
'barcode_formats' => "Format masukan",
'barcode_generate_if_empty' => "Buatkan kode batang otomatis jika kosong.",
'barcode_height' => "Tinggi (px)",
'barcode_id' => "Item Id/Nama",
'barcode_info' => "Informasi pengaturan kode batang",
'barcode_layout' => "Tata letak kode batang",
'barcode_name' => "Nama",
'barcode_number' => "Kode batang",
'barcode_number_in_row' => "Jumlah baris",
'barcode_page_cellspacing' => "Tampilkan jarak antar sel pada halaman.",
'barcode_page_width' => "Lebar halaman",
'barcode_price' => "Harga",
'barcode_second_row' => "Baris 2",
'barcode_third_row' => "Baris 3",
'barcode_tooltip' => "Peringatan: Fitur ini dapat meyebabkan duplikasi item yang diimpor atau dibuat. Jangan digunakan jika Anda tidak ingin menggandakan kode batang.",
'barcode_type' => "Jenis kode batang",
'barcode_width' => "Lebar (px)",
'bottom' => "Bawah",
'cash_button' => "",
'cash_button_1' => "",
'cash_button_2' => "",
'cash_button_3' => "",
'cash_button_4' => "",
'cash_button_5' => "",
'cash_button_6' => "",
'cash_decimals' => "Desimal Tunai",
'cash_decimals_tooltip' => "Jika Desimal Tunai dan Desimal Mata Uang sama, maka pembulatan uang tidak akan dilakukan.",
'cash_rounding' => "Pembulatan tunai",
'category_dropdown' => "Tampilkan menu tarik turun untuk Kategori",
'center' => "Tengah",
'change_apperance_tooltip' => "",
'comma' => "koma",
'company' => "Nama Perusahaan",
'company_avatar' => "",
'company_change_image' => "Ubah gambar",
'company_logo' => "Logo perusahaan",
'company_remove_image' => "Hapus gambar",
'company_required' => "Nama Perusahaan wajib diisi",
'company_select_image' => "Pilih gambar",
'company_website_url' => "Situs Perusahaan bukan URL yang benar(http://...).",
'country_codes' => "Kode negara",
'country_codes_tooltip' => "Daftar kode negara format CSV untuk lookup alamat.",
'currency_code' => "Kode Mata uang",
'currency_decimals' => "Angka desimal",
'currency_symbol' => "Simbol Mata Uang",
'current_employee_only' => "",
'customer_reward' => "Hadiah",
'customer_reward_duplicate' => "Masukkan nama unik untuk hadiah.",
'customer_reward_enable' => "Aktifkan Hadiah Konsumen",
'customer_reward_invalid_chars' => "Nama hadiah tidak boleh berisi '_'",
'customer_reward_required' => "Kolom hadiah tidak boleh kosong",
'customer_sales_tax_support' => "Dukungan Pajak Penjualan Pelanggan",
'date_or_time_format' => "Penyaring tanggal dan waktu",
'datetimeformat' => "Format tanggal dan waktu",
'decimal_point' => "Titik Desimal",
'default_barcode_font_size_number' => "Pengaturan ukuran kode batang default harus berupa angka.",
'default_barcode_font_size_required' => "Pengaturan ukuran kode batang default harus diisi.",
'default_barcode_height_number' => "Pengaturan tinggi kode batang harus berupa angka.",
'default_barcode_height_required' => "Pengaturan tinggi kode batang harus diisi.",
'default_barcode_num_in_row_number' => "Kode batang harus berupa angka.",
'default_barcode_num_in_row_required' => "Kode batang harus diisi.",
'default_barcode_page_cellspacing_number' => "Pengaturan spasi sel kode batang harus berupa angka.",
'default_barcode_page_cellspacing_required' => "Pengaturan spasi sel kode batang harus diisi.",
'default_barcode_page_width_number' => "Lebar halaman kode batang harus berupa angka.",
'default_barcode_page_width_required' => "Lebar halaman kode batang harus diisi.",
'default_barcode_width_number' => "Lebar kode batang harus berupa angka.",
'default_barcode_width_required' => "Lebar kode batang harus diisi.",
'default_item_columns' => "Kolom item terlihat bawaan",
'default_origin_tax_code' => "Kode Pajak Asal Default",
'default_receivings_discount' => "Diskon pembelian bawaan",
'default_receivings_discount_number' => "Diskon pembelian bawaaan harus berupa angka.",
'default_receivings_discount_required' => "Diskon oembelian harus diisi.",
'default_sales_discount' => "Diskon penjualan bawaan",
'default_sales_discount_number' => "Diskon penjualan harus berupa angka.",
'default_sales_discount_required' => "Diskon penjualan harus diisi.",
'default_tax_category' => "Kategori pajak bawaan",
'default_tax_code' => "Kode pajak bawaan",
'default_tax_jurisdiction' => "Yuridiksi Pajak bawaan",
'default_tax_name_number' => "Nama Pajak Default harus berupa string.",
'default_tax_name_required' => "Jenis pajak harus diisi.",
'default_tax_rate' => "Tarif Pajak %",
'default_tax_rate_1' => "Tarif Pajak 1",
'default_tax_rate_2' => "Tarif Pajak 2",
'default_tax_rate_3' => "",
'default_tax_rate_number' => "Tarif Pajak harus berupa angkat.",
'default_tax_rate_required' => "Tarif Pajak Biasa harus diisi.",
'derive_sale_quantity' => "Ijinkan Kuantitas Penjulan Diturunkan",
'derive_sale_quantity_tooltip' => "Jika dicentang maka jenis barang baru akan disediakan untuk barang yang dipesan dengan jumlah yang diperpanjang",
'dinner_table' => "Meja",
'dinner_table_duplicate' => "Masukkan nama meja (harus unik).",
'dinner_table_enable' => "Aktifkan meja",
'dinner_table_invalid_chars' => "Nama meja tidak dapat berisi karater '_'.",
'dinner_table_required' => "Meja adalah kolom yang harus diisi.",
'dot' => "titik",
'email' => "Surel",
'email_configuration' => "Konfigurasi Email",
'email_mailpath' => "Direktori untuk Sendmail",
'email_protocol' => "Protocol",
'email_receipt_check_behaviour' => "Kotak centang Penerimaan Email",
'email_receipt_check_behaviour_always' => "Selalu dicentang",
'email_receipt_check_behaviour_last' => "Ingat pilihan terakhir",
'email_receipt_check_behaviour_never' => "Selalu tidak tercentang",
'email_smtp_crypto' => "Enkripsi SMTP",
'email_smtp_host' => "Server SMTP",
'email_smtp_pass' => "Kata Sandi SMTP",
'email_smtp_port' => "Port SMTP",
'email_smtp_timeout' => "Masa Aktif SMTP",
'email_smtp_user' => "Nama Pengguna SMTP",
'enable_avatar' => "",
'enable_avatar_tooltip' => "",
'enable_dropdown_tooltip' => "",
'enable_new_look' => "",
'enable_right_bar' => "",
'enable_right_bar_tooltip' => "",
'enforce_privacy' => "Berlakukan privasi",
'enforce_privacy_tooltip' => "Lindungi privasi Pelanggan yang menegakkan data dalam hal data mereka dihapus",
'fax' => "Fax",
'file_perm' => "Perizinan berkas bermasalah, Silakan perbaiki dan muat ulang halaman ini.",
'financial_year' => "Tahun Awal Fiskal",
'financial_year_apr' => "1 April",
'financial_year_aug' => "1 Agustus",
'financial_year_dec' => "1 Desember",
'financial_year_feb' => "1 Februari",
'financial_year_jan' => "1 Januari",
'financial_year_jul' => "1 Juli",
'financial_year_jun' => "1 Juni",
'financial_year_mar' => "1 Maret",
'financial_year_may' => "1 Mei",
'financial_year_nov' => "1 November",
'financial_year_oct' => "1 Oktober",
'financial_year_sep' => "1 September",
'floating_labels' => "Label mengambang",
'gcaptcha_enable' => "Halaman login reCHAPTCHA",
'gcaptcha_secret_key' => "Kunci Rahasia reCHAPTCHA",
'gcaptcha_secret_key_required' => "Kunci Rahasia reCHAPTCHA adalah bidang yang harus diisi",
'gcaptcha_site_key' => "Kunci Situs reCHAPTCHA",
'gcaptcha_site_key_required' => "Kunci Situs reCHAPTCHA adalah bidang yang dibutuhkan",
'gcaptcha_tooltip' => "Lindungi Halaman Login dengan reCAPTCHA Google, klik pada ikon untuk pasangan kunci API.",
'general' => "Umum",
'general_configuration' => "Pengaturan Umum",
'giftcard_number' => "Nomor Kartu Hadiah",
'giftcard_random' => "Hasilkan acak",
'giftcard_series' => "Hasilkan dalam seri",
'image_allowed_file_types' => "Jenis berkas yang diizinkan",
'image_max_height_tooltip' => "Tinggi maksimum unggahan gambar yang diizinkan dalam piksel (px).",
'image_max_size_tooltip' => "ukuran berkas maksimum yang diijinkan untuk mengunggah gambar dalam kilobyte (kb).",
'image_max_width_tooltip' => "Lebar maksimum yang diunggah dari pengunggahan gambar dalam piksel (px).",
'image_restrictions' => "Pembatasan Pengunggahan Gambar",
'include_hsn' => "Termasuk dukungan kode HSN",
'info' => "Informasi",
'info_configuration' => "Informasi Toko",
'input_groups' => "Grup masukan",
'integrations' => "Integrasi",
'integrations_configuration' => "Integrasi pihak ketiga",
'invoice' => "Faktur",
'invoice_configuration' => "Pengaturan cetak faktur",
'invoice_default_comments' => "Komentar faktur",
'invoice_email_message' => "Templat email faktur",
'invoice_enable' => "Mengaktifkan faktur",
'invoice_printer' => "Pencetak Faktur",
'invoice_type' => "Tipe Faktur",
'is_readable' => "dapat dibaca, tetapi izin tidak disetel dengan benar. Setel ke 640 atau 660, kemudian segarkan.",
'is_writable' => "bisa ditulis, tetapi izin tidak disetel dengan benar. Setel ke 750 dan segarkan.",
'item_markup' => "",
'jsprintsetup_required' => "Perhatian! Fungsi ini hanya berjalan jika anda menggunakan Firefox yang memiliki tambahan jsPrintSetup. Tetap simpan?",
'language' => "Bahasa",
'last_used_invoice_number' => "Nomor terakhir faktur",
'last_used_quote_number' => "Nomor Penawaran yang terakhir digunakan",
'last_used_work_order_number' => "Nomor W/O yang terakhir dipakai",
'left' => "Kiri",
'license' => "Lisensi",
'license_configuration' => "Pernyataan Lisensi",
'line_sequence' => "Urutan baris",
'lines_per_page' => "Baris per halaman",
'lines_per_page_number' => "Baris per halaman harus berupa angka.",
'lines_per_page_required' => "Baris per halaman tidak boleh kosong.",
'locale' => "Terjemahan",
'locale_configuration' => "Konfigurasi Terjemahan",
'locale_info' => "Informasi Konfigurasi Terjemahan",
'location' => "Lokasi Stock",
'location_configuration' => "Lokasi Stock",
'location_info' => "Informasi konfigurasi lokasi stock",
'login_form' => "Gaya Formulir Log Masuk",
'logout' => "Apakah Anda akan membuat cadangan sebelum anda keluar? Klik [OK] untuk pencadangan, [Batal] untuk keluar.",
'mailchimp' => "MailChimp",
'mailchimp_api_key' => "Kunci API MailChimp",
'mailchimp_configuration' => "Pengaturan MailChimp",
'mailchimp_key_successfully' => "Kunci API benar.",
'mailchimp_key_unsuccessfully' => "Kunci API tidak valid.",
'mailchimp_lists' => "Daftar MailChimp",
'mailchimp_tooltip' => "Klik pada ikon untuk KUnci API.",
'message' => "Pesan",
'message_configuration' => "Pengaturan Pesan",
'msg_msg' => "Pesan teks tersimpan",
'msg_msg_placeholder' => "Apakah Anda ingin menggunakan template SMS menyimpan pesan Anda disini? Jika tidak, biarkan kosong.",
'msg_pwd' => "SMS-API Password",
'msg_pwd_required' => "SMS-API Password harus diisi",
'msg_src' => "ID pengirim SMS-API",
'msg_src_required' => "SMS-API Sender ID harus diisi",
'msg_uid' => "SMS-API User Name",
'msg_uid_required' => "SMS-API Username harus diisi",
'multi_pack_enabled' => "Multi paket per item",
'no_risk' => "Tidak ada risiko keamanan / kerentanan.",
'none' => "none",
'notify_alignment' => "Posisi notifikasi Popup",
'number_format' => "Format Nomor",
'number_locale' => "Terjemahan",
'number_locale_invalid' => "Kode bahasa salah. Cek tautan pada tooltip untuk mendapatkan kode bahasa yang benar.",
'number_locale_required' => "Kode Lokal wajib diisi.",
'number_locale_tooltip' => "Menemukan kode lokal melalui link ini.",
'os_timezone' => "Zona waktu OSPOS:",
'ospos_info' => "Info pemasangan OSPOS",
'payment_options_order' => "Urutan pilihan pembayaran",
'perm_risk' => "Setelan izin yang salah berbahaya bagi keamanan perangkat lunak.",
'phone' => "Telepon Perusahaan",
'phone_required' => "Telepon Perusahaan wajib diisi.",
'print_bottom_margin' => "Margin Bawah",
'print_bottom_margin_number' => "Default margin bawah harus angka.",
'print_bottom_margin_required' => "Default margin Bawah harus di isi.",
'print_delay_autoreturn' => "Otomatis Retur pada penundaan Penjualan",
'print_delay_autoreturn_number' => "Kolom Otomatis Retur pada Penundaan Penjualan harus diisi.",
'print_delay_autoreturn_required' => "Pengembalian otomatis untuk Penjualan tertunda harus berupa angka.",
'print_footer' => "Mencetak Footer Browser",
'print_header' => "Mencetak Browser Header",
'print_left_margin' => "Margin Kiri",
'print_left_margin_number' => "Margin kiri harus berupa angka.",
'print_left_margin_required' => "Margin kiri wajib di isi.",
'print_receipt_check_behaviour' => "Centang Cetak Struk",
'print_receipt_check_behaviour_always' => "Selalu dicentang",
'print_receipt_check_behaviour_last' => "Ingat pilihan terakhir",
'print_receipt_check_behaviour_never' => "Selalu tidak dicentang",
'print_right_margin' => "Margin kanan",
'print_right_margin_number' => "Margin kiri harus berupa angka.",
'print_right_margin_required' => "Margin kanan wajib di isi.",
'print_silently' => "Tampilkan Print Dialog",
'print_top_margin' => "Margin atas",
'print_top_margin_number' => "Nilai margin atas harus di isi angka.",
'print_top_margin_required' => "Margin atas wajib di isi.",
'quantity_decimals' => "Desimal untuk Jumlah",
'quick_cash_enable' => "",
'quote_default_comments' => "Komentar faktur",
'receipt' => "Struk Penerimaan",
'receipt_category' => "",
'receipt_configuration' => "Struk Print Settings",
'receipt_default' => "Default",
'receipt_font_size' => "Ukuran Font",
'receipt_font_size_number' => "Ukuran font harus berupa angka.",
'receipt_font_size_required' => "Ukuran font harus diisi.",
'receipt_info' => "Struk Konfigurasi Informasi",
'receipt_printer' => "Tiket Printer",
'receipt_short' => "Ringkas",
'receipt_show_company_name' => "Tampilkan nama perusahaan",
'receipt_show_description' => "Tampilkan deskripsi",
'receipt_show_serialnumber' => "Tampilkan nomor seri",
'receipt_show_tax_ind' => "Tampilkan Indikator Pajak",
'receipt_show_taxes' => "Tampilkan pajak",
'receipt_show_total_discount' => "Tampilkan total diskon",
'receipt_template' => "Template struk",
'receiving_calculate_average_price' => "Menghitung harga rata-rata (Penerimaan)",
'recv_invoice_format' => "Format Faktur",
'register_mode_default' => "Default register mode",
'report_an_issue' => "Laporkan masalah",
'return_policy_required' => "Kebijakan retur wajib diisi.",
'reward' => "Hadiah",
'reward_configuration' => "Konfigurasi Hadiah",
'right' => "Kanan",
'sales_invoice_format' => "Format Faktur Penjualan",
'sales_quote_format' => "Format Penawaran Penjualan",
'saved_successfully' => "Konfigurasi berhasil disimpan.",
'saved_unsuccessfully' => "Konfigurasi tidak berhasil disimpan.",
'security_issue' => "Peringatan Kerentanan Keamanan",
'server_notice' => "Silakan gunakan info di bawah ini untuk pelaporan masalah.",
'service_charge' => "",
'show_due_enable' => "",
'show_office_group' => "Tampilkan ikon kantor",
'statistics' => "Kirim statistik",
'statistics_tooltip' => "Kirim statistik untuk pengembangan dan peningkatan fitur.",
'stock_location' => "Lokasi Stock",
'stock_location_duplicate' => "Gunakan nama yang unik untuk lokasi stock.",
'stock_location_invalid_chars' => "Nama lokasi tidak boleh berisi karakter '_'.",
'stock_location_required' => "Nomor lokasi stock harus diisi.",
'suggestions_fifth_column' => "",
'suggestions_first_column' => "Kolom 1",
'suggestions_fourth_column' => "",
'suggestions_layout' => "Tampilan Saran Pencarian",
'suggestions_second_column' => "Kolom 2",
'suggestions_third_column' => "Kolom 3",
'system_conf' => "Setting & Conf",
'system_info' => "System Info",
'table' => "Meja",
'table_configuration' => "Konfigurasi Meja",
'takings_printer' => "Struk Printer",
'tax' => "Pajak",
'tax_category' => "Kategori Pajak",
'tax_category_duplicate' => "Kategori pajak yang dimasukkan sudah ada.",
'tax_category_invalid_chars' => "Kategori pajak yang dimasukkan tidak valid.",
'tax_category_required' => "Kategori pajak dibutuhkan.",
'tax_category_used' => "Kategori pajak tidak bisa dihapus karena sedang digunakan.",
'tax_configuration' => "Konfigurasi Pajak",
'tax_decimals' => "Pajak Decimals",
'tax_id' => "Id Pajak",
'tax_included' => "Dikenakan Pajak",
'theme' => "Tema",
'theme_preview' => "Pratinjau Tema:",
'thousands_separator' => "Pemisah Ribuan",
'timezone' => "Zona Waktu",
'timezone_error' => "Zona Waktu OSPOS berbeda dari Zona Waktu Anda.",
'top' => "Atas",
'use_destination_based_tax' => "Gunakan Pajak Berdasarkan Tujuan",
'user_timezone' => "Zona waktu lokal:",
'website' => "Situs Perusahaan",
'wholesale_markup' => "",
'work_order_enable' => "Dukungan Work Order",
'work_order_format' => "Format Work Order",
];

View File

@@ -1,57 +1,57 @@
<?php
return [
"account_number" => "Akun #",
"account_number_duplicate" => "Nomor akun ini telah ada di basis data.",
"available_points" => "Poin tersedia",
"available_points_value" => "",
"average" => "Rata-rata yang dihabiskan",
"avg_discount" => "Rata-rata diskon",
"basic_information" => "Informasi",
"cannot_be_deleted" => "Pelanggan terpilih tidak bisa dihapus. satu atau lebih dari pelanggan yang dipilih memiliki penjualan.",
"company_name" => "Perusahaan",
"confirm_delete" => "Apakah Anda yakin ingin menghapus pelanggan yang dipilih?",
"confirm_restore" => "Anda yakin akan mengembalikan pelanggan terpilih?",
"consent" => "Persetujuan pendaftaran",
"consent_required" => "Persetujuan pendaftaran adalah bidang yang harus diisi.",
"csv_import_failed" => "Gagal impor CSV",
"csv_import_nodata_wrongformat" => "Berkas yang Anda unggah tidak berisi data atau salah format.",
"csv_import_partially_failed" => "Impor pelanggan berhasil dwngan beberapa kesalahan:",
"csv_import_success" => "Impor pelanggan berhasil.",
"customer" => "Pelanggan",
"date" => "Tanggal",
"discount" => "Diskon",
"discount_fixed" => "Diskon Tetap",
"discount_percent" => "Persentase Diskon",
"discount_type" => "Jenis Diskon",
"email_duplicate" => "Alamat email telah digunakan.",
"employee" => "Karyawan",
"error_adding_updating" => "Kesalahan ketika menambah atau memperbaharui pelanggan.",
"import_items_csv" => "Impor pelanggan dari CSV",
"mailchimp_activity_click" => "Klik Email",
"mailchimp_activity_lastopen" => "Email yang terakhir dibuka",
"mailchimp_activity_open" => "Buka email",
"mailchimp_activity_total" => "Email terkirim",
"mailchimp_activity_unopen" => "Email belum dibuka",
"mailchimp_email_client" => "Klien email",
"mailchimp_info" => "MailChimp",
"mailchimp_member_rating" => "Peringkat",
"mailchimp_status" => "Status",
"mailchimp_vip" => "VIP",
"max" => "Max. dihabiskan",
"min" => "Min. dihabiskan",
"new" => "Pelanggan Baru",
"none_selected" => "Anda belum memilih pelanggan untuk dihapus.",
"one_or_multiple" => "Pelanggan",
"quantity" => "Kuantitas",
"stats_info" => "Statistik",
"successful_adding" => "Anda telah berhasil menambah pelanggan",
"successful_deleted" => "Berhasil menghapus Kartu Hadiah",
"successful_updating" => "Anda telah berhasil memperbarui pelanggan",
"tax_code" => "Kode pajak",
"tax_id" => "ID Pajak",
"taxable" => "Dikenakan pajak",
"total" => "Total",
"update" => "Ubah Pelanggan",
"rewards_package" => "Paket Hadiah",
'account_number' => "Akun #",
'account_number_duplicate' => "Nomor akun ini telah ada di basis data.",
'available_points' => "Poin tersedia",
'available_points_value' => "",
'average' => "Rata-rata yang dihabiskan",
'avg_discount' => "Rata-rata diskon",
'basic_information' => "Informasi",
'cannot_be_deleted' => "Pelanggan terpilih tidak bisa dihapus. satu atau lebih dari pelanggan yang dipilih memiliki penjualan.",
'company_name' => "Perusahaan",
'confirm_delete' => "Apakah Anda yakin ingin menghapus pelanggan yang dipilih?",
'confirm_restore' => "Anda yakin akan mengembalikan pelanggan terpilih?",
'consent' => "Persetujuan pendaftaran",
'consent_required' => "Persetujuan pendaftaran adalah bidang yang harus diisi.",
'csv_import_failed' => "Gagal impor CSV",
'csv_import_nodata_wrongformat' => "Berkas yang Anda unggah tidak berisi data atau salah format.",
'csv_import_partially_failed' => "Impor pelanggan berhasil dengan beberapa kesalahan:",
'csv_import_success' => "Impor pelanggan berhasil.",
'customer' => "Pelanggan",
'date' => "Tanggal",
'discount' => "Diskon",
'discount_fixed' => "Diskon Tetap",
'discount_percent' => "Persentase Diskon",
'discount_type' => "Jenis Diskon",
'email_duplicate' => "Alamat email telah digunakan.",
'employee' => "Karyawan",
'error_adding_updating' => "Kesalahan ketika menambah atau memperbaharui pelanggan.",
'import_items_csv' => "Impor pelanggan dari CSV",
'mailchimp_activity_click' => "Klik Email",
'mailchimp_activity_lastopen' => "Email yang terakhir dibuka",
'mailchimp_activity_open' => "Buka email",
'mailchimp_activity_total' => "Email terkirim",
'mailchimp_activity_unopen' => "Email belum dibuka",
'mailchimp_email_client' => "Klien email",
'mailchimp_info' => "MailChimp",
'mailchimp_member_rating' => "Peringkat",
'mailchimp_status' => "Status",
'mailchimp_vip' => "VIP",
'max' => "Max. dihabiskan",
'min' => "Min. dihabiskan",
'new' => "Pelanggan Baru",
'none_selected' => "Anda belum memilih pelanggan untuk dihapus.",
'one_or_multiple' => "Pelanggan",
'quantity' => "Kuantitas",
'stats_info' => "Statistik",
'successful_adding' => "Anda telah berhasil menambah pelanggan",
'successful_deleted' => "Berhasil menghapus Kartu Hadiah",
'successful_updating' => "Anda telah berhasil memperbarui pelanggan",
'tax_code' => "Kode pajak",
'tax_id' => "ID Pajak",
'taxable' => "Dikenakan pajak",
'total' => "Total",
'update' => "Ubah Pelanggan",
'rewards_package' => "Paket Hadiah",
];

View File

@@ -1,49 +1,49 @@
<?php
return [
"admin_cashups" => "",
"admin_cashups_desc" => "",
"attributes" => "Atribut",
"attributes_desc" => "Tambah, Perbaharui, Hapus dan Cari atribut.",
"both" => "Keduanya",
"cashups" => "Kasir",
"cashups_desc" => "Tambah, Perbaharui, Hapus dan Cari Uang Tunai.",
"config" => "Konfigurasi",
"config_desc" => "Ubah Konfigurasi Toko.",
"customers" => "Pelanggan",
"customers_desc" => "Tambah, ubah, hapus, dan cari Pelanggan.",
"employees" => "Karyawan",
"employees_desc" => "Tambah, ubah, hapus, dan cari Karyawan.",
"expenses" => "Biaya",
"expenses_categories" => "Kategori Biaya",
"expenses_categories_desc" => "Tambah, Edit, dan Hapus Kategori Biaya.",
"expenses_desc" => "Tambah, ubah, hapus, dan cari Biaya.",
"giftcards" => "Gift Card",
"giftcards_desc" => "Tambah, ubah, hapus dan cari Gift Card.",
"home" => "Beranda",
"home_desc" => "Daftar modul menu Beranda.",
"item_kits" => "Item Paket",
"item_kits_desc" => "Tambah, ubah, hapus, dan cari Item Paket.",
"items" => "Item Barang",
"items_desc" => "Tambah, ubah, hapus, dan cari Item.",
"messages" => "Messages",
"messages_desc" => "Kirim pesan pada Pelanggan, Pemasok, dan Karyawan.",
"migrate" => "Migrasi",
"migrate_desc" => "Perbaharui basis data OSPOS.",
"office" => "Kantor",
"office_desc" => "Daftar modul menu Kantor.",
"receivings" => "Penerimaan",
"receivings_desc" => "Proses Pesanan Pembelian.",
"reports" => "Laporan",
"reports_desc" => "Lihat dan Cetak Laporan.",
"sales" => "Penjualan",
"sales_desc" => "Proses Penjualan dan Retur.",
"suppliers" => "Pemasok",
"suppliers_desc" => "Tambah, ubah, hapus dan cari Pemasok.",
"taxes" => "Pajak",
"taxes_desc" => "Konfigurasi Pajak Penjualan.",
"timeclocks" => "",
"timeclocks_categories" => "",
"timeclocks_categories_desc" => "",
"timeclocks_desc" => "",
'admin_cashups' => "",
'admin_cashups_desc' => "",
'attributes' => "Atribut",
'attributes_desc' => "Tambah, Perbaharui, Hapus dan Cari atribut.",
'both' => "Keduanya",
'cashups' => "Kasir",
'cashups_desc' => "Tambah, Perbaharui, Hapus dan Cari Uang Tunai.",
'config' => "Konfigurasi",
'config_desc' => "Ubah Konfigurasi Toko.",
'customers' => "Pelanggan",
'customers_desc' => "Tambah, ubah, hapus, dan cari Pelanggan.",
'employees' => "Karyawan",
'employees_desc' => "Tambah, ubah, hapus, dan cari Karyawan.",
'expenses' => "Biaya",
'expenses_categories' => "Kategori Biaya",
'expenses_categories_desc' => "Tambah, Edit, dan Hapus Kategori Biaya.",
'expenses_desc' => "Tambah, ubah, hapus, dan cari Biaya.",
'giftcards' => "Kartu Hadiah",
'giftcards_desc' => "Tambah, ubah, hapus dan cari Gift Card.",
'home' => "Beranda",
'home_desc' => "Daftar modul menu Beranda.",
'item_kits' => "Item Paket",
'item_kits_desc' => "Tambah, ubah, hapus, dan cari Item Paket.",
'items' => "Item Barang",
'items_desc' => "Tambah, ubah, hapus, dan cari Item.",
'messages' => "Pesan",
'messages_desc' => "Kirim pesan pada Pelanggan, Pemasok, dan Karyawan.",
'migrate' => "Migrasi",
'migrate_desc' => "Perbaharui basis data OSPOS.",
'office' => "Kantor",
'office_desc' => "Daftar modul menu Kantor.",
'receivings' => "Penerimaan",
'receivings_desc' => "Proses Pesanan Pembelian.",
'reports' => "Laporan",
'reports_desc' => "Lihat dan Cetak Laporan.",
'sales' => "Penjualan",
'sales_desc' => "Proses Penjualan dan Retur.",
'suppliers' => "Pemasok",
'suppliers_desc' => "Tambah, ubah, hapus dan cari Pemasok.",
'taxes' => "Pajak",
'taxes_desc' => "Konfigurasi Pajak Penjualan.",
'timeclocks' => "",
'timeclocks_categories' => "",
'timeclocks_categories_desc' => "",
'timeclocks_desc' => "",
];

View File

@@ -1,12 +1,12 @@
<?php
return [
"all" => "Tudo",
"columns" => "Colunas",
"hide_show_pagination" => "Ocultar/Exibir paginação",
"loading" => "Carregando, aguarde...",
"page_from_to" => "Exibindo {0} até {1} de {2} linhas",
"refresh" => "Recarregar",
"rows_per_page" => "{0} registros por página",
"toggle" => "Ocultar/Exibir paginação",
'all' => "Tudo",
'columns' => "Colunas",
'hide_show_pagination' => "Ocultar/Exibir paginação",
'loading' => "Carregando, aguarde...",
'page_from_to' => "Exibindo {0} até {1} de {2} linhas",
'refresh' => "Recarregar",
'rows_per_page' => "registros por página",
'toggle' => "Ocultar/Exibir paginação",
];

View File

@@ -1,89 +1,89 @@
<?php
return [
"address_1" => "Endereço",
"address_2" => "Complemento",
"admin" => "",
"city" => "Cidade",
"clerk" => "",
"close" => "Fechar",
"color" => "",
"comments" => "Comentários",
"common" => "comum",
"confirm_search" => "Você selecionou uma ou mais linhas, estes não serão mais selecionados após a sua pesquisa. Tem certeza de que deseja enviar esta pesquisa?",
"copyrights" => "© 2010 - {0}",
"correct_errors" => "Por favor, corrija os erros identificados antes de salvar",
"country" => "País",
"dashboard" => "",
"date" => "Data",
"delete" => "Apagar",
"det" => "detalhes",
"download_import_template" => "Baixar Modelo de importação CSV(CSV)",
"edit" => "editar",
"email" => "e-mail",
"email_invalid_format" => "O formato do e-mail não é válido.",
"export_csv" => "Exportar para CSV",
"export_csv_no" => "Não",
"export_csv_yes" => "Sim",
"fields_required_message" => "Campos em vermelho são obrigatórios",
"fields_required_message_unique" => "",
"first_name" => "Nome",
"first_name_required" => "O nome é requerido.",
"first_page" => "Primeira",
"gender" => "Sexo",
"gender_female" => "F",
"gender_male" => "M",
"gender_undefined" => "",
"icon" => "",
"id" => "Id",
"import" => "Importar",
"import_change_file" => "Requerido",
"import_csv" => "Importar do CSV",
"import_full_path" => "Caminho completo para o arquivo do CSV é necessário",
"import_remove_file" => "Remover",
"import_select_file" => "Selecionar o arquivo",
"inv" => "fat",
"last_name" => "Sobrenome",
"last_name_required" => "O sobrenome é requerido.",
"last_page" => "Última",
"learn_about_project" => "no GitHub.",
"list_of" => "Lista de",
"logo" => "",
"logo_mark" => "",
"logout" => "Sair",
"manager" => "",
"migration_needed" => "Uma migração do banco de dados para {0} será iniciada após o login.",
"new" => "Novo",
"no" => "",
"no_persons_to_display" => "Não existem pessoas para mostrar.",
"none_selected_text" => "Selecione",
"or" => "ou",
"people" => "",
"phone_number" => "Telefone",
"phone_number_required" => "Número do telefone é requerido",
"please_visit_my" => "Para saber mais sobre esta aplicação visite o website do projeto |",
"position" => "",
"powered_by" => "Desenvolvido por",
"price" => "Preço",
"print" => "Imprimir",
"remove" => "Remover",
"required" => "Requerido",
"restore" => "Restaurar",
"return_policy" => "Política",
"search" => "Pesquisar",
"search_options" => "Opções de pesquisa",
"searched_for" => "Pesquisar por",
"software_short" => "",
"software_title" => "",
"state" => "Estado",
"submit" => "Enviar",
"total_spent" => "Total gasto",
"unknown" => "Desconhecido",
"view_recent_sales" => "Ver Vendas Recentes",
"website" => "opensourcepos.org",
"welcome" => "Bem-vindo",
"welcome_message" => "Bem-vindo.",
"yes" => "",
"you_are_using_ospos" => "Você está usando Open Source Point Of Sale Versão",
"zip" => "CEP",
'address_1' => "Endereço",
'address_2' => "Complemento",
'admin' => "",
'city' => "Cidade",
'clerk' => "",
'close' => "Fechar",
'color' => "",
'comments' => "Comentários",
'common' => "comum",
'confirm_search' => "Você selecionou uma ou mais linhas, estes não serão mais selecionados após a sua pesquisa. Tem certeza de que deseja enviar esta pesquisa?",
'copyrights' => "© 2010 - {0}",
'correct_errors' => "Por favor, corrija os erros identificados antes de salvar",
'country' => "País",
'dashboard' => "",
'date' => "Data",
'delete' => "Apagar",
'det' => "detalhes",
'download_import_template' => "Baixar Modelo de importação CSV(CSV)",
'edit' => "editar",
'email' => "e-mail",
'email_invalid_format' => "O formato do e-mail não é válido.",
'export_csv' => "Exportar para CSV",
'export_csv_no' => "Não",
'export_csv_yes' => "Sim",
'fields_required_message' => "Campos em vermelho são obrigatórios",
'fields_required_message_unique' => "",
'first_name' => "Nome",
'first_name_required' => "O nome é requerido.",
'first_page' => "Primeira",
'gender' => "Sexo",
'gender_female' => "F",
'gender_male' => "M",
'gender_undefined' => "",
'icon' => "Ícone",
'id' => "Id",
'import' => "Importar",
'import_change_file' => "Requerido",
'import_csv' => "Importar do CSV",
'import_full_path' => "Caminho completo para o arquivo do CSV é necessário",
'import_remove_file' => "Remover",
'import_select_file' => "Selecionar o arquivo",
'inv' => "fat",
'last_name' => "Sobrenome",
'last_name_required' => "O sobrenome é requerido.",
'last_page' => "Última",
'learn_about_project' => "no GitHub.",
'list_of' => "Lista de",
'logo' => "Logotipo",
'logo_mark' => "Símbolo da marca",
'logout' => "Sair",
'manager' => "",
'migration_needed' => "Uma migração do banco de dados para {0} será iniciada após o login.",
'new' => "Novo",
'no' => "nao",
'no_persons_to_display' => "Não existem pessoas para mostrar.",
'none_selected_text' => "Selecione",
'or' => "ou",
'people' => "",
'phone_number' => "Telefone",
'phone_number_required' => "Número do telefone é requerido",
'please_visit_my' => "Para saber mais sobre esta aplicação visite o website do projeto |",
'position' => "",
'powered_by' => "Desenvolvido por",
'price' => "Preço",
'print' => "Imprimir",
'remove' => "Remover",
'required' => "Requerido",
'restore' => "Restaurar",
'return_policy' => "Política",
'search' => "Pesquisar",
'search_options' => "Opções de pesquisa",
'searched_for' => "Pesquisar por",
'software_short' => "ospos",
'software_title' => "Ponto de Venda de Código Aberto",
'state' => "Estado",
'submit' => "Enviar",
'total_spent' => "Total gasto",
'unknown' => "Desconhecido",
'view_recent_sales' => "Ver Vendas Recentes",
'website' => "opensourcepos.org",
'welcome' => "Bem-vindo",
'welcome_message' => "Bem-vindo.",
'yes' => "sim",
'you_are_using_ospos' => "Você está usando Open Source Point Of Sale Versão",
'zip' => "CEP",
];

View File

@@ -1,16 +1,16 @@
<?php
return [
"gcaptcha" => "Não sou um robô.",
"go" => "Entrar",
"invalid_gcaptcha" => "Inválido eu não sou um robô.",
"invalid_installation" => "A instalação não está correta, verifique o seu arquivo php.ini.",
"invalid_username_and_password" => "Usuário ou senha inválido.",
"login" => "Autenticação",
"logout" => "",
"migration_needed" => "",
"password" => "Senha",
"required_username" => "",
"username" => "Usuário",
"welcome" => "",
'gcaptcha' => "Não sou um robô.",
'go' => "Entrar",
'invalid_gcaptcha' => "Inválido eu não sou um robô.",
'invalid_installation' => "A instalação não está correta, verifique o seu arquivo php.ini.",
'invalid_username_and_password' => "Usuário ou senha inválido.",
'login' => "Autenticação",
'logout' => "Sair",
'migration_needed' => "Uma migração do banco de dados para {0} será iniciada após o login.",
'password' => "Senha",
'required_username' => "O campo nome de usuário é obrigatório.",
'username' => "Usuário",
'welcome' => "Bem-vindo",
];

View File

@@ -147,7 +147,7 @@ class Barcode_lib
$barcode = $this->generate_barcode($item, $barcode_config);
$display_table = '<table>';
$display_table .= '<tr><td style="text-align: center;">' . $this->manage_display_layout($barcode_config['barcode_first_row'], $item, $barcode_config) . '</td></tr>';
$display_table .= '<tr><td style="text-align: center;"><div class="barcode">$barcode</div></td></tr>';
$display_table .= '<tr><td style="text-align: center;"><div class="barcode">'.$barcode.'</div></td></tr>';
$display_table .= '<tr><td style="text-align: center;">' . $this->manage_display_layout($barcode_config['barcode_second_row'], $item, $barcode_config) . '</td></tr>';
$display_table .= '<tr><td style="text-align: center;">' . $this->manage_display_layout($barcode_config['barcode_third_row'], $item, $barcode_config) . '</td></tr>';
$display_table .= '</table>';

View File

@@ -5,6 +5,7 @@ namespace app\Libraries;
use CodeIgniter\Email\Email;
use CodeIgniter\Encryption\Encryption;
use CodeIgniter\Encryption\EncrypterInterface;
use CodeIgniter\Encryption\Exceptions\EncryptionException;
use Config\OSPOS;
use Config\Services;
@@ -28,8 +29,15 @@ class Email_lib
$encrypter = Services::encrypter();
$smtp_pass = $this->config['smtp_pass'];
if (!empty($smtp_pass)) {
$smtp_pass = $encrypter->decrypt($smtp_pass);
if (!empty($smtp_pass) && check_encryption()) {
try {
$smtp_pass = $encrypter->decrypt($smtp_pass);
} catch (\EncryptionException $e) {
// Decryption failed, use the original value
log_message('error', 'SMTP password decryption failed: ' . $e->getMessage());
$smtp_pass = '';
}
}
$email_config = [
@@ -63,12 +71,13 @@ class Email_lib
if (!empty($attachment)) {
$email->attach($attachment);
$email->setAttachmentCID($attachment);
}
$result = $email->send();
if (!$result) {
error_log($email->printDebugger());
log_message('error', $email->printDebugger());
}
return $result;

View File

@@ -9,6 +9,7 @@ use CodeIgniter\Model;
use CodeIgniter\Database\RawSql;
use Config\OSPOS;
use DateTime;
use InvalidArgumentException;
use stdClass;
use ReflectionClass;
@@ -486,7 +487,7 @@ class Attribute extends Model
}
$this->delete_orphaned_links($definition_id);
$this->delete_orphaned_values();
$this->deleteOrphanedValues();
return $success;
}
@@ -514,43 +515,42 @@ class Attribute extends Model
/**
* Inserts or updates a definition
*/
public function save_definition(array &$definition_data, int $definition_id = NO_DEFINITION_ID): bool
public function saveDefinition(array &$definitionData, int $definitionId = NO_DEFINITION_ID): bool
{
$this->db->transStart();
// Definition doesn't exist
if ($definition_id === NO_DEFINITION_ID || !$this->exists($definition_id)) {
if ($this->exists($definition_id, true)) {
$success = $this->undelete($definition_id);
// Insert definition
if ($definitionId === NO_DEFINITION_ID || !$this->exists($definitionId)) {
if ($this->exists($definitionId, true)) {
$success = $this->undelete($definitionId);
} else {
$builder = $this->db->table('attribute_definitions');
$success = $builder->insert($definition_data);
$definition_data['definition_id'] = $this->db->insertID();
$success = $builder->insert($definitionData);
$definitionData['definition_id'] = $definitionId !== CATEGORY_DEFINITION_ID ? $this->db->insertID() : $definitionId;
}
}
// Definition already exists
// Update definition
else {
$builder = $this->db->table('attribute_definitions');
$builder->select('definition_type');
$builder->where('definition_id', $definition_id);
$builder->where('definition_id', $definitionId);
$builder->where('deleted', ACTIVE);
$query = $builder->get();
$row = $query->getRow();
$from_definition_type = $row->definition_type;
$to_definition_type = $definition_data['definition_type'];
$to_definition_type = $definitionData['definition_type'];
// Update the definition values
$builder->where('definition_id', $definition_id);
// Update definition values
$builder->where('definition_id', $definitionId);
$success = $builder->update($definitionData);
$definitionData['definition_id'] = $definitionId;
$success = $builder->update($definition_data);
$definition_data['definition_id'] = $definition_id;
if ($from_definition_type !== $to_definition_type) {
if (!$this->convert_definition_data($definition_id, $from_definition_type, $to_definition_type)) {
return false;
}
if ($from_definition_type !== $to_definition_type
&& !$this->convert_definition_data($definitionId, $from_definition_type, $to_definition_type)) {
return false;
}
}
@@ -602,8 +602,8 @@ class Attribute extends Model
$builder->update();
} else {
$data = [
'attribute_id' => $attributeId,
'item_id' => $itemId,
'attribute_id' => empty($attributeId) ? null : $attributeId,
'item_id' => empty($itemId) ? null : $itemId,
'definition_id' => $definitionId
];
$builder->insert($data);
@@ -615,24 +615,28 @@ class Attribute extends Model
}
/**
* @param int $item_id
* @param int|bool $definition_id
* @return bool
* Deletes attribute links for a given item and optionally a given definition. Does not delete links where sale_id
* or receiving_id has a value. If a definitionId is not provided, deletes all attribute links for the item that do
* not have a sale_id or receiving_id value.
*
* @param int $itemId The item ID to delete links for.
* @param int|bool $definitionId The definition ID to delete links for. (optional)
* @return bool true if successful, false otherwise
*/
public function deleteAttributeLinks(int $item_id, int|bool $definition_id = false): bool
public function deleteAttributeLinks(int $itemId, int|bool $definitionId = false): bool
{
$delete_data = ['item_id' => $item_id];
$deleteData = ['item_id' => $itemId];
// Exclude rows where sale_id or receiving_id has a value
$builder = $this->db->table('attribute_links');
$builder->where('sale_id', null);
$builder->where('receiving_id', null);
if (!empty($definition_id)) {
$delete_data += ['definition_id' => $definition_id];
if (!empty($definitionId)) {
$deleteData += ['definition_id' => $definitionId];
}
return $builder->delete($delete_data);
return $builder->delete($deleteData);
}
/**
@@ -691,7 +695,7 @@ class Attribute extends Model
* @param int $definition_id
* @return object|null
*/
public function get_attribute_value(int $item_id, int $definition_id): ?object
public function getAttributeValue(int $item_id, int $definition_id): ?object
{
$builder = $this->db->table('attribute_values');
$builder->join('attribute_links', 'attribute_links.attribute_id = attribute_values.attribute_id');
@@ -708,6 +712,31 @@ class Attribute extends Model
return $this->getEmptyObject('attribute_values');
}
/**
* Gets a single attribute value by attribute ID.
*
* @param int $attributeId The attribute ID to look up
* @param string $dataType The column name to retrieve (attribute_value, attribute_date, or attribute_decimal)
* @return string|float|null The attribute value. Note: MySQL returns values as follows:
* - attribute_value (TEXT): string
* - attribute_date (DATE): string in 'Y-m-d' format
* - attribute_decimal (DECIMAL): string or float depending on CodeIgniter configuration
* Returns null if the attribute_id is not found.
*/
public function getAttributeValueByAttributeId(int $attributeId, string $dataType): string|float|null
{
helper('attribute');
validateAttributeValueType($dataType);
$builder = $this->db->table('attribute_values');
$builder->select($dataType);
$builder->where('attribute_id', $attributeId);
$builder->limit(1);
$row = $builder->get()->getRow();
return $row ? $row->$dataType : null;
}
/**
* Initializes an empty object based on database definitions
* @param string $table_name
@@ -794,67 +823,64 @@ class Attribute extends Model
}
/**
* @param string $attribute_value
* @param int $definition_id
* @param $item_id
* @param $attribute_id
* @param string $definition_type
* @return int
* Saves an attribute value and creates an attribute link between the attribute value and item if necessary.
* If the attribute value already exists, it will simply create a link to the existing attribute value.
* If the attribute value exists but only has capitalization differences, it will update the existing attribute
* value to match the new capitalization.
* @param string $attributeValue The attribute value to be saved.
* @param int $definitionId The ID of the attribute definition this value is associated with.
* @param int|bool $itemId The ID of the item to link this attribute value to. If false, NULL will be inserted into
* the database for that itemId indicating it is a dropdown value and not linked to a specific item.
* @param int|bool $attributeId The ID of the attribute value if it already exists and is being updated. If false,
* a new attribute value will be created.
* @param string $definitionType The type of the attribute definition which will dictate which column the attribute
* value is saved to.
* @return int The attribute ID of the saved attribute value.
*/
public function saveAttributeValue(string $attribute_value, int $definition_id, int|bool $item_id = false, int|bool $attribute_id = false, string $definition_type = DROPDOWN): int
public function saveAttributeValue(string $attributeValue, int $definitionId, int|bool $itemId = false, int|bool $attributeId = false, string $definitionType = DROPDOWN): int
{
$config = config(OSPOS::class)->settings;
helper('attribute');
$dataType = getAttributeDataType($definitionType);
if ($definitionType === DATE) {
$config = config(OSPOS::class)->settings;
$date = DateTime::createFromFormat($config['dateformat'], $attributeValue);
if ($date !== false) {
$attributeValue = $date->format('Y-m-d');
}
}
$this->db->transStart();
switch ($definition_type) {
case DATE:
$data_type = 'date';
$attribute_date_value = DateTime::createFromFormat($config['dateformat'], $attribute_value);
$attribute_value = $attribute_date_value->format('Y-m-d');
break;
case DECIMAL:
$data_type = 'decimal';
break;
default:
$data_type = 'value';
break;
}
$existingAttributeId = $this->attributeValueExists($attributeValue, $definitionType);
// New Attribute
if (empty($attribute_id) || empty($item_id)) {
$attribute_id = $this->attributeValueExists($attribute_value, $definition_type);
// Update
if ($existingAttributeId) {
$attributeId = $existingAttributeId;
$storedValue = $this->getAttributeValueByAttributeId($attributeId, $dataType);
if (!$attribute_id) {
$builder = $this->db->table('attribute_values');
$builder->set(["attribute_$data_type" => $attribute_value]);
$builder->insert();
$attribute_id = $this->db->insertID();
if ($dataType === 'attribute_value'
&& is_string($storedValue)
&& strcasecmp($storedValue, $attributeValue) === 0
&& $storedValue !== $attributeValue
) {
$this->updateAttributeValue($attributeId, $dataType, $attributeValue);
}
$data = [
'attribute_id' => empty($attribute_id) ? null : $attribute_id,
'item_id' => empty($item_id) ? null : $item_id,
'definition_id' => $definition_id
];
$builder = $this->db->table('attribute_links');
$builder->set($data);
$builder->insert();
}
// Existing Attribute
else {
} else {
// Insert
$builder = $this->db->table('attribute_values');
$builder->set(["attribute_$data_type" => $attribute_value]);
$builder->where('attribute_id', $attribute_id);
$builder->update();
$builder->set([$dataType => $attributeValue]);
$builder->insert();
$attributeId = $this->db->insertID();
}
if (!empty($definitionId)) {
$this->saveAttributeLink($itemId, $definitionId, $attributeId);
}
$this->db->transComplete();
return $attribute_id;
return $attributeId;
}
/**
@@ -887,15 +913,14 @@ class Attribute extends Model
return $builder->update(['deleted' => DELETED]);
}
/**
* Deletes attribute links by definition ID
*
* @param int|array $definition_id
*/
/**
* Deletes attribute links by definition ID
*
* @param int|array $definition_id
*/
public function deleteAttributeLinksByDefinitionId(int|array $definition_id): void
{
if(!is_array($definition_id))
{
if (!is_array($definition_id)) {
$definition_id = [$definition_id];
}
@@ -939,7 +964,7 @@ class Attribute extends Model
*
* @return boolean true is returned if the delete was successful or false if there were any failures
*/
public function delete_orphaned_values(): bool
public function deleteOrphanedValues(): bool
{
$subquery = $this->db->table('attribute_links')
->distinct()
@@ -1027,7 +1052,7 @@ class Attribute extends Model
*
* @param int $definitionId
* @param int $attributeId
* @return \CodeIgniter\Database\BaseBuilder
* @return void
*/
private function deleteAttributeLinksByDefinitionIdAndAttributeId(int $definitionId, int $attributeId): void
{
@@ -1038,4 +1063,41 @@ class Attribute extends Model
$builder->where('attribute_id', $attributeId);
$builder->delete();
}
/**
* Updates the attribute_value, attribute_date, or attribute_decimal column in the attribute_values table based on
* the provided data type for a specific attribute ID.
*
* @param int $attributeId
* @param string $dataType
* @param mixed $attributeValue
* @return void
*/
private function updateAttributeValue(int $attributeId, string $dataType, mixed $attributeValue): void
{
helper('attribute');
validateAttributeValueType($dataType);
// Update the attribute_values table
$builder = $this->db->table('attribute_values');
$builder->set([$dataType => $attributeValue]);
$builder->where('attribute_id', $attributeId);
$builder->update();
// Check if this attribute_id is linked to definition_id = -1 (category dropdown) using COUNT
$linkBuilder = $this->db->table('attribute_links');
$linkBuilder->selectCount('attribute_id', 'cnt');
$linkBuilder->where('attribute_id', $attributeId);
$linkBuilder->where('definition_id', CATEGORY_DEFINITION_ID);
$countRow = $linkBuilder->get()->getRow();
$isCategoryDropdownAttribute = $countRow && $countRow->cnt > 0;
// Update the items.category column to match new capitalization.
if ($isCategoryDropdownAttribute) {
$itemsBuilder = $this->db->table('items');
$itemsBuilder->set(['category' => $attributeValue]);
$itemsBuilder->where('category', $attributeValue);
$itemsBuilder->update();
}
}
}

View File

@@ -75,7 +75,7 @@ class Dinner_table extends Model
* @param int $dinner_table_id
* @return string
*/
public function get_name(int $dinner_table_id): string
public function get_name(?string $dinner_table_id): string
{
if (empty($dinner_table_id)) {
return '';

View File

@@ -520,7 +520,7 @@ class Employee extends Person
{
$success = false;
if (ENVIRONMENT != 'testing') {
if (!getenv('DISALLOW_PASSWORD_CHANGE')) {
$this->db->transStart();
$builder = $this->db->table('employees');

View File

@@ -347,7 +347,7 @@ class Giftcard extends Model
* @param string $giftcard_number Gift card number
* @return int The customer_id of the gift card if it exists, 0 otherwise.
*/
public function get_giftcard_customer(string $giftcard_number): int
public function get_giftcard_customer(string $giftcard_number): int|null
{
if (!$this->exists($this->get_giftcard_id($giftcard_number))) {
return 0;

View File

@@ -103,7 +103,7 @@ class Sale extends Model
/**
* Get number of rows for the takings (sales/manage) view
*/
public function get_found_rows(string $search, array $filters): int
public function get_found_rows(?string $search, array $filters): int
{
return $this->search($search, $filters, 0, 0, 'sales.sale_time', 'desc', true);
}
@@ -111,7 +111,7 @@ class Sale extends Model
/**
* Get the sales data for the takings (sales/manage) view
*/
public function search(string $search, array $filters, ?int $rows = 0, ?int $limit_from = 0, ?string $sort = 'sales.sale_time', ?string $order = 'desc', ?bool $count_only = false)
public function search(?string $search, array $filters, ?int $rows = 0, ?int $limit_from = 0, ?string $sort = 'sales.sale_time', ?string $order = 'desc', ?bool $count_only = false)
{
// Set default values
if ($rows == null) $rows = 0;
@@ -209,7 +209,7 @@ class Sale extends Model
/**
* Get the payment summary for the takings (sales/manage) view
*/
public function get_payments_summary(string $search, array $filters): array
public function get_payments_summary(?string $search, array $filters): array
{
$config = config(OSPOS::class)->settings;
@@ -311,7 +311,7 @@ class Sale extends Model
/**
* Gets search suggestions
*/
public function get_search_suggestions(string $search, int $limit = 25): array // TODO: $limit is never used.
public function get_search_suggestions(?string $search, int $limit = 25): array // TODO: $limit is never used.
{
$suggestions = [];
@@ -396,7 +396,7 @@ class Sale extends Model
/**
* Checks if valid receipt
*/
public function is_valid_receipt(string &$receipt_sale_id): bool // TODO: like the others, maybe this should be an array rather than a delimited string... either that or the parameter name needs to be changed. $receipt_sale_id implies that it's an int.
public function is_valid_receipt(string|null &$receipt_sale_id): bool // TODO: like the others, maybe this should be an array rather than a delimited string... either that or the parameter name needs to be changed. $receipt_sale_id implies that it's an int.
{
$config = config(OSPOS::class)->settings;
@@ -1449,7 +1449,7 @@ class Sale extends Model
* @param BaseBuilder $builder
* @return void
*/
private function add_filters_to_query(string $search, array $filters, BaseBuilder $builder): void
private function add_filters_to_query(?string $search, array $filters, BaseBuilder $builder): void
{
if (!empty($search)) { // TODO: this is duplicated code. We should think about refactoring out a method
if ($filters['is_valid_receipt']) {

View File

@@ -35,6 +35,9 @@ class Token_invoice_sequence extends Token
*/
public function get_value(bool $save = true): string
{
return $this->appconfig->acquire_next_invoice_sequence($save);
}
if (empty($this->value)) {
return $this->appconfig->acquire_next_invoice_sequence($save);
}
return $this->value;
}
}

View File

@@ -34,6 +34,9 @@ class Token_work_order_sequence extends Token
*/
public function get_value(bool $save = true): string
{
if ($this->value !== '') {
return $this->value;
}
return $this->appconfig->acquire_next_work_order_sequence($save);
}
}

View File

@@ -102,7 +102,7 @@
<script type="text/javascript">
(function() {
<?= view('partial/datepicker_locale', ['config' => '{ minView: 2, format: "' . dateformat_bootstrap($config['dateformat'] . '"}')]) ?>
<?= view('partial/datepicker_locale', ['format' => dateformat_bootstrap($config['dateformat'])]) ?>
var enable_delete = function() {
$('.remove_attribute_btn').click(function() {

View File

@@ -88,10 +88,10 @@ use Config\OSPOS;
<br><br>
File Permissions:<br>
&#187; [writeable/logs:]
&#187; [writable/logs:]
<?php $logs = WRITEPATH . 'logs/';
$uploads = FCPATH . 'uploads/';
$images = FCPATH . 'uploads/item_pics/';
$uploads = FCPATH. 'uploads/';
$images = FCPATH. 'uploads/item_pics/';
$importCustomers = WRITEPATH . '/uploads/importCustomers.csv'; // TODO: This variable does not follow naming conventions for the project.
if (is_writable($logs)) {
@@ -109,7 +109,7 @@ use Config\OSPOS;
clearstatcache();
?>
<br>
&#187; [writable/uploads:]
&#187; [public/uploads:]
<?php
if (is_writable($uploads)) {
echo ' - ' . substr(sprintf("%o", fileperms($uploads)), -4) . ' | ' . '<span style="color: green;"> Writable &#x2713 </span>';
@@ -128,7 +128,7 @@ use Config\OSPOS;
clearstatcache();
?>
<br>
&#187; [writable/uploads/item_pics:]
&#187; [public/uploads/item_pics:]
<?php
if (is_writable($images)) {
echo ' - ' . substr(sprintf("%o", fileperms($images)), -4) . ' | ' . '<span style="color: green;"> Writable &#x2713 </span>';
@@ -176,7 +176,7 @@ use Config\OSPOS;
}
if (substr(decoct(fileperms($logs)), -4) != 750) {
echo '<br><span style="color: red;"> &#187; [writeable/logs:] ' . lang('Config.is_writable') . '</span>';
echo '<br><span style="color: red;"> &#187; [writable/logs:] ' . lang('Config.is_writable') . '</span>';
}
if (substr(decoct(fileperms($uploads)), -4) != 750) {

View File

@@ -116,29 +116,22 @@
rules: {
<?php if ($config['giftcard_number'] == 'series') { ?>
person_name: {
required: true
},
giftcard_number: {
required: true
required: true,
number: true,
remote: {
url: "<?= esc("$controller_name/checkNumberGiftcard") ?>",
type: 'POST',
data: {
'giftcard_number': function() { return $('#giftcard_number').val() },
'giftcard_id': '<?= esc($giftcard_id) ?>'
}
}
},
<?php } ?>
giftcard_amount: {
required: true,
remote: {
url: "<?= esc("$controller_name/checkNumberGiftcard") ?>",
type: 'POST',
data: {
'amount': $('#giftcard_amount').val()
},
dataFilter: function(data) {
var response = JSON.parse(data);
if (response.success) {
$('#giftcard_amount').val(response.giftcard_amount);
}
return response.success;
}
}
remote: "<?= esc("$controller_name/checkNumeric") ?>"
}
},
@@ -146,7 +139,8 @@
<?php if ($config['giftcard_number'] == 'series') { ?>
giftcard_number: {
required: "<?= lang('Giftcards.number_required') ?>",
number: "<?= lang('Giftcards.number') ?>"
number: "<?= lang('Giftcards.number') ?>",
remote: "<?= lang('Giftcards.number_required') ?>"
},
<?php } ?>
giftcard_amount: {

View File

@@ -220,7 +220,7 @@
$('#item_kit_items').append('<tr>' +
'<td><a href="#" onclick="return delete_item_kit_row(this);"><span class="glyphicon glyphicon-trash"></span></a></td>' +
'<td><input class="quantity form-control input-sm" id="item_seq_' + ui.item.value + '" name="item_kit_seq[' + ui.item.value + ']" value="0"></td>' +
'<td>' + ui.item.label + '</td>' +
'<td>' + DOMPurify.sanitize(ui.item.label) + '</td>' +
'<td><input class="quantity form-control input-sm" id="item_qty_' + ui.item.value + '" name="item_kit_qty[' + ui.item.value + ']" value="1"></td>' +
'</tr>');
}
@@ -238,7 +238,7 @@
var fill_value = function(event, ui) {
event.preventDefault();
$("input[name='kit_item_id']").val(ui.item.value);
$("input[name='item_name']").val(ui.item.label);
$("input[name='item_name']").val(DOMPurify.sanitize(ui.item.label));
};

View File

@@ -5,7 +5,7 @@ $config = config(OSPOS::class)->settings; ?>
var pickerconfig = function(config) {
return $.extend({
format: "<?= dateformat_bootstrap($config['dateformat']) . ' ' . dateformat_bootstrap($config['timeformat'])?>",
format: "<?= $this->data["format"] ?? dateformat_bootstrap($config['dateformat']) . ' ' . dateformat_bootstrap($config['timeformat'])?>",
<?php
$t = $config['timeformat'];
$m = $t[strlen($t) - 1];

View File

@@ -17,6 +17,14 @@
document.getElementById('liveclock').innerHTML = moment().format("<?= dateformat_momentjs($config['dateformat'] . ' ' . $config['timeformat']) ?>");
}
const notify = $.notify;
$.notify = function(content, options) {
const message = typeof content === "object" ? content.message : content;
const sanitizedMessage = DOMPurify.sanitize(message);
return notify(sanitizedMessage, options);
};
$.notifyDefaults({
placement: {
align: "<?= esc($config['notify_horizontal_position'], 'js') ?>",
@@ -24,10 +32,8 @@
}
});
var cookie_name = "<?= esc(config('Cookie')->prefix, 'js') . esc(config('Security')->cookieName, 'js') ?>";
var csrf_token = function() {
return Cookies.get(cookie_name);
return "<?= csrf_hash() ?>";
};
var csrf_form_base = function() {

View File

@@ -0,0 +1,98 @@
<?php // used in reports ?>
// Utility functions for safe localStorage access
function safeSetItem(key, value) {
try {
localStorage.setItem(key, value);
} catch (e) {
console.error(`Failed to set item in localStorage: ${e.message}`);
}
}
function safeGetItem(key) {
try {
return localStorage.getItem(key);
} catch (e) {
console.error(`Failed to get item from localStorage: ${e.message}`);
return null; // Default fallback
}
}
function safeRemoveItem(key) {
try {
localStorage.removeItem(key);
} catch (e) {
console.error(`Failed to remove item from localStorage: ${e.message}`);
}
}
// Load saved column visibility from localStorage
var savedVisibility = JSON.parse(safeGetItem('columnVisibility')) || { cost: false, profit: false };
var visibleColumns = savedVisibility;
// Function to save column visibility to localStorage
function saveColumnVisibility(visibility) {
safeSetItem('columnVisibility', JSON.stringify(visibility));
}
// Apply column visibility on table initialization
function applyColumnVisibility(columns) {
return columns.map(function (col) {
if (visibleColumns[col.field] !== undefined) {
col.visible = visibleColumns[col.field]; // Apply visibility from localStorage
}
return col;
});
}
// Event listener for column visibility toggle
$('#table').on('column-switch.bs.table', function (e, field, checked) {
visibleColumns[field] = checked; // Save the visibility of this column
saveColumnVisibility(visibleColumns); // Store it in localStorage
});
// Ensure that saved column visibility is applied immediately after table load
$('#table').bootstrapTable('refreshOptions', {
columns: $('#table').bootstrapTable('getOptions').columns // Force refresh to apply column visibility
});
// Initialize visibility settings from localStorage
var summaryVisibility = JSON.parse(safeGetItem('summaryVisibility')) || { cost: false, profit: false };
// Function to apply visibility for cost and profit rows
function applySummaryVisibility() {
var rows = $('#report_summary .summary_row');
var costRow = rows.eq(rows.length - 2); // Second-to-last row
var profitRow = rows.eq(rows.length - 1); // Last row
if (summaryVisibility.cost === false) {
costRow.hide(); // Hide the cost row
} else {
costRow.show(); // Show the cost row
}
if (summaryVisibility.profit === false) {
profitRow.hide(); // Hide the profit row
} else {
profitRow.show(); // Show the profit row
}
}
// Toggle visibility when the button is clicked
$('#toggleCostProfitButton').click(function () {
summaryVisibility.cost = !summaryVisibility.cost;
summaryVisibility.profit = !summaryVisibility.profit;
safeSetItem('summaryVisibility', JSON.stringify(summaryVisibility));
applySummaryVisibility();
});
// Apply saved visibility state on page load
applySummaryVisibility();
// Initialize dialog (if editable)
var init_dialog = function () {
<?php if (isset($editable)): ?>
table_support.submit_handler('<?php echo site_url("reports/get_detailed_{$editable}_row") ?>');
dialog_support.init("a.modal-dlg");
<?php endif; ?>
};

View File

@@ -19,6 +19,15 @@
<div class="ct-chart ct-golden-section" id="chart1"></div>
<div id="toolbar">
<div class="pull-left form-inline" role="toolbar">
<!-- Toggle Button -->
<button id="toggleCostProfitButton" class="btn btn-default btn-sm print_hide">
<?php echo lang('Reports.toggle_cost_and_profit'); ?>
</button>
</div>
</div>
<?= view($chart_type) ?>
<div id="chart_report_summary">
@@ -27,4 +36,6 @@
<?php } ?>
</div>
<script src="<?= base_url('js/hide_cost_profit.js') ?>"></script>
<?= view('partial/footer') ?>

View File

@@ -19,6 +19,14 @@
<div id="page_subtitle"><?= esc($subtitle) ?></div>
<div id="toolbar">
<div class="pull-left form-inline" role="toolbar">
<button id="toggleCostProfitButton" class="btn btn-default btn-sm print_hide">
<?php echo lang('Reports.toggle_cost_and_profit'); ?>
</button>
</div>
</div>
<div id="table_holder">
<table id="table"></table>
</div>
@@ -27,26 +35,29 @@
<?php
foreach ($summary_data as $name => $value) {
if ($name == "total_quantity") {
?>
?>
<div class="summary_row"><?= lang("Reports.$name") . ": $value" ?></div>
<?php } else { ?>
<div class="summary_row"><?= lang("Reports.$name") . ': ' . to_currency($value) ?></div>
<?php
<?php
}
}
?>
</div>
<script type="text/javascript">
$(document).ready(function() {
$(document).ready(function () {
<?= view('partial/bootstrap_tables_locale') ?>
<?= view('partial/visibility_js') ?>
$('#table')
.addClass("table-striped")
.addClass("table-bordered")
.bootstrapTable({
columns: <?= transform_headers(esc($headers), true, false) ?>,
columns: applyColumnVisibility(<?= transform_headers(esc($headers), true, false) ?>),
stickyHeader: true,
stickyHeaderOffsetLeft: $('#table').offset().left + 'px',
stickyHeaderOffsetRight: $('#table').offset().right + 'px',
pageSize: <?= $config['lines_per_page'] ?>,
sortable: true,
showExport: true,

View File

@@ -16,6 +16,15 @@
<div id="page_subtitle"><?= esc($subtitle) ?></div>
<div id="toolbar">
<div class="pull-left form-inline" role="toolbar">
<!-- Toggle Button -->
<button id="toggleCostProfitButton" class="btn btn-default btn-sm print_hide">
<?php echo lang('Reports.toggle_cost_and_profit'); ?>
</button>
</div>
</div>
<div id="table_holder">
<table id="table"></table>
</div>
@@ -27,14 +36,16 @@
</div>
<script type="text/javascript">
$(document).ready(function() {
$(document).ready(function () {
<?= view('partial/bootstrap_tables_locale') ?>
var details_data = <?= json_encode(esc($details_data)) ?>;
<?php if ($config['customer_reward_enable'] && !empty($details_data_rewards)) { ?>
var details_data_rewards = <?= json_encode(esc($details_data_rewards)) ?>;
<?php } ?>
var init_dialog = function() {
<?= view('partial/visibility_js') ?>
var init_dialog = function () {
<?php if (isset($editable)) { ?>
table_support.submit_handler('<?= esc(site_url("reports/get_detailed_$editable" . '_row')) ?>');
dialog_support.init("a.modal-dlg");
@@ -45,8 +56,10 @@
.addClass("table-striped")
.addClass("table-bordered")
.bootstrapTable({
columns: <?= transform_headers(esc($headers['summary']), true) ?>,
columns: applyColumnVisibility(<?= transform_headers(esc($headers['summary']), true) ?>),
stickyHeader: true,
stickyHeaderOffsetLeft: $('#table').offset().left + 'px',
stickyHeaderOffsetRight: $('#table').offset().right + 'px',
pageSize: <?= $config['lines_per_page'] ?>,
pagination: true,
sortable: true,
@@ -62,19 +75,21 @@
escape: true,
search: true,
onPageChange: init_dialog,
onPostBody: function() {
onPostBody: function () {
dialog_support.init("a.modal-dlg");
},
onExpandRow: function(index, row, $detail) {
onExpandRow: function (index, row, $detail) {
$detail.html('<table></table>').find("table").bootstrapTable({
columns: <?= transform_headers_readonly(esc($headers['details'])) ?>,
data: details_data[(!isNaN(row.id) && row.id) || $(row[0] || row.id).text().replace(/(POS|RECV)\s*/g, '')]
data: details_data[(!isNaN(row.id) && row.id) || $(row[0] || row.id).text().replace(
/(POS|RECV)\s*/g, '')]
});
<?php if ($config['customer_reward_enable'] && !empty($details_data_rewards)) { ?>
$detail.append('<table></table>').find("table").bootstrapTable({
columns: <?= transform_headers_readonly(esc($headers['details_rewards'])) ?>,
data: details_data_rewards[(!isNaN(row.id) && row.id) || $(row[0] || row.id).text().replace(/(POS|RECV)\s*/g, '')]
data: details_data_rewards[(!isNaN(row.id) && row.id) || $(row[0] || row.id).text().replace(
/(POS|RECV)\s*/g, '')]
});
<?php } ?>
}

View File

@@ -143,7 +143,7 @@ if (isset($error_message)) {
<?php if ($include_hsn): ?>
<td style="text-align: center;"><?= esc($item['hsn_code']) ?></td>
<?php endif; ?>
<td class="item-name"><?= ($item['is_serialized'] || $item['allow_alt_description']) && !empty($item['description']) ? $item['description'] : $item['name'] . ' ' . $item['attribute_values'] ?></td>
<td class="item-name"><?= ($item['is_serialized'] || $item['allow_alt_description']) && !empty($item['description']) ? esc($item['description']) : esc($item['name'] . ' ' . $item['attribute_values']) ?></td>
<td style="text-align: center;"><?= to_quantity_decimals($item['quantity']) ?></td>
<td><?= to_currency($item['price']) ?></td>
<td style="height: center;"><?= ($item['discount_type'] == FIXED) ? to_currency($item['discount']) : to_decimals($item['discount']) . '%' ?></td>
@@ -155,7 +155,7 @@ if (isset($error_message)) {
<?php if ($item['is_serialized']) { ?>
<tr class="item-row">
<td class="item-description" colspan="<?= $invoice_columns - 1 ?>"></td>
<td style="text-align: center;"><?= $item['serialnumber'] // TODO: serialnumber does not match variable naming conventions for this project ?></td>
<td style="text-align: center;"><?= esc($item['serialnumber']) // TODO: serialnumber does not match variable naming conventions for this project ?></td>
</tr>
<?php
}
@@ -176,7 +176,7 @@ if (isset($error_message)) {
<?php foreach ($taxes as $tax_group_index => $tax) { ?>
<tr>
<td colspan="<?= $invoice_columns - 3 ?>" class="blank"> </td>
<td colspan="2" class="total-line"><?= (float)$tax['tax_rate'] . '% ' . $tax['tax_group'] ?></td>
<td colspan="2" class="total-line"><?= (float)$tax['tax_rate'] . '% ' . esc($tax['tax_group']) ?></td>
<td class="total-value" id="taxes"><?= to_currency_tax($tax['sale_tax_amount']) ?></td>
</tr>
<?php } ?>
@@ -197,7 +197,7 @@ if (isset($error_message)) {
?>
<tr>
<td colspan="<?= $invoice_columns - 3 ?>" class="blank"> </td>
<td colspan="2" class="total-line"><?= $splitpayment[0] ?></td>
<td colspan="2" class="total-line"><?= esc($splitpayment[0]) ?></td>
<td class="total-value" id="paid"><?= to_currency($payment['payment_amount'] * -1) ?></td>
</tr>
<?php } ?>

View File

@@ -126,7 +126,7 @@
<?php foreach ($taxes as $tax_group_index => $tax) { ?>
<tr>
<td colspan="<?= $invoice_columns - 3 ?>" class="blank"> </td>
<td colspan="2" class="total-line"><?= (float)$tax['tax_rate'] . '% ' . $tax['tax_group'] ?></td>
<td colspan="2" class="total-line"><?= (float)$tax['tax_rate'] . '% ' . esc($tax['tax_group']) ?></td>
<td id="taxes" class="total-value"><?= to_currency_tax($tax['sale_tax_amount']) ?></td>
</tr>
<?php } ?>
@@ -148,7 +148,7 @@
?>
<tr>
<td colspan="<?= $invoice_columns - 3 ?>" class="blank"> </td>
<td colspan="2" class="total-line"><?= $splitpayment[0] ?></td>
<td colspan="2" class="total-line"><?= esc($splitpayment[0]) ?></td>
<td class="total-value"><?= to_currency(-$payment['payment_amount']) ?></td>
</tr>
<?php } ?>
@@ -174,9 +174,9 @@
<div id="sale_return_policy">
<h5>
<span><?= nl2br($config['payment_message']) ?></span>
<span><?= lang('Sales.comments') . ': ' . (empty($comments) ? $config['invoice_default_comments'] : $comments) ?></span>
<span><?= lang('Sales.comments') . ': ' . (empty($comments) ? esc($config['invoice_default_comments']) : esc($comments)) ?></span>
</h5>
<?= nl2br($config['return_policy']) ?>
<?= nl2br(esc($config['return_policy'])) ?>
</div>
<div id="barcode">
<img alt=<?= '$sale_id' ?> src="data:image/svg+xml;base64,<?= base64_encode($barcode) ?>"><br>

View File

@@ -65,7 +65,7 @@
</tr>
<tr>
<td class="meta-head"><?= lang('Common.date') ?></td>
<td><?= $transaction_date ?></td>
<td><?= esc($transaction_date) ?></td>
</tr>
<?php if ($amount_due > 0) { ?>
<tr>
@@ -128,7 +128,7 @@
<?php foreach ($taxes as $tax_group_index => $tax) { ?>
<tr>
<td colspan="<?= $quote_columns - 3 ?>" class="blank"> </td>
<td colspan="2" class="total-line"><?= (float)$tax['tax_rate'] . '% ' . $tax['tax_group'] ?></td>
<td colspan="2" class="total-line"><?= (float)$tax['tax_rate'] . '% ' . esc($tax['tax_group']) ?></td>
<td id="taxes" class="total-value"><?= to_currency_tax($tax['sale_tax_amount']) ?></td>
</tr>
<?php } ?>
@@ -144,7 +144,7 @@
<div id="sale_return_policy">
<h5>
<span><?= nl2br(esc($config['payment_message'])) ?></span>
<span><?= lang('Sales.comments') . ': ' . (empty($comments) ? $config['quote_default_comments'] : esc($comments)) ?></span>
<span><?= lang('Sales.comments') . ': ' . (empty($comments) ? esc($config['quote_default_comments']) : esc($comments)) ?></span>
</h5>
<?= nl2br(esc($config['return_policy'])) ?>
</div>

View File

@@ -26,7 +26,7 @@
<?php } ?>
<?php if ($config['receipt_show_company_name']) { ?>
<div id="company_name"><?= $config['company'] ?></div>
<div id="company_name"><?= nl2br(esc($config['company'])) ?></div>
<?php } ?>
<div id="company_address"><?= nl2br(esc($config['address'])) ?></div>
@@ -69,7 +69,7 @@
<td><?= to_quantity_decimals($item['quantity']) ?></td>
<td class="total-value"><?= to_currency($item[($config['receipt_show_total_discount'] ? 'total' : 'discounted_total')]) ?></td>
<?php if ($config['receipt_show_tax_ind']) { ?>
<td><?= $item['taxed_flag'] ?></td>
<td><?= esc($item['taxed_flag']) ?></td>
<?php } ?>
</tr>
<tr>
@@ -114,7 +114,7 @@
</tr>
<?php foreach ($taxes as $tax_group_index => $tax) { ?>
<tr>
<td colspan="3" class="total-value"><?= (float)$tax['tax_rate'] . '% ' . $tax['tax_group'] ?>:</td>
<td colspan="3" class="total-value"><?= (float)$tax['tax_rate'] . '% ' . esc($tax['tax_group']) ?>:</td>
<td class="total-value"><?= to_currency_tax($tax['sale_tax_amount']) ?></td>
</tr>
<?php
@@ -143,7 +143,7 @@
$show_giftcard_remainder |= $splitpayment[0] == lang('Sales.giftcard');
?>
<tr>
<td colspan="3" style="text-align: right;"><?= $splitpayment[0] ?> </td>
<td colspan="3" style="text-align: right;"><?= esc($splitpayment[0]) ?> </td>
<td class="total-value"><?= to_currency($payment['payment_amount'] * -1) ?></td>
</tr>
<?php } ?>
@@ -165,7 +165,7 @@
</table>
<div id="sale_return_policy">
<?= nl2br($config['return_policy']) ?>
<?= nl2br(esc($config['return_policy'])) ?>
</div>
<div id="barcode">

View File

@@ -131,7 +131,7 @@
$show_giftcard_remainder |= $splitpayment[0] == lang('Sales.giftcard');
?>
<tr>
<td colspan="3" style="text-align: right;"><?= $splitpayment[0] ?> </td>
<td colspan="3" style="text-align: right;"><?= esc($splitpayment[0]) ?> </td>
<td style="text-align: right;"><?= to_currency($payment['payment_amount'] * -1) ?></td>
</tr>
<?php } ?>

View File

@@ -99,7 +99,7 @@
</tr>
<?php foreach ($taxes as $tax_group_index => $tax) { ?>
<tr>
<td colspan="2" class="total-value"><?= (float)$tax['tax_rate'] . '% ' . $tax['tax_group'] ?>:</td>
<td colspan="2" class="total-value"><?= (float)$tax['tax_rate'] . '% ' . esc($tax['tax_group']) ?>:</td>
<td class="total-value"><?= to_currency_tax($tax['sale_tax_amount']) ?></td>
</tr>
<?php

View File

@@ -57,6 +57,8 @@ if (!empty($warning)) {
if (isset($success)) {
echo '<div class="alert alert-dismissible alert-success">' . esc($success) . '</div>';
}
helper('url');
?>
<div id="register_wrapper">
@@ -478,7 +480,7 @@ if (isset($success)) {
<tbody id="payment_contents">
<?php foreach ($payments as $payment_id => $payment) { ?>
<tr>
<td><?= anchor("$controller_name/deletePayment/". base64_encode($payment_id), '<span class="glyphicon glyphicon-trash"></span>') ?></td>
<td><?= anchor("$controller_name/deletePayment/". base64url_encode($payment_id), '<span class="glyphicon glyphicon-trash"></span>') ?></td>
<td><?= $payment['payment_type'] ?></td>
<td style="text-align: right;"><?= to_currency($payment['payment_amount']) ?></td>
</tr>

View File

@@ -6,7 +6,7 @@
use App\Models\Employee;
use App\Models\Customer;
$this->dinner_table = model(Dinner_table::class);
?>
<style>
@@ -37,7 +37,7 @@ use App\Models\Customer;
<td><?= $suspended_sale['doc_id'] ?></td>
<td><?= date($config['dateformat'], strtotime($suspended_sale['sale_time'])) ?></td>
<?php if ($config['dinner_table_enable']) { ?>
<td><?= esc($this->Dinner_table->get_name($suspended_sale['dinner_table_id'])) ?></td>
<td><?= esc($this->dinner_table->get_name($suspended_sale['dinner_table_id'])) ?></td>
<?php } ?>
<td>
<?php

View File

@@ -156,7 +156,7 @@ if (isset($error_message)) {
<?php foreach ($taxes as $tax_group_index => $tax) { ?>
<tr>
<td colspan="3" class="blank"> </td>
<td colspan="2" class="total-line"><?= (float)$tax['tax_rate'] . '% ' . $tax['tax_group'] ?></td>
<td colspan="2" class="total-line"><?= (float)$tax['tax_rate'] . '% ' . esc($tax['tax_group']) ?></td>
<td class="total-value" id="taxes"><?= to_currency_tax($tax['sale_tax_amount']) ?></td>
</tr>
<?php } ?>
@@ -176,7 +176,7 @@ if (isset($error_message)) {
?>
<tr>
<td colspan="3" class="blank"> </td>
<td colspan="2" class="total-line"><?= $splitpayment[0] ?></td>
<td colspan="2" class="total-line"><?= esc($splitpayment[0]) ?></td>
<td class="total-value" id="paid"><?= to_currency($payment['payment_amount']) ?></td>
</tr>
<?php } ?>

View File

@@ -31,26 +31,25 @@
"matrix": "https://matrix.to/#/#opensourcepos_Lobby:gitter.im"
},
"require": {
"ext-intl": "*",
"php": "^8.1",
"codeigniter4/framework": "4.6.0",
"codeigniter4/framework": "^4.6.3",
"dompdf/dompdf": "^2.0.3",
"ezyang/htmlpurifier": "^4.17",
"laminas/laminas-escaper": "2.16.0",
"laminas/laminas-escaper": "2.17.0",
"paragonie/random_compat": "^2.0.21",
"picqer/php-barcode-generator": "^2.4.0",
"tamtamchik/namecase": "^3.0.0"
},
"require-dev": {
"codeigniter/coding-standard": "^1.8",
"codeigniter4/devkit": "^1.3",
"fakerphp/faker": "^1.23.0",
"friendsofphp/php-cs-fixer": "^3.47.1",
"kint-php/kint": "^5.0.4",
"mikey179/vfsstream": "^1.6",
"nexusphp/cs-config": "^3.6",
"phpunit/phpunit": "^10.5.16 || ^11.2",
"predis/predis": "^1.1 || ^2.0",
"roave/security-advisories": "dev-latest"
"predis/predis": "^1.1 || ^2.0"
},
"replace": {
"psr/log": "*"

Some files were not shown because too many files have changed in this diff Show More