diff --git a/.gitignore b/.gitignore index 3152ae533..ce22c388e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,33 +1,18 @@ # Dependency directories -/node_modules -/vendor -/public/bower_components +node_modules +vendor +public/bower_components app/Config/email.php app/sessions/* app/logs/* app/uploads/* npm-debug.log* -# Build generated -/tmp -/public/license/.licenses -/public/license/bower.LICENSES -/public/dist - # Docker -!/docker/.env -/docker/data/database/db/* -/docker/data/certbot/conf/* -/docker/data/ospos/app/* - -# Database -/database/database.sql -/database/migrate_phppos_dist.sql - -# Use files -/application/config/email.php -/application/sessions/* -/application/uploads/* +!docker/.env +docker/data/database/db/* +docker/data/certbot/conf/* +docker/data/ospos/app/* # Editors ## SublimeText @@ -69,11 +54,11 @@ $RECYCLE.BIN/ .com.apple.timemachine.donotpresent # Other -/generate_langauges.php -/dist -/docs +generate_languages.php +dist +docs /patches -/translations +translations /.buildpath /.project /.settings/* diff --git a/.travis.yml b/.travis.yml index 999de8e55..0b508fb51 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,9 +17,7 @@ before_install: script: - echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin - - docker run --rm -v $(pwd):/app jekkos/composer composer install - - docker run --rm -v $(pwd):/app jekkos/composer php bin/install.php translations develop - - sed -i "s/'\(dev\)'/'$rev'/g" application/config/config.php + - docker run --rm -v $(pwd):/app opensourcepos/composer composer install - version=$(grep application_version application/config/config.php | sed "s/.*=\s'\(.*\)';/\1/g") - echo "$version-$branch-$rev" - npm version "$version-$branch-$rev" --force || true diff --git a/app/Config/App.php b/app/Config/App.php index 3b6d398ef..0b1ed2e17 100644 --- a/app/Config/App.php +++ b/app/Config/App.php @@ -11,7 +11,7 @@ class App extends BaseConfig * * @var string */ - public $application_version = '3.4.0'; + public $application_version = '4.0.0-dev'; /** * This is the commit hash for the version you are currently using. diff --git a/app/Controllers/Reports.php b/app/Controllers/Reports.php index e6c8184a6..768190f7a 100644 --- a/app/Controllers/Reports.php +++ b/app/Controllers/Reports.php @@ -1161,6 +1161,7 @@ class Reports extends Secure_Controller 'id' => $row['sale_id'], 'type_code' => $row['type_code'], 'sale_time' => to_datetime(strtotime($row['sale_time'])), + 'sale_date' => to_date(strtotime($row['sale_date'])), 'quantity' => to_quantity_decimals($row['items_purchased']), 'employee_name' => $row['employee_name'], 'subtotal' => to_currency($row['subtotal']), @@ -1275,7 +1276,7 @@ class Reports extends Secure_Controller $summary_data[] = [ 'id' => $row['sale_id'], 'type_code' => $row['type_code'], - 'sale_time' => to_datetime(strtotime($row['sale_time'])), + 'sale_date' => to_date(strtotime($row['sale_date'])), 'quantity' => to_quantity_decimals($row['items_purchased']), 'customer_name' => $row['customer_name'], 'subtotal' => to_currency($row['subtotal']), @@ -1393,7 +1394,7 @@ class Reports extends Secure_Controller $summary_data[] = [ 'id' => $row['sale_id'], 'type_code' => $row['type_code'], - 'sale_time' => to_datetime(strtotime($row['sale_time'])), + 'sale_date' => to_date(strtotime($row['sale_date'])), 'quantity' => to_quantity_decimals($row['items_purchased']), 'employee_name' => $row['employee_name'], 'customer_name' => $row['customer_name'], @@ -1543,7 +1544,7 @@ class Reports extends Secure_Controller $tabular_data[] = [ 'id' => $row['sale_id'], 'type_code' => $row['type_code'], - 'sale_time' => to_datetime(strtotime($row['sale_time'])), + 'sale_date' => to_date(strtotime($row['sale_date'])), 'name' => $row['name'], 'category' => $row['category'], 'item_number' => $row['item_number'], @@ -1633,7 +1634,7 @@ class Reports extends Secure_Controller $summary_data[] = [ 'id' => $row['sale_id'], 'type_code' => $row['type_code'], - 'sale_time' => to_datetime(strtotime($row['sale_time'])), + 'sale_date' => to_date(strtotime($row['sale_date'])), 'quantity' => to_quantity_decimals($row['items_purchased']), 'employee_name' => $row['employee_name'], 'customer_name' => $row['customer_name'], @@ -1766,7 +1767,7 @@ class Reports extends Secure_Controller { $summary_data[] = [ 'id' => $row['receiving_id'], - 'receiving_time' => to_datetime(strtotime($row['receiving_time'])), + 'receiving_date' => to_date(strtotime($row['receiving_date'])), 'quantity' => to_quantity_decimals($row['items_purchased']), 'employee_name' => $row['employee_name'], 'supplier_name' => $row['supplier_name'], diff --git a/app/Events/Save.php b/app/Events/Save.php new file mode 100644 index 000000000..9b5ac9c1c --- /dev/null +++ b/app/Events/Save.php @@ -0,0 +1,18 @@ + '-', - 'sale_time' => ''.lang('Sales.total').'', + 'sale_time' => lang('Sales.total'), 'amount_due' => ''.to_currency($sum_amount_due).'', 'amount_tendered' => ''. to_currency($sum_amount_tendered).'', 'change_due' => ''.to_currency($sum_change_due).'' @@ -828,9 +828,9 @@ function get_expenses_data_last_row(object $expense): array return [ 'expense_id' => '-', - 'date' => ''.lang('Sales.total').'', - 'amount' => ''. to_currency($sum_amount_expense).'', - 'tax_amount' => ''. to_currency($sum_tax_amount_expense).'' + 'date' => lang('Sales.total'), + 'amount' => to_currency($sum_amount_expense), + 'tax_amount' => to_currency($sum_tax_amount_expense) ]; } diff --git a/app/Language/.htaccess b/app/Language/.htaccess new file mode 100644 index 000000000..14249c50b --- /dev/null +++ b/app/Language/.htaccess @@ -0,0 +1 @@ +Deny from all \ No newline at end of file diff --git a/app/Libraries/Token_lib.php b/app/Libraries/Token_lib.php index fc7863ef4..a965552c1 100644 --- a/app/Libraries/Token_lib.php +++ b/app/Libraries/Token_lib.php @@ -14,7 +14,7 @@ class Token_lib /** * Expands all the tokens found in a given text string and returns the results. */ - public function render(string $tokened_text, array $tokens = [], $save TRUE): string + public function render(string $tokened_text, array $tokens = [], $save = TRUE): string { // Apply the transformation for the "%" tokens if any are used if(strpos($tokened_text, '%') !== FALSE) @@ -128,12 +128,12 @@ class Token_lib return $results; } - public function generate(array $used_tokens, array &$tokens_to_replace, array &$token_values, array $tokens, $save = TRUE): array //TODO: $tokens + public function generate(array $used_tokens, array &$tokens_to_replace, array &$token_values, array $tokens, bool $save = TRUE): array //TODO: $tokens { foreach($used_tokens as $token_code => $token_info) { // Generate value here based on the key value - $token_value = $this->resolve_token($token_code, array(), $save); + $token_value = $this->resolve_token($token_code, [], $save); foreach($token_info as $length => $token_spec) { diff --git a/app/Models/Reports/Summary_taxes.php b/app/Models/Reports/Summary_taxes.php index 7165ae34f..380cd20aa 100644 --- a/app/Models/Reports/Summary_taxes.php +++ b/app/Models/Reports/Summary_taxes.php @@ -7,9 +7,9 @@ class Summary_taxes extends Summary_report protected function _get_data_columns(): array //TODO: hungarian notation { return [ - ['tax_name' => $this->lang->line('reports_tax_name'), 'sortable' => FALSE], + ['tax_name' => $this->lang->line('Reports.tax_name'), 'sorter' => FALSE], ['tax_percent' => lang('Reports.tax_percent'), 'sorter' => 'number_sorter'], - ['report_count' => lang('Reports.sales'), 'sorter' => 'number_sorter'], + ['report_count' => lang('Reports.sales'), sorter => 'number_sorter'], ['subtotal' => lang('Reports.subtotal'), 'sorter' => 'number_sorter'], ['tax' => lang('Reports.tax'), 'sorter' => 'number_sorter'], ['total' => lang('Reports.total'), 'sorter' => 'number_sorter'] @@ -86,4 +86,4 @@ class Summary_taxes extends Summary_report return $query->getResultArray(); } -} \ No newline at end of file +} diff --git a/app/Models/Tokens/Token_invoice_sequence.php b/app/Models/Tokens/Token_invoice_sequence.php index 0812e035a..04fd346e2 100644 --- a/app/Models/Tokens/Token_invoice_sequence.php +++ b/app/Models/Tokens/Token_invoice_sequence.php @@ -27,8 +27,8 @@ class Token_invoice_sequence extends Token /** * @throws ReflectionException */ - public function get_value(): string + public function get_value(bool $save = TRUE): string { - return $this->appconfig->acquire_save_next_invoice_sequence(); + return $this->appconfig->acquire_next_invoice_sequence($save); } } \ No newline at end of file diff --git a/app/Models/Tokens/Token_quote_sequence.php b/app/Models/Tokens/Token_quote_sequence.php index 741499745..e45891b3a 100644 --- a/app/Models/Tokens/Token_quote_sequence.php +++ b/app/Models/Tokens/Token_quote_sequence.php @@ -28,8 +28,8 @@ class Token_quote_sequence extends Token /** * @throws ReflectionException */ - public function get_value(): string + public function get_value(bool $save = TRUE): string { - return $this->appconfig->acquire_save_next_quote_sequence(); + return $this->appconfig->acquire_next_quote_sequence($save); } } \ No newline at end of file diff --git a/app/Models/Tokens/Token_work_order_sequence.php b/app/Models/Tokens/Token_work_order_sequence.php index 9b134ca0d..629be568f 100644 --- a/app/Models/Tokens/Token_work_order_sequence.php +++ b/app/Models/Tokens/Token_work_order_sequence.php @@ -27,8 +27,8 @@ class Token_work_order_sequence extends Token /** * @throws ReflectionException */ - public function get_value(): string + public function get_value(bool $save = TRUE): string { - return $this->appconfig->acquire_save_next_work_order_sequence(); + return $this->appconfig->acquire_next_work_order_sequence($save); } } \ No newline at end of file diff --git a/app/Views/configs/info_config.php b/app/Views/configs/info_config.php index 51641ce29..b3bb263b4 100644 --- a/app/Views/configs/info_config.php +++ b/app/Views/configs/info_config.php @@ -148,7 +148,7 @@ $(document).ready(function() $("a.fileinput-exists").click(function() { $.ajax({ type: 'POST', - url: '', + url: '', dataType: 'json' }) }); diff --git a/app/Views/login.php b/app/Views/login.php index ab69faba4..4903913b8 100644 --- a/app/Views/login.php +++ b/app/Views/login.php @@ -65,7 +65,7 @@ - > + >
@@ -74,6 +74,7 @@ + " aria-describedby="input-password">
diff --git a/app/Views/partial/footer.php b/app/Views/partial/footer.php index b2c20e62e..23c496f98 100644 --- a/app/Views/partial/footer.php +++ b/app/Views/partial/footer.php @@ -3,10 +3,10 @@ - \ No newline at end of file + diff --git a/app/Views/sales/form.php b/app/Views/sales/form.php index 28726eafd..0b29932db 100644 --- a/app/Views/sales/form.php +++ b/app/Views/sales/form.php @@ -226,6 +226,11 @@ $(document).ready(function() { dialog_support.hide(); table_support.handle_submit("", response); + + const params = $.param(table_support.query_params()); + $.get("/search?" + params, function(response) { + $("#payment_summary").html(response.payment_summary); + }, 'json'); }, dataType: 'json' }); diff --git a/app/Views/sales/register.php b/app/Views/sales/register.php index eea26fe13..6aa84f35c 100644 --- a/app/Views/sales/register.php +++ b/app/Views/sales/register.php @@ -709,6 +709,26 @@ if(isset($success)) diff --git a/package.json b/package.json index 8f5e55055..923e43885 100644 --- a/package.json +++ b/package.json @@ -40,6 +40,7 @@ "grunt-contrib-uglify": "~5.0.1", "grunt-contrib-watch": "^1.1.0", "grunt-license-bower": "~1.0.1", + "load-grunt-tasks": "^3.4.0", "grunt-script-link-tags": "https://github.com/jekkos/grunt-script-link-tags.git#master", "grunt-wiredep": "^3.0.1", "load-grunt-tasks": "^3.4.0" @@ -49,4 +50,4 @@ "bootswatch-5": "npm:bootswatch@^5.1.3", "npm": "^6.14.15" } -} +} \ No newline at end of file