This commit is contained in:
2025-01-21 23:26:40 -07:00
31 changed files with 3525 additions and 1212 deletions

View File

@@ -2434,19 +2434,14 @@
<asp:BoundField HeaderText="SubTotal" DataField="SubTotal" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="IVA" DataField="IVA" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Original" DataField="Original" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Saldo" DataField="Saldo" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:TemplateField HeaderText="Devolución" ItemStyle-HorizontalAlign="Center" Visible="false">
<asp:BoundField HeaderText="Saldo" DataField="SaldoConImpuestos" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Mon" DataField="Abreviatura" ItemStyle-Width="60px" />
<asp:TemplateField HeaderText="Devolución" ItemStyle-HorizontalAlign="Center" Visible="false" ItemStyle-Width="80px">
<ItemTemplate>
<asp:CheckBox ID="chkDevolver" runat="server" Visible="false" CssClass="CssSelector" onclick="FCSumaTotalesNCAnticipos()" />
<asp:HyperLink ID="HLDevolverDinero" Visible="false" NavigateUrl="#" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-usd'></i>" runat="server" />
</ItemTemplate>
</asp:TemplateField>
<%-- <asp:TemplateField HeaderText="Autorización" ItemStyle-HorizontalAlign="Center" Visible="false">
<ItemTemplate>
<asp:LinkButton ID="LnkAutorizar" Visible="false" NavigateUrl="#" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ToolTip="Autorizar Anticipo" runat="server" OnClick="LnkAutorizarAnticipo_Click" />
<asp:LinkButton ID="LnkCancelar" Visible="false" NavigateUrl="#" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-ban'></i>" ToolTip="Bloquear Anticipo" runat="server" OnClick="LnkCancelarAnticipo_Click" />
</ItemTemplate>
</asp:TemplateField>--%>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>

View File

@@ -922,7 +922,7 @@ Partial Class Clientes
LnkPersonaFisica.Visible = True
End If
InicializaDevolverDinero()
'InicializaDevolverDinero()
TxtFechaICredito.Text = NowADS().AddYears(-2).ToShortDateString()
TxtFechaFCredito.Text = NowADS().ToShortDateString()
@@ -1632,7 +1632,7 @@ Partial Class Clientes
DdlUsoCFDI.SelectedValueExist(ObjClientes.CveUsoCFDI.ToString())
DdlMetodoPago33.SelectedValueExist(ObjClientes.CveMetodoPago.ToString())
'DdlFormaPago33.SelectedValueExist(ObjClientes.CveFormaPago33.ToString())
'DdlFormaPago33.SelectedValueExist(ObjClientes.CveFormaPago.ToString())
CargaFormaDePago(ObjClientes.CveFormaPago)
If ObjClientes.CveRegimenFiscal > 0 Then DdlRegimenFiscal.SelectedValueExist(ObjClientes.CveRegimenFiscal)
@@ -1956,12 +1956,8 @@ Partial Class Clientes
DtClientesAnticipo = Nothing
GVAnticiposHistorial.DataSource = Nothing
DtAnticipoHistorial = Nothing
End If
End If
ObjMovtos.Dispose()
'If UsuarioActual.Empresa.Funcionalidad(185) = "1" AndAlso UsuarioActual.TienePermisoProceso(379) Then
' GVAnticipos.Columns(7).Visible = True
'End If
GVAnticipos.DataBind()
GVAnticiposHistorial.DataBind()
@@ -2279,7 +2275,7 @@ Partial Class Clientes
Cuerpo = Cuerpo.Replace("{""NombreEmpresa""}", UsuarioActual.Empresa.Empresa)
Cuerpo = Cuerpo.Replace("{""NombreCliente""}", LtlCliente.Text.Trim)
Cuerpo = Cuerpo.Replace("{""TipoDocumento""}", TipoComprobante)
Cuerpo = Cuerpo.Replace("{""FolioFactura""}", HdnSerieFolio.Value.ToString())
Cuerpo = Cuerpo.Replace("{""SerieFolio""}", HdnSerieFolio.Value.ToString())
If Dr IsNot Nothing Then
Cuerpo = Cuerpo.Replace("{""FechaFactura""}", Dr("Fecha").ToString().ToDate().ToShortDateString())
@@ -2297,7 +2293,7 @@ Partial Class Clientes
Asunto = Asunto.Replace("{""NombreEmpresa""}", UsuarioActual.Empresa.Empresa)
Asunto = Asunto.Replace("{""NombreCliente""}", LtlCliente.Text.Trim)
Asunto = Asunto.Replace("{""TipoDocumento""}", TipoComprobante)
Asunto = Asunto.Replace("{""FolioFactura""}", HdnSerieFolio.Value.ToString())
Asunto = Asunto.Replace("{""SerieFolio""}", HdnSerieFolio.Value.ToString())
If Dr IsNot Nothing Then
Asunto = Asunto.Replace("{""FechaFactura""}", Dr("Fecha").ToString().ToDate().ToShortDateString())
@@ -2318,7 +2314,7 @@ Partial Class Clientes
Cuerpo = Cuerpo.Replace("{""NombreEmpresa""}", UsuarioActual.Empresa.Empresa)
Cuerpo = Cuerpo.Replace("{""NombreCliente""}", LtlCliente.Text.Trim)
Cuerpo = Cuerpo.Replace("{""TipoDocumento""}", TipoComprobante)
Cuerpo = Cuerpo.Replace("{""FolioFactura""}", HdnSerieFolio.Value.ToString())
Cuerpo = Cuerpo.Replace("{""SerieFolio""}", HdnSerieFolio.Value.ToString())
If Dr IsNot Nothing Then
Cuerpo = Cuerpo.Replace("{""FechaFactura""}", Dr("Fecha").ToString().ToDate().ToShortDateString())
Cuerpo = Cuerpo.Replace("{""ImporteFactura""}", Dr("Total").ToString().FormatoNumero())
@@ -2335,7 +2331,7 @@ Partial Class Clientes
Asunto = Asunto.Replace("{""NombreEmpresa""}", UsuarioActual.Empresa.Empresa)
Asunto = Asunto.Replace("{""NombreCliente""}", LtlCliente.Text.Trim)
Asunto = Asunto.Replace("{""TipoDocumento""}", TipoComprobante)
Asunto = Asunto.Replace("{""FolioFactura""}", HdnSerieFolio.Value.ToString())
Asunto = Asunto.Replace("{""SerieFolio""}", HdnSerieFolio.Value.ToString())
If Dr IsNot Nothing Then
Asunto = Asunto.Replace("{""FechaFactura""}", Dr("Fecha").ToString().ToDate().ToShortDateString())
Asunto = Asunto.Replace("{""ImporteFactura""}", Dr("Total").ToString().FormatoNumero())
@@ -2696,7 +2692,7 @@ Partial Class Clientes
If Not ObjClientes.AddSucursal(CveClienteNuevo, Row("SucursalCliente").ToString(), UsuarioActual.CveUsuario, Row("CiudadSucursal").ToString(), Row("ColoniaSucursal").ToString(), Row("CPSucursal").ToString(), Row("DireccionSucursal").ToString(), Row("EstadoSucursal").ToString(), Row("LocalidadSucursal").ToString(),
Row("PaisSucursal").ToString(), Row("NumExtSucursal").ToString(), Row("NumIntSucursal").ToString(), Row("TelefonoSucursal").ToString(), Row("CorreoSucursal").ToString(), Row("CorreoCotiziacionSucursal").ToString(), Row("ContactoSucursal").ToString(),
Row("CveVendedorSucursal").ToString().ToEntero(), Row("NumCuenta").ToString(), Row("CveMetodoPago").ToString().ToEntero(), Row("LimiteCredito").ToString().ToDecimal(), Row("CveResponsableCobranza").ToString().ToEntero(),
Row("CveUsoCFDI").ToString().ToEntero(), Row("CveFormaPago33").ToString().ToEntero(), Row("CveMetodoPago33").ToString().ToEntero(), LT:=Row("LT").ToString(), LG:=Row("LG").ToString(), CveAlmacenAsignado:=CveAlmacenAsignadoSucursal) Then
Row("CveUsoCFDI").ToString().ToEntero(), Row("CveFormaPago33").ToString().ToEntero(), Row("CveMetodoPago").ToString().ToEntero(), LT:=Row("LT").ToString(), LG:=Row("LG").ToString(), CveAlmacenAsignado:=CveAlmacenAsignadoSucursal) Then
ErrorProceso = True
Exit For
End If
@@ -3348,7 +3344,7 @@ Partial Class Clientes
DdlResponsableSucursal.SelectedValueExist(ObjCliente.DtResultados.Rows(0)("CveResponsableCobranza").ToString())
DdlSucursalUsoCFDI.SelectedValueExist(ObjCliente.DtResultados.Rows(0)("CveUsoCFDI").ToString())
DdlSucursalMetodoPago33.SelectedValueExist(ObjCliente.DtResultados.Rows(0)("CveMetodoPago33").ToString())
DdlSucursalMetodoPago33.SelectedValueExist(ObjCliente.DtResultados.Rows(0)("CveMetodoPago").ToString())
DdlSucursalFormaPago33.SelectedValueExist(ObjCliente.DtResultados.Rows(0)("CveFormaPago33").ToString())
txtLg.Text = ObjCliente.DtResultados.Rows(0)("LG").ToString()
@@ -5647,7 +5643,7 @@ Partial Class Clientes
TempDTSucursales.Columns.Add("CveAlmacenAsignado", Type.GetType("System.Int32"))
TempDTSucursales.Columns.Add("CveUsoCFDI", Type.GetType("System.Int32"))
TempDTSucursales.Columns.Add("CveFormaPago33", Type.GetType("System.Int32"))
TempDTSucursales.Columns.Add("CveMetodoPago33", Type.GetType("System.Int32"))
TempDTSucursales.Columns.Add("CveMetodoPago", Type.GetType("System.Int32"))
TempDTSucursales.Columns.Add("Correo", Type.GetType("System.String"))
TempDTSucursales.Columns.Add("CorreoCotizacion", Type.GetType("System.String"))
TempDTSucursales.Columns.Add("LimiteCredito", Type.GetType("System.Decimal"))
@@ -5688,7 +5684,7 @@ Partial Class Clientes
RowSucursal("CveUsoCFDI") = DdlSucursalUsoCFDI.SelectedValue.ToEntero()
RowSucursal("CveFormaPago33") = DdlSucursalFormaPago33.SelectedValue.ToEntero()
RowSucursal("CveMetodoPago33") = DdlSucursalMetodoPago33.SelectedValue.ToEntero()
RowSucursal("CveMetodoPago") = DdlSucursalMetodoPago33.SelectedValue.ToEntero()
RowSucursal("LimiteCredito") = TxtLimiteCreditoSucursal.Text.ToDecimal
RowSucursal("CveResponsableCobranza") = DdlResponsableSucursal.SelectedValue.ToEntero
@@ -5742,7 +5738,7 @@ Partial Class Clientes
Cuerpo = Cuerpo.Replace("{""NombreEmpresa""}", UsuarioActual.Empresa.Empresa)
Cuerpo = Cuerpo.Replace("{""NombreCliente""}", LtlCliente.Text.Trim)
Cuerpo = Cuerpo.Replace("{""TipoDocumento""}", TipoComprobante)
Cuerpo = Cuerpo.Replace("{""FolioFactura""}", HdnSerieFolio2.Value.ToString())
Cuerpo = Cuerpo.Replace("{""SerieFolio""}", HdnSerieFolio2.Value.ToString())
If Dr IsNot Nothing Then
Cuerpo = Cuerpo.Replace("{""FechaFactura""}", Dr("Fecha").ToString().ToDate().ToShortDateString())
Cuerpo = Cuerpo.Replace("{""ImporteFactura""}", Dr("Total").ToString().FormatoNumero())
@@ -5760,7 +5756,7 @@ Partial Class Clientes
Asunto = Asunto.Replace("{""NombreEmpresa""}", UsuarioActual.Empresa.Empresa)
Asunto = Asunto.Replace("{""NombreCliente""}", LtlCliente.Text.Trim)
Asunto = Asunto.Replace("{""TipoDocumento""}", TipoComprobante)
Asunto = Asunto.Replace("{""FolioFactura""}", HdnSerieFolio2.Value.ToString())
Cuerpo = Cuerpo.Replace("{""SerieFolio""}", HdnSerieFolio2.Value.ToString())
If Dr IsNot Nothing Then
Asunto = Asunto.Replace("{""FechaFactura""}", Dr("Fecha").ToString().ToDate().ToShortDateString())
Asunto = Asunto.Replace("{""ImporteFactura""}", Dr("Total").ToString().FormatoNumero())
@@ -5780,7 +5776,7 @@ Partial Class Clientes
Cuerpo = Cuerpo.Replace("{""NombreEmpresa""}", UsuarioActual.Empresa.Empresa)
Cuerpo = Cuerpo.Replace("{""NombreCliente""}", LtlCliente.Text.Trim)
Cuerpo = Cuerpo.Replace("{""TipoDocumento""}", TipoComprobante)
Cuerpo = Cuerpo.Replace("{""FolioFactura""}", HdnSerieFolio2.Value.ToString())
Cuerpo = Cuerpo.Replace("{""SerieFolio""}", HdnSerieFolio2.Value.ToString())
If Dr IsNot Nothing Then
Cuerpo = Cuerpo.Replace("{""FechaFactura""}", Dr("Fecha").ToString().ToDate().ToShortDateString())
Cuerpo = Cuerpo.Replace("{""ImporteFactura""}", Dr("Total").ToString().FormatoNumero())
@@ -5793,13 +5789,12 @@ Partial Class Clientes
End If
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""}", LtlCliente.Text.Trim)
Asunto = Asunto.Replace("{""TipoDocumento""}", TipoComprobante)
Asunto = Asunto.Replace("{""FolioFactura""}", HdnSerieFolio2.Value.ToString())
Asunto = Asunto.Replace("{""SerieFolio""}", HdnSerieFolio2.Value.ToString())
If Dr IsNot Nothing Then
Asunto = Asunto.Replace("{""FechaFactura""}", Dr("Fecha").ToString().ToDate().ToShortDateString())
Asunto = Asunto.Replace("{""ImporteFactura""}", Dr("Total").ToString().FormatoNumero())
@@ -8087,7 +8082,7 @@ Partial Class Clientes
#Region " DEVOLVER DINERO ANT/NC "
Private Sub InicializaDevolverDinero()
If UsuarioActual.TienePermisoProceso(247) Then
GVAnticipos.Columns(6).Visible = True
GVAnticipos.Columns(7).Visible = True
End If
End Sub
#End Region
@@ -10778,6 +10773,7 @@ Partial Class Clientes
TxtDevRedondeo.Text = ""
DdlCuentaDeposito.DataSource = GlobalDTCuentasDepositosClientes(UsuarioActual.CveEmpresa, CveCliente:=CveCliente)
DdlCuentaDeposito.DataBind()
GVAnticipos.Columns(7).Visible = True
'Dim Dep As New ClsGenerales
'If Dep.GetCuentasDepositos(CveCliente:=CveCliente, CveEmpresa:=UsuarioActual.CveEmpresa) Then
' DdlCuentaDeposito.DataSource = Dep.DtResultados

View File

@@ -205,10 +205,14 @@
</div>
<div class="row" id="divAnticipo" runat="server" visible="false">
<div class="col-md-2">Anticipo:</div>
<div class="col-md-3">
<div class="col-md-2">
<asp:TextBox ID="TxtAnticipo" runat="server" Width="100px" ClientIDMode="Static" />
</div>
<div class="col-md-2" runat="server" id="Div3" visible="false"></div>
<div class="col-md-1" runat="server" id="DivAntSubProyectoTexto" visible="false">Sucursal:</div>
<div class="col-md-2" runat="server" id="DivAntSubProyecto" visible="false">
<asp:DropDownList runat="server" ID="DdlSubProyectos" CssClass="form-control input-sm select2me" DataValueField="CveSubProyecto" DataTextField="SubProyecto" Class="table-group-action-input form-control input-inline input-small input-sm">
</asp:DropDownList>
</div>
<div class="col-md-3" runat="server" id="Div4" visible="false">
</div>
</div>
@@ -831,7 +835,7 @@
var chkPesosBancos = $get("ChkPagarPesos");
var chkDolaresBancos = $get("ChkPagarDolares");
debugger;
if (t.checked) {
txt.value = FormatoNumero(importe, 2);
@@ -853,8 +857,15 @@
}
}
function SumaValores(pagoMultiple, monedaPago) {
function FnRecalcula(pagoMultiple,monedaPago)
{
var Suma = SumaValores(pagoMultiple, monedaPago);
$get('TxtImporte').value = FormatoNumero(Suma, 2);
$('#LtlTotalMXN').text(FormatoNumero(Suma, 2))
}
function SumaValores(pagoMultiple, monedaPago) {
var Importe = 0;
var Comision = 0.00;
var topLevelElem = document.getElementById("form1");
@@ -945,7 +956,7 @@
$get('TxtAnticipo').value = 0.00
}
else {
Importe = Importe + ToDouble($get('TxtAnticipo').value);
Importe = Importe + ToDouble($get('TxtAnticipo').value);
}
}
if ($get('TxtPrestamoImporte') != null) {

View File

@@ -4,6 +4,7 @@
Imports System.Data
Imports ADSTimbrado
Imports Extensiones
Imports Org.BouncyCastle.Ocsp
Partial Class Ventas_ClientesAbonar
Inherits ClsPaginas
@@ -343,6 +344,13 @@ Partial Class Ventas_ClientesAbonar
DtPrestamos = CargaPrestamos(1)
End If
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then 'GDIaz
divAnticipo.Visible = True
TxtAnticipo.Attributes.Add("onKeyUp", "FnRecalcula(0,1);")
DivAntSubProyecto.Visible = True
DivAntSubProyectoTexto.visible = True
CargarCentrosDeCosto(Nothing, DdlSubProyectos, Nothing, Nothing, AplicaTodos:="")
End If
CargaDatos(tCveMoneda)
Else
Alert("El Cliente Solicitado no existe, por favor revise su búsqueda.", TipoMensaje.MsgAdvertencia)
@@ -758,7 +766,8 @@ Partial Class Ventas_ClientesAbonar
Dim MsgError As String = ""
Dim NCGeneradas As New List(Of RespuestaNotaCredrito)
Dim ListaFacturasGenerarNC As New List(Of Modelos.Factura)
Dim ObjFacturaAnt As Modelos.Factura = Nothing
Dim RespAnt As Modelos.Factura.MMensajeFactura = Nothing
Dim ImporteSeleccionado As Decimal = 0
'02-05-2018 MANDAMOS CANCELAR EL COMPLEMENTO A SUSTITUIR
@@ -1176,12 +1185,79 @@ Partial Class Ventas_ClientesAbonar
End If
End If
If UsuarioActual.Empresa.Funcionalidad(382) = "1" AndAlso TxtAnticipo.Text.ToDecimal > 0 AndAlso MsgError = "" Then '' si es empresa GDiaz
'generar un anticipo y registrarle el pago.
Dim tCveMoneda As Integer = 1
Dim tCveFormaPago As Integer = GlobalDTTipoTransacciones().FiltroPrimeroValor("CveFormaPago", $"CveTipoTransaccion={DdlTipoTransaccion.SelectedValue}").ToEntero
Dim tCvePS As Integer
Dim tCveUM As Integer = 0
Dim tCveSub As Integer = DdlSubProyectos.SelectedValue.ToEntero
ObjFacturaAnt = Modelos.Factura.CrearVentaNueva(UsuarioActual, tCveSub, CveCliente, tCveMoneda, "Ant")
ObjFacturaAnt.CveMoneda = tCveMoneda
ObjFacturaAnt.CveFormaPago = tCveFormaPago
ObjFacturaAnt.CveMetodoPago = 1
ObjFacturaAnt.ClaveMetodoPagoSAT = "PUE"
ObjFacturaAnt.ClaveFormaPagoSAT = GlobalDTVtaFormaPago.FiltroPrimeroValor("ClaveFormaPagoSAT", $"CveFormaPago = {ObjFacturaAnt.CveFormaPago}")
ObjFacturaAnt.ClaveUsoCFDISAT = GlobalDTSATUsosCFDI.FiltroPrimeroValor("UsoCFDI", $"CveUsoCFDI = {ObjFacturaAnt.CveUsoCFDI}")
Dim drPS As DataRow = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CodigoSATPS:="84111506").FiltroPrimero("PSCodigo LIKE '%ANTICIPO%' OR PSCodigo LIKE '%anticipo%' OR PSCodigo LIKE '%Anticipo%'")
Dim tPorIVA As Decimal = GlobalDTSubProyectos(UsuarioActual.CveEmpresa, CveSubProyecto:=tCveSub).FiltroPrimeroValor("IVA").ToDecimal
Dim tPU As Decimal = (TxtAnticipo.Text.ToDecimal / (1 + tPorIVA)).RoundSQL(6)
If drPS IsNot Nothing Then
tCvePS = drPS("CvePS").ToString.ToEntero
tCveUM = drPS("CveUnidadMedida").ToString.ToEntero
End If
ObjFacturaAnt.AgregarPS(tCvePS, 1, tPU, 0, "", CveUM:=tCveUM, CveSubProyecto:=tCveSub, PorcentajeIVA:=tPorIVA)
ObjFacturaAnt.CalculaTotales()
RespAnt = ObjFacturaAnt.EmitirFactura(False, Transac:=ObjMov.IniciaTransacSQL(), Modulo:="Ventas/ClientesAbonarAnt", MostrarURL:=True)
RespAnt.Factura = ObjFacturaAnt
If RespAnt IsNot Nothing AndAlso RespAnt.Factura IsNot Nothing Then
Dim VentaActual As New Venta(UsuarioActual)
VentaActual.CveVenta = RespAnt.Factura.CveVenta
VentaActual.Fecha = RespAnt.Factura.Fecha
VentaActual.CveCliente = CveCliente
VentaActual.CveMoneda = tCveMoneda
VentaActual.TipoDocto = "Ant"
VentaActual.SerieFolio = RespAnt.Factura.SerieFolio
VentaActual.ClienteNombre = NombreComercial
VentaActual.TC = 1
VentaActual.Total = TxtAnticipo.Text.ToDecimal
VentaActual.IVA = (tPorIVA * tPU).RoundSQL(2)
VentaActual.PorcentajeIVA = tPorIVA
VentaActual.CveSubProyecto = tCveSub
'Importe de pago
Dim Pago As New VentaPago
Pago.TipoPago = "XXX"
Pago.Fecha = TxtFechaDocumento.Text.ToDate
Pago.CveIE = CveIE
Pago.CveMonedaPago = tCveMoneda
Pago.ImportePago = TxtAnticipo.Text.ToDecimal
Pago.ImportePagoVenta = TxtAnticipo.Text.ToDecimal
Pago.Referencia = TxtFolio.Text
Pago.TipoPago = "XXX"
'If RblTipoPago.SelectedValue = "3" Then
' Pago.TipoPago = "I"
' Pago.FechaDocumentoRelacionado = FechaIngreso
' Pago.CveClientePago = CveCliente
'End If
'MsgError = RespAnt.Mensajes.ToString
If MsgError = "" AndAlso AplicaPrePolizaPagoVenta(VentaActual, Pago, CvePrePoliza, ObjMov) Then
MsgError = "No se pudo insertar la póliza"
End If
End If
End If
If MsgError = "" AndAlso Not ObjMov.ValidacionesPrePoliza(CvePrePoliza, UsuarioActual, Opcion:=3) Then
MsgError = ObjMov.MensajePolizaDescuadre & " La diferencia es de: " & ObjMov.ValorDiferencia
'If ObjMov.ValorPolizaDescuadre > 0 Then
' MsgError = ObjMov.MensajePolizaDescuadre & " La diferencia es de: " & ObjMov.ValorDiferencia
'End If
End If
Else
MsgError = "No se pudo insertar la póliza"
End If
@@ -1326,6 +1402,25 @@ Partial Class Ventas_ClientesAbonar
End If
Next
If ObjFacturaAnt IsNot Nothing Then
Dim MsgTimbrado As String = ""
Try
ObjFacturaAnt.PreparaTimbre()
MsgTimbrado = TimbrarFactura(ObjFacturaAnt, True)
StrMsg.AppendFormat("<br/><br/>Anticipo generado correctamente.<br/> Folio: <a href='/Ventas/Ventas.aspx?CveVenta={0}' target='_blank' class='Texto'>{1}</a><br/>", ObjFacturaAnt.CveVenta, ObjFacturaAnt.SerieFolio)
If Not String.IsNullOrEmpty(MsgTimbrado) Then
Dim StrEr As String = $"<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>"
StrMsg.AppendFormat("<br/>{0}<br/>", StrEr)
End If
Catch ex As Exception
GuardaLogAD(ex.ToString())
StrMsg.AppendFormat("<br/>{0}<br/>", MsgTimbrado)
End Try
End If
If ChkComplementoPago.Checked Then
Dim TextoComplementoPago As String = EmitirComplementoPago(CveIE, CveVentasPago, SeriesPago)
StrMsg.AppendFormat("<br/><br/>{0}", TextoComplementoPago)
@@ -1352,6 +1447,26 @@ Partial Class Ventas_ClientesAbonar
End Sub
Private Function TimbrarFactura(ByRef ObjFactura As Modelos.Factura, ByRef SeTimbro As Boolean) As String
Dim MsgErrorTimbrado As String = ""
Dim ObjTimbrado As New Timbrado
Try
SeTimbro = ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura)
Dim FolioFiscalFactura As String = ObjTimbrado.UUID
MsgErrorTimbrado = ObjTimbrado.MensajeErrorCFDI
ObjTimbrado = Nothing
Catch ex As Exception
OnError("Ocurrió un error al generar el timbrado", ex)
End Try
If Not String.IsNullOrEmpty(MsgErrorTimbrado) Then
GuardaLogAD(MsgErrorTimbrado, Archivo:="LogTimbrado")
End If
Return MsgErrorTimbrado
End Function
Private Function RegistraAmortizacionAnticipo(ByRef ObjMov As ClsContabilidad, CvePrePoliza As Integer, CveIE As Integer, Importe As Decimal, tipoCambioPago As Decimal, CveVenta As Integer, ReferenciaVenta As String, ReferenciaPago As String) As String
Dim MsgError As String = ""
If CveMonedaPago = 2 Then

View File

@@ -2681,11 +2681,11 @@ Partial Class PV
CveMetodoPagoCliente = ObjCliente.DtResultados.Rows(0)("CveMetodoPago").ToString.ToEntero
DdlUsoCFDI.SelectedValueExist(ObjCliente.CveUsoCFDI.ToString)
'DdlMetodoPago.SelectedValueExist(ObjCliente.CveMetodoPago.ToString)
DdlMetodoPago33.SelectedValueExist(ObjCliente.CveMetodoPago33.ToString)
DdlMetodoPago33.SelectedValueExist(ObjCliente.CveMetodoPago.ToString)
'DdlMetodoPago33.SelectedValueExist(ObjCliente.DtResultados.Rows(0)("CveMetodoPago33").ToString)
DdlMetodoPago33_SelectedIndexChanged(DdlMetodoPago33, EventArgs.Empty)
DdlFormaPago33.SelectedValueExist(ObjCliente.CveFormaPago33.ToString)
DdlFormaPago33.SelectedValueExist(ObjCliente.CveFormaPago.ToString)
'DdlFormaPago33.SelectedValueExist(ObjCliente.DtResultados.Rows(0)("CveFormaPago33").ToString)
DdlUsoCFDI.SelectedValueExist(ObjCliente.DtResultados.Rows(0)("CveUsoCFDI").ToString)
'SI ES RFC GENERICO NO TIENE OBLIGACIONES FISCALES
@@ -2906,8 +2906,8 @@ Partial Class PV
'CveMetodoPagoCliente = ObjCliente.CveMetodoPago
DdlMetodoPago.SelectedValueExist(CveMetodoPagoCliente.ToString)
DdlFormaPago33.SelectedValueExist(ObjCliente.CveFormaPago33)
DdlMetodoPago33.SelectedValueExist(ObjCliente.CveMetodoPago33)
DdlFormaPago33.SelectedValueExist(ObjCliente.CveFormaPago)
DdlMetodoPago33.SelectedValueExist(ObjCliente.CveMetodoPago)
DdlUsoCFDI.SelectedValueExist(ObjCliente.CveUsoCFDI)
'SI ES RFC GENERICO NO TIENE OBLIGACIONES FISCALES
If LblRFC.Text.Contiene("XAXX010101000", "XEXX010101000") Then

View File

@@ -1139,7 +1139,7 @@ Partial Class Ventas_PVCobranza
For Each Dr As DataRow In ObjFactura.DtRemisionesPS.Rows
ObjFactura.AgregarPS(Dr("CvePS").ToString().ToEntero(), Dr("Cantidad").ToString().ToDecimal(), Dr("PU").ToString().ToDecimal(), Dr("Descuento").ToString().ToDecimal, Dr("Obs").ToString(), CveUM:=Dr("CveUM").ToString().ToEntero(),
CveProyecto:=Dr("CveProyecto").ToString().ToEntero(), CveSubProyecto:=Dr("CveSubProyecto").ToString().ToEntero(), CveVentaDetallePadre:=Dr("CveVentaDetalle").ToString().ToEntero(), CveVentaDetalleRemision:=Dr("CveVentaDetalle").ToString().ToEntero(),
PorcentajeIVA:=Dr("PorcentajeIVA").ToString().ToDecimal())
PorcentajeIVA:=Dr("PorcentajeIVA").ToString().ToDecimal(), CvePromocionDetalle:=Dr("CvePromocionDetalle").ToString.ToEntero)
Next
If Not ValidateString(ObservacionesAlmacen.ToLower(), "parcial") Then
@@ -1148,14 +1148,12 @@ Partial Class Ventas_PVCobranza
ObjFactura.CveAlmacen = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $"CveTipoAlmacen = 1 AND CveSubProyecto = {VentaRemision.CveSubProyecto}", "Orden").ToString().ToEntero()
End If
ObjFactura.CalculaTotales()
ObjFactura.PreparaTimbre()
If HdnTipoAmortizacion.Value = "4" Then
DtAnticipos.Columns.Add("CveVenta", GetType(Integer))
DtAnticipos.Columns.Add("Importe", GetType(Decimal))
DtAnticipos.Columns.Add("CveConceptoContable", GetType(Integer))