Soporte Anticipos del 2017 para atras en ventas y PopIEVnetas

This commit is contained in:
Raul Pimienta
2019-09-05 17:51:36 -07:00
parent 9a04b15004
commit 47b28acfc9
3 changed files with 59 additions and 2 deletions

View File

@@ -215,7 +215,7 @@
<div class="col-xs-12">
<asp:UpdatePanel ID="UpIngresos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvIngresos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron movimientos" DataKeyNames="CveIE,Saldo,RazonSocial,Folio,CveProveedor,SaldoVentas,CveMoneda,IdCtaContClientes"
<asp:GridView ID="GvIngresos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron movimientos" DataKeyNames="CveIE,Saldo,RazonSocial,Folio,CveProveedor,SaldoVentas,CveMoneda,IdCtaContClientes,FechaDocumento"
ToolTip="Listado de Movimientos" Style="width: 100%; height: 100%; text-align: center;" GridLines="None" HeaderStyle-ForeColor="Black">
<Columns>
<asp:TemplateField>

View File

@@ -2197,6 +2197,18 @@ Partial Class Bancos_PopIEVentas
End If
End If
If UsuarioActual.CveEmpresa.Contiene(119) Then
If rw.DataKey("FechaDocumento").ToDate.Year <= 2017 AndAlso Fecha.Year >= 2018 Then
If ObjCliente.DtResultados.Rows.Count > 0 Then
If CveMoneda = 2 Then
IdCtaContable = ObjCliente.IdCtaContMonedaExtranjera
Else
IdCtaContable = ObjCliente.IdCtaContClientes
End If
End If
End If
End If
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, ReferenciaConcepto, ConceptoContable, ConceptoMovimiento, Fecha, IdCtaContable, -1, CveIE, CveVenta, -1, CveSubProyectoContabilizar, If(ViewState("CveCliente") IsNot Nothing, ViewState("CveCliente").ToString.ToEntero, -1), ImporteMX:=ImporteMX, TipoCambio:=tipoCambioPago) Then
MsgError = "No se pudo insertar la póliza"
End If
@@ -2206,6 +2218,15 @@ Partial Class Bancos_PopIEVentas
If ObjCliente.DtResultados.Rows.Count > 0 Then
IdCtaContable = ObjCliente.IdCtaContCompAnticipos
End If
If UsuarioActual.CveEmpresa.Contiene(119) Then
If rw.DataKey("FechaDocumento").ToDate.Year <= 2017 AndAlso Fecha.Year >= 2018 Then
If ObjCliente.DtResultados.Rows.Count > 0 Then
IdCtaContable = ObjCliente.IdCtaContCompClientes
End If
End If
End If
If ImporteMovimiento <> 0 AndAlso (IdCtaContable > 0 Or UsuarioActual.CveEmpresa = 119) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, ReferenciaConcepto, 227, ConceptoMovimiento, Fecha, IdCtaContable, -1, CveIE, CveVenta, -1, CveSubProyectoContabilizar, If(ViewState("CveCliente") IsNot Nothing, ViewState("CveCliente").ToString.ToEntero, -1), ImporteMX:=ImporteMovimiento * tipoCambioPago - ImporteMovimiento, ImporteME:=ImporteMovimiento, TipoCambio:=tipoCambioPago) Then
MsgError = "No se pudo insertar la póliza"
@@ -2216,6 +2237,15 @@ Partial Class Bancos_PopIEVentas
If ObjCliente.DtResultados.Rows.Count > 0 Then
IdCtaContable = ObjCliente.IdCtaMonedaExtranjeraAnticipos
End If
If UsuarioActual.CveEmpresa.Contiene(119) Then
If rw.DataKey("FechaDocumento").ToDate.Year <= 2017 AndAlso Fecha.Year >= 2018 Then
If ObjCliente.DtResultados.Rows.Count > 0 Then
IdCtaContable = ObjCliente.IdCtaContMonedaExtranjera
End If
End If
End If
End If
End If

View File

@@ -11197,6 +11197,7 @@ Partial Class Ventas
Dim ObjConta As New ClsContabilidad
Dim ObjVenta As New ClsVentas(ObjConta.IniciaTransacSQL())
Dim ObjIE As New ClsBancos(ObjConta.IniciaTransacSQL())
Dim ObjCliente As New ClsClientes(ObjConta.IniciaTransacSQL())
Dim ObjContpaq As ClsContPAQi = Nothing
Dim CvePrepoliza As Integer
@@ -11567,12 +11568,36 @@ Partial Class Ventas
End If
End If
'Agregamos el 92
importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal 'gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal - ((gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / gvr.DataKey("TotalAnticipo" & gvr.RowIndex).ToDecimal) * gvr.DataKey("IVAAnticipo").ToDecimal)
importeMX = Math.Round(importeMovimiento * tipoCambioPago, 2, MidpointRounding.AwayFromZero)
IdCtaContable = IdCtaContAnticipos
CveCuenta = CveCuentaAnticipos
If Not ObjConta.AddPrePolizasDetalle(CvePrepoliza, TipoMovimiento, importeMovimiento, Concepto, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=importeMX, CveCuenta:=CveCuenta, TipoCambio:=tipoCambioPago) Then
If ObjCliente.GetClientes(gvr.DataKey("CveCliente").ToEntero, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa) Then
If ObjCliente.DtResultados.Rows.Count > 0 Then
If Not tipoCambioPago = 1 Then
IdCtaContable = ObjCliente.IdCtaMonedaExtranjeraAnticipos
Else
IdCtaContable = ObjCliente.IdCtaContAnticipos
End If
End If
End If
If UsuarioActual.CveEmpresa.Contiene(119) Then
If gvr.DataKey("Fecha").ToDate.Year <= 2017 AndAlso TxtFechaAnticipoCliente.Text.ToDate.Year >= 2018 Then
If ObjCliente.DtResultados.Rows.Count > 0 Then
If Not tipoCambioPago = 1 Then
IdCtaContable = ObjCliente.IdCtaContMonedaExtranjera
Else
IdCtaContable = ObjCliente.IdCtaContClientes
End If
End If
End If
End If
If Not ObjConta.AddPrePolizasDetalle(CvePrepoliza, TipoMovimiento, importeMovimiento, Concepto, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=importeMX, CveCuenta:=-1, TipoCambio:=tipoCambioPago) Then
ErrorConta = True
End If
@@ -11669,7 +11694,9 @@ Partial Class Ventas
End If
ObjConta.Dispose()
ObjVenta.Dispose()
ObjIE.Dispose()
ObjCliente.Dispose()
Else