This commit is contained in:
2025-01-20 09:19:06 -07:00
15 changed files with 2759 additions and 1958 deletions

View File

@@ -3574,21 +3574,6 @@ Namespace Modelos
End If
Next
If ObjConta.ValidacionesPrePoliza(ObjFactura.CvePrePoliza, UsuarioActual, Opcion:=5) Then
If ObjConta.ValorPolizaDescuadre > 0 Then
ErrorPrepoliza = True
GuardaLogAD($"Ventas/Ventas-ProcesoPrePolizas | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{ObjFactura.CvePrePoliza}", "LogPrePolizas")
'SIRVE PARA VER LA PREPOLIZA QUE SE VALIDA
'If ObjConta.GetPrePolizasDetalle(ObjFactura.CvePrePoliza) Then
' Dim DtTest = ObjConta.DtResultados
'End If
End If
importeMovimiento = 0
importeMX = 0
End If
If ErrorPrepoliza Then
Exit For
End If
@@ -3651,15 +3636,12 @@ Namespace Modelos
End If
End If
If ObjConta.ValidacionesPrePoliza(ObjFactura.CvePrePoliza, UsuarioActual, Opcion:=5) Then
If ObjConta.ValorPolizaDescuadre > 0 Then
ErrorPrepoliza = True
GuardaLogAD($"Ventas/Ventas-ProcesoPrePolizas | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{ObjFactura.CvePrePoliza}", "LogPrePolizas")
End If
End If
End If
End If
importeMovimiento = 0
importeMX = 0
End If
End If

View File

@@ -352,7 +352,7 @@ Public Class Timbrado
Dim UsuarioServicio As String = If(CvePACCancelacion = 2, Empresa.RFC, "rene.molina@adsistemas.mx")
Dim ClaveServicio As String = If(CvePACCancelacion = 2, Empresa.RFC.ToLower, "rene2018")
Dim Clave As String = Empresa.ContraseñaKey
Dim UrlServicio As String = "https://servicios.gofac.com.mx/cancelacion.asmx" ' Produccion
Dim UrlServicio As String = "https://cfdi.gofac.com.mx/timbrado.asmx" ' Produccion
If Not Empresa.FacturaProduccion Then
ArchivoLLave = $"{Empresa.Ruta}Certificados\CSD01_ZUÑ920208KL4.key"
@@ -360,6 +360,7 @@ Public Class Timbrado
UsuarioServicio = "UserTest"
ClaveServicio = "1234567890"
UrlServicio = "https://servicios.gofac.com.mx/cancelacion.asmx" ' Produccion
End If
#Region "Valida"
If Not File.Exists(ArchivoCertificado) Then
@@ -2877,7 +2878,7 @@ concep.DescripcionesEspecificas.NumeroSerie)
Dim TimbraProduccion As Boolean = True
If Not Directory.Exists(RutaArchivo) Then Directory.CreateDirectory(RutaArchivo)
UrlServicio = "https://pruebas.gofac.com.mx/timbrado.asmx?WSDL"
UrlServicio = "https://cfdi.gofac.com.mx/timbrado.asmx?WSDL"
If Not ClsPaginas.EsProduccion AndAlso (Not UsuarioActual.Empresa.FacturaProduccion OrElse UsuarioActual.CveEmpresa = 1) Then
EmisorRFC = "EKU9003173C9"
@@ -2897,6 +2898,8 @@ concep.DescripcionesEspecificas.NumeroSerie)
UsuarioServicio = "UserTest"
ClaveServicio = "1234567890"
UsuarioActual.Empresa.CodigoRegimenFiscal = "601"
UrlServicio = "https://pruebas.gofac.com.mx/timbrado.asmx?WSDL"
End If
#Region "Valida"

View File

@@ -128,6 +128,20 @@
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpAccionesProrrateoGasolina" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<li style="text-align: left!important" >
<asp:LinkButton runat="server" ID="LnkProrrateoGasolina" CssClass="" data-toggle="tooltip" data-placement="left" title="Prorrateo" OnClick="LnkProrrateoGasolina_Click" Visible="false" >
<i class="fa fa-list" aria-hidden="true"></i> Prorrateo
</asp:LinkButton>
</li>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
@@ -4576,7 +4590,6 @@
<label runat="server" id="LblSubProyectoEx" for="<%= DdlSubProyecto.ClientID.ToString()%>">
<asp:Label runat="server" id="LblSubProyecto"></asp:Label>:
</label>
</div>
</div>
<div class="col-md-4">
@@ -5703,6 +5716,130 @@
</div>
<div id="DVModalProrrateoGasolina" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">
<asp:UpdatePanel runat="server" ID="UpProrratearTitulo" UpdateMode="Conditional">
<ContentTemplate>
<asp:Label runat="server" id="LblRiruloProrrareo">Prorratear</asp:Label>
</ContentTemplate>
</asp:UpdatePanel>
</h4>
</div>
<div class="modal-body">
<asp:UpdatePanel runat="server" ID="UpModalProrrateoGasolina" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<ADS:Dropdownlost runat="server" ID="DdlPSProrrateoGasolina" CssStyle="width:100%" CssClass="form-control input-sm DdlPS" CssClassDdl="select2me" DataTextField="PSCodigo" DataValueField="CvePS" />
<label for="<%= DdlPSProrrateoGasolina.ClientID.ToString()%>">
Productos / Servicio:
<label>
</div>
</div>
</div>
<div class="row" style="margin-top:10px">
<div class="col-md-4">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlSubProyectoProrrateoGasolina" CssClass=" form-control input-sm select2me" runat="server" Width="100%" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto">
<asp:ListItem Selected="true" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
<%--<asp:RequiredFieldValidator ID="RfvDdlSubProyectoProrrateoGasolina" runat="server" ControlToValidate="DdlSubProyectoProrrateoGasolina" CssClass="help-block errorimput" InitialValue="-1"
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo es necesario, por favor ingréselo." ValidationGroup="GprAgregaPSProrateo">
</asp:RequiredFieldValidator>--%>
<label runat="server" id="Label10" for="<%= DdlSubProyectoProrrateoGasolina.ClientID.ToString()%>">
<asp:Label runat="server" id="LblSubProyectoProrrateoGasolina"></asp:Label>:
</label>
</div>
</div>
<div class="col-md-4">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtPrecioProrrateoGasolina" ClientIDMode="Static" runat="server" CssClass=" form-control " CausesValidation="true" MaxLength="12" ValidationGroup="GprAgregaPS"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="FilTxtPrecioProrrateoGasolina" runat="server" TargetControlID="TxtPrecioProrrateoGasolina" FilterType="Custom, Numbers" ValidChars="." />
<asp:RequiredFieldValidator ID="RfvTxtPrecioProrrateoGasolina" runat="server" ControlToValidate="TxtPrecioProrrateoGasolina" CssClass="help-block errorimput"
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Precio''</b> es necesario, por favor ingréselo." ValidationGroup="GprAgregaPSProrateo">
</asp:RequiredFieldValidator>
<label for="<%= TxtPrecioProrrateoGasolina.ClientID.ToString()%>">Importe:</label>
</div>
</div>
<div class="col-md-4" style="margin-top:10px;text-align:right">
<asp:LinkButton ID="LnkAgregarProrrateoGasolina" OnClick="LnkAgregarProrrateoGasolina_Click" runat="server" Text="Agregar" CssClass="btn btn-primary" ValidationGroup="GprAgregaPSProrateo" > </asp:LinkButton>
</div>
</div>
<div class="row" style="margin-top:10px">
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:Label runat="server" ID="LblTotalProrrateoGasolina" CssClass="form-control" ></asp:Label>
<label for="<%= LblTotalProrrateoGasolina.ClientID.ToString()%>">Total:</label>
</div>
</div>
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:Label runat="server" ID="LblRestoProrrateoGasolina" CssClass="form-control"></asp:Label>
<label for="<%= LblRestoProrrateoGasolina.ClientID.ToString()%>">Restante:</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<asp:GridView ID="GvProrrateoGasolina" runat="server" AutoGenerateColumns="false" GridLines="none" BorderWidth="0" Width="100%"
DataKeyNames=""
CssClass="table table-striped table-hover table-advance ScrollAD mysmallbtn">
<Columns>
<asp:BoundField DataField="SubProyecto" HeaderText="SubProyecto" />
<asp:BoundField DataField="Subtotal" HeaderText="Subtotal" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:#,##0.####}" Visible="false" />
<asp:BoundField DataField="IVA" HeaderText="IVA" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:#,##0.######}" Visible="false" />
<asp:BoundField DataField="RetIVA" HeaderText="Ret. IVA" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:#,##0.####}" Visible="false" />
<asp:BoundField DataField="RetISR" HeaderText="RetISR" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:#,##0.####}" Visible="false" />
<asp:BoundField DataField="Total" DataFormatString="{0:#,##0.00##}" HeaderText="Total" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="Porcentaje" DataFormatString="{0:#,##0.00##}" HeaderText="%" ItemStyle-HorizontalAlign="Right" />
<asp:TemplateField ItemStyle-Width="50px" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:LinkButton ID="LnkEliminarProrrateoGasolina" runat="server" Width="22px"
CssClass="btn btn-circle btn-xs red" OnClick="LnkEliminarProrrateoGasolina_Click"
data-toggle="confirmation"
data-popout="true" data-original-title="¿Seguro que desea eliminar el prorrateo?" data-btn-ok-label="si">
<i style="margin-left:-2px!important" class='icon-trash'></i>
</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="modal-footer">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<asp:Button ID="BtnGuardarProrrateoGasolina" OnClick="BtnGuardarProrrateoGasolina_Click" runat="server" Text="Guardar" CssClass="btn btn-primary" />
<button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
</div>
<div style="display:none">
<asp:UpdatePanel runat="server">

View File

@@ -1662,9 +1662,12 @@ Partial Class Compras_Compras
End If
If UsuarioActual.Empresa.Funcionalidad(574).ToEntero = 1 AndAlso DdlTipoComprobante.SelectedValue = "NC" Then
ConfiguraseleccionRemisionNotaCredito()
End If
If Not CveCompra > 0 Then
LnkProrrateoGasolina.Visible = True
InicializaDTProrrateoGasolina()
End If
End If
@@ -22326,6 +22329,278 @@ Partial Class Compras_Compras
End Sub
#Region "PRORRATEO GASOLINA"
Property DTProrrateoGasolina As DataTable
Get
If ViewState("DTProrrateoGasolina") Is Nothing Then
ViewState("DTProrrateoGasolina") = New DataTable
End If
Return DirectCast(ViewState("DTProrrateoGasolina"), DataTable)
End Get
Set(value As DataTable)
ViewState("DTProrrateoGasolina") = value
End Set
End Property
Private Sub InicializaDTProrrateoGasolina()
Dim TmpDTProrrateoGasolina As New DataTable
TmpDTProrrateoGasolina.Columns.Add("CvePS", GetType(Integer))
TmpDTProrrateoGasolina.Columns.Add("CveSubProyecto", GetType(Integer))
TmpDTProrrateoGasolina.Columns.Add("SubProyecto", GetType(String))
TmpDTProrrateoGasolina.Columns.Add("SubTotal", GetType(Decimal))
TmpDTProrrateoGasolina.Columns.Add("IVA", GetType(Decimal))
TmpDTProrrateoGasolina.Columns.Add("RetIVA", GetType(Decimal))
TmpDTProrrateoGasolina.Columns.Add("RetISR", GetType(Decimal))
TmpDTProrrateoGasolina.Columns.Add("Total", GetType(Decimal))
TmpDTProrrateoGasolina.Columns.Add("PorcentajeIVA", GetType(Decimal))
TmpDTProrrateoGasolina.Columns.Add("CveUM", GetType(Integer))
TmpDTProrrateoGasolina.Columns.Add("CveClasificacion", GetType(Integer))
TmpDTProrrateoGasolina.Columns.Add("UM", GetType(String))
TmpDTProrrateoGasolina.Columns.Add("Clasificacion", GetType(String))
TmpDTProrrateoGasolina.Columns.Add("PS", GetType(String))
TmpDTProrrateoGasolina.Columns.Add("Porcentaje", GetType(Decimal))
DTProrrateoGasolina = TmpDTProrrateoGasolina
End Sub
Protected Sub LnkProrrateoGasolina_Click(sender As Object, e As EventArgs)
InicializaDTProrrateoGasolina()
CargarCentrosDeCosto(Nothing, Nothing, Nothing, LblSubProyectoProrrateoGasolina,)
GvProrrateoGasolina.Columns(0).HeaderText = LblSubProyectoProrrateoGasolina.Text
LblRiruloProrrareo.Text = $"Prorratear por { LblSubProyectoProrrateoGasolina.Text}"
DdlSubProyectoProrrateoGasolina.Items.Clear()
DdlSubProyectoProrrateoGasolina.DataSource = If(Not UsuarioActual.TienePermisoProceso(110), GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1), GlobalDTSubProyectos(UsuarioActual.CveEmpresa, CveProyecto:=-1))
DdlSubProyectoProrrateoGasolina.DataBind()
DdlSubProyectoProrrateoGasolina.Items.Insert(0, New ListItem("Todos", "-1"))
LblTotalProrrateoGasolina.Text = TxtTotal.Text
CargaProrratePS(-1)
RegistraScript("$('#DVModalProrrateoGasolina').modal();")
UpModalProrrateoGasolina.Update()
UpProrratearTitulo.Update()
End Sub
Private Sub CargaProrratePS(CveClasificacion As Integer)
DdlPSProrrateoGasolina.setEsWebService(UsuarioActual.Empresa.Funcionalidad(105) = "1")
If UsuarioActual.Empresa.Funcionalidad(105) = "1" Then
DdlPSProrrateoGasolina.ddlWS.Attributes.Add("data-cveclasificacion", DdlClasificacion.SelectedValue)
DdlPSProrrateoGasolina.SelectedText = ""
DdlPSProrrateoGasolina.SelectedValue = "-1"
Else
DdlPSProrrateoGasolina.ddl.Items.Clear()
'DdlPS.ddl.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacion)
If UsuarioActual.TienePermisoProceso(300) Or UsuarioActual.TienePermisoProceso(301) Then
Dim DTTemp As New DataTable
DTTemp.Columns.Add("CvePS", GetType(Integer))
DTTemp.Columns.Add("PSCodigo", GetType(String))
DTTemp.Columns.Add("CveClasificacion", GetType(Integer))
For Each dRow As DataRow In GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).Rows
For Each drowCla As DataRow In DTClasificacionesComprobaciones.Rows
If drowCla("CveClasificacion").ToString.ToEntero = dRow("CveClasificacion").ToString.ToEntero Then
Dim InRow As DataRow = DTTemp.NewRow
InRow("CvePS") = dRow("CvePS").ToString.ToEntero
InRow("PSCodigo") = dRow("PSCodigo").ToString
InRow("CveClasificacion") = dRow("CveClasificacion").ToString.ToEntero
DTTemp.Rows.Add(InRow)
End If
Next
Next
DdlPSProrrateoGasolina.DataSource = If(CveClasificacion > 0, DTTemp.FiltraParametros($"CveClasificacion = {CveClasificacion}"), DTTemp)
Else
DdlPSProrrateoGasolina.DataSource = If(CveClasificacion > 0, GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltraParametros($"CveClasificacion = {CveClasificacion}"), GlobalDTPSSimplificado(UsuarioActual.CveEmpresa))
End If
DdlPSProrrateoGasolina.ddl.DataBind()
DdlPSProrrateoGasolina.ddl.Items.Insert(0, New ListItem("Seleccione el Producto", "-1"))
End If
End Sub
Private Sub GvProrrateoGasolinaBind()
GvProrrateoGasolina.DataSource = DTProrrateoGasolina
GvProrrateoGasolina.DataBind()
UpModalProrrateoGasolina.Update()
End Sub
Protected Sub LnkEliminarProrrateoGasolina_Click(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
DTProrrateoGasolina.Rows.RemoveAt(GvRow.RowIndex)
DTProrrateoGasolina.AcceptChanges()
ProrateoCalculaRestante()
GvProrrateoGasolinaBind()
End Sub
Protected Sub LnkAgregarProrrateoGasolina_Click(sender As Object, e As EventArgs)
Dim CvePs As Integer = DdlPSProrrateoGasolina.SelectedValue.ToEntero
If Not CvePs > 0 Then
Alert("Debe seleccionar un producto", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim PsRow As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePs).FiltroPrimero("")
If PsRow Is Nothing Then
Alert("No se encontro el producto", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim CveUM As Integer = PsRow("CveUM").ToString.ToEntero
Dim UM As String = GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa).FiltroPrimeroValor("UnidadMedida", $" CveUnidadMedida = {CveUM} ")
Dim CveClasificacion As Integer = PsRow("CveClasificacion").ToString.ToEntero
Dim Clasificacion As String = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Clasificacion", $" CveClasificacion = {CveClasificacion} ")
If DdlSubProyectoProrrateoGasolina.SelectedValue.ToEntero > 0 Then
AgregarProrrateoGasolina(DdlSubProyectoProrrateoGasolina.SelectedValue.ToEntero, DdlSubProyectoProrrateoGasolina.SelectedItem.Text, CvePs, CveUM, UM, CveClasificacion, Clasificacion)
Else
DTProrrateoGasolina.Rows.Clear()
For Each item As ListItem In DdlSubProyectoProrrateoGasolina.Items
If item.Value.ToEntero > 0 Then
AgregarProrrateoGasolina(item.Value.ToEntero, item.Text, CvePs, CveUM, UM, CveClasificacion, Clasificacion)
End If
Next
End If
TxtPrecioProrrateoGasolina.Text = ""
DdlSubProyectoProrrateoGasolina.SelectedValueExist(-1)
UpModalProrrateoGasolina.Update()
End Sub
Private Sub AgregarProrrateoGasolina(CveSubProyecto As Integer, SubProyecto As String, CvePS As Integer, CveUM As Integer, UM As String, CveClasificacion As Integer, Clasificacion As String)
Dim SubTotalOriginal As Decimal = TxtSubTotal.Text.ToDecimal
Dim IVAOriginal As Decimal = TxtIVA.Text.ToDecimal
Dim RetISROriginal As Decimal = TxtRetISR.Text.ToDecimal
Dim RetIVAOriginal As Decimal = TxtRetIVA.Text.ToDecimal
Dim TotalOriginal As Decimal = TxtTotal.Text.ToDecimal
Dim totalParcialDeseado As Decimal = TxtPrecioProrrateoGasolina.Text.ToDecimal
Dim PorcentajeCalculado As Decimal = totalParcialDeseado / TotalOriginal
Dim subtotalParcial As Decimal = SubTotalOriginal * PorcentajeCalculado
Dim ivaParcial As Decimal = IVAOriginal * PorcentajeCalculado
Dim retIsrParcial As Decimal = RetISROriginal * PorcentajeCalculado
Dim retIvaParcial As Decimal = RetIVAOriginal * PorcentajeCalculado
Dim nRow As DataRow = DTProrrateoGasolina.NewRow
nRow("CvePS") = DdlPSProrrateoGasolina.SelectedValue.ToEntero
nRow("CveSubProyecto") = CveSubProyecto
nRow("SubProyecto") = SubProyecto
If CveFactura > 0 Then
nRow("IVA") = ivaParcial.RoundSQL(4)
nRow("RetIVA") = retIvaParcial.RoundSQL(4)
nRow("RetISR") = retIsrParcial.RoundSQL(4)
Else
nRow("IVA") = (ivaParcial / subtotalParcial).RoundSQL(4)
nRow("RetIVA") = (retIvaParcial / subtotalParcial).RoundSQL(4)
nRow("RetISR") = (retIsrParcial / subtotalParcial).RoundSQL(4)
End If
nRow("SubTotal") = subtotalParcial.RoundSQL(4)
nRow("Total") = totalParcialDeseado.RoundSQL(4)
nRow("PorcentajeIVA") = (ivaParcial / subtotalParcial).RoundSQL(4)
nRow("Porcentaje") = ((totalParcialDeseado.RoundSQL(4) * 100) / TotalOriginal).RoundSQL(2)
nRow("CveUM") = CveUM
nRow("UM") = UM
nRow("CveClasificacion") = CveClasificacion
nRow("Clasificacion") = Clasificacion
nRow("PS") = DdlPSProrrateoGasolina.txtText.Value
DTProrrateoGasolina.Rows.Add(nRow)
ProrateoCalculaRestante()
GvProrrateoGasolinaBind()
End Sub
Function ProrateoCalculaRestante(Optional MostrarMensaje As Boolean = False) As Boolean
Dim Acumulado As Decimal = DTProrrateoGasolina.SUM("Total").RoundSQL(2)
Dim Total As Decimal = TxtTotal.Text.ToDecimal.RoundSQL(2)
Dim Respuesta As Boolean = False
LblRestoProrrateoGasolina.Text = (Total - Acumulado).ToString("###,###,###.00")
If Acumulado = Total Then
Respuesta = True
Else
Respuesta = False
If MostrarMensaje Then
If Acumulado <> Total Then
Alert($"El importe prorrateado es diferente del total, Diferencia: {(Acumulado - Total).Abs()}, Total:{Total.ToString("###,###,###.00")}, Prorrateado:{Acumulado.ToString("###,###,###.00")}", TipoMensaje.MsgAdvertencia)
End If
End If
End If
Return Respuesta
End Function
Protected Sub BtnGuardarProrrateoGasolina_Click(sender As Object, e As EventArgs)
If Not ProrateoCalculaRestante(True) Then
Exit Sub
End If
If DTProrrateoGasolina.Rows.Count > 0 Then
TmpDT.Rows.Clear()
For Each dRow As DataRow In DTProrrateoGasolina.Rows
AddPS(1, dRow("CveUM").ToString.ToEntero, dRow("UM").ToString, dRow("CveClasificacion").ToString.ToEntero, dRow("Clasificacion").ToString, dRow("CvePS").ToString.ToEntero, dRow("PS").ToString, 1, dRow("CveSubProyecto").ToString, dRow("SubProyecto").ToString, "",
"-1", "", dRow("SubTotal").ToString.ToDecimal, dRow("Total").ToString.ToDecimal, dRow("PorcentajeIVA").ToString.ToDecimal, dRow("RetIVA").ToString.ToDecimal, dRow("RetISR").ToString.ToDecimal, 0, 0, 0, PorcentajeIVA:=dRow("PorcentajeIVA").ToString.ToDecimal)
Next
AddPS2()
RegistraScript("$('#DVModalProrrateoGasolina').modal('hide');")
End If
End Sub
#End Region
End Class

View File

@@ -1425,9 +1425,14 @@ Partial Class PopUpVerFactura
'Imprime Movimiento de IE
If UrlParametros("OP").ToString = "ImprimeMov" Then
Dim ImportePagoTotal As Decimal = If(UrlParametros("IMPORTEPAGOTOTAL") IsNot Nothing AndAlso UrlParametros("IMPORTEPAGOTOTAL").ToString.ToDecimal > 0, UrlParametros("IMPORTEPAGOTOTAL").ToString.ToDecimal, -1)
Dim SaldoTotal As Decimal = If(UrlParametros("SALDO") IsNot Nothing AndAlso UrlParametros("SALDO").ToString.ToDecimal > 0, UrlParametros("SALDO").ToString.ToDecimal, -1)
If UrlParametros("CVEIE") IsNot Nothing AndAlso UrlParametros("CVEIE").ToString.ToEntero > 0 Then
ImprimeMov(UrlParametros("CVEIE").ToString.ToEntero)
ImprimeMov(UrlParametros("CVEIE").ToString.ToEntero, ImportePagoTotal, SaldoTotal)
End If
End If
'IMPRIME DEPOSITOS CAJA
@@ -5885,7 +5890,7 @@ Partial Class PopUpVerFactura
End Sub
Private Sub ImprimeMov(CveIE As Integer)
Private Sub ImprimeMov(CveIE As Integer, Optional ImportePagoTotal As Decimal = 0, Optional SaldoTotal As Decimal = 0)
Dim ObjIE As New ClsBancos()
Dim DtGvRH As New DataTable
Dim DtComprobacion As New DataTable
@@ -5969,6 +5974,16 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("importe", ParamComprobacion.Rows(0)("Importe").ToString))
params.Add(New ReportParameter("TotAbono", DtComprobacion.SUM("Abonado").ToString))
If UsuarioActual.CveEmpresa = 140 Then
Dim Aplicado As Decimal = 0
Dim ImporteDoc As Decimal = ParamComprobacion.Rows(0)("Importe").ToString.ToDecimal
Dim LeyendaSaldo As String = $"Folio #{ParamComprobacion.Rows(0)("Folio").ToString} con importe de ${ImporteDoc.ToString("###,###,###.00")} y saldo antes de la comprobación de ${SaldoTotal.ToString("###,###,###.00")}, Comprobaciones a la fecha {ParamComprobacion.Rows(0)("FechaDocumento").ToString().ToDate().ToString("dd/MM/yyyy")} ${ImportePagoTotal.ToString("###,###,###.00")} saldo después de la comprobación ${(SaldoTotal - ImportePagoTotal).ToString("###,###,###.00")} ."
params.Add(New ReportParameter("LeyendaSaldo", LeyendaSaldo))
End If
params.Add(New ReportParameter("LogoPath", RutaImagenLogo))
ImprimirPDF("Empresas/Grales/Formatos/RepRembolsosComprobaciones.rdlc", DtComprobacion, params, String.Format("IE{0}", CveIE), Formato:="PDF")

View File

@@ -387,6 +387,8 @@ Partial Class Compras_ReembolsosComprobaciones
Dim FoliosFechasValFechaDocumentoPagoMesSuperior As New StringBuilder
Dim FoliosFechasValFechaDocumentoMesInferior As New StringBuilder
Dim SaldoAntesPago As Decimal = TxtChequeSaldo.Text.ToDecimal
For Each gvRowVal As GridViewRow In GvCxP.Rows
If gvRowVal.FCCheckBox("Chk").Checked Then
@@ -602,6 +604,7 @@ Partial Class Compras_ReembolsosComprobaciones
End If
End If
Dim ImportePagoTotal As Decimal = 0
If CveIERegistrado > 0 Or CveIEExcedente > 0 Or ChkReembolsarSinBancos.Checked Then
'inserto los movimientos de la conta para abonar al saldo
If ((TxtImporte.Text.ToDecimal > 0 Or ChkReembolsarSinBancos.Checked) And CvePrePolizaIERegistrado > 0) Or ((TxtImporteVinculado.Text.ToDecimal > 0 And HdnCheque.Value.ToEntero > 0) Or ChkReembolsarSinBancos.Checked) Then
@@ -676,7 +679,7 @@ Partial Class Compras_ReembolsosComprobaciones
Pago.CveMonedaPago = CveMonedaPago
Pago.TCPago = TipoCambioPago
Pago.CvePersonal =CvePersonal
ImportePagoTotal = ImportePagoTotal + ImporteMovto
'Otros Ingresos
If MsgError = "" AndAlso (ChkAjusteOI.Checked Or ChkOtrosIngresosCheque.Checked) AndAlso gvr.FCTextBox("TxtComision").Text.ToDecimal <> 0 Then
Pago.OtroGastoIngreso = gvr.FCTextBox("TxtComision").Text.ToDecimal
@@ -819,7 +822,7 @@ Partial Class Compras_ReembolsosComprobaciones
Dim Mensaje As New StringBuilder
If CvePrePolizaExcedente > 0 Then
Mensaje.AppendFormat("Abono Registrado Correctamente. <br/><br/> Cheque: <a target='_blank' href=/Bancos/IE.aspx?CveIE={0}>{1}</a> <br/><br/> <a target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={2}"">Imprimir</a>", CveIEExcedente, TxtFolio.Text, Encripta(String.Format("OP=ImprimeMov&CveIE={0}", CveIEExcedente)))
Mensaje.AppendFormat("Abono Registrado Correctamente. <br/><br/> Cheque: <a target='_blank' href=/Bancos/IE.aspx?CveIE={0}>{1}</a> <br/><br/> <a target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={2}"">Imprimir</a>", CveIEExcedente, TxtFolio.Text, Encripta(String.Format("OP=ImprimeMov&CveIE={0}&CvePrePoliza={1}", CveIEExcedente, CvePrePolizaIERegistrado)))
If UsuarioActual.Empresa.TipoContabilidad = 2 Then
Mensaje.AppendFormat("</br> <br/>Póliza: <b> <a href='/Contabilidad/RegPoliza.aspx?IdPoliza={0}' class='Texto' target='_blank'>{1}</a><br/>", ObjMov.ContaIdPoliza, ObjMov.ContaFolio)
Else
@@ -827,7 +830,7 @@ Partial Class Compras_ReembolsosComprobaciones
End If
Alert(Mensaje.ToString, TipoMensaje.MsgInformacion)
Else
Mensaje.AppendFormat("Abono Registrado Correctamente. <br/><br/> <a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir</a>", Encripta(String.Format("OP=ImprimeMov&CveIE={0}", CveIERegistrado)))
Mensaje.AppendFormat("Abono Registrado Correctamente. <br/><br/> <a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir</a>", Encripta(String.Format("OP=ImprimeMov&CveIE={0}&ImportePagoTotal={1}&Saldo={2}", CveIERegistrado, ImportePagoTotal, SaldoAntesPago)))
If CvePrePolizaIERegistrado > 0 Then
If UsuarioActual.Empresa.TipoContabilidad = 2 Then
Mensaje.AppendFormat("</br> <br/>Póliza: <b> <a href='/Contabilidad/RegPoliza.aspx?IdPoliza={0}' class='Texto' target='_blank'>{1}</a><br/>", ObjMov.ContaIdPoliza, ObjMov.ContaFolio)

View File

@@ -188,10 +188,10 @@
<Width>1.40148cm</Width>
</TablixColumn>
<TablixColumn>
<Width>10.82525cm</Width>
<Width>2.95567cm</Width>
</TablixColumn>
<TablixColumn>
<Width>3.03882cm</Width>
<Width>10.82525cm</Width>
</TablixColumn>
<TablixColumn>
<Width>1.63389cm</Width>
@@ -365,14 +365,14 @@
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Textbox11">
<Textbox Name="Textbox1">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Descripción</Value>
<Value># Parte</Value>
<Style>
<FontFamily>MYRIAd Pro</FontFamily>
<FontSize>7.5pt</FontSize>
@@ -385,7 +385,7 @@
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox11</rd:DefaultName>
<rd:DefaultName>Textbox1</rd:DefaultName>
<Style>
<Border>
<Color>LightGrey</Color>
@@ -418,14 +418,14 @@
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Textbox1">
<Textbox Name="Textbox11">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value># Parte</Value>
<Value>Descripción</Value>
<Style>
<FontFamily>MYRIAd Pro</FontFamily>
<FontSize>7.5pt</FontSize>
@@ -438,7 +438,7 @@
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox1</rd:DefaultName>
<rd:DefaultName>Textbox11</rd:DefaultName>
<Style>
<Border>
<Color>LightGrey</Color>
@@ -683,6 +683,40 @@
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="NumeroParte">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Fields!NumeroParte.Value</Value>
<Style>
<FontFamily>MYRIAd Pro</FontFamily>
<FontSize>6.5pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Left</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>NumeroParte</rd:DefaultName>
<Style>
<Border>
<Color>#0e2455</Color>
<Style>None</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>=IIf(RowNumber(Nothing)=1,"1pt","0pt")</PaddingTop>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="PS">
@@ -715,38 +749,6 @@
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="NumeroParte">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Fields!NumeroParte.Value</Value>
<Style>
<FontFamily>MYRIAd Pro</FontFamily>
<FontSize>6.5pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>NumeroParte</rd:DefaultName>
<Style>
<Border>
<Color>#0e2455</Color>
<Style>None</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>=IIf(RowNumber(Nothing)=1,"1pt","0pt")</PaddingTop>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="PU">
@@ -848,7 +850,7 @@
<Top>0.17639cm</Top>
<Left>0.09756cm</Left>
<Height>0.74125cm</Height>
<Width>21.24632cm</Width>
<Width>21.16317cm</Width>
<Style>
<Border>
<Style>None</Style>

View File

@@ -593,7 +593,7 @@ iigAooooAKKKKAP/2Q==</ImageBytes>
<AllowHtmlTags>True</AllowHtmlTags>
<Brush>Transparent</Brush>
<CanGrow>True</CanGrow>
<ClientRectangle>0.12,2.4,9.62,2.28</ClientRectangle>
<ClientRectangle>0.12,2.4,9.62,2.48</ClientRectangle>
<Conditions isList="true" count="0" />
<Expressions isList="true" count="0" />
<Font>Myriad Pro,9,Regular,Point,False,0</Font>
@@ -601,8 +601,8 @@ iigAooooAKKKKAP/2Q==</ImageBytes>
<Name>Textbox20</Name>
<Page isRef="7" />
<Parent isRef="8" />
<Text>&lt;div&gt;&lt;b&gt;Facturado a:&amp;nbsp;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Cliente: &lt;/b&gt;{ClienteCodigo} - {ClienteNombre}&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;b&gt;RFC:&lt;/b&gt; {ClienteRFC}
&lt;b&gt;Colonia: &lt;/b&gt; {ClienteColonia}&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Ciudad: &lt;/b&gt;{ClienteCiudad} &lt;b&gt;Estado: &lt;/b&gt; {ClienteEstado}&lt;/div&gt;&lt;div&gt;&lt;b&gt;Municipio y/o Delegación: &lt;/b&gt;{ClienteMunicipio}&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Pais:&lt;/b&gt; {ClientePais} &lt;b&gt; CP: &lt;/b&gt;{ClienteCP}&lt;/div&gt;</Text>
<Text>&lt;div&gt;&lt;font size="8"&gt;&lt;b&gt;Facturado a:&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font size="8"&gt;&lt;b&gt;Cliente: &lt;/b&gt;{ClienteCodigo} - {ClienteNombre}&amp;nbsp;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font size="8"&gt;&lt;b&gt;RFC:&lt;/b&gt; {ClienteRFC}
&lt;b&gt;Colonia: &lt;/b&gt; {ClienteColonia}&amp;nbsp;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font size="8"&gt;&lt;b&gt;Ciudad: &lt;/b&gt;{ClienteCiudad} &lt;b&gt;Estado: &lt;/b&gt; {ClienteEstado}&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font size="8"&gt;&lt;b&gt;Municipio y/o Delegación: &lt;/b&gt;{ClienteMunicipio}&amp;nbsp;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font size="8"&gt;&lt;b&gt;Pais:&lt;/b&gt; {ClientePais} &lt;b&gt; CP: &lt;/b&gt;{ClienteCP}&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font face="Myriad Pro" style="" size="8"&gt;&lt;b&gt;Régimen Fiscal:&lt;/b&gt; {ClienteRegimenFiscal}&lt;/font&gt;&lt;/div&gt;</Text>
<TextBrush>Black</TextBrush>
<TextQuality>Wysiwyg</TextQuality>
<Type>Expression</Type>
@@ -6326,8 +6326,8 @@ FUERO DE MI DOMICILIO. LA CANTIDAD DE $ {Total} SON: {(ImporteLetra)}.</Text>
<ReportAlias>Factura</ReportAlias>
<ReportChanged>12/30/2024 5:44:19 PM</ReportChanged>
<ReportCreated>7/11/2022 2:49:19 PM</ReportCreated>
<ReportFile>C:\inetpub\WWWSigGit\Empresas\189\Formatos\Factura.mrt</ReportFile>
<ReportGuid>e8b162183e2340d1bbaad55d91fb8962</ReportGuid>
<ReportFile>Factura.mrt</ReportFile>
<ReportGuid>e849bb4463e44732ae40e92228d31a35</ReportGuid>
<ReportName>Factura</ReportName>
<ReportUnit>Centimeters</ReportUnit>
<ReportVersion>2022.4.5.0</ReportVersion>

View File

@@ -53,6 +53,10 @@
<DataField>Almacen</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="NumeroParte">
<DataField>NumeroParte</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
</Fields>
<rd:DataSetInfo>
<rd:DataSetName>DsInventarios</rd:DataSetName>
@@ -81,7 +85,10 @@
<Width>2.35965cm</Width>
</TablixColumn>
<TablixColumn>
<Width>13.49625cm</Width>
<Width>3.67771cm</Width>
</TablixColumn>
<TablixColumn>
<Width>9.81854cm</Width>
</TablixColumn>
</TablixColumns>
<TablixRows>
@@ -220,6 +227,50 @@
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Textbox12">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value># Parte</Value>
<Style>
<FontFamily>Myriad Pro</FontFamily>
<FontSize>8pt</FontSize>
<FontWeight>Bold</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox12</rd:DefaultName>
<Style>
<Border>
<Style>None</Style>
</Border>
<TopBorder>
<Color>Black</Color>
<Style>None</Style>
<Width>1pt</Width>
</TopBorder>
<BottomBorder>
<Color>Black</Color>
<Style>None</Style>
<Width>1pt</Width>
</BottomBorder>
<BackgroundColor>#e36c09</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Textbox5">
@@ -380,6 +431,40 @@
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="NumeroParte">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Fields!NumeroParte.Value</Value>
<Style>
<FontFamily>Myriad Pro</FontFamily>
<FontSize>7pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Left</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>NumeroParte</rd:DefaultName>
<Style>
<Border>
<Style>None</Style>
</Border>
<VerticalAlign>Bottom</VerticalAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>=IIf(rownumber(nothing) = 1, "2pt", "0pt")</PaddingTop>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="PS">
@@ -525,6 +610,39 @@
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Textbox14">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value />
<Style>
<FontSize>7pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Left</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox14</rd:DefaultName>
<Style>
<Border>
<Style>None</Style>
</Border>
<VerticalAlign>Bottom</VerticalAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>=IIf(rownumber(nothing) = 1, "2pt", "0pt")</PaddingTop>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Textbox37">
@@ -568,6 +686,7 @@
<TablixMember />
<TablixMember />
<TablixMember />
<TablixMember />
</TablixMembers>
</TablixColumnHierarchy>
<TablixRowHierarchy>

File diff suppressed because it is too large Load Diff

View File

@@ -127,26 +127,35 @@
EmptyDataText="No se encontraron autorizaciones" ToolTip=""
CssClass="table table-striped table-advance table-hover ScrollAD mysmallbtn" data-sort="true" Width="100%" GridLines="None">
<Columns>
<%-- 0--%>
<asp:TemplateField HeaderText="Tipo " ItemStyle-Width="3%">
<ItemTemplate>
<asp:Label ID="LblTipo" Text='<%# Eval("TipoDocumento") %>' runat="server"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<%-- 1--%>
<asp:TemplateField HeaderText="Tipo" ItemStyle-Width="3%">
<ItemTemplate>
<asp:Label ID="LblTipoAuto" Text='<%# Eval("TipoAutorizacionTexto") %>' runat="server"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<%-- 2--%>
<asp:HyperLinkField DataTextField="NombreComercial" Target="_blank" HeaderText="Cliente" DataNavigateUrlFields="CveCliente" DataNavigateUrlFormatString="/Ventas/Clientes.aspx?CveCliente={0}" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="15%" />
<%-- 3--%>
<asp:BoundField DataField="Vendedor" HeaderText="Vendedor" ItemStyle-Width="9%" />
<%-- 30--%>
<%-- 4--%>
<asp:BoundField DataField="Importe" ItemStyle-Width="7%" HeaderText="Importe" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" />
<asp:BoundField DataField="PorcentajeDescuento" ItemStyle-Width="5%" HeaderText="% Desc" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" />
<asp:BoundField DataField="LimiteCredito" ItemStyle-Width="7%" HeaderText="L.Créd" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" />
<asp:BoundField DataField="Saldo" ItemStyle-Width="7%" HeaderText="Saldo" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" />
<asp:BoundField DataField="FechaIng" ItemStyle-Width="7%" HeaderText="Fecha" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:BoundField DataField="DiasVencidos" ItemStyle-Width="3%" HeaderText="D.Ven" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:N0}" />
<asp:HyperLinkField DataTextField="FacturaAplicada" ItemStyle-Width="7%" Target="_blank" HeaderText="Factura" DataNavigateUrlFields="CveVentaAplicada" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" ItemStyle-HorizontalAlign="Left" />
<asp:TemplateField ItemStyle-Width="7%">
<HeaderTemplate>Folio</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlFactura" runat="server"></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<%-- 45--%>
<asp:BoundField DataField="Usuario" HeaderText="Solicitó" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Motivo" HeaderText="Motivo" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Left" />

View File

@@ -37,6 +37,14 @@ Partial Class Ventas_CatAutorizacionLimites
DdlCliente.setEsWebService(True)
DdlClienteFiltro.setEsWebService(True)
If Request("CveCliente") IsNot Nothing AndAlso Request("CveCliente").ToString().ToEntero() > 0 Then
Dim CveCliente As Integer = Request("CveCliente").ToString().ToEntero()
Dim Cliente As String = GlobalDTCliente(UsuarioActual.CveEmpresa, Estatus:=-1, CveCliente:=CveCliente).FiltroPrimeroValor("NombreComercial")
DdlClienteFiltro.SelectedValue = CveCliente.ToString()
DdlCliente.SelectedText = Cliente
End If
'Dim EsWS = If(UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1", True, False)
'If EsWS Then
' DdlCliente.setEsWebService(True)
@@ -62,6 +70,10 @@ Partial Class Ventas_CatAutorizacionLimites
DdlEstatus.SelectedValue = "0"
If UsuarioActual.Empresa.Funcionalidad(595) = "3" Then
LnkAgregar.Visible = False
End If
UpModal.Update()
End Sub
Private Sub CargaDatos()
@@ -190,6 +202,12 @@ Partial Class Ventas_CatAutorizacionLimites
e.Row.FCLabel("LblTipoAuto").CssClass = "badge badge-secondary"
End If
If e.Row.DBCampo("CveIEAplicado").ToString().ToEntero() > 0 Then
e.Row.FCLiteral("LtlFactura").Text = String.Format("<a class=""Texto"" target=""_blank"" href=""/Bancos/IE.aspx?CveIE={0}"">{1}</a>", e.Row.DBCampo("CveIEAplicado"), e.Row.DBCampo("FolioIEAplicado"))
Else
e.Row.FCLiteral("LtlFactura").Text = String.Format("<a class=""Texto"" target=""_blank"" href=""/Ventas/Ventas.aspx?CveVenta={0}"">{1}</a>", e.Row.DBCampo("CveVentaAplicada"), e.Row.DBCampo("FacturaAplicada"))
End If
'If e.Row.DBCampo("Estatus") = "True" Then
' e.Row.Cells(1).ForeColor = Drawing.Color.Green
' e.Row.Cells(1).Font.Bold = True

View File

@@ -3018,8 +3018,8 @@ Partial Class Clientes
If e.Row.DataKey("ISTotal") = "1" Then
e.Row.FCLiteral("LtlFecha").Text = String.Format("Total {0} ", e.Row.DataKey("Tipo"))
e.Row.BackColor = Drawing.Color.LightGray
End If
End If
If e.Row.RowIndex > -1 Then
If e.Row.DBCampo("Folio") = "N/D" Then
e.Row.FCLiteral("LtlFactura").Text = e.Row.DataKey("Folio")
@@ -3037,22 +3037,27 @@ Partial Class Clientes
If (e.Row.DBCampo("CveVenta").ToEntero() > 0 AndAlso e.Row.DBCampo("Tipo").Contiene("Ant", "NC", "Dev")) OrElse (e.Row.DBCampo("CveIE").ToEntero() > 0 AndAlso e.Row.DBCampo("Tipo") = "IxC") Then
If ModalidadSelecionDevAnticipos Then
e.Row.FCCheckBox("chkDevolver").Visible = True
e.Row.FCCheckBox("chkDevolver").InputAttributes.Add("data-saldo", e.Row.DataKey("Saldo"))
End If
'If UsuarioActual.Empresa.Funcionalidad(185) = "1" AndAlso UsuarioActual.TienePermisoProceso(379) AndAlso CType(sender, GridView).ID = "GVAnticipos" Then
' If e.Row.DBCampo("CveVenta").ToString().ToEntero() > 0 AndAlso e.Row.DBCampo("Tipo").ToString().Contiene("NC", "Ant") Then
' If Not CBool(e.Row.DBCampo("AnticipoAutorizado")) Then
' If Not CBool(e.Row.DBCampo("AnticipoAutorizado")) Then
' e.Row.FCLinkButton("LnkAutorizar").Visible = True
' e.Row.FCLinkButton("LnkCancelar").Visible = False
' Else
' e.Row.FCLinkButton("LnkAutorizar").Visible = False
' e.Row.FCLinkButton("LnkCancelar").Visible = True
' End If
' End If
'End If
If e.Row.DBCampo("CveVenta").ToEntero() > 0 AndAlso e.Row.DBCampo("Tipo") = "NC" Then
Dim Parametros As String = Encripta($"CveVenta={e.Row.DBCampo("CveVenta").ToEntero()}&SerieFolio={e.Row.DBCampo("Folio")}&CveMoneda={e.Row.DBCampo("CveMoneda")}&CveCliente={CveCliente}&Saldo={e.Row.DBCampo("Saldo")}&Original={e.Row.DBCampo("Original")}&CvePrePoliza={e.Row.DBCampo("CvePrePoliza")}")
e.Row.FCHyperLink("HLDevolverDinero").Visible = True
e.Row.FCHyperLink("HLDevolverDinero").NavigateUrl = $"/Bancos/IE.aspx?Opcion=DevDinV&P={Parametros}"
End If
e.Row.FCHyperLink("HLDevolverDinero").Visible = True
e.Row.FCHyperLink("HLDevolverDinero").NavigateUrl = $"/Bancos/IE.aspx?Opcion=DevDinV&P={Parametros}"
End If
End If
End If
End If
End If
End If
End Sub
@@ -4831,8 +4836,8 @@ Partial Class Clientes
If Not TieneError Then
If IVA > 0 Then
If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, -IVA, -IVA, 13, "Traspaso de saldos de anticipos.IVA", "Traspaso de saldos de anticipos.IVA", CveCliente:=Gvr.DataKey("CveCliente").ToEntero(), CveIE:=Gvr.DataKey("CveIE").ToEntero(), PorcentajeImpuesto:=Gvr.DataKey("PorcentajeIVA").ToDecimal, Contabilizable:=False) Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, IVA, IVA, 13, "Traspaso de saldos de anticipos. IVA", "Traspaso de saldos de anticipos.IVA", CveCliente:=CveCliente, CveIE:=Gvr.DataKey("CveIE").ToEntero(), PorcentajeImpuesto:=Gvr.DataKey("PorcentajeIVA").ToDecimal, Contabilizable:=False) Then
If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, -IVA, -IVA, 13, "Traspaso de saldos de anticipos.IVA", "Traspaso de saldos de anticipos.IVA", CveCliente:=Gvr.DataKey("CveCliente").ToEntero(), CveIE:=Gvr.DataKey("CveIE").ToEntero(), PorcentajeImpuesto:=Gvr.DataKey("PorcentajeIVA").ToDecimal, CveVenta:=CveVenta, Contabilizable:=False) Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, IVA, IVA, 13, "Traspaso de saldos de anticipos. IVA", "Traspaso de saldos de anticipos.IVA", CveCliente:=CveCliente, CveIE:=Gvr.DataKey("CveIE").ToEntero(), PorcentajeImpuesto:=Gvr.DataKey("PorcentajeIVA").ToDecimal, CveVenta:=CveVenta, Contabilizable:=False) Then
TieneError = True
End If
Else

View File

@@ -853,94 +853,108 @@ Partial Class Ventas_PVCobranza
If MsgError = "" Then
ObjVentas2.Commit()
Dim msBuild As New StringBuilder()
Dim MsgTimbrado As String = ""
Dim DebeTimbrar As Boolean = True
Try
Dim SeTimbro As Boolean = False
Dim SeTimbroNC As Boolean = False
Dim MsgTimbrado As String = ""
Dim DebeTimbrar As Boolean = True
Dim SeTimbro As Boolean = False
Dim SeTimbroNC As Boolean = False
'SI SE GENERO FACTURA DE INGRESO, TIMBRARLA DESPUES DE REALIZAR EL PAGO
If DebeTimbrar AndAlso respFactura IsNot Nothing Then
Try
'VERIFICA SI SE GENERO NC
If respNC IsNot Nothing Then
AjustarTimbre(respFactura.Factura, respNC.Factura)
MsgTimbrado = TimbrarFactura(respFactura.Factura, respNC.Factura, SeTimbro, SeTimbroNC)
Else
AjustarTimbre(respFactura.Factura, Nothing)
MsgTimbrado = TimbrarFactura(respFactura.Factura, Nothing, SeTimbro, SeTimbroNC)
End If
If Not String.IsNullOrEmpty(MsgTimbrado) Then
Dim StrEr As String = $"<br/><div id = 'DivTipoCambioAdvertencia' class='alert alert-danger' style='padding: 5px; margin-bottom: 5px; padding-right: 25px;'><strong style = 'font-size: 20px; margin-right: 25px;' > Comprobante no emitido : </strong><br/> {MsgTimbrado}<br/>Por favor inténtelo de nuevo a través del botón 'Emitir' en ventas.</div>"
MsgTimbrado = StrEr
End If
Catch ex As Exception
GuardaLogAD(ex.ToString())
msBuild.AppendFormat("<br/>{0}<br/>", MsgTimbrado)
End Try
'SI SE GENERO FACTURA DE INGRESO, TIMBRARLA DESPUES DE REALIZAR EL PAGO
If DebeTimbrar AndAlso respFactura IsNot Nothing Then
'VERIFICA SI SE GENERO NC
If respNC IsNot Nothing Then
AjustarTimbre(respFactura.Factura, respNC.Factura)
MsgTimbrado = TimbrarFactura(respFactura.Factura, respNC.Factura, SeTimbro, SeTimbroNC)
Else
AjustarTimbre(respFactura.Factura, Nothing)
MsgTimbrado = TimbrarFactura(respFactura.Factura, Nothing, SeTimbro, SeTimbroNC)
End If
If Not String.IsNullOrEmpty(MsgTimbrado) Then
Dim StrEr As String = $"<br/><div id = 'DivTipoCambioAdvertencia' class='alert alert-danger' style='padding: 5px; margin-bottom: 5px; padding-right: 25px;'><strong style = 'font-size: 20px; margin-right: 25px;' > Comprobante no emitido : </strong><br/> {MsgTimbrado}<br/>Por favor inténtelo de nuevo a través del botón 'Emitir' en ventas.</div>"
MsgTimbrado = StrEr
End If
If respFactura IsNot Nothing Then
If RegistrarPago Then
msBuild.Append("<span style=""font-size:14px;"">Pago Registrado correctamente. </span> <br/><br/>")
End If
End If
msBuild.AppendFormat("<span style=""font-size:14px;""> La factura <a class=""Texto"" target=""_blank"" style=""font-size:18px;font-weight:bold;"" href=""/Ventas/Ventas.aspx?CveVenta={0}"">{1}</a> se genero correctamente. </span> <br/>", respFactura.CveVenta, respFactura.SerieFolio)
If respFactura IsNot Nothing Then
If RegistrarPago Then
msBuild.Append("<span style=""font-size:14px;"">Pago Registrado correctamente. </span> <br/><br/>")
End If
msBuild.AppendFormat("<span style=""font-size:14px;""> La factura <a class=""Texto"" target=""_blank"" style=""font-size:18px;font-weight:bold;"" href=""/Ventas/Ventas.aspx?CveVenta={0}"">{1}</a> se genero correctamente. </span> <br/>", respFactura.CveVenta, respFactura.SerieFolio)
If SeTimbro Then
Dim xml = String.Format("<ul><li><a class=""Texto"" target=""_blank"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar XML</a></li></ul>", Encripta(String.Format("OP=FactVta&CVEVENTA={0}&EXT={1}&SERIEFOLIO={2}&TIPODOCTO={3}", respFactura.CveVenta, "XML", respFactura.SerieFolio, respFactura.Factura.TipoDocto)))
msBuild.AppendFormat("{0}", xml)
End If
Dim pdf = String.Format("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF</a></li></ul>", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1", respFactura.CveVenta)))
msBuild.AppendFormat("{0}", pdf)
If respFactura.Factura.Inv_CveMovimiento > 0 Then
msBuild.AppendFormat("<b><a target='_blank' class='Texto' href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"">Movimiento de Almacén</a></b><br/>", respFactura.Factura.Inv_CveMovimiento)
End If
If respNC IsNot Nothing Then
msBuild.AppendFormat("<span style=""font-size:14px;""> La nota de crédito <a class=""Texto"" target=""_blank"" style=""font-size:18px;font-weight:bold;"" href=""/Ventas/Ventas.aspx?CveVenta={0}"">{1}</a> se genero correctamente.</span> <br/>", respNC.CveVenta, respNC.SerieFolio)
If SeTimbroNC Then
Dim xml = String.Format("<ul><li><a class=""Texto"" target=""_blank"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar XML</a></li></ul>", Encripta(String.Format("OP=FactVta&CVEVENTA={0}&EXT={1}&SERIEFOLIO={2}&TIPODOCTO={3}", respNC.CveVenta, "XML", respNC.SerieFolio, respNC.Factura.TipoDocto)))
If SeTimbro Then
Dim xml = String.Format("<ul><li><a class=""Texto"" target=""_blank"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar XML</a></li></ul>", Encripta(String.Format("OP=FactVta&CVEVENTA={0}&EXT={1}&SERIEFOLIO={2}&TIPODOCTO={3}", respFactura.CveVenta, "XML", respFactura.SerieFolio, respFactura.Factura.TipoDocto)))
msBuild.AppendFormat("{0}", xml)
End If
Dim pdfNC = String.Format("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF</a></li></ul>", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1", respNC.CveVenta)))
msBuild.AppendFormat("{0}", pdfNC)
End If
Dim pdf = String.Format("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF</a></li></ul>", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1", respFactura.CveVenta)))
msBuild.AppendFormat("{0}", pdf)
If respFactura.Factura.Inv_CveMovimiento > 0 Then
msBuild.AppendFormat("<b><a target='_blank' class='Texto' href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"">Movimiento de Almacén</a></b><br/>", respFactura.Factura.Inv_CveMovimiento)
End If
If respNC IsNot Nothing Then
msBuild.AppendFormat("<span style=""font-size:14px;""> La nota de crédito <a class=""Texto"" target=""_blank"" style=""font-size:18px;font-weight:bold;"" href=""/Ventas/Ventas.aspx?CveVenta={0}"">{1}</a> se genero correctamente.</span> <br/>", respNC.CveVenta, respNC.SerieFolio)
If SeTimbroNC Then
Dim xml = String.Format("<ul><li><a class=""Texto"" target=""_blank"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar XML</a></li></ul>", Encripta(String.Format("OP=FactVta&CVEVENTA={0}&EXT={1}&SERIEFOLIO={2}&TIPODOCTO={3}", respNC.CveVenta, "XML", respNC.SerieFolio, respNC.Factura.TipoDocto)))
msBuild.AppendFormat("{0}", xml)
End If
Dim pdfNC = String.Format("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF</a></li></ul>", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1", respNC.CveVenta)))
msBuild.AppendFormat("{0}", pdfNC)
End If
If respNC IsNot Nothing Then
If respNC IsNot Nothing AndAlso respNC.Factura IsNot Nothing AndAlso respNC.Factura.DtAnticiposAplicados IsNot Nothing Then
For Each dr As DataRow In respNC.Factura.DtAnticiposAplicados.Rows
msBuild.AppendLine($"<br><a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=AMORTIZACIONHIS&CVEIE={0}&CVEVENTA={1}&CVECLIENTE={2}&CVEVENTAAMORTIZADA={3}&MONTO={4}",
If respNC IsNot Nothing Then
If respNC IsNot Nothing AndAlso respNC.Factura IsNot Nothing AndAlso respNC.Factura.DtAnticiposAplicados IsNot Nothing Then
For Each dr As DataRow In respNC.Factura.DtAnticiposAplicados.Rows
msBuild.AppendLine($"<br><a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=AMORTIZACIONHIS&CVEIE={0}&CVEVENTA={1}&CVECLIENTE={2}&CVEVENTAAMORTIZADA={3}&MONTO={4}",
dr("CveIE").ToString,
dr("CveVenta").ToString,
respNC.Factura.CveCliente,
respNC.CveVenta,
respNC.Factura.Total))}"">Imprimir Saldo Aplicado {dr("Folio").ToString}</a><br/>")
Next
End If
Next
End If
Else
If respFactura IsNot Nothing AndAlso respFactura.Factura IsNot Nothing AndAlso respFactura.Factura.DtAnticiposAplicados IsNot Nothing Then
For Each dr As DataRow In respFactura.Factura.DtAnticiposAplicados.Rows
msBuild.AppendLine($"<br><a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=AMORTIZACIONHIS&CVEIE={0}&CVEVENTA={1}&CVECLIENTE={2}&CVEVENTAAMORTIZADA={3}&MONTO={4}",
Else
If respFactura IsNot Nothing AndAlso respFactura.Factura IsNot Nothing AndAlso respFactura.Factura.DtAnticiposAplicados IsNot Nothing Then
For Each dr As DataRow In respFactura.Factura.DtAnticiposAplicados.Rows
msBuild.AppendLine($"<br><a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=AMORTIZACIONHIS&CVEIE={0}&CVEVENTA={1}&CVECLIENTE={2}&CVEVENTAAMORTIZADA={3}&MONTO={4}",
dr("CveIE").ToString,
dr("CveVenta").ToString,
respFactura.Factura.CveCliente,
respFactura.CveVenta,
respFactura.Factura.Total))}"">Imprimir Saldo Aplicado {dr("Folio").ToString}</a><br/>")
Next
Next
End If
End If
If Not String.IsNullOrEmpty(MsgTimbrado) Then
msBuild.AppendFormat("<br/>{0}<br/>", MsgTimbrado)
End If
Else
msBuild.Append($"Pago Registrado correctamente.<br/><br/> <a href=""/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1&TICKET=1&REGENERAR=1", CveVenta))}"" class='Texto'>Imprimir ticket</a>")
End If
If Not String.IsNullOrEmpty(MsgTimbrado) Then
msBuild.AppendFormat("<br/>{0}<br/>", MsgTimbrado)
End If
Catch ex As Exception
GuardaLogAD(ex.ToString())
msBuild.Append("Ocurrio un error posterior al pago")
End Try
Else
msBuild.Append($"Pago Registrado correctamente.<br/><br/> <a href=""/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1&TICKET=1&REGENERAR=1", CveVenta))}"" class='Texto'>Imprimir ticket</a>")
End If
Alert(msBuild.ToString(), TipoMensaje.MsgInformacion)
Else
@@ -958,6 +972,19 @@ Partial Class Ventas_PVCobranza
If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
ImpresionDirectaPDF(CveVenta)
End If
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
'ENVIO DE CORREO
Try
If respFactura IsNot Nothing AndAlso respFactura.Factura IsNot Nothing Then
Dim EnviarMail As Boolean = respFactura.Factura.Cliente.EnviarFactura = "Si"
Dim Hilo As New System.Threading.Thread(Sub() EnviarMailFactura(EnviarMail, respFactura.Factura, UsuarioActual))
Hilo.Start()
End If
Catch ex As Exception
GuardaLogAD(ex.ToString())
End Try
End If
LimpiarDatos()
CargaDatos()
@@ -978,12 +1005,10 @@ Partial Class Ventas_PVCobranza
Dim Actualizo As Boolean = False
If Tipo.Contiene("NC", "Ant") Then
If ObjVentas.UpdateVentaAnticipoAutorizado(CveVenta, False) Then
Alert("El anticipo se desautorizó correctamente")
Actualizo = True
End If
ElseIf Tipo.Contiene("IxC") Then
If ObjVentas.UpdateIxCAnticipoAutorizado(CveIE, False) Then
Alert("El anticipo se desautorizó correctamente")
Actualizo = True
End If
End If
@@ -2125,11 +2150,14 @@ Partial Class Ventas_PVCobranza
End Sub
Protected Sub LnkSolicitarActivarAnticipo_Click(sender As Object, e As EventArgs)
Dim CveCliente As Integer = -1
'falta sacar a los usuarios a notificar.
Dim gvr As GridViewRow = DirectCast(DirectCast(sender, LinkButton).BindingContainer, GridViewRow)
Dim CveCliente As Integer = gvr.DataKey("CveCliente").ToEntero()
Dim Folio As String = gvr.DataKey("Folio")
Dim Importe As Decimal = gvr.FCTextBox(String.Format("TxtAnticipo{0}", gvr.RowIndex)).Text.ToDecimal
Dim Saldo As Decimal = gvr.DataKey("Saldo").ToDecimal()
Dim dtt As DataTable = Nothing
Dim ObjProceso As New ClsSisProcesos
@@ -2151,36 +2179,34 @@ Partial Class Ventas_PVCobranza
If EsProduccion Then
NumeroTelefono = String.Format("52{0}", dr("Celular").ToString())
End If
Dim Arr As New ArrayList
Arr.Add(DdlSucursalCorte.SelectedItem.Text)
Arr.Add(NombreCliente)
Arr.Add(Folio)
Arr.Add($"$ {Importe}")
EnvioMsg = EnviarNotificacionWhatsAppPlantilla(NumeroTelefono, "solicitud_autorizacion_anticipo", Arr, $"https://grupodiaz.adssistemas.mx.com/Clientes/Clientes.aspx?CveCliente={CveCliente}")
'EnvioMsg = ModExtensiones.EnviarNotificacionWhatsApp2(NumeroTelefono, "", $"Solicitud de activación de anticipo.\\nFolio: {Folio}.\\nCliente: {NombreCliente}.")
ClsSisNotificaciones.EnviarAlerta("Solicitud de Anticipo", $"Solicitud de activación de anticipo Folio: {Folio} <br/><a href='/Ventas/Clientes.aspx?CveCliente={CveCliente}&op=ant'>Ir Activar</a>", dr("CveUsuario").ToString, Tipo:=TipoNotificacion.ToastInformacionB)
If NumeroTelefono.Length = 12 Then
EnvioMsg = EnviarNotificacionWhatsAppPlantilla(NumeroTelefono, "solicitud_autorizacion_anticipo", Arr, $"https://grupodiaz.adssistemas.mx.com/Ventas/CatAutorizacionLimites.aspx?CveCliente={CveCliente}")
ClsSisNotificaciones.EnviarAlerta("Solicitud de Anticipo", $"Solicitud de activación de anticipo Folio: {Folio} <br/><a href='/Ventas/CatAutorizacionLimites.aspx?CveCliente={CveCliente}&op=ant'>Ir Activar</a>", dr("CveUsuario").ToString, Tipo:=TipoNotificacion.ToastInformacionB)
End If
Next
If EnvioMsg Then
Alert("Se envió una solicitud de autorización", TipoMensaje.ToastInformacion)
'Else
' Alert("No se envió la solicitud de autorización", TipoMensaje.MsgAdvertencia)
End If
End If
Dim CveVenta As Integer = gvr.DataKey("CveVenta").ToEntero()
Dim CveIE As Integer = gvr.DataKey("CveIE").ToEntero()
Dim ObjVta As New ClsVentas
If ObjVta.AddAutorizacionLimite(UsuarioActual.CveEmpresa, gvr.DataKey("CveCliente").ToEntero(), CveVendedor, Importe, 0, UsuarioActual.CveUsuario, 1, TipoDocumento:="Ant", DiasVencidos:=1, CveVenta:=CveVenta, CveIE:=CveIE) Then
If ObjVta.AddAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, CveVendedor, Saldo, 0, UsuarioActual.CveUsuario, 1, TipoDocumento:="Ant", DiasVencidos:=1, CveVenta:=CveVenta, CveIE:=CveIE) Then
Dim msgAlert = "La autorización se agregó correctamente."
If EnvioMsg Then
msgAlert = $"{msgAlert} Se envió una notificación de autorización a los usuarios"
End If
Alert(msgAlert, TipoMensaje.MsgInformacion)
Alert(msgAlert, TipoMensaje.ToastInformacionB)
End If
ObjVta.Dispose()
UpAnticipos.Update()
End Sub
@@ -2779,6 +2805,131 @@ Partial Class Ventas_PVCobranza
#End Region
Private Sub EnviarMailFactura(EnviaCorreo As Boolean, Factura As Modelos.Factura, UsuarioActual As Usuario)
'GUARDA PDF
Dim LocalSerieFolio As String = Factura.SerieFolio
Dim LocalTipoDocto As String = Factura.TipoDocto
Dim ArchivoPDF As String = String.Format("{0}PDF\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, LocalTipoDocto, LocalSerieFolio)
'TIMBRADO NUEVO
Try
If Not File.Exists(ArchivoPDF) Then
GenerarPDFVenta(Factura.CveVenta, AplicaPagare:="1", GuardarPDF:=True, RegenerarPDF:=True, DescargarArchivo:=False)
End If
Catch ex As Exception
GuardaLogAD(ex.ToString())
End Try
Dim ErrorCorreo As Boolean = False
If EnviaCorreo Then
If Factura IsNot Nothing Then
Dim ArchivoXML As String = String.Format("{0}XML\{1}\{2}.xml", UsuarioActual.Empresa.Ruta, LocalTipoDocto, LocalSerieFolio)
Try
Dim FIXML As New FileInfo(ArchivoXML)
Dim FIPDF As New FileInfo(ArchivoPDF)
If FIXML.Exists AndAlso FIPDF.Exists Then
MandaMails(UsuarioActual, Factura, Factura.TipoDocto, LocalSerieFolio, EnviaCorreo, ArchivoXML, ArchivoPDF)
Else
ErrorCorreo = True
End If
Catch ex As Exception
ErrorCorreo = True
End Try
Else
ErrorCorreo = True
End If
If ErrorCorreo Then
Dim ObjVentas As New ClsVentas(UsuarioActual:=UsuarioActual)
If EnviaCorreo Then
ObjVentas.UpdateVentaMail(3, Factura.CveVenta)
Else
ObjVentas.UpdateVentaMail(0, Factura.CveVenta)
End If
ObjVentas.Dispose()
End If
End If
End Sub
Private Sub MandaMails(UsuarioActual As Usuario, ObjFactura As Modelos.Factura, TipoDocto As String, SerieFolio As String, EnviarFactura As Boolean, XML As String, PDF As String)
Dim ObjMail As New ClsSisMail()
Dim ResultadoMail As Integer = 0
Dim CorreoDestino As String = ObjFactura.Cliente.Mail
Try
Dim Asunto As String = String.Empty
Dim Cuerpo As String = String.Empty
Dim TipoComprobante As String = ""
If TipoDocto = "Ing" Then TipoComprobante = "Factura"
If TipoDocto = "Egs" Then TipoComprobante = "Nota de Crédito"
If UsuarioActual.Empresa.PlantillaMailVenta.Trim.Length > 0 Then
Cuerpo = UsuarioActual.Empresa.PlantillaMailVenta
Cuerpo = Cuerpo.Replace("{""NombreEmpresa""}", UsuarioActual.Empresa.Empresa)
Cuerpo = Cuerpo.Replace("{""NombreCliente""}", ObjFactura.Cliente.NombreComercial)
Cuerpo = Cuerpo.Replace("{""TipoDocumento""}", TipoComprobante)
Cuerpo = Cuerpo.Replace("{""Fecha""}", ObjFactura.Fecha.ToString("dd/MM/yyyy"))
Cuerpo = Cuerpo.Replace("{""Total""}", ObjFactura.Total.ToString("N2"))
Cuerpo = Cuerpo.Replace("{""FechaVencimiento""}", ObjFactura.FechaVencimiento.ToString("dd/MM/yyyy"))
Cuerpo = Cuerpo.Replace("{""SerieFolio""}", SerieFolio)
Asunto = Asunto.Replace("{""AtencionA""}", ObjFactura.AtencionA)
Asunto = Asunto.Replace("{""Sucursal""}", ObjFactura.SubProyecto.SubProyecto)
Asunto = Asunto.Replace("{""DescripcionVenta""}", ObjFactura.DescripcionVenta)
Asunto = Asunto.Replace("{""FolioFactura""}", ObjFactura.SerieFolio)
End If
If UsuarioActual.Empresa.AsuntoPlantillaMailVenta.Trim.Length > 0 Then
Asunto = UsuarioActual.Empresa.AsuntoPlantillaMailVenta
Asunto = Asunto.Replace("{""NombreEmpresa""}", UsuarioActual.Empresa.Empresa)
Asunto = Asunto.Replace("{""NombreCliente""}", ObjFactura.Cliente.NombreComercial)
Asunto = Asunto.Replace("{""TipoDocumento""}", TipoComprobante)
Cuerpo = Cuerpo.Replace("{""Fecha""}", ObjFactura.Fecha.ToString("dd/MM/yyyy"))
Cuerpo = Cuerpo.Replace("{""Total""}", ObjFactura.Total.ToString("N2"))
Cuerpo = Cuerpo.Replace("{""FechaVencimiento""}", ObjFactura.FechaVencimiento.ToString("dd/MM/yyyy"))
Asunto = Asunto.Replace("{""SerieFolio""}", SerieFolio)
Asunto = Asunto.Replace("{""AtencionA""}", ObjFactura.AtencionA)
Asunto = Asunto.Replace("{""Sucursal""}", ObjFactura.SubProyecto.SubProyecto)
Asunto = Asunto.Replace("{""DescripcionVenta""}", ObjFactura.DescripcionVenta)
Asunto = Asunto.Replace("{""FolioFactura""}", ObjFactura.SerieFolio)
End If
If Not EnviarFactura Then
ResultadoMail = 0
End If
Dim LSRutasMail As New List(Of ClsSisMail.ArchivoMail)
LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.Ruta = PDF})
LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.Ruta = XML})
Dim DisplayName As String = ""
If ObjMail.SendMail(UsuarioActual.Empresa, CorreoDestino, Asunto, Cuerpo, "", LSRutasMail, Displayname:=DisplayName) Then
ResultadoMail = 1
Else
ResultadoMail = 3
End If
Catch ex As Exception
OnError("Ocurrió error al mandar el Mail", ex)
ResultadoMail = 3
Finally
Dim ObjVentas As New ClsVentas(UsuarioActual:=UsuarioActual)
ObjVentas.UpdateVentaMail(ResultadoMail, ObjFactura.CveVenta)
ObjVentas.Dispose()
End Try
End Sub
End Class
Public Class MRespuestaSAT

View File

@@ -18733,7 +18733,22 @@ Partial Class Ventas
End Sub
Protected Sub DdlPSEdit_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
If UsuarioActual.Empresa.Funcionalidad(109) = "1" OrElse UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
Dim ActualizarPrecios As Boolean = False
If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
ActualizarPrecios = true
End If
If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
ActualizarPrecios = True
End If
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
ActualizarPrecios = True
End If
If ActualizarPrecios Then
Dim EditarPrecio As Boolean = True
If DdlTipoComprobante.SelectedValue = "Ant" AndAlso UsuarioActual.CveEmpresa = 189 Then
@@ -18747,25 +18762,40 @@ Partial Class Ventas
If (GvRow.RowState = DataControlRowState.Edit OrElse GvRow.RowState = 5) Then
Dim CvePSParametro = ddlPSEdit.SelectedValue.ToEntero()
Dim DdlPrecioListaEdit = GvRow.FCDropDownList("DdlPrecioListaEdit")
Dim CveClasificacion As Integer = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=CvePSParametro).FiltroPrimeroValor("CveClasificacion").ToEntero()
If UsuarioActual.CveEmpresa = 189 Then
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Cot", "Ped") AndAlso GvRow.FCHtmlGenericControl("DivPrecioLista").Visible Then
Using ObjVta As New ClsVentas
If ObjVta.GetPreciosListaSPPermitidos(DdlSubProyectoDatos.SelectedValue.ToEntero(), CvePSParametro, UsuarioActual.CveEmpresa) Then
Dim Dt As DataTable = Nothing
If UsuarioActual.TienePermisoProceso(384) Then
Dt = ObjVta.DtResultados.Copy()
Else
Dt = ObjVta.DtResultados.FiltraParametros("Restringuida = 'False'")
If CveClasificacion > 0 Then
Dim DdlCla As DropDownList = GvRow.FCDropDownList("DdlClasificacion")
DdlCla.SelectedValueExist(CveClasificacion)
End If
Dim CvePrecioListaSugerido As Integer = -1
If UsuarioActual.Empresa.Funcionalidad(360) = "1" OrElse UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
Dim DdlPrecioListaEdit = GvRow.FCDropDownList("DdlPrecioListaEdit")
If UsuarioActual.CveEmpresa = 189 Then
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Cot", "Ped") AndAlso GvRow.FCHtmlGenericControl("DivPrecioLista").Visible Then
Using ObjVta As New ClsVentas
If ObjVta.GetPreciosListaSPPermitidos(DdlSubProyectoDatos.SelectedValue.ToEntero(), CvePSParametro, UsuarioActual.CveEmpresa) Then
Dim Dt As DataTable = Nothing
If UsuarioActual.TienePermisoProceso(384) Then
Dt = ObjVta.DtResultados.Copy()
Else
Dt = ObjVta.DtResultados.FiltraParametros("Restringuida = 'False'")
End If
GvRow.FCDropDownList("DdlPrecioListaEdit").DataSource = Dt
GvRow.FCDropDownList("DdlPrecioListaEdit").DataBind()
GvRow.FCDropDownList("DdlPrecioListaEdit").SelectedValueExist(GvRow.DataKey("CvePrecioLista"))
End If
GvRow.FCDropDownList("DdlPrecioListaEdit").DataSource = Dt
GvRow.FCDropDownList("DdlPrecioListaEdit").DataBind()
GvRow.FCDropDownList("DdlPrecioListaEdit").SelectedValueExist(GvRow.DataKey("CvePrecioLista"))
End If
End Using
End Using
End If
End If
CvePrecioListaSugerido = DdlPrecioListaEdit.SelectedValue.ToEntero()
Else
CvePrecioListaSugerido = GvRow.DataKey("CvePrecioLista").ToEntero()
End If
Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSParametro).FiltroPrimero("")
@@ -18774,7 +18804,7 @@ Partial Class Ventas
Dim PrecioSugerido As Decimal = 0
Dim tPrecioSugerido As Decimal = 0
tPrecioSugerido = DrPS("Precio").ToString().ToDecimal
Dim ObjPrecioSugerido As Modelos.MPrecioSugerido = CalculaPrecioSugerido(CvePSParametro, DrPS("CveClasificacion").ToString().ToEntero(), CvePrecioListaSugerido:=DdlPrecioListaEdit.SelectedValue.ToEntero())
Dim ObjPrecioSugerido As Modelos.MPrecioSugerido = CalculaPrecioSugerido(CvePSParametro, DrPS("CveClasificacion").ToString().ToEntero(), CvePrecioListaSugerido:=CvePrecioListaSugerido)
PrecioSugerido = ObjPrecioSugerido.PrecioSugerido
@@ -39949,9 +39979,19 @@ Partial Class Ventas
Dim FolioFiscal As String = RowVenta("FolioFiscal").ToString().Trim()
Dim Total As Decimal = RowVenta("Total").ToString().ToDecimal()
Dim RFCReceptor As String = RowVenta("RFCReceptor").ToString()
Dim CvePACCancelacion As Integer = 5
Dim ObjTimbrado As New Timbrado
Dim resp = ObjTimbrado.CFDICancelar(UsuarioActual.Empresa, FolioFiscal, Total, RFCReceptor, UsuarioActual.Empresa.RFC, CvePACCancelacion:=5, ValidaFactura:=False, CveSATMotivoCancelacion:=2)
Dim resp = ObjTimbrado.CFDICancelar(UsuarioActual.Empresa, FolioFiscal, Total, RFCReceptor, UsuarioActual.Empresa.RFC, CvePACCancelacion:=CvePACCancelacion, ValidaFactura:=False, CveSATMotivoCancelacion:=2)
If resp IsNot Nothing Then
If resp.Verificado Then
Dim CancelacionAcuse = resp.CancelacionAcuse
Using ObjVentas As New ClsVentas
If Not ObjVentas.UpdateCancelaVenta(CveVenta, Now, CancelacionAcuse, UsuarioActual.CveEmpresa, CvePACCancelacion, -1, EstadoCancelacion:="", CveEstadoCancelacion:=-1) Then
Alert("Ocurrió un error al guardar el estatus de cancelación")
End If
End Using
End If
Alert(resp.Estado)
End If