--aplicacion de RNC como devolucion de remisiones
This commit is contained in:
@@ -252,7 +252,7 @@
|
|||||||
<asp:LinkButton ID="LBNotaCredito" runat="server" OnClick="LBNotaCredito_Click" CausesValidation="False" Text="<i class='fa fa-pencil'></i> Aplicar Nota de Crédito" Visible="false" />
|
<asp:LinkButton ID="LBNotaCredito" runat="server" OnClick="LBNotaCredito_Click" CausesValidation="False" Text="<i class='fa fa-pencil'></i> Aplicar Nota de Crédito" Visible="false" />
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<asp:LinkButton ID="LnkAplicarRNCDevolucion" runat="server" Visible="false" CausesValidation="False" Text="<i class='fa fa-pencil'></i> Aplicar RNC por devolución"
|
<asp:LinkButton ID="LnkAplicarRNCDevolucion" runat="server" Visible="false" CausesValidation="False" Text="<i class='fa fa-pencil'></i> Aplicar Devolución con RNC "
|
||||||
OnClick="LnkAplicarRNCDevolucion_Click" />
|
OnClick="LnkAplicarRNCDevolucion_Click" />
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
@@ -7567,6 +7567,78 @@
|
|||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<%-- MODAL APLICAR DEVOLUCIONES --%>
|
||||||
|
<div class="modal ADS fade" id="DivAplicaRNCDevolucion" role="dialog">
|
||||||
|
<asp:UpdatePanel ID="UpAplicaRNCDevolucion" class="modal-dialog modal-lg rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||||
|
<ContentTemplate>
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header" style="background-color: #3598dc; color: white; font-weight: bold">
|
||||||
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||||
|
<h4 class="modal-title">Aplicar Devolución</h4>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<div class="row" style="margin-bottom: 10px;">
|
||||||
|
<div class="text-right col-md-offset-8 col-md-4">
|
||||||
|
<input type="text" id="TxtBusquedaRNCDevolucion" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaRNCDevolucion','{0}')", GvAplicaRNCDevolucion.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||||
|
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaRNCDevolucion','{0}')", GvAplicaRNCDevolucion.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div style="max-height: 300px; overflow-y: auto;">
|
||||||
|
<asp:GridView ID="GvAplicaRNCDevolucion" runat="server" OnRowDataBound="GvAplicaRNCDevolucion_RowDataBound" AutoGenerateColumns="false" GridLines="None" CssClass="table table-grid table-striped table-advance table-hover Widthall"
|
||||||
|
DataKeyNames="CveVentaDetalle, PU, Total, Cantidad,Descuento,CvePS,PS,Codigo,CodigoPS,CveTipoPS,CveTipoInvPS,CveUM,UM,CveClasificacion,
|
||||||
|
Clasificacion,CveProyecto,Proyecto,CveSubProyecto,SubProyecto,Obs,PorcentajeIVA,ImporteIVA,PorcentajeRetIVA,ImporteRetIVA,PorcentajeRetISR,
|
||||||
|
ImporteRetISR,PorcentajeIEPS,ImporteIEPS,SATClaveProdServ,SATClaveUM,CantSur,CantRes,CveTamaño,CodigoObjetoImpuesto"
|
||||||
|
AllowPaging="False">
|
||||||
|
<Columns>
|
||||||
|
<asp:TemplateField>
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:CheckBox ID="Chk" runat="server" />
|
||||||
|
</ItemTemplate>
|
||||||
|
<ItemStyle Width="8px" HorizontalAlign="Center" />
|
||||||
|
<ControlStyle Width="8px" />
|
||||||
|
</asp:TemplateField>
|
||||||
|
<asp:BoundField HeaderText="Cant. Original" DataField="Cantidad" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||||
|
<asp:BoundField HeaderText="Cant. Devuelta" DataField="CantSur" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||||
|
<asp:BoundField HeaderText="Cant. Restante" DataField="CantRes" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||||
|
<asp:TemplateField HeaderText="Cantidad">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:TextBox ID="TxtCantidadAplicaDevolucion" runat="server" Text='<%#Eval("CantRes").ToString%>' MaxLength="12" Width="46px" Height="24px"></asp:TextBox>
|
||||||
|
<ajax:FilteredTextBoxExtender ID="SoloNumeros1" runat="server" TargetControlID="TxtCantidadAplicaDevolucion" FilterType="Custom, Numbers" ValidChars=".," />
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
<asp:BoundField HeaderText="Producto" DataField="CodigoPS" ItemStyle-HorizontalAlign="Left" />
|
||||||
|
<asp:BoundField HeaderText="Observacion" DataField="Obs" ItemStyle-HorizontalAlign="Left" />
|
||||||
|
<asp:TemplateField HeaderText="Proyecto/SubProyecto">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:Label Style="border-bottom: 1px solid gray;" ID="LblProyecto" runat="server" Text='<%# Eval("Proyecto", "{0}<br />") %>'></asp:Label>
|
||||||
|
<asp:Label ID="LblSubProyecto" runat="server" Text='<%# Eval("SubProyecto") %>' Width="90px"></asp:Label>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
<asp:BoundField HeaderText="PU" DataField="PU" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||||
|
<%-- <asp:TemplateField HeaderText="PU Editado" Visible="false">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:TextBox ID="TxtPrecioEditado" runat="server" Text='<%#Eval("PU").ToString%>' MaxLength="12" Width="50%" Height="24px" CssClass="ImporteDevolucion"></asp:TextBox>
|
||||||
|
<ajax:FilteredTextBoxExtender ID="SoloNumeros1Editado" runat="server" TargetControlID="TxtPrecioEditado" FilterType="Custom, Numbers" ValidChars=".," />
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>--%>
|
||||||
|
<asp:BoundField HeaderText="Total" DataField="Total" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||||
|
</Columns>
|
||||||
|
</asp:GridView>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer" style="text-align: center">
|
||||||
|
<asp:Button ID="BtnAplicarRNCDevolucion" runat="server" CssClass="btn btn-primary" Text="Aplicar" OnClick="BtnAplicaRNCDevolucion_Click" ValidationGroup="GrpAplicaDevolucionRNC" />
|
||||||
|
<button type="button" class="btn default" data-dismiss="modal">Cerrar</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
|
</div>
|
||||||
|
|
||||||
<%--APLICAR REMISIONES DE NC DE DEVOLUCION--%>
|
<%--APLICAR REMISIONES DE NC DE DEVOLUCION--%>
|
||||||
<div id="ModalAplicaRNCDevolucion" class="modal ADS fade" role="dialog">
|
<div id="ModalAplicaRNCDevolucion" class="modal ADS fade" role="dialog">
|
||||||
<asp:UpdatePanel ID="UpRNCDevolucion" class="modal-dialog rowpadding modal-lg" tabindex="-1" runat="server" UpdateMode="Conditional">
|
<asp:UpdatePanel ID="UpRNCDevolucion" class="modal-dialog rowpadding modal-lg" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||||
|
|||||||
@@ -3548,10 +3548,6 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
UpPS.Update()
|
UpPS.Update()
|
||||||
|
|
||||||
If DdlTipoComprobante.Items.FindByValue("RNC") Is Nothing Then
|
|
||||||
DdlTipoComprobante.Items.Add(New ListItem("Remisión de nota de crédito", "RNC"))
|
|
||||||
End If
|
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
@@ -5112,11 +5108,23 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
DiasCredito = DbRowVenta("DiasCredito").ToString().ToEntero()
|
DiasCredito = DbRowVenta("DiasCredito").ToString().ToEntero()
|
||||||
EsDiasCreditoFijo = CBool(DbRowVenta("EsDiasCreditoFijo").ToString())
|
EsDiasCreditoFijo = CBool(DbRowVenta("EsDiasCreditoFijo").ToString())
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
|
||||||
|
Dim TienePermiso As String = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, -1).FiltroPrimeroValor("CveSubProyecto", String.Format("CveSubProyecto = {0}", DbRowVenta("CveSubProyecto")))
|
||||||
|
If TienePermiso <> "" Then ' si tiene acceso en el subproyecto
|
||||||
|
'LkNotaCredito.Visible = UsuarioActual.TienePermisoProceso(175)
|
||||||
|
If UsuarioActual.TienePermisoProceso(264) Then
|
||||||
|
InicializaAplicaRNCDevolucion(TmpDT)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End If
|
||||||
Case "RNC"
|
Case "RNC"
|
||||||
Trsaldo.Visible = True
|
Trsaldo.Visible = True
|
||||||
HplSaldoAuxiliar.NavigateUrl = String.Format("/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxCClientes&CveCliente={0}&CveVenta={1}&TB_iframe=true&height=550&width=920", DbRowVenta("CveCliente"), DbRowVenta("CveVenta"))
|
HplSaldoAuxiliar.NavigateUrl = String.Format("/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxCClientes&CveCliente={0}&CveVenta={1}&TB_iframe=true&height=550&width=920", DbRowVenta("CveCliente"), DbRowVenta("CveVenta"))
|
||||||
HplPagado.NavigateUrl = String.Format("/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxCClientes&CveCliente={0}&CveVenta={1}&TB_iframe=true&height=550&width=920", DbRowVenta("CveCliente"), DbRowVenta("CveVenta"))
|
HplPagado.NavigateUrl = String.Format("/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxCClientes&CveCliente={0}&CveVenta={1}&TB_iframe=true&height=550&width=920", DbRowVenta("CveCliente"), DbRowVenta("CveVenta"))
|
||||||
|
If DdlTipoComprobante.Items.FindByValue("RNC") Is Nothing Then
|
||||||
|
DdlTipoComprobante.Items.Add(New ListItem("Remisión de nota de crédito", "RNC"))
|
||||||
|
End If
|
||||||
|
DdlTipoComprobante.SelectedValueExist("RNC")
|
||||||
Case "OP"
|
Case "OP"
|
||||||
TdOrdenPago.Visible = True
|
TdOrdenPago.Visible = True
|
||||||
DdlOrdenPago.SelectedValue = DbRowVenta("Num3").ToString()
|
DdlOrdenPago.SelectedValue = DbRowVenta("Num3").ToString()
|
||||||
@@ -14904,6 +14912,42 @@ Partial Class Ventas
|
|||||||
|
|
||||||
Next
|
Next
|
||||||
|
|
||||||
|
If ObjFactura.AplicaDevolucion AndAlso ObjFactura.TipoDocto = "RNC" AndAlso CveVentaDevolucion > 0 Then
|
||||||
|
Dim importeMovimientoDev As Decimal = TxtTotal.Text.ToDecimal
|
||||||
|
importeMovimientoDev = If(SaldoVentaDevolucion < importeMovimientoDev, SaldoVentaDevolucion, importeMovimientoDev)
|
||||||
|
|
||||||
|
importeMovimiento = importeMovimientoDev * Multiplicador
|
||||||
|
importeMX = importeMovimiento * tipoCambio
|
||||||
|
|
||||||
|
If importeMovimiento <> 0 Then
|
||||||
|
If Not ErrorPrepoliza AndAlso Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, importeMovimiento * tipoCambio, 150, Referencia, Concepto, CveVenta:=CveVentaDevolucion, CveCliente:=ObjFactura.CveCliente, CveVentaAmortizacion:=-1, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveClasificacion:=ObjFactura.DtDetalle.MAX("CveClasificacion").ToEntero(), CveSubProyecto:=ObjFactura.CveSubProyecto, Contabilizable:=Contabilizable) Then
|
||||||
|
ErrorPrepoliza = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Not ErrorPrepoliza AndAlso Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento * -1, importeMX * -1, 277, Referencia, Concepto, CveVenta:=ObjFactura.CveVenta, CveVentaAmortizacion:=-1, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), Contabilizable:=False, CveSubProyecto:=CveSubProyectoContabilizar) Then
|
||||||
|
ErrorPrepoliza = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Not ErrorPrepoliza AndAlso Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, Not TipoMovimiento, importeMovimiento * -1, importeMX * -1, 278, Referencia, Concepto, CveVenta:=ObjFactura.CveVenta, CveVentaAmortizacion:=-1, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), Contabilizable:=False, CveSubProyecto:=CveSubProyectoContabilizar) Then
|
||||||
|
ErrorPrepoliza = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Not ErrorPrepoliza Then
|
||||||
|
Dim CveConceptoPagoNC As Integer = 251
|
||||||
|
If ObjFactura.CveMoneda > 1 Then
|
||||||
|
CveConceptoPagoNC = 301
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, importeMovimiento, importeMX, CveConceptoPagoNC, Referencia, Concepto, CveVenta:=CveVentaDevolucion, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=Contabilizable) Then
|
||||||
|
ErrorPrepoliza = True
|
||||||
|
Else
|
||||||
|
ViewState("SeGuardoPrePoliza") = True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
If UsuarioActual.Empresa.Funcionalidad(344) = "1" AndAlso ObjFactura.TipoDocto = "Egs" Then
|
If UsuarioActual.Empresa.Funcionalidad(344) = "1" AndAlso ObjFactura.TipoDocto = "Egs" Then
|
||||||
Dim ListaNC As List(Of Modelos.Factura) = Nothing
|
Dim ListaNC As List(Of Modelos.Factura) = Nothing
|
||||||
|
|
||||||
@@ -27471,34 +27515,39 @@ Partial Class Ventas
|
|||||||
|
|
||||||
#Region " APLICAR NOTA DE CREDITO "
|
#Region " APLICAR NOTA DE CREDITO "
|
||||||
Private Sub InicializaAplicarNC()
|
Private Sub InicializaAplicarNC()
|
||||||
'If Not UsuarioActual.CveUsuario = 100 Then
|
'SI NO ES VENTA EXISTENTE NO DEBE ENTRAR ESTE PROCESO
|
||||||
' If Not UsuarioActual.CveEmpresa.Contiene(1, 72, 80, 119) Then
|
If CveVenta <= 0 Then
|
||||||
' Exit Sub
|
|
||||||
' End If
|
|
||||||
'End If
|
|
||||||
|
|
||||||
If CveVenta <= 0 Or Not DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant") Or Not HplSaldoAuxiliar.Text.ToDouble > 0 Then
|
|
||||||
''If Not HplSaldoAuxiliar.Text.ToDouble > 0 Then LkNotaCredito.Visible = False
|
|
||||||
Exit Sub
|
|
||||||
End If
|
|
||||||
|
|
||||||
'sino tiene el permiso de peude generar NC
|
|
||||||
If Not UsuarioActual.TienePermisoProceso(175) Then
|
|
||||||
Exit Sub
|
|
||||||
End If
|
|
||||||
|
|
||||||
If DeshabilitarAplicarNotaDeCredito(LblRFC.Text) Then
|
|
||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
|
|
||||||
AplicaNCMasiva = False
|
AplicaNCMasiva = False
|
||||||
AplicaNC = False
|
AplicaNC = False
|
||||||
LBNotaCredito.Visible = True
|
|
||||||
|
|
||||||
If UsuarioActual.CveUsuario = 100 Then
|
'SOLO APLICA PARA INGRESOS O ANTICIPOS
|
||||||
LnkAplicarRNCDevolucion.Visible = True
|
If (Not DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant")) Then
|
||||||
|
''If Not HplSaldoAuxiliar.Text.ToDouble > 0 Then LkNotaCredito.Visible = False
|
||||||
|
LBNotaCredito.Visible = False
|
||||||
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
'sino tiene el permiso de peude generar NC
|
||||||
|
If Not UsuarioActual.TienePermisoProceso(175) Then
|
||||||
|
LBNotaCredito.Visible = False
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Not HplSaldoAuxiliar.Text.ToDouble > 0 Then
|
||||||
|
LBNotaCredito.Visible = False
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
|
||||||
|
If DeshabilitarAplicarNotaDeCredito(LblRFC.Text) Then
|
||||||
|
LBNotaCredito.Visible = False
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
|
||||||
|
LBNotaCredito.Visible = True
|
||||||
|
|
||||||
'LkNotaCredito.Visible = False
|
'LkNotaCredito.Visible = False
|
||||||
|
|
||||||
TxtNCPorcentaje.Attributes.Add("onkeyup", "CalculaImporteNC();")
|
TxtNCPorcentaje.Attributes.Add("onkeyup", "CalculaImporteNC();")
|
||||||
@@ -27552,9 +27601,7 @@ Partial Class Ventas
|
|||||||
|
|
||||||
AplicaNCMasiva = True
|
AplicaNCMasiva = True
|
||||||
LBNotaCredito.Visible = True
|
LBNotaCredito.Visible = True
|
||||||
If UsuarioActual.CveUsuario = 100 Then
|
|
||||||
LnkAplicarRNCDevolucion.Visible = True
|
|
||||||
End If
|
|
||||||
'LkNotaCredito.Visible = False
|
'LkNotaCredito.Visible = False
|
||||||
TxtNCPorcentaje.Attributes.Add("onkeyup", "CalculaImporteNCMasivo();")
|
TxtNCPorcentaje.Attributes.Add("onkeyup", "CalculaImporteNCMasivo();")
|
||||||
TxtNCImporte.Text = "0.00"
|
TxtNCImporte.Text = "0.00"
|
||||||
@@ -30003,6 +30050,45 @@ Partial Class Ventas
|
|||||||
|
|
||||||
UpDevolucion.Update()
|
UpDevolucion.Update()
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
Private Sub InicializaAplicaRNCDevolucion(DtDetalle As DataTable)
|
||||||
|
|
||||||
|
'sino tiene el permiso no puede generar Devolucion
|
||||||
|
If Not UsuarioActual.TienePermisoProceso(264) Then
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
|
||||||
|
LnkAplicarRNCDevolucion.Visible = True
|
||||||
|
|
||||||
|
Dim SeEsconde As Boolean = False
|
||||||
|
|
||||||
|
If DtDetalle IsNot Nothing AndAlso DtDetalle.Rows.Count > 0 Then
|
||||||
|
If Not DtDetalle.SUM("CantSur").ToString().ToDecimal > 0 Then SeEsconde = True
|
||||||
|
'NO MOSTRAR LOS PRODUCTOS CON LA CLASIFICACION DE USADOS
|
||||||
|
GvAplicaRNCDevolucion.DataSource = DtDetalle.FiltraParametros("CantRes > 0 AND CveClasificacion <> 20519")
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
'activo el permiso para registrar el importe diferente a la devolución
|
||||||
|
'GvAplicaRNCDevolucion.Columns(9).Visible = UsuarioActual.TienePermisoProceso(253)
|
||||||
|
|
||||||
|
'MODALIDAD CENTRO COSTOS
|
||||||
|
If UsuarioActual.Empresa.Tipo_CentroCosto = 1 Then
|
||||||
|
GvAplicaRNCDevolucion.Columns(7).HeaderText = "Sucursal"
|
||||||
|
ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 2 Then
|
||||||
|
GvAplicaRNCDevolucion.Columns(7).HeaderText = "Proyecto"
|
||||||
|
ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 4 Then
|
||||||
|
GvAplicaRNCDevolucion.Columns(7).HeaderText = "Sucursal/Proyecto"
|
||||||
|
ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 5 Then
|
||||||
|
GvAplicaRNCDevolucion.Columns(7).HeaderText = "Proyecto/Sucursal"
|
||||||
|
End If
|
||||||
|
|
||||||
|
If SeEsconde Then GvAplicaRNCDevolucion.Columns(1).Visible = False : GvAplicaRNCDevolucion.Columns(2).Visible = False : GvAplicaRNCDevolucion.Columns(3).Visible = False
|
||||||
|
|
||||||
|
GvAplicaRNCDevolucion.DataBind()
|
||||||
|
|
||||||
|
UpAplicaRNCDevolucion.Update()
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
Protected Sub BtnCalcularPenalizacion_Click(sender As Object, e As EventArgs)
|
Protected Sub BtnCalcularPenalizacion_Click(sender As Object, e As EventArgs)
|
||||||
Dim PorcentajePenalizacion As Decimal = (TxtPorPenalizacion.Text.ToDecimal() / 100D)
|
Dim PorcentajePenalizacion As Decimal = (TxtPorPenalizacion.Text.ToDecimal() / 100D)
|
||||||
@@ -35019,20 +35105,51 @@ Partial Class Ventas
|
|||||||
|
|
||||||
Protected Sub LnkAplicarRNCDevolucion_Click(sender As Object, e As EventArgs)
|
Protected Sub LnkAplicarRNCDevolucion_Click(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
Dim DtNC As DataTable = Nothing
|
If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
|
||||||
|
Dim SaldoAlmacen As Decimal = 0
|
||||||
|
|
||||||
Dim ObjMovtos As New ClsMovimientos()
|
Dim PermiteCancelar As Boolean = True
|
||||||
If ObjMovtos.GetAnticiposNCIxCCliente(CveCliente, CveMoneda:=-1) Then
|
Using ObjVentas As New ClsVentas
|
||||||
DtNC = ObjMovtos.DtResultados.FiltraParametros("Tipo = 'RNC' AND TipoRNC = 3 AND CveVenta > 0 and Saldo > 0", "Moneda,Fecha,Folio")
|
If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa, VerificaAlmacen:=True) Then
|
||||||
|
If ObjVentas.DtResultados.Rows.Count > 0 Then
|
||||||
|
Dim RowVenta As DataRow = ObjVentas.DtResultados.Rows(0)
|
||||||
|
SaldoAlmacen = RowVenta("SaldoAlmacen").ToString().ToDecimal()
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End Using
|
||||||
|
|
||||||
|
Dim PuedeAplicarDevolucion As Boolean = False
|
||||||
|
|
||||||
|
If SaldoAlmacen > 0 Then
|
||||||
|
If DevolucionAlmacen = 0 Then
|
||||||
|
PuedeAplicarDevolucion = True
|
||||||
|
ElseIf DevolucionAlmacen.Contiene(1, 2) Then
|
||||||
|
Alert("No se puede aplicar una devolución sobre el documento actual", TipoMensaje.MsgAdvertencia)
|
||||||
|
End If
|
||||||
|
ElseIf SaldoAlmacen <= 0 Then
|
||||||
|
Alert("No se puede aplicar una devolución sobre el documento actual", TipoMensaje.MsgAdvertencia)
|
||||||
|
End If
|
||||||
|
|
||||||
|
If PuedeAplicarDevolucion Then
|
||||||
|
RegistraScript("$('#DivAplicaRNCDevolucion').modal('show');")
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
Dim DtNC As DataTable = Nothing
|
||||||
|
|
||||||
|
Dim ObjMovtos As New ClsMovimientos()
|
||||||
|
If ObjMovtos.GetAnticiposNCIxCCliente(CveCliente, CveMoneda:=-1) Then
|
||||||
|
DtNC = ObjMovtos.DtResultados.FiltraParametros("Tipo = 'RNC' AND TipoRNC = 3 AND CveVenta > 0 and Saldo > 0", "Moneda,Fecha,Folio")
|
||||||
|
End If
|
||||||
|
ObjMovtos.Dispose()
|
||||||
|
|
||||||
|
GvRNCDevoluciones.DataSource = DtNC
|
||||||
|
GvRNCDevoluciones.DataBind()
|
||||||
|
|
||||||
|
UpRNCDevolucion.Update()
|
||||||
|
|
||||||
|
RegistraScript("$('#ModalAplicaRNCDevolucion').modal('show');")
|
||||||
End If
|
End If
|
||||||
ObjMovtos.Dispose()
|
|
||||||
|
|
||||||
GvRNCDevoluciones.DataSource = DtNC
|
|
||||||
GvRNCDevoluciones.DataBind()
|
|
||||||
|
|
||||||
UpRNCDevolucion.Update()
|
|
||||||
|
|
||||||
RegistraScript("$('#ModalAplicaRNCDevolucion').modal('show');")
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Sub BtnAplicarRNCDevoluciones_Click(sender As Object, e As EventArgs)
|
Protected Sub BtnAplicarRNCDevoluciones_Click(sender As Object, e As EventArgs)
|
||||||
@@ -37512,5 +37629,88 @@ Partial Class Ventas
|
|||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Protected Sub GvAplicaRNCDevolucion_RowDataBound(sender As Object, e As GridViewRowEventArgs)
|
||||||
|
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||||
|
e.Row.FCTextBox("TxtCantidadAplicaDevolucion").Attributes.Add("onkeyup", $"LimitaCantidadAplicaDev({e.Row.DBCampo("CantRes").ToDecimal}, this);")
|
||||||
|
If UsuarioActual.Empresa.Tipo_CentroCosto = 1 Or UsuarioActual.Empresa.Tipo_CentroCosto = 2 Then
|
||||||
|
e.Row.FCLabel("LblProyecto").Text = e.Row.FCLabel("LblSubProyecto").Text
|
||||||
|
e.Row.FCLabel("LblProyecto").Style.Clear()
|
||||||
|
e.Row.FCLabel("LblSubProyecto").Text = ""
|
||||||
|
'e.Row.FCCheckBox("ChkAplicar").Attributes.Add("onclick", $"CalculaSaldoRNCChk({e.Row.FCTextBox("TxtImporte").ClientID},{e.Row.DBCampo("Saldo").ToDouble}, this);")
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Protected Sub BtnAplicaRNCDevolucion_Click(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
|
Dim Selecciono As Boolean = False
|
||||||
|
For Each Gv As GridViewRow In GvAplicaRNCDevolucion.Rows
|
||||||
|
If Gv.FCCheckBox("Chk").Checked And Gv.FCTextBox("TxtCantidadAplicaDevolucion").Text.ToDouble > 0 Then
|
||||||
|
Selecciono = True
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
|
||||||
|
If Not Selecciono Then
|
||||||
|
Alert("Tiene que seleccionar al menos un concepto y este dege tener una cantidad mayor a 0. Por favor verifique y vuelva a intentar", TipoMensaje.MsgAdvertencia)
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
|
||||||
|
If DdlTipoComprobante.Items.FindByValue("RNC") Is Nothing Then
|
||||||
|
DdlTipoComprobante.Items.Add(New ListItem("Remisión de nota de crédito", "RNC"))
|
||||||
|
End If
|
||||||
|
|
||||||
|
DdlTipoComprobante.SelectedValueExist("RNC")
|
||||||
|
|
||||||
|
TmpDT.Clear()
|
||||||
|
For Each Gv As GridViewRow In GvAplicaRNCDevolucion.Rows
|
||||||
|
If Gv.FCCheckBox("Chk").Checked And Gv.FCTextBox("TxtCantidadAplicaDevolucion").Text.ToDecimal > 0 Then
|
||||||
|
Dim Cantidad As Decimal = Gv.FCTextBox("TxtCantidadAplicaDevolucion").Text.ToDecimal
|
||||||
|
Dim Descuento As Decimal = Cantidad * Gv.DataKey("Descuento").ToString().ToDecimal / Gv.DataKey("Cantidad").ToString().ToDecimal
|
||||||
|
Dim PU As Decimal = Gv.DataKey("PU").ToDecimal
|
||||||
|
Dim Total As Decimal = (Cantidad * PU)
|
||||||
|
Dim TotalImpuestos As Decimal = (Cantidad * PU) - Descuento
|
||||||
|
Dim TotalCalculableImpuestosIVA As Decimal = TotalImpuestos * (1 + Gv.DataKey("PorcentajeIEPS").ToString().ToDecimal)
|
||||||
|
Dim ImporteIVA As Decimal = TotalCalculableImpuestosIVA * Gv.DataKey("PorcentajeIVA").ToString().ToDecimal
|
||||||
|
Dim ImporteRetIVA As Decimal = TotalImpuestos * Gv.DataKey("PorcentajeRetIVA").ToString().ToDecimal
|
||||||
|
Dim ImporteRetISR As Decimal = TotalImpuestos * Gv.DataKey("PorcentajeRetISR").ToString().ToDecimal
|
||||||
|
Dim ImporteIEPS As Decimal = TotalImpuestos * Gv.DataKey("PorcentajeIEPS").ToString().ToDecimal
|
||||||
|
Dim CodigoObjetoImpuesto As String = Gv.DataKey("CodigoObjetoImpuesto")
|
||||||
|
|
||||||
|
AgregaTempDT(TmpDT, Gv.DataKey("CvePS").ToString().ToEntero(), Gv.DataKey("PS").ToString(), Gv.DataKey("Codigo").ToString(), Gv.DataKey("CodigoPS").ToString(),
|
||||||
|
Gv.DataKey("CveTipoPS").ToString().ToEntero(), Gv.DataKey("CveTipoInvPS").ToString().ToEntero(),
|
||||||
|
Gv.DataKey("CveUM").ToString().ToEntero(), Gv.DataKey("UM").ToString(), Gv.DataKey("CveClasificacion").ToString().ToEntero(),
|
||||||
|
Gv.DataKey("Clasificacion").ToString(), Gv.DataKey("CveProyecto").ToString().ToEntero(), Gv.DataKey("Proyecto").ToString(),
|
||||||
|
Gv.DataKey("CveSubProyecto").ToString().ToEntero(), Gv.DataKey("SubProyecto").ToString(),
|
||||||
|
Gv.DataKey("Obs").ToString(), Cantidad, PU, Gv.DataKey("PorcentajeIVA").ToString().ToDecimal, ImporteIVA,
|
||||||
|
Gv.DataKey("PorcentajeRetIVA").ToString().ToDecimal, ImporteRetIVA,
|
||||||
|
Gv.DataKey("PorcentajeRetISR").ToString().ToDecimal, ImporteRetISR, Gv.DataKey("PorcentajeIEPS").ToString().ToDecimal,
|
||||||
|
ImporteIEPS, -1, Descuento, Total, "", "", -1, -1,
|
||||||
|
Gv.DataKey("SATClaveProdServ").ToString(), Gv.DataKey("SATClaveUM").ToString(), -1, Gv.DataKey("CveVentaDetalle").ToString().ToEntero(), -1, -1, -1, -1, Gv.DataKey("CveTamaño").ToEntero(), CodigoObjetoImpuesto:=CodigoObjetoImpuesto)
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
|
||||||
|
BtnsFacturar.Visible = False
|
||||||
|
BtnEditarRemision.Visible = False
|
||||||
|
|
||||||
|
LimpiaDocumentoDEV()
|
||||||
|
CambiaTipoDocto()
|
||||||
|
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
|
||||||
|
If TxtAtencionA.Text.Trim.Length = 0 Then
|
||||||
|
TxtAtencionA.Enabled = True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
CalculaTotalesVenta()
|
||||||
|
|
||||||
|
UpParametros.Update()
|
||||||
|
|
||||||
|
AplicaDevolucion = True
|
||||||
|
CveVentaDevolucion = Me.CveVenta
|
||||||
|
SaldoVentaDevolucion = HplSaldoAuxiliar.Text.ToDecimal
|
||||||
|
|
||||||
|
RegistraScript("$('#DivAplicaRNCDevolucion').modal('hide')")
|
||||||
|
End Sub
|
||||||
End Class
|
End Class
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user