diff --git a/App_Code/ClsBancos.vb b/App_Code/ClsBancos.vb index 25443bfa0..b95ac1cd8 100644 --- a/App_Code/ClsBancos.vb +++ b/App_Code/ClsBancos.vb @@ -171,8 +171,11 @@ Public Class ClsBancos Public Property FacturaProveedor As String Public Property FacturaSerieFolio As String Public Property FacturaDescripcion As String - Public Property FacturaFecha As Date + Public Property FacturaFecha As Date #End Region + + + Sub New(Optional TransaccionCompartida As SqlTransaction = Nothing) If TransaccionCompartida Is Nothing Then @@ -240,6 +243,18 @@ Public Class ClsBancos End Sub #End Region + + + Public Function ExisteConeccion() As Boolean + + If SqlTransacc.Connection Is Nothing Then + Return False + Else + Return True + End If + + End Function + Private Sub DataCommand(pStrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure) With SqlCommand .Parameters.Clear() @@ -1612,18 +1627,21 @@ Public Class ClsBancos With SqlAdapter.SelectCommand.Parameters .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario - .Add("@CveIE", SqlDbType.Int).Value = CveIE + .Add("@CveIE", SqlDbType.Int).Value = CveIE + .Add("@TerminoCorrecto", SqlDbType.Bit).Direction = ParameterDirection.Output End With Try - SqlAdapter.Fill(Data) - Retorno = True - 'Catch Ex1 As SqlException - ' If Ex1.Message.Contains("Número: 2627;") Then - ' Alert("Ya existe un Banco con el mismo nombre: " & Banco & ".", TipoMensaje.MsgAdvertencia) - ' Else - ' Me.OnError("Ocurrió un error al guardar los cambios en el Banco", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - ' End If + SqlAdapter.Fill(Data) + + + Retorno = Boolean.Parse(SqlAdapter.SelectCommand.Parameters("@TerminoCorrecto").Value.ToString) + + + 'Catch Ex1 As SqlException + + ' Me.OnError("Ocurrió un error al guardar los cambios en el Banco", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception OnError("Ocurrió un error al cancelar el movimiento en bancos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) End Try diff --git a/App_Code/ClsClientes.vb b/App_Code/ClsClientes.vb index 6ffc5438a..2b603bb68 100644 --- a/App_Code/ClsClientes.vb +++ b/App_Code/ClsClientes.vb @@ -261,7 +261,7 @@ Public Class ClsClientes End Sub Public Function GetClientes(CveCliente As Integer, Nombre As String, Codigo As String, NombreCorto As String, RFC As String, Telefono As String, Mail As String, CveSubProyecto As Integer, CveEmpresa As Integer, Optional Estatus As Integer = 1, Optional Notificar As String = "-1", Optional CvePrecioLista As Integer = -1, Optional CveClienteClasificacion As Integer = -1, - Optional TipoCliente As Integer = 1, Optional CveVendedor As Integer = -1, Optional PermiteCreditoFiltro As Integer = -1) As Boolean + Optional TipoCliente As Integer = -1, Optional CveVendedor As Integer = -1, Optional PermiteCreditoFiltro As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_ClientesGet") diff --git a/App_Code/ClsCompras.vb b/App_Code/ClsCompras.vb index ce3783cd5..68ed6f984 100644 --- a/App_Code/ClsCompras.vb +++ b/App_Code/ClsCompras.vb @@ -2997,9 +2997,51 @@ Public Class ClsCompras OnError("Ocurrió un error al obtener las compras con método de pago PUE.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) End Try Return retorno - End Function - + End Function + #End Region +#Region "Reporte de REQ-OC-Compra-Inv" + Public Function GetRepReqOCCompraInv(FI As Date, FF As Date, CveProveedor As Integer, CveSubProyecto As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Comp_ReqOCCompraInvGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@FI", SqlDbType.Date).Value = FI + .Add("@FF", SqlDbType.Date).Value = FF + .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el reporte de REQ-OC-Compra-Inv", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function +#End Region +#Region "Reporte de Precios de Compras" + Public Function GetRepComprasPrecios(CveProveedor As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Comp_ComprasPreciosGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el reporte de Precios de Compras.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + End Function +#End Region End Class diff --git a/App_Code/ClsGenerales.vb b/App_Code/ClsGenerales.vb index 86122f871..23bdee732 100644 --- a/App_Code/ClsGenerales.vb +++ b/App_Code/ClsGenerales.vb @@ -2926,5 +2926,66 @@ Public Class ClsGenerales End Sub #End Region +#Region " P O L I Z A V I R T U A L " + Public Function ModelosAutosGet(CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Gral_ModelosAutosGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener los Modelos de Autos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + + Public Function MarcasAutosGet(CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Gral_MarcasAutosGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener las Marcas de Autos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + + Public Function MarcasUsadoGet(CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Gral_MarcasUsadoGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener las Marcas de Usados.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + + Public Function BCIUsadoGet(CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Gral_BCIUsadoGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener los BCI de Usados.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function +#End Region End Class diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 39e5d6f62..55e577b76 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -3757,15 +3757,16 @@ Public Class ClsPaginas PaginaDict.Add("/Compras/ProveedoresAuxiliar.aspx".ToUpper(), 536) PaginaDict.Add("/Compras/RepComprasInventarios.aspx".ToUpper(), 537) PaginaDict.Add("/Compras/RepAnt-NC-EXC.aspx".ToUpper(), 538) - PaginaDict.Add("/Compras/RepAnt-NC-EXCDetalle.aspx".ToUpper(), 538) - 'EvaluacionProveedor.aspx - PaginaDict.Add("/Compras/EvaluacionProveedor.aspx".ToUpper(), 715) - PaginaDict.Add("/Compras/RepPUESinPago.aspx".ToUpper(), 675) + PaginaDict.Add("/Compras/RepAnt-NC-EXCDetalle.aspx".ToUpper(), 538) + PaginaDict.Add("/Compras/EvaluacionProveedor.aspx".ToUpper(), 715) 'EvaluacionProveedor.aspx + PaginaDict.Add("/Compras/RepPUESinPago.aspx".ToUpper(), 675) + PaginaDict.Add("/Compras/RepReqOCCompraInv.aspx".ToUpper(), 689) + PaginaDict.Add("/Compras/RepComprasPrecios.aspx".ToUpper(), 690) #End Region - - 'CONTABILIDAD + + 'CONTABILIDAD #Region "Contabilidad" - 'CONTABILIDAD ELECTRONICA + 'CONTABILIDAD ELECTRONICA PaginaDict.Add("/Contabilidad/ContabilidadElectronica.aspx".ToUpper(), 566) PaginaDict.Add("/Contabilidad/RepGastosCC.aspx".ToUpper(), 535) PaginaDict.Add("/Contabilidad/ContabilizarPagosCliente.aspx".ToUpper(), 52) @@ -6698,10 +6699,12 @@ Public Class ClsPaginas 'If EmpresaActual = 48 Then ' nombreautorizo = "Lic. LUIS JORGE CONTRERAS LANDGRAVE" 'End If - + Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos\OC.rdlc", EmpresaActual.Ruta)) + If Not Archivo.Exists OrElse EmpresaActual.CveEmpresa.Contiene(4, 145, 7, 11, 12, 72, 80, 122, 126) Then + params.Add(New ReportParameter("Descuento", DtDetalle.SUM("Descuento").ToString.FormatoNumero(2))) + End If 'DATOS PARA DESCUENTO If EmpresaActual.CveEmpresa.Contiene(4, 145, 7, 11, 12, 72, 80, 122, 126) Then 'EMPRESAS QUE YA TIENEN EL AJUSTE EN EL FORMATO - params.Add(New ReportParameter("Descuento", DtDetalle.SUM("Descuento").ToString.FormatoNumero(2))) params.Add(New ReportParameter("SubTotal", ObjOC.SubTotal.ToString)) params.Add(New ReportParameter("SubTotal2", DtDetalle.SUM("Total").ToString)) Else @@ -6768,8 +6771,8 @@ Public Class ClsPaginas Dim FirmaSol As New System.IO.FileInfo(String.Format("{0}Firmas\{1}.png", EmpresaActual.Ruta, CveUsuarioSol)) params.Add(New ReportParameter("FirmaSolicito", If(FirmaSol.Exists, New Uri(Server.MapPath(String.Format("~/Empresas/{0}/Firmas/{1}.png", EmpresaActual.CveEmpresa, CveUsuarioSol))).AbsoluteUri, ""))) Dim FirmaAut As New System.IO.FileInfo(String.Format("{0}Firmas\{1}.png", EmpresaActual.Ruta, CveUsuarioAut)) - params.Add(New ReportParameter("FirmaAutorizo", If(FirmaAut.Exists, New Uri(Server.MapPath(String.Format("~/Empresas/{0}/Firmas/{1}.png", EmpresaActual.CveEmpresa, CveUsuarioAut))).AbsoluteUri, ""))) - Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos\OC.rdlc", EmpresaActual.Ruta)) + params.Add(New ReportParameter("FirmaAutorizo", If(FirmaAut.Exists, New Uri(Server.MapPath(String.Format("~/Empresas/{0}/Firmas/{1}.png", EmpresaActual.CveEmpresa, CveUsuarioAut))).AbsoluteUri, ""))) + If Archivo.Exists Then bytes = StreamPDF(String.Format("{0}Formatos\OC.rdlc", EmpresaActual.Ruta), DtDetalle, params, $"OC_{ObjOC.Folio.ToString}", RDSName:="DsOC", MR:=MR) Else diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 34e8e1235..f5d08a7ca 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -3976,7 +3976,7 @@ Public Class ClsVentas #Region " U S A D O S " - Public Function AddVentaUsado(CveVenta As Integer, CvePS As Integer, Cantidad As Decimal, PU As Decimal) As Boolean + Public Function AddVentaUsado(CveVenta As Integer, CvePS As Integer, Cantidad As Decimal, PU As Decimal, Optional CveBCI As Integer = -1, Optional CveModeloAuto As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_VentasUsadosAdd", CommandType.StoredProcedure) @@ -3986,6 +3986,8 @@ Public Class ClsVentas .Add("@CvePS", SqlDbType.Int).Value = CvePS .Add("@Cantidad", SqlDbType.Float).Value = Cantidad .Add("@PU", SqlDbType.Money).Value = PU + .Add("@CveBCI", SqlDbType.Int).Value = CveBCI + .Add("@CveModeloAuto", SqlDbType.Int).Value = CveModeloAuto End With Try diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index d1ecd1e37..2295f8946 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -1808,7 +1808,7 @@ Namespace Modelos If TipoDocto.Contiene("Rem") Then If DtRecepcionUsados IsNot Nothing Then For Each drow As DataRow In DtRecepcionUsados.Rows - If Not ObjVentas.AddVentaUsado(CveVenta, drow("CvePS").ToString.ToEntero, drow("Cantidad").ToString.ToDecimal, drow("PU").ToString.ToDecimal) Then + If Not ObjVentas.AddVentaUsado(CveVenta, drow("CvePS").ToString.ToEntero, drow("Cantidad").ToString.ToDecimal, drow("PU").ToString.ToDecimal, drow("CveBCIUsado").ToString.ToEntero, drow("CveModeloAuto").ToString.ToEntero) Then Resultado = False Exit For End If @@ -3823,13 +3823,6 @@ Namespace Modelos Dim TieneAlmacen As Boolean = False - 'If Not EsRefacturacion AndAlso ObjFactura.SaldoAlmacen <> 0 Then - ' Retorno.Mensaje = "El pedido no se puede cancelar ya que tiene movimientos de almacén.
Nota: Primero hay que hacer la devolución al almacén." - ' Retorno.TipoMensaje = TipoMensaje.MsgAdvertencia - - ' Return Retorno - 'End If - 'VALIDA QUE LA FACTURA NO TENGA PAGOS If ObjFactura.TipoDocto.Contiene("Ing", "Rem") AndAlso ObjFactura.Pagado > 0 Then Retorno.Mensaje = "La factura no se puede cancelar debido a que tiene pagos vinculados." @@ -3950,7 +3943,7 @@ Namespace Modelos If CveEstatusFacturaAsignado <= 0 Then Try If ObjFactura.FolioFiscal <> "" Then - If ObjFactura.TipoDocto.Contiene("Ing", "Ant", "Dev", "Egs") Then + If ObjFactura.TipoDocto.Contiene("Ing", "Ant", "Dev", "Egs", "RNC") Then Dim Vigencia = Timbrado.VerificarVigenciaSAT(FolioFiscal, UsuarioActual.Empresa.RFC, RFCReceptor, TotalT.ToString(), UsuarioActual.Empresa.FacturaProduccion) @@ -4096,7 +4089,7 @@ Namespace Modelos Try If ObjFactura.TipoDocto.Contiene("Egs", "Dev") Then CvePlantillaPoliza = 7 - ElseIf ObjFactura.TipoDocto.Contiene("Ing", "Rem", "Ant") Then + ElseIf ObjFactura.TipoDocto.Contiene("Ing", "Rem", "Ant", "RNC") Then CvePlantillaPoliza = 4 Else CvePlantillaPoliza = 4 @@ -4286,13 +4279,6 @@ Namespace Modelos End If End If - If Not ErrorCancelar Then - If Not GeneraMovimientosApartados(ObjInventario) Then - ErrorCancelar = True - MensajeError = "Ocurrió un error al guardar los movimientos de control de apartados" - End If - End If - 'DEVOLUCION REMISION - REGRESA LAS EXISTENCIAS A ENTREGA POR ADELANTADO SI LA FACTURA VIENE DE REMISION If Not ErrorCancelar AndAlso RevivirRemisiones Then If Not GeneraMovimientosEntregaPorAdelantadoRemision(CveMovimiento, ObjVentas, ObjInventario, DtDevRem, ListaRemisionesCancelar) Then @@ -4302,22 +4288,25 @@ Namespace Modelos End If If Not ErrorCancelar Then - 'QUEMA DEVOLUCION | QUEMA = LA QUITA DE PENDIENTE POR RECIBIR (DEVOLVER) - If CveMovimiento > 0 AndAlso RealizarDevolucionAlmacen Then - If Not ErrorCancelar Then - If Not ObjVentas.UpdateVentasDevolucionAlmacen(2, CveVenta) Then - MensajeError = "Ocurrió un error al hacer la devolucion. Por favor vuelva a intentar." - ErrorCancelar = True - End If - End If + If Not GeneraMovimientosApartados(ObjInventario) Then + ErrorCancelar = True + MensajeError = "Ocurrió un error al guardar los movimientos de control de apartados" + End If + End If - 'AGREGA BITACORA A VENTA - If Not ErrorCancelar Then - Dim MensajeBitacora = "Devuelta" - If Not ObjEventos.AddEventoBitacora(String.Format("Venta {2} en Folio: {1}", CveMovimiento, Folio, MensajeBitacora), "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveVenta) Then - ErrorCancelar = True - End If - End If + 'QUEMA DEVOLUCION | QUEMA = LA QUITA DE PENDIENTE POR RECIBIR (DEVOLVER) + If Not ErrorCancelar Then + If Not ObjVentas.UpdateVentasDevolucionAlmacen(2, CveVenta) Then + MensajeError = "Ocurrió un error al hacer la devolucion. Por favor vuelva a intentar." + ErrorCancelar = True + End If + End If + + 'AGREGA BITACORA A VENTA + If Not ErrorCancelar AndAlso RealizarDevolucionAlmacen AndAlso CveMovimiento > 0 Then + Dim MensajeBitacora = "Devuelta" + If Not ObjEventos.AddEventoBitacora(String.Format("Venta {2} en Folio: {1}", CveMovimiento, Folio, MensajeBitacora), "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveVenta) Then + ErrorCancelar = True End If End If @@ -4432,7 +4421,7 @@ Namespace Modelos End If Else If Not ObjVentas.UpdateEstatusFactura(CveEstatus, FolioFiscal, CancelacionAcuse, CancelacionFecha, CveVenta, IDPoliza, CvePAC:=CvePACCancelacion, CveEstatusRefacturacion:=CveEstatusRefacturacion, - CveUsuarioCambiaEstatus:=UsuarioActual.CveUsuario, FechaCambioEstatus:=Now.ToString("yyyy-MM-dd hh:mm:ss.mmm")) Then + CveUsuarioCambiaEstatus:=UsuarioActual.CveUsuario, FechaCambioEstatus:=Now.ToString("yyyy-MM-dd HH:mm:ss.mmm")) Then ErrorCancelar = True MensajeError = "Ocurrió un error al guardar el estatus de cancelación." End If @@ -4551,58 +4540,47 @@ Namespace Modelos Dim SeCancela As Boolean = (ListaRemisionesCancelar IsNot Nothing) AndAlso (ListaRemisionesCancelar.Any(Function(CveRemisionCancelar) CveRemisionCancelar = DrMovtos("CveRem").ToString.ToEntero())) If Not SeCancela Then + Dim ObjRem As New Modelos.Factura(UsuarioActual, DrMovtos("CveRem").ToString.ToEntero(), UsuarioActual.CveEmpresa) - CveAlmacenTraspasoDestinoDevRem = DrMovtos("CveAlmacenTraspasoDestino").ToString.ToEntero + If ObjRem.SaldoAlmacen = 0 Then + CveAlmacenTraspasoDestinoDevRem = DrMovtos("CveAlmacenTraspasoDestino").ToString.ToEntero - If Not CveAlmacenTraspasoDestinoDevRem > 0 Then - ErrorCancelar = True - Exit For - End If - - 'SALIDA GENERAL - CveMovimientoSalidaDevRem = ObjInventario.AddMovimiento(CveAlmacenDevolucion, 8, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, DrMovtos("CveRem").ToString.ToEntero, -1, -1, Observaciones:="", Guia:="", CveContrato:=CveContrato, CveMovimientoRelacionado:=CveMovimiento, CveAlmacenDestino:=CveAlmacenTraspasoDestinoDevRem) - FolioMovimientoSalidaDevRem = ObjInventario.Folio - - 'ENTRADA ADELANTADO - CveMovimientoEntradaDevRem = ObjInventario.AddMovimiento(CveAlmacenTraspasoDestinoDevRem, 9, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, DrMovtos("CveRem").ToString.ToEntero, -1, -1, Observaciones:="", Guia:="", CveContrato:=CveContrato, CveMovimientoRelacionado:=CveMovimientoSalidaDevRem, CveAlmacenDestino:=CveAlmacenDevolucion) - FolioMovimientoEntradaDevRem = ObjInventario.Folio - - If Not (CveMovimientoSalidaDevRem > 0 And CveMovimientoEntradaDevRem > 0) Then - ErrorCancelar = True - Exit For - End If - - 'SALIDA POR TRAPASO DE GENERAL - For Each DrRem As DataRow In DtDevRem.FiltraParametros($"CveRem = {DrMovtos("CveRem")}").Rows - CveVentaDetalleRem = DrRem("CveVentaDetalleRem").ToString.ToEntero - CantidadRem = DrRem("CantidadFacturada").ToString.ToDecimal - - If Not CveVentaDetalleRem > 0 Then + If Not CveAlmacenTraspasoDestinoDevRem > 0 Then ErrorCancelar = True Exit For End If - For Each Dr As DataRow In DtMovtosDev.FiltraParametros($"CveVentaDetalle = {DrRem("CveVentaDetalle").ToString.ToEntero}").Rows - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaDevRem, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDouble, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveVentaDetalle:=CveVentaDetalleRem, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString) Then + 'SALIDA GENERAL + CveMovimientoSalidaDevRem = ObjInventario.AddMovimiento(CveAlmacenDevolucion, 8, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, DrMovtos("CveRem").ToString.ToEntero, -1, -1, Observaciones:="", Guia:="", CveContrato:=CveContrato, CveMovimientoRelacionado:=CveMovimiento, CveAlmacenDestino:=CveAlmacenTraspasoDestinoDevRem) + FolioMovimientoSalidaDevRem = ObjInventario.Folio + + 'ENTRADA ADELANTADO + CveMovimientoEntradaDevRem = ObjInventario.AddMovimiento(CveAlmacenTraspasoDestinoDevRem, 9, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, DrMovtos("CveRem").ToString.ToEntero, -1, -1, Observaciones:="", Guia:="", CveContrato:=CveContrato, CveMovimientoRelacionado:=CveMovimientoSalidaDevRem, CveAlmacenDestino:=CveAlmacenDevolucion) + FolioMovimientoEntradaDevRem = ObjInventario.Folio + + If Not (CveMovimientoSalidaDevRem > 0 And CveMovimientoEntradaDevRem > 0) Then + ErrorCancelar = True + Exit For + End If + + 'SALIDA POR TRAPASO DE GENERAL + For Each DrRem As DataRow In DtDevRem.FiltraParametros($"CveRem = {DrMovtos("CveRem")}").Rows + CveVentaDetalleRem = DrRem("CveVentaDetalleRem").ToString.ToEntero + CantidadRem = DrRem("CantidadFacturada").ToString.ToDecimal + + If Not CveVentaDetalleRem > 0 Then ErrorCancelar = True Exit For End If - Next - If ErrorCancelar Then - Exit For - End If - Next + For Each Dr As DataRow In DtMovtosDev.FiltraParametros($"CveVentaDetalle = {DrRem("CveVentaDetalle").ToString.ToEntero}").Rows + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaDevRem, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDouble, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveVentaDetalle:=CveVentaDetalleRem, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString) Then + ErrorCancelar = True + Exit For + End If + Next - If ErrorCancelar Then - Exit For - End If - - 'ENTRADA POR TRAPASO A ENTREGA POR ADELANTADO - If ObjInventario.GetMovimientosDetalle(CveMovimientoSalidaDevRem, UsuarioActual.CveEmpresa) Then - For Each Dr As DataRow In ObjInventario.DtResultados.Rows - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaDevRem, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString) Then - ErrorCancelar = True + If ErrorCancelar Then Exit For End If Next @@ -4611,16 +4589,31 @@ Namespace Modelos Exit For End If - Else - ErrorCancelar = True - Exit For - End If + 'ENTRADA POR TRAPASO A ENTREGA POR ADELANTADO + If ObjInventario.GetMovimientosDetalle(CveMovimientoSalidaDevRem, UsuarioActual.CveEmpresa) Then + For Each Dr As DataRow In ObjInventario.DtResultados.Rows + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaDevRem, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString) Then + ErrorCancelar = True + Exit For + End If + Next + + If ErrorCancelar Then + Exit For + End If + + Else + ErrorCancelar = True + Exit For + End If - If Not ObjVentas.UpdateVentasDevolucionAlmacen(0, DrMovtos("CveRem").ToString.ToEntero) Then - ErrorCancelar = True - Exit For + If Not ObjVentas.UpdateVentasDevolucionAlmacen(0, DrMovtos("CveRem").ToString.ToEntero) Then + ErrorCancelar = True + Exit For + End If End If + ObjRem.Dispose() End If diff --git a/App_Code/Timbrado.vb b/App_Code/Timbrado.vb index f9fe5c1e1..dbb113a45 100644 --- a/App_Code/Timbrado.vb +++ b/App_Code/Timbrado.vb @@ -3228,10 +3228,24 @@ Public Class Timbrado Else + Dim Resultados = Newtonsoft.Json.Linq.JArray.Parse(resultadoTimbre.Detalle) + If Resultados.Count > 0 Then - Retorno = Resultados(0)("Value").ToString() - MensajeErrorCFDI = Resultados(0)("Value").ToString() + + If resultadoTimbre.Descripcion.Contains("RFC del receptor no existe") Then + + Retorno = $"El RFC { Resultados(0)("Value").ToString() } no existe en las bases de datos publicadas por el SAT, corrobore este dato con su cliente" + MensajeErrorCFDI = $"El RFC { Resultados(0)("Value").ToString() } no existe en las bases de datos publicadas por el SAT, corrobore este dato con su cliente" + + Else + + Retorno = Resultados(0)("Value").ToString() + MensajeErrorCFDI = Resultados(0)("Value").ToString() + + End If + + Else Retorno = resultadoTimbre.Detalle MensajeErrorCFDI = resultadoTimbre.Detalle diff --git a/Ashx/SIGFacturacion.ashx b/Ashx/SIGFacturacion.ashx index d016019c6..1246aac36 100644 --- a/Ashx/SIGFacturacion.ashx +++ b/Ashx/SIGFacturacion.ashx @@ -769,7 +769,7 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Using httpClient = New HttpClient() httpClient.Timeout = New TimeSpan(0, 15, 0) Using request = New HttpRequestMessage(HttpMethod.Get, Url) - request.Headers.Add("ADSToken", Encripta(String.Format("CVEEMPRESA={0}&TICKS={1}", CveEmpresa, DateTime.UtcNow.Ticks))) + request.Headers.Add("ADSToken", Encripta(String.Format("CVEEMPRESA={0}&TICKS={1}&CVEUSUARIO=100", CveEmpresa, DateTime.UtcNow.Ticks))) Dim response = httpClient.SendAsync(request).Result If response.StatusCode = Net.HttpStatusCode.OK Then File = response.Content.ReadAsByteArrayAsync().Result diff --git a/Bancos/IE.aspx b/Bancos/IE.aspx index 53489d4c4..3a606dd7c 100644 --- a/Bancos/IE.aspx +++ b/Bancos/IE.aspx @@ -1,1554 +1,1563 @@ -<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="IE.aspx.vb" Inherits="Bancos_IE" ValidateRequest="false" %> - - - - - - - - - - -   - - - -
  • - Listado Facturas Pagadas -
  • -
  • - Imprimir -
  • - - -
  • - Complemento Pago -
  • -
    -
    - -
  • - Actualizar Tipo Cambio -
  • - - <%--
  • - Emitir Complemento de Pago -
  • --%> - - - -
  • - Cheque Devuelto -
  • -
  • - Cancelar Movimiento -
  • -
  • - Eliminar Movimiento -
  • -
  • - Refacturar Complemento -
  • -
  • - Cancelar - - <%-- data-original-title="¿Está seguro que desea cancelar el documento?" data-btn-ok-label="si" Style="color: #686868;"> - -
  • -
    -
    - - - - -
  • - Contabilizar -
  • -
  • - Descontabilizar -
  • - -
    - - - - -
    - -
  • - Envíar Comprobante Mail -
  • - - - -
  • - Ajustar -
  • -
    -
    - -
    - - - - - -
    -
    -
    -
    -
    -
    - -   - - <%----%> Comprobante -   - -
    - -
    - - - - - -
    - -
    -
    - -
    - - - - - -
    -
    - - -
    -
    -
    - -
    - -
    -
    - -
    - -
    - -
    -
    -
    - - -
    -
    -
    - -
    - -
    -
    - - - - -
    - - - - - - - -
    -
    -
    - -
    - - - -
    -
    - -
    - $ - -
    -
    -
    -
    -
    Interes:
    -
    - $ - -
    -
    - -
    - -
    -
    - -
    - $ - - - -
    -
    - - - - -
    - - Clientes - Proveedor - Viaticos - Personal - - - - - - - - - - - - - - - - -
    -
    - -
    - - -
    -
    -
    -
    -
    - - - - -
    - -
    -
    -
    -
    - - - - - -
    -
    - -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    -
    - -
    - -
    -
    - -
    -
    -
    - - - -
    - -
    - - - - - -
    -
    -
    -
    - - - -
    - - -
    - - - - - - -
    -
    -
    -
    - -
    - -
    - -
    - <%-- - -
    - - - -
    -
    -
    --%> -
    - - - -
    - -
    - -
    -
    -
    -
    - -
    - -
    - -
    -
    - -
    - -
    - -
    -
    - - - -
    - -
    - - - - -
    -
    -
    - -
    - - - -
    -
    -
    -
    - -
    - -
    - - -
    -
    - -
    - -
    - -
    -
    -
    - -
    - - -
    -
    - -
    -
    -
    -
    - -
    - -
    -
    -
    - -
    - - - - - - - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - -
    -
    - -
    -
    - - - -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - -
    - -
    -
    -
    -
    - - - -
    -
    -
    - -
    -
    -
    -
    - - - - - - - - - - - -
    - -
    -
    - - - - - - <%-- - - - - --%> - - - - - - - - - - - - - - - - - -
    CveIE: - -
    Tipo de Documento: - - - -
    Fecha Aplicación -
    - - - - -
    - - - <%-- - - - - --%> - -
    -
    - - -
    Complemento de pago Sustituto de: - -
    -
    -
    -
    - - - -
    -
    - Cargar Comprobante - - - - - - - - - - - -
    - -
    -
    - Nota: Si ya tiene un comprobante este sera reemplazado. -
    -
    -
    -
    -
    - -
    -
    -
    - - - - - - - - - - - - - - - - - - - -
    Moneda: - - - - - -
    Registró: -
    F. Registró: -
    Tipo Cambio: -
    -
    -
    - -
    -
    -
    - - <%-- - - - --%> - - - - - - - - - <%-- - - - - - - - - - - - --%> -
    Es Abono en Cuenta: - -
    Aplica Impuestos: - -
    No Deducible: - -
    Fue Impreso: - -
    Fue Conciliado: - -
     Fecha Aplicado:  -
    -
    -
    -
    -
    - - - - - - - - -
    Depositado : - Ir -
    -
    -
    -
    - -
    -
    - - - -
    -
    - - - - -
    -
    -
    -
    - - Datos Generales Cancelación -
    -
    -
    -
    -
    -
    - -
    -
    -
    - - - - - - - - - - - - - - - - - -
    Usuario: - -
    Fecha Cancelación: - -
    Fecha Registro: - -
    - - - -
    -
    -
    -
    - -
    -
    - -
    - -
    -
    - -
    - -
    -
    - - - - - - -
    - - - - - - - - - - -
    - -
    - -
    - -
    -
    -
    -
    - <%----%> - Bitacora -
    -
    -
    - <%--
    - - Agregar -
    --%> -
    - - -
    -
    -
    -
    - - - - - - Fecha - - - - - - Fecha Agenda - - - - - - Usuario - - - - - - Descripción - - - - - - Archivo - - - - - - - - - - - - - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - - Historial de Modificación -
    -
    -
    -
    -
    -
    -
    - - - - Fecha - - - - - - - - - - -
    -
    -
    -
    - <%-- MODAL BITACORA --%> - - - - - - - - - <%-- COMPLEMENTOS PAGO --%> - - - <%-- ACTUALIZAR TIPO CAMBIO PREPOLIZA --%> - - - - - - - - - - - - -
    - - - - +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="IE.aspx.vb" Inherits="Bancos_IE" ValidateRequest="false" %> + + + + + + + + + + +   + + + +
  • + Listado Facturas Pagadas +
  • +
  • + Imprimir +
  • + + +
  • + Complemento Pago +
  • +
    +
    + +
  • + Actualizar Tipo Cambio +
  • + + <%--
  • + Emitir Complemento de Pago +
  • --%> + + + +
  • + Cheque Devuelto +
  • +
  • + Cancelar Movimiento +
  • +
  • + Eliminar Movimiento +
  • +
  • + Refacturar Complemento +
  • +
  • + Cancelar + + <%-- data-original-title="¿Está seguro que desea cancelar el documento?" data-btn-ok-label="si" Style="color: #686868;"> + +
  • +
    +
    + + + + +
  • + Contabilizar +
  • +
  • + Descontabilizar +
  • + +
    + + + + +
    + +
  • + Envíar Comprobante Mail +
  • + + + +
  • + Ajustar +
  • +
    +
    + +
    + + + + + +
    +
    +
    +
    +
    +
    + +   + + <%----%> Comprobante +   + +
    + +
    + + + + + +
    + +
    +
    + +
    + + + + + +
    +
    + + +
    +
    +
    + +
    + +
    +
    + +
    + +
    + +
    +
    +
    + + +
    +
    +
    + +
    + +
    +
    + + + + +
    + + + + + + + +
    +
    +
    + +
    + + + +
    +
    + +
    + $ + +
    +
    +
    +
    +
    Interes:
    +
    + $ + +
    +
    + +
    + +
    +
    + +
    + $ + + + +
    +
    + + + + +
    + + Clientes + Proveedor + Viaticos - Personal + + + + + + + + + + + + + + + + +
    +
    + +
    + + +
    +
    +
    +
    +
    + + +
    + $ + + +
    +
    +
    + + + + +
    + +
    +
    +
    +
    + + + + + +
    +
    + +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    +
    + +
    + +
    +
    + +
    +
    +
    + + + +
    + +
    + + + + + +
    +
    +
    +
    + + + +
    + + +
    + + + + + + +
    +
    +
    +
    + +
    + +
    + +
    + <%-- + +
    + + + +
    +
    +
    --%> +
    + + + +
    + +
    + +
    +
    +
    +
    + +
    + +
    + +
    +
    + +
    + +
    + +
    +
    + + + +
    + +
    + + + + +
    +
    +
    + +
    + + + +
    +
    +
    +
    + +
    + +
    + + +
    +
    + +
    + +
    + +
    +
    +
    + +
    + + +
    +
    + +
    +
    +
    +
    + +
    + +
    +
    +
    + +
    + + + + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    +
    + +
    +
    + + + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + +
    + +
    +
    +
    +
    + + + +
    +
    +
    + +
    +
    +
    +
    + + + + + + + + + + + +
    + +
    +
    + + + + + + <%-- + + + + --%> + + + + + + + + + + + + + + + + + +
    CveIE: + +
    Tipo de Documento: + + + +
    Fecha Aplicación +
    + + + + +
    + + + <%-- + + + + --%> + +
    +
    + + +
    Complemento de pago Sustituto de: + +
    +
    +
    +
    + + + +
    +
    + Cargar Comprobante + + + + + + + + + + + +
    + +
    +
    + Nota: Si ya tiene un comprobante este sera reemplazado. +
    +
    +
    +
    +
    + +
    +
    +
    + + + + + + + + + + + + + + + + + + + +
    Moneda: + + + + + +
    Registró: +
    F. Registró: +
    Tipo Cambio: +
    +
    +
    + +
    +
    +
    + + <%-- + + + --%> + + + + + + + + + <%-- + + + + + + + + + + + --%> +
    Es Abono en Cuenta: + +
    Aplica Impuestos: + +
    No Deducible: + +
    Fue Impreso: + +
    Fue Conciliado: + +
     Fecha Aplicado:  +
    +
    +
    +
    +
    + + + + + + + + +
    Depositado : + Ir +
    +
    +
    +
    + +
    +
    + + + +
    +
    + + + + +
    +
    +
    +
    + + Datos Generales Cancelación +
    +
    +
    +
    +
    +
    + +
    +
    +
    + + + + + + + + + + + + + + + + + +
    Usuario: + +
    Fecha Cancelación: + +
    Fecha Registro: + +
    + + + +
    +
    +
    +
    + +
    +
    + +
    + +
    +
    + +
    + +
    +
    + + + + + + +
    + + + + + + + + + + +
    + +
    + +
    + +
    +
    +
    +
    + <%----%> + Bitacora +
    +
    +
    + <%--
    + + Agregar +
    --%> +
    + + +
    +
    +
    +
    + + + + + + Fecha + + + + + + Fecha Agenda + + + + + + Usuario + + + + + + Descripción + + + + + + Archivo + + + + + + + + + + + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + Historial de Modificación +
    +
    +
    +
    +
    +
    +
    + + + + Fecha + + + + + + + + + + +
    +
    +
    +
    + <%-- MODAL BITACORA --%> + + + + + + + + + <%-- COMPLEMENTOS PAGO --%> + + + <%-- ACTUALIZAR TIPO CAMBIO PREPOLIZA --%> + + + + + + + + + + + + +
    + + + + diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb index 9b929e01e..1eeb43303 100644 --- a/Bancos/IE.aspx.vb +++ b/Bancos/IE.aspx.vb @@ -2266,15 +2266,10 @@ Partial Class Bancos_IE Exit Sub End If - - - Dim ObjIE As New ClsBancos() Dim ObjMov As New ClsContabilidad(ObjIE.IniciaTransacSQL) Dim ObjComp As New ClsCompras(ObjIE.IniciaTransacSQL) - Dim ObjOC As New ClsOC(ObjIE.IniciaTransacSQL) - - ' Dim ObjContabilidad As New ClsContabilidad(ObjIE.IniciaTransacSQL) + Dim ObjOC As New ClsOC(ObjIE.IniciaTransacSQL) Dim MsgError As String = "" Dim CveConceptoContable As Integer = 30 @@ -2284,964 +2279,968 @@ Partial Class Bancos_IE Dim CvePlantillaPoliza As Integer = 3 Dim CvePrePoliza As Integer = 0 Dim alertaContabilizacion As String = "Se enviaron correctamente las siguientes pólizas:

    " - Dim Msg As New StringBuilder - - If CveIE = -1 Then - - Dim CveCuentaDeposito As Integer = 0 - If DdlCuentaDeposito.Items.Count > 0 Then - CveCuentaDeposito = DdlCuentaDeposito.SelectedValue.ToEntero - End If - - 'OBTIENE COMPROBANTE!! - ComprobanteIE = "" - Dim Comprobante As String = "" - Dim filesgral As List(Of Archivo) = Anexo.getfiles().Archivos - Dim filemove As String = "" - For Each fileItem As Archivo In filesgral - Comprobante = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "") - filemove = fileItem.filename - Next - - - '*****-_- INICIA: CONFIGURACION REGISTRO -_-***** - If CvePersonal > 0 Then - If Opcion IsNot Nothing AndAlso Opcion.Contiene("EGSSINFACT") And DDlCheques.SelectedValue.ToEntero > 0 Then - CveConceptoCompra = 29 'Comprobación Personal - Else - CveConceptoCompra = 28 'Prestamo Personal - End If - CveConceptoContable = 30 'Banco - CvePlantillaPoliza = 8 - End If - - If Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString = "DEV" Then - If CvePersonal > 0 Then - CveConceptoCompra = 29 'Comprobacion Personal - CveConceptoContable = 30 'Bancos - CvePlantillaPoliza = 9 - ElseIf CveProveedor > 0 Then - CveConceptoCompra = 21 'Pago a Proveedor/CAncelacion Anticipos - CveConceptoContable = 30 'Bancos - CvePlantillaPoliza = 7 - End If - End If - - If Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString = "ANTC" Then - If CveCliente > 0 Then - CveConceptoCompra = 3 'Clientes - CveConceptoContable = 30 'Bancos - CvePlantillaPoliza = 12 - End If - End If - - 'Cuando es Egreso sin factura, se registra una compra tipo anticipo - If Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString = "EGSCREDITO" Then - CveConceptoCompra = 48 'Anticipo Acreedores - CveConceptoContable = 30 'Bancos - CveCreditoDetalle = DdlCreditoDetalle.SelectedValue.ToEntero - Dim Estatus As Integer = 2 - If HdnCveTipoCredito.Value = "1" Then - Estatus = 103 - 'cuando es crediproveedores es, pago a documentos por pagar - CveConceptoCompra = 57 - End If - ObjIE.UpdateCreditosDetalle(Estatus, CveCreditoDetalle) - - If HdnImporteCredito.Value.ToDouble > 0 AndAlso TxtImporte.Text.ToDouble > HdnImporteCredito.Value.ToDouble Then - CIF = TxtImporte.Text.ToDecimal - HdnImporteCredito.Value.ToDecimal - Else - CIF = 0 - End If - - CvePlantillaPoliza = 92 - - End If - Dim AgregaPolizaSaldoInicial As Boolean = False - 'Cuando es Egreso sin factura, se registra una compra tipo anticipo - If Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString = "EGSSINFACT" Then - Select Case RBL.SelectedValue - Case "P" 'Proveedores - If CveProveedor > 0 Then - CveConceptoCompra = 10 'Anticipo a proveedor - CveConceptoContable = 30 'Pago a Proveedor - CvePlantillaPoliza = 3 - End If - Case "DD" ' Deudores Diversos - If CveProveedor > 0 Then - CveConceptoCompra = 43 'Prestamo a deudor diverso - CveConceptoContable = 30 'Bancos - 'limpio el iva - HdnProvPorIVA.Value = "0" - CvePlantillaPoliza = 6 - End If - Case "AC" ' Acreedores Diversos - If CveProveedor > 0 Then - CveConceptoCompra = 42 'Prestamo a acreedor diverso - CveConceptoContable = 30 'Bancos - 'limpio el iva - HdnProvPorIVA.Value = "0" - CvePlantillaPoliza = 21 - End If - Case "DP" ' Documentos por pagar - If CveProveedor > 0 Then - CveConceptoCompra = 50 'Anticipo doc por pagar - CveConceptoContable = 30 'Bancos - 'limpio el iva - HdnProvPorIVA.Value = "0" - CvePlantillaPoliza = 22 - End If - Case "FE" - AgregaPolizaSaldoInicial = True - End Select - End If - - 'Nuevo Formato Charlie - If Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString = "INGPC" Then - HdnProvPorIVA.Value = "0" - CvePlantillaPoliza = 6 - Select Case RBL.SelectedValue - Case "DD" ' Deudores Diversos - If CveProveedor > 0 Then - CveConceptoCompra = 37 'Prestamo a deudor diverso - CveConceptoContable = 30 'Bancos - 'limpio el iva - HdnProvPorIVA.Value = "0" - CvePlantillaPoliza = 45 - End If - Case "C" ' Clientes - If CveCliente > 0 Then - CveConceptoCompra = 66 'Anticipo doc por pagar - CveConceptoContable = 30 'Bancos - 'limpio el iva - HdnProvPorIVA.Value = "0" - End If - Case "AC" ' Acreedores Diversos - If CveCliente > 0 Then - CveConceptoCompra = 41 - CveConceptoContable = 30 'Bancos - 'limpio el iva - HdnProvPorIVA.Value = "0" - End If - End Select - End If - - '*****-_- TERMINA: CONFIGURACION REGISTRO -_-***** - - - Dim FolioFijo As Integer = 0 - Dim tCveMoneda As Integer = DdlMoneda.SelectedValue.ToEntero - Dim tImporteMonedaExtranjera As Decimal = 0 - If tCveMoneda <> 1 Then tImporteMonedaExtranjera = TxtImporte.Text.ToDecimal * GlobalTipoCambio(TxtFechaDocumento.Text.Trim.ToDate).ToString.ToDecimal - Dim PagueseA = "" - - If HdnCveCliente.Value.ToEntero > 0 Then - PagueseA = DdlCliente.SelectedText.ToString() - ElseIf HdnCveProveedor.Value.ToEntero > 0 Then - PagueseA = DdlProveedores.SelectedText.ToString() - ElseIf HdnCvePersonal.Value.ToEntero > 0 Then - PagueseA = DdlPersonal.SelectedItem.ToString - ElseIf DdlCreditoDetalle.SelectedValue.ToEntero > 0 Then - PagueseA = String.Format("{0} {1} {2}", DdlFinanciera.SelectedItem.Text, DdlCredito.SelectedItem.Text, DdlCreditoDetalle.SelectedItem.Text) - End If - - If AgregaPolizaSaldoInicial Then - If AgregarSaldoInicial(TxtImporte.Text.ToDouble(), TxtFechaDocumento.Text.ToDateTime(), DdlMoneda.SelectedValue.ToEntero(), ObjMov) <= 0 Then - MsgError = "No se pudo insertar la póliza de saldo inicial." - End If - End If - - If MsgError = "" Then - - - - CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, TxtFechaDocumento.Text.Trim.ToDate, TxtFolio.Text.Trim, PagueseA, TxtImporte.Text.Trim.ToDouble, DdlMoneda.SelectedValue.ToEntero, - TxtTipoCambio.Text.Trim.ToDouble, TxtObservaciones.Text.Trim, TxtNotificarA.Text.Trim, ChkAbonoCuenta.Checked, ChkAplicaImpuestos.Checked, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCuentaDeposito:=CveCuentaDeposito, CveEstatusIE:=DdlEstatusIE.SelectedValue.ToString.ToEntero, Referencia:=If(TxtReferenciaCIE.Visible, TxtReferenciaCIE.Text, "-1"), CveCuentaTarjeta:=If(DivTarjeta.Visible, DdlTarjeta.SelectedValue.ToEntero, -1)) - - If CveIE > 0 Then - - If DdlTipoTransaccion.SelectedValue = "1" Then FolioFijo = ObjIE.Folio.ToEntero 'cheque - CvePrePoliza = ObjMov.AddPrePolizas("Bancos/IE " + If(Request("Opcion") IsNot Nothing, Request("Opcion").ToString, "") + " " + RBL.SelectedValue, CvePlantillaPoliza, TxtImporte.Text.Trim.ToDouble, TxtImporte.Text.Trim.ToDouble, tCveMoneda, TxtFechaDocumento.Text.ToDate, PagueseA, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo:=FolioFijo, ReglaFolioPoliza:=ObjComp.ObtenerReglaFolio(DdlTipoTransaccion.SelectedValue, Nothing, UsuarioActual.CveEmpresa), CveTipoPoliza:=ObjMov.ObtenerTipoPoliza(DdlTipoTransaccion.SelectedValue, "-1", UsuarioActual.CveEmpresa)) - - 'valida prepoliza - If CvePrePoliza > 0 Then - - If Not ObjIE.UpdateIEPrePoliza(MinFecha, "", -1, CvePrePoliza, CveIE, -1) Then - MsgError = "Ocurrio un error al agregar la prepoliza al IE." - End If - - Dim Conc As String = If(TxtObservaciones.Text = "", ObjIE.Folio, TxtObservaciones.Text) - Dim Ref As String = If(TxtObservaciones.Text = "", ObjIE.Folio, TxtObservaciones.Text) - - If Comprobante <> "" Then - ComprobanteIE = $"{CveIE}.{Comprobante}" - End If - - 'GUARDA COMPROBANTE - If filemove <> "" Then - filemove.FilesMove(CveIE.ToString, String.Format("Empresas\{0}\IE", UsuarioActual.CveEmpresa, UsuarioActual.Empresa.Ruta)) - End If - - 'GUARDA PREPOLIZAS DETALLE [PRIMERO SON LOS CASOS ESPECIALES, AL FINAL (ELSE) LOS CASOS NORMALES] --REEMPLAZA IFs - Select Case Opcion - Case "DEV" - Dim CveIEOtro As Integer = If(CveProveedor > 0 Or CvePersonal > 0, DdlIEDevolucion.SelectedValue.ToEntero, CveIE) - - If CveCliente > 0 AndAlso Not DivIvaIxC.Visible AndAlso TxtIvaIxC.Text.ToDouble = 0 Then - 'RMF- CASO DONDE HAY UNA DEVOLUCION Y TENGO QUE AFECTAR LAS FACTURAS QUE SE HABIAN MARCADO COMO PAGADAS TENGO QUE REGRESARLAS A PENDIENTES - Dim Mov As New ClsMovimientos - If Mov.GetMovimientosIE(2, DdlIEDevolucion.SelectedValue.ToEntero, -1, Now, Now, 1, 0, UsuarioActual.CveEmpresa) Then - Dim DtIE As DataTable = Mov.DtResultados - For Each dr As DataRow In DtIE.Rows - - If MsgError = "" AndAlso Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, If(dr("TipoMovto").ToString.ToEntero = 1, False, True), If(dr("CveConceptoContable").ToString.ToEntero.Contiene(66), -TxtImporte.Text.ToDecimal, dr("Importe").ToString.ToDecimal), "", dr("CveConceptoContable").ToString.ToEntero, "", Now, IDCtaBeneficiario, -1, CveIE, CveCliente:=dr("CveCliente").ToString.ToEntero, CveVenta:=dr("CveVenta").ToString.ToEntero, ImporteMX:=If(dr("CveConceptoContable").ToString.ToEntero.Contiene(66), -TxtImporte.Text.ToDecimal, -dr("Importe").ToString.ToDecimal), ImporteME:=tImporteMonedaExtranjera, CveCuenta:=CveCuentaBeneficiario) Then - MsgError = "no se pudo insertar el detalle de la póliza 2" - End If - Next - ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, TxtImporte.Text.ToDecimal, Ref, CveConceptoContable, Conc, Now, IDCtaContable, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=TxtImporte.Text.ToDecimal, ImporteME:=tImporteMonedaExtranjera, CveCuenta:=CveCuentaConta) - - End If - Mov.Dispose() - - 'Devolucion de INGxC Formato Charlie - ElseIf CveCliente > 0 AndAlso DivIvaIxC.Visible Then - - Dim Mov As New ClsMovimientos - 'INGxC - ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, -(TxtImporte.Text.ToDecimal - TxtIvaIxC.Text.ToDecimal), Ref, 66, Conc, Now, IDCtaContable, -1, CveIE, CveIEDevolucion:=DdlIEDevolucion.SelectedValue.ToEntero, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=-(TxtImporte.Text.ToDecimal - TxtIvaIxC.Text.ToDecimal), ImporteME:=tImporteMonedaExtranjera, CveCuenta:=CveCuentaConta) - - If TxtIvaIxC.Text.ToDouble > 0 Then - 'Iva - ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, -TxtIvaIxC.Text.ToDecimal, Ref, 61, Conc, Now, UsuarioActual.Empresa.IdCuentaIVAxTrasladar, -1, CveIE, CveIEDevolucion:=DdlIEDevolucion.SelectedValue.ToEntero, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=-TxtIvaIxC.Text.ToDecimal, ImporteME:=tImporteMonedaExtranjera, CveCuenta:=UsuarioActual.Empresa.CveCuentaIVAxTrasladar) - End If - - 'Bancos - ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, -TxtImporte.Text.ToDecimal, Ref, 30, Conc, Now, IDCtaBeneficiario, -1, CveIE, CveIEDevolucion:=DdlIEDevolucion.SelectedValue.ToEntero, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=-TxtImporte.Text.ToDecimal, ImporteME:=tImporteMonedaExtranjera, CveCuenta:=CveCuentaBeneficiario) - Mov.Dispose() - - Else - If ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, TxtImporte.Text.ToDecimal, Ref, CveConceptoContable, Conc, Now, IDCtaContable, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=TxtImporte.Text.ToDecimal, ImporteME:=tImporteMonedaExtranjera, CveCuenta:=CveCuentaConta) Then - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, TxtImporte.Text.ToDecimal, Ref, CveConceptoCompra, Conc, Now, IDCtaBeneficiario, -1, CveIE:=If(CveIEOtro < 0, CveIE, CveIEOtro), CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=TxtImporte.Text.ToDecimal, ImporteME:=tImporteMonedaExtranjera, CveCuenta:=CveCuentaBeneficiario) Then - MsgError = "no se pudo insertar el detalle de la póliza 2" - End If - Else - MsgError = "no se pudo insertar el detalle de la póliza" - End If - - End If - - - Case "INGPC" - Dim ConceptoContable As Integer - Dim TipoMovimiento As Boolean - Dim importeMovimiento As Decimal - Dim FechaMovimiento As Date = Now - Dim Concepto As String = "" - Dim Referencia As String = PagueseA - - Dim importeMX As Decimal - Dim Multiplicador As Integer - - If ObjMov.GetPlantillaConceptos(UsuarioActual.CveEmpresa, CvePlantillaPoliza) Then - - For Each Row As DataRow In ObjMov.DtResultados.Rows - - ConceptoContable = Row("CveConcepto").ToString.ToEntero - TipoMovimiento = If(Row("TipoMovto").ToString = "True", True, False) - importeMovimiento = 0 - Multiplicador = (Row("Multiplicador").ToString.ToEntero) - Concepto = ObjMov.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, ConceptoContable, PagueseA, "", ObjIE.Folio) - - Select Case ConceptoContable - - Case 10 - If RBL.SelectedValue = "P" AndAlso CveProveedor > 0 Then - importeMovimiento = TxtImporte.Text.ToDecimal - importeMX = importeMovimiento - End If - - Case 28 - If RBL.SelectedValue = "FE" AndAlso CvePersonal > 0 Then - importeMovimiento = TxtImporte.Text.ToDecimal - importeMX = importeMovimiento - End If - - Case 37 - If RBL.SelectedValue = "DD" AndAlso CveProveedor > 0 Then - importeMovimiento = TxtImporte.Text.ToDecimal - importeMX = importeMovimiento - End If - - Case 41 - If RBL.SelectedValue = "AC" AndAlso CveProveedor > 0 Then - importeMovimiento = TxtImporte.Text.ToDecimal - importeMX = importeMovimiento - End If - - Case 46 - - If TxtInteresMoratorio.Text.ToDecimal > 0 Then - importeMovimiento = TxtInteresMoratorio.Text.ToDecimal - importeMX = importeMovimiento - Else - importeMovimiento = 0 - importeMX = 0 - End If - - - Case 50 - If RBL.SelectedValue = "DP" AndAlso CveProveedor > 0 Then - importeMovimiento = TxtImporte.Text.ToDecimal - importeMX = importeMovimiento - End If - - Case 66 - If RBL.SelectedValue = "C" AndAlso CveCliente > 0 Then - importeMovimiento = TxtImporte.Text.ToDecimal - TxtIvaIxC.Text.ToDecimal - importeMX = importeMovimiento - - 'Agregamos el IVA - If DivIvaIxC.Visible AndAlso TxtIvaIxC.Text.ToDecimal <> 0 Then - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, TxtIvaIxC.Text.ToDecimal, Concepto, 61, Concepto, FechaMovimiento, UsuarioActual.Empresa.IdCuentaIVAxTrasladar, -1, CveIE:=CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=TxtIvaIxC.Text.ToDecimal, ImporteME:=tImporteMonedaExtranjera, CveCuenta:=UsuarioActual.Empresa.CveCuentaIVAxTrasladar) Then - MsgError = "Ocurrió un error al registrar el asiento del ingreso." - End If - End If - If tCveMoneda > 1 AndAlso UsuarioActual.CveEmpresa = 119 Then - 'Agregamos complementaria - Dim TC As Decimal = TxtTipoCambio.Text.ToDecimal - - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, Concepto, 226, Concepto, FechaMovimiento, IDCtaBeneficiarioComplementaria, -1, CveIE:=CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=(importeMovimiento * TC - importeMovimiento).RoundSQL, ImporteME:=importeMovimiento, TipoCambio:=TC, CveCuenta:=0) Then - MsgError = "Ocurrió un error al registrar el asiento del ingreso." - End If - - End If - - End If - - Case 30 - importeMovimiento = TxtImporte.Text.ToDecimal - importeMX = importeMovimiento - - If tCveMoneda > 1 AndAlso UsuarioActual.CveEmpresa = 119 Then - 'Agregamos complementaria - Dim TC As Decimal = TxtTipoCambio.Text.ToDecimal - - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, Concepto, 204, Concepto, FechaMovimiento, IDCtaContableComplementaria, -1, CveIE:=CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=(importeMovimiento * TC - importeMovimiento).RoundSQL, ImporteME:=importeMovimiento, TipoCambio:=TC, CveCuenta:=UsuarioActual.Empresa.CveCuentaIVAxTrasladar) Then - MsgError = "Ocurrió un error al registrar el asiento del ingreso." - End If - - End If - - End Select - - If importeMovimiento <> 0 Then - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Concepto, ConceptoContable, Concepto, FechaMovimiento, If(ConceptoContable = 30, IDCtaContable, IDCtaBeneficiario), -1, CveIE:=CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=importeMovimiento, ImporteME:=tImporteMonedaExtranjera, TipoCambio:=TxtTipoCambio.Text.ToDecimal, CveCuenta:=If(ConceptoContable = 30, CveCuentaConta, CveCuentaBeneficiario)) Then - MsgError = "Ocurrió un error al registrar el asiento del ingreso." - End If - End If - - Next - - End If - - - Case "DevDinV" - Dim IdCtaContableAplicar = -1 - Dim ImporteAplicar = 0.0D - Dim ImporteAplicarMN = 0.0D - Dim ImporteAplicarME = 0.0D - Dim ReferenciaAplicar = ObjIE.Folio - Dim ConceptoAplicar = $"Devolución al cliente {PagueseA} {TxtImporte.Text} NC:{SerieFolioDevDin}" - - ImporteAplicar = TxtImporte.Text.ToDecimal - ImporteAplicarME = ImporteAplicar - - 'CONSIDERA COMPLEMENTARIA - If DdlMoneda.SelectedValue.ToEntero > 1 AndAlso UsuarioActual.CveEmpresa.Contiene(1, 119) Then - ImporteAplicarMN = ImporteAplicar - Else - ImporteAplicarMN = (ImporteAplicar * If(DdlMoneda.SelectedValue.ToEntero = 1, 1, TxtTipoCambio.Text.ToDecimal)).RoundSQL() - End If - - 'BANCOS - IdCtaContableAplicar = If(IDCtaContable > 0, IDCtaContable, 0) - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, ImporteAplicar, ReferenciaAplicar, 30, ConceptoAplicar, Now, IdCtaContableAplicar, -1, CveIE, CveVenta:=CveVentaDevDin, CveCliente:=CveCliente, ImporteMX:=ImporteAplicarMN, ImporteME:=ImporteAplicarME, CveCuenta:=CveCuentaConta) Then - MsgError = "Ocurrió un error al registrar el asiento de bancos de devolución" - Exit Select - End If - - 'BANCOS COMPLEMENTARIA - If DdlMoneda.SelectedValue.ToEntero > 1 AndAlso UsuarioActual.CveEmpresa.Contiene(1, 119) Then - ImporteAplicarMN = ((ImporteAplicar * If(DdlMoneda.SelectedValue.ToEntero = 1, 1, TxtTipoCambio.Text.ToDecimal)) - ImporteAplicar).RoundSQL() - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, ImporteAplicar, ReferenciaAplicar, 204, ConceptoAplicar, Now, IdCtaContableAplicar, -1, CveIE, CveVenta:=CveVentaDevDin, CveCliente:=CveCliente, ImporteMX:=ImporteAplicarMN, ImporteME:=ImporteAplicarME, CveCuenta:=CveCuentaConta) Then - MsgError = "Ocurrió un error al registrar el asiento de bancos complementaria de devolución" - End If - End If - - 'CANCELA NC - IdCtaContableAplicar = IDCtaBeneficiario - ImporteAplicarMN = (ImporteAplicar * If(DdlMoneda.SelectedValue.ToEntero = 1, 1, TxtTipoCambio.Text.ToDecimal)).RoundSQL() - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, -(ImporteAplicar), ReferenciaAplicar, 12, ConceptoAplicar, Now, IdCtaContableAplicar, -1, CveIE, CveVenta:=CveVentaDevDin, CveCliente:=CveCliente, ImporteMX:=-(ImporteAplicarMN), ImporteME:=ImporteAplicarME) Then - MsgError = "Ocurrió un error al registrar el asiento de pago de devolución" - Exit Select - End If - - 'IMPUESTOS - If ObjMov.GetPrePolizasDetalle(CvePrePolizaDevDin) Then - Dim PorcentajePagoDevDin = (TxtImporte.Text.ToDecimal / ImporteOriginalDevDin).RoundSQL(6) - Dim CveConceptoContableAplciar = -1 - Dim TipoMovtoAplicar = False - - For Each Dr As DataRow In ObjMov.DtResultados.FiltraParametros("CveConceptoContable IN (13,8,9,38)").Rows - CveConceptoContableAplciar = Dr("CveConceptoContable").ToString.ToEntero - TipoMovtoAplicar = Not CBool(Dr("TipoMovto").ToString) - ImporteAplicar = (Dr("Importe").ToString.ToDecimal * PorcentajePagoDevDin).RoundSQL() - ImporteAplicarMN = (Dr("ImporteMN").ToString.ToDecimal * PorcentajePagoDevDin).RoundSQL() - ImporteAplicarME = (Dr("ImporteME").ToString.ToDecimal * PorcentajePagoDevDin).RoundSQL() - IdCtaContableAplicar = Dr("IdCtaContable").ToString.ToEntero - - If ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoAplicar, ImporteAplicar, ReferenciaAplicar, CveConceptoContableAplciar, ConceptoAplicar, Now, IdCtaContableAplicar, -1, CveIE, CveVenta:=CveVentaDevDin, CveCliente:=CveCliente, ImporteMX:=ImporteAplicarMN, ImporteME:=ImporteAplicarME) Then - Select Case CveConceptoContableAplciar - Case 13 - CveConceptoContableAplciar = 61 - Case 8 - CveConceptoContableAplciar = 62 - Case 9 - CveConceptoContableAplciar = 63 - Case 38 - CveConceptoContableAplciar = 39 - End Select - TipoMovtoAplicar = Not TipoMovtoAplicar - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoAplicar, ImporteAplicar, ReferenciaAplicar, CveConceptoContableAplciar, ConceptoAplicar, Now, IdCtaContableAplicar, -1, CveIE, CveVenta:=CveVentaDevDin, CveCliente:=CveCliente, ImporteMX:=ImporteAplicarMN, ImporteME:=ImporteAplicarME) Then - MsgError = "Ocurrió un error al registrar el asiento de impuestos de devolución" - Exit Select - End If - Else - MsgError = "Ocurrió un error al registrar el asiento de impuestos de devolución" - Exit Select - End If - - Next - End If - - Case "DevDinC" - 'asdasdasd - 'asdasdasdasd - Dim IdCtaContableAplicar = -1 - Dim ImporteAplicar = 0.0D - Dim ImporteAplicarMN = 0.0D - Dim ImporteAplicarME = 0.0D - Dim ReferenciaAplicar = ObjIE.Folio - - Dim ConceptoAplicar = $"Devolución de Proveedor {PagueseA} {TxtImporte.Text} NC:{SerieFolioDeCDin}" - - ImporteAplicar = TxtImporte.Text.ToDecimal - ImporteAplicarME = ImporteAplicar - - - 'CONSIDERA COMPLEMENTARIA - If DdlMoneda.SelectedValue.ToEntero > 1 AndAlso UsuarioActual.CveEmpresa.Contiene(1, 119) Then - ImporteAplicarMN = ImporteAplicar - Else - ImporteAplicarMN = (ImporteAplicar * If(DdlMoneda.SelectedValue.ToEntero = 1, 1, TxtTipoCambio.Text.ToDecimal)).RoundSQL() - End If - - Dim TCCompra As Decimal = 1 - Dim TCDocumento As Decimal = 1 - - If DdlMoneda.SelectedValue.ToEntero > 1 AndAlso UsuarioActual.CveEmpresa.Contiene(1, 119) Then - - TCCompra = GlobalTipoCambio(FechaCompra).ToDecimal - TCDocumento = GlobalTipoCambio(TxtFechaDocumento.Text.ToDate).ToDecimal - - If TCCompra <= 0 Then - Alert("No se pudo obtener el tipo de cambio de la nota de crédito.", TipoMensaje.MsgAdvertencia) - End If - - If TCCompra <= 0 Then - Alert("No se pudo obtener el tipo de cambio del documentpo.", TipoMensaje.MsgAdvertencia) - End If - - End If - - - - 'BANCOS - IdCtaContableAplicar = If(IDCtaContable > 0, IDCtaContable, 0) - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteAplicar, ReferenciaAplicar, 30, ConceptoAplicar, Now, IdCtaContableAplicar, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=ImporteAplicarMN, ImporteME:=ImporteAplicarME, CveCuenta:=CveCuentaConta, TipoCambio:=TCDocumento) Then - MsgError = "Ocurrió un error al registrar el asiento de bancos de devolución" - Exit Select - End If - - - 'BANCOS COMPLEMENTARIA - If DdlMoneda.SelectedValue.ToEntero > 1 AndAlso UsuarioActual.CveEmpresa.Contiene(1, 119) Then - ImporteAplicarMN = ((ImporteAplicar * If(DdlMoneda.SelectedValue.ToEntero = 1, 1, TCDocumento)) - ImporteAplicar).RoundSQL() - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteAplicar, ReferenciaAplicar, 204, ConceptoAplicar, Now, IdCtaContableAplicar, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=ImporteAplicarMN, ImporteME:=ImporteAplicarME, CveCuenta:=CveCuentaConta, TipoCambio:=TCDocumento) Then - MsgError = "Ocurrió un error al registrar el asiento de bancos complementaria de devolución" - End If - End If - - 'CANCELA NC - IdCtaContableAplicar = IDCtaBeneficiario - ImporteAplicarMN = ImporteAplicar ' (ImporteAplicar * If(DdlMoneda.SelectedValue.ToEntero = 1, 1, TxtTipoCambio.Text.ToDecimal)).RoundSQL() - - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, (ImporteAplicar), ReferenciaAplicar, 18, ConceptoAplicar, Now, IdCtaContableAplicar, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=(ImporteAplicarMN), ImporteME:=ImporteAplicarME, TipoCambio:=TCCompra) Then - MsgError = "Ocurrió un error al registrar el asiento de pago de devolución" - Exit Select - End If - - - 'NC COMPLEMENTARIA - If DdlMoneda.SelectedValue.ToEntero > 1 AndAlso UsuarioActual.CveEmpresa.Contiene(1, 119) Then - - ImporteAplicarMN = ((ImporteAplicar * If(DdlMoneda.SelectedValue.ToEntero = 1, 1, TCCompra)) - ImporteAplicar).RoundSQL() - - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, -(ImporteAplicar), ReferenciaAplicar, 201, ConceptoAplicar, Now, IdCtaContableAplicar, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=-(ImporteAplicarMN), ImporteME:=-(ImporteAplicarME), CveCuenta:=CveCuentaConta, TipoCambio:=TCCompra) Then - MsgError = "Ocurrió un error al registrar el asiento de bancos complementaria de devolución" - End If - - End If - - If TCCompra <> TCDocumento Then - - Dim DiferenciaTC As Decimal = TCCompra - TCDocumento - - Dim DiferenciaImportes As Decimal = Math.Abs((ImporteAplicar * TCCompra) - (ImporteAplicar * TCDocumento)) - - If DiferenciaTC < 0 Then - '64 - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, DiferenciaImportes, ReferenciaAplicar, 64, ConceptoAplicar, Now, UsuarioActual.Empresa.IdCuentaGananciaCambiaria, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=DiferenciaImportes, ImporteME:=0, CveCuenta:=CveCuentaConta, TipoCambio:=TCCompra) Then - MsgError = "Ocurrió un error al registrar el asiento de ganancia cambiaria" - Exit Select - End If - - Else - '65 - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, DiferenciaImportes, ReferenciaAplicar, 65, ConceptoAplicar, Now, UsuarioActual.Empresa.IdCuentaPerdidaCambiaria, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=DiferenciaImportes, ImporteME:=0, CveCuenta:=CveCuentaConta, TipoCambio:=TCCompra) Then - MsgError = "Ocurrió un error al registrar el asiento de perdidada cfambiaria" - Exit Select - End If - - End If - - - - End If - - 'IMPUESTOS - - Dim PorcentajePagoDevDin = (TxtImporte.Text.ToDecimal / ImporteOriginalDevDin).RoundSQL(6) - Dim CveConceptoContableAplciar = -1 - Dim TipoMovtoAplicar = False - - - Dim ObjCompras As New ClsCompras() - If ObjCompras.GetCompras(CveCompraDeCDin, "-1", "-1", -1, -1, UsuarioActual.CveEmpresa) Then - - Dim dr As DataRow = ObjCompras.DtResultados.Rows(0) - If dr IsNot Nothing Then - - Dim CveMonedaDev As Integer = dr("CveMoneda").ToString.ToEntero - Dim TotalCompraDev As Decimal = dr("Total").ToString.ToDecimal - - Dim IVADev As Decimal = dr("IVA").ToString.ToDecimal - Dim IEPSDev As Decimal = dr("IEPS").ToString.ToDecimal - PorcentajeCompraDevDinC = ObjCompras.DtResultados.Rows(0)("PorcentajeIVA").ToString.ToDecimal - - Dim DTCuentas As DataTable = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeCompraDevDinC) - Dim CveCuentaIVAxAcreditarDevDinC = 0 - Dim CveCuentaIVAAcreditableDevDinC = 0 - Dim IdCtaIVAXAcreditarDevDinC = DTCuentas.Rows(0)("IdCtaIVAXAcreditar").ToString.ToEntero - Dim IdCtaIVAAcreditableDevDinC = DTCuentas.Rows(0)("IdCtaIVAAcreditable").ToString.ToEntero - - - Dim IVADevMN As Decimal = 0 - Dim IEPSDevMN As Decimal = 0 - - - Dim PorcentajeDevolucion As Decimal = ((TxtImporte.Text.ToDecimal * 100D / TotalCompraDev) / 100).RoundSQL(2) - - IVADev = Math.Round(IVADev * PorcentajeDevolucion, 2) - IEPSDev = Math.Round(IEPSDev * PorcentajeDevolucion, 2) - - Dim CveCuentaDevolucionIMPUESTOS As Integer = -1 - Dim IdCtaIVADevolucionIMPUESTOS As Integer = -1 - - - If DdlMoneda.SelectedValue.ToEntero > 1 AndAlso UsuarioActual.CveEmpresa.Contiene(1, 119) Then - IVADevMN = IVADev - IEPSDevMN = IEPSDev - Else - IVADevMN = (IVADev * If(CveMonedaDev = 1, 1, TxtTipoCambio.Text.ToDecimal)).RoundSQL(2) - IEPSDevMN = (IEPSDev * If(CveMonedaDev = 1, 1, TxtTipoCambio.Text.ToDecimal)).RoundSQL(2) - End If - - - Dim ErrorDevolucionImpuestos As Boolean = False - - If IVADev > 0 Then - - CveCuentaDevolucionIMPUESTOS = CveCuentaIVAxAcreditarDevDinC - IdCtaIVADevolucionIMPUESTOS = IdCtaIVAXAcreditarDevDinC - - If ObjMov.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovtoAplicar, -IVADev, ReferenciaAplicar, 14, ConceptoAplicar, Now, IdCtaIVADevolucionIMPUESTOS, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=-IVADevMN, ImporteME:=-IVADev, CveCuenta:=CveCuentaDevolucionIMPUESTOS) Then - - CveCuentaDevolucionIMPUESTOS = CveCuentaIVAAcreditableDevDinC - IdCtaIVADevolucionIMPUESTOS = IdCtaIVAAcreditableDevDinC - - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoAplicar, -IVADev, ReferenciaAplicar, 19, ConceptoAplicar, Now, IdCtaIVADevolucionIMPUESTOS, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=-IVADevMN, ImporteME:=-IVADev, CveCuenta:=CveCuentaDevolucionIMPUESTOS) Then - MsgError = "Ocurrió un error al registrar el asiento de impuestos de devolución" - ErrorDevolucionImpuestos = True - End If - Else - MsgError = "Ocurrió un error al registrar el asiento de impuestos de devolución" - ErrorDevolucionImpuestos = True - - End If - End If - - - If IEPSDev > 0 Then - 'Dim ObjContabilidad As New ClsContabilidad - If ObjMov.GetRetCuenta(25, UsuarioActual.CveEmpresa) Then - Try - CveCuentaDevolucionIMPUESTOS = ObjMov.DtResultados.Rows(0)("IdCuentaIEPSxAcreditarSIG").ToString.ToEntero - IdCtaIVADevolucionIMPUESTOS = ObjMov.DtResultados.Rows(0)("IdCuentaIEPSxAcreditar").ToString.ToEntero - - If ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoAplicar, -IEPSDev, ReferenciaAplicar, 25, ConceptoAplicar, Now, IdCtaIVADevolucionIMPUESTOS, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=-IEPSDevMN, ImporteME:=-IEPSDev, CveCuenta:=CveCuentaDevolucionIMPUESTOS) Then - - If ObjMov.GetRetCuenta(26, UsuarioActual.CveEmpresa) Then - Try - CveCuentaDevolucionIMPUESTOS = ObjMov.DtResultados.Rows(0)("IdCuentaIEPSAcreditableSIG").ToString.ToEntero - IdCtaIVADevolucionIMPUESTOS = ObjMov.DtResultados.Rows(0)("IdCuentaIEPSAcreditable").ToString.ToEntero - - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoAplicar, -IEPSDev, ReferenciaAplicar, 26, ConceptoAplicar, Now, IdCtaIVADevolucionIMPUESTOS, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=-IEPSDevMN, ImporteME:=-IEPSDev, CveCuenta:=CveCuentaDevolucionIMPUESTOS) Then - MsgError = "Ocurrió un error al registrar el asiento de impuestos de devolución" - ErrorDevolucionImpuestos = True - End If - - - Catch ex As Exception - Alert("Se presento un error al obtener las cuentas de IEPS acreditable.") - ErrorDevolucionImpuestos = True - End Try - - End If - - Else - MsgError = "Ocurrió un error al registrar el asiento de impuestos de devolución" - ErrorDevolucionImpuestos = True - End If - - Catch ex As Exception - Alert("Se presento un error al obtener las cuentas de IEPS acreditable.") - ErrorDevolucionImpuestos = True - End Try - End If - End If - - If ErrorDevolucionImpuestos Then - MsgError = MsgError & " Error en devolución compra." - End If - - - End If - End If - - - - Case "EGSCREDITO" - - Dim ConceptoContable As Integer - Dim TipoMovimiento As Boolean - Dim importeMovimiento As Decimal - Dim FechaMovimiento As Date = Now - Dim Concepto As String = "" - Dim Referencia As String = PagueseA - - Dim importeMX As Decimal - Dim Multiplicador As Integer - - If ObjMov.GetPlantillaConceptos(UsuarioActual.CveEmpresa, CvePlantillaPoliza) Then - - For Each Row As DataRow In ObjMov.DtResultados.Rows - - ConceptoContable = Row("CveConcepto").ToString.ToEntero - TipoMovimiento = If(Row("TipoMovto").ToString = "True", True, False) - importeMovimiento = 0 - Multiplicador = (Row("Multiplicador").ToString.ToEntero) - Concepto = ObjMov.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, ConceptoContable, PagueseA, "", ObjIE.Folio) - - Select Case ConceptoContable - - Case 30 - importeMovimiento = TxtImporte.Text.ToDecimal - importeMX = importeMovimiento - If tCveMoneda > 1 AndAlso UsuarioActual.CveEmpresa = 119 Then - 'Agregamos complementaria - Dim TC As Decimal = TxtTipoCambio.Text.ToDecimal - - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, Concepto, 204, Concepto, FechaMovimiento, IDCtaContableComplementaria, -1, CveIE:=CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=(importeMovimiento * TC - importeMovimiento).RoundSQL, ImporteME:=importeMovimiento, TipoCambio:=TC, CveCuenta:=UsuarioActual.Empresa.CveCuentaIVAxTrasladar) Then - MsgError = "Ocurrió un error al registrar el asiento del ingreso." - End If - End If - Case 42 - - importeMovimiento = TxtImporte.Text.ToDecimal - importeMX = importeMovimiento - - - - Case 46 - If TxtInteresMoratorio.Text.ToDecimal > 0 Then - importeMovimiento = TxtInteresMoratorio.Text.ToDecimal - importeMX = importeMovimiento - Else - importeMovimiento = 0 - importeMX = 0 - End If - Case 48 - - importeMovimiento = TxtImporte.Text.ToDecimal - importeMX = importeMovimiento - - End Select - - If importeMovimiento <> 0 Then - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Concepto, ConceptoContable, Concepto, FechaMovimiento, If(ConceptoContable = 30, IDCtaContable, IDCtaBeneficiario), -1, CveIE:=CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=importeMovimiento, ImporteME:=tImporteMonedaExtranjera, TipoCambio:=TxtTipoCambio.Text.ToDecimal, CveCuenta:=If(ConceptoContable = 30, CveCuentaConta, CveCuentaBeneficiario)) Then - MsgError = "Ocurrió un error al registrar el asiento del ingreso." - End If - End If - - Next - End If - - Case Else - Dim TipoMovimiento As Boolean = True - - If Opcion.Contiene("ANTC") Then - TipoMovimiento = False - End If - - If CveConceptoCompra = 10 AndAlso DdlMoneda.SelectedValue.ToEntero > 1 AndAlso UsuarioActual.CveEmpresa.Contiene(1, 119) Then - IDCtaBeneficiario = IdCtaAnticipoExtranjera - CveCuentaConta = 0 - End If - - 'MOVIMIENTOS EGRESOS - If ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, TxtImporte.Text.ToDecimal, Ref, CveConceptoContable, Conc, Now, IDCtaContable, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveOC:=CveOrdenCompra, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=TxtImporte.Text.ToDecimal, ImporteME:=tImporteMonedaExtranjera, CveCuenta:=CveCuentaConta, CveIEDevolucion:=DDlCheques.SelectedValue.ToEntero) Then - Dim IVA As Decimal = 0 ' TxtImporte.Text.ToDouble * HdnProvPorIVA.Value.ToDouble - If ObjMov.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, TxtImporte.Text.ToDecimal - IVA - CIF, Ref, CveConceptoCompra, Conc, Now, IDCtaBeneficiario, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveOC:=CveOrdenCompra, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=TxtImporte.Text.ToDecimal, ImporteME:=tImporteMonedaExtranjera, CveCuenta:=CveCuentaBeneficiario, CveIEDevolucion:=DdlIEAcreedor.SelectedValue.ToEntero) Then - If IVA > 0 AndAlso Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, IVA, Ref, 19, Conc, Now, IDCtaBeneficiario, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveOC:=CveOrdenCompra, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=TxtImporte.Text.ToDecimal, ImporteME:=tImporteMonedaExtranjera, CveCuenta:=CveCuentaBeneficiario, CveIEDevolucion:=DDlCheques.SelectedValue.ToEntero) Then - MsgError = "Detalle" - End If - 'intereses pagados - If CIF > 0 AndAlso Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, CIF, Ref, 46, Conc, Now, IDCtaBeneficiario, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveOC:=CveOrdenCompra, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=CIF, ImporteME:=tImporteMonedaExtranjera, CveCuenta:=CveCuentaBeneficiario, CveIEDevolucion:=DDlCheques.SelectedValue.ToEntero) Then - MsgError = "Detalle" - End If - Else - MsgError = "no se pudo insertar el detalle de la póliza2" - End If - Else - MsgError = "no se pudo insertar el detalle de la póliza" - End If - - 'BANCOS COMPLEMENTARIA - If DdlMoneda.SelectedValue.ToEntero > 1 AndAlso UsuarioActual.CveEmpresa.Contiene(1, 119) Then - Dim ImporteAplicar As Decimal = TxtImporte.Text.ToDecimal - Dim ImporteAplicarMN = (ImporteAplicar * TxtTipoCambio.Text.ToDecimal - ImporteAplicar).RoundSQL() - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteAplicar, Ref, 204, Conc, Now, IDCtaContableComplementaria, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=ImporteAplicarMN, ImporteME:=ImporteAplicar, CveCuenta:=CveCuentaConta, TipoCambio:=TxtTipoCambio.Text.ToDecimal) Then - MsgError = "Ocurrió un error al registrar el asiento de bancos complementaria de devolución" - End If - - If CveConceptoCompra = 10 Then - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, ImporteAplicar, Ref, 266, Conc, Now, IdCtaAnticipoComplementaria, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=ImporteAplicarMN, ImporteME:=ImporteAplicar, CveCuenta:=0, TipoCambio:=TxtTipoCambio.Text.ToDecimal) Then - MsgError = "Ocurrió un error al registrar el asiento de bancos complementaria de devolución" - End If - End If - - - End If - - - - If Opcion.Contiene("EGSSINFACT") AndAlso CveSolicitudViatico > 0 AndAlso MsgError = "" Then - If Not ObjIE.UpdateSolicitudesViaticosIE(CveSolicitudViatico, CveIE) Then - MsgError = "Ocurrió un error al vincular el egreso con la solicitud de viatico." - End If - End If - - End Select - - 'El movimiento 1 es el de Venta - 'Conta SIG - If UsuarioActual.Empresa.Funcionalidad(200) = "1" AndAlso MsgError = "" AndAlso UsuarioActual.Empresa.UsaContabilidadSIG Then - If CveCuentaBeneficiario > 0 And CveCuentaConta > 0 Then - If ObjMov.ContabilizarPrePolizaSIG(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then - IDPoliza = ObjMov.ContaIdPoliza - Else - Alert("Ocurrio un error al contabilizar en SIG, pongase en contacto con Soporte Técnico", TipoMensaje.MsgError) - End If - Else - If CveCuentaConta < 1 Then - Alert("No se puede contabilizar la Prepoliza en SIG debido a que la cuenta de Bancos es invalida", TipoMensaje.MsgAdvertencia) - End If - If CveCuentaBeneficiario < 1 Then - Alert("No se puede contabilizar la Prepoliza en SIG debido a que las cuenta del Beneficiario es invalida", TipoMensaje.MsgAdvertencia) - End If - End If - End If - - 'Conta ContPAQ - If UsuarioActual.Empresa.Funcionalidad(200) = "1" AndAlso MsgError = "" Then - If IDCtaBeneficiario > 0 And IDCtaContable > 0 Then - If ObjMov.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then - IDPoliza = ObjMov.ContaIdPoliza - 'Alert(alertaContabilizacion & ObjMov.AlertaMensaje, ModExtensiones.TipoMensaje.MsgInformacion) - Else - Alert("Ocurrio un error al contabilizar, pongase en contacto con Soporte Técnico", TipoMensaje.MsgError) - End If - Else - If IDCtaContable < 1 Then - Alert("No se puede contabilizar la Prepoliza debido a que la cuenta de Bancos es invalida", TipoMensaje.MsgAdvertencia) - End If - If IDCtaBeneficiario < 1 Then - Alert("No se puede contabilizar la Prepoliza debido a que las cuenta del Beneficiario es invalida", TipoMensaje.MsgAdvertencia) - End If - End If - End If - - If UsuarioActual.Empresa.UsaAC Then - Dim ConceptoRenglon, Referencia As String - Dim FolioPoliza As Integer - Dim Fecha As Date = TxtFechaDocumento.Text.ToDate - Dim TipoChq As String = "" - Dim Total As Double = TxtImporte.Text.ToDouble - - Dim Conta As New ClsContPAQi(UsuarioActual.Empresa) - Conta.IniciaTransacSQL() - - If DdlTipoTransaccion.SelectedValue = "1" Then TipoChq = "CHQ" - ConceptoRenglon = String.Format("Anticipo {0}", PagueseA) - - IDPoliza = Conta.AddPoliza(2, ConceptoRenglon, Total, Total, UsuarioActual.CveUsuario, Fecha, ObjIE.Folio, TipoChq) - - If IDPoliza > 0 Then - FolioPoliza = Conta.Folio - Referencia = ObjIE.Folio - ConceptoRenglon = String.Format("Anticipo {0} {1}", PagueseA, TxtObservaciones.Text) - - Total = TxtImporte.Text.ToDouble - - If Not Conta.AddMovimiento(IDPoliza, IDCtaContable, True, Total, Referencia, ConceptoRenglon, 0, Fecha, "") Then MsgError = "No se insertó el movimiento" - - If Not Conta.AddMovimiento(IDPoliza, IDCtaBeneficiario, False, Total, Referencia, ConceptoRenglon, 0, Fecha, "") Then MsgError = "No se insertó el movimiento" - - Else - MsgError = "No se insertó el encabezado" - End If - - If MsgError = "" Then - Conta.Commit() - - Conta.AjustaPoliza(IDPoliza) - 'actualizar la conta del IE - ObjIE.UpdateIEPrePoliza(Fecha, FolioPoliza.ToString, IDPoliza, CvePrePoliza, CveIE, 0) - Else - Conta.RollBack() - IDPoliza = 0 - End If - - Conta.Dispose() - End If - - 'Notificación de Pago - If TxtNotificarA.Text.Trim <> "" Then - NotificacionPago(CveIE, TxtNotificarA.Text.Trim) - End If - - Else - MsgError = "No se pudo insertar la póliza" - End If - - Else - MsgError = "No se insertó el encabezado" - End If - - End If - - Else - Msg.Append("El Documento se guardó correctamente.") - - End If - - 'SOLICITUD DE ANTICIPO OC - If MsgError = "" Then - MsgError = GuardaSolicitudAnticipoOC(ObjOC) - End If - - If MsgError = "" Then - 'VIATICOS - If ChkAplicaViatico.Checked Then - Dim Retorno As String = TimbrarNomina12(CvePersonal) - If Retorno <> "" Then MsgError = $"{MsgError} {Retorno}" : Msg.Clear() : CveIE = -1 - If Retorno <> "" Then - Alert(Retorno, TipoMensaje.MsgError) - End If - End If - End If - - If MsgError = "" Then - If ObjMov.ValidacionPrePolizaCuadre(CvePrePoliza, -1) Then - If ObjMov.ValorPolizaDescuadre > 0 Then - ' MsgError = ObjMov.MensajePolizaDescuadre - GuardaLogAD($"Bancos/IE | Error:{ObjMov.MensajePolizaDescuadre} Diferencia:{ObjMov.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas") - End If - Else - MsgError = "No se pudo validar la prepoliza de cuadre." - End If - End If - - If MsgError = "" Then - 'IMPRIME CHEQUE - 'GeneraChequePDF(CveIE, UsuarioActual.Empresa, IDPoliza) - If Msg.ToString = "" Then - Msg.Append("El Documento se guardo correctamente") - End If - Dim Archivo As System.IO.FileInfo = Nothing - 'VERIFICA SI EXISTE EL FORMATO - If DdlTipoTransaccion.SelectedValue.ToEntero.Contiene(2, 8, 9) Then - Archivo = New System.IO.FileInfo(String.Format("{0}Formatos/Transferencia.rdlc", UsuarioActual.Empresa.Ruta)) - ElseIf DdlTipoTransaccion.SelectedValue.ToEntero.Contiene(1) Then - Archivo = New System.IO.FileInfo(String.Format("{0}Formatos/CHQ-{1}.rdlc", UsuarioActual.Empresa.Ruta, DdlCuenta.SelectedValue.ToEntero)) - If Not Archivo.Exists Then - Archivo = New System.IO.FileInfo(String.Format("{0}\Empresas\Grales\Formatos\CHQ.rdlc", AppDomain.CurrentDomain.BaseDirectory)) - End If - ElseIf DdlTipoTransaccion.SelectedValue.ToEntero.Contiene(6) And UsuarioActual.CveEmpresa = 72 Then - Archivo = New System.IO.FileInfo(String.Format("{0}Formatos/ComprobanteEgreso.rdlc", UsuarioActual.Empresa.Ruta, DdlCuenta.SelectedValue.ToEntero)) - End If - - If Archivo IsNot Nothing Then - If Archivo.Exists Then - Msg.AppendFormat("

    {1} ", Encripta(String.Format("OP=IECHEQUE&CVEIE={0}", CveIE)), String.Format("Imprimir {0}", DdlTipoTransaccion.SelectedItem)) - End If - End If - - If IDPoliza > 0 Then - Msg.AppendFormat("

    Ver Póliza", IDPoliza) - End If - - 'AUTO DESCARGAR PDF PARA COMPU - If UsuarioActual.CveEmpresa.Contiene(72, 1, 2) And CveSolicitudViatico > 0 Then - If DdlTipoTransaccion.SelectedValue.ToEntero.Contiene(1, 2, 6, 8, 9) Then - RegistraScript($"window.location.href = '/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=IE&CVEIE={0}", CveIE))}'", String.Format("Imprimir {0}", DdlTipoTransaccion.SelectedItem)) - End If - End If - ObjIE.Commit() - - Else - ObjIE.RollBack() + Dim Msg As New StringBuilder + + Try + If CveIE = -1 Then + + Dim CveCuentaDeposito As Integer = 0 + If DdlCuentaDeposito.Items.Count > 0 Then + CveCuentaDeposito = DdlCuentaDeposito.SelectedValue.ToEntero + End If + + 'OBTIENE COMPROBANTE!! + ComprobanteIE = "" + Dim Comprobante As String = "" + Dim filesgral As List(Of Archivo) = Anexo.getfiles().Archivos + Dim filemove As String = "" + For Each fileItem As Archivo In filesgral + Comprobante = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "") + filemove = fileItem.filename + Next + + + '*****-_- INICIA: CONFIGURACION REGISTRO -_-***** + If CvePersonal > 0 Then + If Opcion IsNot Nothing AndAlso Opcion.Contiene("EGSSINFACT") And DDlCheques.SelectedValue.ToEntero > 0 Then + CveConceptoCompra = 29 'Comprobación Personal + Else + CveConceptoCompra = 28 'Prestamo Personal + End If + CveConceptoContable = 30 'Banco + CvePlantillaPoliza = 8 + End If + + If Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString = "DEV" Then + If CvePersonal > 0 Then + CveConceptoCompra = 29 'Comprobacion Personal + CveConceptoContable = 30 'Bancos + CvePlantillaPoliza = 9 + ElseIf CveProveedor > 0 Then + CveConceptoCompra = 21 'Pago a Proveedor/CAncelacion Anticipos + CveConceptoContable = 30 'Bancos + CvePlantillaPoliza = 7 + End If + End If + + If Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString = "ANTC" Then + If CveCliente > 0 Then + CveConceptoCompra = 3 'Clientes + CveConceptoContable = 30 'Bancos + CvePlantillaPoliza = 12 + End If + End If + + 'Cuando es Egreso sin factura, se registra una compra tipo anticipo + If Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString = "EGSCREDITO" Then + CveConceptoCompra = 48 'Anticipo Acreedores + CveConceptoContable = 30 'Bancos + CveCreditoDetalle = DdlCreditoDetalle.SelectedValue.ToEntero + Dim Estatus As Integer = 2 + If HdnCveTipoCredito.Value = "1" Then + Estatus = 103 + 'cuando es crediproveedores es, pago a documentos por pagar + CveConceptoCompra = 57 + End If + ObjIE.UpdateCreditosDetalle(Estatus, CveCreditoDetalle) + + If HdnImporteCredito.Value.ToDouble > 0 AndAlso TxtImporte.Text.ToDouble > HdnImporteCredito.Value.ToDouble Then + CIF = TxtImporte.Text.ToDecimal - HdnImporteCredito.Value.ToDecimal + Else + CIF = 0 + End If + + CvePlantillaPoliza = 92 + + End If + Dim AgregaPolizaSaldoInicial As Boolean = False + 'Cuando es Egreso sin factura, se registra una compra tipo anticipo + If Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString = "EGSSINFACT" Then + Select Case RBL.SelectedValue + Case "P" 'Proveedores + If CveProveedor > 0 Then + CveConceptoCompra = 10 'Anticipo a proveedor + CveConceptoContable = 30 'Pago a Proveedor + CvePlantillaPoliza = 3 + End If + Case "DD" ' Deudores Diversos + If CveProveedor > 0 Then + CveConceptoCompra = 43 'Prestamo a deudor diverso + CveConceptoContable = 30 'Bancos + 'limpio el iva + HdnProvPorIVA.Value = "0" + CvePlantillaPoliza = 6 + End If + Case "AC" ' Acreedores Diversos + If CveProveedor > 0 Then + CveConceptoCompra = 42 'Prestamo a acreedor diverso + CveConceptoContable = 30 'Bancos + 'limpio el iva + HdnProvPorIVA.Value = "0" + CvePlantillaPoliza = 21 + End If + Case "DP" ' Documentos por pagar + If CveProveedor > 0 Then + CveConceptoCompra = 50 'Anticipo doc por pagar + CveConceptoContable = 30 'Bancos + 'limpio el iva + HdnProvPorIVA.Value = "0" + CvePlantillaPoliza = 22 + End If + Case "FE" + AgregaPolizaSaldoInicial = True + End Select + End If + + 'Nuevo Formato Charlie + If Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString = "INGPC" Then + HdnProvPorIVA.Value = "0" + CvePlantillaPoliza = 6 + Select Case RBL.SelectedValue + Case "DD" ' Deudores Diversos + If CveProveedor > 0 Then + CveConceptoCompra = 37 'Prestamo a deudor diverso + CveConceptoContable = 30 'Bancos + 'limpio el iva + HdnProvPorIVA.Value = "0" + CvePlantillaPoliza = 45 + End If + Case "C" ' Clientes + If CveCliente > 0 Then + CveConceptoCompra = 66 'Anticipo doc por pagar + CveConceptoContable = 30 'Bancos + 'limpio el iva + HdnProvPorIVA.Value = "0" + End If + Case "AC" ' Acreedores Diversos + If CveCliente > 0 Then + CveConceptoCompra = 41 + CveConceptoContable = 30 'Bancos + 'limpio el iva + HdnProvPorIVA.Value = "0" + End If + End Select + End If + + '*****-_- TERMINA: CONFIGURACION REGISTRO -_-***** + + + Dim FolioFijo As Integer = 0 + Dim tCveMoneda As Integer = DdlMoneda.SelectedValue.ToEntero + Dim tImporteMonedaExtranjera As Decimal = 0 + If tCveMoneda <> 1 Then tImporteMonedaExtranjera = TxtImporte.Text.ToDecimal * GlobalTipoCambio(TxtFechaDocumento.Text.Trim.ToDate).ToString.ToDecimal + Dim PagueseA = "" + + If HdnCveCliente.Value.ToEntero > 0 Then + PagueseA = DdlCliente.SelectedText.ToString() + ElseIf HdnCveProveedor.Value.ToEntero > 0 Then + PagueseA = DdlProveedores.SelectedText.ToString() + ElseIf HdnCvePersonal.Value.ToEntero > 0 Then + PagueseA = DdlPersonal.SelectedItem.ToString + ElseIf DdlCreditoDetalle.SelectedValue.ToEntero > 0 Then + PagueseA = String.Format("{0} {1} {2}", DdlFinanciera.SelectedItem.Text, DdlCredito.SelectedItem.Text, DdlCreditoDetalle.SelectedItem.Text) + End If + + If AgregaPolizaSaldoInicial Then + If AgregarSaldoInicial(TxtImporte.Text.ToDouble(), TxtFechaDocumento.Text.ToDateTime(), DdlMoneda.SelectedValue.ToEntero(), ObjMov) <= 0 Then + MsgError = "No se pudo insertar la póliza de saldo inicial." + End If + End If + + If MsgError = "" Then + + + + CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, TxtFechaDocumento.Text.Trim.ToDate, TxtFolio.Text.Trim, PagueseA, TxtImporte.Text.Trim.ToDouble, DdlMoneda.SelectedValue.ToEntero, + TxtTipoCambio.Text.Trim.ToDouble, TxtObservaciones.Text.Trim, TxtNotificarA.Text.Trim, ChkAbonoCuenta.Checked, ChkAplicaImpuestos.Checked, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCuentaDeposito:=CveCuentaDeposito, CveEstatusIE:=DdlEstatusIE.SelectedValue.ToString.ToEntero, Referencia:=If(TxtReferenciaCIE.Visible, TxtReferenciaCIE.Text, "-1"), CveCuentaTarjeta:=If(DivTarjeta.Visible, DdlTarjeta.SelectedValue.ToEntero, -1)) + + If CveIE > 0 Then + + If DdlTipoTransaccion.SelectedValue = "1" Then FolioFijo = ObjIE.Folio.ToEntero 'cheque + CvePrePoliza = ObjMov.AddPrePolizas("Bancos/IE " + If(Request("Opcion") IsNot Nothing, Request("Opcion").ToString, "") + " " + RBL.SelectedValue, CvePlantillaPoliza, TxtImporte.Text.Trim.ToDouble, TxtImporte.Text.Trim.ToDouble, tCveMoneda, TxtFechaDocumento.Text.ToDate, PagueseA, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo:=FolioFijo, ReglaFolioPoliza:=ObjComp.ObtenerReglaFolio(DdlTipoTransaccion.SelectedValue, Nothing, UsuarioActual.CveEmpresa), CveTipoPoliza:=ObjMov.ObtenerTipoPoliza(DdlTipoTransaccion.SelectedValue, "-1", UsuarioActual.CveEmpresa)) + + 'valida prepoliza + If CvePrePoliza > 0 Then + + If Not ObjIE.UpdateIEPrePoliza(MinFecha, "", -1, CvePrePoliza, CveIE, -1) Then + MsgError = "Ocurrio un error al agregar la prepoliza al IE." + End If + + Dim Conc As String = If(TxtObservaciones.Text = "", ObjIE.Folio, TxtObservaciones.Text) + Dim Ref As String = If(TxtObservaciones.Text = "", ObjIE.Folio, TxtObservaciones.Text) + + If Comprobante <> "" Then + ComprobanteIE = $"{CveIE}.{Comprobante}" + End If + + 'GUARDA COMPROBANTE + If filemove <> "" Then + filemove.FilesMove(CveIE.ToString, String.Format("Empresas\{0}\IE", UsuarioActual.CveEmpresa, UsuarioActual.Empresa.Ruta)) + End If + + 'GUARDA PREPOLIZAS DETALLE [PRIMERO SON LOS CASOS ESPECIALES, AL FINAL (ELSE) LOS CASOS NORMALES] --REEMPLAZA IFs + Select Case Opcion + Case "DEV" + Dim CveIEOtro As Integer = If(CveProveedor > 0 Or CvePersonal > 0, DdlIEDevolucion.SelectedValue.ToEntero, CveIE) + + If CveCliente > 0 AndAlso Not DivIvaIxC.Visible AndAlso TxtIvaIxC.Text.ToDouble = 0 Then + 'RMF- CASO DONDE HAY UNA DEVOLUCION Y TENGO QUE AFECTAR LAS FACTURAS QUE SE HABIAN MARCADO COMO PAGADAS TENGO QUE REGRESARLAS A PENDIENTES + Dim Mov As New ClsMovimientos + If Mov.GetMovimientosIE(2, DdlIEDevolucion.SelectedValue.ToEntero, -1, Now, Now, 1, 0, UsuarioActual.CveEmpresa) Then + Dim DtIE As DataTable = Mov.DtResultados + For Each dr As DataRow In DtIE.Rows + + If MsgError = "" AndAlso Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, If(dr("TipoMovto").ToString.ToEntero = 1, False, True), If(dr("CveConceptoContable").ToString.ToEntero.Contiene(66), -TxtImporte.Text.ToDecimal, dr("Importe").ToString.ToDecimal), "", dr("CveConceptoContable").ToString.ToEntero, "", Now, IDCtaBeneficiario, -1, CveIE, CveCliente:=dr("CveCliente").ToString.ToEntero, CveVenta:=dr("CveVenta").ToString.ToEntero, ImporteMX:=If(dr("CveConceptoContable").ToString.ToEntero.Contiene(66), -TxtImporte.Text.ToDecimal, -dr("Importe").ToString.ToDecimal), ImporteME:=tImporteMonedaExtranjera, CveCuenta:=CveCuentaBeneficiario) Then + MsgError = "no se pudo insertar el detalle de la póliza 2" + End If + Next + ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, TxtImporte.Text.ToDecimal, Ref, CveConceptoContable, Conc, Now, IDCtaContable, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=TxtImporte.Text.ToDecimal, ImporteME:=tImporteMonedaExtranjera, CveCuenta:=CveCuentaConta) + + End If + Mov.Dispose() + + 'Devolucion de INGxC Formato Charlie + ElseIf CveCliente > 0 AndAlso DivIvaIxC.Visible Then + + Dim Mov As New ClsMovimientos + 'INGxC + ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, -(TxtImporte.Text.ToDecimal - TxtIvaIxC.Text.ToDecimal), Ref, 66, Conc, Now, IDCtaContable, -1, CveIE, CveIEDevolucion:=DdlIEDevolucion.SelectedValue.ToEntero, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=-(TxtImporte.Text.ToDecimal - TxtIvaIxC.Text.ToDecimal), ImporteME:=tImporteMonedaExtranjera, CveCuenta:=CveCuentaConta) + + If TxtIvaIxC.Text.ToDouble > 0 Then + 'Iva + ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, -TxtIvaIxC.Text.ToDecimal, Ref, 61, Conc, Now, UsuarioActual.Empresa.IdCuentaIVAxTrasladar, -1, CveIE, CveIEDevolucion:=DdlIEDevolucion.SelectedValue.ToEntero, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=-TxtIvaIxC.Text.ToDecimal, ImporteME:=tImporteMonedaExtranjera, CveCuenta:=UsuarioActual.Empresa.CveCuentaIVAxTrasladar) + End If + + 'Bancos + ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, -TxtImporte.Text.ToDecimal, Ref, 30, Conc, Now, IDCtaBeneficiario, -1, CveIE, CveIEDevolucion:=DdlIEDevolucion.SelectedValue.ToEntero, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=-TxtImporte.Text.ToDecimal, ImporteME:=tImporteMonedaExtranjera, CveCuenta:=CveCuentaBeneficiario) + Mov.Dispose() + + Else + If ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, TxtImporte.Text.ToDecimal, Ref, CveConceptoContable, Conc, Now, IDCtaContable, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=TxtImporte.Text.ToDecimal, ImporteME:=tImporteMonedaExtranjera, CveCuenta:=CveCuentaConta) Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, TxtImporte.Text.ToDecimal, Ref, CveConceptoCompra, Conc, Now, IDCtaBeneficiario, -1, CveIE:=If(CveIEOtro < 0, CveIE, CveIEOtro), CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=TxtImporte.Text.ToDecimal, ImporteME:=tImporteMonedaExtranjera, CveCuenta:=CveCuentaBeneficiario) Then + MsgError = "no se pudo insertar el detalle de la póliza 2" + End If + Else + MsgError = "no se pudo insertar el detalle de la póliza" + End If + + End If + + + Case "INGPC" + Dim ConceptoContable As Integer + Dim TipoMovimiento As Boolean + Dim importeMovimiento As Decimal + Dim FechaMovimiento As Date = Now + Dim Concepto As String = "" + Dim Referencia As String = PagueseA + + Dim importeMX As Decimal + Dim Multiplicador As Integer + + If ObjMov.GetPlantillaConceptos(UsuarioActual.CveEmpresa, CvePlantillaPoliza) Then + + For Each Row As DataRow In ObjMov.DtResultados.Rows + + ConceptoContable = Row("CveConcepto").ToString.ToEntero + TipoMovimiento = If(Row("TipoMovto").ToString = "True", True, False) + importeMovimiento = 0 + Multiplicador = (Row("Multiplicador").ToString.ToEntero) + Concepto = ObjMov.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, ConceptoContable, PagueseA, "", ObjIE.Folio) + + Select Case ConceptoContable + + Case 10 + If RBL.SelectedValue = "P" AndAlso CveProveedor > 0 Then + importeMovimiento = TxtImporte.Text.ToDecimal + importeMX = importeMovimiento + End If + + Case 28 + If RBL.SelectedValue = "FE" AndAlso CvePersonal > 0 Then + importeMovimiento = TxtImporte.Text.ToDecimal + importeMX = importeMovimiento + End If + + Case 37 + If RBL.SelectedValue = "DD" AndAlso CveProveedor > 0 Then + importeMovimiento = TxtImporte.Text.ToDecimal + importeMX = importeMovimiento + End If + + Case 41 + If RBL.SelectedValue = "AC" AndAlso CveProveedor > 0 Then + importeMovimiento = TxtImporte.Text.ToDecimal + importeMX = importeMovimiento + End If + + Case 46 + + If TxtInteresMoratorio.Text.ToDecimal > 0 Then + importeMovimiento = TxtInteresMoratorio.Text.ToDecimal + importeMX = importeMovimiento + Else + importeMovimiento = 0 + importeMX = 0 + End If + + + Case 50 + If RBL.SelectedValue = "DP" AndAlso CveProveedor > 0 Then + importeMovimiento = TxtImporte.Text.ToDecimal + importeMX = importeMovimiento + End If + + Case 66 + If RBL.SelectedValue = "C" AndAlso CveCliente > 0 Then + importeMovimiento = TxtImporte.Text.ToDecimal - TxtIvaIxC.Text.ToDecimal + importeMX = importeMovimiento + + 'Agregamos el IVA + If DivIvaIxC.Visible AndAlso TxtIvaIxC.Text.ToDecimal <> 0 Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, TxtIvaIxC.Text.ToDecimal, Concepto, 61, Concepto, FechaMovimiento, UsuarioActual.Empresa.IdCuentaIVAxTrasladar, -1, CveIE:=CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=TxtIvaIxC.Text.ToDecimal, ImporteME:=tImporteMonedaExtranjera, CveCuenta:=UsuarioActual.Empresa.CveCuentaIVAxTrasladar) Then + MsgError = "Ocurrió un error al registrar el asiento del ingreso." + End If + End If + If tCveMoneda > 1 AndAlso UsuarioActual.CveEmpresa = 119 Then + 'Agregamos complementaria + Dim TC As Decimal = TxtTipoCambio.Text.ToDecimal + + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, Concepto, 226, Concepto, FechaMovimiento, IDCtaBeneficiarioComplementaria, -1, CveIE:=CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=(importeMovimiento * TC - importeMovimiento).RoundSQL, ImporteME:=importeMovimiento, TipoCambio:=TC, CveCuenta:=0) Then + MsgError = "Ocurrió un error al registrar el asiento del ingreso." + End If + + End If + + End If + + Case 30 + importeMovimiento = TxtImporte.Text.ToDecimal + importeMX = importeMovimiento + + If tCveMoneda > 1 AndAlso UsuarioActual.CveEmpresa = 119 Then + 'Agregamos complementaria + Dim TC As Decimal = TxtTipoCambio.Text.ToDecimal + + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, Concepto, 204, Concepto, FechaMovimiento, IDCtaContableComplementaria, -1, CveIE:=CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=(importeMovimiento * TC - importeMovimiento).RoundSQL, ImporteME:=importeMovimiento, TipoCambio:=TC, CveCuenta:=UsuarioActual.Empresa.CveCuentaIVAxTrasladar) Then + MsgError = "Ocurrió un error al registrar el asiento del ingreso." + End If + + End If + + End Select + + If importeMovimiento <> 0 Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Concepto, ConceptoContable, Concepto, FechaMovimiento, If(ConceptoContable = 30, IDCtaContable, IDCtaBeneficiario), -1, CveIE:=CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=importeMovimiento, ImporteME:=tImporteMonedaExtranjera, TipoCambio:=TxtTipoCambio.Text.ToDecimal, CveCuenta:=If(ConceptoContable = 30, CveCuentaConta, CveCuentaBeneficiario)) Then + MsgError = "Ocurrió un error al registrar el asiento del ingreso." + End If + End If + + Next + + End If + + + Case "DevDinV" + Dim IdCtaContableAplicar = -1 + Dim ImporteAplicar = 0.0D + Dim ImporteAplicarMN = 0.0D + Dim ImporteAplicarME = 0.0D + Dim ReferenciaAplicar = ObjIE.Folio + Dim ConceptoAplicar = $"Devolución al cliente {PagueseA} {TxtImporte.Text} NC:{SerieFolioDevDin}" + + ImporteAplicar = TxtImporte.Text.ToDecimal + ImporteAplicarME = ImporteAplicar + + 'CONSIDERA COMPLEMENTARIA + If DdlMoneda.SelectedValue.ToEntero > 1 AndAlso UsuarioActual.CveEmpresa.Contiene(1, 119) Then + ImporteAplicarMN = ImporteAplicar + Else + ImporteAplicarMN = (ImporteAplicar * If(DdlMoneda.SelectedValue.ToEntero = 1, 1, TxtTipoCambio.Text.ToDecimal)).RoundSQL() + End If + + 'BANCOS + IdCtaContableAplicar = If(IDCtaContable > 0, IDCtaContable, 0) + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, ImporteAplicar, ReferenciaAplicar, 30, ConceptoAplicar, Now, IdCtaContableAplicar, -1, CveIE, CveVenta:=CveVentaDevDin, CveCliente:=CveCliente, ImporteMX:=ImporteAplicarMN, ImporteME:=ImporteAplicarME, CveCuenta:=CveCuentaConta) Then + MsgError = "Ocurrió un error al registrar el asiento de bancos de devolución" + Exit Select + End If + + 'BANCOS COMPLEMENTARIA + If DdlMoneda.SelectedValue.ToEntero > 1 AndAlso UsuarioActual.CveEmpresa.Contiene(1, 119) Then + ImporteAplicarMN = ((ImporteAplicar * If(DdlMoneda.SelectedValue.ToEntero = 1, 1, TxtTipoCambio.Text.ToDecimal)) - ImporteAplicar).RoundSQL() + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, ImporteAplicar, ReferenciaAplicar, 204, ConceptoAplicar, Now, IdCtaContableAplicar, -1, CveIE, CveVenta:=CveVentaDevDin, CveCliente:=CveCliente, ImporteMX:=ImporteAplicarMN, ImporteME:=ImporteAplicarME, CveCuenta:=CveCuentaConta) Then + MsgError = "Ocurrió un error al registrar el asiento de bancos complementaria de devolución" + End If + End If + + 'CANCELA NC + IdCtaContableAplicar = IDCtaBeneficiario + ImporteAplicarMN = (ImporteAplicar * If(DdlMoneda.SelectedValue.ToEntero = 1, 1, TxtTipoCambio.Text.ToDecimal)).RoundSQL() + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, -(ImporteAplicar), ReferenciaAplicar, 12, ConceptoAplicar, Now, IdCtaContableAplicar, -1, CveIE, CveVenta:=CveVentaDevDin, CveCliente:=CveCliente, ImporteMX:=-(ImporteAplicarMN), ImporteME:=ImporteAplicarME) Then + MsgError = "Ocurrió un error al registrar el asiento de pago de devolución" + Exit Select + End If + + 'IMPUESTOS + If ObjMov.GetPrePolizasDetalle(CvePrePolizaDevDin) Then + Dim PorcentajePagoDevDin = (TxtImporte.Text.ToDecimal / ImporteOriginalDevDin).RoundSQL(6) + Dim CveConceptoContableAplciar = -1 + Dim TipoMovtoAplicar = False + + For Each Dr As DataRow In ObjMov.DtResultados.FiltraParametros("CveConceptoContable IN (13,8,9,38)").Rows + CveConceptoContableAplciar = Dr("CveConceptoContable").ToString.ToEntero + TipoMovtoAplicar = Not CBool(Dr("TipoMovto").ToString) + ImporteAplicar = (Dr("Importe").ToString.ToDecimal * PorcentajePagoDevDin).RoundSQL() + ImporteAplicarMN = (Dr("ImporteMN").ToString.ToDecimal * PorcentajePagoDevDin).RoundSQL() + ImporteAplicarME = (Dr("ImporteME").ToString.ToDecimal * PorcentajePagoDevDin).RoundSQL() + IdCtaContableAplicar = Dr("IdCtaContable").ToString.ToEntero + + If ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoAplicar, ImporteAplicar, ReferenciaAplicar, CveConceptoContableAplciar, ConceptoAplicar, Now, IdCtaContableAplicar, -1, CveIE, CveVenta:=CveVentaDevDin, CveCliente:=CveCliente, ImporteMX:=ImporteAplicarMN, ImporteME:=ImporteAplicarME) Then + Select Case CveConceptoContableAplciar + Case 13 + CveConceptoContableAplciar = 61 + Case 8 + CveConceptoContableAplciar = 62 + Case 9 + CveConceptoContableAplciar = 63 + Case 38 + CveConceptoContableAplciar = 39 + End Select + TipoMovtoAplicar = Not TipoMovtoAplicar + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoAplicar, ImporteAplicar, ReferenciaAplicar, CveConceptoContableAplciar, ConceptoAplicar, Now, IdCtaContableAplicar, -1, CveIE, CveVenta:=CveVentaDevDin, CveCliente:=CveCliente, ImporteMX:=ImporteAplicarMN, ImporteME:=ImporteAplicarME) Then + MsgError = "Ocurrió un error al registrar el asiento de impuestos de devolución" + Exit Select + End If + Else + MsgError = "Ocurrió un error al registrar el asiento de impuestos de devolución" + Exit Select + End If + + Next + End If + + Case "DevDinC" + 'asdasdasd + 'asdasdasdasd + Dim IdCtaContableAplicar = -1 + Dim ImporteAplicar = 0.0D + Dim ImporteAplicarMN = 0.0D + Dim ImporteAplicarME = 0.0D + Dim ReferenciaAplicar = ObjIE.Folio + + Dim ConceptoAplicar = $"Devolución de Proveedor {PagueseA} {TxtImporte.Text} NC:{SerieFolioDeCDin}" + + ImporteAplicar = TxtImporte.Text.ToDecimal + ImporteAplicarME = ImporteAplicar + + + 'CONSIDERA COMPLEMENTARIA + If DdlMoneda.SelectedValue.ToEntero > 1 AndAlso UsuarioActual.CveEmpresa.Contiene(1, 119) Then + ImporteAplicarMN = ImporteAplicar + Else + ImporteAplicarMN = (ImporteAplicar * If(DdlMoneda.SelectedValue.ToEntero = 1, 1, TxtTipoCambio.Text.ToDecimal)).RoundSQL() + End If + + Dim TCCompra As Decimal = 1 + Dim TCDocumento As Decimal = 1 + + If DdlMoneda.SelectedValue.ToEntero > 1 AndAlso UsuarioActual.CveEmpresa.Contiene(1, 119) Then + + TCCompra = GlobalTipoCambio(FechaCompra).ToDecimal + TCDocumento = GlobalTipoCambio(TxtFechaDocumento.Text.ToDate).ToDecimal + + If TCCompra <= 0 Then + Alert("No se pudo obtener el tipo de cambio de la nota de crédito.", TipoMensaje.MsgAdvertencia) + End If + + If TCCompra <= 0 Then + Alert("No se pudo obtener el tipo de cambio del documentpo.", TipoMensaje.MsgAdvertencia) + End If + + End If + + + + 'BANCOS + IdCtaContableAplicar = If(IDCtaContable > 0, IDCtaContable, 0) + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteAplicar, ReferenciaAplicar, 30, ConceptoAplicar, Now, IdCtaContableAplicar, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=ImporteAplicarMN, ImporteME:=ImporteAplicarME, CveCuenta:=CveCuentaConta, TipoCambio:=TCDocumento) Then + MsgError = "Ocurrió un error al registrar el asiento de bancos de devolución" + Exit Select + End If + + + 'BANCOS COMPLEMENTARIA + If DdlMoneda.SelectedValue.ToEntero > 1 AndAlso UsuarioActual.CveEmpresa.Contiene(1, 119) Then + ImporteAplicarMN = ((ImporteAplicar * If(DdlMoneda.SelectedValue.ToEntero = 1, 1, TCDocumento)) - ImporteAplicar).RoundSQL() + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteAplicar, ReferenciaAplicar, 204, ConceptoAplicar, Now, IdCtaContableAplicar, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=ImporteAplicarMN, ImporteME:=ImporteAplicarME, CveCuenta:=CveCuentaConta, TipoCambio:=TCDocumento) Then + MsgError = "Ocurrió un error al registrar el asiento de bancos complementaria de devolución" + End If + End If + + 'CANCELA NC + IdCtaContableAplicar = IDCtaBeneficiario + ImporteAplicarMN = ImporteAplicar ' (ImporteAplicar * If(DdlMoneda.SelectedValue.ToEntero = 1, 1, TxtTipoCambio.Text.ToDecimal)).RoundSQL() + + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, (ImporteAplicar), ReferenciaAplicar, 18, ConceptoAplicar, Now, IdCtaContableAplicar, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=(ImporteAplicarMN), ImporteME:=ImporteAplicarME, TipoCambio:=TCCompra) Then + MsgError = "Ocurrió un error al registrar el asiento de pago de devolución" + Exit Select + End If + + + 'NC COMPLEMENTARIA + If DdlMoneda.SelectedValue.ToEntero > 1 AndAlso UsuarioActual.CveEmpresa.Contiene(1, 119) Then + + ImporteAplicarMN = ((ImporteAplicar * If(DdlMoneda.SelectedValue.ToEntero = 1, 1, TCCompra)) - ImporteAplicar).RoundSQL() + + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, -(ImporteAplicar), ReferenciaAplicar, 201, ConceptoAplicar, Now, IdCtaContableAplicar, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=-(ImporteAplicarMN), ImporteME:=-(ImporteAplicarME), CveCuenta:=CveCuentaConta, TipoCambio:=TCCompra) Then + MsgError = "Ocurrió un error al registrar el asiento de bancos complementaria de devolución" + End If + + End If + + If TCCompra <> TCDocumento Then + + Dim DiferenciaTC As Decimal = TCCompra - TCDocumento + + Dim DiferenciaImportes As Decimal = Math.Abs((ImporteAplicar * TCCompra) - (ImporteAplicar * TCDocumento)) + + If DiferenciaTC < 0 Then + '64 + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, DiferenciaImportes, ReferenciaAplicar, 64, ConceptoAplicar, Now, UsuarioActual.Empresa.IdCuentaGananciaCambiaria, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=DiferenciaImportes, ImporteME:=0, CveCuenta:=CveCuentaConta, TipoCambio:=TCCompra) Then + MsgError = "Ocurrió un error al registrar el asiento de ganancia cambiaria" + Exit Select + End If + + Else + '65 + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, DiferenciaImportes, ReferenciaAplicar, 65, ConceptoAplicar, Now, UsuarioActual.Empresa.IdCuentaPerdidaCambiaria, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=DiferenciaImportes, ImporteME:=0, CveCuenta:=CveCuentaConta, TipoCambio:=TCCompra) Then + MsgError = "Ocurrió un error al registrar el asiento de perdidada cfambiaria" + Exit Select + End If + + End If + + End If + + 'IMPUESTOS + + Dim PorcentajePagoDevDin = (TxtImporte.Text.ToDecimal / ImporteOriginalDevDin).RoundSQL(6) + Dim CveConceptoContableAplciar = -1 + Dim TipoMovtoAplicar = False + + + Dim ObjCompras As New ClsCompras() + If ObjCompras.GetCompras(CveCompraDeCDin, "-1", "-1", -1, -1, UsuarioActual.CveEmpresa) Then + + Dim dr As DataRow = ObjCompras.DtResultados.Rows(0) + If dr IsNot Nothing Then + + Dim CveMonedaDev As Integer = dr("CveMoneda").ToString.ToEntero + Dim TotalCompraDev As Decimal = dr("Total").ToString.ToDecimal + + Dim IVADev As Decimal = dr("IVA").ToString.ToDecimal + Dim IEPSDev As Decimal = dr("IEPS").ToString.ToDecimal + PorcentajeCompraDevDinC = ObjCompras.DtResultados.Rows(0)("PorcentajeIVA").ToString.ToDecimal + + Dim DTCuentas As DataTable = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeCompraDevDinC) + Dim CveCuentaIVAxAcreditarDevDinC = 0 + Dim CveCuentaIVAAcreditableDevDinC = 0 + + Dim IdCtaIVAXAcreditarDevDinC = 0 + Dim IdCtaIVAAcreditableDevDinC = 0 + + If DTCuentas IsNot Nothing AndAlso DTCuentas.Rows.Count > 0 Then + IdCtaIVAXAcreditarDevDinC = DTCuentas.Rows(0)("IdCtaIVAXAcreditar").ToString.ToEntero + IdCtaIVAAcreditableDevDinC = DTCuentas.Rows(0)("IdCtaIVAAcreditable").ToString.ToEntero + End If + + Dim IVADevMN As Decimal = 0 + Dim IEPSDevMN As Decimal = 0 + + Dim PorcentajeDevolucion As Decimal = ((TxtImporte.Text.ToDecimal * 100D / TotalCompraDev) / 100).RoundSQL(2) + + IVADev = Math.Round(IVADev * PorcentajeDevolucion, 2) + IEPSDev = Math.Round(IEPSDev * PorcentajeDevolucion, 2) + + Dim CveCuentaDevolucionIMPUESTOS As Integer = -1 + Dim IdCtaIVADevolucionIMPUESTOS As Integer = -1 + + If DdlMoneda.SelectedValue.ToEntero > 1 AndAlso UsuarioActual.CveEmpresa.Contiene(1, 119) Then + IVADevMN = IVADev + IEPSDevMN = IEPSDev + Else + IVADevMN = (IVADev * If(CveMonedaDev = 1, 1, TxtTipoCambio.Text.ToDecimal)).RoundSQL(2) + IEPSDevMN = (IEPSDev * If(CveMonedaDev = 1, 1, TxtTipoCambio.Text.ToDecimal)).RoundSQL(2) + End If + + Dim ErrorDevolucionImpuestos As Boolean = False + + If IVADev > 0 Then + + CveCuentaDevolucionIMPUESTOS = CveCuentaIVAxAcreditarDevDinC + IdCtaIVADevolucionIMPUESTOS = IdCtaIVAXAcreditarDevDinC + + If ObjMov.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovtoAplicar, -IVADev, ReferenciaAplicar, 14, ConceptoAplicar, Now, IdCtaIVADevolucionIMPUESTOS, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=-IVADevMN, ImporteME:=-IVADev, CveCuenta:=CveCuentaDevolucionIMPUESTOS) Then + + CveCuentaDevolucionIMPUESTOS = CveCuentaIVAAcreditableDevDinC + IdCtaIVADevolucionIMPUESTOS = IdCtaIVAAcreditableDevDinC + + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoAplicar, -IVADev, ReferenciaAplicar, 19, ConceptoAplicar, Now, IdCtaIVADevolucionIMPUESTOS, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=-IVADevMN, ImporteME:=-IVADev, CveCuenta:=CveCuentaDevolucionIMPUESTOS) Then + MsgError = "Ocurrió un error al registrar el asiento de impuestos de devolución" + ErrorDevolucionImpuestos = True + End If + Else + MsgError = "Ocurrió un error al registrar el asiento de impuestos de devolución" + ErrorDevolucionImpuestos = True + + End If + End If + + + If IEPSDev > 0 Then + 'Dim ObjContabilidad As New ClsContabilidad + If ObjMov.GetRetCuenta(25, UsuarioActual.CveEmpresa) Then + Try + CveCuentaDevolucionIMPUESTOS = ObjMov.DtResultados.Rows(0)("IdCuentaIEPSxAcreditarSIG").ToString.ToEntero + IdCtaIVADevolucionIMPUESTOS = ObjMov.DtResultados.Rows(0)("IdCuentaIEPSxAcreditar").ToString.ToEntero + + If ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoAplicar, -IEPSDev, ReferenciaAplicar, 25, ConceptoAplicar, Now, IdCtaIVADevolucionIMPUESTOS, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=-IEPSDevMN, ImporteME:=-IEPSDev, CveCuenta:=CveCuentaDevolucionIMPUESTOS) Then + + If ObjMov.GetRetCuenta(26, UsuarioActual.CveEmpresa) Then + Try + CveCuentaDevolucionIMPUESTOS = ObjMov.DtResultados.Rows(0)("IdCuentaIEPSAcreditableSIG").ToString.ToEntero + IdCtaIVADevolucionIMPUESTOS = ObjMov.DtResultados.Rows(0)("IdCuentaIEPSAcreditable").ToString.ToEntero + + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoAplicar, -IEPSDev, ReferenciaAplicar, 26, ConceptoAplicar, Now, IdCtaIVADevolucionIMPUESTOS, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=-IEPSDevMN, ImporteME:=-IEPSDev, CveCuenta:=CveCuentaDevolucionIMPUESTOS) Then + MsgError = "Ocurrió un error al registrar el asiento de impuestos de devolución" + ErrorDevolucionImpuestos = True + End If + + + Catch ex As Exception + Alert("Se presento un error al obtener las cuentas de IEPS acreditable.") + ErrorDevolucionImpuestos = True + End Try + + End If + + Else + MsgError = "Ocurrió un error al registrar el asiento de impuestos de devolución" + ErrorDevolucionImpuestos = True + End If + + Catch ex As Exception + Alert("Se presento un error al obtener las cuentas de IEPS acreditable.") + ErrorDevolucionImpuestos = True + End Try + End If + End If + + If ErrorDevolucionImpuestos Then + MsgError = MsgError & " Error en devolución compra." + End If + + + End If + End If + + Case "EGSCREDITO" + + Dim ConceptoContable As Integer + Dim TipoMovimiento As Boolean + Dim importeMovimiento As Decimal + Dim FechaMovimiento As Date = Now + Dim Concepto As String = "" + Dim Referencia As String = PagueseA + + Dim importeMX As Decimal + Dim Multiplicador As Integer + + If ObjMov.GetPlantillaConceptos(UsuarioActual.CveEmpresa, CvePlantillaPoliza) Then + + For Each Row As DataRow In ObjMov.DtResultados.Rows + + ConceptoContable = Row("CveConcepto").ToString.ToEntero + TipoMovimiento = If(Row("TipoMovto").ToString = "True", True, False) + importeMovimiento = 0 + Multiplicador = (Row("Multiplicador").ToString.ToEntero) + Concepto = ObjMov.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, ConceptoContable, PagueseA, "", ObjIE.Folio) + + Select Case ConceptoContable + + Case 30 + importeMovimiento = TxtImporte.Text.ToDecimal + importeMX = importeMovimiento + If tCveMoneda > 1 AndAlso UsuarioActual.CveEmpresa = 119 Then + 'Agregamos complementaria + Dim TC As Decimal = TxtTipoCambio.Text.ToDecimal + + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, Concepto, 204, Concepto, FechaMovimiento, IDCtaContableComplementaria, -1, CveIE:=CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=(importeMovimiento * TC - importeMovimiento).RoundSQL, ImporteME:=importeMovimiento, TipoCambio:=TC, CveCuenta:=UsuarioActual.Empresa.CveCuentaIVAxTrasladar) Then + MsgError = "Ocurrió un error al registrar el asiento del ingreso." + End If + End If + Case 42 + + importeMovimiento = TxtImporte.Text.ToDecimal + importeMX = importeMovimiento + + Case 46 + If TxtInteresMoratorio.Text.ToDecimal > 0 Then + importeMovimiento = TxtInteresMoratorio.Text.ToDecimal + importeMX = importeMovimiento + Else + importeMovimiento = 0 + importeMX = 0 + End If + Case 48 + + importeMovimiento = TxtImporte.Text.ToDecimal + importeMX = importeMovimiento + + End Select + + If importeMovimiento <> 0 Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Concepto, ConceptoContable, Concepto, FechaMovimiento, If(ConceptoContable = 30, IDCtaContable, IDCtaBeneficiario), -1, CveIE:=CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=importeMovimiento, ImporteME:=tImporteMonedaExtranjera, TipoCambio:=TxtTipoCambio.Text.ToDecimal, CveCuenta:=If(ConceptoContable = 30, CveCuentaConta, CveCuentaBeneficiario)) Then + MsgError = "Ocurrió un error al registrar el asiento del ingreso." + End If + End If + + Next + End If + + Case Else + Dim TipoMovimiento As Boolean = True + + If Opcion.Contiene("ANTC") Then + TipoMovimiento = False + End If + + If CveConceptoCompra = 10 AndAlso DdlMoneda.SelectedValue.ToEntero > 1 AndAlso UsuarioActual.CveEmpresa.Contiene(1, 119) Then + IDCtaBeneficiario = IdCtaAnticipoExtranjera + CveCuentaConta = 0 + End If + + 'MOVIMIENTOS EGRESOS + If ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, TxtImporte.Text.ToDecimal, Ref, CveConceptoContable, Conc, Now, IDCtaContable, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveOC:=CveOrdenCompra, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=TxtImporte.Text.ToDecimal, ImporteME:=tImporteMonedaExtranjera, CveCuenta:=CveCuentaConta, CveIEDevolucion:=DDlCheques.SelectedValue.ToEntero) Then + Dim IVA As Decimal = 0 ' TxtImporte.Text.ToDouble * HdnProvPorIVA.Value.ToDouble + If ObjMov.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, TxtImporte.Text.ToDecimal - IVA - CIF, Ref, CveConceptoCompra, Conc, Now, IDCtaBeneficiario, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveOC:=CveOrdenCompra, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=TxtImporte.Text.ToDecimal, ImporteME:=tImporteMonedaExtranjera, CveCuenta:=CveCuentaBeneficiario, CveIEDevolucion:=DdlIEAcreedor.SelectedValue.ToEntero) Then + If IVA > 0 AndAlso Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, IVA, Ref, 19, Conc, Now, IDCtaBeneficiario, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveOC:=CveOrdenCompra, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=TxtImporte.Text.ToDecimal, ImporteME:=tImporteMonedaExtranjera, CveCuenta:=CveCuentaBeneficiario, CveIEDevolucion:=DDlCheques.SelectedValue.ToEntero) Then + MsgError = "Detalle" + End If + 'intereses pagados + If CIF > 0 AndAlso Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, CIF, Ref, 46, Conc, Now, IDCtaBeneficiario, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveOC:=CveOrdenCompra, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=CIF, ImporteME:=tImporteMonedaExtranjera, CveCuenta:=CveCuentaBeneficiario, CveIEDevolucion:=DDlCheques.SelectedValue.ToEntero) Then + MsgError = "Detalle" + End If + Else + MsgError = "no se pudo insertar el detalle de la póliza2" + End If + Else + MsgError = "no se pudo insertar el detalle de la póliza" + End If + + 'BANCOS COMPLEMENTARIA + If DdlMoneda.SelectedValue.ToEntero > 1 AndAlso UsuarioActual.CveEmpresa.Contiene(1, 119) Then + Dim ImporteAplicar As Decimal = TxtImporte.Text.ToDecimal + Dim ImporteAplicarMN = (ImporteAplicar * TxtTipoCambio.Text.ToDecimal - ImporteAplicar).RoundSQL() + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteAplicar, Ref, 204, Conc, Now, IDCtaContableComplementaria, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=ImporteAplicarMN, ImporteME:=ImporteAplicar, CveCuenta:=CveCuentaConta, TipoCambio:=TxtTipoCambio.Text.ToDecimal) Then + MsgError = "Ocurrió un error al registrar el asiento de bancos complementaria de devolución" + End If + + If CveConceptoCompra = 10 Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, ImporteAplicar, Ref, 266, Conc, Now, IdCtaAnticipoComplementaria, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=ImporteAplicarMN, ImporteME:=ImporteAplicar, CveCuenta:=0, TipoCambio:=TxtTipoCambio.Text.ToDecimal) Then + MsgError = "Ocurrió un error al registrar el asiento de bancos complementaria de devolución" + End If + End If + + + End If + + If Opcion.Contiene("EGSSINFACT") AndAlso CveSolicitudViatico > 0 AndAlso MsgError = "" Then + If Not ObjIE.UpdateSolicitudesViaticosIE(CveSolicitudViatico, CveIE) Then + MsgError = "Ocurrió un error al vincular el egreso con la solicitud de viatico." + End If + End If + + End Select + + 'El movimiento 1 es el de Venta + 'Conta SIG + If UsuarioActual.Empresa.Funcionalidad(200) = "1" AndAlso MsgError = "" AndAlso UsuarioActual.Empresa.UsaContabilidadSIG Then + If CveCuentaBeneficiario > 0 And CveCuentaConta > 0 Then + If ObjMov.ContabilizarPrePolizaSIG(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then + IDPoliza = ObjMov.ContaIdPoliza + Else + Alert("Ocurrio un error al contabilizar en SIG, pongase en contacto con Soporte Técnico", TipoMensaje.MsgError) + End If + Else + If CveCuentaConta < 1 Then + Alert("No se puede contabilizar la Prepoliza en SIG debido a que la cuenta de Bancos es invalida", TipoMensaje.MsgAdvertencia) + End If + If CveCuentaBeneficiario < 1 Then + Alert("No se puede contabilizar la Prepoliza en SIG debido a que las cuenta del Beneficiario es invalida", TipoMensaje.MsgAdvertencia) + End If + End If + End If + + 'Conta ContPAQ + If UsuarioActual.Empresa.Funcionalidad(200) = "1" AndAlso MsgError = "" Then + If IDCtaBeneficiario > 0 And IDCtaContable > 0 Then + If ObjMov.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then + IDPoliza = ObjMov.ContaIdPoliza + 'Alert(alertaContabilizacion & ObjMov.AlertaMensaje, ModExtensiones.TipoMensaje.MsgInformacion) + Else + Alert("Ocurrio un error al contabilizar, pongase en contacto con Soporte Técnico", TipoMensaje.MsgError) + End If + Else + If IDCtaContable < 1 Then + Alert("No se puede contabilizar la Prepoliza debido a que la cuenta de Bancos es invalida", TipoMensaje.MsgAdvertencia) + End If + If IDCtaBeneficiario < 1 Then + Alert("No se puede contabilizar la Prepoliza debido a que las cuenta del Beneficiario es invalida", TipoMensaje.MsgAdvertencia) + End If + End If + End If + + If UsuarioActual.Empresa.UsaAC Then + Dim ConceptoRenglon, Referencia As String + Dim FolioPoliza As Integer + Dim Fecha As Date = TxtFechaDocumento.Text.ToDate + Dim TipoChq As String = "" + Dim Total As Double = TxtImporte.Text.ToDouble + + Dim Conta As New ClsContPAQi(UsuarioActual.Empresa) + Conta.IniciaTransacSQL() + + If DdlTipoTransaccion.SelectedValue = "1" Then TipoChq = "CHQ" + ConceptoRenglon = String.Format("Anticipo {0}", PagueseA) + + IDPoliza = Conta.AddPoliza(2, ConceptoRenglon, Total, Total, UsuarioActual.CveUsuario, Fecha, ObjIE.Folio, TipoChq) + + If IDPoliza > 0 Then + FolioPoliza = Conta.Folio + Referencia = ObjIE.Folio + ConceptoRenglon = String.Format("Anticipo {0} {1}", PagueseA, TxtObservaciones.Text) + + Total = TxtImporte.Text.ToDouble + + If Not Conta.AddMovimiento(IDPoliza, IDCtaContable, True, Total, Referencia, ConceptoRenglon, 0, Fecha, "") Then MsgError = "No se insertó el movimiento" + + If Not Conta.AddMovimiento(IDPoliza, IDCtaBeneficiario, False, Total, Referencia, ConceptoRenglon, 0, Fecha, "") Then MsgError = "No se insertó el movimiento" + + Else + MsgError = "No se insertó el encabezado" + End If + + If MsgError = "" Then + Conta.Commit() + + Conta.AjustaPoliza(IDPoliza) + 'actualizar la conta del IE + ObjIE.UpdateIEPrePoliza(Fecha, FolioPoliza.ToString, IDPoliza, CvePrePoliza, CveIE, 0) + Else + Conta.RollBack() + IDPoliza = 0 + End If + + Conta.Dispose() + End If + + 'Notificación de Pago + If TxtNotificarA.Text.Trim <> "" Then + NotificacionPago(CveIE, TxtNotificarA.Text.Trim) + End If + + Else + MsgError = "No se pudo insertar la póliza" + End If + + Else + MsgError = "No se insertó el encabezado" + End If + + End If + + Else + Msg.Append("El Documento se guardó correctamente.") + + End If + + 'SOLICITUD DE ANTICIPO OC + If MsgError = "" Then + MsgError = GuardaSolicitudAnticipoOC(ObjOC) + End If + + If MsgError = "" Then + 'VIATICOS + If ChkAplicaViatico.Checked Then + Dim Retorno As String = TimbrarNomina12(CvePersonal) + If Retorno <> "" Then MsgError = $"{MsgError} {Retorno}" : Msg.Clear() : CveIE = -1 + If Retorno <> "" Then + Alert(Retorno, TipoMensaje.MsgError) + End If + End If + End If + + If MsgError = "" Then + If ObjMov.ValidacionPrePolizaCuadre(CvePrePoliza, -1) Then + If ObjMov.ValorPolizaDescuadre > 0 Then + ' MsgError = ObjMov.MensajePolizaDescuadre + GuardaLogAD($"Bancos/IE | Error:{ObjMov.MensajePolizaDescuadre} Diferencia:{ObjMov.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas") + End If + Else + MsgError = "No se pudo validar la prepoliza de cuadre." + End If + End If + + If MsgError = "" Then + 'IMPRIME CHEQUE + 'GeneraChequePDF(CveIE, UsuarioActual.Empresa, IDPoliza) + If Msg.ToString = "" Then + Msg.Append("El Documento se guardo correctamente") + End If + Dim Archivo As System.IO.FileInfo = Nothing + 'VERIFICA SI EXISTE EL FORMATO + If DdlTipoTransaccion.SelectedValue.ToEntero.Contiene(2, 8, 9) Then + Archivo = New System.IO.FileInfo(String.Format("{0}Formatos/Transferencia.rdlc", UsuarioActual.Empresa.Ruta)) + ElseIf DdlTipoTransaccion.SelectedValue.ToEntero.Contiene(1) Then + Archivo = New System.IO.FileInfo(String.Format("{0}Formatos/CHQ-{1}.rdlc", UsuarioActual.Empresa.Ruta, DdlCuenta.SelectedValue.ToEntero)) + If Not Archivo.Exists Then + Archivo = New System.IO.FileInfo(String.Format("{0}\Empresas\Grales\Formatos\CHQ.rdlc", AppDomain.CurrentDomain.BaseDirectory)) + End If + ElseIf DdlTipoTransaccion.SelectedValue.ToEntero.Contiene(6) And UsuarioActual.CveEmpresa = 72 Then + Archivo = New System.IO.FileInfo(String.Format("{0}Formatos/ComprobanteEgreso.rdlc", UsuarioActual.Empresa.Ruta, DdlCuenta.SelectedValue.ToEntero)) + End If + + If Archivo IsNot Nothing Then + If Archivo.Exists Then + Msg.AppendFormat("

    {1} ", Encripta(String.Format("OP=IECHEQUE&CVEIE={0}", CveIE)), String.Format("Imprimir {0}", DdlTipoTransaccion.SelectedItem)) + End If + End If + + If IDPoliza > 0 Then + Msg.AppendFormat("

    Ver Póliza", IDPoliza) + End If + + 'AUTO DESCARGAR PDF PARA COMPU + If UsuarioActual.CveEmpresa.Contiene(72, 1, 2) And CveSolicitudViatico > 0 Then + If DdlTipoTransaccion.SelectedValue.ToEntero.Contiene(1, 2, 6, 8, 9) Then + RegistraScript($"window.location.href = '/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=IE&CVEIE={0}", CveIE))}'", String.Format("Imprimir {0}", DdlTipoTransaccion.SelectedItem)) + End If + End If + + End If + Catch ex As Exception + MsgError = "Ocurrió un error al guardar el IE" + ex.ToString().GuardaLog() + End Try + + If MsgError = "" Then + ObjIE.Commit() + Else + ObjIE.RollBack() + + Alert(MsgError, TipoMensaje.MsgError) End If If Msg.ToString <> "" Then @@ -3264,7 +3263,6 @@ Partial Class Bancos_IE AccionJS = String.Format("document.location.href=""{0}"";", HttpContext.Current.Request.Url.PathAndQuery) End If - If Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString.Contiene("EGSCREDITO") Then AccionJS = $"document.location.href=""/Bancos/Creditos.aspx?CveCredito={Request("CveCredito")}"";" Alert(Msg.ToString, TipoMensaje.MsgInformacion, AccionJS) @@ -3272,18 +3270,15 @@ Partial Class Bancos_IE Alert(Msg.ToString, TipoMensaje.MsgInformacion, String.Format("document.location.href=""{0}"";", HttpContext.Current.Request.Url.PathAndQuery)) End If - - - End If End If - RecargaGlobalCuentasBancarias() ObjIE.Dispose() ObjMov.Dispose() - If ObjComp IsNot Nothing Then ObjComp.Dispose() - - + ObjOC.Dispose() + If ObjComp IsNot Nothing Then ObjComp.Dispose() + + RecargaGlobalCuentasBancarias() End Sub #Region " NOTIFICACION PAGO " @@ -4752,13 +4747,26 @@ Partial Class Bancos_IE End If If Not ErrorCompra Then - Banc.Commit() + If ObjAC IsNot Nothing Then ObjAC.Commit() - Alert("El documento bancario quedó eliminado.", TipoMensaje.MsgInformacion, "document.location.href=""/Bancos/RepIE.aspx""") + + If Banc.ExisteConeccion Then + Banc.Commit() + Alert("El documento bancario quedó eliminado.", TipoMensaje.MsgInformacion, "document.location.href=""/Bancos/RepIE.aspx""") + End If + Else + Alert("El documento no ha sido eliminado.", TipoMensaje.MsgAdvertencia) + If ObjAC IsNot Nothing Then ObjAC.RollBack() - Banc.RollBack() + + If Banc.ExisteConeccion Then + Banc.RollBack() + + + End If + End If If ObjAC IsNot Nothing Then ObjAC.Dispose() diff --git a/Bancos/ProveedoresAbonar.aspx.vb b/Bancos/ProveedoresAbonar.aspx.vb index a9a546aa5..37b1b3a67 100644 --- a/Bancos/ProveedoresAbonar.aspx.vb +++ b/Bancos/ProveedoresAbonar.aspx.vb @@ -637,7 +637,7 @@ Partial Class Bancos_ProveedoresAbonar e.Row.FCTextBox("TxtAbonar").Enabled = False ' si tiene un porcentaje mayor ingresado, que este halla sido por OC, debe de permitirlo - If e.Row.DBCampo("ImporteAlmacenPorcentaje").ToDecimal >= 100 Then 'si ya se recibió el 100% + If e.Row.DBCampo("ImporteAlmacenPorcentaje").ToDecimal >= 99.0 Then 'si ya se recibió el 100% e.Row.FCCheckBox("Chk").Enabled = True e.Row.FCTextBox("TxtAbonar").Enabled = True End If diff --git a/Bin/Microsoft.SqlServer.Types.dll b/Bin/Microsoft.SqlServer.Types.dll index d4dd78993..1ccde4ab4 100644 Binary files a/Bin/Microsoft.SqlServer.Types.dll and b/Bin/Microsoft.SqlServer.Types.dll differ diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 059d27dce..91663ea7a 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -4190,7 +4190,7 @@ Partial Class Compras_Compras Dim TCPago As Decimal = GlobalTipoCambio(TxtFechaPago.Text.ToDate).ToString.ToDecimal Dim CveMonedaPago As Integer = DdlMoneda.SelectedValue.ToEntero - If RBLPago.SelectedValue.ToEntero = 2 AndAlso ArrAnticipos.Count = 0 Then 'Contado + If RBLPago.SelectedValue.ToEntero = 2 Then 'Contado If RBLContado.SelectedValue = "1" Then ImportePago = TxtDocumentoImporte.Text.Trim.ToDecimal @@ -4283,7 +4283,9 @@ Partial Class Compras_Compras If UsuarioActual.CveEmpresa.Contiene(72, 80) Then CveConceptoContableAlmacen = 205 End If - Else + Else + + CveConceptoContableAlmacen = 225 End If @@ -5572,17 +5574,18 @@ Partial Class Compras_Compras End If - If TipoCambioCompra > 1 Then Concepto += $" TC:{TipoCambioCompra} ${importeMovimiento.FormatoNumero(2)}" + If TipoCambioCompra > 1 AndAlso DdlMoneda.SelectedValue.ToEntero <> 1 Then Concepto += $" TC:{TipoCambioCompra} ${importeMovimiento.FormatoNumero(2)}" - If TipoCambioCompra = 1 Then + If TipoCambioCompra = 1 Or DdlMoneda.SelectedValue.ToEntero = 1 Then IdCtaContable = CtaProveedor CveCuenta = CveCuentaProveedor + importeMovimiento = importeMN Else IdCtaContable = CtaProveedorComplementaria CveCuenta = CveCuentaProveedorComplementaria If importeMovimiento <> 0 AndAlso (IdCtaContable > 0 Or CveCuenta > 0) Then 'Cuando tiene complementaria lo dividimos en dos importeMN = importeMovimiento - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, Referencia, 201, Concepto, FechaMovimiento, IdCtaContable, -1, CveIE, CveProveedor:=CveProveedor, ImporteMX:=importeMovimiento * TipoCambioCompra - importeMovimiento, CveCuenta:=CveCuenta, Contabilizable:=SeContabiliza, TipoCambio:=TipoCambioCompra) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento * TipoCambioCompra - importeMovimiento, Referencia, 206, Concepto, FechaMovimiento, IdCtaContable, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, ImporteMX:=importeMovimiento * TipoCambioCompra - importeMovimiento, ImporteME:=importeMovimiento, CveCuenta:=CveCuenta, Contabilizable:=SeContabiliza, TipoCambio:=TipoCambioCompra) Then ErrorPrepoliza = True End If End If @@ -5598,9 +5601,9 @@ Partial Class Compras_Compras End If importeMN = importeMovimiento * TCPago * Multiplicador - If TCPago > 1 Then Concepto += $" TC:{TCPago} ${importeMovimiento.FormatoNumero(2)}" + If TCPago > 1 AndAlso CveMonedaPago <> 1 Then Concepto += $" TC:{TCPago} ${importeMovimiento.FormatoNumero(2)}" - If TCPago = 1 Then + If TCPago = 1 Or CveMonedaPago = 1 Then IdCtaContable = IdCuentaBancaria CveCuenta = CveCuentaBancaria Else @@ -5608,7 +5611,7 @@ Partial Class Compras_Compras CveCuenta = CveCuentaBancariaComplementaria If importeMovimiento <> 0 AndAlso (IdCtaContable > 0 Or CveCuenta > 0) Then 'Cuando tiene complementaria lo dividimos en dos importeMN = importeMovimiento - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, Referencia, 201, Concepto, FechaMovimiento, IdCtaContable, -1, CveIE, CveProveedor:=CveProveedor, ImporteMX:=importeMovimiento * TCPago - importeMovimiento, CveCuenta:=CveCuenta, Contabilizable:=SeContabiliza, TipoCambio:=TCPago) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento * TCPago - importeMovimiento, Referencia, 204, Concepto, FechaMovimiento, IdCtaContable, -1, CveIE, CveProveedor:=CveProveedor, ImporteMX:=importeMovimiento * TCPago - importeMovimiento, ImporteME:=importeMovimiento, CveCuenta:=CveCuenta, Contabilizable:=SeContabiliza, TipoCambio:=TCPago) Then ErrorPrepoliza = True End If End If @@ -5654,7 +5657,7 @@ Partial Class Compras_Compras End If End If - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, importeMovimiento, Referencia, 14, Concepto + If(tipoCambioActual > 1, $" TC: {tipoCambioActual} ${importeMovimiento.FormatoNumero(2)}", ""), FechaMovimiento, IdCtaIva, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CveIE:=CveIE, CvePersonal:=CvePersonal, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=importeMovimiento * tipoCambioActual, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuentaIVA, PorcentajeImpuesto:=PorcentajeImpuesto, Contabilizable:=SeContabiliza) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, importeMovimiento, Referencia, 14, Concepto + If(tipoCambioActual > 1, $" TC: {tipoCambioActual} ${importeMovimiento.FormatoNumero(2)}", ""), FechaMovimiento, IdCtaIva, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CveIE:=CveIE, CvePersonal:=CvePersonal, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=importeMovimiento * tipoCambioActual, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuentaIVA, PorcentajeImpuesto:=PorcentajeImpuesto, Contabilizable:=SeContabiliza, TipoCambio:=tipoCambioActual) Then ErrorPrepoliza = True End If End If @@ -5715,7 +5718,7 @@ Partial Class Compras_Compras End If End If - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, importeMovimiento, Referencia, 25, Concepto + If(tipoCambioActual > 1, $" TC: {tipoCambioActual} ${importeMovimiento.FormatoNumero(2)}", ""), FechaMovimiento, IdCtaIEPS, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CveIE:=CveIE, CvePersonal:=CvePersonal, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=importeMovimiento * tipoCambioActual, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuentaIEPS, Contabilizable:=SeContabiliza) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, importeMovimiento, Referencia, 25, Concepto + If(tipoCambioActual > 1, $" TC: {tipoCambioActual} ${importeMovimiento.FormatoNumero(2)}", ""), FechaMovimiento, IdCtaIEPS, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CveIE:=CveIE, CvePersonal:=CvePersonal, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=importeMovimiento * tipoCambioActual, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuentaIEPS, Contabilizable:=SeContabiliza, TipoCambio:=tipoCambioActual) Then ErrorPrepoliza = True End If End If @@ -5745,7 +5748,7 @@ Partial Class Compras_Compras 'Agregamos el Opuesto del 22 -> 15 If importeMovimiento <> 0 Then - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, importeMovimiento, Referencia, 15, Concepto + If(tipoCambioActual > 1, $" TC: {tipoCambioActual} ${importeMovimiento.FormatoNumero(2)}", ""), FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CveIE:=CveIE, CvePersonal:=CvePersonal, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=importeMovimiento * tipoCambioActual, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, Contabilizable:=SeContabiliza) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, importeMovimiento, Referencia, 15, Concepto + If(tipoCambioActual > 1, $" TC: {tipoCambioActual} ${importeMovimiento.FormatoNumero(2)}", ""), FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CveIE:=CveIE, CvePersonal:=CvePersonal, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=importeMovimiento * tipoCambioActual, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, Contabilizable:=SeContabiliza, TipoCambio:=tipoCambioActual) Then ErrorPrepoliza = True End If End If @@ -5799,7 +5802,7 @@ Partial Class Compras_Compras 'Agregamos el Opuesto del 184 -> 183 If importeMovimiento <> 0 Then - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, importeMovimiento, Referencia, 183, Concepto + If(tipoCambioActual > 1, $" TC: {tipoCambioActual} ${importeMovimiento.FormatoNumero(2)}", ""), FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CveIE:=CveIE, CvePersonal:=CvePersonal, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=importeMovimiento * tipoCambioActual, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, Contabilizable:=SeContabiliza) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, importeMovimiento, Referencia, 183, Concepto + If(tipoCambioActual > 1, $" TC: {tipoCambioActual} ${importeMovimiento.FormatoNumero(2)}", ""), FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CveIE:=CveIE, CvePersonal:=CvePersonal, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=importeMovimiento * tipoCambioActual, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, Contabilizable:=SeContabiliza, TipoCambio:=tipoCambioActual) Then ErrorPrepoliza = True End If End If @@ -5875,7 +5878,7 @@ Partial Class Compras_Compras 'Agregamos el Opuesto del 186 -> 185 If importeMovimiento <> 0 Then - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, importeMovimiento, Referencia, 185, Concepto + If(tipoCambioActual > 1, $" TC: {tipoCambioActual} ${importeMovimiento.FormatoNumero(2)}", ""), FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CveIE:=CveIE, CvePersonal:=CvePersonal, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=importeMovimiento * tipoCambioActual, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, Contabilizable:=SeContabiliza) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, importeMovimiento, Referencia, 185, Concepto + If(tipoCambioActual > 1, $" TC: {tipoCambioActual} ${importeMovimiento.FormatoNumero(2)}", ""), FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CveIE:=CveIE, CvePersonal:=CvePersonal, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=importeMovimiento * tipoCambioActual, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, Contabilizable:=SeContabiliza, TipoCambio:=tipoCambioActual) Then ErrorPrepoliza = True End If End If @@ -5929,36 +5932,36 @@ Partial Class Compras_Compras If tipoCambioActual > 1 Then Concepto += $" TC:{tipoCambioActual} ${importeMovimiento.FormatoNumero(2)}" End If - End If - Case 23 'RetISR Acreditable - If Not DdlTipoComprobante.SelectedValue.Contiene("Ant") Then - If DdlRetISRConcepto.Items.Count > 0 AndAlso DdlRetISRConcepto.SelectedValue.ToEntero = 1 Then - importeMovimiento = importeRetISRAcreditable - importeMN = Math.Round(importeMovimiento, 2) * tipoCambioActual * Multiplicador - If CtaProveedorRetISR > 0 Then - IdCtaContable = CtaProveedorRetISR - CveCuenta = CveCuentaProveedorRetISR - ElseIf UsuarioActual.Empresa.Funcionalidad(316).ToEntero > 0 Then - IdCtaContable = UsuarioActual.Empresa.Funcionalidad(316).ToEntero - Else - If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then - If ObjConta.DtResultados.Rows.Count > 0 Then - IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero - CveCuenta = ObjConta.DtResultados.Rows(0)("IdCuentaRetISRCirculacionSIG").ToString.ToEntero - End If - End If - End If - - 'Agregamos el Opuesto del 23 -> 16 - If importeMovimiento <> 0 Then - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, importeMovimiento, Referencia, 15, Concepto + If(tipoCambioActual > 1, $" TC: {tipoCambioActual} ${importeMovimiento.FormatoNumero(2)}", ""), FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CveIE:=CveIE, CvePersonal:=CvePersonal, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=importeMovimiento * tipoCambioActual, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, Contabilizable:=SeContabiliza) Then - ErrorPrepoliza = True - End If - End If - - If tipoCambioActual > 1 Then Concepto += $" TC:{tipoCambioActual} ${importeMovimiento.FormatoNumero(2)}" - End If - End If + End If + 'Case 23 'RetISR Acreditable + ' If Not DdlTipoComprobante.SelectedValue.Contiene("Ant") Then + ' If DdlRetISRConcepto.Items.Count > 0 AndAlso DdlRetISRConcepto.SelectedValue.ToEntero = 1 Then + ' importeMovimiento = importeRetISRAcreditable + ' importeMN = Math.Round(importeMovimiento, 2) * tipoCambioActual * Multiplicador + ' If CtaProveedorRetISR > 0 Then + ' IdCtaContable = CtaProveedorRetISR + ' CveCuenta = CveCuentaProveedorRetISR + ' ElseIf UsuarioActual.Empresa.Funcionalidad(316).ToEntero > 0 Then + ' IdCtaContable = UsuarioActual.Empresa.Funcionalidad(316).ToEntero + ' Else + ' If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then + ' If ObjConta.DtResultados.Rows.Count > 0 Then + ' IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero + ' CveCuenta = ObjConta.DtResultados.Rows(0)("IdCuentaRetISRCirculacionSIG").ToString.ToEntero + ' End If + ' End If + ' End If + + ' 'Agregamos el Opuesto del 23 -> 16 + ' If importeMovimiento <> 0 Then + ' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, importeMovimiento, Referencia, 15, Concepto + If(tipoCambioActual > 1, $" TC: {tipoCambioActual} ${importeMovimiento.FormatoNumero(2)}", ""), FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CveIE:=CveIE, CvePersonal:=CvePersonal, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=importeMovimiento * tipoCambioActual, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, Contabilizable:=SeContabiliza) Then + ' ErrorPrepoliza = True + ' End If + ' End If + + ' If tipoCambioActual > 1 Then Concepto += $" TC:{tipoCambioActual} ${importeMovimiento.FormatoNumero(2)}" + ' End If + ' End If Case 16 'Ret ISR X Acreditar If Not DdlTipoComprobante.SelectedValue.Contiene("Ant") Then If DdlRetISRConcepto.Items.Count > 0 AndAlso DdlRetISRConcepto.SelectedValue.ToEntero = 1 Then @@ -6001,34 +6004,34 @@ Partial Class Compras_Compras If tipoCambioActual > 1 Then Concepto += $" TC:{tipoCambioActual} ${importeMovimiento.FormatoNumero(2)}" End If - End If - Case 244 'RetISR Acreditable Terceros y Arrendamiento - If Not DdlTipoComprobante.SelectedValue.Contiene("Ant") Then - If DdlRetISRConcepto.Items.Count > 0 AndAlso DdlRetISRConcepto.SelectedValue.ToEntero = 2 Then - importeMovimiento = importeRetISRAcreditable - importeMN = Math.Round(importeMovimiento, 2) * tipoCambioActual * Multiplicador - If CtaProveedorRetISR > 0 Then - IdCtaContable = CtaProveedorRetISR - CveCuenta = CveCuentaProveedorRetISR - ElseIf UsuarioActual.Empresa.Funcionalidad(318).ToEntero > 0 Then - IdCtaContable = UsuarioActual.Empresa.Funcionalidad(318).ToEntero - Else - If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then - If ObjConta.DtResultados.Rows.Count > 0 Then - IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero - CveCuenta = ObjConta.DtResultados.Rows(0)("IdCuentaRetISRCirculacionSIG").ToString.ToEntero - End If - End If - End If - 'Agregamos el Opuesto del 244 -> 243 - If importeMovimiento <> 0 Then - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, importeMovimiento, Referencia, 243, Concepto + If(tipoCambioActual > 1, $" TC: {tipoCambioActual} ${importeMovimiento.FormatoNumero(2)}", ""), FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CveIE:=CveIE, CvePersonal:=CvePersonal, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=importeMovimiento * tipoCambioActual, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, Contabilizable:=SeContabiliza) Then - ErrorPrepoliza = True - End If - End If - If tipoCambioActual > 1 Then Concepto += $" TC:{tipoCambioActual} ${importeMovimiento.FormatoNumero(2)}" - End If - End If + End If + 'Case 244 'RetISR Acreditable Terceros y Arrendamiento + ' If Not DdlTipoComprobante.SelectedValue.Contiene("Ant") Then + ' If DdlRetISRConcepto.Items.Count > 0 AndAlso DdlRetISRConcepto.SelectedValue.ToEntero = 2 Then + ' importeMovimiento = importeRetISRAcreditable + ' importeMN = Math.Round(importeMovimiento, 2) * tipoCambioActual * Multiplicador + ' If CtaProveedorRetISR > 0 Then + ' IdCtaContable = CtaProveedorRetISR + ' CveCuenta = CveCuentaProveedorRetISR + ' ElseIf UsuarioActual.Empresa.Funcionalidad(318).ToEntero > 0 Then + ' IdCtaContable = UsuarioActual.Empresa.Funcionalidad(318).ToEntero + ' Else + ' If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then + ' If ObjConta.DtResultados.Rows.Count > 0 Then + ' IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero + ' CveCuenta = ObjConta.DtResultados.Rows(0)("IdCuentaRetISRCirculacionSIG").ToString.ToEntero + ' End If + ' End If + ' End If + ' 'Agregamos el Opuesto del 244 -> 243 + ' If importeMovimiento <> 0 Then + ' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, importeMovimiento, Referencia, 243, Concepto + If(tipoCambioActual > 1, $" TC: {tipoCambioActual} ${importeMovimiento.FormatoNumero(2)}", ""), FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CveIE:=CveIE, CvePersonal:=CvePersonal, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=importeMovimiento * tipoCambioActual, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, Contabilizable:=SeContabiliza) Then + ' ErrorPrepoliza = True + ' End If + ' End If + ' If tipoCambioActual > 1 Then Concepto += $" TC:{tipoCambioActual} ${importeMovimiento.FormatoNumero(2)}" + ' End If + ' End If Case 64 'Ganancia If TCPago <> 1 AndAlso TxtFechaPago.Text <> TxtFecha.Text Then IdCtaContable = UsuarioActual.Empresa.IdCuentaGananciaCambiaria @@ -6225,8 +6228,8 @@ Partial Class Compras_Compras CostoIndirectoAcum176 += ImporteCI176 'se considera costoindirecto, para que la factura tiene en un concepto tipo servicio SumatoriaOCINV += (Dr(If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, "ImporteSinImpuestos", "Total")).ToString.ToDecimal * tipoCambioActual) - (ImporteMN228 + ImporteMN229 - ImporteCI176) - If ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, Importe228, Referencia, ConceptoContabilizacionME, Concepto, FechaMovimiento, IdCtaContableME, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=ImporteMN228, ImporteME:=ImporteME228, CveCuenta:=CveCuenta, CveOCDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero, TipoCambio:=TCAjuste, CveMovimientoAlmacen:=Dr("CveMovimientoAlmacen").ToString.ToEntero, Contabilizable:=SeContabiliza) Then - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, Importe229, Referencia, ConceptoContabilizacionMEComp, Concepto, FechaMovimiento, IdCtaContableMEComp, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=ImporteMN229, ImporteME:=ImporteME229, CveCuenta:=CveCuenta, CveOCDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero, TipoCambio:=TCAjuste, CveMovimientoAlmacen:=Dr("CveMovimientoAlmacen").ToString.ToEntero, Contabilizable:=SeContabiliza) Then + If ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, Importe228, Referencia, ConceptoContabilizacionME, Concepto, FechaMovimiento, IdCtaContableME, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=ImporteMN228, ImporteME:=ImporteME228, CveCuenta:=CveCuenta, CveOCDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero, TipoCambio:=TCAjuste, CveMovimientoAlmacen:=CveMovimientoAlmacen, Contabilizable:=SeContabiliza) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, Importe229, Referencia, ConceptoContabilizacionMEComp, Concepto, FechaMovimiento, IdCtaContableMEComp, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=ImporteMN229, ImporteME:=ImporteME229, CveCuenta:=CveCuenta, CveOCDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero, TipoCambio:=TCAjuste, CveMovimientoAlmacen:=CveMovimientoAlmacen, Contabilizable:=SeContabiliza) Then ErrorPrepoliza = True Exit For End If @@ -6343,10 +6346,12 @@ Partial Class Compras_Compras End If - End If - - - + End If + + + ' adfasdasd + 'ChkNCInvNC + If Not ChkNCInvNC.Checked OrElse Not RegistroCuentaPuente Then 'GASTO If UsuarioActual.CveEmpresa = 119 Then @@ -6735,7 +6740,7 @@ Partial Class Compras_Compras ' End If 'End If - For Each Ant As Anticipos In ArrAnticipos + For Each Ant As Compras_Compras.Anticipos In ArrAnticipos Dim ConceptoContableAnticipo, ConceptoContableAnticipoComplementaria As Integer Dim CveCompraNC As Integer = CveCompra @@ -7322,7 +7327,7 @@ Partial Class Compras_Compras Dim PorcentajePago As Decimal Dim CveConceptoAnt As Integer = 21 Dim CveCompraNC As Integer - For Each Ant As Anticipos In ArrAnticipos + For Each Ant As Compras_Compras.Anticipos In ArrAnticipos CveCompraNC = CveCompra Dim CveConceptoPago As Integer = 17 Select Case Ant.TipoMovto @@ -8835,7 +8840,7 @@ Partial Class Compras_Compras Dim ImporteAnticipo As Decimal = 0 If ArrAnticipos.Count > 0 Then - For Each Ant As Anticipos In ArrAnticipos + For Each Ant As Compras_Compras.Anticipos In ArrAnticipos ImporteAnticipo += Ant.Importe Next End If @@ -9653,7 +9658,8 @@ Partial Class Compras_Compras End If 'NC CON PRODUCTOS - CUENTA PUENTE - If UsuarioActual.CveEmpresa.Contiene(119) And UsuarioActual.Empresa.UsaInventarios And Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") And Not UsuarioActual.Empresa.Funcionalidad(126) = "1" And ConceptoContabilizacionAlmacen.Contiene(225) Then + + If UsuarioActual.Empresa.UsaInventarios And Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") And Not UsuarioActual.Empresa.Funcionalidad(126) = "1" And ConceptoContabilizacionAlmacen.Contiene(225) Then importeMovimiento = TmpDT.SUM("Total", $"ISNULL(TipoAF,0) <> 2 AND ISNULL(AplicaCostoIndirecto,0) <> 1 AND CveTipoPS = 2").ToString.ToDecimal importeMN = importeMovimiento * tipoCambioActual * Multiplicador @@ -12249,7 +12255,7 @@ Partial Class Compras_Compras Select Case RBLContado.SelectedValue Case "1" ' Bancos PnlContadoBancos.Visible = True - TxtDocumentoImporte.Text = TxtTotal.Text + TxtDocumentoImporte.Text = (TxtTotal.Text.ToDecimal - LblAmortizacion.Text.ToDecimal).FormatoNumero Case "2" ' F y E PnlContadoFyE.Visible = True CargaFuncionariosEmpleados() @@ -12264,7 +12270,7 @@ Partial Class Compras_Compras CargaAcreedores() Case "6" ' Caja Chica PnlContadoCajaChica.Visible = True - TxtDocumentoImporteCaja.Text = TxtTotal.Text + TxtDocumentoImporteCaja.Text = (TxtTotal.Text.ToDecimal - LblAmortizacion.Text.ToDecimal).FormatoNumero End Select UpContado.Update() @@ -14590,7 +14596,7 @@ Partial Class Compras_Compras 'ANTICIPOS COMPRA Dim ImporteAnticipo As Decimal = 0 If ArrAnticipos.Count > 0 Then - For Each Ant As Anticipos In ArrAnticipos + For Each Ant As Compras_Compras.Anticipos In ArrAnticipos ImporteAnticipo += Ant.Importe Next End If diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index 2cdfa5f01..19f919a01 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -890,6 +890,7 @@ Partial Class PopUpVerFactura Vta.Cliente.Mail = dtVentas(0)("Mail").ToString Vta.RefDocto = dtVentas(0)("Ref").ToString Vta.CveVenta = dtVentas(0)("CveVenta").ToString.ToEntero + Vta.NumeroCuenta = dtVentas(0)("NumCtaPago").ToString Vta.Version = dtVentas(0)("Version").ToString Vta.NumeroContrato = dtVentas(0)("NumeroContrato").ToString @@ -2941,9 +2942,11 @@ Partial Class PopUpVerFactura Dim params As New List(Of ReportParameter) Dim CveFolio = "" CreaDT() + Dim ReporteEmpresa As New System.IO.FileInfo(String.Format("{0}Formatos/OrdenServicio.rdlc", UsuarioActual.Empresa.Ruta)) If ObjOS.GetOrdenesServicios(CveOS, -1, -1, -1, -1, UsuarioActual.CveEmpresa) Then - If ObjOS.DtResultados.Rows.Count > 0 Then + If ObjOS.DtResultados.Rows.Count > 0 Then + Dim dtOS As DataTable = ObjOS.DtResultados Dim dr As DataRow = dtOS.Rows(0) params.Add(New ReportParameter("Cliente", dr("Cliente").ToString)) @@ -2957,41 +2960,56 @@ Partial Class PopUpVerFactura params.Add(New ReportParameter("ClienteColonia", dr("Colonia").ToString)) params.Add(New ReportParameter("ClienteCiudad", dr("Ciudad").ToString)) params.Add(New ReportParameter("ClienteEstado", dr("Estado").ToString)) - CveFolio = dr("Folio").ToString + CveFolio = dr("Folio").ToString + + If ReporteEmpresa.Exists Then + params.Add(New ReportParameter("NoDeCliente", dr("CveCliente").ToString)) + params.Add(New ReportParameter("RFC", dr("RFC").ToString)) + params.Add(New ReportParameter("Vendedor", " ")) + params.Add(New ReportParameter("Correo", dr("Correo").ToString)) + params.Add(New ReportParameter("CodigoDeServicio", dr("CveOS").ToString)) + params.Add(New ReportParameter("Sucursal", dr("SubProyecto").ToString)) + params.Add(New ReportParameter("TipoServicio", dr("TipoServicio").ToString)) + params.Add(New ReportParameter("TipoEquipo", dr("TipoEquipo").ToString)) + params.Add(New ReportParameter("Descripcion", dr("Descripcion").ToString)) + params.Add(New ReportParameter("Copia", "Copia: Original")) + params.Add(New ReportParameter("Equipo", dr("Equipo").ToString)) + End If End If End If Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) - params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) - params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)) - params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString)) - - If Imagen.Exists Then - params.Add(New ReportParameter("LogoPath", logouri)) - Else - params.Add(New ReportParameter("LogoPath", "")) - End If - - If ObjOS.GetOrdenesServiciosDetalle(CveOS) Then - TmpDTOS = ObjOS.DtResultados - End If - - If ObjOS.GetDetalleMateriales(-1, CveOS) Then - TmpDTMaterialesOS = ObjOS.DtResultados - End If - - Dim lrds As New List(Of ReportDataSource) - Dim rds As New ReportDataSource With {.Name = "DataSet2", .Value = TmpDTMaterialesOS} - Dim rds2 As New ReportDataSource With {.Name = "DataSet1", .Value = TmpDTOS} - - lrds.Add(rds) - lrds.Add(rds2) - - ImprimirPDF("Empresas/Grales/Formatos/OrdenServicio.rdlc", lrds, params, NombreArchivo:=String.Format("OrdenServicio-{0}", CveFolio)) - - ObjOS.Dispose() + If Not ReporteEmpresa.Exists Then + params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) + params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)) + params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString)) + + If Imagen.Exists Then + params.Add(New ReportParameter("LogoPath", logouri)) + Else + params.Add(New ReportParameter("LogoPath", "")) + End If + + End If + + If ObjOS.GetOrdenesServiciosDetalle(CveOS) Then + TmpDTOS = ObjOS.DtResultados + End If + + If ObjOS.GetDetalleMateriales(-1, CveOS) Then + TmpDTMaterialesOS = ObjOS.DtResultados + End If + Dim lrds As New List(Of ReportDataSource) + Dim rds As New ReportDataSource With {.Name = "DataSet2", .Value = TmpDTMaterialesOS} + Dim rds2 As New ReportDataSource With {.Name = "DataSet1", .Value = TmpDTOS} + + lrds.Add(rds) + lrds.Add(rds2) + ObjOS.Dispose() + + ImprimirPDF(String.Format("Empresas/{0}/Formatos/OrdenServicio.rdlc", UsuarioActual.CveEmpresa), lrds, params, NombreArchivo:=String.Format("OrdenServicio-{0}", CveFolio)) End Sub Private Sub CreaDT() TmpDTOS = New DataTable diff --git a/Compras/Proveedores.aspx.vb b/Compras/Proveedores.aspx.vb index 25e2e72d7..073f98587 100644 --- a/Compras/Proveedores.aspx.vb +++ b/Compras/Proveedores.aspx.vb @@ -1357,7 +1357,14 @@ Partial Class Compras_Proveedores End If - IdCuentaContable = ObjContaAC.AddSiguienteCuentaHijo(ClaveFuncionalidad, TxtRazonSocial.Text.Trim, "D", 2) + If UsuarioActual.Empresa.Funcionalidad(322).ToString.Trim.ToEntero > 0 Then + IdCuentaContable = UsuarioActual.Empresa.Funcionalidad(322).ToString.Trim.ToEntero + Else + IdCuentaContable = ObjContaAC.AddSiguienteCuentaHijo(ClaveFuncionalidad, TxtRazonSocial.Text.Trim, "D", 2) + End If + + + If IdCuentaContable > 0 Then ObjContaAC.GetCuentas(IdCuentaContable, "-1", -1) @@ -1571,7 +1578,8 @@ Partial Class Compras_Proveedores 'End If Dim CreoCuenta As Boolean = False - If (UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.UsaContabilidad) Then + + If (UsuarioActual.Empresa.UsaAC Or (UsuarioActual.Empresa.UsaContabilidad And UsuarioActual.Empresa.Funcionalidad(322).ToString.Trim.ToEntero = 0)) Then Dim ObjContaAC = New ClsContPAQi(UsuarioActual.Empresa) Dim drCuenta As DataRow = ObjContaAC.DtResultados.FiltroPrimero("") If drCuenta IsNot Nothing Then diff --git a/Compras/RepComprasPrecios.aspx b/Compras/RepComprasPrecios.aspx new file mode 100644 index 000000000..4c0fac3c4 --- /dev/null +++ b/Compras/RepComprasPrecios.aspx @@ -0,0 +1,314 @@ +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepComprasPrecios.aspx.vb" Inherits="RepComprasPrecios" %> + + + + + + + + <%--
  • + PDF +
  • --%> +
  • + Excel +
  • +
    + + + + + + + + + <%-- + +
    + +
    +
    +
    --%> +
    + + + + +
    +
    +
    + + "> + +
    +
    +
    + +
    + +
    +
    +
    +
    + +
    > +
    +
    +
    +
    +
    +
    +
    + " style="display: inline-block; width: 150px;" /> + " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> +
    +
    + + + + + + <%-- + + + + --%> + + <%-- + + + + + + + + + + --%> + + <%-- + + --%> + + + + + + + + + +
    + + <%----%> + + + + + + + + diff --git a/Compras/RepComprasPrecios.aspx.vb b/Compras/RepComprasPrecios.aspx.vb new file mode 100644 index 000000000..235906965 --- /dev/null +++ b/Compras/RepComprasPrecios.aspx.vb @@ -0,0 +1,113 @@ +Option Explicit On +Option Strict On + +Imports System.Data +Imports Microsoft.Reporting.WebForms +Imports Extensiones +Partial Class RepComprasPrecios + Inherits ClsPaginas + Private Shared missing As Object = System.Reflection.Missing.Value + +#Region "PROPIEDADES" + Private Property DtCompras As DataTable + Get + Return DirectCast(ViewState("DtCompras"), DataTable) + End Get + Set(value As DataTable) + ViewState("DtCompras") = value + End Set + End Property + +#End Region + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load + If Not Page.IsPostBack Then + CargaProveedor() + 'CargaDatos() + End If + End Sub + +#Region " C A R G A - D A T O S " + Public Sub CargaDatos() + Dim ObjCompras As New ClsCompras + + If ObjCompras.GetRepComprasPrecios(DdlProveedor.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then + GvDatos.DataSource = ObjCompras.DtResultados + DtCompras = ObjCompras.DtResultados + + End If + + ObjCompras.Dispose() + GvDatos.DataBind() + UPDatos.Update() + End Sub +#End Region + +#Region "G V - D A T O S " + Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound + If e.Row.RowType = DataControlRowType.DataRow Then + + 'GvDatos.Columns(1).ItemStyle.Width = New Unit("500px") + + GvDatos.HeaderRow.Cells(0).Visible = False + e.Row.Cells(0).Visible = False + + e.Row.HorizontalAlign = HorizontalAlign.Right + e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left + e.Row.Cells(1).Width = Unit.Pixel(125) + + If e.Row.DBCampo("CvePS") = "" Then + e.Row.CssClass = "Totales" + End If + + For Each Cells As TableCell In e.Row.Cells + Dim Celda As String = Cells.Text + If IsNumeric(Celda) Then + 'If Celda.ToDouble = 0 Then + ' Cells.Text = "" + 'Else + Dim ce = DirectCast(Cells, System.Web.UI.WebControls.DataControlFieldCell) + + If Not ce.ContainingField.HeaderText = "PS" Then + Cells.Text = Cells.Text.FormatoNumero(2) + End If + 'End If + End If + Next + + End If + End Sub +#End Region + +#Region "CARGA COMBOS FILTRO" + Private Sub CargaProveedor() + DdlProveedor.setEsWebService(True) + DdlProveedor.Attributes.Add("data-metodo", "getproveedores") + DdlProveedor.SelectedText = "Todos" + DdlProveedor.SelectedValue = "-1" + End Sub +#End Region + +#Region "IMPRESION" + 'Private Sub LnkPdf_Click(sender As Object, e As EventArgs) Handles LnkPdf.Click + ' Imprime("PDF") + 'End Sub + Private Sub Imprime(Formato As String) + If DtCompras IsNot Nothing Then + Dim StrFiltro As New StringBuilder + StrFiltro.AppendFormat("Proveedor: {0},", DdlProveedor.SelectedText) + GvDatos.ExportToExcelG("RepComprasPrecios.xlsx", "Reporte de Precios de Compras", UsuarioActual, StrFiltro.ToString, 100, 200) + Else + Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia) + End If + End Sub +#End Region + Private Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click + CargaDatos() + End Sub + + Private Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click + Imprime("Excel") + End Sub + Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control) + End Sub +End Class diff --git a/Compras/RepNotasCredito.aspx.vb b/Compras/RepNotasCredito.aspx.vb index c04fd2c3e..cd955ec5c 100644 --- a/Compras/RepNotasCredito.aspx.vb +++ b/Compras/RepNotasCredito.aspx.vb @@ -1,281 +1,281 @@ -Option Explicit On -Option Strict On - -Imports System.Data -Imports Extensiones -Imports Microsoft.Reporting.WebForms - -Partial Class Compras_RepNotasCredito - Inherits ClsPaginas - -#Region "PROPIEDADES" - Private Property DtDatos As DataTable - Get - DtDatos = CType(ViewState("DtDatos"), DataTable) - End Get - Set(value As DataTable) - ViewState("DtDatos") = value - End Set - End Property -#End Region - Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load - If Not Page.IsPostBack Then - DdlProveedores.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa) - DdlProveedores.DataBind() - TxtFechaSaldar.Text = Now.ToShortDateString - CargaDatos() - End If - End Sub - - Private Sub CargaDatos() - Dim ObjCompras As New ClsCompras - Dim FechaI, FechaF As String - - If txtFechaI.Text <> "" Then FechaI = txtFechaI.Text Else FechaI = "-1" - If txtFechaF.Text <> "" Then FechaF = txtFechaF.Text Else FechaF = "-1" - - - If ObjCompras.GetNotasCreditoRep(DdlProveedores.SelectedValue.ToEntero, DdlOpcion.SelectedValue.ToEntero, FechaI, FechaF, UsuarioActual.CveEmpresa) Then - DtDatos = ObjCompras.DtResultados - CargaGrid("") - Else - Alert("Ocurrió un error al obtener el catálogo de Notas de Crédito", Extensiones.TipoMensaje.MsgError) - End If - - ObjCompras.Dispose() - End Sub - - Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) - If e.Row.RowType = DataControlRowType.DataRow Then - e.Row.FCHyperLink("HLRazonSocial").NavigateUrl = String.Format("/Compras/Proveedores.aspx?CveProveedor={0}", e.Row.DBCampo("CveProveedor")) - e.Row.FCHyperLink("HLSerieFolio").NavigateUrl = String.Format("/Compras/Compras.aspx?CveCompra={0}", e.Row.DBCampo("CveCompra")) - - End If - End Sub - - Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) - CargaDatos() - End Sub - - Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click - GvDatos.ExportToExcel("RepNotasCredito." & Now.ToShortDateString) - - End Sub - - - Private Sub GenerarPDF(Optional Formato As String = "PDF") - If DtDatos IsNot Nothing Then - Dim StrFiltro As New StringBuilder - 'StrFiltro.AppendFormat(String.Format("Proveedor: {0}, Estatus: {1}", DdlProveedores.SelectedItem.Text, DdlOpcion.SelectedItem.Text)) - ' If DdlTipoComprobante.SelectedValue <> "-1" Then StrFiltro.AppendFormat(" Tipo Documento: {0}", DdlTipoComprobante.SelectedItem.Text) - If DdlProveedores.SelectedValue <> "-1" Then StrFiltro.AppendFormat(" Proveedor: {0}", DdlProveedores.SelectedItem.Text) - If DdlOpcion.SelectedValue <> "-1" Then StrFiltro.AppendFormat(" Estatus: {0}", DdlOpcion.SelectedItem.Text) - - If txtFechaI.Text <> "" Then StrFiltro.AppendFormat(" Fecha Inicio : {0}", txtFechaI.Text.ToDate.ToShortDateString) - If txtFechaF.Text <> "" Then StrFiltro.AppendFormat(" Fecha Fin : {0}", txtFechaF.Text.ToDate.ToShortDateString) - - - Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) - Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) - 'Dim dt As DataTable = DtVentas.FiltraParametros("", "Orden") '.FiltraParametros("Total > 0", DistinctColumns:={"GPO", "Cantidad", "SubTotal", "Descuento", "Amortizacion", "IVA", "Total"}) - Dim FechaI, FechaF As String - FechaI = If(txtFechaI.Text = "" Or txtFechaI.Text = "__/__/____", "-1", txtFechaI.Text) - FechaF = If(txtFechaF.Text = "" Or txtFechaF.Text = "__/__/____", "-1", txtFechaF.Text) - Dim params As New List(Of ReportParameter) - - params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) - params.Add(New ReportParameter("FechaInicio", FechaI)) - params.Add(New ReportParameter("FechaFin", FechaF)) - params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)) - params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString)) - params.Add(New ReportParameter("Filtros", StrFiltro.ToString)) - - If Imagen.Exists Then - params.Add(New ReportParameter("LogoPath", logouri)) - Else - params.Add(New ReportParameter("LogoPath", "")) - End If - ImprimirPDF("Empresas/Grales/Formatos/RepNotasCredito.rdlc", DtDatos, params, String.Format("ReporteVentas-{0}", Now.ToDateTime.ToShortDateString), Formato:=Formato) - Else - Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia) - End If - - End Sub - - Protected Sub ImgImprimir_Click(sender As Object, e As EventArgs) Handles ImgImprimir.Click - GenerarPDF() - End Sub - - Private Sub LnkHabilitarSaldar_Click(sender As Object, e As EventArgs) Handles LnkHabilitarSaldar.Click - For Each gr As GridViewRow In GvDatos.Rows - If gr.DataKey("CveCompra") <> "" Then - gr.FCCheckBox("Chk").Visible = True - HLSaldar.Visible = True - LnkHabilitarSaldar.Visible = False - UpDatos.Update() - End If - Next - End Sub - - Protected Sub BtnSaldar_Click(sender As Object, e As EventArgs) - Dim ObjConta As New ClsContabilidad - ObjConta.IniciaTransacSQL() - Dim CvePrePoliza As Integer = 0 - Dim MsgError As String = "" - Dim IdCtaContable As Integer = 0 - Dim IdCtaContableComplementaria As Integer = 0 - Dim Importe As Decimal = 0 - Dim ImporteMN As Decimal = 0 - Dim ImporteComplementaria As Decimal = 0 - Dim CveMoneda As Integer = 0 - Dim TC As Decimal = GlobalTipoCambio(TxtFechaSaldar.Text.ToDate).ToDecimal - Dim TCCompra As Decimal = 0 - Dim Concepto As String = TxtConcepto.Text - Dim UsaComplementaria As Boolean = UsuarioActual.CveEmpresa.Contiene(119) - Dim MensajeAlert = New StringBuilder - - For Each gr As GridViewRow In GvDatos.Rows - If gr.FCCheckBox("Chk").Checked Then - IdCtaContable = 0 - IdCtaContableComplementaria = 0 - Importe = gr.DataKey("Saldo").ToDecimal.RoundSQL - ImporteMN = gr.DataKey("Saldo").ToDecimal.RoundSQL - TCCompra = gr.DataKey("TipoCambio").ToDecimal - CveMoneda = gr.DataKey("CveMoneda").ToEntero - - CvePrePoliza = ObjConta.AddPrePolizas("Compras/RepNotasCredito", 2, gr.DataKey("Saldo").ToDecimal, gr.DataKey("Saldo").ToDecimal, gr.DataKey("CveMoneda").ToEntero, Now, "Saldado manual", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) - - If CveMoneda > 1 Then - IdCtaContable = gr.DataKey("IdCtaContExtranjera").ToEntero - ImporteMN = (gr.DataKey("Saldo").ToDecimal * TCCompra).RoundSQL - Else - IdCtaContable = gr.DataKey("IdCtaContProveedores").ToEntero - End If - - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, -Importe, "", 18, Concepto, TxtFechaSaldar.Text.ToDate, IdCtaContable, -1, gr.DataKey("CveIE").ToEntero, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CvePersonal:=gr.DataKey("CvePersonal").ToEntero, ImporteMX:=-If(CveMoneda > 1 AndAlso UsaComplementaria, Importe, ImporteMN), ImporteME:=-If(CveMoneda > 1, Importe, 0), CveCompra:=gr.DataKey("CveCompra").ToEntero, CveCompraAmortizacion:=gr.DataKey("CveCompra").ToEntero, TipoCambio:=TCCompra) Then - MsgError = "Ocurrio un Error al saldar el movimiento" - End If - - If UsaComplementaria AndAlso CveMoneda > 1 Then - ImporteComplementaria = (Importe * TCCompra - Importe).RoundSQL - IdCtaContableComplementaria = gr.DataKey("IdCtaContComplementaria").ToEntero - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, -ImporteComplementaria, "", 235, Concepto, TxtFechaSaldar.Text.ToDate, IdCtaContableComplementaria, -1, CveCompra:=gr.DataKey("CveCompra").ToEntero, CveCompraAmortizacion:=gr.DataKey("CveCompra").ToEntero, CvePersonal:=gr.DataKey("CvePersonal").ToEntero, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, ImporteMX:=-ImporteComplementaria, ImporteME:=-ImporteComplementaria, TipoCambioPago:=TC, TipoCambio:=TCCompra) Then - MsgError = "Ocurrio un Error al saldar el movimiento" - End If - End If - - IdCtaContable = UsuarioActual.Empresa.Funcionalidad(564).ToString.ToEntero - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Importe, "", 211, Concepto, TxtFechaSaldar.Text.ToDate, IdCtaContable, -1, gr.DataKey("CveIE").ToEntero, ImporteMX:=If(CveMoneda > 1, (Importe * TC), Importe).RoundSQL, CveCuenta:=-1, CveCompra:=gr.DataKey("CveCompra").ToEntero, CveProveedor:=gr.DataKey("CveProveedor").ToEntero) Then - MsgError = "Ocurrio un Error al saldar el movimiento" - End If - - If TC <> TCCompra AndAlso CveMoneda > 1 AndAlso UsaComplementaria Then - Dim difFluctuacion As Decimal = TC - TCCompra - Dim CveConceptoFluctua As Integer = 64 '64.ganacia, 65.perdida - Dim TipoMovtoFluctua As Boolean = True - Dim IdCtaContableFluctua As Integer - Dim CveCuenta As Integer = 0 - If difFluctuacion < 0 Then - CveConceptoFluctua = 65 - TipoMovtoFluctua = False - IdCtaContableFluctua = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria - CveCuenta = UsuarioActual.Empresa.CveCuentaPerdidaCambiaria - Else - CveConceptoFluctua = 64 - TipoMovtoFluctua = True - IdCtaContableFluctua = UsuarioActual.Empresa.IdCuentaGananciaCambiaria - CveCuenta = UsuarioActual.Empresa.CveCuentaGananciaCambiaria - End If - Dim ImporteFluctuacion As Decimal = Math.Abs((Importe * difFluctuacion).RoundSQL) - - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoFluctua, ImporteFluctuacion, "", CveConceptoFluctua, Concepto, Now, IdCtaContableFluctua, -1, CveCompra:=gr.DataKey("CveCompra").ToEntero, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, ImporteMX:=ImporteFluctuacion, ImporteME:=ImporteFluctuacion, TipoCambio:=TCCompra, TipoCambioPago:=TC, CveCuenta:=CveCuenta) Then - MsgError = "Ocurrio un Error al saldar el movimiento" - End If - End If - - If ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, 5) Then - If ObjConta.ValorPolizaDescuadre > 0 Then - MsgError = ObjConta.MensajePolizaDescuadre - GuardaLogAD($"Ventas/Ventas-ProcesoPrePolizas | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas") - End If - End If - - If UsuarioActual.Empresa.Funcionalidad(200) = "1" AndAlso MsgError = "" Then - If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then - If MensajeAlert.ToString = "" Then - MensajeAlert.AppendFormat("Los siguientes movimientos fueron saldados correctamente:
    ") - End If - MensajeAlert.AppendFormat("", ObjConta.ContaIdPoliza, ObjConta.ContaFolio) - End If - End If - - If MsgError <> "" Then Exit For - - End If - Next - - - If MsgError = "" Then - ObjConta.Commit() - If MensajeAlert.ToString <> "" Then - Alert(MensajeAlert.ToString) - Else - Alert("Los movimientos fueron saldados correctamente.") - End If - Alert(MensajeAlert.ToString) - CargaDatos() - HLSaldar.Visible = False - RegistraScript("$('#DivSaldar').modal('hide')") - LnkHabilitarSaldar.Visible = True - Else - ObjConta.RollBack() - Alert(MsgError, TipoMensaje.MsgError) - End If - ObjConta.Dispose() - End Sub - Protected Sub LnkSaldar_Click(sender As Object, e As EventArgs) - - End Sub - - -#Region "O R D E N A M I E N T O" - Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs) - Dim Orden As String = "" - Dim Campo As String = "" - Dim Literal As Literal = Nothing - Const OrdenInicial As String = "" - Dim Arg(2) As String - - Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c) - Campo = Arg(0) - Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(", ", "_")), Literal) - - If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then - ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo) - Literal.Text = String.Format("") - Else - ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo) - Literal.Text = String.Format("") - End If - Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString - ViewState("Orden") = Orden - CargaGrid(Orden) - End Sub - - Protected Sub CargaGrid(Orden As String) - Dim DV As DataView = Nothing - DV = New DataView(DtDatos, "", Orden, DataViewRowState.CurrentRows) - If Orden <> String.Empty Then - GvDatos.DataSource = DV.ToTable() - Else - GvDatos.DataSource = DtDatos - End If - - GvDatos.DataBind() - UpDatos.Update() - DV.Dispose() - End Sub -#End Region - - -End Class +Option Explicit On +Option Strict On + +Imports System.Data +Imports Extensiones +Imports Microsoft.Reporting.WebForms + +Partial Class Compras_RepNotasCredito + Inherits ClsPaginas + +#Region "PROPIEDADES" + Private Property DtDatos As DataTable + Get + DtDatos = CType(ViewState("DtDatos"), DataTable) + End Get + Set(value As DataTable) + ViewState("DtDatos") = value + End Set + End Property +#End Region + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load + If Not Page.IsPostBack Then + DdlProveedores.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa) + DdlProveedores.DataBind() + TxtFechaSaldar.Text = Now.ToShortDateString + CargaDatos() + End If + End Sub + + Private Sub CargaDatos() + Dim ObjCompras As New ClsCompras + Dim FechaI, FechaF As String + + If txtFechaI.Text <> "" Then FechaI = txtFechaI.Text Else FechaI = "-1" + If txtFechaF.Text <> "" Then FechaF = txtFechaF.Text Else FechaF = "-1" + + + If ObjCompras.GetNotasCreditoRep(DdlProveedores.SelectedValue.ToEntero, DdlOpcion.SelectedValue.ToEntero, FechaI, FechaF, UsuarioActual.CveEmpresa) Then + DtDatos = ObjCompras.DtResultados + CargaGrid("") + Else + Alert("Ocurrió un error al obtener el catálogo de Notas de Crédito", Extensiones.TipoMensaje.MsgError) + End If + + ObjCompras.Dispose() + End Sub + + Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) + If e.Row.RowType = DataControlRowType.DataRow Then + e.Row.FCHyperLink("HLRazonSocial").NavigateUrl = String.Format("/Compras/Proveedores.aspx?CveProveedor={0}", e.Row.DBCampo("CveProveedor")) + e.Row.FCHyperLink("HLSerieFolio").NavigateUrl = String.Format("/Compras/Compras.aspx?CveCompra={0}", e.Row.DBCampo("CveCompra")) + + End If + End Sub + + Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) + CargaDatos() + End Sub + + Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click + GvDatos.ExportToExcel("RepNotasCredito." & Now.ToShortDateString) + + End Sub + + + Private Sub GenerarPDF(Optional Formato As String = "PDF") + If DtDatos IsNot Nothing Then + Dim StrFiltro As New StringBuilder + 'StrFiltro.AppendFormat(String.Format("Proveedor: {0}, Estatus: {1}", DdlProveedores.SelectedItem.Text, DdlOpcion.SelectedItem.Text)) + ' If DdlTipoComprobante.SelectedValue <> "-1" Then StrFiltro.AppendFormat(" Tipo Documento: {0}", DdlTipoComprobante.SelectedItem.Text) + If DdlProveedores.SelectedValue <> "-1" Then StrFiltro.AppendFormat(" Proveedor: {0}", DdlProveedores.SelectedItem.Text) + If DdlOpcion.SelectedValue <> "-1" Then StrFiltro.AppendFormat(" Estatus: {0}", DdlOpcion.SelectedItem.Text) + + If txtFechaI.Text <> "" Then StrFiltro.AppendFormat(" Fecha Inicio : {0}", txtFechaI.Text.ToDate.ToShortDateString) + If txtFechaF.Text <> "" Then StrFiltro.AppendFormat(" Fecha Fin : {0}", txtFechaF.Text.ToDate.ToShortDateString) + + + Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) + Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + 'Dim dt As DataTable = DtVentas.FiltraParametros("", "Orden") '.FiltraParametros("Total > 0", DistinctColumns:={"GPO", "Cantidad", "SubTotal", "Descuento", "Amortizacion", "IVA", "Total"}) + Dim FechaI, FechaF As String + FechaI = If(txtFechaI.Text = "" Or txtFechaI.Text = "__/__/____", "-1", txtFechaI.Text) + FechaF = If(txtFechaF.Text = "" Or txtFechaF.Text = "__/__/____", "-1", txtFechaF.Text) + Dim params As New List(Of ReportParameter) + + params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) + params.Add(New ReportParameter("FechaInicio", FechaI)) + params.Add(New ReportParameter("FechaFin", FechaF)) + params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)) + params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString)) + params.Add(New ReportParameter("Filtros", StrFiltro.ToString)) + + If Imagen.Exists Then + params.Add(New ReportParameter("LogoPath", logouri)) + Else + params.Add(New ReportParameter("LogoPath", "")) + End If + ImprimirPDF("Empresas/Grales/Formatos/RepNotasCredito.rdlc", DtDatos, params, String.Format("ReporteVentas-{0}", Now.ToDateTime.ToShortDateString), Formato:=Formato) + Else + Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia) + End If + + End Sub + + Protected Sub ImgImprimir_Click(sender As Object, e As EventArgs) Handles ImgImprimir.Click + GenerarPDF() + End Sub + + Private Sub LnkHabilitarSaldar_Click(sender As Object, e As EventArgs) Handles LnkHabilitarSaldar.Click + For Each gr As GridViewRow In GvDatos.Rows + If gr.DataKey("CveCompra") <> "" Then + gr.FCCheckBox("Chk").Visible = True + HLSaldar.Visible = True + LnkHabilitarSaldar.Visible = False + UpDatos.Update() + End If + Next + End Sub + + Protected Sub BtnSaldar_Click(sender As Object, e As EventArgs) + Dim ObjConta As New ClsContabilidad + ObjConta.IniciaTransacSQL() + Dim CvePrePoliza As Integer = 0 + Dim MsgError As String = "" + Dim IdCtaContable As Integer = 0 + Dim IdCtaContableComplementaria As Integer = 0 + Dim Importe As Decimal = 0 + Dim ImporteMN As Decimal = 0 + Dim ImporteComplementaria As Decimal = 0 + Dim CveMoneda As Integer = 0 + Dim TC As Decimal = GlobalTipoCambio(TxtFechaSaldar.Text.ToDate).ToDecimal + Dim TCCompra As Decimal = 0 + Dim Concepto As String = TxtConcepto.Text + Dim UsaComplementaria As Boolean = UsuarioActual.CveEmpresa.Contiene(119) + Dim MensajeAlert = New StringBuilder + + For Each gr As GridViewRow In GvDatos.Rows + If gr.FCCheckBox("Chk").Checked Then + IdCtaContable = 0 + IdCtaContableComplementaria = 0 + Importe = gr.DataKey("Saldo").ToDecimal.RoundSQL + ImporteMN = gr.DataKey("Saldo").ToDecimal.RoundSQL + TCCompra = gr.DataKey("TipoCambio").ToDecimal + CveMoneda = gr.DataKey("CveMoneda").ToEntero + + CvePrePoliza = ObjConta.AddPrePolizas("Compras/RepNotasCredito", 103, gr.DataKey("Saldo").ToDecimal, gr.DataKey("Saldo").ToDecimal, gr.DataKey("CveMoneda").ToEntero, Now, "Saldado manual", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + + If CveMoneda > 1 Then + IdCtaContable = gr.DataKey("IdCtaContExtranjera").ToEntero + ImporteMN = (gr.DataKey("Saldo").ToDecimal * TCCompra).RoundSQL + Else + IdCtaContable = gr.DataKey("IdCtaContProveedores").ToEntero + End If + + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, -Importe, "", 18, Concepto, TxtFechaSaldar.Text.ToDate, IdCtaContable, -1, gr.DataKey("CveIE").ToEntero, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CvePersonal:=gr.DataKey("CvePersonal").ToEntero, ImporteMX:=-If(CveMoneda > 1 AndAlso UsaComplementaria, Importe, ImporteMN), ImporteME:=-If(CveMoneda > 1, Importe, 0), CveCompra:=gr.DataKey("CveCompra").ToEntero, CveCompraAmortizacion:=gr.DataKey("CveCompra").ToEntero, TipoCambio:=TCCompra) Then + MsgError = "Ocurrio un Error al saldar el movimiento" + End If + + If UsaComplementaria AndAlso CveMoneda > 1 Then + ImporteComplementaria = (Importe * TCCompra - Importe).RoundSQL + IdCtaContableComplementaria = gr.DataKey("IdCtaContComplementaria").ToEntero + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, -ImporteComplementaria, "", 235, Concepto, TxtFechaSaldar.Text.ToDate, IdCtaContableComplementaria, -1, CveCompra:=gr.DataKey("CveCompra").ToEntero, CveCompraAmortizacion:=gr.DataKey("CveCompra").ToEntero, CvePersonal:=gr.DataKey("CvePersonal").ToEntero, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, ImporteMX:=-ImporteComplementaria, ImporteME:=-ImporteComplementaria, TipoCambioPago:=TC, TipoCambio:=TCCompra) Then + MsgError = "Ocurrio un Error al saldar el movimiento" + End If + End If + + IdCtaContable = UsuarioActual.Empresa.Funcionalidad(564).ToString.ToEntero + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Importe, "", 211, Concepto, TxtFechaSaldar.Text.ToDate, IdCtaContable, -1, gr.DataKey("CveIE").ToEntero, ImporteMX:=If(CveMoneda > 1, (Importe * TC), Importe).RoundSQL, CveCuenta:=-1, CveCompra:=gr.DataKey("CveCompra").ToEntero, CveProveedor:=gr.DataKey("CveProveedor").ToEntero) Then + MsgError = "Ocurrio un Error al saldar el movimiento" + End If + + If TC <> TCCompra AndAlso CveMoneda > 1 AndAlso UsaComplementaria Then + Dim difFluctuacion As Decimal = TC - TCCompra + Dim CveConceptoFluctua As Integer = 64 '64.ganacia, 65.perdida + Dim TipoMovtoFluctua As Boolean = True + Dim IdCtaContableFluctua As Integer + Dim CveCuenta As Integer = 0 + If difFluctuacion < 0 Then + CveConceptoFluctua = 65 + TipoMovtoFluctua = False + IdCtaContableFluctua = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria + CveCuenta = UsuarioActual.Empresa.CveCuentaPerdidaCambiaria + Else + CveConceptoFluctua = 64 + TipoMovtoFluctua = True + IdCtaContableFluctua = UsuarioActual.Empresa.IdCuentaGananciaCambiaria + CveCuenta = UsuarioActual.Empresa.CveCuentaGananciaCambiaria + End If + Dim ImporteFluctuacion As Decimal = Math.Abs((Importe * difFluctuacion).RoundSQL) + + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoFluctua, ImporteFluctuacion, "", CveConceptoFluctua, Concepto, Now, IdCtaContableFluctua, -1, CveCompra:=gr.DataKey("CveCompra").ToEntero, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, ImporteMX:=ImporteFluctuacion, ImporteME:=ImporteFluctuacion, TipoCambio:=TCCompra, TipoCambioPago:=TC, CveCuenta:=CveCuenta) Then + MsgError = "Ocurrio un Error al saldar el movimiento" + End If + End If + + If ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, 5) Then + If ObjConta.ValorPolizaDescuadre > 0 Then + MsgError = ObjConta.MensajePolizaDescuadre + GuardaLogAD($"Ventas/Ventas-ProcesoPrePolizas | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas") + End If + End If + + If UsuarioActual.Empresa.Funcionalidad(200) = "1" AndAlso MsgError = "" Then + If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then + If MensajeAlert.ToString = "" Then + MensajeAlert.AppendFormat("Los siguientes movimientos fueron saldados correctamente:
    ") + End If + MensajeAlert.AppendFormat("", ObjConta.ContaIdPoliza, ObjConta.ContaFolio) + End If + End If + + If MsgError <> "" Then Exit For + + End If + Next + + + If MsgError = "" Then + ObjConta.Commit() + If MensajeAlert.ToString <> "" Then + Alert(MensajeAlert.ToString) + Else + Alert("Los movimientos fueron saldados correctamente.") + End If + Alert(MensajeAlert.ToString) + CargaDatos() + HLSaldar.Visible = False + RegistraScript("$('#DivSaldar').modal('hide')") + LnkHabilitarSaldar.Visible = True + Else + ObjConta.RollBack() + Alert(MsgError, TipoMensaje.MsgError) + End If + ObjConta.Dispose() + End Sub + Protected Sub LnkSaldar_Click(sender As Object, e As EventArgs) + + End Sub + + +#Region "O R D E N A M I E N T O" + Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs) + Dim Orden As String = "" + Dim Campo As String = "" + Dim Literal As Literal = Nothing + Const OrdenInicial As String = "" + Dim Arg(2) As String + + Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c) + Campo = Arg(0) + Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(", ", "_")), Literal) + + If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then + ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo) + Literal.Text = String.Format("") + Else + ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo) + Literal.Text = String.Format("") + End If + Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString + ViewState("Orden") = Orden + CargaGrid(Orden) + End Sub + + Protected Sub CargaGrid(Orden As String) + Dim DV As DataView = Nothing + DV = New DataView(DtDatos, "", Orden, DataViewRowState.CurrentRows) + If Orden <> String.Empty Then + GvDatos.DataSource = DV.ToTable() + Else + GvDatos.DataSource = DtDatos + End If + + GvDatos.DataBind() + UpDatos.Update() + DV.Dispose() + End Sub +#End Region + + +End Class diff --git a/Compras/RepReqOCCompraInv.aspx b/Compras/RepReqOCCompraInv.aspx new file mode 100644 index 000000000..383660de6 --- /dev/null +++ b/Compras/RepReqOCCompraInv.aspx @@ -0,0 +1,365 @@ +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepReqOCCompraInv.aspx.vb" Inherits="RepReqOCCompraInv" %> + + + + + + + +<%--
  • + PDF +
  • +
  • + Excel +
  • --%> +
    + + + + + + + + + <%-- + +
    + +
    +
    +
    --%> +
    + + + + +
    +
    +
    + + "> + +
    +
    +
    + + + +
    +
    + + + + + + + + + + +
    +
    + +
    +
    + + + + + + + + + + +
    +
    + + +
    + +
    + +
    +
    +
    + +
    > +
    + +
    + +
    + +<%-- +
    + +
    --%> +
    +
    +
    +
    +
    +
    +
    +
    + " style="display: inline-block; width: 150px;" /> + " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + <%----%> + + + + + + + + diff --git a/Compras/RepReqOCCompraInv.aspx.vb b/Compras/RepReqOCCompraInv.aspx.vb new file mode 100644 index 000000000..bfbb0fd3a --- /dev/null +++ b/Compras/RepReqOCCompraInv.aspx.vb @@ -0,0 +1,161 @@ +Option Explicit On +Option Strict On + +Imports System.Data +Imports Microsoft.Reporting.WebForms +Imports Extensiones +Partial Class RepReqOCCompraInv + Inherits ClsPaginas + Private Shared missing As Object = System.Reflection.Missing.Value + +#Region "PROPIEDADES" + Private Property FechaI As String + Get + Return ViewState("FechaI").ToString + End Get + Set(value As String) + ViewState("FechaI") = value + End Set + End Property + Private Property FechaF As String + Get + Return ViewState("FechaF").ToString + End Get + Set(value As String) + ViewState("FechaF") = value + End Set + End Property + 'Private Property CveCliente As Integer + ' Get + ' Return ViewState("CveCliente").ToString.ToEntero + ' End Get + ' Set(value As Integer) + ' ViewState("CveCliente") = value + ' End Set + 'End Property + 'Private Property Sucursales As String + ' Get + ' Return ViewState("Sucursales").ToString + ' End Get + ' Set(value As String) + ' ViewState("Sucursales") = value + ' End Set + 'End Property + Private Property DtCompras As DataTable + Get + Return DirectCast(ViewState("DtCompras"), DataTable) + End Get + Set(value As DataTable) + ViewState("DtCompras") = value + End Set + End Property + +#End Region + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load + If Not Page.IsPostBack Then + txtFechaI.Text = Now.ToShortDateString + txtFechaF.Text = Now.ToShortDateString + + CargaSucursal() + CargaProveedor() + CargaDatos() + + End If + End Sub + +#Region " C A R G A - D A T O S " + Public Sub CargaDatos() + Dim ObjCompras As New ClsCompras + + FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim(), MinFecha.ToShortDateString) + FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim(), MaxFecha.ToShortDateString) + + If ObjCompras.GetRepReqOCCompraInv(FechaI.ToDate, FechaF.ToDate, DdlProveedor.SelectedValue.ToEntero, DdlSucursal.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then + GvDatos.DataSource = ObjCompras.DtResultados + DtCompras = ObjCompras.DtResultados + GvDatos.DataBind() + UPDatos.Update() + End If + + ObjCompras.Dispose() + End Sub +#End Region + +#Region "G V - D A T O S " + 'Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound + ' If e.Row.RowType = DataControlRowType.DataRow Then + + ' 'Cuando es titulo + ' 'If e.Row.DBCampo("PS").ToString.Trim = "" Then + ' ' e.Row.CssClass = "Totales" + + ' ' e.Row.Cells(0).Text = String.Format("Folio: {0} ", e.Row.DBCampo("FolioSalida"), e.Row.DBCampo("CveMovimientoSalida")) + ' ' e.Row.Cells(1).Text = String.Format("{0}", e.Row.DBCampo("FechaMovto").ToString.ToDate.ToShortDateString) + ' ' e.Row.Cells(3).Text = String.Format("Almacen Destino: {0}       Responsable: {1}", e.Row.DBCampo("AlmacenDestino"), e.Row.DBCampo("Recibio")) + ' 'End If + + ' End If + 'End Sub +#End Region + +#Region "CARGA COMBOS FILTRO" + Private Sub CargaSucursal() + DdlSucursal.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa) + DdlSucursal.DataBind() + DdlSucursal.Items.Insert(0, New ListItem("Todos", "-1")) + DdlSucursal.SelectedValue = "-1" + End Sub + Private Sub CargaProveedor() + DdlProveedor.setEsWebService(True) + DdlProveedor.Attributes.Add("data-metodo", "getproveedores") + DdlProveedor.SelectedText = "Todos" + DdlProveedor.SelectedValue = "-1" + End Sub +#End Region + +#Region "IMPRESION" + 'Private Sub LnkPdf_Click(sender As Object, e As EventArgs) Handles LnkPdf.Click + ' Imprime("PDF") + 'End Sub + 'Private Sub Imprime(Formato As String) + ' If DtInventarios IsNot Nothing Then + ' Dim StrFiltro As New StringBuilder + ' If txtFechaI.Text <> "" Then StrFiltro.AppendFormat(" Fecha Inicio: {0}", txtFechaI.Text.ToDate.ToShortDateString) + ' If txtFechaF.Text <> "" Then StrFiltro.AppendFormat(" Fecha Fin: {0}", txtFechaF.Text.ToDate.ToShortDateString) + + ' If DdlAlmacenOrigen.SelectedValue <> "-1" Then StrFiltro.AppendFormat(" Almacén Origen: {0}", DdlAlmacenOrigen.SelectedItem.Text) + ' If DdlAlmacenDestino.SelectedValue <> "-1" Then StrFiltro.AppendFormat(" Almacén Destino: {0}", DdlAlmacenDestino.SelectedItem.Text) + ' If ChkRecibido.Checked Then StrFiltro.AppendFormat(" Recibidos: Si") Else StrFiltro.AppendFormat(" Recibidos: No") + + ' Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) + ' Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + + ' Dim FechaI, FechaF As String + ' FechaI = If(txtFechaI.Text = "" Or txtFechaI.Text = "__/__/____", "-1", txtFechaI.Text) + ' FechaF = If(txtFechaF.Text = "" Or txtFechaF.Text = "__/__/____", "-1", txtFechaF.Text) + + ' Dim params As New List(Of ReportParameter) + ' params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) + ' params.Add(New ReportParameter("FechaInicio", FechaI)) + ' params.Add(New ReportParameter("FechaFin", FechaF)) + ' params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)) + ' params.Add(New ReportParameter("Filtros", StrFiltro.ToString)) + ' If Imagen.Exists Then + ' params.Add(New ReportParameter("LogoPath", logouri)) + ' Else + ' params.Add(New ReportParameter("LogoPath", "")) + ' End If + ' ImprimirPDF("Empresas/Grales/Formatos/RepTraspasoAlmacen.rdlc", DtInventarios, params, String.Format("RepTraspasoAlmacen-{0}", Now.ToDateTime.ToShortDateString), Formato) + ' Else + ' Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia) + ' End If + 'End Sub +#End Region + Private Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click + CargaDatos() + End Sub + + 'Private Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click + ' Imprime("Excel") + 'End Sub +End Class diff --git a/Contabilidad/RegPoliza.aspx.vb b/Contabilidad/RegPoliza.aspx.vb index 565044422..443aa6d68 100644 --- a/Contabilidad/RegPoliza.aspx.vb +++ b/Contabilidad/RegPoliza.aspx.vb @@ -1819,15 +1819,19 @@ Partial Class RegPoliza Dim Referencia As String = Row("Referencia").ToString Dim Cuenta As String = Row("Código Cuenta").ToString + " - " + Row("Nombre Cuenta").ToString + Dim Cuenta2 = AgregaComilla(Cuenta) 'Agregar otra comilla simple adicional cuando contenga una + Dim CveCuenta As String = "" - If DTCuentas.FiltroPrimero("CtaCodigo = '" & Cuenta & "'") IsNot Nothing Then - CveCuenta = DTCuentas.FiltroPrimero("CtaCodigo = '" & Cuenta & "'")("Id").ToString + If DTCuentas.FiltroPrimero("CtaCodigo = '" & Cuenta2 & "'") IsNot Nothing Then + CveCuenta = DTCuentas.FiltroPrimero("CtaCodigo = '" & Cuenta2 & "'")("Id").ToString End If Dim SegNeg As String = Row("SegNeg").ToString + Dim SegNeg2 = AgregaComilla(SegNeg) 'Agregar otra comilla simple adicional cuando contenga una + Dim IdSegNeg As String = "" - If DTSegmentosNegocio.FiltroPrimero("Nombre = '" & SegNeg & "'") IsNot Nothing Then - IdSegNeg = DTSegmentosNegocio.FiltroPrimero("Nombre = '" & SegNeg & "'")("Id").ToString + If DTSegmentosNegocio.FiltroPrimero("Nombre = '" & SegNeg2 & "'") IsNot Nothing Then + IdSegNeg = DTSegmentosNegocio.FiltroPrimero("Nombre = '" & SegNeg2 & "'")("Id").ToString End If Dim Concepto As String = Row("Nombre/Concepto").ToString @@ -1884,4 +1888,18 @@ Partial Class RegPoliza DescargarFormato() End Sub + Private Function AgregaComilla(str As String) As String + If str.Contains("'") Then + Dim arr = Split(str, "'") + str = "" + For i = 0 To arr.Length() - 1 + If i = arr.Length - 1 Then + str += arr(i) + Else + str += arr(i) + "''" + End If + Next + End If + Return str + End Function End Class diff --git a/Contabilidad/RegPrePoliza.aspx b/Contabilidad/RegPrePoliza.aspx index c0620e052..2836aea82 100644 --- a/Contabilidad/RegPrePoliza.aspx +++ b/Contabilidad/RegPrePoliza.aspx @@ -140,12 +140,14 @@ +
    +
    diff --git a/Contabilidad/RegPrePoliza.aspx.vb b/Contabilidad/RegPrePoliza.aspx.vb index c7290769b..f982fbcdd 100644 --- a/Contabilidad/RegPrePoliza.aspx.vb +++ b/Contabilidad/RegPrePoliza.aspx.vb @@ -212,8 +212,14 @@ Partial Class ContabilidadC_RegPrePoliza End If Exit Sub Else + CreaDT() BtnEliminar.Visible = False + + If UsuarioActual.Empresa.UsaAC Then + ChkAutoConta.Checked = True + End If + End If @@ -816,7 +822,7 @@ Partial Class ContabilidadC_RegPrePoliza Dim Conta As ClsContPAQi = Nothing Dim IDPoliza As Integer = 0 Dim MsgError As String = "" - Dim CveIE As Integer + Dim CveIE As Integer = -1 Dim CveIEInsertado As Integer = -1 Dim FolioIE As String = "" @@ -889,7 +895,7 @@ Partial Class ContabilidadC_RegPrePoliza Next 'El movimiento 2 es el de Pago - If ChkAutoConta.Checked AndAlso UsuarioActual.Empresa.Funcionalidad(200) = "1" AndAlso MsgError = "" Then + If ChkAutoConta.Checked AndAlso MsgError = "" Or UsuarioActual.Empresa.Funcionalidad(200) = "1" And MsgError = "" Then If idCuentaContabilizacion > 0 Then If ObjMov.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then @@ -925,7 +931,7 @@ Partial Class ContabilidadC_RegPrePoliza If MsgError = "" Then 'MENSAJE IE - If CveIE Then + If CveIE > 0 Then MensajeAlert.AppendFormat("

    Folio Bancario: {1}", CveIE, FolioIE) Alert(MensajeAlert.ToString, ModExtensiones.TipoMensaje.MsgInformacion, "window.location.reload()") Else diff --git a/Contabilidad/RepBalanceGeneral.aspx.vb b/Contabilidad/RepBalanceGeneral.aspx.vb index 3db5b514a..063f02588 100644 --- a/Contabilidad/RepBalanceGeneral.aspx.vb +++ b/Contabilidad/RepBalanceGeneral.aspx.vb @@ -394,12 +394,12 @@ Partial Class Contabilidad_RepBalanceGeneral End Sub Private Sub ConfiguraFiltros() - FiltroActivoCirculante = "Tipo in ('A','B','C') AND (Sup = 'ACTIVO CIRCULANTE' OR Nombre = 'ACTIVO CIRCULANTE' OR Sup = 'CIRCULANTE' OR Nombre ='CIRCULANTE')" - FiltroActivoNoCirculante = "Tipo in ('A','B','C') AND (Sup = 'ACTIVO NO CIRCULANTE' OR Nombre = 'ACTIVO NO CIRCULANTE' OR Sup = 'FIJO' OR Nombre ='FIJO')" + FiltroActivoCirculante = "Tipo in ('A','B','C') AND (Sup = 'ACTIVO CIRCULANTE' OR Nombre = 'ACTIVO CIRCULANTE' OR Sup = 'CIRCULANTE' OR Nombre ='CIRCULANTE' OR Sup = 'Activo a corto plazo' OR Nombre ='Activo a corto plazo' )" + FiltroActivoNoCirculante = "Tipo in ('A','B','C') AND (Sup = 'ACTIVO NO CIRCULANTE' OR Nombre = 'ACTIVO NO CIRCULANTE' OR Sup = 'FIJO' OR Nombre ='FIJO' OR Sup = 'Activo a largo plazo' OR Nombre ='Activo a largo plazo')" FiltroActivoDiferido = "Tipo In ('A','B','C') AND (Sup = 'DIFERIDO' OR Nombre = 'DIFERIDO')" - FiltroPasivoCirculante = "Tipo in ('D') AND (Sup = 'PASIVO CIRCULANTE' OR (Sup = 'PASIVO' AND Nombre <> 'DIFERIDO' AND Nombre <> 'PASIVO NO CIRCULANTE' ) OR Sup = 'CIRCULANTE' OR Nombre = 'PASIVO CIRCULANTE' OR Sup = 'CORTO PLAZO' OR Nombre = 'CORTO PLAZO')" - FiltroPasivoNoCirculante = "Tipo in ('D') AND (Sup = 'PASIVO NO CIRCULANTE' OR Nombre = 'PASIVO NO CIRCULANTE' OR Sup = 'LARGO PLAZO' OR Nombre = 'LARGO PLAZO' OR Nombre = 'PASIVO LARGO PLAZO')" + FiltroPasivoCirculante = "Tipo in ('D') AND (Sup = 'PASIVO CIRCULANTE' OR (Sup = 'PASIVO' AND Nombre <> 'DIFERIDO' AND Nombre <> 'PASIVO NO CIRCULANTE' ) OR Sup = 'CIRCULANTE' OR Nombre = 'PASIVO CIRCULANTE' OR Sup = 'CORTO PLAZO' OR Nombre = 'CORTO PLAZO' OR Sup = 'Pasivo a corto plazo' OR Nombre = 'Pasivo a corto plazo')" + FiltroPasivoNoCirculante = "Tipo in ('D') AND (Sup = 'PASIVO NO CIRCULANTE' OR Nombre = 'PASIVO NO CIRCULANTE' OR Sup = 'LARGO PLAZO' OR Nombre = 'LARGO PLAZO' OR Nombre = 'PASIVO LARGO PLAZO' OR Sup = 'Pasivo a largo plazo' OR Nombre = 'Pasivo a largo plazo')" FiltroPasivoDiferido = "Tipo in ('D') AND (Sup = 'DIFERIDO' OR Nombre = 'DIFERIDO')" FiltroCapital = "Tipo in ('F') AND (Sup = 'PATRIMONIO CONTRIBUIDO' OR Nombre = 'PATRIMONIO CONTRIBUIDO' OR Sup = 'CAPITAL CONTABLE' OR Sup = 'CAPITAL' OR Nombre = 'CAPITAL CONTABLE' OR Nombre = 'CAPITAL')" diff --git a/Contabilidad/RepIVA.aspx b/Contabilidad/RepIVA.aspx index cd25184a0..fe925144c 100644 --- a/Contabilidad/RepIVA.aspx +++ b/Contabilidad/RepIVA.aspx @@ -1,267 +1,268 @@ -<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="RepIVA.aspx.cs" Inherits="Contabilidad_RepIVA" %> - - - - - - - - Reporte de Impuestos - - -
  • - PDF -
  • -
  • - Excel -
  • -
  • - Ver Dlls en pesos -
  • - - - -
  • - Generar DIOT -
  • - -
    - - - -
    -
    - - - - - - - -
    -
    -
    - -
    -
    -
    - -
    -
    - - - - - - - - - - -   -
    -
    - -
    -
    - - - - - - - - - - -
    -
    - -
    - - - - -
    -
    -
    -
    -
    -
    -
    -
    -
    - - - - - - - - -
    - - -

    IVA Trasladado

    - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    - -
    -

    IEPS por Porcentaje

    - - - - - - - - - -
    -
    -

    IVA por Porcentaje

    - - - - - - - - -
    -
    -
    - -
    -
    - - - -

    IVA Acreditable

    - - - - - - - - - - - - - - - - RetIVA
    Hon/Ser.Prof.
    -
    - - - -
    - - - - - - - - - <%-- - - - --%> - - - - - -
    -
    - -
    -

    IVA por Porcentaje

    - - - - - - - - -
    - -
    -
    -
    - -
    -
    - - - - - -
    - - - +<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="RepIVA.aspx.cs" Inherits="Contabilidad_RepIVA" %> + + + + + + + + Reporte de Impuestos + + +
  • + PDF +
  • +
  • + Excel +
  • +
  • + Ver Dlls en pesos +
  • + + + +
  • + Generar DIOT +
  • + +
    + + + +
    +
    + + + + + + + +
    +
    +
    + +
    +
    +
    + +
    +
    + + + + + + + + + + +   +
    +
    + +
    +
    + + + + + + + + + + +
    +
    + +
    + + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + + + + + +
    + + +

    IVA Trasladado

    + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    +

    IEPS por Porcentaje

    + + + + + + + + + +
    +
    +

    IVA por Porcentaje

    + + + + + + + + +
    +
    +
    + +
    +
    + + + +

    IVA Acreditable

    + + + + + + + + + + + + + + + + + RetIVA
    Hon/Ser.Prof.
    +
    + + + +
    + + + + + + + + + <%-- + + + --%> + + + + + +
    +
    + +
    +

    IVA por Porcentaje

    + + + + + + + + +
    + +
    +
    +
    + +
    +
    + + + + + +
    + + + diff --git a/Contabilidad/RepIVA.aspx.cs b/Contabilidad/RepIVA.aspx.cs index 3f8e11bff..176f60830 100644 --- a/Contabilidad/RepIVA.aspx.cs +++ b/Contabilidad/RepIVA.aspx.cs @@ -1,307 +1,316 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.UI.WebControls; -using Extensiones; -using System.Data; -using static Extensiones.ModExtensiones; -using Microsoft.Reporting.WebForms; -using System.Activities.Expressions; -using System.Text; -using System.IO; - -public partial class Contabilidad_RepIVA : ClsPaginas -{ - #region PROPIEDADES - - private DataTable DtIVATrasladado - { - get { return DtIVATrasladado = (DataTable)ViewState["DtIVATrasladado"]; } - set { ViewState["DtIVATrasladado"] = value; } - } - private DataTable DtIVAAcreditable - { - get { return DtIVAAcreditable = (DataTable)ViewState["DtIVAAcreditable"]; } - set { ViewState["DtIVAAcreditable"] = value; } - } - private double TCEspecifico - { - get { return TCEspecifico = (double)ViewState["TCEspecifico"]; } - set { ViewState["TCEspecifico"] = value; } - } - - private int TipoCambio - { - get { return TipoCambio = (int)ViewState["TipoCambio"]; } - set { ViewState["TipoCambio"] = value; } - } - - #endregion - protected void Page_Load(object sender, EventArgs e) - { - if (!IsPostBack) - { - InicializaValores(); - - } - } - - public void InicializaValores() - { - TipoCambio = 1; - TCEspecifico = -1; - txtFechaI.Text = $"01/{DateTime.Now.Month}/{DateTime.Now.Year}"; - txtFechaF.Text = DateTime.Now.ToShortDateString(); - - LnkAccionesDIOT.Visible = true; - - } - - public void Consulta() - { - if (TipoCambio == 3 && TxtEspecifico.Text != "") { TCEspecifico = TxtEspecifico.Text.ToDouble(); } else { TCEspecifico = -1; } - int Conciliado = DdlTipoMovto.SelectedValue.ToEntero(); - - ClsContabilidad ObjCont = new ClsContabilidad(); - if (ObjCont.GetRepIVA(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), 1, UsuarioActual.CveUsuario, Conciliado, UsuarioActual.CveEmpresa, TipoCambio, TCEspecifico)) - { - GvT.DataSource = ObjCont.DtResultados; - DtIVATrasladado = ObjCont.DtResultados; - if (ObjCont.GetRepIVAAcumulado(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), Conciliado, 1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)) - { - GvIEPSA.DataSource = ObjCont.DtResultados; - } - - if (ObjCont.GetRepIVAAcumulado(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), Conciliado, 2, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)) - { - GvIVAA.DataSource = ObjCont.DtResultados; - } - - } - if (ObjCont.GetRepIVA(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), 2, UsuarioActual.CveUsuario, Conciliado, UsuarioActual.CveEmpresa, TipoCambio, TCEspecifico)) - { - GvA.DataSource = ObjCont.DtResultados; - DtIVAAcreditable = ObjCont.DtResultados; - if (ObjCont.GetRepIVAAcumulado(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), Conciliado, 3, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)) - { - GvIVA2.DataSource = ObjCont.DtResultados; - } - } - ObjCont.Dispose(); - GvT.DataBind(); - GvA.DataBind(); - GvIEPSA.DataBind(); - GvIVAA.DataBind(); - GvIVA2.DataBind(); - UpDatos.Update(); - } - - protected void BtnConsultar_Click(object sender, EventArgs e) - { - Consulta(); - } - - protected void GvIVATrasladado_RowDataBound(object sender, GridViewRowEventArgs e) - { - if (e.Row.RowType == DataControlRowType.DataRow) - { - if (e.Row.DBCampo("CveVenta").ToEntero() < 1) - { - e.Row.CssClass = "Totales"; - } - } - } - - protected void GvIVAAcreditable_RowDataBound(object sender, GridViewRowEventArgs e) - { - if (e.Row.RowType == DataControlRowType.DataRow) - { - if (e.Row.DBCampo("CveCompra").ToEntero() < 1) - { - e.Row.CssClass = "Totales"; - } - if (e.Row.DBCampo("PorcentajeIVA").ToDecimal() > 0 ) - { - Decimal SubTotal = (e.Row.DBCampo("SubTotal16").ToDecimal() > 0? e.Row.DBCampo("SubTotal16").ToDecimal() : (e.Row.DBCampo("SubTotal8").ToDecimal() > 0? e.Row.DBCampo("SubTotal8").ToDecimal() : (Decimal)0.0) ); - - Decimal dif = Math.Round(SubTotal * e.Row.DBCampo("PorcentajeIVA").ToDecimal(), 2) - Math.Round(e.Row.DBCampo("IVA").ToDecimal(), 2); - if (dif > 1) - { - e.Row.ForeColor = System.Drawing.Color.Red; - e.Row.Cells[0].Text = e.Row.Cells[0].Text + "Err"; - - e.Row.ToolTip = "Dif:" + dif.ToString() + "- Sub:" + e.Row.DBCampo("SubTotal")+ " - IVA:"+ e.Row.DBCampo("IVA"); - } - } - } - } - - protected void LnkPdf_Click(object sender, EventArgs e) - { - Imprimir("PDF"); - } - - protected void LnkExcel_Click(object sender, EventArgs e) - { - Imprimir("EXCEL"); - } - - public void Imprimir(String Opcion) - { - String FechaF; - if (txtFechaF.Text == "" || txtFechaF.Text == "__/__/____") { FechaF = "-1"; } else { FechaF = $" Fecha Final: {txtFechaF.Text}"; } - String FechaI; - if (txtFechaI.Text == "" || txtFechaI.Text == "__/__/____") { FechaI = "-1"; } else { FechaI = $" Fecha Inicial: {txtFechaI.Text}"; } - if (DtIVATrasladado.Rows.Count > 0 || DtIVAAcreditable.Rows.Count > 0) - { - System.IO.FileInfo Imagen; - String logouri = ""; - - if (UsuarioActual.CveEmpresa.Contiene(119)) - { - Imagen = new System.IO.FileInfo(String.Format("{0}/Logo.jpg", UsuarioActual.Empresa.Ruta)); - logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.jpg", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa); - } - else - { - Imagen = new System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)); - logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa); - } - - List para = new List(); - para.Add(new CrystalParametro("Empresa", UsuarioActual.Empresa.Empresa)); - para.Add(new CrystalParametro("UsuarioImprimio", UsuarioActual.Nombre)); - para.Add(new CrystalParametro("Filtros", $"Filtros: {FechaI}{FechaF}")); - if (Imagen.Exists) - { - para.Add(new CrystalParametro("LogoPath", logouri)); - } - else - { - para.Add(new CrystalParametro("LogoPath", "")); - } - - DataTable Dt = TT.ActiveTabIndex == 0 ? DtIVATrasladado.Copy() : DtIVAAcreditable.Copy(); - string Formato = TT.ActiveTabIndex == 0 ? "RepIVA.rpt" : "RepIVAAcreditable.rpt"; - para.Add(new CrystalParametro("Excel", Formato)); - - ImprimirbytesPDF(ImprimirPDFCrystal(Server.MapPath($"~/Empresas/Grales/Formatos/{Formato}"),Dt,para, "Reporte de IVA", Opcion), "Reporte de IVA", Opcion); - } - else - { - Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia); - } - } - - protected void BtnTipoCambio_Click(object sender, EventArgs e) - { - Consulta(); - RegistraScript(String.Format("$('#{0}').modal('hide');", "DivTipoCambio")); - } - - protected void RblTipoCambio_SelectedIndexChanged(object sender, EventArgs e) - { - TipoCambio = RblTipoCambio.SelectedValue.ToEntero(); - if (TipoCambio == 3) - { - LiEspecifico.Visible = true; - TCEspecifico = get_GlobalTipoCambio(DateTime.Now).ToString().ToDouble(); - TxtEspecifico.Text = TCEspecifico.ToString(); - } - else - { - LiEspecifico.Visible = false; - } - UpBodyTipoCambio.Update(); - } - - - protected string GenerarDIOT() - { - System.Text.StringBuilder Respuesta = new System.Text.StringBuilder(); - - - - return Respuesta.ToString(); - } - - protected void LnkAccionesDIOT_Click(object sender, EventArgs e) - { - - ClsContabilidad Objconta = new ClsContabilidad(); - StringBuilder SBDIOT = new StringBuilder(); - int Conciliado = DdlTipoMovto.SelectedValue.ToEntero(); - - if (Objconta.GetRepIVA(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), 2, UsuarioActual.CveUsuario, Conciliado, UsuarioActual.CveEmpresa, TipoCambio, TCEspecifico)) - { - - foreach (DataRow Drow in Objconta.DtResultados.FiltraParametros("CveCompra is null and CveProveedor > 0 and SubTotal >= 1 ").Rows) // and(IVA > 1 OR IEPS > 0) - { - SBDIOT.AppendLine( - Drow["TipoTercero"].ToString() + "|" + - Drow["TipoOperacion"].ToString() + "|" + - Drow["RFC"].ToString() +"|"+ - Drow["NumeroIDFiscal"].ToString() + "|" + - Drow["NombreExtranjero"].ToString() +"|"+ - Drow["PaisResidencia"].ToString() + "|" + - Drow["Nacionalidad"].ToString() +"|"+ - LV(Drow["valorActos1516"].ToString()) + "|"+ - LV(Drow["valorActos15"].ToString()) + "|" + - LV(Drow["ValorIvaNo1516"].ToString()) +"|"+ - - LV(Drow["valorActos1011"].ToString()) + "|" + - LV(Drow["valorActos10"].ToString()) + "|" + - LV(Drow["valorActosImp8"].ToString()) + "|" + - LV(Drow["ValorIvaNo10"].ToString()) + "|" + - LV(Drow["ValorIvaNo08"].ToString()) + "|" + - - LV(Drow["valorActosImp1516"].ToString()) + "|" + - LV(Drow["ValorIvaNoImp16"].ToString()) + "|" + - - LV(Drow["valorActosImp10"].ToString()) + "|" + - LV(Drow["ValorIvaNoImp10"].ToString()) + "|" + - - LV(Drow["IvaExentoImpo"].ToString()) + "|"+ - LV(Drow["IVACero"].ToString()) + "|" + - LV(Drow["IvaExento"].ToString()) + "|"+ - LV(Drow["IvaRetenido"].ToString()) + "|" + - LV(Drow["IvaDevoluciones"].ToString()) + "|"); - } - } - - Objconta.Dispose(); - - //MemoryStream ms = new MemoryStream(); - //TextWriter tw = new StreamWriter(ms, System.Text.Encoding.UTF8); - - //tw.Write(SBDIOT.ToString()); - - //tw.Flush(); - - //byte[] bytes = ms.ToArray(); - //ms.Close(); - - //Response.Clear(); - //Response.AppendHeader("Content-Length", text.Length.ToString()); - //Response.ContentType = "text/plain"; - //Response.AddHeader("content-disposition", $"attachment; filename=DIOT_{ txtFechaI.Text.ToDate().ToString("ddMMyyyy") }_{txtFechaI.Text.ToDate().ToString("ddMMyyyy") }.txt"); - //Response.BinaryWrite(bytes); - //Response.End(); - - Response.Clear(); - Response.ClearHeaders(); - - Response.AppendHeader("Content-Length", SBDIOT.ToString().Length.ToString()); - Response.ContentType = "text/plain"; - Response.AppendHeader("Content-Disposition", $"attachment;filename=DIOT_{ txtFechaI.Text.ToDate().ToString("ddMMyyyy") }_{txtFechaI.Text.ToDate().ToString("ddMMyyyy") }.txt"); - - Response.Write(SBDIOT.ToString()); - Response.End(); - } - - protected string LV(string Valor ) - { - return (Valor.ToDecimal() > 0) ? Valor.ToDecimal().ToString().FormatoNumero(0).Replace(",", string.Empty) : ""; - } +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI.WebControls; +using Extensiones; +using System.Data; +using static Extensiones.ModExtensiones; +using Microsoft.Reporting.WebForms; +using System.Activities.Expressions; +using System.Text; +using System.IO; + +public partial class Contabilidad_RepIVA : ClsPaginas +{ + #region PROPIEDADES + + private DataTable DtIVATrasladado + { + get { return DtIVATrasladado = (DataTable)ViewState["DtIVATrasladado"]; } + set { ViewState["DtIVATrasladado"] = value; } + } + private DataTable DtIVAAcreditable + { + get { return DtIVAAcreditable = (DataTable)ViewState["DtIVAAcreditable"]; } + set { ViewState["DtIVAAcreditable"] = value; } + } + private double TCEspecifico + { + get { return TCEspecifico = (double)ViewState["TCEspecifico"]; } + set { ViewState["TCEspecifico"] = value; } + } + + private int TipoCambio + { + get { return TipoCambio = (int)ViewState["TipoCambio"]; } + set { ViewState["TipoCambio"] = value; } + } + + #endregion + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + InicializaValores(); + + } + } + + public void InicializaValores() + { + TipoCambio = 1; + TCEspecifico = -1; + txtFechaI.Text = $"01/{DateTime.Now.Month}/{DateTime.Now.Year}"; + txtFechaF.Text = DateTime.Now.ToShortDateString(); + + LnkAccionesDIOT.Visible = true; + + } + + public void Consulta() + { + if (TipoCambio == 3 && TxtEspecifico.Text != "") { TCEspecifico = TxtEspecifico.Text.ToDouble(); } else { TCEspecifico = -1; } + int Conciliado = DdlTipoMovto.SelectedValue.ToEntero(); + LblMsgAcreditable.Text = ""; // lbl de mensajes de negativos + + ClsContabilidad ObjCont = new ClsContabilidad(); + if (ObjCont.GetRepIVA(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), 1, UsuarioActual.CveUsuario, Conciliado, UsuarioActual.CveEmpresa, TipoCambio, TCEspecifico)) + { + GvT.DataSource = ObjCont.DtResultados; + DtIVATrasladado = ObjCont.DtResultados; + if (ObjCont.GetRepIVAAcumulado(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), Conciliado, 1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)) + { + GvIEPSA.DataSource = ObjCont.DtResultados; + } + + if (ObjCont.GetRepIVAAcumulado(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), Conciliado, 2, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)) + { + GvIVAA.DataSource = ObjCont.DtResultados; + } + + } + if (ObjCont.GetRepIVA(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), 2, UsuarioActual.CveUsuario, Conciliado, UsuarioActual.CveEmpresa, TipoCambio, TCEspecifico)) + { + GvA.DataSource = ObjCont.DtResultados; + DtIVAAcreditable = ObjCont.DtResultados; + if (DtIVAAcreditable.FiltraParametros("IVA < 0 OR IEPS < 0 ").Rows.Count > 0) + { + LblMsgAcreditable.Text = "La información presenta importes en negativo, estos no se incluirán en el archivo generado para DIOT"; + } + + + if (ObjCont.GetRepIVAAcumulado(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), Conciliado, 3, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)) + { + GvIVA2.DataSource = ObjCont.DtResultados; + } + + + } + ObjCont.Dispose(); + GvT.DataBind(); + GvA.DataBind(); + GvIEPSA.DataBind(); + GvIVAA.DataBind(); + GvIVA2.DataBind(); + UpDatos.Update(); + } + + protected void BtnConsultar_Click(object sender, EventArgs e) + { + Consulta(); + } + + protected void GvIVATrasladado_RowDataBound(object sender, GridViewRowEventArgs e) + { + if (e.Row.RowType == DataControlRowType.DataRow) + { + if (e.Row.DBCampo("CveVenta").ToEntero() < 1) + { + e.Row.CssClass = "Totales"; + } + } + } + + protected void GvIVAAcreditable_RowDataBound(object sender, GridViewRowEventArgs e) + { + if (e.Row.RowType == DataControlRowType.DataRow) + { + if (e.Row.DBCampo("CveCompra").ToEntero() < 1) + { + e.Row.CssClass = "Totales"; + } + if (e.Row.DBCampo("PorcentajeIVA").ToDecimal() > 0 ) + { + Decimal SubTotal = (e.Row.DBCampo("SubTotal16").ToDecimal() > 0? e.Row.DBCampo("SubTotal16").ToDecimal() : (e.Row.DBCampo("SubTotal8").ToDecimal() > 0? e.Row.DBCampo("SubTotal8").ToDecimal() : (Decimal)0.0) ); + + Decimal dif = Math.Round(SubTotal * e.Row.DBCampo("PorcentajeIVA").ToDecimal(), 2) - Math.Round(e.Row.DBCampo("IVA").ToDecimal(), 2); + if (dif > 1) + { + e.Row.ForeColor = System.Drawing.Color.Red; + e.Row.Cells[0].Text = e.Row.Cells[0].Text + "Err"; + + e.Row.ToolTip = "Dif:" + dif.ToString() + "- Sub:" + e.Row.DBCampo("SubTotal")+ " - IVA:"+ e.Row.DBCampo("IVA"); + } + } + } + } + + protected void LnkPdf_Click(object sender, EventArgs e) + { + Imprimir("PDF"); + } + + protected void LnkExcel_Click(object sender, EventArgs e) + { + Imprimir("EXCEL"); + } + + public void Imprimir(String Opcion) + { + String FechaF; + if (txtFechaF.Text == "" || txtFechaF.Text == "__/__/____") { FechaF = "-1"; } else { FechaF = $" Fecha Final: {txtFechaF.Text}"; } + String FechaI; + if (txtFechaI.Text == "" || txtFechaI.Text == "__/__/____") { FechaI = "-1"; } else { FechaI = $" Fecha Inicial: {txtFechaI.Text}"; } + if (DtIVATrasladado.Rows.Count > 0 || DtIVAAcreditable.Rows.Count > 0) + { + System.IO.FileInfo Imagen; + String logouri = ""; + + if (UsuarioActual.CveEmpresa.Contiene(119)) + { + Imagen = new System.IO.FileInfo(String.Format("{0}/Logo.jpg", UsuarioActual.Empresa.Ruta)); + logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.jpg", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa); + } + else + { + Imagen = new System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)); + logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa); + } + + List para = new List(); + para.Add(new CrystalParametro("Empresa", UsuarioActual.Empresa.Empresa)); + para.Add(new CrystalParametro("UsuarioImprimio", UsuarioActual.Nombre)); + para.Add(new CrystalParametro("Filtros", $"Filtros: {FechaI}{FechaF}")); + if (Imagen.Exists) + { + para.Add(new CrystalParametro("LogoPath", logouri)); + } + else + { + para.Add(new CrystalParametro("LogoPath", "")); + } + + DataTable Dt = TT.ActiveTabIndex == 0 ? DtIVATrasladado.Copy() : DtIVAAcreditable.Copy(); + string Formato = TT.ActiveTabIndex == 0 ? "RepIVA.rpt" : "RepIVAAcreditable.rpt"; + para.Add(new CrystalParametro("Excel", Formato)); + + ImprimirbytesPDF(ImprimirPDFCrystal(Server.MapPath($"~/Empresas/Grales/Formatos/{Formato}"),Dt,para, "Reporte de IVA", Opcion), "Reporte de IVA", Opcion); + } + else + { + Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia); + } + } + + protected void BtnTipoCambio_Click(object sender, EventArgs e) + { + Consulta(); + RegistraScript(String.Format("$('#{0}').modal('hide');", "DivTipoCambio")); + } + + protected void RblTipoCambio_SelectedIndexChanged(object sender, EventArgs e) + { + TipoCambio = RblTipoCambio.SelectedValue.ToEntero(); + if (TipoCambio == 3) + { + LiEspecifico.Visible = true; + TCEspecifico = get_GlobalTipoCambio(DateTime.Now).ToString().ToDouble(); + TxtEspecifico.Text = TCEspecifico.ToString(); + } + else + { + LiEspecifico.Visible = false; + } + UpBodyTipoCambio.Update(); + } + + + protected string GenerarDIOT() + { + System.Text.StringBuilder Respuesta = new System.Text.StringBuilder(); + + + + return Respuesta.ToString(); + } + + protected void LnkAccionesDIOT_Click(object sender, EventArgs e) + { + + ClsContabilidad Objconta = new ClsContabilidad(); + StringBuilder SBDIOT = new StringBuilder(); + int Conciliado = DdlTipoMovto.SelectedValue.ToEntero(); + + if (Objconta.GetRepIVA(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), 2, UsuarioActual.CveUsuario, Conciliado, UsuarioActual.CveEmpresa, TipoCambio, TCEspecifico)) + { + + foreach (DataRow Drow in Objconta.DtResultados.FiltraParametros("CveCompra is null and CveProveedor > 0 and SubTotal >= 1 ").Rows) // and(IVA > 1 OR IEPS > 0) + { + SBDIOT.AppendLine( + Drow["TipoTercero"].ToString() + "|" + + Drow["TipoOperacion"].ToString() + "|" + + Drow["RFC"].ToString() +"|"+ + Drow["NumeroIDFiscal"].ToString() + "|" + + Drow["NombreExtranjero"].ToString() +"|"+ + Drow["PaisResidencia"].ToString() + "|" + + Drow["Nacionalidad"].ToString() +"|"+ + LV(Drow["valorActos1516"].ToString()) + "|"+ + LV(Drow["valorActos15"].ToString()) + "|" + + LV(Drow["ValorIvaNo1516"].ToString()) +"|"+ + + LV(Drow["valorActos1011"].ToString()) + "|" + + LV(Drow["valorActos10"].ToString()) + "|" + + LV(Drow["valorActosImp8"].ToString()) + "|" + + LV(Drow["ValorIvaNo10"].ToString()) + "|" + + LV(Drow["ValorIvaNo08"].ToString()) + "|" + + + LV(Drow["valorActosImp1516"].ToString()) + "|" + + LV(Drow["ValorIvaNoImp16"].ToString()) + "|" + + + LV(Drow["valorActosImp10"].ToString()) + "|" + + LV(Drow["ValorIvaNoImp10"].ToString()) + "|" + + + LV(Drow["IvaExentoImpo"].ToString()) + "|"+ + LV(Drow["IVACero"].ToString()) + "|" + + LV(Drow["IvaExento"].ToString()) + "|"+ + LV(Drow["IvaRetenido"].ToString()) + "|" + + LV(Drow["IvaDevoluciones"].ToString()) + "|"); + } + } + + Objconta.Dispose(); + + //MemoryStream ms = new MemoryStream(); + //TextWriter tw = new StreamWriter(ms, System.Text.Encoding.UTF8); + + //tw.Write(SBDIOT.ToString()); + + //tw.Flush(); + + //byte[] bytes = ms.ToArray(); + //ms.Close(); + + //Response.Clear(); + //Response.AppendHeader("Content-Length", text.Length.ToString()); + //Response.ContentType = "text/plain"; + //Response.AddHeader("content-disposition", $"attachment; filename=DIOT_{ txtFechaI.Text.ToDate().ToString("ddMMyyyy") }_{txtFechaI.Text.ToDate().ToString("ddMMyyyy") }.txt"); + //Response.BinaryWrite(bytes); + //Response.End(); + + Response.Clear(); + Response.ClearHeaders(); + + Response.AppendHeader("Content-Length", SBDIOT.ToString().Length.ToString()); + Response.ContentType = "text/plain"; + Response.AppendHeader("Content-Disposition", $"attachment;filename=DIOT_{ txtFechaI.Text.ToDate().ToString("ddMMyyyy") }_{txtFechaI.Text.ToDate().ToString("ddMMyyyy") }.txt"); + + Response.Write(SBDIOT.ToString()); + Response.End(); + } + + protected string LV(string Valor ) + { + return (Valor.ToDecimal() > 0) ? Valor.ToDecimal().ToString().FormatoNumero(0).Replace(",", string.Empty) : ""; + } } \ No newline at end of file diff --git a/Empresas/140/Formatos/Cotizacion.rdlc b/Empresas/140/Formatos/Cotizacion.rdlc new file mode 100644 index 000000000..616303c08 --- /dev/null +++ b/Empresas/140/Formatos/Cotizacion.rdlc @@ -0,0 +1,3047 @@ + + + + + + true + true + + + + + Cliente: + + + + =Parameters!ClienteNombre.Value + + + + + + + + + Dirección: + + + + =Parameters!ClienteDireccion.Value + + + + + + + + + RFC: + + + + =Parameters!ClienteRFC.Value + + + + + + + + + Atención A: + + + + =Parameters!ClienteContacto.Value + + + + + + + Textbox2 + 0.05159in + 4.32145cm + 0.99993in + 3.6362in + + + 2pt + 2pt + 2pt + 2pt + + + + Embedded + Logo + Fit + 0.05159in + 0.0375in + 0.99993in + 1.60289in + 1 + + + + + + true + true + + + + + Domicilio fiscal: + + + + + + + + + + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + + + + + + + + + Cotización + + + + + + + + + + + + + Serie: + + + + =Parameters!Serie.Value + + + + Folio: + + + + =Parameters!Folio.Value + + + + + + + + + Fecha: + + + + + + + + = Parameters!Fecha.Value + + + + + + + + + + + + + Forma de pago: + + + + =Parameters!FormaPago.Value + + + + + + + + + Método de pago: + + + + =Parameters!MetodoPago.Value + + + + + + + + + Cuenta: + + + + =IIF(Parameters!NumCta.Value="0" Orelse Parameters!NumCta.Value="","No Identificado",Parameters!NumCta.Value) + + + + + + + Textbox4 + 0.05159in + 5.39311in + 1.27833in + 2.8593in + 3 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Expedido en + + + + : + + + + + + + + + =Parameters!DomicilioSucursal.Value + + + + + + + + + BBD021220APA + + + + + + + + + + + + + + + + + + Vendedor: + + + + =Parameters!VendedorNombre.Value + + + + + + + Textbox40 + 3.51387cm + 13.72673cm + 2.47332cm + 7.26261cm + 4 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + 0.75572in + + + 0.58129in + + + 0.79461in + + + 2.38421in + + + 0.78125in + + + 0.63048in + + + 0.55487in + + + 0.62063in + + + 1.11998in + + + + + 0.19645in + + + + + true + true + + + + + CANT + + + + + + #3a4173 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + UNIDAD + + + + + + #3a4173 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + CODIGO + + + + + + + Textbox29 + + + #3a4173 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + DESCRIPCIÓN + + + + + + + Textbox17 + + + #3a4173 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + PU + + + + + + + Textbox1 + + + #3a4173 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + %DESC + + + + + + + Textbox21 + + + #3a4173 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + IEPS + + + + + + + Textbox23 + + + #3a4173 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + IVA + + + + + + + Textbox8 + + + #3a4173 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + TOTAL + + + + + + + Textbox1 + + + #3a4173 + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.14436in + + + + + true + true + + + + + =Fields!Cantidad.Value + + + + + + + Cantidad1 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!UM.Value + + + + + + + UM + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Codigo.Value + + + + + + + Codigo + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!PS.Value & " " & Fields!Obs.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!PU.Value + + + + + + + PU1 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Descuento.Value + + + + + + + Descuento + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!IEPS.Value + + + + + + + IEPS + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!IVA.Value + + + + + + + IVA + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Cantidad.Value * Fields!PU.Value + + + + + + + TiempoEntrega + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + + + + + After + + + + + + + DsOC + 2.45577in + 0.04048in + 0.34081in + 8.22304in + 5 + + + + + + true + true + + + + + + + + #3a4173 + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + + + + #3a4173 + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =UCase(Parameters!ImporteLetra.Value) + + + + + + + ImporteLetra + 3.25108in + 1.038in + 0.18861in + 7.22552in + 8 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + 2.99824cm + + + + + 0.48004cm + + + + + true + true + + + + + =Fields!Importe.Value + + + + + + + Importe + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + =Fields!ImpuestoLocal.Value + + + + 2.93858cm + + + true + true + + + + + =IIF(Fields!ImpuestoLocal.Value = "Total",UCase(Fields!ImpuestoLocal.Value),Fields!ImpuestoLocal.Value) + + + + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + DataSet1 + 7.4511cm + 15.05252cm + 0.48004cm + 5.93682cm + 9 + + + + + + true + true + + + + + Sin más por el momento, se despide su seguro proveedor + + + + Textbox2 + 12.55395cm + 3.49882cm + 0.57354cm + 12.91587cm + 10 + + + 2pt + 2pt + 2pt + 2pt + + + + 14.00062cm + 7.56391cm + 0cm + 5.675cm + 11 + + + + + + true + true + + + + + =Parameters!VendedorNombre.Value + + + + Textbox3 + 14.07117cm + 7.56391cm + 0.6cm + 5.675cm + 12 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Observaciones de crédito: + + + + =Parameters!Observaciones.Value + + + + + + + =Parameters!FormaEntrega.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + 14.80346cm + + + + + + + + =Parameters!Serie.Value + + + + + + + + Folio: + + + + =Parameters!Folio.Value + + + + + + + Textbox81 + 0.36804in + 5.50529in + 0.18682in + 2.05349in + + + 2pt + 2pt + 2pt + 2pt + + + + Embedded + Logo + Fit + 0.23694in + 0.8541in + 1.39456in + 1 + + + + + + true + true + + + + + Cliente: + + + + =Parameters!ClienteCodigo.Value + + + + - + + + + =Parameters!ClienteNombre.Value + + + + + + + + + Domicilio: + + + + =Parameters!ClienteDireccion.Value + + + + , + + + + =Parameters!ClienteCiudad.Value + + + + , + + + + =Parameters!ClienteEstado.Value + + + + + + + Textbox36 + 1.83775cm + 4.3204cm + 0.96667cm + 14.87889cm + 2 + + + 2pt + 2pt + 2pt + 2pt + + + + 3.08165cm + 0.635cm + 0cm + 18.56429cm + 3 + + + + + + true + true + + + + + + + + + POR ESTE PAGARE ME(NO) OBLIGO(AMOS) INCONDICIONALMENTE A PAGAR A LA ORDEN DE + + + + BDH BATERIAS DISTRIBUCIONES DE HERMOSILLO, SA DE CV. + + + + AL VENCIMIENTO ABAJO INDICADO. EN LA CIUDAD DE HERMOSILLO, SONORA O EN CUALQUIER OTRO LUGAR QUE SE ME REQUIERA DE PAGO, RENUNCIANDO EXPRESAMENTE AL FUERO DE MI DOMICILIO. LA CANTIDAD DE + + + + $ + + + + =Parameters!Total.Value + + + + + + + =Microsoft.VisualBasic.Strings.UCase(Parameters!ImporteLetra.Value) + + + + + + + LA SUMA ANTERIOR SI NO FUERA CUBIERTA A SU VENCIMIENTO, CAUSARA INTERES MORATORIO A RAZON DEL + + + + 3.00% MENSUAL + + + + Y EN CASO DEL COBRO JUDICIAL SE CARGARAN LOS GASTOS QUE ESTOS GENEREN. + + + + + + + true + true + + + + + a + + + + =cdate(Parameters!Fecha.Value) + + + + + + + + + Vencimiento el + + + + =Parameters!Vencimiento.Value + + + + + + + Textbox38 + 8.17569cm + 3.93558cm + 1.07625cm + 5.19875cm + 5 + + + 2pt + 2pt + 2pt + 2pt + + + + 10.25697cm + 3.93558cm + 0cm + 5.19875cm + 6 + + + + + + true + true + + + + + S U S C R I P T O R + + + + + + + Textbox39 + 10.43336cm + 3.93558cm + 0.6cm + 5.19875cm + 7 + + + 2pt + 2pt + 2pt + 2pt + + + + 10.25697cm + 11.9387cm + 0cm + 5.19875cm + 8 + + + + + + true + true + + + + + NOMBRE Y FIRMA DEL AVAL + + + + + + + Textbox39 + 10.43336cm + 11.9387cm + 0.6cm + 5.19875cm + 9 + + + 2pt + 2pt + 2pt + 2pt + + + + + Start + + true + 7.01812in + 0.17767in + 4.422in + 7.87128in + + =iif(Parameters!AplicaPagare.Value="0",True,False) + + + + + + + true + true + + + + + Facturado a: + + + + + + + + + Cliente: + + + + =Parameters!ClienteNombre.Value + + + + + + + + + RFC: + + + + =Parameters!ClienteRFC.Value + + + + + + + + + Calle: + + + + + + + + =Parameters!ClienteCalle.Value & IIF(Parameters!ClienteNoExt.Value <> "", " No.Ext: " & Parameters!ClienteNoExt.Value & iif(Parameters!ClienteNoInt.Value <> ""," No.Int: " & Parameters!ClienteNoInt.Value,""),iif(Parameters!ClienteNoInt.Value <> ""," No.Int: " & Parameters!ClienteNoInt.Value,"")) + + + + + + + + + Colonia: + + + + + + + + =Parameters!ClienteColonia.Value + + + + + + + + + Ciudad: + + + + =Parameters!ClienteCiudad.Value + + + + + + + + Estado: + + + + + + + + =Parameters!ClienteEstado.Value + + + + + + + + + Municipio y/o Delegación: + + + + =Parameters!ClienteMunicipio.Value + + + + + + + + + + + + + Pais: + + + + =Parameters!ClientePais.Value + + + + + + + + CP: + + + + + + + + =Parameters!ClienteCP.Value + + + + + + + + + Pedido/Contrato: + + + + =Parameters!PedidoContrato.Value + + + + + + + + + Orden Compra: + + + + =Parameters!OrdenCompra.Value + + + + + + + Textbox2 + 0.05159in + 4.31439cm + 1.62208in + 3.20861in + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + + + true + true + + + + + "Este documento es una representación impresa de un CFDI" + + + + + + + + + Folio fiscal: + + + + =Parameters!FolioFiscal.Value + + + + + + + =Parameters!FechaCertificacion.Value + + + + Número de serie del Certificado de Sello Digital: + + + + =Parameters!CertificadoContribuyente.Value + + + + + + + =Parameters!SerieCertificadoSAT.Value + + + + + + + + + + + + + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + External + =Parameters!QR.Value + FitProportional + 0.0444in + 6.56374in + 1.13974in + 1.53682in + 1 + + + + + + true + 3.53788in + 0.03589in + 1.21305in + 8.22763in + 2 + + + + + + true + true + + + + + Domicilio fiscal: + + + + + + + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + + + + + TIPO DE DOCUMENTO: + + + + =Parameters!Tipo.Value + + + + + + + + + + + + + Serie: + + + + =Parameters!Serie.Value + + + + Folio: + + + + =Parameters!Folio.Value + + + + + + + + + Fecha: + + + + + + + + = Parameters!Fecha.Value + + + + + + + + + Moneda: + + + + + + + + =Parameters!MonedaAbreviatura.Value + + + + + + + + + + + + + =iif(Parameters!TipoCambio.Value <= 1, "", "Tipo Cambio: " & Parameters!TipoCambio.Value) + + + + + + + + + Forma de pago: + + + + =Parameters!FormaPago.Value + + + + + + + + + Método de pago: + + + + =Parameters!MetodoPago.Value + + + + + + + + + Uso CFDI: + + + + =Parameters!UsoCFDI.Value + + + + + + + + + Régimen fiscal: + + + + Regimen General de Ley Personas Morales + + + + + + + + + + + Textbox4 + 0.05022in + 4.90719in + 1.62345in + 3.35633in + 4 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Expedido en + + + + : + + + + + + + + + =Parameters!DomicilioSucursal.Value + + + + + + + + + BBD021220APA + + + + + + + + + + + + + + + + + + Vendedor: + + + + =Parameters!VendedorNombre.Value + + + + + + + Textbox40 + 4.25cm + 13.26812cm + 1.42163cm + 7.72123cm + 5 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + 0.54927in + + + 0.58129in + + + 0.8527in + + + 3.02234in + + + 0.57354in + + + 0.59047in + + + 0.61967in + + + 0.64182in + + + 0.79194in + + + + + 0.19645in + + + + + true + true + + + + + CANT + + + + + + + Textbox22 + + + #3a4173 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + UNIDAD + + + + + + #3a4173 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + CLAVE SAT + + + + + + + Textbox29 + + + #3a4173 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + DESCRIPCIÓN + + + + + + + Textbox17 + + + #3a4173 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + PU + + + + + + + Textbox3 + + + #3a4173 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + DESC. + + + + + + + Textbox8 + + + #3a4173 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + IVA + + + + + + + Textbox2 + + + #3a4173 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + IEPS + + + + + + + Textbox4 + + + #3a4173 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + TOTAL + + + + + + + Textbox1 + + + #3a4173 + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.14436in + + + + + true + true + + + + + =Fields!Cantidad.Value + + + + + + + Cantidad1 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!UM.Value + + + + + + + UM + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!SATClaveProdServ.Value + + + + + + + SATClaveProdServ + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!PS.Value & " " & Fields!Obs.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!PU.Value + + + + + + + PU + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Descuento.Value + + + + + + + Descuento + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ImporteIVA.Value & iif(Fields!PorcentajeIVA.Value = "0.16", " (16%)"," (0%)") + + + + + + + ImporteIVA + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =iif(Fields!PorcentajeIEPS.Value = "0.03",Fields!ImporteIEPS.Value & " (3%)",iif(Fields!PorcentajeIEPS.Value = "0.06",Fields!ImporteIEPS.Value & " (6%)",iif(Fields!PorcentajeIEPS.Value = "0.07",Fields!ImporteIEPS.Value & " (7%)",iif(Fields!PorcentajeIEPS.Value = "0.09",Fields!ImporteIEPS.Value & " (9%)","")))) + + + + + + + ImporteIEPS + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Cantidad.Value * Fields!PU.Value + + + + + + + TiempoEntrega + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + + + + + After + + + + + + + DsOC + 2.25503in + 0.04048in + 0.34081in + 8.22304in + 6 + + + + + + true + true + + + + + + + + #3a4173 + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + + + + #3a4173 + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =UCase(Parameters!ImporteLetra.Value) + + + + + + + ImporteLetra + 3.05676in + 2.28431in + 0.18861in + 5.97921in + 9 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + + + + #3a4173 + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + + + + #3a4173 + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Observaciones.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + 2.99824cm + + + + + 0.48004cm + + + + + true + true + + + + + =Fields!Importe.Value + + + + + + + Importe + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + =Fields!ImpuestoLocal.Value + + + + 2.93858cm + + + true + true + + + + + =IIF(Fields!ImpuestoLocal.Value = "Total",UCase(Fields!ImpuestoLocal.Value),Fields!ImpuestoLocal.Value) + + + + + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + DataSet1 + 6.99203cm + 15.05252cm + 0.48004cm + 5.93682cm + 13 + + + + + + + + true + true + + + + + CFDI Relacionados + + + + + + + Textbox5 + 0.14926cm + 0.07193cm + 0.54004cm + 20.7077cm + + + #3a4173 + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Tipo Relación: + + + + + + + Textbox29 + 0.83025cm + 4.78817cm + 0.41981cm + 5.31841cm + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!TipoRelacionTexto.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + 2.42456cm + + + 2.05585cm + + + 3.03631cm + + + 7.7847cm + + + + + 0.44125cm + + + + + true + true + + + + + Folio + + + + + + + Textbox10 + + + #3a4173 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Fecha + + + + + + + Textbox12 + + + #3a4173 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Importe + + + + + + + Textbox21 + + + #3a4173 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Folio Fiscal + + + + + + + Textbox11 + + + #3a4173 + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.41479cm + + + + + true + true + + + + + =Fields!SerieFolio.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Fecha.Value + + + + + + + Fecha + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Importe.Value + + + + + + + Importe1 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!FolioFiscal.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + After + + + + + + + DataSet4 + 1.39643cm + 3.28643cm + 0.85604cm + 15.30142cm + 3 + + + + + + true + true + + + + + VERSION 3.3 + + + + + + + Textbox5 + 2.32303cm + 17.39754cm + 0.6cm + 3.32021cm + 4 + + + 2pt + 2pt + 2pt + 2pt + + + + true + 12.89651cm + 0.09116cm + 2.97096cm + 20.89818cm + 14 + + =Microsoft.VisualBasic.Interaction.IIF(First(Fields!SerieFolio.Value, "DataSet4") <> "", False, True) + + + + + + + + + + 0.78719in + + + 0.58129in + + + 0.71694in + + + + + 0.19645in + + + + + true + true + + + + + IMPUESTO + + + + + + + Textbox22 + + + #3a4173 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + TASA + + + + + + + Textbox15 + + + #3a4173 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + IMPORTE + + + + + + + Textbox29 + + + #3a4173 + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.14436in + + + + + true + true + + + + + =Fields!Impuesto.Value + + + + + + + Cantidad1 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!tasa.Value + + + + + + + UM + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Importe.Value + + + + + + + Codigo + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + After + + + + + + + DataSet3 + 2.75704in + 0.04048in + 0.34081in + 2.08542in + 15 + + + + + + true + true + + + + + "REVISAR SU FACTURA Y SUS PRODUCTOS AL MOMENTO DE RECIBIRLAS, YA QUE NO SE REALIZARAN CAMBIOS EN FACTURA NI SE ACEPTARAN DEVOLUCIONES DE MERCANCIA DESPUES DE + + + + + + + + + 72 HORAS + + + + POSTERIORES A LA FECHA DE ELABORACIÓN" + + + + + + + Textbox1 + 8.4794cm + 0.13457cm + 0.34219cm + 20.85477cm + 16 + + + 2pt + 2pt + 2pt + 2pt + + + + Embedded + Logo + FitProportional + 0.13104cm + 0.08425cm + 2.5433cm + 4.13cm + 17 + + + + + + 29.14037cm + + + + + 21.12144cm + + + 0.63499cm + true + true + + + true + true + + + + + Fecha Impresión: + + + + =Parameters!FechaImpresion.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + ="Página " & Globals.PageNumber & " de " & Globals.TotalPages + + + + + + + Textbox35 + 0.11289cm + 18.37079cm + 0.41981cm + 2.5cm + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 27.94cm + 21.59cm + 0cm + 0cm + 0.5cm + 0.5cm + 1.27cm + + + + =Parameters!ClienteNombre.Value + + + + + + + + + RFC: + + + + =Parameters!ClienteRFC.Value + + + + + + + + + Calle: + + + + + + + + =Parameters!ClienteCalle.Value & IIF(Parameters!ClienteNoExt.Value <> "", " No.Ext: " & Parameters!ClienteNoExt.Value & iif(Parameters!ClienteNoInt.Value <> ""," No.Int: " & Parameters!ClienteNoInt.Value,""),iif(Parameters!ClienteNoInt.Value <> ""," No.Int: " & Parameters!ClienteNoInt.Value,"")) + + + + + + + + + Colonia: + + + + + + + + =Parameters!ClienteColonia.Value + + + + + + + + + Ciudad: + + + + =Parameters!ClienteCiudad.Value + + + + + + + + Estado: + + + + + + + + =Parameters!ClienteEstado.Value + + + + + + + + + Municipio y/o Delegación: + + + + =Parameters!ClienteMunicipio.Value + + + + + + + + + + + + + Pais: + + + + =Parameters!ClientePais.Value + + + + + + + + CP: + + + + + + + + =Parameters!ClienteCP.Value + + + + + + + + + Pedido/Contrato: + + + + =Parameters!PedidoContrato.Value + + + + + + + + + Orden Compra: + + + + =Parameters!OrdenCompra.Value + + + + + + + Textbox2 + 1.08277in + 0.15466cm + 1.48139in + 4.29918in + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Domicilio fiscal: + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + + + + + + + + + Remisión + + + + + + + + + + + + + Serie: + + + + =Parameters!Serie.Value + + + + Folio: + + + + =Parameters!Folio.Value + + + + + + + + + Fecha: + + + + + + + + =cdate(Parameters!Fecha.Value) + + + + + + + + + Vendedor: + + + + =Parameters!VendedorNombre.Value + + + + + + + Textbox4 + 0.04117in + 5.62784in + 0.99993in + 2.66068in + 2 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + 0.84089in + + + 0.75902in + + + 1.18379in + + + 0.94204in + + + 4.47563in + + + + + 0.19645in + + + + + true + true + + + + + CANT + + + + + + + Textbox22 + + + #3a4173 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + UNIDAD + + + + + + + Textbox15 + + + #3a4173 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + CODIGO + + + + + + + Textbox29 + + + #3a4173 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + CLAVE SAT + + + + + + + Textbox5 + + + #3a4173 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + DESCRIPCIÓN + + + + + + + Textbox17 + + + #3a4173 + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.17561in + + + + + true + true + + + + + =Fields!Cantidad.Value + + + + + + + Cantidad1 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!UM.Value + + + + + + + UM + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Codigo.Value + + + + + + + Codigo + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!SATClaveProdServ.Value + + + + + + + Textbox6 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!PS.Value & " " & Fields!Obs.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + After + + + + + + + DsOC + 2.74327in + 0.06548in + 0.37206in + 8.20137in + 3 + + + + + + true + true + + + + + + + + #3a4173 + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + + + + #3a4173 + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Observaciones.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + Embedded + Logo + Fit + 0.04117in + 0.06089in + 0.99993in + 1.6045in + 7 + + + + + + true + true + + + + + Expedido en + + + + : + + + + + + + + + =Parameters!DomicilioSucursal.Value + + + + + + + + + BBD021220APA + + + + + + + Textbox4 + 0.10457cm + 9.52183cm + 1.40387cm + 4.08234cm + 8 + + + 2pt + 2pt + 2pt + 2pt + + + + + + 2.51986cm + 1.75262cm + 0cm + 4.9765cm + + + + + + true + true + + + + + Nombre y Firma + + + + Textbox31 + 2.69625cm + 1.33778cm + 0.6cm + 5.7988cm + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Elaborado por: + + + + Textbox31 + 0.68161cm + 1.31521cm + 0.6cm + 5.7988cm + 2 + + + 2pt + 2pt + 2pt + 2pt + + + + 2.51986cm + 13.20338cm + 0cm + 4.9765cm + 3 + + + + + + true + true + + + + + Nombre y Firma + + + + Textbox31 + 2.69625cm + 12.78854cm + 0.6cm + 5.7988cm + 4 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Almacén: + + + + Textbox31 + 0.68161cm + 12.76597cm + 0.6cm + 5.7988cm + 5 + + + 2pt + 2pt + 2pt + 2pt + + + + 6.94912cm + 1.90541cm + 0cm + 4.9765cm + 6 + + + + + + true + true + + + + + Nombre y Firma + + + + Textbox31 + 7.12551cm + 1.49057cm + 0.6cm + 5.7988cm + 7 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Recibió (Chofer): + + + + Textbox31 + 5.11087cm + 1.468cm + 0.6cm + 5.7988cm + 8 + + + 2pt + 2pt + 2pt + 2pt + + + + 6.94912cm + 13.35617cm + 0cm + 4.9765cm + 9 + + + + + + true + true + + + + + Nombre y Firma + + + + Textbox31 + 7.12551cm + 12.94133cm + 0.6cm + 5.7988cm + 10 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Recibió (Cliente): + + + + Textbox31 + 5.11087cm + 12.91876cm + 0.6cm + 5.7988cm + 11 + + + 2pt + 2pt + 2pt + 2pt + + + + true + 9.2202cm + 0.15466cm + 8.67801cm + 20.84313cm + 9 + + + + + + 18.12046cm + + + + =Parameters!FechaImpresion.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + ="Página " & Globals.PageNumber & " de " & Globals.TotalPages + + + + + + + Textbox35 + 0.17639cm + 18.49779cm + 0.41981cm + 2.5cm + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 27.94cm + 21.59cm + 0cm + 0cm + 0.5cm + 0.5cm + 1.27cm + - - - - - - Textbox7 - - - - - 1pt - - - - 1pt - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - CLAVE - - - - - - - Textbox9 - - - - - 1pt - - - - 1pt - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Descripción - - - - - - - Textbox11 - - - - - 1pt - - - - 1pt - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Serie/Lote - - - - - - - Textbox10 - - - - - 1pt - - - - 1pt - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - U.M. - - - - - - - Textbox13 - - - - - 1pt - - - - 1pt - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Precio - - - - - - - Textbox17 - - - - - 1pt - - - - 1pt - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Importe - - - - - - - Textbox19 - - - - - 1pt - - - - 1pt - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.36717cm - - - - - true - true - - - - - =Fields!Cantidad.Value - - - - - - - Cantidad - - - 2pt - 2pt - =IIf(RowNumber(Nothing)=1,"1pt","0pt") - - - - - - - - true - true - - - - - =Fields!Codigo.Value - - - - - - - Codigo - - - 2pt - 2pt - =IIf(RowNumber(Nothing)=1,"1pt","0pt") - - - - - - - - true - true - - - - - =Fields!PS.Value - - - - - - 2pt - 2pt - =IIf(RowNumber(Nothing)=1,"1pt","0pt") - - - - - - - - true - true - - - - - =Fields!SerieLote.Value - - - - - - 2pt - 2pt - =IIf(RowNumber(Nothing)=1,"1pt","0pt") - - - - - - - - true - true - - - - - =Fields!UnidadMedida.Value - - - - - - - UnidadMedida - - - 2pt - 2pt - =IIf(RowNumber(Nothing)=1,"1pt","0pt") - - - - - - - - true - true - - - - - =Fields!PU.Value - - - - - - - PU - - - 2pt - 2pt - =IIf(RowNumber(Nothing)=1,"1pt","0pt") - - - - - - - - true - true - - - - - =Fields!Total.Value - - - - - - - Total - - - 2pt - 2pt - =IIf(RowNumber(Nothing)=1,"1pt","0pt") - - - - - - - - - - - - - - - - - - - - - - - After - - - - - - - DsInventarios - 0.17639cm - 0.12931cm - 0.96717cm - 19.16931cm - - - - - - 1.21412cm - 0.17882cm - 0cm - 19.11979cm - 1 - - - - - - true - true - - - - - ="Son: " & UCase(Parameters!ImporteLetra.Value) - - - - - - - ImporteLetra - 1.30749in - 2.18543in - 0.18861in - 5.38135in - 2 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - 1.56514cm - - - 2.0317cm - - - - - 0.46771cm - - - - - true - true - - - - - Total: - - - - - - - Textbox33 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Sum(Fields!Total.Value) - - - - - - - Textbox38 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - - DsInventarios - 1.31995cm - 15.70179cm - 0.46771cm - 3.59684cm - 3 - - - - - - 1.59819in - - - - - - - Textbox34 - 0.07056cm - 9.3683cm - 0.6cm - 9.85131cm - - - 2pt - 2pt - 2pt - 2pt - - - - Embedded - Logo1 - FitProportional - 0.07152in - 0.85657in - 1.28286in - 1 - - - - - - true - true - - - - - Factura de: - - - - - - - - - - - =Parameters!NombreProveedor.Value - - - - - - - - - - - =Parameters!RFCProveedor.Value - - - - - - - - - - - =Parameters!TelefonoProveedor.Value - - - - - - - - - - - =Parameters!ContactoProveedor.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Folio - - - - : - - - - =Parameters!Folio.Value - - - - - - - - - Almacén: - - - - =Parameters!Almacen.Value - - - - - - - - - Fecha: - - - - =Parameters!Fecha.Value - - - - - - - - - Folio Factura del Proveedor: - - - - =Parameters!FacturaProveedor.Value - - - - - - - Textbox50 - 0.74112cm - 10.83216cm - 1.86797cm - 8.38745cm - 3 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - 4.7625cm - true - true - - - 0.28886cm - 1.26971cm - 0cm - 5.13525cm - - - - - - true - true - - - - - =Parameters!NombreRecibio.Value - - - - Textbox31 - 0.46525cm - 0.85487cm - 0.6cm - 5.95755cm - 1 - - - 2pt - 2pt - 2pt - 2pt - - - - 0.28886cm - 13.28031cm - 0cm - 5.24108cm - 2 - - - - - - true - true - - - - - =Parameters!NombreEntrego.Value - - - - Textbox31 - 0.42997cm - 12.88344cm - 0.6cm - 5.95755cm - 3 - - - 2pt - 2pt - 2pt - 2pt - - - - 2.04584cm - 0.12912cm - 0cm - 19.1695cm - 4 - - - - - - true - true - - - - - OBSERVACIONES: - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!Observaciones.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - 2.85017cm - 0.05012cm - 0cm - 19.16949cm - 7 - - - - - - true - true - - - - - Usuario: - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!UsuarioImprimio.Value - - - - - - - Textbox18 - 2.956cm - 1.49125cm - 0.44125cm - 5.21516cm - 9 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Fecha Impresión: - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Globals!ExecutionTime - - - - - - - Textbox18 - 2.956cm - 10.44391cm - 0.44125cm - 3.44953cm - 11 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - ="Página " & Globals.PageNumber & " de " & Globals.TotalPages - - - - - - - Textbox3 - 2.956cm - 15.59511cm - 0.38981cm - 3.61081cm - 12 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - IMPRESO EN SIG, Entradas / Salidas - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - 27.94cm - 21.59cm - 1cm - 1cm - 1cm - 0cm - 0.13cm - + + + + + + Textbox7 + + + + + 1pt + + + + 1pt + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + CLAVE + + + + + + + Textbox9 + + + + + 1pt + + + + 1pt + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Descripción + + + + + + + Textbox11 + + + + + 1pt + + + + 1pt + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Serie/Lote + + + + + + + Textbox10 + + + + + 1pt + + + + 1pt + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + U.M. + + + + + + + Textbox13 + + + + + 1pt + + + + 1pt + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Precio + + + + + + + Textbox17 + + + + + 1pt + + + + 1pt + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Importe + + + + + + + Textbox19 + + + + + 1pt + + + + 1pt + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.36717cm + + + + + true + true + + + + + =Fields!Cantidad.Value + + + + + + + Cantidad + + + 2pt + 2pt + =IIf(RowNumber(Nothing)=1,"1pt","0pt") + + + + + + + + true + true + + + + + =Fields!Codigo.Value + + + + + + + Codigo + + + 2pt + 2pt + =IIf(RowNumber(Nothing)=1,"1pt","0pt") + + + + + + + + true + true + + + + + =Fields!PS.Value + + + + + + 2pt + 2pt + =IIf(RowNumber(Nothing)=1,"1pt","0pt") + + + + + + + + true + true + + + + + =Fields!SerieLote.Value + + + + + + 2pt + 2pt + =IIf(RowNumber(Nothing)=1,"1pt","0pt") + + + + + + + + true + true + + + + + =Fields!UnidadMedida.Value + + + + + + + UnidadMedida + + + 2pt + 2pt + =IIf(RowNumber(Nothing)=1,"1pt","0pt") + + + + + + + + true + true + + + + + =Fields!PU.Value + + + + + + + PU + + + 2pt + 2pt + =IIf(RowNumber(Nothing)=1,"1pt","0pt") + + + + + + + + true + true + + + + + =Fields!Total.Value + + + + + + + Total + + + 2pt + 2pt + =IIf(RowNumber(Nothing)=1,"1pt","0pt") + + + + + + + + + + + + + + + + + + + + + + + After + + + + + + + DsInventarios + 0.17639cm + 0.12931cm + 0.96717cm + 19.16931cm + + + + + + 1.21412cm + 0.17882cm + 0cm + 19.11979cm + 1 + + + + + + true + true + + + + + ="Son: " & UCase(Parameters!ImporteLetra.Value) + + + + + + + ImporteLetra + 0.73158in + 1.49813in + 0.18861in + 6.09975in + 2 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + 1.56514cm + + + 2.0317cm + + + + + 0.46771cm + + + + + true + true + + + + + Total: + + + + + + + Textbox33 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Sum(Fields!Total.Value) + + + + + + + Textbox38 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + DsInventarios + 1.31995cm + 15.70179cm + 0.46771cm + 3.59684cm + 3 + + + + + + 1.75444in + + + + + + + Textbox34 + 0.07056cm + 9.3683cm + 0.6cm + 9.85131cm + + + 2pt + 2pt + 2pt + 2pt + + + + Embedded + Logo1 + FitProportional + 0.07152in + 0.85657in + 1.28286in + 1 + + + + + + true + true + + + + + Factura de: + + + + + + + + + + + =Parameters!NombreProveedor.Value + + + + + + + + + + + =Parameters!RFCProveedor.Value + + + + + + + + + + + =Parameters!TelefonoProveedor.Value + + + + + + + + + + + =Parameters!ContactoProveedor.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Folio + + + + : + + + + =Parameters!Folio.Value + + + + + + + + + Almacén: + + + + =Parameters!Almacen.Value + + + + + + + + + Fecha: + + + + =Parameters!Fecha.Value + + + + + + + + + Folio Factura del Proveedor: + + + + =Parameters!FacturaProveedor.Value + + + + + + + Textbox50 + 0.74112cm + 10.83216cm + 1.86797cm + 8.38745cm + 3 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + 3.15049cm + true + true + + + 0.92688cm + 0.05012cm + 0cm + 19.16949cm + + + + + + true + true + + + + + Usuario: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!UsuarioImprimio.Value + + + + + + + Textbox18 + 1.03271cm + 1.49125cm + 0.44125cm + 5.21516cm + 2 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Fecha Impresión: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Globals!ExecutionTime + + + + + + + Textbox18 + 1.03271cm + 10.44391cm + 0.44125cm + 3.44953cm + 4 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + ="Página " & Globals.PageNumber & " de " & Globals.TotalPages + + + + + + + Textbox3 + 1.03271cm + 15.59511cm + 0.38981cm + 3.61081cm + 5 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + IMPRESO EN SIG, Entradas / Salidas + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + 0.19459cm + 1.19476cm + 0cm + 5.13525cm + + + + + + true + true + + + + + =Parameters!NombreRecibio.Value + + + + Textbox31 + 0.37098cm + 0.77992cm + 0.09729cm + 5.95755cm + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + 0.19459cm + 13.20536cm + 0cm + 5.24108cm + 2 + + + + + + true + true + + + + + =Parameters!NombreEntrego.Value + + + + Textbox31 + 0.3357cm + 12.80849cm + 0.13257cm + 5.95755cm + 3 + + + 2pt + 2pt + 2pt + 2pt + + + + 0.75931cm + 0.05417cm + 0cm + 19.1695cm + 4 + + + + + + true + true + + + + + OBSERVACIONES: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Observaciones.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + 0cm + 0.05922cm + 0.90952cm + 19.22367cm + 7 + + =IIf( Globals.PageNumber = Globals.TotalPages, False, True) + + + + + + + + + + + 27.94cm + 21.59cm + 1cm + 1cm + 1cm + 0cm + 0.13cm + + + + + + + Textbox165 + 3.63358cm + 0.11767cm + 0.47364cm + 18.64497cm + + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + Silver + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + FECHA + + + + + + + Textbox165 + 0.5338cm + 8.89208cm + 0.47364cm + 4.43083cm + 1 + + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + Silver + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + DESCRIPCIÓN DEL SERVICIO EN PROCESO + + + + + + + Textbox165 + 6.93966cm + 0.12111cm + 0.48cm + 18.65153cm + 2 + + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + Silver + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + VIGENCIA + + + + + + + Textbox165 + 2.08369cm + 8.89208cm + 0.47364cm + 4.43083cm + 3 + + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + Silver + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + FOLIO + + + + + + + Textbox165 + 0.5338cm + 13.4993cm + 0.47364cm + 5.24334cm + 4 + + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + Silver + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!FolioOS.Value + + + + + + + Textbox165 + 1.00743cm + 13.4993cm + 0.97042cm + 5.26334cm + 5 + + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + White + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!CodigoDeServicio.Value + + + + + + + Textbox165 + 2.62788cm + 13.4993cm + 0.89986cm + 5.26334cm + 6 + + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + White + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + CÓDIGO DE SERVICIO + + + + + + + Textbox165 + 2.15424cm + 13.4993cm + 0.47364cm + 5.25334cm + 7 + + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + Silver + 2pt + 2pt + 2pt + 2pt + + + + Embedded + Logo1 + FitProportional + 0.1546in + 0.09795in + 1.2065in + 1.21875in + 8 + + + + + + true + true + + + + + SOLICITUD DE + + + + + + + + + SERVICIO + + + + + + + Textbox165 + 1.00743cm + 3.3444cm + 2.52032cm + 5.37129cm + 9 + + + + White + + 1pt + + + White + + 1pt + + + White + + 1pt + + + White + + 1pt + + White + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + RECEPCIÓN DE + + + + + + + Textbox165 + 10.0666cm + 0.13112cm + 0.44775cm + 18.65497cm + 10 + + + + White + + 1pt + + + White + + 1pt + + + White + + 1pt + + + White + + 1pt + + #eceaed + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Descripcion.Value + + + + + + + Textbox165 + 13.97806cm + 0.13112cm + 0.99688cm + 18.64497cm + 11 + + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + White + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + FALLA REPORTADA + + + + + + + Textbox165 + 13.39858cm + 0.13112cm + 0.47364cm + 18.64497cm + 12 + + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + Silver + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + NOMBRE Y FIRMA DEL TÉCNICO + + + + + + + + + ASIGNADO AL SERVICIO + + + + + + + Textbox165 + 16.28274cm + 0.13112cm + 0.89754cm + 6.17587cm + 13 + + + + Black + + 1pt + + + White + + 1pt + + + White + + 1pt + + + White + + 1pt + + White + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + NOMBRE Y FIRMA DE ENTERADO DEL + + + + + + + + + COORDINADOR EMPRESARIAL + + + + + + + Textbox165 + 16.28274cm + 6.48338cm + 0.89754cm + 6.17587cm + 14 + + + + Black + + 1pt + + + White + + 1pt + + + White + + 1pt + + + White + + 1pt + + White + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + NOMBRE Y FIRMA DEL CLIENTE + + + + + + + Textbox165 + 16.28274cm + 12.96369cm + 0.89754cm + 5.54792cm + 15 + + + + Black + + 1pt + + + White + + 1pt + + + White + + 1pt + + + White + + 1pt + + White + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + POLÍTICAS + + + + + + + Textbox165 + 17.68299cm + 0.13112cm + 0.47421cm + 18.64497cm + 16 + + + + White + + 1pt + + + White + + 1pt + + + White + + 1pt + + + White + + 1pt + + White + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + 1. Toda solicitud será descrita de forma clara para ofrecerle un mejor servicio. +2. La recepción y atención de las solicitudes de servicio se efectuará conforme se vayan recibiendo de acuerdo al número de su reporte. +3. El tiempo estimado para realizar el diagnóstico de su equipo será de 48 horas, posteriores a la recepción de su solicitud. El diagnostico +tiene un costo de $200 pesos, el cual deberá cubrirlo al momento de ingresar su equipo. Sin factura y pago de diagnóstico este reporte no +será procesado. +4. El tiempo de reparación del equipo estará sujeto a la autorización del Cliente y de acuerdo a la disponibilidad de componentes en +Compuproveedores, fabricantes y/o proveedores. +5. El Cliente recibirá una liga al correo electrónico que indicó al momento de ingresar su equipo, en donde podrá consultar el seguimiento a +su servicio. +6. Una vez que reciba la notificación por correo electrónico, de que su equipo ha sido reparado podrá pasar a nuestras oficinas en un horario +de lunes a viernes de 8:00 a.m. a 12:00 a.m. y de 2:00 p.m. a 4:00 p.m. +7. Una vez realizada la reparación de su equipo, podrá permanecer por 10 días hábiles en Compuproveedores/HP store, posteriormente del +día 11 al 20 hábil se cobrara un 3% diario del monto total de la reparación por concepto de almacenaje. Después de este periodo +Compuproveeores no se hace responsable por el resguardo de su equipo. + + + + + + + Textbox165 + 18.58053cm + 0.13112cm + 7.1417cm + 17.72549cm + 17 + + + + White + + 1pt + + + White + + 1pt + + + White + + 1pt + + + White + + 1pt + + White + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Copia.Value + + + + Copia + 25.72223cm + 0.13112cm + 0.6cm + 18.38049cm + 18 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + 9.31248cm + + + 9.31248cm + + + + + 0.54708cm + + + + + true + true + + + + + CLIENTE + + + + : + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + NO. DE CLIENTE: + + + + + + + + =Parameters!NoDeCliente.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.54709cm + + + + + true + true + + + + + DIRECCIÓN: + + + + + + + + =Parameters!ClienteCalle.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + RFC: + + + + + + + + =Parameters!RFC.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.57354cm + + + + + true + true + + + + + POBLACIÓN: + + + + + + + + =Parameters!ClienteCiudad.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + VENDEDOR: + + + + + + + + =Parameters!Vendedor.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + CONTACTAR A: + + + + + + + + =Parameters!Cliente.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + CORREO: + + + + + + + + =Parameters!Correo.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + After + + + + + + Before + + + Before + + + + DataSet1 + 4.10722cm + 0.11767cm + 2.26771cm + 18.62496cm + 19 + + + 7pt + + + + true + true + + + + + TELÉFONO: + + + + =Parameters!ClienteTelefono.Value + + + + EXT.: TELÉFONO ADICIONAL: + + + + =Parameters!ClienteTelefono.Value + + + + CELULAR: + + + + =Parameters!ClienteTelefono.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + 1.47694cm + + + 1.47694cm + + + 1.47694cm + + + + + 0.97042cm + + + + + true + true + + + + + Día + + + + + + + + + =Day(Parameters!FechaRecibido.Value) + + + + + + + Textbox42 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Mes + + + + + + + + + =Month(Parameters!FechaRecibido.Value) + + + + + + + Textbox44 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Año + + + + + + + + + =Year(Parameters!FechaRecibido.Value) + + + + + + + Textbox46 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + DataSet1 + 1.00743cm + 8.89208cm + 0.97042cm + 4.43082cm + 21 + + + + + + + + + 1.47694cm + + + 1.47694cm + + + 1.47694cm + + + + + 0.97042cm + + + + + true + true + + + + + Día + + + + + + + + + =Microsoft.VisualBasic.DateAndTime.Day(Parameters!FechaRecibido.Value) + + + + + + + Textbox42 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Mes + + + + + + + + + =Microsoft.VisualBasic.DateAndTime.Month(Parameters!FechaRecibido.Value) + + + + + + + Textbox44 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Año + + + + + + + + + =Microsoft.VisualBasic.DateAndTime.Year(Parameters!FechaRecibido.Value) + + + + + + + Textbox46 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + DataSet1 + 2.55733cm + 8.89208cm + 0.97042cm + 4.43082cm + 22 + + + + + + + + + 9.32749cm + + + 9.32749cm + + + + + 0.57354cm + + + + + true + true + + + + + SUCURSARL: + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + LUGAR DE SERVICIO: + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.52062cm + + + + + true + true + + + + + TIPO DE SERVICIO: + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + TIPO DE EQUIPO: + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + DataSet1 + 7.41966cm + 0.12111cm + 1.09416cm + 18.65498cm + 23 + + + 9pt + + + + true + true + + + + + ( ) Bandeja + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1.64066cm + + + 1.82591cm + + + 8.24827cm + + + 6.93013cm + + + + + 0.6cm + + + + + true + true + + + + + Cantidad + + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + UM + + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Descripcion + + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Observaciones + + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + =Fields!Cantidad.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!UM.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!PS.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Observaciones.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + After + + + + + + + DataSet1 + 8.69021cm + 0.13112cm + 1.2cm + 18.64497cm + 25 + + + 7pt + + + + 10.79142in + - - - - - #0e2455 - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - CLAVE - - - - - - - Textbox29 - - - #0e2455 - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - DESCRIPCIÓN - - - - - - - Textbox17 - - - #0e2455 - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - OBSERVACIÓN - - - - - - - Textbox46 - - - #0e2455 - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - P/U - - - - - - - Textbox23 - - - #0e2455 - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - IMPORTE - - - - - - - Textbox1 - - - #0e2455 - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.19644in - - - - - true - true - - - - - =Fields!Cantidad.Value - - - - - - - Cantidad1 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!CodPS.Value - - - - - - - CodPS - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Producto.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Obs.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Importe.Value - - - - - - - Importe - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Total.Value - - - - - - - Total - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - - - - After - - - - - - - DsOC - 0.04788in - 0.41372in - 8.15117in - - - - - - 0.44497in - - - - : - - - - - - - - - Nombre - - - - : - - - - - - - - =Parameters!ProveedorNombre.Value - - - - - - - - - RFC: - - - - - - - - =Parameters!ProveedorRFC.Value - - - - - - - - - Direccion: - - - - =Parameters!ProveedorDireccion.Value - - - - - - - - - Teléfono: - - - - =Parameters!ProveedorTel.Value - - - - - - - - - Contacto: - - - - =Parameters!ProveedorContacto.Value - - - - - - - - - - - Textbox2 - 1.60003in - 0.12161cm - 1.20291in - 3.01189in - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Enviar a: - - - - - - - - - Nombre: - - - - =Parameters!EnvioContacto.Value - - - - - - - - - - - - - Departamento: - - - - =Parameters!EnvioDepartamento.Value - - - - - - - - - Calle: - - - - - - - - =Parameters!EnvioDireccion.Value - - - - - - - - - Colonia: - - - - - - - - =Parameters!EnvioColonia.Value - - - - - - - - - Ciudad: - - - - - - - - =Parameters!EnvioCiudad.Value - - - - - - - - Estado: - - - - - - - - =Parameters!EnvioEstado.Value - - - - - - - - - Municipio y/o Delegación: - - - - =Parameters!EnvioCiudad.Value - - - - - - - - - - - - - Pais: - - - - - - - - =Parameters!ProveedorPais.Value - - - - - - - - - - - - - - - - CP: - - - - - - - - =Parameters!EnvioCP.Value - - - - - - - - - Teléfono: - - - - - - - - =Parameters!EnvioTel.Value - - - - - - - - - - - - - Pedido/Contrato: - - - - =Parameters!PedidoContrato.Value - - - - - - - Textbox36 - 4.06406cm - 7.84944cm - 4.25633cm - 8.32364cm - 1 - - =IIF(String.IsNullOrEmpty(Parameters!LugarEntrega.Value),False,True) - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Facturar a: - - - - - - - - - DN DIFUSA NORTE, S.A. de C.V. - - - - - - - - - =Parameters!DomicilioSucursal.Value - - - - - - - - - DDN091028GL0 - - - - - - - - - = Parameters!Telefono.Value.ToString() - - - - - - - - - - - - - - - - - - CFDI 3.3: - - - - - - - - - =Parameters!UsoCFDI.Value - - - - - - - Textbox40 - 4.06406cm - 16.26833cm - 4.25633cm - 4.55726cm - 2 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - ="Envío Directo al Cliente" - - - - - - - EstatusEntrega - 1.27043cm - 4.61876cm - 0.6cm - 5.51419cm - 3 - - =IIF(Parameters!EntregaDirecta.Value <> "False",FALSE,TRUE) - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - - - - - - - - - =Parameters!TipoOC.Value - - - - - - - - - Folio: - - - - =Parameters!Folio.Value - - - - - - - - - Almacen: - - - - =Parameters!Proyecto.Value - - - - - - - - - Fecha de ElaboracIón: - - - - =Parameters!FechaSolicitud.Value - - - - - - - - - Fecha Estimada de Recepción: - - - - =iif(Parameters!FechaEntrega.Value="01/01/0001","",Parameters!FechaEntrega.Value) - - - - - - - - - - - - - Folio Pedido Proveedor: - - - - =Parameters!FolioAdicional.Value - - - - - - - - - Comprador: - - - - =Parameters!Comprador.Value - - - - - - - - - Coordinador Empresarial: - - - - - - - - =Parameters!Vendedor.Value - - - - - - - Textbox40 - 0.16794cm - 12.50129cm - 3.79029cm - 8.3243cm - 4 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Enviar a: - - - - - - - - - Dirección: - - - - =Parameters!LugarEntrega.Value - - - - - - - - - - - - - - - - - - - - Textbox36 - 4.07112cm - 7.85296cm - 4.25633cm - 8.32364cm - 6 - - =IIF(String.IsNullOrEmpty(Parameters!LugarEntrega.Value),True,False) - - - - 2pt - 2pt - 2pt - 2pt - - - - Embedded - Logo6 - FitProportional - 0.33585cm - 0.37861cm - 1.53458cm - 3.85445cm - 7 - - - - - - - - - - - 6.50904cm - true - true - - - true - true - - - - - I.V.A. - - - - - - - Textbox20 - 0.91629cm - 15.88909cm - 0.45183cm - 2.5cm - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - TOTAL: - - - - - - - Textbox20 - 3.0156cm - 15.89438cm - 0.45183cm - 2.5cm - 1 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!IVA.Value - - - - - - - Textbox20 - 0.91629cm - 18.38909cm - 0.45183cm - 2.4365cm - 2 - - - 2pt - 2pt - 2pt - 2pt - es-MX - - - - true - true - - - - - =Parameters!Total.Value - - - - - - - Textbox20 - 3.0156cm - 18.39438cm - 0.45183cm - 2.43121cm - 3 - - - 2pt - 2pt - 2pt - 2pt - es-MX - - - - true - true - - - - - SUB-TOTAL - - - - - - - Textbox20 - 0.39363cm - 15.88909cm - 0.45183cm - 2.5cm - 4 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!SubTotal.Value - - - - - - - Textbox20 - 0.39363cm - 18.38909cm - 0.45183cm - 2.4365cm - 5 - - - 2pt - 2pt - 2pt - 2pt - es-MX - - - - true - true - - - - - =UCase(Parameters!ImporteLetra.Value) - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - - - - #0e2455 - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - - - - - - - #0e2455 - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - - - - - - - #0e2455 - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Usuario: - - - - =Parameters!UsuarioImprimio.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Fecha Impresión: - - - - =Parameters!FechaImpresion.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - ="Página " & Globals.PageNumber & " de " & Globals.TotalPages - - - - - - - Textbox35 - 5.01502cm - 18.19908cm - 0.41981cm - 2.5cm - 12 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!Descripcion.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Ret I.V.A - - - - - - - Textbox20 - 1.36812cm - 15.8883cm - 0.45183cm - 2.5cm - 14 - - =IIF(Parameters!RetIVA.Value > 0,FALSE,TRUE) - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!RetIVA.Value - - - - - - - Textbox20 - 1.36812cm - 18.3883cm - 0.45183cm - 2.4365cm - 15 - - =IIF(Parameters!RetIVA.Value > 0,FALSE,TRUE) - - - - 2pt - 2pt - 2pt - 2pt - es-MX - - - - true - true - - - - - Ret I.S.R - - - - - - - Textbox20 - 1.81995cm - 15.8883cm - 0.45183cm - 2.5cm - 16 - - =IIF(Parameters!RetISR.Value > 0,FALSE,TRUE) - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!RetISR.Value - - - - - - - Textbox20 - 1.81995cm - 18.3883cm - 0.45183cm - 2.4365cm - 17 - - =IIF(Parameters!RetISR.Value > 0,FALSE,TRUE) - - - - 2pt - 2pt - 2pt - 2pt - es-MX - - - - true - true - - - - - I.E.P.S - - - - - - - Textbox20 - 2.27178cm - 15.8883cm - 0.45183cm - 2.5cm - 18 - - =IIF(Sum(Fields!IEPS.Value, "DsOC") > 0,FALSE,TRUE) - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Sum(Fields!IEPS.Value, "DsOC") - - - - - - - Textbox20 - 2.27178cm - 18.3883cm - 0.45183cm - 2.4365cm - 19 - - =IIF(Sum(Fields!IEPS.Value, "DsOC") > 0,FALSE,TRUE) - - - - 2pt - 2pt - 2pt - 2pt - es-MX - - - - - - - - 27.94cm - 21.59cm - 0cm - 0cm - 0cm - 0.5cm - 0.13cm - + + + + + #0e2455 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + CLAVE + + + + + + + Textbox29 + + + #0e2455 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + DESCRIPCIÓN + + + + + + + Textbox17 + + + #0e2455 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + OBSERVACIÓN + + + + + + + Textbox46 + + + #0e2455 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + P/U + + + + + + + Textbox23 + + + #0e2455 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + IMPORTE + + + + + + + Textbox1 + + + #0e2455 + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.19644in + + + + + true + true + + + + + =Fields!Cantidad.Value + + + + + + + Cantidad1 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!CodPS.Value + + + + + + + CodPS + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Producto.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Obs.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Importe.Value + + + + + + + Importe + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Total.Value + + + + + + + Total + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + + After + + + + + + + DsOC + 0.04788in + 0.41372in + 8.15117in + + + + + + 0.44497in + + + + : + + + + + + + + + Nombre + + + + : + + + + + + + + =Parameters!ProveedorNombre.Value + + + + + + + + + RFC: + + + + + + + + =Parameters!ProveedorRFC.Value + + + + + + + + + Direccion: + + + + =Parameters!ProveedorDireccion.Value + + + + + + + + + Teléfono: + + + + =Parameters!ProveedorTel.Value + + + + + + + + + Contacto: + + + + =Parameters!ProveedorContacto.Value + + + + + + + + + + + Textbox2 + 1.60003in + 0.12161cm + 1.20291in + 3.01189in + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Enviar a: + + + + + + + + + Nombre: + + + + =Parameters!EnvioContacto.Value + + + + + + + + + + + + + Departamento: + + + + =Parameters!EnvioDepartamento.Value + + + + + + + + + Calle: + + + + + + + + =Parameters!EnvioDireccion.Value + + + + + + + + + Colonia: + + + + + + + + =Parameters!EnvioColonia.Value + + + + + + + + + Ciudad: + + + + + + + + =Parameters!EnvioCiudad.Value + + + + + + + + Estado: + + + + + + + + =Parameters!EnvioEstado.Value + + + + + + + + + Municipio y/o Delegación: + + + + =Parameters!EnvioCiudad.Value + + + + + + + + + + + + + Pais: + + + + + + + + =Parameters!ProveedorPais.Value + + + + + + + + + + + + + + + + CP: + + + + + + + + =Parameters!EnvioCP.Value + + + + + + + + + Teléfono: + + + + + + + + =Parameters!EnvioTel.Value + + + + + + + + + + + + + Pedido/Contrato: + + + + =Parameters!PedidoContrato.Value + + + + + + + Textbox36 + 4.06406cm + 7.84944cm + 4.25633cm + 8.32364cm + 1 + + =IIF(String.IsNullOrEmpty(Parameters!LugarEntrega.Value),False,True) + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Facturar a: + + + + + + + + + DN DIFUSA NORTE, S.A. de C.V. + + + + + + + + + =Parameters!DomicilioSucursal.Value + + + + + + + + + DDN091028GL0 + + + + + + + + + = Parameters!Telefono.Value.ToString() + + + + + + + + + + + + + + + + + + CFDI 3.3: + + + + + + + + + =Parameters!UsoCFDI.Value + + + + + + + Textbox40 + 4.06406cm + 16.26833cm + 4.25633cm + 4.55726cm + 2 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + ="Envío Directo al Cliente" + + + + + + + EstatusEntrega + 1.27043cm + 4.61876cm + 0.6cm + 5.51419cm + 3 + + =IIF(Parameters!EntregaDirecta.Value <> "False",FALSE,TRUE) + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + + + + + + + + + =Parameters!TipoOC.Value + + + + + + + + + Folio: + + + + =Parameters!Folio.Value + + + + + + + + + Almacen: + + + + =Parameters!Proyecto.Value + + + + + + + + + Fecha de ElaboracIón: + + + + =Parameters!FechaSolicitud.Value + + + + + + + + + Fecha Estimada de Recepción: + + + + =iif(Parameters!FechaEntrega.Value="01/01/0001","",Parameters!FechaEntrega.Value) + + + + + + + + + + + + + Folio Pedido Proveedor: + + + + =Parameters!FolioAdicional.Value + + + + + + + + + Comprador: + + + + =Parameters!Comprador.Value + + + + + + + + + Coordinador Empresarial: + + + + + + + + =Parameters!Vendedor.Value + + + + + + + Textbox40 + 0.16794cm + 12.50129cm + 3.79029cm + 8.3243cm + 4 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Enviar a: + + + + + + + + + Dirección: + + + + =Parameters!LugarEntrega.Value + + + + + + + + + + + + + + + + + + + + Textbox36 + 4.07112cm + 7.85296cm + 4.25633cm + 8.32364cm + 6 + + =IIF(String.IsNullOrEmpty(Parameters!LugarEntrega.Value),True,False) + + + + 2pt + 2pt + 2pt + 2pt + + + + Embedded + Logo6 + FitProportional + 0.33585cm + 0.37861cm + 1.53458cm + 3.85445cm + 7 + + + + + + + + + + + 5.95342cm + true + true + + + true + true + + + + + TOTAL: + + + + + + + Textbox20 + 3.17435cm + 15.89438cm + 0.45183cm + 2.5cm + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Total.Value + + + + + + + Textbox20 + 3.2061cm + 18.39438cm + 0.45183cm + 2.43121cm + 1 + + + 2pt + 2pt + 2pt + 2pt + es-MX + + + + true + true + + + + + =UCase(Parameters!ImporteLetra.Value) + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + + + + #0e2455 + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + + + + + + + #0e2455 + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + + + + + + + #0e2455 + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Usuario: + + + + =Parameters!UsuarioImprimio.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Fecha Impresión: + + + + =Parameters!FechaImpresion.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + ="Página " & Globals.PageNumber & " de " & Globals.TotalPages + + + + + + + Textbox35 + 5.33252cm + 18.19908cm + 0.41981cm + 2.5cm + 8 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Descripcion.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + I.V.A. + + + + + + + Textbox20 + 1.22239cm + 15.89517cm + 0.45183cm + 2.5cm + 10 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!IVA.Value + + + + + + + Textbox20 + 1.22239cm + 18.39517cm + 0.45183cm + 2.4365cm + 11 + + + 2pt + 2pt + 2pt + 2pt + es-MX + + + + true + true + + + + + SUB-TOTAL + + + + + + + Textbox20 + 0.41398cm + 15.89517cm + 0.45183cm + 2.5cm + 12 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!SubTotal.Value + + + + + + + Textbox20 + 0.41398cm + 18.39517cm + 0.45183cm + 2.4365cm + 13 + + + 2pt + 2pt + 2pt + 2pt + es-MX + + + + true + true + + + + + Ret I.V.A + + + + + + + Textbox20 + 1.67422cm + 15.89438cm + 0.45183cm + 2.5cm + 14 + + =IIF(Parameters!RetIVA.Value > 0,FALSE,TRUE) + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!RetIVA.Value + + + + + + + Textbox20 + 1.67422cm + 18.39438cm + 0.45183cm + 2.4365cm + 15 + + =IIF(Parameters!RetIVA.Value > 0,FALSE,TRUE) + + + + 2pt + 2pt + 2pt + 2pt + es-MX + + + + true + true + + + + + Ret I.S.R + + + + + + + Textbox20 + 2.12605cm + 15.89438cm + 0.45183cm + 2.5cm + 16 + + =IIF(Parameters!RetISR.Value > 0,FALSE,TRUE) + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!RetISR.Value + + + + + + + Textbox20 + 2.12605cm + 18.39438cm + 0.45183cm + 2.4365cm + 17 + + =IIF(Parameters!RetISR.Value > 0,FALSE,TRUE) + + + + 2pt + 2pt + 2pt + 2pt + es-MX + + + + true + true + + + + + I.E.P.S + + + + + + + Textbox20 + 2.57788cm + 15.89438cm + 0.45183cm + 2.5cm + 18 + + =IIF(Sum(Fields!IEPS.Value, "DsOC") > 0,FALSE,TRUE) + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Sum(Fields!IEPS.Value, "DsOC") + + + + + + + Textbox20 + 2.57788cm + 18.39438cm + 0.45183cm + 2.4365cm + 19 + + =IIF(Sum(Fields!IEPS.Value, "DsOC") > 0,FALSE,TRUE) + + + + 2pt + 2pt + 2pt + 2pt + es-MX + + + + true + true + + + + + DESCUENTO + + + + + + + Textbox20 + 0.83759cm + 15.90124cm + 0.45183cm + 2.5cm + 20 + + =IIF(Parameters!Descuento.Value > 0,FALSE,TRUE) + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Descuento.Value + + + + + + + Textbox20 + 0.83759cm + 18.40124cm + 0.45183cm + 2.4365cm + 21 + + =IIF(Parameters!Descuento.Value > 0,FALSE,TRUE) + + + + 2pt + 2pt + 2pt + 2pt + es-MX + + + + + + + + 27.94cm + 21.59cm + 0cm + 0cm + 0cm + 0.5cm + 0.13cm + - - - - - - Textbox3 - - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - Silver - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - U. M. - - - - - - - Textbox7 - - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - Silver - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Producto o Servicio - - - - - - - Textbox9 - - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - Silver - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Observaciones - - - - - - - Textbox68 - - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - Silver - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Sub Proyecto - - - - - - - Textbox71 - - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - Silver - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Activo Fijo - - - - - - - Textbox11 - - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - Silver - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - P. Unitario - - - - - - - Textbox13 - - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - Silver - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Importe - - - - - - - Textbox5 - - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - Silver - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.473cm - - - - - true - true - - - - - =Fields!Cantidad.Value - - - - - - - Cantidad - - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - 2pt - 2pt - 1pt - - - - - - - - true - true - - - - - =Fields!UM.Value - - - - - - - UM - - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - 2pt - 2pt - 1pt - - - - - - - - true - true - - - - - =Fields!PS.Value - - - - - - - PS - - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - 2pt - 2pt - 1pt - - - - - - - - true - true - - - - - =Fields!Observacion.Value - - - - - - - Observacion - - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - 2pt - 2pt - 1pt - - - - - - - - true - true - - - - - =Fields!SubProyecto.Value - - - - - - - SubProyecto - - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - 2pt - 2pt - 1pt - - - - - - - - true - true - - - - - =Fields!Codigo.Value - - - - - - - Codigo - - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - 2pt - 2pt - 1pt - - - - - - - - true - true - - - - - =Fields!Importe.Value - - - - - - - Importe - - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - 2pt - 2pt - 1pt - - - - - - - - true - true - - - - - =Fields!Total.Value - - - - - - - Total - - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - 2pt - 2pt - 1pt - - - - - - - - - - - - - - - - - - - - - - - - After - - - - - - - DsOC - 4.45714cm - 0.20457cm - 0.96717cm - 20.25838cm - - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - - - true - true - - - - - IVA - - - - - - - Textbox20 - 5.84792cm - 16.1331cm - 0.45183cm - 2.06968cm - 1 - - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - ="Total " & Parameters!Moneda.Value - - - - - - - Textbox20 - 6.29975cm - 16.1331cm - 0.45183cm - 2.06968cm - 2 - - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - SubTotal - - - - - - - Textbox20 - 5.42431cm - 16.1331cm - 0.42361cm - 2.06968cm - 3 - - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!IVA.Value - - - - - - - Textbox20 - 5.84792cm - 18.20277cm - 0.45183cm - 2.26019cm - 4 - - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!Total.Value - - - - - - - Textbox20 - 6.29975cm - 18.20276cm - 0.45183cm - 2.26019cm - 5 - - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!SubTotal.Value - - - - - - - Textbox20 - 5.42431cm - 18.20276cm - 0.42361cm - 2.26019cm - 6 - - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - 2pt - 2pt - 2pt - 2pt - - - - true - - - - - =Parameters!ImporteLetra.Value - - - - - - - Textbox46 - 6.29975cm - 0.20457cm - 0.45183cm - 15.92855cm - 7 - - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - ORDEN DE COMPRA DE MATERIALES Y SERVICIOS - - - - - - - Textbox8 - 1.24262cm - 2.95843cm - 0.5365cm - 12.7315cm - 8 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!TipoOC.Value - - - - - - - Textbox12 - 16.1331cm - 0.44478cm - 4.32987cm - 9 - - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - #3598dc - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!Folio.Value - - - - - - - Textbox12 - 0.44478cm - 16.1331cm - 0.44478cm - 4.32987cm - 10 - - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Fecha Impresion - - - - - - - Textbox12 - 0.88956cm - 16.13311cm - 0.44478cm - 4.32987cm - 11 - - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - #3598dc - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Format(Globals!ExecutionTime,"dd/MM/yyyy") - - - - - - - Textbox12 - 1.33434cm - 16.1331cm - 0.44478cm - 4.32987cm - 12 - - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Proveedor - - - - - - - Textbox12 - 2.41498cm - 0.20457cm - 0.44478cm - 2.34596cm - 13 - - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - #3598dc - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Descripción - - - - - - - Textbox12 - 2.85976cm - 0.20457cm - 0.44478cm - 2.34596cm - 14 - - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - #3598dc - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Justificación - - - - - - - Textbox12 - 3.30454cm - 0.20457cm - 0.44478cm - 2.34596cm - 15 - - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - #3598dc - Middle - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Fecha Entrega - - - - - - - Textbox12 - 2.85976cm - 13.61054cm - 0.44478cm - 2.52258cm - 16 - - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - #3598dc - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Lugar de Entrega - - - - - - - Textbox12 - 3.30454cm - 13.61054cm - 0.44478cm - 2.52258cm - 17 - - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - #3598dc - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Estatus - - - - - - - Textbox12 - 2.41498cm - 13.61054cm - 0.44478cm - 2.52258cm - 18 - - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - #3598dc - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =iif(Parameters!FechaEntrega.Value="01/01/0001","",Parameters!FechaEntrega.Value) - - - - - - - Textbox12 - 2.85976cm - 16.1331cm - 0.44478cm - 4.32987cm - 19 - - - White - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!ProveedorLugar.Value - - - - - - - Textbox12 - 3.30454cm - 16.1331cm - 0.44478cm - 4.32987cm - 20 - - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - White - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!Estatus.Value - - - - - - - Textbox12 - 2.41498cm - 16.1331cm - 0.44478cm - 4.32987cm - 21 - - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - White - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!Descripcion.Value - - - - - - - Textbox12 - 2.85976cm - 2.55053cm - 0.44478cm - 11.06001cm - 22 - - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - White - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!Asunto.Value - - - - - - - Textbox12 - 3.30454cm - 2.55053cm - 0.44478cm - 11.06001cm - 23 - - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - White - Middle - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!ProveedorNombre.Value - - - - - - - Textbox12 - 2.41498cm - 2.55053cm - 0.44478cm - 11.06001cm - 24 - - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - White - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!Empresa.Value - - - - - - - Textbox8 - 0.48034cm - 2.95843cm - 0.76228cm - 12.7315cm - 25 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Solicitante - - - - - - - Textbox12 - 8.49815cm - 3.07712cm - 0.44478cm - 5.83844cm - 26 - - - #3598dc - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - - - - - - - - Textbox12 - 8.94293cm - 3.07712cm - 0.4095cm - 5.83844cm - 27 - - - - Black - - 1pt - - Top - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!NombreSolicito.Value - - - - - - - Textbox12 - 9.38771cm - 3.07712cm - 0.44478cm - 5.83844cm - 28 - - - White - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Autorizó - - - - - - - Textbox12 - 8.49815cm - 11.4732cm - 0.44478cm - 5.83844cm - 29 - - - #3598dc - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - - - - - - - - Textbox12 - 8.94293cm - 11.4732cm - 0.4095cm - 5.83844cm - 30 - - - - Black - - 1pt - - Top - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!NombreAutorizo.Value - - - - - - - Textbox12 - 9.38771cm - 11.4732cm - 0.44478cm - 5.83844cm - 31 - - - White - 2pt - 2pt - 2pt - 2pt - - - - External - =Parameters!FirmaAutorizo.Value - Fit - 6.92797cm - 12.49243cm - 3.5cm - 3.5cm - 32 - - =iif(Parameters!FirmaAutorizo.Value <> "", False, True) - - - - - - - External - =Parameters!FirmaSolicito.Value - Fit - 6.92797cm - 4.23541cm - 3.5cm - 3.5cm - 33 - - =iif(Parameters!FirmaSolicito.Value <> "", False, True) - - - - - - - true - true - - - - - Uso CFDI 3.3: - - - - - - - Textbox12 - 3.74932cm - 0.20457cm - 0.44478cm - 2.34596cm - 34 - - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - #3598dc - Middle - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!UsoCFDI.Value - - - - - - - Textbox12 - 3.74932cm - 2.55053cm - 0.44478cm - 11.06001cm - 35 - - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - - LightGrey - - 1pt - - White - Middle - 2pt - 2pt - 2pt - 2pt - - - - 4.12223in - + + + + + + Textbox3 + + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + U. M. + + + + + + + Textbox7 + + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Producto o Servicio + + + + + + + Textbox9 + + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Observaciones + + + + + + + Textbox68 + + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Sub Proyecto + + + + + + + Textbox71 + + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Activo Fijo + + + + + + + Textbox11 + + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + P. Unitario + + + + + + + Textbox13 + + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Importe + + + + + + + Textbox5 + + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.473cm + + + + + true + true + + + + + =Fields!Cantidad.Value + + + + + + + Cantidad + + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + 2pt + 2pt + 1pt + + + + + + + + true + true + + + + + =Fields!UM.Value + + + + + + + UM + + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + 2pt + 2pt + 1pt + + + + + + + + true + true + + + + + =Fields!PS.Value + + + + + + + PS + + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + 2pt + 2pt + 1pt + + + + + + + + true + true + + + + + =Fields!Observacion.Value + + + + + + + Observacion + + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + 2pt + 2pt + 1pt + + + + + + + + true + true + + + + + =Fields!SubProyecto.Value + + + + + + + SubProyecto + + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + 2pt + 2pt + 1pt + + + + + + + + true + true + + + + + =Fields!Codigo.Value + + + + + + + Codigo + + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + 2pt + 2pt + 1pt + + + + + + + + true + true + + + + + =Fields!Importe.Value + + + + + + + Importe + + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + 2pt + 2pt + 1pt + + + + + + + + true + true + + + + + =Fields!Total.Value + + + + + + + Total + + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + 2pt + 2pt + 1pt + + + + + + + + + + + + + + + + + + + + + + + + After + + + + + + + DsOC + 4.45714cm + 0.20457cm + 0.96717cm + 20.25838cm + + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + + + true + true + + + + + IVA + + + + + + + Textbox20 + 6.29242cm + 16.1331cm + 0.45183cm + 2.06968cm + 1 + + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + ="Total " & Parameters!Moneda.Value + + + + + + + Textbox20 + 6.74425cm + 16.1331cm + 0.45183cm + 2.06968cm + 2 + + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Descuento + + + + + + + Textbox20 + 5.86881cm + 16.1331cm + 0.42361cm + 2.06968cm + 3 + + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!IVA.Value + + + + + + + Textbox20 + 6.29242cm + 18.20277cm + 0.45183cm + 2.26019cm + 4 + + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Total.Value + + + + + + + Textbox20 + 6.74425cm + 18.20276cm + 0.45183cm + 2.26019cm + 5 + + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Descuento.Value + + + + + + + Textbox20 + 5.86881cm + 18.20276cm + 0.42361cm + 2.26019cm + 6 + + + 2pt + 2pt + 2pt + 2pt + + + + true + + + + + =Parameters!ImporteLetra.Value + + + + + + + Textbox46 + 6.74425cm + 0.20457cm + 0.45183cm + 15.92855cm + 7 + + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + ORDEN DE COMPRA DE MATERIALES Y SERVICIOS + + + + + + + Textbox8 + 1.24262cm + 2.95843cm + 0.5365cm + 12.7315cm + 8 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!TipoOC.Value + + + + + + + Textbox12 + 16.1331cm + 0.44478cm + 4.32987cm + 9 + + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + #3598dc + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Folio.Value + + + + + + + Textbox12 + 0.44478cm + 16.1331cm + 0.44478cm + 4.32987cm + 10 + + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Fecha Impresion + + + + + + + Textbox12 + 0.88956cm + 16.13311cm + 0.44478cm + 4.32987cm + 11 + + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + #3598dc + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Format(Globals!ExecutionTime,"dd/MM/yyyy") + + + + + + + Textbox12 + 1.33434cm + 16.1331cm + 0.44478cm + 4.32987cm + 12 + + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Proveedor + + + + + + + Textbox12 + 2.41498cm + 0.20457cm + 0.44478cm + 2.34596cm + 13 + + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + #3598dc + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Descripción + + + + + + + Textbox12 + 2.85976cm + 0.20457cm + 0.44478cm + 2.34596cm + 14 + + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + #3598dc + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Justificación + + + + + + + Textbox12 + 3.30454cm + 0.20457cm + 0.44478cm + 2.34596cm + 15 + + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + #3598dc + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Fecha Entrega + + + + + + + Textbox12 + 2.85976cm + 13.61054cm + 0.44478cm + 2.52258cm + 16 + + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + #3598dc + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Lugar de Entrega + + + + + + + Textbox12 + 3.30454cm + 13.61054cm + 0.44478cm + 2.52258cm + 17 + + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + #3598dc + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Estatus + + + + + + + Textbox12 + 2.41498cm + 13.61054cm + 0.44478cm + 2.52258cm + 18 + + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + #3598dc + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =iif(Parameters!FechaEntrega.Value="01/01/0001","",Parameters!FechaEntrega.Value) + + + + + + + Textbox12 + 2.85976cm + 16.1331cm + 0.44478cm + 4.32987cm + 19 + + + White + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!ProveedorLugar.Value + + + + + + + Textbox12 + 3.30454cm + 16.1331cm + 0.44478cm + 4.32987cm + 20 + + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + White + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Estatus.Value + + + + + + + Textbox12 + 2.41498cm + 16.1331cm + 0.44478cm + 4.32987cm + 21 + + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + White + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Descripcion.Value + + + + + + + Textbox12 + 2.85976cm + 2.55053cm + 0.44478cm + 11.06001cm + 22 + + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + White + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Asunto.Value + + + + + + + Textbox12 + 3.30454cm + 2.55053cm + 0.44478cm + 11.06001cm + 23 + + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + White + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!ProveedorNombre.Value + + + + + + + Textbox12 + 2.41498cm + 2.55053cm + 0.44478cm + 11.06001cm + 24 + + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + White + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Empresa.Value + + + + + + + Textbox8 + 0.48034cm + 2.95843cm + 0.76228cm + 12.7315cm + 25 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Solicitante + + + + + + + Textbox12 + 8.9744cm + 3.07712cm + 0.44478cm + 5.83844cm + 26 + + + #3598dc + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + + + + + + + + Textbox12 + 9.41918cm + 3.07712cm + 0.4095cm + 5.83844cm + 27 + + + + Black + + 1pt + + Top + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!NombreSolicito.Value + + + + + + + Textbox12 + 9.86396cm + 3.07712cm + 0.44478cm + 5.83844cm + 28 + + + White + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Autorizó + + + + + + + Textbox12 + 8.9744cm + 11.4732cm + 0.44478cm + 5.83844cm + 29 + + + #3598dc + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + + + + + + + + Textbox12 + 9.41918cm + 11.4732cm + 0.4095cm + 5.83844cm + 30 + + + + Black + + 1pt + + Top + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!NombreAutorizo.Value + + + + + + + Textbox12 + 9.86396cm + 11.4732cm + 0.44478cm + 5.83844cm + 31 + + + White + 2pt + 2pt + 2pt + 2pt + + + + External + =Parameters!FirmaAutorizo.Value + Fit + 7.40422cm + 12.49243cm + 3.5cm + 3.5cm + 32 + + =iif(Parameters!FirmaAutorizo.Value <> "", False, True) + + + + + + + External + =Parameters!FirmaSolicito.Value + Fit + 7.40422cm + 4.23541cm + 3.5cm + 3.5cm + 33 + + =iif(Parameters!FirmaSolicito.Value <> "", False, True) + + + + + + + true + true + + + + + Uso CFDI 3.3: + + + + + + + Textbox12 + 3.74932cm + 0.20457cm + 0.44478cm + 2.34596cm + 34 + + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + #3598dc + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!UsoCFDI.Value + + + + + + + Textbox12 + 3.74932cm + 2.55053cm + 0.44478cm + 11.06001cm + 35 + + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + White + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + SubTotal + + + + + + + Textbox20 + 5.43618cm + 16.13311cm + 0.42361cm + 2.0597cm + 36 + + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!SubTotal.Value + + + + + + + Textbox20 + 5.43618cm + 18.19279cm + 0.42361cm + 2.26019cm + 37 + + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + + LightGrey + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + 4.55973in + - - -
  • - - Ver Remisiones - -
  • -
    - -
    - - - - - - - - - - - - -
    + diff --git a/GPS/CatRemisionesVehiculos.aspx.vb b/GPS/CatRemisionesVehiculos.aspx.vb index 69a7979ab..f2660c6f5 100644 --- a/GPS/CatRemisionesVehiculos.aspx.vb +++ b/GPS/CatRemisionesVehiculos.aspx.vb @@ -42,14 +42,12 @@ Partial Class GPS_CatRemisionesVehiculos Dim ObjTSoft As New ClsTSoft If ObjTSoft.GetRemisiones(UsuarioActual.CveCliente) Then GvRemisiones.DataSource = ObjTSoft.DtResultados - Else - GvRemisiones.DataSource = Nothing End If If ObjTSoft.GetEstatusRemisiones() Then DdlEstatus.DataSource = ObjTSoft.DtResultados End If - - ObjTSoft.Dispose() + ObjTSoft.Dispose() + DdlEstatus.DataBind() GvRemisiones.DataBind() UPConsulta.Update() @@ -91,16 +89,16 @@ Partial Class GPS_CatRemisionesVehiculos UpContratos.Update() End Sub Protected Sub BtnActualizarEstatus_Click(sender As Object, e As EventArgs) - Dim ObjSoft As New ClsTSoft - Dim TrackingNo As String = If(TxtTracking.Text <> "", TxtTracking.Text, "-1") - Dim NumRemolque As String = If(TxtNoRemolque.Text <> "", TxtNoRemolque.Text, "-1") + Dim TrackingNo As String = If(TxtTracking.Text <> "", TxtTracking.Text, "-1") + Dim NumRemolque As String = If(TxtNoRemolque.Text <> "", TxtNoRemolque.Text, "-1") + Dim ObjSoft As New ClsTSoft If ObjSoft.UpdateEstatusRemisiones(CveRemision, DdlEstatus.SelectedValue.ToEntero, TrackingNo, NumRemolque) Then Alert("El estatus se actualizó correctamente") - End If + End If + ObjSoft.Dispose() TxtNoRemolque.Text = "" TxtTracking.Text = "" - ObjSoft.Dispose() CargaDatos() RegistraScript("$('#C_BtnCerrarContrato').click();") End Sub @@ -108,17 +106,19 @@ Partial Class GPS_CatRemisionesVehiculos RegistraScript("$('#C_BtnCerrarContrato').click();") End Sub Protected Sub imgHistorial_Click(sender As Object, e As EventArgs) - Dim ObjSoft As New ClsTSoft Dim Boton = CType(sender, LinkButton) Dim GvRow As GridViewRow = DirectCast(Boton.NamingContainer, GridViewRow) - CveRemision = Boton.CommandArgument.ToEntero + CveRemision = Boton.CommandArgument.ToEntero + + Dim ObjSoft As New ClsTSoft If ObjSoft.GETRemisionesHistorial(GvRow.DataKey("FolioRemision").ToString, GvRow.DataKey("NoEconomico").ToString) Then GVHistorico.DataSource = ObjSoft.DtResultados End If ObjSoft.Dispose() + H1.InnerText = $"Histórico Remisión: {GvRow.DataKey("FolioRemision").ToString} " GVHistorico.DataBind() UpHistorico.Update() - RegistraScript("$('#dvHistorico').modal();") + RegistraScript("$('#dvHistorico').modal('show');") End Sub End Class diff --git a/General/SaldosIniciales.aspx.vb b/General/SaldosIniciales.aspx.vb index eae9c9693..7db555706 100644 --- a/General/SaldosIniciales.aspx.vb +++ b/General/SaldosIniciales.aspx.vb @@ -10,7 +10,8 @@ Imports GemBox.Spreadsheet Partial Class General_SaldosIniciales Inherits ClsPaginas Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load - If Not IsPostBack Then + If Not IsPostBack Then + End If End Sub @@ -68,7 +69,92 @@ Partial Class General_SaldosIniciales 'End Try 'Conexion.Close() If Not ErrorArchivo Then + If RblFormato.SelectedValue = "1" Or RblFormato.SelectedValue = "2" Then + If Not dt.Columns(0).ColumnName = "Codigo" Then + Alert("El nombre de la primera columna debe ser 'Codigo'. Favor de corregirlo", TipoMensaje.MsgError) + Exit Sub + End If + If Not dt.Columns(1).ColumnName = "RazonSocial" Then + Alert("El nombre de la segunda columna debe ser 'Fecha'.Favor de corregirlo", TipoMensaje.MsgError) + Exit Sub + End If + If Not dt.Columns(2).ColumnName = "RFC" Then + Alert("El nombre de la tercera columna debe ser 'RFC'.Favor de corregirlo", TipoMensaje.MsgError) + Exit Sub + End If + If Not dt.Columns(3).ColumnName = "Calle" Then + Alert("El nombre de la cuarta columna debe ser 'Calle'. Favor de corregirlo", TipoMensaje.MsgError) + Exit Sub + End If + If Not dt.Columns(4).ColumnName = "Número exterior" Then + Alert("El nombre de la quinta columna debe ser 'Número exterior' .Favor de corregirlo", TipoMensaje.MsgError) + Exit Sub + End If + If Not dt.Columns(5).ColumnName = "Colonia" Then + Alert("El nombre de la sexta columna debe ser 'Colonia'. Favor de corregirlo", TipoMensaje.MsgError) + Exit Sub + End If + If Not dt.Columns(6).ColumnName = "Código postal" Then + Alert("El nombre de la séptima columna debe ser 'Código postal'.Favor de corregirlo", TipoMensaje.MsgError) + Exit Sub + End If + If Not dt.Columns(7).ColumnName = "Población" Then + Alert("El nombre de la octava columna debe ser 'Población'. Favor de corregirlo", TipoMensaje.MsgError) + Exit Sub + End If + If Not dt.Columns(8).ColumnName = "Estado" Then + Alert("El nombre de la novena columna debe ser 'Estado'. Favor de corregirlo", TipoMensaje.MsgError) + Exit Sub + End If + If Not dt.Columns(9).ColumnName = "Teléfono" Then + Alert("El nombre de la décima columna debe ser 'Teléfono'. Favor de corregirlo", TipoMensaje.MsgError) + Exit Sub + End If + If Not dt.Columns(10).ColumnName = "Contacto" Then + Alert("El nombre de la onceava columna debe ser 'Contacto'. Favor de corregirlo", TipoMensaje.MsgError) + Exit Sub + End If + If Not dt.Columns(11).ColumnName = "Celular Contacto" Then + Alert("El nombre de la doceava columna debe ser 'Celular Contacto'. Favor de corregirlo", TipoMensaje.MsgError) + Exit Sub + End If + If Not dt.Columns(12).ColumnName = "Limite Credito" Then + Alert("El nombre de la treceava columna debe ser 'Limite Credito'. Favor de corregirlo", TipoMensaje.MsgError) + Exit Sub + End If + + If Not dt.Columns(13).ColumnName = "Plazo Cobranza" Then + Alert("El nombre de la catorceava columna debe ser 'Plazo Cobranza'. Favor de corregirlo", TipoMensaje.MsgError) + Exit Sub + End If + + 'If Not dt.Columns(14).ColumnName = "Pais" Then + ' Alert("El nombre de la quinceava columna debe ser 'Plazo Cobranza'. Favor de corregirlo", TipoMensaje.MsgError) + ' Exit Sub + 'End If + + + + If Not dt.Columns(14).ColumnName.ToUpper = "BANCO" Then + Alert("El nombre de la quinceava columna debe ser 'Banco'. Favor de corregirlo", TipoMensaje.MsgError) + Exit Sub + End If + If Not dt.Columns(15).ColumnName.ToUpper = "N° CUENTA" Then + Alert("El nombre de la dieciseisava columna debe ser 'N° Cuenta'. Favor de corregirlo", TipoMensaje.MsgError) + Exit Sub + End If + If Not dt.Columns(16).ColumnName.ToUpper = "CLABE INTER" Then + Alert("El nombre de la diecisieteava columna debe ser 'Clabe Inter'. Favor de corregirlo", TipoMensaje.MsgError) + Exit Sub + End If + + + + + + ElseIf RblFormato.SelectedValue = "2" Then + If Not dt.Columns(0).ColumnName = "Codigo" Then Alert("El nombre de la primera columna debe ser 'Codigo'. Favor de corregirlo", TipoMensaje.MsgError) Exit Sub @@ -124,22 +210,24 @@ Partial Class General_SaldosIniciales If Not dt.Columns(13).ColumnName = "Plazo Cobranza" Then Alert("El nombre de la treceava columna debe ser 'Plazo Cobranza'. Favor de corregirlo", TipoMensaje.MsgError) Exit Sub - End If - If RblFormato.SelectedValue = "1" Then - If Not dt.Columns(14).ColumnName = "Vendedor" Then + End If + + + If Not dt.Columns(14).ColumnName = "Vendedor" Then Alert("El nombre de la catorceava columna debe ser 'Es distribuidor'. Favor de corregirlo", TipoMensaje.MsgError) Exit Sub End If If Not dt.Columns(15).ColumnName = "Clasificación" Then Alert("El nombre de la catorceava columna debe ser 'Es distribuidor'. Favor de corregirlo", TipoMensaje.MsgError) Exit Sub - End If - If Not dt.Columns(16).ColumnName = "Es distribuidor" Then - Alert("El nombre de la catorceava columna debe ser 'Es distribuidor'. Favor de corregirlo", TipoMensaje.MsgError) - Exit Sub - End If - End If - + End If + If Not dt.Columns(16).ColumnName = "Es distribuidor" Then + Alert("El nombre de la catorceava columna debe ser 'Es distribuidor'. Favor de corregirlo", TipoMensaje.MsgError) + Exit Sub + End If + + + ElseIf RblFormato.SelectedValue = "3" Or RblFormato.SelectedValue = "4" Then If Not dt.Columns(0).ColumnName = "Sucursal" Then Alert("El nombre de la primera columna debe ser 'Sucursal'. Favor de corregirlo", TipoMensaje.MsgError) @@ -271,8 +359,13 @@ Partial Class General_SaldosIniciales Exit Sub End If - If Not dt.Columns(12).ColumnName = "Litraje" Then - Alert("El nombre de la treceava columna debe ser 'Litraje'. Favor de corregirlo", TipoMensaje.MsgError) + If Not dt.Columns(12).ColumnName = "Servicio" Then + Alert("El nombre de la treceava columna debe ser 'Servicio'. Favor de corregirlo", TipoMensaje.MsgError) + Exit Sub + End If + + If Not dt.Columns(13).ColumnName = "Conversion Unidad" Then + Alert("El nombre de la catorceava columna debe ser 'Conversion Unidad'. Favor de corregirlo", TipoMensaje.MsgError) Exit Sub End If @@ -512,7 +605,8 @@ Partial Class General_SaldosIniciales If Not ErrorArchivo Then 'P R O D U C T O S / S E R V I C I O S - If RblFormato.SelectedValue = "5" Then + If RblFormato.SelectedValue = "5" Then + Dim ObjPS As New ClsProductosServicios Dim ObjGral As New ClsGenerales(ObjPS.IniciaTransacSQL()) Dim ObjClas As New ClsClasificaciones(ObjPS.IniciaTransacSQL()) @@ -563,7 +657,8 @@ Partial Class General_SaldosIniciales Dim IEPS As Decimal = Row("IEPS").ToString.ToDecimal Dim Tamaño As String = Row("Tamaño").ToString.Trim Dim SATClavePS As String = Row("Código SAT").ToString.Trim - Dim Litraje As Double = Row("Litraje").ToString.ToDouble + Dim Clasificacion2 As String = Row("Servicio").ToString.Trim + Dim Litraje As Double = Row("Conversion Unidad").ToString.ToDouble Dim RinTamaño As String = If(Row.Table.Columns.Contains("Tamaño de Rin"), Row("Tamaño de Rin").ToString.Trim, "") Dim Medida As String = If(Row.Table.Columns.Contains("Medida"), Row("Medida").ToString.Trim, "") Dim SATClaveUnidadMedida As String = If(Row.Table.Columns.Contains("Clave Unidad"), Row("Clave Unidad").ToString.Trim, "") @@ -572,11 +667,12 @@ Partial Class General_SaldosIniciales Dim CvePS As Integer = DTPS.FiltroPrimeroValor("CvePS", $"Codigo = '{Codigo}'").ToString.ToEntero - Dim CveTipoPS As Integer = If(TipoPS = "PRODUCTO", 2, 1) + Dim CveTipoPS As Integer = If(TipoPS.ToUpper = "PRODUCTO", 2, 1) Dim CveClasificacion As Integer = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveClasificacion", $"Clasificacion = '{Clasificacion}'").ToString.ToEntero Dim CveUnidadMedida As Integer = GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveUnidadMedida", $"UnidadMedida = '{UnidadMedida}'").ToString.ToEntero Dim CveSATPS As Integer = GlobalDTPSATPS.FiltroPrimeroValor("CveSATPS", $"SATClavePS = '{SATClavePS}'").ToString.ToEntero - Dim CveTamaño As Integer = GlobalDTAcumTamaños.FiltroPrimeroValor("CveTamaño", $"Tamaño = '{Tamaño}'").ToString.ToEntero + Dim CveTamaño As Integer = GlobalDTAcumTamaños.FiltroPrimeroValor("CveTamaño", $"Tamaño = '{Tamaño}' AND CveEmpresa = {UsuarioActual.CveEmpresa}").ToString.ToEntero + Dim CveClasificacion2 As Integer = GlobalDTClasificaciones2(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveClasificacion", $"Clasificacion = '{Clasificacion2}'").ToString.ToEntero If Not CveClasificacion > 0 AndAlso Clasificacion <> "" Then If ObjClas.AddClasificaciones(Clasificacion, "", -1, "-1", -1, "-1", -1, "-1", @@ -588,7 +684,7 @@ Partial Class General_SaldosIniciales End If If Not CveUnidadMedida > 0 AndAlso UnidadMedida <> "" Then - If ObjUM.AddUnidadMedida(UnidadMedida, "", "", "", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).ToEntero > 0 Then + If ObjUM.AddUnidadMedida(UnidadMedida, UnidadMedida, "", "", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).ToEntero > 0 Then If ObjUM.GetUnidadesMedida() Then Application("GlobalDTUnidadesMedida") = ObjUM.DtResultados CveUnidadMedida = GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveUnidadMedida", $"UnidadMedida = '{UnidadMedida}'").ToString.ToEntero End If @@ -644,6 +740,45 @@ Partial Class General_SaldosIniciales End If End If End If + End If + + If Not CveClasificacion2 > 0 AndAlso Clasificacion2 <> "" Then + Dim CveCategoria As Integer + + + + If ObjGral.GetCategorias(UsuarioActual.CveEmpresa, 4) Then + CveCategoria = ObjGral.DtResultados.FiltroPrimeroValor("CveCategoria", "").ToEntero + End If + + If Not CveCategoria > 0 Then + If ObjGral.AddCategorias(Clasificacion2, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 4) Then + + If ObjGral.GetCategorias(UsuarioActual.CveEmpresa, 4) Then + CveCategoria = ObjGral.DtResultados.FiltroPrimeroValor("CveCategoria", "").ToEntero + End If + End If + End If + + + If ObjClas.GetClasificaciones(UsuarioActual.CveEmpresa) Then + CveClasificacion2 = ObjClas.DtResultados.FiltroPrimeroValor("CveClasificacion", $"Clasificacion = '{ Clasificacion2.Trim }'").ToEntero + End If + + + If CveClasificacion2 = 0 Then + + If ObjClas.AddClasificaciones(Clasificacion2, "", -1, "-1", -1, "-1", -1, "-1", CveCategoria, UsuarioActual.CveUsuario, + UsuarioActual.CveEmpresa) Then + If ObjClas.GetClasificaciones(Tipo:=4) Then Application("GlobalDTClasificaciones2") = ObjClas.DtResultados + CveClasificacion2 = GlobalDTClasificaciones2(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveClasificacion", $"Clasificacion = '{Clasificacion2}'").ToString.ToEntero + End If + + End If + + + + End If If Not CveClasificacion > 0 AndAlso Clasificacion <> "" Then Alert("No se encontró la Clasificación: " + Clasificacion, TipoMensaje.MsgAdvertencia) : ErrorPS = True : Exit For @@ -653,11 +788,12 @@ Partial Class General_SaldosIniciales If Not CveMedida > 0 AndAlso Medida <> "" Then Alert("No se encontró la Media: " + Medida, TipoMensaje.MsgAdvertencia) : ErrorPS = True : Exit For If Not CveRinTamaño > 0 AndAlso RinTamaño <> "" Then Alert("No se encontró el Tamaño: " + RinTamaño, TipoMensaje.MsgAdvertencia) : ErrorPS = True : Exit For If Not CveModelo > 0 AndAlso Modelo <> "" Then Alert("No se encontró el Modelo: " + Modelo, TipoMensaje.MsgAdvertencia) : ErrorPS = True : Exit For + 'If Not CveClasificacion2 > 0 AndAlso Clasificacion2 <> "" Then Alert("No se encontró la Serie: " + Clasificacion2, TipoMensaje.MsgAdvertencia) : ErrorPS = True : Exit For If CvePS > 0 Then If Not ObjPS.UpdatePS(CveClasificacion, 1, CveUnidadMedida, Codigo, "", CodigoBarras, Descripcion, Precio, 1, 1, False, 0, True, True, True, UsuarioActual.CveUsuario, CvePS, -1, -1, CveSATPS, CveTipoPS:=CveTipoPS, CveMarca:=CveMarca, CveMedida:=CveMedida, CveRinTamaño:=CveRinTamaño, - CveModelo:=CveModelo, Litraje:=Litraje, IEPSPorcentaje:=IEPS) Then + CveModelo:=CveModelo, Litraje:=Litraje, IEPSPorcentaje:=IEPS, CveClasificacion2:=CveClasificacion2, CveTamaño:=CveTamaño) Then 'If Not ObjPS.UpdatePS(CveClasificacion, 1, CveUnidadMedida, Codigo, "", CodigoBarras, Descripcion, 0, 1, 1, False, 0, True, True, True, UsuarioActual.CveUsuario, CvePS, -1, -1, CveSATPS, ' CveTipoPS:=CveTipoPS, CveMarca:=CveMarca, CveTamaño:=CveTamaño, CveMedida:=CveMedida) Then ErrorPS = True @@ -666,10 +802,11 @@ Partial Class General_SaldosIniciales Else Contador += 1 End If + Else If ObjPS.AddPS(CveClasificacion, 1, CveUnidadMedida, Codigo, "", CodigoBarras, Descripcion, Precio, 0, 0, False, 0, False, True, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, 1, CveTipoPS:=CveTipoPS, CveSATPS:=CveSATPS, CveMarca:=CveMarca, CveTamaño:=CveTamaño, CveMedida:=CveMedida, CveRinTamaño:=CveRinTamaño, - CveModelo:=CveModelo, Litraje:=Litraje, IEPSPorcentaje:=IEPS) <= 0 Then + CveModelo:=CveModelo, Litraje:=Litraje, IEPSPorcentaje:=IEPS, CveClasificacion2:=CveClasificacion2) <= 0 Then 'If ObjPS.AddPS(CveClasificacion, 1, CveUnidadMedida, Codigo, "", "", Descripcion, 0, 0, 0, False, 0, False, True, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, 1, ' CveTipoPS:=CveTipoPS, CveSATPS:=CveSATPS, CveMarca:=CveMarca, CveTamaño:=CveTamaño, CveMedida:=CveMedida) <= 0 Then ErrorPS = True @@ -710,43 +847,106 @@ Partial Class General_SaldosIniciales Dim ExisteProveedor As Boolean = False ObjProv.IniciaTransacSQL() - For Each Row As DataRow In dt.Rows + For Each Row As DataRow In dt.Rows + Dim Codigo As String = Row("Codigo").ToString Dim RazonSocial As String = Row("RazonSocial").ToString - Dim RFC As String = Row("RFC").ToString.Trim - Dim Calle As String = Row("Calle").ToString - Dim NumExt As Decimal = Row("Número exterior").ToString.ToDecimal - Dim Colonia As String = Row("Colonia").ToString - Dim CodigoPostal As Decimal = Row("Código Postal").ToString.ToDecimal - Dim Poblacion As String = Row("Población").ToString - Dim Estado As String = Row("Estado").ToString + Dim RFC As String = Row("RFC").ToString.Trim + + Dim Dirrecion As String = $"{ Row("Población").ToString}, { Row("Estado").ToString} , Colonia { Row("Colonia").ToString}, {Row("Calle").ToString} #{Row("Número exterior").ToString}" + + 'Dim NumExt As String = Row("Número exterior").ToString + + + ' Dim Colonia As String = Row("Colonia").ToString + Dim CodigoPostal As Integer = Row("Código Postal").ToString.ToEntero + + ' Dim Poblacion As String = Row("Población").ToString + + 'Dim Estado As String = Row("Estado").ToString Dim Telefono As String = Row("Teléfono").ToString - Dim Contacto As String = Row("Contacto").ToString + Dim ContactoMail As String = Row("Contacto").ToString Dim CelularContacto As String = Row("Celular Contacto").ToString Dim LimiteCredito As Double = Row("Limite Credito").ToString.ToDouble - Dim PlazoCobranza As Integer = Row("Plazo Cobranza").ToString.ToEntero + Dim PlazoCobranza As Integer = Row("Plazo Cobranza").ToString.ToEntero + + Dim Banco As String = Row("Banco").ToString + Dim NumeroCuenta As String = Row("N° CUENTA").ToString.Replace("-", "").Replace(" ", "") + Dim ClabeInter As String = Row("Clabe Inter").ToString.Replace("-", "").Replace(" ", "") + Dim CveProveedor As Integer = GlobalDTCompProveedores(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveProveedor", $"RFC = '{RFC}'").ToString.ToEntero - Dim CveProveedor2 As Integer = GlobalDTCompProveedores(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveProveedor", $"RazonSocial = '{RazonSocial}'").ToString.ToEntero - Dim CveProveedor3 As Integer = GlobalDTCompProveedores(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveProveedor", $"Codigo = '{Codigo}'").ToString.ToEntero - - If CveProveedor > 0 Or CveProveedor2 > 0 Or CveProveedor3 > 0 Then - Contador = Contador + 1 - 'If Not ObjProv.UpdateProveedor(Codigo, RazonSocial, RazonSocial, RazonSocial, RFC, Calle, Telefono, - ' Contacto, "", Telefono, LimiteCredito, PlazoCobranza, "", 0, 0, 0, -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", - ' -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, -1, True, "", "", False, CveProveedor) Then - ' ErrorProv = True - ' Exit For - 'End If - Else - If Not ObjProv.AddProveedor(Codigo, RazonSocial, RazonSocial, RazonSocial, RFC, Calle, Telefono, - Contacto, "", Telefono, LimiteCredito, PlazoCobranza, "", 0, 0, 0, -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", - -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, -1, "", "", False, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then + Dim CveProveedor2 As Integer = GlobalDTCompProveedores(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveProveedor", $"RazonSocial = '{RazonSocial}'").ToString.ToEntero + Dim CveProveedor3 As Integer = 0 + + If Codigo.Trim.Length > 0 Then + CveProveedor3 = GlobalDTCompProveedores(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveProveedor", $"Codigo = '{Codigo}'").ToString.ToEntero + End If + + + + ' If CveProveedor > 0 Or CveProveedor2 > 0 Or CveProveedor3 > 0 Then + If CveProveedor > 0 Or CveProveedor2 > 0 Or CveProveedor3 > 0 Then + Contador = Contador + 1 + + 'If Not ObjProv.UpdateProveedor(Codigo, RazonSocial, RazonSocial, RazonSocial, RFC, Calle, Telefono, + ' Contacto, "", Telefono, LimiteCredito, PlazoCobranza, "", 0, 0, 0, -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", + ' -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, -1, True, "", "", False, CveProveedor) Then + ' ErrorProv = True + ' Exit For + 'End If + + Else + + Telefono = Telefono.Replace("-", "").Replace("(", "").Replace(")", "").Trim + CelularContacto = CelularContacto.Replace("-", "").Replace("(", "").Replace(")", "").Trim + + Telefono = If(Telefono.Length > 10, "", Telefono) + CelularContacto = If(CelularContacto.Length > 10, "", Telefono) + + If Not ObjProv.AddProveedor(Codigo, RazonSocial, RazonSocial, RazonSocial, RFC, Dirrecion, Telefono, + "", ContactoMail, CelularContacto, LimiteCredito, PlazoCobranza, "", 0, 0, 0, -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", + -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, -1, "", "", False, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CP:=CodigoPostal) Then ErrorProv = True - Exit For - End If - End If - Next + Exit For + + + Else + + Dim ErrorCuentaDeposito As Boolean = False + 'RESTRICCIONES GENERALES + 'QUE TENGA ALGUN DATO DE TIPO DE CUENTA + If NumeroCuenta.Trim.Length = 0 AndAlso ClabeInter.Trim.Length = 0 Then + ErrorCuentaDeposito = True + End If + + 'SI CLABE TIENE ALGO DEBE TENER UNA LOGITUD EXACTA DE 18 + If ClabeInter.Trim.Length <> 0 AndAlso ClabeInter.Trim.Length <> 18 Then + ErrorCuentaDeposito = True + End If + + If Not ErrorCuentaDeposito Then + Dim ObjGrales As New ClsGenerales(ObjProv.IniciaTransacSQL) + If Not ObjGrales.AddCuentasDepositos(Banco, "-1", "-1", NumeroCuenta, ClabeInter, "-1", "-1", "-1", "-1", UsuarioActual.CveUsuario, 1, CveProveedor:=ObjProv.CveProveedor) Then + 'ErrorProv = True + End If + End If + End If + End If + + + + + Next + + + + + + + + + If Not ErrorProv Then ObjProv.Commit() If ObjProv.GetProveedores(ClsCompProveedores.TipoConsulta.ParaGlobalDT, -1, "-1", "-1", "-1", "-1", "-1", "-1", "-1", -1, -1) Then Application("GlobalDTCompProveedores") = ObjProv.DtResultados @@ -772,7 +972,9 @@ Partial Class General_SaldosIniciales ObjClientes.IniciaTransacSQL() For Each Row As DataRow In dt.FiltraParametros("RFC <> ''").Rows - NumRow = NumRow + 1 + NumRow = NumRow + 1 + + Dim Codigo As String = Row("Codigo").ToString Dim RazonSocial As String = Row("RazonSocial").ToString Dim RFC As String = Row("RFC").ToString.Trim @@ -783,36 +985,148 @@ Partial Class General_SaldosIniciales Dim Poblacion As String = Row("Población").ToString Dim Estado As String = Row("Estado").ToString Dim Pais As String = Row("Pais").ToString - Dim Telefono As String = Row("Teléfono").ToString - Dim Contacto As String = Row("Contacto").ToString - Dim CelularContacto As String = Row("Celular Contacto").ToString + Dim Telefono As String = Row("Teléfono").ToString.Replace("-", "").Replace(" ", "").Replace("(", "").Replace(")", "") + Dim Contacto As String = Row("Contacto").ToString + + Dim Vendedor As String = Row("Vendedor").ToString Dim Clasificacion As String = Row("Clasificación").ToString Dim CveCliente As Integer = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveCliente", $"RFC = '{RFC}'").ToString.ToEntero Dim CveVendedor As Integer = GlobalDTVendedores(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveVendedor", $"Vendedor = '{Vendedor}'").ToString.ToEntero Dim CveClasificación As Integer = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveClasificacion", $"Clasificacion = '{Clasificacion}'").ToString.ToEntero - Dim EsDistribuidor As Boolean = If(Row("Es distribuidor").ToString = "si", True, False) - Dim CargoUsado As Boolean = If(Row("CargoUsado").ToString = "si", True, False) - Dim BonificacionUsado As Boolean = If(Row("BonificacionUsado").ToString = "si", True, False) - + Dim EsDistribuidor As Boolean = If(Row("Es distribuidor").ToString.ToUpper = "SI", True, False) + Dim CargoUsado As Boolean = If(Row("Cargo Usados").ToString.ToUpper = "SI", True, False) + Dim BonificacionUsado As Boolean = If(Row("EmitirBon Usado").ToString.ToUpper = "SI", True, False) + + Dim LimiteCredito As Decimal = Row("Limite Credito").ToString.ToDecimal + Dim CobranzaCorreo As String = Row("CorreoPago").ToString + Dim PlazoCobranza As Integer = Row("Plazo Cobranza").ToString.ToEntero + + Dim DìaVisita As String = Row("Dia Pago").ToString + Dim DiasPagoEspecifico As String = Row("Dìa Visita").ToString + Dim CobranzaContacto As String = Row("Encargado Pago").ToString + Dim CobranzaTelefono As String = Row("Celular Contacto").ToString.Replace("-", "").Replace(" ", "").Replace("(", "").Replace(")", "") + + + ' CobranzaContacto = Regex.Replace(CobranzaContacto, "[^0-9]", "") + + 'Telefono + + If Telefono.Trim.Length > 10 Then + Telefono = "" + End If + + If CobranzaTelefono.Trim.Length > 10 Then + + CobranzaTelefono = "" + End If + + Dim FormaPago As String = Row("Forma Pago").ToString + Dim CveFormaPago33 As Integer = 99 + + Select Case FormaPago + + Case "01" + CveFormaPago33 = 1 + Exit Select + Case "02" + CveFormaPago33 = 2 + Exit Select + Case "03" + CveFormaPago33 = 3 + Exit Select + Case "04" + CveFormaPago33 = 4 + Exit Select + Case "05" + CveFormaPago33 = 5 + Exit Select + Case "06" + CveFormaPago33 = 6 + Exit Select + Case "08" + CveFormaPago33 = 7 + Exit Select + Case "12" + CveFormaPago33 = 8 + Exit Select + Case "13" + CveFormaPago33 = 9 + Exit Select + Case "14" + CveFormaPago33 = 10 + Exit Select + Case "15" + CveFormaPago33 = 11 + Exit Select + Case "17" + CveFormaPago33 = 12 + Exit Select + Case "23" + CveFormaPago33 = 13 + Exit Select + Case "24" + CveFormaPago33 = 14 + Exit Select + Case "25" + CveFormaPago33 = 15 + Exit Select + Case "26" + CveFormaPago33 = 16 + Exit Select + Case "27" + CveFormaPago33 = 17 + Exit Select + Case "28" + CveFormaPago33 = 18 + Exit Select + Case "29" + CveFormaPago33 = 19 + Exit Select + Case "99" + CveFormaPago33 = 20 + Exit Select + Case "30" + CveFormaPago33 = 21 + Exit Select + Case "31" + CveFormaPago33 = 22 + Exit Select + Case Else + CveFormaPago33 = 99 + + End Select + + + + 'Dim RazonSocial As String = Row("RazonSocial").ToString + + 'Contacto + If CveCliente > 0 Then ExisteCliente = True - Contador = Contador + 1 - 'If Not ObjClientes.UpdateCliente(RazonSocial, RazonSocial, Calle, "", "", Colonia, "", "", Estado, RFC, CodigoPostal, "", "", Contacto, "", "", "", "", -1, False, 1, -1, False, True, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, "", -1, -1, -1, - ' "-1", -1, -1, -1, -1, "0", -1, "0", 0, "", 0, "", 0, "", 0, "", "", "", "", 0, "", 1, False, "", "", "", False, "", "", "", "", "", False, "", "", "", False, 0, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, "", "", False, -1) Then - ' ErrorClientes = True - ' RFC.GuardaLog - ' Exit For - 'End If + Contador = Contador + 1 + + 'If Not ObjClientes.UpdateCliente(RazonSocial, RazonSocial, Calle, "", "", Colonia, "", "", Estado, RFC, CodigoPostal, "", "", Contacto, "", "", "", "", -1, False, 1, -1, False, True, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, "", -1, -1, -1, + ' "-1", -1, -1, -1, -1, "0", -1, "0", 0, "", 0, "", 0, "", 0, "", "", "", "", 0, "", 1, False, "", "", "", False, "", "", "", "", "", False, "", "", "", False, 0, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, "", "", False, -1) Then + ' ErrorClientes = True + ' RFC.GuardaLog + ' Exit For + 'End If Else - If Not ObjClientes.AddCliente(RazonSocial, RazonSocial, Calle, "", "", Colonia, "", "", Estado, Pais, RFC, CodigoPostal, "", "", Contacto, "", "", "", "", -1, False, 0, 0, False, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, "", CveVendedor, -1, -1, - "-1", "-1", -1, "-1", -1, "0", -1, "0", 0, "", 0, "", 0, "", 0, "", "", "", Codigo, 0, "", 1, False, "", "", "", False, "", "", "", "", "", False, "", "", "", False, 0, -1, EsDistribuidor:=EsDistribuidor, CveClienteClasificacion:=CveClasificación, CargoUsado:=CargoUsado, BonificacionUsado:=BonificacionUsado) Then + + If Not ObjClientes.AddCliente(RazonSocial, RazonSocial, Calle, NumExt.ToString, "", Colonia, Poblacion, Poblacion, Estado, Pais, RFC, CodigoPostal, Telefono, Contacto, "", "", "", "", "", -1, False, 0, 0, False, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, "", CveVendedor, PlazoCobranza, -1, + "-1", "-1", -1, "-1", -1, "0", -1, "0", 0, "", 0, "", 0, "", 0, "", "", "", Codigo, LimiteCredito, "", 1, False, "", "", "", False, "", "", "", "", "", False, "", "", "", False, 0, -1, EsDistribuidor:=EsDistribuidor, CveClienteClasificacion:=CveClasificación, CargoUsado:=CargoUsado, + BonificacionUsado:=BonificacionUsado, CobranzaContacto:=CobranzaContacto, CobranzaCorreo:=CobranzaCorreo, DiasEspecifico:=DiasPagoEspecifico, DiasRevision:=DìaVisita, CobranzaTelefono:=CobranzaTelefono, CveFormaPago33:=CveFormaPago33) Then + ErrorClientes = True RFC.GuardaLog Exit For End If + End If + Next @@ -1629,10 +1943,12 @@ Partial Class General_SaldosIniciales End Sub - Protected Sub BtnDescargar_Click(sender As Object, e As EventArgs) Handles BtnDescargar.Click - Dim Directorio As String = "" + Protected Sub BtnDescargar_Click(sender As Object, e As EventArgs) Handles BtnDescargar.Click + + Dim Directorio As String = "" + If RblFormato.SelectedValue = "1" Then - Directorio = AppDomain.CurrentDomain.BaseDirectory & "Empresas\Grales\SaldosIniciales\FormatoClientes.xlsx" + Directorio = AppDomain.CurrentDomain.BaseDirectory & "Empresas\Grales\SaldosIniciales\FormatoProveedor.xlsx" ElseIf RblFormato.SelectedValue = "2" Then Directorio = AppDomain.CurrentDomain.BaseDirectory & "Empresas\Grales\SaldosIniciales\FormatoClientes.xlsx" ElseIf RblFormato.SelectedValue = "3" Then @@ -1684,7 +2000,7 @@ Partial Class General_SaldosIniciales If firstRowHasHeaders Then If worksheet.Rows(0).Cells(cols).Value IsNot Nothing Then - dataTable.Columns.Add(worksheet.Rows(0).Cells(cols).Value.ToString()) + dataTable.Columns.Add(worksheet.Rows(0).Cells(cols).Value.ToString().Trim) Else dataTable.Columns.Add("Unnamed Column " & (System.Threading.Interlocked.Increment(unnamed))) End If @@ -1693,9 +2009,11 @@ Partial Class General_SaldosIniciales Else dataTable.Columns.Add("Column " & (cols + 1)) End If + Next - While curRow < worksheet.Rows.Count + While curRow < worksheet.Rows.Count + columns = New String(cols - 1) {} For curCol = 0 To cols - 1 @@ -1705,13 +2023,16 @@ Partial Class General_SaldosIniciales Else columns(curCol) = worksheet.Rows(curRow).Cells(curCol).Value.ToString() End If + Next dataTable.Rows.Add(columns) curRow += 1 + End While Return dataTable + End Function End Class diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb index baab9686f..285af40ba 100644 --- a/Inventarios/EntradasSalidas.aspx.vb +++ b/Inventarios/EntradasSalidas.aspx.vb @@ -588,8 +588,8 @@ Partial Class Inventarios_EntradasSalidas If DtMov.Rows(0)("CvePrePoliza").ToString.ToEntero > 0 Then HplPrePoliza.Visible = True HplPrePoliza.NavigateUrl = String.Format("/Contabilidad/RegPrePoliza.aspx?CvePrePoliza={0}", DtMov.Rows(0)("CvePrePoliza")) - CvePrePoliza = DtMov.Rows(0)("CvePrePoliza").ToString.ToEntero - Else + CvePrePoliza = DtMov.Rows(0)("CvePrePoliza").ToString.ToEntero + Else If UsuarioActual.CveRol = 1 Then BtnGeneraPrepoliza.Visible = True End If @@ -874,7 +874,18 @@ Partial Class Inventarios_EntradasSalidas TxtFecha.Enabled = True ImgFecha.Enabled = True TxtObservaciones.Enabled = True - End If + End If + + Dim ObjContabilidad As New ClsContabilidad + If ObjContabilidad.GetPrePoliza(CvePrePoliza, UsuarioActual.CveEmpresa) Then + Dim dr As DataRow = ObjContabilidad.DtResultados.FiltroPrimero("") + If dr IsNot Nothing Then + If dr("IdPoliza").ToString.ToEntero > 0 Then + BtnEliminar.Visible = False + End If + End If + End If + ObjContabilidad.Dispose() 'SI TIENE PREPOLIZA NO SE DEBE PODER EDITAR If Mov.TienePrePoliza > 0 Then @@ -1149,9 +1160,20 @@ Partial Class Inventarios_EntradasSalidas Protected Sub AddNew(CvePS As Integer, PS As String, CveUM As Integer, UM As String, Cantidad As Double, PU As Double, SerieLote As String, CodigoAF As String, Codigo As String, CveAF As String, Observaciones As String, Lote As String, Batch As String, CveSeccionAlmacen As Integer, SeccionAlmacen As String) If DdlAlmacen.SelectedValue.ToEntero <= 0 Then Alert("Seleccione un almacen", TipoMensaje.MsgAdvertencia) : RegistraScript("playsonidito('142608__autistic-lucario__error.wav')") : DdlProducto2.SelectedText = "" : Exit Sub - Dim Valido As Boolean = True + Dim Valido As Boolean = True + + Dim RowPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS).Rows(0) + + Dim CveMetodoInventario As Integer = RowPS("Inv_CveMetodoInventario").ToString().ToEntero() + + If CveMetodoInventario = 5 And (String.IsNullOrEmpty(SerieLote.Trim()) OrElse SerieLote = "-1") Then + Valido = False + Alert("El producto requiere Serie-Lote", TipoMensaje.MsgAdvertencia) + End If + 'salida - If DdlConcepto.SelectedValue.Contiene({"3", "5", "7", "8", "11", "12", "13", "15", "16", "17", "20", "21", "30", "31"}) Then ' salida de almacen + If Valido AndAlso DdlConcepto.SelectedValue.Contiene({"3", "5", "7", "8", "11", "12", "13", "15", "16", "17", "20", "21", "30", "31"}) Then ' salida de almacen + Dim Existencia As Double = GetExistencias(CvePS, CveUM, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, If(SerieLote = "", "-1", SerieLote), If(Lote = "", "-1", Lote), If(Batch = "", "-1", Batch)) LbAgregar.ToolTip = Existencia.ToString If Existencia - Cantidad - DtMovimientos.SUM("Cantidad", $"CvePS = {CvePS} AND CveUM = {CveUM} {If(SerieLote <> "", $" AND SerieLote = '{SerieLote}'", "")}") < 0 Then @@ -1170,6 +1192,7 @@ Partial Class Inventarios_EntradasSalidas End If End If + If Valido Then Dim CveClasificacion As Integer Dim dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS).FiltroPrimero("", "PS") @@ -1513,6 +1536,7 @@ Partial Class Inventarios_EntradasSalidas Dim OrigenMov As Integer = GlobalDTInvConceptos.FiltroPrimeroValor("Origen", "CveConcepto = " & DdlConcepto.SelectedValue).ToEntero If OrigenMov = 1 Then TipoMovtoAlmacen = False Else TipoMovtoAlmacen = True + TipoMovtoOtro = Not TipoMovtoAlmacen Dim CveConceptoContable As Integer = 78 Dim CveClasificacion As Integer = -1 @@ -1527,6 +1551,7 @@ Partial Class Inventarios_EntradasSalidas Case 30 CveConceptoContable = 181 + TipoMovtoOtro = False If UsuarioActual.Empresa.Funcionalidad(342).ToEntero > 0 Then IdCtaContableOtro = UsuarioActual.Empresa.Funcionalidad(342).ToEntero End If diff --git a/Inventarios/PrestamosdeProveedor.aspx b/Inventarios/PrestamosdeProveedor.aspx index 7ad824cb7..69922a7b1 100644 --- a/Inventarios/PrestamosdeProveedor.aspx +++ b/Inventarios/PrestamosdeProveedor.aspx @@ -84,6 +84,7 @@
    +
    diff --git a/Inventarios/PrestamosdeProveedor.aspx.vb b/Inventarios/PrestamosdeProveedor.aspx.vb index b55283484..9cfe144b4 100644 --- a/Inventarios/PrestamosdeProveedor.aspx.vb +++ b/Inventarios/PrestamosdeProveedor.aspx.vb @@ -6,12 +6,8 @@ Partial Class Inventarios_PrestamosdeProveedor Private Sub Inventarios_PrestamosdeProveedor_Load(sender As Object, e As EventArgs) Handles Me.Load If Not Page.IsPostBack Then CargaCombos() - Dim a As New ClsValidaCFDi("EBFD0EF4-F7D2-4243-9A79-9C484D6C1323", "FRU880930R72", "AJA850608L7A", 39) - Alert(a.EsValida) - Dim lista As New List(Of String) - lista.Add("93") - lista.Add("100") - Notificaciones.AlertaVentana("hola", lista) + + CargaDatos() End If End Sub @@ -45,6 +41,11 @@ Partial Class Inventarios_PrestamosdeProveedor If ObjInv.PrestamosdeProveedorGet(tCveProveedor, tFolio, UsuarioActual.CveEmpresa) Then GvD.DataSource = ObjInv.DtResultados + Dim Dr As Data.DataRow = ObjInv.DtResultados.FiltroPrimero("") + If Dr IsNot Nothing Then + HdnCveProveedor.Value = Dr("CveProveedor") + End If + End If ObjInv.Dispose() @@ -128,7 +129,7 @@ Partial Class Inventarios_PrestamosdeProveedor Dim Fecha As Date = TxtFechaEntrega.Text.ToDate Dim CveMovimientoSalida As Integer - Dim tCveProveedor As Integer = ddlProveedor.SelectedValue.ToEntero + Dim tCveProveedor As Integer = HdnCveProveedor.Value.ToEntero Dim CvePS As Integer = 0 'AGREGAMOS LA SALIDA @@ -173,8 +174,7 @@ Partial Class Inventarios_PrestamosdeProveedor Dim CveConceptoContable As Integer = 69 Dim CveClasifCosto As Integer = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveClasificacion", String.Format("CvePS ={0} ", CvePS)) - idCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaGasto", $"CveClasificacion = {CveClasifCosto}").ToEntero - + IdCtaContableOtro = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {CveClasifCosto}").ToEntero If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoAlmacen, tValorInventario, TxtObservacionesEntrega.Text.Trim, 68, TxtObservacionesEntrega.Text.Trim, Fecha, idCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoSalida, ImporteMX:=tValorInventario) Then ErrorMovInv = True @@ -196,6 +196,7 @@ Partial Class Inventarios_PrestamosdeProveedor TxtRecibio.Text = "" TxtFechaEntrega.Text = Now.ToShortDateString TxtObservacionesEntrega.Text = "" + HdnCveProveedor.Value = "" Dim Mensaje As StringBuilder = New StringBuilder Mensaje.AppendFormat("Se realizo correctamente la recepción.
    Folio de Salida: {0}", Folio, CveMovimientoSalida) diff --git a/Inventarios/RecepcionAlmacen.aspx.vb b/Inventarios/RecepcionAlmacen.aspx.vb index 4bb7f050d..377a2551a 100644 --- a/Inventarios/RecepcionAlmacen.aspx.vb +++ b/Inventarios/RecepcionAlmacen.aspx.vb @@ -1897,83 +1897,91 @@ Partial Class Inventarios_RecepcionAlmacen End Sub - Private Function GeneraPrePolizaSalidaEntregaDirecta(CveMovimiento As Integer, ByRef ObjInventario As ClsInventarios, ByRef ObjConta As ClsContabilidad, ByRef ObjContaContPAQ As ClsContPAQi) As Boolean - Dim DtCostos As DataTable = Nothing - Dim ValorInventario As Decimal = 0 - Dim ValorInventarioME As Decimal = 0 - Dim CveConcepto As Integer = 3 - Dim Retorno As Boolean = True - - ObjInventario.GetMovimientos(CveMovimiento, -1, -1, UsuarioActual.CveEmpresa) - Dim CveVenta As Integer = ObjInventario.CveVenta - Dim CveAlmacen As Integer = ObjInventario.CveAlmacen - Dim SerieFolio As String = ObjInventario.DtResultados.Rows(0)("SerieFolioVenta").ToString - Dim MovAlmacen As Boolean = True - - Dim OrigenMov As Integer = GlobalDTInvConceptos.FiltroPrimeroValor("Origen", "CveConcepto = " & CveConcepto).ToEntero - If OrigenMov = 1 Then MovAlmacen = False Else MovAlmacen = True - - If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then - DtCostos = ObjInventario.DtResultados - Dim tmpCostos As DataTable = DtCostos.FiltraParametros("", "", {"CveClasificacion"}) - Dim IdCtaContable As Integer = 0 - Dim ConceptoPoliza As String = String.Format("{0}-{1}", "Salida de Almacen", SerieFolio) - - If tmpCostos.Rows.Count > 0 Then - Dim Concepto As String = ConceptoPoliza - Dim CvePrePoliza = ObjConta.AddPrePolizas("Inv_EntradaSalida", 74, DtCostos.SUM("Total"), DtCostos.SUM("Total"), 1, TxtFecha.Text.ToDate, ConceptoPoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) - Dim tCveSubProyecto = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen={CveAlmacen}").ToEntero - Dim tCveConcepto As Integer = 69 - - For Each RowInv As DataRow In tmpCostos.Rows - ValorInventario = DtCostos.SUM("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").ToString.ToDecimal.RoundSQL - If tCveConcepto = 69 Then - IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero - End If - - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, ValorInventario, Concepto, tCveConcepto, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveClasificacion:=RowInv("CveClasificacion").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=ValorInventario, CveSubProyecto:=tCveSubProyecto) Then - Retorno = False - Exit For - End If - Next - - IdCtaContable = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen={CveAlmacen}").ToEntero - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, MovAlmacen, DtCostos.SUMD("Total").RoundSQL, Concepto, 68, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=DtCostos.SUMD("Total").RoundSQL) Then - Retorno = False - End If - - - If ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, -1) Then - If ObjConta.ValorPolizaDescuadre > 0 Then - GuardaLogAD($"Inventarios/RecepcionAlmacen-PPCompOC | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas") - Retorno = False - End If - End If - - 'CONTABILIZAR - SIMPLIFICAR - If Retorno Then - If UsuarioActual.Empresa.Funcionalidad(220) <> "" Then - If Not ObjConta.PrePolizaSimplificacion(CvePrePoliza, UsuarioActual.CveEmpresa) Then - Retorno = False - End If - End If - - If UsuarioActual.Empresa.Funcionalidad(200) = "1" Then - If ObjContaContPAQ Is Nothing Then - ObjContaContPAQ = New ClsContPAQi(UsuarioActual.Empresa) - ObjContaContPAQ.IniciaTransacSQL() - End If - - If Not ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjContaContPAQ) Then - Retorno = False - End If - End If - - End If - - End If - End If - + Private Function GeneraPrePolizaSalidaEntregaDirecta(CveMovimiento As Integer, ByRef ObjInventario As ClsInventarios, ByRef ObjConta As ClsContabilidad, ByRef ObjContaContPAQ As ClsContPAQi) As Boolean + Dim Retorno As Boolean = True + Try + Dim DtCostos As DataTable = Nothing + Dim ValorInventario As Decimal = 0 + Dim ValorInventarioME As Decimal = 0 + Dim CveConcepto As Integer = 3 + + ObjInventario.GetMovimientos(CveMovimiento, -1, -1, UsuarioActual.CveEmpresa) + Dim CveVenta As Integer = ObjInventario.CveVenta + Dim CveAlmacen As Integer = ObjInventario.CveAlmacen + Dim SerieFolio As String = ObjInventario.DtResultados.Rows(0)("SerieFolioVenta").ToString + Dim MovAlmacen As Boolean = True + + Dim OrigenMov As Integer = GlobalDTInvConceptos.FiltroPrimeroValor("Origen", "CveConcepto = " & CveConcepto).ToEntero + If OrigenMov = 1 Then MovAlmacen = False Else MovAlmacen = True + + If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then + DtCostos = ObjInventario.DtResultados + Dim tmpCostos As DataTable = DtCostos.FiltraParametros("", "", {"CveClasificacion"}) + Dim IdCtaContable As Integer = 0 + Dim ConceptoPoliza As String = String.Format("{0}-{1}", "Salida de Almacen", SerieFolio) + + If tmpCostos.Rows.Count > 0 Then + Dim Concepto As String = ConceptoPoliza + Dim CvePrePoliza = ObjConta.AddPrePolizas("Inv_EntradaSalida", 74, DtCostos.SUM("Total"), DtCostos.SUM("Total"), 1, TxtFecha.Text.ToDate, ConceptoPoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + Dim tCveSubProyecto = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen={CveAlmacen}").ToEntero + Dim tCveConcepto As Integer = 69 + + For Each RowInv As DataRow In tmpCostos.Rows + ValorInventario = DtCostos.SUM("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").ToString.ToDecimal.RoundSQL + If tCveConcepto = 69 Then + IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero + End If + + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, ValorInventario, Concepto, tCveConcepto, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveClasificacion:=RowInv("CveClasificacion").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=ValorInventario, CveSubProyecto:=tCveSubProyecto) Then + Retorno = False + Exit For + End If + Next + + IdCtaContable = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen={CveAlmacen}").ToEntero + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, MovAlmacen, DtCostos.SUMD("Total").RoundSQL, Concepto, 68, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=DtCostos.SUMD("Total").RoundSQL) Then + Retorno = False + End If + + + If ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, -1) Then + If ObjConta.ValorPolizaDescuadre > 0 Then + GuardaLogAD($"Inventarios/RecepcionAlmacen-PPCompOC | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas") + Retorno = False + End If + End If + + 'CONTABILIZAR - SIMPLIFICAR + If Retorno Then + If UsuarioActual.Empresa.Funcionalidad(220) <> "" Then + If Not ObjConta.PrePolizaSimplificacion(CvePrePoliza, UsuarioActual.CveEmpresa) Then + Retorno = False + End If + End If + + If UsuarioActual.Empresa.Funcionalidad(200) = "1" Then + If ObjContaContPAQ Is Nothing Then + ObjContaContPAQ = New ClsContPAQi(UsuarioActual.Empresa) + ObjContaContPAQ.IniciaTransacSQL() + End If + + If Not ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjContaContPAQ) Then + Retorno = False + End If + End If + + End If + Else + Retorno = False + End If + Else + Retorno = False + End If + Catch ex As Exception + OnError("Ocurrió un error al guadar la prepoliza", ex) + Retorno = False + End Try + Return Retorno End Function diff --git a/Inventarios/RecepcionEntrega.aspx.vb b/Inventarios/RecepcionEntrega.aspx.vb index eb89b8e82..f291d9842 100644 --- a/Inventarios/RecepcionEntrega.aspx.vb +++ b/Inventarios/RecepcionEntrega.aspx.vb @@ -1465,8 +1465,6 @@ Partial Class Inventarios_RecepcionEntrega End If - - 'VALIDA CANTIDAD DE SALIDA Dim Cantidad As Decimal = 0.0D For Each Gvr As GridViewRow In GvDatos.Rows @@ -1630,7 +1628,7 @@ Partial Class Inventarios_RecepcionEntrega 'Exit Sub Dim TieneErrorExistencia = False - If ObjInventario.GetExistenciasPSXML(StrXML.ToString(), DdlAlmacen.SelectedValue.ToEntero, TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), CveSubProyecto, CveVendedor, If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then + If ObjInventario.GetExistenciasPSXML(StrXML.ToString(), DdlAlmacen.SelectedValue.ToEntero, TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), CveSubProyecto, CveVendedor, If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), If(TipoEntrega = 2, 1, -1), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then If ObjInventario.DtResultados.Rows.Count > 0 Then TieneErrorExistencia = True For Each Dr As DataRow In ObjInventario.DtResultados.Rows @@ -2214,122 +2212,123 @@ Partial Class Inventarios_RecepcionEntrega End If End If End If - + ' SE REALIZARA AL MOMENTO DE CANCELAR LA FACTURA { 'DEVOLUCION REMISION - REGRESA LAS EXISTENCIAS A ENTREGA POR ADELANTADO SI LA FACTURA VIENE DE REMISION - If Not ErrorMovInv And EsDevolucionVenta = 1 And TipoDocto = "Ing" Then - Dim DtDevRem As New DataTable - Dim DtMovtosDev As New DataTable - Dim CveAlmacenTraspasoDestinoDevRem = -1 - Dim CveVentaDetalleRem = -1 - Dim CantidadDevolver As Decimal = 0 - Dim CantidadRem As Decimal = 0 + 'If Not ErrorMovInv And EsDevolucionVenta = 1 And TipoDocto = "Ing" Then + ' Dim DtDevRem As New DataTable + ' Dim DtMovtosDev As New DataTable + ' Dim CveAlmacenTraspasoDestinoDevRem = -1 - 'CARGA REMISIONES DE LA VENTA DEVUELTA - If ObjInventario.GetDevolucionRemisionesFacturadas(CveVentaSurtir) Then - DtDevRem = ObjInventario.DtResultados.FiltraParametros("CantidadAlmacen > 0") - Else - ErrorMovInv = True - End If + ' Dim CveVentaDetalleRem = -1 + ' Dim CantidadDevolver As Decimal = 0 + ' Dim CantidadRem As Decimal = 0 - 'CARGA CONCEPTOS DEVUELTOS EN LA VENTA - If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then - DtMovtosDev = ObjInventario.DtResultados - Else - ErrorMovInv = True - End If + ' 'CARGA REMISIONES DE LA VENTA DEVUELTA + ' If ObjInventario.GetDevolucionRemisionesFacturadas(CveVentaSurtir) Then + ' DtDevRem = ObjInventario.DtResultados.FiltraParametros("CantidadAlmacen > 0") + ' Else + ' ErrorMovInv = True + ' End If - If Not ErrorMovInv Then - If DtDevRem.Rows.Count > 0 And DtMovtosDev.Rows.Count > 0 Then + ' 'CARGA CONCEPTOS DEVUELTOS EN LA VENTA + ' If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then + ' DtMovtosDev = ObjInventario.DtResultados + ' Else + ' ErrorMovInv = True + ' End If - For Each DrMovtos As DataRow In DtDevRem.FiltraParametros("", "CveRem", {"CveRem", "CveAlmacenTraspasoDestino"}).Rows - CveAlmacenTraspasoDestinoDevRem = DrMovtos("CveAlmacenTraspasoDestino").ToString.ToEntero - If Not CveAlmacenTraspasoDestinoDevRem > 0 Then - ErrorMovInv = True - TextoError = "Ocurrió un error al obtener el almacén de devolucion de remisión." - Exit For - End If + ' If Not ErrorMovInv Then + ' If DtDevRem.Rows.Count > 0 And DtMovtosDev.Rows.Count > 0 Then - 'SALIDA GENERAL - CveMovimientoSalidaDevRem = ObjInventario.AddMovimiento(DdlAlmacen.SelectedValue.ToEntero, 8, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Guia:=TxtGuia.Text, CveContrato:=CveContrato, CveMovimientoRelacionado:=CveMovimiento, CveAlmacenDestino:=CveAlmacenTraspasoDestinoDevRem) - FolioMovimientoSalidaDevRem = ObjInventario.Folio + ' For Each DrMovtos As DataRow In DtDevRem.FiltraParametros("", "CveRem", {"CveRem", "CveAlmacenTraspasoDestino"}).Rows + ' CveAlmacenTraspasoDestinoDevRem = DrMovtos("CveAlmacenTraspasoDestino").ToString.ToEntero + ' If Not CveAlmacenTraspasoDestinoDevRem > 0 Then + ' ErrorMovInv = True + ' TextoError = "Ocurrió un error al obtener el almacén de devolucion de remisión." + ' Exit For + ' End If - 'ENTRADA ADELANTADO - CveMovimientoEntradaDevRem = ObjInventario.AddMovimiento(CveAlmacenTraspasoDestinoDevRem, 9, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Guia:=TxtGuia.Text, CveContrato:=CveContrato, CveMovimientoRelacionado:=CveMovimientoSalidaDevRem, CveAlmacenDestino:=DdlAlmacen.SelectedValue.ToEntero) - FolioMovimientoEntradaDevRem = ObjInventario.Folio + ' 'SALIDA GENERAL + ' CveMovimientoSalidaDevRem = ObjInventario.AddMovimiento(DdlAlmacen.SelectedValue.ToEntero, 8, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Guia:=TxtGuia.Text, CveContrato:=CveContrato, CveMovimientoRelacionado:=CveMovimiento, CveAlmacenDestino:=CveAlmacenTraspasoDestinoDevRem) + ' FolioMovimientoSalidaDevRem = ObjInventario.Folio - If Not (CveMovimientoSalidaDevRem > 0 And CveMovimientoEntradaDevRem > 0) Then - ErrorMovInv = True - TextoError = "Ocurrió un error al generar los movimientos de devolución a remisión." - Exit For - End If + ' 'ENTRADA ADELANTADO + ' CveMovimientoEntradaDevRem = ObjInventario.AddMovimiento(CveAlmacenTraspasoDestinoDevRem, 9, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Guia:=TxtGuia.Text, CveContrato:=CveContrato, CveMovimientoRelacionado:=CveMovimientoSalidaDevRem, CveAlmacenDestino:=DdlAlmacen.SelectedValue.ToEntero) + ' FolioMovimientoEntradaDevRem = ObjInventario.Folio + + ' If Not (CveMovimientoSalidaDevRem > 0 And CveMovimientoEntradaDevRem > 0) Then + ' ErrorMovInv = True + ' TextoError = "Ocurrió un error al generar los movimientos de devolución a remisión." + ' Exit For + ' End If - 'SALIDA POR TRAPASO DE GENERAL - For Each DrRem As DataRow In DtDevRem.FiltraParametros($"CveRem = {DrMovtos("CveRem")}").Rows - CveVentaDetalleRem = DrRem("CveVentaDetalleRem").ToString.ToEntero - CantidadRem = DrRem("CantidadFacturada").ToString.ToDecimal - 'CantidadDevolver = DtMovtosDev.FiltroPrimeroValor("Cantidad", $"CveVentaDetalle = {DrRem("CveVentaDetalle").ToString.ToEntero}").ToDouble - 'If (Dr("Cantidad").ToString.ToDouble > CantidadRem, CantidadRem, Dr("Cantidad").ToString.ToDouble) Then + ' 'SALIDA POR TRAPASO DE GENERAL + ' For Each DrRem As DataRow In DtDevRem.FiltraParametros($"CveRem = {DrMovtos("CveRem")}").Rows + ' CveVentaDetalleRem = DrRem("CveVentaDetalleRem").ToString.ToEntero + ' CantidadRem = DrRem("CantidadFacturada").ToString.ToDecimal + ' 'CantidadDevolver = DtMovtosDev.FiltroPrimeroValor("Cantidad", $"CveVentaDetalle = {DrRem("CveVentaDetalle").ToString.ToEntero}").ToDouble + ' 'If (Dr("Cantidad").ToString.ToDouble > CantidadRem, CantidadRem, Dr("Cantidad").ToString.ToDouble) Then - If Not CveVentaDetalleRem > 0 Then - ErrorMovInv = True - TextoError = "Ocurrió un error al obtener la relación de la venta con la remisión." - Exit For - End If + ' If Not CveVentaDetalleRem > 0 Then + ' ErrorMovInv = True + ' TextoError = "Ocurrió un error al obtener la relación de la venta con la remisión." + ' Exit For + ' End If - For Each Dr As DataRow In DtMovtosDev.FiltraParametros($"CveVentaDetalle = {DrRem("CveVentaDetalle").ToString.ToEntero}").Rows - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaDevRem, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDouble, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveVentaDetalle:=CveVentaDetalleRem, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString) Then - ErrorMovInv = True - TextoError = "Ocurrió un error al guardar los movimientos de salida de traspaso de devolucion de remisión." - Exit For - End If - Next + ' For Each Dr As DataRow In DtMovtosDev.FiltraParametros($"CveVentaDetalle = {DrRem("CveVentaDetalle").ToString.ToEntero}").Rows + ' If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaDevRem, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDouble, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveVentaDetalle:=CveVentaDetalleRem, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString) Then + ' ErrorMovInv = True + ' TextoError = "Ocurrió un error al guardar los movimientos de salida de traspaso de devolucion de remisión." + ' Exit For + ' End If + ' Next - If ErrorMovInv Then - Exit For - End If - Next + ' If ErrorMovInv Then + ' Exit For + ' End If + ' Next - If ErrorMovInv Then - Exit For - End If + ' If ErrorMovInv Then + ' Exit For + ' End If - 'ENTRADA POR TRAPASO A ENTREGA POR ADELANTADO - If ObjInventario.GetMovimientosDetalle(CveMovimientoSalidaDevRem, UsuarioActual.CveEmpresa) Then - For Each Dr As DataRow In ObjInventario.DtResultados.Rows - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaDevRem, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString) Then - ErrorMovInv = True - TextoError = "Ocurrió un error al guardar los movimientos de entrada de traspaso de devolucion de remisión." - Exit For - End If - Next + ' 'ENTRADA POR TRAPASO A ENTREGA POR ADELANTADO + ' If ObjInventario.GetMovimientosDetalle(CveMovimientoSalidaDevRem, UsuarioActual.CveEmpresa) Then + ' For Each Dr As DataRow In ObjInventario.DtResultados.Rows + ' If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaDevRem, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString) Then + ' ErrorMovInv = True + ' TextoError = "Ocurrió un error al guardar los movimientos de entrada de traspaso de devolucion de remisión." + ' Exit For + ' End If + ' Next - If ErrorMovInv Then - Exit For - End If + ' If ErrorMovInv Then + ' Exit For + ' End If - Else - ErrorMovInv = True - TextoError = "Ocurrió un error al obtener los detalles de la devolución de almacén" - Exit For - End If + ' Else + ' ErrorMovInv = True + ' TextoError = "Ocurrió un error al obtener los detalles de la devolución de almacén" + ' Exit For + ' End If - If Not ObjVentas.UpdateVentasDevolucionAlmacen(0, DrMovtos("CveRem").ToString.ToEntero) Then - TextoError = "Ocurrió un error al hacer la devolucion hacia la remision. Por favor vuelva a intentar." - ErrorMovInv = True - Exit For - End If + ' If Not ObjVentas.UpdateVentasDevolucionAlmacen(0, DrMovtos("CveRem").ToString.ToEntero) Then + ' TextoError = "Ocurrió un error al hacer la devolucion hacia la remision. Por favor vuelva a intentar." + ' ErrorMovInv = True + ' Exit For + ' End If - Next - End If - Else - TextoError = "Ocurrió un error al hacer la devolucion a remisión. Por favor vuelva a intentar." - ErrorMovInv = True - End If - - End If + ' Next + ' End If + ' Else + ' TextoError = "Ocurrió un error al hacer la devolucion a remisión. Por favor vuelva a intentar." + ' ErrorMovInv = True + ' End If + 'End If + '} 'QUEMA DEVOLUCION | QUEMA = LA QUITA DE PENDIENTE POR RECIBIR (DEVOLVER) If Not ErrorMovInv And EsDevolucionVenta = 1 Then @@ -2521,7 +2520,7 @@ Partial Class Inventarios_RecepcionEntrega StrXML.Append("") Dim TieneErrorExistencia = False - If ObjInventario.GetExistenciasPSXML(StrXML.ToString(), DdlAlmacen.SelectedValue.ToEntero, TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), CveSubProyecto, CveVendedor, If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), 1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then + If ObjInventario.GetExistenciasPSXML(StrXML.ToString(), DdlAlmacen.SelectedValue.ToEntero, TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), CveSubProyecto, CveVendedor, If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), If(TipoEntrega = 2, 1, -1), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then If ObjInventario.DtResultados.Rows.Count > 0 Then TieneErrorExistencia = True For Each Dr As DataRow In ObjInventario.DtResultados.Rows diff --git a/Inventarios/RecepcionUsados.aspx b/Inventarios/RecepcionUsados.aspx index 85275e53c..cd25a6832 100644 --- a/Inventarios/RecepcionUsados.aspx +++ b/Inventarios/RecepcionUsados.aspx @@ -65,9 +65,9 @@
  • Traspaso Almacen
  • - <%--
  • - + <%--
  • +
  • --%>
  • Ver PrePóliza @@ -94,7 +94,7 @@
  • - Información del movimiento + Información del movimiento
    @@ -120,11 +120,11 @@ - <%-- -
    - - - + <%-- +
    + + +
    --%>
    @@ -148,7 +148,13 @@ - +
    + +
    + + +
    +
    @@ -292,7 +298,7 @@
    -   +   Sucursal: @@ -341,7 +347,7 @@ ">
    - Agregar Producto + Agregar Producto
    @@ -408,14 +414,14 @@
    - Información de registro + Información de registro
    @@ -425,7 +431,7 @@
    @@ -434,7 +440,7 @@
    @@ -447,7 +453,7 @@
    @@ -457,7 +463,7 @@
    @@ -466,7 +472,7 @@
    @@ -484,7 +490,7 @@
    - Tipo de Cambio + Tipo de Cambio
    @@ -551,9 +557,6 @@ - - - - - - @@ -591,12 +591,16 @@ - - + + + + + + @@ -606,13 +610,22 @@ - - +
    +
    +
    +
    + $ + +
    + +
    +
    +
    +

    -
    @@ -622,10 +635,8 @@ -

    -

    @@ -636,14 +647,9 @@

    -
    - -
    - - <%-- EMPIEZA: BITACORA --%> @@ -685,9 +691,7 @@
    -
    - - <%-- TERMINA: BITACORA --%> @@ -735,7 +738,6 @@ -