Cancelacion de anticipos,timbrado de retenciones al 6%
This commit is contained in:
@@ -368,7 +368,7 @@ Namespace Modelos
|
||||
End If
|
||||
Timbre = New CFDITimbre
|
||||
End Sub
|
||||
Public Sub New(UsuarioActual As Usuario, CveVenta As Integer, CveEmpresa As Integer, Optional DirectorioServidor As String = "")
|
||||
Public Sub New(UsuarioActual As Usuario, CveVenta As Integer, CveEmpresa As Integer, Optional DirectorioServidor As String = "", Optional EsCancelacion As Boolean = False)
|
||||
Me.UsuarioActual = UsuarioActual
|
||||
Me.CveVenta = CveVenta
|
||||
Me.CveEmpresa = CveEmpresa
|
||||
@@ -393,7 +393,7 @@ Namespace Modelos
|
||||
Me.DtDetalle = ObjVentas.DtResultados.Copy()
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
IniciaValoresVentas()
|
||||
IniciaValoresVentas(EsCancelacion)
|
||||
If String.IsNullOrEmpty(DirectorioServidor) Then
|
||||
DirectorioServidor = HttpContext.Current.Server.MapPath("/")
|
||||
End If
|
||||
@@ -446,7 +446,7 @@ Namespace Modelos
|
||||
Me.IEPS = 0
|
||||
Me.CveAlmacenTraspasoOrigen = 0
|
||||
End Sub
|
||||
Private Sub IniciaValoresVentas()
|
||||
Private Sub IniciaValoresVentas(Optional EsCancelacion As Boolean = False)
|
||||
If CveVenta > 0 AndAlso CveEmpresa > 0 Then
|
||||
Me.DtAnticipos = New DataTable()
|
||||
Me.DtAntNCVinculadas = New DataTable()
|
||||
@@ -492,6 +492,10 @@ Namespace Modelos
|
||||
Me.DtNCVinculadas = ObjVentas.DtResultados.Copy()
|
||||
End If
|
||||
|
||||
If TipoDocto.Contiene("Ant") AndAlso EsCancelacion Then
|
||||
EsNCAmortizacion = True
|
||||
End If
|
||||
|
||||
If ObjVentas.GetVentasAntNC(-1, CveVenta, AplicaAmortizacion:=EsNCAmortizacion) Then
|
||||
Me.DtAnticipos = ObjVentas.DtResultados.Copy()
|
||||
End If
|
||||
@@ -2333,7 +2337,7 @@ Namespace Modelos
|
||||
Exit Select
|
||||
End If
|
||||
|
||||
If ObjFactura.TipoDocto.Contiene("Ing", "Egs") AndAlso ValorMultiplicador = -1 Then
|
||||
If ObjFactura.TipoDocto.Contiene("Ing", "Egs", "Ant") AndAlso ValorMultiplicador = -1 Then
|
||||
For Each row2 As DataRow In ObjFactura.DtAnticipos.Rows
|
||||
If row2("CveConceptoContable").ToString().ToEntero = 11 Then
|
||||
importeMovimiento = row2("Importe").ToString().ToDecimal * ValorMultiplicador '- ((row2.FCTextBox("TxtAnticipo" & row2.RowIndex).Text.ToDecimal / row2.DataKey("TotalAnticipo").ToDecimal) * row2.DataKey("IVAAnticipo").ToDecimal)
|
||||
@@ -2344,7 +2348,10 @@ Namespace Modelos
|
||||
CveSubProyectoContabilizar = CveSubProyectoVenta
|
||||
|
||||
If importeMovimiento <> 0 Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=row2("CveVenta").ToString().ToEntero, CveVentaAmortizacion:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=importeMovimiento * tipoCambio, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=SeContabiliza) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1,
|
||||
CveVenta:=ObjFactura.CveVenta, CveVentaAmortizacion:=row2("CveVenta").ToString().ToEntero, CveCliente:=ObjFactura.CveCliente,
|
||||
CveIE:=CveIEAnticipo, ImporteMX:=importeMovimiento * tipoCambio, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveCuenta:=CveCuenta,
|
||||
CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=SeContabiliza) Then
|
||||
ErrorPrepoliza = True
|
||||
Exit For
|
||||
Else
|
||||
|
||||
@@ -838,7 +838,7 @@
|
||||
</div>
|
||||
<div id="DivRetenciones" runat="server">
|
||||
<div id="DivTipoRetenciones" runat="server" visible="false" class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlTipoRetencion" AutoPostBack="true" OnSelectedIndexChanged="DdlTipoRetencion_SelectedIndexChanged" CssClass="form-control select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="MetodoPago" DataValueField="CveMetodoPago" ValidationGroup="GrpGuardar">
|
||||
<asp:DropDownList ID="DdlTipoRetencion" CssClass="form-control select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="MetodoPago" DataValueField="CveMetodoPago" ValidationGroup="GrpGuardar">
|
||||
<asp:ListItem Selected="True" Text="Sin Retención" Value="0"></asp:ListItem>
|
||||
<asp:ListItem Text="Arrendamiento" Value="1"></asp:ListItem>
|
||||
<asp:ListItem Text="Servicios Profesionales" Value="2"></asp:ListItem>
|
||||
|
||||
@@ -9940,23 +9940,6 @@ Partial Class Clientes
|
||||
Acum.Dispose()
|
||||
|
||||
End Sub
|
||||
#End Region
|
||||
Protected Sub DdlTipoRetencion_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
Select Case DdlTipoRetencion.SelectedValue
|
||||
Case "1" 'Arrendamiento
|
||||
TxtRetIVA.Text = "10"
|
||||
TxtRetISR.Text = "10"
|
||||
Case "2" 'Servicios Profesionales
|
||||
TxtRetIVA.Text = "10"
|
||||
TxtRetISR.Text = "10"
|
||||
Case "3" 'Fletes
|
||||
TxtRetIVA.Text = "4"
|
||||
TxtRetISR.Text = "4"
|
||||
Case "4" 'Servicios
|
||||
TxtRetIVA.Text = "6"
|
||||
TxtRetISR.Text = "6"
|
||||
End Select
|
||||
UpFiscalContable.Update()
|
||||
End Sub
|
||||
#End Region
|
||||
End Class
|
||||
|
||||
|
||||
@@ -1372,16 +1372,15 @@
|
||||
<td>
|
||||
<asp:Label ID="LblRetIVA" runat="server" BorderStyle="None" Text="0.00"></asp:Label> (%)
|
||||
</td>
|
||||
<%-- <td>
|
||||
<asp:DropDownList ID="DdlTipoRetencion" AutoPostBack="true" OnSelectedIndexChanged="DdlTipoRetencion_SelectedIndexChanged" CssClass="form-control select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="MetodoPago" DataValueField="CveMetodoPago" ValidationGroup="GrpGuardar">
|
||||
<td>
|
||||
<asp:DropDownList ID="DdlTipoRetencion" Visible="false" AutoPostBack="true" OnSelectedIndexChanged="DdlTipoRetencion_SelectedIndexChanged" CssClass="form-control input-sm" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="MetodoPago" DataValueField="CveMetodoPago" ValidationGroup="GrpGuardar">
|
||||
<asp:ListItem Selected="True" Text="Sin Retención" Value="0"></asp:ListItem>
|
||||
<asp:ListItem Text="Arrendamiento" Value="1"></asp:ListItem>
|
||||
<asp:ListItem Text="Servicios Profesionales" Value="2"></asp:ListItem>
|
||||
<asp:ListItem Text="Fletes" Value="3"></asp:ListItem>
|
||||
<asp:ListItem Text="Servicios" Value="4"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</td>--%>
|
||||
<td></td>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id="TrRetISR" runat="server" align="right" style="display: none;">
|
||||
|
||||
@@ -4111,6 +4111,7 @@ Partial Class Ventas
|
||||
|
||||
'Sección Detalle
|
||||
DdlMoneda.Enabled = False
|
||||
DdlTipoRetencion.Enabled = False
|
||||
TxtFechaEjecucion.ReadOnly = True
|
||||
ImgCalendarFechaEje.Enabled = False
|
||||
'DdlSucursalEjecucion.Enabled = False
|
||||
@@ -4699,6 +4700,9 @@ Partial Class Ventas
|
||||
ViewState("ClienteRetIVA") = ObjCliente.RetIVA / 100
|
||||
ViewState("ClienteRetISR") = ObjCliente.RetISR / 100
|
||||
|
||||
DdlTipoRetencion.SelectedValueExist(ObjCliente.DtResultados(0)("CveTipoRetencion").ToString)
|
||||
DdlTipoRetencion_SelectedIndexChanged(DdlTipoRetencion, EventArgs.Empty)
|
||||
|
||||
ViewState("RetIVAFletes") = ObjCliente.RetieneIVAFletes
|
||||
If ObjCliente.RetieneIVAFletes Then
|
||||
TrRetIVA.Style.Add("display", "")
|
||||
@@ -4737,8 +4741,6 @@ Partial Class Ventas
|
||||
End If
|
||||
ViewState("CargoUsado") = ObjCliente.CargoUsados
|
||||
|
||||
'DdlTipoRetencion.SelectedValueExist(ObjCliente.DtResultados(0)("CveTipoRetencion").ToString)
|
||||
|
||||
Dim dr As DataRow = Nothing
|
||||
dr = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("TipoSucursal = 1 And Estatus = 'Activo' AND CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
If dr IsNot Nothing Then
|
||||
@@ -5922,6 +5924,20 @@ Partial Class Ventas
|
||||
Dim TotalCalculableImpuestosIVA As Decimal = 0
|
||||
TotalCalculableImpuestosIVA = TotalCalculableImpuestos * (1 + TmpDT.Rows(e.RowIndex)("PorcentajeIEPS").ToString.ToDecimal)
|
||||
|
||||
Dim ClienteRetIVA = Me.ClienteRetIVA
|
||||
If UsuarioActual.Empresa.Funcionalidad(579) = "1" Then
|
||||
If DdlTipoRetencion.SelectedValue.Contiene("1", "2") Then
|
||||
ClienteRetIVA = 0.1D
|
||||
ElseIf DdlTipoRetencion.SelectedValue.Contiene("3") Then
|
||||
ClienteRetIVA = 0.04D
|
||||
ElseIf DdlTipoRetencion.SelectedValue.Contiene("4") Then
|
||||
ClienteRetIVA = 0.06D
|
||||
End If
|
||||
|
||||
LblRetIVA.Text = (ClienteRetIVA * 100).FormatoNumero
|
||||
DdlTipoRetencion.Visible = True
|
||||
End If
|
||||
|
||||
|
||||
TmpDT.Rows(e.RowIndex)("CveUM") = GvPS.Rows(e.RowIndex).FCDropDownList("DdlUnidadMedida").SelectedValue.ToEntero
|
||||
TmpDT.Rows(e.RowIndex)("UM") = GvPS.Rows(e.RowIndex).FCDropDownList("DdlUnidadMedida").SelectedItem.Text
|
||||
@@ -7583,10 +7599,10 @@ Partial Class Ventas
|
||||
End Function
|
||||
|
||||
|
||||
Private Sub CreaObjetosVenta(Optional VistaPrevia As Boolean = False)
|
||||
Private Sub CreaObjetosVenta(Optional VistaPrevia As Boolean = False, Optional EsCancelacion As Boolean = False)
|
||||
|
||||
If Me.CveVenta > 0 AndAlso NuevaFactura <> 1 Then
|
||||
ObjFactura = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa)
|
||||
ObjFactura = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=EsCancelacion)
|
||||
Else
|
||||
ObjFactura = New Modelos.Factura
|
||||
End If
|
||||
@@ -14217,6 +14233,20 @@ Partial Class Ventas
|
||||
Row("PorcentajeIVA") = DrPS("IVA")
|
||||
End If
|
||||
|
||||
Dim ClienteRetIVA = Me.ClienteRetIVA
|
||||
If UsuarioActual.Empresa.Funcionalidad(579) = "1" Then
|
||||
If DdlTipoRetencion.SelectedValue.Contiene("1", "2") Then
|
||||
ClienteRetIVA = 0.1D
|
||||
ElseIf DdlTipoRetencion.SelectedValue.Contiene("3") Then
|
||||
ClienteRetIVA = 0.04D
|
||||
ElseIf DdlTipoRetencion.SelectedValue.Contiene("4") AndAlso DrPS("CveTipoPS").ToString().ToEntero() = 1 Then
|
||||
ClienteRetIVA = 0.06D
|
||||
End If
|
||||
|
||||
LblRetIVA.Text = (ClienteRetIVA * 100).FormatoNumero
|
||||
DdlTipoRetencion.Visible = True
|
||||
End If
|
||||
|
||||
Row("IVA") = Row("PorcentajeIVA")
|
||||
Row("ImporteIVA") = Math.Round(Row("PorcentajeIVA").ToString.ToDecimal * TotalCalculableImpuestosIVA, NumeroDecimales)
|
||||
Row("ImporteRetIVA") = Math.Round(ClienteRetIVA * TotalCalculableImpuestos, NumeroDecimales)
|
||||
@@ -18435,7 +18465,8 @@ Partial Class Ventas
|
||||
CancelarRefacturada()
|
||||
End If
|
||||
|
||||
CreaObjetosVenta()
|
||||
CreaObjetosVenta(EsCancelacion:=True)
|
||||
|
||||
Dim resp As Modelos.Factura.MCancelacionVentaMensaje = Nothing
|
||||
|
||||
If ObjFactura IsNot Nothing AndAlso ObjFactura.CveVenta > 0 Then
|
||||
@@ -18453,9 +18484,6 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
ObjFactura.CveAlmacenDevolucion = CveAlmacenDevolucion
|
||||
If ChkDevAlm.Checked Then
|
||||
ObjFactura.CveAlmacenDevolucion = CveAlmacenDevolucion
|
||||
End If
|
||||
|
||||
resp = ObjFactura.CancelarFactura(ChkDevAlm.Checked, ListaRemisionesCancelar)
|
||||
End If
|
||||
@@ -23859,10 +23887,12 @@ Partial Class Ventas
|
||||
CargaRNC()
|
||||
RegistraScript("$('#ModalAplicarRemisionesNC').modal({backdrop: 'static', keyboard: false });")
|
||||
End Sub
|
||||
|
||||
#Region "P O L I Z A - V I R T U A L"
|
||||
Protected Sub GeneraPolizaVentaWS(ObjFactura As Modelos.Factura)
|
||||
Dim DtUsados As DataTable = Nothing
|
||||
Dim ObjAcum As New ClsAcumuladores
|
||||
If ObjAcum.GetGarantiasDetalle(ObjFactura.CveVenta) Then
|
||||
If ObjAcum.GetGarantiasPolizaVirtual(ObjFactura.CveVenta) Then
|
||||
DtUsados = ObjAcum.DtResultados.Copy()
|
||||
End If
|
||||
ObjAcum.Dispose()
|
||||
@@ -23986,19 +24016,39 @@ Partial Class Ventas
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
'Protected Sub DdlTipoRetencion_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
' Dim PorcentajeRetencion As Decimal = 0
|
||||
' Select Case DdlTipoRetencion.SelectedValue
|
||||
' Case "1" 'Arrendamiento
|
||||
' PorcentajeRetencion = 10
|
||||
' Case "2" 'Servicios Profesionales
|
||||
' PorcentajeRetencion = 10
|
||||
' Case "3" 'Fletes
|
||||
' PorcentajeRetencion = 4
|
||||
' Case "4" 'Servicios
|
||||
' PorcentajeRetencion = 6
|
||||
' End Select
|
||||
#End Region
|
||||
|
||||
'End Sub
|
||||
Protected Sub DdlTipoRetencion_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
If UsuarioActual.Empresa.Funcionalidad(579) = "1" Then
|
||||
If TmpDT IsNot Nothing AndAlso TmpDT.Rows.Count > 0 Then
|
||||
For Each RowServicio As DataRow In TmpDT.Rows
|
||||
Dim ClienteRetIVA = Me.ClienteRetIVA
|
||||
If DdlTipoRetencion.SelectedValue.Contiene("1", "2") Then
|
||||
ClienteRetIVA = 0.1D
|
||||
ElseIf DdlTipoRetencion.SelectedValue.Contiene("3") Then
|
||||
ClienteRetIVA = 0.04D
|
||||
ElseIf DdlTipoRetencion.SelectedValue.Contiene("4") AndAlso RowServicio("CveTipoPS").ToString().ToEntero() = 1 Then
|
||||
ClienteRetIVA = 0.06D
|
||||
End If
|
||||
|
||||
Dim TotalCalculableImpuestos As Decimal = (RowServicio("Cantidad").ToString().ToDecimal() * RowServicio("PU").ToString().ToDecimal()) - RowServicio("Descuento").ToString().ToDecimal()
|
||||
RowServicio("ImporteRetIVA") = (TotalCalculableImpuestos * ClienteRetIVA).RoundSQL()
|
||||
RowServicio("PorcentajeRetIVA") = ClienteRetIVA
|
||||
|
||||
Next
|
||||
TxtRetIVA.Text = TmpDT.SUM("ImporteRetIVA").ToDecimal().FormatoNumero(2)
|
||||
Dim PorcentajeRetIVA = (TmpDT.MAX("PorcentajeRetIVA").ToDecimal() * 100)
|
||||
LblRetIVA.Text = PorcentajeRetIVA.FormatoNumero(2)
|
||||
If PorcentajeRetIVA > 0 Then
|
||||
DdlTipoRetencion.Visible = True
|
||||
End If
|
||||
|
||||
GvPS.DataSource = TmpDT
|
||||
GvPS.DataBind()
|
||||
|
||||
UpPS.Update()
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user