diff --git a/source/app/models/main.py b/source/app/models/main.py
index a2b89a4..9a2547a 100644
--- a/source/app/models/main.py
+++ b/source/app/models/main.py
@@ -110,8 +110,11 @@ def config_main():
except IndexError:
obj = None
+ punto_de_venta = util.get_bool(Configuracion.get_('chk_usar_punto_de_venta'))
data = {
'empresa': 'Empresa Libre',
+ 'punto_de_venta': punto_de_venta
+
}
if not obj is None:
titulo = 'Empresa Libre - {}'
@@ -183,6 +186,7 @@ class Configuracion(BaseModel):
'chk_config_anticipo',
'chk_config_cuenta_predial',
'chk_config_ine',
+ 'chk_usar_punto_de_venta',
)
data = (Configuracion
.select()
diff --git a/source/static/js/controller/admin.js b/source/static/js/controller/admin.js
index 52bd83a..0f779d9 100644
--- a/source/static/js/controller/admin.js
+++ b/source/static/js/controller/admin.js
@@ -53,6 +53,7 @@ var controllers = {
$$('chk_config_anticipo').attachEvent('onItemClick', chk_config_item_click)
$$('chk_config_ine').attachEvent('onItemClick', chk_config_item_click)
$$('chk_config_cuenta_predial').attachEvent('onItemClick', chk_config_item_click)
+ $$('chk_usar_punto_de_venta').attachEvent('onItemClick', chk_config_item_click)
$$('cmd_subir_bdfl').attachEvent('onItemClick', cmd_subir_bdfl_click)
$$('up_bdfl').attachEvent('onUploadComplete', up_bdfl_upload_complete)
diff --git a/source/static/js/controller/main.js b/source/static/js/controller/main.js
index 1dfb30f..45b4cbf 100644
--- a/source/static/js/controller/main.js
+++ b/source/static/js/controller/main.js
@@ -9,7 +9,18 @@ function configuracion_inicial(){
webix.ajax().get('/values/main', function(text, data){
var values = data.json()
$$('lbl_title_main').setValue(values.empresa)
+ //~ showvar()
+ if(values.punto_de_venta){
+ var node = {
+ id: 'app_tickets',
+ icon: 'money',
+ value: 'Punto de venta'}
+ $$('main_sidebar').add(node, 4)
+ }
})
+
+
+
}
@@ -195,6 +206,11 @@ function multi_change(prevID, nextID){
return
}
+ if(nextID == 'app_tickets'){
+
+ return
+ }
+
if(nextID == 'app_invoices'){
active = $$('multi_invoices').getActiveId()
if(active == 'invoices_home'){
diff --git a/source/static/js/controller/util.js b/source/static/js/controller/util.js
index 8e8c4f1..c0a01ab 100644
--- a/source/static/js/controller/util.js
+++ b/source/static/js/controller/util.js
@@ -33,6 +33,18 @@ var months = [
]
+function get_icon(tipo){
+ icons = {
+ xml: 'fa-file-code-o',
+ pdf: 'fa-file-pdf-o',
+ zip: 'fa-file-zip-o',
+ email: 'fa-envelope-o',
+ print: 'print',
+ }
+ return ""
+}
+
+
function focus(name){
webix.UIManager.setFocus(name)
}
diff --git a/source/static/js/ui/admin.js b/source/static/js/ui/admin.js
index 3cd09a1..8b0f944 100644
--- a/source/static/js/ui/admin.js
+++ b/source/static/js/ui/admin.js
@@ -504,6 +504,13 @@ var options_admin_otros = [
labelRight: 'Mostrar el complemento INE al facturar'},
{}]},
{maxHeight: 20},
+ {template: 'Punto de venta', type: 'section'},
+ {cols: [{maxWidth: 15},
+ {view: 'checkbox', id: 'chk_usar_punto_de_venta', labelWidth: 0,
+ labelRight: 'Usar punto de venta'},
+ {}]},
+
+ {maxHeight: 20},
{}]
diff --git a/source/static/js/ui/invoices.js b/source/static/js/ui/invoices.js
index 532fe7f..49adef3 100644
--- a/source/static/js/ui/invoices.js
+++ b/source/static/js/ui/invoices.js
@@ -180,17 +180,6 @@ var toolbar_invoices_filter = [
]
-function get_icon(tipo){
- icons = {
- xml: 'fa-file-code-o',
- pdf: 'fa-file-pdf-o',
- zip: 'fa-file-zip-o',
- email: 'fa-envelope-o',
- }
- return ""
-}
-
-
var grid_invoices_cols = [
{id: 'index', header: '#', adjust: 'data', css: 'right',
footer: {content: 'rowCount', colspan: 3, css: 'right'}},
diff --git a/source/static/js/ui/main.js b/source/static/js/ui/main.js
index d004c18..cd6bdaf 100644
--- a/source/static/js/ui/main.js
+++ b/source/static/js/ui/main.js
@@ -5,12 +5,13 @@ var menu_data = [
{id: 'app_partners', icon: 'users', value: 'Clientes y Proveedores'},
{id: 'app_products', icon: 'server', value: 'Productos y Servicios'},
{id: 'app_bancos', icon: 'university', value: 'Bancos'},
- {id: 'app_invoices', icon: 'cart-plus', value: 'Facturas'},
+ {id: 'app_invoices', icon: 'file-code-o', value: 'Facturas'},
]
var sidebar = {
view: 'sidebar',
+ id: 'main_sidebar',
data: menu_data,
ready: function(){
this.select('app_home');
@@ -36,6 +37,7 @@ var multi_main = {
app_partners,
app_products,
app_bancos,
+ app_tickets,
app_invoices,
],
}
@@ -60,7 +62,7 @@ var ui_main = {
{view: 'toolbar', padding: 3, elements: [
{view: 'button', type: 'icon', icon: 'bars',
width: 37, align: 'left', css: 'app_button', click: function(){
- $$('$sidebar1').toggle()
+ $$('main_sidebar').toggle()
}
},
{view: 'label', id: 'lbl_title_main', label: 'Empresa Libre'},
diff --git a/source/static/js/ui/tickets.js b/source/static/js/ui/tickets.js
new file mode 100644
index 0000000..7a3f534
--- /dev/null
+++ b/source/static/js/ui/tickets.js
@@ -0,0 +1,89 @@
+
+
+
+
+var toolbar_tickets = [
+ {view: 'button', id: 'cmd_nuevo_ticket', label: 'Nuevo', type: 'iconButton',
+ autowidth: true, icon: 'plus'},
+ {},
+ {view: 'button', id: 'cmd_cancelar_ticket', label: 'Cancelar',
+ type: 'iconButton', autowidth: true, icon: 'ban'},
+]
+
+
+var toolbar_tickets_filter = [
+ {view: 'richselect', id: 'filter_year_ticket', label: 'Año',
+ labelAlign: 'right', labelWidth: 50, width: 150, options: []},
+ {view: 'richselect', id: 'filter_month_ticket', label: 'Mes',
+ labelAlign: 'right', labelWidth: 50, width: 200, options: months},
+ {view: 'daterangepicker', id: 'filter_dates_ticket', label: 'Fechas',
+ labelAlign: 'right', width: 300},
+]
+
+
+var grid_tickets_cols = [
+ {id: 'index', header: '#', adjust: 'data', css: 'right',
+ footer: {content: 'rowCount', colspan: 3, css: 'right'}},
+ {id: "id", header:"ID", hidden:true},
+ {id: "serie", header: ["Serie", {content: "selectFilter"}], adjust: "data",
+ sort:"string"},
+ {id: 'folio', header: ['Folio', {content: 'numberFilter'}], adjust: 'data',
+ sort: 'int', css: 'right', footer: {text: 'Tickets', colspan: 3}},
+ {id: "fecha", header: ["Fecha y Hora"],
+ adjust: "data", sort: "date"},
+ {id: "estatus", header: ["Estatus", {content: "selectFilter"}],
+ adjust: "data", sort:"string"},
+ {id: 'total', header: ['Total', {content: 'numberFilter'}], width: 150,
+ sort: 'int', format: webix.i18n.priceFormat, css: 'right'},
+ {id: "cliente", header: ["Razón Social", {content: "selectFilter"}],
+ fillspace:true, sort:"string"},
+ {id: 'pdf', header: 'PDF', adjust: 'data', template: get_icon('pdf')},
+ {id: 'print', header: 'I', adjust: 'data', template: get_icon('print')},
+ {id: 'email', header: '', adjust: 'data', template: get_icon('email')}
+]
+
+
+var grid_tickets = {
+ view: 'datatable',
+ id: 'grid_tickets',
+ select: 'row',
+ adjust: true,
+ footer: true,
+ resizeColumn: true,
+ headermenu: true,
+ columns: grid_tickets_cols,
+ on:{
+ 'data->onStoreUpdated':function(){
+ this.data.each(function(obj, i){
+ obj.index = i + 1
+ })
+ }
+ },
+}
+
+
+var rows_tickets_home = [
+ {view: 'toolbar', elements: toolbar_tickets},
+ {view: 'toolbar', elements: toolbar_tickets_filter},
+ grid_tickets,
+]
+
+
+var multi_tickets = {
+ id: 'multi_tickets',
+ view: 'multiview',
+ animate: true,
+ cells:[
+ {id: 'tickets_home', rows: rows_tickets_home},
+ {id: 'tickets_new', rows:[]}
+ ],
+}
+
+
+var app_tickets = {
+ id: 'app_tickets',
+ rows:[
+ {view: 'template', id: 'th_ticckets', type: 'header', template: 'Punto de venta'},
+ multi_tickets
+ ],
+}
diff --git a/source/templates/main.html b/source/templates/main.html
index 8c95768..2e3ee63 100644
--- a/source/templates/main.html
+++ b/source/templates/main.html
@@ -8,6 +8,7 @@
+