This commit is contained in:
2021-09-07 12:54:08 -07:00
23 changed files with 944 additions and 343 deletions

View File

@@ -85,7 +85,7 @@ Partial Class Ventas_CatImpuestosLocales
Dim TieneError = False
Dim CveImpuestoLocal As Integer = GvImpuestos.Rows(e.RowIndex).DataKey("CveImpuestoLocal").ToEntero
Dim Impuesto As String = GvImpuestos.Rows(e.RowIndex).FCTextBox("TxtImpuestoLocal").Text.Trim
Dim Porcentaje As Double = GvImpuestos.Rows(e.RowIndex).FCTextBox("TxtVentaPorcentaje").Text.ToDouble
Dim Porcentaje As Decimal = GvImpuestos.Rows(e.RowIndex).FCTextBox("TxtVentaPorcentaje").Text.ToDecimal
Dim Orden = GvImpuestos.Rows(e.RowIndex).FCTextBox("TxtOrdenImpuesto").Text.ToEntero
Dim TipoImpuesto = GvImpuestos.Rows(e.RowIndex).FCDropDownList("DdlTipoImpuestoEdit").SelectedValue.ToEntero
Dim IdCtaContable = GvImpuestos.Rows(e.RowIndex).FCDropDownList("DdlCuentasContables").SelectedValue.ToEntero
@@ -199,7 +199,7 @@ Partial Class Ventas_CatImpuestosLocales
If CveImpuestoLocal = -1 Then
If ChkEstatus.Checked Then Estatus = 1
If ObjVentas.AddImpuestosLocales(TxtImpuesto.Text.Trim, TxtPorcentaje.Text.ToDouble, TxtOrden.Text.ToEntero, DdlTipoImpuesto.SelectedValue.ToEntero, Estatus, DdlCuentasContables.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
If ObjVentas.AddImpuestosLocales(TxtImpuesto.Text.Trim, TxtPorcentaje.Text.ToDecimal, TxtOrden.Text.ToEntero, DdlTipoImpuesto.SelectedValue.ToEntero, Estatus, DdlCuentasContables.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
CargaDatos()
End If
TxtImpuesto.Text = ""
@@ -210,7 +210,7 @@ Partial Class Ventas_CatImpuestosLocales
If CveImpuestoLocal <> -1 Then
Dim TieneError = False
Dim Impuesto As String = TxtImpuesto.Text.Trim
Dim Porcentaje As Double = TxtPorcentaje.Text.ToDouble
Dim Porcentaje As Decimal = TxtPorcentaje.Text.ToDecimal
Dim Orden = TxtOrden.Text.ToEntero
Dim TipoImpuesto = DdlTipoImpuesto.SelectedValue.ToEntero
Dim IdCtaContable = DdlCuentasContables.SelectedValue.ToEntero

View File

@@ -688,7 +688,7 @@ Partial Class PV
Get
Return New Dictionary(Of Integer, Decimal) From {
{20516, 0.23D}, 'Descuento para lubricantes LTH
{20515, 0.24D} 'Descuento para filtros LTH
{20515, 0.274D} 'Descuento para filtros LTH
}
End Get
End Property

View File

@@ -280,19 +280,19 @@ Partial Class PopUpBuscarFolio
End Sub
Private Function ValidarUnFiltroSeleccionado() As Boolean
If DdlClasificacion.SelectedValue.ToEntero > 0 Then Return True
If DdlTipoDocto.SelectedValue <> "-1" Then Return True
If DdlSubProyecto.SelectedValue.ToEntero > 0 Then Return True
If DdlEstatusFactura.SelectedValue.ToEntero > 0 Then Return True
If DdlUsuario.SelectedValue.ToEntero > 0 Then Return True
If DdlPS.SelectedValue.ToEntero > 0 Then Return True
If TxtFolio.Text.Trim.Length > 0 Then Return True
If DdlNombre.SelectedValue.ToEntero > 0 Then Return True
If TxtFolioFiscal.Text.Trim.Length > 0 Then Return True
If TxtPedidoContrato.Text.Length > 0 Then Return True
If TxtOrdenCompra.Text.Length > 0 Then Return True
'If DdlClasificacion.SelectedValue.ToEntero > 0 Then Return True
'If DdlTipoDocto.SelectedValue <> "-1" Then Return True
'If DdlSubProyecto.SelectedValue.ToEntero > 0 Then Return True
'If DdlEstatusFactura.SelectedValue.ToEntero > 0 Then Return True
'If DdlUsuario.SelectedValue.ToEntero > 0 Then Return True
'If DdlPS.SelectedValue.ToEntero > 0 Then Return True
'If TxtFolio.Text.Trim.Length > 0 Then Return True
'If DdlNombre.SelectedValue.ToEntero > 0 Then Return True
'If TxtFolioFiscal.Text.Trim.Length > 0 Then Return True
'If TxtPedidoContrato.Text.Length > 0 Then Return True
'If TxtOrdenCompra.Text.Length > 0 Then Return True
Return False
Return True
End Function
End Class

View File

@@ -211,6 +211,44 @@
</div>
<div class="row" id="divBitacora" runat="server" visible="false">
<asp:UpdatePanel runat="server" ID="UpHistorialModificacion" UpdateMode="Conditional">
<ContentTemplate>
<div class="col-md-12">
<div class="portlet light bordered xspadding">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Historial de Modificación</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
</div>
<div class="portlet-body">
<asp:GridView ID="GvBitacora" runat="server" GridLines="None" Width="100%" CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" data-sort="true" CellSpacing="0" AutoGenerateColumns="False">
<Columns>
<asp:TemplateField HeaderText="Fecha" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("FechaIng") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="ConceptoHistorialBitacora" HeaderText="Campo" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Anterior" HeaderText="Anterior" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Actual" HeaderText="Actual" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Usuario" HeaderText="Usuario" ItemStyle-HorizontalAlign="Left" />
</Columns>
</asp:GridView>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<table width="100%">
<tr>
<td align="center">

View File

@@ -17,6 +17,16 @@ Partial Class Ventas_Promociones
ViewState("TempDT") = value
End Set
End Property
Private Property TempDTOrigial As DataTable
Get
Return CType(ViewState("TempDTOrigial"), DataTable)
End Get
Set(value As DataTable)
ViewState("TempDTOrigial") = value
End Set
End Property
Private Property CvePromocion As Integer
Get
Return ViewState("CvePromocion").ToString.ToEntero
@@ -46,6 +56,7 @@ Partial Class Ventas_Promociones
#End Region
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
CvePromocion = -1
CargaValoresIniciales()
@@ -53,16 +64,46 @@ Partial Class Ventas_Promociones
If Request("CvePromocion") IsNot Nothing AndAlso Request("CvePromocion").ToString.ToEntero > 0 Then
CvePromocion = Request("CvePromocion").ToString.ToEntero
CargaDatos()
Else
ChkEstatus.Enabled = True
ChkEstatus.Checked = True
CreaDT()
End If
CargaGvBitacora()
End If
End Sub
#Region "BITACORA"
Private Sub CargaGvBitacora()
If CvePromocion > 0 Then
divBitacora.Visible = True
Dim ObjGral As New ClsGenerales()
If ObjGral.GetHistorialBitacora(-1, -1, -1, -1, -1, -1, -1, UsuarioActual.CveEmpresa, CvePromocion:=CvePromocion) Then
GvBitacora.DataSource = ObjGral.DtResultados
End If
ObjGral.Dispose()
GvBitacora.DataBind()
UpHistorialModificacion.Update()
Else
divBitacora.Visible = False
End If
End Sub
#End Region
#Region " VALORES INICIALES "
Private Sub CargaValoresIniciales()
@@ -148,6 +189,32 @@ Partial Class Ventas_Promociones
TempDT.Columns.Add("AplicaDomingo", GetType(Boolean))
TempDT.Columns.Add("IncluyeImpuestos", GetType(Boolean))
TempDTOrigial = TempDT.Copy
'366 Estatus
'367 CvePS
'368 PUPromocion
'369 CveTipoPromocion
'370 Cantidad Minima
'371 AplicaRestriccion
'372 HoraInicio
'373 HoraFin
'374 AplicaLunes
'375 AplicaMartes
'376 AplicaMiercoles
'377 AplicaJueves
'378 AplicaViernes
'379 AplicaSabado
'380 AplicaDomingo
'381 IncluyeImpuestos
End Sub
#Region " PS "
@@ -197,7 +264,8 @@ Partial Class Ventas_Promociones
DdlTipoAplicacion.SelectedValueExist(Dr("TipoAplicacion").ToString)
If ObjVentas.GetPromocionesDetalle(CvePromocion, UsuarioActual.CveEmpresa) Then
TempDT = ObjVentas.DtResultados
TempDT = ObjVentas.DtResultados.Copy
TempDTOrigial = ObjVentas.DtResultados.Copy
CargaGrid()
Else
Alert("Ocurrió un error al consultar los detalles de la promoción. Por favor vuelva a intentar.", TipoMensaje.MsgError)
@@ -324,6 +392,9 @@ Partial Class Ventas_Promociones
Dr("AplicaDomingo") = False
End If
Dr("IncluyeImpuestos") = ChkIncluyeImpuesto.Checked
If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
Dr("CveRinTamaño") = DdlRin.SelectedValue.ToEntero
Else
@@ -456,9 +527,12 @@ Partial Class Ventas_Promociones
Dim CveCliente As Integer = If(DdlClientes.SelectedValue = "", -1, DdlClientes.SelectedValue.ToEntero)
Dim ObjVentas As New ClsVentas
Dim TieneError = False
ObjVentas.IniciaTransacSQL()
Dim ObjGral As New ClsGenerales(ObjVentas.IniciaTransacSQL)
If ObjVentas.UpdatePromociones(TxtPromocion.Text.Trim, If(IsDate(TxtFechaI.Text), TxtFechaI.Text.ToDate, MinFecha), If(IsDate(TxtFechaF.Text), TxtFechaF.Text.ToDate, MaxFecha),
DdlVendedor.SelectedValue.ToEntero, CveCliente, ChkEstatus.Checked, DdlMoneda.SelectedValue.ToEntero, UsuarioActual.CveUsuario,
CvePromocion, DdlSubProyecto.SelectedValue.ToEntero, DdlTipoAplicacion.SELECTEDVALUE.TOENTERO, UsuarioActual.CveEmpresa, CveMarca:=DdlMarca.SelectedValue.ToEntero) Then
@@ -470,6 +544,18 @@ Partial Class Ventas_Promociones
TieneError = True
Exit For
End If
If Not TieneError Then
If Not ObjGral.AddHistorialBitacora(364, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, "", Dr("CodigoPS").ToString, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, "Se elimino " & Dr("CodigoPS").ToString, "PS", "", CvePromocion:=CvePromocion) Then
TieneError = True
Exit For
End If
End If
Next
If Not TieneError Then
@@ -480,6 +566,171 @@ Partial Class Ventas_Promociones
TieneError = True
Exit For
End If
If Not TieneError Then
'366 Estatus
'367 CvePS
'368 PUPromocion
'369 CveTipoPromocion
'370 Cantidad Minima
'371 AplicaRestriccion
'372 HoraInicio
'373 HoraFin
'374 AplicaLunes
'375 AplicaMartes
'376 AplicaMiercoles
'377 AplicaJueves
'378 AplicaViernes
'379 AplicaSabado
'380 AplicaDomingo
'381 IncluyeImpuestos
Dim Dr2 As DataRow = TempDTOrigial.FiltraParametros($"CvePromocionDetalle = {Dr("CvePromocionDetalle").ToString}").Rows(0)
If Not TieneError And Dr("CvePS").ToString <> Dr2("CvePS").ToString Then
If Not ObjGral.AddHistorialBitacora(367, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Dr("CodigoPS").ToString, Dr2("CodigoPS").ToString, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, "Se elimino " & Dr("CodigoPS").ToString, "PS", "", CvePromocion:=CvePromocion) Then
TieneError = True
Exit For
End If
End If
If Not TieneError And Dr("CveTipoPromocion").ToString <> Dr2("CveTipoPromocion").ToString Then
If Not ObjGral.AddHistorialBitacora(369, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Dr2("TipoPromocion").ToString, $"{Dr("CodigoPS").ToString} - {Dr("TipoPromocion").ToString}", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, "Se elimino " & Dr("CodigoPS").ToString, "PS", "", CvePromocion:=CvePromocion) Then
TieneError = True
Exit For
End If
End If
If Not TieneError And Dr("CantidadMinima").ToString <> Dr2("CantidadMinima").ToString Then
If Not ObjGral.AddHistorialBitacora(370, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Dr2("CantidadMinima").ToString, $"{Dr("CodigoPS").ToString} - {Dr("CantidadMinima").ToString}", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, "Se elimino " & Dr("CodigoPS").ToString, "PS", "", CvePromocion:=CvePromocion) Then
TieneError = True
Exit For
End If
End If
'If Not TieneError And Dr("AplicaRestriccion").ToString <> Dr2("AplicaRestriccion").ToString Then
' If Not ObjGral.AddHistorialBitacora(371, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Dr2("AplicaRestriccion").ToString, $"{Dr("CodigoPS").ToString} - {Dr("AplicaRestriccion").ToString}", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, "Se elimino " & Dr("CodigoPS").ToString, "PS", "", CvePromocion:=CvePromocion) Then
' TieneError = True
' Exit For
' End If
'End If
If Not TieneError And Dr("HoraInicio").ToString <> Dr2("HoraInicio").ToString Then
If Not ObjGral.AddHistorialBitacora(372, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Dr2("HoraInicio").ToString, $"{Dr("CodigoPS").ToString} - {Dr("HoraInicio").ToString}", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, "Se elimino " & Dr("CodigoPS").ToString, "PS", "", CvePromocion:=CvePromocion) Then
TieneError = True
Exit For
End If
End If
If Not TieneError And Dr("HoraFin").ToString <> Dr2("HoraFin").ToString Then
If Not ObjGral.AddHistorialBitacora(373, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Dr2("HoraFin").ToString, $"{Dr("CodigoPS").ToString} - {Dr("HoraFin").ToString}", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, "Se elimino " & Dr("CodigoPS").ToString, "PS", "", CvePromocion:=CvePromocion) Then
TieneError = True
Exit For
End If
End If
If Not TieneError And Dr("AplicaLunes").ToString <> Dr2("AplicaLunes").ToString Then
Dim EstadoAnterior As String = If(Boolean.Parse(Dr2("AplicaLunes").ToString), "Aplica", "No aplica")
Dim EstadoActual As String = If(Boolean.Parse(Dr("AplicaLunes").ToString), "Aplica", "No aplica")
If Not ObjGral.AddHistorialBitacora(374, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, EstadoActual, $"{Dr("CodigoPS").ToString} - { EstadoAnterior }", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, "Se elimino " & Dr("CodigoPS").ToString, "PS", "", CvePromocion:=CvePromocion) Then
TieneError = True
Exit For
End If
End If
If Not TieneError And Dr("AplicaMartes").ToString <> Dr2("AplicaMartes").ToString Then
Dim EstadoAnterior As String = If(Boolean.Parse(Dr2("AplicaMartes").ToString), "Aplica", "No aplica")
Dim EstadoActual As String = If(Boolean.Parse(Dr("AplicaMartes").ToString), "Aplica", "No aplica")
If Not ObjGral.AddHistorialBitacora(375, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, EstadoActual, $"{Dr("CodigoPS").ToString} - { EstadoAnterior }", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, "Se elimino " & Dr("CodigoPS").ToString, "PS", "", CvePromocion:=CvePromocion) Then
TieneError = True
Exit For
End If
End If
If Not TieneError And Dr("AplicaMiercoles").ToString <> Dr2("AplicaMiercoles").ToString Then
Dim EstadoAnterior As String = If(Boolean.Parse(Dr2("AplicaMiercoles").ToString), "Aplica", "No aplica")
Dim EstadoActual As String = If(Boolean.Parse(Dr("AplicaMiercoles").ToString), "Aplica", "No aplica")
If Not ObjGral.AddHistorialBitacora(376, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, EstadoActual, $"{Dr("CodigoPS").ToString} - { EstadoAnterior }", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, "Se elimino " & Dr("CodigoPS").ToString, "PS", "", CvePromocion:=CvePromocion) Then
TieneError = True
Exit For
End If
End If
If Not TieneError And Dr("AplicaJueves").ToString <> Dr2("AplicaJueves").ToString Then
Dim EstadoAnterior As String = If(Boolean.Parse(Dr2("AplicaJueves").ToString), "Aplica", "No aplica")
Dim EstadoActual As String = If(Boolean.Parse(Dr("AplicaJueves").ToString), "Aplica", "No aplica")
If Not ObjGral.AddHistorialBitacora(377, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, EstadoActual, $"{Dr("CodigoPS").ToString} - { EstadoAnterior }", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, "Se elimino " & Dr("CodigoPS").ToString, "PS", "", CvePromocion:=CvePromocion) Then
TieneError = True
Exit For
End If
End If
If Not TieneError And Dr("AplicaViernes").ToString <> Dr2("AplicaViernes").ToString Then
Dim EstadoAnterior As String = If(Boolean.Parse(Dr2("AplicaViernes").ToString), "Aplica", "No aplica")
Dim EstadoActual As String = If(Boolean.Parse(Dr("AplicaViernes").ToString), "Aplica", "No aplica")
If Not ObjGral.AddHistorialBitacora(378, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, EstadoActual, $"{Dr("CodigoPS").ToString} - { EstadoAnterior }", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, "Se elimino " & Dr("CodigoPS").ToString, "PS", "", CvePromocion:=CvePromocion) Then
TieneError = True
Exit For
End If
End If
If Not TieneError And Dr("AplicaSabado").ToString <> Dr2("AplicaSabado").ToString Then
Dim EstadoAnterior As String = If(Boolean.Parse(Dr2("AplicaSabado").ToString), "Aplica", "No aplica")
Dim EstadoActual As String = If(Boolean.Parse(Dr("AplicaSabado").ToString), "Aplica", "No aplica")
If Not ObjGral.AddHistorialBitacora(379, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, EstadoActual, $"{Dr("CodigoPS").ToString} - { EstadoAnterior }", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, "Se elimino " & Dr("CodigoPS").ToString, "PS", "", CvePromocion:=CvePromocion) Then
TieneError = True
Exit For
End If
End If
If Not TieneError And Dr("AplicaDomingo").ToString <> Dr2("AplicaDomingo").ToString Then
Dim EstadoAnterior As String = If(Boolean.Parse(Dr2("AplicaDomingo").ToString), "Aplica", "No aplica")
Dim EstadoActual As String = If(Boolean.Parse(Dr("AplicaDomingo").ToString), "Aplica", "No aplica")
If Not ObjGral.AddHistorialBitacora(380, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, EstadoActual, $"{Dr("CodigoPS").ToString} - { EstadoAnterior }", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, "Se elimino " & Dr("CodigoPS").ToString, "PS", "", CvePromocion:=CvePromocion) Then
TieneError = True
Exit For
End If
End If
If Not TieneError And Dr("IncluyeImpuestos").ToString <> Dr2("IncluyeImpuestos").ToString Then
Dim EstadoAnterior As String = If(Boolean.Parse(Dr2("IncluyeImpuestos").ToString), "Incluye", "No Incluye")
Dim EstadoActual As String = If(Boolean.Parse(Dr("IncluyeImpuestos").ToString), "Incluye", "No Incluye")
If Not ObjGral.AddHistorialBitacora(381, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, EstadoActual, $"{Dr("CodigoPS").ToString} - { EstadoAnterior }", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, "Se elimino " & Dr("CodigoPS").ToString, "PS", "", CvePromocion:=CvePromocion) Then
TieneError = True
Exit For
End If
End If
End If
Next
End If
@@ -489,6 +740,16 @@ Partial Class Ventas_Promociones
TieneError = True
Exit For
End If
If Not TieneError Then
If Not ObjGral.AddHistorialBitacora(365, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, "", Dr("CodigoPS").ToString, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, "Se elimino " & Dr("CodigoPS").ToString, "PS", "", CvePromocion:=CvePromocion) Then
TieneError = True
Exit For
End If
End If
Next
End If
@@ -511,6 +772,7 @@ Partial Class Ventas_Promociones
#Region " ELIMINAR "
Protected Sub BtnEliminar_Click(sender As Object, e As EventArgs)
Dim ObjVentas As New ClsVentas
ObjVentas.IniciaTransacSQL()
Dim TieneError = False
@@ -541,4 +803,13 @@ Partial Class Ventas_Promociones
' DivCantMinima.Visible = False
' End If
'End Sub
End Class

View File

@@ -154,6 +154,10 @@ Partial Class Ventas_RepVentasUtilidadDetalle
DdlPS.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
End If
DdlMarcas.DataSource = GlobalDTGralMarcas(UsuarioActual.CveEmpresa)
DdlMarcas.DataBind()
DdlMarcas.Items.Insert(0, New ListItem("Todas", "-1"))
'Cargo Clasificaciones
DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa)
DdlClasificacion.DataBind()

View File

@@ -3271,7 +3271,12 @@ Partial Class Ventas
If ObjContratos.GetContratos(-1, UsuarioActual.CveEmpresa, CveCliente, -1, 1) Then
If ObjContratos.DtResultados.FiltraParametros("Estatus = True").Rows.Count > 0 AndAlso (DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ped") Or DdlTipoComprobante.SelectedValue.Contiene("Egs", "Dev")) Then
DtContratos = ObjContratos.DtResultados.FiltraParametros($"Estatus = True AND FechaFinal >= '{Now.ToShortDateString}' AND FechaInicial <= '{Now.ToShortDateString}'")
If UsuarioActual.CveEmpresa.Contiene(72, 80) Then
DtContratos = ObjContratos.DtResultados.FiltraParametros($"Estatus = True AND FechaFinal >= '{Now.ToShortDateString}' AND FechaInicial <= '{Now.ToShortDateString}'")
Else
DtContratos = ObjContratos.DtResultados.FiltraParametros($"Estatus = True ")
End If
If AfterPageLoad Then
RegistraScript("window.onload = function MuestraContratos() { document.getElementById(""C_BtnMostrarContrato"").click(); }")
@@ -8472,10 +8477,10 @@ Partial Class Ventas
If AutoConta Then
If idCuentaContabilizacion > 0 Then
If ObjConta.ContabilizarPrePoliza(ObjFactura.CvePrePoliza, ObjFactura.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjContPaq) Then
If ObjContPaq IsNot Nothing Then ObjContPaq.Commit()
Else
Alert("Ocurrio un Error al contabilizar, pongase en contacto con Soporte Técnico", TipoMensaje.MsgError)
If ObjContPaq IsNot Nothing Then ObjContPaq.RollBack()
End If
Else
Alert(String.Format("Falta asignación de las siguientes cuentas contables: {0}", CuentasContablesInvalidas), TipoMensaje.MsgAdvertencia)
@@ -8483,7 +8488,7 @@ Partial Class Ventas
End If
End If
If ObjContPaq IsNot Nothing Then ObjContPaq.Commit()
'If ObjContPaq IsNot Nothing Then ObjContPaq.RollBack()
'RMF, cuando es pedido, se manda autorización.
@@ -10693,7 +10698,7 @@ Partial Class Ventas
.CuentaPredial = drr("CuentaPredial").ToString(),
.ImporteGravaIVAAdicional = drr("ImporteIEPS").ToString().ToDecimal}
'verifica suma subtotales
If i = Obj.DtDetalle.Rows.Count AndAlso totSubTotal <> concepto.Importe Then 'proceso de ajusta de decimales
If i = Obj.DtDetalle.Rows.Count AndAlso totSubTotal.RoundSQL(2) <> concepto.Importe.RoundSQL(2) AndAlso Math.Abs(totSubTotal.RoundSQL(2) - concepto.Importe.RoundSQL(2)) <= 0.01 Then 'proceso de ajusta de decimales
concepto.Importe = totSubTotal
End If
totSubTotal = totSubTotal - concepto.Importe
@@ -10703,19 +10708,19 @@ Partial Class Ventas
'si es ingreso amortizado por la totalidad, y arroja el valor total de cero, no debe de impuestos, y si la BASE de calculo es mayor a cero
If Timbre.Comprobante.Total > 0 AndAlso concepto.Importe - concepto.Descuento + concepto.ImporteGravaIVAAdicional > 0 Then
concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "T", .Base = concepto.Importe - concepto.Descuento + concepto.ImporteGravaIVAAdicional, .TasaOCuota = drr("PorcentajeIVA").ToString().ToDecimal, .Impuesto = "002", .Importe = drr("ImporteIVA").ToString().ToDecimal})
concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "T", .Base = (concepto.Importe - concepto.Descuento + concepto.ImporteGravaIVAAdicional).RoundSQL(6), .TasaOCuota = drr("PorcentajeIVA").ToString().ToDecimal, .Impuesto = "002", .Importe = drr("ImporteIVA").ToString().ToDecimal})
End If
If drr("ImporteIEPS").ToString().ToDouble > 0 Then
concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "T", .Base = concepto.Importe - concepto.Descuento, .TasaOCuota = drr("PorcentajeIEPS").ToString().ToDecimal, .Impuesto = "003", .Importe = drr("ImporteIEPS").ToString().ToDecimal})
concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "T", .Base = (concepto.Importe - concepto.Descuento).RoundSQL(6), .TasaOCuota = drr("PorcentajeIEPS").ToString().ToDecimal, .Impuesto = "003", .Importe = drr("ImporteIEPS").ToString().ToDecimal})
End If
If drr("ImporteRetIVA").ToString().ToDouble > 0 Then 'si hay retenciones
concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "R", .Base = concepto.Importe - concepto.Descuento, .TasaOCuota = drr("PorcentajeRetIVA").ToString().ToDecimal, .Impuesto = "002", .Importe = drr("ImporteRetIVA").ToString().ToDecimal})
concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "R", .Base = (concepto.Importe - concepto.Descuento).RoundSQL(6), .TasaOCuota = drr("PorcentajeRetIVA").ToString().ToDecimal, .Impuesto = "002", .Importe = drr("ImporteRetIVA").ToString().ToDecimal})
End If
If drr("ImporteRetISR").ToString().ToDouble > 0 Then 'retención de ISR
concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "R", .Base = concepto.Importe - concepto.Descuento, .TasaOCuota = drr("PorcentajeRetISR").ToString().ToDecimal, .Impuesto = "001", .Importe = drr("ImporteRetISR").ToString().ToDecimal})
concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "R", .Base = (concepto.Importe - concepto.Descuento).RoundSQL(6), .TasaOCuota = drr("PorcentajeRetISR").ToString().ToDecimal, .Impuesto = "001", .Importe = drr("ImporteRetISR").ToString().ToDecimal})
End If
Timbre.Conceptos.Add(concepto)
@@ -13256,9 +13261,6 @@ Partial Class Ventas
End If
Dim ModalidadRefacturacion As Integer = UsuarioActual.Empresa.Funcionalidad(586).ToEntero()
If UsuarioActual.CveUsuario.Contiene(100, 1719) Then
ModalidadRefacturacion = 2
End If
'REFACTURACION CON PAGOS, DEBE CANCELAR SALDOS DEL DOCUMENTO ANTERIOR Y TRASPASAR PAGOS AL NUEVO
If ModalidadRefacturacion = 2 AndAlso ObjFactura.TipoDocto.Contiene("Ing", "Ant") AndAlso ObjFactura.NuevaFactura = 1 Then
@@ -20218,7 +20220,7 @@ Partial Class Ventas
For Each Row As DataRow In TmpDT.Rows
Dim CveVentaDetalle As Integer = Row("CveVentaDetalle").ToString().ToEntero()
If CveVentaDetalle > 0 Then
If Not ObjVentas.UpdateVentaDetalleRemision(Row("CveVentaDetalle").ToString().ToEntero(), Row("CvePS").ToString().ToEntero(), Row("Cantidad").ToString().ToDecimal, Row("PU").ToString().ToDecimal(), Row("ImporteIEPS").ToString().ToDecimal(), Row("PorcentajeIEPS").ToString().ToDecimal(), Row("ImporteIVA").ToString().ToDecimal(), Row("PorcentajeIVA").ToString().ToDecimal(), Row("Obs").ToString(), UsuarioActual.CveUsuario) Then
If Not ObjVentas.UpdateVentaDetalleRemision(Row("CveVentaDetalle").ToString().ToEntero(), Row("CvePS").ToString().ToEntero(), Row("Cantidad").ToString().ToDecimal, Row("PU").ToString().ToDecimal(), Row("ImporteIEPS").ToString().ToDecimal(), Row("PorcentajeIEPS").ToString().ToDecimal(), Row("ImporteIVA").ToString().ToDecimal(), Row("PorcentajeIVA").ToString().ToDecimal(), Row("Descuento").ToString().ToDecimal(), Row("Obs").ToString(), UsuarioActual.CveUsuario) Then
OcurrioError = True
Exit For
End If
@@ -31508,7 +31510,7 @@ Partial Class Ventas
Dim Respuesta As Boolean = False
If EscontratoObra Then
If EscontratoObra AndAlso PorAmortizacionAnticipo > 0 Then ' si es contrato de obra y tiene amortización de anticipo
If DdlTipoComprobante.SelectedValue = "Ing" Then
@@ -31529,7 +31531,7 @@ Partial Class Ventas
Respuesta = True
Else
Respuesta = False
Alert("Debe de seleccioanr un importe de amortización.", TipoMensaje.MsgAdvertencia)
Alert("Debe de seleccionar un importe de amortización.", TipoMensaje.MsgAdvertencia)
End If
Else