Compras marcar partidas con PSSAT diferente entre xml y producto alias

This commit is contained in:
Rakcsle Supertramp
2020-07-22 18:36:18 -07:00
parent d25ea575c1
commit 6a08571130
9 changed files with 99 additions and 40 deletions

View File

@@ -682,7 +682,7 @@
</asp:Panel>
<asp:GridView ID="GvPS" ShowHeader="false" runat="server" AutoGenerateColumns="False" DataKeyNames="CvePS,Cantidad,CveUM,UM,PU,Descuento,OtrosGastos,CvePresupuestoEgreso,PS,Clasificacion,CveClasificacion,CveOrdenCompraDetalle,IVA,IVAPorcentaje,RetIVAPorcentaje,RetISRPorcentaje,IEPSPSPorcentaje,Obs,Total,CveProyecto,CveSubProyecto,Proyecto,SubProyecto,Consec,CveTipoGasto,NoDeducible" GridLines="none" BorderWidth="0" EmptyDataText="Sin Productos o Servicios agregados" CssClass="table GvPS table-striped table-hover table-advance Widthall ScrollAD mysmallbtn">
<asp:GridView ID="GvPS" ShowHeader="false" runat="server" AutoGenerateColumns="False" DataKeyNames="CvePS,Cantidad,CveUM,UM,PU,Descuento,OtrosGastos,CvePresupuestoEgreso,PS,Clasificacion,CveClasificacion,CveOrdenCompraDetalle,IVA,IVAPorcentaje,RetIVAPorcentaje,RetISRPorcentaje,IEPSPSPorcentaje,Obs,Total,CveProyecto,CveSubProyecto,Proyecto,SubProyecto,Consec,CveTipoGasto,NoDeducible,DifPSSat" GridLines="none" BorderWidth="0" EmptyDataText="Sin Productos o Servicios agregados" CssClass="table GvPS table-striped table-hover table-advance Widthall ScrollAD mysmallbtn">
<Columns>
<%-- 0 --%>
<asp:TemplateField ItemStyle-Width="15px">

View File

@@ -1511,6 +1511,8 @@ Partial Class Compras_Compras
CargaFletesAgregados()
End If
InicializaOC()
'Valida si el IVA del XML es está bien calculado
@@ -2396,6 +2398,8 @@ Partial Class Compras_Compras
EstatusAlmacen = dr("EstatusAlmacen").ToString.ToEntero
DdlTipoCompra.SelectedValueExist(dr("CveTipoCompra"))
CveTipoConcepto = dr("CveTipoConcepto").ToString.ToEntero
ChkEsNoDeducible.Checked = Boolean.Parse(dr("NoDeducible").ToString)
'Select Case dr("PorcentajeIVA").ToString.ToDouble
' Case 0
' DdlIVA.SelectedValue = "1"
@@ -2620,6 +2624,7 @@ Partial Class Compras_Compras
TmpDT.Columns.Add("EntregaDirecta", GetType(Integer))
TmpDT.Columns.Add("CveContrato", GetType(Integer))
TmpDT.Columns.Add("DifPSSat", GetType(Integer))
@@ -3612,6 +3617,7 @@ Partial Class Compras_Compras
tPSCodigo = String.Format("{1} - {0}", ValorXML(node, "descripcion").ToUpper.Trim.Replace(vbCrLf, " ").Replace(vbLf, " ").Replace("'", "''"), ValorXML(node, "noIdentificacion").Trim)
End If
'Alert(ValorXML(node, "ClaveProdServ").Trim)
If Version = "3.3" Then
If node IsNot Nothing AndAlso node.ChildNodes.Count > 0 Then
@@ -3721,6 +3727,8 @@ Partial Class Compras_Compras
'AGREGA A TMPDT
AddPS(ValorXML(node, "cantidad").ToDouble, CveUM, UMM, tCveClasif, Clasif, tCvePS, PSS, TipoPS, "-1", "SE", "SE", "-1", Obs, PU, Total, IVA, RetIVA, RetISR, IEPS, 0, Descuento, PSCodigo:=tPSCodigo, TCalculaTotales:=False, CveSATPS:=ValorXML(node, "ClaveProdServ").ToEntero(), CargaXml:=True, PorcentajeIVA:=PorcentajeIVA, PorcentajeRetIVA:=PorcentajeRetIVA, PorcentajeRetISR:=PorcentajeRetISR, PorcentajeIEPS:=PorcentajeIEPS)
Next
End If
@@ -4484,6 +4492,17 @@ Partial Class Compras_Compras
'si el registro es manual, toma el mismo dato
If CveFactura <= 0 Then TotalOriginal = TxtTotal.Text.ToDecimal
For Each GvRow As GridViewRow In GvPS.Rows
If GvRow.RowType = DataControlRowType.DataRow Then
If GvRow.FCCheckBox("ChkEsNoDeduciblePS").Checked = False Then
EsNoDeducible = False
Exit For
End If
End If
Next
'Compra
If ObjCompras.AddCompra(DdlTipoComprobante.SelectedValue, TxtDescripcion.Text.Trim, TxtSerie.Text.Trim, TxtFolio.Text.Trim, TxtFolioSecundario.Text.Trim, CveProveedor, TxtSubTotal.Text.ToDouble, TxtDescuento.Text.ToDouble,
LblAmortizacion.Text.ToDouble, TxtIVA.Text.ToDouble, TxtRetIVA.Text.ToDouble, TxtRetISR.Text.ToDouble, TxtIEPS.Text.ToDouble, TxtOtrosImpuestos.Text.ToDouble,
@@ -10755,6 +10774,14 @@ Partial Class Compras_Compras
End If
If e.Row.DataKey("DifPSSat").ToEntero = 1 Then
'#e35b5a
e.Row.BackColor = Drawing.Color.FromArgb(1, 227, 91, 90)
e.Row.Attributes.Add("data-toggle", "tooltip")
e.Row.Attributes.Add("title", "El código del producto del SAT no es igual al código del producto registrado.")
End If
End If
End Sub
Protected Sub GvPS_RowDeleting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvPS.RowDeleting
@@ -11018,6 +11045,8 @@ Partial Class Compras_Compras
TmpDT.Columns.Add("ImporteConImpuestos", GetType(Double))
TmpDT.Columns.Add("NoDeducible", GetType(Boolean))
TmpDT.Columns.Add("DifPSSat", GetType(Integer))
TmpDTOriginal = New DataTable
TmpDTOriginal.Columns.Add("Consec", GetType(Integer))
TmpDTOriginal.Columns.Add("Cantidad", GetType(Decimal))