This commit is contained in:
2021-01-22 12:58:35 -07:00
40 changed files with 2730 additions and 1163 deletions

View File

@@ -1888,6 +1888,7 @@
<asp:ListItem Selected="True" Value="NC" Text="NC"></asp:ListItem>
<asp:ListItem Selected="True" Value="IxC" Text="Ingresos X Comp"></asp:ListItem>
<asp:ListItem Selected="True" Value="Dev" Text="Devolución"></asp:ListItem>
<asp:ListItem Selected="True" Value="RNC" Text="Remisión de Nota de crédito"></asp:ListItem>
</asp:ListBox>
<%-- <asp:DropDownList CssClass="form-control input-sm" ID="DdlTipoDocto" runat="server" Width="120px">
<asp:ListItem Selected="True" Value="-1" Text="Todos" />

View File

@@ -3825,7 +3825,7 @@ Partial Class Clientes
Protected Sub ChkAntIXCNC_CheckedChanged(sender As Object, e As EventArgs)
DdlTipoDocto.ClearSelection()
If ChkAntIXCNC.Checked Then
DdlTipoDocto.SelectedValuesIfExistM("Ing,Rem,Ant,Egs,IxC")
DdlTipoDocto.SelectedValuesIfExistM("Ing,Rem,Ant,Egs,IxC,RNC")
Else
DdlTipoDocto.SelectedValuesIfExistM("Ing,Rem")
End If
@@ -3907,7 +3907,7 @@ Partial Class Clientes
Dim dtt As DataTable = Nothing
If ObjMovtos.GetAnticiposNCIxCCliente(CveCliente, -1, -1) Then
dtt = If(DdlTipoCuentasCxC.SelectedValue = "-1", ObjMovtos.DtResultados.FiltraParametros("SaldoVentaAnticipo = 0 AND ((Tipo = 'IxC' AND CveIE > 0) OR (Tipo = 'Ant' AND CveVenta > 0) OR (Tipo = 'NC' AND CveVenta > 0) OR (Tipo = 'Egs' AND CveVenta > 0) )"), ObjMovtos.DtResultados.FiltraParametros("Saldo > 0 AND SaldoVentaAnticipo = 0 AND ((Tipo = 'IxC' AND CveIE > 0) OR (Tipo = 'Ant' AND CveVenta > 0) OR (Tipo = 'NC' AND CveVenta > 0) OR (Tipo = 'Egs' AND CveVenta > 0) )")) ' que tenga saldo de anticipo y no de cliente
dtt = If(DdlTipoCuentasCxC.SelectedValue = "-1", ObjMovtos.DtResultados.FiltraParametros("SaldoVentaAnticipo = 0 AND ((Tipo = 'IxC' AND CveIE > 0) OR (Tipo = 'Ant' AND CveVenta > 0) OR (Tipo = 'NC' AND CveVenta > 0) OR (Tipo = 'Egs' AND CveVenta > 0) OR (Tipo = 'RNC' AND CveVenta > 0) )"), ObjMovtos.DtResultados.FiltraParametros("Saldo > 0 AND SaldoVentaAnticipo = 0 AND ((Tipo = 'IxC' AND CveIE > 0) OR (Tipo = 'Ant' AND CveVenta > 0) OR (Tipo = 'NC' AND CveVenta > 0) OR (Tipo = 'Egs' AND CveVenta > 0) OR (Tipo = 'RNC' AND CveVenta > 0) )")) ' que tenga saldo de anticipo y no de cliente
If dtt IsNot Nothing AndAlso dtt.Rows.Count > 0 Then
For Each drt As DataRow In dtt.Rows
Dim drr As DataRow = DtCxCFact.NewRow
@@ -3942,7 +3942,7 @@ Partial Class Clientes
SaldoIngDolaresPesos = SaldoIngDolaresPesos + (Row("Saldo").ToString.ToDouble * Row("TipoCambio").ToString.ToDouble)
End If
ElseIf (Row("TipoDocto").ToString = "Ant" And Row("Saldo").ToString.ToDouble = 0) Or Row("TipoDocto").ToString = "IxC" Or Row("TipoDocto").ToString = "NC" Or Row("TipoDocto").ToString = "Dev" Then 'Anticipos, NC, IxC
ElseIf (Row("TipoDocto").ToString = "Ant" And Row("Saldo").ToString.ToDouble = 0) Or Row("TipoDocto").ToString = "IxC" Or Row("TipoDocto").ToString = "NC" Or Row("TipoDocto").ToString = "Dev" Or Row("TipoDocto").ToString = "RNC" Then 'Anticipos, NC, IxC
ContaAnt = ContaAnt + 1
If Row("CveMoneda").ToString.ToEntero = 1 Then
If Row("TipoDocto").ToString = "Dev" Then

View File

@@ -99,6 +99,7 @@
<asp:ListItem Text="Usuario" Value="8"></asp:ListItem>
<asp:ListItem Text="Estatus Fact." Value="9"></asp:ListItem>
<asp:ListItem Text="% IVA" Value="10"></asp:ListItem>
<asp:ListItem Text="Forma de Pago" Value="15"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
@@ -168,6 +169,14 @@
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
<label id="lblEsDistribuidor" runat="server" visible="false" class="col-md-1 truncate">Es Distrubuidor:</label>
<div class="col-md-2" id="divEsDistribuidor" runat="server" visible="false">
<asp:DropDownList ID="DdlDistribuidor" runat="server" AppendDataBoundItems="true" CssClass="form-control input-small input-sm select2me" Width="100%">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
<asp:ListItem Text="Si" Value="1"></asp:ListItem>
<asp:ListItem Text="No" Value="0"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>
</div>

View File

@@ -108,6 +108,13 @@ Partial Class Ventas_RepRecuperacion
txtFechaI.Text = $"01/{Now.Month}/{Now.Year}"
txtFechaF.Text = Now.ToShortDateString
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
lblEsDistribuidor.Visible = True
divEsDistribuidor.Visible = True
End If
UPFiltros.Update()
End Sub
Private Sub CargaDatos()
@@ -120,7 +127,8 @@ Partial Class Ventas_RepRecuperacion
If ObjMovtos.GetRepRecuperacion(txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, DdlClientes.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, DdlUsuario.SelectedValue.ToEntero, -1,
"-1", UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero, DdlResponsable.SelectedValue.ToEntero, DdlTipoDocto.SelectedValue.ToString, CveBanco:=DdlBanco.SelectedValue.ToEntero, CveCuenta:=DdlCuentaBancaria.SelectedValue.ToEntero,
EstatusCliente:=DdlEstatusCliente.SelectedValue.ToEntero, CveUsuarioConsulta:=UsuarioActual.CveUsuario, TipoCambio:=RblTipoCambio.SelectedValue.ToEntero, TCEspecifico:=TCEspecifico, CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero) Then
EstatusCliente:=DdlEstatusCliente.SelectedValue.ToEntero, CveUsuarioConsulta:=UsuarioActual.CveUsuario, TipoCambio:=RblTipoCambio.SelectedValue.ToEntero, TCEspecifico:=TCEspecifico, CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero,
EsDistribuidor:=DdlDistribuidor.SelectedValue.ToEntero()) Then
GvDatos.DataSource = ObjMovtos.DtResultados
DtDatos = ObjMovtos.DtResultados
Else
@@ -159,15 +167,15 @@ Partial Class Ventas_RepRecuperacion
End If
End If
Dim Liga4 As String = String.Format("/Ventas/RepRecuperacionDetalle.aspx?GPO={0}&CveCliente={1}&CveSubProyecto={2}&Vendedor={3}&CveUsuario={4}&CveEstatusFactura={5}&IVA={6}&FechaI={7}&FechaF={8}&CveResponsable={9}&TipoDocto={10}&CveClienteSucursal={11}&CveBanco{12}&CveCuenta{13}&Grupo={14}&TipoCambio={15}&TCEspecifico={16}&CveMoneda={17}&Tipo={18}",
Dim Liga4 As String = String.Format("/Ventas/RepRecuperacionDetalle.aspx?GPO={0}&CveCliente={1}&CveSubProyecto={2}&Vendedor={3}&CveUsuario={4}&CveEstatusFactura={5}&IVA={6}&FechaI={7}&FechaF={8}&CveResponsable={9}&TipoDocto={10}&CveClienteSucursal={11}&CveBanco{12}&CveCuenta{13}&Grupo={14}&TipoCambio={15}&TCEspecifico={16}&CveMoneda={17}&Tipo={18}&EsDistribuidor={19}",
DdlGrupo.SelectedValue, e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"),
e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), CveClienteSucursal, e.Row.DBCampo("CveBanco"), e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("GPO"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), e.Row.DBCampo("CveMoneda"), 2)
e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), CveClienteSucursal, e.Row.DBCampo("CveBanco"), e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("GPO"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), e.Row.DBCampo("CveMoneda"), 2, e.Row.DBCampo("EsDistribuidor"))
e.Row.FCHyperLink("HplPagado").NavigateUrl = Liga4
Dim Liga5 As String = String.Format("/Ventas/RepRecuperacionDetalle.aspx?GPO={0}&CveCliente={1}&CveSubProyecto={2}&Vendedor={3}&CveUsuario={4}&CveEstatusFactura={5}&IVA={6}&FechaI={7}&FechaF={8}&CveResponsable={9}&TipoDocto={10}&CveClienteSucursal={11}&CveBanco{12}&CveCuenta{13}&Grupo={14}&TipoCambio={15}&TCEspecifico={16}&CveMoneda={17}&Tipo={18}",
Dim Liga5 As String = String.Format("/Ventas/RepRecuperacionDetalle.aspx?GPO={0}&CveCliente={1}&CveSubProyecto={2}&Vendedor={3}&CveUsuario={4}&CveEstatusFactura={5}&IVA={6}&FechaI={7}&FechaF={8}&CveResponsable={9}&TipoDocto={10}&CveClienteSucursal={11}&CveBanco{12}&CveCuenta{13}&Grupo={14}&TipoCambio={15}&TCEspecifico={16}&CveMoneda={17}&Tipo={18}&EsDistribuidor={19}",
DdlGrupo.SelectedValue, e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"),
e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), CveClienteSucursal, e.Row.DBCampo("CveBanco"), e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("GPO"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), e.Row.DBCampo("CveMoneda"), 1)
e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), CveClienteSucursal, e.Row.DBCampo("CveBanco"), e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("GPO"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), e.Row.DBCampo("CveMoneda"), 1, e.Row.DBCampo("EsDistribuidor"))
e.Row.FCHyperLink("HplVendido").NavigateUrl = Liga5

View File

@@ -94,6 +94,7 @@
<asp:ListItem Text="Usuario" Value="8"></asp:ListItem>
<asp:ListItem Text="Estatus Fact." Value="9"></asp:ListItem>
<asp:ListItem Text="% IVA" Value="10"></asp:ListItem>
<asp:ListItem Text="Forma de Pago" Value="15"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
@@ -177,6 +178,14 @@
<asp:ListItem Selected="True" Text="Todas" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
<label id="lblEsDistribuidor" runat="server" visible="false" class="col-md-1 truncate">Es Distrubuidor:</label>
<div class="col-md-2" id="divEsDistribuidor" runat="server" visible="false">
<asp:DropDownList ID="DdlDistribuidor" runat="server" AppendDataBoundItems="true" CssClass="form-control input-small input-sm select2me" Width="100%">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
<asp:ListItem Text="Si" Value="1"></asp:ListItem>
<asp:ListItem Text="No" Value="0"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>
</div>

View File

@@ -7,8 +7,8 @@ Imports Extensiones
Imports Microsoft.Reporting.WebForms
Imports System.IO
Partial Class Ventas_RepRecuperacionDetalle
Inherits ClsPaginas
Inherits ClsPaginas
#Region "Propiedades"
Public Property Iva() As String
Get
@@ -60,18 +60,28 @@ Partial Class Ventas_RepRecuperacionDetalle
Set(value As Integer)
ViewState("Tipo") = value
End Set
End Property
End Property
Private Property EsDistribuidor As Integer
Get
Return ViewState("EsDistribuidor").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("EsDistribuidor") = value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
CargaCombos()
CargaDatos()
End If
End Sub
End Sub
#Region "CARGAS"
Private Sub CargaCombos()
Dim CveCliente, CveVendedor, CveUsuario, CveSubProyecto,
CveEstatus, CveResponsable, CveAgrupador, CveBanco, CveCuenta, CveClienteSucursal, CveMoneda, CveClienteClasificacion As Integer
@@ -153,7 +163,8 @@ Partial Class Ventas_RepRecuperacionDetalle
TxtEspecifico.Text = IfNull(Request("TCEspecifico"), "").ToString
CveMoneda = IfNull(Request("CveMoneda"), "-1").ToString.ToEntero
CveClienteClasificacion = IfNull(Request("CveClienteClasificacion"), "-1").ToString.ToEntero
Tipo = IfNull(Request("Tipo"), "-1").ToString.ToEntero
Tipo = IfNull(Request("Tipo"), "-1").ToString.ToEntero
EsDistribuidor = IfNull(Request("EsDistribuidor"), "-1").ToString.ToEntero
'Carga Clasificacion Cliente'
Dim ObjCliente As New ClsClientes
@@ -196,8 +207,13 @@ Partial Class Ventas_RepRecuperacionDetalle
RblTipoCambio.SelectedValue = TipoCambio
DdlMoneda.SelectedValueExist(If(TipoCambio.ToEntero > 1, -1, CveMoneda))
DdlClienteClasificacion.SelectedValueExist(CveClienteClasificacion)
DdlClienteSucursal.SelectedValueExist(CveClienteSucursal)
DdlClienteSucursal.SelectedValueExist(CveClienteSucursal)
DdlDistribuidor.SelectedValueExist(EsDistribuidor)
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
lblEsDistribuidor.Visible = True
divEsDistribuidor.Visible = True
End If
End Sub
Public Sub CargaDatos()
@@ -211,7 +227,8 @@ Partial Class Ventas_RepRecuperacionDetalle
DdlClienteSucursal.SelectedValue.ToEntero, -1,
Iva.ToString, DdlGrupo.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlResponsable.SelectedValue.ToEntero,
DdlTipoDocto.SelectedValue, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveBanco:=DdlBanco.SelectedValue.ToEntero, CveCuenta:=DdlCuentaBancaria.SelectedValue.ToEntero, Grupo:=Grupo,
TipoCambio:=RblTipoCambio.SelectedValue.ToEntero, TCEspecifico:=TCEspecifico, CveMoneda:=DdlMoneda.SelectedValue.ToEntero, CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero, Tipo:=Tipo) Then
TipoCambio:=RblTipoCambio.SelectedValue.ToEntero, TCEspecifico:=TCEspecifico, CveMoneda:=DdlMoneda.SelectedValue.ToEntero, CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero, Tipo:=Tipo,
EsDistribuidor:=DdlDistribuidor.SelectedValue.ToEntero()) Then
GvDatos.DataSource = ObjMovtos.DtResultados
DtDatos = ObjMovtos.DtResultados
@@ -234,12 +251,12 @@ Partial Class Ventas_RepRecuperacionDetalle
End If
DdlCuentaBancaria.Items.Insert(0, New ListItem("Todos", "-1"))
DdlCuentaBancaria.DataBind()
End Sub
End Sub
#End Region
#Region "GRIDVIEW"
Private Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
@@ -259,18 +276,18 @@ Partial Class Ventas_RepRecuperacionDetalle
e.Row.Cells(8).Text = ""
End If
End If
End Sub
End Sub
#End Region
#Region "SELECTED INDEX CHANGE"
Protected Sub DdlBanco_SelectedIndexChanged(sender As Object, e As EventArgs)
CargaCuentas()
End Sub
End Sub
#End Region
#Region "IMPRESIONES"
Protected Sub LnkPdf_Click(sender As Object, e As EventArgs)
Imprimir("PDF")
@@ -318,10 +335,10 @@ Partial Class Ventas_RepRecuperacionDetalle
Else
Alert("No hay datos consultados.", TipoMensaje.MsgAdvertencia)
End If
End Sub
End Sub
#End Region
Protected Sub RblTipoCambio_SelectedIndexChanged(sender As Object, e As EventArgs)
If RblTipoCambio.SelectedValue.ToEntero = 3 Then
LiEspecifico.Visible = True

View File

@@ -374,7 +374,8 @@ Partial Class RepVentaDetalle
'Vendedor
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa)
DdlVendedor.DataBind()
DdlVendedor.DataBind()
DdlVendedor.Items.Insert(0, New ListItem("Sin Vendedor", "-2"))
'CargaUsuarios
DdlUsuario.DataSource = GlobalDTUsuarios.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)

View File

@@ -137,7 +137,8 @@ Partial Class Ventas_RepVentas
DdlGrupo.Items.Insert(11, New ListItem("Mes Ejec.", "12"))
DdlGrupo.Items.Insert(12, New ListItem("Año/Mes Ejec.", "13"))
DdlGrupo.Items.Insert(13, New ListItem("Fecha Ejec.", "14"))
DdlGrupo.Items.Insert(13, New ListItem("Tipo Cliente", "20"))
DdlGrupo.Items.Insert(13, New ListItem("Tipo Cliente", "20"))
DdlGrupo.Items.Insert(13, New ListItem("Vendedor/Cliente", "21"))
DdlGrupo.DataBind()
DdlGrupo.SelectedValueExist("3")
End Sub
@@ -395,6 +396,7 @@ Partial Class Ventas_RepVentas
e.Row.Cells(2).BackColor = Drawing.Color.Transparent
e.Row.Cells(6).BackColor = Drawing.Color.Transparent
End If
If e.Row.DBCampo("GPO") = "Total Dólares" Then
e.Row.CssClass = "Totales"
End If
@@ -492,6 +494,22 @@ Partial Class Ventas_RepVentas
e.Row.Attributes.Add("style", "background:#CCCCCC !important")
End If
If DdlGrupo.SelectedValue.ToEntero = 21 Then
If e.Row.DBCampo("GPO").Contains("Total") Then
e.Row.CssClass = "Totales"
e.Row.Cells(2).BackColor = Drawing.Color.Transparent
e.Row.Cells(6).BackColor = Drawing.Color.Transparent
Else
If e.Row.DBCampo("CveCliente") = "" Then
e.Row.CssClass = "SubTotales"
e.Row.Cells(2).BackColor = Drawing.Color.Transparent
e.Row.Cells(6).BackColor = Drawing.Color.Transparent
End If
End If
End If
End If
End Sub
#End Region

View File

@@ -3961,7 +3961,7 @@ Partial Class Ventas
LblAlertRefacInv.Visible = True
End If
If DdlTipoComprobante.SelectedValue.Contiene("Egs", "Ing", "Ant", "Dev", "Rem", "DPe", "RNC", "Pd2") AndAlso Not CveEstatus.Contiene(4, 5, 12, 13, 20) Then
If DdlTipoComprobante.SelectedValue.Contiene("Egs", "Ing", "Ant", "Dev", "Rem", "DPe", "RNC", "Pd2", "Cot") AndAlso Not CveEstatus.Contiene(4, 5, 10, 12, 13, 20) Then
If UsuarioActual.TienePermisoProceso(159) Then
Dim TienePermiso As String = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, -1).FiltroPrimeroValor("CveSubProyecto", String.Format("CveSubProyecto = {0}", DbRowVenta("CveSubProyecto")))
If TienePermiso <> "" Then
@@ -3981,11 +3981,13 @@ Partial Class Ventas
Dim TipoEstatus As Integer = GlobalDTEstatusFactura().FiltroPrimeroValor("TipoEstatus", $"CveEstatusFactura = {CveEstatus}").ToEntero()
If UsuarioActual.Empresa.Funcionalidad(135).Contiene("1", "2") AndAlso DdlTipoComprobante.SelectedValue.Contiene("Cot") AndAlso TipoEstatus = 5 Then
If UsuarioActual.TienePermisoProceso(159) Then
Dim TienePermiso As String = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, -1).FiltroPrimeroValor("CveSubProyecto", String.Format("CveSubProyecto = {0}", DbRowVenta("CveSubProyecto")))
If TienePermiso <> "" Then
LbCancelarDocumento.Visible = True
If UsuarioActual.Empresa.Funcionalidad(135).Contiene("1", "2") AndAlso DdlTipoComprobante.SelectedValue.Contiene("Cot") Then
If UsuarioActual.TienePermisoProceso(116) Then
LbCancelarDocumento.Visible = True
If TipoEstatus = 2 Then
LbCancelarDocumento.Visible = False
ElseIf TipoEstatus = 5 Then
LbCancelarDocumento.Visible = False
End If
End If
End If
@@ -7875,21 +7877,30 @@ Partial Class Ventas
Dim SerieFolioNCProntoPago As String = ""
Dim CveVentaNCProntoPago As Integer = -1
Dim GeneroDescuentoProntoPago As Boolean = False
If ObjFactura.DescuentoProntoPago > 0 Then
Dim RespFacturaProntoPago = GenerarNCProntoPago(ObjVentas.IniciaTransacSQL(), ObjClientes, ObjContPaq, ObjFactura)
If RespFacturaProntoPago.ObjFacturaProntoPago Is Nothing OrElse RespFacturaProntoPago Is Nothing Then
ErrorList.Add("No se pudo generar la nota de crédito de pronto pago")
Else
If RespFacturaProntoPago.Mensaje.CveVenta <= 0 OrElse RespFacturaProntoPago.Mensaje.TieneError Then
'SOLO GENERAR NC POR DESCUENTO PRONTO PAGO SI EL PAGO ES DE CONTADO
If RBLPago.SelectedValue = "2" AndAlso ObjFactura.DescuentoProntoPago > 0 Then
Dim ImportePagado = DtPagos.SUM("Importe").ToString().ToDecimal
If (ImportePagado + ObjFactura.DescuentoProntoPago) >= ObjFactura.Total Then
Dim RespFacturaProntoPago = GenerarNCProntoPago(ObjVentas.IniciaTransacSQL(), ObjClientes, ObjContPaq, ObjFactura)
If RespFacturaProntoPago.ObjFacturaProntoPago Is Nothing OrElse RespFacturaProntoPago Is Nothing Then
ErrorList.Add("No se pudo generar la nota de crédito de pronto pago")
Else
GeneroDescuentoProntoPago = True
CveVentaNCProntoPago = RespFacturaProntoPago.Mensaje.CveVenta
SerieFolioNCProntoPago = RespFacturaProntoPago.Mensaje.SerieFolio
If RespFacturaProntoPago.Mensaje.CveVenta <= 0 OrElse RespFacturaProntoPago.Mensaje.TieneError Then
ErrorList.Add("No se pudo generar la nota de crédito de pronto pago")
Else
GeneroDescuentoProntoPago = True
CveVentaNCProntoPago = RespFacturaProntoPago.Mensaje.CveVenta
SerieFolioNCProntoPago = RespFacturaProntoPago.Mensaje.SerieFolio
Obj2.Add(RespFacturaProntoPago.ObjFacturaProntoPago)
Obj2.Add(RespFacturaProntoPago.ObjFacturaProntoPago)
End If
End If
End If
End If
'MARCA PARA NO SURTIR VENTA DE COTNRATO DE CONSIGNACION DE VENTA | [IPP] : PARCHE
@@ -16710,9 +16721,13 @@ Partial Class Ventas
If ImporteProntoPago > 0 Then
Row("ImporteProntoPago") = ImporteProntoPago
Row("TieneProntoPago") = "Si"
GvPS.Columns(22).Visible = True
thProntoPago.Visible = True
thProntoPago2.Visible = True
'SOLO DEBE MOSTRASE SI EL PAGO ES DE CONTADO
If RBLPago.SelectedValue = "2" Then
GvPS.Columns(22).Visible = True
thProntoPago.Visible = True
thProntoPago2.Visible = True
End If
End If
If UsuarioActual.CveEmpresa = 119 Then
@@ -17365,7 +17380,7 @@ Partial Class Ventas
Dim Total As Decimal = 0
Dim TotalImpuestosLocales As Decimal = 0
Dim TotalProntoPago As Decimal = TmpDT.SUM("ImporteProntoPago").ToDecimal
Dim TotalProntoPago As Decimal = 0
If TotalAmortizacion > 0 AndAlso TotalSubTotal = TotalAmortizacion Then ' si se amortizó completa la factura, debe de limpiar los impuestos
If DdlTipoAmortizacionAnticipo.SelectedValue.Contiene("3") Then
@@ -17439,6 +17454,11 @@ Partial Class Ventas
TxtIEPS.Text = TotalIEPS.FormatoNumero
TxtTotal.Text = Total.FormatoNumero
'SI ES PAGO DE CONTADO
If RBLPago.SelectedValue = "2" Then
TotalProntoPago = TmpDT.SUM("ImporteProntoPago").ToDecimal
End If
HdnProntoPago.Value = TotalProntoPago.ToString()
LblProntoPago.Text = TotalProntoPago.FormatoNumero(2)
@@ -19783,9 +19803,26 @@ Partial Class Ventas
End Select
LimpiaContado()
LimpiaProntoPago()
UpContado.Update()
UPCondicionesPago.Update()
End Sub
Private Sub LimpiaProntoPago()
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
If RBLPago.SelectedValue = "2" Then
GvPS.Columns(22).Visible = True
thProntoPago.Visible = True
thProntoPago2.Visible = True
Else
GvPS.Columns(22).Visible = False
thProntoPago.Visible = False
thProntoPago2.Visible = False
End If
CalculaTotalesVenta()
End If
End Sub
Private Sub CargaCuentas()
DdlCuentaEfectivo.Items.Clear()
@@ -28647,7 +28684,12 @@ Partial Class Ventas
Exit Sub
End If
Dim TotalProntoPago As Decimal = TmpDT.SUM("ImporteProntoPago").ToDecimal
Dim TotalProntoPago As Decimal = 0
'SOLO APLICA SI EL PAGO ES DE CONTADO
If RBLPago.SelectedValue = "2" Then
TotalProntoPago = TmpDT.SUM("ImporteProntoPago").ToDecimal
End If
HdnTotalRNC.Value = TotalRemNCAplicado.ToString()
LblDescuentosRNC.Text = TotalRemNCAplicado.FormatoNumero