diff --git a/README.md b/README.md index d248e5c01..3f3a260fb 100644 --- a/README.md +++ b/README.md @@ -15,3 +15,10 @@ password:pointofsale 9. Enjoy A more extensive setup guide can be found at [this site](http://www.opensourceposguide.com/guide/gettingstarted/installation) + +If you like the project, and you are making money out of it on a daily basis, then consider to buy me a coffee so I can keep adding features. + + +[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=MUN6AEG7NY6H8) + +Or send some coins to **19kwPpAwrUTxbNEs5D6cRR1k4mf5HNa4v2** diff --git a/application/config/routes.php b/application/config/routes.php index 1047287a4..03120d02c 100644 --- a/application/config/routes.php +++ b/application/config/routes.php @@ -39,6 +39,7 @@ */ $route['default_controller'] = "login"; +$route['no_access/(:any)'] = "no_access/index/$1"; $route['no_access/(:any)/(:any)'] = "no_access/index/$1/$2"; $route['reports/(summary_:any)/(:any)/(:any)'] = "reports/$1/$2/$3"; $route['reports/summary_:any'] = "reports/date_input_excel_export"; diff --git a/application/controllers/config.php b/application/controllers/config.php index be3b8775d..e0359ffa3 100644 --- a/application/controllers/config.php +++ b/application/controllers/config.php @@ -10,17 +10,17 @@ class Config extends Secure_area function index() { $location_names = array(); - $locations = $this->Stock_locations->get_location_names(); - foreach($locations->result_array() as $array) - { - array_push($location_names, $array['location_name']); - } - $data['location_names'] = implode(',', $location_names); - $this->load->view("config", $data); + $stock_locations = $this->Stock_locations->get_all()->result_array(); + $this->load->view("config", array('stock_locations' => $stock_locations)); } function save() { + $barcode_labels = preg_replace('/^_|barcode_label_|_$/', '', implode('_', array( + $this->input->post('barcode_label_name'), + $this->input->post('barcode_label_price'), + $this->input->post('barcode_label_company') + ))); $batch_save_data=array( 'company'=>$this->input->post('company'), 'address'=>$this->input->post('address'), @@ -41,6 +41,8 @@ class Config extends Secure_area 'tax_included'=>$this->input->post('tax_included'), 'recv_invoice_format'=>$this->input->post('recv_invoice_format'), 'sales_invoice_format'=>$this->input->post('sales_invoice_format'), + 'barcode_labels'=>$barcode_labels, + 'barcode_content'=>$this->input->post('barcode_content'), 'custom1_name'=>$this->input->post('custom1_name'),/**GARRISON ADDED 4/20/2013**/ 'custom2_name'=>$this->input->post('custom2_name'),/**GARRISON ADDED 4/20/2013**/ 'custom3_name'=>$this->input->post('custom3_name'),/**GARRISON ADDED 4/20/2013**/ @@ -53,28 +55,49 @@ class Config extends Secure_area 'custom10_name'=>$this->input->post('custom10_name')/**GARRISON ADDED 4/20/2013**/ ); - $stock_locations = explode( ',', $this->input->post('stock_location')); - $stock_locations_trimmed=array(); - foreach($stock_locations as $location) + $deleted_locations = $this->Stock_locations->get_allowed_locations(); + foreach($this->input->post() as $key => $value) + { + if (strstr($key, 'stock_location')) + { + $location_id = preg_replace("/.*?_(\d+)$/", "$1", $key); + unset($deleted_locations[$location_id]); + // save or update + $location_data = array('location_name' => $value); + if ($this->Stock_locations->save($location_data, $location_id)) + { + $this->_clear_session_state(); + } + } + } + // all locations not available in post will be deleted now + foreach ($deleted_locations as $location_id => $location_name) { - array_push($stock_locations_trimmed, trim($location, ' ')); - } - $current_locations = $this->Stock_locations->concat_location_names()->location_names; - if ($this->input->post('stock_locations') != $current_locations) - { - $this->load->library('sale_lib'); - $this->sale_lib->clear_sale_location(); - $this->sale_lib->clear_all(); - $this->load->library('receiving_lib'); - $this->receiving_lib->clear_stock_source(); - $this->receiving_lib->clear_stock_destination(); - $this->receiving_lib->clear_all(); + $this->Stock_locations->delete($location_id); } - if( $this->Appconfig->batch_save( $batch_save_data ) && $this->Stock_locations->array_save($stock_locations_trimmed)) + if( $this->Appconfig->batch_save( $batch_save_data )) { echo json_encode(array('success'=>true,'message'=>$this->lang->line('config_saved_successfully'))); } + $this->_remove_duplicate_cookies(); + } + + function stock_locations() + { + $stock_locations = $this->Stock_locations->get_all()->result_array(); + $this->load->view('partial/stock_locations', array('stock_locations' => $stock_locations)); + } + + function _clear_session_state() + { + $this->load->library('sale_lib'); + $this->sale_lib->clear_sale_location(); + $this->sale_lib->clear_all(); + $this->load->library('receiving_lib'); + $this->receiving_lib->clear_stock_source(); + $this->receiving_lib->clear_stock_destination(); + $this->receiving_lib->clear_all(); } } ?> \ No newline at end of file diff --git a/application/controllers/employees.php b/application/controllers/employees.php index 698d132d7..d6d0c7527 100644 --- a/application/controllers/employees.php +++ b/application/controllers/employees.php @@ -69,7 +69,7 @@ class Employees extends Person_controller 'country'=>$this->input->post('country'), 'comments'=>$this->input->post('comments') ); - $grants_data = $this->input->post("grants")!=false ? $this->input->post("grants"):array(); + $grants_data = $this->input->post("grants")!=FALSE ? $this->input->post("grants"):array(); //Password has been changed OR first time password set if($this->input->post('password')!='') diff --git a/application/controllers/items.php b/application/controllers/items.php index cdae76145..0aec46ebc 100644 --- a/application/controllers/items.php +++ b/application/controllers/items.php @@ -25,6 +25,7 @@ class Items extends Secure_area implements iData_controller $data['form_width']=$this->get_form_width(); $data['manage_table']=get_items_manage_table( $this->Item->get_all( $stock_location, $config['per_page'], $this->uri->segment( $config['uri_segment'] ) ), $this ); $this->load->view('items/manage',$data); + $this->_remove_duplicate_cookies(); } function refresh() @@ -49,6 +50,7 @@ class Items extends Secure_area implements iData_controller $data['form_width']=$this->get_form_width(); $data['manage_table']=get_items_manage_table($this->Item->get_all_filtered($stock_location,$is_serialized,$no_description,$search_custom,$is_deleted),$this);//GARRISON MODIFIED 4/13/2013, Parq 131215 $this->load->view('items/manage',$data); + $this->_remove_duplicate_cookies(); } function find_item_info() @@ -63,6 +65,7 @@ class Items extends Secure_area implements iData_controller $stock_location=$this->item_lib->get_item_location(); $data_rows=get_items_manage_table_data_rows($this->Item->search($search,$stock_location),$this); echo $data_rows; + $this->_remove_duplicate_cookies(); } /* @@ -201,6 +204,7 @@ class Items extends Secure_area implements iData_controller $data_row=get_item_data_row($item_info,$this); echo $data_row; + $this->_remove_duplicate_cookies(); } function view($item_id=-1) @@ -271,7 +275,7 @@ class Items extends Secure_area implements iData_controller { $item_info = $this->Item->get_info($item_id); - $result[] = array('name' =>$item_info->name, 'id'=> $item_id); + $result[] = array('name' =>$item_info->name, 'id'=> $item_id, 'item_number'=> $item_info->item_number, 'unit_price'=>$item_info->unit_price); } $data['items'] = $result; diff --git a/application/controllers/no_access.php b/application/controllers/no_access.php index b64a7f6b9..9761c02af 100644 --- a/application/controllers/no_access.php +++ b/application/controllers/no_access.php @@ -9,7 +9,7 @@ class No_Access extends CI_Controller function index($module_id='',$permission_id='') { $data['module_name']=$this->Module->get_module_name($module_id); - $data['permission_id']=empty($permission_id)?$module_id:$permission_id; + $data['permission_id']=$permission_id; $this->load->view('no_access',$data); } } diff --git a/application/controllers/receivings.php b/application/controllers/receivings.php index 1c326b979..4b8f6a776 100644 --- a/application/controllers/receivings.php +++ b/application/controllers/receivings.php @@ -4,7 +4,7 @@ class Receivings extends Secure_area { function __construct() { - parent::__construct('receivings','items'); + parent::__construct('receivings'); $this->load->library('receiving_lib'); } diff --git a/application/controllers/sales.php b/application/controllers/sales.php index a5b735be2..897eede34 100644 --- a/application/controllers/sales.php +++ b/application/controllers/sales.php @@ -4,7 +4,7 @@ class Sales extends Secure_area { function __construct() { - parent::__construct('sales','items'); + parent::__construct('sales'); $this->load->library('sale_lib'); } diff --git a/application/language/en/config_lang.php b/application/language/en/config_lang.php index 1c45f8881..8549e3b8d 100644 --- a/application/language/en/config_lang.php +++ b/application/language/en/config_lang.php @@ -36,7 +36,15 @@ $lang["config_sales_invoice_format"] = "Sales Invoice Format"; $lang["config_saved_successfully"] = "Configuration saved successfully"; $lang["config_saved_unsuccessfully"] = "Configuration saved unsuccessfully"; $lang["config_stock_location"] = "Stock location"; +$lang["config_stock_location_duplicate"] = "Please use an unique location name"; $lang["config_stock_location_required"] = "Stock location number is a required field"; $lang["config_tax_included"] = "Tax Included"; $lang["config_timezone"] = "Timezone"; $lang["config_website"] = "Website"; +$lang["config_barcode_number"] = "UPC/EAN/ISBN"; +$lang["config_barcode_id"] = "Item Id/Name"; +$lang["config_barcode_content"] = "Barcode Content"; +$lang["config_barcode_labels"] = "Barcode Labels"; +$lang["config_barcode_name"] = "Name"; +$lang["config_barcode_price"] = "Price"; +$lang["config_barcode_company"] = "Company Name"; diff --git a/application/language/en/sales_lang.php b/application/language/en/sales_lang.php index 853fe66fe..87afbac18 100644 --- a/application/language/en/sales_lang.php +++ b/application/language/en/sales_lang.php @@ -5,7 +5,6 @@ $lang["sales_amount_due"] = "Amount Due"; $lang["sales_amount_tendered"] = "Amount Tendered"; $lang["sales_basic_information"] = "Sale information"; $lang["sales_cancel_sale"] = "Cancel Sale"; -$lang["sales_cannot_be_deleted"] = "Sale(s) could not be deleted"; $lang["sales_cash"] = "Cash"; $lang["sales_change_due"] = "Change Due"; $lang["sales_check"] = "Check"; @@ -27,7 +26,6 @@ $lang["sales_delete_successful"] = "You have successfully deleted a sale"; $lang["sales_delete_unsuccessful"] = "You have unsuccessfully deleted a sale"; $lang["sales_description_abbrv"] = "Desc"; $lang["sales_discount"] = "Disc %"; -$lang["sales_discount_included"] = ""; $lang["sales_discount_short"] = "%"; $lang["sales_edit"] = "Edit"; $lang["sales_edit_item"] = "Edit Item"; @@ -43,7 +41,6 @@ $lang["sales_id"] = "Sale ID"; $lang["sales_invoice_number"] = "Invoice #"; $lang["sales_invoice_number_duplicate"] = "Please enter an unique invoice number"; $lang["sales_item_insufficient_of_stock"] = "Item is Insufficient of Stock"; -$lang["sales_item_insufficient_of_stockfi"] = ""; $lang["sales_item_name"] = "Item Name"; $lang["sales_item_number"] = "Item #"; $lang["sales_item_out_of_stock"] = "Item is Out of Stock"; @@ -87,7 +84,7 @@ $lang["sales_tax_percent"] = "Tax %"; $lang["sales_total"] = "Total"; $lang["sales_transaction_failed"] = "Sales Transaction Failed"; $lang["sales_unable_to_add_item"] = "Unable to add item to sale"; -$lang["sales_unsuccessfully_deleted"] = ""; +$lang["sales_unsuccessfully_deleted"] = "Sale(s) could not be deleted"; $lang["sales_unsuccessfully_updated"] = "Sale unsuccessfully updated"; $lang["sales_unsuspend"] = "Unsuspend"; $lang["sales_unsuspend_and_delete"] = ""; diff --git a/application/language/es/config_lang.php b/application/language/es/config_lang.php index 19724dbb8..11d27728a 100644 --- a/application/language/es/config_lang.php +++ b/application/language/es/config_lang.php @@ -36,7 +36,15 @@ $lang["config_sales_invoice_format"] = ""; $lang["config_saved_successfully"] = "Configuración guardada satisfactoriamente"; $lang["config_saved_unsuccessfully"] = "Configuración no guardada"; $lang["config_stock_location"] = ""; +$lang["config_stock_location_duplicate"] = ""; $lang["config_stock_location_required"] = ""; $lang["config_tax_included"] = "Impuestos incluidos"; $lang["config_timezone"] = "Zona Horaria"; $lang["config_website"] = "Sitio Web"; +$lang["config_barcode_number"] = "UPC/EAN/ISBN"; +$lang["config_barcode_id"] = "Item Id/Name"; +$lang["config_barcode_content"] = "Barcode Content"; +$lang["config_barcode_labels"] = "Barcode Labels"; +$lang["config_barcode_name"] = "Name"; +$lang["config_barcode_price"] = "Price"; +$lang["config_barcode_company"] = "Nombre del Comercio"; diff --git a/application/language/es/sales_lang.php b/application/language/es/sales_lang.php index ad78afa02..390144889 100644 --- a/application/language/es/sales_lang.php +++ b/application/language/es/sales_lang.php @@ -5,7 +5,6 @@ $lang["sales_amount_due"] = "Debe"; $lang["sales_amount_tendered"] = "Cantidad Recibida"; $lang["sales_basic_information"] = "información sobre las entradas"; $lang["sales_cancel_sale"] = "Cancelar Venta"; -$lang["sales_cannot_be_deleted"] = ""; $lang["sales_cash"] = "Efectivo"; $lang["sales_change_due"] = "Cambio"; $lang["sales_check"] = "Cheque"; @@ -27,7 +26,6 @@ $lang["sales_delete_successful"] = "Has borrado satisfactoriamente una venta"; $lang["sales_delete_unsuccessful"] = "No he podido borrar la venta satisfactoriamente"; $lang["sales_description_abbrv"] = "Desc"; $lang["sales_discount"] = "Desc %"; -$lang["sales_discount_included"] = ""; $lang["sales_discount_short"] = "%"; $lang["sales_edit"] = "Editar"; $lang["sales_edit_item"] = "Editar Artículo"; @@ -40,10 +38,9 @@ $lang["sales_find_or_scan_item_or_receipt"] = "Encontrar/Escanear Artículo o En $lang["sales_giftcard"] = "Tarjeta de Regalo"; $lang["sales_giftcard_number"] = "Número de Tarjeta de Regalo"; $lang["sales_id"] = "ID de Venta"; -$lang["sales_invoice_number"] = ""; -$lang["sales_invoice_number_duplicate"] = ""; +$lang["sales_invoice_number"] = "Invoice #"; +$lang["sales_invoice_number_duplicate"] = "Please enter an unique invoice number"; $lang["sales_item_insufficient_of_stock"] = "Hay un número insuficiente de Artículos en existencia"; -$lang["sales_item_insufficient_of_stockfi"] = ""; $lang["sales_item_name"] = "Nombre del Artículo"; $lang["sales_item_number"] = "UPC/EAN/ISBN"; $lang["sales_item_out_of_stock"] = "El artículo está agotado"; diff --git a/application/language/fr/config_lang.php b/application/language/fr/config_lang.php index 27f7beb23..0e8999538 100644 --- a/application/language/fr/config_lang.php +++ b/application/language/fr/config_lang.php @@ -36,7 +36,15 @@ $lang["config_sales_invoice_format"] = ""; $lang["config_saved_successfully"] = "Configuration sauvegardée"; $lang["config_saved_unsuccessfully"] = "Échec de sauvegarde de configuration"; $lang["config_stock_location"] = ""; +$lang["config_stock_location_duplicate"] = ""; $lang["config_stock_location_required"] = ""; $lang["config_tax_included"] = ""; $lang["config_timezone"] = "Fuseau Horaire"; $lang["config_website"] = "Site-web"; +$lang["config_barcode_number"] = "UPC/EAN/ISBN"; +$lang["config_barcode_id"] = "Item Id/Name"; +$lang["config_barcode_content"] = "Barcode Content"; +$lang["config_barcode_labels"] = "Barcode Labels"; +$lang["config_barcode_name"] = "Name"; +$lang["config_barcode_price"] = "Price"; +$lang["config_barcode_company"] = "Nome de l\'Entreprise"; diff --git a/application/language/fr/sales_lang.php b/application/language/fr/sales_lang.php index 7faac9b05..27ea4f1ea 100644 --- a/application/language/fr/sales_lang.php +++ b/application/language/fr/sales_lang.php @@ -5,7 +5,6 @@ $lang["sales_amount_due"] = "Somme Due"; $lang["sales_amount_tendered"] = "Somme"; $lang["sales_basic_information"] = "Information de Vente"; $lang["sales_cancel_sale"] = "Annuler la Vente"; -$lang["sales_cannot_be_deleted"] = ""; $lang["sales_cash"] = "Cash"; $lang["sales_change_due"] = "Reste"; $lang["sales_check"] = "Cheque"; @@ -27,7 +26,6 @@ $lang["sales_delete_successful"] = "Suppréssion réussie"; $lang["sales_delete_unsuccessful"] = "Échec de suppression"; $lang["sales_description_abbrv"] = "Desc"; $lang["sales_discount"] = "% Remise"; -$lang["sales_discount_included"] = ""; $lang["sales_discount_short"] = "%"; $lang["sales_edit"] = "Éditer"; $lang["sales_edit_item"] = "Éditer Item"; @@ -40,10 +38,9 @@ $lang["sales_find_or_scan_item_or_receipt"] = "Trouver/Scanner Item OU Recu"; $lang["sales_giftcard"] = "Carte Cadeau"; $lang["sales_giftcard_number"] = "Numéro de Carte cadeau"; $lang["sales_id"] = "ID Vente"; -$lang["sales_invoice_number"] = ""; +$lang["sales_invoice_number"] = "Invoice #"; $lang["sales_invoice_number_duplicate"] = ""; $lang["sales_item_insufficient_of_stock"] = "Stock top faible"; -$lang["sales_item_insufficient_of_stockfi"] = ""; $lang["sales_item_name"] = "Nom"; $lang["sales_item_number"] = "# Item"; $lang["sales_item_out_of_stock"] = "Stock épuisé"; diff --git a/application/language/id/config_lang.php b/application/language/id/config_lang.php index 26169fb7d..d05225725 100644 --- a/application/language/id/config_lang.php +++ b/application/language/id/config_lang.php @@ -36,7 +36,15 @@ $lang["config_sales_invoice_format"] = ""; $lang["config_saved_successfully"] = "Konfigurasi berhasil disimpan"; $lang["config_saved_unsuccessfully"] = "Konfigurasi tidak berhasil disimpan"; $lang["config_stock_location"] = ""; +$lang["config_stock_location_duplicate"] = ""; $lang["config_stock_location_required"] = ""; $lang["config_tax_included"] = "Dikenakan Pajak"; $lang["config_timezone"] = "Zona Waktu"; $lang["config_website"] = "Situs Perusahaan"; +$lang["config_barcode_number"] = "UPC/EAN/ISBN"; +$lang["config_barcode_id"] = "Item Id/Name"; +$lang["config_barcode_content"] = "Barcode Content"; +$lang["config_barcode_labels"] = "Barcode Labels"; +$lang["config_barcode_name"] = "Name"; +$lang["config_barcode_price"] = "Price"; +$lang["config_barcode_company"] = "Nama Perusahaan"; diff --git a/application/language/id/sales_lang.php b/application/language/id/sales_lang.php index 306c82f48..6ac91256c 100644 --- a/application/language/id/sales_lang.php +++ b/application/language/id/sales_lang.php @@ -5,7 +5,6 @@ $lang["sales_amount_due"] = "Kembalian Uang"; $lang["sales_amount_tendered"] = "Nilai Pembayaran"; $lang["sales_basic_information"] = "Sale information"; $lang["sales_cancel_sale"] = "Batal Jual"; -$lang["sales_cannot_be_deleted"] = ""; $lang["sales_cash"] = "Tunai"; $lang["sales_change_due"] = "Kembalian Uang"; $lang["sales_check"] = "Cek"; @@ -27,7 +26,6 @@ $lang["sales_delete_successful"] = "Transaksi Penjualan berhasil dihapus"; $lang["sales_delete_unsuccessful"] = "Transaksi Penjualan tidak berhasil dihapus"; $lang["sales_description_abbrv"] = "Deskripsi"; $lang["sales_discount"] = "Diskon %"; -$lang["sales_discount_included"] = ""; $lang["sales_discount_short"] = "%"; $lang["sales_edit"] = "Ubah"; $lang["sales_edit_item"] = "Ubah Item"; @@ -43,7 +41,6 @@ $lang["sales_id"] = "ID Penjualan"; $lang["sales_invoice_number"] = ""; $lang["sales_invoice_number_duplicate"] = ""; $lang["sales_item_insufficient_of_stock"] = "Stok Item tidak mencukupi"; -$lang["sales_item_insufficient_of_stockfi"] = ""; $lang["sales_item_name"] = "Nama Item "; $lang["sales_item_number"] = "Item #"; $lang["sales_item_out_of_stock"] = "Item tidak ada stok"; diff --git a/application/language/nl-BE/config_lang.php b/application/language/nl-BE/config_lang.php index 2f32de352..ae8bd7f6a 100755 --- a/application/language/nl-BE/config_lang.php +++ b/application/language/nl-BE/config_lang.php @@ -35,8 +35,16 @@ $lang["config_sales_invoice_enable"] = ""; $lang["config_sales_invoice_format"] = ""; $lang["config_saved_successfully"] = "Configuratie werd bewaard"; $lang["config_saved_unsuccessfully"] = "Configuratie kon niet worden bewaard"; -$lang["config_stock_location"] = ""; -$lang["config_stock_location_required"] = ""; +$lang["config_stock_location"] = "Stock locatie"; +$lang["config_stock_location_duplicate"] = "Vul een unieke naam in"; +$lang["config_stock_location_required"] = "Naam van de stock locatie is een verplicht veld"; $lang["config_tax_included"] = "VAT Ingebgrepen"; $lang["config_timezone"] = "Tijdzone"; $lang["config_website"] = "Website"; +$lang["config_barcode_number"] = "UPC/EAN/ISBN"; +$lang["config_barcode_id"] = "Product id/naam"; +$lang["config_barcode_content"] = "Inhoud Barcode"; +$lang["config_barcode_labels"] = "Barcode Labels"; +$lang["config_barcode_name"] = "Productnaam"; +$lang["config_barcode_price"] = "Prijs"; +$lang["config_barcode_company"] = "Bedrijfsnaam"; diff --git a/application/language/nl-BE/sales_lang.php b/application/language/nl-BE/sales_lang.php index 5568c344e..247e8f43e 100755 --- a/application/language/nl-BE/sales_lang.php +++ b/application/language/nl-BE/sales_lang.php @@ -5,7 +5,6 @@ $lang["sales_amount_due"] = "Te betalen"; $lang["sales_amount_tendered"] = "Ontvangen bedrag"; $lang["sales_basic_information"] = "Ticket informatie"; $lang["sales_cancel_sale"] = "Annuleer"; -$lang["sales_cannot_be_deleted"] = ""; $lang["sales_cash"] = "Contant"; $lang["sales_change_due"] = "Wisselgeld terug"; $lang["sales_check"] = "Waardebon"; @@ -27,7 +26,6 @@ $lang["sales_delete_successful"] = "De geselecteerde aanko(o)p(en) werden verwij $lang["sales_delete_unsuccessful"] = "De geselecteerde aankopen konden niet worden verwijderd."; $lang["sales_description_abbrv"] = "Omschr."; $lang["sales_discount"] = "%"; -$lang["sales_discount_included"] = ""; $lang["sales_discount_short"] = "%"; $lang["sales_edit"] = "Bewerk"; $lang["sales_edit_item"] = "Bewaar"; @@ -41,9 +39,8 @@ $lang["sales_giftcard"] = "Cadeaubon"; $lang["sales_giftcard_number"] = "Cadeaubon nummer"; $lang["sales_id"] = "Nummer Verkoop "; $lang["sales_invoice_number"] = ""; -$lang["sales_invoice_number_duplicate"] = ""; -$lang["sales_item_insufficient_of_stock"] = ""; -$lang["sales_item_insufficient_of_stockfi"] = "Product is niet meer in voorraad"; +$lang["sales_invoice_number_duplicate"] = "Vul een unieke nummer in"; +$lang["sales_item_insufficient_of_stock"] = "Product is niet meer in voorraad"; $lang["sales_item_name"] = "Naam"; $lang["sales_item_number"] = "Product #"; $lang["sales_item_out_of_stock"] = "Product is niet meer in voorraad"; @@ -53,7 +50,7 @@ $lang["sales_must_enter_numeric_giftcard"] = "Er moet een geldige code worden in $lang["sales_new_customer"] = "Nieuwe klant"; $lang["sales_new_item"] = "Nieuw Product"; $lang["sales_no_items_in_cart"] = "Er zijn geen aankopen geselecteerd"; -$lang["sales_one_or_multiple"] = ""; +$lang["sales_one_or_multiple"] = "aankopen verwijderd"; $lang["sales_payment"] = "Betaalmethode"; $lang["sales_payment_amount"] = "Bedrag"; $lang["sales_payment_not_cover_total"] = "Betaalde hoeveelheid is onvoldoende"; @@ -74,9 +71,9 @@ $lang["sales_select_customer"] = "Selecteer Klant (Optioneel)"; $lang["sales_serial"] = "Nummer"; $lang["sales_start_typing_customer_name"] = "Typ naam klant..."; $lang["sales_start_typing_item_name"] = "Typ naam product of barcode..."; -$lang["sales_stock_location"] = ""; +$lang["sales_stock_location"] = "Stock locatie"; $lang["sales_sub_total"] = "Subtotaal excl. VAT"; -$lang["sales_successfully_deleted"] = ""; +$lang["sales_successfully_deleted"] = "Uw aankoop werd verwijded"; $lang["sales_successfully_suspended_sale"] = "Uw aankoop werd met sucess bewaard"; $lang["sales_successfully_updated"] = "Wijzigingen bewaard voor ticket"; $lang["sales_suspend_sale"] = "Bewaar aankoop"; @@ -87,7 +84,7 @@ $lang["sales_tax_percent"] = "VAT %"; $lang["sales_total"] = "Totaal"; $lang["sales_transaction_failed"] = "Transactie mislukt"; $lang["sales_unable_to_add_item"] = "Onmogelijk om product toe te voegen"; -$lang["sales_unsuccessfully_deleted"] = ""; +$lang["sales_unsuccessfully_deleted"] = "De aankoop kon niet verwijderd worden"; $lang["sales_unsuccessfully_updated"] = "Fout bij het bewaren van ticket"; $lang["sales_unsuspend"] = "Hervat"; $lang["sales_unsuspend_and_delete"] = ""; diff --git a/application/language/ru/config_lang.php b/application/language/ru/config_lang.php index ff9ecf171..9c0a93c88 100644 --- a/application/language/ru/config_lang.php +++ b/application/language/ru/config_lang.php @@ -36,7 +36,15 @@ $lang["config_sales_invoice_format"] = ""; $lang["config_saved_successfully"] = "Конфигурация успешно сохранена"; $lang["config_saved_unsuccessfully"] = "Конфигурация сохраненная безуспешно"; $lang["config_stock_location"] = ""; +$lang["config_stock_location_duplicate"] = ""; $lang["config_stock_location_required"] = ""; $lang["config_tax_included"] = "Tax Included"; $lang["config_timezone"] = "Часовой пояс"; $lang["config_website"] = "Веб-сайт"; +$lang["config_barcode_number"] = "UPC/EAN/ISBN"; +$lang["config_barcode_id"] = "Item Id/Name"; +$lang["config_barcode_content"] = "Barcode Content"; +$lang["config_barcode_labels"] = "Barcode Labels"; +$lang["config_barcode_name"] = "Name"; +$lang["config_barcode_price"] = "Price"; +$lang["config_barcode_company"] = "Название Компании"; diff --git a/application/language/ru/sales_lang.php b/application/language/ru/sales_lang.php index 08ac12d58..5edf8c28a 100644 --- a/application/language/ru/sales_lang.php +++ b/application/language/ru/sales_lang.php @@ -5,7 +5,6 @@ $lang["sales_amount_due"] = "Amount Due"; $lang["sales_amount_tendered"] = "предложенная сумма"; $lang["sales_basic_information"] = "информацию о билетах"; $lang["sales_cancel_sale"] = "Отменить продажу"; -$lang["sales_cannot_be_deleted"] = ""; $lang["sales_cash"] = "наличные деньги"; $lang["sales_change_due"] = "сдача должное"; $lang["sales_check"] = "банковский чек"; @@ -27,7 +26,6 @@ $lang["sales_delete_successful"] = "Вы успешно удален прода $lang["sales_delete_unsuccessful"] = "Вы безуспешно удален продаже"; $lang["sales_description_abbrv"] = "описание"; $lang["sales_discount"] = "скидка %"; -$lang["sales_discount_included"] = ""; $lang["sales_discount_short"] = "%"; $lang["sales_edit"] = "редактировать"; $lang["sales_edit_item"] = "Редактировать Товар"; @@ -43,7 +41,6 @@ $lang["sales_id"] = "Номер Продажы"; $lang["sales_invoice_number"] = ""; $lang["sales_invoice_number_duplicate"] = ""; $lang["sales_item_insufficient_of_stock"] = "Товар недостаточно на складе"; -$lang["sales_item_insufficient_of_stockfi"] = ""; $lang["sales_item_name"] = "Название товара"; $lang["sales_item_number"] = "Номер товара"; $lang["sales_item_out_of_stock"] = "Товар распродано"; diff --git a/application/language/th/config_lang.php b/application/language/th/config_lang.php index fcfeb212a..bb9376e3f 100644 --- a/application/language/th/config_lang.php +++ b/application/language/th/config_lang.php @@ -36,7 +36,15 @@ $lang["config_sales_invoice_format"] = "รหัสใบเสร็จ"; $lang["config_saved_successfully"] = "องค์ประกอบร้านค้าบันทึกเรียบร้อย"; $lang["config_saved_unsuccessfully"] = "องค์ประกอบร้านค้าบันทึกล้มเหลว"; $lang["config_stock_location"] = "สถานที่เก็บ"; +$lang["config_stock_location_duplicate"] = ""; $lang["config_stock_location_required"] = "จำเป็นต้องระบุสถานที่เก็บ"; $lang["config_tax_included"] = "รวมภาษีแล้ว"; $lang["config_timezone"] = "โซนเวลา"; $lang["config_website"] = "เว็บไซต์"; +$lang["config_barcode_number"] = "UPC/EAN/ISBN"; +$lang["config_barcode_id"] = "Item Id/Name"; +$lang["config_barcode_content"] = "Barcode Content"; +$lang["config_barcode_labels"] = "Barcode Labels"; +$lang["config_barcode_name"] = "Name"; +$lang["config_barcode_price"] = "Price"; +$lang["config_barcode_company"] = "ชื่อร้านค้า"; diff --git a/application/language/th/sales_lang.php b/application/language/th/sales_lang.php index 0b24472b9..c1ae9d1ab 100644 --- a/application/language/th/sales_lang.php +++ b/application/language/th/sales_lang.php @@ -5,7 +5,6 @@ $lang["sales_amount_due"] = ""; $lang["sales_amount_tendered"] = "จำนวนประมูล"; $lang["sales_basic_information"] = ""; $lang["sales_cancel_sale"] = "ยกเลิกการขาย"; -$lang["sales_cannot_be_deleted"] = ""; $lang["sales_cash"] = "เงินสด"; $lang["sales_change_due"] = "เงินทอน"; $lang["sales_check"] = "เช็ก"; @@ -27,7 +26,6 @@ $lang["sales_delete_successful"] = "คุณลบการขายสำเ $lang["sales_delete_unsuccessful"] = "คุณลบการขายไม่สำเร็จ"; $lang["sales_description_abbrv"] = "Desc"; $lang["sales_discount"] = "ส่วนลด %"; -$lang["sales_discount_included"] = ""; $lang["sales_discount_short"] = ""; $lang["sales_edit"] = "แก้ไข"; $lang["sales_edit_item"] = "แก้ไขสินค้า"; @@ -43,7 +41,6 @@ $lang["sales_id"] = "เลขที่ขาย"; $lang["sales_invoice_number"] = ""; $lang["sales_invoice_number_duplicate"] = ""; $lang["sales_item_insufficient_of_stock"] = "จำนวนสินค้าไม่เพียงพอ"; -$lang["sales_item_insufficient_of_stockfi"] = ""; $lang["sales_item_name"] = "ชื่อสินค้า"; $lang["sales_item_number"] = "สินค้า #"; $lang["sales_item_out_of_stock"] = "สินค้าจำหน่ายหมด"; diff --git a/application/language/tr/config_lang.php b/application/language/tr/config_lang.php index 3ce699c19..4caf3af3b 100644 --- a/application/language/tr/config_lang.php +++ b/application/language/tr/config_lang.php @@ -36,7 +36,15 @@ $lang["config_sales_invoice_format"] = ""; $lang["config_saved_successfully"] = "Yapılandırma kaydedildi"; $lang["config_saved_unsuccessfully"] = "Yapılandırma kaydedilemedi"; $lang["config_stock_location"] = "Mağaza Yeri"; +$lang["config_stock_location_duplicate"] = ""; $lang["config_stock_location_required"] = "Mağaza Yeri numarası zorunlu alandır"; $lang["config_tax_included"] = ""; $lang["config_timezone"] = "Saat Dilimi"; $lang["config_website"] = "Website"; +$lang["config_barcode_number"] = "UPC/EAN/ISBN"; +$lang["config_barcode_id"] = "Item Id/Name"; +$lang["config_barcode_content"] = "Barcode Content"; +$lang["config_barcode_labels"] = "Barcode Labels"; +$lang["config_barcode_name"] = "Name"; +$lang["config_barcode_price"] = "Price"; +$lang["config_barcode_company"] = "Şirket Adı"; diff --git a/application/language/tr/sales_lang.php b/application/language/tr/sales_lang.php index ecf7ad06b..64957bf9b 100644 --- a/application/language/tr/sales_lang.php +++ b/application/language/tr/sales_lang.php @@ -5,7 +5,6 @@ $lang["sales_amount_due"] = "Kalan Ödeme"; $lang["sales_amount_tendered"] = "Ödenen Tutar"; $lang["sales_basic_information"] = "Satış bilgisi"; $lang["sales_cancel_sale"] = "İptal Et"; -$lang["sales_cannot_be_deleted"] = ""; $lang["sales_cash"] = "Nakit"; $lang["sales_change_due"] = "Para Üstü"; $lang["sales_check"] = "Çek"; @@ -27,7 +26,6 @@ $lang["sales_delete_successful"] = "Satışı sildiniz"; $lang["sales_delete_unsuccessful"] = "Satışı silemediniz"; $lang["sales_description_abbrv"] = "Tanım"; $lang["sales_discount"] = "İndirim %"; -$lang["sales_discount_included"] = "% İndirim"; $lang["sales_discount_short"] = "%"; $lang["sales_edit"] = "Düzenle"; $lang["sales_edit_item"] = "Düzenle"; @@ -43,7 +41,6 @@ $lang["sales_id"] = "Satış No"; $lang["sales_invoice_number"] = ""; $lang["sales_invoice_number_duplicate"] = ""; $lang["sales_item_insufficient_of_stock"] = "Ürün Stoğu Yetersiz"; -$lang["sales_item_insufficient_of_stockfi"] = ""; $lang["sales_item_name"] = "Ürün Adı"; $lang["sales_item_number"] = "Ürün No"; $lang["sales_item_out_of_stock"] = "Ürün Stokta Yok"; diff --git a/application/language/zh/config_lang.php b/application/language/zh/config_lang.php index 7640b2950..8074e2492 100755 --- a/application/language/zh/config_lang.php +++ b/application/language/zh/config_lang.php @@ -36,7 +36,15 @@ $lang["config_sales_invoice_format"] = ""; $lang["config_saved_successfully"] = "組態設置儲存成功"; $lang["config_saved_unsuccessfully"] = "組態設置儲存失敗"; $lang["config_stock_location"] = ""; +$lang["config_stock_location_duplicate"] = ""; $lang["config_stock_location_required"] = ""; $lang["config_tax_included"] = "Tax Included"; $lang["config_timezone"] = "時區"; $lang["config_website"] = "網站"; +$lang["config_barcode_number"] = "UPC/EAN/ISBN"; +$lang["config_barcode_id"] = "Item Id/Name"; +$lang["config_barcode_content"] = "Barcode Content"; +$lang["config_barcode_labels"] = "Barcode Labels"; +$lang["config_barcode_name"] = "Name"; +$lang["config_barcode_price"] = "Price"; +$lang["config_barcode_company"] = "公司名稱"; diff --git a/application/language/zh/sales_lang.php b/application/language/zh/sales_lang.php index da43a4869..2bbd1f6bf 100755 --- a/application/language/zh/sales_lang.php +++ b/application/language/zh/sales_lang.php @@ -5,7 +5,6 @@ $lang["sales_amount_due"] = "Amount Due"; $lang["sales_amount_tendered"] = "已收帳款"; $lang["sales_basic_information"] = "Sale information"; $lang["sales_cancel_sale"] = "取消銷售"; -$lang["sales_cannot_be_deleted"] = ""; $lang["sales_cash"] = "現金"; $lang["sales_change_due"] = "更改到期日"; $lang["sales_check"] = "支票"; @@ -27,7 +26,6 @@ $lang["sales_delete_successful"] = "您已成功刪除銷售資料"; $lang["sales_delete_unsuccessful"] = "銷售資料刪除失敗"; $lang["sales_description_abbrv"] = "倒序"; $lang["sales_discount"] = "折扣 %"; -$lang["sales_discount_included"] = ""; $lang["sales_discount_short"] = "%"; $lang["sales_edit"] = "編輯"; $lang["sales_edit_item"] = "編輯產品"; @@ -43,7 +41,6 @@ $lang["sales_id"] = "銷售編號"; $lang["sales_invoice_number"] = ""; $lang["sales_invoice_number_duplicate"] = ""; $lang["sales_item_insufficient_of_stock"] = "產品庫存不足"; -$lang["sales_item_insufficient_of_stockfi"] = ""; $lang["sales_item_name"] = "產品名稱"; $lang["sales_item_number"] = "產品 #"; $lang["sales_item_out_of_stock"] = "產品缺貨"; diff --git a/application/models/sale.php b/application/models/sale.php index 361fd587f..58bbcf4b3 100644 --- a/application/models/sale.php +++ b/application/models/sale.php @@ -185,7 +185,7 @@ class Sale extends CI_Model 'trans_user'=>$employee_id, 'trans_comment'=>'Deleting sale ' . $sale_id, 'trans_location'=>$item['item_location'], - 'trans_inventory'=>$item['quantity_purchased']*-1 + 'trans_inventory'=>$item['quantity_purchased'] ); // update inventory @@ -194,7 +194,7 @@ class Sale extends CI_Model // update quantities $this->Item_quantities->change_quantity($item['item_id'], $item['item_location'], - $item['quantity_purchased']*-1); + $item['quantity_purchased']); } } // delete all items diff --git a/application/models/stock_locations.php b/application/models/stock_locations.php index 5fb4be464..2d3ab0220 100644 --- a/application/models/stock_locations.php +++ b/application/models/stock_locations.php @@ -1,13 +1,13 @@ db->from('stock_locations'); - $this->db->where('location_name',$location_name); + $this->db->where('location_id',$location_id); $query = $this->db->get(); - return ($query->num_rows()==1); + return ($query->num_rows()>=1); } function get_all($limit=10000, $offset=0) @@ -18,14 +18,6 @@ class Stock_locations extends CI_Model return $this->db->get(); } - function get_location_names() - { - $this->db->select('location_name'); - $this->db->from('stock_locations'); - $this->db->where('deleted', 0); - return $this->db->get(); - } - /* * returns all location-ids in a simple array like array (location_id, location_id, ...) * used in items-controller::do_excel_import @@ -45,14 +37,6 @@ class Stock_locations extends CI_Model return $ids_array; } - function concat_location_names() - { - $this->db->select('GROUP_CONCAT(location_name SEPARATOR\',\') AS location_names', FALSE); - $this->db->from('stock_locations'); - $this->db->where('deleted', 0); - return $this->db->get()->row(); - } - function get_undeleted_all() { $this->db->from('stock_locations'); @@ -92,61 +76,69 @@ class Stock_locations extends CI_Model return $this->db->get()->row()->location_name; } - function array_save($stock_locations) + function save(&$location_data,$location_id) { - $allowed_locations = $this->get_allowed_locations(); - // check for insertion - foreach ($stock_locations as $location_name) - { - if(!$this->exists($location_name)) - { - $this->db->trans_start(); - $location_data = array('location_name'=>$location_name,'deleted'=>0); - $this->db->insert('stock_locations',$location_data); - $location_id = $this->db->insert_id(); - - // insert new permission for stock location - $permission_id = 'items_'.$location_name; - $permission_data = array('permission_id'=>$permission_id,'module_id'=>'items','location_id' => $location_id); - $this->db->insert('permissions', $permission_data); - - // insert grants for new permission - $employees = $this->Employee->get_all(); - foreach ($employees->result_array() as $employee) - { - $grants_data = array('permission_id' => $permission_id, 'person_id' => $employee['person_id']); - $this->db->insert('grants', $grants_data); - } - - // insert quantities for existing items - $items = $this->Item->get_all(); - foreach ($items->result_array() as $item) - { - $quantity_data = array('item_id' => $item['item_id'], 'location_id' => $location_id, 'quantity' => 0); - $this->db->insert('item_quantities', $quantity_data); - } - $this->db->trans_complete(); - } - else if (!in_array($location_name, array_values($allowed_locations))) - { - $this->db->where('location_name', $location_name); - $this->db->update('stock_locations', array('deleted' => 0)); - } - } - - // check for deletion - foreach ($allowed_locations as $location_id => $location_name) - { - if (!in_array($location_name, $stock_locations)) - { - $this->db->where('location_id', $location_id); - $this->db->update('stock_locations', array('deleted' => 1)); - - $this->db->delete('permissions', array('permission_id' => 'items_'.$location_name)); - } - } - - return true; + if (!$this->exists($location_id)) + { + $location_name = $location_data['location_name']; + $this->db->trans_start(); + $location_data = array('location_name'=>$location_name,'deleted'=>0); + $this->db->insert('stock_locations',$location_data); + $location_id = $this->db->insert_id(); + + $this->_insert_new_permission('items', $location_id, $location_name); + $this->_insert_new_permission('sales', $location_id, $location_name); + $this->_insert_new_permission('receivings', $location_id, $location_name); + + + // insert quantities for existing items + $items = $this->Item->get_all(); + foreach ($items->result_array() as $item) + { + $quantity_data = array('item_id' => $item['item_id'], 'location_id' => $location_id, 'quantity' => 0); + $this->db->insert('item_quantities', $quantity_data); + } + $this->db->trans_complete(); + } + else + { + $this->db->where('location_id', $location_id); + return $this->db->update('stock_locations',$location_data); + } } + + function _insert_new_permission($module, $location_id, $location_name) + { + // insert new permission for stock location + $permission_id = $module."_".$location_name; + $permission_data = array('permission_id'=>$permission_id,'module_id'=>$module,'location_id' => $location_id); + $this->db->insert('permissions', $permission_data); + + // insert grants for new permission + $employees = $this->Employee->get_all(); + foreach ($employees->result_array() as $employee) + { + $grants_data = array('permission_id' => $permission_id, 'person_id' => $employee['person_id']); + $this->db->insert('grants', $grants_data); + } + + } + + /* + Deletes one item + */ + function delete($location_id) + { + $this->db->trans_start(); + $this->db->where('location_id', $location_id); + $this->db->update('stock_locations', array('deleted' => 1)); + + // should delete permissions and grants as well? + $this->db->where('location_id', $location_id); + $this->db->delete('permissions'); + $this->db->trans_complete(); + } + + } ?> \ No newline at end of file diff --git a/application/views/barcode_sheet.php b/application/views/barcode_sheet.php index eb196ebf4..d8e89addd 100644 --- a/application/views/barcode_sheet.php +++ b/application/views/barcode_sheet.php @@ -3,6 +3,12 @@
| ";
+ if (strstr($this->config->item('barcode_labels'), 'company'))
+ {
+ echo $this->config->item('company');
+ }
+ echo " "; + if (strstr($this->config->item('barcode_labels'), 'price')) + { + echo to_currency($item['unit_price']); + } + if (strstr($this->config->item('barcode_labels'), 'name')) + { + echo " " . $item['name']; + } + echo " | ";
$count++;
}
?>
diff --git a/application/views/config.php b/application/views/config.php
index fd722e88c..df840fe1d 100644
--- a/application/views/config.php
+++ b/application/views/config.php
@@ -259,14 +259,8 @@ echo form_open('config/save/',array('id'=>'config_form'));
-