This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2019-10-11 17:20:34 -07:00
39 changed files with 23655 additions and 9388 deletions

View File

@@ -1248,6 +1248,7 @@
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Cotizaciones</span>
</div>
<div class="actions">
<div class="btn-group">
<input type="text" id="TxtBusquedaCotizacion" class="form-control input-sm"
@@ -1257,6 +1258,22 @@
style="margin-top: -3px; float: inherit;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
</div>
<div class="actions">
<div class="btn-group">
<asp:UpdatePanel UpdateMode="Conditional" runat="server" ID="UpRepProveedoresPagosBancos" >
<ContentTemplate>
<asp:LinkButton ID="LnkCotizacionesPDF" runat="server" data-toggle="tooltip" Title="PDF"> <i class="fa fa-file-pdf-o" style="margin-right: 10px; font-size:15px; font-weight:bold; color:dimgray;"></i> </asp:LinkButton>
<asp:LinkButton ID="LnkCotizacionesExcel" runat="server" data-toggle="tooltip" Title="Excel"><i class="fa fa-file-excel-o" style="margin-right: 10px; font-size:15px; font-weight:bold; color:dimgray;"></i> </asp:LinkButton>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="LnkCotizacionesPDF" />
<asp:PostBackTrigger ControlID="LnkCotizacionesExcel" />
</Triggers>
</asp:UpdatePanel>
</div>
</div>
</div>
<div class="portlet-body ">
<div class="table-scrollable">
@@ -1741,6 +1758,16 @@
</div>
<div class="actions">
<div class="btn-group">
<asp:UpdatePanel UpdateMode="Conditional" runat="server" ID="UpdatePanel2">
<ContentTemplate>
<asp:LinkButton ID="LnkCxCActivasPDF" runat="server" data-toggle="tooltip" Title="PDF"> <i class="fa fa-file-pdf-o" style="margin-right: 10px; font-size:15px; font-weight:bold; color:dimgray;"></i> </asp:LinkButton>
<asp:LinkButton ID="LnkCxCActivasExcel" runat="server" data-toggle="tooltip" Title="Excel"><i class="fa fa-file-excel-o" style="margin-right: 10px; font-size:15px; font-weight:bold; color:dimgray;"></i> </asp:LinkButton>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="LnkCxCActivasPDF" />
<asp:PostBackTrigger ControlID="LnkCxCActivasExcel" />
</Triggers>
</asp:UpdatePanel>
</div>
</div>
</div>
@@ -1814,6 +1841,16 @@
</div>
<div class="actions">
<div class="btn-group">
<asp:UpdatePanel UpdateMode="Conditional" runat="server" ID="UpdatePanel6">
<ContentTemplate>
<asp:LinkButton ID="LnkHistorialCxCPDF" runat="server" data-toggle="tooltip" Title="PDF"> <i class="fa fa-file-pdf-o" style="margin-right: 10px; font-size:15px; font-weight:bold; color:dimgray;"></i> </asp:LinkButton>
<asp:LinkButton ID="LnkHistorialCxCExcel" runat="server" data-toggle="tooltip" Title="Excel"><i class="fa fa-file-excel-o" style="margin-right: 10px; font-size:15px; font-weight:bold; color:dimgray;"></i> </asp:LinkButton>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="LnkHistorialCxCPDF" />
<asp:PostBackTrigger ControlID="LnkHistorialCxCExcel" />
</Triggers>
</asp:UpdatePanel>
</div>
</div>
</div>
@@ -1898,6 +1935,16 @@
</div>
<div class="actions">
<div class="btn-group">
<asp:UpdatePanel UpdateMode="Conditional" runat="server" ID="UpdatePanel7">
<ContentTemplate>
<asp:LinkButton ID="LnkAnticipoClientePDF" runat="server" data-toggle="tooltip" Title="PDF"> <i class="fa fa-file-pdf-o" style="margin-right: 10px; font-size:15px; font-weight:bold; color:dimgray;"></i> </asp:LinkButton>
<asp:LinkButton ID="LnkAnticipoClienteExcel" runat="server" data-toggle="tooltip" Title="Excel"><i class="fa fa-file-excel-o" style="margin-right: 10px; font-size:15px; font-weight:bold; color:dimgray;"></i> </asp:LinkButton>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="LnkAnticipoClientePDF" />
<asp:PostBackTrigger ControlID="LnkAnticipoClienteExcel" />
</Triggers>
</asp:UpdatePanel>
</div>
</div>
</div>
@@ -1944,6 +1991,16 @@
</div>
<div class="actions">
<div class="btn-group">
<asp:UpdatePanel UpdateMode="Conditional" runat="server" ID="UpdatePanel8">
<ContentTemplate>
<asp:LinkButton ID="LnkAnticipoHistorialPDF" runat="server" data-toggle="tooltip" Title="PDF"> <i class="fa fa-file-pdf-o" style="margin-right: 10px; font-size:15px; font-weight:bold; color:dimgray;"></i> </asp:LinkButton>
<asp:LinkButton ID="LnkAnticipoHistorialExcel" runat="server" data-toggle="tooltip" Title="Excel"><i class="fa fa-file-excel-o" style="margin-right: 10px; font-size:15px; font-weight:bold; color:dimgray;"></i> </asp:LinkButton>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="LnkAnticipoHistorialPDF" />
<asp:PostBackTrigger ControlID="LnkAnticipoHistorialExcel" />
</Triggers>
</asp:UpdatePanel>
</div>
</div>
</div>
@@ -2003,16 +2060,27 @@
<span class="caption-subject bold uppercase">Cuentas Bancarias</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="tools">
<a href="javascript:;" class="collapse" data-original-title="" title=""></a>
<a href="javascript:;" class="fullscreen" data-original-title="" title=""></a>
<a href="javascript:;" class="remove" data-original-title="" title=""></a>
</div>
<div class="actions">
<div class="btn-group">
<asp:UpdatePanel UpdateMode="Conditional" runat="server" ID="UpdatePanel9">
<ContentTemplate>
<asp:LinkButton ID="LnkCuentasBancariasPDF" runat="server" data-toggle="tooltip" Title="PDF"> <i class="fa fa-file-pdf-o" style="margin-right: 10px; font-size:15px; font-weight:bold; color:dimgray;"></i> </asp:LinkButton>
<asp:LinkButton ID="LnkCuentasBancariasExcel" runat="server" data-toggle="tooltip" Title="Excel"><i class="fa fa-file-excel-o" style="margin-right: 10px; font-size:15px; font-weight:bold; color:dimgray;"></i> </asp:LinkButton>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="LnkCuentasBancariasPDF" />
<asp:PostBackTrigger ControlID="LnkCuentasBancariasExcel" />
</Triggers>
</asp:UpdatePanel>
</div>
</div>
</div>
<div class="portlet-body ">
<asp:UpdatePanel ID="UpCuentasBancos" runat="server" UpdateMode="Conditional">
@@ -5496,16 +5564,15 @@
<table border="0" cellpadding="0" class="Widthall grides" cellspacing="0">
<tbody>
<tr class="Titulos">
<tr class="Titulos" style="font-size: 12px">
<th style="width: 28px">#</th>
<th style="width: 200px">Marca</th>
<%-- <th width="73px">Precio<br />
General </th>--%>
<th width="73px">%</th>
<th width="73px">%</th>
<th width="73px">%</th>
<%-- <th width="73px">Precio<br />
Aplicado </th>--%>
<th style="width: 200px">MARCA</th>
<th width="73px">DCTO COM</th>
<th width="73px">DCTO ADIC 1</th>
<th width="73px">DCTO ADIC 2</th>
<th width="73px">PRONTO PAGO</th>
<th width="73px">PLAZO</th>
<th style="width: 73px;"></th>
</tr>
<tr align="center">
@@ -5532,7 +5599,7 @@
<td>
<asp:TextBox ID="txtPorcentaje" CssClass="form-control input-sm" Width="55px" MaxLength="15" runat="server" ValidationGroup="GprAgrega" Style="text-align: right"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="ftbe1" runat="server" TargetControlID="txtPorcentaje" FilterType="Custom, Numbers" ValidChars=".," />
<asp:RequiredFieldValidator ID="RFVPorcentaje" runat="server" ControlToValidate="txtPorcentaje" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''%'' Porcentaje</b> es necesario, por favor ingréselo." ValidationGroup="GprAgrega"></asp:RequiredFieldValidator>
<asp:RequiredFieldValidator ID="RFVPorcentaje" runat="server" ControlToValidate="txtPorcentaje" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''DCTO COM''</b> es necesario, por favor ingréselo." ValidationGroup="GprAgrega"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEPorcentaje" runat="server" HighlightCssClass="vco" TargetControlID="RFVPorcentaje" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td>
@@ -5547,9 +5614,20 @@
<%-- <asp:RequiredFieldValidator ID="RFVPorcentaje3" runat="server" ControlToValidate="txtPorcentaje3" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''%'' Porcentaje</b> es necesario, por favor ingréselo." ValidationGroup="GprAgrega"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender6" runat="server" HighlightCssClass="vco" TargetControlID="RFVPorcentaje3" Width="300px"></ajax:ValidatorCalloutExtender>--%>
</td>
<%-- <td>
<asp:Label ID="LbPrecioA" Width="55px" MaxLength="15" runat="server" ClientIDMode="Static"></asp:Label>
</td>--%>
<td>
<asp:TextBox ID="txtProntoPago" CssClass="form-control input-sm" Width="55px" MaxLength="15" runat="server" ValidationGroup="GprAgrega" Style="text-align: right"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="FilteredTextBoxExtender7" runat="server" TargetControlID="txtProntoPago" FilterType="Custom, Numbers" ValidChars=".," />
<%-- <asp:RequiredFieldValidator ID="RFVProntoPago" runat="server" ControlToValidate="txtProntoPago" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''PRONTO PAGO''</b> es necesario, por favor ingréselo." ValidationGroup="GprAgrega"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEProntoPago" runat="server" HighlightCssClass="vco" TargetControlID="RFVProntoPago" Width="300px"></ajax:ValidatorCalloutExtender>--%>
</td>
<td>
<asp:TextBox ID="txtPlazo" CssClass="form-control input-sm" Width="55px" MaxLength="15" runat="server" ValidationGroup="GprAgrega" Style="text-align: right"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="FilteredTextBoxExtender8" runat="server" TargetControlID="txtPlazo" FilterType="Custom, Numbers" />
<%-- <asp:RequiredFieldValidator ID="RFVPlazo" runat="server" ControlToValidate="txtPlazo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''PLAZO''</b> es necesario, por favor ingréselo." ValidationGroup="GprAgrega"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEPlazo" runat="server" HighlightCssClass="vco" TargetControlID="RFVPlazo" Width="300px"></ajax:ValidatorCalloutExtender>--%>
</td>
<td align="center">
<asp:LinkButton ID="LbAgregarMarca" runat="server" CssClass="btn btn-default" ValidationGroup="GprAgrega" Text="Agregar" />
</td>
@@ -5576,7 +5654,7 @@
</ItemTemplate>
<ItemStyle Width="28px"></ItemStyle>
</asp:TemplateField>
<asp:BoundField HeaderText="" ReadOnly="true" DataField="Marca" ItemStyle-Width="200px" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="" ReadOnly="true" DataField="Marca" ItemStyle-Width="100px" ItemStyle-HorizontalAlign="Left" />
<%-- <asp:BoundField HeaderText="" ReadOnly="true" DataField="PrecioG" ItemStyle-Width="73px" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" />--%>
@@ -5616,8 +5694,30 @@
<FooterStyle HorizontalAlign="Right"></FooterStyle>
</asp:TemplateField>
<asp:TemplateField HeaderText="">
<EditItemTemplate>
<asp:TextBox ID="TxtProntoPagoP" CssClass="form-control input-sm" runat="server" Width="80px" Text='<%# Eval("ProntoPago", "{0:N2}")%>' Style="text-align: right"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="ftbepp" runat="server" TargetControlID="TxtProntoPagoP" FilterType="Custom, Numbers" ValidChars=".," />
</EditItemTemplate>
<ItemTemplate>
<asp:Literal ID="lblProntoPago" runat="server" Text='<%# Eval("ProntoPago", "{0:N2}")%>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="73px" HorizontalAlign="Right"></ItemStyle>
<FooterStyle HorizontalAlign="Right"></FooterStyle>
</asp:TemplateField>
<%-- <asp:BoundField HeaderText="" ReadOnly="true" DataField="PrecioA" ItemStyle-Width="73px" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" />--%>
<asp:TemplateField HeaderText="">
<EditItemTemplate>
<asp:TextBox ID="TxtPlazoP" CssClass="form-control input-sm" runat="server" Width="80px" Text='<%# Eval("Plazo")%>' Style="text-align: right"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="ftbepl" runat="server" TargetControlID="TxtPlazoP" FilterType="Custom, Numbers" />
</EditItemTemplate>
<ItemTemplate>
<asp:Literal ID="lblPlazoP" runat="server" Text='<%# Eval("Plazo")%>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="73px" HorizontalAlign="Right"></ItemStyle>
<FooterStyle HorizontalAlign="Right"></FooterStyle>
</asp:TemplateField>
<asp:TemplateField>
<EditItemTemplate>

View File

@@ -399,6 +399,47 @@ Partial Class Clientes
Set(value As DataTable)
ViewState("DtPagos") = value
End Set
End Property
Private Property DtCotizaciones As DataTable
Get
Return CType(ViewState("DtCotizaciones"), DataTable)
End Get
Set(value As DataTable)
ViewState("DtCotizaciones") = value
End Set
End Property
Private Property DtCxCActivas As DataTable
Get
Return CType(ViewState("DtCxCActivas"), DataTable)
End Get
Set(value As DataTable)
ViewState("DtCxCActivas") = value
End Set
End Property
Private Property DtHistorialCxC As DataTable
Get
Return CType(ViewState("DtHistorialCxC"), DataTable)
End Get
Set(value As DataTable)
ViewState("DtHistorialCxC") = value
End Set
End Property
Private Property DtClientesAnticipo As DataTable
Get
Return CType(ViewState("DtClientesAnticipo"), DataTable)
End Get
Set(value As DataTable)
ViewState("DtClientesAnticipo") = value
End Set
End Property
Private Property DtAnticipoHistorial As DataTable
Get
Return CType(ViewState("DtAnticipoHistorial"), DataTable)
End Get
Set(value As DataTable)
ViewState("DtAnticipoHistorial") = value
End Set
End Property
'Private Property EstatusAnteriorCliente As Boolean
' Get
@@ -1654,16 +1695,20 @@ Partial Class Clientes
'Dim ObjClientesVentas As New ClsMovimientos
'CxC Clientes
If ObjMovtos.GetCxCClienteDetalle(CveCliente, "-1", "-1", -1, -1, UsuarioActual.CveEmpresa, DdlSucursalCliente.SelectedValue.ToEntero) Then
GvCxC.DataSource = ObjMovtos.DtResultados.FiltraParametros("Tipo = 'Act'", "Moneda, OrdenVencimiento, FechaVencimiento")
DtCxCActivas = ObjMovtos.DtResultados.FiltraParametros("Tipo = 'Act'", "Moneda, OrdenVencimiento, FechaVencimiento")
GvCxC.DataSource = DtCxCActivas
'solo tomo los 10 ultimos mas el totalizador general
Dim dt As DataTable = ObjMovtos.DtResultados.FiltraParametros("Tipo = 'Hist'")
DtHistorialCxC = dt
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
GvCxCHistorial.DataSource = dt.AsEnumerable().Take(22).CopyToDataTable()
End If
Retorno = True
Else
GvCxC.DataSource = Nothing
DtCxCActivas = Nothing
GvCxCHistorial.DataSource = Nothing
DtHistorialCxC = Nothing
End If
@@ -1676,11 +1721,15 @@ Partial Class Clientes
Private Sub CargaAnticipos(Optional SelectTop As Integer = 21, Optional CveClienteSucursal As Integer = -1)
Dim ObjMovtos As New ClsMovimientos()
If ObjMovtos.GetAnticiposNCIxCCliente(CveCliente, CveClienteSucursal:=DdlSucursalCliente.SelectedValue.ToEntero) Then
GVAnticipos.DataSource = ObjMovtos.DtResultados.FiltraParametros("Saldo > 0 ")
GVAnticiposHistorial.DataSource = ObjMovtos.DtResultados.FiltraParametros("Saldo <= 0 ")
DtClientesAnticipo = ObjMovtos.DtResultados.FiltraParametros("Saldo > 0 ")
GVAnticipos.DataSource = DtClientesAnticipo
DtAnticipoHistorial = ObjMovtos.DtResultados.FiltraParametros("Saldo <= 0 ")
GVAnticiposHistorial.DataSource = DtAnticipoHistorial
Else
GVAnticipos.DataSource = Nothing
DtClientesAnticipo = Nothing
GVAnticiposHistorial.DataSource = Nothing
DtAnticipoHistorial = Nothing
End If
ObjMovtos.Dispose()
GVAnticipos.DataBind()
@@ -4014,6 +4063,7 @@ Partial Class Clientes
LtlFactorCotVentas.Text = If(LtlCantidad.Text.ToEntero > 0, (LtlCantidadCotizaciones.Text.ToEntero / LtlCantidad.Text.ToEntero).FormatoNumero, "0.00")
'Carga Grid
GvCot.DataSource = ObjClientes.DtResultados
DtCotizaciones = ObjClientes.DtResultados
If UsuarioActual.Empresa.UsaOS Then
GvCot.Columns(9).Visible = True
@@ -4026,9 +4076,11 @@ Partial Class Clientes
LtlCantidadCotizaciones.Text = "0"
LtlFactorCotVentas.Text = "0.00"
GvCot.DataSource = Nothing
DtCotizaciones = Nothing
End If
Else
GvCot.DataSource = Nothing
DtCotizaciones = Nothing
End If
ObjClientes.Dispose()
GvCot.DataBind()
@@ -4925,10 +4977,22 @@ Partial Class Clientes
End If
End If
End Sub
Private Sub CargaClienteDispositivos(CveEmpresa As Integer)
Dim Dt As DataTable = GlobalDTUsuarios(UsuarioActual.CveUsuario)
If Dt IsNot Nothing AndAlso Dt.Rows.Count > 0 Then
DdlClienteDispositivo.DataSource = Dt.FiltraParametros($"CvePlataforma = 3 AND CveEmpresa = {CveEmpresa}", "Empresa")
DdlClienteDispositivo.DataBind()
DdlClienteDispositivo.Items.Insert(0, New ListItem("Seleccione", "-1"))
End If
End Sub
Protected Sub DdlEmpresaDispositivo_SelectedIndexChanged(sender As Object, e As EventArgs)
CargaEmpresasUsuario(DdlEmpresaDispositivo.SelectedValue.ToEntero())
End Sub
CargaClienteDispositivos(DdlEmpresaDispositivo.SelectedValue.ToEntero())
End Sub
Protected Sub ImgMoverDispositivo_Click(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
Me.NombreDispositivo = GvRow.DataKey("Display")
@@ -8201,6 +8265,8 @@ Partial Class Clientes
DTPorcentajeTemp.Columns.Add("PorcentajeProducto", GetType(Decimal))
DTPorcentajeTemp.Columns.Add("PorcentajeProducto2", GetType(Decimal))
DTPorcentajeTemp.Columns.Add("PorcentajeProducto3", GetType(Decimal))
DTPorcentajeTemp.Columns.Add("ProntoPago", GetType(Decimal))
DTPorcentajeTemp.Columns.Add("Plazo", GetType(Integer))
DTPorcentajeTemp.Columns.Add("Estatus", GetType(String))
DTPorcentajePrecios = DTPorcentajeTemp.Clone
End Sub
@@ -8240,6 +8306,8 @@ Partial Class Clientes
txtPorcentaje.Text = ""
txtPorcentaje2.Text = ""
txtPorcentaje3.Text = ""
txtProntoPago.Text = ""
txtPlazo.Text = ""
DdlMarcaPS.SelectedValue = "-1"
End Sub
@@ -8254,6 +8322,8 @@ Partial Class Clientes
registro.Item("PorcentajeProducto") = txtPorcentaje.Text.ToDecimal
registro.Item("PorcentajeProducto2") = txtPorcentaje2.Text.ToDecimal
registro.Item("PorcentajeProducto3") = txtPorcentaje3.Text.ToDecimal
registro.Item("ProntoPago") = txtProntoPago.Text.ToDecimal
registro.Item("Plazo") = txtPlazo.Text.ToEntero
registro.Item("Estatus") = "I"
DTPorcentajePrecios.Rows.Add(registro)
CargaDTPorcentajePrecios(DTPorcentajePrecios.FiltraParametros("Estatus <> 'D' "))
@@ -8305,6 +8375,8 @@ Partial Class Clientes
Dim PorcentajeProducto As Double = GvM.Rows(e.RowIndex).FCTextBox("TxtPorcentajeP").Text.ToDouble
Dim PorcentajeProducto2 As Double = GvM.Rows(e.RowIndex).FCTextBox("TxtPorcentajeP2").Text.ToDouble
Dim PorcentajeProducto3 As Double = GvM.Rows(e.RowIndex).FCTextBox("TxtPorcentajeP3").Text.ToDouble
Dim ProntoPago As Double = GvM.Rows(e.RowIndex).FCTextBox("TxtProntoPagoP").Text.ToDouble
Dim Plazo As Double = GvM.Rows(e.RowIndex).FCTextBox("TxtPlazoP").Text.ToDouble
If PorcentajeProducto > 0 And PorcentajeProducto <= 100 And PorcentajeProducto2 >= 0 And PorcentajeProducto2 <= 100 And PorcentajeProducto3 >= 0 And PorcentajeProducto3 <= 100 Then
Dim No As Integer = GvM.Rows(e.RowIndex).DataKey("No").ToEntero
@@ -8315,6 +8387,8 @@ Partial Class Clientes
Drs(0)("PorcentajeProducto") = PorcentajeProducto
Drs(0)("PorcentajeProducto2") = PorcentajeProducto2
Drs(0)("PorcentajeProducto3") = PorcentajeProducto3
Drs(0)("ProntoPago") = ProntoPago
Drs(0)("Plazo") = Plazo
If Drs(0)("Estatus").ToString <> "I" Then
Drs(0)("Estatus") = "U"
End If
@@ -8342,11 +8416,11 @@ Partial Class Clientes
If Dr("Estatus").ToString <> "" Then
If Dr("Estatus").ToString = "I" Then
If Not ObjPS.AddPorcentajeMarcas(CveCliente, Dr("CveMarca").ToString.ToEntero, Dr("PorcentajeProducto").ToString.ToDecimal, Dr("PorcentajeProducto2").ToString.ToDecimal, Dr("PorcentajeProducto3").ToString.ToDecimal, UsuarioActual.CveUsuario) Then
If Not ObjPS.AddPorcentajeMarcas(CveCliente, Dr("CveMarca").ToString.ToEntero, Dr("PorcentajeProducto").ToString.ToDecimal, Dr("PorcentajeProducto2").ToString.ToDecimal, Dr("PorcentajeProducto3").ToString.ToDecimal, UsuarioActual.CveUsuario, Dr("ProntoPago").ToString.ToDecimal, Dr("Plazo").ToString.ToEntero) Then
TieneError = True
End If
ElseIf Dr("Estatus").ToString = "U" Then
If Not ObjPS.UpdatePorcentajeMarcas(CveCliente, Dr("CveMarca").ToString.ToEntero, Dr("PorcentajeProducto").ToString.ToDecimal, Dr("PorcentajeProducto2").ToString.ToDecimal, Dr("PorcentajeProducto3").ToString.ToDecimal) Then
If Not ObjPS.UpdatePorcentajeMarcas(CveCliente, Dr("CveMarca").ToString.ToEntero, Dr("PorcentajeProducto").ToString.ToDecimal, Dr("PorcentajeProducto2").ToString.ToDecimal, Dr("PorcentajeProducto3").ToString.ToDecimal, Dr("ProntoPago").ToString.ToDecimal, Dr("Plazo").ToString.ToEntero) Then
TieneError = True
End If
ElseIf Dr("Estatus").ToString = "D" Then
@@ -9449,326 +9523,390 @@ Partial Class Clientes
Next
Return Timbre
End Function
'Private Function GenerarNotaCredito(CvePS As Integer, Tipo As Integer, CveUnidadMedida As Integer, Importe As Decimal, Iva As Decimal, Descripcion As String, CveClasificacion As Integer) As Boolean
' Dim Respuesta As Boolean = False
' Dim ObjVentas As New ClsVentas
' Dim ObjConta As New ClsContabilidad(ObjVentas.IniciaTransacSQL())
' Dim ObjAcum As New ClsAcumuladores(ObjVentas.IniciaTransacSQL())
' Dim ErrorVentas As Boolean = False
' Dim SubTotal As Decimal = Importe
' Dim Total As Decimal = Importe + Iva
' Dim RetIVA As Decimal = 0
' Dim RetISR As Decimal = 0
' Dim TipoCambio As Decimal = 0
' Dim FechaVencimiento As Date = Now
' Dim fecha As Date = Now
' Dim Folio As Integer = 0
' Dim Serie As String = ""
' If FolioNotaCredito() Then
' Folio = FolioNotaAcumulador
' Serie = SerieNotaAcumulador
' End If
' Dim CveSubProyecto As Integer = DdlSubProyecto.SelectedValue.ToEntero
' Dim CveVenta As Integer
' If Folio > 0 Then
' Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas($"Clientes/{Descripcion}", 1, Total, Total, 1, fecha, "Nota de crédito por Cargo", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
' If ObjVentas.AddVenta("Egs", Folio, CveCliente.ToEntero, -1, SubTotal, 0, 0, Iva, RetIVA, RetISR, Total, 1, TipoCambio,
' 0, 0, 0, FechaVencimiento, fecha, "", "", fecha, -1, "", "", "", 0, 0, 0, "-1".ToDate, "-1".ToDate, "-1".ToDate, -1, -1, 0, CvePrePoliza,
' UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Serie:=Serie, CveSubProyecto:=CveSubProyecto, CveSubProyectoEjecucion:=CveSubProyecto) Then
' CveVenta = ObjVentas.CveVenta
' If CveVenta > 0 Then
' If ObjVentas.AddVentaDetalle(CveVenta, CvePS, 1, CveUnidadMedida, SubTotal, 0.16, SubTotal * 0.16, Descripcion, 0, 0, -1, 0) Then
' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, SubTotal, Folio.ToString, 150, String.Format("{0}-{1}", Serie, Folio), fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveClasificacion:=CveClasificacion, ImporteMX:=SubTotal, CveSubProyecto:=CveSubProyecto) Then
' ErrorVentas = True
' End If
' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Total, Folio.ToString, 12, String.Format("{0}-{1}", Serie, Folio), fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=Total) Then
' ErrorVentas = True
' End If
' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Iva, Folio.ToString, 13, String.Format("{0}-{1}", Serie, Folio), fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=Iva) Then
' ErrorVentas = True
' End If
' If Not ErrorVentas Then
' For Each GvRow As GridViewRow In GvAcum.Rows
' Dim CveMovto As Integer = GvRow.DataKey("CveMovto").ToEntero
' If (Tipo = 1 And GvRow.FCCheckBox("ChkCargo").Checked) Or (Tipo = 2 And GvRow.FCCheckBox("ChkBonificacion").Checked) Then
' If ObjAcum.DistribuidorActualizarFacturados(CveMovto, UsuarioActual.CveEmpresa, Tipo, CveVenta) Then
' Respuesta = True
' ErrorVentas = False
' CveVentaNota = CveVenta
' Else
' Respuesta = False
' ErrorVentas = True
' CveVentaNota = 0
' Exit For
' End If
' End If
' Next
' End If
' If Not ErrorVentas Then
' Alert($"Nota de crédito generada correctamente <a href='./Ventas.aspx?CveVenta={CveVenta}' >{Serie}-{Folio}</a>")
' End If
' Else
' ErrorVentas = True
' End If
' Else
' ErrorVentas = True
' End If
' Else
' ErrorVentas = True
' End If
' Else
' Alert("No se pudo obtener el Folio.", TipoMensaje.MsgError)
' End If
' If ErrorVentas Then
' ObjVentas.RollBack()
' Else
' ObjVentas.Commit()
' CargaUsados()
' Dim DtDetallesVenta As New DataTable
' If ObjVentas.GetVentaDetalle(CveVenta) Then
' DtDetallesVenta = ObjVentas.DtResultados
' 'CreaObjetosVenta(CveVenta, Serie, Folio, SubTotal, Iva, DtDetallesVenta)
' ObjFactura.Timbre = PreParaTimbre(ObjFactura, ObjFactura.CveSubProyecto)
' Dim ObjTimbrado As New Timbrado
' Dim SeTimbro As Boolean = False
' SeTimbro = ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura)
' If SeTimbro Then
' Alert("Se timbro correctamente")
' Else
' Alert("No se pudo timbrar, intente mas tarde.", TipoMensaje.MsgError)
' End If
' Else
' Alert("No se pudo timbrar, no se pudieron obtener los detalles de la venta.", TipoMensaje.MsgError)
' End If
' End If
' ObjVentas.Dispose()
' Return Respuesta
'End Function
'Private Function generaNC(CveVenta As Integer, ByRef ObjVentas As ClsVentas, ByVal factura As Modelos.Factura) As List(Of Object)
' Dim Obj As New List(Of Object)
' Dim CveVentaNueva As Integer = ObjVentas.CveVenta
' Dim BanderaGeneraNC As Boolean = False
' If UsuarioActual.CveEmpresa.Contiene(1, 119) Then BanderaGeneraNC = True
' If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) Then
' If ObjVentas.DtResultados IsNot Nothing AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then
' Dim drv As DataRow = ObjVentas.DtResultados.Rows(0)
' Dim TmpDTconceptos As DataTable = Nothing
' ''CargaCliente
' Dim CveCliente As Integer = drv("CveCliente").ToString.ToEntero
' If UsuarioActual.CveEmpresa = 2 AndAlso UsuarioActual.CveUsuario = 77 AndAlso Not CveCliente.Contiene(10450, 10460, 10458) Then
' Return Nothing
' ElseIf UsuarioActual.CveEmpresa = 2 AndAlso UsuarioActual.CveUsuario = 21 AndAlso Not CveCliente.Contiene(27448) Then
' Return Nothing
' End If
' factura.TipoDocto = drv("TipoDocto").ToString
' factura.Serie = drv("Serie").ToString
' factura.FechaEjecucion = drv("FechaEjecucion").ToString.ToDateTime
' factura.Fecha = drv("Fecha").ToString.ToDateTime
' factura.CveSubProyectoEjecucion = drv("CveSubProyectoEjecucion").ToString.ToEntero
' factura.CveSubProyectoCobranza = drv("CveSubProyectoCobranza").ToString.ToEntero
' factura.CveClienteSucursal = drv("CveClienteSucursal").ToString.ToEntero
' factura.CveSubProyecto = drv("CveSubProyecto").ToString.ToEntero
' ''CargaDetalle
' If ObjVentas.GetVentaDetalle(CveVenta) Then
' TmpDTconceptos = ObjVentas.DtResultados
' TmpDTconceptos.Columns.Add("CveMovimientoDetallePedido", GetType(Integer))
' GvPS.DataSource = TmpDTconceptos
' GvPS.DataBind()
' End If
' '' Carga Totales
' factura.SubTotal = drv("SubTotal").ToString.ToDecimal
' factura.Descuento = drv("Descuento").ToString.ToDecimal
' factura.Amortizacion = drv("Amortizacion").ToString.ToDecimal
' factura.IVA = drv("IVA").ToString.ToDecimal
' factura.RetIVA = drv("RetIVA").ToString.ToDecimal
' factura.RetISR = drv("RetISR").ToString.ToDecimal
' factura.Total = drv("Total").ToString.ToDecimal
' factura.MotivoDescuento = drv("MotivoDescuento").ToString
' factura.Observaciones = drv("Observaciones").ToString
' factura.CveMoneda = drv("CveMoneda").ToString.ToEntero
' factura.TipoCambio = drv("TipoCambio").ToString.ToDecimal
' factura.CveVendedor = drv("CveVendedor").ToString.ToEntero
' factura.RefDocto = drv("Ref").ToString
' If factura.CveCliente > 0 Then
' If Not IsNothing(TmpDTconceptos) AndAlso TmpDTconceptos.Rows.Count > 0 Then
' If Not drv("Total").ToString.ToDecimal = factura.Total Then
' Return Nothing
' End If
' End If
' End If
' End If
' End If
' If Obj.Count > 0 Then
' Return Obj
' Else
' Return Nothing
' End If
'End Function
'Private Function PreParaTimbre(Obj As Modelos.Factura, CveSubProyecto As Integer) As CFDITimbre
' Dim Timbre As New CFDITimbre
' Timbre.Comprobante.TipoComprobante = If(Obj.TipoDocto.Contiene("Ing", "Ant"), "I", If(Obj.TipoDocto.Contiene("Egs", "Dev"), "E", ""))
' Timbre.Comprobante.Folio = Obj.Folio.ToString
' Timbre.Comprobante.Serie = Obj.Serie
' Timbre.Comprobante.Fecha = Obj.Fecha
' Timbre.Comprobante.FormadePago = Obj.FormaPagoSAT33
' Timbre.Comprobante.CondicionesdePago = Obj.FormaPago33
' Timbre.Comprobante.MetodoPago = Obj.ClaveMetodoPagoSAT
' Timbre.Comprobante.Subtotal = Obj.SubTotal
' Timbre.Comprobante.Descuentos = Obj.Descuento
' Timbre.Comprobante.Moneda = Obj.MonedaSAT
' Timbre.Comprobante.TipoCambio = If(Obj.CveMoneda = 1, "1", Obj.TipoCambio.ToString)
' Timbre.Comprobante.Total = Obj.Total
' Try
' Obj.SetSubProyecto(Me)
' Timbre.Comprobante.LugarExpedicion = Obj.SubProyecto.CP
' Catch ex As Exception
' End Try
' Timbre.Comprobante.Confirmacion = ""
' Timbre.Receptor.RFC = TxtRFC.Text
' Timbre.Receptor.Nombre = TxtNombre.Text
' Timbre.Receptor.ResidenciaFiscal = ""
' Timbre.Receptor.NumeroRegistroTributario = ""
' Timbre.Receptor.UsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("UsoCFDI", $"CveUsoCFDI = {DdlUsoCFDI.SelectedValue}")
' Dim totSubTotal As Decimal = Obj.SubTotal
' Dim totIVA As Decimal = Obj.IVA
' Dim totRetIVA As Decimal = Obj.RetIVA
' Dim totRetISR As Decimal = Obj.RetISR
' Dim TasaRetIVA As Decimal = 0
' Dim TasaRetISR As Decimal = 0
' Dim i As Integer = 1
' ''detalles
' Dim tPS As String = ""
' For Each drr As DataRow In Obj.DtDetalle.Rows
' If drr("PS").ToString.Length = 1 Then
' tPS = drr("Obs").ToString
' Else
' If drr("PS").ToString.Length = 0 Then
' tPS = ""
' Else
' tPS = String.Format("{0} {1}", drr("PS"), drr("Obs"))
' End If
' End If
' '' condicionante, especial
' If UsuarioActual.CveEmpresa = 15 Then drr("UM") = "" ' les comentan que no debe de ir la etiqueta de "unidad" en el producto
' Dim concepto As New CFDIConceptos With {.Cantidad = drr("Cantidad").ToString.ToDecimal,
' .Descripcion = tPS,
' .ValorUnitario = drr("PU").ToString.ToDecimal,
' .Importe = drr("TotalImporte").ToString.ToDecimal,
' .Descuento = drr("Descuento").ToString.ToDecimal,
' .Unidad = drr("UM").ToString,
' .ClaveUnidad = drr("SATClaveUM").ToString,
' .ClaveProdServ = drr("SATClaveProdServ").ToString,
' .Noidentificacion = drr("Noidentificacion").ToString,
' .CuentaPredial = drr("CuentaPredial").ToString}
' '' verifica suma subtotales
' If i = Obj.DtDetalle.Rows.Count AndAlso totSubTotal <> concepto.Importe Then 'proceso de ajusta de decimales
' concepto.Importe = totSubTotal
' End If
' totSubTotal = totSubTotal - concepto.Importe
' ''siempre estaremos agregando el iva, auqnue sea en importe cero o tasa cero, para que se emita la factura
' If drr("ImporteIVA").ToString.ToDouble > 0 Then
' concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "T", .Base = concepto.Importe - concepto.Descuento, .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})
' 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 = TasaRetIVA, .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 = TasaRetISR, .Impuesto = "001", .Importe = drr("ImporteRetISR").ToString.ToDecimal})
' End If
' Timbre.Conceptos.Add(concepto)
' i += 1
' Next
' Dim AplicaComercioExteriorSubProyecto As Boolean = If(GlobalDTSubProyectos(-1, Obj.CveSubProyecto)(0)("AplicaComercioExterior").ToString = "True", True, False)
' Timbre.Complementos.ComercioExterior11.AplicaComercioExteriorSubProyecto = AplicaComercioExteriorSubProyecto
' If Obj.Cliente.AplicaComercioExterior And AplicaComercioExteriorSubProyecto Then
' Timbre.Receptor.ResidenciaFiscal = Obj.Cliente.ClaveSATPais
' Timbre.Receptor.NumeroRegistroTributario = Obj.Cliente.NumRegIdTrib
' End If
' Return Timbre
'End Function
End Function
'Private Function GenerarNotaCredito(CvePS As Integer, Tipo As Integer, CveUnidadMedida As Integer, Importe As Decimal, Iva As Decimal, Descripcion As String, CveClasificacion As Integer) As Boolean
' Dim Respuesta As Boolean = False
' Dim ObjVentas As New ClsVentas
' Dim ObjConta As New ClsContabilidad(ObjVentas.IniciaTransacSQL())
' Dim ObjAcum As New ClsAcumuladores(ObjVentas.IniciaTransacSQL())
' Dim ErrorVentas As Boolean = False
' Dim SubTotal As Decimal = Importe
' Dim Total As Decimal = Importe + Iva
' Dim RetIVA As Decimal = 0
' Dim RetISR As Decimal = 0
' Dim TipoCambio As Decimal = 0
' Dim FechaVencimiento As Date = Now
' Dim fecha As Date = Now
' Dim Folio As Integer = 0
' Dim Serie As String = ""
' If FolioNotaCredito() Then
' Folio = FolioNotaAcumulador
' Serie = SerieNotaAcumulador
' End If
' Dim CveSubProyecto As Integer = DdlSubProyecto.SelectedValue.ToEntero
' Dim CveVenta As Integer
' If Folio > 0 Then
' Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas($"Clientes/{Descripcion}", 1, Total, Total, 1, fecha, "Nota de crédito por Cargo", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
' If ObjVentas.AddVenta("Egs", Folio, CveCliente.ToEntero, -1, SubTotal, 0, 0, Iva, RetIVA, RetISR, Total, 1, TipoCambio,
' 0, 0, 0, FechaVencimiento, fecha, "", "", fecha, -1, "", "", "", 0, 0, 0, "-1".ToDate, "-1".ToDate, "-1".ToDate, -1, -1, 0, CvePrePoliza,
' UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Serie:=Serie, CveSubProyecto:=CveSubProyecto, CveSubProyectoEjecucion:=CveSubProyecto) Then
' CveVenta = ObjVentas.CveVenta
' If CveVenta > 0 Then
' If ObjVentas.AddVentaDetalle(CveVenta, CvePS, 1, CveUnidadMedida, SubTotal, 0.16, SubTotal * 0.16, Descripcion, 0, 0, -1, 0) Then
' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, SubTotal, Folio.ToString, 150, String.Format("{0}-{1}", Serie, Folio), fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveClasificacion:=CveClasificacion, ImporteMX:=SubTotal, CveSubProyecto:=CveSubProyecto) Then
' ErrorVentas = True
' End If
' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Total, Folio.ToString, 12, String.Format("{0}-{1}", Serie, Folio), fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=Total) Then
' ErrorVentas = True
' End If
' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Iva, Folio.ToString, 13, String.Format("{0}-{1}", Serie, Folio), fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=Iva) Then
' ErrorVentas = True
' End If
' If Not ErrorVentas Then
' For Each GvRow As GridViewRow In GvAcum.Rows
' Dim CveMovto As Integer = GvRow.DataKey("CveMovto").ToEntero
' If (Tipo = 1 And GvRow.FCCheckBox("ChkCargo").Checked) Or (Tipo = 2 And GvRow.FCCheckBox("ChkBonificacion").Checked) Then
' If ObjAcum.DistribuidorActualizarFacturados(CveMovto, UsuarioActual.CveEmpresa, Tipo, CveVenta) Then
' Respuesta = True
' ErrorVentas = False
' CveVentaNota = CveVenta
' Else
' Respuesta = False
' ErrorVentas = True
' CveVentaNota = 0
' Exit For
' End If
' End If
' Next
' End If
' If Not ErrorVentas Then
' Alert($"Nota de crédito generada correctamente <a href='./Ventas.aspx?CveVenta={CveVenta}' >{Serie}-{Folio}</a>")
' End If
' Else
' ErrorVentas = True
' End If
' Else
' ErrorVentas = True
' End If
' Else
' ErrorVentas = True
' End If
' Else
' Alert("No se pudo obtener el Folio.", TipoMensaje.MsgError)
' End If
' If ErrorVentas Then
' ObjVentas.RollBack()
' Else
' ObjVentas.Commit()
' CargaUsados()
' Dim DtDetallesVenta As New DataTable
' If ObjVentas.GetVentaDetalle(CveVenta) Then
' DtDetallesVenta = ObjVentas.DtResultados
' 'CreaObjetosVenta(CveVenta, Serie, Folio, SubTotal, Iva, DtDetallesVenta)
' ObjFactura.Timbre = PreParaTimbre(ObjFactura, ObjFactura.CveSubProyecto)
' Dim ObjTimbrado As New Timbrado
' Dim SeTimbro As Boolean = False
' SeTimbro = ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura)
' If SeTimbro Then
' Alert("Se timbro correctamente")
' Else
' Alert("No se pudo timbrar, intente mas tarde.", TipoMensaje.MsgError)
' End If
' Else
' Alert("No se pudo timbrar, no se pudieron obtener los detalles de la venta.", TipoMensaje.MsgError)
' End If
' End If
' ObjVentas.Dispose()
' Return Respuesta
'End Function
'Private Function generaNC(CveVenta As Integer, ByRef ObjVentas As ClsVentas, ByVal factura As Modelos.Factura) As List(Of Object)
' Dim Obj As New List(Of Object)
' Dim CveVentaNueva As Integer = ObjVentas.CveVenta
' Dim BanderaGeneraNC As Boolean = False
' If UsuarioActual.CveEmpresa.Contiene(1, 119) Then BanderaGeneraNC = True
' If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) Then
' If ObjVentas.DtResultados IsNot Nothing AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then
' Dim drv As DataRow = ObjVentas.DtResultados.Rows(0)
' Dim TmpDTconceptos As DataTable = Nothing
' ''CargaCliente
' Dim CveCliente As Integer = drv("CveCliente").ToString.ToEntero
' If UsuarioActual.CveEmpresa = 2 AndAlso UsuarioActual.CveUsuario = 77 AndAlso Not CveCliente.Contiene(10450, 10460, 10458) Then
' Return Nothing
' ElseIf UsuarioActual.CveEmpresa = 2 AndAlso UsuarioActual.CveUsuario = 21 AndAlso Not CveCliente.Contiene(27448) Then
' Return Nothing
' End If
' factura.TipoDocto = drv("TipoDocto").ToString
' factura.Serie = drv("Serie").ToString
' factura.FechaEjecucion = drv("FechaEjecucion").ToString.ToDateTime
' factura.Fecha = drv("Fecha").ToString.ToDateTime
' factura.CveSubProyectoEjecucion = drv("CveSubProyectoEjecucion").ToString.ToEntero
' factura.CveSubProyectoCobranza = drv("CveSubProyectoCobranza").ToString.ToEntero
' factura.CveClienteSucursal = drv("CveClienteSucursal").ToString.ToEntero
' factura.CveSubProyecto = drv("CveSubProyecto").ToString.ToEntero
' ''CargaDetalle
' If ObjVentas.GetVentaDetalle(CveVenta) Then
' TmpDTconceptos = ObjVentas.DtResultados
' TmpDTconceptos.Columns.Add("CveMovimientoDetallePedido", GetType(Integer))
' GvPS.DataSource = TmpDTconceptos
' GvPS.DataBind()
' End If
' '' Carga Totales
' factura.SubTotal = drv("SubTotal").ToString.ToDecimal
' factura.Descuento = drv("Descuento").ToString.ToDecimal
' factura.Amortizacion = drv("Amortizacion").ToString.ToDecimal
' factura.IVA = drv("IVA").ToString.ToDecimal
' factura.RetIVA = drv("RetIVA").ToString.ToDecimal
' factura.RetISR = drv("RetISR").ToString.ToDecimal
' factura.Total = drv("Total").ToString.ToDecimal
' factura.MotivoDescuento = drv("MotivoDescuento").ToString
' factura.Observaciones = drv("Observaciones").ToString
' factura.CveMoneda = drv("CveMoneda").ToString.ToEntero
' factura.TipoCambio = drv("TipoCambio").ToString.ToDecimal
' factura.CveVendedor = drv("CveVendedor").ToString.ToEntero
' factura.RefDocto = drv("Ref").ToString
' If factura.CveCliente > 0 Then
' If Not IsNothing(TmpDTconceptos) AndAlso TmpDTconceptos.Rows.Count > 0 Then
' If Not drv("Total").ToString.ToDecimal = factura.Total Then
' Return Nothing
' End If
' End If
' End If
' End If
' End If
' If Obj.Count > 0 Then
' Return Obj
' Else
' Return Nothing
' End If
'End Function
'Private Function PreParaTimbre(Obj As Modelos.Factura, CveSubProyecto As Integer) As CFDITimbre
' Dim Timbre As New CFDITimbre
' Timbre.Comprobante.TipoComprobante = If(Obj.TipoDocto.Contiene("Ing", "Ant"), "I", If(Obj.TipoDocto.Contiene("Egs", "Dev"), "E", ""))
' Timbre.Comprobante.Folio = Obj.Folio.ToString
' Timbre.Comprobante.Serie = Obj.Serie
' Timbre.Comprobante.Fecha = Obj.Fecha
' Timbre.Comprobante.FormadePago = Obj.FormaPagoSAT33
' Timbre.Comprobante.CondicionesdePago = Obj.FormaPago33
' Timbre.Comprobante.MetodoPago = Obj.ClaveMetodoPagoSAT
' Timbre.Comprobante.Subtotal = Obj.SubTotal
' Timbre.Comprobante.Descuentos = Obj.Descuento
' Timbre.Comprobante.Moneda = Obj.MonedaSAT
' Timbre.Comprobante.TipoCambio = If(Obj.CveMoneda = 1, "1", Obj.TipoCambio.ToString)
' Timbre.Comprobante.Total = Obj.Total
' Try
' Obj.SetSubProyecto(Me)
' Timbre.Comprobante.LugarExpedicion = Obj.SubProyecto.CP
' Catch ex As Exception
' End Try
' Timbre.Comprobante.Confirmacion = ""
' Timbre.Receptor.RFC = TxtRFC.Text
' Timbre.Receptor.Nombre = TxtNombre.Text
' Timbre.Receptor.ResidenciaFiscal = ""
' Timbre.Receptor.NumeroRegistroTributario = ""
' Timbre.Receptor.UsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("UsoCFDI", $"CveUsoCFDI = {DdlUsoCFDI.SelectedValue}")
' Dim totSubTotal As Decimal = Obj.SubTotal
' Dim totIVA As Decimal = Obj.IVA
' Dim totRetIVA As Decimal = Obj.RetIVA
' Dim totRetISR As Decimal = Obj.RetISR
' Dim TasaRetIVA As Decimal = 0
' Dim TasaRetISR As Decimal = 0
' Dim i As Integer = 1
' ''detalles
' Dim tPS As String = ""
' For Each drr As DataRow In Obj.DtDetalle.Rows
' If drr("PS").ToString.Length = 1 Then
' tPS = drr("Obs").ToString
' Else
' If drr("PS").ToString.Length = 0 Then
' tPS = ""
' Else
' tPS = String.Format("{0} {1}", drr("PS"), drr("Obs"))
' End If
' End If
' '' condicionante, especial
' If UsuarioActual.CveEmpresa = 15 Then drr("UM") = "" ' les comentan que no debe de ir la etiqueta de "unidad" en el producto
' Dim concepto As New CFDIConceptos With {.Cantidad = drr("Cantidad").ToString.ToDecimal,
' .Descripcion = tPS,
' .ValorUnitario = drr("PU").ToString.ToDecimal,
' .Importe = drr("TotalImporte").ToString.ToDecimal,
' .Descuento = drr("Descuento").ToString.ToDecimal,
' .Unidad = drr("UM").ToString,
' .ClaveUnidad = drr("SATClaveUM").ToString,
' .ClaveProdServ = drr("SATClaveProdServ").ToString,
' .Noidentificacion = drr("Noidentificacion").ToString,
' .CuentaPredial = drr("CuentaPredial").ToString}
' '' verifica suma subtotales
' If i = Obj.DtDetalle.Rows.Count AndAlso totSubTotal <> concepto.Importe Then 'proceso de ajusta de decimales
' concepto.Importe = totSubTotal
' End If
' totSubTotal = totSubTotal - concepto.Importe
' ''siempre estaremos agregando el iva, auqnue sea en importe cero o tasa cero, para que se emita la factura
' If drr("ImporteIVA").ToString.ToDouble > 0 Then
' concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "T", .Base = concepto.Importe - concepto.Descuento, .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})
' 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 = TasaRetIVA, .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 = TasaRetISR, .Impuesto = "001", .Importe = drr("ImporteRetISR").ToString.ToDecimal})
' End If
' Timbre.Conceptos.Add(concepto)
' i += 1
' Next
' Dim AplicaComercioExteriorSubProyecto As Boolean = If(GlobalDTSubProyectos(-1, Obj.CveSubProyecto)(0)("AplicaComercioExterior").ToString = "True", True, False)
' Timbre.Complementos.ComercioExterior11.AplicaComercioExteriorSubProyecto = AplicaComercioExteriorSubProyecto
' If Obj.Cliente.AplicaComercioExterior And AplicaComercioExteriorSubProyecto Then
' Timbre.Receptor.ResidenciaFiscal = Obj.Cliente.ClaveSATPais
' Timbre.Receptor.NumeroRegistroTributario = Obj.Cliente.NumRegIdTrib
' End If
' Return Timbre
'End Function
#End Region
#Region "C L I E N T E S G R I D S I M P R I M I R P D F/Excel"
Private Sub LnkCotizacionesPDF_Click(sender As Object, e As EventArgs) Handles LnkCotizacionesPDF.Click
ImprimeGridsProveedores("PDF", DtCotizaciones, "RepClientesCotizaciones")
End Sub
Private Sub LnkCotizacionesExcel_Click(sender As Object, e As EventArgs) Handles LnkCotizacionesExcel.Click
ImprimeGridsProveedores("Excel", DtCotizaciones, "RepClientesCotizaciones")
End Sub
Private Sub LnkCxCActivasPDF_Click(sender As Object, e As EventArgs) Handles LnkCxCActivasPDF.Click
ImprimeGridsProveedores("PDF", DtCxCActivas, "RepClientesCxCActivas")
End Sub
Private Sub LnkCxCActivasExcel_Click(sender As Object, e As EventArgs) Handles LnkCxCActivasExcel.Click
ImprimeGridsProveedores("Excel", DtCxCActivas, "RepClientesCxCActivas")
End Sub
Private Sub LnkHistorialCxCPDF_Click(sender As Object, e As EventArgs) Handles LnkHistorialCxCPDF.Click
ImprimeGridsProveedores("PDF", DtHistorialCxC, "RepClientesHistorialCxC")
End Sub
Private Sub LnkHistorialCxCExcel_Click(sender As Object, e As EventArgs) Handles LnkHistorialCxCExcel.Click
ImprimeGridsProveedores("Excel", DtHistorialCxC, "RepClientesHistorialCxC")
End Sub
Private Sub LnkAnticipoClientePDF_Click(sender As Object, e As EventArgs) Handles LnkAnticipoClientePDF.Click
ImprimeGridsProveedores("PDF", DtClientesAnticipo, "RepClientesAnticipos")
End Sub
Private Sub LnkAnticipoClienteExcel_Click(sender As Object, e As EventArgs) Handles LnkAnticipoClienteExcel.Click
ImprimeGridsProveedores("Excel", DtClientesAnticipo, "RepClientesAnticipos")
End Sub
Private Sub LnkAnticipoHistorialPDF_Click(sender As Object, e As EventArgs) Handles LnkAnticipoHistorialPDF.Click
ImprimeGridsProveedores("PDF", DtAnticipoHistorial, "RepClientesAnticipoHistorial")
End Sub
Private Sub LnkAnticipoHistorialExcel_Click(sender As Object, e As EventArgs) Handles LnkAnticipoHistorialExcel.Click
ImprimeGridsProveedores("Excel", DtAnticipoHistorial, "RepClientesAnticipoHistorial")
End Sub
Private Sub LnkCuentasBancariasPDF_Click(sender As Object, e As EventArgs) Handles LnkCuentasBancariasPDF.Click
ImprimeGridsProveedores("PDF", DTCuentasBancos, "RepClientesCuentasBancarias")
End Sub
Private Sub LnkCuentasBancariasExcel_Click(sender As Object, e As EventArgs) Handles LnkCuentasBancariasExcel.Click
ImprimeGridsProveedores("Excel", DTCuentasBancos, "RepClientesCuentasBancarias")
End Sub
Private Sub ImprimeGridsProveedores(Formato As String, DtTemp As DataTable, NombreFormato As String)
If DtTemp IsNot Nothing And DtTemp.Rows.Count > 0 Then
Dim params As New List(Of ReportParameter)
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
params.Add(New ReportParameter("AgrupadoPor", "Cliente: " & LtlCliente.Text))
If Imagen.Exists Then
params.Add(New ReportParameter("LogoPath", logouri))
Else
params.Add(New ReportParameter("LogoPath", ""))
End If
ImprimirPDF("Empresas\Grales\Formatos\" & NombreFormato & ".rdlc", DtTemp, params, NombreFormato & "_" & Now.ToString("yyyyMMddhhmmss"), Formato:=Formato)
Else
Alert("No se encontró información.", TipoMensaje.MsgAdvertencia)
End If
End Sub
#End Region
End Class

View File

@@ -7,6 +7,7 @@ Imports System.IO
Imports System.Linq
Imports System.Security.Cryptography.X509Certificates
Imports System.Globalization
Imports System.Net.Http
Partial Class PV
Inherits ClsPaginas
@@ -2290,6 +2291,18 @@ Partial Class PV
If ObjFactura.CveCliente > 0 Then
If TmpDT.Rows.Count > 0 Then
Dim Retorno = ObjFactura.EmitirFactura()
If Retorno.CveVenta > 0 Then
Dim SbAlert As New StringBuilder
SbAlert.AppendFormat("{0}<br>", Retorno.Mensajes(Retorno.Mensajes.Count - 1))
DescargarFactura(Retorno.CveVenta, UsuarioActual.CveEmpresa)
SbAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF</a></li></ul><br/>", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", CveVenta)))
Retorno.Mensajes(Retorno.Mensajes.Count - 1) = SbAlert.ToString()
End If
For Each Mensaje In Retorno.Mensajes
Alert(Mensaje, If(Retorno.TieneError, TipoMensaje.MsgError, TipoMensaje.MsgInformacion), If(Retorno.TieneError, "", Retorno.LigaPV))
Next
@@ -2298,6 +2311,27 @@ Partial Class PV
End If
End Sub
Private Function DescargarFactura(CveVenta As Integer, CveEmpresa As Integer, Optional GetBytes As Boolean = True) As Byte()
Dim Url = New Uri(String.Format("http://{0}:{1}/Compras/PopUpVerFactura.aspx?P={2}", HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port, Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", CveVenta))))
Dim File As Byte() = Nothing
Try
Using httpClient = New HttpClient()
httpClient.Timeout = New TimeSpan(0, 15, 0)
Using request = New HttpRequestMessage(HttpMethod.Get, Url)
request.Headers.Add("ADSToken", Encripta(String.Format("CVEEMPRESA={0}&TICKS={1}&CveUsuario={2}", CveEmpresa, DateTime.UtcNow.Ticks, UsuarioActual.CveUsuario)))
Dim response = httpClient.SendAsync(request).Result
If GetBytes AndAlso response.StatusCode = Net.HttpStatusCode.OK Then
File = response.Content.ReadAsByteArrayAsync().Result
End If
End Using
End Using
Catch ex As Exception
File = Nothing
OnError("Ocurrió un error al descargar la factura", ex)
End Try
Return File
End Function
#End Region
#Region "OBJETO VENTA"
@@ -2485,7 +2519,7 @@ Partial Class PV
ObjFactura.DtRecepcionUsados = TmpDTRecepcionUsados
ObjFactura.GenerarPDFFactura = True
ObjFactura.GenerarPDFFactura = False
Dim CveTipoAlmacen As Integer = If(TmpDTAjustes IsNot Nothing AndAlso TmpDTAjustes.Rows.Count > 0, 6, 22)
If GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros($"CveTipoAlmacen = {CveTipoAlmacen} AND CveSubProyecto= {DdlSubProyectoDatos.SelectedValue}").Rows.Count > 0 Then

View File

@@ -1162,7 +1162,8 @@ Partial Class ProductosyServicios
CveTipoFactor:=DdlTipoFactor.SelectedValue.ToEntero, CveFraccionArancelaria:=DdlFraccionArancelaria.SelectedValue.ToEntero,
CveClasificacionDetalle:=DdlTipoPSDes.SelectedValue.ToEntero, CveTamaño:=DdlTamanio.SelectedValue.ToEntero,
CveModelo:=DdlModelo.SelectedValue.ToEntero(), CveMedida:=DdlMedida.SelectedValue.ToEntero(), CveRinTamaño:=DdlRin.SelectedValue.ToEntero(),
ClaveImpuestoEmpaque:=DdlImpEmpaque.SelectedValue.ToString, ClaveImpuestoUM:=DdlImpUM.SelectedValue.ToString, ClaveCategoriaToxicidad:=DdlCategoriaToxicidad.SelectedValue.ToString) > 0 Then
ClaveImpuestoEmpaque:=DdlImpEmpaque.SelectedValue.ToString, ClaveImpuestoUM:=DdlImpUM.SelectedValue.ToString, ClaveCategoriaToxicidad:=DdlCategoriaToxicidad.SelectedValue.ToString,
ClaveImpuestoTipoProducto:=DdlImpTipoProducto.SelectedValue.ToString) > 0 Then
ViewState("CvePS") = ObjProductosServicios.CvePS
For Each GVR As GridViewRow In GvImpuestosLocales.Rows
If GVR.FCCheckBox("ChkDeduccion").Checked Then
@@ -1206,7 +1207,8 @@ Partial Class ProductosyServicios
CveTipoFactor:=DdlTipoFactor.SelectedValue.ToEntero, CveFraccionArancelaria:=DdlFraccionArancelaria.SelectedValue.ToEntero,
CveUsuarioModifico:=UsuarioActual.CveUsuario, CveClasificacionDetalle:=DdlTipoPSDes.SelectedValue.ToEntero, CveTamaño:=DdlTamanio.SelectedValue.ToEntero,
CveModelo:=DdlModelo.SelectedValue.ToEntero(), CveMedida:=DdlMedida.SelectedValue.ToEntero(), CveRinTamaño:=DdlRin.SelectedValue.ToEntero(),
ClaveImpuestoEmpaque:=DdlImpEmpaque.SelectedValue.ToString, ClaveImpuestoUM:=DdlImpUM.SelectedValue.ToString, ClaveCategoriaToxicidad:=DdlCategoriaToxicidad.SelectedValue.ToString) Then
ClaveImpuestoEmpaque:=DdlImpEmpaque.SelectedValue.ToString, ClaveImpuestoUM:=DdlImpUM.SelectedValue.ToString, ClaveCategoriaToxicidad:=DdlCategoriaToxicidad.SelectedValue.ToString,
ClaveImpuestoTipoProducto:=DdlImpTipoProducto.SelectedValue.ToString) Then
If Not ObjProductosServicios.LimpiaImpuestosLocales(CvePS) Then
TieneError = True

View File

@@ -1142,6 +1142,15 @@ Partial Class Ventas
End Set
End Property
Private Property PermiteCredito As Boolean
Get
Return If(IsNothing(ViewState("PermiteCredito")), False, CBool(ViewState("PermiteCredito")))
End Get
Set(value As Boolean)
ViewState("PermiteCredito") = value
End Set
End Property
#End Region
#Region "Propiedades PuntoVenta"
@@ -1598,6 +1607,14 @@ Partial Class Ventas
End Set
End Property
Private Property CvePrecioLista As Integer
Get
Return ViewState("CvePrecioLista").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("CvePrecioLista") = value
End Set
End Property
#End Region
@@ -1652,6 +1669,7 @@ Partial Class Ventas
ViewState("ClienteDesglosaIEPS") = False
ViewState("ClienteRetIVA") = 0
ViewState("ClienteRetISR") = 0
ViewState("CvePrecioLista") = 0
idCuentaContabilizacion = 1
CveEmpresaCRM = 0
CveAcercamientoCRM = 0
@@ -3848,6 +3866,7 @@ Partial Class Ventas
DdlSubProyectoDatos.Items.Insert(0, New ListItem("Seleccione", "-1"))
End If
DdlSubProyectoDatos.SelectedValueExistInsert(DbRowVenta("CveSubProyecto").ToString, DbRowVenta("SubProyecto").ToString)
CargarAlmacenes()
If DdlSubProyectoCobranza.Items.Count = 0 Then
DdlSubProyectoCobranza.Items.Insert(0, New ListItem("Seleccione", "-1"))
@@ -4444,7 +4463,7 @@ Partial Class Ventas
End Function
Private Sub CargarAlmacenes()
If CveVenta > 0 Then
If CveVenta > 0 And DdlTipoComprobante.SelectedValue <> "Cot" Then
DivAlmacen.Visible = False
Else
Dim DTAlmacen As DataTable
@@ -4605,6 +4624,8 @@ Partial Class Ventas
ViewState("CveCuentaRetISR") = ObjCliente.CveCuentaRetISR
ViewState("CodCliente") = ObjCliente.Codigo
ViewState("CvePrecioLista") = ObjCliente.CvePrecioLista
ViewState("CliNoExt") = ObjCliente.NoExt
ViewState("CliNoInt") = ObjCliente.NoInt
ViewState("CliLocalidad") = If(ObjCliente.Localidad.Trim.Length = 0, ObjCliente.Ciudad.Trim, ObjCliente.Localidad.Trim)
@@ -4860,7 +4881,7 @@ Partial Class Ventas
TrAtencionA.Visible = True
tdVigencia.Visible = DdlTipoComprobante.SelectedValue.Contiene("Cot")
tdFechaVigencia.Visible = DdlTipoComprobante.SelectedValue.Contiene("Cot")
Me.PermiteCredito = ObjCliente.PermiteCredito
LbAgregar.Enabled = True
LnkAgregarPyME.Enabled = True
@@ -5780,7 +5801,7 @@ Partial Class Ventas
End If
If CveVenta > 0 Then
If CveVenta > 0 And DdlTipoComprobante.SelectedValue <> "Cot" Then
If e.Row.DBCampo("CveConcepto").ToEntero = 3 Then CveAlmacenDevolucion = e.Row.DBCampo("CveAlmacen").ToEntero
e.Row.FCCheckBox("cbInv").Visible = False
End If
@@ -13851,10 +13872,10 @@ Partial Class Ventas
PU = 0
Dim PrecioSugerido As Decimal = 0
Dim CvePrecioListaPS = GlobalDTCliente(UsuarioActual.CveEmpresa, -1).FiltroPrimeroValor("CvePrecioLista", $"CveCliente = {CveCliente}").ToEntero
If CvePrecioListaPS > 0 Then
'Dim CvePrecioListaPS = GlobalDTCliente(UsuarioActual.CveEmpresa, -1).FiltroPrimeroValor("CvePrecioLista", $"CveCliente = {CveCliente}").ToEntero
If CvePrecioLista > 0 Then
Dim ObjPS As New ClsProductosServicios
If ObjPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, CvePrecioListaPS, CvePS:=CvePSAdicional) Then
If ObjPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, CvePrecioLista, CvePS:=CvePSAdicional) Then
PrecioSugerido = ObjPS.DtResultados.FiltroPrimeroValor("PrecioLista").ToDecimal
If PrecioSugerido = 0 Then
@@ -14500,7 +14521,7 @@ Partial Class Ventas
GvPS.DataBind()
'RECARGA GV INVENTARIO
If Not CveVenta > 0 Then
If Not CveVenta > 0 Or DdlTipoComprobante.SelectedValue = "Cot" Then
DtInv = TmpDT.Copy.FiltraParametros("CveTipoPS = 2")
CargaGVInv(DtInv)
End If
@@ -14905,7 +14926,7 @@ Partial Class Ventas
Dim AplicaMovimientoDetalleEntrada As Boolean = False
If RemisionesLista.Count > 0 Then
AplicaMovimientoDetalleEntrada = True
MovDetalle = CuadrarFacturaMovimientos(DtMovimientosDetalles.FiltraParametros($"CveMovimiento = {dr("CveMovimiento")} AND TieneSalidaxFactura IS NULL"))
MovDetalle = CuadrarFacturaMovimientos(DtMovimientosDetalles.FiltraParametros($"CveMovimiento = {dr("CveMovimiento")} AND (TieneSalidaxFactura IS NULL OR SaldoAlmacen > 0)"))
Else
MovDetalle = DtMovimientosDetalles.FiltraParametros($"CveMovimiento = {dr("CveMovimiento")}")
End If
@@ -16534,6 +16555,11 @@ Partial Class Ventas
Private Function ValidaPagosContado() As Boolean
Dim Retorno = False
If (UsuarioActual.CveEmpresa = 140) AndAlso (Not PermiteCredito) AndAlso (DtPagos Is Nothing OrElse DtPagos.Rows.Count = 0) Then
Alert("Es necesario especificar un pago.", TipoMensaje.MsgAdvertencia)
Retorno = True
End If
If DtPagos.SUM("Importe").ToString.ToDecimal > TxtTotal.Text.ToDecimal Then
Alert("El importe de los pagos no puede exceder el importe de la factura. Por favor verifique.", TipoMensaje.MsgAdvertencia)
Retorno = True