CFDI de traslado en ceros
This commit is contained in:
parent
01ed2d9090
commit
99abfd5859
|
@ -3657,9 +3657,6 @@ class Facturas(BaseModel):
|
|||
cantidad = float(product['cantidad'])
|
||||
valor_unitario = float(product['valor_unitario'])
|
||||
descuento = float(product['descuento'])
|
||||
# ~ if tipo_comprobante == 'T':
|
||||
# ~ valor_unitario = 0.0
|
||||
# ~ descuento = 0.0
|
||||
precio_final = valor_unitario - descuento
|
||||
importe = round(cantidad * precio_final, DECIMALES)
|
||||
|
||||
|
@ -3711,7 +3708,10 @@ class Facturas(BaseModel):
|
|||
tax.suma_impuestos = impuesto_producto
|
||||
totals_tax[tax.id] = tax
|
||||
|
||||
if tipo_comprobante != 'T':
|
||||
if tipo_comprobante == 'T':
|
||||
subtotal = 0.0
|
||||
descuento = 0.0
|
||||
else:
|
||||
for tax in totals_tax.values():
|
||||
if tax.tipo == 'E':
|
||||
continue
|
||||
|
@ -4651,6 +4651,9 @@ class PreFacturas(BaseModel):
|
|||
|
||||
PreFacturasDetalle.create(**product)
|
||||
|
||||
if invoice.tipo_comprobante == 'T':
|
||||
continue
|
||||
|
||||
base = product['importe'] - product['descuento']
|
||||
for tax in p.impuestos:
|
||||
if tax_locales and tax.tipo == 'R' and tax.key == '000':
|
||||
|
@ -4678,17 +4681,21 @@ class PreFacturas(BaseModel):
|
|||
tax.suma_impuestos = impuesto_producto
|
||||
totals_tax[tax.id] = tax
|
||||
|
||||
for tax in totals_tax.values():
|
||||
if tax.tipo == 'E':
|
||||
continue
|
||||
if invoice.tipo_comprobante == 'T':
|
||||
subtotal = 0.0
|
||||
descuento = 0.0
|
||||
else:
|
||||
for tax in totals_tax.values():
|
||||
if tax.tipo == 'E':
|
||||
continue
|
||||
|
||||
invoice_tax = {
|
||||
'factura': invoice.id,
|
||||
'impuesto': tax.id,
|
||||
'base': tax.base,
|
||||
'importe': tax.suma_impuestos,
|
||||
}
|
||||
PreFacturasImpuestos.create(**invoice_tax)
|
||||
invoice_tax = {
|
||||
'factura': invoice.id,
|
||||
'impuesto': tax.id,
|
||||
'base': tax.base,
|
||||
'importe': tax.suma_impuestos,
|
||||
}
|
||||
PreFacturasImpuestos.create(**invoice_tax)
|
||||
|
||||
total = subtotal - descuento_cfdi + \
|
||||
(total_trasladados or 0) - (total_retenciones or 0) \
|
||||
|
|
|
@ -42,6 +42,7 @@ var invoices_controllers = {
|
|||
$$('cmd_cfdi_relacionados').attachEvent('onItemClick', cmd_cfdi_relacionados_click)
|
||||
$$('lst_metodo_pago').attachEvent('onChange', lst_metodo_pago_change)
|
||||
$$('lst_moneda').attachEvent('onChange', lst_moneda_change)
|
||||
$$('lst_tipo_comprobante').attachEvent('onChange', lst_tipo_comprobante_change)
|
||||
$$('lst_serie').attachEvent('onChange', lst_serie_change)
|
||||
|
||||
$$('cmd_cfdi_notes').attachEvent('onItemClick', cmd_cfdi_notes_click)
|
||||
|
@ -817,6 +818,11 @@ function calcular_impuestos(){
|
|||
grid_totals.clearAll()
|
||||
grid_totals.add({id: 1, concepto: 'SubTotal', importe: 0})
|
||||
|
||||
var tc = $$('lst_tipo_comprobante').getValue()
|
||||
if(tc=='T'){
|
||||
return
|
||||
}
|
||||
|
||||
grid.eachRow(function(row){
|
||||
var product = grid.getItem(row)
|
||||
var valor_unitario = parseFloat(product.valor_unitario)
|
||||
|
@ -1804,6 +1810,13 @@ function lst_tipo_relacion_change(nv, ov){
|
|||
}
|
||||
|
||||
|
||||
function lst_tipo_comprobante_change(nv, ov){
|
||||
if(nv=='T' || ov=='T'){
|
||||
calcular_impuestos()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function lst_serie_change(nv, ov){
|
||||
query = table_series.chain().find({id: nv}).data()[0]
|
||||
if(query.usarcon){
|
||||
|
|
Loading…
Reference in New Issue