--FIX generacion de NC en cobranza

This commit is contained in:
2024-10-21 11:48:27 -07:00
parent 909036cb12
commit 4a78544929
3 changed files with 158 additions and 80 deletions

View File

@@ -742,7 +742,7 @@ Namespace Modelos
Return Not ErrorPrePolizas Return Not ErrorPrePolizas
End Function End Function
Public Function EmitirFactura(Optional Timbrar As Boolean = True, Optional Transac As SqlClient.SqlTransaction = Nothing, Optional Modulo As String = "Modelos/GuardarVentaM") As MMensajeFactura Public Function EmitirFactura(Optional Timbrar As Boolean = True, Optional Transac As SqlClient.SqlTransaction = Nothing, Optional Modulo As String = "Modelos/GuardarVentaM", Optional MostrarURL As Boolean = False) As MMensajeFactura
Dim Retorno As New MMensajeFactura() Dim Retorno As New MMensajeFactura()
If Me.Version = "3.3" AndAlso Not Me.TipoDocto.Contiene("Ped", "PeC") Then If Me.Version = "3.3" AndAlso Not Me.TipoDocto.Contiene("Ped", "PeC") Then
@@ -1117,8 +1117,12 @@ Namespace Modelos
End If End If
'MENSAJE PRINCIPAL 'MENSAJE PRINCIPAL
MensajeAlert.AppendFormat(String.Format("<br/>La {0}: <b>{1}</b> se generó correctamente.<br/><br/>", If(Me.TipoDocumento = "Ingresos", "Factura", Me.TipoDocumento), Me.SerieFolio))
If MostrarURL Then
MensajeAlert.AppendFormat("<br/>La {0}: <a class=""Texto"" target=""_blank"" href=""/Ventas/Ventas.aspx?CveVenta={2}""><b></b>{1}</a> se generó correctamente.<br/><br/>", If(Me.TipoDocumento = "Ingresos", "Factura", Me.TipoDocumento), Me.SerieFolio, Me.CveVenta)
Else
MensajeAlert.AppendFormat(String.Format("<br/>La {0}: <b>{1}</b> se generó correctamente.<br/><br/>", If(Me.TipoDocumento = "Ingresos", "Factura", Me.TipoDocumento), Me.SerieFolio))
End If
' DESCARGA XML - SI SE TIMBRA MANDA CORREO CON FACTURA ' DESCARGA XML - SI SE TIMBRA MANDA CORREO CON FACTURA
If SeTimbro Then If SeTimbro Then

View File

@@ -535,8 +535,8 @@
</div> </div>
<div class="col-md-4 input-icon"> <div class="col-md-4 input-icon">
<i style="margin: 0px;">$</i> <i style="margin: 0px;">$</i>
<asp:TextBox ID="TxtAnticipos" CssClass="form-control input-sm " runat="server" MaxLength="12" Width="100px" Enabled="false" ClientIDMode="Static" Style="text-align: right;"></asp:TextBox> <asp:TextBox ID="TxtNCDev" CssClass="form-control input-sm " runat="server" MaxLength="12" Width="100px" Enabled="false" ClientIDMode="Static" Style="text-align: right;"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="FTEAnticipo" runat="server" TargetControlID="TxtAnticipos" FilterType="Custom, Numbers" ValidChars=".," /> <ajax:FilteredTextBoxExtender ID="FTEAnticipo" runat="server" TargetControlID="TxtNCDev" FilterType="Custom, Numbers" ValidChars=".," />
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<label> <label>
@@ -1130,7 +1130,6 @@
<div class="col-md-8"> <div class="col-md-8">
<asp:DropDownList ID="DdlTipoAmortizacionAnticipo" runat="server" AutoPostBack="true" Width="250px" CssClass="select2me" CausesValidation="true" OnSelectedIndexChanged="DdlTipoAmortizacionAnticipo_SelectedIndexChanged"> <asp:DropDownList ID="DdlTipoAmortizacionAnticipo" runat="server" AutoPostBack="true" Width="250px" CssClass="select2me" CausesValidation="true" OnSelectedIndexChanged="DdlTipoAmortizacionAnticipo_SelectedIndexChanged">
<asp:ListItem Text="Seleccionar" Value="-1"></asp:ListItem> <asp:ListItem Text="Seleccionar" Value="-1"></asp:ListItem>
<asp:ListItem Text="Amortización anticipo en descuento" Value="1"></asp:ListItem>
<asp:ListItem Text="Amortización anticipo con nota de crédito" Value="2"></asp:ListItem> <asp:ListItem Text="Amortización anticipo con nota de crédito" Value="2"></asp:ListItem>
</asp:DropDownList> </asp:DropDownList>
@@ -1389,7 +1388,7 @@
let total = totalEfectivo + totalCredito + totalDebito + totalCheque + totalTransferencia + TotalOtrosContado; let total = totalEfectivo + totalCredito + totalDebito + totalCheque + totalTransferencia + TotalOtrosContado;
if (<%= If(UsuarioActual.Empresa.CveEmpresa = 189, 1, 0)%> == 1) { if (<%= If(UsuarioActual.Empresa.CveEmpresa = 189, 1, 0)%> == 1) {
var totalAnticipos = ToDouble($get("TxtAnticipos").value); let totalAnticipos = ToDouble($get("TxtNCDev").value);
total = total + totalAnticipos; total = total + totalAnticipos;
} }

View File

@@ -9,6 +9,18 @@ Imports Modelos.Factura
Partial Class Ventas_PVCobranza Partial Class Ventas_PVCobranza
Inherits ClsPaginas Inherits ClsPaginas
Private Property CveCliente As Integer
Get
If ViewState("CveCliente") Is Nothing Then
ViewState("CveCliente") = -1
End If
Return ViewState("CveCliente").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("CveCliente") = value
End Set
End Property
Private Property TmpDTAnticiposNCIxCCliente As DataTable Private Property TmpDTAnticiposNCIxCCliente As DataTable
Get Get
Return If(IsNothing(ViewState("TmpDTAnticiposNCIxCCliente")), Nothing, CType(ViewState("TmpDTAnticiposNCIxCCliente"), DataTable)) Return If(IsNothing(ViewState("TmpDTAnticiposNCIxCCliente")), Nothing, CType(ViewState("TmpDTAnticiposNCIxCCliente"), DataTable))
@@ -16,6 +28,15 @@ Partial Class Ventas_PVCobranza
Set(value As DataTable) Set(value As DataTable)
ViewState("TmpDTAnticiposNCIxCCliente") = value ViewState("TmpDTAnticiposNCIxCCliente") = value
End Set End Set
End Property
Private Property ListaAnticiposAplicados As List(Of Modelos.MAnticipoRelacionado)
Get
Return If(IsNothing(ViewState("ListaAnticiposAplicados")), Nothing, CType(ViewState("ListaAnticiposAplicados"), List(Of Modelos.MAnticipoRelacionado)))
End Get
Set(value As List(Of Modelos.MAnticipoRelacionado))
ViewState("ListaAnticiposAplicados") = value
End Set
End Property End Property
Private Property CveCorte As Integer Private Property CveCorte As Integer
@@ -86,8 +107,6 @@ Partial Class Ventas_PVCobranza
If UsuarioActual.CveEmpresa = 189 Then If UsuarioActual.CveEmpresa = 189 Then
DivDatosCheque.Visible = True DivDatosCheque.Visible = True
DivAnticipo.Visible = True
ImgAntiPend.Visible = True
End If End If
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
@@ -282,16 +301,6 @@ Partial Class Ventas_PVCobranza
ObjMovtos.Dispose() ObjMovtos.Dispose()
GvDatos.DataBind() GvDatos.DataBind()
TxtImporteEfectivo.Text = ""
TxtImporteCredito.Text = ""
TxtImporteDebito.Text = ""
TxtImporteCheque.Text = ""
TxtImporteTransferencia.Text = ""
TxtImporteOtrosContado.Text = ""
TxtCambio.Text = ""
TxtClaveAutorizacion.Text = ""
TxtAutorizo.Text = ""
UpL.Update() UpL.Update()
End Sub End Sub
@@ -395,6 +404,12 @@ Partial Class Ventas_PVCobranza
LtlNombre.Text = GvRow.DataKey("AtencionA") LtlNombre.Text = GvRow.DataKey("AtencionA")
LtlFolio.Text = GvRow.DataKey("SerieFolio") LtlFolio.Text = GvRow.DataKey("SerieFolio")
LtlSaldo.Text = GvRow.DataKey("Saldo").ToDecimal.FormatoNumero LtlSaldo.Text = GvRow.DataKey("Saldo").ToDecimal.FormatoNumero
If UsuarioActual.CveEmpresa = 189 AndAlso GvRow.DataKey("TipoDocto") = "Rem" Then
DivAnticipo.Visible = True
ImgAntiPend.Visible = True
End If
Catch ex As Exception Catch ex As Exception
TieneError = True TieneError = True
End Try End Try
@@ -419,7 +434,7 @@ Partial Class Ventas_PVCobranza
'registrar pago 'registrar pago
'validaciones 'validaciones
Dim Pagado As Decimal = TxtImporteEfectivo.Text.ToDecimal + TxtImporteCredito.Text.ToDecimal + TxtImporteDebito.Text.ToDecimal + TxtImporteCheque.Text.ToDecimal + TxtImporteTransferencia.Text.ToDecimal + TxtAnticipos.Text.ToDecimal() Dim Pagado As Decimal = TxtImporteEfectivo.Text.ToDecimal + TxtImporteCredito.Text.ToDecimal + TxtImporteDebito.Text.ToDecimal + TxtImporteCheque.Text.ToDecimal + TxtImporteTransferencia.Text.ToDecimal + TxtNCDev.Text.ToDecimal()
If Pagado = 0 Then If Pagado = 0 Then
Alert("Favor de especificar importe", TipoMensaje.ToastAdventencia) Alert("Favor de especificar importe", TipoMensaje.ToastAdventencia)
Exit Sub Exit Sub
@@ -618,11 +633,11 @@ Partial Class Ventas_PVCobranza
ObjVentas2.Commit() ObjVentas2.Commit()
Dim msBuild As New StringBuilder() Dim msBuild As New StringBuilder()
'SI SE GENERO FACTURA DE INGRESO, TIMBRARLA DESPUES DE REALIZAR EL PAGO 'SI SE GENERO FACTURA DE INGRESO, TIMBRARLA DESPUES DE REALIZAR EL PAGO
If respFactura IsNot Nothing Then 'If respFactura IsNot Nothing Then
If Not respFactura.Factura.TimbrarFactura() Then ' If Not respFactura.Factura.TimbrarFactura() Then
msBuild.Append("La factura no se pudo timbrar<br/> ") ' msBuild.Append("La factura no se pudo timbrar<br/> ")
End If ' End If
End If 'End If
If respFactura IsNot Nothing Then If respFactura IsNot Nothing Then
msBuild.Append($"Pago Registrado correctamente.") msBuild.Append($"Pago Registrado correctamente.")
@@ -672,8 +687,34 @@ Partial Class Ventas_PVCobranza
Private Sub LimpiarDatos() Private Sub LimpiarDatos()
PnlContado.Visible = False PnlContado.Visible = False
HdnCveVenta.Value = "" TxtImporteEfectivo.Text = ""
HdnTipoAmortizacion.Value = "" TxtImporteCredito.Text = ""
TxtImporteDebito.Text = ""
TxtImporteCheque.Text = ""
TxtImporteTransferencia.Text = ""
TxtImporteOtrosContado.Text = ""
TxtCambio.Text = ""
TxtClaveAutorizacion.Text = ""
TxtAutorizo.Text = ""
TxtNCDev.Text = ""
LtlTipoAnticipo.Text = ""
HdnTipoAmortizacion.Value = ""
CveCliente = -1
If TmpDTAnticiposNCIxCCliente IsNot Nothing Then
TmpDTAnticiposNCIxCCliente.Clear()
TmpDTAnticiposNCIxCCliente = Nothing
End If
If ListaAnticiposAplicados IsNot Nothing Then
ListaAnticiposAplicados.Clear()
ListaAnticiposAplicados = Nothing
End If
ImgAntiPend.Visible = False
DivAnticipo.Visible = False
UpL.Update()
End Sub End Sub
Private Function GenerarFactura(ByRef VentaRemision As Venta, ByRef ObjVentas As ClsVentas, ByRef ObjClientes As ClsClientes) As Modelos.Factura.MMensajeFactura Private Function GenerarFactura(ByRef VentaRemision As Venta, ByRef ObjVentas As ClsVentas, ByRef ObjClientes As ClsClientes) As Modelos.Factura.MMensajeFactura
@@ -755,7 +796,7 @@ Partial Class Ventas_PVCobranza
Dim SbAlert As New StringBuilder() Dim SbAlert As New StringBuilder()
Try Try
Retorno = ObjFactura.EmitirFactura(False, Transac:=ObjVentas.IniciaTransacSQL(), Modulo:="Cobranza/GuardarVenta") Retorno = ObjFactura.EmitirFactura(False, Transac:=ObjVentas.IniciaTransacSQL(), Modulo:="Cobranza/GuardarVenta", MostrarURL:=True)
Retorno.Factura = ObjFactura Retorno.Factura = ObjFactura
If Retorno IsNot Nothing AndAlso Retorno.CveVenta > 0 Then If Retorno IsNot Nothing AndAlso Retorno.CveVenta > 0 Then
@@ -826,7 +867,7 @@ Partial Class Ventas_PVCobranza
Dim Retorno As Modelos.Factura.MMensajeFactura = Nothing Dim Retorno As Modelos.Factura.MMensajeFactura = Nothing
Dim ObjNC = Modelos.Factura.CrearVentaNueva(UsuarioActual, Venta.CveSubProyecto, Venta.CveCliente, Venta.CveMoneda, "Egs") Dim ObjNC = Modelos.Factura.CrearVentaNueva(UsuarioActual, Venta.CveSubProyecto, Venta.CveCliente, Venta.CveMoneda, "Egs")
Dim Total As Decimal = TxtAnticipos.Text.ToDecimal() Dim Total As Decimal = TxtNCDev.Text.ToDecimal()
Dim subTotal As Decimal = (Total / (1D + Venta.PorcentajeIVA)) Dim subTotal As Decimal = (Total / (1D + Venta.PorcentajeIVA))
'Dim IVA = (subTotal * Factura.PorcentajeIVA).RoundSQL(2) 'Dim IVA = (subTotal * Factura.PorcentajeIVA).RoundSQL(2)
Dim PU As Decimal = subTotal Dim PU As Decimal = subTotal
@@ -874,7 +915,7 @@ Partial Class Ventas_PVCobranza
Dim CveConceptoContable = GvRow.DataKey("CveConceptoContable").ToEntero() Dim CveConceptoContable = GvRow.DataKey("CveConceptoContable").ToEntero()
Dim CveIE = GvRow.DataKey("CveIE").ToEntero() Dim CveIE = GvRow.DataKey("CveIE").ToEntero()
Dim FolioFiscal = "" Dim FolioFiscal = GvRow.DataKey("FolioFiscal")
Dim Descuentos As Decimal = GvRow.DataKey("Descuentos").ToDecimal() Dim Descuentos As Decimal = GvRow.DataKey("Descuentos").ToDecimal()
Dim TotalAnticipo As Decimal = GvRow.DataKey("TotalAnticipo").ToDecimal() Dim TotalAnticipo As Decimal = GvRow.DataKey("TotalAnticipo").ToDecimal()
Dim SubTotalAnticipo As Decimal = GvRow.DataKey("SubTotalAnticipo").ToDecimal() Dim SubTotalAnticipo As Decimal = GvRow.DataKey("SubTotalAnticipo").ToDecimal()
@@ -893,7 +934,7 @@ Partial Class Ventas_PVCobranza
Dim SbAlert As New StringBuilder() Dim SbAlert As New StringBuilder()
Try Try
Retorno = ObjNC.EmitirFactura(False, Transac:=ObjVentas.IniciaTransacSQL(), Modulo:="Cobranza/GuardarVenta") Retorno = ObjNC.EmitirFactura(False, Transac:=ObjVentas.IniciaTransacSQL(), Modulo:="Cobranza/GuardarVenta", MostrarURL:=True)
Retorno.Factura = ObjNC Retorno.Factura = ObjNC
If Retorno IsNot Nothing AndAlso Retorno.CveVenta > 0 Then If Retorno IsNot Nothing AndAlso Retorno.CveVenta > 0 Then
@@ -1392,23 +1433,24 @@ Partial Class Ventas_PVCobranza
divAmortizacionTipoRelacion.Visible = False divAmortizacionTipoRelacion.Visible = False
If DdlTipoAmortizacionAnticipo.Items.FindByValue("1") IsNot Nothing Then
DdlTipoAmortizacionAnticipo.Items.Remove(DdlTipoAmortizacionAnticipo.Items.FindByValue("1"))
End If
DdlTipoAmortizacionAnticipo_SelectedIndexChanged(DdlTipoAmortizacionAnticipo, EventArgs.Empty) DdlTipoAmortizacionAnticipo_SelectedIndexChanged(DdlTipoAmortizacionAnticipo, EventArgs.Empty)
End If End If
Dim DbRowVenta As DataRow = Nothing If CveCliente <= 0 Then
Dim ObjVentas As New ClsVentas Dim DbRowVenta As DataRow = Nothing
If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) Then Dim ObjVentas As New ClsVentas
DbRowVenta = ObjVentas.DtResultados.Copy().FiltroPrimero("") If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) Then
End If DbRowVenta = ObjVentas.DtResultados.Copy().FiltroPrimero("")
ObjVentas.Dispose() End If
ObjVentas.Dispose()
If DbRowVenta IsNot Nothing Then If DbRowVenta IsNot Nothing Then
CargaAnticipos(DbRowVenta("CveCliente").ToString().ToEntero()) CveCliente = DbRowVenta("CveCliente").ToString().ToEntero()
End If
End If
If CveCliente > 0 Then
CargaAnticipos(CveCliente)
End If End If
UpAnticipos.Update() UpAnticipos.Update()
@@ -1446,12 +1488,12 @@ Partial Class Ventas_PVCobranza
ObjMovtos.Dispose() ObjMovtos.Dispose()
If Me.TmpDTAnticiposNCIxCCliente IsNot Nothing Then If Me.TmpDTAnticiposNCIxCCliente IsNot Nothing Then
Dim DtMovtos As DataTable = Me.TmpDTAnticiposNCIxCCliente.FiltraParametros($"Saldo > 0 AND Tipo IN('RNC','IxC','Ant') ") Dim DtMovtos As DataTable = Me.TmpDTAnticiposNCIxCCliente.FiltraParametros($"Saldo > 0 AND Tipo IN('NC','IxC','Ant') ")
GVAnticipos.DataSource = DtMovtos If DdlTipoAmortizacionAnticipo.SelectedValue = "4" Then
If DtMovtos.Rows.Count > 0 Then ImgAntiPend.Visible = True GVAnticipos.DataSource = DtMovtos.FiltraParametros("Tipo IN('NC','IxC')")
If UsuarioActual.Empresa.Funcionalidad(382) = "1" AndAlso DtMovtos IsNot Nothing AndAlso DtMovtos.Rows.Count = 0 Then Else
ImgAntiPend.Visible = False GVAnticipos.DataSource = DtMovtos.FiltraParametros("Tipo IN('Ant')")
End If End If
Else Else
GVAnticipos.DataSource = Nothing GVAnticipos.DataSource = Nothing
@@ -1476,30 +1518,44 @@ Partial Class Ventas_PVCobranza
End Sub End Sub
Protected Sub TxtFechaAnticipoCliente_TextChanged(sender As Object, e As EventArgs) Protected Sub TxtFechaAnticipoCliente_TextChanged(sender As Object, e As EventArgs)
Dim CveVenta As Integer = HdnCveVenta.Value.ToEntero() Dim CveVenta As Integer = HdnCveVenta.Value.ToEntero()
Dim DbRowVenta As DataRow = Nothing If CveCliente <= 0 Then
Dim ObjVentas As New ClsVentas Dim DbRowVenta As DataRow = Nothing
If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) Then Dim ObjVentas As New ClsVentas
DbRowVenta = ObjVentas.DtResultados.Copy().FiltroPrimero("") If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) Then
End If DbRowVenta = ObjVentas.DtResultados.Copy().FiltroPrimero("")
ObjVentas.Dispose() End If
If DbRowVenta IsNot Nothing Then ObjVentas.Dispose()
CargaAnticipos(DbRowVenta("CveCliente").ToString().ToEntero())
If DbRowVenta IsNot Nothing Then
CveCliente = DbRowVenta("CveCliente").ToString().ToEntero()
End If
End If
If CveCliente > 0 Then
CargaAnticipos(CveCliente)
End If End If
End Sub End Sub
Protected Sub LnkRecargaAnticipos_Click(sender As Object, e As EventArgs) Protected Sub LnkRecargaAnticipos_Click(sender As Object, e As EventArgs)
Dim CveVenta As Integer = HdnCveVenta.Value.ToEntero() Dim CveVenta As Integer = HdnCveVenta.Value.ToEntero()
Dim DbRowVenta As DataRow = Nothing If CveCliente <= 0 Then
Dim ObjVentas As New ClsVentas Dim DbRowVenta As DataRow = Nothing
If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) Then Dim ObjVentas As New ClsVentas
DbRowVenta = ObjVentas.DtResultados.Copy().FiltroPrimero("") If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) Then
End If DbRowVenta = ObjVentas.DtResultados.Copy().FiltroPrimero("")
ObjVentas.Dispose() End If
If DbRowVenta IsNot Nothing Then ObjVentas.Dispose()
CargaAnticipos(DbRowVenta("CveCliente").ToString().ToEntero())
If DbRowVenta IsNot Nothing Then
CveCliente = DbRowVenta("CveCliente").ToString().ToEntero()
End If
End If
If CveCliente > 0 Then
CargaAnticipos(CveCliente)
End If End If
End Sub End Sub
@@ -1639,20 +1695,32 @@ Partial Class Ventas_PVCobranza
Dim Amortizacion As Decimal = 0 Dim Amortizacion As Decimal = 0
If ListaAnticiposAplicados Is Nothing Then
ListaAnticiposAplicados = New List(Of Modelos.MAnticipoRelacionado)
Else
ListaAnticiposAplicados.Clear()
End If
'cuando es PAGO CON DEVOLUCION 'cuando es PAGO CON DEVOLUCION
Dim SbObs As New StringBuilder Dim SbObs As New StringBuilder
For Each gvr As GridViewRow In GVAnticipos.Rows For Each gvr As GridViewRow In GVAnticipos.Rows
If gvr.FCCheckBox("Chk" & gvr.RowIndex) IsNot Nothing AndAlso gvr.FCCheckBox("Chk" & gvr.RowIndex).Checked Then If gvr.FCCheckBox("Chk" & gvr.RowIndex) IsNot Nothing AndAlso gvr.FCCheckBox("Chk" & gvr.RowIndex).Checked Then
Amortizacion += gvr.FCTextBox(String.Format("TxtAnticipo{0}", gvr.RowIndex)).Text.ToDecimal If gvr.FCTextBox(String.Format("TxtAnticipo{0}", gvr.RowIndex)).Text.ToDecimal > 0 Then
Amortizacion += gvr.FCTextBox(String.Format("TxtAnticipo{0}", gvr.RowIndex)).Text.ToDecimal()
If DdlTipoAmortizacionAnticipo.SelectedValue = "2" Then
ListaAnticiposAplicados.Add(New Modelos.MAnticipoRelacionado() With {.CveVenta = gvr.DataKey("CveVenta").ToEntero(), .FolioFiscal = gvr.DataKey("FolioFiscal")})
End If
End If
End If End If
Next Next
If Amortizacion > 0 Then If Amortizacion > 0 Then
TxtAnticipos.Text = Amortizacion.ToString() TxtNCDev.Text = Amortizacion.ToString()
LtlTipoAnticipo.Text = DdlTipoAmortizacionAnticipo.SelectedItem.Text LtlTipoAnticipo.Text = DdlTipoAmortizacionAnticipo.SelectedItem.Text
HdnTipoAmortizacion.Value = DdlTipoAmortizacionAnticipo.SelectedValue HdnTipoAmortizacion.Value = DdlTipoAmortizacionAnticipo.SelectedValue
Else Else
TxtAnticipos.Text = "" TxtNCDev.Text = ""
LtlTipoAnticipo.Text = "" LtlTipoAnticipo.Text = ""
HdnTipoAmortizacion.Value = "" HdnTipoAmortizacion.Value = ""
End If End If
@@ -1671,16 +1739,23 @@ Partial Class Ventas_PVCobranza
DivConceptoNC.Visible = False DivConceptoNC.Visible = False
End If End If
Dim CveVenta As Integer = HdnCveVenta.Value.ToEntero If CveCliente <= 0 Then
Dim DbRowVenta As DataRow = Nothing Dim CveVenta As Integer = HdnCveVenta.Value.ToEntero
Dim ObjVentas As New ClsVentas Dim DbRowVenta As DataRow = Nothing
If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) Then Dim ObjVentas As New ClsVentas
DbRowVenta = ObjVentas.DtResultados.Copy().FiltroPrimero("") If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) Then
End If DbRowVenta = ObjVentas.DtResultados.Copy().FiltroPrimero("")
ObjVentas.Dispose() End If
ObjVentas.Dispose()
If DbRowVenta IsNot Nothing Then If DbRowVenta IsNot Nothing Then
CargaAnticipos(DbRowVenta("CveCliente").ToString().ToEntero()) CveCliente = DbRowVenta("CveCliente").ToString().ToEntero()
End If
End If
If CveCliente > 0 Then
CargaAnticipos(CveCliente)
End If End If
UpAnticipos.Update() UpAnticipos.Update()