diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx index 628e7c404..dcc9544ea 100644 --- a/Ventas/Ventas.aspx +++ b/Ventas/Ventas.aspx @@ -378,9 +378,9 @@
  • Solicitar autorización de crédito
  • -
  • +<%--
  • Cancelar solo CFDI -
  • + --%> diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 476164075..c80df0e69 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -12031,6 +12031,8 @@ Partial Class Ventas End If ObjFactura.DtMercancias = DtMercancias + + ObjFactura.DtImpuestosLocales = TmpDTImpuestos End Sub Private Sub CreaObjetosVentaDevolucion() @@ -13693,16 +13695,6 @@ Partial Class Ventas If Me.CveContratoTipo <> 33 Then GuardarVentaEstimaciones(ObjContr, factura) 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 @@ -14914,6 +14906,14 @@ Partial Class Ventas 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.ValorPolizaDescuadre > 0 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 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 Concepto As String Dim tipoCambio As Decimal 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 Importe = RowIL("Importe").ToString().ToDecimal * ValorMultiplicador @@ -35740,32 +35740,32 @@ Partial Class Ventas #End Region - Protected Sub LnkCancelarSoloCFDI_Click(sender As Object, e As EventArgs) - If CveVenta > 0 Then - Dim RowVenta As DataRow = Nothing + 'Protected Sub LnkCancelarSoloCFDI_Click(sender As Object, e As EventArgs) + ' If CveVenta > 0 Then + ' Dim RowVenta As DataRow = Nothing - Using ObjVentas As New ClsVentas - If (ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa)) Then - RowVenta = ObjVentas.DtResultados.Copy().Rows(0) - End If - End Using + ' Using ObjVentas As New ClsVentas + ' If (ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa)) Then + ' RowVenta = ObjVentas.DtResultados.Copy().Rows(0) + ' End If + ' End Using - If RowVenta IsNot Nothing Then - Dim FolioFiscal As String = RowVenta("FolioFiscal").ToString().Trim() - Dim Total As Decimal = RowVenta("Total").ToString().ToDecimal() - Dim RFCReceptor As String = RowVenta("RFCReceptor").ToString() - Dim ObjTimbrado As New Timbrado - Dim resp = ObjTimbrado.CFDICancelar(UsuarioActual.Empresa, FolioFiscal, Total, RFCReceptor, UsuarioActual.Empresa.RFC, CvePACCancelacion:=4, ValidaFactura:=False, CveSATMotivoCancelacion:=2) - If resp IsNot Nothing Then - Alert(resp.Estado) - End If + ' If RowVenta IsNot Nothing Then + ' Dim FolioFiscal As String = RowVenta("FolioFiscal").ToString().Trim() + ' Dim Total As Decimal = RowVenta("Total").ToString().ToDecimal() + ' Dim RFCReceptor As String = RowVenta("RFCReceptor").ToString() + ' Dim ObjTimbrado As New Timbrado + ' Dim resp = ObjTimbrado.CFDICancelar(UsuarioActual.Empresa, FolioFiscal, Total, RFCReceptor, UsuarioActual.Empresa.RFC, CvePACCancelacion:=4, ValidaFactura:=False, CveSATMotivoCancelacion:=2) + ' If resp IsNot Nothing Then + ' Alert(resp.Estado) + ' End If - End If - End If + ' End If + ' End If - End Sub + 'End Sub End Class