--Impuestos locales ligados a la factura. agregar desde proceso prepolizas, comentar el "solo cancelar cfdi"

This commit is contained in:
2023-12-01 14:51:09 -07:00
parent c8b5cd19cb
commit 5eb743c874
2 changed files with 34 additions and 34 deletions

View File

@@ -378,9 +378,9 @@
<li> <li>
<asp:LinkButton ID="LnkSolicitarCredito" Visible="false" runat="server"><i class="fa fa-plus"></i>Solicitar autorización de crédito</asp:LinkButton> <asp:LinkButton ID="LnkSolicitarCredito" Visible="false" runat="server"><i class="fa fa-plus"></i>Solicitar autorización de crédito</asp:LinkButton>
</li> </li>
<li> <%-- <li>
<asp:LinkButton ID="LnkCancelarSoloCFDI" Visible="false" runat="server" data-toggle="confirmation" data-popout="true" data-original-title="¿Seguro que desea cancelar el CFDI?" data-btn-ok-label="si" OnClick="LnkCancelarSoloCFDI_Click"><i class="fa fa-plus"></i>Cancelar solo CFDI</asp:LinkButton> <asp:LinkButton ID="LnkCancelarSoloCFDI" Visible="false" runat="server" data-toggle="confirmation" data-popout="true" data-original-title="¿Seguro que desea cancelar el CFDI?" data-btn-ok-label="si" OnClick="LnkCancelarSoloCFDI_Click"><i class="fa fa-plus"></i>Cancelar solo CFDI</asp:LinkButton>
</li> </li>--%>
</ContentTemplate> </ContentTemplate>
<Triggers> <Triggers>
<asp:AsyncPostBackTrigger ControlID="LnkImprimir" EventName="Click" /> <asp:AsyncPostBackTrigger ControlID="LnkImprimir" EventName="Click" />

View File

@@ -12031,6 +12031,8 @@ Partial Class Ventas
End If End If
ObjFactura.DtMercancias = DtMercancias ObjFactura.DtMercancias = DtMercancias
ObjFactura.DtImpuestosLocales = TmpDTImpuestos
End Sub End Sub
Private Sub CreaObjetosVentaDevolucion() Private Sub CreaObjetosVentaDevolucion()
@@ -13693,16 +13695,6 @@ Partial Class Ventas
If Me.CveContratoTipo <> 33 Then If Me.CveContratoTipo <> 33 Then
GuardarVentaEstimaciones(ObjContr, factura) GuardarVentaEstimaciones(ObjContr, factura)
End If End If
If ErrorList.Count = 0 Then
'armonizaccionContable
'GuardarVentaAC(ObjVentas, factura, Msgok)
If ErrorList.Count = 0 Then
'Impuestos Locales
If GuardarVentaImpuestosLocales(ObjVentas, ObjConta, factura) Then
ErrorList.Add("Ocurrio un error al Guardar Impuestos Locales")
End If
End If
End If
End If End If
End If End If
End If End If
@@ -14914,6 +14906,14 @@ Partial Class Ventas
End If End If
End If End If
'Impuestos Locales
If Not ErrorPrepoliza Then
If GuardarVentaImpuestosLocales(ObjVentas, ObjConta, ObjFactura, ValorMultiplicador:=ValorMultiplicador) Then
ErrorPrepoliza = True
ErrorList.Add("Ocurrio un error al Guardar Impuestos Locales")
End If
End If
If ObjConta.ValidacionesPrePoliza(ObjFactura.CvePrePoliza, UsuarioActual, Opcion:=2, AutoConta:=AutoConta) Then If ObjConta.ValidacionesPrePoliza(ObjFactura.CvePrePoliza, UsuarioActual, Opcion:=2, AutoConta:=AutoConta) Then
If ObjConta.ValorPolizaDescuadre > 0 Then If ObjConta.ValorPolizaDescuadre > 0 Then
If ObjConta.ValorPolizaDescuadre = 2 Then If ObjConta.ValorPolizaDescuadre = 2 Then
@@ -15293,14 +15293,14 @@ Partial Class Ventas
Private Function GuardarVentaImpuestosLocales(ObjVentas As ClsVentas, ObjConta As ClsContabilidad, Factura As Modelos.Factura, Optional ValorMultiplicador As Integer = 1) As Boolean Private Function GuardarVentaImpuestosLocales(ObjVentas As ClsVentas, ObjConta As ClsContabilidad, Factura As Modelos.Factura, Optional ValorMultiplicador As Integer = 1) As Boolean
Dim ErrorPrepoliza As Boolean = False Dim ErrorPrepoliza As Boolean = False
If TmpDTImpuestos IsNot Nothing AndAlso Factura.CvePrePoliza > 0 AndAlso Not DdlTipoComprobante.SelectedValue.Contiene("Cot", "Rem") Then If Factura.DtImpuestosLocales IsNot Nothing AndAlso Factura.CvePrePoliza > 0 AndAlso Not Factura.TipoDocto.Contiene("Cot", "Rem") Then
Dim Importe As Decimal Dim Importe As Decimal
Dim Concepto As String Dim Concepto As String
Dim tipoCambio As Decimal Dim tipoCambio As Decimal
Dim CveSubProyectoContabilizar As Integer = DdlSubProyectoDatos.SelectedValue.ToEntero() Dim CveSubProyectoContabilizar As Integer = DdlSubProyectoDatos.SelectedValue.ToEntero()
For Each RowIL As DataRow In TmpDTImpuestos.Rows For Each RowIL As DataRow In Factura.DtImpuestosLocales.Rows
If RowIL("TipoImpuesto").ToString().ToEntero() > 0 Then If RowIL("TipoImpuesto").ToString().ToEntero() > 0 Then
Importe = RowIL("Importe").ToString().ToDecimal * ValorMultiplicador Importe = RowIL("Importe").ToString().ToDecimal * ValorMultiplicador
@@ -35740,32 +35740,32 @@ Partial Class Ventas
#End Region #End Region
Protected Sub LnkCancelarSoloCFDI_Click(sender As Object, e As EventArgs) 'Protected Sub LnkCancelarSoloCFDI_Click(sender As Object, e As EventArgs)
If CveVenta > 0 Then ' If CveVenta > 0 Then
Dim RowVenta As DataRow = Nothing ' Dim RowVenta As DataRow = Nothing
Using ObjVentas As New ClsVentas ' Using ObjVentas As New ClsVentas
If (ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa)) Then ' If (ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa)) Then
RowVenta = ObjVentas.DtResultados.Copy().Rows(0) ' RowVenta = ObjVentas.DtResultados.Copy().Rows(0)
End If ' End If
End Using ' End Using
If RowVenta IsNot Nothing Then ' If RowVenta IsNot Nothing Then
Dim FolioFiscal As String = RowVenta("FolioFiscal").ToString().Trim() ' Dim FolioFiscal As String = RowVenta("FolioFiscal").ToString().Trim()
Dim Total As Decimal = RowVenta("Total").ToString().ToDecimal() ' Dim Total As Decimal = RowVenta("Total").ToString().ToDecimal()
Dim RFCReceptor As String = RowVenta("RFCReceptor").ToString() ' Dim RFCReceptor As String = RowVenta("RFCReceptor").ToString()
Dim ObjTimbrado As New Timbrado ' Dim ObjTimbrado As New Timbrado
Dim resp = ObjTimbrado.CFDICancelar(UsuarioActual.Empresa, FolioFiscal, Total, RFCReceptor, UsuarioActual.Empresa.RFC, CvePACCancelacion:=4, ValidaFactura:=False, CveSATMotivoCancelacion:=2) ' Dim resp = ObjTimbrado.CFDICancelar(UsuarioActual.Empresa, FolioFiscal, Total, RFCReceptor, UsuarioActual.Empresa.RFC, CvePACCancelacion:=4, ValidaFactura:=False, CveSATMotivoCancelacion:=2)
If resp IsNot Nothing Then ' If resp IsNot Nothing Then
Alert(resp.Estado) ' Alert(resp.Estado)
End If ' End If
End If ' End If
End If ' End If
End Sub 'End Sub
End Class End Class