This commit is contained in:
Rakcsle Supertramp
2020-06-27 20:48:11 -07:00
18 changed files with 1062 additions and 26 deletions

View File

@@ -1314,7 +1314,7 @@
<Columns>
<asp:TemplateField HeaderText="Código Único">
<ItemTemplate>
<asp:TextBox ID="TxtCodigoUnico" runat="server" Text='<%# Eval("SerieLote") %>' />
<asp:TextBox ID="TxtCodigoUnico" runat="server" Text='<%# Eval("Serie") %>' />
</ItemTemplate>
</asp:TemplateField>
</Columns>
@@ -5265,6 +5265,7 @@
<asp:Button ID="BtnRefacturacionConfirmar" runat="server" ClientIDMode="Static" Text="Refacturacion Documento" Style="display: none;" />
<asp:Button ID="BtnRefacturacionConfirmarAceptacion" runat="server" ClientIDMode="Static" Text="Refacturacion Aceptacion Documento" Style="display: none;" />
<asp:Button ID="BtnRefrescarPagina" runat="server" ClientIDMode="Static" Text="Refrescar" Style="display: none;" />
<asp:Button ID="BtnAplicaNuevaNC" runat="server" ClientIDMode="Static" Text="AplicarNC" Style="display: none;" />
<%--FLETES--%>
<div id="ModalFletes" class="modal ADS fade" role="dialog">
@@ -7394,6 +7395,9 @@
function Recargar() {
$('#BtnRefrescarPagina').click();
}
function BtnAplicaNuevaNC() {
$('#BtnAplicaNuevaNC').click();
}
$('.DdlPS').on("select2:open", function (e) { $('.select2-container.select2-container--default .select2-dropdown .select2anothertable').remove(); });
$('.DdlPSPyME').on("select2:open", function (e) { $('.select2-container.select2-container--default .select2-dropdown .select2anothertable').remove(); });

View File

@@ -10343,18 +10343,33 @@ Partial Class Ventas
Next
If ImporteConcepto12 < ImporteAcumulado91 Then
Dim ImporteOtrosIngresos As Decimal = ImporteConcepto12 - ImporteAcumulado91
If ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, False, ImporteOtrosIngresos, Referencia, 91, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveVentaAmortizacion:=CveUltimaVenta, ImporteMX:=ImporteOtrosIngresos, ImporteME:=0, CveSubProyecto:=CveSubProyectoContabilizar, TipoCambio:=tipoCambio) Then
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, ImporteOtrosIngresos, Referencia, 211, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, ImporteME:=0, ImporteMX:=ImporteOtrosIngresos, CveSubProyecto:=CveSubProyectoContabilizar) Then
ErrorPrepoliza = True
End If
If ImporteConcepto12 <> ImporteAcumulado91 Then
Dim CveConceptoOtIngresos As Integer = 0
Dim IdCuentaContableOt As Integer = 0
Dim TipoMovtoOt As Boolean = False
If ImporteConcepto12 > ImporteAcumulado91 Then
IdCuentaContableOt = UsuarioActual.Empresa.Funcionalidad(559).ToEntero()
CveConceptoOtIngresos = 211
TipoMovtoOt = False
Else
IdCuentaContableOt = UsuarioActual.Empresa.IdCuentaOtrosIngresos
CveConceptoOtIngresos = 78
TipoMovtoOt = True
End If
Dim ImporteOtrosIngresos As Decimal = ImporteConcepto12 - ImporteAcumulado91
' If ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, False, ImporteOtrosIngresos, Referencia, 91, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveVentaAmortizacion:=CveUltimaVenta, ImporteMX:=ImporteOtrosIngresos, ImporteME:=0, CveSubProyecto:=CveSubProyectoContabilizar, TipoCambio:=tipoCambio) Then
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovtoOt, ImporteOtrosIngresos, Referencia, CveConceptoOtIngresos, Concepto, FechaMovimiento, IdCuentaContableOt, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, ImporteME:=0, ImporteMX:=ImporteOtrosIngresos, CveSubProyecto:=CveSubProyectoContabilizar) Then
ErrorPrepoliza = True
End If
'Else
' ErrorPrepoliza = True
'End If
End If
If ObjConta.ValidacionPrePolizaCuadre(ObjFactura.CvePrePoliza, 5) Then
If Not ErrorPrepoliza AndAlso ObjConta.ValidacionPrePolizaCuadre(ObjFactura.CvePrePoliza, 5) Then
If ObjConta.ValorPolizaDescuadre > 0 Then
'ErrorPrepoliza = True
GuardaLogAD($"Ventas/Ventas-ProcesoPrePolizas | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{ObjFactura.CvePrePoliza}", "LogPrePolizas")
@@ -11344,6 +11359,12 @@ Partial Class Ventas
End If
End If
'Simplificacion de PrePolizas
If ObjFactura.TipoDocto.Contiene("Egs", "Dev") Then
If Not ObjConta.PrePolizaSimplificacion(ObjFactura.CvePrePoliza, UsuarioActual.CveEmpresa) Then
Alert("No se pudo simplificar los movimientos", TipoMensaje.MsgError)
End If
End If
If ObjConta.ValidacionPrePolizaCuadre(ObjFactura.CvePrePoliza, 2) Then
If ObjConta.ValorPolizaDescuadre > 0 Then
@@ -11361,13 +11382,6 @@ Partial Class Ventas
End If
End If
'Simplificacion de PrePolizas
If ObjFactura.TipoDocto.Contiene("Egs", "Dev") Then
If Not ObjConta.PrePolizaSimplificacion(ObjFactura.CvePrePoliza, UsuarioActual.CveEmpresa) Then
Alert("No se pudo simplificar los movimientos", TipoMensaje.MsgError)
End If
End If
'EN CASO DE SER REFACTURACION DE ANTICIPO SE ACTUALIZAN LAS VENTAS APLICADAS HACIA EL NUEVO
If NuevaFactura = 1 AndAlso CveDevolucion > 0 AndAlso ObjFactura.TipoDocto.Contiene("Ant") Then
If Not ObjVentas.TraspasaVentasAplicadasAnt(ObjFactura.CveVenta, CveDevolucion, UsuarioActual.CveEmpresa) Then
@@ -22288,6 +22302,31 @@ Partial Class Ventas
End If
End If
End If
'SOLO APLICA SI NO HAY DOCUMENTOS QUE SELECCIONAR
If UsuarioActual.CveEmpresa = 140 Then
If GvCxC.Rows.Count = 0 OrElse GvCxC.Rows.Cast(Of GridViewRow)().Count(Function(gvr) gvr.FCCheckBox("ChkCxC").Checked) = 0 Then
Alert("No se ha seleccionado ninguna nota de crédito, en caso de no seleccionar ninguna se creará una nueva nota de crédito. ¿Está seguro de realizar esta acción?", TipoMensaje.MsgConfirmacion, JSBtnAceptar:="BtnAplicaNuevaNC();", TextoConfirmacion:="&nbsp;&nbsp;&nbsp;&nbsp;Si&nbsp;&nbsp;&nbsp;&nbsp;", TextoCancelacion:="&nbsp;&nbsp;&nbsp;&nbsp;No&nbsp;&nbsp;&nbsp;&nbsp;")
Else
AplicarNotaCreditoDesdeVenta()
End If
Else
AplicarNotaCreditoDesdeVenta()
End If
End Sub
Private Sub BtnAplicaNuevaNC_Click(sender As Object, e As EventArgs) Handles BtnAplicaNuevaNC.Click
If ListaRemisionesNC IsNot Nothing AndAlso ListaRemisionesNC.Count > 0 Then
AplicarNotaCreditoDesdeVenta(AplicaNuevoDocumento:=True)
Else
Alert("No ha seleccionado ninguna remisión de nota de crédito", TipoMensaje.MsgAdvertencia)
End If
End Sub
Private Sub AplicarNotaCreditoDesdeVenta(Optional AplicaNuevoDocumento As Boolean = False)
RegistraScript("$('#ModalAplicarNC').modal('hide');", "EscondeModalNC")
DdlTipoComprobante.SelectedValue = "Egs"
Dim AplicaImpuestosLocales As Boolean = False
@@ -22299,16 +22338,8 @@ Partial Class Ventas
End If
ObjCliente.Dispose()
Dim AplicaNuevoDocumento As Boolean = False
'SOLO APLICA SI NO HAY DOCUMENTOS QUE SELECCIONAR
If UsuarioActual.CveEmpresa = 140 AndAlso GvCxC.Rows.Count = 0 Then
AplicaNuevoDocumento = True
End If
AplicarNC(DdlNCPS.SelectedValue.ToEntero(), EsNCAmortizacion:=ChkAplicaNCAnticipo.Checked, AplicaImpuestosLocales:=AplicaImpuestosLocales, AplicaNuevoDocumento:=AplicaNuevoDocumento)
RegistraScript("$('#ModalAplicarNC').modal('hide');", "EscondeModalNC")
End Sub
Private Sub AplicarNC(CvePS As Integer, Optional NCDescuento As Boolean = False, Optional EsNCAmortizacion As Boolean = False, Optional AplicaImpuestosLocales As Boolean = True, Optional AplicaNuevoDocumento As Boolean = False)