diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb
index 8234a17ad..90d5cbe6e 100644
--- a/App_Code/ClsVentas.vb
+++ b/App_Code/ClsVentas.vb
@@ -6117,25 +6117,25 @@ Public Class ClsVentas
End Function
-
-
-
- Public Function AddMedico(Medico As String, CedulaProfesional As String, FechaNacimiento As Date, Notas As String, DiasAtencion As String, Horario As String, Lugar As String, Estatus As Boolean, CveUsuario As Integer,
- CveEmpresa As Integer, Telefono As String, Mail As String, CveMedicoEspecialidad As Integer, Celular As String, Consultorio As String, Optional CveMedicoSubEspecialidad As Integer = -1,
- Optional Torre As String = "-1") As Integer
+ Public Function AddMedico(Nombre As String, APaterno As String, AMaterno As String, CedulaProfesional As String, FechaNacimiento As Date, Notas As String, Estatus As Boolean, CveUsuario As Integer,
+ CveEmpresa As Integer, Telefono As String, Mail As String, CveMedicoEspecialidad As Integer, Celular As String, Optional CveMedicoSubEspecialidad As Integer = -1, Optional CveVendedor As Integer = -1) As Integer
Dim Retorno As Boolean = False
CveMedicoNuevo = -1
DataAdapter("PA_Vta_MedicosAdd")
With SqlAdapter.SelectCommand.Parameters
+ .Add("@Nombre", SqlDbType.VarChar).Value = Nombre
+ .Add("@APaterno", SqlDbType.VarChar).Value = APaterno
+ .Add("@AMaterno", SqlDbType.VarChar).Value = AMaterno
+ '.Add("@Medico", SqlDbType.VarChar).Value = Medico
.Add("@CedulaProfesional", SqlDbType.VarChar).Value = CedulaProfesional
- .Add("@Medico", SqlDbType.VarChar).Value = Medico
+ '.Add("@Medico", SqlDbType.VarChar).Value = Medico
.Add("@FechaNacimiento", SqlDbType.Date).Value = FechaNacimiento
.Add("@Notas", SqlDbType.VarChar).Value = Notas
- .Add("@DiasAtencion", SqlDbType.VarChar).Value = DiasAtencion
- .Add("@Horario", SqlDbType.VarChar).Value = Horario
- .Add("@Lugar", SqlDbType.VarChar).Value = Lugar
+ '.Add("@DiasAtencion", SqlDbType.VarChar).Value = DiasAtencion
+ '.Add("@Horario", SqlDbType.VarChar).Value = Horario
+ '.Add("@Lugar", SqlDbType.VarChar).Value = Lugar
.Add("@Estatus", SqlDbType.Bit).Value = Estatus
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
@@ -6143,9 +6143,10 @@ Public Class ClsVentas
.Add("@Mail", SqlDbType.VarChar).Value = Mail
.Add("@CveMedicoEspecialidad", SqlDbType.Int).Value = CveMedicoEspecialidad
.Add("@Celular", SqlDbType.VarChar).Value = Celular
- .Add("@Consultorio", SqlDbType.VarChar).Value = Consultorio
+ '.Add("@Consultorio", SqlDbType.VarChar).Value = Consultorio
.Add("@CveMedicoSubEspecialidad", SqlDbType.Int).Value = CveMedicoSubEspecialidad
- .Add("@Torre", SqlDbType.VarChar).Value = Torre
+ .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
+ '.Add("@Torre", SqlDbType.VarChar).Value = Torre
.Add("@CveMedicoNuevo", SqlDbType.Int).Direction = ParameterDirection.Output
@@ -6163,21 +6164,23 @@ Public Class ClsVentas
End Function
- Public Function UpdateMedico(CveMedico As Integer, Medico As String, CedulaProfesional As String, FechaNacimiento As Date, Notas As String, DiasAtencion As String, Horario As String, Lugar As String, Estatus As Boolean, CveUsuario As Integer,
- CveEmpresa As Integer, Telefono As String, Mail As String, CveMedicoEspecialidad As Integer, Celular As String, Consultorio As String, Optional CveMedicoSubEspecialidad As Integer = -1,
- Optional Torre As String = "-1") As Boolean
+ Public Function UpdateMedico(CveMedico As Integer, Nombre As String, APaterno As String, AMaterno As String, CedulaProfesional As String, FechaNacimiento As Date, Notas As String, Estatus As Boolean, CveUsuario As Integer,
+ CveEmpresa As Integer, Telefono As String, Mail As String, CveMedicoEspecialidad As Integer, Celular As String, Optional CveMedicoSubEspecialidad As Integer = -1, Optional CveVendedor As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_MedicosUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveMedico", SqlDbType.Int).Value = CveMedico
- .Add("@Medico", SqlDbType.VarChar).Value = Medico
+ .Add("@Nombre", SqlDbType.VarChar).Value = Nombre
+ .Add("@APaterno", SqlDbType.VarChar).Value = APaterno
+ .Add("@AMaterno", SqlDbType.VarChar).Value = AMaterno
+ '.Add("@Medico", SqlDbType.VarChar).Value = Medico
.Add("@CedulaProfesional", SqlDbType.VarChar).Value = CedulaProfesional
.Add("@FechaNacimiento", SqlDbType.Date).Value = FechaNacimiento
.Add("@Notas", SqlDbType.VarChar).Value = Notas
- .Add("@DiasAtencion", SqlDbType.VarChar).Value = DiasAtencion
- .Add("@Horario", SqlDbType.VarChar).Value = Horario
- .Add("@Lugar", SqlDbType.VarChar).Value = Lugar
+ '.Add("@DiasAtencion", SqlDbType.VarChar).Value = DiasAtencion
+ '.Add("@Horario", SqlDbType.VarChar).Value = Horario
+ '.Add("@Lugar", SqlDbType.VarChar).Value = Lugar
.Add("@Estatus", SqlDbType.Bit).Value = Estatus
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
@@ -6185,9 +6188,10 @@ Public Class ClsVentas
.Add("@Mail", SqlDbType.VarChar).Value = Mail
.Add("@CveMedicoEspecialidad", SqlDbType.Int).Value = CveMedicoEspecialidad
.Add("@Celular", SqlDbType.VarChar).Value = Celular
- .Add("@Consultorio", SqlDbType.VarChar).Value = Consultorio
+ '.Add("@Consultorio", SqlDbType.VarChar).Value = Consultorio
.Add("@CveMedicoSubEspecialidad", SqlDbType.Int).Value = CveMedicoSubEspecialidad
- .Add("@Torre", SqlDbType.VarChar).Value = Torre
+ .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
+ '.Add("@Torre", SqlDbType.VarChar).Value = Torre
End With
@@ -6405,6 +6409,111 @@ Public Class ClsVentas
#End Region
+#Region "MEDICO CLIENTE SUCURALES"
+
+
+
+ Public Function GetMedicosClientesSucursales(CveMedico As Integer, CveEmpresa As Integer) As Boolean
+
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Vta_MedicosClientesSucursalesGet")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveMedico", SqlDbType.Int).Value = CveMedico
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al obtener los detalles.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+
+ End Function
+
+ Public Function AddMedicosClientesSucursales(CveMedico As Integer, CveCliente As Integer, CveClienteSucursal As Integer, DiasAtencion As String, Horario As String, Consultorio As String, Torre As String, AsistenteNombre As String,
+ CveUsuario As Integer, CveEmpresa As Integer) As Boolean
+
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_Vta_MedicosClientesSucursalesAdd")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveMedico", SqlDbType.Int).Value = CveMedico
+ .Add("@CveCliente", SqlDbType.Int).Value = CveCliente
+ .Add("@CveClienteSucursal", SqlDbType.Int).Value = CveClienteSucursal
+ .Add("@DiasAtencion", SqlDbType.VarChar).Value = DiasAtencion
+ .Add("@Horario", SqlDbType.VarChar).Value = Horario
+ .Add("@Consultorio", SqlDbType.VarChar).Value = Consultorio
+ .Add("@Torre", SqlDbType.VarChar).Value = Torre
+ .Add("@AsistenteNombre", SqlDbType.VarChar).Value = AsistenteNombre
+ .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al guardar el detalle.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+
+ End Function
+
+ Public Function UpdateMedicosClientesSucursales(CveMedicoClienteSucursal As Integer, CveMedico As Integer, CveCliente As Integer, CveClienteSucursal As Integer, DiasAtencion As String, Horario As String, Consultorio As String, Torre As String,
+ AsistenteNombre As String, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
+
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Vta_MedicosClientesSucursalesUpdate")
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveMedicoClienteSucursal", SqlDbType.Int).Value = CveMedicoClienteSucursal
+ .Add("@CveMedico", SqlDbType.Int).Value = CveMedico
+ .Add("@CveCliente", SqlDbType.Int).Value = CveCliente
+ .Add("@CveClienteSucursal", SqlDbType.Int).Value = CveClienteSucursal
+ .Add("@DiasAtencion", SqlDbType.VarChar).Value = DiasAtencion
+ .Add("@Horario", SqlDbType.VarChar).Value = Horario
+ .Add("@Consultorio", SqlDbType.VarChar).Value = Consultorio
+ .Add("@Torre", SqlDbType.VarChar).Value = Torre
+ .Add("@AsistenteNombre", SqlDbType.VarChar).Value = AsistenteNombre
+ .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al actualizar el Medico.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+ Return Retorno
+
+ End Function
+
+ Public Function RemoveMedicosClientesSucursales(CveMedicoClienteSucursal As Integer, CveEmpresa As Integer) As Boolean
+
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Vta_MedicosClientesSucursalesRemove")
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveMedicoClienteSucursal", SqlDbType.Int).Value = CveMedicoClienteSucursal
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al eliminar el detalle.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+ Return Retorno
+
+ End Function
+
+
+#End Region
+
#Region "PRODEDIMIENTOS"
Public Function GetProcedimientos(CveProcedimiento As Integer, CveEmpresa As Integer, Estatus As Integer) As Boolean
diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb
index 916eac813..4a7b56be4 100644
--- a/App_Code/Modelos.vb
+++ b/App_Code/Modelos.vb
@@ -3248,31 +3248,40 @@ Namespace Modelos
Dim TipoMovto68 As Boolean = TipoMovimiento
'SI ES CANCELACION DEBE GENERAR EL MOVIMIENTO DE SALIDA DE USADOS
If ValorMultiplicador = -1 Then
- CveMovimientoReferencia = CancelarInventarioUsado(ObjFactura, CveAlmacen, CveMovimiento, ObjInventario, ObjConta, GenerarPrePoliza:=False)
+ Dim CveMovCancelacion = CancelarInventarioUsado(ObjFactura, CveAlmacen, CveMovimiento, ObjInventario, ObjConta, GenerarPrePoliza:=False)
+ If CveMovCancelacion > 0 Then
+ CveMovimientoReferencia = CveMovCancelacion
+ Else
+ ErrorPrepoliza = True
+ End If
Else
CveMovimientoReferencia = CveMovimiento
End If
' If ObjFactura.EsGarantia Then, el valor viene en cero ya
- If ObjInventario.GetMovimientosDetalle(CveMovimientoReferencia, UsuarioActual.CveEmpresa) Then
- Dim Importe68 As Decimal = ObjInventario.DtResultados.SUMD("Total").RoundSQL * ValorMultiplicador
- If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovto68, Importe68, Importe68, 68, Referencia, Concepto, CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimientoReferencia, Contabilizable:=False) Then
+ If Not ErrorPrepoliza Then
+ If ObjInventario.GetMovimientosDetalle(CveMovimientoReferencia, UsuarioActual.CveEmpresa) Then
+ Dim Importe68 As Decimal = ObjInventario.DtResultados.SUMD("Total").RoundSQL * ValorMultiplicador
+
+ If Not ErrorPrepoliza AndAlso Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovto68, Importe68, Importe68, 68, Referencia, Concepto, CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimientoReferencia, Contabilizable:=False) Then
+ ErrorPrepoliza = True
+ End If
+
+ If Not ErrorPrepoliza AndAlso Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, Not TipoMovto68, importeMovimiento, importeMX, 277, Referencia, Concepto, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), Contabilizable:=False, CveSubProyecto:=CveSubProyectoContabilizar) Then
+ ErrorPrepoliza = True
+ End If
+
+ Dim Importe318 As Decimal = (Math.Abs(importeMovimiento) - Math.Abs(Importe68)) * ValorMultiplicador
+
+ If Not ErrorPrepoliza AndAlso Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovto68, Importe318, Importe318, 318, Referencia, Concepto, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), Contabilizable:=False, CveSubProyecto:=CveSubProyectoContabilizar) Then
+ ErrorPrepoliza = True
+ End If
+
+ Else
ErrorPrepoliza = True
End If
-
- If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, Not TipoMovto68, importeMovimiento, importeMX, 277, Referencia, Concepto, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), Contabilizable:=False, CveSubProyecto:=CveSubProyectoContabilizar) Then
- ErrorPrepoliza = True
- End If
-
- Dim Importe318 As Decimal = (Math.Abs(importeMovimiento) - Math.Abs(Importe68)) * ValorMultiplicador
-
- If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovto68, Importe318, Importe318, 318, Referencia, Concepto, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), Contabilizable:=False, CveSubProyecto:=CveSubProyectoContabilizar) Then
- ErrorPrepoliza = True
- End If
-
- Else
- ErrorPrepoliza = True
End If
+
'Else
' If ObjInventario.GetMovimientosDetalle(CveMovimientoReferencia, UsuarioActual.CveEmpresa) Then
' Dim Importe68 As Decimal = ObjInventario.DtResultados.SUMD("")
diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb
index fd3c9db42..8d0239e5a 100644
--- a/Compras/PopUpVerFactura.aspx.vb
+++ b/Compras/PopUpVerFactura.aspx.vb
@@ -2891,7 +2891,7 @@ Partial Class PopUpVerFactura
End If
- Case 3, 16, 37, 40, 45 ' S A L I D A S
+ Case 3, 16, 37, 40, 45, 47 ' S A L I D A S
'Dim Archivo As New System.IO.FileInfo(String.Format("Empresas/{0}/Formatos/Salidas.rdlc", 72))
'Dim Imagen As New System.IO.FileInfo(String.Format("Empresas/{0}/Logo.png", 72))
Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos/Salidas.rdlc", UsuarioActual.Empresa.Ruta))
@@ -2904,6 +2904,8 @@ Partial Class PopUpVerFactura
concepto = "SALIDA VIRTUAL"
ElseIf CveConcepto = 45 Then
concepto = "SALIDA DE USADOS"
+ ElseIf CveConcepto = 47 Then
+ concepto = "SALIDA POR CAMBIO DE VIGENCIA"
Else
concepto = "SALIDA DE ALMACÉN POR RECONSTRUCCIÓN"
End If
diff --git a/General/SaldosIniciales.aspx.vb b/General/SaldosIniciales.aspx.vb
index 51bc19045..0954bbc05 100644
--- a/General/SaldosIniciales.aspx.vb
+++ b/General/SaldosIniciales.aspx.vb
@@ -1482,7 +1482,7 @@ Partial Class General_SaldosIniciales
Dim ErrorCompras As Boolean = False
Dim ObjConta As New ClsContabilidad(ObjCompras.IniciaTransacSQL())
Dim CveCompra As Integer
- Dim Contador As Integer = 0
+ 'Dim Contador As Integer = 0
Dim ExisteCompra As Boolean = False
Dim DtProveedores As New DataTable
Dim NoEncontrados As Integer = 0
@@ -1681,12 +1681,15 @@ Partial Class General_SaldosIniciales
End Try
If Not ErrorCompras Then
- If Contador > 0 Then
- Alert(String.Format("Se agregaron: {0} Compras correctamente.
Se Omitieron: {1} Compras ya que ya se encuentran registradas.", NumRows - Contador, Contador), TipoMensaje.MsgInformacion)
- Else
- Alert(String.Format("Se agregaron: {0} Compras correctamente.", NumRows), TipoMensaje.MsgInformacion)
- End If
- Alert(String.Format("Se agregaron: {0} Compras correctamente. RFC:{1} ", Encontrados, RFC), TipoMensaje.MsgInformacion)
+
+ 'If Encontrados > 0 Then
+ ' Alert(String.Format("Se agregaron: {0} Compras correctamente.
Se Omitieron: {1} Compras ya que ya se encuentran registradas.", Encontrados, NumRows - 1 - Encontrados), TipoMensaje.MsgInformacion)
+ 'Else
+ ' Alert(String.Format("Se agregaron: {0} Compras correctamente.", Encontrados), TipoMensaje.MsgInformacion)
+ 'End If
+ Alert(String.Format("Se agregaron: {0} Compras correctamente.", Encontrados), TipoMensaje.MsgInformacion)
+ 'Alert(String.Format("Se agregaron: {0} Compras correctamente. RFC:{1} ", Encontrados, RFC), TipoMensaje.MsgInformacion)
+
ObjCompras.Commit()
TxtExcel.Text = ""
UpDatos.Update()
@@ -1756,7 +1759,13 @@ Partial Class General_SaldosIniciales
Dim Vendedor As String = If(dt.Columns.Contains("Vendedor"), Row("Vendedor").ToString(), "")
Dim CveVendedor As Integer = 0
- Dim IEPS As Decimal = 0 'Row("IEPS").ToString().ToDecimal
+ Dim IEPS As Decimal = 0
+
+ If RblFormato.SelectedValue = "17" Then
+ IEPS = Row("IEPS").ToString().ToDecimal
+ End If
+
+
Dim CveClienteSucursal As Integer = 0 'Row("CveClienteSucursal").ToString().ToEntero()
Dim FolioFiscal As String = If(dt.Columns.Contains("Folio Fiscal"), Row("Folio Fiscal").ToString(), "")
@@ -1777,6 +1786,11 @@ Partial Class General_SaldosIniciales
Dim CantidadDetalle As Decimal = 0
Dim PUDetalle As Decimal = 0
Dim IVADetalle As Decimal = 0
+ Dim PorcentajeIEPS As Decimal = 0
+
+ If IEPS > 0 Then
+ PorcentajeIEPS = If(dt.Columns.Contains("PorcentajeIEPS"), Round(Row("PorcentajeIEPS").ToString().ToDecimal, 4), 0)
+ End If
If RblFormato.SelectedValue = "17" Then
@@ -1895,8 +1909,8 @@ Partial Class General_SaldosIniciales
Exit For
End If
- If Not ObjVentas.AddVentaDetalle(CveVenta, CvePS, CantidadDetalle, CveUnidadMedida, PUDetalle * CantidadDetalle, IVADetalle, TotalDetalles, "Saldo Inicial", 0, 0, Sucursal.ToEntero(), 0,
- PorcentajeIVA:=PorcentajeIVA, PorcentajeRetIVA:=PorcentajeRetIVA, ImporteRetIVA:=RetIVA, IEPS:=IEPSDetalle, PorcentajeRetISR:=PorcentajeRetISR) Then
+ If Not ObjVentas.AddVentaDetalle(CveVenta, CvePS, CantidadDetalle, CveUnidadMedida, PUDetalle, IVADetalle, TotalDetalles, "Saldo Inicial", 0, 0, Sucursal.ToEntero(), 0,
+ PorcentajeIVA:=PorcentajeIVA, PorcentajeRetIVA:=PorcentajeRetIVA, ImporteRetIVA:=RetIVA, IEPS:=IEPSDetalle, PorcentajeRetISR:=PorcentajeRetISR, PorcentajeIEPS:=PorcentajeIEPS) Then
ErrorVentas = True
Exit For
End If
@@ -1935,10 +1949,16 @@ Partial Class General_SaldosIniciales
If IVA > 0 Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, IVA, IVA, 13, Folio.ToString(), String.Format("{0}-{1}", Serie, Folio), CveVenta:=CveVenta, CveCliente:=CveCliente, PorcentajeImpuesto:=PorcentajeIVA, Contabilizable:=False) Then ErrorVentas = True : Exit For
End If
- 'If IEPS > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, IEPS, Folio.ToString(), 38, String.Format("{0}-{1}", Serie, Folio), CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=IEPS) Then ErrorVentas = True : Exit For
+
+ If IEPS > 0 Then
+ 'AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, IEPS, Folio, 38, String.Format("{0}-{1}", Serie, Folio), CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=IEPS)
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, IEPS, IEPS, 38, Folio.ToString, String.Format("{0}-{1}", Serie, Folio), CveVenta:=CveVenta, CveCliente:=CveCliente, Contabilizable:=False) Then ErrorVentas = True : Exit For
+
+ End If
If RetIVA > 0 Then
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, RetIVA, RetIVA, 8, Folio.ToString(), String.Format("{0}-{1}", Serie, Folio), CveVenta:=CveVenta, CveCliente:=CveCliente, PorcentajeImpuesto:=PorcentajeRetIVA, Contabilizable:=False) Then ErrorVentas = True : Exit For
+
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, RetISR, RetISR, 8, Folio.ToString(), String.Format("{0}-{1}", Serie, Folio), CveVenta:=CveVenta, CveCliente:=CveCliente, PorcentajeImpuesto:=PorcentajeRetISR, Contabilizable:=False) Then ErrorVentas = True : Exit For
End If
If RetISR > 0 Then
diff --git a/Inventarios/EntregaAlmacen.aspx b/Inventarios/EntregaAlmacen.aspx
index 787910cdd..39ebbe52f 100644
--- a/Inventarios/EntregaAlmacen.aspx
+++ b/Inventarios/EntregaAlmacen.aspx
@@ -1150,6 +1150,17 @@
}
+ function fncCantidad(checkbox, numeroMax, idTbCantidadF) {
+
+ var $textbox = $('#' + idTbCantidadF);
+
+ if ($(checkbox).is(':checked')) {
+ $textbox.val(numeroMax);
+ } else {
+ $textbox.val(0);
+ }
+ }
+
diff --git a/Inventarios/EntregaAlmacen.aspx.vb b/Inventarios/EntregaAlmacen.aspx.vb
index 7e9b55a25..b2012351d 100644
--- a/Inventarios/EntregaAlmacen.aspx.vb
+++ b/Inventarios/EntregaAlmacen.aspx.vb
@@ -5,6 +5,7 @@ Imports System.Data
Imports System.Data.SqlClient
Imports System.IO
Imports System.Web.Management
+Imports DocumentFormat.OpenXml.InkML
Imports Extensiones
Imports Microsoft.Reporting.WebForms
Imports MoreLinq
@@ -1237,13 +1238,13 @@ Partial Class Inventarios_EntregaAlmacen
If BloqueCantidad Then
e.Row.FCTextBox("TbCantidadF").Enabled = False
+ Else
+ e.Row.FCCheckBox("cbInv").Attributes.Add("onclick", $"fncCantidad(this,{e.Row.DBCampo("CantidadF")},'{e.Row.FCTextBox("TbCantidadF").ClientID}')")
End If
If Boolean.Parse(e.Row.DataKey("AplicaLote")) Or Boolean.Parse(e.Row.DataKey("AplicaCaducidad")) Then
-
CargarCaducidadProducto(e.Row.DataKey("CvePS").ToEntero, e.Row.FCDropDownList("DdlCaducidadProducto"))
-
End If
diff --git a/UserControl/AddMedico.ascx b/UserControl/AddMedico.ascx
index 754c018de..80bdcd6e0 100644
--- a/UserControl/AddMedico.ascx
+++ b/UserControl/AddMedico.ascx
@@ -1,7 +1,19 @@
<%@ Control Language="VB" AutoEventWireup="false" CodeFile="AddMedico.ascx.vb" Inherits="UserControl_AddMedico" %>
+<%----%>
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
-
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ <%--
+
+
+
+
+
+
+
+
+
+ --%>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/UserControl/AddMedico.ascx.vb b/UserControl/AddMedico.ascx.vb
index 02ba68186..277a05b03 100644
--- a/UserControl/AddMedico.ascx.vb
+++ b/UserControl/AddMedico.ascx.vb
@@ -1,4 +1,6 @@
-Imports Extensiones
+Imports System.Data
+Imports Extensiones
+Imports Profact.TimbraCFDI.Complementos.InstitucionesEducativas
Partial Class UserControl_AddMedico
Inherits System.Web.UI.UserControl
@@ -25,16 +27,80 @@ Partial Class UserControl_AddMedico
End Set
End Property
+ Public Property CveMedicoClienteSucursal As Integer
+ Get
+ If ViewState("CveMedicoClienteSucursal") Is Nothing Then
+ ViewState("CveMedicoClienteSucursal") = -1
+ End If
+ Return ViewState("CveMedicoClienteSucursal").ToString.ToEntero
+ End Get
+ Set(value As Integer)
+ ViewState("CveMedicoClienteSucursal") = value
+ End Set
+ End Property
+
+ Public Property IndexSeleccionado As Integer
+ Get
+ If ViewState("IndexSeleccionado") Is Nothing Then
+ ViewState("IndexSeleccionado") = -1
+ End If
+ Return ViewState("IndexSeleccionado").ToString.ToEntero
+ End Get
+ Set(value As Integer)
+ ViewState("IndexSeleccionado") = value
+ End Set
+ End Property
+
+
+
+ Public Property DTMedicosClientesSucursales As DataTable
+ Get
+ If ViewState("CveMedico") Is Nothing Then
+ ViewState("CveMedico") = New DataTable
+ End If
+ Return DirectCast(ViewState("CveMedico"), DataTable)
+ End Get
+ Set(value As DataTable)
+ ViewState("CveMedico") = value
+ End Set
+ End Property
+
Private Sub UserControl_AddMedico_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
- CargaEspecialidad()
- CargaSubEspecialidad(-1)
+
End If
End Sub
+ Sub CargaCombos()
+ CargaEspecialidad()
+ CargaSubEspecialidad(-1)
+ CargaVendedores()
+ End Sub
+
+ Sub CargaVendedores()
+ DdlVendedor.ClearSelection()
+ DdlVendedor.SelectedValue = Nothing
+ DdlVendedor.Items.Clear()
+
+ Dim ObjVendedores As New ClsVtaVendedores
+ If ObjVendedores.GetVendedores(UsuarioActual.CveEmpresa) Then
+ DdlVendedor.DataSource = ObjVendedores.DtResultados.FiltraParametros("VendedorTipo = 1")
+ Else
+ DdlVendedor.DataSource = Nothing
+ End If
+ ObjVendedores.Dispose()
+ DdlVendedor.DataBind()
+
+ End Sub
+
Sub CargaEspecialidad()
+
+ DdlEspecialidad.ClearSelection()
+ DdlEspecialidad.SelectedValue = Nothing
+ DdlEspecialidad.Items.Clear()
+
Dim ObjVentas As New ClsVentas
If ObjVentas.GetMedicosEspecialidades(-1, UsuarioActual.CveEmpresa, -1) Then
@@ -50,11 +116,16 @@ Partial Class UserControl_AddMedico
UpModal.Update()
-
End Sub
+
+
Sub CargaSubEspecialidad(CveMedicoEspecialidad As Integer)
+
+ DdlSubEspecialidad.ClearSelection()
+ DdlSubEspecialidad.SelectedValue = Nothing
+ DdlSubEspecialidad.Items.Clear()
Dim ObjVentas As New ClsVentas
If ObjVentas.GetMedicosSubEspecialidades(-1, UsuarioActual.CveEmpresa, -1) Then
@@ -79,50 +150,78 @@ Partial Class UserControl_AddMedico
Public Sub LimpiarControles()
+ CargaCombos()
+ CargaCombosMedicoClientesucursal()
+
+ CveMedico = -1
+ CrearDTMedicosClientesSucursales()
+ CveMedicoClienteSucursal = -1
+
LbAgregar.Text = "Agregar"
LtlTituloModal.Text = "Agregar Médico"
- TxtMedico.Text = ""
+ TxtNombre.Text = ""
+ TxtAPaterno.Text = ""
+ TxtAMaterno.Text = ""
TxtCedulaProfecional.Text = ""
TxtFechaNacimiento.Text = ""
TxtNotas.Text = ""
- TxtDiasAtencion.Text = ""
- TxtHorario.Text = ""
- TxtLugar.Text = ""
- TxtConsultorio.Text = ""
TxtMail.Text = ""
TxtTelefono.Text = ""
TxtCelular.Text = ""
DdlEspecialidad.SelectedValueExist(-1)
DdlSubEspecialidad.SelectedValueExist(-1)
- TxtTorre.Text = ""
+
DVUsuarioFechaIng.Visible = False
TxtFechaIng.Text = ""
TxtUsuario.Text = ""
+ DdlVendedor.SelectedValueExist(-1)
+ CargaGVMedicoClienteSucursal(-1, UsuarioActual.CveEmpresa)
+
DVEstatus.Visible = False
ChkEstatus.Checked = True
UpModal.Update()
- CveMedico = -1
+
End Sub
- Public Sub PreparaEdicion(CveMedicoEditar As Integer, Medico As String, CedulaProfecional As String, FechaNacimiento As Date, Notas As String, DiasAtencion As String, Horario As String, Lugar As String, Consultorio As String, Estatus As Boolean,
- Mail As String, Telefono As String, Celular As String, CveMedicoEspecialidad As Integer, CveMedicoSubEspecialidad As Integer, Torre As String, FechaIng As DateTime, Usuario As String)
+ Private Sub CrearDTMedicosClientesSucursales()
+ DTMedicosClientesSucursales = New DataTable
+ DTMedicosClientesSucursales.Columns.Add("CveMedicoClienteSucursal", GetType(Integer))
+ DTMedicosClientesSucursales.Columns.Add("CveMedico", GetType(Integer))
+ DTMedicosClientesSucursales.Columns.Add("CveCliente", GetType(Integer))
+ DTMedicosClientesSucursales.Columns.Add("CveClienteSucursal", GetType(Integer))
+ DTMedicosClientesSucursales.Columns.Add("ClienteSucursal", GetType(String))
+ DTMedicosClientesSucursales.Columns.Add("DiasAtencion", GetType(String))
+ DTMedicosClientesSucursales.Columns.Add("Horario", GetType(String))
+ DTMedicosClientesSucursales.Columns.Add("Consultorio", GetType(String))
+ DTMedicosClientesSucursales.Columns.Add("Torre", GetType(String))
+ DTMedicosClientesSucursales.Columns.Add("AsistenteNombre", GetType(String))
+ DTMedicosClientesSucursales.Columns.Add("CveUsuario", GetType(Integer))
+ DTMedicosClientesSucursales.Columns.Add("FechaIng", GetType(Date))
+ DTMedicosClientesSucursales.Columns.Add("Usuario", GetType(String))
+
+ DTMedicosClientesSucursales.AcceptChanges()
+
+ End Sub
+
+ Public Sub PreparaEdicion(CveMedicoEditar As Integer, Nombre As String, APaterno As String, AMaterno As String, CedulaProfecional As String, FechaNacimiento As Date, Notas As String, Estatus As Boolean,
+ Mail As String, Telefono As String, Celular As String, CveMedicoEspecialidad As Integer, CveMedicoSubEspecialidad As Integer, FechaIng As DateTime, Usuario As String, CveVendedor As Integer)
+
+ CargaCombos()
+ CargaCombosMedicoClientesucursal()
CveMedico = CveMedicoEditar
-
- TxtMedico.Text = Medico
+ TxtNombre.Text = Nombre
+ TxtAPaterno.Text = APaterno
+ TxtAMaterno.Text = AMaterno
TxtCedulaProfecional.Text = CedulaProfecional
TxtFechaNacimiento.Text = FechaNacimiento.ToString("dd/MM/yyyy")
TxtNotas.Text = Notas
- TxtDiasAtencion.Text = DiasAtencion
- TxtHorario.Text = Horario
- TxtLugar.Text = Lugar
- TxtConsultorio.Text = Consultorio
ChkEstatus.Checked = Estatus
TxtMail.Text = Mail
TxtTelefono.Text = Telefono
@@ -130,24 +229,28 @@ Partial Class UserControl_AddMedico
DdlEspecialidad.SelectedValueExist(CveMedicoEspecialidad)
CargaSubEspecialidad(CveMedicoEspecialidad)
DdlSubEspecialidad.SelectedValueExist(CveMedicoSubEspecialidad)
- TxtTorre.Text = Torre
DVUsuarioFechaIng.Visible = True
TxtFechaIng.Text = FechaIng.ToString("dd/MM/yyyy hh:mm:ss tt")
TxtUsuario.Text = Usuario
+ DdlVendedor.SelectedValueExist(CveVendedor)
+
DVEstatus.Visible = True
LbAgregar.Text = "Actualizar"
LtlTituloModal.Text = $"Actualizar Médico {TxtCedulaProfecional.Text}"
UpModal.Update()
+ CargaGVMedicoClienteSucursal(CveMedico, UsuarioActual.CveEmpresa)
+
End Sub
Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
Dim ProcesoOK = False
Dim ObjVentas As New ClsVentas
+ ObjVentas.IniciaTransacSQL()
Dim CveMedicoNuevo As Integer = -1
@@ -155,33 +258,336 @@ Partial Class UserControl_AddMedico
Dim Celular As String = If(TxtCelular.Text = "(___) ___-____", "", TxtCelular.Text)
If CveMedico > 0 Then
- If ObjVentas.UpdateMedico(CveMedico, TxtMedico.Text.Trim, TxtCedulaProfecional.Text.Trim, TxtFechaNacimiento.Text.ToDate, TxtNotas.Text.Trim, TxtDiasAtencion.Text.Trim, TxtHorario.Text.Trim, TxtLugar.Text.Trim, ChkEstatus.Checked,
- UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Telefono, TxtMail.Text, DdlEspecialidad.SelectedValue.ToEntero, Celular, TxtConsultorio.Text.Trim, DdlSubEspecialidad.SelectedValue.ToEntero, TxtTorre.Text.Trim) Then
+ If ObjVentas.UpdateMedico(CveMedico, TxtNombre.Text.Trim, TxtAPaterno.Text.Trim, TxtAMaterno.Text.Trim, TxtCedulaProfecional.Text.Trim, TxtFechaNacimiento.Text.ToDate, TxtNotas.Text.Trim, ChkEstatus.Checked,
+ UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Telefono, TxtMail.Text, DdlEspecialidad.SelectedValue.ToEntero, Celular, DdlSubEspecialidad.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero) Then
ProcesoOK = True
End If
Else
- CveMedicoNuevo = ObjVentas.AddMedico(TxtMedico.Text.Trim, TxtCedulaProfecional.Text.Trim, TxtFechaNacimiento.Text.ToDate, TxtNotas.Text.Trim, TxtDiasAtencion.Text.Trim, TxtHorario.Text.Trim, TxtLugar.Text.Trim, ChkEstatus.Checked, UsuarioActual.CveUsuario,
- UsuarioActual.CveEmpresa, Telefono, TxtMail.Text, DdlEspecialidad.SelectedValue.ToEntero, Celular, TxtConsultorio.Text.Trim, DdlSubEspecialidad.SelectedValue.ToEntero, TxtTorre.Text.Trim)
+ CveMedicoNuevo = ObjVentas.AddMedico(TxtNombre.Text.Trim, TxtAPaterno.Text.Trim, TxtAMaterno.Text.Trim, TxtCedulaProfecional.Text.Trim, TxtFechaNacimiento.Text.ToDate, TxtNotas.Text.Trim, ChkEstatus.Checked,
+ UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Telefono, TxtMail.Text, DdlEspecialidad.SelectedValue.ToEntero, Celular, DdlSubEspecialidad.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero)
If CveMedicoNuevo > 0 Then
+
+
+ For Each GvRow As GridViewRow In GvMedicosClientesSucursales.Rows
+
+ If Not (ObjVentas.AddMedicosClientesSucursales(CveMedicoNuevo, GvRow.DataKey("CveCliente").ToEntero, GvRow.DataKey("CveClienteSucursal").ToEntero, GvRow.DataKey("DiasAtencion"), GvRow.DataKey("Horario"), GvRow.DataKey("Consultorio"), GvRow.DataKey("Torre"), GvRow.DataKey("AsistenteNombre"),
+ UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)) Then
+ ProcesoOK = False
+ Exit For
+ End If
+
+ Next
+
ProcesoOK = True
+
End If
End If
- ObjVentas.Dispose()
+
If ProcesoOK Then
+ ObjVentas.Commit()
ClsPaginas.Alert($"Medico {If(CveMedico > 0, "Actualizado", "Guardado")} Correctamente.")
Dim AppNombre As String = $"GlobalDTAgentes-{UsuarioActual.CveEmpresa}"
Application(AppNombre) = Nothing
RegistraScript($"fncRegargaMedicos({If(CveMedicoNuevo > 0, CveMedicoNuevo, CveMedico) });")
RegistraScript("$('#BtnCancelarMedico').click();")
-
+ CargaGVMedicoClienteSucursal(If(CveMedicoNuevo > 0, CveMedicoNuevo, CveMedico), UsuarioActual.CveEmpresa)
+ Else
+ ObjVentas.RollBack()
End If
-
+ ObjVentas.Dispose()
End Sub
+#Region "DETALLES"
+ Private Function DdlClienteSucursalCliente() As Integer
+ If DdlClienteSucursal.SelectedValue = "-1" Then
+ Return -1
+ Else
+ Dim array As String() = DdlClienteSucursal.SelectedValue.Split("|"c)
+ Return If(array(0).ToEntero > 0, array(0).ToEntero, -1)
+ End If
+ End Function
+
+ Private Function DdlClienteSucursalSucursal() As Integer
+ If DdlClienteSucursal.SelectedValue = "-1" Then
+ Return -1
+ Else
+ Dim array As String() = DdlClienteSucursal.SelectedValue.Split("|"c)
+ Return If(array(1).ToEntero > 0, array(1).ToEntero, -1)
+ End If
+ End Function
+
+ Private Sub CargaCombosMedicoClientesucursal()
+
+ DdlClienteSucursal.ClearSelection()
+ DdlClienteSucursal.SelectedValue = Nothing
+ DdlClienteSucursal.Items.Clear()
+
+ Dim objcliente As New ClsClientes
+ If objcliente.GetClienteSucursales(-1, UsuarioActual.CveEmpresa) Then
+ DdlClienteSucursal.DataSource = objcliente.DtResultados
+ Else
+ DdlClienteSucursal.DataSource = Nothing
+ End If
+
+ objcliente.Dispose()
+
+ DdlClienteSucursal.DataBind()
+ DdlClienteSucursal.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
+ End Sub
+
+ Protected Sub LnkAgregarMedicoClienteSucursal_Click(sender As Object, e As EventArgs)
+ LimpiarcontrolesDetalle()
+ RegistraScript("$('#DVMedicoClienteSucursal').modal({ backdrop: 'static', keyboard: false });")
+ End Sub
+
+ Protected Sub LimpiarcontrolesDetalle()
+
+ CveMedicoClienteSucursal = -1
+ IndexSeleccionado = -1
+ DdlClienteSucursal.SelectedValueExist(-1)
+ 'TxtDiasAtencion.Text = ""
+ TxtHorario.Text = ""
+ TxtConsultorio.Text = ""
+ TxtTorre.Text = ""
+ TxtAsistenteNombre.Text = ""
+
+ ChkLunes.Checked = False
+ ChkMartes.Checked = False
+ ChkMiercoles.Checked = False
+ ChkJueves.Checked = False
+ ChkViernes.Checked = False
+ ChkSabado.Checked = False
+ ChkDomingo.Checked = False
+
+ UpModalMedicoClienteSucursal.Update()
+
+ End Sub
+
+
+ Protected Sub BtnGaurdarMedicoClienteSucursal_Click(sender As Object, e As EventArgs)
+
+ Dim TieneError As Boolean = False
+
+ Dim DiasAtencion As String = ""
+ Dim ListaDiasAntencion As New List(Of String)
+
+ If ChkLunes.Checked Then
+ ListaDiasAntencion.Add("L")
+ End If
+
+ If ChkMartes.Checked Then
+ ListaDiasAntencion.Add("M")
+ End If
+
+ If ChkMiercoles.Checked Then
+ ListaDiasAntencion.Add("MI")
+ End If
+
+ If ChkJueves.Checked Then
+ ListaDiasAntencion.Add("J")
+ End If
+
+ If ChkViernes.Checked Then
+ ListaDiasAntencion.Add("V")
+ End If
+
+ If ChkSabado.Checked Then
+ ListaDiasAntencion.Add("S")
+ End If
+
+ If ChkDomingo.Checked Then
+ ListaDiasAntencion.Add("D")
+ End If
+
+ DiasAtencion = String.Join(", ", ListaDiasAntencion)
+
+
+ If CveMedico > 0 Then
+ Dim objVenta As New ClsVentas
+
+ If CveMedicoClienteSucursal > 0 Then
+ If Not (objVenta.UpdateMedicosClientesSucursales(CveMedicoClienteSucursal, CveMedico, DdlClienteSucursalCliente, DdlClienteSucursalSucursal, DiasAtencion, TxtHorario.Text.Trim, TxtConsultorio.Text.Trim, TxtTorre.Text.Trim, TxtAsistenteNombre.Text.Trim,
+ UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)) Then
+ TieneError = True
+ End If
+ Else
+ If Not (objVenta.AddMedicosClientesSucursales(CveMedico, DdlClienteSucursalCliente, DdlClienteSucursalSucursal, DiasAtencion, TxtHorario.Text.Trim, TxtConsultorio.Text.Trim, TxtTorre.Text.Trim, TxtAsistenteNombre.Text.Trim,
+ UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)) Then
+ TieneError = True
+ End If
+ End If
+
+ objVenta.Dispose()
+
+ Else
+
+ If IndexSeleccionado > -1 Then
+
+ DTMedicosClientesSucursales.Rows(IndexSeleccionado)("CveMedicoClienteSucursal") = -1
+ DTMedicosClientesSucursales.Rows(IndexSeleccionado)("CveMedico") = CveMedico
+ DTMedicosClientesSucursales.Rows(IndexSeleccionado)("CveCliente") = DdlClienteSucursalCliente()
+ DTMedicosClientesSucursales.Rows(IndexSeleccionado)("CveClienteSucursal") = DdlClienteSucursalSucursal()
+ DTMedicosClientesSucursales.Rows(IndexSeleccionado)("ClienteSucursal") = DdlClienteSucursal.SelectedItem.Text
+ DTMedicosClientesSucursales.Rows(IndexSeleccionado)("DiasAtencion") = DiasAtencion
+ DTMedicosClientesSucursales.Rows(IndexSeleccionado)("Horario") = TxtHorario.Text
+ DTMedicosClientesSucursales.Rows(IndexSeleccionado)("Consultorio") = TxtConsultorio.Text
+ DTMedicosClientesSucursales.Rows(IndexSeleccionado)("Torre") = TxtTorre.Text
+ DTMedicosClientesSucursales.Rows(IndexSeleccionado)("AsistenteNombre") = TxtAsistenteNombre.Text
+ DTMedicosClientesSucursales.Rows(IndexSeleccionado)("CveUsuario") = UsuarioActual.CveUsuario
+ DTMedicosClientesSucursales.Rows(IndexSeleccionado)("FechaIng") = Now
+ DTMedicosClientesSucursales.Rows(IndexSeleccionado)("Usuario") = UsuarioActual.Usuario
+
+ Else
+
+ Dim nRow As DataRow = DTMedicosClientesSucursales.NewRow
+
+ nRow("CveMedicoClienteSucursal") = -1
+ nRow("CveMedico") = CveMedico
+ nRow("CveCliente") = DdlClienteSucursalCliente()
+ nRow("CveClienteSucursal") = DdlClienteSucursalSucursal()
+ nRow("ClienteSucursal") = DdlClienteSucursal.SelectedItem.Text
+ nRow("DiasAtencion") = DiasAtencion
+ nRow("Horario") = TxtHorario.Text
+ nRow("Consultorio") = TxtConsultorio.Text
+ nRow("Torre") = TxtTorre.Text
+ nRow("AsistenteNombre") = TxtAsistenteNombre.Text
+ nRow("CveUsuario") = UsuarioActual.CveUsuario
+ nRow("FechaIng") = Now
+ nRow("Usuario") = UsuarioActual.Usuario
+
+ DTMedicosClientesSucursales.Rows.Add(nRow)
+
+ End If
+
+ DTMedicosClientesSucursales.AcceptChanges()
+
+ End If
+
+ If Not TieneError Then
+ RegistraScript(" $('#DVMedicoClienteSucursal').modal('hide');")
+ 'Alert("Detalle Guardado Correctamenrte", TipoMensaje.MsgInformacion)
+ CargaGVMedicoClienteSucursal(CveMedico, UsuarioActual.CveEmpresa)
+ End If
+
+ End Sub
+
+ Public Sub CargaGVMedicoClienteSucursal(CveMedicoConsulta As Integer, CveEmpresa As Integer)
+
+ GvMedicosClientesSucursales.DataSource = Nothing
+
+ If CveMedicoConsulta > 0 Then
+ Dim objVenta As New ClsVentas
+
+ If (objVenta.GetMedicosClientesSucursales(CveMedicoConsulta, CveEmpresa)) Then
+ GvMedicosClientesSucursales.DataSource = objVenta.DtResultados
+ End If
+
+ objVenta.Dispose()
+ Else
+ GvMedicosClientesSucursales.DataSource = DTMedicosClientesSucursales
+ End If
+
+ GvMedicosClientesSucursales.DataBind()
+ UpModal.Update()
+
+ End Sub
+
+ Protected Sub LnkEditarClienteSucursal_Click(sender As Object, e As EventArgs)
+
+ LimpiarcontrolesDetalle()
+
+ Dim GvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
+
+ Dim CveCliente As Integer = GvRow.DataKey("CveCliente").ToEntero
+ Dim CveClienteSucursal As Integer = GvRow.DataKey("CveClienteSucursal").ToEntero
+
+ If CveMedico > 0 Then
+ CveMedicoClienteSucursal = GvRow.DataKey("CveMedicoClienteSucursal").ToEntero
+ Else
+ IndexSeleccionado = GvRow.RowIndex
+ End If
+
+ If CveClienteSucursal > 0 Then
+ DdlClienteSucursal.SelectedValueExist($"{CveCliente}|{CveClienteSucursal}")
+ Else
+ DdlClienteSucursal.SelectedValueExist($"{CveCliente}|")
+ End If
+
+ 'TxtDiasAtencion.Text = GvRow.DataKey("DiasAtencion")
+ TxtHorario.Text = GvRow.DataKey("Horario")
+ TxtConsultorio.Text = GvRow.DataKey("Consultorio")
+ TxtTorre.Text = GvRow.DataKey("Torre")
+ TxtAsistenteNombre.Text = GvRow.DataKey("AsistenteNombre")
+
+ Dim DiasAtencionArray As String() = GvRow.DataKey("DiasAtencion").Split(New Char() {","c})
+
+ For Each s As String In DiasAtencionArray
+ Select Case s.Trim()
+ Case "L"
+ ChkLunes.Checked = True
+ Case "M"
+ ChkMartes.Checked = True
+ Case "MI"
+ ChkMiercoles.Checked = True
+ Case "J"
+ ChkJueves.Checked = True
+ Case "V"
+ ChkViernes.Checked = True
+ Case "S"
+ ChkSabado.Checked = True
+ Case "D"
+ ChkDomingo.Checked = True
+ End Select
+ Next
+
+ RegistraScript(" $('#DVMedicoClienteSucursal').modal('show');")
+ UpModalMedicoClienteSucursal.Update()
+
+
+ End Sub
+
+ Protected Sub LnkEliminarClienteSucursal_Click(sender As Object, e As EventArgs)
+
+ Dim GvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
+ Dim TieneError As Boolean = False
+
+ GvMedicosClientesSucursales.DataSource = Nothing
+
+ If CveMedico > 0 Then
+
+ Dim CveMedicoClienteSucursalEliminar As Integer = GvRow.DataKey("CveMedicoClienteSucursal").ToEntero
+ Dim objVenta As New ClsVentas
+
+ If Not objVenta.RemoveMedicosClientesSucursales(CveMedicoClienteSucursalEliminar, UsuarioActual.CveEmpresa) Then
+ TieneError = True
+ End If
+
+ objVenta.Dispose()
+
+ Else
+
+ Dim RowIndex As Integer = GvRow.RowIndex
+ DTMedicosClientesSucursales.Rows.RemoveAt(RowIndex)
+ DTMedicosClientesSucursales.AcceptChanges()
+
+ End If
+
+ If Not TieneError Then
+ CargaGVMedicoClienteSucursal(CveMedico, UsuarioActual.CveEmpresa)
+ End If
+
+
+ End Sub
+
+#End Region
+
+
+
+
End Class
diff --git a/Ventas/CatMedicos.aspx b/Ventas/CatMedicos.aspx
index 6c8892736..1895c5a48 100644
--- a/Ventas/CatMedicos.aspx
+++ b/Ventas/CatMedicos.aspx
@@ -226,14 +226,25 @@
-
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
@@ -253,25 +264,38 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
-
+
-
-
-
-
-
+
@@ -314,67 +338,7 @@
- <%--
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- --%>
+
@@ -388,8 +352,7 @@
-
- <%--
--%>
+
@@ -400,197 +363,7 @@
- <%--
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
--%>
+
@@ -632,7 +405,7 @@
-
+
diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb
index 34288b8e0..48457315e 100644
--- a/Ventas/Clientes.aspx.vb
+++ b/Ventas/Clientes.aspx.vb
@@ -922,12 +922,18 @@ Partial Class Clientes
LnkAgregarLineaAdicional.Visible = True
GetLineasAdicionales()
End If
+
+ If UsuarioActual.Empresa.Funcionalidad(109) <> "1" Then
+ If RblTipo.Items.FindByValue("RNC") IsNot Nothing Then
+ RblTipo.Items.Remove(RblTipo.Items.FindByValue("RNC"))
+ End If
+ End If
+
+ ChkPermiso4.Enabled = False
+ ChkPermiso5.Enabled = False
+ ChkPermiso6.Enabled = False
End If
- 'EN SERIO SE OCUPA EN CADA POSTBACK ??? IPP 7 SEPTIEMNRE 2017
- ChkPermiso4.Enabled = False
- ChkPermiso5.Enabled = False
- ChkPermiso6.Enabled = False
End Sub
diff --git a/Ventas/PV.aspx.vb b/Ventas/PV.aspx.vb
index 29ad9b268..1a66ff435 100644
--- a/Ventas/PV.aspx.vb
+++ b/Ventas/PV.aspx.vb
@@ -3466,7 +3466,7 @@ Partial Class PV
Dim SbAlert As New StringBuilder
Try
- Retorno = ObjFactura.EmitirFactura(Transac:=ObjAcum.IniciaTransacSQL())
+ Retorno = ObjFactura.EmitirFactura(Transac:=ObjAcum.IniciaTransacSQL(), Modulo:="PV/GuardarVenta")
If Retorno IsNot Nothing AndAlso Retorno.CveVenta > 0 Then
diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx
index 5a677a9e8..72bdb40e7 100644
--- a/Ventas/Ventas.aspx
+++ b/Ventas/Ventas.aspx
@@ -4572,6 +4572,12 @@
+
+ Atención A
+
+
+
+
Amort. Ant.
@@ -8685,41 +8691,41 @@
-
-
+
+
-
-
-
+
+
+
-
-
-
- |
- |
-
-
- | |
- |
-
-
- |
-
- |
-
-
-
- |
-
-
- |
- |
-
-
-
-
-
+
+
+
+ |
+ |
+
+
+ | |
+ |
+
+
+ |
+
+ |
+
+
+
+ |
+
+
+ |
+ |
+
+
+
+
+
@@ -8728,7 +8734,7 @@
-
+
@@ -8742,7 +8748,7 @@
-
+
diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb
index 3a9eafab9..1eb4471a4 100644
--- a/Ventas/Ventas.aspx.vb
+++ b/Ventas/Ventas.aspx.vb
@@ -2,6 +2,7 @@
Option Strict On
Option Infer On
+Imports System.Activities.Expressions
Imports System.Data
Imports System.Data.SqlClient
Imports System.Diagnostics
@@ -3547,6 +3548,10 @@ Partial Class Ventas
End If
UpPS.Update()
+ If DdlTipoComprobante.Items.FindByValue("RNC") Is Nothing Then
+ DdlTipoComprobante.Items.Add(New ListItem("Remisión de nota de crédito", "RNC"))
+ End If
+
End If
End If
@@ -5057,10 +5062,6 @@ Partial Class Ventas
Select Case DbRowVenta("TipoDocto").ToString()
Case "Ing"
- If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
- TxtAtencionA.Text = DbRowVenta("AtencionA").ToString()
- End If
-
Trsaldo.Visible = True
HplSaldoAuxiliar.NavigateUrl = String.Format("/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxCClientes&CveCliente={0}&CveVenta={1}&TB_iframe=true&height=550&width=920", DbRowVenta("CveCliente"), DbRowVenta("CveVenta"))
HplPagado.NavigateUrl = String.Format("/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxCClientes&CveCliente={0}&CveVenta={1}&TB_iframe=true&height=550&width=920", DbRowVenta("CveCliente"), DbRowVenta("CveVenta"))
@@ -5097,10 +5098,6 @@ Partial Class Ventas
End If
Case "Rem"
- If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
- TxtAtencionA.Text = DbRowVenta("AtencionA").ToString()
- End If
-
Trsaldo.Visible = True
HplSaldoAuxiliar.NavigateUrl = String.Format("/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxCClientes&CveCliente={0}&CveVenta={1}&TB_iframe=true&height=550&width=920", DbRowVenta("CveCliente"), DbRowVenta("CveVenta"))
HplPagado.NavigateUrl = String.Format("/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxCClientes&CveCliente={0}&CveVenta={1}&TB_iframe=true&height=550&width=920", DbRowVenta("CveCliente"), DbRowVenta("CveVenta"))
@@ -5260,6 +5257,10 @@ Partial Class Ventas
End If
+ If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
+ TxtAtencionA.Text = DbRowVenta("AtencionA").ToString()
+ End If
+
DdlTipoRelacionARelacionar.SelectedValueExist(DbRowVenta("CveTipoRelacion").ToString())
'contado 0, credito 1, terminal 2
@@ -9244,6 +9245,11 @@ Partial Class Ventas
End If
End If
+ If UsuarioActual.Empresa.Funcionalidad(109) = "1" AndAlso TxtAtencionA.Text.Trim.Length = 0 Then
+ Alert("El campo 'Atención A' es requerido. Favor de llenarlo", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+
If Not ValidaImportePublicoGeneral() Then
Exit Sub
End If
@@ -14869,6 +14875,33 @@ Partial Class Ventas
End If
+ 'SI ES PAGO CON DEVOLUCION
+ If DdlTipoAmortizacionAnticipo.SelectedValue = "4" Then
+ If row2.DataKey("CveConceptoContable").ToString().ToEntero() = 277 Then
+
+ If row2.FCCheckBox("Chk" & row2.RowIndex).Checked Then
+ importeMovimiento = row2.FCTextBox("TxtAnticipo" & row2.RowIndex).Text.ToDecimal() * Multiplicador
+ importeMX = importeMovimiento * tipoCambio
+ sumaAmorticaciones += importeMovimiento
+
+ If importeMovimiento <> 0 Then
+ If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, importeMovimiento * tipoCambio, 150, Referencia, Concepto, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveVentaAmortizacion:=-1, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveClasificacion:=ObjFactura.DtDetalle.MAX("CveClasificacion").ToEntero(), CveSubProyecto:=ObjFactura.CveSubProyecto, Contabilizable:=Contabilizable) Then
+ ErrorPrepoliza = True
+ End If
+
+ If ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento * -1, importeMX * -1, 277, Referencia, Concepto, CveVenta:=row2.DataKey("CveVenta").ToString().ToEntero(), CveVentaAmortizacion:=-1, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), Contabilizable:=False, CveSubProyecto:=CveSubProyectoContabilizar) Then
+ If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, Not TipoMovimiento, importeMovimiento * -1, importeMX * -1, 278, Referencia, Concepto, CveVenta:=row2.DataKey("CveVenta").ToString().ToEntero(), CveVentaAmortizacion:=-1, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), Contabilizable:=False, CveSubProyecto:=CveSubProyectoContabilizar) Then
+ ErrorPrepoliza = True
+ End If
+ Else
+ ErrorPrepoliza = True
+ End If
+ End If
+ End If
+
+ End If
+ End If
+
Next
If UsuarioActual.Empresa.Funcionalidad(344) = "1" AndAlso ObjFactura.TipoDocto = "Egs" Then
@@ -16201,7 +16234,11 @@ Partial Class Ventas
End If
GVAnticipos.Columns(4).Visible = False
- GVAnticipos.Columns(7).Visible = False
+ GVAnticipos.Columns(8).Visible = False
+
+ If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
+ GVAnticipos.Columns(6).Visible = True
+ End If
GVAnticipos.DataBind()
End If
@@ -16339,7 +16376,7 @@ Partial Class Ventas
'SI UN REGISTRO ES DE DIFERENTE MONEDA AL DOCUMENTO SE MUESTRAN LAS COLUMNAS
If e.Row.DBCampo("CveMoneda").ToString().ToEntero() > 0 And e.Row.DBCampo("CveMoneda").ToString().ToEntero() <> DdlMoneda.SelectedValue.ToEntero() Then
GVAnticipos.Columns(4).Visible = True
- GVAnticipos.Columns(7).Visible = True
+ GVAnticipos.Columns(8).Visible = True
End If
@@ -16740,7 +16777,7 @@ Partial Class Ventas
If DdlTipoAmortizacionAnticipo.SelectedValue = "4" Then
For Each gvr As GridViewRow In GVAnticipos.Rows
- If gvr.FCCheckBox("Chk" & gvr.RowIndex) IsNot Nothing AndAlso gvr.FCCheckBox("Chk" & gvr.RowIndex).Checked AndAlso gvr.DataKey("CveConceptoContable").ToEntero().Contiene(12) Then
+ If gvr.FCCheckBox("Chk" & gvr.RowIndex) IsNot Nothing AndAlso gvr.FCCheckBox("Chk" & gvr.RowIndex).Checked AndAlso gvr.DataKey("CveConceptoContable").ToEntero().Contiene(12, 277) Then
Amortizacion += gvr.FCTextBox(String.Format("TxtAnticipo{0}", gvr.RowIndex)).Text.ToDecimal ' - ((gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / gvr.DataKey("TotalAnticipo").ToDecimal) * gvr.DataKey("IVAAnticipo").ToDecimal)
End If
Next
@@ -20180,28 +20217,14 @@ Partial Class Ventas
'si tiene la funcionalidad que se active independiente del tipo de documento RMF 15-10-2017
Tr33.Visible = True
- If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant") Then
+ If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Egs", "Dev") Then
BtnEmitirImprimir.Text = "Emitir e Imprimir"
- 'TdReferencia.Style.Add("display", "none")
- ElseIf DdlTipoComprobante.SelectedValue.Contiene("Egs", "Dev") Then
- BtnEmitirImprimir.Text = "Emitir e Imprimir"
- 'TdReferencia.Style.Remove("display")
- ElseIf DdlTipoComprobante.SelectedValue = "Rem" Then
+ ElseIf DdlTipoComprobante.SelectedValue.Contiene("Rem", "Ped", "PeC", "PA", "RNC", "Com") Then
BtnEmitirImprimir.Text = "Registrar"
- 'TdReferencia.Style.Add("display", "none")
- ElseIf DdlTipoComprobante.SelectedValue.Contiene("Ped", "PeC", "PA") Then
- BtnEmitirImprimir.Text = "Registrar"
- 'TdReferencia.Style.Add("display", "none")
ElseIf DdlTipoComprobante.SelectedValue = "Cot" Then
BtnEmitirImprimir.Text = "Cotizar"
- 'TdReferencia.Style.Add("display", "none")
-
'FACTURACION 3.3
Tr33.Visible = True
-
- ElseIf DdlTipoComprobante.SelectedValue = "Com" Then
- BtnEmitirImprimir.Text = "Registrar"
- 'TdReferencia.Style.Add("display", "none")
ElseIf DdlTipoComprobante.SelectedValue.ToString() = "OP" Then
BtnEmitirImprimir.Text = "Registrar"
TdOrdenPago.Visible = True
@@ -26772,26 +26795,7 @@ Partial Class Ventas
#Region " SALDAR VENTA "
Protected Sub BtnSaldarVenta_Click(sender As Object, e As EventArgs)
- 'SaldarVenta()
-
- Dim ObjCancelacion As New Timbrado
-
- Dim FolioFiscal As String = LblFolioFiscal.Text
- Dim RFCEmisor As String = UsuarioActual.Empresa.RFC
- Dim RFCReceptor As String = LblRFC.Text
- Dim CvePACCancelacion As Integer = 4
-
-
- Dim RespCancelacion As RespuestaCancelacionSAT = ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscal, TxtTotal.Text.ToDecimal, RFCReceptor, RFCEmisor, CvePACCancelacion, CveSATMotivoCancelacion:=3)
-
- If RespCancelacion.Verificado Then
-
-
-
- Else
- Alert("Los servicios de cancelación del SAT no se encuentran disponibles o presentan time out. Intente de nuevo en unos minutos.
Origen del error: WebService www.sat.gob.mx", TipoMensaje.MsgError)
- End If
-
+ SaldarVenta()
End Sub
Private Sub SaldarVenta()
'Dim ObjVenta As New ClsVentas
@@ -26805,9 +26809,6 @@ Partial Class Ventas
'RegistraScript("$('#ModalSaldarVenta').modal('hide')", "ModalSaldarVentaHidde")
-
- Dim ObjConta As New ClsContabilidad
- ObjConta.IniciaTransacSQL()
Dim CvePrePoliza As Integer = 0
Dim MsgError As String = ""
@@ -26919,69 +26920,74 @@ Partial Class Ventas
End If
Dim UsaComplementaria As Boolean = True
+ Dim ObjConta As New ClsContabilidad
+ ObjConta.IniciaTransacSQL()
+ Try
+ If MsgError = "" AndAlso Saldo > 0 Then
+ CvePrePoliza = ObjConta.AddPrePolizas("Ventas/Saldarr", 47, SaldoVenta, SaldoVenta, tCveMoneda, FechaPago, ConceptoPartida, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
- If MsgError = "" AndAlso Saldo > 0 Then
- CvePrePoliza = ObjConta.AddPrePolizas("Ventas/Saldarr", 47, SaldoVenta, SaldoVenta, tCveMoneda, FechaPago, ConceptoPartida, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
-
- If UsaComplementaria AndAlso tCveMoneda = 2 Then
- 'normal
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ClienteMovto, Saldo, If(tCveMoneda = 1, Saldo, Saldo), CveConceptoCliente, SerieFolio, ConceptoPartida, CveCliente:=CveCliente, CveVenta:=CveVenta, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
- MsgError = "Ocurrio un error al saldar el movimiento"
- End If
- 'complementaria
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ClienteMovto, 0, If(tCveMoneda = 1, Saldo, (Saldo * TCVenta) - Saldo), 207, SerieFolio, ConceptoPartida, CveCliente:=CveCliente, CveVenta:=CveVenta, ImporteME:=Saldo, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
- MsgError = "Ocurrio un error al saldar el movimiento"
- End If
-
- Else
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ClienteMovto, Saldo, If(tCveMoneda = 1, Saldo, Saldo * TCVenta), CveConceptoCliente, SerieFolio, ConceptoPartida, CveCliente:=CveCliente, CveVenta:=CveVenta, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
- MsgError = "Ocurrio un error al saldar el movimiento"
- End If
-
- End If
-
- 'fluctuación.
- If tCveMoneda = 2 Then
- Dim ImporteFluctuacion As Decimal = 0
- ImporteFluctuacion = Saldo * (TCPago - TCVenta)
- If TCPago > TCVenta Then
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Math.Abs(ImporteFluctuacion), Math.Abs(ImporteFluctuacion), 64, SerieFolio, ConceptoPartida, CveCliente:=CveCliente, CveVenta:=CveVenta, TipoCambio:=TCVenta, TipoCambioPago:=TCPago, CveSubProyecto:=CveSubProyecto) Then
+ If UsaComplementaria AndAlso tCveMoneda = 2 Then
+ 'normal
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ClienteMovto, Saldo, If(tCveMoneda = 1, Saldo, Saldo), CveConceptoCliente, SerieFolio, ConceptoPartida, CveCliente:=CveCliente, CveVenta:=CveVenta, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
MsgError = "Ocurrio un error al saldar el movimiento"
End If
+ 'complementaria
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ClienteMovto, 0, If(tCveMoneda = 1, Saldo, (Saldo * TCVenta) - Saldo), 207, SerieFolio, ConceptoPartida, CveCliente:=CveCliente, CveVenta:=CveVenta, ImporteME:=Saldo, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
+ MsgError = "Ocurrio un error al saldar el movimiento"
+ End If
+
Else
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Math.Abs(ImporteFluctuacion), Math.Abs(ImporteFluctuacion), 65, SerieFolio, ConceptoPartida, CveCliente:=CveCliente, CveVenta:=CveVenta, TipoCambio:=TCVenta, TipoCambioPago:=TCPago, CveSubProyecto:=CveSubProyecto) Then
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ClienteMovto, Saldo, If(tCveMoneda = 1, Saldo, Saldo * TCVenta), CveConceptoCliente, SerieFolio, ConceptoPartida, CveCliente:=CveCliente, CveVenta:=CveVenta, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
MsgError = "Ocurrio un error al saldar el movimiento"
End If
- End If
-
- 'cuando hay pago en dólares, se ajusta el concepto de subtotal,
- SubTotal = (Saldo * TCVenta) + ImporteFluctuacion - (IVA * TCVenta) - (IEPS * TCVenta)
-
- End If
- If IVA > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ImpuestosMovto, IVA, If(tCveMoneda = 1, IVA, IVA * TCVenta), 13, SerieFolio, ConceptoPartida, CveCliente:=CveCliente, CveVenta:=CveVenta, PorcentajeImpuesto:=PorcentajeImpuesto, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
- MsgError = "Ocurrio un error al saldar el movimiento"
- End If
-
- If IEPS > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ImpuestosMovto, IEPS, If(tCveMoneda = 1, IEPS, IEPS * TCVenta), 38, SerieFolio, ConceptoPartida, CveCliente:=CveCliente, CveVenta:=CveVenta, PorcentajeImpuesto:=PorcentajeImpuesto, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
- MsgError = "Ocurrio un error al saldar el movimiento"
- End If
-
- 'al gasto,Subtotal
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, SubtotalMovto, SubTotal, SubTotal, CveConceptoDeduccion, SerieFolio, ConceptoPartida, CveCliente:=CveCliente, CveVenta:=CveVenta, CveCuenta:=-1, TipoCambio:=TCVenta, TipoCambioPago:=TCPago, CveSubProyecto:=CveSubProyecto) Then
- MsgError = "Ocurrio un error al saldar el movimiento"
- End If
-
- If ObjConta.ValidacionesPrePoliza(CvePrePoliza, UsuarioActual, 5) Then
- If ObjConta.ValorPolizaDescuadre > 0 Then
- MsgError = ObjConta.MensajePolizaDescuadre + " " + ObjConta.ValorDiferencia
- GuardaLogAD($"Ventas/ClientesAbonar | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
End If
- End If
- Else
- MsgError = "Saldo Cero"
- End If
+ 'fluctuación.
+ If tCveMoneda = 2 Then
+ Dim ImporteFluctuacion As Decimal = 0
+ ImporteFluctuacion = Saldo * (TCPago - TCVenta)
+ If TCPago > TCVenta Then
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Math.Abs(ImporteFluctuacion), Math.Abs(ImporteFluctuacion), 64, SerieFolio, ConceptoPartida, CveCliente:=CveCliente, CveVenta:=CveVenta, TipoCambio:=TCVenta, TipoCambioPago:=TCPago, CveSubProyecto:=CveSubProyecto) Then
+ MsgError = "Ocurrio un error al saldar el movimiento"
+ End If
+ Else
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Math.Abs(ImporteFluctuacion), Math.Abs(ImporteFluctuacion), 65, SerieFolio, ConceptoPartida, CveCliente:=CveCliente, CveVenta:=CveVenta, TipoCambio:=TCVenta, TipoCambioPago:=TCPago, CveSubProyecto:=CveSubProyecto) Then
+ MsgError = "Ocurrio un error al saldar el movimiento"
+ End If
+ End If
+
+ 'cuando hay pago en dólares, se ajusta el concepto de subtotal,
+ SubTotal = (Saldo * TCVenta) + ImporteFluctuacion - (IVA * TCVenta) - (IEPS * TCVenta)
+
+ End If
+ If IVA > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ImpuestosMovto, IVA, If(tCveMoneda = 1, IVA, IVA * TCVenta), 13, SerieFolio, ConceptoPartida, CveCliente:=CveCliente, CveVenta:=CveVenta, PorcentajeImpuesto:=PorcentajeImpuesto, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
+ MsgError = "Ocurrio un error al saldar el movimiento"
+ End If
+
+ If IEPS > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ImpuestosMovto, IEPS, If(tCveMoneda = 1, IEPS, IEPS * TCVenta), 38, SerieFolio, ConceptoPartida, CveCliente:=CveCliente, CveVenta:=CveVenta, PorcentajeImpuesto:=PorcentajeImpuesto, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
+ MsgError = "Ocurrio un error al saldar el movimiento"
+ End If
+
+ 'al gasto,Subtotal
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, SubtotalMovto, SubTotal, SubTotal, CveConceptoDeduccion, SerieFolio, ConceptoPartida, CveCliente:=CveCliente, CveVenta:=CveVenta, CveCuenta:=-1, TipoCambio:=TCVenta, TipoCambioPago:=TCPago, CveSubProyecto:=CveSubProyecto) Then
+ MsgError = "Ocurrio un error al saldar el movimiento"
+ End If
+
+ If ObjConta.ValidacionesPrePoliza(CvePrePoliza, UsuarioActual, 5) Then
+ If ObjConta.ValorPolizaDescuadre > 0 Then
+ MsgError = ObjConta.MensajePolizaDescuadre + " " + ObjConta.ValorDiferencia
+ GuardaLogAD($"Ventas/ClientesAbonar | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
+
+ End If
+ End If
+ Else
+ MsgError = "Saldo Cero"
+ End If
+ Catch ex As Exception
+ MsgError = "Ocurrió un error al saldar"
+ GuardaLog(ex.ToString())
+ End Try
If MsgError = "" Then
'ObjConta.RollBack()
@@ -29002,6 +29008,13 @@ Partial Class Ventas
CambiaTipoDocto()
End If
+
+ If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
+ If TxtAtencionA.Text.Trim.Length = 0 Then
+ TxtAtencionA.Enabled = True
+ End If
+ End If
+
Catch ex As Exception
OnError("Ocurrió un error al aplicar NC", ex)
End Try
@@ -30023,6 +30036,12 @@ Partial Class Ventas
Exit Sub
End If
+ If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
+ If TxtAtencionA.Text.Trim.Length = 0 Then
+ TxtAtencionA.Enabled = True
+ End If
+ End If
+
AplicaDevolucion = True
SaldoVentaDevolucion = HplSaldoAuxiliar.Text.ToDecimal
CveVentaDevolucion = CveVenta
@@ -30691,7 +30710,7 @@ Partial Class Ventas
If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem") AndAlso DdlTipoAmortizacionAnticipo.SelectedValue = "4" Then
- Dim DtMovtos As DataTable = Me.TmpDTAnticiposNCIxCCliente.FiltraParametros($"Saldo > 0 And SaldoSubtotal > 0 {If(CveVenta < 0, $"AND Tipo = 'NC' ", "")}")
+ Dim DtMovtos As DataTable = Me.TmpDTAnticiposNCIxCCliente.FiltraParametros($"Saldo > 0 And SaldoSubtotal > 0 {If(CveVenta < 0, $"AND Tipo IN('NC','RNC') ", "")}")
divAmortizacionTipoRelacion.Visible = False
GVAnticipos.DataSource = DtMovtos
GVAnticipos.DataBind()
@@ -31891,7 +31910,7 @@ Partial Class Ventas
CveMetodoPago = Dr("CveMetodoPago33").ToString().ToEntero()
Next
- If EsRemisionMedica Then
+ If UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 AndAlso EsRemisionMedica Then
TxtObsFact.Text = If(MensajeRemisionesMedicas.ToString().Length > 0, MensajeRemisionesMedicas.ToString().Substring(0, MensajeRemisionesMedicas.ToString().Length - 2), "")
Else
TxtObsFact.Text = If(MensajeRemisiones.ToString().Length > 0, MensajeRemisiones.ToString().Substring(0, MensajeRemisiones.ToString().Length - 2), "")
@@ -36927,8 +36946,14 @@ Partial Class Ventas
If DdlClientesModal.SelectedValue.ToEntero > 0 Then
ViewState("CveCliente") = DdlClientesModal.SelectedValue.ToEntero
Else
- Alert("Debe de seleccionar un cliente.", TipoMensaje.MsgAdvertencia)
- Exit Sub
+ Dim CveClientePublicoGeneral As Integer = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveCliente", " RFC = 'XAXX010101000' ").ToEntero
+
+ If CveClientePublicoGeneral > 0 Then
+ ViewState("CveCliente") = CveClientePublicoGeneral
+ Else
+ Alert("Debe de seleccionar un cliente.", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
End If