This commit is contained in:
2024-06-21 11:43:31 -07:00
13 changed files with 1495 additions and 1122 deletions

View File

@@ -574,7 +574,7 @@ Public Class ClsCompras
DataAdapter("PA_Comp_CompraDetalleRemove") DataAdapter("PA_Comp_CompraDetalleRemove")
SqlAdapter.SelectCommand.CommandTimeout = 0
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
.Add("@CveCompraDetalle", SqlDbType.Int).Value = CveCompraDetalle .Add("@CveCompraDetalle", SqlDbType.Int).Value = CveCompraDetalle
End With End With

View File

@@ -117,7 +117,9 @@ Public Class ClsMovimientos
#Region "CxC" #Region "CxC"
Public Function GetCxCClienteDetalle(CveCliente As Integer, FechaI As String, FechaF As String, CveMoneda As Integer, CveSubProyecto As Integer, CveEmpresa As Integer, CveClienteSucursal As Integer, Optional TipoDocto As String = "-1", Optional FechaCorte As Date = MaxFecha, Optional FechaVencimientoI As Date = MinFecha, Optional FechaVencimientoF As Date = MaxFecha) As Boolean Public Function GetCxCClienteDetalle(CveCliente As Integer, FechaI As String, FechaF As String, CveMoneda As Integer, CveSubProyecto As Integer, CveEmpresa As Integer, CveClienteSucursal As Integer, Optional TipoDocto As String = "-1",
Optional FechaCorte As Date = MaxFecha, Optional FechaVencimientoI As Date = MinFecha, Optional FechaVencimientoF As Date = MaxFecha, Optional Opcion As Integer = 1, Optional SaldoMayorA As Decimal = -999999999999,
Optional SaldoMenorA As Decimal = 999999999999) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
FechaCorte = IIf(FechaCorte = Nothing, ClsPaginas.NowADS().AddYears(1), FechaCorte).ToString.ToDate FechaCorte = IIf(FechaCorte = Nothing, ClsPaginas.NowADS().AddYears(1), FechaCorte).ToString.ToDate
@@ -135,6 +137,9 @@ Public Class ClsMovimientos
.Add("@FechaCorte", SqlDbType.Date).Value = FechaCorte .Add("@FechaCorte", SqlDbType.Date).Value = FechaCorte
.Add("@FechaVencimientoI", SqlDbType.Date).Value = FechaVencimientoI .Add("@FechaVencimientoI", SqlDbType.Date).Value = FechaVencimientoI
.Add("@FechaVencimientoF", SqlDbType.Date).Value = FechaVencimientoF .Add("@FechaVencimientoF", SqlDbType.Date).Value = FechaVencimientoF
.Add("@Opcion", SqlDbType.Int).Value = Opcion
.Add("@SaldoMayorA", SqlDbType.Money).Value = SaldoMayorA
.Add("@SaldoMenorA", SqlDbType.Money).Value = SaldoMenorA
End With End With
Try Try

View File

@@ -1948,7 +1948,7 @@ Partial Class Compras_Compras
For Each concepto As XmlNode In nodeconceptos For Each concepto As XmlNode In nodeconceptos
' Obtener la descripción del concepto ' Obtener la descripción del concepto
Dim descripcion As String = ValorXML(concepto, "Descripcion") Dim descripcion As String = ValorXML(concepto, "Descripcion")
Dim importeValue As Decimal = Decimal.Parse(ValorXML(concepto, "Importe")) Dim importeValue As Decimal = Decimal.Parse(ValorXML(concepto, "Importe")).RoundSQL(2)
' Seleccionar el nodo de Impuestos dentro de Concepto, si existe ' Seleccionar el nodo de Impuestos dentro de Concepto, si existe
Dim impuestosNode As XmlNode = concepto.SelectSingleNode("cfdi:Impuestos", namespaces) Dim impuestosNode As XmlNode = concepto.SelectSingleNode("cfdi:Impuestos", namespaces)
@@ -1958,7 +1958,7 @@ Partial Class Compras_Compras
Dim retenciones As XmlNodeList = impuestosNode.SelectNodes("cfdi:Retenciones/cfdi:Retencion", namespaces) Dim retenciones As XmlNodeList = impuestosNode.SelectNodes("cfdi:Retenciones/cfdi:Retencion", namespaces)
For Each retencion As XmlNode In retenciones For Each retencion As XmlNode In retenciones
' Obtener los valores de los atributos Base e Importe ' Obtener los valores de los atributos Base e Importe
Dim baseValue As Decimal = Decimal.Parse(ValorXML(retencion, "Base")) Dim baseValue As Decimal = Decimal.Parse(ValorXML(retencion, "Base")).RoundSQL(2)
Dim impuesto As String = ValorXML(retencion, "Impuesto") Dim impuesto As String = ValorXML(retencion, "Impuesto")
If impuesto = "001" Then If impuesto = "001" Then

View File

@@ -260,6 +260,7 @@ public partial class Contabilidad_RepIVA : ClsPaginas
ImprimirbytesPDF(ImprimirSubRepPDFCrystal(Ruta, Dt, para, DtIEPSA, DtIVAA, "RepIEPSPorcentaje.rpt", "RepIVAPorcentaje.rpt", "Reporte de IVA", Opcion), "Reporte de IVA", Opcion); ImprimirbytesPDF(ImprimirSubRepPDFCrystal(Ruta, Dt, para, DtIEPSA, DtIVAA, "RepIEPSPorcentaje.rpt", "RepIVAPorcentaje.rpt", "Reporte de IVA", Opcion), "Reporte de IVA", Opcion);
//ImprimirbytesPDF(ImprimirPDFCrystal(Ruta, Dt, para, "Reporte de IVA", Opcion), "Reporte de IVA", Opcion);
} }

View File

@@ -605,9 +605,14 @@ Partial Class Contratos_RepPresupuestos
params.Add(New ReportParameter("Autorizado", LtlAutorizado.Text.FormatoNumero())) params.Add(New ReportParameter("Autorizado", LtlAutorizado.Text.FormatoNumero()))
params.Add(New ReportParameter("Ejercido", LtlEjercido.Text.FormatoNumero())) params.Add(New ReportParameter("Ejercido", LtlEjercido.Text.FormatoNumero()))
params.Add(New ReportParameter("PorEjercer", LtlPorEjercer.Text.FormatoNumero())) params.Add(New ReportParameter("PorEjercer", LtlPorEjercer.Text.FormatoNumero()))
params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", ""))) params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", "")))
params.Add(New ReportParameter("PresupuestoRestrictivo", UsuarioActual.Empresa.Funcionalidad(532)))
ImprimirPDF("Empresas/Grales/Formatos/RepPresupuestoAnual.rdlc", DtPresupuestos, params, "Reporte de Presupuestos Anual", Formato) ImprimirPDF("Empresas/Grales/Formatos/RepPresupuestoAnual.rdlc", DtPresupuestos, params, "Reporte de Presupuestos Anual", Formato)
Else Else
Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia) Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia)
End If End If

File diff suppressed because it is too large Load Diff

View File

@@ -10,15 +10,7 @@
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server"> <asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content> </asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server"> <asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<%-- <li>
<asp:LinkButton ID="LnkPdf" OnClick="LnkPdf_Click" runat="server"> <i class="fa fa-ad-pdf"></i> Generar PDF</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="LnkExcel" OnClick="LnkExcel_Click" runat="server"><i class="fa fa-ad-excel"></i> Exporta Excel</asp:LinkButton>
</li>
<li>
<asp:HyperLink NavigateUrl="javascript:;" data-toggle="modal" data-target="#DivTipoCambio" ID="ImgTipoCambio" runat="server"> <i class="fa fa-money"></i> Ver Dlls en pesos</asp:HyperLink>
</li>--%>
</asp:Content> </asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server"> <asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
@@ -110,10 +102,12 @@
</div> </div>
</div> </div>
<div class="col-md-1" style="text-align: left">Centro Costo:</div> <div class="col-md-1" style="text-align: left" runat="server" visible="false" id="DvSubProyectoSaldar1">Centro Costo:</div>
<div class="col-md-1" style="text-align: left"> <div class="col-md-1" style="text-align: left" runat="server" visible="false" id="DvSubProyectoSaldar2">
<asp:DropDownList ID="DdlSubProyectoSaldar" runat="server" DataTextField="SubProyecto" DataValueField="CveSubProyecto" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-sm select2me" Width="100%"> <asp:DropDownList ID="DdlSubProyectoSaldar" runat="server" DataTextField="SubProyecto" DataValueField="CveSubProyecto" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-sm select2me" Width="100%">
</asp:DropDownList> </asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlSubProyectoSaldar" runat="server" ControlToValidate="DdlSubProyectoSaldar" InitialValue="-1" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Centro Costo''</b> es necesario, por favor ingréselo." ValidationGroup="VgGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VceRfvDdlSubProyectoSaldar" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlSubProyectoSaldar"></ajax:ValidatorCalloutExtender>
</div> </div>
<div class="col-md-1" style="text-align: left">Concepto:</div> <div class="col-md-1" style="text-align: left">Concepto:</div>
@@ -123,10 +117,26 @@
<ajax:ValidatorCalloutExtender ID="VcoConcepto" runat="server" HighlightCssClass="vco" TargetControlID="RfvConcepto"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="VcoConcepto" runat="server" HighlightCssClass="vco" TargetControlID="RfvConcepto"></ajax:ValidatorCalloutExtender>
</div> </div>
<div class="col-md-1">
<label class="col-md-1" runat="server" visible="false" id="DVDdlDeduccion1" >Cta Deducción:</label>
<div class="col-md-1" style="text-align: left" runat="server" visible="false" id="DVDdlDeduccion2">
<asp:DropDownList ID="DdlTipoDeduccion" runat="server" Width="100%" CssClass="form-control select2me" >
<asp:ListItem Text="Gasto No Deducible" Value="255" Selected="True"></asp:ListItem>
<asp:ListItem Text="Incobrable No Deducible" Value="179"></asp:ListItem>
<asp:ListItem Text="Incobrable Deducible" Value="263"></asp:ListItem>
<asp:ListItem Text="Reservas" Value="252"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlTipoDeduccion" runat="server" ControlToValidate="DdlTipoDeduccion" InitialValue="-1" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cta Deducción''</b> es necesario, por favor ingréselo." ValidationGroup="VgGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VceRfvDdlTipoDeduccion" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlTipoDeduccion"></ajax:ValidatorCalloutExtender>
</div>
<div class="col-md-1">
<asp:Button ID="BtnSaldar" OnClick="BtnSaldar_Click" runat="server" Text="Saldar" CssClass="btn btn-primary" ValidationGroup="VgGuardar" /> <asp:Button ID="BtnSaldar" OnClick="BtnSaldar_Click" runat="server" Text="Saldar" CssClass="btn btn-primary" ValidationGroup="VgGuardar" />
</div> </div>
</div> </div>
</ContentTemplate> </ContentTemplate>
@@ -137,7 +147,7 @@
<ajax:TabContainer runat="server" ID="Tabs"> <ajax:TabContainer runat="server" ID="Tabs">
<ajax:TabPanel ID="TabIXC" runat="server" HeaderText="IXC" ClientIDMode="Static"> <ajax:TabPanel ID="TabIXC" runat="server" HeaderText="IXC" ClientIDMode="Static" OnClientClick="" >
<ContentTemplate> <ContentTemplate>
@@ -255,10 +265,9 @@
CssClass="table table-striped table-advance table-hover Widthall" Style="text-align: center;" GridLines="None" HeaderStyle-CssClass="ADtr"> CssClass="table table-striped table-advance table-hover Widthall" Style="text-align: center;" GridLines="None" HeaderStyle-CssClass="ADtr">
<Columns> <Columns>
<asp:TemplateField> <asp:TemplateField>
<HeaderTemplate> <HeaderTemplate>
<input type="checkbox" id="ChkAll" onclick="CheckAll();" /> <%--<input type="checkbox" id="ChkAll" onclick="CheckAll();" />--%>
</HeaderTemplate> </HeaderTemplate>
<ItemTemplate> <ItemTemplate>
<asp:CheckBox ID="Chk" CssClass="chkgv" runat="server"></asp:CheckBox> <asp:CheckBox ID="Chk" CssClass="chkgv" runat="server"></asp:CheckBox>
@@ -282,6 +291,15 @@
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Left">
<HeaderTemplate>
Cliente
</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="Ltl" runat="server" Text='<%# Eval("Nombre") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Center"> <asp:TemplateField ItemStyle-HorizontalAlign="Center">
<HeaderTemplate> <HeaderTemplate>
Fecha<br> Fecha<br>
@@ -386,7 +404,17 @@
</div> </div>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
<div style="display:none">
<asp:Button runat="server" ID="BtnonClickTabs" OnClick="BtnonClickTabs_Click" ClientIDMode="Static" />
</div>
</asp:Content> </asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server"> <asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
<script>
function onClickTabs() {
$('#BtnonClickTabs').click();
}
</script>
</asp:Content> </asp:Content>

View File

@@ -78,34 +78,47 @@ Partial Public Class General_SaldosMenores
InicializaDatos() InicializaDatos()
End If End If
End Sub End Sub
Protected Sub BtnonClickTabs_Click(sender As Object, e As EventArgs)
Consultar()
End Sub
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
Consultar()
End Sub
Private Sub Consultar()
DvSaldar.Visible = False DvSaldar.Visible = False
DtDatosIXC = New DataTable DtDatosIXC = New DataTable
DtDatosNCEXC = New DataTable DtDatosNCEXC = New DataTable
DtDatosVentas = New DataTable DtDatosVentas = New DataTable
DvSubProyectoSaldar1.Visible = False
DvSubProyectoSaldar2.Visible = False
DVDdlDeduccion1.Visible = False
DVDdlDeduccion2.Visible = False
If Tabs.ActiveTab Is TabIXC Then If Tabs.ActiveTab Is TabIXC Then
CargaDatosIXC() CargaDatosIXC()
If DtDatosIXC.Rows.Count > 0 Then If DtDatosIXC.Rows.Count > 0 Then
DvSaldar.Visible = True DvSaldar.Visible = True
DvSubProyectoSaldar1.Visible = True
DvSubProyectoSaldar2.Visible = True
End If End If
End If End If
If Tabs.ActiveTab Is TabVentas Then If Tabs.ActiveTab Is TabVentas Then
CargaDatosVentas() CargaDatosVentas()
If DtDatosVentas.Rows.Count > 0 Then If DtDatosVentas.Rows.Count > 0 Then
DvSaldar.Visible = True DvSaldar.Visible = True
DVDdlDeduccion1.Visible = True
DVDdlDeduccion2.Visible = True
End If End If
End If End If
Upsaldar.Update() Upsaldar.Update()
End Sub End Sub
Protected Sub BtnSaldar_Click(sender As Object, e As EventArgs) Protected Sub BtnSaldar_Click(sender As Object, e As EventArgs)
@@ -182,6 +195,7 @@ Partial Public Class General_SaldosMenores
If MsgError = "" Then If MsgError = "" Then
ObjConta.Commit() ObjConta.Commit()
' DvSaldar.Visible = False
Dim Msg As String = "Los movimientos se saldaron correctamente." Dim Msg As String = "Los movimientos se saldaron correctamente."
Msg &= $"<br/><br/><a Class='Texto' target='_blank' href='/Contabilidad/RegPrePolizaS.aspx?CvePrePoliza={CvePrePoliza}'>Ver Póliza</a>&nbsp;&nbsp; " Msg &= $"<br/><br/><a Class='Texto' target='_blank' href='/Contabilidad/RegPrePolizaS.aspx?CvePrePoliza={CvePrePoliza}'>Ver Póliza</a>&nbsp;&nbsp; "
Alert(Msg) Alert(Msg)
@@ -197,6 +211,159 @@ Partial Public Class General_SaldosMenores
If Tabs.ActiveTab Is TabVentas Then If Tabs.ActiveTab Is TabVentas Then
Dim ObjConta As New ClsContabilidad
ObjConta.IniciaTransacSQL()
Dim CvePrePoliza As Integer = 0
Dim MsgError As String = ""
'Dim ObjIE As New ClsBancos
Dim FechaUltimaFluctuacion As Date = MinFecha
Dim TipoCambioFluctuacion As Decimal = 1
Dim tFecha As Date = TxtFecha.Text.ToDate
Dim UltimaFluctuacion As MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(tFecha)
If UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso UltimaFluctuacion IsNot Nothing Then
If UltimaFluctuacion.FechaFluctuacion <= tFecha Then
FechaUltimaFluctuacion = UltimaFluctuacion.FechaFluctuacion
TipoCambioFluctuacion = UltimaFluctuacion.TCFluctuacion
End If
End If
CvePrePoliza = ObjConta.AddPrePolizas("Bancos/ClientesAbonar/SaldarI", 47, 0, 0, 1, TxtFecha.Text.ToDate, TxtFecha.Text.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
For Each gr As GridViewRow In GvCxC.Rows
If gr.FCCheckBox("Chk").Checked Then
Dim PorcentajePago As Decimal = gr.DataKey("Saldo").ToDecimal / gr.DataKey("Original").ToDecimal
Dim Saldo As Decimal = gr.DataKey("Saldo").ToDecimal
Dim RETIVA As Decimal = gr.DataKey("RetIVA").ToDecimal
Dim SubTotal As Decimal = PorcentajePago * (gr.DataKey("SubTotal").ToDecimal.RoundSQL - gr.DataKey("Descuento").ToDecimal.RoundSQL).RoundSQL
Dim IVA As Decimal = PorcentajePago * gr.DataKey("IVA").ToDecimal.RoundSQL
Dim IEPS As Decimal = PorcentajePago * gr.DataKey("IEPS").ToDecimal.RoundSQL
Dim TCVenta As Decimal = gr.DataKey("TipoCambio").ToDecimal
Dim FechaVenta As Date = gr.DataKey("Fecha").ToDate
Dim tCveMoneda As Integer = gr.DataKey("CveMoneda").ToEntero
Dim TCPago As Decimal = GlobalTipoCambio(TxtFecha.Text.ToDate).FormatoNumero(4).ToDecimal
Dim CveConceptoDeduccion As Integer = DdlTipoDeduccion.SelectedValue.ToEntero
Dim CveMoneda As Integer = gr.DataKey("CveMoneda").ToEntero
'si la fecha del documento es anterior a su ultima fluctuación. toma el Tc de la fluctuacion
If tCveMoneda = 2 Then
If FechaVenta < FechaUltimaFluctuacion Then
TCVenta = TipoCambioFluctuacion
End If
End If
'condicionante
Dim ClienteMovto As Boolean = True
Dim SubtotalMovto As Boolean = False
Dim CveConceptoCliente As Integer = 2
Dim ImpuestosMovto As Boolean = False
Dim CveSubProyecto As Integer = gr.DataKey("CveSubProyecto").ToEntero
Dim ConceptoPartida As String = TxtConcepto.Text.Trim & " " & gr.DataKey("SerieFolio").ToString
'TxtConcepto.Text
'If CveConceptoDeduccion = 255 Then IdCuentaContableNoDeducible = UsuarioActual.Empresa.Funcionalidad(266).ToEntero
'If CveConceptoDeduccion = 179 Then IdCuentaContableNoDeducible = UsuarioActual.Empresa.Funcionalidad(559).ToEntero
'If CveConceptoDeduccion = 263 Then IdCuentaContableNoDeducible = UsuarioActual.Empresa.Funcionalidad(537).ToEntero
'If CveConceptoDeduccion = 252 Then IdCuentaContableNoDeducible = UsuarioActual.Empresa.Funcionalidad(581).ToEntero
If UsuarioActual.CveEmpresa.Contiene(4, 7, 11, 12, 122) Then
ClienteMovto = False : Saldo = Saldo * -1
ImpuestosMovto = True : IVA = IVA * -1
RETIVA = ((SubTotal * RETIVA / gr.DataKey("SubTotal").ToDecimal.RoundSQL) * -1).RoundSQL(2)
CveConceptoCliente = 1
End If
Dim UsaComplementaria As Boolean = True
'If UsuarioActual.CveEmpresa = 119 Then
' UsaComplementaria = True
'End If
If MsgError = "" Then
Dim ConPreP As ConceptosTipoSaldo = ClsPaginas.ObtenerCveConceptoPrePoliza(6, tCveMoneda, True, 1)
'normal
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ClienteMovto, Saldo, Saldo, ConPreP.CveConcepto, gr.DataKey("SerieFolio").ToString, ConceptoPartida, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
MsgError = "Ocurrio un error al saldar el movimiento"
End If
If UsaComplementaria AndAlso tCveMoneda = 2 Then
'complementaria
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ClienteMovto, 0, If(CveMoneda = 1, Saldo, (Saldo * TCVenta) - Saldo).RoundSQL, ConPreP.CveConceptoComplementario, gr.DataKey("SerieFolio").ToString, ConceptoPartida, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteME:=Saldo, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
MsgError = "Ocurrio un error al saldar el movimiento"
End If
End If
'fluctuación.
If tCveMoneda = 2 Then
Dim ImporteFluctuacion As Decimal = 0
ImporteFluctuacion = Saldo * (TCPago - TCVenta)
If CveSubProyecto <= 0 Then
MsgError = $"No se pudo obtener el sub proyecto de la venta {gr.DataKey("SerieFolio").ToString}"
End If
If TCPago > TCVenta Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Math.Abs(ImporteFluctuacion), Math.Abs(ImporteFluctuacion), 64, gr.DataKey("SerieFolio").ToString, ConceptoPartida, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, TipoCambio:=TCVenta, TipoCambioPago:=TCPago, CveSubProyecto:=CveSubProyecto) Then
MsgError = "Ocurrio un error al saldar el movimiento"
End If
Else
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Math.Abs(ImporteFluctuacion), Math.Abs(ImporteFluctuacion), 65, gr.DataKey("SerieFolio").ToString, ConceptoPartida, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, TipoCambio:=TCVenta, TipoCambioPago:=TCPago, CveSubProyecto:=CveSubProyecto) Then
MsgError = "Ocurrio un error al saldar el movimiento"
End If
End If
'cuando hay pago en dólares, se ajusta el concepto de subtotal,
SubTotal = (Saldo * TCVenta) + ImporteFluctuacion - (IVA * TCVenta) - (IEPS * TCVenta)
End If
If (IVA > 0 Or UsuarioActual.CveEmpresa.Contiene(4, 7, 11, 12, 122) And IVA < 0) AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ImpuestosMovto, IVA, If(CveMoneda = 1, IVA, IVA * TCVenta), 13, gr.DataKey("SerieFolio").ToString, ConceptoPartida, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, PorcentajeImpuesto:=gr.DataKey("PorcentajeIVA").ToDecimal, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
MsgError = "Ocurrio un error al saldar el movimiento"
End If
If (RETIVA > 0 Or UsuarioActual.CveEmpresa.Contiene(4, 7, 11, 12, 122) And RETIVA < 0) AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ClienteMovto, RETIVA, If(CveMoneda = 1, RETIVA, RETIVA * TCVenta), 8, gr.DataKey("SerieFolio").ToString, ConceptoPartida, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
MsgError = "Ocurrio un error al saldar el movimiento"
End If
If IEPS > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ImpuestosMovto, IEPS, If(CveMoneda = 1, IEPS, IEPS * TCVenta), 38, gr.DataKey("SerieFolio").ToString, ConceptoPartida, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
MsgError = "Ocurrio un error al saldar el movimiento"
End If
'al gasto,Subtotal
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, SubtotalMovto, SubTotal, SubTotal, CveConceptoDeduccion, gr.DataKey("SerieFolio").ToString, ConceptoPartida, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, CveSubProyecto:=CveSubProyecto, CveCuenta:=-1, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
MsgError = "Ocurrio un error al saldar el movimiento"
End If
If ObjConta.ValidacionesPrePoliza(CvePrePoliza, UsuarioActual, Opcion:=5) Then
If ObjConta.ValorPolizaDescuadre > 0 Then
MsgError = ObjConta.MensajePolizaDescuadre + " " + ObjConta.ValorDiferencia
GuardaLogAD($"Ventas/ClientesAbonar | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
Exit For
End If
End If
End If
End If
Next
If MsgError = "" Then
'ObjConta.RollBack()
ObjConta.Commit()
'DvSaldar.Visible = False
CargaDatosVentas()
'RegistraScript("$('#ModalSaldarCuentaIncobrable').modal('hide')")
Alert(String.Format("Los movimientos se saldaron correctamente. <br/> <a href='/Contabilidad/RegPrePoliza.aspx?CvePrePoliza={0}' class='Texto'>Ver PrePóliza</a>", CvePrePoliza), TipoMensaje.MsgInformacion)
'BtnSaldarCuentasIncobrables.Visible = False
Else
ObjConta.RollBack()
Alert(MsgError, TipoMensaje.MsgError)
End If
ObjConta.Dispose()
End If End If
@@ -438,8 +605,8 @@ Partial Public Class General_SaldosMenores
Dim FechaCorte As Date = NowADS().AddYears(1).ToShortDateString.ToString.ToDate Dim FechaCorte As Date = NowADS().AddYears(1).ToShortDateString.ToString.ToDate
Dim SumDescuentoProntoPago As Double = 0.0 Dim SumDescuentoProntoPago As Double = 0.0
If Mov.GetCxCClienteDetalle(-1, FechaI, FechaF, -1, -1, UsuarioActual.CveEmpresa, -1, FechaCorte:=FechaCorte) Then If Mov.GetCxCClienteDetalle(-1, FechaI, FechaF, -1, -1, UsuarioActual.CveEmpresa, -1, FechaCorte:=FechaCorte, Opcion:=2, SaldoMayorA:=TxtSaldoMayorA.Text.ToDecimal, SaldoMenorA:=TxtSaldoMenorA.Text.ToDecimal) Then
DtDatosVentas = Mov.DtResultados.FiltraParametros($"Saldo > {TxtSaldoMayorA.Text.ToDecimal} AND Saldo < {TxtSaldoMenorA.Text.ToDecimal} ", "Fecha,SerieFolio").AsEnumerable().Take(51).CopyToDataTable() DtDatosVentas = Mov.DtResultados
'Dim TmpCxCAux As DataTable 'Dim TmpCxCAux As DataTable
'TmpCxCAux = Mov.DtResultados.FiltraParametros($"Saldo > {TxtSaldoMayorA.Text.ToDecimal} AND Saldo < {TxtSaldoMenorA.Text.ToDecimal} ", "Fecha,SerieFolio").AsEnumerable().Take(51).CopyToDataTable() 'TmpCxCAux = Mov.DtResultados.FiltraParametros($"Saldo > {TxtSaldoMayorA.Text.ToDecimal} AND Saldo < {TxtSaldoMenorA.Text.ToDecimal} ", "Fecha,SerieFolio").AsEnumerable().Take(51).CopyToDataTable()
@@ -467,9 +634,17 @@ Partial Public Class General_SaldosMenores
Protected Sub GvCxC_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvCxC.RowDataBound Protected Sub GvCxC_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvCxC.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DataKey("CveVenta").ToEntero <= 0 Then
e.Row.BackColor = Drawing.Color.LightGray
e.Row.FCCheckBox("Chk").Visible = False
End If
End If
End Sub End Sub
#End Region #End Region
End Class End Class

View File

@@ -602,7 +602,6 @@ Partial Class OC_OC
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then If Not Page.IsPostBack Then
GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa) = Nothing GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa) = Nothing
CargaDatosAgregarPS() CargaDatosAgregarPS()
@@ -6182,11 +6181,16 @@ Partial Class OC_OC
End If End If
End If End If
'MANDA CORREO A TODOS LOS USUARIOS INVOLUCRADOS 'MANDA CORREO A TODOS LOS USUARIOS INVOLUCRADOS
If DtHistorial IsNot Nothing Then If DtHistorial IsNot Nothing Then
For Each Row As DataRow In DtHistorial.FiltraParametros("CveConceptoHistorialBitacora = 1").Rows For Each Row As DataRow In DtHistorial.FiltraParametros("CveConceptoHistorialBitacora = 1").Rows
StrCorreos.AppendFormat("{0};", GlobalDTUsuarios(Row("CveUsuario").ToString.ToEntero)(0)("correo").ToString)
CorreosCCPNombre.Add(GlobalDTUsuarios(Row("CveUsuario").ToString.ToEntero)(0)("nombre").ToString) If GlobalDTUsuarios(Row("CveUsuario").ToString.ToEntero).FiltraParametros(" Estatus = True ").Rows.Count > 0 Then
StrCorreos.AppendFormat("{0};", GlobalDTUsuarios(Row("CveUsuario").ToString.ToEntero)(0)("correo").ToString)
CorreosCCPNombre.Add(GlobalDTUsuarios(Row("CveUsuario").ToString.ToEntero)(0)("nombre").ToString)
End If
Next Next
End If End If

View File

@@ -264,6 +264,7 @@ public partial class SAT_SolicitudesIngresoSat : ClsPaginas
{ {
try try
{ {
var TipoMensaje = ModExtensiones.TipoMensaje.MsgInformacion;
StringBuilder sbResultado = new StringBuilder(); StringBuilder sbResultado = new StringBuilder();
foreach (GridViewRow GvRow in GVSolicitudesPendientes.Rows) foreach (GridViewRow GvRow in GVSolicitudesPendientes.Rows)
{ {
@@ -276,7 +277,7 @@ public partial class SAT_SolicitudesIngresoSat : ClsPaginas
List<string> resultVerificacion = new List<string>(); List<string> resultVerificacion = new List<string>();
var ResultadoVerificaionOK = false; var ResultadoVerificaionOK = false;
var SeVerifico = false; var SeVerifico = false;
var TipoMensaje = ModExtensiones.TipoMensaje.MsgInformacion;
var ResultadoSolicitudOK = false; var ResultadoSolicitudOK = false;
@@ -331,7 +332,7 @@ public partial class SAT_SolicitudesIngresoSat : ClsPaginas
else else
{ {
if (resultSolicitud.Count == 4) if (resultSolicitud.Count >= 4)
{ {
sbResultado.Append($"({resultSolicitud[1]})<br> Folio:{Folio} <br> "); sbResultado.Append($"({resultSolicitud[1]})<br> Folio:{Folio} <br> ");
} }
@@ -344,7 +345,7 @@ public partial class SAT_SolicitudesIngresoSat : ClsPaginas
} }
if (SeVerifico && resultVerificacion.Count == 4) if (SeVerifico && resultVerificacion.Count >= 4)
{ {
if (ResultadoVerificaionOK) if (ResultadoVerificaionOK)
{ {
@@ -362,11 +363,11 @@ public partial class SAT_SolicitudesIngresoSat : ClsPaginas
TipoMensaje = ModExtensiones.TipoMensaje.MsgAdvertencia; TipoMensaje = ModExtensiones.TipoMensaje.MsgAdvertencia;
} }
Alert(sbResultado.ToString(), TipoMensaje);
} }
Alert(sbResultado.ToString(), TipoMensaje);

View File

@@ -518,7 +518,7 @@
<ContentTemplate> <ContentTemplate>
<asp:GridView ID="GVSolicitudesPendientes" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD Widthall" AutoGenerateColumns="False" <asp:GridView ID="GVSolicitudesPendientes" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD Widthall" AutoGenerateColumns="False"
ShowHeaderWhenEmpty="true" EmptyDataText="No se encontraron registros" ShowHeaderWhenEmpty="true" EmptyDataText="No se encontraron registros"
DataKeyNames="CveSolicitud,CveSolicitudCFDI,CveSolicitudMetadata,Estatus,Observaciones,FechaInicio,FechaFin,FechaIng,CveUsuarioIng,CveEmpresa"> DataKeyNames="CveSolicitud,idSolicitud,CveTipoSolicitud,Folio,CveSolicitudCFDI,CveSolicitudMetadata,Estatus,Observaciones,FechaInicio,FechaFin,FechaIng,CveUsuarioIng,CveEmpresa">
<Columns> <Columns>
<asp:TemplateField HeaderText="Folio"> <asp:TemplateField HeaderText="Folio">
<ItemTemplate> <ItemTemplate>

View File

@@ -12,7 +12,8 @@ using System.Web;
using System.Web.UI; using System.Web.UI;
using System.Web.UI.WebControls; using System.Web.UI.WebControls;
using static Extensiones.ModExtensiones; using static Extensiones.ModExtensiones;
using Newtonsoft.Json.Linq;
using Extensiones;
public partial class SAT_SolicitudesNominaSat : ClsPaginas public partial class SAT_SolicitudesNominaSat : ClsPaginas
{ {
@@ -217,15 +218,16 @@ public partial class SAT_SolicitudesNominaSat : ClsPaginas
DateTime fechaFin = txtFechaFAdd.Text.ToDateTime(); DateTime fechaFin = txtFechaFAdd.Text.ToDateTime();
int cveUsuarioIng = UsuarioActual.CveUsuario; int cveUsuarioIng = UsuarioActual.CveUsuario;
int cveEmpresa = UsuarioActual.CveEmpresa; int cveEmpresa = UsuarioActual.CveEmpresa;
bool Continuar = false; //bool Continuar = false;
int CveSolicitudAgregada = -1;
using (ClsNominas nom = new ClsNominas()) using (ClsNominas nom = new ClsNominas())
{ {
Continuar = nom.SolicitudesAdd(idSolicitudCFDI, idSolicitudMetadata, estatus, observaciones, fechaInicio, fechaFin, cveUsuarioIng, cveEmpresa); CveSolicitudAgregada = nom.SolicitudesAdd2(idSolicitudCFDI, idSolicitudMetadata, estatus, observaciones, fechaInicio, fechaFin, cveUsuarioIng, cveEmpresa,1);
var api = new GeneralesAPI(); var api = new GeneralesAPI();
api.GeneraSolicitud(UsuarioActual.CveEmpresa, 1); api.GeneraSolicitud(UsuarioActual.CveEmpresa, 1, CveSolicitudAgregada);
api.VerificaSolicitudesNominas(UsuarioActual.CveEmpresa, 1); api.VerificaSolicitudesNominas(UsuarioActual.CveEmpresa, 1, CveSolicitudAgregada);
} }
if (Continuar) if (CveSolicitudAgregada > 0)
{ {
txtFechaIAdd.Text = ""; txtFechaIAdd.Text = "";
txtFechaFAdd.Text = ""; txtFechaFAdd.Text = "";
@@ -239,10 +241,126 @@ public partial class SAT_SolicitudesNominaSat : ClsPaginas
protected void LnkverificarSolicitudes_Click(object sender, EventArgs e) protected void LnkverificarSolicitudes_Click(object sender, EventArgs e)
{ {
var api = new GeneralesAPI(); //var api = new GeneralesAPI();
api.GeneraSolicitud(UsuarioActual.CveEmpresa,1); //api.GeneraSolicitud(UsuarioActual.CveEmpresa,1);
api.VerificaSolicitudesNominas(UsuarioActual.CveEmpresa, 1); //api.VerificaSolicitudesNominas(UsuarioActual.CveEmpresa, 1);
cargasolicitudes(); //cargasolicitudes();
try
{
var TipoMensaje = ModExtensiones.TipoMensaje.MsgInformacion;
StringBuilder sbResultado = new StringBuilder();
foreach (GridViewRow GvRow in GVSolicitudesPendientes.Rows)
{
int CveSolicitudActual = GvRow.DataKey("CveSolicitud").ToEntero();
string idSolicitud = GvRow.DataKey("idSolicitud").Trim();
int CveTipoSolicitud = GvRow.DataKey("CveTipoSolicitud").ToEntero();
int Folio = GvRow.DataKey("CveSolicitud").ToEntero();
List<string> resultSolicitud = new List<string>();
List<string> resultVerificacion = new List<string>();
var ResultadoVerificaionOK = false;
var SeVerifico = false;
var ResultadoSolicitudOK = false;
var api = new GeneralesAPI();
if (idSolicitud.Length == 0)
{
JToken ObjApiSolicitud = (JToken)api.GeneraSolicitud(UsuarioActual.CveEmpresa, CveTipoSolicitud, CveSolicitudActual);
if (!(ObjApiSolicitud == null))
{
resultSolicitud = ObjApiSolicitud.Select(token => token.Values().Aggregate((i, j) => $"{i}|{j}").Value<string>()).ToList();
ResultadoSolicitudOK = bool.Parse(resultSolicitud[0]);
sbResultado.Append($"Solicitud {Folio} solicitada a SAT.<br>");
}
else
{
TipoMensaje = ModExtensiones.TipoMensaje.MsgAdvertencia;
}
}
else
{
resultSolicitud = new List<string>();
resultSolicitud.Add("true");
resultSolicitud.Add("");
resultSolicitud.Add("");
resultSolicitud.Add("");
ResultadoSolicitudOK = true;
}
if (ResultadoSolicitudOK)
{
JToken ObjApiVerificacion = (JToken)api.VerificaSolicitudesNominas(UsuarioActual.CveEmpresa, CveTipoSolicitud, CveSolicitudActual);
if (!(ObjApiVerificacion == null))
{
resultVerificacion = ObjApiVerificacion.Select(token => token.Values().Aggregate((i, j) => $"{i}|{j}").Value<string>()).ToList();
ResultadoVerificaionOK = bool.Parse(resultVerificacion[0]);
SeVerifico = true;
}
else
{
TipoMensaje = ModExtensiones.TipoMensaje.MsgAdvertencia;
}
}
else
{
if (resultSolicitud.Count >= 4)
{
sbResultado.Append($"({resultSolicitud[1]})<br> Folio:{Folio} <br> ");
}
else
{
sbResultado.Append($"Solicitud pendiente de verificar en SAT <br> Folio:{Folio} <br>");
}
TipoMensaje = ModExtensiones.TipoMensaje.MsgAdvertencia;
}
if (SeVerifico && resultVerificacion.Count >= 4)
{
if (ResultadoVerificaionOK)
{
sbResultado.Append($"Solicitud procesada.<br> Folio: {Folio} <br> {resultVerificacion[1]}");
}
else
{
sbResultado.Append($"Solicitud no verificada <br> Folio: {Folio}{resultVerificacion[1]}.<br>");
TipoMensaje = ModExtensiones.TipoMensaje.MsgAdvertencia;
}
}
else
{
sbResultado.Append($"Se presento un error al verificar la solicitud <br> Folio: {Folio}.");
TipoMensaje = ModExtensiones.TipoMensaje.MsgAdvertencia;
}
}
Alert(sbResultado.ToString(), TipoMensaje);
cargasolicitudes();
}
catch (Exception ex)
{
Alert(ex.StackTrace);
}
} }
@@ -307,14 +425,18 @@ public class GeneralesAPI : ADSNetLibrary.Helpers.Conexiones.SIGAPI.BaseSIGAPI
public object GeneraSolicitud(int CveEmpresa, int CveTipoSolicitud) public object GeneraSolicitud(int CveEmpresa, int CveTipoSolicitud, int CveSolicitud)
{ {
return getData<object>($"GeneraSolicitud/{CveEmpresa}/{CveTipoSolicitud}", null, ADSNetLibrary.Helpers.Conexiones.SIGAPI.requestMethod.GET, false); //return getData<object>($"GeneraSolicitud/{CveEmpresa}/{CveTipoSolicitud}", null, ADSNetLibrary.Helpers.Conexiones.SIGAPI.requestMethod.GET, false);
return getData<object>($"GeneraSolicitud/{CveEmpresa}/{CveTipoSolicitud}/{CveSolicitud}", null, ADSNetLibrary.Helpers.Conexiones.SIGAPI.requestMethod.GET, false);
} }
public object VerificaSolicitudesNominas(int CveEmpresa, int CveTipoSolicitud) public object VerificaSolicitudesNominas(int CveEmpresa, int CveTipoSolicitud, int CveSolicitud)
{ {
return getData<object>($"VerificaSolicitudesNominas/{CveEmpresa}/{CveTipoSolicitud}", null, ADSNetLibrary.Helpers.Conexiones.SIGAPI.requestMethod.GET, false); ///return getData<object>($"VerificaSolicitudesNominas/{CveEmpresa}/{CveTipoSolicitud}", null, ADSNetLibrary.Helpers.Conexiones.SIGAPI.requestMethod.GET, false);
return getData<object>($"VerificaSolicitudesNominas/{CveEmpresa}/{CveTipoSolicitud}/{CveSolicitud}", null, ADSNetLibrary.Helpers.Conexiones.SIGAPI.requestMethod.GET, false);
} }
} }

View File

@@ -8870,6 +8870,14 @@ Partial Class Ventas
Dim DatarowPS As DataRow = Nothing Dim DatarowPS As DataRow = Nothing
DatarowPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=TmpDT.Rows(e.RowIndex)("CvePS").ToString().ToEntero()).FiltroPrimero("") ' Estado = -1 DatarowPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=TmpDT.Rows(e.RowIndex)("CvePS").ToString().ToEntero()).FiltroPrimero("") ' Estado = -1
If UsuarioActual.Empresa.Funcionalidad(382) = "1" AndAlso DdlTipoComprobante.SelectedValue = "Cot" Then
If PU < DatarowPS("PrecioMinimo").ToString().ToDecimal() Then
Alert($"El precio no puede ser menor al precio mínimo. Precio Mínimo: {DatarowPS("PrecioMinimo"):N2}", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
'verifica si tiene ventaminima 'verifica si tiene ventaminima
If Cantidad > 0 AndAlso DatarowPS("VentaMinima").ToString().ToDecimal > 0 AndAlso (DdlTipoComprobante.SelectedValue.Contiene("Rem", "Ing", "PA")) Then If Cantidad > 0 AndAlso DatarowPS("VentaMinima").ToString().ToDecimal > 0 AndAlso (DdlTipoComprobante.SelectedValue.Contiene("Rem", "Ing", "PA")) Then
'verifico que la cantidad sea multiplo de venta minima, es decir ventaminima =5, solo puede vender 5,10,15... 'verifico que la cantidad sea multiplo de venta minima, es decir ventaminima =5, solo puede vender 5,10,15...
@@ -13181,10 +13189,10 @@ Partial Class Ventas
End If End If
'SI ES DEVOLUCION DIRECTA, SIN RELACION A UNA FACTURA 'SI ES DEVOLUCION DIRECTA, SIN RELACION A UNA FACTURA
'If UsuarioActual.CveEmpresa.Contiene(1, 192) AndAlso DdlTipoComprobante.SelectedValue = "Dev" AndAlso CveVentaDevolucion <= 0 AndAlso Timbre.CFDIRelacionados.UUID.Count = 0 Then If UsuarioActual.CveEmpresa.Contiene(1, 190) AndAlso DdlTipoComprobante.SelectedValue = "Dev" AndAlso CveVentaDevolucion <= 0 AndAlso Timbre.CFDIRelacionados.UUID.Count = 0 Then
' Timbre.CFDIRelacionados.TipoRelacion = "" Timbre.CFDIRelacionados.TipoRelacion = ""
' Timbre.CFDIRelacionados.TipoRelacionTexto = "" Timbre.CFDIRelacionados.TipoRelacionTexto = ""
'End If End If
'SI LAS FACTURAS SE RELACIONARAN MANUALMENTE SE AGREGAN 'SI LAS FACTURAS SE RELACIONARAN MANUALMENTE SE AGREGAN
If Me.AplicaRelacionManual AndAlso DdlTipoRelacionARelacionar.SelectedValue.ToEntero() > 0 Then If Me.AplicaRelacionManual AndAlso DdlTipoRelacionARelacionar.SelectedValue.ToEntero() > 0 Then
@@ -16705,6 +16713,10 @@ Partial Class Ventas
If ObjMovtos.DtResultados.SUM("Saldo", "Saldo > 0 AND SaldoSubtotal > 0 AND Tipo = 'Ant'") > 0 Then If ObjMovtos.DtResultados.SUM("Saldo", "Saldo > 0 AND SaldoSubtotal > 0 AND Tipo = 'Ant'") > 0 Then
HdnTieneAnticipos.Value = "1" HdnTieneAnticipos.Value = "1"
End If End If
If UsuarioActual.Empresa.Funcionalidad(382) = "1" AndAlso DtMovtos IsNot Nothing AndAlso DtMovtos.Rows.Count = 0 Then
ImgAntiPend.Visible = False
End If
Else Else
GVAnticipos.DataSource = Nothing GVAnticipos.DataSource = Nothing
End If End If
@@ -18737,6 +18749,16 @@ Partial Class Ventas
Return False Return False
End If End If
If UsuarioActual.Empresa.Funcionalidad(382) = "1" AndAlso DdlTipoComprobante.SelectedValue = "Cot" Then
Dim DatarowPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
If DatarowPS IsNot Nothing Then
If PU < DatarowPS("PrecioMinimo").ToString().ToDecimal() Then
Alert($"El precio no puede ser menor al precio mínimo. Precio Mínimo: {DatarowPS("PrecioMinimo"):N2}", TipoMensaje.MsgAdvertencia)
Return False
End If
End If
End If
'SI NO VIENE DESDE EL MODAL 'SI NO VIENE DESDE EL MODAL
If CantidadModal = 0 Then If CantidadModal = 0 Then
If TxtCantidad.Text.ToDecimal() <= 0 Then If TxtCantidad.Text.ToDecimal() <= 0 Then
@@ -20266,11 +20288,11 @@ Partial Class Ventas
If Not UsuarioActual.TienePermisoProceso(264) Then If Not UsuarioActual.TienePermisoProceso(264) Then
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Dev")) DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Dev"))
Else Else
'If UsuarioActual.CveEmpresa.Contiene(1, 192) Then If UsuarioActual.CveEmpresa.Contiene(1, 190) Then
' If DdlTipoComprobante.Items.FindByValue("Dev") Is Nothing Then If DdlTipoComprobante.Items.FindByValue("Dev") Is Nothing Then
' DdlTipoComprobante.Items.Add(New ListItem("Devolución", "Dev")) DdlTipoComprobante.Items.Add(New ListItem("Devolución", "Dev"))
' End If End If
'End If End If
End If End If
'Puede facturar 'Puede facturar