UI para administrar tickets
This commit is contained in:
parent
3a10c146d2
commit
19c0708d15
|
@ -110,8 +110,11 @@ def config_main():
|
||||||
except IndexError:
|
except IndexError:
|
||||||
obj = None
|
obj = None
|
||||||
|
|
||||||
|
punto_de_venta = util.get_bool(Configuracion.get_('chk_usar_punto_de_venta'))
|
||||||
data = {
|
data = {
|
||||||
'empresa': 'Empresa Libre',
|
'empresa': 'Empresa Libre',
|
||||||
|
'punto_de_venta': punto_de_venta
|
||||||
|
|
||||||
}
|
}
|
||||||
if not obj is None:
|
if not obj is None:
|
||||||
titulo = 'Empresa Libre - <b><font color="#610B0B">{}</font></b>'
|
titulo = 'Empresa Libre - <b><font color="#610B0B">{}</font></b>'
|
||||||
|
@ -183,6 +186,7 @@ class Configuracion(BaseModel):
|
||||||
'chk_config_anticipo',
|
'chk_config_anticipo',
|
||||||
'chk_config_cuenta_predial',
|
'chk_config_cuenta_predial',
|
||||||
'chk_config_ine',
|
'chk_config_ine',
|
||||||
|
'chk_usar_punto_de_venta',
|
||||||
)
|
)
|
||||||
data = (Configuracion
|
data = (Configuracion
|
||||||
.select()
|
.select()
|
||||||
|
|
|
@ -53,6 +53,7 @@ var controllers = {
|
||||||
$$('chk_config_anticipo').attachEvent('onItemClick', chk_config_item_click)
|
$$('chk_config_anticipo').attachEvent('onItemClick', chk_config_item_click)
|
||||||
$$('chk_config_ine').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_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)
|
$$('cmd_subir_bdfl').attachEvent('onItemClick', cmd_subir_bdfl_click)
|
||||||
$$('up_bdfl').attachEvent('onUploadComplete', up_bdfl_upload_complete)
|
$$('up_bdfl').attachEvent('onUploadComplete', up_bdfl_upload_complete)
|
||||||
|
|
|
@ -9,7 +9,18 @@ function configuracion_inicial(){
|
||||||
webix.ajax().get('/values/main', function(text, data){
|
webix.ajax().get('/values/main', function(text, data){
|
||||||
var values = data.json()
|
var values = data.json()
|
||||||
$$('lbl_title_main').setValue(values.empresa)
|
$$('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
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(nextID == 'app_tickets'){
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if(nextID == 'app_invoices'){
|
if(nextID == 'app_invoices'){
|
||||||
active = $$('multi_invoices').getActiveId()
|
active = $$('multi_invoices').getActiveId()
|
||||||
if(active == 'invoices_home'){
|
if(active == 'invoices_home'){
|
||||||
|
|
|
@ -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 "<span class='webix_icon " + icons[tipo] + "'></span>"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function focus(name){
|
function focus(name){
|
||||||
webix.UIManager.setFocus(name)
|
webix.UIManager.setFocus(name)
|
||||||
}
|
}
|
||||||
|
|
|
@ -504,6 +504,13 @@ var options_admin_otros = [
|
||||||
labelRight: 'Mostrar el complemento INE al facturar'},
|
labelRight: 'Mostrar el complemento INE al facturar'},
|
||||||
{}]},
|
{}]},
|
||||||
{maxHeight: 20},
|
{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},
|
||||||
{}]
|
{}]
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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 "<span class='webix_icon " + icons[tipo] + "'></span>"
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
var grid_invoices_cols = [
|
var grid_invoices_cols = [
|
||||||
{id: 'index', header: '#', adjust: 'data', css: 'right',
|
{id: 'index', header: '#', adjust: 'data', css: 'right',
|
||||||
footer: {content: 'rowCount', colspan: 3, css: 'right'}},
|
footer: {content: 'rowCount', colspan: 3, css: 'right'}},
|
||||||
|
|
|
@ -5,12 +5,13 @@ var menu_data = [
|
||||||
{id: 'app_partners', icon: 'users', value: 'Clientes y Proveedores'},
|
{id: 'app_partners', icon: 'users', value: 'Clientes y Proveedores'},
|
||||||
{id: 'app_products', icon: 'server', value: 'Productos y Servicios'},
|
{id: 'app_products', icon: 'server', value: 'Productos y Servicios'},
|
||||||
{id: 'app_bancos', icon: 'university', value: 'Bancos'},
|
{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 = {
|
var sidebar = {
|
||||||
view: 'sidebar',
|
view: 'sidebar',
|
||||||
|
id: 'main_sidebar',
|
||||||
data: menu_data,
|
data: menu_data,
|
||||||
ready: function(){
|
ready: function(){
|
||||||
this.select('app_home');
|
this.select('app_home');
|
||||||
|
@ -36,6 +37,7 @@ var multi_main = {
|
||||||
app_partners,
|
app_partners,
|
||||||
app_products,
|
app_products,
|
||||||
app_bancos,
|
app_bancos,
|
||||||
|
app_tickets,
|
||||||
app_invoices,
|
app_invoices,
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
@ -60,7 +62,7 @@ var ui_main = {
|
||||||
{view: 'toolbar', padding: 3, elements: [
|
{view: 'toolbar', padding: 3, elements: [
|
||||||
{view: 'button', type: 'icon', icon: 'bars',
|
{view: 'button', type: 'icon', icon: 'bars',
|
||||||
width: 37, align: 'left', css: 'app_button', click: function(){
|
width: 37, align: 'left', css: 'app_button', click: function(){
|
||||||
$$('$sidebar1').toggle()
|
$$('main_sidebar').toggle()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{view: 'label', id: 'lbl_title_main', label: '<b>Empresa Libre</b>'},
|
{view: 'label', id: 'lbl_title_main', label: '<b>Empresa Libre</b>'},
|
||||||
|
|
|
@ -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
|
||||||
|
],
|
||||||
|
}
|
|
@ -8,6 +8,7 @@
|
||||||
<script src="/static/js/ui/partners.js" type="text/javascript" ></script>
|
<script src="/static/js/ui/partners.js" type="text/javascript" ></script>
|
||||||
<script src="/static/js/ui/products.js" type="text/javascript" ></script>
|
<script src="/static/js/ui/products.js" type="text/javascript" ></script>
|
||||||
<script src="/static/js/ui/bancos.js" type="text/javascript" ></script>
|
<script src="/static/js/ui/bancos.js" type="text/javascript" ></script>
|
||||||
|
<script src="/static/js/ui/tickets.js" type="text/javascript" ></script>
|
||||||
<script src="/static/js/ui/invoices.js" type="text/javascript" ></script>
|
<script src="/static/js/ui/invoices.js" type="text/javascript" ></script>
|
||||||
<script src="/static/js/ui/main.js" type="text/javascript" ></script>
|
<script src="/static/js/ui/main.js" type="text/javascript" ></script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue