Fix issue #53
This commit is contained in:
commit
68c0203039
|
@ -1,3 +1,8 @@
|
|||
v 1.46.3 [15-Feb-2022]
|
||||
----------------------
|
||||
- Error: Issue #53
|
||||
|
||||
|
||||
v 1.46.2 [31-Ene-2022]
|
||||
----------------------
|
||||
- Error: Al generar Carta Porte sin remolque.
|
||||
|
|
|
@ -7168,6 +7168,7 @@ class CfdiPagos(BaseModel):
|
|||
|
||||
def _cancel(self, values):
|
||||
id_mov = int(values['id_mov'])
|
||||
args = utils.loads(values['args'])
|
||||
|
||||
filters = (
|
||||
(CfdiPagos.movimiento==id_mov) &
|
||||
|
@ -7194,7 +7195,7 @@ class CfdiPagos(BaseModel):
|
|||
auth = Configuracion.get_({'fields': 'auth_by_pac', 'pac': pac})
|
||||
|
||||
certificado = Certificado.get(Certificado.es_fiel==False)
|
||||
result = utils.cancel_xml_sign(last, auth, certificado)
|
||||
result = utils.cancel_xml_sign(last, args, auth, certificado)
|
||||
|
||||
if result['ok']:
|
||||
last.estatus = 'Cancelada'
|
||||
|
|
|
@ -42,7 +42,7 @@ except ImportError:
|
|||
|
||||
|
||||
DEBUG = DEBUG
|
||||
VERSION = '1.46.2'
|
||||
VERSION = '1.46.3'
|
||||
EMAIL_SUPPORT = ('soporte@empresalibre.mx',)
|
||||
TITLE_APP = '{} v{}'.format(TITLE_APP, VERSION)
|
||||
|
||||
|
|
|
@ -1063,6 +1063,61 @@ function cmd_pay_stamp_click(){
|
|||
}
|
||||
|
||||
|
||||
function cmd_win_cancel_pay_close_click(){
|
||||
$$('win_invoice_cancel_pay').close()
|
||||
}
|
||||
|
||||
|
||||
function send_invoice_cancel_pay(reason='', uuid=''){
|
||||
var grid = $$('grid_cfdi_pay')
|
||||
var form = $$('form_bank_pay')
|
||||
var values = form.getValues()
|
||||
var data = {
|
||||
'opt': 'cancel',
|
||||
'id_mov': values.id_mov,
|
||||
args: {
|
||||
reason: reason,
|
||||
uuid: uuid,
|
||||
}
|
||||
}
|
||||
|
||||
webix.ajax().post('cfdipay', data, function(text, data){
|
||||
var values = data.json()
|
||||
if(values.ok){
|
||||
msg_ok(values.msg)
|
||||
grid.updateItem(values.id, {'estatus': 'Cancelada'})
|
||||
}else{
|
||||
msg_error('No fue posible cancelar')
|
||||
webix.alert({
|
||||
title: 'Error al Cancelar',
|
||||
text: values.msg,
|
||||
type: 'alert-error'
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
function cmd_invoice_cancel_pay_click(){
|
||||
var reason = $$('lst_reasons_cancel').getValue()
|
||||
var uuid = $$('txt_cancel_uuid').getValue()
|
||||
|
||||
if(!reason){
|
||||
msg = 'Selecciona un motivo para esta cancelación'
|
||||
msg_error(msg)
|
||||
return
|
||||
}
|
||||
if(reason=='01' & !uuid){
|
||||
msg = 'Debes de capturar el UUID que reemplaza a este CFDI'
|
||||
msg_error(msg)
|
||||
return
|
||||
}
|
||||
|
||||
send_invoice_cancel_pay(reason, uuid)
|
||||
$$('win_invoice_cancel_pay').close()
|
||||
}
|
||||
|
||||
|
||||
function cmd_pay_cancel_click(){
|
||||
var form = $$('form_bank_pay')
|
||||
var values = form.getValues()
|
||||
|
@ -1074,33 +1129,36 @@ function cmd_pay_cancel_click(){
|
|||
return
|
||||
}
|
||||
|
||||
msg = '¿Estás seguro de cancelar esta factura?\n\nESTA ACCIÓN NO SE PUEDE DESHACER'
|
||||
webix.confirm({
|
||||
title: 'Cancelar Factura',
|
||||
ok: 'Si',
|
||||
cancel: 'No',
|
||||
type: 'confirm-error',
|
||||
text: msg,
|
||||
callback:function(result){
|
||||
if(result){
|
||||
webix.ajax().post('/cfdipay', data, {
|
||||
error:function(text, data, XmlHttpRequest){
|
||||
msg = 'Ocurrio un error, consulta a soporte técnico'
|
||||
msg_error(msg)
|
||||
},
|
||||
success:function(text, data, XmlHttpRequest){
|
||||
values = data.json();
|
||||
if(values.ok){
|
||||
grid.updateItem(values.id, {'estatus': 'Cancelada'})
|
||||
msg_ok(values.msg)
|
||||
}else{
|
||||
msg_error(values.msg)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
win_invoice_cancel_pay.init()
|
||||
$$('win_invoice_cancel_pay').show()
|
||||
|
||||
//~ msg = '¿Estás seguro de cancelar esta factura?\n\nESTA ACCIÓN NO SE PUEDE DESHACER'
|
||||
//~ webix.confirm({
|
||||
//~ title: 'Cancelar Factura',
|
||||
//~ ok: 'Si',
|
||||
//~ cancel: 'No',
|
||||
//~ type: 'confirm-error',
|
||||
//~ text: msg,
|
||||
//~ callback:function(result){
|
||||
//~ if(result){
|
||||
//~ webix.ajax().post('/cfdipay', data, {
|
||||
//~ error:function(text, data, XmlHttpRequest){
|
||||
//~ msg = 'Ocurrio un error, consulta a soporte técnico'
|
||||
//~ msg_error(msg)
|
||||
//~ },
|
||||
//~ success:function(text, data, XmlHttpRequest){
|
||||
//~ values = data.json();
|
||||
//~ if(values.ok){
|
||||
//~ grid.updateItem(values.id, {'estatus': 'Cancelada'})
|
||||
//~ msg_ok(values.msg)
|
||||
//~ }else{
|
||||
//~ msg_error(values.msg)
|
||||
//~ }
|
||||
//~ }
|
||||
//~ })
|
||||
//~ }
|
||||
//~ }
|
||||
//~ })
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -608,3 +608,45 @@ var win_mov_description = {
|
|||
$$('cmd_close_mov_description').attachEvent('onItemClick', cmd_close_mov_description_click)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
var opt_reasons_cancel_pay = [
|
||||
{id: '', value: ''},
|
||||
{id: '01', value: '[01] Comprobante emitido con errores con relación'},
|
||||
{id: '02', value: '[02] Comprobante emitido con errores sin relación'},
|
||||
{id: '03', value: '[03] No se llevó acabo la operación'},
|
||||
{id: '04', value: '[04] Operación nominativa relacionada en una factura global'},
|
||||
]
|
||||
|
||||
|
||||
var body_invoice_cancel_pay = {rows: [{minHeight: 15},
|
||||
{view: 'richselect', id: 'lst_reasons_cancel', labelPosition: 'top', label: 'Razón de cancelación', options: opt_reasons_cancel_pay, value: '', width: 400},
|
||||
{view: 'text', id: 'txt_cancel_uuid', labelPosition: 'top', label: 'UUID que sustituye', width: 400},
|
||||
{view: 'label', label: 'Esta acción no se puede deshacer', autowidth: true, align: 'center'},
|
||||
{view: 'label', label: '¿Estás segura de continuar?', autowidth: true, align: 'center'},
|
||||
{cols: [{},
|
||||
{view: 'button', id: 'cmd_invoice_cancel_pay', width: 100, label: 'Cancelar', type: 'danger', icon: 'ban'},
|
||||
{maxWidth: 25},
|
||||
{view: 'button', id: 'cmd_win_cancel_pay_close', width: 100, label: 'Cerrar'},
|
||||
{}
|
||||
]},
|
||||
{minHeight: 20},
|
||||
]}
|
||||
|
||||
|
||||
var win_invoice_cancel_pay = {
|
||||
init: function(){
|
||||
webix.ui({
|
||||
view: 'window',
|
||||
id: 'win_invoice_cancel_pay',
|
||||
modal: true,
|
||||
width: 400,
|
||||
position: 'center',
|
||||
head: 'Cancelar CFDI',
|
||||
body: body_invoice_cancel_pay,
|
||||
})
|
||||
$$('cmd_invoice_cancel_pay').attachEvent('onItemClick', cmd_invoice_cancel_pay_click)
|
||||
$$('cmd_win_cancel_pay_close').attachEvent('onItemClick', cmd_win_cancel_pay_close_click)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue