Fix - Issue #174
This commit is contained in:
parent
535958f3c1
commit
75f2d9d662
|
@ -3108,6 +3108,15 @@ class Facturas(BaseModel):
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def cancel(cls, id):
|
def cancel(cls, id):
|
||||||
|
obj = Facturas.get(Facturas.id==id)
|
||||||
|
if obj.uuid is None:
|
||||||
|
obj.estatus = 'Cancelada'
|
||||||
|
obj.cancelada = True
|
||||||
|
obj.fecha_cancelacion = util.now()
|
||||||
|
obj.save()
|
||||||
|
msg = 'Factura cancelada correctamente'
|
||||||
|
return {'ok': True, 'msg': msg, 'row': {'estatus': 'Cancelada'}}
|
||||||
|
|
||||||
if CANCEL_SIGNATURE:
|
if CANCEL_SIGNATURE:
|
||||||
return cls._cancel_signature(cls, id)
|
return cls._cancel_signature(cls, id)
|
||||||
return cls._cancel_xml(cls, id)
|
return cls._cancel_xml(cls, id)
|
||||||
|
|
|
@ -1233,18 +1233,17 @@ function cmd_invoice_cancelar_click(){
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!row.uuid){
|
|
||||||
msg_error('La factura no esta timbrada, solo es posible cancelar \
|
|
||||||
facturas timbradas')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if(row.estatus == 'Cancelada'){
|
if(row.estatus == 'Cancelada'){
|
||||||
msg_error('La factura ya esta cancelada')
|
msg_error('La factura ya esta cancelada')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
msg = '¿Estás seguro de enviar a cancelar esta factura?<BR><BR> \
|
msg = ''
|
||||||
|
if(!row.uuid){
|
||||||
|
msg = 'La factura NO esta timbrada, asegurate de que efectivamente NO este timbrada.<BR><BR>'
|
||||||
|
}
|
||||||
|
|
||||||
|
msg += '¿Estás seguro de enviar a cancelar esta factura?<BR><BR> \
|
||||||
ESTA ACCIÓN NO SE PUEDE DESHACER'
|
ESTA ACCIÓN NO SE PUEDE DESHACER'
|
||||||
webix.confirm({
|
webix.confirm({
|
||||||
title: 'Cancelar Factura',
|
title: 'Cancelar Factura',
|
||||||
|
|
Loading…
Reference in New Issue