This commit is contained in:
2020-12-02 01:38:35 -07:00
parent a3c8a8872a
commit 8953c5c94c
6 changed files with 338 additions and 257 deletions

View File

@@ -752,7 +752,7 @@
<asp:HiddenField runat="server" ID="HdnCodAFEdit" Value="-1" ClientIDMode="Static" /> <asp:HiddenField runat="server" ID="HdnCodAFEdit" Value="-1" ClientIDMode="Static" />
<asp:GridView ID="GvM" runat="server" GridLines="none" Width="70%" <asp:GridView ID="GvM" runat="server" GridLines="none" Width="70%"
CssClass="table table-hover ADScroller btn-xs" ShowHeader="True" CssClass="table table-hover ADScroller btn-xs" ShowHeader="True"
EmptyDataText="Aún no hay registros." DataKeyNames="No,CveMovimientoDetalle,CvePS,PU,Cantidad,CveTamaño" EmptyDataText="Aún no hay registros." DataKeyNames="No,CveMovimientoDetalle,CvePS,PU,Cantidad,CveTamaño,CodigoPS"
AutoGenerateColumns="False" AllowPaging="False" ShowFooter="True" ShowHeaderWhenEmpty="True"> AutoGenerateColumns="False" AllowPaging="False" ShowFooter="True" ShowHeaderWhenEmpty="True">
<Columns> <Columns>
<asp:TemplateField HeaderText="" ItemStyle-Font-Size="6pt"> <asp:TemplateField HeaderText="" ItemStyle-Font-Size="6pt">

View File

@@ -2489,7 +2489,6 @@ Partial Class Inventarios_RecepcionUsados
For Each Row As GridViewRow In GvM.Rows For Each Row As GridViewRow In GvM.Rows
If Row.RowType = DataControlRowType.DataRow Then If Row.RowType = DataControlRowType.DataRow Then
Dim CvePS As Integer = Row.DataKey("CvePS").ToEntero()
Dim Cantidad As Decimal = Row.DataKey("Cantidad").ToDecimal() Dim Cantidad As Decimal = Row.DataKey("Cantidad").ToDecimal()
Dim PU As Decimal = Row.DataKey("PU").ToDecimal() Dim PU As Decimal = Row.DataKey("PU").ToDecimal()
Dim CveTamaño As Integer = Row.DataKey("CveTamaño").ToEntero() Dim CveTamaño As Integer = Row.DataKey("CveTamaño").ToEntero()
@@ -2502,29 +2501,45 @@ Partial Class Inventarios_RecepcionUsados
Dim PS As String = "" Dim PS As String = ""
Dim PorcentajeIVA As Decimal = 0D Dim PorcentajeIVA As Decimal = 0D
Dim IVA As Decimal = 0D Dim IVA As Decimal = 0D
If CvePS > 0 Then
If SubTotal > 0 Then Dim CvePS As Integer = 0
Dim Dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS).Rows(0)
If Dr IsNot Nothing Then Select Case RblUsadosAjuste.SelectedValue
CveUnidadMedida = Dr("CveUnidadMedida").ToString.ToEntero Case "0" ' USADOS
CveClasificacion = Dr("CveClasificacion").ToString.ToEntero CvePS = Row.DataKey("CvePS").ToEntero()
PS = Dr("PSCodigo").ToString Case "1" ' AJUSTE/GARANTIA
UnidadMedida = Dr("UnidadMedida").ToString Dim drDatos As DataRow = GlobalDTAcumTamaños().FiltroPrimero(String.Format("CveTamaño = {0} AND CveEmpresa = {1}", CveTamaño, UsuarioActual.CveEmpresa))
Clasificacion = Dr("Clasificacion").ToString
If drDatos IsNot Nothing Then
CvePS = drDatos.Item("CvePSCargo").ToString.ToEntero
End If End If
PorcentajeIVA = 0.16D End Select
IVA = SubTotal * PorcentajeIVA
If CvePS > 0 Then
Dim Dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).Rows(0)
If Dr IsNot Nothing Then
CveUnidadMedida = Dr("CveUnidadMedida").ToString.ToEntero
CveClasificacion = Dr("CveClasificacion").ToString.ToEntero
PS = Dr("PSCodigo").ToString
UnidadMedida = Dr("UnidadMedida").ToString
Clasificacion = Dr("Clasificacion").ToString
End If End If
PorcentajeIVA = 0.16D
IVA = SubTotal * PorcentajeIVA
AddPSRNC(ObjRemisionNC.DtDetalle, Cantidad, CveUnidadMedida, UnidadMedida, CveClasificacion, Clasificacion, CvePS, PS, "", PU, 0, -1, "",
ObjRemisionNC.CveSubProyecto, ObjRemisionNC.SubProyecto.SubProyecto, PorcentajeIVA:=PorcentajeIVA, CveTamaño:=CveTamaño)
Else
Alert("No se pudo cargar el producto", TipoMensaje.MsgError)
End If End If
AddPSRNC(ObjRemisionNC.DtDetalle, Cantidad, CveUnidadMedida, UnidadMedida, CveClasificacion, Clasificacion, CvePS, PS, "", PU, 0, -1, "",
ObjRemisionNC.CveSubProyecto, ObjRemisionNC.SubProyecto.SubProyecto, PorcentajeIVA:=PorcentajeIVA, CveTamaño:=CveTamaño)
End If End If
Next Next
'SI ES AJUSTE/GARANTIA
If RblUsadosAjuste.SelectedValue = "1" Then If RblUsadosAjuste.SelectedValue = "1" Then
'agrego un registro extra del importe de ajuste 'agrego un registro extra del importe de ajuste
Dim PU As Decimal = TxtImporteAjuste.Text.ToDecimal Dim PU As Decimal = TmpDTAjustes.SUMD("Importe")
'CONSULTA EL CONCEPTO DE NC 'CONSULTA EL CONCEPTO DE NC
Dim ArrayNC As String() = UsuarioActual.Empresa.Funcionalidad(591).Split(",".ToCharArray()) Dim ArrayNC As String() = UsuarioActual.Empresa.Funcionalidad(591).Split(",".ToCharArray())
Dim NCAjuste As Integer = -1 Dim NCAjuste As Integer = -1
@@ -2540,7 +2555,18 @@ Partial Class Inventarios_RecepcionUsados
CveClasificacion = Dr("CveClasificacion").ToString.ToEntero CveClasificacion = Dr("CveClasificacion").ToString.ToEntero
CvePS = Dr("CvePS").ToString.ToEntero CvePS = Dr("CvePS").ToString.ToEntero
Dim PorcentajeIVA As Decimal = 0.16D Dim PorcentajeIVA As Decimal = 0.16D
Dim Obs As String = $"Descuento por garantía. BCI: {DdlBCIAjuste.SelectedValue}"
Dim SbBCI As New StringBuilder()
SbBCI.Append("BCI: ")
'AGREGA LOS PRODUCTOS COMO OBSERVACION
For Each GvRow As GridViewRow In GvM.Rows
If GvRow.RowType = DataControlRowType.DataRow Then
SbBCI.AppendFormat("{0},", GvRow.DataKey("CodigoPS"))
End If
Next
SbBCI.Remove(SbBCI.Length - 1, 1)
Dim Obs As String = SbBCI.ToString()
AddPSRNC(ObjRemisionNC.DtDetalle, 1, CveUnidadMedida, "", CveClasificacion, "", CvePS, "", Obs, PU, 0, -1, "", AddPSRNC(ObjRemisionNC.DtDetalle, 1, CveUnidadMedida, "", CveClasificacion, "", CvePS, "", Obs, PU, 0, -1, "",
ObjRemisionNC.CveSubProyecto, ObjRemisionNC.SubProyecto.SubProyecto, PorcentajeIVA:=PorcentajeIVA) ObjRemisionNC.CveSubProyecto, ObjRemisionNC.SubProyecto.SubProyecto, PorcentajeIVA:=PorcentajeIVA)
@@ -2570,7 +2596,6 @@ Partial Class Inventarios_RecepcionUsados
ObjRemisionNC.Total = Total ObjRemisionNC.Total = Total
ObjRemisionNC.TotalOtrosConceptos = 0 ObjRemisionNC.TotalOtrosConceptos = 0
ObjRemisionNC.DtMovimientosUsados = DtMovimientos ObjRemisionNC.DtMovimientosUsados = DtMovimientos
ObjRemisionNC.CveAlmacen = DdlAlmacen.SelectedValue.ToEntero() ObjRemisionNC.CveAlmacen = DdlAlmacen.SelectedValue.ToEntero()
ObjRemisionNC.ObservacionesMovimiento = TxtObservaciones.Text ObjRemisionNC.ObservacionesMovimiento = TxtObservaciones.Text
@@ -2646,6 +2671,10 @@ Partial Class Inventarios_RecepcionUsados
End Sub End Sub
Private Sub CargaPSAjuste() Private Sub CargaPSAjuste()
DdlPSAjuste.setEsWebService(True) DdlPSAjuste.setEsWebService(True)
DdlPSAjuste.Attributes.Add("data-cvesubproyecto", "-1")
DdlPSAjuste.ddlWS.Attributes.Add("data-cveclasificacion", "-1")
DdlPSAjuste.ddlWS.Attributes.Add("data-pagina", "ventas/ventas")
DdlPSAjuste.ddlWS.Attributes.Add("data-Estatus", "1")
End Sub End Sub
Protected Sub DdlPSAjuste_selectedindexchange(sender As Object, e As EventArgs) Protected Sub DdlPSAjuste_selectedindexchange(sender As Object, e As EventArgs)
@@ -2996,28 +3025,38 @@ Partial Class Inventarios_RecepcionUsados
End If End If
Dim ObjPS As New ClsProductosServicios Dim ObjPS As New ClsProductosServicios
Dim CveTamaño As Integer = -1 Try
If ObjPS.GetPS(CvePS, -1, UsuarioActual.CveEmpresa) Then Dim CveTamaño As Integer = -1
CveTamaño = ObjPS.DtResultados.FiltroPrimeroValor("CveTamaño").ToEntero If ObjPS.GetPS(CvePS, -1, UsuarioActual.CveEmpresa) Then
End If CveTamaño = ObjPS.DtResultados.FiltroPrimeroValor("CveTamaño").ToEntero
Dim drDatos As DataRow = GlobalDTAcumTamaños().FiltroPrimero(String.Format("CveTamaño = {0} AND CveEmpresa = {1}", CveTamaño, UsuarioActual.CveEmpresa))
If drDatos IsNot Nothing Then
Dim Importe As Decimal = drDatos("Cargo").ToString.ToDecimal
Dim drTamañoPS As DataRow = Nothing
DtMovimientos.Rows.Clear()
If ObjPS.GetPS(drDatos.Item("CvePSCargo").ToString.ToEntero, -1, UsuarioActual.CveEmpresa) Then
drTamañoPS = ObjPS.DtResultados.FiltroPrimero("")
'CveTamaño = -1 'limpio esta variable para que no se registre dos veces en la clase Modelos
AddNew(drTamañoPS.Item("CvePS").ToString.ToEntero, drTamañoPS.Item("PSCodigo").ToString, drTamañoPS.Item("CveUM").ToString.ToEntero, drTamañoPS.Item("UnidadMedida").ToString, 1.0, Importe,
"", "-1", "-1", "-1", "", "", -1, "", "", CveTamaño)
End If End If
Else Dim drDatos As DataRow = GlobalDTAcumTamaños().FiltroPrimero(String.Format("CveTamaño = {0} AND CveEmpresa = {1}", CveTamaño, UsuarioActual.CveEmpresa))
Alert("No se pudo cargar el producto", TipoMensaje.MsgError)
End If If drDatos IsNot Nothing Then
Dim Importe As Decimal = drDatos("Cargo").ToString.ToDecimal
Dim drTamañoPS As DataRow = Nothing
DtMovimientos.Rows.Clear()
Select Case RblUsadosAjuste.SelectedValue
Case "0" ' USADOS
CvePS = drDatos.Item("CvePSCargo").ToString.ToEntero
Case "1" ' AJUSTE/GARANTIA
CvePS = DdlPSAjuste.SelectedValue.ToEntero
End Select
If ObjPS.GetPS(CvePS, -1, UsuarioActual.CveEmpresa) Then
drTamañoPS = ObjPS.DtResultados.FiltroPrimero("")
'CveTamaño = -1 'limpio esta variable para que no se registre dos veces en la clase Modelos
AddNew(drTamañoPS.Item("CvePS").ToString.ToEntero, drTamañoPS.Item("PSCodigo").ToString, drTamañoPS.Item("CveUM").ToString.ToEntero, drTamañoPS.Item("UnidadMedida").ToString, 1.0, Importe,
"", "-1", "-1", "-1", "", "", -1, "", "", CveTamaño)
End If
Else
Alert("No se pudo cargar el producto", TipoMensaje.MsgError)
End If
Catch ex As Exception
OnError("Ocurrió un error al agregar el producto", ex)
End Try
ObjPS.Dispose() ObjPS.Dispose()
GuardaAjuste() GuardaAjuste()

View File

@@ -4155,61 +4155,7 @@
<ajax:TabPanel ID="TabUsados" runat="server" HeaderText="Usados" Visible="false"> <ajax:TabPanel ID="TabUsados" runat="server" HeaderText="Usados" Visible="false">
<ContentTemplate> <ContentTemplate>
<div class="row"> <div class="row">
<div class="col-md-6 " id="DVusadosResumen" runat="server">
<div class="portlet light xspadding bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Usados resumen</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
</div>
<div class="portlet-body form">
<asp:UpdatePanel runat="server" ID="UpUsadosResumen" UpdateMode="Conditional">
<ContentTemplate>
<table style="width: 100%!important">
<tr>
<td style="width: 140px!important">Puntos</td>
<td style="text-align: right!important; width: 120px!important">
<asp:Label runat="server" ID="LblUsadosPuntos"></asp:Label></td>
<td style="text-align: right!important"></td>
</tr>
<tr>
<td>Importe Cargo</td>
<td style="text-align: right!important">$
<asp:Label runat="server" ID="LblUsadosImpCargo"></asp:Label></td>
<td style="text-align: right!important">
<asp:Button runat="server" Visible="false" Height="34px" Width="300px" ID="LnkFacturaUsadosCargos" CssClass="btn btn-primary" Text="Generar NC Cargo" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar generación de remisión de nota de crédito de cargos" data-btn-ok-label="si" OnClick="LnkFacturaUsadosCargos_Click"></asp:Button>
</td>
</tr>
<tr>
<td>Importe Bonificación</td>
<td style="text-align: right!important">$
<asp:Label runat="server" ID="LblusadosImpBonificacion"></asp:Label></td>
<td style="text-align: right!important">
<asp:Button runat="server" Height="34px" Width="300px" ID="LnkFacturaUsadosBonificacion" CssClass="btn btn-primary" Text="Generar RNC de Bonificación" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar generación de remisión de nota de crédito de bonificación" data-btn-ok-label="si" OnClick="LnkFacturaUsadosBonificacion_Click"></asp:Button>
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
<div class="col-md-6" id="DivSaldoUsados" runat="server"> <div class="col-md-6" id="DivSaldoUsados" runat="server">
<div class="portlet light xspadding bordered"> <div class="portlet light xspadding bordered">
<div class="portlet-title"> <div class="portlet-title">
@@ -4219,23 +4165,28 @@
</div> </div>
<div class="actions"> <div class="actions">
<div class="btn-group"> <div class="btn-group">
<asp:Button runat="server" Width="250px" ID="LnkFacturaUsadosBonificacion" CssClass="btn btn-primary" Text="Generar RNC de Bonificación" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar generación de remisión de nota de crédito de bonificación" data-btn-ok-label="si" OnClick="LnkFacturaUsadosBonificacion_Click"></asp:Button>
</div> </div>
</div> </div>
</div> </div>
<div class="portlet-body form"> <div class="portlet-body form">
<asp:UpdatePanel ID="UpGvUsadosResumen" runat="server" UpdateMode="Conditional"> <div class="row">
<ContentTemplate> <div class="col-md-12">
<asp:GridView ID="GvUsadosResumen" Width="100%" runat="server" GridLines="None" <asp:UpdatePanel ID="UpGvUsadosResumen" runat="server" UpdateMode="Conditional">
CssClass="table table-striped table-advance table-hover ScrollAD " ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true" <ContentTemplate>
AutoGenerateColumns="False" AllowPaging="False" ShowFooter="False"> <asp:GridView ID="GvUsadosResumen" Width="100%" runat="server" GridLines="None" DataKeyNames="Puntos"
<Columns> CssClass="table table-striped table-advance table-hover ScrollAD " ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true"
<asp:BoundField DataField="SaldoCliente" HeaderText="" /> AutoGenerateColumns="False" AllowPaging="False" ShowFooter="False">
<asp:BoundField DataField="Puntos" HeaderText="Puntos" DataFormatString="{0:n}" ItemStyle-HorizontalAlign="Right" ControlStyle-BorderWidth="150px" /> <Columns>
<asp:BoundField DataField="Valor" HeaderText="Valor $" DataFormatString="{0:n}" ItemStyle-HorizontalAlign="Right" ControlStyle-BorderWidth="150px" /> <asp:BoundField DataField="SaldoCliente" HeaderText="" />
</Columns> <asp:BoundField DataField="Puntos" HeaderText="Puntos" DataFormatString="{0:n}" ItemStyle-HorizontalAlign="Right" ControlStyle-BorderWidth="150px" />
</asp:GridView> <asp:BoundField DataField="Valor" HeaderText="Valor $" DataFormatString="{0:n}" ItemStyle-HorizontalAlign="Right" ControlStyle-BorderWidth="150px" />
</ContentTemplate> </Columns>
</asp:UpdatePanel> </asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -4783,7 +4783,7 @@ Partial Class Clientes
Exit Select Exit Select
Case 6 Case 6
TxtCuentaValor.Visible = True TxtCuentaValor.Visible = True
TxtCuentaValor.TextMode = TextBoxMode.Number TxtCuentaValor.TextMode = TextBoxMode.SingleLine
If Requerido = 1 Then If Requerido = 1 Then
RFVCuentaValor1.Enabled = True RFVCuentaValor1.Enabled = True
@@ -4893,7 +4893,7 @@ Partial Class Clientes
Exit Select Exit Select
Case 6 Case 6
TxtCuentaValor.Visible = True TxtCuentaValor.Visible = True
TxtCuentaValor.TextMode = TextBoxMode.Number TxtCuentaValor.TextMode = TextBoxMode.SingleLine
If Requerido = 1 Then If Requerido = 1 Then
RFVCuentaValor2.Enabled = True RFVCuentaValor2.Enabled = True
@@ -9135,45 +9135,27 @@ Partial Class Clientes
Dim ObjAcum As New ClsAcumuladores Dim ObjAcum As New ClsAcumuladores
Dim ImporteCargo As Decimal = 0D Dim ImporteCargo As Decimal = 0D
Dim ImporteBonificacion As Decimal = 0D
If ObjAcum.DistribuidorMovtosGet(CveCliente, UsuarioActual.CveEmpresa, TxtFechaIUsados.Text.ToDate, TxtFechaFUsados.Text.ToDate, CveConcepto:=DdlConceptoUsado.SelectedValue.ToEntero()) Then If ObjAcum.DistribuidorMovtosGet(CveCliente, UsuarioActual.CveEmpresa, TxtFechaIUsados.Text.ToDate, TxtFechaFUsados.Text.ToDate, CveConcepto:=DdlConceptoUsado.SelectedValue.ToEntero()) Then
GvAcum.DataSource = ObjAcum.DtResultados GvAcum.DataSource = ObjAcum.DtResultados
End If
LblUsadosPuntos.Text = (ObjAcum.DtResultados.SUM("Puntos", " CveConcepto = 2 ") - ObjAcum.DtResultados.SUM("Puntos", " CveConcepto IN (1,3) ")).ToDecimal.FormatoNumero(2)
Dim ImporteBonificacion As Decimal = 0
ImporteCargo = ObjAcum.DtResultados.SUM("ImporteCargo", "(FacturadoCargo = 0 OR FacturadoCargo IS NULL) AND CveConcepto = 1 ").ToDecimal If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) AndAlso ObjAcum.DtResultados.Rows.Count > 0 Then
ImporteBonificacion = ObjAcum.DtResultados.SUM("ImporteBonificacion", "(FacturadoBonificacion = 0 OR FacturadoBonificacion IS NULL) AND CveConcepto = 1 ").ToDecimal
LblUsadosImpCargo.Text = ImporteCargo.FormatoNumero(2)
LblusadosImpBonificacion.Text = ImporteBonificacion.FormatoNumero(2)
Else
GvAcum.DataSource = Nothing
ImporteCargo = 0D
ImporteBonificacion = 0D
LblUsadosImpCargo.Text = ""
LblusadosImpBonificacion.Text = ""
LblUsadosPuntos.Text = ""
End If
If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) Then
GvUsadosResumen.DataSource = ObjAcum.DtResultados GvUsadosResumen.DataSource = ObjAcum.DtResultados
ImporteBonificacion = ObjAcum.DtResultados.Rows(4)("Valor").ToString().ToDecimal()
End If End If
GvUsadosResumen.DataBind() GvUsadosResumen.DataBind()
'LnkFacturaUsadosCargos.Visible = If(ImporteCargo > 0, True, False)
LnkFacturaUsadosBonificacion.Visible = If(ImporteBonificacion > 0, True, False) 'LnkFacturaUsadosCargos.Visible = If(ImporteCargo > 0, True, False)
LnkFacturaUsadosBonificacion.Visible = If(ImporteBonificacion > 0, True, False)
ObjAcum.Dispose() ObjAcum.Dispose()
GvAcum.DataBind() GvAcum.DataBind()
UpAcciones.Update() UpAcciones.Update()
UpUsadosResumen.Update() 'UpUsadosResumen.Update()
UpGvUsadosResumen.Update() UpGvUsadosResumen.Update()
UpAcum.Update() UpAcum.Update()
@@ -10187,7 +10169,7 @@ Partial Class Clientes
Private Sub LnkUsadosReset_Click(sender As Object, e As EventArgs) Handles LnkUsadosReset.Click Private Sub LnkUsadosReset_Click(sender As Object, e As EventArgs) Handles LnkUsadosReset.Click
Dim Acum As New ClsAcumuladores Dim Acum As New ClsAcumuladores
Dim Puntos As Decimal = -LblUsadosPuntos.Text.ToDecimal Dim Puntos As Decimal = -GvUsadosResumen.Rows.Cast(Of GridViewRow).Where(Function(x) x.RowType = DataControlRowType.DataRow).FirstOrDefault(Function(gvr) gvr.RowIndex = 3).DataKey("Puntos").ToEntero()
If Acum.DistribuidorMovtosAdd(CveCliente, 1, 1, 3, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Puntos, "Saldo Inicializado") Then If Acum.DistribuidorMovtosAdd(CveCliente, 1, 1, 3, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Puntos, "Saldo Inicializado") Then
Alert("Puntuación Inicializada") Alert("Puntuación Inicializada")
End If End If

View File

@@ -6273,12 +6273,21 @@
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-12">
<asp:RadioButtonList ID="RblRNCTipo" runat="server" RepeatDirection="Horizontal" CssClass="input-group col-md-12" CellSpacing="100" AutoPostBack="true" OnSelectedIndexChanged="RblRNCTipo_SelectedIndexChanged" >
<asp:ListItem Value="1" Class="one" Selected="True"><label><b>Cargos</b></label></asp:ListItem>
<asp:ListItem Value="2" Class="one"><label><b>Bonificaciones</b></label></asp:ListItem>
<asp:ListItem Value="3" Class="one"><label><b>Ajuste/Garantía</b></label></asp:ListItem>
</asp:RadioButtonList>
</div>
</div>
<div class="row" id="DivRNCCargo" runat="server">
<div class="col-md-12"> <div class="col-md-12">
<div class="portlet light xspadding bordered"> <div class="portlet light xspadding bordered">
<div class="portlet-title"> <div class="portlet-title">
<div class="caption font-green"> <div class="caption font-green">
<i class="icon-pin font-green"></i> <i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Cargos</span> <span class="caption-subject bold uppercase"><asp:Literal ID="LtlCargos" runat="server" Text=""></asp:Literal></span>
</div> </div>
<div class="actions"> <div class="actions">
<div class="btn-group"> <div class="btn-group">
@@ -8086,75 +8095,75 @@
function LimpiaModal() { function LimpiaModal() {
$('#<%= TxtDireccion.ClientID %>').val(''); $('#<%= TxtDireccion.ClientID %>').val('');
$('#<%= TxtColonia.ClientID %>').val(''); $('#<%= TxtColonia.ClientID %>').val('');
$('#<%= TxtCiudad.ClientID %>').val(''); $('#<%= TxtCiudad.ClientID %>').val('');
$('#<%= TxtEstado.ClientID %>').val(''); $('#<%= TxtEstado.ClientID %>').val('');
$('#<%= TxtCP.ClientID %>').val(''); $('#<%= TxtCP.ClientID %>').val('');
} }
function BtnMateriales() { function BtnMateriales() {
$('#BtnMateriales').click(); $('#BtnMateriales').click();
} }
function BtnEnviarMailCancelacion() { function BtnEnviarMailCancelacion() {
$('#BtnEnviarMailCancelacion').click(); $('#BtnEnviarMailCancelacion').click();
} }
function BtnRefacturacionConfirmar() { function BtnRefacturacionConfirmar() {
$('#BtnRefacturacionConfirmar').click(); $('#BtnRefacturacionConfirmar').click();
} }
function BtnRefacturacionConfirmarAceptacion(Liga) { function BtnRefacturacionConfirmarAceptacion(Liga) {
$('#BtnRefacturacionConfirmarAceptacion').click(); $('#BtnRefacturacionConfirmarAceptacion').click();
} }
function BtnRefrescarPagina() { function BtnRefrescarPagina() {
$('#BtnRefrescarPagina').click(); $('#BtnRefrescarPagina').click();
} }
function Recargar() { function Recargar() {
$('#BtnRefrescarPagina').click(); $('#BtnRefrescarPagina').click();
} }
function BtnAplicaNuevaNC() { function BtnAplicaNuevaNC() {
$('#BtnAplicaNuevaNC').click(); $('#BtnAplicaNuevaNC').click();
} }
$('.DdlPS').on("select2:open", function (e) { $('.select2-container.select2-container--default .select2-dropdown .select2anothertable').remove(); }); $('.DdlPS').on("select2:open", function (e) { $('.select2-container.select2-container--default .select2-dropdown .select2anothertable').remove(); });
$('.DdlPSPyME').on("select2:open", function (e) { $('.select2-container.select2-container--default .select2-dropdown .select2anothertable').remove(); }); $('.DdlPSPyME').on("select2:open", function (e) { $('.select2-container.select2-container--default .select2-dropdown .select2anothertable').remove(); });
$("body").on("mouseenter", ".select2-container.select2-container--default.select2-container--open .select2-dropdown li", function (event) { $("body").on("mouseenter", ".select2-container.select2-container--default.select2-container--open .select2-dropdown li", function (event) {
var $this = $(this); var $this = $(this);
var ind = $this.index(); var ind = $this.index();
$(".select2-container.select2-container--default.select2-container--open .select2-dropdown .select2anothertable tr.active").removeClass('active'); $(".select2-container.select2-container--default.select2-container--open .select2-dropdown .select2anothertable tr.active").removeClass('active');
$(".select2-container.select2-container--default.select2-container--open .select2-dropdown .select2anothertable tr:nth-child(" + (ind + 2) + ")").addClass('active'); $(".select2-container.select2-container--default.select2-container--open .select2-dropdown .select2anothertable tr:nth-child(" + (ind + 2) + ")").addClass('active');
//log($this); //log($this);
}); });
var scrollfuncion = function () { var scrollfuncion = function () {
var stop = this.scrollTop; var stop = this.scrollTop;
$(".select2-container.select2-container--default.select2-container--open .select2-dropdown .select2anothertable").scrollTop(stop); $(".select2-container.select2-container--default.select2-container--open .select2-dropdown .select2anothertable").scrollTop(stop);
} }
function CargaExistenciaAlmacenes(data, params) { function CargaExistenciaAlmacenes(data, params) {
var div = $('<div class="select2anothertable" style=" max-width: 950px; overflow-x: auto;"></div>'); var div = $('<div class="select2anothertable" style=" max-width: 950px; overflow-x: auto;"></div>');
$('.select2-container.select2-container--default.select2-container--open .select2-dropdown .select2anothertable').remove(); $('.select2-container.select2-container--default.select2-container--open .select2-dropdown .select2anothertable').remove();
$('.select2-container.select2-container--default.select2-container--open .select2-dropdown').prepend(div); $('.select2-container.select2-container--default.select2-container--open .select2-dropdown').prepend(div);
var table = $('<table id="TExistencias" ></table>'); div.append(table); var table = $('<table id="TExistencias" ></table>'); div.append(table);
var tbody = $('<tbody></tbody>'); table.append(tbody); var tbody = $('<tbody></tbody>'); table.append(tbody);
$(".select2-container--default .select2-results>.select2-results__options").off("scroll", scrollfuncion); $(".select2-container--default .select2-results>.select2-results__options").off("scroll", scrollfuncion);
$(".select2-container--default .select2-results>.select2-results__options").scroll(scrollfuncion); $(".select2-container--default .select2-results>.select2-results__options").scroll(scrollfuncion);
var indexd = 0; var indexd = 0;
data.forEach(function (item) { data.forEach(function (item) {
if (indexd == 0) { if (indexd == 0) {
var tr = $('<tr></tr>'); tbody.append(tr);
var td;
for (var key in item) {
if (!(key == "text" || key == "id")) { td = $('<td style="font-weight:bold;">' + key + '</td>'); tr.append(td); }
}
}
var tr = $('<tr></tr>'); tbody.append(tr); var tr = $('<tr></tr>'); tbody.append(tr);
var td; var td;
for (var key in item) { for (var key in item) {
if (!(key == "text" || key == "id")) { td = $('<td style="font-weight:bold;">' + key + '</td>'); tr.append(td); } if (!(key == "text" || key == "id")) {
} if ((item[key] > 0)) {
} td = $('<td style = "font-weight:bold;" >' + item[key] + '</td>'); tr.append(td);
var tr = $('<tr></tr>'); tbody.append(tr); } else {
if ('<%= UsuarioActual.Empresa.Funcionalidad(566) %>' == '1') {
var td;
for (var key in item) {
if (!(key == "text" || key == "id")) {
if ((item[key] > 0)) {
td = $('<td style = "font-weight:bold;" >' + item[key] + '</td>'); tr.append(td);
} else {
if ('<%= UsuarioActual.Empresa.Funcionalidad(566) %>' == '1') {
var buscarAlmacenes = "CargaExistenciasSucursales(" + item.id + ",'" + item.text + "');" var buscarAlmacenes = "CargaExistenciasSucursales(" + item.id + ",'" + item.text + "');"
td = $('<td>' + item[key] + ' <button type="button" class="btn btn-xs btn-primary" onclick="' + buscarAlmacenes + '">Ver mas existencias</button></td>'); tr.append(td); td = $('<td>' + item[key] + ' <button type="button" class="btn btn-xs btn-primary" onclick="' + buscarAlmacenes + '">Ver mas existencias</button></td>'); tr.append(td);
} else { } else {
@@ -8361,44 +8370,44 @@
if (TotalAnticipos > 0) { if (TotalAnticipos > 0) {
$('#<%= BtnAceptarAnticipos.ClientID %>').prop('disabled', false); $('#<%= BtnAceptarAnticipos.ClientID %>').prop('disabled', false);
} else { } else {
$('#<%= BtnAceptarAnticipos.ClientID %>').prop('disabled', true); $('#<%= BtnAceptarAnticipos.ClientID %>').prop('disabled', true);
} }
} else { } else {
$('#<%= BtnAceptarAnticipos.ClientID %>').prop('disabled', true); $('#<%= BtnAceptarAnticipos.ClientID %>').prop('disabled', true);
} }
}
function showDivEC() {
$('#<%= TxtRFCCliente.ClientID %>').val('');
$('#<%= TxtNombreCliente.ClientID %>').val('');
$('#<%= TxtDireccionCliente.ClientID %>').val('');
$('#<%= TxtNumExtCliente.ClientID %>').val('');
$('#<%= TxtNumIntCliente.ClientID %>').val('');
$('#<%= TxtCPCliente.ClientID %>').val('');
$('#<%= TxtColoniaCliente.ClientID %>').val('');
$('#<%= TxtTelefonoCliente.ClientID %>').val('');
$('#<%= TxtCiudadCliente.ClientID %>').val('');
$('#<%= TxtLocalidadCliente.ClientID %>').val('');
$('#<%= DdlSATPais.ClientID %>').val('');
$('#<%= DdlEstadoSAT.ClientID %>').val('');
$('#<%= TxtCorreoCliente.ClientID %>').val('');
$('#divAgregarCliente').modal();
} }
function showDivEC() { function hideDivEC() {
$('#<%= TxtRFCCliente.ClientID %>').val(''); $('#divAgregarCliente').modal('hide');
$('#<%= TxtNombreCliente.ClientID %>').val(''); }
$('#<%= TxtDireccionCliente.ClientID %>').val('');
$('#<%= TxtNumExtCliente.ClientID %>').val('');
$('#<%= TxtNumIntCliente.ClientID %>').val('');
$('#<%= TxtCPCliente.ClientID %>').val('');
$('#<%= TxtColoniaCliente.ClientID %>').val('');
$('#<%= TxtTelefonoCliente.ClientID %>').val('');
$('#<%= TxtCiudadCliente.ClientID %>').val('');
$('#<%= TxtLocalidadCliente.ClientID %>').val('');
$('#<%= DdlSATPais.ClientID %>').val('');
$('#<%= DdlEstadoSAT.ClientID %>').val('');
$('#<%= TxtCorreoCliente.ClientID %>').val('');
$('#divAgregarCliente').modal(); var ValidarRNC = false;
} function AplicarValidarRNC(Valor) {
ValidarRNC = Valor;
function hideDivEC() { }
$('#divAgregarCliente').modal('hide'); function CompararNC() {
} if (ValidarRNC) {
var TotalRem = ToDouble(document.getElementById('<%= TxtImportesRemisionesNC.ClientID %>').value);
var ValidarRNC = false;
function AplicarValidarRNC(Valor) {
ValidarRNC = Valor;
}
function CompararNC() {
if (ValidarRNC) {
var TotalRem = ToDouble(document.getElementById('<%= TxtImportesRemisionesNC.ClientID %>').value);
var TotalNC = ToDouble(document.getElementById('<%= TxtNCImporte.ClientID %>').value); var TotalNC = ToDouble(document.getElementById('<%= TxtNCImporte.ClientID %>').value);
if (TotalRem == TotalNC) { if (TotalRem == TotalNC) {

View File

@@ -14776,8 +14776,9 @@ Partial Class Ventas
If NuevaFactura = 1 AndAlso UsuarioActual.TienePermisoProceso(222) Then If NuevaFactura = 1 AndAlso UsuarioActual.TienePermisoProceso(222) Then
If ObjVentas.GetVentaDetalle(ObjFacturaDevolucion.CveVenta) Then If ObjVentas.GetVentaDetalle(ObjFacturaDevolucion.CveVenta) Then
TmpDT = ObjVentas.DtResultados TmpDT = ObjVentas.DtResultados
TmpDT.Columns.Add("CveVentaDetalleRNC", GetType(Integer))
End If End If
ErrorCancelar = ProcesoPrepolizas(ObjConta, ObjFacturaDevolucion, -1, TmpDT, ObjAC, -1, ObjBancos, ObjVentas) ErrorCancelar = ProcesoPrepolizaBtnAplicaNuevaNC_Clicks(ObjConta, ObjFacturaDevolucion, -1, TmpDT, ObjAC, -1, ObjBancos, ObjVentas)
Else Else
ErrorCancelar = ProcesoPrepolizas(ObjConta, ObjFacturaDevolucion, -1, TmpDT, ObjAC, -1, ObjBancos, ObjVentas) ErrorCancelar = ProcesoPrepolizas(ObjConta, ObjFacturaDevolucion, -1, TmpDT, ObjAC, -1, ObjBancos, ObjVentas)
End If End If
@@ -23582,7 +23583,7 @@ Partial Class Ventas
End Sub End Sub
Protected Sub DdlVentaUsado_SelectedIndexChanged(sender As Object, e As EventArgs) Protected Sub DdlVentaUsado_SelectedIndexChanged(sender As Object, e As EventArgs)
CargaRNC(DdlVentaUsado.SelectedValue.ToEntero()) RblRNCTipo_SelectedIndexChanged(RblRNCTipo, EventArgs.Empty)
End Sub End Sub
Private Sub InicializaAplicarNCMasiva() Private Sub InicializaAplicarNCMasiva()
@@ -23603,7 +23604,9 @@ Partial Class Ventas
'LkNotaCredito.Visible = False 'LkNotaCredito.Visible = False
DivGvCxC.Visible = True DivGvCxC.Visible = True
CargaCxC() CargaCxC()
CargaRNC() 'CARGAR RNC
RblRNCTipo_SelectedIndexChanged(RblRNCTipo, EventArgs.Empty)
TxtNCPorcentaje.Attributes.Add("onkeyup", "CalculaImporteNCMasivo();") TxtNCPorcentaje.Attributes.Add("onkeyup", "CalculaImporteNCMasivo();")
TxtNCImporte.Text = "0.00" TxtNCImporte.Text = "0.00"
TxtNCImporte.Enabled = False TxtNCImporte.Enabled = False
@@ -23622,6 +23625,28 @@ Partial Class Ventas
ObjMovtos.Dispose() ObjMovtos.Dispose()
GvCxC.DataBind() GvCxC.DataBind()
End Sub End Sub
Protected Sub RblRNCTipo_SelectedIndexChanged(sender As Object, e As EventArgs)
Select Case RblRNCTipo.SelectedValue
Case "1" 'CARGOS
LtlCargos.Text = "CARGOS"
DivRNCCargo.Visible = True
DivRNCBon.Visible = False
CargaRNC(DdlVentaUsado.SelectedValue.ToEntero(), False, False)
Case "2" 'BONIFICACIONES
DivRNCCargo.Visible = False
DivRNCBon.Visible = True
CargaRNC(-1, True, False)
Case "3" 'AJUSTE/GARANTIAS
LtlCargos.Text = "AJUSTES/GARANTIAS"
DivRNCCargo.Visible = True
DivRNCBon.Visible = False
CargaRNC(DdlVentaUsado.SelectedValue.ToEntero(), False, True)
End Select
End Sub
Protected Sub ChkMostarProductosRNC_CheckedChanged(sender As Object, e As EventArgs) Protected Sub ChkMostarProductosRNC_CheckedChanged(sender As Object, e As EventArgs)
If ChkMostarProductosRNC.Checked Then If ChkMostarProductosRNC.Checked Then
DivRNCCargos.Visible = False DivRNCCargos.Visible = False
@@ -23630,11 +23655,11 @@ Partial Class Ventas
Else Else
DivRNCCargos.Visible = True DivRNCCargos.Visible = True
DivRNCCargosDetalle.Visible = False DivRNCCargosDetalle.Visible = False
CargaRNC(DdlVentaUsado.SelectedValue.ToEntero()) RblRNCTipo_SelectedIndexChanged(RblRNCTipo, EventArgs.Empty)
End If End If
UpModalRemisionesNC.Update() UpModalRemisionesNC.Update()
End Sub End Sub
Private Sub CargaRNC(Optional CveVentaUsado As Integer = -1) Private Sub CargaRNC(Optional CveVentaUsado As Integer = -1, Optional CargarBonificaciones As Boolean = False, Optional CargarSoloGarantias As Boolean = False)
Dim DtNC As DataTable = Nothing Dim DtNC As DataTable = Nothing
Dim ObjMovtos As New ClsMovimientos() Dim ObjMovtos As New ClsMovimientos()
@@ -23643,16 +23668,24 @@ Partial Class Ventas
End If End If
ObjMovtos.Dispose() ObjMovtos.Dispose()
TmpDTRNCBonificacionesSeleccionadas = Nothing Me.TmpDTRNCBonificacionesSeleccionadas = Nothing
GvRemisionesNC.DataSource = DtNC.FiltraParametros("TipoRNC = 1")
GvRemisionesNCBon.DataSource = TmpDTRNCBonificacionesSeleccionadas
Me.TmpDTRNCBonificacionesCliente = DtNC.FiltraParametros("TipoRNC = 2") Me.TmpDTRNCBonificacionesCliente = DtNC.FiltraParametros("TipoRNC = 2")
Me.TmpDTRNCBonificacionesCliente.Columns.Add("ImporteBonificacion", GetType(Decimal)) Me.TmpDTRNCBonificacionesCliente.Columns.Add("ImporteBonificacion", GetType(Decimal))
Me.TmpDTRNCBonificacionesCliente.Columns.Add("IVABonificacion", GetType(Decimal)) Me.TmpDTRNCBonificacionesCliente.Columns.Add("IVABonificacion", GetType(Decimal))
Me.TmpDTRNCBonificacionesCliente.Columns.Add("CveVentaRNCCargo", GetType(Integer)) Me.TmpDTRNCBonificacionesCliente.Columns.Add("CveVentaRNCCargo", GetType(Integer))
If CargarBonificaciones Then
Me.TmpDTRNCBonificacionesSeleccionadas = Me.TmpDTRNCBonificacionesCliente.Copy()
End If
If CargarSoloGarantias Then
GvRemisionesNC.DataSource = DtNC.FiltraParametros("TipoRNC = 1 AND EsGarantia = True")
Else
GvRemisionesNC.DataSource = DtNC.FiltraParametros("TipoRNC = 1 AND EsGarantia = False")
End If
GvRemisionesNCBon.DataSource = Me.TmpDTRNCBonificacionesSeleccionadas
GvRemisionesNC.DataBind() GvRemisionesNC.DataBind()
GvRemisionesNCBon.DataBind() GvRemisionesNCBon.DataBind()
@@ -24119,12 +24152,18 @@ Partial Class Ventas
End If End If
Else Else
For Each RNC In ListaRemisionesNC If ListaRemisionesNC IsNot Nothing Then
DtImpuestos.Merge(CargaDtImpuestosNC(RNC.CveVenta, RNC.TotalRemNCAplicado, NCDescuento:=True, AplicaImpuestosLocales:=AplicaImpuestosLocales, NivelTotal:=DdlNCNivelImporte.SelectedValue.ToEntero(), AplicaNCUsado:=(UsuarioActual.CveEmpresa = 140)), True, MissingSchemaAction.Ignore) For Each RNC In ListaRemisionesNC
Next DtImpuestos.Merge(CargaDtImpuestosNC(RNC.CveVenta, RNC.TotalRemNCAplicado, NCDescuento:=True, AplicaImpuestosLocales:=AplicaImpuestosLocales, NivelTotal:=DdlNCNivelImporte.SelectedValue.ToEntero(), AplicaNCUsado:=(UsuarioActual.CveEmpresa = 140)), True, MissingSchemaAction.Ignore)
For Each RNC In ListaNCBonificacion Next
DtImpuestosBonificacion.Merge(CargaDtImpuestosNC(RNC.CveVenta, RNC.TotalRemNCAplicado, NCDescuento:=True, AplicaImpuestosLocales:=AplicaImpuestosLocales, NivelTotal:=DdlNCNivelImporte.SelectedValue.ToEntero(), AplicaNCUsado:=(UsuarioActual.CveEmpresa = 140)), True, MissingSchemaAction.Ignore) End If
Next
If ListaNCBonificacion IsNot Nothing Then
For Each RNC In ListaNCBonificacion
DtImpuestosBonificacion.Merge(CargaDtImpuestosNC(RNC.CveVenta, RNC.TotalRemNCAplicado, NCDescuento:=True, AplicaImpuestosLocales:=AplicaImpuestosLocales, NivelTotal:=DdlNCNivelImporte.SelectedValue.ToEntero(), AplicaNCUsado:=(UsuarioActual.CveEmpresa = 140)), True, MissingSchemaAction.Ignore)
Next
End If
End If End If
@@ -24320,12 +24359,11 @@ Partial Class Ventas
For Each RNC In ListaNC For Each RNC In ListaNC
Dim UltimoRenglonRNC As Integer = 1 Dim UltimoRenglonRNC As Integer = 1
Dim TotalAcumuladoRNC As Decimal = 0 Dim TotalAcumuladoRNC As Decimal = 0
Dim Terminar As Boolean = False
For Each RowUsado As DataRow In RNC.DtDetalle.Rows For Each RowUsado As DataRow In RNC.DtDetalle.Rows
Dim PorcentajeAplicado = (RNC.TotalRemNCAplicado / RNC.Total) Dim Cantidad As Decimal = RowUsado("Cantidad").ToString().ToDecimal()
Dim Cantidad As Decimal = RowUsado("Cantidad").ToString().ToDecimal() * PorcentajeAplicado
Dim Obs = RowUsado("CodigoPS").ToString() Dim Obs = RowUsado("CodigoPS").ToString()
@@ -24345,8 +24383,33 @@ Partial Class Ventas
TotalAcumuladoRNC += (TotalCalculableImpuestos + ImporteIVA + ImporteIEPS - ImporteRetIVA - ImporteRetISR) TotalAcumuladoRNC += (TotalCalculableImpuestos + ImporteIVA + ImporteIEPS - ImporteRetIVA - ImporteRetISR)
'SI EL IMPORTE ES MAYOR REALIZA EL AJUSTE
If TotalAcumuladoRNC > RNC.TotalRemNCAplicado Then
Terminar = True
'RESTA LO SUMANDO DEL ACUMULADO
TotalAcumuladoRNC -= (TotalCalculableImpuestos + ImporteIVA + ImporteIEPS - ImporteRetIVA - ImporteRetISR)
Dim Diferencia As Decimal = RNC.TotalRemNCAplicado - TotalAcumuladoRNC
Dim TotalPartida As Decimal = (TotalCalculableImpuestos + ImporteIVA + ImporteIEPS - ImporteRetIVA - ImporteRetISR)
Dim PorcentajePorAplicar As Decimal = (Diferencia / TotalPartida)
Cantidad = Cantidad * PorcentajePorAplicar
TotalCalculableImpuestos = (Cantidad * ImportePU)
ImporteIVA = (TotalCalculableImpuestos * RowUsado("PorcentajeIVA").ToString().ToDecimal).RoundSQL(2)
ImporteIEPS = (TotalCalculableImpuestos * RowUsado("PorcentajeIEPS").ToString().ToDecimal).RoundSQL(2)
ImporteRetIVA = (TotalCalculableImpuestos * RowUsado("PorcentajeRetIVA").ToString().ToDecimal).RoundSQL(2)
ImporteRetISR = (TotalCalculableImpuestos * RowUsado("PorcentajeRetISR").ToString().ToDecimal).RoundSQL(2)
ImporteTotal = TotalCalculableImpuestos
TotalAcumuladoRNC += (TotalCalculableImpuestos + ImporteIVA + ImporteIEPS - ImporteRetIVA - ImporteRetISR)
End If
'SI ES EL ULTIMO REGLON REALIZA UN AJUSTE 'SI ES EL ULTIMO REGLON REALIZA UN AJUSTE
If UltimoRenglonRNC = RNC.DtDetalle.Rows.Count Then If UltimoRenglonRNC = RNC.DtDetalle.Rows.Count OrElse Terminar Then
Dim Ajuste As Decimal = 0 Dim Ajuste As Decimal = 0
If Math.Abs(RNC.TotalRemNCAplicado - TotalAcumuladoRNC) > 0.00 Then If Math.Abs(RNC.TotalRemNCAplicado - TotalAcumuladoRNC) > 0.00 Then
Ajuste = RNC.TotalRemNCAplicado - TotalAcumuladoRNC Ajuste = RNC.TotalRemNCAplicado - TotalAcumuladoRNC
@@ -24361,6 +24424,10 @@ Partial Class Ventas
Obs, Cantidad, ImportePU, RowUsado("PorcentajeIVA").ToString().ToDecimal, ImporteIVA, RowUsado("PorcentajeRetIVA").ToString().ToDecimal, ImporteRetIVA, Obs, Cantidad, ImportePU, RowUsado("PorcentajeIVA").ToString().ToDecimal, ImporteIVA, RowUsado("PorcentajeRetIVA").ToString().ToDecimal, ImporteRetIVA,
RowUsado("PorcentajeRetISR").ToString().ToDecimal, ImporteRetISR, RowUsado("PorcentajeIEPS").ToString().ToDecimal, ImporteIEPS, -1, 0.0, ImporteTotal, "", "", -1, -1, RowUsado("PorcentajeRetISR").ToString().ToDecimal, ImporteRetISR, RowUsado("PorcentajeIEPS").ToString().ToDecimal, ImporteIEPS, -1, 0.0, ImporteTotal, "", "", -1, -1,
DrPS("SATClavePS").ToString(), DrPS("SATClaveUnidadMedida").ToString(), -1, -1, -1, -1, -1, -1, CveVentaDetalleRNC:=RowUsado("CveVentaDetalle").ToString().ToEntero()) DrPS("SATClavePS").ToString(), DrPS("SATClaveUnidadMedida").ToString(), -1, -1, -1, -1, -1, -1, CveVentaDetalleRNC:=RowUsado("CveVentaDetalle").ToString().ToEntero())
If Terminar Then
Exit For
End If
Next Next
Next Next
@@ -24424,6 +24491,7 @@ Partial Class Ventas
For Each RNCBonificacion In ListaNCBonificacion For Each RNCBonificacion In ListaNCBonificacion
Dim UltimoRenglonRNC As Integer = 1 Dim UltimoRenglonRNC As Integer = 1
Dim TotalAcumuladoRNC As Decimal = 0 Dim TotalAcumuladoRNC As Decimal = 0
Dim Terminar As Boolean = False
Dim RNCCargo = ListaNC.Where(Function(f) f.CveVenta = RNCBonificacion.CveVentaRNCCargo).FirstOrDefault() Dim RNCCargo = ListaNC.Where(Function(f) f.CveVenta = RNCBonificacion.CveVentaRNCCargo).FirstOrDefault()
@@ -24431,7 +24499,7 @@ Partial Class Ventas
Dim PorcentajeAplicado = (RNCBonificacion.TotalRemNCAplicado / RNCBonificacion.Total) Dim PorcentajeAplicado = (RNCBonificacion.TotalRemNCAplicado / RNCBonificacion.Total)
Dim Cantidad As Decimal = RowCargo("Cantidad").ToString().ToDecimal() * PorcentajeAplicado Dim Cantidad As Decimal = RowCargo("Cantidad").ToString().ToDecimal() '* PorcentajeAplicado
Dim Obs = RowCargo("CodigoPS").ToString() Dim Obs = RowCargo("CodigoPS").ToString()
@@ -24451,6 +24519,31 @@ Partial Class Ventas
TotalAcumuladoRNC += (TotalCalculableImpuestos + ImporteIVA + ImporteIEPS - ImporteRetIVA - ImporteRetISR) TotalAcumuladoRNC += (TotalCalculableImpuestos + ImporteIVA + ImporteIEPS - ImporteRetIVA - ImporteRetISR)
'SI EL IMPORTE ES MAYOR REALIZA EL AJUSTE
If TotalAcumuladoRNC > RNCBonificacion.TotalRemNCAplicado Then
Terminar = True
'RESTA LO SUMANDO DEL ACUMULADO
TotalAcumuladoRNC -= (TotalCalculableImpuestos + ImporteIVA + ImporteIEPS - ImporteRetIVA - ImporteRetISR)
Dim Diferencia As Decimal = RNCBonificacion.TotalRemNCAplicado - TotalAcumuladoRNC
Dim TotalPartida As Decimal = (TotalCalculableImpuestos + ImporteIVA + ImporteIEPS - ImporteRetIVA - ImporteRetISR)
Dim PorcentajePorAplicar As Decimal = (Diferencia / TotalPartida)
Cantidad = Cantidad * PorcentajePorAplicar
TotalCalculableImpuestos = (Cantidad * ImportePU)
ImporteIVA = (TotalCalculableImpuestos * RowCargo("PorcentajeIVA").ToString().ToDecimal).RoundSQL(2)
ImporteIEPS = (TotalCalculableImpuestos * RowCargo("PorcentajeIEPS").ToString().ToDecimal).RoundSQL(2)
ImporteRetIVA = (TotalCalculableImpuestos * RowCargo("PorcentajeRetIVA").ToString().ToDecimal).RoundSQL(2)
ImporteRetISR = (TotalCalculableImpuestos * RowCargo("PorcentajeRetISR").ToString().ToDecimal).RoundSQL(2)
ImporteTotal = TotalCalculableImpuestos
TotalAcumuladoRNC += (TotalCalculableImpuestos + ImporteIVA + ImporteIEPS - ImporteRetIVA - ImporteRetISR)
End If
'SI ES EL ULTIMO REGLON REALIZA UN AJUSTE 'SI ES EL ULTIMO REGLON REALIZA UN AJUSTE
If UltimoRenglonRNC = RNCCargo.DtDetalle.Rows.Count Then If UltimoRenglonRNC = RNCCargo.DtDetalle.Rows.Count Then
Dim Ajuste As Decimal = 0 Dim Ajuste As Decimal = 0
@@ -24491,6 +24584,7 @@ Partial Class Ventas
TmpDT = ObjVentas.DtResultados.Copy() TmpDT = ObjVentas.DtResultados.Copy()
TmpDT.Columns.Add("EntregaDirecta", GetType(Integer)) TmpDT.Columns.Add("EntregaDirecta", GetType(Integer))
TmpDT.Columns.Add("CveMovimientoDetallePedido", GetType(Integer)) TmpDT.Columns.Add("CveMovimientoDetallePedido", GetType(Integer))
TmpDT.Columns.Add("CveVentaDetalleRNC", GetType(Integer))
End If End If
If AplicaNCMasiva OrElse AplicaNCUsado Then If AplicaNCMasiva OrElse AplicaNCUsado Then
@@ -27606,6 +27700,13 @@ Partial Class Ventas
End If End If
End If End If
Next Next
'SI SON SOLO BONIFICACIONES GENERA LA NC PRINCIPAL EN BASE A ESAS
If RblRNCTipo.SelectedValue.ToString() = "2" AndAlso ListaRemisionesNC.Count = 0 Then
ListaRemisionesNC.AddRange(ListaNCBonificacion)
ListaNCBonificacion.Clear()
End If
End If End If
TxtImportesRemisionesNC.Text = TotalRemNCAplicado.FormatoNumero TxtImportesRemisionesNC.Text = TotalRemNCAplicado.FormatoNumero
@@ -28406,5 +28507,4 @@ Partial Class Ventas
Public ImporteBonificacion As Decimal = 0 Public ImporteBonificacion As Decimal = 0
Public IVABonificacion As Decimal = 0 Public IVABonificacion As Decimal = 0
End Class End Class
End Class End Class