This commit is contained in:
2021-08-04 11:59:41 -07:00
64 changed files with 19028 additions and 2080 deletions

View File

@@ -682,7 +682,7 @@
</th>
<th style="width: 100px">P.U.&nbsp;</th>
<th style="width: 40px">IVA&nbsp;</th>
<th style="width: 40px">% IEPS&nbsp;</th>
<th style="width: 40px" runat="server" id="TD_Gvps_IEPS" visible="false">IEPS&nbsp;</th>
<th style="width: 110px">Total&nbsp;</th>
<div id="dvNoDeducible" runat="server" visible="false">
<th style="width: 80px">¿No Deducible?&nbsp;</th>
@@ -753,7 +753,7 @@
</ItemTemplate>
</asp:TemplateField>
<%-- 3 --%>
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-VerticalAlign="Top" ItemStyle-Width="299">
<asp:TemplateField ItemStyle-VerticalAlign="Top" ItemStyle-Width="299">
<ItemTemplate>
<div style="float: left; width: 100%;">
<span style="width: 100%; border-bottom: 1px solid gray;">
@@ -783,15 +783,15 @@
<%-- 8 --%>
<asp:TemplateField ItemStyle-HorizontalAlign="Right" ItemStyle-Width="53px">
<ItemTemplate>
<asp:Label ID="LtlIva" runat="server" Text='<%# If(Eval("IVA").ToString.Length > 0, (CDbl(Eval("IVA").ToString)).ToString("###,####,###.00"), "") %>'></asp:Label><br />
<asp:Label ID="LtlIva" runat="server" Text='<%# If(Eval("IVA").ToString.Length > 0, If((CDbl(Eval("IVA").ToString)) > 0, (CDbl(Eval("IVA").ToString)).ToString("###,####,###.00"), ""), "") %>'></asp:Label><br />
<asp:Label ID="LblIVAPorcentaje" runat="server" Text='<%# String.Format("{0} {1}", (CDbl(Eval("IVAPorcentaje").ToString) * 100).ToString("#####"), If(CDbl(Eval("IVAPorcentaje").ToString) * 100 > 0, "%", "")) %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<%-- 9 --%>
<asp:TemplateField ItemStyle-HorizontalAlign="Right" ItemStyle-Width="53px">
<asp:TemplateField ItemStyle-HorizontalAlign="Right" ItemStyle-Width="53px" Visible="false">
<ItemTemplate>
<asp:Label ID="LtlIEPSPSPorcentaje" runat="server" Text='<%# If(Eval("IEPSPSPorcentaje").ToString.Length > 0, (CDbl(Eval("IEPSPSPorcentaje").ToString) * 100).ToString("#####") & If(CDbl(Eval("IEPSPSPorcentaje").ToString) * 100 > 0, "%", ""), "") %>'></asp:Label>
<%--<asp:Label ID="Label10" runat="server" Text='<%# Eval("IEPSPSPorcentaje").ToString %>'></asp:Label>--%>
<asp:Label ID="LtlIEPSPS" runat="server" Text='<%# If(Eval("IEPSPS").ToString.Length > 0, If((CDbl(Eval("IEPSPS").ToString)) > 0, (CDbl(Eval("IEPSPS").ToString)).ToString("###,####,###.00"), ""), "") %>'></asp:Label><br />
<asp:Label ID="LtlIEPSPSPorcentaje" runat="server" Text='<%# If(Eval("IEPSPSPorcentaje").ToString.Length > 0, (CDbl(Eval("IEPSPSPorcentaje").ToString) * 100).ToString("#####") & If(CDbl(Eval("IEPSPSPorcentaje").ToString) * 100 > 0, "%", ""), "") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
@@ -1589,7 +1589,7 @@
<asp:GridView runat="server" ID="GvOC1" AutoGenerateColumns="false"
GridLines="None" UseAccessibleHeader="true" EmptyDataText="No se encontraron registros." CssClass="table table-striped table-hover Widthall Sortable" RowStyle-HorizontalAlign="Center"
DataKeyNames="CantidadF,FolioREQ,CveProveedorSucursal,CveTipoPS,PS,CantidadPendienteVincular,IEPSPS,IVA,RetIVA,RetISR,Descuento,IVAPorcentaje,RetIVAPorcentaje,RetISRPorcentaje,IEPSPSPorcentaje,IEPSPSIVAPorcentaje,Cantidad,CveProveedorOC,Importe">
DataKeyNames="CantidadF,FolioREQ,CveProveedorSucursal,CveTipoPS,PS,CantidadPendienteVincular,IEPSPS,IVA,RetIVA,RetISR,Descuento,IVAPorcentaje,RetIVAPorcentaje,RetISRPorcentaje,IEPSPSPorcentaje,IEPSPSIVAPorcentaje,Cantidad,CveProveedorOC,Importe,CveSATPS">
<Columns>
<asp:TemplateField HeaderText="Folio" ItemStyle-Width="10%" Visible="false">

View File

@@ -1548,8 +1548,8 @@ Partial Class Compras_Compras
End If
'SE OCUPAN AFUERA DEL POSTBACK ??
cargaddlVinculacionServcios()
'SE OCUPAN AFUERA DEL POSTBACK ??
cargaddlVinculacionServcios()
If UsuarioActual.TienePermisoProceso(117) Then
HplAddClasificacion.Visible = False
@@ -1574,9 +1574,30 @@ Partial Class Compras_Compras
End If
MostrarOcultarColumnaIEPS()
End Sub
#Region "C A R G A S"
Private Sub MostrarOcultarColumnaIEPS()
If TxtIEPS.Text.ToDecimal <> 0 And TmpDT.SUM("IEPSPS") <> 0 Then
GvPS.Columns(9).Visible = True
TD_Gvps_IEPS.Visible = True
Else
GvPS.Columns(9).Visible = False
TD_Gvps_IEPS.Visible = False
End If
UpPS.Update()
End Sub
Private Sub CargaOrdenCorte()
Dim ObjCGame As New ClsCGame()
If ObjCGame.GetOrdenCorte(UsuarioActual.CveEmpresa) Then
@@ -1734,7 +1755,7 @@ Partial Class Compras_Compras
Xml.Append(Replace(Replace(Replace(nodeconceptos.OuterXml, "<cfdi:", "<"), "</cfdi:", "</"), "xmlns:cfdi=""http://www.sat.gob.mx/cfd/3""", ""))
If ObjeFacturas.GetFacturasComparacionXML(Version, Xml.ToString, UsuarioActual.CveEmpresa) Then
TmpDT = ObjeFacturas.DtResultados
'TmpDT.Columns.Add("IVAPorcentaje")
TmpDT.Columns.Add("CveSATPSActualizado")
'TmpDT.Columns.Add("RetIVAPorcentaje")
'TmpDT.Columns.Add("RetISRPorcentaje")
'TmpDT.Columns.Add("IEPSPSPorcentaje")
@@ -2681,6 +2702,9 @@ Partial Class Compras_Compras
TmpDT.Columns.Add("CveCultivoCuadroDetalle", GetType(Integer))
End If
If Not TmpDT.Columns.Contains("CveSATPSActualizado") Then
TmpDT.Columns.Add("CveSATPSActualizado", GetType(Integer))
End If
GvPS.DataSource = TmpDT
GvPS.DataBind()
@@ -4361,8 +4385,6 @@ Partial Class Compras_Compras
Exit Sub
End If
'------------------TERMINA VALIDACIONES------------------
'si hay necesidad de actualizar el globaldtps
@@ -5143,9 +5165,12 @@ Partial Class Compras_Compras
'ACTUALIZAR PRODUCTO/SERVICIO SAT
If Version = "3.3" Then
If Not ObjProductosServicios.UpdateProductosServiciosSAT(Row("CvePS").ToString().ToEntero(), Row("CveSATPS").ToString().ToEntero(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
ErrorSATPS = True
If Row("CveSATPSActualizado").ToString().ToEntero() = 1 Then
If Not ObjProductosServicios.UpdateProductosServiciosSAT(Row("CvePS").ToString().ToEntero(), Row("CveSATPS").ToString().ToEntero(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
ErrorSATPS = True
End If
End If
End If
indiceTR += 1
@@ -8640,6 +8665,16 @@ Partial Class Compras_Compras
End If
For Each dRow As DataRow In TmpDT.Rows
If dRow("IEPSPSPorcentaje").ToString.ToDecimal > 0 AndAlso dRow("IEPSPS").ToString.ToDecimal = 0 Then
dRow("IEPSPSPorcentaje") = 0
End If
Next
TmpDT.AcceptChanges()
End If
@@ -11437,6 +11472,8 @@ Partial Class Compras_Compras
TmpDT.Columns.Add("SATClaveProductoServicio", GetType(String))
TmpDT.Columns.Add("CveUnidadMedidaSAT", GetType(Integer))
TmpDT.Columns.Add("SATClaveUnidadMedida", GetType(String))
TmpDT.Columns.Add("CveSATPSActualizado", GetType(Integer))
'Tipo de Gasto
TmpDT.Columns.Add("CveTipoGasto", GetType(Integer))
@@ -11549,6 +11586,7 @@ Partial Class Compras_Compras
TmpDTOriginal.Columns.Add("SATClaveProductoServicio", GetType(String))
TmpDTOriginal.Columns.Add("CveUnidadMedidaSAT", GetType(Integer))
TmpDTOriginal.Columns.Add("SATClaveUnidadMedida", GetType(String))
TmpDTOriginal.Columns.Add("CveSATPSActualizado", GetType(Integer))
'Tipo de Gasto
TmpDTOriginal.Columns.Add("CveTipoGasto", GetType(Integer))
@@ -15948,7 +15986,7 @@ Partial Class Compras_Compras
Dim TipoGasto As String = dr("TipoGasto").ToString
Dim CveContratoDetalle As Integer = dr("CveContratoDetalle").ToString.ToEntero
Dim CveCultivoCuadroDetalle As Integer = dr("CveCultivoCuadroDetalle").ToString.ToEntero
Dim CveSATPSActualizado As Boolean = gvr.FCDropDownLost("DdlSATPS").SelectedValue.ToEntero <> dr("CveSATPS").ToString.ToEntero
'[IPP] PROVISIONAL PARA TIPO GASTO
If GlobalDTTiposGastos(UsuarioActual.CveEmpresa) IsNot Nothing AndAlso GlobalDTTiposGastos(UsuarioActual.CveEmpresa).Rows.Count = 1 Then
Dim DrTipoGasto = GlobalDTTiposGastos(UsuarioActual.CveEmpresa).FiltroPrimero("")
@@ -15959,7 +15997,7 @@ Partial Class Compras_Compras
End If
AddPS(Cantidad, CveUM, UM, CveClasificacion, Clasificacion, CvePS, PS, CveTipoPS, CveSubProyectoContrato, SubProyecto, Proyecto, CveProyecto, Obs, PU, Total, IVA, RetIVA, RetISR, IEPSPS, IEPSPSIVA, Descuento, CveOrdenCompraDetalle, False,
CantidadF:=CantidadF, EntregaDirecta:=EntregaDirecta, CveSATPS:=CveSATPS, CveTipoGasto:=CveTipoGasto, TipoGasto:=TipoGasto, CveContratoDetalle:=CveContratoDetalle, CveCultivoCuadroDetalle:=CveCultivoCuadroDetalle)
CantidadF:=CantidadF, EntregaDirecta:=EntregaDirecta, CveSATPS:=CveSATPS, CveTipoGasto:=CveTipoGasto, TipoGasto:=TipoGasto, CveContratoDetalle:=CveContratoDetalle, CveCultivoCuadroDetalle:=CveCultivoCuadroDetalle, CveSATPSActualizado:=CveSATPSActualizado)
'CARGA PE
Index = TmpDT.Rows.Count - 1
@@ -18267,7 +18305,11 @@ Partial Class Compras_Compras
End If
UpPS.Update()
CargaGvPersonal()
CargaGvPersonal()
MostrarOcultarColumnaIEPS()
End Sub
''' <summary>
''' Regresa el INDEX del row que acaba de agregar en el TMPDT
@@ -18277,7 +18319,7 @@ Partial Class Compras_Compras
Obs As String, PU As Double, Total As Double, IVA As Double, RetIVA As Double, RetISR As Double, IEPSPS As Double, IEPSPSIVA As Double, Descuento As Double, Optional CveOrdenCompraDetalle As Integer = -1, Optional TCalculaTotales As Boolean = True,
Optional PSCodigo As String = "-", Optional PSDescripcion As String = "-", Optional CantidadF As Double = -1, Optional EntregaDirecta As Integer = -1, Optional OtrosGastos As Double = 0,
Optional CveSATPS As Integer = -1, Optional CargaXml As Boolean = False, Optional CveTipoGasto As Integer = -1, Optional TipoGasto As String = "", Optional PorcentajeIVA As Double = 0,
Optional PorcentajeIEPS As Double = 0, Optional PorcentajeRetIVA As Double = 0, Optional PorcentajeRetISR As Double = 0, Optional NoDeducible As Boolean = False, Optional CveContratoDetalle As Integer = -1, Optional CveCultivoCuadroDetalle As Integer = -1) As Integer
Optional PorcentajeIEPS As Double = 0, Optional PorcentajeRetIVA As Double = 0, Optional PorcentajeRetISR As Double = 0, Optional NoDeducible As Boolean = False, Optional CveContratoDetalle As Integer = -1, Optional CveCultivoCuadroDetalle As Integer = -1, Optional CveSATPSActualizado As Boolean = False) As Integer
Dim Row As DataRow = Nothing
@@ -18332,6 +18374,13 @@ Partial Class Compras_Compras
If DrPSSAT IsNot Nothing Then
Row("SATClaveProductoServicio") = DrPSSAT("SATClaveProductoServicio").ToString
Row("CveSATPS") = DrPSSAT("CveSATPS").ToString
If CveSATPSActualizado Then
Row("CveSATPSActualizado") = 1
Else
Row("CveSATPSActualizado") = 0
End If
End If
End If
@@ -18492,6 +18541,7 @@ Partial Class Compras_Compras
DrPS("CveTipoPS") = PSRow("CveTipoPS").ToString.ToEntero
DrPS("CveSATPS") = PSRow("CveSATPS").ToString.ToEntero
DrPS("SATClaveProductoServicio") = PSRow("SATClaveProductoServicio").ToString
DrPS("CveSATPSActualizado") = 0
'RESPETAR VALORES DE LA PANTALLA
'IVA = PSRow("IVA").ToString.ToDouble
@@ -18774,6 +18824,7 @@ Partial Class Compras_Compras
TmpDT.Rows(HdnAliasInd.Value.ToEntero)("Obs") = TxtPSAlias.Text.Trim
TmpDT.Rows(HdnAliasInd.Value.ToEntero)("CveSATPS") = HdnPSAliasCveSATPS.Value.ToEntero
TmpDT.Rows(HdnAliasInd.Value.ToEntero)("SATClaveProductoServicio") = HdnPSAliasSATClavePS.Value
TmpDT.Rows(HdnAliasInd.Value.ToEntero)("CveSATPSActualizado") = 0
'busco si el producto está en otros renglones QUE NO LO TENGAN ASIGNADO, LO VINCULE
For Each drt As DataRow In TmpDT.Select($"PS ='{TxtPSAlias.Text.Trim}' and ISNULL(CvePS,0) = 0")
@@ -18786,6 +18837,8 @@ Partial Class Compras_Compras
drt("Obs") = TxtPSAlias.Text.Trim
drt("CveSATPS") = HdnPSAliasCveSATPS.Value.ToEntero
drt("SATClaveProductoServicio") = HdnPSAliasSATClavePS.Value
drt("CveSATPSActualizado") = 0
Next
TmpDT.AcceptChanges()
@@ -19772,6 +19825,9 @@ Partial Class Compras_Compras
Alert("Debe seleccionar al menos un impuesto", TipoMensaje.MsgAdvertencia)
End If
MostrarOcultarColumnaIEPS()
End Sub
#End Region

View File

@@ -2788,7 +2788,7 @@ Partial Class Compras_eFacturas
XMLNodosPagosModalCount = 0
Dim XMLDoc As New XmlDocument
Dim Archivo As String = String.Format("{0}Compras\{2}\{3}", UsuarioActual.Empresa.Ruta, gvRow.DataKey("RFCDe"), gvRow.DataKey("XML"))
Dim Archivo As String = String.Format("{0}Compras\{1}\{2}", UsuarioActual.Empresa.Ruta, gvRow.DataKey("RFCDe"), gvRow.DataKey("XML"))
If IO.File.Exists(Archivo) Then