--Cambios en Boletos, parece que se duplicaron id's

This commit is contained in:
AbrahamCastilloV
2024-01-21 16:44:58 -07:00
38 changed files with 3343 additions and 2330 deletions

View File

@@ -124,8 +124,8 @@ Partial Class AF_CatAF
DdlTipoActivo.Items.Insert(0, New ListItem("Todos", "-1"))
End Sub
Private Sub CargaResponsable()
Dim DtPersonal = GlobalDTRHPersonal(UsuarioActual.CveEmpresa).FiltraParametros("", "NombreCompleto")
DdlResponsable.DataSource = DtPersonal
DdlResponsable.DataSource = GlobalDTRHPersonal(UsuarioActual.CveEmpresa).FiltraParametros("", "NombreCompleto")
DdlResponsable.DataBind()
End Sub
Protected Sub DdlTipoActivo_SelectedIndexChanged(sender As Object, e As EventArgs)
@@ -454,7 +454,7 @@ Partial Class AF_CatAF
End Sub
Private Sub GenerarPDF(Optional Formato As String = "PDF")
If DtActivosFijos.Rows.Count > 0 Then
If DtActivosFijos IsNot Nothing AndAlso DtActivosFijos.Rows.Count > 0 Then
Dim params As New List(Of ReportParameter)
Dim Imagen As New System.IO.FileInfo($"{UsuarioActual.Empresa.Ruta}/Logo.png")

View File

@@ -248,11 +248,11 @@ End Class
<Serializable>
Public Class CFDIComplementos
Public Property ComercioExterior11 As CFDIComercioExterior11
Public Property ComercioExterior As CFDIComercioExterior
Public Property CartaPorte As CFDICartaPorte
Sub New()
ComercioExterior11 = New CFDIComercioExterior11
ComercioExterior = New CFDIComercioExterior
End Sub
End Class
@@ -732,7 +732,7 @@ End Class
<Serializable>
Public Class CFDIComercioExterior11
Public Class CFDIComercioExterior
Public Property MotivoTraslado As String
Public Property TipoOperacion As String = ""
Public Property ClavedePedimento As String = ""

View File

@@ -6914,6 +6914,13 @@ Public Class ClsPaginas
params.Add(New ReportParameter("Tipo", TipoDocumento))
params.Add(New ReportParameter("Ref", TipoDocumentoRef))
params.Add(New ReportParameter("AplicaPagare", AplicaPagare))
If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then
params.Add(New ReportParameter("Documentacion", Vta.Cliente.Documentacion))
params.Add(New ReportParameter("Medico", Vta.Medico))
params.Add(New ReportParameter("Procedimiento", Vta.Procedimiento))
params.Add(New ReportParameter("FechaCirugia", Vta.FechaEjecucion.ToString("dd/MM/yyyy HH:mm")))
End If
'VSH
If UsuarioActual.CveEmpresa.Contiene(4, 7, 11, 12, 122, 145) Then
'DATOS CLIENTES
@@ -7197,6 +7204,46 @@ Public Class ClsPaginas
GuardaLog("No se especifico el tipo de Impresion de venta (Venta, Remision, Cotización, Nota de Crédito).")
Return Nothing
End If
If NombreArchivo = "FacturaUSA" Then
Dim DtBaseTotales = Vta.DtDeduccion.Clone()
If Vta.DtDeduccion IsNot Nothing Then
Dim RowTotal_USA = DtBaseTotales.NewRow()
Dim RowPAYMENTS_USA = DtBaseTotales.NewRow()
Dim RowBALANCE_USA = DtBaseTotales.NewRow()
Dim TOTAL_USA As Decimal = 0
Dim PAYMENTS_USA As Decimal = 0
Dim BALANCE_USA As Decimal = 0
For Each Row As DataRow In Vta.DtDeduccion.Rows
If Row("ImpuestoLocal").ToString() = "Total" Then
TOTAL_USA += Row("Importe").ToString().ToDecimal()
End If
Next
RowTotal_USA("ImpuestoLocal") = "TOTAL"
RowTotal_USA("Importe") = TOTAL_USA
RowTotal_USA("Orden") = 1
DtBaseTotales.Rows.Add(RowTotal_USA)
RowPAYMENTS_USA("ImpuestoLocal") = "PAYMENTS/CREDITS"
RowPAYMENTS_USA("Importe") = PAYMENTS_USA
RowPAYMENTS_USA("Orden") = 2
DtBaseTotales.Rows.Add(RowPAYMENTS_USA)
BALANCE_USA = TOTAL_USA - PAYMENTS_USA
RowBALANCE_USA("ImpuestoLocal") = "BALANCE DUE"
RowBALANCE_USA("Importe") = BALANCE_USA
RowBALANCE_USA("Orden") = 3
DtBaseTotales.Rows.Add(RowBALANCE_USA)
Vta.DtDeduccion = DtBaseTotales
End If
End If
'TERMINA REGION PARAMETROS
Dim lrds As New List(Of ReportDataSource)
'Si es ECLIPSE CREAR COLUMAS PARA FIRMAS EN DtDetalle.
@@ -7273,6 +7320,7 @@ Public Class ClsPaginas
If UsuarioActual.CveEmpresa.Contiene(141, 152, 159, 160, 161, 162, 163) AndAlso (RutaFormato.Contains("Factura") Or RutaFormato.Contains("Cotizacion")) Then
params.Add(New ReportParameter("Kilometraje", Vta.Kilometraje.ToString))
End If
'Imprime los parametros
'Dim ast As New StringBuilder
'For Each par As ReportParameter In params
@@ -7550,6 +7598,7 @@ Public Class ClsPaginas
End If
End If
ObjVentas.Dispose()
If Not IsNothing(Vta) Then
PdfFactura(Vta)
Vta = Nothing
@@ -9163,7 +9212,7 @@ Public Class ClsPaginas
End If
If VentaActual.Fecha < tFechaUltimaFluctuacion Then TCValuacionVenta = TCValuacion
'si tiene fecha de documento, debe de evaluarse para su tc. y no la fecha de la prepóliza
If IIf(Pago.FechaDocumentoRelacionado > MinFecha, Pago.FechaDocumentoRelacionado, Pago.Fecha).ToString.ToDate < tFechaUltimaFluctuacion Then TCValuacionPago = TCValuacion
If IIf(Pago.FechaDocumentoRelacionado > MinFecha, Pago.FechaDocumentoRelacionado, Pago.Fecha).ToString.ToDate < tFechaUltimaFluctuacion AndAlso Pago.CveMonedaPago > 1 Then TCValuacionPago = TCValuacion
End If
End If
If VentaActual.CveMoneda = 1 And Pago.CveMonedaPago <> 1 Then 'factura pesos, pago en dolares
@@ -9173,7 +9222,7 @@ Public Class ClsPaginas
tImporteVenta = (Pago.ImportePago * TCValuacionVenta).RoundSQL
tImportePago = (Pago.ImportePago * TCValuacionPago).RoundSQL
ElseIf VentaActual.CveMoneda <> 1 And Pago.CveMonedaPago = 1 Then 'factura dolares, pago en pesos
tImporteVenta = (Pago.ImportePago * TCValuacionVenta).RoundSQL
tImporteVenta = (Pago.ImportePagoVenta * TCValuacionVenta).RoundSQL
tImportePago = (Pago.ImportePago * TCValuacionPago).RoundSQL
End If
If VentaActual.CveMoneda > 1 Then ImporteME = Pago.ImportePagoVenta
@@ -9282,7 +9331,7 @@ Public Class ClsPaginas
If Pago.TipoPago = "NC" AndAlso Not ErrorMovtos Then ' N O T A D E C R E D I T O
Concepto = String.Format("{0} NC:{1}", VentaActual.ClienteNombre, Pago.Referencia)
Dim Ret As New ConceptosRetenciones
Dim ConPrePNC As ConceptosTipoSaldo = ObtenerCveConceptoPrePoliza(6, VentaActual.CveMoneda, True, 2)
Dim ConPrePNC As ConceptosTipoSaldo = ObtenerCveConceptoPrePoliza(6, Pago.CveMonedaPago, True, 2)
If Pago.CveMonedaPago > 1 Then
'Agregamos la Extranjera
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Pago.ImportePago, Pago.ImportePago, ConPrePNC.CveConcepto, Pago.Referencia, Concepto, CveVenta:=Pago.CveVentaAmortizacion, CveVentaAmortizacion:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, ImporteME:=Pago.ImportePago, TipoCambio:=TCValuacionPago, CveSubProyecto:=VentaActual.CveSubProyecto) Then ErrorMovtos = True

View File

@@ -2802,7 +2802,10 @@ Public Class ClsRH
Retorno = True
Catch Ex1 As SqlException
If Ex1.Message.Contains("Número: 2627;") Then
Alert("Ya se registró la Asistencia para el empleado.", TipoMensaje.MsgAdvertencia)
Alert("Ya se registró la Asistencia para el empleado.", TipoMensaje.MsgAdvertencia)
ElseIf Ex1.Message.Contains("x50102;") Then
Alert("No se puede editar o agregar la asistencia ya que se encuentra vinculada a un periodo autorizado.", TipoMensaje.MsgAdvertencia)
GuardaLog(String.Format("{0} DESCRIPCIÓN DETALLADA: {1} {2} {3}", "Ocurrió un error al editar o agregar la asistencia ", Ex1.ToString, vbCrLf, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()))
Else
Me.OnError("Ocurrió un error al guardar la Asistencia.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End If
@@ -2830,7 +2833,10 @@ Public Class ClsRH
Retorno = True
Catch Ex1 As SqlException
If Ex1.Message.Contains("Número: 2627;") Then
Alert("Ya se registró la Asistencia para el empleado.", TipoMensaje.MsgAdvertencia)
Alert("Ya se registró la Asistencia para el empleado.", TipoMensaje.MsgAdvertencia)
ElseIf Ex1.Message.Contains("x50102;") Then
Alert("No se puede editar o agregar la asistencia ya que se encuentra vinculada a un periodo autorizado.", TipoMensaje.MsgAdvertencia)
GuardaLog(String.Format("{0} DESCRIPCIÓN DETALLADA: {1} {2} {3}", "Ocurrió un error al editar o agregar la asistencia ", Ex1.ToString, vbCrLf, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()))
Else
Me.OnError("Ocurrió un error al guardar la Asistencia.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End If
@@ -2873,7 +2879,10 @@ Public Class ClsRH
Retorno = True
Catch Ex1 As SqlException
If Ex1.Message.Contains("Número: 2627;") Then
Alert("Ya existe un Registro con el mismo nombre: " & CveAsistencia & ".", TipoMensaje.MsgAdvertencia)
Alert("Ya existe un Registro con el mismo nombre: " & CveAsistencia & ".", TipoMensaje.MsgAdvertencia)
ElseIf Ex1.Message.Contains("x50102;") Then
Alert("No se puede editar o agregar la asistencia ya que se encuentra vinculada a un periodo autorizado.", TipoMensaje.MsgAdvertencia)
GuardaLog(String.Format("{0} DESCRIPCIÓN DETALLADA: {1} {2} {3}", "Ocurrió un error al editar o agregar la asistencia ", Ex1.ToString, vbCrLf, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()))
Else
Me.OnError("Ocurrió un error al Guardar el registro.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End If
@@ -2899,6 +2908,15 @@ Public Class ClsRH
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch Ex1 As SqlException
If Ex1.Message.Contains("Número: 2627;") Then
Alert("Ya existe un Registro con el mismo nombre: " & CveAsistencia & ".", TipoMensaje.MsgAdvertencia)
ElseIf Ex1.Message.Contains("x50102;") Then
Alert("No se puede editar o agregar la asistencia ya que se encuentra vinculada a un periodo autorizado.", TipoMensaje.MsgAdvertencia)
GuardaLog(String.Format("{0} DESCRIPCIÓN DETALLADA: {1} {2} {3}", "Ocurrió un error al editar o agregar la asistencia ", Ex1.ToString, vbCrLf, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()))
Else
Me.OnError("Ocurrió un error al Guardar el registro.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End If
Catch ex As Exception
OnError("Ocurrió un error al guardar los cambios.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
@@ -2919,7 +2937,10 @@ Public Class ClsRH
Retorno = True
Catch Ex1 As SqlException
If Ex1.Message.Contains("Número: 547;") Then
Alert("El registro no se pudo eliminar porque está siendo usado.", TipoMensaje.MsgAdvertencia)
Alert("El registro no se pudo eliminar porque está siendo usado.", TipoMensaje.MsgAdvertencia)
ElseIf Ex1.Message.Contains("x50102;") Then
Alert("No se puede editar o agregar la asistencia ya que se encuentra vinculada a un periodo autorizado.", TipoMensaje.MsgAdvertencia)
GuardaLog(String.Format("{0} DESCRIPCIÓN DETALLADA: {1} {2} {3}", "Ocurrió un error al editar o agregar la asistencia ", Ex1.ToString, vbCrLf, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()))
Else
Me.OnError("Ocurrió un error al eliminar el registro.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End If
@@ -2937,6 +2958,13 @@ Public Class ClsRH
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch Ex1 As SqlException
If Ex1.Message.Contains("x50102;") Then
Alert("No se puede editar o agregar la asistencia ya que se encuentra vinculada a un periodo autorizado.", TipoMensaje.MsgAdvertencia)
GuardaLog(String.Format("{0} DESCRIPCIÓN DETALLADA: {1} {2} {3}", "Ocurrió un error al editar o agregar la asistencia ", Ex1.ToString, vbCrLf, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()))
Else
Me.OnError("Ocurrió un error al guardar la Asistencia.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End If
Catch ex As Exception
Me.OnError("Ocurrió un error al eliminar la asistencia.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try

View File

@@ -184,6 +184,7 @@ Public Class ClsTransportes
CveMasivo = Data.Rows(0)("CveMasivo").ToString.ToEntero
Fecha = Data.Rows(0)("Fecha").ToString.ToDate
Ruta = Data.Rows(0)("Ruta").ToString
Me.CveViaje = Data.Rows(0)("CveViaje").ToString.ToEntero
End If
Retorno = True
Catch ex As Exception
@@ -273,20 +274,15 @@ Public Class ClsTransportes
Return Retorno
End Function
Public Function GetViajesPasajeros(CveViaje As Integer, Optional CveViajePasajero As Integer = 0, Optional Estatus As Boolean = False) As Boolean
Public Function GetViajesPasajeros(CveViaje As Integer, Optional CveViajePasajero As Integer = -1, Optional Estatus As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Trans_ViajesPasajerosGet")
If Estatus = True Then
With SqlAdapter.SelectCommand.Parameters
.Add("@CveViaje", SqlDbType.Int).Value = CveViaje
.Add("@Estatus", SqlDbType.Bit).Value = Estatus
End With
Else
With SqlAdapter.SelectCommand.Parameters
.Add("@CveViaje", SqlDbType.Int).Value = CveViaje
End With
End If
With SqlAdapter.SelectCommand.Parameters
.Add("@CveViaje", SqlDbType.Int).Value = CveViaje
.Add("@CveViajePasajero", SqlDbType.Int).Value = CveViajePasajero
.Add("@Estatus", SqlDbType.Int).Value = Estatus
End With
Try
SqlAdapter.Fill(Data)

View File

@@ -576,7 +576,7 @@ Public Class ClsVentas
Optional AtencionA As String = "", Optional PedidoContrato As String = "", Optional CveFormaPago33 As Integer = -1, Optional CveMetodoPago33 As Integer = -1,
Optional CveCliente As Integer = -1, Optional CveClienteSucursal As Integer = -1, Optional OrdenCompra As String = "-1", Optional RetIVA As Decimal = -1,
Optional RetISR As Decimal = -1, Optional Kilometraje As Decimal = 0, Optional CveUsoCFDi As Integer = -1, Optional ServicioDomicilio As Boolean = False, Optional CveVendedor As Integer = -1,
Optional RequiereOS As Boolean = False, Optional CveMedico As Integer = -1, Optional CveProcedimiento As Integer = -1) As Boolean
Optional RequiereOS As Boolean = False, Optional CveMedico As Integer = -1, Optional CveProcedimiento As Integer = -1, Optional FechaParaSurtir As DateTime = MinFecha) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_VentasUpdate")
@@ -612,6 +612,7 @@ Public Class ClsVentas
.Add("@RequiereOS", SqlDbType.Int).Value = RequiereOS
.Add("@CveMedico", SqlDbType.Int).Value = CveMedico
.Add("@CveProcedimiento", SqlDbType.Int).Value = CveProcedimiento
.Add("@FechaParaSurtir", SqlDbType.DateTime).Value = FechaParaSurtir
End With
Try
@@ -625,7 +626,8 @@ Public Class ClsVentas
End Function
Public Function UpdateObservacionesVenta(CveVenta As Integer, CveEmpresa As Integer, CveVendedor As Integer, Observaciones As String, FormaPaqueteria As Integer, CorreoNotificaciones As String, ObservacionesAlm As String,
Pedido As String, OrdenCompra As String, FechaPago As String, CveUsoCFDI As Integer, Optional DescripcionVenta As String = "-1", Optional CveMedico As Integer = -1, Optional CveProcedimiento As Integer = -1) As Boolean
Pedido As String, OrdenCompra As String, FechaPago As String, CveUsoCFDI As Integer, Optional DescripcionVenta As String = "-1", Optional CveMedico As Integer = -1, Optional CveProcedimiento As Integer = -1,
Optional FechaParaSurtir As DateTime = MinFecha) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_VentasObservacionesUpdate")
With SqlAdapter.SelectCommand.Parameters
@@ -643,8 +645,42 @@ Public Class ClsVentas
.Add("@DescripcionVenta", SqlDbType.VarChar).Value = DescripcionVenta
.Add("@CveMedico", SqlDbType.Int).Value = CveMedico
.Add("@CveProcedimiento", SqlDbType.Int).Value = CveProcedimiento
.Add("@FechaParaSurtir", SqlDbType.DateTime).Value = FechaParaSurtir
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al actualizar las observaciones de la venta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function UpdateEstatusOCRelacionada(CveVenta As Integer, CveEstatusOrdenServicio As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_VentasOSEstatusUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
.Add("@CveEstatusOrdenServicio", SqlDbType.Int).Value = CveEstatusOrdenServicio
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al actualizar las observaciones de la venta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function UpdateFechaOSVenta(CveVenta As Integer, FechaCita As DateTime, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_VentasOSFechaCitaUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
.Add("@FechaCita", SqlDbType.DateTime).Value = FechaCita
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
@@ -1383,7 +1419,7 @@ Public Class ClsVentas
Optional CveContratoDetalle As Integer = -1, Optional PorcentajeIVA As Decimal = 0, Optional IEPS As Decimal = -1, Optional PorcentajeIEPS As Double = 0, Optional CvePromocionDetalle As Integer = -1,
Optional CveMovimientoDetallePedido As Integer = -1, Optional ImporteRetIVA As Decimal = 0, Optional PorcentajeRetIVA As Double = 0,
Optional ImporteRetISR As Decimal = 0, Optional PorcentajeRetISR As Decimal = 0, Optional CuentaPredial As String = "", Optional CvePrecioLista As Integer = -1, Optional CveActivoFijo As Integer = -1,
Optional NumTurnos As Decimal = 0D, Optional EstatusAlmacen As Integer = 0) As Boolean
Optional NumTurnos As Decimal = 0D, Optional EstatusAlmacen As Integer = 0, Optional CantidadConversion As Decimal = 0) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_VentasDetalleAdd")
@@ -1417,6 +1453,7 @@ Public Class ClsVentas
.Add("@CveActivoFijo", SqlDbType.Int).Value = CveActivoFijo
.Add("@NumTurnos", SqlDbType.Decimal).Value = NumTurnos
.Add("@EstatusAlmacen", SqlDbType.Int).Value = EstatusAlmacen
.Add("@CantidadConversion", SqlDbType.Decimal).Value = CantidadConversion
End With
Try
@@ -4016,6 +4053,7 @@ Public Class ClsVentas
.Add("@TipoSaldo", SqlDbType.Int).Value = TipoSaldo
.Add("@EsquemaNuevo", SqlDbType.Bit).Value = EsquemaNuevo
End With
SqlAdapter.SelectCommand.CommandTimeout = 0
Try
SqlAdapter.Fill(Data)
Retorno = True

View File

@@ -1788,7 +1788,7 @@ Namespace Modelos
Dim AplicaComercioExteriorSubProyecto As Boolean = True
Timbre.Complementos.ComercioExterior11.AplicaComercioExteriorSubProyecto = False
Timbre.Complementos.ComercioExterior.AplicaComercioExteriorSubProyecto = False
Me.FemsaFactura = New Modelos.FemsaFactura
Me.Timbre = Timbre
@@ -6221,6 +6221,17 @@ Namespace Modelos
End If
End If
'CANCELAR ORDEN DE SERVICIO
If Not ErrorCancelar Then
If ObjFactura.CveMedico > 0 Then
Dim CveEstatusCancelacion As Integer = ClsPaginas.GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveEstatusOrdenServicio", "TipoEstatus = 5", "Orden ASC").ToString().ToEntero()
If Not ObjVentas.UpdateEstatusOCRelacionada(ObjFactura.CveVenta, CveEstatusCancelacion, ObjFactura.CveEmpresa) Then
ErrorCancelar = True
MensajeError = "Ocurrió un error al cancelar la orden de servicio"
End If
End If
End If
End If
'MARCA LA VENTA PARA REALIZAR LA DEVOLUCION POSTERIORMENTE

View File

@@ -1361,127 +1361,127 @@ Public Class Timbrado
#End Region
#Region " Comercio Exterior"
If Ventas.Cliente.AplicaComercioExterior And ObjCFDITimbre.Complementos.ComercioExterior11.AplicaComercioExteriorSubProyecto Then
If ObjCFDITimbre.Complementos.ComercioExterior11 IsNot Nothing Then
If Ventas.Cliente.AplicaComercioExterior And ObjCFDITimbre.Complementos.ComercioExterior.AplicaComercioExteriorSubProyecto Then
If ObjCFDITimbre.Complementos.ComercioExterior IsNot Nothing Then
'DATOS GENERALES
Dim ComExt As New Profact.TimbraCFDI33.Complementos.ComercioExterior11.ComercioExterior()
ComExt.Version = "1.1"
ComExt.MotivoTrasladoSpecified = True
ComExt.MotivoTraslado = ObjCFDITimbre.Complementos.ComercioExterior11.MotivoTraslado
ComExt.TipoOperacion = ObjCFDITimbre.Complementos.ComercioExterior11.TipoOperacion
ComExt.MotivoTraslado = ObjCFDITimbre.Complementos.ComercioExterior.MotivoTraslado
ComExt.TipoOperacion = ObjCFDITimbre.Complementos.ComercioExterior.TipoOperacion
ComExt.ClaveDePedimentoSpecified = True
ComExt.ClaveDePedimento = ObjCFDITimbre.Complementos.ComercioExterior11.ClavedePedimento
ComExt.ClaveDePedimento = ObjCFDITimbre.Complementos.ComercioExterior.ClavedePedimento
ComExt.CertificadoOrigenSpecified = True
ComExt.CertificadoOrigen = ObjCFDITimbre.Complementos.ComercioExterior11.CertificadoOrigen.ToEntero
If ObjCFDITimbre.Complementos.ComercioExterior11.NumCertificadoOrigen <> "" Then
ComExt.NumCertificadoOrigen = ObjCFDITimbre.Complementos.ComercioExterior11.NumCertificadoOrigen
ComExt.CertificadoOrigen = ObjCFDITimbre.Complementos.ComercioExterior.CertificadoOrigen.ToEntero
If ObjCFDITimbre.Complementos.ComercioExterior.NumCertificadoOrigen <> "" Then
ComExt.NumCertificadoOrigen = ObjCFDITimbre.Complementos.ComercioExterior.NumCertificadoOrigen
End If
If ObjCFDITimbre.Complementos.ComercioExterior11.NumeroExportadorConfiable <> "" Then
ComExt.NumeroExportadorConfiable = ObjCFDITimbre.Complementos.ComercioExterior11.NumeroExportadorConfiable
If ObjCFDITimbre.Complementos.ComercioExterior.NumeroExportadorConfiable <> "" Then
ComExt.NumeroExportadorConfiable = ObjCFDITimbre.Complementos.ComercioExterior.NumeroExportadorConfiable
End If
ComExt.IncotermSpecified = True
ComExt.Incoterm = ObjCFDITimbre.Complementos.ComercioExterior11.Incoterm
ComExt.Incoterm = ObjCFDITimbre.Complementos.ComercioExterior.Incoterm
ComExt.SubdivisionSpecified = True
ComExt.Subdivision = ObjCFDITimbre.Complementos.ComercioExterior11.Subdivision.ToEntero
If ObjCFDITimbre.Complementos.ComercioExterior11.Observaciones <> "" Then
ComExt.Observaciones = ObjCFDITimbre.Complementos.ComercioExterior11.Observaciones
ComExt.Subdivision = ObjCFDITimbre.Complementos.ComercioExterior.Subdivision.ToEntero
If ObjCFDITimbre.Complementos.ComercioExterior.Observaciones <> "" Then
ComExt.Observaciones = ObjCFDITimbre.Complementos.ComercioExterior.Observaciones
End If
ComExt.TipoCambioUSDSpecified = True
ComExt.TipoCambioUSD = ObjCFDITimbre.Complementos.ComercioExterior11.TipoCambioUSD
ComExt.TipoCambioUSD = ObjCFDITimbre.Complementos.ComercioExterior.TipoCambioUSD
ComExt.TotalUSDSpecified = True
ComExt.TotalUSD = ObjCFDITimbre.Complementos.ComercioExterior11.TotalUSD
ComExt.TotalUSD = ObjCFDITimbre.Complementos.ComercioExterior.TotalUSD
'EMISOR
ComExt.Emisor = New Profact.TimbraCFDI33.Complementos.ComercioExterior11.ComercioExteriorEmisor()
If EmisorRFC.Length < 12 Then
ComExt.Emisor.Curp = ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.CURP
ComExt.Emisor.Curp = ObjCFDITimbre.Complementos.ComercioExterior.Emisor.CURP
End If
ComExt.Emisor.Domicilio = New Profact.TimbraCFDI33.Complementos.ComercioExterior11.ComercioExteriorEmisorDomicilio
ComExt.Emisor.Domicilio.Calle = ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.Calle
ComExt.Emisor.Domicilio.CodigoPostal = ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.CP
ComExt.Emisor.Domicilio.Calle = ObjCFDITimbre.Complementos.ComercioExterior.Emisor.Calle
ComExt.Emisor.Domicilio.CodigoPostal = ObjCFDITimbre.Complementos.ComercioExterior.Emisor.CP
ComExt.Emisor.Domicilio.ColoniaSpecified = True
ComExt.Emisor.Domicilio.Colonia = ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.Colonia
ComExt.Emisor.Domicilio.Estado = ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.Estado
If ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.Localidad <> "" Then
ComExt.Emisor.Domicilio.Colonia = ObjCFDITimbre.Complementos.ComercioExterior.Emisor.Colonia
ComExt.Emisor.Domicilio.Estado = ObjCFDITimbre.Complementos.ComercioExterior.Emisor.Estado
If ObjCFDITimbre.Complementos.ComercioExterior.Emisor.Localidad <> "" Then
ComExt.Emisor.Domicilio.LocalidadSpecified = False
ComExt.Emisor.Domicilio.Localidad = ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.Localidad
ComExt.Emisor.Domicilio.Localidad = ObjCFDITimbre.Complementos.ComercioExterior.Emisor.Localidad
End If
ComExt.Emisor.Domicilio.MunicipioSpecified = True
ComExt.Emisor.Domicilio.Municipio = ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.Municipio
If ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.NumeroExterior <> "" Then ComExt.Emisor.Domicilio.NumeroExterior = ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.NumeroExterior
If ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.NumeroInterior <> "" Then ComExt.Emisor.Domicilio.NumeroInterior = ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.NumeroInterior
ComExt.Emisor.Domicilio.Pais = ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.Pais
If ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.Referencia <> "" Then
ComExt.Emisor.Domicilio.Referencia = ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.Referencia
ComExt.Emisor.Domicilio.Municipio = ObjCFDITimbre.Complementos.ComercioExterior.Emisor.Municipio
If ObjCFDITimbre.Complementos.ComercioExterior.Emisor.NumeroExterior <> "" Then ComExt.Emisor.Domicilio.NumeroExterior = ObjCFDITimbre.Complementos.ComercioExterior.Emisor.NumeroExterior
If ObjCFDITimbre.Complementos.ComercioExterior.Emisor.NumeroInterior <> "" Then ComExt.Emisor.Domicilio.NumeroInterior = ObjCFDITimbre.Complementos.ComercioExterior.Emisor.NumeroInterior
ComExt.Emisor.Domicilio.Pais = ObjCFDITimbre.Complementos.ComercioExterior.Emisor.Pais
If ObjCFDITimbre.Complementos.ComercioExterior.Emisor.Referencia <> "" Then
ComExt.Emisor.Domicilio.Referencia = ObjCFDITimbre.Complementos.ComercioExterior.Emisor.Referencia
End If
'RECEPTOR
ComExt.Receptor = New Profact.TimbraCFDI33.Complementos.ComercioExterior11.ComercioExteriorReceptor
If ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.NumRegIdTrib <> "" Then
ComExt.Receptor.NumRegIdTrib = ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.NumRegIdTrib
If ObjCFDITimbre.Complementos.ComercioExterior.Receptor.NumRegIdTrib <> "" Then
ComExt.Receptor.NumRegIdTrib = ObjCFDITimbre.Complementos.ComercioExterior.Receptor.NumRegIdTrib
End If
ComExt.Receptor.Domicilio = New Profact.TimbraCFDI33.Complementos.ComercioExterior11.ComercioExteriorReceptorDomicilio
ComExt.Receptor.Domicilio.Calle = ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.Calle
ComExt.Receptor.Domicilio.CodigoPostal = ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.CP
If ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.Colonia <> "" Then
ComExt.Receptor.Domicilio.Colonia = ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.Colonia
ComExt.Receptor.Domicilio.Calle = ObjCFDITimbre.Complementos.ComercioExterior.Receptor.Calle
ComExt.Receptor.Domicilio.CodigoPostal = ObjCFDITimbre.Complementos.ComercioExterior.Receptor.CP
If ObjCFDITimbre.Complementos.ComercioExterior.Receptor.Colonia <> "" Then
ComExt.Receptor.Domicilio.Colonia = ObjCFDITimbre.Complementos.ComercioExterior.Receptor.Colonia
End If
ComExt.Receptor.Domicilio.Estado = ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.Estado
If ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.Localidad <> "" Then
ComExt.Receptor.Domicilio.Localidad = ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.Localidad
ComExt.Receptor.Domicilio.Estado = ObjCFDITimbre.Complementos.ComercioExterior.Receptor.Estado
If ObjCFDITimbre.Complementos.ComercioExterior.Receptor.Localidad <> "" Then
ComExt.Receptor.Domicilio.Localidad = ObjCFDITimbre.Complementos.ComercioExterior.Receptor.Localidad
End If
If ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.Municipio <> "" Then
ComExt.Receptor.Domicilio.Municipio = ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.Municipio
If ObjCFDITimbre.Complementos.ComercioExterior.Receptor.Municipio <> "" Then
ComExt.Receptor.Domicilio.Municipio = ObjCFDITimbre.Complementos.ComercioExterior.Receptor.Municipio
End If
If ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.NumeroExterior <> "" Then
ComExt.Receptor.Domicilio.NumeroExterior = ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.NumeroExterior
If ObjCFDITimbre.Complementos.ComercioExterior.Receptor.NumeroExterior <> "" Then
ComExt.Receptor.Domicilio.NumeroExterior = ObjCFDITimbre.Complementos.ComercioExterior.Receptor.NumeroExterior
End If
If ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.NumeroInterior <> "" Then
ComExt.Receptor.Domicilio.NumeroInterior = ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.NumeroInterior
If ObjCFDITimbre.Complementos.ComercioExterior.Receptor.NumeroInterior <> "" Then
ComExt.Receptor.Domicilio.NumeroInterior = ObjCFDITimbre.Complementos.ComercioExterior.Receptor.NumeroInterior
End If
ComExt.Receptor.Domicilio.Pais = ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.Pais
If ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.Referencia <> "" Then
ComExt.Receptor.Domicilio.Referencia = ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.Referencia
ComExt.Receptor.Domicilio.Pais = ObjCFDITimbre.Complementos.ComercioExterior.Receptor.Pais
If ObjCFDITimbre.Complementos.ComercioExterior.Receptor.Referencia <> "" Then
ComExt.Receptor.Domicilio.Referencia = ObjCFDITimbre.Complementos.ComercioExterior.Receptor.Referencia
End If
'DESTINATARIO
ComExt.Destinatario = New Profact.TimbraCFDI33.Complementos.ComercioExterior11.ComercioExteriorDestinatario(0) {}
ComExt.Destinatario(0) = New Profact.TimbraCFDI33.Complementos.ComercioExterior11.ComercioExteriorDestinatario()
ComExt.Destinatario(0).Nombre = ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.Nombre
If ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.NumRegIdTrib <> "" Then
ComExt.Destinatario(0).NumRegIdTrib = ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.NumRegIdTrib
ComExt.Destinatario(0).Nombre = ObjCFDITimbre.Complementos.ComercioExterior.Destinatario.Nombre
If ObjCFDITimbre.Complementos.ComercioExterior.Destinatario.NumRegIdTrib <> "" Then
ComExt.Destinatario(0).NumRegIdTrib = ObjCFDITimbre.Complementos.ComercioExterior.Destinatario.NumRegIdTrib
End If
ComExt.Destinatario(0).Domicilio = New Profact.TimbraCFDI33.Complementos.ComercioExterior11.ComercioExteriorDestinatarioDomicilio(0) {}
ComExt.Destinatario(0).Domicilio(0) = New Profact.TimbraCFDI33.Complementos.ComercioExterior11.ComercioExteriorDestinatarioDomicilio()
ComExt.Destinatario(0).Domicilio(0).Calle = ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.Calle
ComExt.Destinatario(0).Domicilio(0).CodigoPostal = ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.CP
If ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.Colonia <> "" Then
ComExt.Destinatario(0).Domicilio(0).Colonia = ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.Colonia
ComExt.Destinatario(0).Domicilio(0).Calle = ObjCFDITimbre.Complementos.ComercioExterior.Destinatario.Calle
ComExt.Destinatario(0).Domicilio(0).CodigoPostal = ObjCFDITimbre.Complementos.ComercioExterior.Destinatario.CP
If ObjCFDITimbre.Complementos.ComercioExterior.Destinatario.Colonia <> "" Then
ComExt.Destinatario(0).Domicilio(0).Colonia = ObjCFDITimbre.Complementos.ComercioExterior.Destinatario.Colonia
End If
ComExt.Destinatario(0).Domicilio(0).Estado = ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.Estado
If ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.Localidad <> "" Then
ComExt.Destinatario(0).Domicilio(0).Localidad = ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.Localidad
ComExt.Destinatario(0).Domicilio(0).Estado = ObjCFDITimbre.Complementos.ComercioExterior.Destinatario.Estado
If ObjCFDITimbre.Complementos.ComercioExterior.Destinatario.Localidad <> "" Then
ComExt.Destinatario(0).Domicilio(0).Localidad = ObjCFDITimbre.Complementos.ComercioExterior.Destinatario.Localidad
End If
If ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.Municipio <> "" Then
ComExt.Destinatario(0).Domicilio(0).Municipio = ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.Municipio
If ObjCFDITimbre.Complementos.ComercioExterior.Destinatario.Municipio <> "" Then
ComExt.Destinatario(0).Domicilio(0).Municipio = ObjCFDITimbre.Complementos.ComercioExterior.Destinatario.Municipio
End If
If ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.NumeroExterior <> "" Then
ComExt.Destinatario(0).Domicilio(0).NumeroExterior = ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.NumeroExterior
If ObjCFDITimbre.Complementos.ComercioExterior.Destinatario.NumeroExterior <> "" Then
ComExt.Destinatario(0).Domicilio(0).NumeroExterior = ObjCFDITimbre.Complementos.ComercioExterior.Destinatario.NumeroExterior
End If
If ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.NumeroInterior <> "" Then
ComExt.Destinatario(0).Domicilio(0).NumeroInterior = ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.NumeroInterior
If ObjCFDITimbre.Complementos.ComercioExterior.Destinatario.NumeroInterior <> "" Then
ComExt.Destinatario(0).Domicilio(0).NumeroInterior = ObjCFDITimbre.Complementos.ComercioExterior.Destinatario.NumeroInterior
End If
ComExt.Destinatario(0).Domicilio(0).Pais = ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.Pais
If ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.Referencia <> "" Then
ComExt.Destinatario(0).Domicilio(0).Referencia = ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.Referencia
ComExt.Destinatario(0).Domicilio(0).Pais = ObjCFDITimbre.Complementos.ComercioExterior.Destinatario.Pais
If ObjCFDITimbre.Complementos.ComercioExterior.Destinatario.Referencia <> "" Then
ComExt.Destinatario(0).Domicilio(0).Referencia = ObjCFDITimbre.Complementos.ComercioExterior.Destinatario.Referencia
End If
'MERCANCIAS
If ObjCFDITimbre.Complementos.ComercioExterior11.Mercancias IsNot Nothing AndAlso ObjCFDITimbre.Complementos.ComercioExterior11.Mercancias.Count > 0 Then
ComExt.Mercancias = New Profact.TimbraCFDI33.Complementos.ComercioExterior11.ComercioExteriorMercancia(ObjCFDITimbre.Complementos.ComercioExterior11.Mercancias.Count - 1) {}
If ObjCFDITimbre.Complementos.ComercioExterior.Mercancias IsNot Nothing AndAlso ObjCFDITimbre.Complementos.ComercioExterior.Mercancias.Count > 0 Then
ComExt.Mercancias = New Profact.TimbraCFDI33.Complementos.ComercioExterior11.ComercioExteriorMercancia(ObjCFDITimbre.Complementos.ComercioExterior.Mercancias.Count - 1) {}
Dim i As Integer
For Each concep As CFDIComercioExterior11Mercancias In ObjCFDITimbre.Complementos.ComercioExterior11.Mercancias
For Each concep As CFDIComercioExterior11Mercancias In ObjCFDITimbre.Complementos.ComercioExterior.Mercancias
ComExt.Mercancias(i) = New Profact.TimbraCFDI33.Complementos.ComercioExterior11.ComercioExteriorMercancia()
ComExt.Mercancias(i).NoIdentificacion = concep.NoIdentificacion
ComExt.Mercancias(i).FraccionArancelariaSpecified = True
@@ -1531,7 +1531,6 @@ Public Class Timbrado
If ObjCFDITimbre.Comprobante.TipoComprobante = "P" Then
If ObjCFDITimbre.ComplementoPagos20.ComplementoPagos.Count > 0 Then
Dim Totales As New Profact.TimbraCFDI40.Complementos.Pagos20.PagosTotales() 'Totales Generales
@@ -2461,68 +2460,66 @@ Public Class Timbrado
#Region "Comercio Exterior"
If Ventas.Cliente.AplicaComercioExterior And ObjCFDITimbre.Complementos.ComercioExterior11.AplicaComercioExteriorSubProyecto Then
If ObjCFDITimbre.Complementos.ComercioExterior11 IsNot Nothing Then
If Ventas.Cliente.AplicaComercioExterior And ObjCFDITimbre.Complementos.ComercioExterior.AplicaComercioExteriorSubProyecto Then
If ObjCFDITimbre.Complementos.ComercioExterior IsNot Nothing Then
'DATOS GENERALES
cfdi.ComercioExterior11(ObjCFDITimbre.Complementos.ComercioExterior11.MotivoTraslado,
ObjCFDITimbre.Complementos.ComercioExterior11.TipoOperacion,
ObjCFDITimbre.Complementos.ComercioExterior11.ClavedePedimento,
ObjCFDITimbre.Complementos.ComercioExterior11.CertificadoOrigen,
ObjCFDITimbre.Complementos.ComercioExterior11.NumCertificadoOrigen,
ObjCFDITimbre.Complementos.ComercioExterior11.NumeroExportadorConfiable,
ObjCFDITimbre.Complementos.ComercioExterior11.Incoterm,
ObjCFDITimbre.Complementos.ComercioExterior11.Subdivision,
ObjCFDITimbre.Complementos.ComercioExterior11.Observaciones,
ObjCFDITimbre.Complementos.ComercioExterior11.TipoCambioUSD,
ObjCFDITimbre.Complementos.ComercioExterior11.TotalUSD)
cfdi.ComercioExterior20(ObjCFDITimbre.Complementos.ComercioExterior.MotivoTraslado,
ObjCFDITimbre.Complementos.ComercioExterior.ClavedePedimento,
ObjCFDITimbre.Complementos.ComercioExterior.CertificadoOrigen,
ObjCFDITimbre.Complementos.ComercioExterior.NumCertificadoOrigen,
ObjCFDITimbre.Complementos.ComercioExterior.NumeroExportadorConfiable,
ObjCFDITimbre.Complementos.ComercioExterior.Incoterm,
ObjCFDITimbre.Complementos.ComercioExterior.Observaciones,
ObjCFDITimbre.Complementos.ComercioExterior.TipoCambioUSD,
ObjCFDITimbre.Complementos.ComercioExterior.TotalUSD)
'EMISOR
cfdi.ComercioExterior11Emisor(If(EmisorRFC.Length >= 12, "", ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.CURP))
cfdi.ComercioExterior11Domicilio(ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.Calle,
ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.NumeroExterior,
ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.NumeroInterior,
ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.Colonia,
ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.Localidad,
ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.Referencia,
ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.Municipio,
ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.Estado,
ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.Pais,
ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.CP)
cfdi.ComercioExterior20Emisor(If(EmisorRFC.Length >= 12, "", ObjCFDITimbre.Complementos.ComercioExterior.Emisor.CURP))
cfdi.ComercioExterior20Domicilio(ObjCFDITimbre.Complementos.ComercioExterior.Emisor.Calle,
ObjCFDITimbre.Complementos.ComercioExterior.Emisor.NumeroExterior,
ObjCFDITimbre.Complementos.ComercioExterior.Emisor.NumeroInterior,
ObjCFDITimbre.Complementos.ComercioExterior.Emisor.Colonia,
ObjCFDITimbre.Complementos.ComercioExterior.Emisor.Localidad,
ObjCFDITimbre.Complementos.ComercioExterior.Emisor.Referencia,
ObjCFDITimbre.Complementos.ComercioExterior.Emisor.Municipio,
ObjCFDITimbre.Complementos.ComercioExterior.Emisor.Estado,
ObjCFDITimbre.Complementos.ComercioExterior.Emisor.Pais,
ObjCFDITimbre.Complementos.ComercioExterior.Emisor.CP)
'RECEPTOR
cfdi.ComercioExterior11Receptor(ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.NumRegIdTrib)
cfdi.ComercioExterior11DomicilioReceptor(ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.Calle,
ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.NumeroExterior,
ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.NumeroInterior,
ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.Colonia,
ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.Localidad,
ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.Referencia,
ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.Municipio,
ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.Estado,
ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.Pais,
ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.CP)
cfdi.ComercioExterior20Receptor(ObjCFDITimbre.Complementos.ComercioExterior.Receptor.NumRegIdTrib)
cfdi.ComercioExterior20DomicilioReceptor(ObjCFDITimbre.Complementos.ComercioExterior.Receptor.Calle,
ObjCFDITimbre.Complementos.ComercioExterior.Receptor.NumeroExterior,
ObjCFDITimbre.Complementos.ComercioExterior.Receptor.NumeroInterior,
ObjCFDITimbre.Complementos.ComercioExterior.Receptor.Colonia,
ObjCFDITimbre.Complementos.ComercioExterior.Receptor.Localidad,
ObjCFDITimbre.Complementos.ComercioExterior.Receptor.Referencia,
ObjCFDITimbre.Complementos.ComercioExterior.Receptor.Municipio,
ObjCFDITimbre.Complementos.ComercioExterior.Receptor.Estado,
ObjCFDITimbre.Complementos.ComercioExterior.Receptor.Pais,
ObjCFDITimbre.Complementos.ComercioExterior.Receptor.CP)
If ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario IsNot Nothing Then
cfdi.ComercioExterior11Destinatario(ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.NumRegIdTrib,
ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.Nombre,
ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.Calle,
ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.NumeroExterior,
ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.NumeroInterior,
ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.Colonia,
ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.Localidad,
ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.Referencia,
ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.Municipio,
ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.Estado,
ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.Pais,
ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.CP)
If ObjCFDITimbre.Complementos.ComercioExterior.Destinatario IsNot Nothing Then
cfdi.ComercioExterior20Destinatario(ObjCFDITimbre.Complementos.ComercioExterior.Destinatario.NumRegIdTrib,
ObjCFDITimbre.Complementos.ComercioExterior.Destinatario.Nombre,
ObjCFDITimbre.Complementos.ComercioExterior.Destinatario.Calle,
ObjCFDITimbre.Complementos.ComercioExterior.Destinatario.NumeroExterior,
ObjCFDITimbre.Complementos.ComercioExterior.Destinatario.NumeroInterior,
ObjCFDITimbre.Complementos.ComercioExterior.Destinatario.Colonia,
ObjCFDITimbre.Complementos.ComercioExterior.Destinatario.Localidad,
ObjCFDITimbre.Complementos.ComercioExterior.Destinatario.Referencia,
ObjCFDITimbre.Complementos.ComercioExterior.Destinatario.Municipio,
ObjCFDITimbre.Complementos.ComercioExterior.Destinatario.Estado,
ObjCFDITimbre.Complementos.ComercioExterior.Destinatario.Pais,
ObjCFDITimbre.Complementos.ComercioExterior.Destinatario.CP)
End If
'MERCANCIAS
If ObjCFDITimbre.Complementos.ComercioExterior11.Mercancias IsNot Nothing AndAlso ObjCFDITimbre.Complementos.ComercioExterior11.Mercancias.Count > 0 Then
For Each concep As CFDIComercioExterior11Mercancias In ObjCFDITimbre.Complementos.ComercioExterior11.Mercancias
cfdi.ComercioExterior11Mercancia(concep.NoIdentificacion, concep.FraccionArancelaria, concep.CantidadAduana, concep.UnidadAduana, concep.ValorUnitarioAduana, concep.ValorDolares)
If ObjCFDITimbre.Complementos.ComercioExterior.Mercancias IsNot Nothing AndAlso ObjCFDITimbre.Complementos.ComercioExterior.Mercancias.Count > 0 Then
For Each concep As CFDIComercioExterior11Mercancias In ObjCFDITimbre.Complementos.ComercioExterior.Mercancias
cfdi.ComercioExterior20Mercancia(concep.NoIdentificacion, concep.FraccionArancelaria, concep.CantidadAduana, concep.UnidadAduana, concep.ValorUnitarioAduana, concep.ValorDolares)
If concep.DescripcionesEspecificas.Marca <> "" Then
cfdi.ComercioExterior11MercanciaDescripcionesEspeciales(concep.DescripcionesEspecificas.Marca,
cfdi.ComercioExterior20MercanciaDescripcionesEspeciales(concep.DescripcionesEspecificas.Marca,
concep.DescripcionesEspecificas.Modelo,
concep.DescripcionesEspecificas.SubModelo,
concep.DescripcionesEspecificas.NumeroSerie)
@@ -2545,140 +2542,144 @@ Public Class Timbrado
#Region "C O M P L E M E N T O C A R T A P O R T E"
'If UsuarioActual.CveEmpresa = 13 Then
' If ObjCFDITimbre.Complementos.CartaPorte IsNot Nothing Then
'If ObjCFDITimbre.Complementos.CartaPorte IsNot Nothing Then
' Dim Carta As CFDICartaPorte = ObjCFDITimbre.Complementos.CartaPorte
' Dim Carta As CFDICartaPorte = ObjCFDITimbre.Complementos.CartaPorte
' ''DATOS GENERALES
' cfdi.CartaPorte(Carta.TranspInternac, Carta.EntradaSalidaMercancia, "", Carta.ViaEntradaSalida, Carta.TotalDistanciaRecorrida)
' 'cfdi.CartaPorte30("", Carta.TranspInternac, Carta.RegimenAduanero, Carta.EntradaSalidaMercancia, "", Carta.ViaEntradaSalida, Carta.TotalDistanciaRecorrida, Carta.RegistroITSMO, Carta.UbicacionPoloOrigen, Carta.UbicacionPoloDestino)
' ''DATOS GENERALES
' cfdi.CartaPorte(Carta.TranspInternac, Carta.EntradaSalidaMercancia, "", Carta.ViaEntradaSalida, Carta.TotalDistanciaRecorrida)
' 'cfdi.CartaPorte30("", Carta.TranspInternac, Carta.RegimenAduanero, Carta.EntradaSalidaMercancia, "", Carta.ViaEntradaSalida, Carta.TotalDistanciaRecorrida, Carta.RegistroITSMO, Carta.UbicacionPoloOrigen, Carta.UbicacionPoloDestino)
' 'UBICACIONES
' If Carta.Ubicaciones IsNot Nothing AndAlso Carta.Ubicaciones.Count > 0 Then
' For Each ubica As CFDICartaPorteUbicacion In Carta.Ubicaciones
' 'origen
' cfdi.CartaPorteUbicacion(ubica.TipoUbicacion, ubica.IDUbicacion, ubica.RFCRemitenteDestinatario, ubica.NombreRemitenteDestinatario, ubica.NumRegIdTrib, ubica.ResidenciaFiscal, ubica.NumEstacion, ubica.NombreEstacion, ubica.NavegacionTrafico, ubica.FechaHoraSalidaLlegada, ubica.TipoEstacion, ubica.DistanciaRecorrida)
' 'cfdi.CartaPorteOrigen(ubica.Origen.IDOrigen, ubica.Origen.RFCRemitente, ubica.Origen.NombreRemitente, ubica.NumRegIdTrib, ubica.Origen.ResidenciaFiscal, ubica.Origen.NumEstacion, ubica.Origen.NombreEstacion, ubica.Origen.NavegacionTrafico, ubica.Origen.FechaHoraSalida)
' cfdi.CartaPorteDomicilio(ubica.Domicilio.Calle, ubica.Domicilio.NumeroExterior, ubica.Domicilio.NumeroInterior, ubica.Domicilio.Colonia, ubica.Domicilio.Localidad, ubica.Domicilio.Referencia, ubica.Domicilio.Municipio, ubica.Domicilio.Estado, ubica.Domicilio.Pais, ubica.Domicilio.CP)
' Next
' End If
' 'MERCANCIAS
' If Carta.Mercancias IsNot Nothing Then
' cfdi.CartaPorteMercancias(Carta.Mercancias.PesoBrutoTotal, Carta.Mercancias.UnidadPeso, Carta.Mercancias.PesoNetoTotal, Carta.Mercancias.NumTotalMercancias, Carta.Mercancias.CargoporTasacion)
' If Carta.Mercancias IsNot Nothing AndAlso Carta.Mercancias.Mercancias.Count > 0 Then
' For Each concep As CFDICartaPorteMercancia In Carta.Mercancias.Mercancias
' If concep.ValorMercancia <= 0 Then concep.Moneda = ""
' cfdi.CartaPorteMercancia(concep.BienesTransp, concep.ClaveSTCC, concep.Descripción, concep.Cantidad, concep.ClaveUnidad, concep.Unidad, concep.Dimensiones, concep.MaterialPeligroso, concep.ClaveMaterialPeligroso, If(concep.ClaveMaterialPeligroso <> "", concep.Embalaje, ""), If(concep.ClaveMaterialPeligroso <> "", concep.DescripEmbalaje, ""), concep.PesoenKg, concep.ValorMercancia, concep.Moneda, concep.FraccionArrancelaria, concep.UUIDComercioExt)
' For Each transp As CFDICartaPorteMercanciaTransporta In concep.MercanciasCantidadTransporta
' cfdi.CartaPorteCantidadTransporta(transp.Cantidad, transp.IDOrigen, transp.IDDestino, transp.CvesTransportes)
' Next
' 'UBICACIONES
' If Carta.Ubicaciones IsNot Nothing AndAlso Carta.Ubicaciones.Count > 0 Then
' For Each ubica As CFDICartaPorteUbicacion In Carta.Ubicaciones
' 'origen
' cfdi.CartaPorteUbicacion(ubica.TipoUbicacion, ubica.IDUbicacion, ubica.RFCRemitenteDestinatario, ubica.NombreRemitenteDestinatario, ubica.NumRegIdTrib, ubica.ResidenciaFiscal, ubica.NumEstacion, ubica.NombreEstacion, ubica.NavegacionTrafico, ubica.FechaHoraSalidaLlegada, ubica.TipoEstacion, ubica.DistanciaRecorrida)
' 'cfdi.CartaPorteOrigen(ubica.Origen.IDOrigen, ubica.Origen.RFCRemitente, ubica.Origen.NombreRemitente, ubica.NumRegIdTrib, ubica.Origen.ResidenciaFiscal, ubica.Origen.NumEstacion, ubica.Origen.NombreEstacion, ubica.Origen.NavegacionTrafico, ubica.Origen.FechaHoraSalida)
' cfdi.CartaPorteDomicilio(ubica.Domicilio.Calle, ubica.Domicilio.NumeroExterior, ubica.Domicilio.NumeroInterior, ubica.Domicilio.Colonia, ubica.Domicilio.Localidad, ubica.Domicilio.Referencia, ubica.Domicilio.Municipio, ubica.Domicilio.Estado, ubica.Domicilio.Pais, ubica.Domicilio.CP)
' Next
' End If
' End If
' '
' If Carta.FiguraTransporte IsNot Nothing Then
' If Carta.FiguraTransporte.AutoTransporte IsNot Nothing Then
' cfdi.CartaPorteAutotransporte(Carta.FiguraTransporte.AutoTransporte.PermisoSCT, Carta.FiguraTransporte.AutoTransporte.NumPermisoSCT)
' cfdi.CartaPorteIdentificacionVehicular(Carta.FiguraTransporte.AutoTransporte.Vehiculo.ConfigVehicular, Carta.FiguraTransporte.AutoTransporte.Vehiculo.PlacaVM, Carta.FiguraTransporte.AutoTransporte.Vehiculo.AnioModeloVM)
' cfdi.CartaPorteSeguros(Carta.FiguraTransporte.AutoTransporte.NombreSeguroResponsabilidadCivil, Carta.FiguraTransporte.AutoTransporte.PolizaSeguroResponsabilidadCivil,
' Carta.FiguraTransporte.AutoTransporte.NombreSeguroMedioAmbiente, Carta.FiguraTransporte.AutoTransporte.PolizaSeguroMedioAmbiente,
' Carta.FiguraTransporte.AutoTransporte.NombreSeguroCarga, Carta.FiguraTransporte.AutoTransporte.PolizaSeguroCarga,
' Carta.FiguraTransporte.AutoTransporte.PrimaSeguro)
' If Carta.FiguraTransporte.AutoTransporte.Remolques IsNot Nothing AndAlso Carta.FiguraTransporte.AutoTransporte.Remolques.Count > 0 Then
' For Each concep As CFDICartaPorteRemolque In Carta.FiguraTransporte.AutoTransporte.Remolques
' cfdi.CartaPorteRemolque(concep.SubTipoRemolque, concep.Placa)
' 'MERCANCIAS
' If Carta.Mercancias IsNot Nothing Then
' cfdi.CartaPorteMercancias(Carta.Mercancias.PesoBrutoTotal, Carta.Mercancias.UnidadPeso, Carta.Mercancias.PesoNetoTotal, Carta.Mercancias.NumTotalMercancias, Carta.Mercancias.CargoporTasacion)
' If Carta.Mercancias IsNot Nothing AndAlso Carta.Mercancias.Mercancias.Count > 0 Then
' For Each concep As CFDICartaPorteMercancia In Carta.Mercancias.Mercancias
' If concep.ValorMercancia <= 0 Then concep.Moneda = ""
' cfdi.CartaPorteMercancia(concep.BienesTransp, concep.ClaveSTCC, concep.Descripción, concep.Cantidad, concep.ClaveUnidad, concep.Unidad, concep.Dimensiones, concep.MaterialPeligroso, concep.ClaveMaterialPeligroso, If(concep.ClaveMaterialPeligroso <> "", concep.Embalaje, ""), If(concep.ClaveMaterialPeligroso <> "", concep.DescripEmbalaje, ""), concep.PesoenKg, concep.ValorMercancia, concep.Moneda, concep.FraccionArrancelaria, concep.UUIDComercioExt)
' For Each transp As CFDICartaPorteMercanciaTransporta In concep.MercanciasCantidadTransporta
' cfdi.CartaPorteCantidadTransporta(transp.Cantidad, transp.IDOrigen, transp.IDDestino, transp.CvesTransportes)
' Next
' Next
' End If
' End If
' '
' If Carta.FiguraTransporte IsNot Nothing Then
' If Carta.FiguraTransporte.AutoTransporte IsNot Nothing Then
' cfdi.CartaPorteAutotransporte(Carta.FiguraTransporte.AutoTransporte.PermisoSCT, Carta.FiguraTransporte.AutoTransporte.NumPermisoSCT)
' cfdi.CartaPorteIdentificacionVehicular(Carta.FiguraTransporte.AutoTransporte.Vehiculo.ConfigVehicular, Carta.FiguraTransporte.AutoTransporte.Vehiculo.PlacaVM, Carta.FiguraTransporte.AutoTransporte.Vehiculo.AnioModeloVM)
' cfdi.CartaPorteSeguros(Carta.FiguraTransporte.AutoTransporte.NombreSeguroResponsabilidadCivil, Carta.FiguraTransporte.AutoTransporte.PolizaSeguroResponsabilidadCivil,
' Carta.FiguraTransporte.AutoTransporte.NombreSeguroMedioAmbiente, Carta.FiguraTransporte.AutoTransporte.PolizaSeguroMedioAmbiente,
' Carta.FiguraTransporte.AutoTransporte.NombreSeguroCarga, Carta.FiguraTransporte.AutoTransporte.PolizaSeguroCarga,
' Carta.FiguraTransporte.AutoTransporte.PrimaSeguro)
' If Carta.FiguraTransporte.AutoTransporte.Remolques IsNot Nothing AndAlso Carta.FiguraTransporte.AutoTransporte.Remolques.Count > 0 Then
' For Each concep As CFDICartaPorteRemolque In Carta.FiguraTransporte.AutoTransporte.Remolques
' cfdi.CartaPorteRemolque(concep.SubTipoRemolque, concep.Placa)
' Next
' If Carta.FiguraTransporte.Operadores IsNot Nothing AndAlso Carta.FiguraTransporte.Operadores.Count > 0 Then
' For Each concep As CFDICartaPorteOperador In Carta.FiguraTransporte.Operadores
' cfdi.CartaPorteTiposFigura(concep.TipoFigura, concep.RFCFigura, concep.NumLicencia, concep.NombreFigura, concep.NumRegidTribFigura, If(concep.ResidenciaFiscalFigura <> "MEX", concep.ResidenciaFiscalFigura, ""))
' If concep.TipoFigura.Contiene("02", "03") Then ' “02”- Propietario o “03” -Arrendador
' cfdi.CartaPortePartesTransporte("PT01")
' cfdi.CartaPortePartesTransporteDomicilio(concep.Domicilio.Calle, concep.Domicilio.NumeroExterior, concep.Domicilio.NumeroInterior, concep.Domicilio.Colonia, concep.Domicilio.Localidad, concep.Domicilio.Referencia, concep.Domicilio.Municipio, concep.Domicilio.Estado, concep.Domicilio.Pais, concep.Domicilio.CP)
' End If
' Next
' End If
' If Carta.FiguraTransporte.Operadores IsNot Nothing AndAlso Carta.FiguraTransporte.Operadores.Count > 0 Then
' For Each concep As CFDICartaPorteOperador In Carta.FiguraTransporte.Operadores
' cfdi.CartaPorteTiposFigura(concep.TipoFigura, concep.RFCFigura, concep.NumLicencia, concep.NombreFigura, concep.NumRegidTribFigura, If(concep.ResidenciaFiscalFigura <> "MEX", concep.ResidenciaFiscalFigura, ""))
' If concep.TipoFigura.Contiene("02", "03") Then ' “02”- Propietario o “03” -Arrendador
' cfdi.CartaPortePartesTransporte("PT01")
' cfdi.CartaPortePartesTransporteDomicilio(concep.Domicilio.Calle, concep.Domicilio.NumeroExterior, concep.Domicilio.NumeroInterior, concep.Domicilio.Colonia, concep.Domicilio.Localidad, concep.Domicilio.Referencia, concep.Domicilio.Municipio, concep.Domicilio.Estado, concep.Domicilio.Pais, concep.Domicilio.CP)
' End If
' Next
' End If
' End If
' End If
'Else
'End If
If ObjCFDITimbre.Complementos.CartaPorte IsNot Nothing Then
Dim Carta As CFDICartaPorte = ObjCFDITimbre.Complementos.CartaPorte
Dim Carta As CFDICartaPorte = ObjCFDITimbre.Complementos.CartaPorte
''DATOS GENERALES
cfdi.CartaPorte30("", Carta.TranspInternac, Carta.RegimenAduanero, Carta.EntradaSalidaMercancia, "", Carta.ViaEntradaSalida, Carta.TotalDistanciaRecorrida, Carta.RegistroISTMO, Carta.UbicacionPoloOrigen, Carta.UbicacionPoloDestino)
''DATOS GENERALES
cfdi.CartaPorte30("", Carta.TranspInternac, Carta.RegimenAduanero, Carta.EntradaSalidaMercancia, "", Carta.ViaEntradaSalida, Carta.TotalDistanciaRecorrida, Carta.RegistroISTMO, Carta.UbicacionPoloOrigen, Carta.UbicacionPoloDestino)
'UBICACIONES
If Carta.Ubicaciones IsNot Nothing AndAlso Carta.Ubicaciones.Count > 0 Then
For Each ubica As CFDICartaPorteUbicacion In Carta.Ubicaciones
'origen
cfdi.CartaPorte30Ubicacion(ubica.TipoUbicacion, ubica.IDUbicacion, ubica.RFCRemitenteDestinatario, ubica.NombreRemitenteDestinatario, ubica.NumRegIdTrib, ubica.ResidenciaFiscal, ubica.NumEstacion, ubica.NombreEstacion, ubica.NavegacionTrafico, ubica.FechaHoraSalidaLlegada, ubica.TipoEstacion, ubica.DistanciaRecorrida)
'cfdi.CartaPorteOrigen(ubica.Origen.IDOrigen, ubica.Origen.RFCRemitente, ubica.Origen.NombreRemitente, ubica.NumRegIdTrib, ubica.Origen.ResidenciaFiscal, ubica.Origen.NumEstacion, ubica.Origen.NombreEstacion, ubica.Origen.NavegacionTrafico, ubica.Origen.FechaHoraSalida)
cfdi.CartaPorte30Domicilio(ubica.Domicilio.Calle, ubica.Domicilio.NumeroExterior, ubica.Domicilio.NumeroInterior, ubica.Domicilio.Colonia, ubica.Domicilio.Localidad, ubica.Domicilio.Referencia, ubica.Domicilio.Municipio, ubica.Domicilio.Estado, ubica.Domicilio.Pais, ubica.Domicilio.CP)
Next
End If
'MERCANCIAS
If Carta.Mercancias IsNot Nothing Then
cfdi.CartaPorte30Mercancias(Carta.Mercancias.PesoBrutoTotal, Carta.Mercancias.UnidadPeso, Carta.Mercancias.PesoNetoTotal, Carta.Mercancias.NumTotalMercancias, Carta.Mercancias.CargoporTasacion, Carta.Mercancias.LogisticaInversaRecoleccionDevolucion)
If Carta.Mercancias IsNot Nothing AndAlso Carta.Mercancias.Mercancias.Count > 0 Then
For Each concep As CFDICartaPorteMercancia In Carta.Mercancias.Mercancias
If concep.ValorMercancia <= 0 Then concep.Moneda = ""
cfdi.CartaPorte30Mercancia(concep.BienesTransp, concep.ClaveSTCC, concep.Descripción, concep.Cantidad, concep.ClaveUnidad, concep.Unidad, concep.Dimensiones, concep.MaterialPeligroso, concep.ClaveMaterialPeligroso, If(concep.ClaveMaterialPeligroso <> "", concep.Embalaje, ""), If(concep.ClaveMaterialPeligroso <> "", concep.DescripEmbalaje, ""),
concep.SectorCOFEPRIS, concep.NombreIngredienteActivo, concep.NomQuimico, concep.DenominacionGenericaProd, concep.DenominacionDistintivaProd, concep.Fabricante, concep.FechaCaducidad, concep.LoteMedicamento, concep.FormaFarmaceutica, concep.CondicionesEspTransp, concep.RegistroSanitarioFolioAutorizacion,
If(Carta.TranspInternac <> "No", concep.PermisoImportacion, ""), If(Carta.TranspInternac <> "No", concep.FolioImpoVUCEM, ""), concep.NumCAS, If(Carta.TranspInternac <> "No", concep.RazonSocialEmpImp, ""), concep.NumRegSanPlagCOFEPRIS, concep.DatosFabricante, concep.DatosFormulador, concep.DatosMaquilador, concep.UsoAutorizado,
concep.PesoenKg, concep.ValorMercancia, concep.Moneda, concep.FraccionArrancelaria, concep.UUIDComercioExt)
For Each transp As CFDICartaPorteMercanciaTransporta In concep.MercanciasCantidadTransporta
cfdi.CartaPorte30CantidadTransporta(transp.Cantidad, transp.IDOrigen, transp.IDDestino, transp.CvesTransportes)
Next
'UBICACIONES
If Carta.Ubicaciones IsNot Nothing AndAlso Carta.Ubicaciones.Count > 0 Then
For Each ubica As CFDICartaPorteUbicacion In Carta.Ubicaciones
'origen
cfdi.CartaPorte30Ubicacion(ubica.TipoUbicacion, ubica.IDUbicacion, ubica.RFCRemitenteDestinatario, ubica.NombreRemitenteDestinatario, ubica.NumRegIdTrib, ubica.ResidenciaFiscal, ubica.NumEstacion, ubica.NombreEstacion, ubica.NavegacionTrafico, ubica.FechaHoraSalidaLlegada, ubica.TipoEstacion, ubica.DistanciaRecorrida)
'cfdi.CartaPorteOrigen(ubica.Origen.IDOrigen, ubica.Origen.RFCRemitente, ubica.Origen.NombreRemitente, ubica.NumRegIdTrib, ubica.Origen.ResidenciaFiscal, ubica.Origen.NumEstacion, ubica.Origen.NombreEstacion, ubica.Origen.NavegacionTrafico, ubica.Origen.FechaHoraSalida)
cfdi.CartaPorte30Domicilio(ubica.Domicilio.Calle, ubica.Domicilio.NumeroExterior, ubica.Domicilio.NumeroInterior, ubica.Domicilio.Colonia, ubica.Domicilio.Localidad, ubica.Domicilio.Referencia, ubica.Domicilio.Municipio, ubica.Domicilio.Estado, ubica.Domicilio.Pais, ubica.Domicilio.CP)
Next
End If
End If
'
If Carta.FiguraTransporte IsNot Nothing Then
If Carta.FiguraTransporte.AutoTransporte IsNot Nothing Then
cfdi.CartaPorte30Autotransporte(Carta.FiguraTransporte.AutoTransporte.PermisoSCT, Carta.FiguraTransporte.AutoTransporte.NumPermisoSCT)
cfdi.CartaPorte30IdentificacionVehicular(Carta.FiguraTransporte.AutoTransporte.Vehiculo.ConfigVehicular, Carta.FiguraTransporte.AutoTransporte.Vehiculo.PesoBrutoVehicular, Carta.FiguraTransporte.AutoTransporte.Vehiculo.PlacaVM, Carta.FiguraTransporte.AutoTransporte.Vehiculo.AnioModeloVM)
cfdi.CartaPorte30Seguros(Carta.FiguraTransporte.AutoTransporte.NombreSeguroResponsabilidadCivil, Carta.FiguraTransporte.AutoTransporte.PolizaSeguroResponsabilidadCivil,
Carta.FiguraTransporte.AutoTransporte.NombreSeguroMedioAmbiente, Carta.FiguraTransporte.AutoTransporte.PolizaSeguroMedioAmbiente,
Carta.FiguraTransporte.AutoTransporte.NombreSeguroCarga, Carta.FiguraTransporte.AutoTransporte.PolizaSeguroCarga,
Carta.FiguraTransporte.AutoTransporte.PrimaSeguro)
If Carta.FiguraTransporte.AutoTransporte.Remolques IsNot Nothing AndAlso Carta.FiguraTransporte.AutoTransporte.Remolques.Count > 0 Then
For Each concep As CFDICartaPorteRemolque In Carta.FiguraTransporte.AutoTransporte.Remolques
cfdi.CartaPorte30Remolque(concep.SubTipoRemolque, concep.Placa)
'MERCANCIAS
If Carta.Mercancias IsNot Nothing Then
cfdi.CartaPorte30Mercancias(Carta.Mercancias.PesoBrutoTotal, Carta.Mercancias.UnidadPeso, Carta.Mercancias.PesoNetoTotal, Carta.Mercancias.NumTotalMercancias, Carta.Mercancias.CargoporTasacion, Carta.Mercancias.LogisticaInversaRecoleccionDevolucion)
If Carta.Mercancias IsNot Nothing AndAlso Carta.Mercancias.Mercancias.Count > 0 Then
For Each concep As CFDICartaPorteMercancia In Carta.Mercancias.Mercancias
If concep.ValorMercancia <= 0 Then concep.Moneda = ""
cfdi.CartaPorte30Mercancia(concep.BienesTransp, concep.ClaveSTCC, concep.Descripción, concep.Cantidad, concep.ClaveUnidad, concep.Unidad, concep.Dimensiones, concep.MaterialPeligroso, concep.ClaveMaterialPeligroso, If(concep.ClaveMaterialPeligroso <> "", concep.Embalaje, ""), If(concep.ClaveMaterialPeligroso <> "", concep.DescripEmbalaje, ""),
concep.SectorCOFEPRIS, concep.NombreIngredienteActivo, concep.NomQuimico, concep.DenominacionGenericaProd, concep.DenominacionDistintivaProd, concep.Fabricante, concep.FechaCaducidad, concep.LoteMedicamento, concep.FormaFarmaceutica, concep.CondicionesEspTransp, concep.RegistroSanitarioFolioAutorizacion,
If(Carta.TranspInternac <> "No", concep.PermisoImportacion, ""), If(Carta.TranspInternac <> "No", concep.FolioImpoVUCEM, ""), concep.NumCAS, If(Carta.TranspInternac <> "No", concep.RazonSocialEmpImp, ""), concep.NumRegSanPlagCOFEPRIS, concep.DatosFabricante, concep.DatosFormulador, concep.DatosMaquilador, concep.UsoAutorizado,
concep.PesoenKg, concep.ValorMercancia, concep.Moneda, concep.FraccionArrancelaria, concep.UUIDComercioExt)
For Each transp As CFDICartaPorteMercanciaTransporta In concep.MercanciasCantidadTransporta
cfdi.CartaPorte30CantidadTransporta(transp.Cantidad, transp.IDOrigen, transp.IDDestino, transp.CvesTransportes)
Next
Next
End If
End If
'
If Carta.FiguraTransporte IsNot Nothing Then
If Carta.FiguraTransporte.Operadores IsNot Nothing AndAlso Carta.FiguraTransporte.Operadores.Count > 0 Then
For Each concep As CFDICartaPorteOperador In Carta.FiguraTransporte.Operadores
cfdi.CartaPorte30TiposFigura(concep.TipoFigura, concep.RFCFigura, concep.NumLicencia, concep.NombreFigura, concep.NumRegidTribFigura, If(concep.ResidenciaFiscalFigura <> "MEX", concep.ResidenciaFiscalFigura, ""))
If concep.TipoFigura.Contiene("02", "03") Then ' “02”- Propietario o “03” -Arrendador
cfdi.CartaPorte30PartesTransporte("PT01")
cfdi.CartaPorte30PartesTransporteDomicilio(concep.Domicilio.Calle, concep.Domicilio.NumeroExterior, concep.Domicilio.NumeroInterior, concep.Domicilio.Colonia, concep.Domicilio.Localidad, concep.Domicilio.Referencia, concep.Domicilio.Municipio, concep.Domicilio.Estado, concep.Domicilio.Pais, concep.Domicilio.CP)
If Carta.FiguraTransporte.AutoTransporte IsNot Nothing Then
cfdi.CartaPorte30Autotransporte(Carta.FiguraTransporte.AutoTransporte.PermisoSCT, Carta.FiguraTransporte.AutoTransporte.NumPermisoSCT)
cfdi.CartaPorte30IdentificacionVehicular(Carta.FiguraTransporte.AutoTransporte.Vehiculo.ConfigVehicular, Carta.FiguraTransporte.AutoTransporte.Vehiculo.PesoBrutoVehicular, Carta.FiguraTransporte.AutoTransporte.Vehiculo.PlacaVM, Carta.FiguraTransporte.AutoTransporte.Vehiculo.AnioModeloVM)
cfdi.CartaPorte30Seguros(Carta.FiguraTransporte.AutoTransporte.NombreSeguroResponsabilidadCivil, Carta.FiguraTransporte.AutoTransporte.PolizaSeguroResponsabilidadCivil,
Carta.FiguraTransporte.AutoTransporte.NombreSeguroMedioAmbiente, Carta.FiguraTransporte.AutoTransporte.PolizaSeguroMedioAmbiente,
Carta.FiguraTransporte.AutoTransporte.NombreSeguroCarga, Carta.FiguraTransporte.AutoTransporte.PolizaSeguroCarga,
Carta.FiguraTransporte.AutoTransporte.PrimaSeguro)
If Carta.FiguraTransporte.AutoTransporte.Remolques IsNot Nothing AndAlso Carta.FiguraTransporte.AutoTransporte.Remolques.Count > 0 Then
For Each concep As CFDICartaPorteRemolque In Carta.FiguraTransporte.AutoTransporte.Remolques
cfdi.CartaPorte30Remolque(concep.SubTipoRemolque, concep.Placa)
Next
End If
Next
End If
If Carta.FiguraTransporte.Operadores IsNot Nothing AndAlso Carta.FiguraTransporte.Operadores.Count > 0 Then
For Each concep As CFDICartaPorteOperador In Carta.FiguraTransporte.Operadores
cfdi.CartaPorte30TiposFigura(concep.TipoFigura, concep.RFCFigura, concep.NumLicencia, concep.NombreFigura, concep.NumRegidTribFigura, If(concep.ResidenciaFiscalFigura <> "MEX", concep.ResidenciaFiscalFigura, ""))
If concep.TipoFigura.Contiene("02", "03") Then ' “02”- Propietario o “03” -Arrendador
cfdi.CartaPorte30PartesTransporte("PT01")
cfdi.CartaPorte30PartesTransporteDomicilio(concep.Domicilio.Calle, concep.Domicilio.NumeroExterior, concep.Domicilio.NumeroInterior, concep.Domicilio.Colonia, concep.Domicilio.Localidad, concep.Domicilio.Referencia, concep.Domicilio.Municipio, concep.Domicilio.Estado, concep.Domicilio.Pais, concep.Domicilio.CP)
End If
Next
End If
End If
End If
End If
'End If
#End Region

View File

@@ -6,6 +6,7 @@ Imports System.IO
Imports Extensiones
Imports Microsoft.Reporting.WebForms
Imports Newtonsoft.Json
Imports System.Net.Http
Public Class SIGDesc : Implements IHttpHandler, IRequiresSessionState
@@ -35,11 +36,47 @@ Public Class SIGDesc : Implements IHttpHandler, IRequiresSessionState
context.Response.Flush()
context.Response.WriteFile(FileInfo.FullName)
context.Response.End()
Else
DescargarPDFVentaPeticion(context, ObjFactura)
End If
FileInfo = Nothing
End If
End Sub
Private Sub DescargarPDFVentaPeticion(ByVal context As HttpContext, ObjFactura As Modelos.Factura)
Dim usuario As Usuario = UsuarioActual(context)
If Not IsNothing(usuario) Then
Dim strURLHOST = String.Format("{0}://{1}:{2}", HttpContext.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port)
Dim Url As New Uri(String.Format("{0}/Compras/PopUpVerFactura.aspx?P={1}", strURLHOST, Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1&REGENERAR={1}", ObjFactura.CveVenta, "1"))))
Dim File As Byte() = Nothing
Try
Using httpClient As New HttpClient()
httpClient.Timeout = New TimeSpan(0, 1, 0)
Using request As New HttpRequestMessage(HttpMethod.Get, Url)
request.Headers.Add("ADSToken", Encripta(String.Format("CVEEMPRESA={0}&TICKS={1}&CveUsuario={2}", ObjFactura.CveEmpresa, DateTime.UtcNow.Ticks, ObjFactura.CveUsuario)))
Dim response = httpClient.SendAsync(request).Result
If response.StatusCode = Net.HttpStatusCode.OK Then
File = response.Content.ReadAsByteArrayAsync().Result
End If
End Using
End Using
Catch ex As Exception
File = Nothing
OnError("Ocurrió un error al descargar la factura", ex)
End Try
context.Response.Buffer = True
context.Response.Clear()
context.Response.ContentType = "application/pdf"
context.Response.ClearHeaders()
context.Response.AddHeader("content-disposition", String.Format("{0}; filename=""{1}.{2}""", "attachment", ObjFactura.SerieFolio, "pdf"))
context.Response.BinaryWrite(File) ' create the file
context.Response.End()
End If
End Sub
Public ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable
Get
Return False

View File

@@ -223,6 +223,7 @@ Partial Class Bancos_ConciliacionesBancariasaspx
Protected Sub LnkConciliarManual_Click(sender As Object, e As EventArgs)
ModalidadConciliacion = "M"
If DdlCriterio.Items.FindByValue("2") Is Nothing Then DdlCriterio.Items.Add(New ListItem("Importe - Tipo Movimiento", "2"))
DdlCriterio.SelectedIndex = 0
DivCriterio.Visible = True
TxtFechaAplicado.Text = txtFechaI.Text
@@ -323,7 +324,7 @@ Partial Class Bancos_ConciliacionesBancariasaspx
End Sub
Protected Sub LnlConciliarAutomaticamente_Click(sender As Object, e As EventArgs)
ModalidadConciliacion = "A"
DdlCriterio.SelectedIndex = 0
DdlCriterio.Items.Remove(DdlCriterio.Items.FindByValue("2"))
DivCriterio.Visible = True
TxtFechaAplicado.Text = txtFechaI.Text
UpModalCriterio.Update()

Binary file not shown.

View File

@@ -2,11 +2,13 @@
Option Explicit On
Imports System.Data
Imports System.Data.Entity.Core.Metadata.Edm
Imports System.IO
Imports System.Xml
Imports Extensiones
Imports iText.Barcodes.Dmcode
Imports Microsoft.Reporting.WebForms
Imports Modelos
Partial Class PopUpVerFactura
@@ -3361,13 +3363,24 @@ Partial Class PopUpVerFactura
Dim CveCliente As Integer = 0
Dim CveDireccionEnvio As Integer = 0
Dim ClienteNombre As String = "", EnvioContacto As String = "", EnvioDireccion As String = "", EnvioColonia As String = "", EnvioCiudad As String = "", EnvioEstado As String = "", ClientePais As String = "", EnvioCP As String = "", Contrato As String = "",
Paqueteria As String = "", NumContrato As String = "", Guia As String = ""
Paqueteria As String = "", NumContrato As String = "", Guia As String = "", Documentacion As String = ""
Dim CveContrato As Integer = 0
If DtMovimientos IsNot Nothing AndAlso DtMovimientos.Rows.Count > 0 Then
CveContrato = DtMovimientos.FiltroPrimeroValor("CveContrato").ToEntero
End If
If UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then
CveCliente = DtMovimientos.FiltroPrimeroValor("CveCliente").ToEntero
DTCliente = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltraParametros($"CveCliente = {CveCliente}")
params.Add(New ReportParameter("Documentacion", DTCliente.FiltroPrimeroValor("Documentacion")))
If CveCliente = 819998 Then
RutaFormato = "{0}Formatos\TrasladoAngeles.rdlc"
End If
End If
If CveContrato > 0 Then
Contrato = GlobalDTContratos(UsuarioActual.CveEmpresa).FiltroPrimeroValor("DescripcionContrato", $"CveContrato={CveContrato} AND CveEmpresa = {UsuarioActual.CveEmpresa}")
NumContrato = GlobalDTContratos(UsuarioActual.CveEmpresa).FiltroPrimeroValor("NumeroContrato", $"CveContrato={CveContrato} AND CveEmpresa = {UsuarioActual.CveEmpresa}")
@@ -3387,6 +3400,8 @@ Partial Class PopUpVerFactura
EnvioCiudad = ObjVentas.DtResultados.Rows(0)("EnvioCiudad").ToString
EnvioCP = ObjVentas.DtResultados.Rows(0)("EnvioCP").ToString
EnvioEstado = ObjVentas.DtResultados.Rows(0)("EnvioEstado").ToString
Else
ClienteNombre = DTCliente.FiltroPrimeroValor("Nombre")
EnvioContacto = DTCliente.FiltroPrimeroValor("Contacto")
@@ -3401,6 +3416,8 @@ Partial Class PopUpVerFactura
ObjVentas.Dispose()
End If
params.Add(New ReportParameter("ClienteNombre", ClienteNombre))
params.Add(New ReportParameter("EnvioContacto", EnvioContacto))
params.Add(New ReportParameter("EnvioDireccion", EnvioDireccion))
@@ -3524,6 +3541,16 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("NombreAccion", Recibio)) 'TxtResponsable.Text
params.Add(New ReportParameter("Accion", "RECIBIÓ"))
If UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then
Dim CveCliente = DtMovimientos.FiltroPrimeroValor("CveCliente").ToEntero
Dim DTCliente = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltraParametros($"CveCliente = {CveCliente}")
params.Add(New ReportParameter("Documentacion", DTCliente.FiltroPrimeroValor("Documentacion")))
'If CveCliente = 819998 Then
' RutaFormato = "{0}Formatos\TrasladoAngeles.rdlc"
'End If
End If
If Archivo.Exists Then
params.Add(New ReportParameter("CveAlmacen", DtMovimientos(0)("CveTipoAlmacen").ToString))
params.Add(New ReportParameter("CveTipoAlmacenDestino", DtMovimientos(0)("CveTipoAlmacenDestino").ToString))

View File

@@ -3371,12 +3371,9 @@ Partial Class Compras_eFacturas
XMLNodosPagosModalCount = XMLNodosPagosModalCount + 1
Next
Next
Next
Dim UUIDDuplicadosEnu = From row In DTDocumentosRelacionados.AsEnumerable()
Let IdDocumento = row.Field(Of String)("IdDocumento")
Group row By IdDocumento Into IdDocumentos = Group
@@ -3392,8 +3389,6 @@ Partial Class Compras_eFacturas
Next
Next
MontoPago = Monto
Dim NodosPagosString As String = Regex.Replace(nodePagos2.InnerXml, $"{Prefijo}:", "", RegexOptions.IgnoreCase)
@@ -3428,10 +3423,6 @@ Partial Class Compras_eFacturas
Catch ex As Exception
dRow2("CvePrePolizaDetalle") = 0
End Try
End If
Next
Next
@@ -3989,9 +3980,9 @@ Partial Class Compras_eFacturas
Private Sub GVPDocumentosRelacionadosPagos_RowCreated(sender As Object, e As GridViewRowEventArgs) Handles GVPDocumentosRelacionadosPagos.RowCreated
If e.Row.RowType = DataControlRowType.Header Then
Dim HeaderGrid = DirectCast(sender, GridView)
Dim HeaderGridRow = New GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Insert)
Dim HeaderCell = New TableCell
Dim HeaderGrid As GridView = DirectCast(sender, GridView)
Dim HeaderGridRow As New GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Insert)
Dim HeaderCell As New TableCell
HeaderCell.Text = "Documentos Relacionados"
HeaderCell.ColumnSpan = 9
@@ -5507,7 +5498,7 @@ Public Class Compra2
XMLCargaExistosa = True
Catch ex As Exception
Try
Dim oReader = New StreamReader(XmlFuenteRuta, Encoding.GetEncoding("ISO-8859-1"))
Dim oReader As New StreamReader(XmlFuenteRuta, Encoding.GetEncoding("ISO-8859-1"))
XMLDoc.Load(oReader)
oReader.Dispose()
XMLCargaExistosa = True
@@ -5734,10 +5725,10 @@ Public Class Compra2
#Region "DETALLES"
Dim ObjeFacturas As New ClsCompras
Dim AjustaUltimoConcepto = False
Dim AjustaUltimoConcepto As Boolean = False
Dim nodeconceptos As XmlNode = XMLDoc.SelectSingleNode(String.Format("//{0}:Conceptos", Prefijo), namespaces)
Dim XML = Replace(nodeconceptos.OuterXml, "<cfdi:", "<")
Dim XML As String = Replace(nodeconceptos.OuterXml, "<cfdi:", "<")
XML = XML.Replace("</cfdi:", "</")
XML = XML.Replace("xmlns:cfdi=""http://www.sat.gob.mx/cfd/3""", "")
XML = XML.Replace("xmlns:cfdi=""http://www.sat.gob.mx/cfd/4""", "")
@@ -6640,7 +6631,7 @@ Public Class Compra2
End If
'RETENCIONES
Dim Retenciones = 0D
Dim Retenciones As Decimal = 0
Retenciones = LocalRetIVA
Retenciones += LocalRetISR
@@ -7147,7 +7138,7 @@ Namespace ADSNetLibraryzdE.HelpersE.ConexionesE.SIGAPIE
client.Timeout = TimeSpan.FromMinutes(15)
Dim response As HttpResponseMessage = New HttpResponseMessage()
Dim strjsonreq = Newtonsoft.Json.JsonConvert.SerializeObject(requestobject)
Dim strjsonreq As String = Newtonsoft.Json.JsonConvert.SerializeObject(requestobject)
Dim content As StringContent = New StringContent(strjsonreq, Encoding.UTF8, "application/json")
Dim route As String = If(isfullpath, path, GetRoute(path))

View File

@@ -1563,7 +1563,7 @@
<Top>7.59855cm</Top>
<Left>0.06623cm</Left>
<Height>0.82958cm</Height>
<Width>20.31433cm</Width>
<Width>20.31432cm</Width>
<ZIndex>4</ZIndex>
<Style>
<Border>
@@ -1749,9 +1749,9 @@
</Paragraphs>
<rd:DefaultName>Textbox3</rd:DefaultName>
<Top>2.27425cm</Top>
<Left>0.06623cm</Left>
<Left>0.15384cm</Left>
<Height>0.5cm</Height>
<Width>8.01543in</Width>
<Width>7.93649in</Width>
<ZIndex>7</ZIndex>
<Style>
<Border>
@@ -4112,6 +4112,47 @@
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
<Textbox Name="Textbox59">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Carta Porte 3.0</Value>
<Style>
<FontFamily>calibri</FontFamily>
<FontSize>7pt</FontSize>
<FontWeight>Bold</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Right</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox3</rd:DefaultName>
<Top>2.27425cm</Top>
<Left>16.42665cm</Left>
<Height>0.5cm</Height>
<Width>1.52986in</Width>
<ZIndex>19</ZIndex>
<Style>
<Border>
<Style>None</Style>
</Border>
<BottomBorder>
<Color>Black</Color>
<Style>None</Style>
<Width>1pt</Width>
</BottomBorder>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</ReportItems>
<Height>7.00495in</Height>
<Style />
@@ -4363,7 +4404,7 @@
<PrintOnLastPage>true</PrintOnLastPage>
<ReportItems>
<Line Name="Line1">
<Top>0.03519cm</Top>
<Top>0.03518cm</Top>
<Left>0.06623cm</Left>
<Height>0cm</Height>
<Width>20.38566cm</Width>
@@ -4393,7 +4434,7 @@
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox13</rd:DefaultName>
<Top>0.14102cm</Top>
<Top>0.14101cm</Top>
<Left>0.71425cm</Left>
<Height>0.54708cm</Height>
<Width>1.55632cm</Width>
@@ -4427,7 +4468,7 @@
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox14</rd:DefaultName>
<Top>0.14102cm</Top>
<Top>0.14101cm</Top>
<Left>2.27057cm</Left>
<Height>0.54708cm</Height>
<Width>4.96223cm</Width>
@@ -4462,7 +4503,7 @@
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox13</rd:DefaultName>
<Top>0.14102cm</Top>
<Top>0.14101cm</Top>
<Left>7.33864cm</Left>
<Height>0.54708cm</Height>
<Width>2.84562cm</Width>
@@ -4497,7 +4538,7 @@
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox14</rd:DefaultName>
<Top>0.14102cm</Top>
<Top>0.14101cm</Top>
<Left>10.18425cm</Left>
<Height>0.54708cm</Height>
<Width>4.68641cm</Width>
@@ -4531,7 +4572,7 @@
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox14</rd:DefaultName>
<Top>0.14455cm</Top>
<Top>0.14454cm</Top>
<Left>14.99343cm</Left>
<Height>0.54708cm</Height>
<Width>4.04906cm</Width>
@@ -4563,7 +4604,7 @@
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox14</rd:DefaultName>
<Top>0.6881cm</Top>
<Top>0.68809cm</Top>
<Left>0.71425cm</Left>
<Height>0.54708cm</Height>
<Width>6.21751cm</Width>

View File

@@ -4846,6 +4846,30 @@
<AllowBlank>true</AllowBlank>
<Prompt>ReportParameter1</Prompt>
</ReportParameter>
<ReportParameter Name="SRP_CFDIVersion">
<DataType>String</DataType>
<Nullable>true</Nullable>
<AllowBlank>true</AllowBlank>
<Prompt>ReportParameter1</Prompt>
</ReportParameter>
<ReportParameter Name="SRP_CartaPorteVersion">
<DataType>String</DataType>
<Nullable>true</Nullable>
<AllowBlank>true</AllowBlank>
<Prompt>ReportParameter1</Prompt>
</ReportParameter>
<ReportParameter Name="SRP_PesoBrutoVehicular">
<DataType>String</DataType>
<Nullable>true</Nullable>
<AllowBlank>true</AllowBlank>
<Prompt>ReportParameter1</Prompt>
</ReportParameter>
<ReportParameter Name="SRP_QRCCP">
<DataType>String</DataType>
<Nullable>true</Nullable>
<AllowBlank>true</AllowBlank>
<Prompt>ReportParameter1</Prompt>
</ReportParameter>
</ReportParameters>
<EmbeddedImages>
<EmbeddedImage Name="Logo">

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -86,10 +86,10 @@
</div>
<div class="tools">
<asp:Button ID="BtnBuscar" runat="server" Text="Buscar" OnClick="BtnBuscar_Click" ValidationGroup="GrpBuscar" class="btn btn-primary" />
</div>
</div>
<div class="portlet-body" style="display: none;">
<div class="portlet-body" style="display: none;">
</div>
</div>
</asp:Panel>
@@ -315,16 +315,16 @@
<div class="portlet light xspadding bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Ventas por surtir</span>
<code style="font-family: Menlo,Monaco,Consolas,'Courier New',monospace; font-size: 10px">
<asp:Literal Text="" runat="server" ID="LtActualizado" />
</code>
&nbsp
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Ventas por surtir</span>
<code style="font-family: Menlo,Monaco,Consolas,'Courier New',monospace; font-size: 10px">
<asp:Literal Text="" runat="server" ID="LtActualizado" />
</code>
&nbsp
</div>
<div class="actions">
<div class="btn-group">
@@ -333,7 +333,7 @@
<div class="tools">
<asp:Panel runat="server" DefaultButton="BtnConsultarPendientes">
<input type="text" id="TxtBusqueda1" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda1','{0}')", GVPendientes.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 70px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda1','{0}')", GVPendientes.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
&nbsp
@@ -545,7 +545,15 @@
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="Unidad" DataField="UM" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="5%" />
<asp:HyperLinkField HeaderText="Producto o Servicio" Target="_blank" DataTextField="CodigoPS" DataNavigateUrlFields="CvePS" DataNavigateUrlFormatString="/Ventas/ProductosServicios.aspx?CvePS={0}" ItemStyle-HorizontalAlign="Left" />
<%-- <asp:HyperLinkField HeaderText="Producto o Servicio" Target="_blank" DataTextField="CodigoPS" DataNavigateUrlFields="CvePS" DataNavigateUrlFormatString="/Ventas/ProductosServicios.aspx?CvePS={0}" ItemStyle-HorizontalAlign="Left" />--%>
<asp:TemplateField ItemStyle-HorizontalAlign="Left">
<HeaderTemplate>
<asp:Literal ID="LtlHeaderPS" Text="Producto o Servicio" runat="server"></asp:Literal>
</HeaderTemplate>
<ItemTemplate>
<asp:HyperLink ID="HplPS" runat="server" Target="_blank" Text='<%# Eval("CodigoPS", "{0}") %>'></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="Observación" DataField="ObservacionesDetalle" ItemStyle-Width="7.5%" />
<asp:TemplateField HeaderText="Sección" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="7.5%" Visible="false">

View File

@@ -4,8 +4,7 @@ Option Explicit On
Imports System.Data
Imports System.Data.SqlClient
Imports System.IO
Imports Extensiones
Imports Microsoft.Owin.Security.Provider
Imports Extensiones
Imports Microsoft.Reporting.WebForms
Partial Class Inventarios_EntregaAlmacen
@@ -342,7 +341,7 @@ Partial Class Inventarios_EntregaAlmacen
InicializaValores()
CargaParametrosAD()
If UsuarioActual.CveEmpresa.Contiene(1, 72, 80, 146, 119) Then DdlAlmacen.AutoPostBack = True
If UsuarioActual.CveEmpresa.Contiene(1, 72, 80, 146, 119, 186) Then DdlAlmacen.AutoPostBack = True
If UsuarioActual.Empresa.Funcionalidad(281).ToEntero() = 1 Then
@@ -435,16 +434,16 @@ Partial Class Inventarios_EntregaAlmacen
CveVentaAD = -1
If UsuarioActual.CveUsuario <> 100 Then
Exit Sub
End If
'If UsuarioActual.CveUsuario <> 100 Then
' Exit Sub
'End If
If Not IsNothing(Request("CveVenta")) AndAlso IsNumeric(Request("CveVenta")) Then
CveVentaAD = Request("CveVenta").ToEntero()
CargaVentaPorSurtir(Request("CveVenta").ToEntero())
LbSurtida.Visible = True
LbSurtida.Text = "SOLO MODO VISUAL"
BtnGuardar.Visible = False
'LbSurtida.Visible = True
'LbSurtida.Text = "SOLO MODO VISUAL"
'BtnGuardar.Visible = False
End If
End Sub
@@ -521,9 +520,7 @@ Partial Class Inventarios_EntregaAlmacen
If DtPendientes IsNot Nothing Then
GVPendientes.DataSource = DtPendientes
End If
LtActualizado.Text = String.Format("Actualizado: {0}", NowADS().ToString("H:mm"))
GVPendientes.DataBind()
@@ -613,8 +610,6 @@ Partial Class Inventarios_EntregaAlmacen
TipoEntrega = 1
BtnGuardar.Visible = True
Dim StrAlmacenes As String = "CveTipoAlmacen IN (1,2,26)"
If UsuarioActual.CveSubProyecto = 8804 Then
@@ -659,6 +654,10 @@ Partial Class Inventarios_EntregaAlmacen
TipoDocto = DtDatos.Rows(0)("TipoDocto").ToString()
TipoMovimiento = If(TipoDocto.Contiene({"Rem", "Ped", "Ing", "Ped", "PeC", "Ant"}) And (EsDevolucionVenta = 0 Or CveVentaAD > 0), 1, 2)
If UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 AndAlso TipoDocto.Contiene("Ped", "Ing") Then
TxtObservaciones.Text = $"Dr. {drE("Medico").ToString}{vbCrLf}Cx. {drE("Procedimiento").ToString}{vbCrLf}F. Cirugía {drE("FechaEjecucion").ToString.ToDateTime.ToString("dd/MM/yyyy HH:mm")}{vbCrLf}H. {drE("Sucursal").ToString}{vbCrLf}"
End If
LbCliente.Text = DtDatos.Rows(0)("Nombre").ToString()
HLFolio.Text = drE("SerieFolio").ToString()
If UsuarioActual.TienePermisoProceso(201) Then
@@ -1016,9 +1015,31 @@ Partial Class Inventarios_EntregaAlmacen
End Sub
Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.Header Then
If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then
If DtDatos IsNot Nothing Then
If DtDatos.MAX("EsPaquete") = "True" Then
e.Row.FCLiteral("LtlHeaderPS").Text = "Paquete"
Else
e.Row.FCLiteral("LtlHeaderPS").Text = "Producto"
End If
End If
End If
End If
If e.Row.RowType = DataControlRowType.DataRow Then
If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then
If e.Row.DBCampo("EsPaquete") = "True" Then
e.Row.FCHyperLink("HplPS").NavigateUrl = $"/Inventarios/PaquetesArmadoDesarmado.aspx?CvePS={e.Row.DBCampo("CvePS")}&Cantidad={e.Row.DBCampo("CantidadF")}"
Else
e.Row.FCHyperLink("HplPS").NavigateUrl = $"/Ventas/ProductosServicios.aspx?CvePS={e.Row.DBCampo("CvePS")}"
End If
Else
e.Row.FCHyperLink("HplPS").NavigateUrl = $"/Ventas/ProductosServicios.aspx?CvePS={e.Row.DBCampo("CvePS")}"
End If
'código temporal
Dim AplicaSerie As Boolean = CBool(e.Row.DBCampo("AplicaSerie"))

View File

@@ -1,4 +1,4 @@
<%@ Page Title="SIG | Paquetes: Armado - Desarmado" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="PaquetesArmadoDesarmado.aspx.vb" Inherits="Inventarios_PaquetesArmadoDesarmado" %>
<%@ Page Title="SIG | Paquetes: Armado - Desarmado" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="PaquetesArmadoDesarmado.aspx.vb" Inherits="Inventarios_PaquetesArmadoDesarmado" EnableEventValidation="false" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
@@ -116,42 +116,12 @@
</div>
</div>
<div class="portlet-body">
<table width="100%">
<tr>
<td>Paquete:</td>
<td>
<asp:Label Font-Bold="true" Text="" ID="LbPaqueteArmado" runat="server" />
</td>
</tr>
<tr>
<td>Cantidad:</td>
<td>
<asp:Label Text="" ID="LbCantidadArmado" runat="server" />
</td>
</tr>
<tr>
<td colspan="2">
<hr />
</td>
</tr>
<tr>
<td>Almacén:</td>
<td>
<asp:Label Text="" ID="LbAlmacenArmado" runat="server" />
</td>
</tr>
<tr>
<td>Fecha:</td>
<td>
<asp:Label Text="" ID="LbFechaArmado" runat="server" />
</td>
</tr>
<tr>
<td>Observaciones:</td>
<td>
<asp:TextBox ID="TxtObservacionesArmado" TextMode="MultiLine" Rows="2" CssClass="form-control input-sm" runat="server" MaxLength="200"></asp:TextBox>
</td>
</tr>
<tr>
<td>Observaciones:</td>
<td>
<asp:TextBox ID="TxtObservacionesArmado" TextMode="MultiLine" Rows="2" CssClass="form-control input-sm" runat="server" MaxLength="200"></asp:TextBox>
</td>
</tr>
</table>
</div>
</div>
@@ -216,7 +186,7 @@
</div>
</div>
<div class="portlet-body">
<asp:GridView ID="GvDatosArmado" DataKeyNames="Cantidad,CvePS,CveUM,Consec,AplicaSeccion,AplicaSerie,AplicaCaducidad,AplicaLote" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron datos con los filtros especificados" CssClass="table table-striped table-hover Widthall" BorderColor="#D3D3D3" GridLines="None">
<asp:GridView ID="GvDatosArmado" DataKeyNames="Cantidad,CvePS,CveUM,Consec,AplicaSeccion,AplicaSerie,AplicaCaducidad,AplicaLote" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron datos con los filtros especificados" CssClass="table table-striped table-hover ScrollAD Widthall" BorderColor="#D3D3D3" data-heighterror="450" data-freezerows="1" GridLines="None">
<Columns>
<asp:BoundField HeaderText="Cant. Necesaria" DataField="Cantidad" ItemStyle-Width="15%" DataFormatString="{0:###,###,###,##0.##}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Cant. Disponible" DataField="CantidadDisponible2" ItemStyle-Width="15%" DataFormatString="{0:###,###,###,##0.##}" ItemStyle-HorizontalAlign="Right" />
@@ -225,12 +195,12 @@
<asp:TemplateField HeaderText="Serie">
<ItemTemplate>
<asp:Button Text="Serie" ID="BtnSerie" OnClick="BtnSerie_Click" CssClass="btn btn-xs btn-primary" runat="server" Style="float: left;" />
<asp:LinkButton Text="<i class='fa fa-star'></i>" ID="BtnSeriePaquete" OnClick="BtnSeriePaquete_Click" CssClass="btn btn-xs btn-primary" runat="server" Style="float: left;" data-toggle="tooltip" title="Seleccionar como serie del paquete" />
<asp:LinkButton Text="<i class='fa fa-star'></i>" ID="BtnSeriePaquete" OnClick="BtnSeriePaquete_Click" CssClass="btn btn-xs btn-primary" runat="server" Style="float: left;" data-toggle="tooltip" title="Seleccionar como serie del paquete" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Sección">
<ItemTemplate>
<asp:DropDownList ID="DdlSeccionAlmacen" DataTextField="SeccionAlmacen" AppendDataBoundItems="true" DataValueField="CveSeccionAlmacen" CssClass="select2me" runat="server"/>
<asp:DropDownList ID="DdlSeccionAlmacen" DataTextField="SeccionAlmacen" AppendDataBoundItems="true" DataValueField="CveSeccionAlmacen" CssClass="select2me" runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Lote">
@@ -238,12 +208,22 @@
<asp:TextBox ID="TxtLote" CssClass="form-control input-sm" runat="server" Width="80px" Style="text-align: right;"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Fecha Caducidad">
<asp:TemplateField HeaderText="Fecha Caducidad">
<ItemTemplate>
<asp:TextBox ID="TxtCaducidad" CssClass="form-control input-sm" runat="server" Width="80px" Style="text-align: right;"></asp:TextBox>
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 120px !important; padding: 0px;">
<asp:TextBox ID="TxtCaducidad" Text="" CssClass="form-control input-sm ADSMaskDate" Style="width: 78px" runat="server" Visible="false" Enabled="false"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton runat="server" ID="LnkCaducidad" class="btn default" Visible="false" Enabled="false"> <i class="fa fa-calendar"></i> </asp:LinkButton>
<ajax:MaskedEditExtender ID="MEECaducidad" runat="server" TargetControlID="TxtCaducidad" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" Enabled="false" ID="CECaducidad" TargetControlID="TxtCaducidad" PopupButtonID="LnkCaducidad" PopupPosition="BottomLeft" Format="dd/MM/yyyy"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVCaducidad" runat="server" ControlToValidate="TxtCaducidad" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Caducidad''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCECaducidad" runat="server" HighlightCssClass="vco" TargetControlID="RFVCaducidad"></ajax:ValidatorCalloutExtender>
</span>
</div>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
@@ -256,7 +236,7 @@
<div class="col-md-12" style="text-align: center;">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<asp:Button ID="BtnGuadarArmado" OnClick="BtnGuadarArmado_Click" Text="Armar" Visible="false" CssClass="btn btn-primary" Width="150px" runat="server" />
<asp:Button ID="BtnGuadarArmado" OnClick="BtnGuadarArmado_Click" Text="Armar" Visible="false" CssClass="btn btn-primary" Width="150px" runat="server" ValidationGroup="GrpGuardar" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
@@ -365,35 +345,6 @@
</div>
<div class="portlet-body">
<table width="100%">
<tr>
<td>Paquete:</td>
<td>
<asp:Label Font-Bold="true" Text="" ID="LbPaqueteDesarmado" runat="server" />
</td>
</tr>
<tr>
<td>Cantidad:</td>
<td>
<asp:Label Text="" ID="LbCantidadDesarmado" runat="server" />
</td>
</tr>
<tr>
<td colspan="2">
<hr />
</td>
</tr>
<tr>
<td>Almacén:</td>
<td>
<asp:Label Text="" ID="LbAlmacenDesarmado" runat="server" />
</td>
</tr>
<tr>
<td>Fecha:</td>
<td>
<asp:Label Text="" ID="LbFechaDesarmado" runat="server" />
</td>
</tr>
<tr>
<td>Observaciones:</td>
<td>
@@ -505,9 +456,29 @@
<asp:Button Text="Serie" ID="BtnSerie" OnClick="BtnSerie_Click" CssClass="btn btn-xs btn-primary" runat="server" Style="float: left;" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Sección">
<asp:TemplateField HeaderText="Sección">
<ItemTemplate>
<asp:DropDownList ID="DdlSeccionAlmacen" DataTextField="SeccionAlmacen" AppendDataBoundItems="true" DataValueField="CveSeccionAlmacen" CssClass="select2me" runat="server"/>
<asp:DropDownList ID="DdlSeccionAlmacen" DataTextField="SeccionAlmacen" AppendDataBoundItems="true" DataValueField="CveSeccionAlmacen" CssClass="select2me" runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Lote">
<ItemTemplate>
<asp:TextBox ID="TxtLote" CssClass="form-control input-sm" runat="server" Width="80px" Style="text-align: right;"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Fecha Caducidad">
<ItemTemplate>
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 120px !important; padding: 0px;">
<asp:TextBox ID="TxtCaducidad" Text="" CssClass="form-control input-sm ADSMaskDate" Style="width: 78px" runat="server" Visible="false" Enabled="false"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton runat="server" ID="LnkCaducidad" class="btn default" Visible="false" Enabled="false"> <i class="fa fa-calendar"></i> </asp:LinkButton>
<ajax:MaskedEditExtender ID="MEECaducidad" runat="server" TargetControlID="TxtCaducidad" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" Enabled="false" ID="CECaducidad" TargetControlID="TxtCaducidad" PopupButtonID="LnkCaducidad" PopupPosition="BottomLeft" Format="dd/MM/yyyy"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVCaducidad" runat="server" ControlToValidate="TxtCaducidad" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Caducidad''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCECaducidad" runat="server" HighlightCssClass="vco" TargetControlID="RFVCaducidad"></ajax:ValidatorCalloutExtender>
</span>
</div>
</ItemTemplate>
</asp:TemplateField>
</Columns>

View File

@@ -130,6 +130,15 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
InicializaValores()
If Request("CvePS") IsNot Nothing Then
DdlPaqueteArmado.SelectedValueExist(Request("CvePS").ToString())
End If
If Request("Cantidad") IsNot Nothing Then
TxtCantidadArmado.Text = Request("Cantidad").ToString()
End If
End If
End Sub
@@ -268,20 +277,16 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
End If
UpSeriesPaqueteArmado.Update()
LbPaqueteArmado.Text = DdlPaqueteArmado.SelectedItem.Text
CvePaqueteArmado = DdlPaqueteArmado.SelectedValue.ToEntero
LbCantidadArmado.Text = TxtCantidadArmado.Text
LbAlmacenArmado.Text = DdlAlmacenArmado.SelectedItem.Text
CveAlmacenArmado = DdlAlmacenArmado.SelectedValue.ToEntero
LbFechaArmado.Text = TxtFechaArmado.Text
GvDatosArmado.DataSource = DtDatos
GvDatosArmado.DataBind()
GvDatosArmado.Columns(4).Visible = DtDatos.MAX("AplicaSerie", "") = "True"
GvDatosArmado.Columns(5).Visible = DtDatos.MAX("AplicaSeccion") = "True"
GvDatosArmado.Columns(6).Visible = False 'DtDatos.MAX("Lote", "") <> ""
GvDatosArmado.Columns(7).Visible = False 'DtDatos.MAX("FechaCaducidad", "FechaCaducidad is not null").ToDate > MinFecha
GvDatosArmado.Columns(6).Visible = DtDatos.MAX("AplicaLote") = "True"
GvDatosArmado.Columns(7).Visible = DtDatos.MAX("AplicaCaducidad") = "True"
'If ErrorExistencias Then
' GvDatosArmado.Columns(4).Visible = False
@@ -364,18 +369,16 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
End If
UpSeriesPaqueteDesarmado.Update()
LbPaqueteDesarmado.Text = DdlPaqueteDesarmado.SelectedItem.Text
CvePaqueteDesarmado = DdlPaqueteDesarmado.SelectedValue.ToEntero
LbCantidadDesarmado.Text = TxtCantidadDesarmado.Text
LbAlmacenDesarmado.Text = DdlAlmacenDesarmado.SelectedItem.Text
CveAlmacenDesarmado = DdlAlmacenDesarmado.SelectedValue.ToEntero
LbFechaDesarmado.Text = TxtFechaDesarmado.Text
GvDatosDesarmado.DataSource = DtDatos
GvDatosDesarmado.DataBind()
GvDatosDesarmado.Columns(4).Visible = CBool(DtDatos.MAX("AplicaSerie"))
GvDatosDesarmado.Columns(5).Visible = CBool(DtDatos.MAX("AplicaSeccion"))
GvDatosArmado.Columns(4).Visible = DtDatos.MAX("AplicaSerie", "") = "True"
GvDatosArmado.Columns(5).Visible = DtDatos.MAX("AplicaSeccion") = "True"
GvDatosArmado.Columns(6).Visible = DtDatos.MAX("AplicaLote") = "True"
GvDatosArmado.Columns(7).Visible = DtDatos.MAX("AplicaCaducidad") = "True"
BtnGuadarDesarmado.Visible = True
@@ -447,7 +450,7 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
End If
Next
Case 2 ' DESARMADO
If LbCantidadDesarmado.Text.ToEntero <> DtSeriesDesarmado.Rows.Count Then
If TxtCantidadDesarmado.Text.ToEntero <> DtSeriesDesarmado.Rows.Count Then
Alert("Es necesario indicar las series del paquete a desarmar.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
@@ -456,7 +459,8 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
Dim ObjInventario As New ClsInventarios
ObjInventario.IniciaTransacSQL() 'Inicia la transacción
Dim ObjConta As New ClsContabilidad(ObjInventario.IniciaTransacSQL())
Dim TieneError As Boolean = False
Dim MensajeError As String = ""
@@ -464,137 +468,244 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
Dim FolioSalida As Integer = 0
Dim CveMovimientoEntrada As Integer = 0
Dim FolioEntrada As Integer = 0
Dim Fecha As Date = If(Tipo = 1, LbFechaArmado.Text.ToDate, LbFechaDesarmado.Text.ToDate)
Dim Fecha As Date = If(Tipo = 1, TxtFechaArmado.Text.ToDate, TxtFechaDesarmado.Text.ToDate)
Dim DtDetalle As New DataTable
Dim ConcepPrePoliza1 = "ARMPAQ1"
Dim ConcepPrePoliza2 = "ARMPAQ2"
Dim Modulo As String = "ARMPAQ1/ARMPAQ2"
Select Case (Tipo)
Case 1 ' ARMADO
Try
Select Case (Tipo)
Case 1 ' ARMADO
'SALIDA COMPONENTES
CveMovimientoSalida = ObjInventario.AddMovimiento(CveAlmacenArmado, 5, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservacionesArmado.Text, CveVendedor:=CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), Modulo:="ARMPAQ1")
FolioSalida = ObjInventario.Folio
'SALIDA COMPONENTES
CveMovimientoSalida = ObjInventario.AddMovimiento(CveAlmacenArmado, 5, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservacionesArmado.Text, CveVendedor:=CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), Modulo:="ARMPAQ1")
FolioSalida = ObjInventario.Folio
If CveMovimientoSalida <= 0 Then
TieneError = True
MensajeError = "Ocurrió un error al guardar el movimiento de salida. Por favor vuelva a intentar."
Exit Select
End If
For Each Gvr As GridViewRow In GvDatosArmado.Rows
If Gvr.DataKey("Cantidad").ToString.ToDouble > 0 Then
Dim Lote As String = If(Gvr.FCTextBox("TxtLote").Text = "", "-1", Gvr.FCTextBox("TxtLote").Text)
Dim FechaCaducidad As String = If(Gvr.FCTextBox("TxtCaducidad").Text = "", "-1", Gvr.FCTextBox("TxtCaducidad").Text)
Dim CveSeccionAlmacen As Integer = Gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero()
If CBool(Gvr.DataKey("AplicaSerie")) Then
For Each Dr As DataRow In DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", Gvr.DataKey("Consec").ToEntero)).Rows
If Not ObjInventario.GetExistenciasPS(Gvr.DataKey("CvePS").ToString.ToEntero, Gvr.DataKey("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacenArmado.SelectedValue.ToEntero, FechaMovto:=Fecha.ToDateTime.ToString("yyyy/MM/dd HH:mm"), Serie:=Dr("Serie").ToString, CveVendedor:=CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente)) >= 1 Then
MensajeError = String.Format("El Producto <b>{0}</b> con Serie: <b>{1}</b> no tiene existencia suficiente", Dr("PS"), Dr("Serie"))
TieneError = True
Exit For
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, 1, Gvr.DataKey("CveUM").ToString.ToEntero, Gvr.DataKey("CvePS").ToString.ToEntero, 0, -1,
CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Dr("Serie").ToString, Lote:=Lote, FechaCaducidad:=FechaCaducidad.ToDate) Then
MensajeError = "Ocurrió un error al guardar los detalles con serie del movimiento de salida. Por favor vuelva a intentar."
TieneError = True
Exit For
End If
Next
If TieneError Then
Exit For
End If
Else
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Gvr.DataKey("Cantidad").ToString.ToDecimal, Gvr.DataKey("CveUM").ToString.ToEntero,
Gvr.DataKey("CvePS").ToString.ToEntero, 0, -1, CveSeccionAlmacen:=CveSeccionAlmacen, Lote:=Lote,
FechaCaducidad:=FechaCaducidad.ToDate) Then
MensajeError = "Ocurrió un error al guardar los detalles del movimiento de salida. Por favor vuelva a intentar."
TieneError = True
Exit For
End If
End If
End If
Next
'ENTRADA PAQUETE
If Not TieneError Then
CveMovimientoEntrada = ObjInventario.AddMovimiento(CveAlmacenArmado, 19, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservacionesArmado.Text, CveVendedor:=CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="ARMPAQ2")
FolioEntrada = ObjInventario.Folio
If CveMovimientoEntrada <= 0 Then
MensajeError = "Ocurrió un error al guardar el movimiento de entrada correctamente. Por favor vuelva a intentar."
If CveMovimientoSalida <= 0 Then
TieneError = True
Else
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
Dim PUTemp As Decimal = 0
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
PUTemp += Dr("PU").ToString.ToDecimal * Dr("Cantidad").ToString.ToDecimal
Next
PUTemp = PUTemp / LbCantidadArmado.Text.ToDecimal
Dim CvePSTemp = CvePaqueteArmado
Dim CveSeccionAlmacen As Integer = -1
Dim Drp As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePaqueteArmado).FiltroPrimero("")
MensajeError = "Ocurrió un error al guardar el movimiento de salida. Por favor vuelva a intentar."
Exit Select
End If
Dim CveUMTemp As Integer = Drp("CveUM").ToString.ToEntero
Dim AplicaSeccion As Boolean = CBool(Drp("AplicaSeccion"))
If AplicaSeccion Then
CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, CveAlmacenArmado, CvePaqueteArmado).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero
End If
If AplicaSerie Then
Dim ContadorPaquete = 1
Dim DtSeriesComponentes As New DataTable
For Each Gvr As GridViewRow In GvSeriesPaqueteArmado.Rows
'AGREGA MOVTO DETALLE DE LA ENTRADA DEL PAQUETE
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, 1, CveUMTemp, CvePSTemp, PUTemp, CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Gvr.FCTextBox("TxtSerie").Text.Trim) Then
For Each Gvr As GridViewRow In GvDatosArmado.Rows
If Gvr.DataKey("Cantidad").ToString.ToDouble > 0 Then
Dim Lote As String = If(Gvr.FCTextBox("TxtLote").Text = "", "-1", Gvr.FCTextBox("TxtLote").Text)
Dim FechaCaducidad As String = If(Gvr.FCTextBox("TxtCaducidad").Text = "", "-1", Gvr.FCTextBox("TxtCaducidad").Text)
Dim CveSeccionAlmacen As Integer = Gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero()
If CBool(Gvr.DataKey("AplicaSerie")) Then
For Each Dr As DataRow In DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", Gvr.DataKey("Consec").ToEntero)).Rows
If Not ObjInventario.GetExistenciasPS(Gvr.DataKey("CvePS").ToString.ToEntero, Gvr.DataKey("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacenArmado.SelectedValue.ToEntero, FechaMovto:=Fecha.ToDateTime.ToString("yyyy/MM/dd HH:mm"), Serie:=Dr("Serie").ToString, CveVendedor:=CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente)) >= 1 Then
MensajeError = String.Format("El Producto <b>{0}</b> con Serie: <b>{1}</b> no tiene existencia suficiente", Dr("PS"), Dr("Serie"))
TieneError = True
MensajeError = "Ocurrió un error al guardar los detalles con serie del movimiento de entrada"
Exit For
End If
'INGRESA EN TABLA DE CONTROL DE PAQUETES CON SERIE
For Each Gvr2 As GridViewRow In GvDatosArmado.Rows
If CBool(Gvr2.DataKey("AplicaSerie")) Then
DtSeriesComponentes = New DataTable
DtSeriesComponentes = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", Gvr2.DataKey("Consec").ToEntero)).Copy
Dim CantidadComponente = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", Gvr2.DataKey("Consec").ToEntero)).Rows.Count / LbCantidadArmado.Text.ToEntero
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, 1, Gvr.DataKey("CveUM").ToString.ToEntero, Gvr.DataKey("CvePS").ToString.ToEntero, 0, -1,
CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Dr("Serie").ToString, Lote:=Lote, FechaCaducidad:=FechaCaducidad.ToDate) Then
MensajeError = "Ocurrió un error al guardar los detalles con serie del movimiento de salida. Por favor vuelva a intentar."
TieneError = True
Exit For
End If
Next
For index As Integer = (ContadorPaquete - 1) * CantidadComponente.ToEntero To (ContadorPaquete * CantidadComponente.ToEntero) - 1
If Not ObjInventario.AddPaqueteRelacionSeries(CvePSTemp, Gvr.FCTextBox("TxtSerie").Text.Trim, DtSeriesComponentes.Rows(index)("CvePS").ToString.ToEntero, DtSeriesComponentes.Rows(index)("Serie").ToString) Then
TieneError = True
Exit For
End If
Next
If TieneError Then
Exit For
End If
Else
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Gvr.DataKey("Cantidad").ToString.ToDecimal, Gvr.DataKey("CveUM").ToString.ToEntero,
Gvr.DataKey("CvePS").ToString.ToEntero, 0, -1, CveSeccionAlmacen:=CveSeccionAlmacen, Lote:=Lote,
FechaCaducidad:=FechaCaducidad.ToDate) Then
MensajeError = "Ocurrió un error al guardar los detalles del movimiento de salida. Por favor vuelva a intentar."
TieneError = True
Exit For
End If
End If
End If
Next
'ENTRADA PAQUETE
If Not TieneError Then
CveMovimientoEntrada = ObjInventario.AddMovimiento(CveAlmacenArmado, 19, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservacionesArmado.Text, CveVendedor:=CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="ARMPAQ2")
FolioEntrada = ObjInventario.Folio
If CveMovimientoEntrada <= 0 Then
MensajeError = "Ocurrió un error al guardar el movimiento de entrada correctamente. Por favor vuelva a intentar."
TieneError = True
Else
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
Dim PUTemp As Decimal = 0
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
PUTemp += Dr("PU").ToString.ToDecimal * Dr("Cantidad").ToString.ToDecimal
Next
PUTemp = PUTemp / TxtCantidadArmado.Text.ToDecimal
Dim CvePSTemp = CvePaqueteArmado
Dim CveSeccionAlmacen As Integer = -1
Dim Drp As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePaqueteArmado).FiltroPrimero("")
Dim CveUMTemp As Integer = Drp("CveUM").ToString.ToEntero
Dim AplicaSeccion As Boolean = CBool(Drp("AplicaSeccion"))
If AplicaSeccion Then
CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, CveAlmacenArmado, CvePaqueteArmado).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero
End If
If AplicaSerie Then
Dim ContadorPaquete = 1
Dim DtSeriesComponentes As New DataTable
For Each Gvr As GridViewRow In GvSeriesPaqueteArmado.Rows
'AGREGA MOVTO DETALLE DE LA ENTRADA DEL PAQUETE
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, 1, CveUMTemp, CvePSTemp, PUTemp, CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Gvr.FCTextBox("TxtSerie").Text.Trim) Then
TieneError = True
MensajeError = "Ocurrió un error al guardar los detalles con serie del movimiento de entrada"
Exit For
End If
'INGRESA EN TABLA DE CONTROL DE PAQUETES CON SERIE
For Each Gvr2 As GridViewRow In GvDatosArmado.Rows
If CBool(Gvr2.DataKey("AplicaSerie")) Then
DtSeriesComponentes = New DataTable
DtSeriesComponentes = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", Gvr2.DataKey("Consec").ToEntero)).Copy
Dim CantidadComponente = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", Gvr2.DataKey("Consec").ToEntero)).Rows.Count / TxtCantidadArmado.Text.ToEntero
For index As Integer = (ContadorPaquete - 1) * CantidadComponente.ToEntero To (ContadorPaquete * CantidadComponente.ToEntero) - 1
If Not ObjInventario.AddPaqueteRelacionSeries(CvePSTemp, Gvr.FCTextBox("TxtSerie").Text.Trim, DtSeriesComponentes.Rows(index)("CvePS").ToString.ToEntero, DtSeriesComponentes.Rows(index)("Serie").ToString) Then
TieneError = True
Exit For
End If
Next
End If
Next
ContadorPaquete = ContadorPaquete + 1
Next
Else
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, TxtCantidadArmado.Text.ToDecimal, CveUMTemp, CvePSTemp, PUTemp, CveSeccionAlmacen:=CveSeccionAlmacen) Then
TieneError = True
MensajeError = "Ocurrió un error al guardar los detalles del movimiento de entrada"
End If
End If
Else
TieneError = True
MensajeError = "Ocurrió un error al guardar los movimientos de entrada"
End If
End If
End If
Case 2 'DESARMADO
'SALIDA PAQUETE
CveMovimientoSalida = ObjInventario.AddMovimiento(CveAlmacenDesarmado, 20, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservacionesDesarmado.Text, CveVendedor:=CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), Modulo:="ARMPAQ3")
FolioSalida = ObjInventario.Folio
If CveMovimientoSalida <= 0 Then
TieneError = True
MensajeError = "Ocurrió un error al guardar el movimiento de salida. Por favor vuelva a intentar."
Exit Select
End If
Dim CvePSTemp As Integer = CvePaqueteDesarmado
Dim CveSeccionAlmacen As Integer = -1
Dim Drp As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePaqueteDesarmado).FiltroPrimero("")
Dim CveUMTemp As Integer = Drp("CveUM").ToString.ToEntero
'Dim AplicaSeccion As Boolean = CBool(Drp("AplicaSeccion"))
'If AplicaSeccion Then
' CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, CveAlmacenDesarmado, CvePaqueteDesarmado).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero
'End If
If AplicaSerie Then
For Each Gvr As GridViewRow In GvSeriesPaqueteDesarmado.Rows
'AGREGA MOVTO DETALLE DE LA SALIDA DEL PAQUETE
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, 1, CveUMTemp, CvePSTemp, 0, CveSeccionAlmacen:=-3, Serie:=Gvr.DataKey("Serie").ToString) Then
TieneError = True
MensajeError = "Ocurrió un error al guardar los detalles con serie del movimiento de salida"
Exit For
End If
'ELIMINA EN TABLA DE CONTROL DE PAQUETES CON SERIE
If Not ObjInventario.RemovePaqueteRelacionSeries(CvePSTemp, Gvr.DataKey("Serie").ToString) Then
TieneError = True
MensajeError = "Ocurrió un error al guardar los detalles con serie del movimiento de salida"
Exit For
End If
Next
Else
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, TxtCantidadDesarmado.Text.ToDecimal, CveUMTemp, CvePSTemp, 0, CveSeccionAlmacen:=CveSeccionAlmacen) Then
TieneError = True
MensajeError = "Ocurrió un error al guardar los movimientos de salida"
End If
End If
'ENTRADA COMPONENTES
If Not TieneError Then
CveMovimientoEntrada = ObjInventario.AddMovimiento(CveAlmacenDesarmado, 4, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservacionesDesarmado.Text, CveVendedor:=CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="ARMPAQ4")
FolioEntrada = ObjInventario.Folio
If CveMovimientoEntrada <= 0 Then
MensajeError = "Ocurrió un error al guardar el movimiento de entrada correctamente. Por favor vuelva a intentar."
TieneError = True
Else
For Each Gvr As GridViewRow In GvDatosDesarmado.Rows
Dim Lote As String = If(Gvr.FCTextBox("TxtLote").Text = "", "-1", Gvr.FCTextBox("TxtLote").Text)
Dim FechaCaducidad As String = If(Gvr.FCTextBox("TxtCaducidad").Text = "", "-1", Gvr.FCTextBox("TxtCaducidad").Text)
If CBool(Gvr.DataKey("AplicaSeccion")) Then
CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, CveAlmacenDesarmado, CvePaqueteDesarmado).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero
End If
If CBool(Gvr.DataKey("AplicaSerie")) Then
For Each Dr As DataRow In DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", Gvr.DataKey("Consec").ToEntero)).Rows
If Not ObjInventario.GetExistenciasPS(Gvr.DataKey("CvePS").ToString.ToEntero, Gvr.DataKey("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacenArmado.SelectedValue.ToEntero, FechaMovto:=Fecha.ToDateTime.ToString("yyyy/MM/dd HH:mm"), Serie:=Dr("Serie").ToString, CveVendedor:=CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente)) >= 1 Then
MensajeError = String.Format("El Producto <b>{0}</b> con Serie: <b>{1}</b> no tiene existencia suficiente", Dr("PS"), Dr("Serie"))
TieneError = True
Exit For
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, 1, Gvr.DataKey("CveUM").ToString.ToEntero, Gvr.DataKey("CvePS").ToString.ToEntero, Gvr.FCTextBox("TxtCosto").Text.ToDecimal, -1,
CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Dr("Serie").ToString, Lote:=Lote, FechaCaducidad:=FechaCaducidad.ToDate) Then
MensajeError = "Ocurrió un error al guardar los detalles con serie del movimiento de salida. Por favor vuelva a intentar."
TieneError = True
Exit For
End If
Next
ContadorPaquete = ContadorPaquete + 1
Next
Else
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, LbCantidadArmado.Text.ToDecimal, CveUMTemp, CvePSTemp, PUTemp, CveSeccionAlmacen:=CveSeccionAlmacen) Then
TieneError = True
MensajeError = "Ocurrió un error al guardar los detalles del movimiento de entrada"
End If
End If
If TieneError Then
Exit For
End If
Else
TieneError = True
MensajeError = "Ocurrió un error al guardar los movimientos de entrada"
Else
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Gvr.DataKey("Cantidad").ToString.ToDecimal, Gvr.DataKey("CveUM").ToString.ToEntero,
Gvr.DataKey("CvePS").ToString.ToEntero, Gvr.FCTextBox("TxtCosto").Text.ToDecimal, -1, CveSeccionAlmacen:=CveSeccionAlmacen, Lote:=Lote,
FechaCaducidad:=FechaCaducidad.ToDate) Then
MensajeError = "Ocurrió un error al guardar los detalles del movimiento de salida. Por favor vuelva a intentar."
TieneError = True
Exit For
End If
End If
Next
End If
End If
End If
ConcepPrePoliza1 = "ARMPAQ3"
ConcepPrePoliza2 = "ARMPAQ4"
Modulo = "ARMPAQ3/ARMPAQ4"
End Select
'CONTABILIZAR MOVIMIENTOS
If Not TieneError Then
Dim ImportePrePoliza As Decimal = 0D
If ObjInventario.GetMovimientosDetalle(CveMovimientoEntrada, UsuarioActual.CveEmpresa) Then
ImportePrePoliza = ObjInventario.DtResultados.SUMD("Total")
End If
Dim MovAlmacen As Boolean = True
Dim OrigenMov As Integer = GlobalDTInvConceptos.FiltroPrimeroValor("Origen", "CveConcepto = " & 19).ToEntero
@@ -605,17 +716,13 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
MovAlmacen = False
End If
Dim ObjConta As New ClsContabilidad(ObjInventario.IniciaTransacSQL)
Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas(Modulo, 74, ImportePrePoliza, ImportePrePoliza, 1, Fecha, Modulo, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
Dim Concepto As String = "ARMPAQ2"
Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("ARMPAQ1/ARMPAQ2", 74, ImportePrePoliza, ImportePrePoliza, 1, Fecha, Concepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
'Dim tCveSubProyecto = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen={CveAlmacen}").ToEntero
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, ImportePrePoliza, ImportePrePoliza, 68, "ARMPAQ2", "ARMPAQ2", CveMovimientoAlmacen:=CveMovimientoEntrada, CveSubProyecto:=-1, Contabilizable:=True) Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, ImportePrePoliza, ImportePrePoliza, 68, ConcepPrePoliza2, ConcepPrePoliza2, CveMovimientoAlmacen:=CveMovimientoEntrada, CveSubProyecto:=-1, Contabilizable:=True) Then
TieneError = True
End If
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, MovAlmacen, ImportePrePoliza, ImportePrePoliza, 68, "ARMPAQ1", "ARMPAQ1", CveMovimientoAlmacen:=CveMovimientoSalida, Contabilizable:=True) Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, MovAlmacen, ImportePrePoliza, ImportePrePoliza, 68, ConcepPrePoliza1, ConcepPrePoliza1, CveMovimientoAlmacen:=CveMovimientoSalida, Contabilizable:=True) Then
TieneError = True
End If
@@ -625,134 +732,13 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
TieneError = True
End If
End If
Case 2 'DESARMADO
'SALIDA PAQUETE
CveMovimientoSalida = ObjInventario.AddMovimiento(CveAlmacenDesarmado, 20, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservacionesDesarmado.Text, CveVendedor:=CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), Modulo:="ARMPAQ3")
FolioSalida = ObjInventario.Folio
If CveMovimientoSalida <= 0 Then
TieneError = True
MensajeError = "Ocurrió un error al guardar el movimiento de salida. Por favor vuelva a intentar."
Exit Select
End If
Dim CvePSTemp As Integer = CvePaqueteDesarmado
Dim CveSeccionAlmacen As Integer = -1
Dim Drp As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePaqueteDesarmado).FiltroPrimero("")
Dim CveUMTemp As Integer = Drp("CveUM").ToString.ToEntero
'Dim AplicaSeccion As Boolean = CBool(Drp("AplicaSeccion"))
'If AplicaSeccion Then
' CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, CveAlmacenDesarmado, CvePaqueteDesarmado).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero
'End If
If AplicaSerie Then
For Each Gvr As GridViewRow In GvSeriesPaqueteDesarmado.Rows
'AGREGA MOVTO DETALLE DE LA SALIDA DEL PAQUETE
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, 1, CveUMTemp, CvePSTemp, 0, CveSeccionAlmacen:=-3, Serie:=Gvr.DataKey("Serie").ToString) Then
TieneError = True
MensajeError = "Ocurrió un error al guardar los detalles con serie del movimiento de salida"
Exit For
End If
'ELIMINA EN TABLA DE CONTROL DE PAQUETES CON SERIE
If Not ObjInventario.RemovePaqueteRelacionSeries(CvePSTemp, Gvr.DataKey("Serie").ToString) Then
TieneError = True
MensajeError = "Ocurrió un error al guardar los detalles con serie del movimiento de salida"
Exit For
End If
Next
Else
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, TxtCantidadDesarmado.Text.ToDecimal, CveUMTemp, CvePSTemp, 0, CveSeccionAlmacen:=CveSeccionAlmacen) Then
TieneError = True
MensajeError = "Ocurrió un error al guardar los movimientos de salida"
End If
End If
'ENTRADA COMPONENTES
If Not TieneError Then
CveMovimientoEntrada = ObjInventario.AddMovimiento(CveAlmacenDesarmado, 4, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservacionesDesarmado.Text, CveVendedor:=CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="ARMPAQ4")
FolioEntrada = ObjInventario.Folio
If CveMovimientoEntrada <= 0 Then
MensajeError = "Ocurrió un error al guardar el movimiento de entrada correctamente. Por favor vuelva a intentar."
TieneError = True
Else
For Each Gvr As GridViewRow In GvDatosDesarmado.Rows
If Gvr.DataKey("Cantidad").ToString.ToDouble > 0 Then
If CBool(Gvr.DataKey("AplicaSeccion")) Then
CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, CveAlmacenDesarmado, CvePaqueteDesarmado).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero
End If
If CBool(Gvr.DataKey("AplicaSerie")) Then
For Each Dr As DataRow In DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", Gvr.DataKey("Consec").ToEntero)).Rows
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, 1, Gvr.DataKey("CveUM").ToString.ToEntero, Gvr.DataKey("CvePS").ToString.ToEntero, Gvr.FCTextBox("TxtCosto").Text.ToDecimal, CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Dr("Serie").ToString) Then
MensajeError = "Ocurrió un error al guardar los detalles con serie del movimiento de entrada. Por favor vuelva a intentar."
TieneError = True
Exit For
End If
Next
Else
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Gvr.DataKey("Cantidad").ToString.ToDecimal, Gvr.DataKey("CveUM").ToString.ToEntero, Gvr.DataKey("CvePS").ToString.ToEntero, Gvr.FCTextBox("TxtCosto").Text.ToDecimal, CveSeccionAlmacen:=CveSeccionAlmacen) Then
MensajeError = "Ocurrió un error al guardar los detalles del movimiento de entrada. Por favor vuelva a intentar."
TieneError = True
Exit For
End If
End If
End If
Next
End If
End If
Dim ImportePrePoliza As Decimal = 0D
If ObjInventario.GetMovimientosDetalle(CveMovimientoEntrada, UsuarioActual.CveEmpresa) Then
ImportePrePoliza = ObjInventario.DtResultados.SUMD("Total")
End If
Dim MovAlmacen As Boolean = True
Dim OrigenMov As Integer = GlobalDTInvConceptos.FiltroPrimeroValor("Origen", "CveConcepto = " & 4).ToEntero
If OrigenMov = 1 Then
MovAlmacen = True
Else
MovAlmacen = False
End If
Dim ObjConta As New ClsContabilidad(ObjInventario.IniciaTransacSQL)
Dim Concepto As String = "ARMPAQ2"
Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("ARMPAQ1/ARMPAQ2", 74, ImportePrePoliza, ImportePrePoliza, 1, Fecha, Concepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
'Dim tCveSubProyecto = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen={CveAlmacen}").ToEntero
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, ImportePrePoliza, ImportePrePoliza, 68, "ARMPAQ4", "ARMPAQ4", CveMovimientoAlmacen:=CveMovimientoEntrada, CveSubProyecto:=-1, Contabilizable:=True) Then
TieneError = True
End If
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, MovAlmacen, ImportePrePoliza, ImportePrePoliza, 68, "ARMPAQ3", "ARMPAQ3", CveMovimientoAlmacen:=CveMovimientoSalida, Contabilizable:=True) Then
TieneError = True
End If
If ObjConta.ValidacionesPrePoliza(CvePrePoliza, UsuarioActual, Opcion:=6) Then
If ObjConta.ValorPolizaDescuadre > 0 Then
GuardaLogAD($"Inventarios/RecepcionAlmacen-PPCompOC | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
TieneError = True
End If
End If
End Select
End If
Catch ex As Exception
TieneError = True
OnError("Ocurrió un error al generar el movimiento", ex)
End Try
If Not TieneError Then
Dim Msg As New StringBuilder
Msg.AppendFormat("<br/>El Movimiento de salida se registro con el Folio: <b><a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"" target=""_blank"">{1}</a></b>", CveMovimientoSalida, FolioSalida)
Msg.AppendFormat("<br/><a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir Movimiento</a> ", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoSalida)))
@@ -769,6 +755,7 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
End If
ObjInventario.Dispose() 'elimino la instancia
ObjConta.Dispose()
End Sub
Private Sub Limpia(Tipo As Integer)
@@ -783,12 +770,8 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
DivSeriesPaqueteArmado.Visible = False
GvDatosArmado.Columns(4).Visible = False
LbPaqueteArmado.Text = ""
CvePaqueteArmado = -1
LbCantidadArmado.Text = ""
LbAlmacenArmado.Text = ""
CveAlmacenArmado = -1
LbFechaArmado.Text = ""
TxtObservacionesArmado.Text = ""
UpGeneralesArmado.Update()
@@ -797,12 +780,8 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
UpSeriesPaqueteArmado.Update()
'Else
LbPaqueteDesarmado.Text = ""
CvePaqueteDesarmado = -1
LbCantidadDesarmado.Text = ""
LbAlmacenDesarmado.Text = ""
CveAlmacenDesarmado = -1
LbFechaDesarmado.Text = ""
TxtObservacionesDesarmado.Text = ""
UpGeneralesDesarmado.Update()
@@ -840,7 +819,7 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
'If AplicaSerie Then
e.Row.FCLinkButton("BtnSeriePaquete").Visible = True
e.Row.FCLinkButton("BtnSeriePaquete").Attributes.Add("data-toggle", "tooltip")
e.Row.FCLinkButton("BtnSeriePaquete").Attributes.Add("data-toggle", "tooltip")
'End If
Else
@@ -851,10 +830,23 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
e.Row.FCDropDownList("DdlSeccionAlmacen").Visible = False
Else
CargaSeccionesAlmacen(e.Row.FCDropDownList("DdlSeccionAlmacen"), DdlAlmacenArmado.SelectedValue.ToEntero, e.Row.DBCampo("CvePS").ToEntero, UsuarioActual.CveEmpresa)
End If
e.Row.FCTextBox("TxtCaducidad").Visible = e.Row.DataKey("AplicaCaducidad") = "True"
If e.Row.DataKey("AplicaCaducidad") = "True" Then
e.Row.FCTextBox("TxtCaducidad").Visible = True
e.Row.FCLinkButton("LnkCaducidad").Visible = True
e.Row.FCTextBox("TxtCaducidad").ReadOnly = False
CType(e.Row.FindControl("RFVCaducidad"), RequiredFieldValidator).Enabled = True
e.Row.FCTextBox("TxtCaducidad").Enabled = True
Else
e.Row.FCTextBox("TxtCaducidad").Visible = False
e.Row.FCLinkButton("LnkCaducidad").Visible = False
e.Row.FCTextBox("TxtCaducidad").Enabled = True
e.Row.FCTextBox("TxtCaducidad").ReadOnly = True
CType(e.Row.FindControl("RFVCaducidad"), RequiredFieldValidator).Enabled = False
End If
e.Row.FCTextBox("TxtLote").Visible = e.Row.DataKey("AplicaLote") = "True"
@@ -883,6 +875,23 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
CargaSeccionesAlmacen(e.Row.FCDropDownList("DdlSeccionAlmacen"), DdlAlmacenDesarmado.SelectedValue.ToEntero, e.Row.DBCampo("CvePS").ToEntero, UsuarioActual.CveEmpresa)
End If
If e.Row.DataKey("AplicaCaducidad") = "True" Then
e.Row.FCTextBox("TxtCaducidad").Visible = True
e.Row.FCLinkButton("LnkCaducidad").Visible = True
e.Row.FCTextBox("TxtCaducidad").ReadOnly = False
CType(e.Row.FindControl("RFVCaducidad"), RequiredFieldValidator).Enabled = True
e.Row.FCTextBox("TxtCaducidad").Enabled = True
Else
e.Row.FCTextBox("TxtCaducidad").Visible = False
e.Row.FCLinkButton("LnkCaducidad").Visible = False
e.Row.FCTextBox("TxtCaducidad").Enabled = True
e.Row.FCTextBox("TxtCaducidad").ReadOnly = True
CType(e.Row.FindControl("RFVCaducidad"), RequiredFieldValidator).Enabled = False
End If
e.Row.FCTextBox("TxtLote").Visible = e.Row.DataKey("AplicaLote") = "True"
e.Row.FCTextBox("TxtCosto").Attributes.Add("onkeyup", "SumaValores();")
End If
@@ -1094,7 +1103,7 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
Dt.Columns.Add("Serie", GetType(String))
For Each Row As DataRow In DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", CType(sender, LinkButton).CommandArgument.ToEntero)).Rows
If i > LbCantidadArmado.Text.ToEntero Then
If i > TxtCantidadArmado.Text.ToEntero Then
Exit For
End If
@@ -1125,7 +1134,7 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
'VERIFICA EXISTENCIAS
Dim ObjInventarios As New ClsInventarios
Dim CveUMTemp = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePaqueteDesarmado).FiltroPrimeroValor("CveUM").ToEntero
Dim Existencia = ObjInventarios.GetExistenciasPS(CvePaqueteDesarmado, CveUMTemp, UsuarioActual.CveEmpresa, CveAlmacenDesarmado, FechaMovto:=LbFechaDesarmado.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), Serie:=Serie, CveVendedor:=CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente))
Dim Existencia = ObjInventarios.GetExistenciasPS(CvePaqueteDesarmado, CveUMTemp, UsuarioActual.CveEmpresa, CveAlmacenDesarmado, FechaMovto:=TxtFechaDesarmado.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), Serie:=Serie, CveVendedor:=CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente))
If Existencia < 1 Then
Alert($"No hay existencia suficiente con la Serie definida <b>""{Serie}""</b>. Por favor rectifique y vuelva a intentar", TipoMensaje.MsgAdvertencia)
@@ -1151,7 +1160,7 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
TxtSerieDesarmado.Text = ""
If DtSeriesDesarmado.Rows.Count >= LbCantidadDesarmado.Text.ToEntero Then
If DtSeriesDesarmado.Rows.Count >= TxtCantidadDesarmado.Text.ToEntero Then
BtnAgregarSerieDesarmado.Enabled = False
Else
BtnAgregarSerieDesarmado.Enabled = True
@@ -1177,7 +1186,7 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
dtTemp.Dispose()
If DtSeriesDesarmado.Rows.Count >= LbCantidadDesarmado.Text.ToEntero Then
If DtSeriesDesarmado.Rows.Count >= TxtCantidadDesarmado.Text.ToEntero Then
BtnAgregarSerieDesarmado.Enabled = False
Else
BtnAgregarSerieDesarmado.Enabled = True

View File

@@ -165,16 +165,35 @@
</div>
<asp:UpdatePanel ID="UpDatosGvVentas" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvVentas" ClientIDMode="Static" Width="100%" runat="server" GridLines="None" BorderWidth="0" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true" AutoGenerateColumns="False" AllowPaging="False" ShowFooter="False">
<asp:GridView ID="GvVentas" ClientIDMode="Static" Width="100%" runat="server" GridLines="None" BorderWidth="0" CssClass="table table-striped table-hover Widthall ScrollAD" OnRowDataBound="GvVentas_RowDataBound"
data-sort="true" EmptyDataText="No se encontraron resultados." AutoGenerateColumns="False" >
<Columns>
<asp:BoundField HeaderText="Tipo Docto" DataField="TipoDocto" ItemStyle-Width="55px" />
<asp:HyperLinkField DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="~/Ventas/Ventas.aspx?CveVenta={0}" Target="_blank" ItemStyle-Width="80px" HeaderText="SerieFolio" ControlStyle-CssClass="Texto" DataTextField="SerieFolio" />
<asp:BoundField HeaderText="Fecha" DataField="Fecha" DataFormatString="{0:d}" ItemStyle-Width="90px" ItemStyle-HorizontalAlign="Center" />
<%-- <asp:BoundField HeaderText="Fecha" DataField="Fecha" DataFormatString="{0:d}" ItemStyle-Width="90px" ItemStyle-HorizontalAlign="Center" />--%>
<asp:TemplateField HeaderText="Fecha" ItemStyle-Width="90px" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="LtlFechaFactura" runat="server" ></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:HyperLinkField DataNavigateUrlFields="CveCliente" DataNavigateUrlFormatString="~/Ventas/Clientes.aspx?CveCliente={0}" Target="_blank" HeaderText="Cliente" ControlStyle-CssClass="Texto" ItemStyle-HorizontalAlign="Left" DataTextField="Nombre" />
<asp:BoundField HeaderText="Total" DataField="Total" DataFormatString="{0:n2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Sucursal" DataField="SubProyecto" ItemStyle-Width="100px" />
<asp:BoundField HeaderText="Médico" DataField="Medico" Visible="false" />
<asp:BoundField HeaderText="Procedimiento" DataField="Procedimiento" Visible="false" />
<asp:BoundField HeaderText="Procedimiento" DataField="Procedimiento" Visible="false" />
<asp:TemplateField ItemStyle-Width="70px" HeaderText="Acción" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:HyperLink ID="lnkSurtir" NavigateUrl='<%# Eval("CveVenta", "/Inventarios/EntregaAlmacen.aspx?CveVenta={0}") %>' runat="server" CssClass="btn btn-sm blue" Text="Surtir <i class='fa fa-arrow-right' ></i>"></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>

View File

@@ -1,9 +1,10 @@
Imports System.Data
Imports Extensiones
Imports Microsoft.Reporting.WebForms
Partial Class RepNotasSinAlmacen
Imports Microsoft.Reporting.WebForms
Imports Stimulsoft.Report.QuickButtons.StiWpfQuickButtonAttribute
Partial Class RepNotasSinAlmacen
Inherits ClsPaginas
#Region "propiedades"
Private Property dt As DataTable
@@ -57,10 +58,12 @@ Partial Class RepNotasSinAlmacen
End Get
Set(value As DataTable)
ViewState("DtNotasSinAlmacenCompras") = value
End Set
End Property
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not IsPostBack Then
@@ -77,11 +80,15 @@ Partial Class RepNotasSinAlmacen
GvCompras.Columns(5).Visible = TienePermisoDesmarcar
If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then ' es empresa hospitalaria
GvVentas.Columns(2).HeaderText = "Fecha Cirugía"
GvVentas.Columns(3).HeaderText = "Hospital"
GvVentas.Columns(6).Visible = True
GvVentas.Columns(7).Visible = True
CType(GvVentas.Columns(2), BoundField).DataFormatString = "{0:dd/MM/yyyy HH:mm}"
CType(GvVentas.Columns(2), BoundField).ItemStyle.Width = Unit.Pixel(120)
TxtFechaF.Text = NowADS.AddDays(3).ToShortDateString
GvVentas.Columns(0).ItemStyle.Width = Unit.Pixel(120)
'CType(GvVentas.Columns(2), Literal).DataFormatString = "{0:dd/MM/yyyy HH:mm}"
'CType(GvVentas.Columns(2), Literal).ItemStyle.Width = Unit.Pixel(120)
End If
End Sub
@@ -192,16 +199,15 @@ Partial Class RepNotasSinAlmacen
End If
UpFiltros.Update()
End Sub
UpFiltros.Update()
End Sub
#Region " EXPORTAR - PDF - EXCEL "
Private Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click
ImprimirPDFExcel("Excel")
End Sub
ImprimirPDFExcel("Excel")
End Sub
#Region "P D F"
Private Sub LinkPDF_Click(sender As Object, e As EventArgs) Handles LinkPDF.Click
ImprimirPDFExcel()
@@ -274,8 +280,10 @@ Partial Class RepNotasSinAlmacen
e.Row.FCLinkButton("lnkAccion").Visible = False
If GvCompras.Columns(4).Visible Then
e.Row.Cells(4).Text = ""
End If
End If
End If
End If
End Sub
@@ -292,7 +300,7 @@ Partial Class RepNotasSinAlmacen
Dim ObjCompras As New ClsCompras
Dim ObjEventos As New ClsOIEventos
If ObjCompras.UpdateEstatusAlmacenDetalle(CveCompraDetalle, 1, Usuarioactual.CveUsuario) Then
If ObjCompras.UpdateEstatusAlmacenDetalle(CveCompraDetalle, 1, UsuarioActual.CveUsuario) Then
If ObjEventos.AddEventoBitacora(String.Format("El producto: {0} se marcó como no recibido", PS), "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompra:=CveCompra) Then
Alert("El producto se marcó como 'no recibido' correctamente.")
End If
@@ -306,4 +314,16 @@ Partial Class RepNotasSinAlmacen
End Sub
Protected Sub GvVentas_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then ' es empresa hospitalaria
e.Row.Cells(2).Text = $"<div style='display:none'>{e.Row.DBCampo("Fecha").ToDateTime.ToString("dd/MM/yyyy")}</div> {e.Row.DBCampo("Fecha").ToDateTime.ToString("dd/MM/yyyy HH:mm")}"
Else
e.Row.Cells(2).Text = $"{e.Row.DBCampo("Fecha").ToDateTime.ToString("dd/MM/yyyy")}"
End If
End If
End Sub
End Class

View File

@@ -174,24 +174,25 @@
</div>
<div class="row" >
<div class="row">
<div class="col-md-2" style="margin-top: 5px" >
<div class="col-md-2" style="margin-top: 5px">
<b>Dirección:</b>
</div>
<div class="col-md-4" style="margin-top: 5px" >
<asp:TextBox ID="TxtDireccion" runat="server" MaxLength="300" CssClass="form-control" Height="25px" />
<div class="col-md-4" style="margin-top: 5px">
<asp:TextBox ID="TxtDireccion" runat="server" MaxLength="300" CssClass="form-control" Height="25px" />
</div>
<div class="col-md-2" style="margin-top: 5px" id="DVDatosAdicionalesAcum1" runat="server" visible="false" >
<div class="col-md-2" style="margin-top: 5px" id="DVDatosAdicionalesAcum1" runat="server" visible="false">
<b>Telefono:</b>
</div>
<div class="col-md-4" style="margin-top: 5px" id="DVDatosAdicionalesAcum3" runat="server" visible="false" >
<div class="col-md-4" style="margin-top: 5px" id="DVDatosAdicionalesAcum3" runat="server" visible="false">
<asp:TextBox ID="TxtTelefono" CssClass="form-control" runat="server" MaxLength="10"></asp:TextBox>
<ajax:MaskedEditExtender ID="MaskedEditExtender4" runat="server" TargetControlID="TxtTelefono" ClearMaskOnLostFocus="false" MaskType="Number" Mask="(999) 999-9999" MessageValidatorTip="true" InputDirection="LeftToRight" ErrorTooltipEnabled="True"></ajax:MaskedEditExtender>
</div>
<div class="col-md-6" style="margin-top: 5px">
</div>
</div>
<div class="row" id="DVDatosAdicionalesAcum2" runat="server" visible="false">
@@ -239,22 +240,32 @@
</div>
<div class="row" id="DVTipoVenta" runat="server" visible="false">
<div class="col-md-2" style="margin-top: 5px">
<div class="row">
<div class="col-md-2" style="margin-top: 5px" id="DVTipoVenta1" runat="server" visible="false" >
<b>Tipo de Venta:</b>
</div>
<div class="col-md-4" style="margin-top: 5px; text-align: left">
<div class="col-md-4" style="margin-top: 5px; text-align: left" id="DVTipoVenta2" runat="server" visible="false" >
<asp:DropDownList ID="DdlTipoVenta" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="TipoVenta" DataValueField="CveTipoVenta">
<asp:ListItem Value="-1">Seleccione uno</asp:ListItem>
<asp:ListItem Value="-1">Seleccione uno</asp:ListItem>
</asp:DropDownList>
</div>
<div class="col-md-6" style="margin-top: 5px">
<div class="col-md-2" style="margin-top: 5px" id="DVUsuarioAtendio1" runat="server">
<b>Técnico:</b>
</div>
<div class="col-md-3" style="margin-top: 5px" id="DVUsuarioAtendio2" runat="server">
<asp:DropDownList ID="DdlUsuarioAtendio" runat="server" CssClass="form-control select2me" DataTextField="Nombre" DataValueField="CveUsuario" Enabled="false"></asp:DropDownList>
</div>
<div class="col-md-1" style="margin-top: 5px" id="DVUsuarioAtendio3" runat="server" visible="false">
<asp:LinkButton runat="server" ID="LnkActualizarUsaurioAtendio" OnClick="LnkActualizarUsaurioAtendio_Click" data-toggle="confirmation" data-popout="true"
data-original-title="¿Está seguro que desea actualizar el Técnico de la factura?" data-btn-ok-label="si" Text="<i class='fa fa-check' style='color:green'></i>"
CssClass="btn btn-default btn-circle btn-xs" ToolTip="Actualizar Técnico" />
</div>
</div>

View File

@@ -99,6 +99,20 @@ Partial Class OS_OrdenesServicios
End Set
End Property
Private Property CvePedido As Integer
Get
If ViewState("CvePedido") Is Nothing Then
ViewState("CvePedido") = -1
End If
Return ViewState("CvePedido").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("CvePedido") = value
End Set
End Property
Private Property CveOsDetalle As Integer
Get
@@ -446,8 +460,10 @@ Partial Class OS_OrdenesServicios
End If
If UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then
DVAMedicoProcedimiento.Visible = True
DVTipoVenta.Visible = True
DVTipoVenta1.Visible = True
DVTipoVenta2.Visible = True
DvFechaRecivido1.Visible = False
DvFechaRecivido2.Visible = False
@@ -457,6 +473,11 @@ Partial Class OS_OrdenesServicios
DVEpisodioPaciente.Visible = True
If CveOS > 0 And TipoEstatus >= 3 Then
DdlUsuarioAtendio.Enabled = True
DVUsuarioAtendio3.Visible = True
End If
End If
End If
@@ -639,8 +660,13 @@ Partial Class OS_OrdenesServicios
TipoEstatus = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("TipoEstatus", String.Format("CveEstatusOrdenServicio = {0}", ObjOS.CveEstatusOrdenServicio), "CveEstatusOrdenServicio ASC").ToEntero
SeFacturara = GlobalDTTipoOrdenServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("SeFacturara", String.Format("CveOrdenServicioTipo = {0}", ObjOS.CveOSTipo))
CveTecnico = ObjOS.CveUsuarioAtendio
DdlUsuarioAtendio.SelectedValueExist(CveTecnico)
CargarEstatusDelUsuario(TipoEstatus)
CveVenta = ObjOS.CveVenta
If UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then
CvePedido = ObjOS.CveCotizacion
End If
'Dim validacionTieneEstatus As Integer = EstatusOSDelUsuario.FiltraParametros(String.Format("CveEstatusOrdenServicio = {0}", ObjOS.CveEstatusOrdenServicio)).Rows.Count
@@ -656,7 +682,7 @@ Partial Class OS_OrdenesServicios
DdlEstatusOS.SelectedValue = ObjOS.CveEstatusOrdenServicio.ToString
'If TipoEstatus = 2 Then
' LnkTecnico.Visible = True
LnkTecnico.Visible = True
'End If
If TipoEstatus = 3 Then
@@ -2879,6 +2905,12 @@ Partial Class OS_OrdenesServicios
DdlTecnico.DataSource = GlobalDTUsuarios(-1, UsuarioActual.CveEmpresa)
DdlTecnico.DataBind()
DdlTecnico.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlUsuarioAtendio.DataSource = GlobalDTUsuarios(-1, UsuarioActual.CveEmpresa)
DdlUsuarioAtendio.DataBind()
DdlUsuarioAtendio.Items.Insert(0, New ListItem("Sin Asignar", "-1"))
End Sub
Private Sub LnkTecnico_Click(sender As Object, e As EventArgs) Handles LnkTecnico.Click
RegistraScript(String.Format("$('#{0}').modal('show');", "DivCambiarTecnico"))
@@ -2972,7 +3004,7 @@ Partial Class OS_OrdenesServicios
End Select
Dim ObjOS As New ClsOS
If ObjOS.GetOrdenesServicioDevolucionMaterial(CveOS, CveVenta, Opcion, UsuarioActual.CveEmpresa) Then
If ObjOS.GetOrdenesServicioDevolucionMaterial(CveOS, If(UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1, CvePedido, CveVenta), Opcion, UsuarioActual.CveEmpresa) Then
DTSolicitudDev = ObjOS.DtResultados
GvMU.DataSource = DTSolicitudDev
GvMU.Columns(3).Visible = DTSolicitudDev.MIN("Serie") <> ""
@@ -3093,7 +3125,7 @@ Partial Class OS_OrdenesServicios
Next
If AplicaDevolucion Then
If Not ObjV.UpdateVentasDevolucionAlmacen(1, CveVenta) Then
If Not ObjV.UpdateVentasDevolucionAlmacen(1, CveVentaPedido) Then
ProcesoOK = False
End If
End If
@@ -3213,6 +3245,16 @@ Partial Class OS_OrdenesServicios
Else
ProcesoOK = False
End If
If ProcesoOK Then
If Not ObjOS.UpdateVentaOS(Respuesta.CveVenta, CveOS) Then
ProcesoOK = False
End If
End If
End If
End If
@@ -3249,7 +3291,7 @@ Partial Class OS_OrdenesServicios
Dim CveSubProyectoPedido As Integer = -1
Dim CveMoneda As Integer = -1
If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa, VerificaAlmacen:=False) Then
If ObjVentas.GetVenta(CvePedido, UsuarioActual.CveEmpresa, VerificaAlmacen:=False) Then
Dim DbRowVenta As DataRow = ObjVentas.DtResultados.Copy().Rows(0)
CveMoneda = DbRowVenta("CveMoneda").ToString.ToEntero
CveSubProyectoPedido = DbRowVenta("CveSubProyecto").ToString().ToEntero()
@@ -3313,4 +3355,31 @@ Partial Class OS_OrdenesServicios
End Sub
End Class
Protected Sub LnkActualizarUsaurioAtendio_Click(sender As Object, e As EventArgs)
Dim ObjOs As New ClsOS
Dim ProcesoOk As Boolean = True
If DdlUsuarioAtendio.SelectedValue.ToEntero > 0 Then
For Each GvRow As GridViewRow In GvPS.Rows
If Not ObjOs.UpdateOrdenesServiciosAsignadas(GvRow.DataKey("CveOSDetalle").ToEntero, DdlUsuarioAtendio.SelectedValue.ToEntero, MinFecha, DateTime.Parse(MinFecha.ToShortDateString), UsuarioActual.CveEmpresa) Then
ProcesoOk = False
Alert($"Se presento un error al actualizar el técnico.")
Exit For
End If
Next
If ProcesoOk Then
Alert($"Técnico actualizado correctamenrte a {DdlUsuarioAtendio.SelectedItem.Text}.")
End If
Else
Alert("Debe de seleccionar un ténico para actualziar", TipoMensaje.MsgAdvertencia)
End If
ObjOs.Dispose()
End Sub
End Class

View File

@@ -1,7 +1,7 @@
<%@ Page Title="Reporte de Ordenes de Servicio Médicas" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepOSMedicas.aspx.vb" Inherits="OS_RepOSMedicas" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
@@ -105,12 +105,7 @@
</div>
</div>
<div class="portlet-body" style="display: none">
<div class="row">
<div class="row">
<label class="col-md-1 ">Técnico:</label>
<div class="col-md-1">
<asp:DropDownList ID="DdlTecnico" ClientIDMode="Static" CssClass="form-control input-sm select2me" runat="server" DataTextField="Nombre" DataValueField="CveUsuario" Width="110px" ></asp:DropDownList>
@@ -163,29 +158,32 @@
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" Width="100%" EmptyDataText="No se encontraron ordenes de servicio con los filtros especificados"
ToolTip="Listado de ordenes de servicio" CssClass="table table-advance table-hover Widthall ScrollAD" data-sort="true" Style="text-align: center;" GridLines="None">
ToolTip="Listado de ordenes de servicio" CssClass="table table-advance table-hover Widthall ScrollAD" data-sort="true" GridLines="None">
<Columns>
<%--0--%>
<asp:HyperLinkField HeaderText="Folio" DataNavigateUrlFields="CveOS" DataNavigateUrlFormatString="/OS/OrdenesServicios.aspx?CveOS={0}" DataTextField="Folio" Target="_blank" />
<%--<asp:BoundField HeaderText="Folio" DataField="Folio" ItemStyle-HorizontalAlign="Left" />--%>
<%--<asp:BoundField HeaderText="Folio" DataField="Folio" />--%>
<%--1--%>
<asp:BoundField DataField="FechaCita" HeaderText="Fecha Cirugía" ItemStyle-Width="100px" DataFormatString="{0:dd/MM/yyyy HH:mm}" HtmlEncode="False" />
<%--2--%>
<asp:BoundField HeaderText="Hospital" DataField="Nombre" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Hospital" DataField="Nombre" />
<%--3--%>
<asp:BoundField HeaderText="Médico" DataField="Medico" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Tipo" DataField="TipoVenta" />
<asp:BoundField HeaderText="Médico" DataField="Medico" />
<%--4--%>
<asp:BoundField HeaderText="Procedimiento" DataField="Procedimiento" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Procedimiento" DataField="Procedimiento" />
<%--5--%>
<asp:BoundField HeaderText="Vendedor" DataField="Vendedor" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Vendedor" DataField="Vendedor" />
<%--6--%>
<asp:BoundField HeaderText="Estatus" DataField="EstatusOrdenServicio" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Estatus" DataField="EstatusOrdenServicio" />
<%--7--%>
<asp:BoundField HeaderText="Técnico" DataField="NombreUsuario" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Técnico" DataField="NombreUsuario" />
<%--8--%>
<asp:BoundField HeaderText="Paciente" DataField="Paciente" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Paciente" DataField="Paciente" />
<%--9--%>
<asp:BoundField HeaderText="Episodio" DataField="IdentificadorCliente" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Episodio" DataField="IdentificadorCliente" />
<asp:HyperLinkField HeaderText="Pedido" DataTextField="SerieFolioPedido" ControlStyle-CssClass="Texto" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" DataNavigateUrlFields="CveVentaPedido" Target="_blank" />
<asp:HyperLinkField HeaderText="Remisión" DataTextField="SerieFolioRemision" ControlStyle-CssClass="Texto" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" DataNavigateUrlFields="CveVentaRemision" Target="_blank" />
</Columns>
</asp:GridView>

View File

@@ -72,7 +72,7 @@ Partial Class OS_RepOSMedicas
End If
txtFechaI.Text = NowADS().FirstDayOfMonth.ToShortDateString
txtFechaF.Text = NowADS().ToShortDateString
txtFechaF.Text = NowADS().AddDays(2).ToShortDateString
DdlMedico.DataSource = GlobalDTMedicos(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' ")
DdlMedico.DataBind()
@@ -138,7 +138,7 @@ Partial Class OS_RepOSMedicas
#Region " GV DATOS - ROW DATABOUND "
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
e.Row.Cells(1).Attributes.Add("data-order", e.Row.DBCampo("FechaCita").ToDateTime.ToString("yyyyMMddHHmm"))
End If
End Sub
#End Region

View File

@@ -51,7 +51,7 @@
<asp:GridView ID="GvDocumentos" runat="server" AutoGenerateColumns="False"
DataKeyNames="CveDocumentacion,Documentacion,DocumentacionFormato,Orden,Estatus,CveDocumentacionTipo,DocumentacionTipo,Requerido,DiasLimite,AplicaDiasLimite,AplicaFechaVencimiento"
EmptyDataText="No se encontraron registros de documentos" CssClass="table table-hover table-advance Widthall" GridLines="None" >
EmptyDataText="No se encontraron registros de documentos" CssClass="table table-hover table-advance Widthall mysmallbtn" GridLines="None" >
<Columns>
<asp:TemplateField ItemStyle-HorizontalAlign="Left" ItemStyle-Width="60px" HeaderText="Documento">

View File

@@ -233,24 +233,19 @@ Partial Class RH_CatDocumentos
TxtOrden.Text = Orden.ToString
TxtDiasLimite.Text = GvRow.DataKey("DiasLimite")
ChkAplicaDiasLimite.Checked = Boolean.Parse(GvRow.DataKey("AplicaDiasLimite"))
ChkAplicaFechaVencimiento.Checked = Boolean.Parse(GvRow.DataKey("AplicaFechaVencimiento"))
ChkAplicaDiasLimite.Checked = CBool(GvRow.DataKey("AplicaDiasLimite"))
ChkAplicaFechaVencimiento.Checked = CBool(GvRow.DataKey("AplicaFechaVencimiento"))
DdlDocumentacionTipo.SelectedValueExist(CveDocumentacionTipo)
chkEstatus.Checked = Estatus
chkRequerido.Checked = Requerido
LtlTituloModalDocumentacion.Text = "Actualizar Documento: " & Documentacion
BtnAgregarDocumentoModal.Text = "Actualizar"
UpModalDocumentacion.Update()
ActualizarDocumentacion = True
CargaDatosParametro()
RegistraScript("$('#divAgregarDocumentacion').modal({ backdrop: 'static', keyboard: false});")

View File

@@ -1667,6 +1667,22 @@ function loadsortadscroll() {
var index = tthis.index();
var multiplicador = -1;
var tipodato = tthis.closest('tr').find('th').data('tipodato')
if(1==1){
var table = $(tthis.closest('.ADScroller').find('.ADScroller-body > table ')[0]);
var tabletr = table.find('> tr:not(.trnopadding.ADtr),> tbody > tr:not(.trnopadding.ADtr),> thead > tr:not(.trnopadding.ADtr)');
if (tabletr.length > 0) {
el = $(tabletr[0]);
var tdtexto = el.find("> td");
texto = $(tdtexto[index]).data('order');
if (texto) {
tipodato = 'dataorder';
}
}
}
//console.log({ tipodato })
tthis.closest('tr').addClass('tsorterblock');
setTimeout(
function () {
@@ -1867,6 +1883,35 @@ function loadsortadscroll() {
table.append(this.obj);
});
}
function reordenarcinco() {
var re = new RegExp(",", 'g');
var table = $(tthis.closest('.ADScroller').find('.ADScroller-body > table ')[0]);
var tabletr = table.find('> tr:not(.trnopadding.ADtr),> tbody > tr:not(.trnopadding.ADtr),> thead > tr:not(.trnopadding.ADtr)');
tipostring = 0;
tiponumeric = 0;
tipodate = 0;
var mapped = tabletr.map(function (i, el) {
el = $(el);
var tdtexto = el.find("> td");
var texto = null;
var texton = 0;
if (tdtexto && tdtexto.length > index) {
texton = Number($(tdtexto[index]).data('order'));
} else {
texto = null;
}
return { index: i, value: texton, obj: el };
});
//console.log(mapped)
mapped.sort(function (a, b) {
return (+(a.value > b.value) || +(a.value === b.value) - 1) * multiplicador;
});
mapped.each(function (i, el) {
table.append(this.obj);
});
}
switch (tipodato) {
case 'string':
reordenardos();
@@ -1877,6 +1922,9 @@ function loadsortadscroll() {
case 'numeric':
reordenarcuatro();
break;
case 'dataorder':
reordenarcinco();
break;
default:
reordenaruno();
}

View File

@@ -20,7 +20,6 @@ Partial Class Boletos
ViewState("Importe") = value
End Set
End Property
Private Property CveViaje As Integer
Get
Return ViewState("CveViaje").ToString().ToEntero
@@ -59,13 +58,15 @@ Partial Class Boletos
'Datos Viaje
Dim ObjViaje As New ClsTransportes
Dim retornoViaje As Boolean = ObjViaje.GetViajes(CveViaje, UsuarioActual.CveEmpresa)
ViewState("CveRuta") = ObjViaje.CveRuta
If retornoViaje Then
If retornoViaje AndAlso ObjViaje.CveViaje > 0 Then
CveRuta = ObjViaje.CveRuta
TxtRuta.Text = ObjViaje.Ruta
TxtFecha.Text = ObjViaje.Fecha.ToShortDateString
CargaDestinos()
'Boletos Vendidos
Dim dt As DataTable
If ObjViaje.GetViajesPasajeros(CveViaje, Estatus:=True) Then 'Poner párametro para estatus y cancelado de viajes
If ObjViaje.GetViajesPasajeros(CveViaje, Estatus:=1) Then 'Poner párametro para estatus y cancelado de viajes
dt = ObjViaje.DtResultados
Dim cph As ContentPlaceHolder = CType(Me.Master.FindControl("C"), ContentPlaceHolder)
For Each dr As DataRow In dt.Rows
@@ -75,7 +76,6 @@ Partial Class Boletos
lnk.CssClass = "nodisponible"
lnk.ToolTip = dr("Nombre").ToString
End If
Next
End If
End If
@@ -85,6 +85,10 @@ Partial Class Boletos
Protected Sub InicializaCombos()
'Lista Destinos''carga específicos
End Sub
Protected Sub CargaDestinos()
Dim ObjDestinos As New ClsTransportes()
If ObjDestinos.GetDestinos(CveRuta:=CveRuta) Then
@@ -102,20 +106,18 @@ Partial Class Boletos
End If
ObjDestinos.Dispose()
End Sub
Protected Sub CotizarTarifa(sender As Object, e As EventArgs)
If DdlDestino.SelectedValue <> "" And DdlPartida.SelectedValue <> "" Then
Dim ObjDestinos As New ClsTransportes()
Dim retorno As Boolean = ObjDestinos.GetDestinosTarifas(DdlPartida.SelectedValue.ToEntero, DdlDestino.SelectedValue.ToEntero)
Dim ImporteR As Decimal = ObjDestinos.DtResultados.FiltroPrimeroValor("Importe").ToDecimal
Dim ImporteR As Decimal = ObjDestinos.DtResultados.FiltroPrimeroValor("Importe").ToDecimal.RoundSQL
ObjDestinos.Dispose()
If retorno Then
If ImporteR > 0 Then
Dim redondeado As String = CStr(Math.Round(ImporteR, 2))
ViewState("Importe") = redondeado
TxtCosto.Text = $"El precio de su boleto es ${Importe}"
ViewState("Importe") = ImporteR
TxtCosto.Text = $"El precio de su boleto es ${ImporteR.FormatoNumero}"
BtnGuardar.Visible = True
upPanel.Visible = True
Else
@@ -177,4 +179,12 @@ Partial Class Boletos
End Sub
Protected Sub DdlPartida_SelectedIndexChanged(sender As Object, e As EventArgs)
CotizarTarifa(sender, e)
End Sub
Protected Sub DdlDestino_SelectedIndexChanged(sender As Object, e As EventArgs)
CotizarTarifa(sender, e)
End Sub
End Class

View File

@@ -14,9 +14,9 @@
</style>
</asp:Content>
<%--<asp:Content ID="Content1" ContentPlaceHolderID="HB" runat="Server">
<asp:Content ID="Content1" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>--%>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<div class="row my-1" style="margin-right: 10px; margin-top: 10px;" align="right">
@@ -27,11 +27,13 @@
</i></a>
</div>
<asp:Label ID="Prueba" runat="server" Text=""></asp:Label>
<asp:UpdatePanel ID="UPPD" runat="server">
<ContentTemplate>
<div class="portlet light xspadding bordered margin-bottom-10">
<div class="portlet light xspadding bordered margin-bottom-10">
<asp:GridView ID="GvBoletos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontró ningún boleto registrado"
CssClass="table table-striped table-hover Widthall ScrollAD mysmallbtn" GridLines="None"
data-sort="true" DataKeyNames="Asiento,Nombre, Visa,Celular,Sexo,Estatus,Partida,Destino, Importe,FechaIng, Agencia, TelefonoAgencia">
data-sort="true" DataKeyNames="CveViajePasajero,Asiento,Nombre, Visa,Celular,Sexo,Estatus,Partida,Destino, Importe,FechaIng, Agencia, TelefonoAgencia">
<Columns>
<asp:TemplateField HeaderText="No. Asiento">
@@ -93,10 +95,10 @@
<ItemTemplate>
<asp:LinkButton ID="BtnEditar" runat="server" AlternateText="Editar"
CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" ToolTip="Editar" />
<asp:LinkButton ID="BtnToggle" runat="server" AlternateText="Activar"
<asp:LinkButton ID="BtnCancelar" runat="server" AlternateText="Activar"
CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-cancel'></i>"
data-toggle="confirmation" data-popout="true" data-original-title='<%# If(Eval("Estatus").ToString = "True", "Cancelar Boleto", "Reactivar") %>'
data-btn-ok-label="si" OnClick="ToggleViajesPasajeros" />
data-btn-ok-label="si" OnClick="BtnCancelar_Click" />
<asp:LinkButton ID="BtnImprimir" runat="server" AlternateText="Viaje"
CssClass="btn btn-circle btn-sm blue" Text="<i class='fa fa-print'></i>" ToolTip="Imprimir"
OnClick="ImprimirBoleto" />
@@ -107,6 +109,8 @@
</asp:GridView>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>

View File

@@ -31,7 +31,7 @@ Partial Class ListadoBoletos
Response.Redirect("/Transportes/RepViajes.aspx")
End If
CveViaje = Request.QueryString("CveViaje").ToEntero
Ruta = Request.QueryString("Ruta")
Ruta = IfNull(Request("Ruta"), "").ToString
Prueba.Text = Ruta
@@ -46,43 +46,11 @@ Partial Class ListadoBoletos
Private Sub CargaDatos()
Dim ObjTransportes As New ClsTransportes
If ObjTransportes.GetViajesPasajeros(CveViaje) Then
GvBoletos.DataSource = ObjTransportes.DtResultados
ObjTransportes.Dispose()
GvBoletos.DataBind()
End If
End Sub
Protected Sub ToggleViajesPasajeros(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
Dim CveViajePasajero As String = GvRow.DataKey("CveViajePasajero")
Dim Estatus As String = GvRow.DataKey("Estatus")
Dim cambiarEstatus As Boolean = Not Estatus.ToBool
Dim ObjTransportes As New ClsTransportes
Try
ObjTransportes.IniciaTransacSQL()
If ObjTransportes.UpdateViajesPasajeros(CveViajePasajero.ToEntero, Activar:=True, Estatus:=cambiarEstatus) Then
If cambiarEstatus Then
Alert($"El boleto ha sido cancelado correctamente.")
Else
Alert($"El boleto ha sido reactivado correctamente.")
End If
End If
ObjTransportes.Commit()
Catch ex As Exception
ObjTransportes.RollBack()
Alert($"No se pudo cambiar el estatus del boleto {ex}", TipoMensaje.MsgError)
Finally
ObjTransportes.Dispose()
CargaDatos()
End Try
ObjTransportes.Dispose()
GvBoletos.DataBind()
End Sub
Protected Sub ImprimirBoleto(sender As Object, e As EventArgs)
@@ -113,4 +81,29 @@ Partial Class ListadoBoletos
End Sub
Protected Sub BtnCancelar_Click(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
Dim CveViajePasajero As String = GvRow.DataKey("CveViajePasajero")
Dim Estatus As String = GvRow.DataKey("Estatus")
Dim cambiarEstatus As Boolean = Not Estatus.ToBool
Dim ObjTransportes As New ClsTransportes
ObjTransportes.IniciaTransacSQL()
Try
If ObjTransportes.UpdateViajesPasajeros(CveViajePasajero.ToEntero, Activar:=cambiarEstatus, Estatus:=cambiarEstatus) Then
If Not cambiarEstatus Then
Alert($"El boleto ha sido cancelado correctamente.")
Else
Alert($"El boleto ha sido reactivado correctamente.")
End If
End If
ObjTransportes.Commit()
Catch ex As Exception
ObjTransportes.RollBack()
Alert($"No se pudo cambiar el estatus del boleto {ex}", TipoMensaje.MsgError)
Finally
ObjTransportes.Dispose()
CargaDatos()
End Try
End Sub
End Class

View File

@@ -1169,7 +1169,7 @@
</asp:DropDownList>
<label for="<%= DdlFormaPago33.ClientID.ToString()%>">Forma Pago:</label>
</div>
<div class="row">
<div class="row" id="divDesgloseImpuestos" runat="server" visible="false">
<div class="col-md-6">
<div class="form-group form-md-line-input" id="DivDesglosaIEPS" runat="server">
El cliente desglosa IEPS:

View File

@@ -6071,6 +6071,10 @@ Partial Class Clientes
DdlSATPais.Items.Add(New ListItem("Guatemala", "GTM"))
End If
If UsuarioActual.Empresa.Funcionalidad(713) = "1" Then 'si la empresa deduce ieps
divDesgloseImpuestos.Visible = True
End If
CargaDdlAlmacen()
End Sub

View File

@@ -164,11 +164,12 @@ Partial Class Ventas_Promociones
If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
GvDatos.Columns(8).Visible = True
DivRin.Visible = True
Dim ObjGral As New ClsGenerales
If ObjGral.GetRimTamanios(UsuarioActual.CveEmpresa) Then
DdlRin.DataSource = ObjGral.DtResultados
End If
ObjGral.Dispose()
'Dim ObjGral As New ClsGenerales
'If ObjGral.GetRinTamanios(UsuarioActual.CveEmpresa) Then
' DdlRin.DataSource = ObjGral.DtResultados
'End If
'ObjGral.Dispose()
DdlRin.DataSource = GlobalDTPSRinTamaños(UsuarioActual.CveEmpresa)
DdlRin.DataBind()
DdlRin.Items.Insert(0, New ListItem("Todos", "-1"))
End If
@@ -1073,12 +1074,12 @@ Partial Class Ventas_Promociones
ObjPS.Dispose()
Dim ObjGral As New ClsGenerales
If ObjGral.GetRimTamanios(UsuarioActual.CveEmpresa) Then
DTRines = ObjGral.DtResultados
End If
ObjGral.Dispose()
'Dim ObjGral As New ClsGenerales
'If ObjGral.GetRinTamanios(UsuarioActual.CveEmpresa) Then
' DTRines = ObjGral.DtResultados
'End If
'ObjGral.Dispose()
DTRines = GlobalDTPSRinTamaños(UsuarioActual.CveEmpresa)
Dim RegistroActual As Integer = 1
For Each dRow As DataRow In DTPlantilla.Rows

View File

@@ -5,6 +5,11 @@
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
<style>
.v-center {
display: flex;
align-items: center;
}
.btn-xs {
padding: 0px 5px;
}
@@ -2568,35 +2573,28 @@
</div>
<div class="portlet-body">
<div class="rowpadding">
<asp:UpdatePanel ID="UpComercioExterior" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<label class="col-md-2 form-group form-md-line-input">Tipo Operación:</label>
<div class="col-md-4 form-group form-md-line-input">
<label class="col-md-2 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">Tipo Operación:</label>
<div class="col-md-4 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:Label ID="LblTipoOperacion" runat="server"></asp:Label>
</div>
<label class="col-md-2 form-group form-md-line-input">Clave Pedimento:</label>
<div class="col-md-4 form-group form-md-line-input">
<label class="col-md-2 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">Clave Pedimento:</label>
<div class="col-md-4 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:Label ID="LblClavePedimento" runat="server"></asp:Label>
</div>
</div>
<div class="row">
<div class="col-md-2 form-group form-md-line-input col-md-offset-3">
<div class="col-md-2 form-group form-md-line-input v-venter">
<label>Incoterm:</label>
</div>
<div class="col-md-4 form-group form-md-line-input col-md-offset-3">
<div class="col-md-4 form-group form-md-line-input v-venter" style="margin-top: 0px; padding-top: 0px;">
<asp:DropDownList ID="DdlIncoterm" CssClass="form-control select2me" AppendDataBoundItems="true" Width="100%" runat="server" DataTextField="ClaveSATIncotermDescripcion" DataValueField="CveIncoterm">
</asp:DropDownList>
</div>
</div>
<div class="row">
<%-- <label class="col-md-2 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">Motivo Traslado:</label>
<div class="col-md-4 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:DropDownList ID="DdlSATMotivoTraslado" Width="100%" runat="server" CssClass="select2me" DataTextField="ClaveSATMotivoTrasladoDescripcion" DataValueField="CveMotivoTraslado"></asp:DropDownList>
</div>--%>
<label class="col-md-2 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">Num Reg IdTrib:</label>
<div class="col-md-4 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<label class="col-md-2 form-group form-md-line-input v-venter">Num Reg IdTrib:</label>
<div class="col-md-4 form-group form-md-line-input v-venter" style="margin-top: 0px; padding-top: 0px;">
<asp:TextBox ID="TxtNumRegIdTrib" CssClass="form-control input-sm" runat="server" Width="100%"></asp:TextBox>
</div>
</div>
@@ -2605,63 +2603,60 @@
<asp:UpdatePanel ID="UPPDestina" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-md-2 form-group form-md-line-input"><span>Nombre:</span></div>
<div class="col-md-4 form-group form-md-line-input">
<div class="col-md-2 form-group form-md-line-input v-venter"><span>Nombre:</span></div>
<div class="col-md-10 form-group form-md-line-input v-venter" style="margin-top: 0px; padding-top: 0px;">
<asp:TextBox ID="TxtDestinatarioNombre" CssClass="form-control input-sm" runat="server" Width="100%"></asp:TextBox>
</div>
</div>
<div class="row">
<div class="col-md-2 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;"><span>Calle:</span></div>
<div class="col-md-4 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<div class="col-md-2 form-group form-md-line-input v-venter"><span>Calle:</span></div>
<div class="col-md-4 form-group form-md-line-input v-venter" style="margin-top: 0px; padding-top: 0px;">
<asp:TextBox ID="TxtComExtCalle" CssClass="form-control input-sm" runat="server" Width="100%"></asp:TextBox>
</div>
<div class="col-md-1 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;"><span>Núm.</span></div>
<div class="col-md-2 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:TextBox ID="TxtComExtNumero" CssClass="form-control input-sm" runat="server" Width="55px"></asp:TextBox>
<div class="col-md-1 form-group form-md-line-input v-venter"><span>Núm.</span></div>
<div class="col-md-2 form-group form-md-line-input v-venter" style="margin-top: 0px; padding-top: 0px;">
<asp:TextBox ID="TxtComExtNumero" CssClass="form-control input-sm" runat="server" Width="100%"></asp:TextBox>
</div>
<div class="col-md-1 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;"><span>CP.</span></div>
<div class="col-md-2 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:TextBox ID="TxtComExtCP" CssClass="form-control input-sm" runat="server" Width="65px"></asp:TextBox>
<div class="col-md-1 form-group form-md-line-input v-venter"><span>CP.</span></div>
<div class="col-md-2 form-group form-md-line-input v-venter" style="margin-top: 0px; padding-top: 0px;">
<asp:TextBox ID="TxtComExtCP" CssClass="form-control input-sm" runat="server" Width="100%"></asp:TextBox>
</div>
</div>
<div class="row">
<div class="col-md-2 form-group form-md-line-input"><span>Pais:</span></div>
<div class="col-md-4 form-group form-md-line-input">
<div class="col-md-2 form-group form-md-line-input v-venter"><span>Pais:</span></div>
<div class="col-md-4 form-group form-md-line-input v-venter" style="margin-top: 0px; padding-top: 0px;">
<asp:DropDownList ID="DdlComExtPais" AutoPostBack="true" OnSelectedIndexChanged="DdlPais_SelectedIndexChanged" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" runat="server" DataTextField="ClaveSATPaisDescripcion" DataValueField="CvePais"></asp:DropDownList>
<asp:TextBox ID="TxtComExtPais" CssClass="form-control input-sm" runat="server" Width="100%" Visible="false"></asp:TextBox>
</div>
<div class="col-md-2 form-group form-md-line-input"><span>Estado:</span></div>
<div class="col-md-4 form-group form-md-line-input">
<div class="col-md-2 form-group form-md-line-input v-venter"><span>Estado:</span></div>
<div class="col-md-4 form-group form-md-line-input v-venter" style="margin-top: 0px; padding-top: 0px;">
<asp:DropDownList ID="DdlComExtEstado" AutoPostBack="true" OnSelectedIndexChanged="DdlEstado_SelectedIndexChanged" Visible="false" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" runat="server" DataTextField="ClaveSATEstadoNombreEstado" DataValueField="CveEstado"></asp:DropDownList>
<asp:TextBox ID="TxtComExtEstado" CssClass="form-control input-sm" runat="server" Width="100%" Visible="false"></asp:TextBox>
</div>
</div>
<div class="row">
<div class="col-md-2 form-group form-md-line-input"><span>Municipio:</span></div>
<div class="col-md-4 form-group form-md-line-input">
<div class="col-md-2 form-group form-md-line-input v-venter"><span>Municipio:</span></div>
<div class="col-md-4 form-group form-md-line-input v-venter" style="margin-top: 0px; padding-top: 0px;">
<asp:DropDownList ID="DdlComExtMunicipio" AutoPostBack="true" OnSelectedIndexChanged="DdlMunicipio_SelectedIndexChanged" Visible="false" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" runat="server" DataTextField="ClaveSATMunicipioDescripcion" DataValueField="CveMunicipio"></asp:DropDownList>
<asp:TextBox ID="TxtComExtMunicipio" CssClass="form-control input-sm" runat="server" Width="100%" Visible="false"></asp:TextBox>
</div>
<div class="col-md-2 form-group form-md-line-input"><span>Colonia:</span></div>
<div class="col-md-4 form-group form-md-line-input">
<div class="col-md-2 form-group form-md-line-input v-venter"><span>Colonia:</span></div>
<div class="col-md-4 form-group form-md-line-input v-venter" style="margin-top: 0px; padding-top: 0px;">
<asp:DropDownList ID="DdlComExtColonia" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" Visible="false" runat="server" DataTextField="ClaveSATColoniaNombreAsentamiento" DataValueField="CveColonia"></asp:DropDownList>
<asp:TextBox ID="TxtComExtColonia" CssClass="form-control input-sm" runat="server" Width="100%" Visible="false"></asp:TextBox>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
<div class="row rowpadding">
<div class="col-md-2 form-group form-md-line-input"><span>Aplica Destinatario:</span></div>
<div class="col-md-2 form-group form-md-line-input">
<div class="col-md-2 form-group form-md-line-input v-venter"><span>Aplica Destinatario:</span></div>
<div class="col-md-4 form-group form-md-line-input v-venter">
<asp:CheckBox ID="ChkAplicaDestinatario" runat="server" CssClass="chksino" Text=" " OnCheckedChanged="ChkAplicaDestinatario_CheckedChanged" AutoPostBack="true" Checked="false" />
</div>
</div>
<div class="row rowpadding">
<div class="col-md-2 form-group form-md-line-input" id="DivLblDestino" runat="server" visible="false"><span>Destino:</span></div>
<div class="col-md-4 form-group form-md-line-input" id="DivDdlDestino" runat="server" visible="false">
<div class="col-md-2 form-group form-md-line-input v-venter" id="DivLblDestino" runat="server" visible="false"><span>Destino:</span></div>
<div class="col-md-4 form-group form-md-line-input v-venter" id="DivDdlDestino" runat="server" visible="false">
<asp:DropDownList ID="DdlDirecionDestinatario" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" runat="server" DataTextField="DireccionEnvioContacto" DataValueField="CveDireccionEnvio"></asp:DropDownList>
</div>
</div>
@@ -2674,20 +2669,20 @@
<Columns>
<asp:TemplateField HeaderText="Cantidad">
<ItemTemplate>
<asp:TextBox ID="TxtCantidad" runat="server" Text='<%# Eval("Cantidad", "{0:#,##0.##}") %>' Width="50px"></asp:TextBox>
<asp:TextBox ID="TxtCantidad" runat="server" Text='<%# Eval("CantidadConversion", "{0:#,##0.##}") %>' Width="50px"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="CodigoPS" HeaderText="Producto ó Servicio" />
<asp:TemplateField HeaderText="Valor Unitario">
<ItemTemplate>
<asp:TextBox ID="TxtValorUnitario" runat="server" Text='<%# Eval("PU") %>' Width="60px"></asp:TextBox>
<asp:TextBox ID="TxtValorUnitario" runat="server" Width="60px"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="ClaveSATFraccionArancelariaDescripcion" HeaderText="Fracción Arancelaria" />
<asp:BoundField DataField="ClaveSATUnidadAduanaDescripcion" HeaderText="Unidad Aduana" />
<asp:TemplateField HeaderText="Total USD">
<ItemTemplate>
<asp:Label ID="LblTotalUSD" Text='<%# (CDbl(Eval("Cantidad").ToString) * CDbl(Eval("PU").ToString)).ToString("N2") %>' runat="server"></asp:Label>
<asp:Label ID="LblTotalUSD" runat="server"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Marca">
@@ -4306,10 +4301,10 @@
</div>
</div>
</div>
<div id="DivAnticipos" class="modal ADS fade" role="dialog">
<asp:UpdatePanel runat="server" ID="UpAnticipos" UpdateMode="Conditional" class="modal-dialog">
<ContentTemplate>
<div class="modal-content">
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">&times;</button>
@@ -4370,7 +4365,7 @@
<label class="col-md-2">Fecha:</label></b>
<div class="col-md-4">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 80% !important; padding: 0px;">
<asp:TextBox ID="TxtFechaAnticipoCliente" runat="server" ClientIDMode="Static" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<asp:TextBox ID="TxtFechaAnticipoCliente" runat="server" ClientIDMode="Static" CssClass="form-control" CausesValidation="true" MaxLength="10" AutoPostBack="true" OnTextChanged="TxtFechaAnticipoCliente_TextChanged"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgFechaAnticipoCliente" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
@@ -4435,14 +4430,11 @@
<asp:TemplateField HeaderText="T.C." Visible="false">
<ItemTemplate>
<asp:TextBox ID="TxtTC" runat="server" Width="50px" Enabled="false"></asp:TextBox>
<%--<ajax:FilteredTextBoxExtender ID="SoloNumeros2" runat="server" TargetControlID="TxtTC" FilterType="Custom, Numbers" ValidChars="." />--%>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
<div class="modal-footer">
@@ -5368,7 +5360,7 @@
</asp:GridView>
<asp:GridView ID="GvRemPS" runat="server" AutoGenerateColumns="false" GridLines="None" Visible="false" CssClass="table table-grid table-striped table-advance table-hover Widthall"
DataKeyNames="CveVentaDetalle, PU, Total, Cantidad, CveContrato,Surtido,Medico,Procedimiento" AllowPaging="False">
DataKeyNames="CveVenta, CveVentaDetalle, PU, Total, Cantidad, CveContrato,Surtido,Medico,Procedimiento" AllowPaging="False">
<Columns>
<asp:TemplateField>
<ItemTemplate>

View File

@@ -2448,8 +2448,6 @@ Partial Class Ventas
CveAlmacenDevolucion = 0
Me.CveEstadoCancelacion = 0
TxtFechaOS.Text = NowADS().ToDateTime.ToString("yyyy-MM-dd HH:mm:ss").Replace(" ", "T")
txtFechaICot.Text = NowADS().AddMonths(-3).ToShortDateString
TxtFechaIRem.Text = NowADS().AddMonths(-3).ToShortDateString
TxtFechaIPed.Text = NowADS().AddMonths(-3).ToShortDateString
@@ -2722,15 +2720,15 @@ Partial Class Ventas
If Request("CveManifiesto") IsNot Nothing AndAlso IsNumeric(Request("CveManifiesto")) AndAlso Request("CveManifiesto").ToEntero() > 0 Then
Using ObjVentas As New ClsCGame()
Using ObjCGame As New ClsCGame()
If ObjVentas.ManifiestoGet(Request("CveManifiesto").ToEntero(), -1, -1, -1, -1, -1, -1, -1, -1, UsuarioActual.CveEmpresa, "-1", "-1") Then
DdlSubProyectoDatos.SelectedValueExist(ObjVentas.DtResultados.Rows(0)("CveSubProyecto").ToString())
If ObjCGame.ManifiestoGet(Request("CveManifiesto").ToEntero(), -1, -1, -1, -1, -1, -1, -1, -1, UsuarioActual.CveEmpresa, "-1", "-1") Then
DdlSubProyectoDatos.SelectedValueExist(ObjCGame.DtResultados.Rows(0)("CveSubProyecto").ToString())
End If
If ObjVentas.ManifiestoForVtaGet(UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, Request("CveManifiesto").ToEntero()) Then
GvPS.DataSource = ObjVentas.DtResultados
TmpDT = ObjVentas.DtResultados
If ObjCGame.ManifiestoForVtaGet(UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, Request("CveManifiesto").ToEntero()) Then
GvPS.DataSource = ObjCGame.DtResultados
TmpDT = ObjCGame.DtResultados
GvPS.DataBind()
End If
@@ -2831,6 +2829,8 @@ Partial Class Ventas
End If
Else
TxtFechaOS.Text = NowADS().ToDateTime.ToString("yyyy-MM-dd HH:mm").Replace(" ", "T")
If Request("CveOS") IsNot Nothing AndAlso IsNumeric(Request("CveOS")) AndAlso Request("CveOS").ToEntero() > 0 Then
ViewState("CveOS") = Request("CveOS")
CargaOS(CveOS)
@@ -3452,6 +3452,9 @@ Partial Class Ventas
End If
TxtPrecio.Enabled = False
If UsuarioActual.CveUsuario = 3986 Then
TxtPrecio.Enabled = True
End If
'ocultar la columna de subproyecto
GvPS.Columns(ColumnaSubProyecto).Visible = False
ThProyecto.Visible = False
@@ -5869,21 +5872,28 @@ Partial Class Ventas
CveTipoVenta = If(DbRowVenta("CveTipoVenta").ToString.ToEntero > 0, DbRowVenta("CveTipoVenta").ToString.ToEntero, -1)
If DbRowVenta("CveMedico").ToString.ToEntero > 0 AndAlso CveTipoVenta.Contiene(1, 3, 5) Then
If DbRowVenta("CveMedico").ToString.ToEntero > 0 AndAlso CveTipoVenta.Contiene(1, 2, 3, 5) Then
TrVentasMedicas1.Visible = True
DdlMedico.SelectedValueExist(DbRowVenta("CveMedico").ToString)
DdlProcedimiento.SelectedValueExist(DbRowVenta("CveProcedimiento").ToString)
DdlMedico.Enabled = False
DdlProcedimiento.Enabled = False
If DbRowVenta("FechaParaSurtir").ToString().ToDate() > DateTime.MinValue Then
TrVentasMedicas2.Visible = True
ChkRequiereTecnico.Enabled = False
TxtFechaOS.Enabled = False
TxtFechaOS.Text = DbRowVenta("FechaParaSurtir").ToString().ToDateTime().ToString("yyyy-MM-dd HH:mm").Replace(" ", "T")
End If
End If
End If
End If
Return Retorno
End Function
@@ -10117,6 +10127,40 @@ Partial Class Ventas
End If
End If
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.CveUsuario, UsuarioActual.CveEmpresa, Request("CveEmbarqueManifiesto").ToEntero()) Then
End If
End If
If Request("CveManifiesto") IsNot Nothing AndAlso IsNumeric(Request("CveManifiesto")) AndAlso Request("CveManifiesto").ToEntero() > 0 Then
If ObjVentas.CGame_ManifiestoUpvta(ObjFactura.CveVenta, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Request("CveManifiesto").ToEntero()) Then
End If
End If
Catch ex As Exception
OnError("Ocurrió un error al actualizar el embarque", ex)
ErrorList.Add("Ocurrió un error al actualizar el embarque")
End Try
Try
ViewState("CveVenta") = ObjFactura.CveVenta
If Request("CveOrdenProduccion") IsNot Nothing AndAlso IsNumeric(Request("CveOrdenProduccion")) AndAlso Request("CveOrdenProduccion").ToEntero() > 0 Then
If ObjVentas.AgroOrdenProduccionUpvta(ObjFactura.CveVenta, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Request("CveOrdenProduccion").ToEntero()) Then
End If
End If
Catch ex As Exception
OnError("Ocurrió un error al actualizar la orden de producción", ex)
ErrorList.Add("Ocurrió un error al actualizar la orden de producción")
End Try
'ContPAQ El movimiento 1 es el de Venta
Dim AutoConta As Boolean = UsuarioActual.Empresa.Funcionalidad(200) = "1"
AutoConta = AutocontaMatriz(AutoConta)
@@ -10174,36 +10218,7 @@ Partial Class Ventas
' 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.CveUsuario, UsuarioActual.CveEmpresa, Request("CveEmbarqueManifiesto").ToEntero()) Then
End If
End If
If Request("CveManifiesto") IsNot Nothing AndAlso IsNumeric(Request("CveManifiesto")) AndAlso Request("CveManifiesto").ToEntero() > 0 Then
If ObjVentas.CGame_ManifiestoUpvta(ObjFactura.CveVenta, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Request("CveManifiesto").ToEntero()) Then
End If
End If
Catch ex As Exception
OnError("Ocurrió un error al actualizar el embarque", ex)
End Try
Try
ViewState("CveVenta") = ObjFactura.CveVenta
If Request("CveOrdenProduccion") IsNot Nothing AndAlso IsNumeric(Request("CveOrdenProduccion")) AndAlso Request("CveOrdenProduccion").ToEntero() > 0 Then
If ObjVentas.AgroOrdenProduccionUpvta(ObjFactura.CveVenta, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Request("CveOrdenProduccion").ToEntero()) Then
End If
End If
Catch ex As Exception
OnError("Ocurrió un error al actualizar la orden de producción", ex)
End Try
Try
Dim DirectoriArchivoXML As String = String.Format("{0}{1}", UsuarioActual.Empresa.Ruta, ObjFactura.TipoDocto) ' System.IO.Path.Combine()
@@ -12684,25 +12699,25 @@ Partial Class Ventas
If ChkEmitirComercioExterior.Checked Then
'AplicaComercioExteriorSubProyecto = If(GlobalDTSubProyectos(-1, Obj.CveSubProyecto, CveEmpresa:=UsuarioActual.CveEmpresa)(0)("AplicaComercioExterior").ToString() = "True", True, False)
Timbre.Complementos.ComercioExterior11.AplicaComercioExteriorSubProyecto = AplicaComercioExteriorSubProyecto
Timbre.Complementos.ComercioExterior.AplicaComercioExteriorSubProyecto = AplicaComercioExteriorSubProyecto
'DATOS GENERALES
Timbre.Comprobante.Exportacion = "02"
Timbre.Complementos.ComercioExterior11.TipoOperacion = GlobalDTTipoOperacion().FiltraParametros($"CveTipoOperacion={CveTipoOperacion}")(0)("ClaveSATTipoOperacion").ToString()
Timbre.Complementos.ComercioExterior11.ClavedePedimento = GlobalDTClavePedimento().FiltraParametros($"CvePedimento={CvePedimento}")(0)("ClaveSATPedimento").ToString()
Timbre.Complementos.ComercioExterior11.CertificadoOrigen = "0"
Timbre.Complementos.ComercioExterior11.Incoterm = GlobalDTIncoterm.FiltroPrimeroValor("ClaveSATIncoterm", $"CveIncoterm={DdlIncoterm.SelectedValue}")
Timbre.Complementos.ComercioExterior11.Subdivision = "0"
Timbre.Complementos.ComercioExterior.TipoOperacion = GlobalDTTipoOperacion().FiltraParametros($"CveTipoOperacion={CveTipoOperacion}")(0)("ClaveSATTipoOperacion").ToString()
Timbre.Complementos.ComercioExterior.ClavedePedimento = GlobalDTClavePedimento().FiltraParametros($"CvePedimento={CvePedimento}")(0)("ClaveSATPedimento").ToString()
Timbre.Complementos.ComercioExterior.CertificadoOrigen = "0"
Timbre.Complementos.ComercioExterior.Incoterm = GlobalDTIncoterm.FiltroPrimeroValor("ClaveSATIncoterm", $"CveIncoterm={DdlIncoterm.SelectedValue}")
Timbre.Complementos.ComercioExterior.Subdivision = "0"
Timbre.Complementos.ComercioExterior11.TipoCambioUSD = If(Obj.CveMoneda = 1, 1, Obj.TipoCambio)
Timbre.Complementos.ComercioExterior.TipoCambioUSD = If(Obj.CveMoneda = 1, 1, Obj.TipoCambio)
Timbre.Complementos.ComercioExterior11.MotivoTraslado = ""
Timbre.Complementos.ComercioExterior.MotivoTraslado = ""
'If Timbre.Comprobante.TipoComprobante = "T" Then
' Timbre.Complementos.ComercioExterior11.MotivoTraslado = GlobalDTSATMotivoTraslado.FiltroPrimeroValor("ClaveSATMotivoTraslado", $"CveMotivoTraslado={DdlSATMotivoTraslado.SelectedValue}")
' Timbre.Complementos.ComercioExterior.MotivoTraslado = GlobalDTSATMotivoTraslado.FiltroPrimeroValor("ClaveSATMotivoTraslado", $"CveMotivoTraslado={DdlSATMotivoTraslado.SelectedValue}")
'Else
' Timbre.Complementos.ComercioExterior11.MotivoTraslado = ""
' Timbre.Complementos.ComercioExterior.MotivoTraslado = ""
'End If
'EMISOR
@@ -12711,16 +12726,16 @@ Partial Class Ventas
If GlobalDTSubProyectos(-1, DdlSubProyectoDatos.SelectedValue.ToEntero(), CveEmpresa:=UsuarioActual.CveEmpresa).Rows.Count > 0 Then
Dr = GlobalDTSubProyectos(-1, DdlSubProyectoDatos.SelectedValue.ToEntero(), CveEmpresa:=UsuarioActual.CveEmpresa)(0)
End If
Timbre.Complementos.ComercioExterior11.Emisor.CURP = UsuarioActual.Empresa.CURP
Timbre.Complementos.ComercioExterior11.Emisor.Calle = Dr("Calle").ToString()
Timbre.Complementos.ComercioExterior11.Emisor.NumeroExterior = Dr("NoExt").ToString()
Timbre.Complementos.ComercioExterior11.Emisor.NumeroInterior = Dr("NoInt").ToString()
Timbre.Complementos.ComercioExterior11.Emisor.Colonia = Dr("ClaveSATColonia").ToString()
Timbre.Complementos.ComercioExterior11.Emisor.Localidad = ""
Timbre.Complementos.ComercioExterior11.Emisor.Municipio = Dr("ClaveSATMunicipio").ToString()
Timbre.Complementos.ComercioExterior11.Emisor.Estado = Dr("ClaveSATEstado").ToString()
Timbre.Complementos.ComercioExterior11.Emisor.Pais = Dr("ClaveSATPais").ToString()
Timbre.Complementos.ComercioExterior11.Emisor.CP = Dr("ClaveSATCP").ToString()
Timbre.Complementos.ComercioExterior.Emisor.CURP = UsuarioActual.Empresa.CURP
Timbre.Complementos.ComercioExterior.Emisor.Calle = Dr("Calle").ToString()
Timbre.Complementos.ComercioExterior.Emisor.NumeroExterior = Dr("NoExt").ToString()
Timbre.Complementos.ComercioExterior.Emisor.NumeroInterior = Dr("NoInt").ToString()
Timbre.Complementos.ComercioExterior.Emisor.Colonia = Dr("ClaveSATColonia").ToString()
Timbre.Complementos.ComercioExterior.Emisor.Localidad = ""
Timbre.Complementos.ComercioExterior.Emisor.Municipio = Dr("ClaveSATMunicipio").ToString()
Timbre.Complementos.ComercioExterior.Emisor.Estado = Dr("ClaveSATEstado").ToString()
Timbre.Complementos.ComercioExterior.Emisor.Pais = Dr("ClaveSATPais").ToString()
Timbre.Complementos.ComercioExterior.Emisor.CP = Dr("ClaveSATCP").ToString()
Dim ComExtPais, ComExtEstado, ComExtMunicipio, ComExtColonia, ComExtCalle, ComExtNumero, ComExtCP As String
ComExtColonia = "" : ComExtMunicipio = ""
@@ -12744,17 +12759,17 @@ Partial Class Ventas
End If
'RECEPTOR
Timbre.Complementos.ComercioExterior11.Receptor.NumRegIdTrib = If(Timbre.Comprobante.Version = "4.0", Obj.Cliente.NumRegIdTrib, "") ' EN LA VERSION 3.3 NO DEBE DE REGISTRARSE ESTE VALOR
Timbre.Complementos.ComercioExterior11.Receptor.Calle = ComExtCalle
Timbre.Complementos.ComercioExterior11.Receptor.NumeroExterior = ComExtNumero
Timbre.Complementos.ComercioExterior11.Receptor.NumeroInterior = ""
Timbre.Complementos.ComercioExterior11.Receptor.Colonia = ComExtColonia
Timbre.Complementos.ComercioExterior11.Receptor.Localidad = ""
Timbre.Complementos.ComercioExterior11.Receptor.Referencia = Obj.Cliente.ReferenciaFiscal
Timbre.Complementos.ComercioExterior11.Receptor.Municipio = ComExtMunicipio
Timbre.Complementos.ComercioExterior11.Receptor.CP = ComExtCP
Timbre.Complementos.ComercioExterior11.Receptor.Estado = ComExtEstado
Timbre.Complementos.ComercioExterior11.Receptor.Pais = ComExtPais
Timbre.Complementos.ComercioExterior.Receptor.NumRegIdTrib = If(Timbre.Comprobante.Version = "4.0", Obj.Cliente.NumRegIdTrib, "") ' EN LA VERSION 3.3 NO DEBE DE REGISTRARSE ESTE VALOR
Timbre.Complementos.ComercioExterior.Receptor.Calle = ComExtCalle
Timbre.Complementos.ComercioExterior.Receptor.NumeroExterior = ComExtNumero
Timbre.Complementos.ComercioExterior.Receptor.NumeroInterior = ""
Timbre.Complementos.ComercioExterior.Receptor.Colonia = ComExtColonia
Timbre.Complementos.ComercioExterior.Receptor.Localidad = ""
Timbre.Complementos.ComercioExterior.Receptor.Referencia = Obj.Cliente.ReferenciaFiscal
Timbre.Complementos.ComercioExterior.Receptor.Municipio = ComExtMunicipio
Timbre.Complementos.ComercioExterior.Receptor.CP = ComExtCP
Timbre.Complementos.ComercioExterior.Receptor.Estado = ComExtEstado
Timbre.Complementos.ComercioExterior.Receptor.Pais = ComExtPais
Timbre.Receptor.ResidenciaFiscal = Obj.Cliente.ClaveSATPais
Timbre.Receptor.NumeroRegistroTributario = Obj.Cliente.NumRegIdTrib
@@ -12771,23 +12786,23 @@ Partial Class Ventas
If RowDireccion IsNot Nothing Then
Timbre.Complementos.ComercioExterior11.Destinatario.Nombre = RowDireccion("EnvioContacto").ToString()
Timbre.Complementos.ComercioExterior11.Destinatario.Calle = RowDireccion("EnvioDireccion").ToString()
Timbre.Complementos.ComercioExterior11.Destinatario.NumeroExterior = RowDireccion("EnvioNoExt").ToString()
Timbre.Complementos.ComercioExterior11.Destinatario.NumeroInterior = ""
Timbre.Complementos.ComercioExterior11.Destinatario.Colonia = ""
Timbre.Complementos.ComercioExterior11.Destinatario.Localidad = RowDireccion("NombreLocalidad").ToString()
Timbre.Complementos.ComercioExterior11.Destinatario.Referencia = ""
Timbre.Complementos.ComercioExterior11.Destinatario.Municipio = RowDireccion("NombreMunicipio").ToString()
Timbre.Complementos.ComercioExterior11.Destinatario.CP = RowDireccion("EnvioCP").ToString()
Timbre.Complementos.ComercioExterior11.Destinatario.Estado = RowDireccion("NombreEstado").ToString()
Timbre.Complementos.ComercioExterior11.Destinatario.Pais = RowDireccion("ClaveSATPais").ToString()
Timbre.Complementos.ComercioExterior11.Destinatario.NumRegIdTrib = RowDireccion("COM_NumRegIdTrib").ToString()
Timbre.Complementos.ComercioExterior.Destinatario.Nombre = RowDireccion("EnvioContacto").ToString()
Timbre.Complementos.ComercioExterior.Destinatario.Calle = RowDireccion("EnvioDireccion").ToString()
Timbre.Complementos.ComercioExterior.Destinatario.NumeroExterior = RowDireccion("EnvioNoExt").ToString()
Timbre.Complementos.ComercioExterior.Destinatario.NumeroInterior = ""
Timbre.Complementos.ComercioExterior.Destinatario.Colonia = ""
Timbre.Complementos.ComercioExterior.Destinatario.Localidad = RowDireccion("NombreLocalidad").ToString()
Timbre.Complementos.ComercioExterior.Destinatario.Referencia = ""
Timbre.Complementos.ComercioExterior.Destinatario.Municipio = RowDireccion("NombreMunicipio").ToString()
Timbre.Complementos.ComercioExterior.Destinatario.CP = RowDireccion("EnvioCP").ToString()
Timbre.Complementos.ComercioExterior.Destinatario.Estado = RowDireccion("NombreEstado").ToString()
Timbre.Complementos.ComercioExterior.Destinatario.Pais = RowDireccion("ClaveSATPais").ToString()
Timbre.Complementos.ComercioExterior.Destinatario.NumRegIdTrib = RowDireccion("COM_NumRegIdTrib").ToString()
End If
Else
Timbre.Complementos.ComercioExterior11.Destinatario = Nothing
Timbre.Complementos.ComercioExterior.Destinatario = Nothing
End If
'MERCANCIAS
@@ -12802,12 +12817,12 @@ Partial Class Ventas
mercancia.DescripcionesEspecificas.Marca = Gvr.FCTextBox("TxtMarca").Text
End If
Timbre.Complementos.ComercioExterior11.Mercancias.Add(mercancia)
Timbre.Complementos.ComercioExterior.Mercancias.Add(mercancia)
i += 1
Next
Else
Timbre.Complementos.ComercioExterior11.AplicaComercioExteriorSubProyecto = False
Timbre.Complementos.ComercioExterior.AplicaComercioExteriorSubProyecto = False
End If
Return Timbre
@@ -13410,7 +13425,7 @@ Partial Class Ventas
CveContratoDetalle:=Row("CveContratoDetalle").ToString().ToEntero(), CvePromocionDetalle:=Row("CvePromocionDetalle").ToString().ToEntero(), IEPS:=Row("ImporteIEPS").ToString().ToDecimal, CveMovimientoDetallePedido:=Row("CveMovimientoDetallePedido").ToString().ToEntero(), ImporteRetIVA:=Row("ImporteRetIVA").ToString().ToDecimal, ImporteRetISR:=Row("ImporteRetISR").ToString().ToDecimal,
PorcentajeIVA:=Row("PorcentajeIVA").ToString().ToDecimal, PorcentajeIEPS:=Row("PorcentajeIEPS").ToString().ToDecimal, PorcentajeRetIVA:=Row("PorcentajeRetIVA").ToString().ToDecimal,
PorcentajeRetISR:=Row("PorcentajeRetISR").ToString().ToDecimal, CuentaPredial:=Row("CuentaPredial").ToString(), CvePrecioLista:=Row("CvePrecioLista").ToString().ToEntero(),
CveActivoFijo:=Row("CveActivoFijo").ToString().ToEntero(), NumTurnos:=Row("NumTurnos").ToString().ToDecimal(), EstatusAlmacen:=EsatusAlmacen) Then
CveActivoFijo:=Row("CveActivoFijo").ToString().ToEntero(), NumTurnos:=Row("NumTurnos").ToString().ToDecimal(), EstatusAlmacen:=EsatusAlmacen, CantidadConversion:=Row("CantidadConversion").ToString().ToDecimal()) Then
ErrorList.Add("Ocurrió un error al agregar un Producto o Servicio a la Factura.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
Exit For
Else
@@ -13637,19 +13652,12 @@ Partial Class Ventas
GeneraOS(ObjVentas.IniciaTransacSQL, ErrorList, CveVentaOS:=factura.CveVenta, SerieFolioOS:=factura.SerieFolio)
If ErrorList.Count = 0 Then
If Not ObjOS.UpdateVentaOS(factura.CveVenta, CveOSVentaMedica) Then
ErrorList.Add("Ocurrió un error al guardar la venta en Ordenes de Servicio")
End If
End If
If Not ObjVentas.SincronizacionProcedimientoProducto(DdlProcedimiento.SelectedValue.ToEntero, factura.CveVenta, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
ErrorList.Add("Ocurrió un error al guardar los productos al procedimiento")
End If
End If
'Si viene de OS, Se guarda CveVenta en OS
If CveOS > 0 Then
If Not ObjOS.UpdateVentaOS(factura.CveVenta, CveOS) Then
@@ -15836,22 +15844,23 @@ Partial Class Ventas
End If
If e.Row.DBCampo("Tipo").ToString() = "NC" And e.Row.DataKey("CveVenta").ToString().ToEntero() > 0 OrElse (e.Row.DBCampo("Tipo").ToString() = "Ant" And e.Row.DataKey("CveMoneda").ToString().ToEntero() = 1 AndAlso DdlMoneda.SelectedValue.ToEntero() = 2) Then
If e.Row.DBCampo("Tipo").ToString() = "NC" And e.Row.DataKey("CveVenta").ToEntero() > 0 OrElse (e.Row.DBCampo("Tipo").Contiene("Ant", "IxC") And e.Row.DataKey("CveMoneda").ToEntero() = 1 AndAlso DdlMoneda.SelectedValue.ToEntero() = 2) Then
'If e.Row.DBCampo("CveMoneda").ToString().ToEntero() = 2 Then
' tipoCambio = e.Row.DBCampo("TipoCambioHoy").ToString().ToDecimal
'Else
' tipoCambio = GlobalTipoCambio(e.Row.DataKey("Fecha").ToString().ToDate).ToDecimal
'End If
tipoCambio = e.Row.DBCampo("TipoCambioHoy").ToString().ToDecimal
If TxtFechaAnticipoCliente.Text = "" Then TxtFechaAnticipoCliente.Text = Now.ToShortDateString
tipoCambio = GlobalTipoCambio(TxtFechaAnticipoCliente.Text.ToDate).ToDecimal 'e.Row.DBCampo("TipoCambioHoy").ToString().ToDecimal
e.Row.FCTextBox("TxtTC" & e.Row.RowIndex).Text = tipoCambio.FormatoNumero(4)
If DdlMoneda.SelectedValue.ToEntero() = 1 And e.Row.DBCampo("CveMoneda").ToString().ToEntero() = 1 Then
If DdlMoneda.SelectedValue.ToEntero() = 1 And e.Row.DBCampo("CveMoneda").ToEntero() = 1 Then
saldo = e.Row.DataKey("Saldo").ToDecimal
ElseIf DdlMoneda.SelectedValue.ToEntero() = 2 And e.Row.DBCampo("CveMoneda").ToString().ToEntero() = 1 And tipoCambio > 0 Then
saldo = (e.Row.DataKey("Saldo").ToString().ToDecimal / tipoCambio)
ElseIf DdlMoneda.SelectedValue.ToEntero() = 1 And e.Row.DBCampo("CveMoneda").ToString().ToEntero() = 2 Then
saldo = (e.Row.DataKey("Saldo").ToString().ToDecimal * tipoCambio)
ElseIf DdlMoneda.SelectedValue.ToEntero() = 2 And e.Row.DBCampo("CveMoneda").ToEntero() = 1 And tipoCambio > 0 Then
saldo = (e.Row.DataKey("Saldo").ToString().ToDecimal / tipoCambio).TruncateDecimal
ElseIf DdlMoneda.SelectedValue.ToEntero() = 1 And e.Row.DBCampo("CveMoneda").ToEntero() = 2 Then
saldo = (e.Row.DataKey("Saldo").ToString().ToDecimal * tipoCambio).TruncateDecimal
Else
saldo = e.Row.DataKey("Saldo").ToDecimal
End If
@@ -16047,12 +16056,12 @@ Partial Class Ventas
importeMN = importeMovimiento * gvr.DataKey("TipoCambio").ToString().ToDecimal
TC = gvr.DataKey("TipoCambio").ToString().ToDecimal
ElseIf CveMonedaVenta = 1 And gvr.DataKey("CveMoneda").ToEntero = 2 Then
importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / gvr.FCTextBox("TxtTC" & gvr.RowIndex).Text.ToDecimal
importeMN = importeMovimiento * gvr.FCTextBox("TxtTC" & gvr.RowIndex).Text.ToDecimal
importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal
importeMN = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / gvr.FCTextBox("TxtTC" & gvr.RowIndex).Text.ToDecimal
TC = TipoCambioFluctuacion
ElseIf CveMonedaVenta = 2 And gvr.DataKey("CveMoneda").ToEntero = 1 Then
importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal * gvr.FCTextBox("TxtTC" & gvr.RowIndex).Text.ToDecimal
importeMN = importeMovimiento
importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal
importeMN = importeMovimiento * gvr.FCTextBox("TxtTC" & gvr.RowIndex).Text.ToDecimal
TC = gvr.DataKey("TipoCambio").ToString().ToDecimal
End If
importeMovimiento = importeMovimiento.RoundSQL
@@ -16064,7 +16073,7 @@ Partial Class Ventas
Pago.Fecha = TxtFechaAnticipoCliente.Text.ToDate
Pago.FechaDocumentoRelacionado = gvr.DataKey("Fecha").ToDate
Pago.ImportePagoVenta = importeMovimiento
Pago.ImportePago = importeMovimiento
Pago.ImportePago = importeMN
Pago.CveIE = CveIEAnticipo
Pago.CveMonedaPago = gvr.DataKey("CveMoneda").ToEntero()
Pago.TCPago = gvr.DataKey("TipoCambio").ToDecimal
@@ -16072,7 +16081,6 @@ Partial Class Ventas
Pago.CveVentaAmortizacion = gvr.DataKey("CveVenta").ToEntero()
Pago.AplicaTraslado = gvr.DataKey("RegresarImpuesto") = "1"
Pago.Referencia = gvr.DataKey("Folio")
'Pago.CveConceptoPago = 251
ErrorConta = AplicaPrePolizaPagoVenta(VentaActual, Pago, CvePrePoliza, ObjConta)
End If
@@ -16080,19 +16088,38 @@ Partial Class Ventas
Case "66"
If gvr.DataKey("CveIE").ToEntero() > 0 Then
importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal
'importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal
If CveMonedaVenta = 1 And gvr.DataKey("CveMoneda").ToEntero = 1 Then
importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal
importeMN = importeMovimiento
TC = gvr.DataKey("TipoCambio").ToString().ToDecimal
ElseIf CveMonedaVenta = 2 And gvr.DataKey("CveMoneda").ToEntero = 2 Then
importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal
importeMN = importeMovimiento * gvr.DataKey("TipoCambio").ToString().ToDecimal
TC = gvr.DataKey("TipoCambio").ToString().ToDecimal
ElseIf CveMonedaVenta = 1 And gvr.DataKey("CveMoneda").ToEntero = 2 Then
importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / gvr.FCTextBox("TxtTC" & gvr.RowIndex).Text.ToDecimal
importeMN = importeMovimiento * gvr.FCTextBox("TxtTC" & gvr.RowIndex).Text.ToDecimal
TC = TipoCambioFluctuacion
ElseIf CveMonedaVenta = 2 And gvr.DataKey("CveMoneda").ToEntero = 1 Then
importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal
importeMN = importeMovimiento * gvr.FCTextBox("TxtTC" & gvr.RowIndex).Text.ToDecimal
TC = gvr.DataKey("TipoCambio").ToString().ToDecimal
End If
importeMovimiento = importeMovimiento.RoundSQL
importeMN = importeMN.RoundSQL
If importeMovimiento <> 0 Then
Dim Pago As New VentaPago
Pago.ImportePagoVenta = importeMovimiento
Pago.ImportePago = importeMovimiento
Pago.ImportePago = importeMN
Pago.CveIE = CveIEAnticipo
Pago.CveMonedaPago = gvr.DataKey("CveMoneda").ToEntero()
Pago.TCPago = gvr.DataKey("TipoCambio").ToDecimal
Pago.TipoPago = "I"
Pago.FechaDocumentoRelacionado = gvr.DataKey("Fecha").ToDate
Pago.CveVentaAmortizacion = gvr.DataKey("CveVenta").ToEntero()
Pago.AplicaTraslado = gvr.DataKey("RegresarImpuesto") = "1"
Pago.AplicaTraslado = True
Pago.Referencia = gvr.DataKey("Folio")
Pago.CveClientePago = gvr.DataKey("CveCliente").ToEntero()
@@ -16734,6 +16761,9 @@ Partial Class Ventas
If EsVentaMedica Then
TxtPrecio.Enabled = False
If UsuarioActual.CveUsuario = 3986 Then
TxtPrecio.Enabled = True
End If
Else
If drPS("CveTipoPS").ToString() = "1" Then 'Si es servicio
If UsuarioActual.Empresa.Funcionalidad(558).ToString() = "1" Then 'Si es Empresa llantera
@@ -17591,7 +17621,7 @@ Partial Class Ventas
' NO VALIDA EXISTENCIAS NI COSTO - PERMISO PARA NO VALIDAR
If Not UsuarioActual.TienePermisoProceso(169) Then
'SOLO VALIDA EXISTENCIAS Y COSTO: SI USA INVENTARIOS, SOLO PRODUCTOS TIPO PRODUCTO, SOLO REMISIONES E INGRESOS
If UsuarioActual.Empresa.UsaInventarios AndAlso CveTipoPS = 2 AndAlso (DdlTipoComprobante.SelectedValue.Contiene("Rem", "Ing", "PA") Or (DdlTipoComprobante.SelectedValue.Contiene("Cot") And UsuarioActual.CveEmpresa.Contiene(119))) Then
If UsuarioActual.Empresa.UsaInventarios AndAlso CveTipoPS = 2 AndAlso (DdlTipoComprobante.SelectedValue.Contiene("Rem", "Ing", "PA") OrElse ((DdlTipoComprobante.SelectedValue.Contiene("Cot") And UsuarioActual.CveEmpresa.Contiene(119)) OrElse (DdlTipoComprobante.SelectedValue.Contiene("Ped") And UsuarioActual.CveEmpresa.Contiene(186)))) Then
Dim ObjInventarios As New ClsInventarios
Dim Existencia As Decimal = ObjInventarios.GetExistenciasPS(CvePS, CveUM, UsuarioActual.CveEmpresa, -1, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeAdelantado:=1, PendientePorSurtir:=1, RestringirAlmacenes:=1, ExcluyeApartados:=-1)
Dim Costo As Decimal = ObjInventarios.GetCostoPS(CvePS, TxtCantidad.Text.Trim.ToDecimal, -1, "-1", TxtFecha.Text.ToDate, DdlSubProyectoDatos.SelectedValue.ToEntero(), CveTipoAlmacen:=1)
@@ -18174,7 +18204,7 @@ Partial Class Ventas
Optional CveOrdenCompraDetalle As Integer = 0, Optional CveVentaDetalleRemision As Integer = 0, Optional CveVentaDetalleCotizacion As Integer = 0, Optional CuentaPredial As String = "",
Optional RegeneraIEPS As Boolean = True, Optional CveVentaDetallePedido2 As Integer = 0, Optional SeActualiza As Boolean = False, Optional CvePromocionDetalle As Integer = -1, Optional EsCargo As Boolean = False,
Optional ImporteProntoPago As Decimal = 0, Optional ByRef ObjDescuento As Modelos.VentaDescuentos = Nothing, Optional CvePrecioLista As Integer = -1, Optional PrecioLista As String = "",
Optional CveActivoFijo As Integer = -1, Optional AFDepreciacion As Decimal = 0D, Optional AFValorInicial As Decimal = 0D, Optional NumTurnos As Decimal = 0D) As Boolean
Optional CveActivoFijo As Integer = -1, Optional AFDepreciacion As Decimal = 0D, Optional AFValorInicial As Decimal = 0D, Optional NumTurnos As Decimal = 0D, Optional CantidadConversion As Decimal = 0) As Boolean
Dim Retorno As Boolean = False
Try
@@ -18433,6 +18463,16 @@ Partial Class Ventas
Row("CodigoAlterno") = DrPS("CodigoAlterno")
Row("PSAlterno") = DrPS("PSAlterno")
'SI NO SE UTILIZA LA CONVERSION, UTILIZA LA CANTIDAD
If CantidadConversion = 0 Then
If DrPS("PesoKg").ToString().ToDecimal() > 0 Then
CantidadConversion = DrPS("PesoKg").ToString().ToDecimal()
Else
CantidadConversion = Cantidad
End If
End If
Row("CantidadConversion") = CantidadConversion
If UsuarioActual.CveEmpresa.Contiene(119, 13, 83) Then
If Not RemisionesLista.Count > 0 Then 'SI VIENE DE REMISION NO SE CONSIDERA
@@ -18679,7 +18719,9 @@ Partial Class Ventas
TmpDT.Columns.Add("CodigoAlterno", GetType(String))
TmpDT.Columns.Add("PSAlterno", GetType(String))
'USO PARA COMERCIO EXTERIOR
TmpDT.Columns.Add("CantidadConversion", GetType(Decimal))
TmpDT.Columns("CantidadConversion").DefaultValue = 0
End Sub
Private Sub CreaDTmpC()
DTmpC = New DataTable
@@ -19737,7 +19779,7 @@ Partial Class Ventas
If DtMovimientos.Rows.Count > 0 Then
Dim GeneroMovimientoAlmacen As Boolean = False
TieneMovimientosServicioDomicilio = DtMovimientosDetalles.COUNT("CveTipoAlmacen", "CveTipoAlmacen=29") > 0
TieneMovimientosServicioDomicilio = DtMovimientosDetalles.COUNT("CveTipoAlmacen", "CveTipoAlmacen IN (29,4)") > 0
TieneMovimientosSinCosto = DtMovimientosDetalles.COUNT("CveTipoAlmacen", "CveTipoAlmacen=26") > 0
@@ -19766,7 +19808,7 @@ Partial Class Ventas
If (CveAlmacenEntrada > 0 AndAlso CveTipoAlmacen <> 1) Or RemisionesLista.Count = 0 Then 'Con remisiones parciales ignoramos las surtidas ya realizadas
Dim MovDetalle As New DataTable
Dim AplicaMovimientoDetalleEntrada As Boolean = False
Dim AplicaMovimientoDetalleEntrada As Boolean = True
If RemisionesLista.Count > 0 Then
AplicaMovimientoDetalleEntrada = True
@@ -19786,35 +19828,9 @@ Partial Class Ventas
If ErrorList.Count = 0 AndAlso MovDetalle.Rows.Count > 0 Then
Dim CveMovimientoSalidaPorTraspaso As Integer = -1
Dim CveConceptoSalidaAlmacen As Integer = 3
Dim CveAlmacenParaSalida As Integer = CveAlmacenEntrada
Dim CveConceptoSalidaAlmacen As Integer = 40 'SALIDA DEFINITIVA DEL SISTEMA
Dim CveAlmacenParaSalida As Integer = CveAlmacenSalida
'SALIDA DEFINITIVA DEL SISTEMA
If UsuarioActual.Empresa.Funcionalidad(575) = "1" Then
CveConceptoSalidaAlmacen = 40
CveAlmacenParaSalida = CveAlmacenSalida
AplicaMovimientoDetalleEntrada = True
Else
'Le damos salida de apartado por traspaso
CveMovimientoSalidaPorTraspaso = GenerarMovimientoAlmacen(ObjInventario, MovDetalle, CveAlmacenSalida, 8, CveMoneda, CveRemision, AplicaMovimientoDetalleEntrada:=AplicaMovimientoDetalleEntrada, ObjConta:=ObjConta)
If Not CveMovimientoSalidaPorTraspaso > 0 Then
OcurrioError = True
Exit For
End If
'Le damos entrada al general por traspaso
If Not OcurrioError Then
GeneroMovimientoAlmacen = GenerarMovimientoAlmacen(ObjInventario, MovDetalle, CveAlmacenEntrada, 9, CveMoneda, CveRemision, CveMovimientoRelacionado:=CveMovimientoSalidaPorTraspaso, AplicaMovimientoDetalleEntrada:=AplicaMovimientoDetalleEntrada, ObjConta:=ObjConta) > 0
If Not GeneroMovimientoAlmacen Then
OcurrioError = True
Exit For
End If
End If
End If
'Le damos salida normal
If ConSalida AndAlso Not OcurrioError Then
@@ -19976,7 +19992,7 @@ Partial Class Ventas
If DtMovimientos.Rows.Count > 0 Then
Dim GeneroMovimientoAlmacen As Boolean = False
TieneMovimientosServicioDomicilio = DtMovimientosDetalles.COUNT("CveTipoAlmacen", "CveTipoAlmacen=29") > 0
TieneMovimientosServicioDomicilio = DtMovimientosDetalles.COUNT("CveTipoAlmacen", "CveTipoAlmacen IN (29,4)") > 0
TieneMovimientosSinCosto = DtMovimientosDetalles.COUNT("CveTipoAlmacen", "CveTipoAlmacen=26") > 0
@@ -21661,6 +21677,9 @@ Partial Class Ventas
If EsVentaMedica Then
TxtPrecio.Enabled = False
If UsuarioActual.CveUsuario = 3986 Then
TxtPrecio.Enabled = True
End If
Else
TxtPrecio.Enabled = True
End If
@@ -21676,6 +21695,12 @@ Partial Class Ventas
DdlMetodoPago33.Enabled = True
End If
If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then
If DdlMedico.SelectedValue.ToEntero() > 0 Then
TxtFechaOS.Enabled = True
End If
End If
UPPVentas.Update()
UpPS.Update()
UpCliente.Update()
@@ -21769,16 +21794,29 @@ Partial Class Ventas
Moneda = 1
End If
Dim FechaParaSurtir As DateTime = MinFecha
If TxtFechaOS.Text.Replace(",", "").ToDateTime() > MinFecha Then
FechaParaSurtir = TxtFechaOS.Text.Replace(",", "").ToDateTime()
End If
If Not ObjVentas.UpdateVentas(TxtSubTotal.Text.ToDecimal, LblDescuentos.Text.ToDecimal, TxtIVA.Text.ToDecimal, TxtIEPS.Text.ToDecimal, TxtTotal.Text.ToDecimal, Moneda, TipoCambio, TxtFecha.Text.Trim.ToDate, TxtObsFact.Text.Trim,
UsuarioActual.CveEmpresa, CveVenta,
Vigencia:=TxtFechaVencimientoCotizacion.Text.Trim.ToDate, CondicionesPago:=If(RBLPago.SelectedValue = "2", 0, 1),
PedidoContrato:=TxtPedidoContrato.Text, AtencionA:=TxtAtencionA.Text.Trim, CveMetodoPago33:=DdlMetodoPago33.SelectedValue.ToEntero(),
CveFormaPago33:=DdlFormaPago33.SelectedValue.ToEntero(), TipoDocto:=DdlTipoComprobante.SelectedValue, CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal,
OrdenCompra:=TxtOrdenCompra.Text, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, Kilometraje:=TxtKilometraje.Text.ToDecimal, CveUsoCFDi:=DdlUsoCFDI.SelectedValue.ToEntero(),
CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), ServicioDomicilio:=TrServicioDomicilio.Visible, CveMedico:=DdlMedico.SelectedValue.ToEntero, CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero) Then
CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), ServicioDomicilio:=TrServicioDomicilio.Visible, CveMedico:=DdlMedico.SelectedValue.ToEntero, CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero, FechaParaSurtir:=FechaParaSurtir) Then
OcurrioError = True
End If
If Not OcurrioError Then
If DdlMedico.SelectedValue.ToEntero() > 0 AndAlso TxtFechaOS.Text.Replace(",", "").ToDateTime() > MinFecha Then
If Not ObjVentas.UpdateFechaOSVenta(CveVenta, FechaParaSurtir, UsuarioActual.CveEmpresa) Then
OcurrioError = True
End If
End If
End If
'Cargo de nueva cuenta el detalle de Ventas (Conceptos)
If Not OcurrioError Then
Dim index As Integer = 0
@@ -29650,6 +29688,24 @@ Partial Class Ventas
Protected Sub GvComercioExterior_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
Dim CantidadConversion = CDbl(e.Row.DBCampo("CantidadConversion"))
Dim CantidadBase = CDbl(e.Row.DBCampo("Cantidad"))
Dim PUBase = CDbl(e.Row.DBCampo("PU"))
Dim TotalUSD = (CantidadBase * PUBase)
e.Row.FCLabel("LblTotalUSD").Text = TotalUSD.ToString("N2")
If CantidadConversion <> CantidadBase Then
If CantidadConversion > 0 Then
e.Row.FCTextBox("TxtValorUnitario").Text = (TotalUSD / CantidadConversion).ToString("N6")
Else
e.Row.FCTextBox("TxtValorUnitario").Text = PUBase.ToString("N2")
End If
Else
e.Row.FCTextBox("TxtValorUnitario").Text = PUBase.ToString("N2")
End If
e.Row.FCTextBox("TxtValorUnitario").Attributes.Add("onkeyup", $"CalculaTotalUSD({e.Row.FCLabel("LblTotalUSD").ClientID}, this,{e.Row.FCTextBox("TxtCantidad").ClientID});")
End If
End Sub
@@ -33603,6 +33659,12 @@ Partial Class Ventas
TxtDescripcionVenta.Enabled = True
If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then
If DdlMedico.SelectedValue.ToEntero() > 0 Then
TxtFechaOS.Enabled = True
End If
End If
UpCliente.Update()
UpParametros.Update()
UPObservaciones.Update()
@@ -33624,12 +33686,25 @@ Partial Class Ventas
'DdlMedicoObservaciones.Enabled = True
'DdlProcedimientoObservaciones.Enabled = True
Dim FechaParaSurtir As DateTime = MinFecha
If TxtFechaOS.Text.Replace(",", "").ToDateTime() > MinFecha Then
FechaParaSurtir = TxtFechaOS.Text.Replace(",", "").ToDateTime()
End If
If Not ObjVentas.UpdateObservacionesVenta(Me.CveVenta, UsuarioActual.CveEmpresa, DdlVendedor.SelectedValue.ToEntero(), TxtObsFact.Text, RblPaqueteria.SelectedValue.ToEntero(), TxtCorreoNotificaciones.Text,
TxtObsAlmacen.Text, TxtPedidoContrato.Text, TxtOrdenCompra.Text, TxtFechaPago.Text, DdlUsoCFDI.SelectedValue.ToEntero, DescripcionVenta:=TxtDescripcionVenta.Text.Trim,
CveMedico:=DdlMedico.SelectedValue.ToEntero, CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero) Then
CveMedico:=DdlMedico.SelectedValue.ToEntero, CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero, FechaParaSurtir:=FechaParaSurtir) Then
TieneError = True
End If
If Not TieneError Then
If DdlMedico.SelectedValue.ToEntero() > 0 AndAlso FechaParaSurtir > MinFecha Then
If Not ObjVentas.UpdateFechaOSVenta(CveVenta, FechaParaSurtir, UsuarioActual.CveEmpresa) Then
TieneError = True
End If
End If
End If
If Not TieneError AndAlso AplicaUpdateTC Then
If Not ObjVentas.UpdateVentaTC(Me.CveVenta, UsuarioActual.CveEmpresa, TxtTipoCambio.Text.ToDecimal()) Then
TieneError = True
@@ -36373,7 +36448,7 @@ Partial Class Ventas
Dim EstatusOrdenServicio As Integer = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveEstatusOrdenServicio", "TipoEstatus = 1").ToEntero
If ObjOrdenServicio.AddOrdenesServicios(CveCliente, DdlSubProyectoDatos.SelectedValue.ToEntero, UsuarioActual.Nombre, TxtFechaOS.Text.Replace(",", "").ToDateTime, $"Venta: {LblSerie.Text}-{TxtFolio.Text}", UsuarioActual.CveUsuario, EstatusOrdenServicio,
UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, CveOSTipo, CveClienteSucursal:=DdlSucursalCliente.SelectedValue.ToEntero,
UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVentaOS, -1, -1, CveOSTipo, CveClienteSucursal:=DdlSucursalCliente.SelectedValue.ToEntero,
Direccion:="", Telefono:="", CveModeloAuto:=-1, Año:="", CveMedico:=DdlMedico.SelectedValue.ToEntero,
CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero, CveTipoVenta:=RBLTipoVenta.SelectedValue.ToEntero, FechaCita:=TxtFechaOS.Text.Replace(",", "").ToDateTime) Then
CveOSVentaMedica = ObjOrdenServicio.CveOS
@@ -36393,10 +36468,10 @@ Partial Class Ventas
Dim CveOsDetalle = ObjOrdenServicio.AddOrdenesServiciosDetalle(ObjOrdenServicio.CveOS, CvePSDetalle, 1, -1, -1, $"Venta: {LblSerie.Text}-{TxtFolio.Text}", False, True, False, -1, "-1", "-1", "-1", "", UsuarioActual.CveUsuario, Archivo:="")
If CveOsDetalle > 0 Then
MensajeAlert.AppendFormat(String.Format("<br/>La Orden de Servicio: <b>{0}</b> se generó correctamente.<br/>", ObjOrdenServicio.Folio))
MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF</a></li></ul><br/>", Encripta(String.Format("OP=OS&CVEOS={0}", ObjOrdenServicio.CveOS)))
Else
If Not CveOsDetalle > 0 Then
' MensajeAlert.AppendFormat(String.Format("<br/>La Orden de Servicio: <b>{0}</b> se generó correctamente.<br/>", ObjOrdenServicio.Folio))
' MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF</a></li></ul><br/>", Encripta(String.Format("OP=OS&CVEOS={0}", ObjOrdenServicio.CveOS)))
'Else
errorList.Add("Se presento un error al guardar la el detalle de la orden de servicio.")
Errores = True
End If
@@ -36491,5 +36566,9 @@ Partial Class Ventas
End If
End Sub
Protected Sub TxtFechaAnticipoCliente_TextChanged(sender As Object, e As EventArgs)
CargaAnticipos(CveCliente)
End Sub
End Class