This commit is contained in:
2020-09-22 16:05:35 -07:00
73 changed files with 4062 additions and 2128 deletions

View File

@@ -169,17 +169,8 @@
<asp:HyperLink ID="HplReferencia" Target="_blank" CssClass="Texto" runat="server" Text='<%# Eval("Referencia")%>' ></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Cargo" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label runat="server" ID="LblCargo" Text='<%# Eval("Cargo", "{0:N2}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Abono" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label runat="server" ID="LblAbono" Text='<%# Eval("Abono", "{0:N2}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="Cargo" DataField="Cargo" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right"/>
<asp:BoundField HeaderText="Abono" DataField="Abono" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right"/>
<asp:TemplateField HeaderText="Moneda">
<ItemTemplate>
<asp:Label runat="server" ID="LblMoneda" Text='<%# Eval("Abreviatura") %>'></asp:Label>

View File

@@ -100,93 +100,7 @@ Partial Class Ventas_AuxiliarCliente
Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control)
End Sub
Public Sub ExportToExcelGTest(Gv As GridView, NombreArchivoXLSx As String, Optional Titulo As String = "Reporte", Optional Usuario As Usuario = Nothing)
Dim sw As New StringWriter()
Dim htw As New HtmlTextWriter(sw)
Gv.RenderControl(htw)
GemBox.Spreadsheet.SpreadsheetInfo.SetLicense("ESWN-4QFD-26JF-1SZ8")
Dim excel As GemBox.Spreadsheet.ExcelFile
Dim options = GemBox.Spreadsheet.LoadOptions.HtmlDefault
Using htmlStream = New MemoryStream(options.Encoding.GetBytes(sw.ToString()))
excel = GemBox.Spreadsheet.ExcelFile.Load(htmlStream, options)
If Usuario IsNot Nothing Then
Dim worksheet = excel.Worksheets(0)
Dim num As Integer = worksheet.Rows.Count
If num > 128 Then num = 128
Dim columnCount = worksheet.CalculateMaxUsedColumns()
'If columnCount > 1 Then
' For i As Integer = 1 To columnCount - 1
' worksheet.Columns(i).AutoFit(1, worksheet.Rows(1), worksheet.Rows(num - 1))
' Next
'End If
worksheet.Rows.InsertEmpty(0, 7)
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", Usuario.Empresa.Ruta))
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", HttpContext.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port, Usuario.CveEmpresa)
If Imagen.Exists Then
worksheet.Pictures.Add(logouri.ToString(), "A1", "B4")
End If
Dim celdasConTexto = worksheet.GetUsedCellRange(True)
celdasConTexto.Style.Font.Name = "Calibri Light"
Dim RangoNombreEmpresa = worksheet.Cells.GetSubrangeAbsolute(1, celdasConTexto.FirstColumnIndex, 1, celdasConTexto.LastColumnIndex)
RangoNombreEmpresa.Merged = True
RangoNombreEmpresa.Value = Usuario.Empresa.Empresa
RangoNombreEmpresa.Style.Font.Size = 18 * 20
RangoNombreEmpresa.Style.Font.Name = "Calibri Light"
RangoNombreEmpresa.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center
RangoNombreEmpresa.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
Dim RangoTitulo = worksheet.Cells.GetSubrangeAbsolute(3, celdasConTexto.FirstColumnIndex, 3, celdasConTexto.LastColumnIndex)
RangoTitulo.Merged = True
RangoTitulo.Value = Titulo
RangoTitulo.Style.Font.Size = 20 * 20
RangoTitulo.Style.Font.Name = "Calibri Light"
RangoTitulo.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center
RangoTitulo.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
Dim FiltroCliente = worksheet.Cells.GetSubrangeAbsolute(5, celdasConTexto.FirstColumnIndex, 5, celdasConTexto.LastColumnIndex)
FiltroCliente.Merged = True
FiltroCliente.Value = String.Format("Cliente: {0} Fecha Inicio: {1} Fecha Fin: {2} Opción: {3}", DdlClientes.SelectedText, txtFechaI.Text, txtFechaF.Text, DdlOpcion.SelectedItem.Text)
FiltroCliente.Style.Font.Size = 12 * 20
FiltroCliente.Style.Font.Name = "Calibri Light"
FiltroCliente.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Left
FiltroCliente.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
For i = celdasConTexto.FirstColumnIndex To celdasConTexto.LastColumnIndex
worksheet.Rows(7).Cells(i).Style.Font.Size = 12 * 20
worksheet.Rows(7).Cells(i).Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center
worksheet.Rows(7).Cells(i).Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
worksheet.Rows(7).Cells(i).Style.FillPattern.SetPattern(GemBox.Spreadsheet.FillPatternStyle.Solid, GemBox.Spreadsheet.SpreadsheetColor.FromArgb(75, 119, 190), GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255))
worksheet.Rows(7).Cells(i).Style.Font.Color = GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255)
'If i > 0 Then
' Try
' worksheet.Columns(i).AutoFit(1)
' Catch ex As Exception
' End Try
'End If
Next
Dim IndexEndTable As Integer = Gv.Rows.Count + 9
worksheet.Rows(IndexEndTable).Cells(0).Value = "Usuario Imprimió:"
worksheet.Rows(IndexEndTable + 1).Cells(0).Value = Usuario.Nombre
worksheet.Rows(IndexEndTable).Cells(4).Value = "Fecha Impresión: "
worksheet.Rows(IndexEndTable + 1).Cells(4).Value = DateTime.Now.ToString()
worksheet.Rows(IndexEndTable).Cells(8).Value = "Impreso en SIG"
End If
End Using
htw.Dispose()
excel.Save(HttpContext.Current.Response, NombreArchivoXLSx)
ExportToExcelGembox(Gv, NombreArchivoXLSx, Usuario, txtFechaI.Text, txtFechaF.Text, Titulo, "", 1)
End Sub
Protected Sub GvAuxCliente_RowDataBound(sender As Object, e As GridViewRowEventArgs)

View File

@@ -2396,6 +2396,54 @@
</div>
</div>
</div>
<div class="portlet light xspadding bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Pagos no bancarios</span>
</div>
<div class="actions">
<div class="btn-group">
<asp:UpdatePanel UpdateMode="Conditional" runat="server" ID="UpdatePanel10">
<ContentTemplate>
<asp:LinkButton ID="LnkPagosNoBancariosPDF" 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="LnkPagosNoBancariosExcel" 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="LnkPagosNoBancariosPDF" />
<asp:PostBackTrigger ControlID="LnkPagosNoBancariosExcel" />
</Triggers>
</asp:UpdatePanel>
</div>
</div>
</div>
<div class="portlet-body">
<div class="row col-md-12" align="right">
<input type="text" id="TxtBusquedaPagosNoBancarios" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaPagosNoBancarios','{0}')", GvPagosNoBancarios.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaPagosNoBancarios','{0}')", GvPagosNoBancarios.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<div class="table-scrollable">
<asp:GridView ID="GvPagosNoBancarios" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron pagos no bancarios" Width="50%"
CssClass="table table-striped table-advance table-hover ScrollAD" data-sort="false" BorderWidth="1" BorderColor="#D3D3D3" GridLines="None" DataKeyNames="CvePrePoliza,CveCompra,CveVenta,CvePersonal,ImporteMN,VentaSerieFolio,CompraSerieFolio,NombreCompleto,FechaIng,Abreviatura">
<Columns>
<asp:BoundField HeaderText="Nombre Completo" DataField="NombreCompleto"/>
<asp:BoundField HeaderText="Fecha" DataField="FechaIng" DataFormatString="{0:dd/MM/yyyy}"/>
<asp:HyperLinkField HeaderText="Venta Serie Folio" DataTextField="VentaSerieFolio" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}"/>
<asp:HyperLinkField HeaderText="Compra Serie Folio" DataTextField="CompraSerieFolio" DataNavigateUrlFields="CveCompra" DataNavigateUrlFormatString="/Compras/Compras.aspx?CveCompra={0}"/>
<asp:TemplateField HeaderText="Importe" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Literal ID="LtlImp" runat="server" Text='<%# Eval("ImporteMN", "{0:N2}")%>'></asp:Literal>
<asp:Literal ID="LtlMon" runat="server" Text='<%# Eval("Abreviatura")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</div>
</ContentTemplate>
</ajax:TabPanel>

File diff suppressed because it is too large Load Diff

View File

@@ -2662,12 +2662,17 @@ Partial Class Ventas_ClientesAbonar
If tCveMoneda = 2 Then
Dim ImporteFluctuacion As Decimal = 0
ImporteFluctuacion = Saldo * (TCPago - TCVenta)
If CveSubProyecto <= 0 Then
MsgError = $"No se pudo obtener el sub proyecto de la venta {gr.DataKey("SerieFolio").ToString}"
End If
If TCPago > TCVenta Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Math.Abs(ImporteFluctuacion), gr.DataKey("SerieFolio").ToString, 64, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=UsuarioActual.Empresa.IdCuentaGananciaCambiaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=Math.Abs(ImporteFluctuacion), CveCuenta:=CveCuenta, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Math.Abs(ImporteFluctuacion), gr.DataKey("SerieFolio").ToString, 64, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=UsuarioActual.Empresa.IdCuentaGananciaCambiaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=Math.Abs(ImporteFluctuacion), CveCuenta:=CveCuenta, TipoCambio:=TCVenta, TipoCambioPago:=TCPago, CveSubProyecto:=CveSubProyecto) Then
MsgError = "Ocurrio un error al saldar el movimiento"
End If
Else
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Math.Abs(ImporteFluctuacion), gr.DataKey("SerieFolio").ToString, 65, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=UsuarioActual.Empresa.IdCuentaPerdidaCambiaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=Math.Abs(ImporteFluctuacion), CveCuenta:=CveCuenta, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Math.Abs(ImporteFluctuacion), gr.DataKey("SerieFolio").ToString, 65, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=UsuarioActual.Empresa.IdCuentaPerdidaCambiaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=Math.Abs(ImporteFluctuacion), CveCuenta:=CveCuenta, TipoCambio:=TCVenta, TipoCambioPago:=TCPago, CveSubProyecto:=CveSubProyecto) Then
MsgError = "Ocurrio un error al saldar el movimiento"
End If
End If

View File

@@ -137,12 +137,12 @@
<asp:HyperLink ID="HypSAT" runat="server"><%# Eval("CFDISAT")%></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Sin Encontrar SAT">
<asp:TemplateField HeaderText="Sin encontrar SAT">
<ItemTemplate>
<asp:HyperLink ID="HypSIGnoSAT" runat="server"><%# Eval("CFDISIGSinSAT")%></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Sin Encontrar SIG">
<asp:TemplateField HeaderText="Sin encontrar SIG">
<ItemTemplate>
<asp:HyperLink ID="HypSatnoSIG" runat="server"><%# Eval("CFDISATSinSIG")%></asp:HyperLink>
</ItemTemplate>

View File

@@ -119,7 +119,7 @@ Partial Class Ventas_RepRecuperacion
End If
If ObjMovtos.GetRepRecuperacion(txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, DdlClientes.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, DdlUsuario.SelectedValue.ToEntero, -1,
"-1", UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero, DdlResponsable.SelectedValue.ToEntero, DdlTipoDocto.SelectedValue.ToString, CveBanco:=DdlBanco.SelectedValue.ToEntero,
"-1", UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero, DdlResponsable.SelectedValue.ToEntero, DdlTipoDocto.SelectedValue.ToString, CveBanco:=DdlBanco.SelectedValue.ToEntero, CveCuenta:=DdlCuentaBancaria.SelectedValue.ToEntero,
EstatusCliente:=DdlEstatusCliente.SelectedValue.ToEntero, CveUsuarioConsulta:=UsuarioActual.CveUsuario, TipoCambio:=RblTipoCambio.SelectedValue.ToEntero, TCEspecifico:=TCEspecifico, CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero) Then
GvDatos.DataSource = ObjMovtos.DtResultados
DtDatos = ObjMovtos.DtResultados

View File

@@ -239,7 +239,7 @@
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" runat="server" style="text-align: left">Solicitar Descarga SAT</h4>
<h4 class="modal-title" runat="server" style="text-align: left">Solicitar descarga SAT</h4>
</div>
<div class="modal-body">

View File

@@ -21048,7 +21048,7 @@ Partial Class Ventas
If CveMovimientoEntradaGeneral > 0 Then
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalidaConsignacion, UsuarioActual.CveEmpresa) Then
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaGeneral, Dr("Cantidad").ToString().ToDouble, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), Dr("PU").ToString().ToDecimal, CveAF:=Dr("CveAF").ToString().ToEntero(), CveSeccionAlmacen:=Dr("CveSeccionAlmacen").ToString().ToEntero(), Serie:=Dr("Serie").ToString(), Lote:=Dr("Lote").ToString(), CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString().ToEntero(), CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero()) Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaGeneral, Dr("Cantidad").ToString().ToDouble, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), Dr("PU").ToString().ToDecimal, CveAF:=Dr("CveAF").ToString().ToEntero(), CveSeccionAlmacen:=-3, Serie:=Dr("Serie").ToString(), Lote:=Dr("Lote").ToString(), CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString().ToEntero(), CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero()) Then
Return False
End If
Next
@@ -22843,12 +22843,55 @@ Partial Class Ventas
'codigo para ajuste de centavo, si el importe total no cuadra con los totales
Dim difTmp As Decimal = Importe - importeNC
'el ajuste procede si no tiene iva,ni ieps, con iva sin ieps,
If Math.Abs(difTmp) > 0.00D Then
'asusto la diferencia en el último concepto
Dim ImporteAjustado As Decimal = DtImpuestosLocal.Rows(DtImpuestosLocal.Rows.Count - 1)("ImporteTotal").ToString().ToDecimal + difTmp
DtImpuestosLocal.Rows(DtImpuestosLocal.Rows.Count - 1)("ImporteTotal") = ImporteAjustado
DtImpuestosLocal.Rows(DtImpuestosLocal.Rows.Count - 1)("ImportePU") = ImporteAjustado
'filtro si hay renglon sin impuestos.
Dim drDIF As DataRow() = DtImpuestosLocal.Select("ImporteIVA = 0 AND ImporteIEPS = 0")
If drDIF IsNot Nothing AndAlso drDIF.Length > 0 Then
Dim ImporteAjustado0 As Decimal = drDIF(0)("ImporteTotal").ToString().ToDecimal + difTmp
drDIF(0)("ImporteTotal") = ImporteAjustado0
drDIF(0)("ImportePU") = ImporteAjustado0
Else
'filtro si hay renglon sin impuestos.
Dim drDIF2 As DataRow() = DtImpuestosLocal.Select("ImporteIVA > 0 AND ImporteIEPS = 0")
If drDIF2 IsNot Nothing AndAlso drDIF2.Length > 0 Then
Dim PorIVA As Decimal = drDIF2(0)("PorcentajeIVA").ToString().ToDecimal
Dim ImporteAjustado1 As Decimal = drDIF2(0)("ImporteTotal").ToString().ToDecimal + (difTmp / (1 + PorIVA)) 'saco el PU sin iva
drDIF2(0)("ImportePU") = ImporteAjustado1
drDIF2(0)("ImporteTotal") = ImporteAjustado1
drDIF2(0)("ImporteIVA") = (ImporteAjustado1) * drDIF2(0)("PorcentajeIVA").ToString().ToDecimal
Else
' ajustar cuando tiene ieps y no iva
Dim drDIF3 As DataRow() = DtImpuestosLocal.Select("ImporteIVA = 0 AND ImporteIEPS > 0")
If drDIF3 IsNot Nothing AndAlso drDIF3.Length > 0 Then
Dim PorIEPS As Decimal = drDIF3(0)("PorcentajeIEPS").ToString().ToDecimal
Dim ImporteAjustado1 As Decimal = drDIF3(0)("ImporteTotal").ToString().ToDecimal + (difTmp / (1 + PorIEPS)) 'saco el PU sin iva
drDIF3(0)("ImportePU") = ImporteAjustado1
drDIF3(0)("ImporteTotal") = ImporteAjustado1
drDIF3(0)("ImporteIEPS") = (ImporteAjustado1) * drDIF3(0)("PorcentajeIEPS").ToString().ToDecimal
Else
' ajustar cuando tiene ieps e iva
Dim drDIF4 As DataRow() = DtImpuestosLocal.Select("ImporteIVA > 0 AND ImporteIEPS > 0")
If drDIF4 IsNot Nothing AndAlso drDIF4.Length > 0 Then
Dim PorIEPS As Decimal = drDIF4(0)("PorcentajeIEPS").ToString().ToDecimal
Dim PorIVA As Decimal = drDIF4(0)("PorcentajeIVA").ToString().ToDecimal
Dim ImporteAntesIVA As Decimal = (difTmp / (1 + PorIVA))
Dim ImporteAjustado1 As Decimal = drDIF4(0)("ImporteTotal").ToString().ToDecimal + +(ImporteAntesIVA / (1 + PorIEPS)) 'saco el PU sin iva
drDIF4(0)("ImportePU") = ImporteAjustado1
drDIF4(0)("ImporteTotal") = ImporteAjustado1
drDIF4(0)("ImporteIEPS") = (ImporteAjustado1) * drDIF4(0)("PorcentajeIEPS").ToString().ToDecimal
drDIF4(0)("ImporteIVA") = (ImporteAjustado1 + drDIF4(0)("ImporteIEPS").ToString.ToDecimal) * drDIF4(0)("PorcentajeIVA").ToString().ToDecimal
End If
End If
End If
End If
End If
If Not NCDescuento Then