Agregar controles para objeto de impuesto en productos

This commit is contained in:
El Mau 2022-04-14 23:01:02 -05:00
parent de2ab5cedd
commit a36034a476
3 changed files with 26 additions and 15 deletions

View File

@ -466,7 +466,7 @@ class Configuracion(BaseModel):
'chk_config_codigo_barras',
'chk_config_precio_con_impuestos',
'chk_llevar_inventario',
'chk_use_packing',
# ~ 'chk_use_packing',
'chk_multi_stock',
)
data = (Configuracion
@ -4724,15 +4724,15 @@ class Facturas(BaseModel):
for k, v in receptor.items():
values['receptor'][k] = v
use_packing = Configuracion.get_bool('chk_use_packing')
if use_packing:
w = FacturasDetalle.factura == invoice
q = (FacturasDetalle
.select(FacturasDetalle.empaques)
.where(w)
.order_by(FacturasDetalle.id.asc())
.tuples())
values['pakings'] = [str(int(r[0])) for r in q]
# ~ use_packing = Configuracion.get_bool('chk_use_packing')
# ~ if use_packing:
# ~ w = FacturasDetalle.factura == invoice
# ~ q = (FacturasDetalle
# ~ .select(FacturasDetalle.empaques)
# ~ .where(w)
# ~ .order_by(FacturasDetalle.id.asc())
# ~ .tuples())
# ~ values['pakings'] = [str(int(r[0])) for r in q]
return values
@ -5303,7 +5303,7 @@ class Facturas(BaseModel):
tax_locales = Configuracion.get_bool('chk_config_tax_locales')
tax_locales_truncate = Configuracion.get_bool('chk_config_tax_locales_truncate')
tax_decimals = Configuracion.get_bool('chk_config_tax_decimals')
use_packing = Configuracion.get_bool('chk_use_packing')
# ~ use_packing = Configuracion.get_bool('chk_use_packing')
subtotal = 0
descuento_cfdi = 0

View File

@ -19,7 +19,7 @@ function products_default_config(){
if(cfg_products['inventario']){
$$('grid_products').showColumn('existencia')
}
show('cant_by_packing', values.chk_use_packing)
//~ show('cant_by_packing', values.chk_use_packing)
show('cmd_show_exists', values.chk_multi_stock)
}
})

View File

@ -111,6 +111,13 @@ var suggest_sat_producto = {
}
var opt_tax_object = [
{id: '01', value: '[01] No objeto de impuesto.'},
{id: '02', value: '[02] Sí objeto de impuesto.'},
{id: '03', value: '[03] Sí objeto del impuesto y no obligado al desglose.'},
]
var controls_generals = [
{view: 'checkbox', id: 'es_activo_producto', name: 'es_activo_producto',
label: 'Activo: ', value: true,
@ -141,10 +148,14 @@ var controls_generals = [
{view: "richselect", id: "unidad", name: "unidad", label: "Unidad",
width: 300, labelWidth: 130, labelAlign: "right", required: true,
invalidMessage: "La Unidad es requerida", options: []},
{view: 'text', id: 'cant_by_packing', name: 'cant_by_packing',
labelAlign: 'right', labelWidth: 150, inputAlign: "right",
label: 'Cantidad por empaque:'},
{view: 'richselect', id: 'lst_tax_object', label: 'Objeto de Impuestos',
width: 500, labelWidth: 130, labelAlign: "right", required: true,
invalidMessage: 'Este campo es requerido', options: opt_tax_object},
{},
//~ {view: 'text', id: 'cant_by_packing', name: 'cant_by_packing',
//~ labelAlign: 'right', labelWidth: 150, inputAlign: "right",
//~ label: 'Cantidad por empaque:'},
//~ {},
//~ {view: 'text', id: 'tags_producto', name: 'tags_producto',
//~ labelAlign: 'right', label: 'Etiquetas',
//~ placeholder: 'Separadas por comas'}