Add UI windows for add inventory manually
This commit is contained in:
parent
1aa6540ac1
commit
d61672dac4
|
@ -3563,6 +3563,7 @@ class Productos(BaseModel):
|
||||||
tags = ManyToManyField(Tags, related_name='productos_tags')
|
tags = ManyToManyField(Tags, related_name='productos_tags')
|
||||||
cantidad_empaque = DecimalField(default=0.0, max_digits=14, decimal_places=4,
|
cantidad_empaque = DecimalField(default=0.0, max_digits=14, decimal_places=4,
|
||||||
auto_round=True)
|
auto_round=True)
|
||||||
|
is_discontinued = BooleanField(default=False)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
order_by = ('descripcion',)
|
order_by = ('descripcion',)
|
||||||
|
@ -9943,6 +9944,10 @@ def _migrate_tables(rfc=''):
|
||||||
decimal_places=4, auto_round=True)
|
decimal_places=4, auto_round=True)
|
||||||
migrations.append(migrator.add_column(
|
migrations.append(migrator.add_column(
|
||||||
table, 'cantidad_empaque', cantidad_empaque))
|
table, 'cantidad_empaque', cantidad_empaque))
|
||||||
|
if not 'is_discontinued' in columns:
|
||||||
|
is_discontinued = BooleanField(default=False)
|
||||||
|
migrations.append(migrator.add_column(
|
||||||
|
table, 'is_discontinued', is_discontinued))
|
||||||
|
|
||||||
table = 'facturasdetalle'
|
table = 'facturasdetalle'
|
||||||
columns = [c.name for c in database_proxy.get_columns(table)]
|
columns = [c.name for c in database_proxy.get_columns(table)]
|
||||||
|
|
|
@ -32,6 +32,7 @@ var products_controllers = {
|
||||||
$$("cmd_save_product").attachEvent("onItemClick", cmd_save_product_click)
|
$$("cmd_save_product").attachEvent("onItemClick", cmd_save_product_click)
|
||||||
$$("cmd_cancel_product").attachEvent("onItemClick", cmd_cancel_product_click)
|
$$("cmd_cancel_product").attachEvent("onItemClick", cmd_cancel_product_click)
|
||||||
$$("cmd_import_products").attachEvent("onItemClick", cmd_import_products_click)
|
$$("cmd_import_products").attachEvent("onItemClick", cmd_import_products_click)
|
||||||
|
$$("cmd_add_inventory").attachEvent("onItemClick", cmd_add_inventory_click)
|
||||||
$$("cmd_products_add").attachEvent("onItemClick", cmd_products_add_click)
|
$$("cmd_products_add").attachEvent("onItemClick", cmd_products_add_click)
|
||||||
$$('cmd_add_products_from_xml').attachEvent('onItemClick', cmd_add_products_from_xml_click)
|
$$('cmd_add_products_from_xml').attachEvent('onItemClick', cmd_add_products_from_xml_click)
|
||||||
$$('cmd_save_products_add').attachEvent('onItemClick', cmd_save_products_add_click)
|
$$('cmd_save_products_add').attachEvent('onItemClick', cmd_save_products_add_click)
|
||||||
|
@ -433,6 +434,19 @@ function up_products_upload_complete(response){
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//~ Add inventory
|
||||||
|
function cmd_add_inventory_click(id, e, node){
|
||||||
|
var row = $$('grid_products').getSelectedItem()
|
||||||
|
if (row == undefined){
|
||||||
|
msg_error('Selecciona un Producto')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
win_add_inventory.init()
|
||||||
|
$$('win_add_inventory').show()
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
//~ Add products
|
//~ Add products
|
||||||
function cmd_products_add_click(id, e, node){
|
function cmd_products_add_click(id, e, node){
|
||||||
$$("multi_products").setValue("product_add")
|
$$("multi_products").setValue("product_add")
|
||||||
|
@ -681,3 +695,13 @@ function grid_partner_products_select(row_id, state){
|
||||||
grid.refresh(row_id)
|
grid.refresh(row_id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function cmd_add_inventory_save_click(id, e, node){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function cmd_add_inventory_cancel_click(id, e, node){
|
||||||
|
$$('win_add_inventory').close()
|
||||||
|
}
|
||||||
|
|
|
@ -10,7 +10,9 @@ var toolbar_products = [
|
||||||
{},
|
{},
|
||||||
{view: 'button', id: 'cmd_import_products', label: 'Importar',
|
{view: 'button', id: 'cmd_import_products', label: 'Importar',
|
||||||
type: 'iconButton', autowidth: true, icon: 'upload'},
|
type: 'iconButton', autowidth: true, icon: 'upload'},
|
||||||
{view: "button", id: "cmd_products_add", label: "Altas",
|
{view: "button", id: "cmd_add_inventory", label: "Altas",
|
||||||
|
type: "iconButton", autowidth: true, icon: "plus"},
|
||||||
|
{view: "button", id: "cmd_products_add", label: "Altas CFDI",
|
||||||
type: "iconButton", autowidth: true, icon: "plus"},
|
type: "iconButton", autowidth: true, icon: "plus"},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -413,3 +415,41 @@ var win_add_products_from_xml = {
|
||||||
$$('up_products_from_xml').attachEvent('onUploadComplete', up_products_from_xml_upload_complete)
|
$$('up_products_from_xml').attachEvent('onUploadComplete', up_products_from_xml_upload_complete)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var body_add_inventory = {rows: [{minHeight: 10},
|
||||||
|
{view: 'text', id: 'txt_add_id', readonly: true, hidden: true},
|
||||||
|
{cols: [
|
||||||
|
{view: 'text', id: 'txt_add_key', label: 'Clave',
|
||||||
|
labelPosition: 'top', readonly: true},
|
||||||
|
{view: 'text', id: 'txt_add_unit', label: 'Unidad',
|
||||||
|
labelPosition: 'top', readonly: true},
|
||||||
|
]},
|
||||||
|
{view: 'textarea', id: 'txt_add_description', height: 100,
|
||||||
|
label: 'Descripción', readonly: true, labelPosition: 'top'},
|
||||||
|
{view: 'counter', id: 'txt_new_cant', label: 'Cantidad a agregar',
|
||||||
|
labelWidth: 'auto', step: 5, value: 0, min: 0.01},
|
||||||
|
{minHeight: 20},
|
||||||
|
{cols: [{},
|
||||||
|
{view: 'button', id: 'cmd_add_inventory_save', label: 'Guardar'}, {},
|
||||||
|
{view: 'button', id: 'cmd_add_inventory_cancel', label: 'Cancelar', type: 'danger'}, {}
|
||||||
|
]},
|
||||||
|
{minHeight: 20},
|
||||||
|
]}
|
||||||
|
|
||||||
|
|
||||||
|
var win_add_inventory = {
|
||||||
|
init: function(){
|
||||||
|
webix.ui({
|
||||||
|
view: 'window',
|
||||||
|
id: 'win_add_inventory',
|
||||||
|
width: 600,
|
||||||
|
modal: true,
|
||||||
|
position: 'center',
|
||||||
|
head: 'Agregar manualmente',
|
||||||
|
body: body_add_inventory,
|
||||||
|
})
|
||||||
|
$$('cmd_add_inventory_save').attachEvent('onItemClick', cmd_add_inventory_save_click)
|
||||||
|
$$('cmd_add_inventory_cancel').attachEvent('onItemClick', cmd_add_inventory_cancel_click)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue