forked from elmau/empresa-libre
Fix issue #54
This commit is contained in:
commit
b68d79d0ca
|
@ -1,3 +1,8 @@
|
||||||
|
v 1.46.4 [18-Feb-2022]
|
||||||
|
----------------------
|
||||||
|
- Error: Issue #54
|
||||||
|
|
||||||
|
|
||||||
v 1.46.3 [15-Feb-2022]
|
v 1.46.3 [15-Feb-2022]
|
||||||
----------------------
|
----------------------
|
||||||
- Error: Issue #53
|
- Error: Issue #53
|
||||||
|
|
|
@ -72,8 +72,10 @@ class DebugPlugin(Plugin):
|
||||||
|
|
||||||
class PACFinkok(object):
|
class PACFinkok(object):
|
||||||
WS = 'https://facturacion.finkok.com/servicios/soap/{}.wsdl'
|
WS = 'https://facturacion.finkok.com/servicios/soap/{}.wsdl'
|
||||||
|
NS_TYPE = 'ns1'
|
||||||
if DEBUG:
|
if DEBUG:
|
||||||
WS = 'http://demo-facturacion.finkok.com/servicios/soap/{}.wsdl'
|
WS = 'http://demo-facturacion.finkok.com/servicios/soap/{}.wsdl'
|
||||||
|
NS_TYPE = 'ns0'
|
||||||
URL = {
|
URL = {
|
||||||
'quick_stamp': False,
|
'quick_stamp': False,
|
||||||
'timbra': WS.format('stamp'),
|
'timbra': WS.format('stamp'),
|
||||||
|
@ -209,9 +211,12 @@ class PACFinkok(object):
|
||||||
method = 'cancel'
|
method = 'cancel'
|
||||||
client = Client(self.URL[method],
|
client = Client(self.URL[method],
|
||||||
transport=self._transport, plugins=self._plugins)
|
transport=self._transport, plugins=self._plugins)
|
||||||
uuid_type = client.get_type('ns1:UUIDS')
|
|
||||||
|
uuid_type = client.get_type(f'{self.NS_TYPE}:UUIDS')
|
||||||
|
ns1_uuid = client.get_type(f'{self.NS_TYPE}:UUID')
|
||||||
|
|
||||||
# ~ sa = client.get_type('ns0:stringArray')
|
# ~ sa = client.get_type('ns0:stringArray')
|
||||||
ns1_uuid = client.get_type('ns1:UUID')
|
|
||||||
data_uuid = {
|
data_uuid = {
|
||||||
'UUID': cfdi_uuid,
|
'UUID': cfdi_uuid,
|
||||||
'FolioSustitucion': info['args']['uuid'],
|
'FolioSustitucion': info['args']['uuid'],
|
||||||
|
|
|
@ -8853,6 +8853,8 @@ class CfdiNomina(BaseModel):
|
||||||
|
|
||||||
def _cancel(self, values, user):
|
def _cancel(self, values, user):
|
||||||
id = int(values['id'])
|
id = int(values['id'])
|
||||||
|
args = utils.loads(values['args'])
|
||||||
|
|
||||||
obj = CfdiNomina.get(CfdiNomina.id==id)
|
obj = CfdiNomina.get(CfdiNomina.id==id)
|
||||||
if obj.uuid is None:
|
if obj.uuid is None:
|
||||||
msg = 'Solo se pueden cancelar recibos timbrados'
|
msg = 'Solo se pueden cancelar recibos timbrados'
|
||||||
|
@ -8860,7 +8862,7 @@ class CfdiNomina(BaseModel):
|
||||||
|
|
||||||
auth = Configuracion.get_({'fields': 'pac_auth'})
|
auth = Configuracion.get_({'fields': 'pac_auth'})
|
||||||
certificado = Certificado.get(Certificado.es_fiel==False)
|
certificado = Certificado.get(Certificado.es_fiel==False)
|
||||||
result = utils.cancel_xml_sign(obj, auth, certificado)
|
result = utils.cancel_xml_sign(obj, args, auth, certificado)
|
||||||
|
|
||||||
if result['ok']:
|
if result['ok']:
|
||||||
obj.estatus = 'Cancelado'
|
obj.estatus = 'Cancelado'
|
||||||
|
|
|
@ -42,7 +42,7 @@ except ImportError:
|
||||||
|
|
||||||
|
|
||||||
DEBUG = DEBUG
|
DEBUG = DEBUG
|
||||||
VERSION = '1.46.3'
|
VERSION = '1.46.4'
|
||||||
EMAIL_SUPPORT = ('soporte@empresalibre.mx',)
|
EMAIL_SUPPORT = ('soporte@empresalibre.mx',)
|
||||||
TITLE_APP = '{} v{}'.format(TITLE_APP, VERSION)
|
TITLE_APP = '{} v{}'.format(TITLE_APP, VERSION)
|
||||||
|
|
||||||
|
|
|
@ -1131,35 +1131,6 @@ function cmd_pay_cancel_click(){
|
||||||
|
|
||||||
win_invoice_cancel_pay.init()
|
win_invoice_cancel_pay.init()
|
||||||
$$('win_invoice_cancel_pay').show()
|
$$('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)
|
|
||||||
//~ }
|
|
||||||
//~ }
|
|
||||||
//~ })
|
|
||||||
//~ }
|
|
||||||
//~ }
|
|
||||||
//~ })
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -485,29 +485,43 @@ function cmd_nomina_cancel_click(){
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
msg = '¿Estás seguro de cancelar el recibo?<BR><BR>'
|
win_invoice_cancel_nomina.init()
|
||||||
msg += row['empleado'] + ' (' + row['serie'] + '-' + row['folio'] + ')'
|
$$('win_invoice_cancel_nomina').show()
|
||||||
msg += '<BR><BR>ESTA ACCIÓN NO SE PUEDE DESHACER<BR><BR>'
|
|
||||||
webix.confirm({
|
|
||||||
title: 'Cancelar Nomina',
|
|
||||||
ok: 'Si',
|
|
||||||
cancel: 'No',
|
|
||||||
type: 'confirm-error',
|
|
||||||
text: msg,
|
|
||||||
callback:function(result){
|
|
||||||
if (result){
|
|
||||||
cancel_nomina(row['id'])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function cancel_nomina(id){
|
function cmd_win_cancel_nomina_close_click(){
|
||||||
|
$$('win_invoice_cancel_nomina').close()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function cmd_invoice_cancel_nomina_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
|
||||||
|
}
|
||||||
|
|
||||||
|
$$('win_invoice_cancel_nomina').close()
|
||||||
|
send_cancel_nomina(reason, uuid)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function send_cancel_nomina(reason, uuid){
|
||||||
var grid = $$('grid_nomina')
|
var grid = $$('grid_nomina')
|
||||||
|
var row = grid.getSelectedItem()
|
||||||
var data = new Object()
|
var data = new Object()
|
||||||
data['opt'] = 'cancel'
|
data['opt'] = 'cancel'
|
||||||
data['id'] = id
|
data['id'] = row.id
|
||||||
|
data['args'] = {reason: reason, uuid: uuid}
|
||||||
|
|
||||||
webix.ajax().sync().post('nomina', data, {
|
webix.ajax().sync().post('nomina', data, {
|
||||||
error:function(text, data, XmlHttpRequest){
|
error:function(text, data, XmlHttpRequest){
|
||||||
|
@ -517,7 +531,7 @@ function cancel_nomina(id){
|
||||||
success:function(text, data, XmlHttpRequest){
|
success:function(text, data, XmlHttpRequest){
|
||||||
values = data.json();
|
values = data.json();
|
||||||
if(values.ok){
|
if(values.ok){
|
||||||
grid.updateItem(id, values.row)
|
grid.updateItem(row.id, values.row)
|
||||||
msg_ok(values.msg)
|
msg_ok(values.msg)
|
||||||
}else{
|
}else{
|
||||||
msg_error(values.msg)
|
msg_error(values.msg)
|
||||||
|
@ -609,3 +623,5 @@ function cmd_nomina_sat_click(){
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -245,3 +245,44 @@ var win_import_nomina = {
|
||||||
$$('up_nomina').attachEvent('onUploadComplete', up_nomina_upload_complete)
|
$$('up_nomina').attachEvent('onUploadComplete', up_nomina_upload_complete)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var opt_reasons_cancel_nomina = [
|
||||||
|
{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_nomina = {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_nomina', width: 100, label: 'Cancelar', type: 'danger', icon: 'ban'},
|
||||||
|
{maxWidth: 25},
|
||||||
|
{view: 'button', id: 'cmd_win_cancel_nomina_close', width: 100, label: 'Cerrar'},
|
||||||
|
{}
|
||||||
|
]},
|
||||||
|
{minHeight: 20},
|
||||||
|
]}
|
||||||
|
|
||||||
|
|
||||||
|
var win_invoice_cancel_nomina = {
|
||||||
|
init: function(){
|
||||||
|
webix.ui({
|
||||||
|
view: 'window',
|
||||||
|
id: 'win_invoice_cancel_nomina',
|
||||||
|
modal: true,
|
||||||
|
width: 400,
|
||||||
|
position: 'center',
|
||||||
|
head: 'Cancelar CFDI',
|
||||||
|
body: body_invoice_cancel_nomina,
|
||||||
|
})
|
||||||
|
$$('cmd_invoice_cancel_nomina').attachEvent('onItemClick', cmd_invoice_cancel_nomina_click)
|
||||||
|
$$('cmd_win_cancel_nomina_close').attachEvent('onItemClick', cmd_win_cancel_nomina_close_click)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue