--Correciones de facturacion global

This commit is contained in:
2024-02-12 18:26:16 -07:00
parent 7b909094e5
commit 5261cf1bd3
2 changed files with 47 additions and 7 deletions

View File

@@ -49,6 +49,10 @@ Partial Class Ventas_FacturacionGlobal
DdlAnio.Items.Add(New ListItem(Anio.ToString(), Anio.ToString()))
DdlAnio.Items.Add(New ListItem(AnioAnterior.ToString(), AnioAnterior.ToString()))
txtFechaI.Text = Now.AddDays(-1).ToString("dd/MM/yyyy")
txtFechaF.Text = Now.ToString("dd/MM/yyyy")
End Sub
Protected Sub DdlPeriodo_SelectedIndexChanged(sender As Object, e As EventArgs)
@@ -58,6 +62,7 @@ Partial Class Ventas_FacturacionGlobal
DdlMes.DataSource = GlobalDTGralSATMeses().FiltraParametros("ISNULL(CveSATPeriodicidad,0) <> 5")
End If
DdlMes.DataBind()
DdlMes.Items.Insert(0, New ListItem("Seleccione", "-1"))
UPFiltros.Update()
End Sub
@@ -128,8 +133,15 @@ Partial Class Ventas_FacturacionGlobal
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("CveVenta").ToEntero() > 0 Then
e.Row.FCCheckBox("chkDis").Visible = True
If e.Row.DBCampo("Saldo").ToDecimal() > 0 Then
e.Row.FCCheckBox("chkDis").Enabled = False
e.Row.FCCheckBox("chkDis").ToolTip = "No se puede seleccionar esta remisión porque no ha sido pagada"
Else
e.Row.FCCheckBox("chkDis").Enabled = True
e.Row.FCCheckBox("chkDis").CssClass = "ChkAllEvt"
End If
Else
e.Row.FCCheckBox("chkDis").Visible = False
e.Row.CssClass = "Totales"
End If
End If
@@ -137,7 +149,7 @@ Partial Class Ventas_FacturacionGlobal
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs)
Dim CveCliente As Integer = UsuarioActual.Empresa.Funcionalidad(714).ToEntero()
Dim CveMoneda As Integer = -1
Dim CveMoneda As Integer = 1
Dim SbRemisiones As New StringBuilder()
Dim RemisionesLista As New List(Of Integer)
@@ -171,6 +183,26 @@ Partial Class Ventas_FacturacionGlobal
End If
ObjClientes.Dispose()
If DtRemisionesPS Is Nothing OrElse DtRemisionesPS.Rows.Count = 0 Then
Alert("No se pudieron cargar las remsiones para facturar", TipoMensaje.MsgError)
Exit Sub
End If
If DtPagos Is Nothing OrElse DtPagos.Rows.Count = 0 Then
Alert("No se pudieron cargar los pagos", TipoMensaje.MsgError)
Exit Sub
End If
If Me.CveSubProyecto <= 0 Then
Alert("No se pudo cargar la sucursal", TipoMensaje.MsgError)
Exit Sub
End If
If CveCliente <= 0 Then
Alert("No se pudo cargar el cliente", TipoMensaje.MsgError)
Exit Sub
End If
Dim ObjFactura = Modelos.Factura.CrearVentaNueva(UsuarioActual, Me.CveSubProyecto, CveCliente, CveMoneda, "Ing")
ObjFactura.EsFacturaGlobal = True
ObjFactura.CveSATPeriodicidad = DdlPeriodo.SelectedValue.ToEntero()
@@ -188,6 +220,12 @@ Partial Class Ventas_FacturacionGlobal
ObjFactura.CalculaTotales()
ObjFactura.PreparaTimbre()
If ObjFactura.Total <> DtPagos.SUMD("Importe") Then
Alert("Los pagos no coinciden con el total de la factura", TipoMensaje.MsgError)
Exit Sub
End If
'ObjFactura.DtInventario = ObjFactura.DtDetalle.FiltraParametros("CveTipoPs = 2")
Dim SbAlert As New StringBuilder()