diff --git a/.travis.yml b/.travis.yml index 94d0f227a..60d249815 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ sudo: false - + language: node_js node_js: diff --git a/Dockerfile b/Dockerfile index 5578caddf..b5258d91b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,7 +18,7 @@ RUN git clone https://github.com/jekkos/opensourcepos.git /app RUN ln -s /usr/bin/nodejs /usr/bin/node RUN cd app && npm install RUN npm install -g grunt-cli -RUn ln -s /usr/local/bin/grunt /usr/bin/grunt +RUN ln -s /usr/local/bin/grunt /usr/bin/grunt RUN ln -fs /app/* /var/www/html ADD ./docker/start_container.sh /start_container.sh diff --git a/application/config/config.php b/application/config/config.php index f814b8522..c82190a6c 100644 --- a/application/config/config.php +++ b/application/config/config.php @@ -381,7 +381,7 @@ $config['encryption_key'] = ''; | */ $config['sess_driver'] = 'database'; -$config['sess_cookie_name'] = 'ci_session'; +$config['sess_cookie_name'] = 'ospos_session'; $config['sess_expiration'] = 7200; $config['sess_save_path'] = 'sessions'; $config['sess_match_ip'] = FALSE; @@ -452,8 +452,8 @@ $config['global_xss_filtering'] = FALSE; | 'csrf_exclude_uris' = Array of URIs which ignore CSRF checks */ $config['csrf_protection'] = FALSE; -$config['csrf_token_name'] = 'csrf_test_name'; -$config['csrf_cookie_name'] = 'csrf_cookie_name'; +$config['csrf_token_name'] = 'csrf_ospos_v3'; +$config['csrf_cookie_name'] = 'csrf_cookie_ospos_v3'; $config['csrf_expire'] = 7200; $config['csrf_regenerate'] = TRUE; $config['csrf_exclude_uris'] = array(); diff --git a/application/controllers/Sales.php b/application/controllers/Sales.php index 901ba3483..6d8ad2af7 100644 --- a/application/controllers/Sales.php +++ b/application/controllers/Sales.php @@ -118,8 +118,6 @@ class Sales extends Secure_area $sale_rows = get_sales_manage_table_data_rows($sales, $this); $payment_summary = get_sales_manage_payments_summary($payments, $sales, $this); - // do not move this line to be after the json_encode otherwise the search function won't work!! - echo json_encode(array('total_rows' => $total_rows, 'rows' => $sale_rows, 'pagination' => $links, 'payment_summary' => $payment_summary)); } @@ -276,10 +274,9 @@ class Sales extends Secure_area $data['error'] = $this->lang->line('sales_unable_to_add_item'); } - if($this->sale_lib->out_of_stock($item_id_or_number_or_item_kit_or_receipt,$item_location)) - { - $data['warning'] = $this->lang->line('sales_quantity_less_than_zero'); - } + $data['warning'] = $this->sale_lib->out_of_stock($item_id_or_number_or_item_kit_or_receipt,$item_location); + + $this->_reload($data); } @@ -307,11 +304,7 @@ class Sales extends Secure_area { $data['error'] = $this->lang->line('sales_error_editing_item'); } - - if($this->sale_lib->out_of_stock($this->sale_lib->get_item_id($line),$item_location)) - { - $data['warning'] = $this->lang->line('sales_quantity_less_than_zero'); - } + $data['warning'] = $this->sale_lib->out_of_stock($this->sale_lib->get_item_id($line),$item_location); $this->_reload($data); } diff --git a/application/language/de-CH/sales_lang.php b/application/language/de-CH/sales_lang.php index 50022d5a7..a3d92a4f4 100644 --- a/application/language/de-CH/sales_lang.php +++ b/application/language/de-CH/sales_lang.php @@ -78,6 +78,7 @@ $lang["sales_price"] = "Preis"; $lang["sales_print_after_sale"] = "Drucke Bon nach Verkauf"; $lang["sales_quantity"] = "Menge"; $lang["sales_quantity_less_than_zero"] = "Warnung: Gewünschte Menge ist nicht verfügbar. Sie können den Verkauf fortsetzen, dennoch prüfen Sie bitte den Lagerbestand."; +$lang["sales_quantity_less_than_reorder_level"] = "Warnung: Gewünschte Menge ist nicht verfügbar."; $lang["sales_receipt"] = "Quittung"; $lang["sales_receipt_number"] = "Quittung Nr."; $lang["sales_register"] = "Kasse"; diff --git a/application/language/en/sales_lang.php b/application/language/en/sales_lang.php index 8754d3bf6..00742ba77 100644 --- a/application/language/en/sales_lang.php +++ b/application/language/en/sales_lang.php @@ -78,6 +78,7 @@ $lang["sales_price"] = "Price"; $lang["sales_print_after_sale"] = "Print after sale"; $lang["sales_quantity"] = "Qty."; $lang["sales_quantity_less_than_zero"] = "Warning, Desired Quantity is Insufficient. You can still process the sale, but check your inventory"; +$lang["sales_quantity_less_than_reorder_level"] = "Warning, Desired Quantity is below reorder level"; $lang["sales_receipt"] = "Sales Receipt"; $lang["sales_receipt_number"] = "Sale #"; $lang["sales_register"] = "Sales Register"; diff --git a/application/language/es/sales_lang.php b/application/language/es/sales_lang.php index 2902866d0..c9a522236 100644 --- a/application/language/es/sales_lang.php +++ b/application/language/es/sales_lang.php @@ -78,6 +78,7 @@ $lang["sales_price"] = "Precio"; $lang["sales_print_after_sale"] = "Imprimir recibo después de una venta"; $lang["sales_quantity"] = "Cant."; $lang["sales_quantity_less_than_zero"] = "Advertencia. La cantidad deseada es insuficiente. Puedes procesar la venta pero verifica el inventario."; +$lang["sales_quantity_less_than_reorder_level"] = "Advertencia. La cantidad deseada es insuficiente"; $lang["sales_receipt"] = "Recibo de Venta"; $lang["sales_receipt_number"] = "POS #"; $lang["sales_register"] = "Registro de Ventas"; diff --git a/application/language/fr/sales_lang.php b/application/language/fr/sales_lang.php index a2292e7c8..653cbed2e 100644 --- a/application/language/fr/sales_lang.php +++ b/application/language/fr/sales_lang.php @@ -78,6 +78,7 @@ $lang["sales_price"] = "Prix"; $lang["sales_print_after_sale"] = "Imprimer un recu après vente"; $lang["sales_quantity"] = "Qté."; $lang["sales_quantity_less_than_zero"] = "Avertissement, Quantité Demandée Insuffisante. Vous pouvez accomplir la ventre, mais veuillez vérifier votre inventaire"; +$lang["sales_quantity_less_than_reorder_level"] = "Avertissement, Quantité Demandée Insuffisante"; $lang["sales_receipt"] = "Recu de Ventes"; $lang["sales_receipt_number"] = "# Caisse"; $lang["sales_register"] = "Registre des Ventes"; diff --git a/application/language/id/sales_lang.php b/application/language/id/sales_lang.php index ae3a5e559..79a140bad 100644 --- a/application/language/id/sales_lang.php +++ b/application/language/id/sales_lang.php @@ -78,6 +78,7 @@ $lang["sales_price"] = "Harga"; $lang["sales_print_after_sale"] = "Cetak Faktur setelah penjualan"; $lang["sales_quantity"] = "Jumlah."; $lang["sales_quantity_less_than_zero"] = "Peringatan!... Stok Inventori Kosong. Proses penjualan masih dapat dilanjutkan, Periksa Inventori."; +$lang["sales_quantity_less_than_reorder_level"] = "Peringatan!... Stok Inventori Kosong."; $lang["sales_receipt"] = "Faktur Penjualan"; $lang["sales_receipt_number"] = "POS #"; $lang["sales_register"] = "Transaksi Penjualan"; diff --git a/application/language/nl-BE/sales_lang.php b/application/language/nl-BE/sales_lang.php index 0ade7c537..330699a39 100755 --- a/application/language/nl-BE/sales_lang.php +++ b/application/language/nl-BE/sales_lang.php @@ -78,6 +78,7 @@ $lang["sales_price"] = "Prijs"; $lang["sales_print_after_sale"] = "Print Ticket"; $lang["sales_quantity"] = "Aantal"; $lang["sales_quantity_less_than_zero"] = "Waarschuwing, de gewenste hoeveelheid is onvoldoende. U kunt deze aankoop verwerken, maar kijk toch even de voorraad na."; +$lang["sales_quantity_less_than_reorder_level"] = "Waarschuwing, de gewenste hoeveelheid stock is overgeschreden."; $lang["sales_receipt"] = "Ticket #"; $lang["sales_receipt_number"] = "Ticket #"; $lang["sales_register"] = "Kassa"; diff --git a/application/language/ru/sales_lang.php b/application/language/ru/sales_lang.php index 8955ccb1d..4bc0344e4 100644 --- a/application/language/ru/sales_lang.php +++ b/application/language/ru/sales_lang.php @@ -78,6 +78,7 @@ $lang["sales_price"] = "цена"; $lang["sales_print_after_sale"] = "Распечатать квитанцию после продажи"; $lang["sales_quantity"] = "Кол-во."; $lang["sales_quantity_less_than_zero"] = "Внимание Желаемое количество является недостаточным. Вы все еще можете обрабатывать продажи, но проверить ваш инвентарь"; +$lang["sales_quantity_less_than_reorder_level"] = "Внимание Желаемое количество является недостаточным."; $lang["sales_receipt"] = "товарный чек"; $lang["sales_receipt_number"] = "POS #"; $lang["sales_register"] = "Продажи журнала"; diff --git a/application/language/th/sales_lang.php b/application/language/th/sales_lang.php index dad8633d5..2dcd28534 100644 --- a/application/language/th/sales_lang.php +++ b/application/language/th/sales_lang.php @@ -78,6 +78,7 @@ $lang["sales_price"] = "ราคา"; $lang["sales_print_after_sale"] = "พิมพ์บิลหลังการขาย"; $lang["sales_quantity"] = "จำนวน"; $lang["sales_quantity_less_than_zero"] = "คำเตือน ถ้าจำนวนของไม่เพียงพอกับความต้องการหรือไม่ตรงกับยอดในบันชี ก็สามารถทำการขายได้ แต่ต้องเชคปริมานสินค้าคงคลัง"; +$lang["sales_quantity_less_than_reorder_level"] = "คำเตือน ถ้าจำนวนของไม่เพียงพอกับความต้องการหรือไม่ตรงกับยอดในบันชี ก็สามารถทำการขายได้ แต่ต้องเชคปริมานสินค้าคงคลัง"; $lang["sales_receipt"] = "บิลขาย"; $lang["sales_receipt_number"] = "จุดขาย#"; $lang["sales_register"] = "ลงทะเบียนขาย"; diff --git a/application/language/tr/sales_lang.php b/application/language/tr/sales_lang.php index 1da14e843..a84cf1441 100644 --- a/application/language/tr/sales_lang.php +++ b/application/language/tr/sales_lang.php @@ -78,6 +78,7 @@ $lang["sales_price"] = "Fiyat"; $lang["sales_print_after_sale"] = "Satıştan sonra yazdır"; $lang["sales_quantity"] = "Adet"; $lang["sales_quantity_less_than_zero"] = "Dikkat, İstenen stok yetersiz. Satışa devam edebilirsiniz ama stoğunuzu kontrol ediniz"; +$lang["sales_quantity_less_than_reorder_level"] = "Dikkat, İstenen stok yetersiz."; $lang["sales_receipt"] = "Satış Faturası"; $lang["sales_receipt_number"] = ""; $lang["sales_register"] = "Satış Kaydı"; diff --git a/application/language/zh/sales_lang.php b/application/language/zh/sales_lang.php index bf3ba1d7c..5326e110c 100755 --- a/application/language/zh/sales_lang.php +++ b/application/language/zh/sales_lang.php @@ -78,6 +78,7 @@ $lang["sales_price"] = "價格"; $lang["sales_print_after_sale"] = "出貨時打印收據"; $lang["sales_quantity"] = "數量."; $lang["sales_quantity_less_than_zero"] = "警告!產品的庫存數量是不足的。您仍然可以處理銷售,但檢查您的庫存"; +$lang["sales_quantity_less_than_reorder_level"] = "警告!產品的庫存數量是不足的。您仍然可以處理銷售,但檢查您的庫存"; $lang["sales_receipt"] = "銷貨單"; $lang["sales_receipt_number"] = "POS #"; $lang["sales_register"] = "銷售登記"; diff --git a/application/libraries/Sale_lib.php b/application/libraries/Sale_lib.php index 907f4b641..8861238b9 100644 --- a/application/libraries/Sale_lib.php +++ b/application/libraries/Sale_lib.php @@ -343,16 +343,19 @@ class Sale_lib return false; } - + $item_info = $this->CI->Item->get_info($item_id); //$item = $this->CI->Item->get_info($item_id); $item_quantity = $this->CI->Item_quantity->get_item_quantity($item_id,$item_location)->quantity; $quantity_added = $this->get_quantity_already_added($item_id,$item_location); - + if ($item_quantity - $quantity_added < 0) { - return true; + return $this->CI->lang->line('sales_quantity_less_than_zero'); + } + else if ($item_quantity - $quantity_added < $item_info->reorder_level) + { + return $this->CI->lang->line('sales_quantity_less_than_reorder_level'); } - return false; } diff --git a/application/views/sales/register.php b/application/views/sales/register.php index 1b9f25106..5d24f6d11 100644 --- a/application/views/sales/register.php +++ b/application/views/sales/register.php @@ -8,7 +8,7 @@ if (isset($error)) echo "