Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -4155,61 +4155,7 @@
|
||||
|
||||
<ajax:TabPanel ID="TabUsados" runat="server" HeaderText="Usados" Visible="false">
|
||||
<ContentTemplate>
|
||||
|
||||
|
||||
<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="portlet light xspadding bordered">
|
||||
<div class="portlet-title">
|
||||
@@ -4219,23 +4165,28 @@
|
||||
</div>
|
||||
<div class="actions">
|
||||
<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 class="portlet-body form">
|
||||
<asp:UpdatePanel ID="UpGvUsadosResumen" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvUsadosResumen" Width="100%" runat="server" GridLines="None"
|
||||
CssClass="table table-striped table-advance table-hover ScrollAD " ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true"
|
||||
AutoGenerateColumns="False" AllowPaging="False" ShowFooter="False">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="SaldoCliente" HeaderText="" />
|
||||
<asp:BoundField DataField="Puntos" HeaderText="Puntos" DataFormatString="{0:n}" ItemStyle-HorizontalAlign="Right" ControlStyle-BorderWidth="150px" />
|
||||
<asp:BoundField DataField="Valor" HeaderText="Valor $" DataFormatString="{0:n}" ItemStyle-HorizontalAlign="Right" ControlStyle-BorderWidth="150px" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<asp:UpdatePanel ID="UpGvUsadosResumen" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvUsadosResumen" Width="100%" runat="server" GridLines="None" DataKeyNames="Puntos"
|
||||
CssClass="table table-striped table-advance table-hover ScrollAD " ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true"
|
||||
AutoGenerateColumns="False" AllowPaging="False" ShowFooter="False">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="SaldoCliente" HeaderText="" />
|
||||
<asp:BoundField DataField="Puntos" HeaderText="Puntos" DataFormatString="{0:n}" ItemStyle-HorizontalAlign="Right" ControlStyle-BorderWidth="150px" />
|
||||
<asp:BoundField DataField="Valor" HeaderText="Valor $" DataFormatString="{0:n}" ItemStyle-HorizontalAlign="Right" ControlStyle-BorderWidth="150px" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -4783,7 +4783,7 @@ Partial Class Clientes
|
||||
Exit Select
|
||||
Case 6
|
||||
TxtCuentaValor.Visible = True
|
||||
TxtCuentaValor.TextMode = TextBoxMode.Number
|
||||
TxtCuentaValor.TextMode = TextBoxMode.SingleLine
|
||||
|
||||
If Requerido = 1 Then
|
||||
RFVCuentaValor1.Enabled = True
|
||||
@@ -4893,7 +4893,7 @@ Partial Class Clientes
|
||||
Exit Select
|
||||
Case 6
|
||||
TxtCuentaValor.Visible = True
|
||||
TxtCuentaValor.TextMode = TextBoxMode.Number
|
||||
TxtCuentaValor.TextMode = TextBoxMode.SingleLine
|
||||
|
||||
If Requerido = 1 Then
|
||||
RFVCuentaValor2.Enabled = True
|
||||
@@ -9135,45 +9135,27 @@ Partial Class Clientes
|
||||
|
||||
Dim ObjAcum As New ClsAcumuladores
|
||||
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
|
||||
|
||||
GvAcum.DataSource = ObjAcum.DtResultados
|
||||
|
||||
LblUsadosPuntos.Text = (ObjAcum.DtResultados.SUM("Puntos", " CveConcepto = 2 ") - ObjAcum.DtResultados.SUM("Puntos", " CveConcepto IN (1,3) ")).ToDecimal.FormatoNumero(2)
|
||||
|
||||
ImporteCargo = ObjAcum.DtResultados.SUM("ImporteCargo", "(FacturadoCargo = 0 OR FacturadoCargo IS NULL) AND CveConcepto = 1 ").ToDecimal
|
||||
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
|
||||
End If
|
||||
|
||||
Dim ImporteBonificacion As Decimal = 0
|
||||
If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) AndAlso ObjAcum.DtResultados.Rows.Count > 0 Then
|
||||
GvUsadosResumen.DataSource = ObjAcum.DtResultados
|
||||
ImporteBonificacion = ObjAcum.DtResultados.Rows(4)("Valor").ToString().ToDecimal()
|
||||
End If
|
||||
GvUsadosResumen.DataBind()
|
||||
|
||||
'LnkFacturaUsadosCargos.Visible = If(ImporteCargo > 0, True, False)
|
||||
LnkFacturaUsadosBonificacion.Visible = If(ImporteBonificacion > 0, True, False)
|
||||
|
||||
GvUsadosResumen.DataBind()
|
||||
|
||||
|
||||
'LnkFacturaUsadosCargos.Visible = If(ImporteCargo > 0, True, False)
|
||||
LnkFacturaUsadosBonificacion.Visible = If(ImporteBonificacion > 0, True, False)
|
||||
|
||||
ObjAcum.Dispose()
|
||||
GvAcum.DataBind()
|
||||
|
||||
UpAcciones.Update()
|
||||
UpUsadosResumen.Update()
|
||||
'UpUsadosResumen.Update()
|
||||
UpGvUsadosResumen.Update()
|
||||
UpAcum.Update()
|
||||
|
||||
@@ -10187,7 +10169,7 @@ Partial Class Clientes
|
||||
Private Sub LnkUsadosReset_Click(sender As Object, e As EventArgs) Handles LnkUsadosReset.Click
|
||||
|
||||
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
|
||||
Alert("Puntuación Inicializada")
|
||||
End If
|
||||
|
||||
@@ -102,7 +102,7 @@
|
||||
<asp:UpdatePanel ID="UpDatos" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" runat="server"
|
||||
DataKeyNames="Nombre,FolioPago,SerieFolio,CveVenta,CveIE,CveCliente,Transaccion,CveVendedor,CveSubProyecto,Vendedor,SubProyecto,CveCategoria,CveMoneda,Costo,CostoDolares,Comision,PorcentajeComision,TieneCategoriaValida,CodigoPS"
|
||||
DataKeyNames="Nombre,FolioPago,SerieFolio,CveVenta,CveIE,CveCliente,Transaccion,CveVendedor,CveSubProyecto,Vendedor,SubProyecto,CveCategoria,CveMoneda,Costo,CostoDolares,Comision,PorcentajeComision,TieneCategoriaValida,CodigoPS,PorcentajePrecioPublico,DiasPago"
|
||||
EmptyDataText="No se han encontrado datos con los filtros especificados." data-sort="true" GridLines="None"
|
||||
CssClass="table table-hover table-striped Widthall ScrollAD " Width="100%" AutoGenerateColumns="False"
|
||||
OnRowDataBound="GvDatos_RowDataBound" OnPreRender="GvDatos_PreRender">
|
||||
|
||||
@@ -113,28 +113,24 @@ public partial class Ventas_RepComisionesJAM : ClsPaginas
|
||||
{
|
||||
e.Row.CssClass = "SubTotales2";
|
||||
//e.Row.Cells[0].Text = e.Row.DBCampo("Vendedor").ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (e.Row.DBCampo("Transaccion").ToString() == "Pago" && ChkEsquemaNuevo.Checked)
|
||||
{
|
||||
e.Row.FCLinkButton("LnkInfo").Visible = true;
|
||||
//if (e.Row.DBCampo("CveCategoria").ToEntero() < 1 && e.Row.DBCampo("Comision").ToDouble() == 0)
|
||||
//{
|
||||
// //if (UsuarioActual.TienePermisoProceso(201))
|
||||
// //{
|
||||
// // e.Row.Cells[21].ToolTip = "No se encuentra dentro de alguna categoria que de comision ni a alguno de los productos especiales.";
|
||||
// // e.Row.Cells[22].ToolTip = "No se encuentra dentro de alguna categoria que de comision ni a alguno de los productos especiales.";
|
||||
// //}
|
||||
// //else
|
||||
// //{
|
||||
// e.Row.Cells[21].ToolTip = "No se encuentra dentro de alguna categoria que de comision ni a alguno de los productos especiales.";
|
||||
// e.Row.Cells[22].ToolTip = "No se encuentra dentro de alguna categoria que de comision ni a alguno de los productos especiales.";
|
||||
// //}
|
||||
//}else if (e.Row.DBCampo("CveCategoria").ToEntero() > 0 )
|
||||
//{
|
||||
// e.Row.Cells[21].ToolTip = $"El producto obtuvo la comision porque se encuentra en la categoria: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria",$"CveCategoria = {e.Row.DBCampo("CveCategoria").ToString()}")}.";
|
||||
// e.Row.Cells[22].ToolTip = $"El producto obtuvo la comision porque se encuentra en la categoria: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = {e.Row.DBCampo("CveCategoria").ToString()}")}.";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (e.Row.DBCampo("Transaccion").ToString() == "Pago" && ChkEsquemaNuevo.Checked)
|
||||
{
|
||||
e.Row.FCLinkButton("LnkInfo").Visible = true;
|
||||
if (!Convert.ToBoolean(e.Row.DataKey("TieneCategoriaValida")) && e.Row.DataKey("Comision").ToDouble() == 0)
|
||||
{
|
||||
e.Row.FCLinkButton("LnkInfo").ToolTip = $"No se encuentra dentro de alguna categoria que de comision ni alguno de los productos especiales. La categoria del producto es: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = { e.Row.DataKey("CveCategoria").ToString()}")}. % Precio Publico: {e.Row.DataKey("PorcentajePrecioPublico").ToString()}. Dias Pago: {e.Row.DataKey("DiasPago").ToString()}.";
|
||||
}
|
||||
else if (Convert.ToBoolean(e.Row.DataKey("TieneCategoriaValida")) && e.Row.DataKey("Comision").ToDouble() > 0)
|
||||
{
|
||||
e.Row.FCLinkButton("LnkInfo").ToolTip = $"El producto obtuvo la comision porque se encuentra en la categoria: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = {e.Row.DataKey("CveCategoria").ToString()}")} y esta dentro de los rangos de precio publico y dias validos. % Precio Publico: {e.Row.DataKey("PorcentajePrecioPublico").ToString()}. Dias Pago: {e.Row.DataKey("DiasPago").ToString()}.";
|
||||
}
|
||||
else if (Convert.ToBoolean(e.Row.DataKey("TieneCategoriaValida")) && e.Row.DataKey("Comision").ToDouble() == 0)
|
||||
{
|
||||
e.Row.FCLinkButton("LnkInfo").ToolTip = $"El producto se encuentra en la categoria: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = {e.Row.DataKey("CveCategoria").ToString()}")} que da comision, pero no se encuentra dentro de los rangos de precio publico y dias validos. % Precio Publico: {e.Row.DataKey("PorcentajePrecioPublico").ToString()}. Dias Pago: {e.Row.DataKey("DiasPago").ToString()}.";
|
||||
}
|
||||
else if (e.Row.DataKey("Comision").ToDouble() > 0)
|
||||
{
|
||||
e.Row.FCLinkButton("LnkInfo").ToolTip = $"El producto obtuvo comision porque esta dentro de los de las comisiones especiales. La categoria del producto es: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = { e.Row.DataKey("CveCategoria").ToString()}")}. El producto es: <b>{e.Row.DataKey("CodigoPS").ToString()}</b>. % Precio Publico: {e.Row.DataKey("PorcentajePrecioPublico").ToString()}. Dias Pago: {e.Row.DataKey("DiasPago").ToString()}.";
|
||||
@@ -357,19 +353,19 @@ public partial class Ventas_RepComisionesJAM : ClsPaginas
|
||||
}
|
||||
|
||||
|
||||
protected void LnkInfo_Click(object sender, EventArgs e)
|
||||
protected void LnkInfo_Click(object sender, EventArgs e)
|
||||
{
|
||||
GridViewRow gvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
|
||||
|
||||
if (!Convert.ToBoolean(gvRow.DataKey("TieneCategoriaValida")) && gvRow.DataKey("Comision").ToDouble() == 0)
|
||||
if (!Convert.ToBoolean(gvRow.DataKey("TieneCategoriaValida")) && gvRow.DataKey("Comision").ToDouble() == 0)
|
||||
{
|
||||
LblInfo.Text = $"No se encuentra dentro de alguna categoria que de comision ni alguno de los productos especiales.<br/> La categoria del producto es: <b>{get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = { gvRow.DataKey("CveCategoria").ToString()}")}</b>. <br/> % Precio Publico: <b>{gvRow.DataKey("PorcentajePrecioPublico").ToString()}</b> <br/> Dias Pago: <b>{gvRow.DataKey("DiasPago").ToString()}</b>";
|
||||
}
|
||||
else if (Convert.ToBoolean(gvRow.DataKey("TieneCategoriaValida")) && gvRow.DataKey("Comision").ToDouble() > 0)
|
||||
else if (Convert.ToBoolean(gvRow.DataKey("TieneCategoriaValida")) && gvRow.DataKey("Comision").ToDouble() > 0)
|
||||
{
|
||||
LblInfo.Text = $"El producto obtuvo la comision porque se encuentra en la categoria: <b>{get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = {gvRow.DataKey("CveCategoria").ToString()}")}</b> y esta dentro de los rangos de precio publico y dias validos. <br/> % Precio Publico: <b>{gvRow.DataKey("PorcentajePrecioPublico").ToString()}</b> <br/> Dias Pago: <b>{gvRow.DataKey("DiasPago").ToString()}</b>";
|
||||
}
|
||||
else if (Convert.ToBoolean(gvRow.DataKey("TieneCategoriaValida")) && gvRow.DataKey("Comision").ToDouble() == 0)
|
||||
else if (Convert.ToBoolean(gvRow.DataKey("TieneCategoriaValida")) && gvRow.DataKey("Comision").ToDouble() == 0)
|
||||
{
|
||||
LblInfo.Text = $"El producto se encuentra en la categoria: <b>{get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = {gvRow.DataKey("CveCategoria").ToString()}")}</b> que da comision, pero no se encuentra dentro de los rangos de precio publico y dias validos. <br/> % Precio Publico: <b>{gvRow.DataKey("PorcentajePrecioPublico").ToString()}</b> <br/> Dias Pago: <b>{gvRow.DataKey("DiasPago").ToString()}</b>";
|
||||
}
|
||||
|
||||
@@ -6273,12 +6273,21 @@
|
||||
</div>
|
||||
</div>
|
||||
<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="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">Cargos</span>
|
||||
<span class="caption-subject bold uppercase"><asp:Literal ID="LtlCargos" runat="server" Text=""></asp:Literal></span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
@@ -6305,7 +6314,7 @@
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox ID="ChkAplicar" runat="server" AutoPostBack="true" OnCheckedChanged="ChkAplicarNCBon_CheckedChanged" />
|
||||
<asp:CheckBox ID="ChkAplicar" runat="server"/>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:HyperLinkField DataNavigateUrlFields="CveVenta" Target="_blank" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" DataTextField="Folio" HeaderText="Folio" ItemStyle-Width="150px" ItemStyle-HorizontalAlign="Left" />
|
||||
@@ -8086,75 +8095,75 @@
|
||||
|
||||
function LimpiaModal() {
|
||||
$('#<%= TxtDireccion.ClientID %>').val('');
|
||||
$('#<%= TxtColonia.ClientID %>').val('');
|
||||
$('#<%= TxtCiudad.ClientID %>').val('');
|
||||
$('#<%= TxtEstado.ClientID %>').val('');
|
||||
$('#<%= TxtCP.ClientID %>').val('');
|
||||
}
|
||||
$('#<%= TxtColonia.ClientID %>').val('');
|
||||
$('#<%= TxtCiudad.ClientID %>').val('');
|
||||
$('#<%= TxtEstado.ClientID %>').val('');
|
||||
$('#<%= TxtCP.ClientID %>').val('');
|
||||
}
|
||||
|
||||
function BtnMateriales() {
|
||||
$('#BtnMateriales').click();
|
||||
}
|
||||
function BtnMateriales() {
|
||||
$('#BtnMateriales').click();
|
||||
}
|
||||
|
||||
function BtnEnviarMailCancelacion() {
|
||||
$('#BtnEnviarMailCancelacion').click();
|
||||
}
|
||||
function BtnRefacturacionConfirmar() {
|
||||
$('#BtnRefacturacionConfirmar').click();
|
||||
}
|
||||
function BtnRefacturacionConfirmarAceptacion(Liga) {
|
||||
$('#BtnRefacturacionConfirmarAceptacion').click();
|
||||
}
|
||||
function BtnRefrescarPagina() {
|
||||
$('#BtnRefrescarPagina').click();
|
||||
}
|
||||
function Recargar() {
|
||||
$('#BtnRefrescarPagina').click();
|
||||
}
|
||||
function BtnAplicaNuevaNC() {
|
||||
$('#BtnAplicaNuevaNC').click();
|
||||
}
|
||||
function BtnEnviarMailCancelacion() {
|
||||
$('#BtnEnviarMailCancelacion').click();
|
||||
}
|
||||
function BtnRefacturacionConfirmar() {
|
||||
$('#BtnRefacturacionConfirmar').click();
|
||||
}
|
||||
function BtnRefacturacionConfirmarAceptacion(Liga) {
|
||||
$('#BtnRefacturacionConfirmarAceptacion').click();
|
||||
}
|
||||
function BtnRefrescarPagina() {
|
||||
$('#BtnRefrescarPagina').click();
|
||||
}
|
||||
function Recargar() {
|
||||
$('#BtnRefrescarPagina').click();
|
||||
}
|
||||
function BtnAplicaNuevaNC() {
|
||||
$('#BtnAplicaNuevaNC').click();
|
||||
}
|
||||
|
||||
$('.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(); });
|
||||
$('.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(); });
|
||||
|
||||
$("body").on("mouseenter", ".select2-container.select2-container--default.select2-container--open .select2-dropdown li", function (event) {
|
||||
var $this = $(this);
|
||||
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:nth-child(" + (ind + 2) + ")").addClass('active');
|
||||
//log($this);
|
||||
});
|
||||
var scrollfuncion = function () {
|
||||
var stop = this.scrollTop;
|
||||
$(".select2-container.select2-container--default.select2-container--open .select2-dropdown .select2anothertable").scrollTop(stop);
|
||||
}
|
||||
function CargaExistenciaAlmacenes(data, params) {
|
||||
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').prepend(div);
|
||||
var table = $('<table id="TExistencias" ></table>'); div.append(table);
|
||||
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").scroll(scrollfuncion);
|
||||
var indexd = 0;
|
||||
data.forEach(function (item) {
|
||||
if (indexd == 0) {
|
||||
$("body").on("mouseenter", ".select2-container.select2-container--default.select2-container--open .select2-dropdown li", function (event) {
|
||||
var $this = $(this);
|
||||
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:nth-child(" + (ind + 2) + ")").addClass('active');
|
||||
//log($this);
|
||||
});
|
||||
var scrollfuncion = function () {
|
||||
var stop = this.scrollTop;
|
||||
$(".select2-container.select2-container--default.select2-container--open .select2-dropdown .select2anothertable").scrollTop(stop);
|
||||
}
|
||||
function CargaExistenciaAlmacenes(data, params) {
|
||||
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').prepend(div);
|
||||
var table = $('<table id="TExistencias" ></table>'); div.append(table);
|
||||
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").scroll(scrollfuncion);
|
||||
var indexd = 0;
|
||||
data.forEach(function (item) {
|
||||
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 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 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') {
|
||||
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 + "');"
|
||||
td = $('<td>' + item[key] + ' <button type="button" class="btn btn-xs btn-primary" onclick="' + buscarAlmacenes + '">Ver mas existencias</button></td>'); tr.append(td);
|
||||
} else {
|
||||
@@ -8361,44 +8370,44 @@
|
||||
|
||||
if (TotalAnticipos > 0) {
|
||||
$('#<%= BtnAceptarAnticipos.ClientID %>').prop('disabled', false);
|
||||
} else {
|
||||
$('#<%= BtnAceptarAnticipos.ClientID %>').prop('disabled', true);
|
||||
}
|
||||
} else {
|
||||
$('#<%= BtnAceptarAnticipos.ClientID %>').prop('disabled', true);
|
||||
}
|
||||
} else {
|
||||
$('#<%= BtnAceptarAnticipos.ClientID %>').prop('disabled', true);
|
||||
}
|
||||
} else {
|
||||
$('#<%= 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() {
|
||||
$('#<%= 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('');
|
||||
function hideDivEC() {
|
||||
$('#divAgregarCliente').modal('hide');
|
||||
}
|
||||
|
||||
$('#divAgregarCliente').modal();
|
||||
}
|
||||
|
||||
function hideDivEC() {
|
||||
$('#divAgregarCliente').modal('hide');
|
||||
}
|
||||
|
||||
var ValidarRNC = false;
|
||||
function AplicarValidarRNC(Valor) {
|
||||
ValidarRNC = Valor;
|
||||
}
|
||||
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);
|
||||
|
||||
if (TotalRem == TotalNC) {
|
||||
|
||||
@@ -3926,7 +3926,7 @@ Partial Class Ventas
|
||||
LblAlertRefacInv.Visible = True
|
||||
End If
|
||||
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Egs", "Ing", "Ant", "Dev", "Rem", "DPe", "RNC") AndAlso Not CveEstatus.Contiene(4, 5, 12, 13, 20) Then
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Egs", "Ing", "Ant", "Dev", "Rem", "DPe", "RNC", "Pd2") AndAlso Not CveEstatus.Contiene(4, 5, 12, 13, 20) Then
|
||||
If UsuarioActual.TienePermisoProceso(159) Then
|
||||
Dim TienePermiso As String = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, -1).FiltroPrimeroValor("CveSubProyecto", String.Format("CveSubProyecto = {0}", DbRowVenta("CveSubProyecto")))
|
||||
If TienePermiso <> "" Then
|
||||
@@ -14777,6 +14777,7 @@ Partial Class Ventas
|
||||
If NuevaFactura = 1 AndAlso UsuarioActual.TienePermisoProceso(222) Then
|
||||
If ObjVentas.GetVentaDetalle(ObjFacturaDevolucion.CveVenta) Then
|
||||
TmpDT = ObjVentas.DtResultados
|
||||
TmpDT.Columns.Add("CveVentaDetalleRNC", GetType(Integer))
|
||||
End If
|
||||
ErrorCancelar = ProcesoPrepolizas(ObjConta, ObjFacturaDevolucion, -1, TmpDT, ObjAC, -1, ObjBancos, ObjVentas)
|
||||
Else
|
||||
@@ -20880,8 +20881,16 @@ Partial Class Ventas
|
||||
RegistraScript("$('#ModalCancelarDocumento').modal();")
|
||||
UpCancelarDocumento.Update()
|
||||
sb.Clear()
|
||||
ElseIf DdlTipoComprobante.SelectedValue.Contiene("Pd2") Then
|
||||
Dim ObjVentas As New ClsVentas
|
||||
If ObjVentas.UpdateEstatusVenta(CveVenta, 22, UsuarioActual.CveEmpresa) Then
|
||||
Dim redirectString As String = String.Format("document.location.href=""/Ventas/Ventas.aspx?CveVenta={0}""", CveVenta)
|
||||
Alert("Pedido cancelado.", JSBtnAceptar:=redirectString)
|
||||
', "document.location.href=""/Ventas/Ventas.aspx?CveVenta=" & CveVenta
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
Else
|
||||
CancelarDocumento()
|
||||
CancelarDocumento()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
@@ -23584,7 +23593,7 @@ Partial Class Ventas
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlVentaUsado_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
CargaRNC(DdlVentaUsado.SelectedValue.ToEntero())
|
||||
RblRNCTipo_SelectedIndexChanged(RblRNCTipo, EventArgs.Empty)
|
||||
End Sub
|
||||
|
||||
Private Sub InicializaAplicarNCMasiva()
|
||||
@@ -23605,7 +23614,9 @@ Partial Class Ventas
|
||||
'LkNotaCredito.Visible = False
|
||||
DivGvCxC.Visible = True
|
||||
CargaCxC()
|
||||
CargaRNC()
|
||||
'CARGAR RNC
|
||||
RblRNCTipo_SelectedIndexChanged(RblRNCTipo, EventArgs.Empty)
|
||||
|
||||
TxtNCPorcentaje.Attributes.Add("onkeyup", "CalculaImporteNCMasivo();")
|
||||
TxtNCImporte.Text = "0.00"
|
||||
TxtNCImporte.Enabled = False
|
||||
@@ -23624,6 +23635,28 @@ Partial Class Ventas
|
||||
ObjMovtos.Dispose()
|
||||
GvCxC.DataBind()
|
||||
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)
|
||||
If ChkMostarProductosRNC.Checked Then
|
||||
DivRNCCargos.Visible = False
|
||||
@@ -23632,11 +23665,11 @@ Partial Class Ventas
|
||||
Else
|
||||
DivRNCCargos.Visible = True
|
||||
DivRNCCargosDetalle.Visible = False
|
||||
CargaRNC(DdlVentaUsado.SelectedValue.ToEntero())
|
||||
RblRNCTipo_SelectedIndexChanged(RblRNCTipo, EventArgs.Empty)
|
||||
End If
|
||||
UpModalRemisionesNC.Update()
|
||||
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 ObjMovtos As New ClsMovimientos()
|
||||
@@ -23645,16 +23678,24 @@ Partial Class Ventas
|
||||
End If
|
||||
ObjMovtos.Dispose()
|
||||
|
||||
TmpDTRNCBonificacionesSeleccionadas = Nothing
|
||||
|
||||
GvRemisionesNC.DataSource = DtNC.FiltraParametros("TipoRNC = 1")
|
||||
GvRemisionesNCBon.DataSource = TmpDTRNCBonificacionesSeleccionadas
|
||||
Me.TmpDTRNCBonificacionesSeleccionadas = Nothing
|
||||
|
||||
Me.TmpDTRNCBonificacionesCliente = DtNC.FiltraParametros("TipoRNC = 2")
|
||||
Me.TmpDTRNCBonificacionesCliente.Columns.Add("ImporteBonificacion", GetType(Decimal))
|
||||
Me.TmpDTRNCBonificacionesCliente.Columns.Add("IVABonificacion", GetType(Decimal))
|
||||
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()
|
||||
GvRemisionesNCBon.DataBind()
|
||||
|
||||
@@ -24121,12 +24162,18 @@ Partial Class Ventas
|
||||
|
||||
End If
|
||||
Else
|
||||
For Each RNC In ListaRemisionesNC
|
||||
DtImpuestos.Merge(CargaDtImpuestosNC(RNC.CveVenta, RNC.TotalRemNCAplicado, NCDescuento:=True, AplicaImpuestosLocales:=AplicaImpuestosLocales, NivelTotal:=DdlNCNivelImporte.SelectedValue.ToEntero(), AplicaNCUsado:=(UsuarioActual.CveEmpresa = 140)), True, MissingSchemaAction.Ignore)
|
||||
Next
|
||||
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
|
||||
If ListaRemisionesNC IsNot Nothing Then
|
||||
For Each RNC In ListaRemisionesNC
|
||||
DtImpuestos.Merge(CargaDtImpuestosNC(RNC.CveVenta, RNC.TotalRemNCAplicado, NCDescuento:=True, AplicaImpuestosLocales:=AplicaImpuestosLocales, NivelTotal:=DdlNCNivelImporte.SelectedValue.ToEntero(), AplicaNCUsado:=(UsuarioActual.CveEmpresa = 140)), True, MissingSchemaAction.Ignore)
|
||||
Next
|
||||
End If
|
||||
|
||||
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
|
||||
|
||||
|
||||
@@ -24322,12 +24369,11 @@ Partial Class Ventas
|
||||
For Each RNC In ListaNC
|
||||
Dim UltimoRenglonRNC As Integer = 1
|
||||
Dim TotalAcumuladoRNC As Decimal = 0
|
||||
Dim Terminar As Boolean = False
|
||||
|
||||
For Each RowUsado As DataRow In RNC.DtDetalle.Rows
|
||||
|
||||
Dim PorcentajeAplicado = (RNC.TotalRemNCAplicado / RNC.Total)
|
||||
|
||||
Dim Cantidad As Decimal = RowUsado("Cantidad").ToString().ToDecimal() * PorcentajeAplicado
|
||||
Dim Cantidad As Decimal = RowUsado("Cantidad").ToString().ToDecimal()
|
||||
|
||||
Dim Obs = RowUsado("CodigoPS").ToString()
|
||||
|
||||
@@ -24347,8 +24393,33 @@ Partial Class Ventas
|
||||
|
||||
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
|
||||
If UltimoRenglonRNC = RNC.DtDetalle.Rows.Count Then
|
||||
If UltimoRenglonRNC = RNC.DtDetalle.Rows.Count OrElse Terminar Then
|
||||
Dim Ajuste As Decimal = 0
|
||||
If Math.Abs(RNC.TotalRemNCAplicado - TotalAcumuladoRNC) > 0.00 Then
|
||||
Ajuste = RNC.TotalRemNCAplicado - TotalAcumuladoRNC
|
||||
@@ -24363,6 +24434,10 @@ Partial Class Ventas
|
||||
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,
|
||||
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
|
||||
@@ -24426,6 +24501,7 @@ Partial Class Ventas
|
||||
For Each RNCBonificacion In ListaNCBonificacion
|
||||
Dim UltimoRenglonRNC As Integer = 1
|
||||
Dim TotalAcumuladoRNC As Decimal = 0
|
||||
Dim Terminar As Boolean = False
|
||||
|
||||
Dim RNCCargo = ListaNC.Where(Function(f) f.CveVenta = RNCBonificacion.CveVentaRNCCargo).FirstOrDefault()
|
||||
|
||||
@@ -24433,7 +24509,7 @@ Partial Class Ventas
|
||||
|
||||
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()
|
||||
|
||||
@@ -24453,6 +24529,31 @@ Partial Class Ventas
|
||||
|
||||
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
|
||||
If UltimoRenglonRNC = RNCCargo.DtDetalle.Rows.Count Then
|
||||
Dim Ajuste As Decimal = 0
|
||||
@@ -24493,6 +24594,7 @@ Partial Class Ventas
|
||||
TmpDT = ObjVentas.DtResultados.Copy()
|
||||
TmpDT.Columns.Add("EntregaDirecta", GetType(Integer))
|
||||
TmpDT.Columns.Add("CveMovimientoDetallePedido", GetType(Integer))
|
||||
TmpDT.Columns.Add("CveVentaDetalleRNC", GetType(Integer))
|
||||
End If
|
||||
|
||||
If AplicaNCMasiva OrElse AplicaNCUsado Then
|
||||
@@ -27478,6 +27580,18 @@ Partial Class Ventas
|
||||
|
||||
Dim TotalRemNCAplicado As Decimal = 0
|
||||
|
||||
Dim ArrayNC As String() = UsuarioActual.Empresa.Funcionalidad(591).Split(",".ToCharArray())
|
||||
Dim NCConcepto As Integer = -1
|
||||
|
||||
Select Case RblRNCTipo.SelectedValue
|
||||
Case "1" 'CARGOS
|
||||
NCConcepto = ArrayNC(3).ToEntero()
|
||||
Case "2" 'BONIFICACIONES
|
||||
NCConcepto = ArrayNC(4).ToEntero()
|
||||
Case "3" 'AJUSTE/GARANTIAS
|
||||
NCConcepto = ArrayNC(1).ToEntero()
|
||||
End Select
|
||||
|
||||
If ChkMostarProductosRNC.Checked Then
|
||||
|
||||
Me.AplicaRNCXDetalle = True
|
||||
@@ -27560,24 +27674,18 @@ Partial Class Ventas
|
||||
For Each RNC In ListaRemisionesNC.Where(Function(x) x.Num2 = 1)
|
||||
Dim Salir As Boolean = False
|
||||
|
||||
Dim ArrayNC As String() = UsuarioActual.Empresa.Funcionalidad(591).Split(",".ToCharArray())
|
||||
Dim NCAjuste As Integer = -1
|
||||
Dim NCGarantiaTotal As Integer = -1
|
||||
If ArrayNC.Length > 2 Then
|
||||
NCAjuste = ArrayNC(1).ToEntero()
|
||||
NCGarantiaTotal = ArrayNC(2).ToEntero()
|
||||
End If
|
||||
|
||||
Using ObjAcum As New ClsAcumuladores
|
||||
If ObjAcum.GetGarantiasDetalle(RNC.CveVenta) Then
|
||||
'SI ES GARANTIA TOTAL
|
||||
If ObjAcum.DtResultados.MAX("PorcentajeAjuste") = "1" Then
|
||||
DdlNCPS.SelectedValueExist(NCGarantiaTotal)
|
||||
DdlNCPS.Enabled = False
|
||||
If ArrayNC.Length > 2 Then
|
||||
NCConcepto = ArrayNC(2).ToEntero()
|
||||
End If
|
||||
Salir = True
|
||||
Else
|
||||
DdlNCPS.SelectedValueExist(NCAjuste)
|
||||
DdlNCPS.Enabled = False
|
||||
If ArrayNC.Length > 2 Then
|
||||
NCConcepto = ArrayNC(1).ToEntero()
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End Using
|
||||
@@ -27590,7 +27698,6 @@ Partial Class Ventas
|
||||
DdlNCPS.Enabled = True
|
||||
End If
|
||||
|
||||
|
||||
For Each GvRow As GridViewRow In GvRemisionesNCBon.Rows
|
||||
If GvRow.RowType = DataControlRowType.DataRow Then
|
||||
If GvRow.FCCheckBox("ChkAplicar").Checked Then
|
||||
@@ -27609,8 +27716,22 @@ Partial Class Ventas
|
||||
End If
|
||||
End If
|
||||
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
|
||||
|
||||
Dim DrPSSeleccionado As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=NCConcepto).FiltroPrimero("")
|
||||
If DrPSSeleccionado IsNot Nothing Then
|
||||
DdlNCPS.SelectedValueExistInsert(NCConcepto, DrPSSeleccionado("PS").ToString())
|
||||
DdlNCPS.Enabled = False
|
||||
End If
|
||||
|
||||
|
||||
TxtImportesRemisionesNC.Text = TotalRemNCAplicado.FormatoNumero
|
||||
TxtNCImporte.Text = TotalRemNCAplicado.FormatoNumero
|
||||
|
||||
@@ -28409,5 +28530,4 @@ Partial Class Ventas
|
||||
Public ImporteBonificacion As Decimal = 0
|
||||
Public IVABonificacion As Decimal = 0
|
||||
End Class
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user