Solicitudes Ingreso ajustes, OC num remision, rep ventas detalle

This commit is contained in:
rakcsle
2022-08-02 09:33:47 -07:00
parent 35be01025e
commit d6a349e5e2
7 changed files with 693 additions and 457 deletions

View File

@@ -3259,6 +3259,68 @@ Public Class ClsNominas
retorno = RunQuery("Ocurrió un error al agregar el SolicitudesNominas.")
Return retorno
End Function
Public Function SolicitudesAdd2(CveSolicitudCFDI As Integer, CveSolicitudMetadata As Integer, estatus As Integer, observaciones As String, fechaInicio As DateTime, fechaFin As DateTime, cveUsuarioIng As Int32, cveEmpresa As Int32, Optional CveTipoSolicitud As Integer = 1) As Integer
Dim CveSolictudAgregada As Integer = -1
Try
DataAdapter("PA_Gral_SAT_SolicitudesAdd2", CommandType.StoredProcedure)
addParameters("@CveSolicitudCFDI", SqlDbType.Int, CveSolicitudCFDI)
addParameters("@CveSolicitudMetadata", SqlDbType.Int, CveSolicitudMetadata)
addParameters("@Estatus", SqlDbType.Int, estatus)
addParameters("@Observaciones", SqlDbType.VarChar, observaciones)
addParameters("@FechaInicio", SqlDbType.DateTime, fechaInicio)
addParameters("@FechaFin", SqlDbType.DateTime, fechaFin)
addParameters("@CveUsuarioIng", SqlDbType.Int, cveUsuarioIng)
addParameters("@CveEmpresa", SqlDbType.Int, cveEmpresa)
addParameters("@CveTipoSolicitud", SqlDbType.Int, CveTipoSolicitud)
With SqlAdapter.SelectCommand.Parameters
.Add("@CveSolicitud", SqlDbType.Int).Direction = ParameterDirection.Output
End With
SqlAdapter.Fill(Data)
CveSolictudAgregada = SqlAdapter.SelectCommand.Parameters("@CveSolicitud").Value.ToString.ToEntero
Catch ex As Exception
CveSolictudAgregada = -1
OnError("Ocurrió un error al agregar la Solicitud.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return CveSolictudAgregada
End Function
Public Function UpdateSolicitudDetalleCveSolicitudDetalle(CveEmpresa As Integer, UUID As String, CveSolicitudDetalle As Integer) As Boolean
Dim retorno As Boolean = False
Try
DataAdapter("PA_SAT_SolicitudesCFDIDataCveSolicitudDetalleUpdate", CommandType.StoredProcedure)
With SqlAdapter.SelectCommand.Parameters
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@UUID", SqlDbType.VarChar).Value = UUID
.Add("@CveSolicitudDetalle", SqlDbType.Int).Value = CveSolicitudDetalle
End With
SqlAdapter.Fill(Data)
retorno = True
Catch ex As Exception
retorno = False
OnError("Ocurrió un error al Actualizar SolicitudesCFDIData.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return retorno
End Function
Public Function SolicitudesUp(CveSolicitud As Int32, CveSolicitudCFDI As Int32, CveSolicitudMetadata As Int32, estatus As Int32, observaciones As String, cveEmpresa As Int32) As Boolean
Dim retorno As Boolean = False
DataAdapter("PA_Gral_SAT_SolicitudesUp", CommandType.StoredProcedure)

View File

@@ -1114,7 +1114,7 @@
<Height>0.63559in</Height>
<Style />
</Body>
<Width>10.98354in</Width>
<Width>10.94855in</Width>
<Page>
<PageHeader>
<Height>2.46174cm</Height>

View File

@@ -343,7 +343,7 @@
</asp:UpdatePanel>
</div>
<div class="col-md-2" runat="server" id="DvNumRemision1" visible="false"><b>Número Remisión</b></div>
<div class="col-md-2" runat="server" id="DvNumRemision1" visible="false"><b>Núm. Remisión</b></div>
<div class="col-md-2" runat="server" id="DvNumRemision2" visible="false">
<asp:TextBox ID="TxtNumRemision" runat="server" MaxLength="10" Width="100%" onblur="ValidaNumRemision()"></asp:TextBox>
<asp:Button ID="BtnValidaNumRemision" ClientIDMode="Static" OnClick="BtnValidaNumRemision_Click" Style="display: none;" runat="server" />

View File

@@ -829,8 +829,11 @@ Partial Class OC
DdlCultivosCuadro.DataBind()
DdlCultivosCuadro.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
DvNumRemision1.Visible = True
DvNumRemision2.Visible = True
If UsuarioActual.CveRol = 1 Then
DvNumRemision1.Visible = True
DvNumRemision2.Visible = True
End If
End If
@@ -8731,7 +8734,7 @@ Partial Class OC
If NumRemision.Trim.Length > 0 Then
If UsuarioActual.Empresa.Funcionalidad(590).ToString.ToEntero = 1 Then
If UsuarioActual.Empresa.Funcionalidad(590).ToString.ToEntero = 1 AndAlso UsuarioActual.CveRol = 1 Then
Dim ObjOC As ClsOC

View File

@@ -207,7 +207,13 @@
}
/* .ajax_tab_xp .ajax_tab_body {
font-size: 9px !important;
}
*/
.ajax__tab_xp .ajax__tab_body {
font-size: 12px !important;
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
@@ -216,15 +222,21 @@
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<li>
<%-- <asp:LinkButton ID="LnkDownloadExcel" OnClick="LnkDownloadExcel_Click" runat="server"><i class="fa fa-download"></i>Descargar</asp:LinkButton>--%>
</li>
<asp:UpdatePanel ID="UpAcciones" runat="server" UpdateMode="Conditional">
<contenttemplate>
<li>
<asp:LinkButton ID="LnkShowSolicitudes" OnClick="LnkShowSolicitudes_Click" runat="server" > Solicitudes</asp:LinkButton>
<ContentTemplate>
<li>
<asp:LinkButton ID="LnkDownloadExcel" OnClick="LnkDownloadExcel_Click" runat="server"><i class="fa fa-download"></i>Descargar</asp:LinkButton>
</li>
</contenttemplate>
<li>
<asp:LinkButton ID="LnkShowSolicitudes" OnClick="LnkShowSolicitudes_Click" runat="server"> Solicitudes</asp:LinkButton>
</li>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="LnkDownloadExcel" />
</Triggers>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
@@ -232,7 +244,7 @@
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="upDatosChec" runat="server" UpdateMode="Conditional">
<contenttemplate>
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle">
<div class="titlefiltros caption">
@@ -240,8 +252,8 @@
<label class="col-md-1">Agrupador: </label>
<div class="col-md-2">
<asp:DropDownList ID="DdlReporte" runat="server" Style="width: 100% !important;" CssClass="select2me" DataValueField="CveUsuario" DataTextField="Nombre">
<asp:ListItem Value="1" Text="Por Mes"></asp:ListItem>
<asp:ListItem Value="2" Text="Por Comprobante"></asp:ListItem>
<asp:ListItem Value="1" Text="Por Mes"></asp:ListItem>
<asp:ListItem Value="2" Text="Por Comprobante"></asp:ListItem>
</asp:DropDownList>
</div>
<label class="col-md-1 mediocol">Fecha inicio:</label>
@@ -253,10 +265,10 @@
<span class="input-group-btn ">
<asp:LinkButton ID="LnkRpdFechaInicio" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:maskededitextender id="MaskedEditExtender3" runat="server" targetcontrolid="TxtRpdFechaInicio" mask="99/99/9999" masktype="Date" displaymoney="Left" acceptnegative="Left"></ajax:maskededitextender>
<ajax:calendarextender runat="server" id="CalendarExtender3" targetcontrolid="TxtRpdFechaInicio" popupbuttonid="LnkRpdFechaInicio" popupposition="BottomRight" enabled="True" format="dd/MM/yyyy"></ajax:calendarextender>
<ajax:MaskedEditExtender ID="MaskedEditExtender3" runat="server" TargetControlID="TxtRpdFechaInicio" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CalendarExtender3" TargetControlID="TxtRpdFechaInicio" PopupButtonID="LnkRpdFechaInicio" PopupPosition="BottomRight" Enabled="True" Format="dd/MM/yyyy"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="rfvRpdFechaInicio" runat="server" ControlToValidate="TxtRpdFechaInicio" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Inicio''</b> es necesario, por favor ingréselo." ValidationGroup="VGReporterepperde"></asp:RequiredFieldValidator>
<ajax:validatorcalloutextender id="ValidatorCalloutExtender1" runat="server" highlightcssclass="vco" targetcontrolid="rfvRpdFechaInicio"></ajax:validatorcalloutextender>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="rfvRpdFechaInicio"></ajax:ValidatorCalloutExtender>
</div>
</div>
<label class="col-md-1 mediocol">Fecha fin:</label>
@@ -267,13 +279,13 @@
<span class="input-group-btn ">
<asp:LinkButton ID="LnkFechaFin" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:maskededitextender id="MaskedEditExtender5" runat="server" targetcontrolid="TxtRpdFechaFin" mask="99/99/9999" masktype="Date" displaymoney="Left" acceptnegative="Left"></ajax:maskededitextender>
<ajax:calendarextender runat="server" id="CalendarExtender4" targetcontrolid="TxtRpdFechaFin" popupbuttonid="LnkFechaFin" popupposition="BottomRight" enabled="True" format="dd/MM/yyyy"></ajax:calendarextender>
<ajax:MaskedEditExtender ID="MaskedEditExtender5" runat="server" TargetControlID="TxtRpdFechaFin" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CalendarExtender4" TargetControlID="TxtRpdFechaFin" PopupButtonID="LnkFechaFin" PopupPosition="BottomRight" Enabled="True" Format="dd/MM/yyyy"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="rfvRpdFechaFin" runat="server" ControlToValidate="TxtRpdFechaFin" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Fin''</b> es necesario, por favor ingréselo." ValidationGroup="VGReporterepperde"></asp:RequiredFieldValidator>
<ajax:validatorcalloutextender id="ValidatorCalloutExtender2" runat="server" highlightcssclass="vco" targetcontrolid="rfvRpdFechaFin"></ajax:validatorcalloutextender>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" HighlightCssClass="vco" TargetControlID="rfvRpdFechaFin"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="col-md-2" style="text-align:right">
<div class="col-md-2" style="text-align: right">
<asp:LinkButton ID="LnkConsultar" OnClick="LnkConsultar_Click" runat="server" Text="Consultar" Visible="true" class="btn btn-primary" />
</div>
</div>
@@ -286,240 +298,246 @@
</div>
</div>
</contenttemplate>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row" runat="server" id="DVResumen1" visible="false">
<div class="col-md-6" style="text-align: right">
<input type="text" id="TxtBusquedaResumen" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaResumen','{0}')", GvResumen.ClientID) %>" style="display: inline-block; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaResumen','{0}')", GvResumen.ClientID) %>" style="margin-top: -3px; margin-left: -13px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<div class="row" runat="server" id="DVResumen1" visible="false">
<div class="col-md-6" style="text-align: right">
<input type="text" id="TxtBusquedaResumen" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaResumen','{0}')", GvResumen.ClientID) %>" style="display: inline-block; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaResumen','{0}')", GvResumen.ClientID) %>" style="margin-top: -3px; margin-left: -13px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
</div>
<div class="row" runat="server" id="DVResumen2" visible="false" >
<div class="col-md-6">
<asp:GridView ID="GvResumen" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD Widthall" AutoGenerateColumns="False" OnRowDataBound="GvResumen_RowDataBound"
ShowHeaderWhenEmpty="true" EmptyDataText="No se encontraron registros"
DataKeyNames="Mes">
<Columns>
<asp:TemplateField HeaderText="Mes">
<ItemTemplate>
<asp:Label ID="LblMes" runat="server" Text='<%# Eval("Mes")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="SIG" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label ID="LblVTotal" runat="server" Text='<%# Eval("VTotal","{0:N2}")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="SAT" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label ID="LblCBTTotal" runat="server" Text='<%# Eval("CBTTotal","{0:N2}")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Diferencia" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label ID="LblDif" runat="server" Text='<%# Eval("Dif","{0:N2}")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
<div class="row" runat="server" id="DVResumen2" visible="false">
<div class="col-md-6">
<asp:GridView ID="GvResumen" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD Widthall" AutoGenerateColumns="False" OnRowDataBound="GvResumen_RowDataBound"
ShowHeaderWhenEmpty="true" EmptyDataText="No se encontraron registros"
DataKeyNames="Mes">
<Columns>
<asp:TemplateField HeaderText="Mes">
<ItemTemplate>
<asp:Label ID="LblMes" runat="server" Text='<%# Eval("Mes")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="SIG" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label ID="LblVTotal" runat="server" Text='<%# Eval("VTotal","{0:N2}")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="SAT" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label ID="LblCBTTotal" runat="server" Text='<%# Eval("CBTTotal","{0:N2}")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Diferencia" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label ID="LblDif" runat="server" Text='<%# Eval("Dif","{0:N2}")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
<div class="row" runat="server" id="DvDatos1" visible="false">
<div class="col-md-12">
<div class="col-md-12" style="text-align: right">
<input type="text" id="TxtBusquedaDatos" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaDatos','{0}')", GvDatos.ClientID) %>" style="display: inline-block; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaDatos','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px; margin-left: -13px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
</div>
</div>
<div class="row" runat="server" id="DvDatos2" visible="false">
<div class="col-md-12">
<asp:GridView ID="GvDatos" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD Widthall" AutoGenerateColumns="false" OnRowDataBound="GvDatos_RowDataBound"
ShowHeaderWhenEmpty="true" EmptyDataText="No se encontraron registros"
DataKeyNames="UUID,CountRegistros,VTotal,CBTTotal,CountRegistrosSIG,CountRegistrosSAT">
<Columns>
<asp:TemplateField HeaderText="Folio">
<ItemTemplate>
<asp:Label runat="server" ID="LblUUID" Text='<%# Eval("UUID")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</div>
<asp:TemplateField HeaderText="SIG">
<ItemTemplate>
<asp:Label runat="server" ID="LblEnSistema" Text='<%# Eval("Sistema")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="SAT" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label runat="server" ID="LblCFDIData" Text='<%# Eval("CFDIData")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Serie Folio" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label runat="server" ID="LblVSerieFolio" Text='<%# Eval("VSerieFolio")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Total" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label runat="server" ID="LblVTotal" Text='<%# Eval("VTotal","{0:N2}")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Sub Total" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label runat="server" ID="LblVSubTotal" Text='<%# Eval("VSubTotal","{0:N2}")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="IVA" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label runat="server" ID="LblVIVA" Text='<%# Eval("VIVA","{0:N2}")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="IEPS" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label runat="server" ID="LblVIEPS" Text='<%# Eval("VIEPS","{0:N2}")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Ret. IVA" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label runat="server" ID="LblVRetIVA" Text='<%# Eval("VRetIVA","{0:N2}")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Ret. ISR" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label runat="server" ID="LblVRetISR" Text='<%# Eval("VRetISR","{0:N2}")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Total" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label runat="server" ID="LblCBTTotal" Text='<%# Eval("CBTTotal","{0:N2}")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Sub Total" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label runat="server" ID="LblCBTSubTotal" Text='<%# Eval("CBTSubTotal","{0:N2}")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="IVA" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label runat="server" ID="LblImpIVA" Text='<%# Eval("ImpIVA","{0:N2}")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="IEPS" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label runat="server" ID="LblImpIEPS" Text='<%# Eval("ImpIEPS","{0:N2}")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Ret. ISR" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label runat="server" ID="LblImpRetISR" Text='<%# Eval("ImpRetISR","{0:N2}")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Ret. IVA" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label runat="server" ID="LblImpRetIVA" Text='<%# Eval("ImpRetIVA","{0:N2}")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<div class="row" runat="server" id="DvDatos1" visible="false">
<div class="col-md-12">
<div class="col-md-12" style="text-align: right">
<input type="text" id="TxtBusquedaDatos" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaDatos','{0}')", GvDatos.ClientID) %>" style="display: inline-block; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaDatos','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px; margin-left: -13px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
</div>
</div>
<div class="row" runat="server" id="DvDatos2" visible="false">
<div class="col-md-12">
<asp:GridView ID="GvDatos" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD Widthall" AutoGenerateColumns="false" OnRowDataBound="GvDatos_RowDataBound"
ShowHeaderWhenEmpty="true" EmptyDataText="No se encontraron registros"
DataKeyNames="UUID,CountRegistros,VTotal,CBTTotal,CountRegistrosSIG,CountRegistrosSAT,DifImporte,Abreviatura,CBTMoneda,CFDIData,CveSolicitudDetalle,CveVenta,VSerieFolio,Sistema">
<Columns>
<asp:TemplateField HeaderText="Folio">
<ItemTemplate>
<asp:Label runat="server" ID="LblUUID" Text='<%# Eval("UUID")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="SIG">
<ItemTemplate>
<asp:Label runat="server" ID="LblEnSistema" Text='<%# Eval("Sistema")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="SAT" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:LinkButton runat="server" ID="LnkCFDIData" OnClick="LnkCFDIData_Click" Text='<%# Eval("CFDIData")%>' ></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Serie Folio" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label runat="server" ID="LblVSerieFolio" Text='<%# Eval("VSerieFolio")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Total" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label runat="server" ID="LblVTotal" Text='<%# Eval("VTotal","{0:N2}")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Sub Total" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label runat="server" ID="LblVSubTotal" Text='<%# Eval("VSubTotal","{0:N2}")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="IVA" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label runat="server" ID="LblVIVA" Text='<%# Eval("VIVA","{0:N2}")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="IEPS" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label runat="server" ID="LblVIEPS" Text='<%# Eval("VIEPS","{0:N2}")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Ret. IVA" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label runat="server" ID="LblVRetIVA" Text='<%# Eval("VRetIVA","{0:N2}")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Ret. ISR" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label runat="server" ID="LblVRetISR" Text='<%# Eval("VRetISR","{0:N2}")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Moneda" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label runat="server" ID="LblAbreviatura" Text='<%# Eval("Abreviatura")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Total" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label runat="server" ID="LblCBTTotal" Text='<%# Eval("CBTTotal","{0:N2}")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Sub Total" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label runat="server" ID="LblCBTSubTotal" Text='<%# Eval("CBTSubTotal","{0:N2}")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="IVA" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label runat="server" ID="LblImpIVA" Text='<%# Eval("ImpIVA","{0:N2}")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="IEPS" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label runat="server" ID="LblImpIEPS" Text='<%# Eval("ImpIEPS","{0:N2}")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Ret. ISR" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label runat="server" ID="LblImpRetISR" Text='<%# Eval("ImpRetISR","{0:N2}")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Ret. IVA" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label runat="server" ID="LblImpRetIVA" Text='<%# Eval("ImpRetIVA","{0:N2}")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Moneda" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label runat="server" ID="LblCBTMoneda" Text='<%# Eval("CBTMoneda")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<div id="ModalViewSolicitudes" class="modal ADS fade" role="dialog">
<div id="ModalViewSolicitudes" class="modal ADS fade" role="dialog">
<asp:UpdatePanel ID="UPModalViewSolicitudes" class="modal-dialog rowpadding xspadding" tabindex="-1" runat="server" UpdateMode="Conditional">
<contenttemplate>
<ContentTemplate>
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Solicitudes CFDI</h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-12" style="text-align:right">
<div class="row">
<div class="col-md-12" style="text-align: right">
<asp:LinkButton ID="LnkAgregarSolictud" runat="server" data-toggle="tooltip" data-placement="right" OnClick="LnkAgregarSolictud_Click" title="Agregar Solicitud." CssClass="btn btn-circle btn-default" Text="<i class='fa fa-plus'></i> Agregar Solicitud"></asp:LinkButton>
</div>
</div>
<ajax:TabContainer runat="server" ID="TabPanel" ActiveTabIndex="0">
<ajax:TabPanel runat="server" HeaderText="Pendientes" ID="TabPendientes">
<ContentTemplate>
<div class="row">
<div class="col-md-12">
<asp:GridView ID="GVSolicitudesPendientes" runat="server" GridLines="None" CssClass="table table-striped table-hover Widthall ScrollAD mysmallbtn" AutoGenerateColumns="False"
ShowHeaderWhenEmpty="true" EmptyDataText="No se encontraron registros"
DataKeyNames="CveSolicitud,CveSolicitudCFDI,CveSolicitudMetadata,Estatus,Observaciones,FechaInicio,FechaFin,FechaIng,CveUsuarioIng,CveEmpresa,ArchivoXML">
DataKeyNames="CveSolicitud,CveSolicitudCFDI,CveSolicitudMetadata,Estatus,Observaciones,FechaInicio,FechaFin,FechaIng,CveUsuarioIng,CveEmpresa,ArchivoXML,idSolicitud,CveSolicitudDetalle">
<Columns>
<asp:TemplateField HeaderText="Folio">
<ItemTemplate>
@@ -565,14 +583,14 @@
</div>
<div class="row">
<div class="col-md-12" style="text-align:center">
<div class="col-md-12" style="text-align: center">
<asp:LinkButton ID="LnkverificarSolicitudes" CssClass="btn btn-primary" OnClick="LnkverificarSolicitudes_Click" runat="server">Verificar pendientes</asp:LinkButton>
</div>
</div>
</ContentTemplate>
</ajax:TabPanel>
@@ -582,13 +600,13 @@
<ContentTemplate>
<div class="row">
<div class="col-md-12">
<asp:GridView ID="GVSolicitudesNominas" runat="server" GridLines="None" CssClass="table table-striped table-hover Widthall ScrollAD mysmallbtn" AutoGenerateColumns="False" OnRowDataBound="GVSolicitudesNominas_RowDataBound"
ShowHeaderWhenEmpty="true" EmptyDataText="No se encontraron registros"
DataKeyNames="CveSolicitud,idSolicitudCFDI,idSolicitudMetadata,Estatus,Observaciones,FechaInicio,FechaFin,FechaIng,CveUsuarioIng,CveEmpresa,ArchivoXML">
DataKeyNames="CveSolicitudDetalle,CveSolicitud,idSolicitudCFDI,idSolicitudMetadata,Estatus,Observaciones,FechaInicio,FechaFin,FechaIng,CveUsuarioIng,CveEmpresa,ArchivoXML">
<Columns>
<asp:TemplateField HeaderText="Folio">
<ItemTemplate>
@@ -605,14 +623,14 @@
<asp:Label ID="lblfechaFin" runat="server" Text='<%# Eval("FechaFin","{0:dd/MM/yyyy}")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="No CFDI">
<asp:TemplateField HeaderText="No CFDI" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label ID="LblnumeroCFDIs" runat="server" Text='<%# Eval("numeroCFDIs")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Observaciones">
<ItemTemplate>
<asp:Label ID="lblobservaciones" runat="server" Text='<%# Eval("Observaciones")%>'></asp:Label>
<asp:Label ID="lblobservaciones" runat="server" Text='<%# Eval("Observaciones")%>' ItemStyle-Width="150px" ControlStyle-Width="150px" CssClass="truncate" ></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Fecha solicitud">
@@ -631,16 +649,24 @@
Text="<i class='fa fa-download' style='color:white' title='Descargar Documento'></i>" CausesValidation="False" Visible="false" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="R Nombres" Visible="false">
<ItemTemplate>
<asp:LinkButton ID="LnkRenombrarArchivos" CssClass="btn btn-circle btn-sm blue" OnClick="LnkRenombrarArchivos_Click" runat="server" ToolTip="Renombrar Archivos"
Text="Renombrar" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</ContentTemplate>
</ajax:TabPanel>
@@ -649,16 +675,16 @@
</ajax:TabContainer>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
</div>
</div>
</contenttemplate>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
@@ -668,7 +694,7 @@
<div id="ModalAgregarSolicitud" class="modal ADS fade" role="dialog">
<asp:UpdatePanel ID="UPModalViewSolicitudesAgregar" class="modal-dialog rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
@@ -678,10 +704,10 @@
<div class="row">
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright" style="width: 125px!important">
<asp:TextBox ID="txtFechaIAdd" CssClass="form-control" MaxLength="20" runat="server" Width="100px"></asp:TextBox>
<div class="form-group form-md-line-input input-iconright" style="width: 125px!important;height:28px!important">
<asp:TextBox ID="txtFechaIAdd" CssClass="form-control" MaxLength="20" runat="server" Width="100px" Height="28px"></asp:TextBox>
<span class="input-group-btn " style="position: absolute; right: 41px; top: -5px;">
<asp:LinkButton ID="LnkFechaIAdd" class="btn default" Style="margin-top: 15px; margin-left: 6px" Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
<asp:LinkButton ID="LnkFechaIAdd" class="btn default" Style="margin-top: 15px; margin-left: 6px" Text="<i Style='margin-left: -6px;margin-top: -5px' class='fa fa-calendar'></i>" runat="server" Width="25px" Height="27px" ></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFechaIAdd" runat="server" TargetControlID="txtFechaIAdd" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CalendarExtender1" TargetControlID="txtFechaIAdd" PopupButtonID="LnkFechaIAdd" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
@@ -695,9 +721,9 @@
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright" style="width: 125px!important">
<asp:TextBox ID="txtFechaFAdd" CssClass="form-control" MaxLength="20" runat="server" Width="100px"></asp:TextBox>
<asp:TextBox ID="txtFechaFAdd" CssClass="form-control" MaxLength="20" runat="server" Width="100px" Height="28px"></asp:TextBox>
<span class="input-group-btn " style="position: absolute; right: 41px; top: -5px;">
<asp:LinkButton ID="LnkFechaFAdd" class="btn default" Style="margin-top: 15px; margin-left: 6px" Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
<asp:LinkButton ID="LnkFechaFAdd" class="btn default" Style="margin-top: 15px; margin-left: 6px" Text="<i Style='margin-left: -6px;margin-top: -5px' class='fa fa-calendar'></i>" runat="server" Width="25px" Height="27px" ></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFechaFAdd" runat="server" TargetControlID="txtFechaFAdd" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CalendarExtender2" TargetControlID="txtFechaFAdd" PopupButtonID="LnkFechaFAdd" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
@@ -724,10 +750,10 @@
</asp:Content>

View File

@@ -44,93 +44,44 @@ public partial class SAT_SolicitudesIngresoSat : ClsPaginas
}
set { ViewState["fechaFin"] = value; }
}
public int TipoDescarga // 0 sin descarga 1 resumen 2 desglose
{
get
{
if (ViewState["TipoDescarga"] == null) { return 0; }
else { return ViewState["TipoDescarga"].ToString().ToEntero(); }
}
set { ViewState["TipoDescarga"] = (int)value; }
}
#endregion
protected void Page_Load(object sender, EventArgs e)
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
TxtRpdFechaInicio.Text = string.Format("01/{0:MM/yyyy}", DateTime.Now.AddMonths(-1));
TxtRpdFechaFin.Text = string.Format("{0:dd/MM/yyyy}", DateTime.Now.AddMonths(-1).LastDayOfMonth());
LnkConsultar_Click(null, null);
//if(UsuarioActual.CveRol == 1)
//{
// GVSolicitudesNominas.Columns[8].Visible = true;
//}
}
}
protected void LnkDownloadExcel_Click(object sender, EventArgs e)
{
if(TipoDescarga == 1) {
GvResumen.ExportToExcel2($"Resumen{DateTime.Now.ToString("yyyyMMddhhmmss")}");
}
using (ClsNominas nom = new ClsNominas())
if (TipoDescarga == 2)
{
nom.SATSolicitudTimbreNominaGral(DdlReporte.SelectedValue.ToString().ToEntero(), UsuarioActual.CveEmpresa, fechaInicio, fechaFin);
ClosedXML.Excel.XLWorkbook wb = new ClosedXML.Excel.XLWorkbook();
var libro = wb.AddWorksheet(nom.DtResultados, "Nomina");
libro.ColumnsUsed().AdjustToContents();
libro.Range(1, 1, 1, nom.DtResultados.Columns.Count).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(153, 153, 153));
switch (DdlReporte.SelectedValue.ToString().ToEntero())
{
case 1:
libro.Range(1, 2, 1, 2).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(153, 0, 0));
libro.Range(1, 3, 1, 5).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(53, 152, 220));
break;
case 2:
libro.Range(1, 2, 1, 2).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(153, 0, 0));
libro.Range(1, 3, 1, 6).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(53, 152, 220));
libro.Range(1, 8, 1, 11).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(53, 152, 220));
break;
case 3:
libro.Range(1, 1, 1, 10).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(53, 152, 220));
libro.Range(1, 11, 1, nom.DtResultados.Columns.Count).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(153, 0, 0));
break;
case 4:
libro.Range(1, 2, 1, 2).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(153, 0, 0));
libro.Range(1, 3, 1, 5).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(53, 152, 220));
break;
case 5:
libro.Range(1, 2, 1, 2).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(153, 0, 0));
libro.Range(1, 3, 1, 3).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(53, 152, 220));
break;
case 6:
libro.Range(1, 4, 1, 6).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(153, 0, 0));
libro.Range(1, 7, 1, 9).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(53, 152, 220));
break;
case 7:
libro.Range(1, 3, 1, 5).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(153, 0, 0));
libro.Range(1, 6, 1, 8).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(53, 152, 220));
break;
case 8:
libro.Range(1, 6, 1, 8).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(153, 0, 0));
libro.Range(1, 9, 1, 12).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(53, 152, 220));
break;
case 9:
break;
default:
break;
}
libro.Row(1).InsertRowsAbove(4);
libro.Range(1, 2, 1, 6).Merge().Value = UsuarioActual.Empresa.Empresa;
libro.Range(2, 2, 2, 6).Merge().Value = $"Reporte de {DdlReporte.SelectedItem.Text}";
libro.Range(3, 2, 3, 6).Merge().Value = $"del {fechaInicio.ToDateTime():dd/MM/yyyy} al {fechaFin.ToDateTime():dd/MM/yyyy}";
libro.Range(2, 7, 2, 9).Merge().Value = $"Fecha:{DateTime.Now:dd/MM/yyyy}";
libro.Range(3, 7, 3, 9).Merge().Value = $"Hora:{DateTime.Now:HH:mm}";
System.IO.Stream fs = new System.IO.MemoryStream();
wb.SaveAs(fs);
fs.Position = 0;
System.IO.MemoryStream memoryStream = new System.IO.MemoryStream();
using (System.IO.Stream input = fs)
{
input.CopyTo(memoryStream);
}
memoryStream.Position = 0;
Response.Clear();
Response.Buffer = true;
Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
Response.AddHeader("content-disposition", string.Format("attachment;filename={0}.xlsx", $"Visor nómina ( Reporte :{DdlReporte.SelectedValue}) "));
Response.BinaryWrite(memoryStream.ToArray());
Response.End();
GvDatos.ExportToExcel2($"PorComprobante{DateTime.Now.ToString("yyyyMMddhhmmss")}");
}
}
protected void LnkConsultar_Click(object sender, EventArgs e)
@@ -146,6 +97,10 @@ public partial class SAT_SolicitudesIngresoSat : ClsPaginas
DVResumen1.Visible = false;
DVResumen2.Visible = false;
TipoDescarga = 0;
LnkDownloadExcel.Visible = false;
if (DdlReporte.SelectedValue.ToEntero() == 1)
{
@@ -176,10 +131,14 @@ public partial class SAT_SolicitudesIngresoSat : ClsPaginas
if (DdlReporte.SelectedValue.ToEntero() == 1)
{
GvResumen.DataSource = ObjNom.DtResultados;
TipoDescarga = ObjNom.DtResultados.Rows.Count > 0 ? 1:0;
LnkDownloadExcel.Visible = true;
}
else
{
GvDatos.DataSource = ObjNom.DtResultados;
TipoDescarga = ObjNom.DtResultados.Rows.Count > 0 ? 2 : 0;
LnkDownloadExcel.Visible = true;
}
}
}
@@ -191,7 +150,9 @@ public partial class SAT_SolicitudesIngresoSat : ClsPaginas
GvDatos.DataBind();
UpDatos.Update();
UpAcciones.Update();
}
@@ -237,6 +198,7 @@ public partial class SAT_SolicitudesIngresoSat : ClsPaginas
protected void LnkSolicitarSat_Click(object sender, EventArgs e)
{
StringBuilder sbResultado = new StringBuilder();
int idSolicitudCFDI = 0;
int idSolicitudMetadata = 0;
int estatus = 0;
@@ -245,22 +207,23 @@ public partial class SAT_SolicitudesIngresoSat : ClsPaginas
DateTime fechaFin = txtFechaFAdd.Text.ToDateTime();
int cveUsuarioIng = UsuarioActual.CveUsuario;
int cveEmpresa = UsuarioActual.CveEmpresa;
bool Continuar = false;
int CveSolicitudAgregada = -1;
using (ClsNominas nom = new ClsNominas())
{
Continuar = nom.SolicitudesAdd(idSolicitudCFDI, idSolicitudMetadata, estatus, observaciones, fechaInicio, fechaFin, cveUsuarioIng, cveEmpresa, CveTipoSolicitud: 3);
CveSolicitudAgregada = nom.SolicitudesAdd2(idSolicitudCFDI, idSolicitudMetadata, estatus, observaciones, fechaInicio, fechaFin, cveUsuarioIng, cveEmpresa, CveTipoSolicitud: 3);
}
if (Continuar)
if (CveSolicitudAgregada > 0)
{
StringBuilder sbResultado = new StringBuilder();
var api = new GeneralesAPII();
JToken ObjApiSolicitud = (JToken)api.GeneraSolicitud(UsuarioActual.CveEmpresa, 3);
JToken ObjApiSolicitud = (JToken)api.GeneraSolicitud(UsuarioActual.CveEmpresa, 3, CveSolicitudAgregada);
List<string> resultSolicitud = new List<string>();
List<string> resultVerificacion = new List<string>();
var ResultadoVerificaionOK = false;
var SeVerifico = false;
//var ResultadoVerificaionOK = false;
//var SeVerifico = false;
var TipoMensaje = ModExtensiones.TipoMensaje.MsgInformacion;
var ResultadoSolicitudOK = false;
@@ -277,71 +240,25 @@ public partial class SAT_SolicitudesIngresoSat : ClsPaginas
if (ResultadoSolicitudOK)
{
JToken ObjApiVerificacion = (JToken)api.VerificaSolicitudesNominas(UsuarioActual.CveEmpresa, 3);
if (!(ObjApiVerificacion == null))
{
resultVerificacion = ObjApiVerificacion.Select(token => token.Values().Aggregate((i, j) => $"{i}|{j}").Value<string>()).ToList();
ResultadoVerificaionOK = bool.Parse(resultVerificacion[0]);
SeVerifico = true;
}
else
{
TipoMensaje = ModExtensiones.TipoMensaje.MsgAdvertencia;
}
sbResultado.Append($"Solicitud registrada correctamente y solicitada a SAT.<br> Folio: { CveSolicitudAgregada}");
}
else {
if (resultSolicitud.Count == 4)
{
if (ResultadoSolicitudOK)
{
if (resultSolicitud[1].ToString().Trim().Length > 0)
{
sbResultado.Append($"{resultSolicitud[1]}<br/>");
}
else
{
sbResultado.Append($"Solicitud Generada Correctamente");
sbResultado.Append($"Se presento un error al verificar las solicitudes <br/> {resultSolicitud[1]} <br>");
}
}
else
{
sbResultado.Append($"{resultSolicitud[1]}");
TipoMensaje = ModExtensiones.TipoMensaje.MsgAdvertencia;
}
}
else
{
sbResultado.AppendLine("Se presento un error al generar la solicitud (API) <br/>");
sbResultado.Append($"Solicitud registrada, pendiente de verificar en SAT <br> Folio: {CveSolicitudAgregada} <br>({resultSolicitud[1] })<br>");
TipoMensaje = ModExtensiones.TipoMensaje.MsgAdvertencia;
}
//if (SeVerifico && resultVerificacion.Count == 4)
//{
// if (ResultadoVerificaionOK)
// {
// sbResultado.Append($"{resultVerificacion[1]}<br>");
// }
// else
// {
// sbResultado.Append($"Se presento un error al verificar las solicitudes {resultVerificacion[1]}<br>");
// TipoMensaje = ModExtensiones.TipoMensaje.MsgAdvertencia;
// }
//}
//else
//{
// sbResultado.AppendLine("Se presento un error al verificar las solicitudes (API) <br/>");
// TipoMensaje = ModExtensiones.TipoMensaje.MsgAdvertencia;
//}
Alert(sbResultado.ToString(), TipoMensaje);
}
else
{
Alert("No se puedo registrar la solictud".ToString(), ModExtensiones.TipoMensaje.MsgAdvertencia);
}
if (Continuar)
if (CveSolicitudAgregada > 0)
{
txtFechaIAdd.Text = "";
txtFechaFAdd.Text = "";
@@ -358,95 +275,107 @@ public partial class SAT_SolicitudesIngresoSat : ClsPaginas
//api.GeneraSolicitud();
//api.VerificaSolicitudesNominas();
try
{
StringBuilder sbResultado = new StringBuilder();
var api = new GeneralesAPII();
JToken ObjApiSolicitud = (JToken)api.GeneraSolicitud(UsuarioActual.CveEmpresa, 3);
List<string> resultSolicitud = new List<string>();
List<string> resultVerificacion = new List<string>();
var ResultadoVerificaionOK = false;
var SeVerifico = false;
var TipoMensaje = ModExtensiones.TipoMensaje.MsgInformacion;
var ResultadoSolicitudOK = false;
if (!(ObjApiSolicitud == null))
foreach(GridViewRow GvRow in GVSolicitudesPendientes.Rows)
{
resultSolicitud = ObjApiSolicitud.Select(token => token.Values().Aggregate((i, j) => $"{i}|{j}").Value<string>()).ToList();
ResultadoSolicitudOK = bool.Parse(resultSolicitud[0]);
}
else
{
TipoMensaje = ModExtensiones.TipoMensaje.MsgAdvertencia;
}
int CveSolicitudActual = GvRow.DataKey("CveSolicitud").ToEntero();
string idSolicitud = GvRow.DataKey("idSolicitud").Trim();
List<string> resultSolicitud = new List<string>();
List<string> resultVerificacion = new List<string>();
var ResultadoVerificaionOK = false;
var SeVerifico = false;
var TipoMensaje = ModExtensiones.TipoMensaje.MsgInformacion;
var ResultadoSolicitudOK = false;
if (ResultadoSolicitudOK)
{
JToken ObjApiVerificacion = (JToken)api.VerificaSolicitudesNominas(UsuarioActual.CveEmpresa, 3);
var api = new GeneralesAPII();
if (!(ObjApiVerificacion == null))
if (idSolicitud.Length == 0)
{
resultVerificacion = ObjApiVerificacion.Select(token => token.Values().Aggregate((i, j) => $"{i}|{j}").Value<string>()).ToList();
ResultadoVerificaionOK = bool.Parse(resultVerificacion[0]);
SeVerifico = true;
}
else
{
TipoMensaje = ModExtensiones.TipoMensaje.MsgAdvertencia;
}
}
if (resultSolicitud.Count == 4)
{
if (ResultadoSolicitudOK)
{
if (resultSolicitud[1].ToString().Trim().Length > 0)
JToken ObjApiSolicitud = (JToken)api.GeneraSolicitud(UsuarioActual.CveEmpresa, 3, CveSolicitudActual);
if (!(ObjApiSolicitud == null))
{
//sbResultado.Append($"{resultSolicitud[1]}<br/>");
resultSolicitud = ObjApiSolicitud.Select(token => token.Values().Aggregate((i, j) => $"{i}|{j}").Value<string>()).ToList();
ResultadoSolicitudOK = bool.Parse(resultSolicitud[0]);
sbResultado.Append($"Solicitud {CveSolicitudActual} solicitada a SAT.<br>");
}
else
{
sbResultado.Append($"Se presento un error al verificar las solicitudes <br/> {resultSolicitud[1]} <br>");
{
TipoMensaje = ModExtensiones.TipoMensaje.MsgAdvertencia;
}
}
else
{
sbResultado.Append($"{resultSolicitud[1]}");
TipoMensaje = ModExtensiones.TipoMensaje.MsgAdvertencia;
resultSolicitud = new List<string>();
resultSolicitud.Add("true");
resultSolicitud.Add("");
resultSolicitud.Add("");
resultSolicitud.Add("");
ResultadoSolicitudOK = true;
}
}
else
{
sbResultado.AppendLine("Se presento un error al generar la solicitud (API) <br/>");
TipoMensaje = ModExtensiones.TipoMensaje.MsgAdvertencia;
}
if (SeVerifico && resultVerificacion.Count == 4)
{
if (ResultadoVerificaionOK)
if (ResultadoSolicitudOK)
{
sbResultado.Append($"{resultVerificacion[1]}.<br>");
JToken ObjApiVerificacion = (JToken)api.VerificaSolicitudesNominas(UsuarioActual.CveEmpresa, 3, CveSolicitudActual);
if (!(ObjApiVerificacion == null))
{
resultVerificacion = ObjApiVerificacion.Select(token => token.Values().Aggregate((i, j) => $"{i}|{j}").Value<string>()).ToList();
ResultadoVerificaionOK = bool.Parse(resultVerificacion[0]);
SeVerifico = true;
}
else
{
TipoMensaje = ModExtensiones.TipoMensaje.MsgAdvertencia;
}
}
else
{
sbResultado.Append($"Se presento un error al verificar las solicitudes {resultVerificacion[1]}<br>");
sbResultado.Append($"Solicitud pendiente de verificar en SAT <br> Folio:{CveSolicitudActual} ({resultSolicitud[1]})<br>");
TipoMensaje = ModExtensiones.TipoMensaje.MsgAdvertencia;
}
if (SeVerifico && resultVerificacion.Count == 4)
{
if (ResultadoVerificaionOK)
{
sbResultado.Append($"Solicitud procesada.<br> Folio: {CveSolicitudActual}");
}
else
{
sbResultado.Append($"Solicitud no verificada <br> Folio: {CveSolicitudActual}{resultVerificacion[1]}.<br>");
TipoMensaje = ModExtensiones.TipoMensaje.MsgAdvertencia;
}
}
else
{
sbResultado.Append($"Se presento un error al verificar la solicitud <br> Folio: {CveSolicitudActual}.");
TipoMensaje = ModExtensiones.TipoMensaje.MsgAdvertencia;
}
}
else
{
sbResultado.AppendLine("Se presento un error al verificar las solicitudes (API) <br/>");
TipoMensaje = ModExtensiones.TipoMensaje.MsgAdvertencia;
}
Alert(sbResultado.ToString(), TipoMensaje);
Alert(sbResultado.ToString(), TipoMensaje);
}
@@ -490,6 +419,8 @@ public partial class SAT_SolicitudesIngresoSat : ClsPaginas
if(e.Row.RowType == DataControlRowType.DataRow)
{
if (e.Row.DataKey("UUID") == "Totales")
{
e.Row.Font.Bold = true;
@@ -498,13 +429,73 @@ public partial class SAT_SolicitudesIngresoSat : ClsPaginas
e.Row.Attributes.Add("class", "Totales");
}
if(e.Row.DataKey("UUID").ToUpper() != "TOTALES")
{
StringBuilder SBMsgToolTip = new StringBuilder();
if (e.Row.DataKey("DifImporte").ToDecimal() != 0 || (e.Row.DataKey("Abreviatura").ToUpper() != e.Row.DataKey("CBTMoneda").ToUpper()))
{
e.Row.CssClass = "bg-yellow-casablanca bg-font-yellow-casablanca";
}
e.Row.Attributes.Add("data-html", "true");
e.Row.Attributes.Add("data-toggle", "tooltip");
e.Row.Attributes.Add("data-placement", "top");
if (e.Row.DataKey("Sistema").ToUpper() == "NO" || e.Row.DataKey("CFDIData").ToUpper() == "NO")
{
if (e.Row.DataKey("Sistema").ToUpper() == "NO")
{
SBMsgToolTip.AppendLine("Comprobante no se encuentra en SIG.<br>");
}
if (e.Row.DataKey("CFDIData").ToUpper() == "NO")
{
SBMsgToolTip.AppendLine("Comprobante no se encuentra en descargas de SAT.<br>");
}
}
else {
if (e.Row.DataKey("DifImporte").ToDecimal() != 0)
{
SBMsgToolTip.AppendLine($" Diferencia importes {e.Row.DataKey("DifImporte").ToDecimal().ToString("###,###,###.00")}");
}
if (e.Row.DataKey("Abreviatura").ToUpper() != e.Row.DataKey("CBTMoneda").ToUpper())
{
SBMsgToolTip.AppendLine($"Diferencia en monedas.");
}
}
if (SBMsgToolTip.ToString().Length > 0)
{
e.Row.Attributes.Add("title", SBMsgToolTip.ToString());
}
LinkButton LnkCFDIData = e.Row.FCLinkButton("LnkCFDIData");
if((e.Row.DataKey("CFDIData").ToUpper() == "SI"))
{
ScriptManager.GetCurrent(this).RegisterPostBackControl(LnkCFDIData);
LnkCFDIData.CssClass = "Texto";
}
else
{
LnkCFDIData.PostBackUrl = "#";
}
if(e.Row.DataKey("CveVenta").ToEntero() > 0)
{
e.Row.Cells[1].Text = $"<a href='/Ventas/Ventas.aspx?CveVenta={e.Row.DataKey("CveVenta").ToEntero()}'class='Texto' target='_blank' >Si</a>";
e.Row.Cells[3].Text = $"<a href='/Ventas/Ventas.aspx?CveVenta={e.Row.DataKey("CveVenta").ToEntero()}'class='Texto' target='_blank' >{e.Row.DataKey("VSerieFolio")}</a>";
}
}
}
if (e.Row.RowType == DataControlRowType.Header)
{
e.Row.Cells[1].BackColor = System.Drawing.Color.FromName("#3598dc"); //Azul
e.Row.Cells[2].BackColor = System.Drawing.Color.FromName("#900"); //Rojo
e.Row.Cells[2].BackColor = System.Drawing.Color.FromName("#E87E04"); //Rojo
e.Row.Cells[4].BackColor = System.Drawing.Color.FromName("#3598dc"); //Azul
@@ -513,14 +504,29 @@ public partial class SAT_SolicitudesIngresoSat : ClsPaginas
e.Row.Cells[7].BackColor = System.Drawing.Color.FromName("#3598dc"); //Azul
e.Row.Cells[8].BackColor = System.Drawing.Color.FromName("#3598dc"); //Azul
e.Row.Cells[9].BackColor = System.Drawing.Color.FromName("#3598dc"); //Azul
e.Row.Cells[10].BackColor = System.Drawing.Color.FromName("#3598dc"); //Azul
//e.Row.Cells[11].BackColor = System.Drawing.Color.FromName("#900"); //Rojo
//e.Row.Cells[12].BackColor = System.Drawing.Color.FromName("#900"); //Rojo
//e.Row.Cells[13].BackColor = System.Drawing.Color.FromName("#900"); //Rojo
//e.Row.Cells[14].BackColor = System.Drawing.Color.FromName("#900"); //Rojo
//e.Row.Cells[15].BackColor = System.Drawing.Color.FromName("#900"); //Rojo
//e.Row.Cells[16].BackColor = System.Drawing.Color.FromName("#900"); //Rojo
//e.Row.Cells[17].BackColor = System.Drawing.Color.FromName("#900"); //Rojo
e.Row.Cells[11].BackColor = System.Drawing.Color.FromName("#E87E04"); //Rojo
e.Row.Cells[12].BackColor = System.Drawing.Color.FromName("#E87E04"); //Rojo
e.Row.Cells[13].BackColor = System.Drawing.Color.FromName("#E87E04"); //Rojo
e.Row.Cells[14].BackColor = System.Drawing.Color.FromName("#E87E04"); //Rojo
e.Row.Cells[15].BackColor = System.Drawing.Color.FromName("#E87E04"); //Rojo
e.Row.Cells[16].BackColor = System.Drawing.Color.FromName("#E87E04"); //Rojo
e.Row.Cells[17].BackColor = System.Drawing.Color.FromName("#E87E04"); //Rojo
e.Row.Cells[10].BackColor = System.Drawing.Color.FromName("#900"); //Rojo
e.Row.Cells[11].BackColor = System.Drawing.Color.FromName("#900"); //Rojo
e.Row.Cells[12].BackColor = System.Drawing.Color.FromName("#900"); //Rojo
e.Row.Cells[13].BackColor = System.Drawing.Color.FromName("#900"); //Rojo
e.Row.Cells[14].BackColor = System.Drawing.Color.FromName("#900"); //Rojo
e.Row.Cells[15].BackColor = System.Drawing.Color.FromName("#900"); //Rojo
e.Row.Cells[1].ForeColor = System.Drawing.Color.FromName("white");
@@ -532,14 +538,14 @@ public partial class SAT_SolicitudesIngresoSat : ClsPaginas
e.Row.Cells[7].ForeColor = System.Drawing.Color.FromName("white");
e.Row.Cells[8].ForeColor = System.Drawing.Color.FromName("white");
e.Row.Cells[9].ForeColor = System.Drawing.Color.FromName("white");
e.Row.Cells[10].ForeColor = System.Drawing.Color.FromName("white");
e.Row.Cells[11].ForeColor = System.Drawing.Color.FromName("white");
e.Row.Cells[12].ForeColor = System.Drawing.Color.FromName("white");
e.Row.Cells[13].ForeColor = System.Drawing.Color.FromName("white");
e.Row.Cells[14].ForeColor = System.Drawing.Color.FromName("white");
e.Row.Cells[15].ForeColor = System.Drawing.Color.FromName("white");
e.Row.Cells[15].ForeColor = System.Drawing.Color.FromName("white");
e.Row.Cells[16].ForeColor = System.Drawing.Color.FromName("white");
e.Row.Cells[17].ForeColor = System.Drawing.Color.FromName("white");
}
@@ -569,9 +575,6 @@ public partial class SAT_SolicitudesIngresoSat : ClsPaginas
protected void GVSolicitudesNominas_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (e.Row.DataKey("ArchivoXML").Length > 0)
@@ -585,14 +588,150 @@ public partial class SAT_SolicitudesIngresoSat : ClsPaginas
}
}
e.Row.Attributes.Add("data-html", "true");
e.Row.Attributes.Add("data-toggle", "tooltip");
e.Row.Attributes.Add("data-placement", "top");
e.Row.Attributes.Add("title", e.Row.DataKey("Observaciones"));
}
}
private void CargaComprobanteXML(string DirectoryPath, int CveSolicitudDetalle)
{
int Contador = 0;
System.IO.DirectoryInfo DirInfo = new System.IO.DirectoryInfo(DirectoryPath);
IEnumerable<System.IO.FileInfo> files = DirInfo.EnumerateFiles();
foreach (var f in files)
{
if(f.Extension.ToUpper() == ".XML")
{
string UUID = "";
System.Xml.XmlDocument XMLDoc = new System.Xml.XmlDocument();
try
{
XMLDoc.Load(f.FullName);
}
catch (Exception ex)
{
try
{
var oReader = new System.IO.StreamReader(f.FullName, System.Text.Encoding.GetEncoding("ISO-8859-1"));
XMLDoc.Load(oReader);
oReader.Dispose();
}
catch (Exception ex2)
{
// GuardaLog("Error al intentar leer el XML del SAT. Error:" + ex2.ToString());
ModExtensiones.GuardaLog(ex2.StackTrace);
}
}
System.Xml.XmlNode nodo = XMLDoc.DocumentElement;
string Version = ValorXML(nodo, "version");
System.Xml.XmlNamespaceManager namespaces = new System.Xml.XmlNamespaceManager(XMLDoc.NameTable);
string Prefijo = XMLDoc.DocumentElement.Prefix == "" ? "cfd" : XMLDoc.DocumentElement.Prefix;
string cfdVer = "";
if (Version == "3.2")
{
Prefijo = "cfd";
cfdVer = "http://www.sat.gob.mx/cfd/2";
}
else if (Version == "3.3")
cfdVer = "http://www.sat.gob.mx/cfd/3";
else
cfdVer = "http://www.sat.gob.mx/cfd/4";
namespaces.AddNamespace(Prefijo, cfdVer);
namespaces.AddNamespace("tfd", "http://www.sat.gob.mx/TimbreFiscalDigital");
namespaces.AddNamespace("implocal", "http://www.sat.gob.mx/implocal");
namespaces.AddNamespace("registrofiscal", "http://www.sat.gob.mx/registrofiscal");
System.Xml.XmlNode node;
node = XMLDoc.SelectSingleNode(string.Format("//{0}:Emisor", Prefijo), namespaces);
System.Xml.XmlNode nodeComp = XMLDoc.SelectSingleNode(string.Format("//{0}:Complemento", Prefijo), namespaces);
if (node != null )
{
System.Xml.XmlNode nodeTFD = nodeComp.SelectSingleNode(string.Format("//{0}:TimbreFiscalDigital", "tfd"), namespaces);
UUID = ValorXML(nodeTFD, "UUID", "");
}
if (UUID.Length > 0)
{
try {
System.IO.File.Move(f.FullName, $@"{f.DirectoryName}\{UUID.ToUpper()}.XML");
Contador++;
} catch (Exception ex3)
{
ModExtensiones.GuardaLog(ex3.StackTrace);
}
//ClsNominas objNominas = new ClsNominas();
//objNominas.UpdateSolicitudDetalleCveSolicitudDetalle(UsuarioActual.CveEmpresa, UUID, CveSolicitudDetalle);
//objNominas.Dispose();
}
}
}
Alert("Archivos Renombrados ");
}
private string ValorXML(System.Xml.XmlNode n, string Campo, string Retorno = "")
{
System.Xml.XmlNode o = n.Attributes.Cast<System.Xml.XmlAttribute>().SingleOrDefault(a => string.Compare(a.Name, Campo, true) == 0);
if (o == null)
return Retorno;
else
return o.Value;
}
protected void LnkRenombrarArchivos_Click(object sender, EventArgs e)
{
GridViewRow GvRow = (GridViewRow)((LinkButton)sender).NamingContainer;
var CveSolicitudDetalle = GvRow.DataKey("CveSolicitudDetalle").ToEntero();
var UrlDirectorio = $"{UsuarioActual.Empresa.Ruta}DescargasSATXML\\Ingresos\\{CveSolicitudDetalle}";
CargaComprobanteXML(UrlDirectorio, CveSolicitudDetalle);
}
protected void LnkCFDIData_Click(object sender, EventArgs e)
{
GridViewRow GvRow = (GridViewRow)((LinkButton)sender).NamingContainer;
var CveSolicitudDetalle = GvRow.DataKey("CveSolicitudDetalle");
var UrlDescargaXML = $"{UsuarioActual.Empresa.Ruta}DescargasSATXML\\Ingresos\\{CveSolicitudDetalle}\\{GvRow.DataKey("UUID")}.XML";
var ArchivoXML = new System.IO.FileInfo(UrlDescargaXML);
if (ArchivoXML.Exists)
{
Response.Clear();
Response.AddHeader("Content-Disposition", "attachment; filename=" + ArchivoXML.Name);
Response.AddHeader("Content-Length", ArchivoXML.Length.ToString());
Response.ContentType = "text/octet-stream";
Response.Flush();
Response.TransmitFile(ArchivoXML.FullName);
Response.End();
}
}
}
@@ -601,13 +740,13 @@ public class GeneralesAPII : ADSNetLibraryzI.HelpersI.ConexionesI.SIGAPII.BaseSI
public GeneralesAPII(string domainApi = "http://localhost:4001/", string token = "") : base(domainApi, token) { }
public object GeneraSolicitud(int CveEmpresa, int CveTipoSolicitud)
public object GeneraSolicitud(int CveEmpresa, int CveTipoSolicitud, int CveSolicitud)
{
return getData<object>($"GeneraSolicitud/{CveEmpresa}/{CveTipoSolicitud}", null, ADSNetLibraryzI.HelpersI.ConexionesI.SIGAPII.requestMethod.GET, false);
return getData<object>($"GeneraSolicitud/{CveEmpresa}/{CveTipoSolicitud}/{CveSolicitud}", null, ADSNetLibraryzI.HelpersI.ConexionesI.SIGAPII.requestMethod.GET, false);
}
public object VerificaSolicitudesNominas(int CveEmpresa, int CveTipoSolicitud)
public object VerificaSolicitudesNominas(int CveEmpresa, int CveTipoSolicitud, int CveSolicitud)
{
return getData<object>($"VerificaSolicitudesNominas/{CveEmpresa}/{CveTipoSolicitud}", null, ADSNetLibraryzI.HelpersI.ConexionesI.SIGAPII.requestMethod.GET, false);
return getData<object>($"VerificaSolicitudesNominas/{CveEmpresa}/{CveTipoSolicitud}/{CveSolicitud}", null, ADSNetLibraryzI.HelpersI.ConexionesI.SIGAPII.requestMethod.GET, false);
}
}

View File

@@ -1018,6 +1018,7 @@ Partial Class RepVentaDetalle
Dim RutaFormato = String.Format("{0}Formatos\RepVentaDetalle.rdlc", UsuarioActual.Empresa.Ruta)
Dim Archivo As New System.IO.FileInfo(RutaFormato)
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
@@ -1033,14 +1034,19 @@ Partial Class RepVentaDetalle
params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
params.Add(New ReportParameter("TipoDocto", TipoDocto))
params.Add(New ReportParameter("AgrupadoPor", $"<b>Agrupado Por:</b>&nbsp;{Grupo} {TipoDocto} {FechaIn} {FechaFn} {FechaIEjec} {FechaFEjec} {CveCliente} {CveSucursal} {CveSucursalEjec} {Vendedor} {CveUsuario} {CveEstatusFactura} {CondicionesPago} "))
If Imagen.Exists Then
params.Add(New ReportParameter("LogoPath", logouri))
Else
params.Add(New ReportParameter("LogoPath", ""))
End If
If Not Archivo.Exists Then
RutaFormato = "Empresas/Grales/Formatos/RepVentaDetalle.rdlc"
End If
ImprimirPDF(RutaFormato, dt, params, String.Format("ReporteVentaDetalle-{0}", Now.ToDateTime.ToShortDateString), Formato:=Formato)
Else
Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia)