|
|
|
|
@@ -2630,6 +2630,7 @@ Partial Class Ventas
|
|
|
|
|
End If
|
|
|
|
|
If Request("CveEmbarqueManifiesto") IsNot Nothing AndAlso IsNumeric(Request("CveEmbarqueManifiesto")) AndAlso Request("CveEmbarqueManifiesto").ToEntero() > 0 Then
|
|
|
|
|
DdlMoneda.SelectedValueExist(2)
|
|
|
|
|
CambiaMoneda()
|
|
|
|
|
Using ObjVentas As New ClsNominas
|
|
|
|
|
If ObjVentas.EmbarqueManifiestoGet(-1, -1, -1, Request("CveEmbarqueManifiesto").ToString().ToEntero()) And ObjVentas.DtResultados.Rows.Count > 0 Then
|
|
|
|
|
DdlSubProyectoDatos.SelectedValueExist(ObjVentas.DtResultados.Rows(0)("CveSubProyecto").ToString())
|
|
|
|
|
@@ -2695,9 +2696,6 @@ Partial Class Ventas
|
|
|
|
|
End If
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
'PERMISO PARA CANCELAR PEDIDO
|
|
|
|
|
If GvInv.Rows.Count = 0 Then
|
|
|
|
|
If DdlTipoComprobante.SelectedValue.Contiene("Ped") And Not CveEstatus = 14 Then
|
|
|
|
|
@@ -3276,70 +3274,69 @@ Partial Class Ventas
|
|
|
|
|
HlFacturasRelaciondas.Visible = False
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
''EN REALIDAD SE OCUPAN ESTAS COSAS DENTRO DEL POSTABCK ???
|
|
|
|
|
If Not CveVenta > 0 Then
|
|
|
|
|
'LbDescargarExcel.Visible = True
|
|
|
|
|
HlAgregarExcel.Visible = True
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
If DdlTipoComprobante.SelectedValue.Contiene("Rem") Then
|
|
|
|
|
' IPP 15 Julio 2017 - ERA FALSE
|
|
|
|
|
ImgAntiPend.Visible = False
|
|
|
|
|
UpPS.Update()
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
If UsuarioActual.Empresa.Funcionalidad(517) <> "" Then
|
|
|
|
|
TxtFolio.Enabled = False
|
|
|
|
|
TxtFecha.Enabled = False
|
|
|
|
|
If LblSeTimbro.Text = "No" And DdlTipoComprobante.SelectedValue.Contiene("Ing", "Egs", "Dev", "Ant") Then
|
|
|
|
|
TxtFecha.Text = Now.ToShortDateString
|
|
|
|
|
''EN REALIDAD SE OCUPAN ESTAS COSAS DENTRO DEL POSTABCK ???
|
|
|
|
|
If Not CveVenta > 0 Then
|
|
|
|
|
'LbDescargarExcel.Visible = True
|
|
|
|
|
HlAgregarExcel.Visible = True
|
|
|
|
|
End If
|
|
|
|
|
ImgFecha.Visible = False
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
'condición temporal por implementación JAM. usuario FernandaRomo
|
|
|
|
|
If UsuarioActual.CveUsuario.Contiene(11703, 1719) Then
|
|
|
|
|
If DdlTipoComprobante.SelectedValue.Contiene("Rem") Then
|
|
|
|
|
' IPP 15 Julio 2017 - ERA FALSE
|
|
|
|
|
ImgAntiPend.Visible = False
|
|
|
|
|
UpPS.Update()
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
If UsuarioActual.Empresa.Funcionalidad(517) <> "" Then
|
|
|
|
|
TxtFolio.Enabled = False
|
|
|
|
|
TxtFecha.Enabled = False
|
|
|
|
|
If LblSeTimbro.Text = "No" And DdlTipoComprobante.SelectedValue.Contiene("Ing", "Egs", "Dev", "Ant") Then
|
|
|
|
|
TxtFecha.Text = Now.ToShortDateString
|
|
|
|
|
End If
|
|
|
|
|
ImgFecha.Visible = False
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
'condición temporal por implementación JAM. usuario FernandaRomo
|
|
|
|
|
If UsuarioActual.CveUsuario.Contiene(11703, 1719) Then
|
|
|
|
|
TxtFecha.Enabled = True
|
|
|
|
|
ImgFecha.Visible = True
|
|
|
|
|
End If
|
|
|
|
|
TxtFecha.Enabled = True
|
|
|
|
|
ImgFecha.Visible = True
|
|
|
|
|
|
|
|
|
|
BloqueaCondiconesPago()
|
|
|
|
|
|
|
|
|
|
BloqueaClasificaciones()
|
|
|
|
|
|
|
|
|
|
'NO PERMITIR AGREGAR PS DESDE VENTAS EN ECONOLLANTAS
|
|
|
|
|
If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
|
|
|
|
|
BtnModalAddPS.Enabled = False
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
MostrarOpcionesPaqueteria()
|
|
|
|
|
|
|
|
|
|
'If ViewState("CveCotizacion").ToString().ToEntero() > 0 Then
|
|
|
|
|
|
|
|
|
|
'If Not AjustarTotalCotizacionFacturada(ViewState("CveCotizacion").ToString().ToEntero(), TxtTotal.Text.ToDecimal) Then
|
|
|
|
|
' BtnEmitirImprimir.Visible = True
|
|
|
|
|
' Alert("Ocurrió un error al ajustar el importe", TipoMensaje.MsgError)
|
|
|
|
|
'End If
|
|
|
|
|
|
|
|
|
|
'End If
|
|
|
|
|
|
|
|
|
|
If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
|
|
|
|
|
trRotacion.Visible = True
|
|
|
|
|
trRotacionlbl.Visible = True
|
|
|
|
|
trAlineacion.Visible = True
|
|
|
|
|
trAlineacionlbl.Visible = True
|
|
|
|
|
|
|
|
|
|
Dim FechaRotaAlinea As Date = TxtFecha.Text.ToDate
|
|
|
|
|
LblRotacion.Text = FechaRotaAlinea.AddMonths(6).ToShortDateString
|
|
|
|
|
LblAlineacion.Text = FechaRotaAlinea.AddMonths(6).ToShortDateString
|
|
|
|
|
|
|
|
|
|
UPObservaciones.Update()
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
End If
|
|
|
|
|
TxtFecha.Enabled = True
|
|
|
|
|
|
|
|
|
|
BloqueaCondiconesPago()
|
|
|
|
|
|
|
|
|
|
BloqueaClasificaciones()
|
|
|
|
|
|
|
|
|
|
'NO PERMITIR AGREGAR PS DESDE VENTAS EN ECONOLLANTAS
|
|
|
|
|
If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
|
|
|
|
|
BtnModalAddPS.Enabled = False
|
|
|
|
|
End If
|
|
|
|
|
MostrarOpcionesPaqueteria()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
'If ViewState("CveCotizacion").ToString().ToEntero() > 0 Then
|
|
|
|
|
|
|
|
|
|
'If Not AjustarTotalCotizacionFacturada(ViewState("CveCotizacion").ToString().ToEntero(), TxtTotal.Text.ToDecimal) Then
|
|
|
|
|
' BtnEmitirImprimir.Visible = True
|
|
|
|
|
' Alert("Ocurrió un error al ajustar el importe", TipoMensaje.MsgError)
|
|
|
|
|
'End If
|
|
|
|
|
|
|
|
|
|
'End If
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
|
|
|
|
|
trRotacion.Visible = True
|
|
|
|
|
trRotacionlbl.Visible = True
|
|
|
|
|
trAlineacion.Visible = True
|
|
|
|
|
trAlineacionlbl.Visible = True
|
|
|
|
|
|
|
|
|
|
Dim FechaRotaAlinea As Date = TxtFecha.Text.ToDate
|
|
|
|
|
LblRotacion.Text = FechaRotaAlinea.AddMonths(6).ToShortDateString
|
|
|
|
|
LblAlineacion.Text = FechaRotaAlinea.AddMonths(6).ToShortDateString
|
|
|
|
|
|
|
|
|
|
UPObservaciones.Update()
|
|
|
|
|
End If
|
|
|
|
|
End Sub
|
|
|
|
|
Private Sub BloqueaClasificaciones()
|
|
|
|
|
If UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso DdlTipoComprobante.SelectedValue = "Cot" Then
|
|
|
|
|
@@ -5239,8 +5236,11 @@ Partial Class Ventas
|
|
|
|
|
TxtFech3.ReadOnly = True : ImgFech3.Enabled = False
|
|
|
|
|
ChkConvertirDoctoPesos.Enabled = False
|
|
|
|
|
ChkConvertirDolares.Enabled = False
|
|
|
|
|
TxtTipoCambio.Enabled = False
|
|
|
|
|
TxtTipoCambioDlls.Enabled = False
|
|
|
|
|
|
|
|
|
|
TxtTipoCambio.Enabled = UsuarioActual.CveEmpresa.Contiene(13, 83)
|
|
|
|
|
TxtTipoCambioDlls.Enabled = UsuarioActual.CveEmpresa.Contiene(13, 83)
|
|
|
|
|
TxtTipoCambio.ReadOnly = Not UsuarioActual.CveEmpresa.Contiene(13, 83)
|
|
|
|
|
TxtTipoCambioDlls.ReadOnly = Not UsuarioActual.CveEmpresa.Contiene(13, 83)
|
|
|
|
|
|
|
|
|
|
'Condiciones de Pago
|
|
|
|
|
RBLPago.Enabled = False
|
|
|
|
|
@@ -8017,7 +8017,7 @@ Partial Class Ventas
|
|
|
|
|
TmpDT.Rows(e.RowIndex)("CveUM") = GvPS.Rows(e.RowIndex).FCDropDownList("DdlUnidadMedida").SelectedValue.ToEntero()
|
|
|
|
|
TmpDT.Rows(e.RowIndex)("UM") = GvPS.Rows(e.RowIndex).FCDropDownList("DdlUnidadMedida").SelectedItem.Text
|
|
|
|
|
TmpDT.Rows(e.RowIndex)("Cantidad") = Cantidad
|
|
|
|
|
TmpDT.Rows(e.RowIndex)("Obs") = GvPS.Rows(e.RowIndex).FCTextBox("TxtObsPS").Text.Trim
|
|
|
|
|
TmpDT.Rows(e.RowIndex)("Obs") = GvPS.Rows(e.RowIndex).FCTextBox("TxtObsPS").Text.TrimEnd
|
|
|
|
|
TmpDT.Rows(e.RowIndex)("TiempoEntrega") = GvPS.Rows(e.RowIndex).FCTextBox("TxtTiempoEntrega").Text.Trim
|
|
|
|
|
TmpDT.Rows(e.RowIndex)("PU") = PU
|
|
|
|
|
TmpDT.Rows(e.RowIndex)("Descuento") = ObjDescuento.ImporteDescuento
|
|
|
|
|
@@ -8376,6 +8376,37 @@ Partial Class Ventas
|
|
|
|
|
Alert("La carta porte no tiene un destino definido.", TipoMensaje.MsgAdvertencia)
|
|
|
|
|
Exit Sub
|
|
|
|
|
End If
|
|
|
|
|
If DdlChofer.SelectedValue.ToEntero() <= 0 Then
|
|
|
|
|
Alert("La carta porte no tiene un chofer definido.", TipoMensaje.MsgAdvertencia)
|
|
|
|
|
Exit Sub
|
|
|
|
|
End If
|
|
|
|
|
If DdlUnidadCamion.SelectedValue.ToEntero() <= 0 Then
|
|
|
|
|
Alert("La carta porte no tiene un chofer definido.", TipoMensaje.MsgAdvertencia)
|
|
|
|
|
Exit Sub
|
|
|
|
|
End If
|
|
|
|
|
If String.IsNullOrEmpty(TxtDistancia.Text.Trim) Then
|
|
|
|
|
Alert("La carta porte no tiene la distancia definida.", TipoMensaje.MsgAdvertencia)
|
|
|
|
|
Exit Sub
|
|
|
|
|
End If
|
|
|
|
|
If String.IsNullOrEmpty(TxtFechaEntregaCP.Text.Trim) Then
|
|
|
|
|
Alert("La carta porte no tiene la F.Salida definida.", TipoMensaje.MsgAdvertencia)
|
|
|
|
|
Exit Sub
|
|
|
|
|
End If
|
|
|
|
|
If String.IsNullOrEmpty(TxtFechaLlegadaCP.Text.Trim) Then
|
|
|
|
|
Alert("La carta porte no tiene la F.Llegada definida.", TipoMensaje.MsgAdvertencia)
|
|
|
|
|
Exit Sub
|
|
|
|
|
End If
|
|
|
|
|
If DtMercancias Is Nothing OrElse DtMercancias.Rows.Count = 0 Then
|
|
|
|
|
Alert("La carta porte no tiene mercancía definida.", TipoMensaje.MsgAdvertencia)
|
|
|
|
|
Exit Sub
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
If DvConfiguracionVeiculo.Visible Then
|
|
|
|
|
If DdlConfigAuto.SelectedValue.ToEntero() <= 0 Then
|
|
|
|
|
Alert("La carta porte no tiene la configuración definida.", TipoMensaje.MsgAdvertencia)
|
|
|
|
|
Exit Sub
|
|
|
|
|
End If
|
|
|
|
|
End If
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
'CUANDO ES COTIZACION Y SE VA A FACTURAR SE HACE INGRESO
|
|
|
|
|
@@ -9327,46 +9358,58 @@ Partial Class Ventas
|
|
|
|
|
idCuentaContabilizacion = 10
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
If AutoConta Then
|
|
|
|
|
If idCuentaContabilizacion > 0 Then
|
|
|
|
|
If ObjConta.ContabilizarPrePoliza(ObjFactura.CvePrePoliza, ObjFactura.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjContPaq) Then
|
|
|
|
|
If ObjContPaq IsNot Nothing Then ObjContPaq.Commit()
|
|
|
|
|
Try
|
|
|
|
|
If AutoConta Then
|
|
|
|
|
If idCuentaContabilizacion > 0 Then
|
|
|
|
|
If ObjConta.ContabilizarPrePoliza(ObjFactura.CvePrePoliza, ObjFactura.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjContPaq) Then
|
|
|
|
|
If ObjContPaq IsNot Nothing Then ObjContPaq.Commit()
|
|
|
|
|
Else
|
|
|
|
|
Alert("Ocurrió un Error al contabilizar, pongase en contacto con Soporte Técnico", TipoMensaje.MsgError)
|
|
|
|
|
If ObjContPaq IsNot Nothing Then ObjContPaq.RollBack()
|
|
|
|
|
End If
|
|
|
|
|
Else
|
|
|
|
|
Alert("Ocurrio un Error al contabilizar, pongase en contacto con Soporte Técnico", TipoMensaje.MsgError)
|
|
|
|
|
If ObjContPaq IsNot Nothing Then ObjContPaq.RollBack()
|
|
|
|
|
Alert(String.Format("Falta asignación de las siguientes cuentas contables: {0}", CuentasContablesInvalidas), TipoMensaje.MsgAdvertencia)
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
Else
|
|
|
|
|
Alert(String.Format("Falta asignación de las siguientes cuentas contables: {0}", CuentasContablesInvalidas), TipoMensaje.MsgAdvertencia)
|
|
|
|
|
If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso UsuarioActual.Empresa.UsaAC Then
|
|
|
|
|
If ObjContPaq IsNot Nothing Then ObjContPaq.Commit()
|
|
|
|
|
End If
|
|
|
|
|
End If
|
|
|
|
|
Catch ex As Exception
|
|
|
|
|
OnError("Ocurrió un error al contabilizar la factura", ex)
|
|
|
|
|
End Try
|
|
|
|
|
|
|
|
|
|
Else
|
|
|
|
|
If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso UsuarioActual.Empresa.UsaAC Then
|
|
|
|
|
If ObjContPaq IsNot Nothing Then ObjContPaq.Commit()
|
|
|
|
|
End If
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
'RMF, cuando es pedido, se manda autorización.
|
|
|
|
|
If ObjFactura.TipoDocto.Contiene("PA") Then
|
|
|
|
|
Try
|
|
|
|
|
'RMF, cuando es pedido, se manda autorización.
|
|
|
|
|
If ObjFactura.TipoDocto.Contiene("PA") Then
|
|
|
|
|
|
|
|
|
|
Dim Titulo As String = "Solicitud de autorización" 'usuarios de crédito y cobranza
|
|
|
|
|
Dim Msg As String = String.Format("{0} - Folio {1} ", DdlSubProyectoDatos.SelectedItem.Text, TxtFolio.Text)
|
|
|
|
|
If UsuarioActual.CveEmpresa = 119 Then
|
|
|
|
|
ClsSisNotificaciones.SendNotificacionERP(1715, Titulo, Msg, 1)
|
|
|
|
|
ClsSisNotificaciones.SendNotificacionERP(1815, Titulo, Msg, 1)
|
|
|
|
|
ClsSisNotificaciones.SendNotificacionERP(1830, Titulo, Msg, 1)
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
ViewState("CveVenta") = ObjFactura.CveVenta
|
|
|
|
|
|
|
|
|
|
If Request("CveEmbarqueManifiesto") IsNot Nothing AndAlso IsNumeric(Request("CveEmbarqueManifiesto")) AndAlso Request("CveEmbarqueManifiesto").ToEntero() > 0 Then
|
|
|
|
|
|
|
|
|
|
If ObjVentas.Embarque_ManifiestoUpvta(ObjFactura.CveVenta, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, Request("CveEmbarqueManifiesto").ToEntero()) Then
|
|
|
|
|
Dim Titulo As String = "Solicitud de autorización" 'usuarios de crédito y cobranza
|
|
|
|
|
Dim Msg As String = String.Format("{0} - Folio {1} ", DdlSubProyectoDatos.SelectedItem.Text, TxtFolio.Text)
|
|
|
|
|
If UsuarioActual.CveEmpresa = 119 Then
|
|
|
|
|
ClsSisNotificaciones.SendNotificacionERP(1715, Titulo, Msg, 1)
|
|
|
|
|
ClsSisNotificaciones.SendNotificacionERP(1815, Titulo, Msg, 1)
|
|
|
|
|
ClsSisNotificaciones.SendNotificacionERP(1830, Titulo, Msg, 1)
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
End If
|
|
|
|
|
End If
|
|
|
|
|
GVAnticipos.DataBind()
|
|
|
|
|
Catch ex As Exception
|
|
|
|
|
OnError("Ocurrió un error al mandar las notificaciones de autorización", ex)
|
|
|
|
|
End Try
|
|
|
|
|
|
|
|
|
|
Try
|
|
|
|
|
ViewState("CveVenta") = ObjFactura.CveVenta
|
|
|
|
|
|
|
|
|
|
If Request("CveEmbarqueManifiesto") IsNot Nothing AndAlso IsNumeric(Request("CveEmbarqueManifiesto")) AndAlso Request("CveEmbarqueManifiesto").ToEntero() > 0 Then
|
|
|
|
|
|
|
|
|
|
If ObjVentas.Embarque_ManifiestoUpvta(ObjFactura.CveVenta, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, Request("CveEmbarqueManifiesto").ToEntero()) Then
|
|
|
|
|
|
|
|
|
|
End If
|
|
|
|
|
End If
|
|
|
|
|
Catch ex As Exception
|
|
|
|
|
OnError("Ocurrió un error al actualizar el embarque", ex)
|
|
|
|
|
End Try
|
|
|
|
|
|
|
|
|
|
Try
|
|
|
|
|
Dim DirectoriArchivoXML As String = String.Format("{0}{1}", UsuarioActual.Empresa.Ruta, ObjFactura.TipoDocto) ' System.IO.Path.Combine()
|
|
|
|
|
@@ -9374,7 +9417,7 @@ Partial Class Ventas
|
|
|
|
|
Directory.CreateDirectory(DirectoriArchivoXML)
|
|
|
|
|
End If
|
|
|
|
|
Catch ex As Exception
|
|
|
|
|
|
|
|
|
|
OnError("Ocurrió un error al generar el directorio de xml", ex)
|
|
|
|
|
End Try
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -9412,31 +9455,35 @@ Partial Class Ventas
|
|
|
|
|
Dim TmpDT7Eleven As New DataTable
|
|
|
|
|
Dim TmpDTComplementosTimbrado As New DataTable
|
|
|
|
|
|
|
|
|
|
If AplicaFEMSA Then
|
|
|
|
|
PrepararTimbrado(FM, TmpDT7Eleven, TmpDTComplementosTimbrado)
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
If ChkEmitirCartaPorte.Checked AndAlso CveTimbreCartaPorte > 0 Then
|
|
|
|
|
Dim RespCartaPorte = Timbres.PreParaCartaPorteFactura(CveTimbreCartaPorte, UsuarioActual)
|
|
|
|
|
If Not RespCartaPorte.TieneError Then
|
|
|
|
|
ObjFactura.Timbre.Complementos.CartaPorte = RespCartaPorte.CartaPorte
|
|
|
|
|
Else
|
|
|
|
|
DebeTimbrar = False
|
|
|
|
|
Alert(RespCartaPorte.Mensaje, TipoMensaje.MsgAdvertencia)
|
|
|
|
|
End If
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
Dim ObjTimbrado As New Timbrado
|
|
|
|
|
If DebeTimbrar Then
|
|
|
|
|
SeTimbro = ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura)
|
|
|
|
|
End If
|
|
|
|
|
Try
|
|
|
|
|
If AplicaFEMSA Then
|
|
|
|
|
PrepararTimbrado(FM, TmpDT7Eleven, TmpDTComplementosTimbrado)
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
If ChkEmitirCartaPorte.Checked AndAlso CveTimbreCartaPorte > 0 Then
|
|
|
|
|
Dim RespCartaPorte = Timbres.PreParaCartaPorteFactura(CveTimbreCartaPorte, UsuarioActual)
|
|
|
|
|
If Not RespCartaPorte.TieneError Then
|
|
|
|
|
ObjFactura.Timbre.Complementos.CartaPorte = RespCartaPorte.CartaPorte
|
|
|
|
|
Else
|
|
|
|
|
DebeTimbrar = False
|
|
|
|
|
Alert(RespCartaPorte.Mensaje, TipoMensaje.MsgAdvertencia)
|
|
|
|
|
End If
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
If DebeTimbrar Then
|
|
|
|
|
SeTimbro = ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura)
|
|
|
|
|
End If
|
|
|
|
|
Catch ex As Exception
|
|
|
|
|
OnError("Ocurrió un error al generar el timbrado", ex)
|
|
|
|
|
End Try
|
|
|
|
|
|
|
|
|
|
Dim FolioFiscalFactura As String = ObjTimbrado.UUID
|
|
|
|
|
Dim MsgErrorTimbrado = ObjTimbrado.MensajeErrorCFDI
|
|
|
|
|
ObjTimbrado = Nothing
|
|
|
|
|
|
|
|
|
|
'NOTA DE CREDITO - REFACTURADA - CASO ESPECIAL, TIMBRADO E IMPRESION
|
|
|
|
|
If DebeTimbrar AndAlso SeTimbro AndAlso ListaNotasCreditoGeneradas.Count > 0 Then
|
|
|
|
|
If DebeTimbrar AndAlso SeTimbro AndAlso ListaNotasCreditoGeneradas IsNot Nothing AndAlso ListaNotasCreditoGeneradas.Count > 0 Then
|
|
|
|
|
Try
|
|
|
|
|
For Each NCGenerada In ListaNotasCreditoGeneradas
|
|
|
|
|
If NCGenerada.Timbre IsNot Nothing Then
|
|
|
|
|
@@ -9467,45 +9514,55 @@ Partial Class Ventas
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
'CANCELAR FACTURA ANTERIOR
|
|
|
|
|
If SeTimbro AndAlso (Me.CveDevolucion > 0 AndAlso Me.NuevaFactura = 1) Then
|
|
|
|
|
If Me.ObjFacturaNC IsNot Nothing AndAlso Me.ObjFacturaNC.CveEstatusFactura <> 5 Then
|
|
|
|
|
Me.ObjFacturaNC.CveEstatusRefacturacion = 2 'MARCAR COMO REFACTURADA
|
|
|
|
|
MsgCancelacionRefacturacion = Me.ObjFacturaNC.CancelarPorRefacturacion(Me.ObjFacturaNC.CveMotivoCancelacion, Me.ObjFacturaNC.MotivoCancelacion, FolioFiscalFactura)
|
|
|
|
|
Try
|
|
|
|
|
If SeTimbro AndAlso (Me.CveDevolucion > 0 AndAlso Me.NuevaFactura = 1) Then
|
|
|
|
|
If Me.ObjFacturaNC IsNot Nothing AndAlso Me.ObjFacturaNC.CveEstatusFactura <> 5 Then
|
|
|
|
|
Me.ObjFacturaNC.CveEstatusRefacturacion = 2 'MARCAR COMO REFACTURADA
|
|
|
|
|
MsgCancelacionRefacturacion = Me.ObjFacturaNC.CancelarPorRefacturacion(Me.ObjFacturaNC.CveMotivoCancelacion, Me.ObjFacturaNC.MotivoCancelacion, FolioFiscalFactura)
|
|
|
|
|
End If
|
|
|
|
|
End If
|
|
|
|
|
End If
|
|
|
|
|
Catch ex As Exception
|
|
|
|
|
OnError("Ocurrió un error al cancelar la factura anterior.", ex)
|
|
|
|
|
End Try
|
|
|
|
|
|
|
|
|
|
End If
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
'VERIFICAR 100% AVANCE A IMPORTE Y CANTIDAD
|
|
|
|
|
If ObjFactura.TipoDocto.Contiene("Ing", "Ant") AndAlso CveContrato > 0 Then
|
|
|
|
|
If ObjContr.GetContratos(CveContrato, UsuarioActual.CveEmpresa) Then
|
|
|
|
|
Try
|
|
|
|
|
If ObjFactura.TipoDocto.Contiene("Ing", "Ant") AndAlso CveContrato > 0 Then
|
|
|
|
|
If ObjContr.GetContratos(CveContrato, UsuarioActual.CveEmpresa) Then
|
|
|
|
|
|
|
|
|
|
If ObjContr.DtResultados.Rows.Count > 0 Then
|
|
|
|
|
If ObjContr.DtResultados.Rows.Count > 0 Then
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
'SI ES FLEXIBLE QUE NOTIFIQUE EL MONTO MAXIMO, SI NO LO ES QUE NOTIFIQUE EL PORCENTAJE ALCANZADO... FLEXIBLE = 2, NO FLEXIBLE = 1
|
|
|
|
|
If ObjContr.DtResultados.Rows(0)("ModalidadDetalle").ToString() = "1" Then
|
|
|
|
|
Dim PorcentajeAvance As Double = ObjContr.DtResultados.Rows(0)("ContratoAvance").ToString().ToDouble
|
|
|
|
|
'SI ES FLEXIBLE QUE NOTIFIQUE EL MONTO MAXIMO, SI NO LO ES QUE NOTIFIQUE EL PORCENTAJE ALCANZADO... FLEXIBLE = 2, NO FLEXIBLE = 1
|
|
|
|
|
If ObjContr.DtResultados.Rows(0)("ModalidadDetalle").ToString() = "1" Then
|
|
|
|
|
Dim PorcentajeAvance As Double = ObjContr.DtResultados.Rows(0)("ContratoAvance").ToString().ToDouble
|
|
|
|
|
|
|
|
|
|
If PorcentajeAvance >= 100 Then
|
|
|
|
|
EnviarNotificacionAvance(ObjContr.DtResultados.Rows(0)("NumeroContrato").ToString(), ObjContr.DtResultados.Rows(0)("DescripcionContrato").ToString(), ObjContr.DtResultados.Rows(0)("ContratoTipo").ToString(), ObjContr.DtResultados.Rows(0)("NombreComercial").ToString(), ObjContr.DtResultados.Rows(0)("CorreoVendedor").ToString())
|
|
|
|
|
If PorcentajeAvance >= 100 Then
|
|
|
|
|
EnviarNotificacionAvance(ObjContr.DtResultados.Rows(0)("NumeroContrato").ToString(), ObjContr.DtResultados.Rows(0)("DescripcionContrato").ToString(), ObjContr.DtResultados.Rows(0)("ContratoTipo").ToString(), ObjContr.DtResultados.Rows(0)("NombreComercial").ToString(), ObjContr.DtResultados.Rows(0)("CorreoVendedor").ToString())
|
|
|
|
|
End If
|
|
|
|
|
Else
|
|
|
|
|
Dim MontoMaximo As Double = ObjContr.DtResultados.Rows(0)("ImporteMax").ToString().ToDouble
|
|
|
|
|
Dim Avance As Double = ObjContr.DtResultados.Rows(0)("Avance").ToString().ToDouble
|
|
|
|
|
|
|
|
|
|
Dim PorcentajeAvance As Double = (Avance / MontoMaximo) * 100
|
|
|
|
|
|
|
|
|
|
If PorcentajeAvance >= 100 And MontoMaximo > 0 Then
|
|
|
|
|
EnviarNotificacionAvance(ObjContr.DtResultados.Rows(0)("NumeroContrato").ToString(), ObjContr.DtResultados.Rows(0)("DescripcionContrato").ToString(), ObjContr.DtResultados.Rows(0)("ContratoTipo").ToString(), ObjContr.DtResultados.Rows(0)("NombreComercial").ToString(), ObjContr.DtResultados.Rows(0)("CorreoVendedor").ToString(), MontoMaximo)
|
|
|
|
|
End If
|
|
|
|
|
End If
|
|
|
|
|
Else
|
|
|
|
|
Dim MontoMaximo As Double = ObjContr.DtResultados.Rows(0)("ImporteMax").ToString().ToDouble
|
|
|
|
|
Dim Avance As Double = ObjContr.DtResultados.Rows(0)("Avance").ToString().ToDouble
|
|
|
|
|
|
|
|
|
|
Dim PorcentajeAvance As Double = (Avance / MontoMaximo) * 100
|
|
|
|
|
|
|
|
|
|
If PorcentajeAvance >= 100 And MontoMaximo > 0 Then
|
|
|
|
|
EnviarNotificacionAvance(ObjContr.DtResultados.Rows(0)("NumeroContrato").ToString(), ObjContr.DtResultados.Rows(0)("DescripcionContrato").ToString(), ObjContr.DtResultados.Rows(0)("ContratoTipo").ToString(), ObjContr.DtResultados.Rows(0)("NombreComercial").ToString(), ObjContr.DtResultados.Rows(0)("CorreoVendedor").ToString(), MontoMaximo)
|
|
|
|
|
End If
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
End If
|
|
|
|
|
End If
|
|
|
|
|
End If
|
|
|
|
|
Catch ex As Exception
|
|
|
|
|
OnError("Ocurrió un error al notificar el avance.", ex)
|
|
|
|
|
End Try
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
'MENSAJE PRINCIPAL
|
|
|
|
|
MensajeAlert.AppendFormat(String.Format("<br/>La {0}: <b>{1}</b> se generó correctamente.<br/><br/>", ObjFactura.TipoDocumento, ObjFactura.SerieFolio))
|
|
|
|
|
@@ -9521,7 +9578,8 @@ Partial Class Ventas
|
|
|
|
|
Try
|
|
|
|
|
'MANDA CORREO
|
|
|
|
|
Dim strURLHOST = String.Format("{0}://{1}:{2}", HttpContext.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port)
|
|
|
|
|
Dim Hilo As New System.Threading.Thread(Sub() GeneraPDFFactura(ChkEnviarFactura.Checked, CveVenta, UsuarioActual, strURLHOST))
|
|
|
|
|
Dim Factura = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=False)
|
|
|
|
|
Dim Hilo As New System.Threading.Thread(Sub() GeneraPDFFactura(ChkEnviarFactura.Checked, Factura, UsuarioActual, strURLHOST))
|
|
|
|
|
Hilo.Start()
|
|
|
|
|
Catch ex As Exception
|
|
|
|
|
OnError("Ocurrió un error al enviar el PDF", ex)
|
|
|
|
|
@@ -9538,7 +9596,7 @@ Partial Class Ventas
|
|
|
|
|
Dim ArchivoEgs As New System.IO.FileInfo(String.Format("{0}Formatos/NotaCredito.rdlc", UsuarioActual.Empresa.Ruta))
|
|
|
|
|
|
|
|
|
|
If ArchivoIng.Exists Or ArchivoRem.Exists Or ArchivoIngPyMe.Exists Or ArchivoEgs.Exists Then
|
|
|
|
|
MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF</a></li></ul><br/>", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1", CveVenta)))
|
|
|
|
|
MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF</a></li></ul><br/>", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", CveVenta)))
|
|
|
|
|
Else
|
|
|
|
|
MensajeAlert.Append("Ocurrió un error al generar el PDF. Por favor vuelva a entrar a la factura para imprimir el PDF. ")
|
|
|
|
|
End If
|
|
|
|
|
@@ -9566,7 +9624,7 @@ Partial Class Ventas
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
'AUTO DESCARGAR PDF
|
|
|
|
|
If UsuarioActual.CveEmpresa.Contiene(72, 1) Then
|
|
|
|
|
If UsuarioActual.CveEmpresa.Contiene(72) Then
|
|
|
|
|
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant") Then
|
|
|
|
|
RegistraScript($"window.location.href = '/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1", CveVenta))}'", "Imprimir")
|
|
|
|
|
End If
|
|
|
|
|
@@ -9670,11 +9728,16 @@ Partial Class Ventas
|
|
|
|
|
|
|
|
|
|
MensajeAlert.Clear()
|
|
|
|
|
|
|
|
|
|
'LIMPIA CONDICIONES DE PAGO - CONTADO
|
|
|
|
|
RBLPago.SelectedValue = "1"
|
|
|
|
|
LimpiaEscondeContado()
|
|
|
|
|
BtnEmitirImprimir.Visible = False
|
|
|
|
|
ObjFactura = Nothing
|
|
|
|
|
Try
|
|
|
|
|
'LIMPIA CONDICIONES DE PAGO - CONTADO
|
|
|
|
|
RBLPago.SelectedValue = "1"
|
|
|
|
|
LimpiaEscondeContado()
|
|
|
|
|
BtnEmitirImprimir.Visible = False
|
|
|
|
|
ObjFactura = Nothing
|
|
|
|
|
Catch ex As Exception
|
|
|
|
|
OnError("Ocurrió un error al limpiar los datos", ex)
|
|
|
|
|
End Try
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Else
|
|
|
|
|
ObjVentas.RollBack()
|
|
|
|
|
@@ -11572,7 +11635,7 @@ Partial Class Ventas
|
|
|
|
|
If UsuarioActual.Empresa.Funcionalidad(350) = "1" Then
|
|
|
|
|
Timbre.Receptor.Nombre = Obj.Cliente.Nombre
|
|
|
|
|
Else
|
|
|
|
|
Timbre.Receptor.Nombre = Obj.Cliente.NombreComercial
|
|
|
|
|
Timbre.Receptor.Nombre = Obj.Cliente.Nombre + " " + Obj.Cliente.RegimenSociedad
|
|
|
|
|
End If
|
|
|
|
|
Timbre.Receptor.DomicilioFiscalReceptor = Obj.Cliente.CP
|
|
|
|
|
End If
|
|
|
|
|
@@ -15011,19 +15074,14 @@ Partial Class Ventas
|
|
|
|
|
#End Region
|
|
|
|
|
|
|
|
|
|
#Region "¡ P D F R E P O R T V I E W E R !"
|
|
|
|
|
Private Sub GeneraPDFFactura(EnviaCorreo As Boolean, CveVenta As Integer, UsuarioActual As Usuario, strURLHOST As String)
|
|
|
|
|
Private Sub GeneraPDFFactura(EnviaCorreo As Boolean, Factura As Modelos.Factura, UsuarioActual As Usuario, strURLHOST As String)
|
|
|
|
|
'GUARDA PDF
|
|
|
|
|
Dim LocalSerieFolio As String = String.Empty
|
|
|
|
|
Dim LocalTipoDocto As String = String.Empty
|
|
|
|
|
|
|
|
|
|
Dim Factura As Modelos.Factura
|
|
|
|
|
'TIMBRADO NUEVO
|
|
|
|
|
Try
|
|
|
|
|
Dim ObjetoPDF As Byte() = DescargarFactura(CveVenta, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, Regenerar:=True, strURLHOST:=strURLHOST)
|
|
|
|
|
|
|
|
|
|
If ObjetoPDF Is Nothing OrElse ObjetoPDF.Length = 0 Then
|
|
|
|
|
PdfFactura(ObjFactura, AplicaPagare:=If(ObjFactura.TipoDocto.Contiene("Ing", "Rem", "Ant"), "1", "0"))
|
|
|
|
|
End If
|
|
|
|
|
DescargarFactura(Factura.CveVenta, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, Regenerar:=True, strURLHOST:=strURLHOST)
|
|
|
|
|
Catch ex As Exception
|
|
|
|
|
OnError("Ocurrió un error al generar el PDF", ex)
|
|
|
|
|
End Try
|
|
|
|
|
@@ -15031,7 +15089,6 @@ Partial Class Ventas
|
|
|
|
|
Dim ErrorCorreo As Boolean = False
|
|
|
|
|
|
|
|
|
|
If EnviaCorreo Then
|
|
|
|
|
Factura = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=False)
|
|
|
|
|
If Factura IsNot Nothing Then
|
|
|
|
|
'MANDA CORREO
|
|
|
|
|
If EnviaCorreo Then
|
|
|
|
|
@@ -16376,7 +16433,8 @@ Partial Class Ventas
|
|
|
|
|
Try
|
|
|
|
|
'MANDA CORREO
|
|
|
|
|
Dim strURLHOST = String.Format("{0}://{1}:{2}", HttpContext.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port)
|
|
|
|
|
Dim Hilo As New System.Threading.Thread(Sub() GeneraPDFFactura(ChkEnviarFactura.Checked, CveVenta, UsuarioActual, strURLHOST))
|
|
|
|
|
Dim Factura = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=False)
|
|
|
|
|
Dim Hilo As New System.Threading.Thread(Sub() GeneraPDFFactura(ChkEnviarFactura.Checked, Factura, UsuarioActual, strURLHOST))
|
|
|
|
|
Hilo.Start()
|
|
|
|
|
Catch ex As Exception
|
|
|
|
|
OnError("Ocurrió un error al enviar el PDF", ex)
|
|
|
|
|
@@ -18103,7 +18161,7 @@ Partial Class Ventas
|
|
|
|
|
If CvePS.Contiene(402917, 402918) Then
|
|
|
|
|
PUPromocion = 40D
|
|
|
|
|
End If
|
|
|
|
|
PUModificado = Math.Round(PUPromocion / (1 + If(IncluyeImpuestos, PorcentajeIVA, 0)), 6)
|
|
|
|
|
PUModificado = Math.Round(PUPromocion / (1 + PorcentajeIVA), 6)
|
|
|
|
|
End If
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
@@ -18145,7 +18203,7 @@ Partial Class Ventas
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
AgregarProductoServicio(Cantidad, DdlUnidadMedida.SelectedValue.ToEntero(), DdlUnidadMedida.SelectedItem.Text, DdlClasificacion.SelectedValue.ToEntero(), DdlClasificacion.SelectedItem.Text,
|
|
|
|
|
CvePS, "", TxtObsPS.Text.Trim, PU, ObjDescuento.ImporteDescuento,
|
|
|
|
|
CvePS, "", TxtObsPS.Text.TrimEnd, PU, ObjDescuento.ImporteDescuento,
|
|
|
|
|
DdlProyecto.SelectedValue.ToEntero(), DdlProyecto.SelectedItem.Text, DdlSubProyecto.SelectedValue.ToEntero(), DdlSubProyecto.SelectedItem.Text,
|
|
|
|
|
Serie:=If(DIVCod.Visible, TxtCodigoSerie.Text.Trim, ""), TiempoEntrega:=TxtTiempoEntrega.Text, CuentaPredial:=TxtCuentaPredial.Text.Trim, RegeneraIEPS:=ClienteDesglosaIEPS, CvePromocionDetalle:=ObjDescuento.CvePromocionDetalle,
|
|
|
|
|
ImporteProntoPago:=ObjDescuento.ImporteProntoPago)
|
|
|
|
|
@@ -21681,6 +21739,15 @@ Partial Class Ventas
|
|
|
|
|
TxtTipoCambio.Text = GlobalTipoCambio(TxtFecha.Text.ToDate).ToString()
|
|
|
|
|
TrConversionTipoCambio.Visible = True
|
|
|
|
|
End Select
|
|
|
|
|
|
|
|
|
|
If UsuarioActual.CveEmpresa.Contiene(13, 83) Then
|
|
|
|
|
TxtTipoCambio.Enabled = True
|
|
|
|
|
TxtTipoCambioDlls.Enabled = True
|
|
|
|
|
TxtTipoCambio.ReadOnly = False
|
|
|
|
|
TxtTipoCambioDlls.ReadOnly = False
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UpPS.Update()
|
|
|
|
|
|
|
|
|
|
If CveCliente > 0 Then
|
|
|
|
|
@@ -25445,37 +25512,42 @@ Partial Class Ventas
|
|
|
|
|
'1 = TODO FINO
|
|
|
|
|
'2 = ERROR
|
|
|
|
|
'3 = SIN CELULAR - PROBLEMA CON EL CELULAR
|
|
|
|
|
|
|
|
|
|
Dim Mensaje = UsuarioActual.Empresa.Funcionalidad(152)
|
|
|
|
|
If Mensaje = "" Then Return 0
|
|
|
|
|
|
|
|
|
|
Dim Celular As String = ""
|
|
|
|
|
|
|
|
|
|
Try
|
|
|
|
|
Celular = ObjFactura.Cliente.CobranzaTelefono
|
|
|
|
|
Catch ex As Exception
|
|
|
|
|
Dim Mensaje = UsuarioActual.Empresa.Funcionalidad(152)
|
|
|
|
|
If Mensaje = "" Then Return 0
|
|
|
|
|
|
|
|
|
|
Dim Celular As String = ""
|
|
|
|
|
|
|
|
|
|
Try
|
|
|
|
|
Celular = ObjFactura.Cliente.CobranzaTelefono
|
|
|
|
|
Catch ex As Exception
|
|
|
|
|
|
|
|
|
|
End Try
|
|
|
|
|
|
|
|
|
|
If Celular.Length <> 10 Then Return 3
|
|
|
|
|
|
|
|
|
|
'ARMA MENSAJE
|
|
|
|
|
'4: VSH Monitoreo aviso de: Factura pendiente {SerieFolio} del {Fecha} por ${Importe} fecha limite de pago {FechaPago} Bancomer 0171426931-{ClienteNombreCorto}
|
|
|
|
|
Mensaje = Mensaje.Replace("{SerieFolio}", ObjFactura.SerieFolio)
|
|
|
|
|
Mensaje = Mensaje.Replace("{Fecha}", ObjFactura.Fecha.ToString("dd-MMM-yyyy").Replace(".", ""))
|
|
|
|
|
Mensaje = Mensaje.Replace("{Importe}", ObjFactura.Total.FormatoNumero)
|
|
|
|
|
Mensaje = Mensaje.Replace("{FechaPago}", ObjFactura.FechaPago.ToString("dd-MMM-yyyy").Replace(".", ""))
|
|
|
|
|
Mensaje = Mensaje.Replace("{ClienteNombreCorto}", ObjFactura.Cliente.NombreCorto)
|
|
|
|
|
If Mensaje = "" Then Return 2
|
|
|
|
|
|
|
|
|
|
Dim ObjMensaje As New ClsTecnoMovil
|
|
|
|
|
If ObjMensaje.EnviarMensajeWS(Celular, Mensaje) Then
|
|
|
|
|
If ObjEventos.AddEventoBitacora($"Notificación al cliente via SMS. Mensaje: {Mensaje}", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCliente:=ObjFactura.CveCliente, CveVenta:=ObjFactura.CveVenta) Then
|
|
|
|
|
End If
|
|
|
|
|
Return 1
|
|
|
|
|
Else
|
|
|
|
|
Return 2
|
|
|
|
|
End If
|
|
|
|
|
Catch ex As Exception
|
|
|
|
|
OnError("Ocurrió un error al generar el SMS", ex)
|
|
|
|
|
Return 0
|
|
|
|
|
End Try
|
|
|
|
|
|
|
|
|
|
If Celular.Length <> 10 Then Return 3
|
|
|
|
|
|
|
|
|
|
'ARMA MENSAJE
|
|
|
|
|
'4: VSH Monitoreo aviso de: Factura pendiente {SerieFolio} del {Fecha} por ${Importe} fecha limite de pago {FechaPago} Bancomer 0171426931-{ClienteNombreCorto}
|
|
|
|
|
Mensaje = Mensaje.Replace("{SerieFolio}", ObjFactura.SerieFolio)
|
|
|
|
|
Mensaje = Mensaje.Replace("{Fecha}", ObjFactura.Fecha.ToString("dd-MMM-yyyy").Replace(".", ""))
|
|
|
|
|
Mensaje = Mensaje.Replace("{Importe}", ObjFactura.Total.FormatoNumero)
|
|
|
|
|
Mensaje = Mensaje.Replace("{FechaPago}", ObjFactura.FechaPago.ToString("dd-MMM-yyyy").Replace(".", ""))
|
|
|
|
|
Mensaje = Mensaje.Replace("{ClienteNombreCorto}", ObjFactura.Cliente.NombreCorto)
|
|
|
|
|
If Mensaje = "" Then Return 2
|
|
|
|
|
|
|
|
|
|
Dim ObjMensaje As New ClsTecnoMovil
|
|
|
|
|
If ObjMensaje.EnviarMensajeWS(Celular, Mensaje) Then
|
|
|
|
|
If ObjEventos.AddEventoBitacora($"Notificación al cliente via SMS. Mensaje: {Mensaje}", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCliente:=ObjFactura.CveCliente, CveVenta:=ObjFactura.CveVenta) Then
|
|
|
|
|
End If
|
|
|
|
|
Return 1
|
|
|
|
|
Else
|
|
|
|
|
Return 2
|
|
|
|
|
End If
|
|
|
|
|
End Function
|
|
|
|
|
#End Region
|
|
|
|
|
|
|
|
|
|
@@ -31305,6 +31377,8 @@ Partial Class Ventas
|
|
|
|
|
' BtnCrearApartirDe.Visible = False
|
|
|
|
|
'End If
|
|
|
|
|
|
|
|
|
|
Dim FolioOriginal As String = TxtFolio.Text
|
|
|
|
|
|
|
|
|
|
HdnCveVenta.Value = ""
|
|
|
|
|
|
|
|
|
|
BtnCrearApartirDe.Visible = False '[IPP-2Novimebre2018] REEMPLAZA LO COMENTADO ARRIBA
|
|
|
|
|
@@ -31504,6 +31578,30 @@ Partial Class Ventas
|
|
|
|
|
HabilitarControlesCartaPorte(True)
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
If DivAdjuntar.Visible Then
|
|
|
|
|
Dim FolioNuevo As String = TxtFolio.Text
|
|
|
|
|
If FolioNuevo <> FolioOriginal Then
|
|
|
|
|
If Adjunto <> "" Then
|
|
|
|
|
Adjunto = ""
|
|
|
|
|
BtnArchivoAdjunto.Text = ""
|
|
|
|
|
BtnArchivoAdjunto.Visible = False
|
|
|
|
|
BtnEliminarAdjunto.Visible = False
|
|
|
|
|
BtnAdjuntar.Visible = True
|
|
|
|
|
|
|
|
|
|
tdAdjuntar.Style.Item("display") = "block"
|
|
|
|
|
tdAdjunto.Style.Item("display") = "none"
|
|
|
|
|
Else
|
|
|
|
|
DivAdjuntar.Visible = True
|
|
|
|
|
End If
|
|
|
|
|
Else
|
|
|
|
|
DivAdjuntar.Visible = False
|
|
|
|
|
End If
|
|
|
|
|
UpAdjuntar.Update()
|
|
|
|
|
Else
|
|
|
|
|
DivAdjuntar.Visible = True
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UpnTools.Update()
|
|
|
|
|
UpCliente.Update()
|
|
|
|
|
UpParametros.Update()
|
|
|
|
|
@@ -34662,6 +34760,7 @@ Partial Class Ventas
|
|
|
|
|
If DrPS IsNot Nothing Then
|
|
|
|
|
CveUM = drPSFlete("CveUnidadMedida").ToString().ToEntero()
|
|
|
|
|
CveClasificacion = drPSFlete("CveClasificacion").ToString().ToEntero()
|
|
|
|
|
UnidadMedida = drPSFlete("UnidadMedida").ToString()
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
Dim CveSubProyecto As Integer = DdlSubProyectoDatos.SelectedValue.ToEntero()
|
|
|
|
|
|