-- corrección del cambio anterior

This commit is contained in:
2023-06-19 11:07:35 -07:00
parent 06fa4ff055
commit adbd4bb959
2 changed files with 31 additions and 308 deletions

View File

@@ -582,13 +582,13 @@
<asp:CheckBox ID="ChkSubTotal" runat="server" Text="SubTotal" Checked="true" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkDescuento" runat="server" Text="Descuento" Checked="true" /></td>
<asp:CheckBox ID="ChkDescuento" runat="server" Text="Descuento" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChlMotivoDescuento" runat="server" Text="Motivo Descuento" /></td>
</tr>
<tr>
<td style="text-align: left;">
<asp:CheckBox ID="ChkAmortizacion" runat="server" Text="Amortización" Checked="true" /></td>
<asp:CheckBox ID="ChkAmortizacion" runat="server" Text="Amortización" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkIVA" runat="server" Text="IVA" Checked="true" /></td>

View File

@@ -114,8 +114,6 @@ Partial Class RepVentaDetalle
DVServicioDomicilio.Visible = True
End If
End If
End Sub
@@ -452,6 +450,7 @@ Partial Class RepVentaDetalle
If Not UsuarioActual.Empresa.MostrarRetISR Then GvDatos.Columns(11).Visible = False
ChkIEPS.Checked = UsuarioActual.Empresa.Funcionalidad(713) = "1" 'empresa deduce IEPS
GvDatos.Columns(9).Visible = ChkIEPS.Checked
End Sub
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
@@ -482,24 +481,6 @@ Partial Class RepVentaDetalle
e.Row.FCLiteral("LtlFacturaCotizacion").Text = "<a class=""Texto"" href=""/Ventas/Ventas.aspx?CveVenta=" & e.Row.DBCampo("CveVentaPadre") & """>" & e.Row.DBCampo("FolioVenta") & "</a>"
End If
'e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Center
'e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Center
'e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Center
'e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Left
'e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Right
'e.Row.Cells(5).HorizontalAlign = HorizontalAlign.Right
'e.Row.Cells(6).HorizontalAlign = HorizontalAlign.Right
'e.Row.Cells(7).HorizontalAlign = HorizontalAlign.Right
'e.Row.Cells(8).HorizontalAlign = HorizontalAlign.Right
'e.Row.Cells(9).HorizontalAlign = HorizontalAlign.Right
'e.Row.Cells(10).HorizontalAlign = HorizontalAlign.Right
'e.Row.Cells(11).HorizontalAlign = HorizontalAlign.Right
'e.Row.Cells(12).HorizontalAlign = HorizontalAlign.Center
'e.Row.Cells(13).HorizontalAlign = HorizontalAlign.Left
'e.Row.Cells(14).HorizontalAlign = HorizontalAlign.Center
'e.Row.Cells(15).HorizontalAlign = HorizontalAlign.Center
'e.Row.Cells(20).HorizontalAlign = HorizontalAlign.Left
If e.Row.DBCampo("SubTotal").ToDouble = 0 Then e.Row.FCLiteral("LtlSubTotal").Text = "-"
If e.Row.DBCampo("Descuento").ToDouble = 0 Then e.Row.FCLiteral("LtlDescuento").Text = "-"
@@ -550,178 +531,38 @@ Partial Class RepVentaDetalle
Protected Sub BtnPersonalizar_Click(sender As Object, e As System.EventArgs) Handles BtnPersonalizar.Click
If ChkFolio.Checked Then
GvDatos.Columns(1).Visible = True
Else
GvDatos.Columns(1).Visible = False
End If
If ChkFecha.Checked Then
GvDatos.Columns(2).Visible = True
Else
GvDatos.Columns(2).Visible = False
End If
If ChkCliente.Checked Then
GvDatos.Columns(3).Visible = True
Else
GvDatos.Columns(3).Visible = False
End If
If ChkSubTotal.Checked Then
GvDatos.Columns(4).Visible = True
Else
GvDatos.Columns(4).Visible = False
End If
If ChkDescuento.Checked Then
GvDatos.Columns(5).Visible = True
Else
GvDatos.Columns(5).Visible = False
End If
If ChlMotivoDescuento.Checked Then
GvDatos.Columns(6).Visible = True
Else
GvDatos.Columns(6).Visible = False
End If
If ChkAmortizacion.Checked Then
GvDatos.Columns(7).Visible = True
Else
GvDatos.Columns(7).Visible = False
End If
If ChkIVA.Checked Then
GvDatos.Columns(8).Visible = True
Else
GvDatos.Columns(8).Visible = False
End If
If ChkIEPS.Checked Then
GvDatos.Columns(9).Visible = True
Else
GvDatos.Columns(9).Visible = False
End If
If ChkRetIVA.Checked Then
GvDatos.Columns(10).Visible = True
Else
GvDatos.Columns(10).Visible = False
End If
If ChkRetISR.Checked Then
GvDatos.Columns(11).Visible = True
Else
GvDatos.Columns(11).Visible = False
End If
If ChkTotalImpuestos.Checked Then
GvDatos.Columns(12).Visible = True
Else
GvDatos.Columns(12).Visible = False
End If
If ChkTotal.Checked Then
GvDatos.Columns(13).Visible = True
Else
GvDatos.Columns(13).Visible = False
End If
GvDatos.Columns(1).Visible = ChkFolio.Checked
GvDatos.Columns(2).Visible = ChkFecha.Checked
GvDatos.Columns(3).Visible = ChkCliente.Checked
GvDatos.Columns(4).Visible = ChkSubTotal.Checked
GvDatos.Columns(5).Visible = ChkDescuento.Checked
GvDatos.Columns(6).Visible = ChlMotivoDescuento.Checked
GvDatos.Columns(7).Visible = ChkAmortizacion.Checked
GvDatos.Columns(8).Visible = ChkIVA.Checked
GvDatos.Columns(9).Visible = ChkIEPS.Checked
GvDatos.Columns(10).Visible = ChkRetIVA.Checked
GvDatos.Columns(11).Visible = ChkRetISR.Checked
GvDatos.Columns(12).Visible = ChkTotalImpuestos.Checked
GvDatos.Columns(13).Visible = ChkTotal.Checked
GvDatos.Columns(14).Visible = ChkMoneda.Checked
If ChkSucursal.Checked Then
GvDatos.Columns(15).Visible = True
Else
GvDatos.Columns(15).Visible = False
End If
If ChkSucursalEjecucion.Checked Then
GvDatos.Columns(16).Visible = True
Else
GvDatos.Columns(16).Visible = False
End If
If ChkCodigo.Checked Then
GvDatos.Columns(17).Visible = True
Else
GvDatos.Columns(17).Visible = False
End If
If ChkSucursalCliente.Checked Then
GvDatos.Columns(18).Visible = True
Else
GvDatos.Columns(18).Visible = False
End If
If ChkSucursalCobranza.Checked Then
GvDatos.Columns(19).Visible = True
Else
GvDatos.Columns(19).Visible = False
End If
If ChkSucursalEjecucion.Checked Then
GvDatos.Columns(20).Visible = True
Else
GvDatos.Columns(20).Visible = False
End If
If ChkVendedor.Checked Then
GvDatos.Columns(21).Visible = True
Else
GvDatos.Columns(21).Visible = False
End If
If ChkEstatusFactura.Checked Then
GvDatos.Columns(22).Visible = True
Else
GvDatos.Columns(22).Visible = False
End If
If ChkMotivoCancelacion.Checked Then
GvDatos.Columns(23).Visible = True
Else
GvDatos.Columns(23).Visible = False
End If
If ChkSeTimbro.Checked Then
GvDatos.Columns(24).Visible = True
Else
GvDatos.Columns(24).Visible = False
End If
If ChkSeEnvioMail.Checked Then
GvDatos.Columns(25).Visible = True
Else
GvDatos.Columns(25).Visible = False
End If
If ChkCuentaContable.Checked Then
GvDatos.Columns(26).Visible = True
Else
GvDatos.Columns(26).Visible = False
End If
If ChkUsuario.Checked Then
GvDatos.Columns(27).Visible = True
Else
GvDatos.Columns(27).Visible = False
End If
If ChkObservaciones.Checked Then
GvDatos.Columns(28).Visible = True
Else
GvDatos.Columns(28).Visible = False
End If
GvDatos.Columns(15).Visible = ChkSucursal.Checked
GvDatos.Columns(16).Visible = ChkSucursalEjecucion.Checked
GvDatos.Columns(17).Visible = ChkCodigo.Checked
GvDatos.Columns(18).Visible = ChkSucursalCliente.Checked
GvDatos.Columns(19).Visible = ChkSucursalCobranza.Checked
GvDatos.Columns(20).Visible = ChkSucursalEjecucion.Checked
GvDatos.Columns(21).Visible = ChkVendedor.Checked
GvDatos.Columns(22).Visible = ChkEstatusFactura.Checked
GvDatos.Columns(23).Visible = ChkMotivoCancelacion.Checked
GvDatos.Columns(24).Visible = ChkSeTimbro.Checked
GvDatos.Columns(25).Visible = ChkSeEnvioMail.Checked
GvDatos.Columns(26).Visible = ChkCuentaContable.Checked
GvDatos.Columns(27).Visible = ChkUsuario.Checked
GvDatos.Columns(28).Visible = ChkObservaciones.Checked
GvDatos.Columns(29).Visible = ChkFolioFiscal.Checked
GvDatos.Columns(30).Visible = ChkMailCliente.Checked
GvDatos.Columns(31).Visible = True = ChkEstatusFacturacion.Checked
GvDatos.Columns(31).Visible = ChkEstatusFacturacion.Checked
GvDatos.Columns(32).Visible = ChkFolioFacturacion.Checked
GvDatos.Columns(33).Visible = ChkSaldo.Checked
Personalizo = 1
@@ -966,124 +807,6 @@ Partial Class RepVentaDetalle
Private Function GenerarFacturaVentaDEV(CveVenta As Integer, CveUsuario As Integer) As Byte()
Return DescargarFactura(CveVenta, UsuarioActual.CveEmpresa, CveUsuario)
'Dim ObjVentas As New ClsVentas
'Dim Vta As Modelos.Factura = Nothing
'Dim TmpDTImpuestos = New DataTable
'TmpDTImpuestos.Columns.Add("ImpuestoLocal", GetType(String))
'TmpDTImpuestos.Columns.Add("Importe", GetType(Double))
'TmpDTImpuestos.Columns.Add("Orden", GetType(Integer))
'If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then
' Dim dtVentas As DataTable = ObjVentas.DtResultados
' ' se rellenan los campos de la factura
' Vta = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, Server.MapPath("/"))
' Vta.MonedaAbreviatura = dtVentas(0)("Abreviatura").ToString
' 'se rellena la sucursal
' Vta.Cliente.Sucursal = New Modelos.ClienteModel(dtVentas(0)("CveCliente").ToString.ToEntero, UsuarioActual.CveEmpresa)
' Vta.Cliente = New Modelos.ClienteModel
' Vta.Cliente.Nombre = dtVentas(0)("ClienteNombre").ToString
' Vta.Cliente.Telefono = dtVentas(0)("Telefono").ToString
' Vta.Cliente.Direccion = dtVentas(0)("ClienteDireccion").ToString
' Vta.Cliente.CP = dtVentas(0)("CPCliente").ToString
' Vta.Cliente.Ciudad = dtVentas(0)("ClienteCiudad").ToString
' Vta.Cliente.Localidad = dtVentas(0)("ClienteLocalidad").ToString
' Vta.Cliente.Estado = dtVentas(0)("ClienteEstado").ToString
' Vta.Cliente.Pais = dtVentas(0)("ClientePais").ToString
' Vta.Cliente.RFC = dtVentas(0)("ClienteRFC").ToString
' Vta.Cliente.Colonia = dtVentas(0)("ColoniaCliente").ToString
' Vta.AtencionA = dtVentas(0)("AtencionA").ToString
' Vta.Cliente.NoExt = dtVentas(0)("ClienteNoExt").ToString
' Vta.Cliente.NoInt = dtVentas(0)("ClienteNoInt").ToString
' Vta.Cliente.Codigo = dtVentas(0)("ClienteCodigo").ToString
' Vta.Cliente.Mail = dtVentas(0)("Mail").ToString
' Vta.RefDocto = dtVentas(0)("Ref").ToString
' Vta.CveVenta = dtVentas(0)("CveVenta").ToString.ToEntero
' Vta.ClienteSucursal = New Modelos.SucursalModel
' Vta.ClienteSucursal.Direccion = dtVentas(0)("SucClienteDireccion").ToString
' Vta.ClienteSucursal.NoExt = dtVentas(0)("SucClienteNoExt").ToString
' Vta.ClienteSucursal.NoInt = dtVentas(0)("SucClienteNoInt").ToString
' Vta.ClienteSucursal.Colonia = dtVentas(0)("SucClienteColonia").ToString
' Vta.ClienteSucursal.CP = dtVentas(0)("SucClienteCP").ToString
' Vta.ClienteSucursal.Municipio = dtVentas(0)("SucClienteCiudad").ToString
' Vta.ClienteSucursal.Estado = dtVentas(0)("SucClienteEstado").ToString
' Vta.ClienteSucursal.Pais = dtVentas(0)("SucClientePais").ToString
' Vta.ClienteSucursal.Localidad = dtVentas(0)("SucClienteLocalidad").ToString
' Vta.ClienteSucursal.CorreoSucursal = dtVentas(0)("SucClienteCorreo").ToString
' Vta.ClienteSucursal.TelefonoSucursal = dtVentas(0)("SucClienteTelefono").ToString
' Vta.ClienteSucursal.Sucursal = dtVentas(0)("SucursalCliente").ToString
' Vta.EnviarA = New Modelos.EnviarAModel
' Vta.EnviarA.CveDireccionEnvio = dtVentas(0)("CveDireccionEnvio").ToString.ToEntero
' Vta.EnviarA.EnvioDireccion = dtVentas(0)("EnvioDireccion").ToString
' Vta.EnviarA.EnvioColonia = dtVentas(0)("EnvioColonia").ToString
' Vta.EnviarA.EnvioCiudad = dtVentas(0)("EnvioCiudad").ToString
' Vta.EnviarA.EnvioEstado = dtVentas(0)("EnvioEstado").ToString
' Vta.EnviarA.EnvioCP = dtVentas(0)("EnvioCP").ToString
' Dim DR As DataRow = TmpDTImpuestos.NewRow()
' If UsuarioActual.CveEmpresa.Contiene(1, 5, 15, 17, 72, 66, 79, 81, 109, 110, 111, 76) Then
' If dtVentas(0)("SubTotal").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Subtotal" : DR("Importe") = dtVentas(0)("SubTotal").ToString.ToDouble : DR("Orden") = 10 : TmpDTImpuestos.Rows.Add(DR)
' DR = TmpDTImpuestos.NewRow()
' If dtVentas(0)("Descuento").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Descuentos" : DR("Importe") = dtVentas(0)("Descuento").ToString.ToDouble : DR("Orden") = 20 : TmpDTImpuestos.Rows.Add(DR)
' DR = TmpDTImpuestos.NewRow()
' If dtVentas(0)("Amortizacion").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Amort.Ant" : DR("Importe") = dtVentas(0)("Amortizacion").ToString.ToDouble : DR("Orden") = 30 : TmpDTImpuestos.Rows.Add(DR)
' DR = TmpDTImpuestos.NewRow()
' If dtVentas(0)("SubTotal").ToString.ToDouble <> (dtVentas(0)("SubTotal").ToString.ToDouble - dtVentas(0)("Descuento").ToString.ToDouble - dtVentas(0)("Amortizacion").ToString.ToDouble) Then DR("ImpuestoLocal") = "SubTotal2" : DR("Importe") = (dtVentas(0)("SubTotal").ToString.ToDouble - dtVentas(0)("Descuento").ToString.ToDouble - dtVentas(0)("Amortizacion").ToString.ToDouble) : DR("Orden") = 40 : TmpDTImpuestos.Rows.Add(DR)
' DR = TmpDTImpuestos.NewRow()
' If dtVentas(0)("IVA").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "IVA" : DR("Importe") = dtVentas(0)("IVA").ToString.ToDouble : DR("Orden") = 50 : TmpDTImpuestos.Rows.Add(DR)
' 'solo para eclipse, que muesre un subtotal debajo de IVA
' If UsuarioActual.CveEmpresa = 15 Then DR = TmpDTImpuestos.NewRow() : DR("ImpuestoLocal") = "Subtotal2" : DR("Importe") = (dtVentas(0)("SubTotal").ToString.ToDouble - dtVentas(0)("Descuento").ToString.ToDouble - dtVentas(0)("Amortizacion").ToString.ToDouble) + dtVentas(0)("IVA").ToString.ToDouble : DR("Orden") = 51 : TmpDTImpuestos.Rows.Add(DR)
' DR = TmpDTImpuestos.NewRow()
' If dtVentas(0)("RetIVA").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Ret.IVA" : DR("Importe") = dtVentas(0)("RetIVA").ToString.ToDouble : DR("Orden") = 60 : TmpDTImpuestos.Rows.Add(DR)
' DR = TmpDTImpuestos.NewRow()
' If dtVentas(0)("RetISR").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Ret.ISR" : DR("Importe") = dtVentas(0)("RetISR").ToString.ToDouble : DR("Orden") = 70 : TmpDTImpuestos.Rows.Add(DR)
' DR = TmpDTImpuestos.NewRow()
' If dtVentas(0)("Total").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Total" : DR("Importe") = dtVentas(0)("Total").ToString.ToDouble : DR("Orden") = 1000 : TmpDTImpuestos.Rows.Add(DR)
' DR = TmpDTImpuestos.NewRow()
' End If
' If ObjVentas.GetVentaDetalle(CveVenta) Then 'Obtenemos el Detalle de la Oorden de Compra
' Vta.DtDetalle = ObjVentas.DtResultados
' End If
' If ObjVentas.GetVentaImpuestosLocales(CveVenta) Then
' If UsuarioActual.CveEmpresa.Contiene(1, 5, 15, 17, 72, 66, 79, 81, 109, 110, 111, 76) Then
' Dim dtImpuesto As DataTable = ObjVentas.DtResultados
' If dtImpuesto.Rows.Count > 0 Then
' For Each Row As DataRow In dtImpuesto.Rows
' Dim Orden = 80
' If Row("Importe").ToString.ToDouble <> 0 Then
' DR("ImpuestoLocal") = Row("ImpuestoLocal").ToString
' DR("Importe") = Row("Importe").ToString.ToDouble
' DR("Orden") = Orden
' TmpDTImpuestos.Rows.Add(DR)
' DR = TmpDTImpuestos.NewRow()
' Orden = Orden + 1
' End If
' Next
' End If
' Vta.DtDeduccion = TmpDTImpuestos.FiltraParametros("", Orderby:="Orden ASC")
' Else
' Vta.DtDeduccion = ObjVentas.DtResultados
' End If
' End If
' If ObjVentas.GetVentasFirmas(CveVenta) Then
' Vta.DtFirmas = ObjVentas.DtResultados
' End If
'End If
'ObjVentas.Dispose()
'If Not IsNothing(Vta) Then
' PdfFactura(Vta)
' Vta = Nothing
'End If
End Function