Error al timbrar la primera vez un ingreso cuando tiene impuestos locales

This commit is contained in:
2020-02-12 18:05:10 -07:00
parent 7d907ebb3e
commit 6fc5f29b71
2 changed files with 39 additions and 27 deletions

View File

@@ -7444,8 +7444,8 @@ Partial Class Ventas
For Each gvr As GridViewRow In GvImpuestosLocales2.Rows For Each gvr As GridViewRow In GvImpuestosLocales2.Rows
If gvr.RowType = DataControlRowType.DataRow Then If gvr.RowType = DataControlRowType.DataRow Then
Dim Orden As Integer = 80 Dim Orden As Integer = 80
If gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDouble > 0 Then If gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDecimal > 0 Then
DR("ImpuestoLocal") = gvr.DataKey("ImpuestoLocal").ToString : DR("Importe") = gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDouble : DR("Orden") = Orden : DR("Porcentaje") = gvr.DataKey("Porcentaje").ToString : DR("TipoImpuesto") = gvr.DataKey("TipoImpuesto").ToString : DR("IdCtaContable") = gvr.DataKey("IdCtaContable").ToString.ToEntero : TmpDTImpuestos.Rows.Add(DR) DR("ImpuestoLocal") = gvr.DataKey("ImpuestoLocal").ToString : DR("Importe") = gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDecimal.RoundSQL(2) : DR("Orden") = Orden : DR("Porcentaje") = gvr.DataKey("Porcentaje").ToString : DR("TipoImpuesto") = gvr.DataKey("TipoImpuesto").ToString : DR("IdCtaContable") = gvr.DataKey("IdCtaContable").ToString.ToEntero : TmpDTImpuestos.Rows.Add(DR)
DR = TmpDTImpuestos.NewRow() DR = TmpDTImpuestos.NewRow()
Orden = Orden + 1 Orden = Orden + 1
End If End If
@@ -8266,7 +8266,12 @@ Partial Class Ventas
For Each DrImpuestosLocales As DataRow In TmpDTImpuestos.FiltraParametros("TipoImpuesto = 1").Rows For Each DrImpuestosLocales As DataRow In TmpDTImpuestos.FiltraParametros("TipoImpuesto = 1").Rows
If DrImpuestosLocales("Importe").ToString.ToDecimal > 0 Then If DrImpuestosLocales("Importe").ToString.ToDecimal > 0 Then
Dim ret As New CFDIRetencionesLocales With {.TasaRetencion = DrImpuestosLocales("Porcentaje").ToString.ToDecimal, .ImpuestoLocalRetenido = DrImpuestosLocales("ImpuestoLocal").ToString, .Importe = DrImpuestosLocales("Importe").ToString.ToDecimal(If(ObjFactura.ConvertirPesos, ObjFactura.TipoCambio, 1))} Dim ret As New CFDIRetencionesLocales With
{
.TasaRetencion = DrImpuestosLocales("Porcentaje").ToString.ToDecimal,
.ImpuestoLocalRetenido = DrImpuestosLocales("ImpuestoLocal").ToString,
.Importe = DrImpuestosLocales("Importe").ToString.ToDecimal(If(ObjFactura.ConvertirPesos, ObjFactura.TipoCambio, 1)).RoundSQL(2)
}
ObjFactura.Timbre.RetencionesLocales.Add(ret) ObjFactura.Timbre.RetencionesLocales.Add(ret)
End If End If
Next Next
@@ -18429,8 +18434,10 @@ Partial Class Ventas
'Else 'Else
'End If 'End If
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Dev", "Egs", "RNC") Then If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Dev", "Egs", "RNC") Then
'SI ES PRODUCCION VERIFICA EL ESTATUS ANTE EL SAT
If UsuarioActual.Empresa.FacturaProduccion AndAlso Not FolioFiscal.Contains("test") Then
Dim sb As New StringBuilder() Dim sb As New StringBuilder()
sb.Append("La factura se encuentra en el siguiente estatus del SAT:<br/>") sb.Append("La factura se encuentra en el siguiente estatus del SAT:<br/>")
@@ -18461,6 +18468,9 @@ Partial Class Ventas
RegistraScript("$('#ModalCancelarDocumento').modal();") RegistraScript("$('#ModalCancelarDocumento').modal();")
UpCancelarDocumento.Update() UpCancelarDocumento.Update()
Else
CancelarDocumento()
End If
Else Else
CancelarDocumento() CancelarDocumento()

View File

@@ -15,6 +15,8 @@
<Service ID="{C0C07587-41A7-46C8-8FBD-3F9C8EBE2DDC}"/> <Service ID="{C0C07587-41A7-46C8-8FBD-3F9C8EBE2DDC}"/>
</StartupServices> </StartupServices>
</VisualWebDeveloper> </VisualWebDeveloper>