This commit is contained in:
@@ -266,7 +266,7 @@
|
||||
<asp:UpdatePanel runat="server" ID="UpReporteGpsButton" RenderMode="Inline" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton ID="ReporteDispositivos" Visible="False" OnClick="GenerarReporte" data-toggle="tooltip" data-placement="left" runat="server" Text="<i class='fa fa-file-pdf-o'></i> Dispositivos GPS"></asp:LinkButton>
|
||||
<asp:LinkButton ID="ReporteDispositivos" Visible="False" OnClick="GenerarReporte" data-toggle="tooltip" data-placement="left" runat="server" Text="<i class='fa fa-file-pdf-o'></i> Dispositivos GPS"></asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
@@ -1129,9 +1129,9 @@
|
||||
<asp:GridView ID="GVHistorial" runat="server" DataKeyNames="CveVenta, Folio, TipoDocto" AutoGenerateColumns="False" EmptyDataText="No se encontraron Ventas en el Cliente" ToolTip="Listado de Historial de Ventas" CssClass="table table-striped table-advance table-hover" Style="text-align: center; min-width: 783px; width: 100%;" GridLines="None">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="Tipo" DataField="TipoDocto" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:TemplateField >
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Factura</HeaderTemplate>
|
||||
<ItemTemplate >
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFactura" runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
@@ -1678,7 +1678,7 @@
|
||||
<asp:ListItem Selected="True" Value="Ing" Text="Ingresos"></asp:ListItem>
|
||||
<asp:ListItem Selected="True" Value="Rem" Text="Remisión"></asp:ListItem>
|
||||
<asp:ListItem Selected="True" Value="Ant" Text="Anticipos"></asp:ListItem>
|
||||
<asp:ListItem Selected="True" Value="Egs" Text="NC"></asp:ListItem>
|
||||
<asp:ListItem Selected="True" Value="NC" Text="NC"></asp:ListItem>
|
||||
<asp:ListItem Selected="True" Value="IxC" Text="Ingresos X Comp"></asp:ListItem>
|
||||
<asp:ListItem Selected="True" Value="Dev" Text="Devolución"></asp:ListItem>
|
||||
</asp:ListBox>
|
||||
@@ -5483,13 +5483,12 @@
|
||||
<tbody>
|
||||
<tr class="Titulos">
|
||||
<th style="width: 28px">#</th>
|
||||
<th style="width: 200px">Clasificación<br />
|
||||
Producto </th>
|
||||
<th width="73px">Precio<br />
|
||||
General </th>
|
||||
<th style="width: 200px">Marca</th>
|
||||
<%-- <th width="73px">Precio<br />
|
||||
General </th>--%>
|
||||
<th width="73px">%</th>
|
||||
<th width="73px">Precio<br />
|
||||
Aplicado </th>
|
||||
<%-- <th width="73px">Precio<br />
|
||||
Aplicado </th>--%>
|
||||
<th style="width: 73px;"></th>
|
||||
</tr>
|
||||
<tr align="center">
|
||||
@@ -5497,35 +5496,36 @@
|
||||
<td style="text-align: center;">
|
||||
<div class="psagregar">
|
||||
<div class="comboxes">
|
||||
<asp:DropDownList ID="DdlClasificacion2" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="Clasificacion" DataValueField="CveClasificacion" Width="100%" Class="form-control input-sm select2me">
|
||||
<asp:DropDownList ID="DdlMarcaPS" CssClass="form-control input-sm select2me" runat="server" DataTextField="Marca" DataValueField="CveMarca" Width="100%" Height="22px"/>
|
||||
<%-- <asp:DropDownList ID="DdlClasificacion2" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="Clasificacion" DataValueField="CveClasificacion" Width="100%" Class="form-control input-sm select2me">
|
||||
<asp:ListItem Selected="True" Text="Seleccione la Clasificación (Todas)" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<br />
|
||||
<ADS:Dropdownlost runat="server" ID="DdlProducto2" CssStyle="width: 100%;" CssClassDdl="select2me" DataTextField="PSCodigo" DataValueField="CvePS" />
|
||||
<ADS:Dropdownlost runat="server" ID="DdlProducto2" CssStyle="width: 100%;" CssClassDdl="select2me" DataTextField="PSCodigo" DataValueField="CvePS" />--%>
|
||||
<%-- <asp:RequiredFieldValidator ID="RFVProducto2" InitialValue="-1" runat="server" ControlToValidate="DdlProducto2" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Producto''</b> es necesario, por favor ingréselo." ValidationGroup="GprAgregaPS"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEProducto2" runat="server" HighlightCssClass="vco" TargetControlID="RFVProducto2" Width="300px"></ajax:ValidatorCalloutExtender>--%>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<%-- <td>
|
||||
<asp:Label ID="LbPrecioG" DataFormatString="{0:N2}" Width="55px" MaxLength="15" runat="server"></asp:Label>
|
||||
</td>
|
||||
</td>--%>
|
||||
<td>
|
||||
<asp:TextBox ID="txtPorcentaje" CssClass="form-control input-sm" Width="55px" MaxLength="15" runat="server" ValidationGroup="GprAgregaPS" Style="text-align: right"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="ftbe" runat="server" TargetControlID="txtPorcentaje" FilterType="Custom, Numbers" ValidChars=".," />
|
||||
<asp:RequiredFieldValidator ID="RFVPorcentaje" runat="server" ControlToValidate="txtPorcentaje" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''%'' Porcentaje</b> es necesario, por favor ingréselo." ValidationGroup="GprAgregaPS"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEPorcentaje" runat="server" HighlightCssClass="vco" TargetControlID="RFVPorcentaje" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</td>
|
||||
<td>
|
||||
<%-- <td>
|
||||
<asp:Label ID="LbPrecioA" Width="55px" MaxLength="15" runat="server" ClientIDMode="Static"></asp:Label>
|
||||
</td>
|
||||
</td>--%>
|
||||
<td align="center">
|
||||
<asp:LinkButton ID="LbAgregar" runat="server" CssClass="btn btn-default" ValidationGroup="GprAgregaPS" Text="Agregar" />
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<asp:Button ID="BtnCambiaPorcentaje" Text="" OnClick="BtnCambiaPorcentaje_Click" ClientIDMode="Static" Style="display: none;" runat="server" />
|
||||
<%--<asp:Button ID="BtnCambiaPorcentaje" Text="" OnClick="BtnCambiaPorcentaje_Click" ClientIDMode="Static" Style="display: none;" runat="server" />--%>
|
||||
</div>
|
||||
|
||||
<br />
|
||||
@@ -5546,7 +5546,7 @@
|
||||
<ItemStyle Width="28px"></ItemStyle>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField HeaderText="" ReadOnly="true" DataField="Producto" ItemStyle-Width="200px" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="" ReadOnly="true" DataField="PrecioG" ItemStyle-Width="73px" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" />
|
||||
<%-- <asp:BoundField HeaderText="" ReadOnly="true" DataField="PrecioG" ItemStyle-Width="73px" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" />--%>
|
||||
|
||||
|
||||
<asp:TemplateField HeaderText="">
|
||||
@@ -5562,7 +5562,7 @@
|
||||
</asp:TemplateField>
|
||||
|
||||
|
||||
<asp:BoundField HeaderText="" ReadOnly="true" DataField="PrecioA" ItemStyle-Width="73px" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" />
|
||||
<%-- <asp:BoundField HeaderText="" ReadOnly="true" DataField="PrecioA" ItemStyle-Width="73px" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" />--%>
|
||||
|
||||
<asp:TemplateField>
|
||||
<EditItemTemplate>
|
||||
|
||||
@@ -1253,7 +1253,7 @@ Partial Class Clientes
|
||||
'CargaFormaPago33()
|
||||
'CargaComboCFDI()
|
||||
|
||||
'LnkPorcentajePrecios.Visible = True
|
||||
LnkPorcentajePrecios.Visible = True
|
||||
|
||||
If UsuarioActual.TienePermisoProceso(261) Then LnkVerGrafica.Visible = True
|
||||
|
||||
@@ -3643,14 +3643,14 @@ Partial Class Clientes
|
||||
Dim FechaVencimientoF As String = If(TxtFechaVFCxP.Text = "", "-1", TxtFechaVFCxP.Text).ToString
|
||||
|
||||
Dim ObjMovtos As New ClsMovimientos()
|
||||
If ObjMovtos.GetCxCDetalle(FI, FF, CveCliente, -1, -1, -1, -1, -1, "-1", "-1", DdlSucursalCliente.SelectedValue.ToEntero(), "S", -1, "-1", 1, UsuarioActual.CveEmpresa, -1, 1, TipoDocto:=TipoDocto, FechaCorte:=FechaCorte, FechaVI:=FechaVencimientoI, FechaVF:=FechaVencimientoF, CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then
|
||||
DtCxCFact = ObjMovtos.DtResultados '.FiltraParametros("Tipo = 'Act'").Copy ' If(DdlTipoCuentasCxC.SelectedValue = "-1", ObjMovtos.DtResultados.FiltraParametros("CveVentaAmortizacion IS NULL", "TipoDocto").Copy, ObjMovtos.DtResultados.FiltraParametros("Tipo = 'Act' AND CveVentaAmortizacion IS NULL", "TipoDocto"))
|
||||
If ObjMovtos.GetCxCClienteDetalle(CveCliente, "-1", "-1", -1, -1, UsuarioActual.CveEmpresa, DdlSucursalCliente.SelectedValue.ToEntero) Then
|
||||
DtCxCFact = If(DdlTipoCuentasCxC.SelectedValue = "-1", ObjMovtos.DtResultados.FiltraParametros("", "TipoDocto").Copy, ObjMovtos.DtResultados.FiltraParametros("Tipo = 'Act'", "TipoDocto"))
|
||||
'cargo los anticipos NC
|
||||
DtCxCFact.Columns.Add("SaldoAnticipo", GetType(Decimal))
|
||||
|
||||
Dim dtt As DataTable = Nothing
|
||||
If ObjMovtos.GetAnticiposNCIxCCliente(CveCliente, -1, -1) Then
|
||||
dtt = ObjMovtos.DtResultados.FiltraParametros("Saldo > 0 AND SaldoVentaAnticipo = 0 AND ((Tipo = 'IxC' AND CveIE > 0) OR (Tipo = 'Ant' AND CveVenta > 0) )") ' que tenga saldo de anticipo y no de cliente
|
||||
dtt = If(DdlTipoCuentasCxC.SelectedValue = "-1", ObjMovtos.DtResultados.FiltraParametros("SaldoVentaAnticipo = 0 AND ((Tipo = 'IxC' AND CveIE > 0) OR (Tipo = 'Ant' AND CveVenta > 0) OR (Tipo = 'NC' AND CveVenta > 0) OR (Tipo = 'Egs' AND CveVenta > 0) )"), ObjMovtos.DtResultados.FiltraParametros("Saldo > 0 AND SaldoVentaAnticipo = 0 AND ((Tipo = 'IxC' AND CveIE > 0) OR (Tipo = 'Ant' AND CveVenta > 0) OR (Tipo = 'NC' AND CveVenta > 0) OR (Tipo = 'Egs' AND CveVenta > 0) )")) ' que tenga saldo de anticipo y no de cliente
|
||||
If dtt IsNot Nothing AndAlso dtt.Rows.Count > 0 Then
|
||||
For Each drt As DataRow In dtt.Rows
|
||||
Dim drr As DataRow = DtCxCFact.NewRow
|
||||
@@ -3685,7 +3685,7 @@ Partial Class Clientes
|
||||
SaldoIngDolaresPesos = SaldoIngDolaresPesos + (Row("Saldo").ToString.ToDouble * Row("TipoCambio").ToString.ToDouble)
|
||||
End If
|
||||
|
||||
ElseIf (Row("TipoDocto").ToString = "Ant" And Row("Saldo").ToString.ToDouble = 0) Or Row("TipoDocto").ToString = "IxC" Or Row("TipoDocto").ToString = "Egs" Or Row("TipoDocto").ToString = "Dev" Then 'Anticipos, NC, IxC
|
||||
ElseIf (Row("TipoDocto").ToString = "Ant" And Row("Saldo").ToString.ToDouble = 0) Or Row("TipoDocto").ToString = "IxC" Or Row("TipoDocto").ToString = "NC" Or Row("TipoDocto").ToString = "Dev" Then 'Anticipos, NC, IxC
|
||||
ContaAnt = ContaAnt + 1
|
||||
If Row("CveMoneda").ToString.ToEntero = 1 Then
|
||||
If Row("TipoDocto").ToString = "Dev" Then
|
||||
@@ -8138,8 +8138,9 @@ Partial Class Clientes
|
||||
|
||||
CreaDT()
|
||||
|
||||
txtPorcentaje.Attributes.Add("onchange", String.Format("FnCambiaPorcentaje({0});", "5"))
|
||||
CargaPorcentajesProductos()
|
||||
'txtPorcentaje.Attributes.Add("onchange", String.Format("FnCambiaPorcentaje({0});", "5"))
|
||||
'CargaPorcentajesProductos()
|
||||
CargaMarcas()
|
||||
LimpiaModalPorcentaje()
|
||||
End Sub
|
||||
Private Sub CreaDT()
|
||||
@@ -8154,61 +8155,69 @@ Partial Class Clientes
|
||||
End With
|
||||
|
||||
DTPorcentajeTemp.Columns.Add(column)
|
||||
DTPorcentajeTemp.Columns.Add("CvePS", GetType(Integer))
|
||||
DTPorcentajeTemp.Columns.Add("Producto", GetType(String))
|
||||
DTPorcentajeTemp.Columns.Add("PrecioG", GetType(Decimal))
|
||||
DTPorcentajeTemp.Columns.Add("CveMarca", GetType(Integer))
|
||||
DTPorcentajeTemp.Columns.Add("PorcentajeProducto", GetType(Decimal))
|
||||
DTPorcentajeTemp.Columns.Add("PrecioA", GetType(Decimal))
|
||||
DTPorcentajeTemp.Columns.Add("Estatus", GetType(String))
|
||||
DTPorcentajePrecios = DTPorcentajeTemp.Clone
|
||||
End Sub
|
||||
Private Sub CargaPorcentajesProductos()
|
||||
'Llenar el dropdownlist de Secciones
|
||||
If UsuarioActual.CveEmpresa = 66 Then
|
||||
DdlClasificacion2.DataSource = GlobalDTSubFamilias(UsuarioActual.CveEmpresa).FiltraParametros("", Orderby:="Clasificacion")
|
||||
Else
|
||||
Dim ObjClasificaciones As New ClsClasificaciones
|
||||
If ObjClasificaciones.GetClasificacionesExistencias(UsuarioActual.CveEmpresa) Then
|
||||
DdlClasificacion2.DataSource = ObjClasificaciones.DtResultados
|
||||
End If
|
||||
ObjClasificaciones.Dispose()
|
||||
End If
|
||||
DdlClasificacion2.DataBind()
|
||||
Private Sub CargaMarcas()
|
||||
Dim ObjMarcas As New ClsProductosServicios
|
||||
ObjMarcas.GetMarcas(UsuarioActual.CveEmpresa)
|
||||
DdlMarcaPS.DataSource = ObjMarcas.DtResultados
|
||||
ObjMarcas.Dispose()
|
||||
DdlMarcaPS.DataBind()
|
||||
DdlMarcaPS.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
|
||||
CargaPS()
|
||||
CargaGridPorcentajes()
|
||||
|
||||
UpPorcentaje.Update()
|
||||
End Sub
|
||||
Private Sub CargaPS()
|
||||
DdlProducto2.setEsWebService(UsuarioActual.Empresa.Funcionalidad(105) = "1")
|
||||
'Private Sub CargaPorcentajesProductos()
|
||||
' 'Llenar el dropdownlist de Secciones
|
||||
' If UsuarioActual.CveEmpresa = 66 Then
|
||||
' DdlClasificacion2.DataSource = GlobalDTSubFamilias(UsuarioActual.CveEmpresa).FiltraParametros("", Orderby:="Clasificacion")
|
||||
' Else
|
||||
' Dim ObjClasificaciones As New ClsClasificaciones
|
||||
' If ObjClasificaciones.GetClasificacionesExistencias(UsuarioActual.CveEmpresa) Then
|
||||
' DdlClasificacion2.DataSource = ObjClasificaciones.DtResultados
|
||||
' End If
|
||||
' ObjClasificaciones.Dispose()
|
||||
' End If
|
||||
' DdlClasificacion2.DataBind()
|
||||
|
||||
If UsuarioActual.CveEmpresa = 66 Then
|
||||
DdlProducto2.ddlWS.Attributes.Add("data-pagina", "Inventarios")
|
||||
End If
|
||||
' CargaPS()
|
||||
' CargaGridPorcentajes()
|
||||
|
||||
If Not DdlProducto2.UsaWebService AndAlso CType(DdlProducto2.DataSource, DataTable) Is Nothing Then
|
||||
DdlProducto2.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltraParametros("CveTipoPS = 2")
|
||||
' UpPorcentaje.Update()
|
||||
'End Sub
|
||||
'Private Sub CargaPS()
|
||||
' DdlProducto2.setEsWebService(UsuarioActual.Empresa.Funcionalidad(105) = "1")
|
||||
|
||||
DdlProducto2.DataBind()
|
||||
' If UsuarioActual.CveEmpresa = 66 Then
|
||||
' DdlProducto2.ddlWS.Attributes.Add("data-pagina", "Inventarios")
|
||||
' End If
|
||||
|
||||
DdlProducto2.ddl.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
End If
|
||||
' If Not DdlProducto2.UsaWebService AndAlso CType(DdlProducto2.DataSource, DataTable) Is Nothing Then
|
||||
' DdlProducto2.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltraParametros("CveTipoPS = 2")
|
||||
|
||||
End Sub
|
||||
' DdlProducto2.DataBind()
|
||||
|
||||
Protected Sub DdlProducto2_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DdlProducto2.selectedindexchange
|
||||
DdlProducto2IndexChange(DdlProducto2.SelectedValue.ToEntero, DdlProducto2)
|
||||
End Sub
|
||||
Private Sub DdlProducto2IndexChange(CvePSParametro As Integer, Ddl As ADServerControl.Dropdownlost)
|
||||
Dim drPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSParametro).FiltroPrimero("")
|
||||
' DdlProducto2.ddl.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
' End If
|
||||
|
||||
If drPS IsNot Nothing Then
|
||||
Dim Precio = drPS("Precio").ToString.ToDouble
|
||||
LbPrecioG.Text = Precio.FormatoNumero()
|
||||
LbPrecioA.Text = ((Precio * txtPorcentaje.Text.ToDecimal) / 100).FormatoNumero
|
||||
End If
|
||||
End Sub
|
||||
'End Sub
|
||||
|
||||
'Protected Sub DdlProducto2_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DdlProducto2.selectedindexchange
|
||||
' DdlProducto2IndexChange(DdlProducto2.SelectedValue.ToEntero, DdlProducto2)
|
||||
'End Sub
|
||||
'Private Sub DdlProducto2IndexChange(CvePSParametro As Integer, Ddl As ADServerControl.Dropdownlost)
|
||||
' Dim drPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSParametro).FiltroPrimero("")
|
||||
|
||||
' If drPS IsNot Nothing Then
|
||||
' Dim Precio = drPS("Precio").ToString.ToDouble
|
||||
' LbPrecioG.Text = Precio.FormatoNumero()
|
||||
' LbPrecioA.Text = ((Precio * txtPorcentaje.Text.ToDecimal) / 100).FormatoNumero
|
||||
' End If
|
||||
'End Sub
|
||||
|
||||
Private Sub CargaGridPorcentajes()
|
||||
Dim ObjPS As New ClsProductosServicios
|
||||
@@ -8232,31 +8241,22 @@ Partial Class Clientes
|
||||
|
||||
Private Sub LimpiaModalPorcentaje()
|
||||
txtPorcentaje.Text = ""
|
||||
DdlClasificacion2.SelectedValue = "-1"
|
||||
DdlProducto2.SelectedText = ""
|
||||
DdlMarcaPS.SelectedValue = "-1"
|
||||
End Sub
|
||||
|
||||
Protected Sub LbAgregar_Click(sender As Object, e As EventArgs) Handles LbAgregar.Click
|
||||
If txtPorcentaje.Text.ToDecimal >= 0 And txtPorcentaje.Text.ToDecimal <= 100 Then
|
||||
|
||||
If DdlProducto2.SelectedText <> "" Then
|
||||
If txtPorcentaje.Text.ToDecimal >= 0 And txtPorcentaje.Text.ToDecimal <= 100 Then
|
||||
Dim registro As DataRow = DTPorcentajePrecios.NewRow
|
||||
|
||||
Dim registro As DataRow = DTPorcentajePrecios.NewRow
|
||||
|
||||
registro.Item("No") = DTPorcentajePrecios.Rows.Count + 1
|
||||
registro.Item("CvePS") = DdlProducto2.SelectedValue.ToEntero
|
||||
registro.Item("Producto") = DdlProducto2.SelectedText
|
||||
registro.Item("PrecioG") = 0
|
||||
registro.Item("PrecioA") = 0 * txtPorcentaje.Text.ToDecimal / 100
|
||||
registro.Item("PorcentajeProducto") = txtPorcentaje.Text.ToDecimal
|
||||
registro.Item("Estatus") = "I"
|
||||
DTPorcentajePrecios.Rows.Add(registro)
|
||||
CargaDTPorcentajePrecios(DTPorcentajePrecios.FiltraParametros("Estatus <> 'D' "))
|
||||
Else
|
||||
Alert("El Porcentaje debe estar en un rango entre 0 y 100", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
registro.Item("No") = DTPorcentajePrecios.Rows.Count + 1
|
||||
registro.Item("CveMarca") = DdlMarcaPS.SelectedValue.ToEntero
|
||||
registro.Item("PorcentajeProducto") = txtPorcentaje.Text.ToDecimal
|
||||
registro.Item("Estatus") = "I"
|
||||
DTPorcentajePrecios.Rows.Add(registro)
|
||||
CargaDTPorcentajePrecios(DTPorcentajePrecios.FiltraParametros("Estatus <> 'D' "))
|
||||
Else
|
||||
Alert("El campo <b>''Producto''</b> es necesario, por favor ingréselo.", TipoMensaje.MsgAdvertencia)
|
||||
Alert("El Porcentaje debe estar en un rango entre 0 y 100", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
LimpiaModalPorcentaje()
|
||||
@@ -8272,7 +8272,7 @@ Partial Class Clientes
|
||||
i = lnkRemove.CommandArgument.ToString.ToEntero
|
||||
Dim Drs As DataRow() = DTPorcentajePrecios.Select(String.Format("No = {0}", i))
|
||||
If Drs.Count > 0 Then
|
||||
If CveCliente > 0 AndAlso Drs(0)("CvePS").ToString.ToEntero > 0 Then
|
||||
If CveCliente > 0 AndAlso Drs(0)("CveMarca").ToString.ToEntero > 0 Then
|
||||
Drs(0)("Estatus") = "D"
|
||||
Else
|
||||
Drs(0).Delete()
|
||||
@@ -8309,7 +8309,6 @@ Partial Class Clientes
|
||||
|
||||
If Drs.Count > 0 Then
|
||||
Drs(0)("PorcentajeProducto") = PorcentajeProducto
|
||||
Drs(0)("PrecioA") = Drs(0)("PrecioG").ToString.ToDouble * PorcentajeProducto / 100
|
||||
Drs(0)("Estatus") = "U"
|
||||
End If
|
||||
|
||||
@@ -8363,9 +8362,9 @@ Partial Class Clientes
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnCambiaPorcentaje_Click(sender As Object, e As EventArgs)
|
||||
DdlProducto2IndexChange(DdlProducto2.SelectedValue.ToEntero, DdlProducto2)
|
||||
End Sub
|
||||
'Protected Sub BtnCambiaPorcentaje_Click(sender As Object, e As EventArgs)
|
||||
' DdlProducto2IndexChange(DdlProducto2.SelectedValue.ToEntero, DdlProducto2)
|
||||
'End Sub
|
||||
#End Region
|
||||
|
||||
#Region " A C U M U L A D O R E S"
|
||||
@@ -8473,7 +8472,7 @@ Partial Class Clientes
|
||||
End Sub
|
||||
|
||||
|
||||
Function FolioNotaCredito() As Boolean
|
||||
Function FolioNotaCredito(Tipo As Integer) As Boolean
|
||||
|
||||
FolioNotaAcumulador = 0
|
||||
SerieNotaAcumulador = ""
|
||||
@@ -8485,7 +8484,7 @@ Partial Class Clientes
|
||||
|
||||
If DTSucursales.Rows.Count > 0 Then
|
||||
|
||||
If ObjFolios.GetFolios("Egs", UsuarioActual.CveEmpresa) Then
|
||||
If ObjFolios.GetFolios(If(Tipo = 1, "RNC", "Egs"), UsuarioActual.CveEmpresa) Then
|
||||
|
||||
Dim DT As DataTable
|
||||
If UsuarioActual.CveSubProyecto > 0 Then
|
||||
@@ -8862,7 +8861,7 @@ Partial Class Clientes
|
||||
Dim Folio As Integer = 0
|
||||
Dim Serie As String = ""
|
||||
|
||||
If FolioNotaCredito() Then
|
||||
If FolioNotaCredito(Tipo) Then
|
||||
Folio = FolioNotaAcumulador
|
||||
Serie = SerieNotaAcumulador
|
||||
End If
|
||||
@@ -8879,7 +8878,7 @@ Partial Class Clientes
|
||||
ObjFactura.CveMoneda = 1
|
||||
ObjFactura.Moneda = "Pesos"
|
||||
ObjFactura.MonedaSAT = "MXN"
|
||||
ObjFactura.TipoDocto = "Egs"
|
||||
ObjFactura.TipoDocto = If(Tipo = 1, "RNC", "Egs")
|
||||
|
||||
ObjFactura.Folio = Folio
|
||||
|
||||
@@ -9013,7 +9012,7 @@ Partial Class Clientes
|
||||
|
||||
End If
|
||||
|
||||
If ObjFactura.TipoDocto = "Egs" Then
|
||||
If ObjFactura.TipoDocto.Contiene("Egs", "RNC") Then
|
||||
ObjFactura.CveTipoRelacion = -1
|
||||
End If
|
||||
|
||||
|
||||
@@ -1538,7 +1538,7 @@ Partial Class Ventas_ClientesAbonar
|
||||
End If
|
||||
|
||||
'Conta ContPAQ
|
||||
If UsuarioActual.Empresa.Funcionalidad(200) = "1" And MsgError = "" AndAlso UsuarioActual.Empresa.UsaContabilidad Then
|
||||
If UsuarioActual.Empresa.Funcionalidad(200) = "1" AndAlso MsgError = "" Then
|
||||
If idCuentaContabilizacion > 0 Then
|
||||
If ObjMov.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then
|
||||
IDPoliza = ObjMov.ContaIdPoliza
|
||||
|
||||
@@ -2719,8 +2719,8 @@
|
||||
<asp:TextBox ID="TxtPUFactura" CssClass="form-control" runat="server" MaxLength="50" ></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVPUFactura" runat="server" ControlToValidate="TxtPUFactura" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''PU Factura''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEPUFactura" runat="server" HighlightCssClass="vco" TargetControlID="RFVPUFactura"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:FilteredTextBoxExtender ID="FTBEPUFactura" runat="server" TargetControlID="TxtPUFactura" FilterType="Custom, Numbers" ValidChars="." />
|
||||
<label for="<%= TxtPUFactura.ClientID.ToString()%>">PU Factura:</label>
|
||||
<ajax:FilteredTextBoxExtender ID="FTBEPUFactura" runat="server" TargetControlID="TxtPUFactura" FilterType="Custom, Numbers" ValidChars=".," />
|
||||
<label for="<%= TxtPUFactura.ClientID.ToString()%>">P.U.:</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -2830,7 +2830,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="col-md-2">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtPoliza" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox>
|
||||
<%--<asp:RequiredFieldValidator ID="RFVPoliza" runat="server" ControlToValidate="TxtPoliza" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Poliza''</b> es necesario, por favor ingréselo." ValidationGroup="VGMAjuste"></asp:RequiredFieldValidator>--%>
|
||||
@@ -2838,7 +2838,7 @@
|
||||
<label for="<%= TxtPoliza.ClientID.ToString()%>">Poliza:</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="col-md-3">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtImporteAjuste" CssClass="form-control" runat="server" Enabled="false" MaxLength="50"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVImporteAjuste" runat="server" ControlToValidate="TxtImporteAjuste" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Importe''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:RequiredFieldValidator>
|
||||
@@ -2847,6 +2847,15 @@
|
||||
<label for="<%= TxtImporteAjuste.ClientID.ToString()%>">Importe:</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtDescuentoAjuste" CssClass="form-control" runat="server" Enabled="false" MaxLength="50"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVDescuentoAjuste" runat="server" ControlToValidate="TxtDescuentoAjuste" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Descuento''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEDescuentoAjuste" runat="server" HighlightCssClass="vco" TargetControlID="RFVDescuentoAjuste"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:FilteredTextBoxExtender ID="FTBEDescuentoAjuste" runat="server" TargetControlID="TxtDescuentoAjuste" FilterType="Custom, Numbers" ValidChars=".," />
|
||||
<label for="<%= TxtImporteAjuste.ClientID.ToString()%>">Descuento:</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<asp:Button ID="BtnCalcularImporteAjuste" CssClass="btn green-haze btn-outline btn-circle btn-sm" OnClick="BtnCalcularImporteAjuste_Click" runat="server" Text="Recalcular" />
|
||||
</div>
|
||||
|
||||
@@ -4853,7 +4853,7 @@ Partial Class PV
|
||||
TmpDTAjustes.Columns.Add("CodigoInspeccion", GetType(String))
|
||||
TmpDTAjustes.Columns.Add("Consecutivo", GetType(String))
|
||||
TmpDTAjustes.Columns.Add("ConsecutivoVenta", GetType(Integer))
|
||||
TmpDTAjustes.Columns.Add("FechaAjuste", GetType(String))
|
||||
TmpDTAjustes.Columns.Add("FechaAjuste", GetType(Date))
|
||||
TmpDTAjustes.Columns.Add("Meses", GetType(String))
|
||||
TmpDTAjustes.Columns.Add("PorcentajeAjuste", GetType(Double))
|
||||
TmpDTAjustes.Columns.Add("NumPoliza", GetType(String))
|
||||
@@ -4925,6 +4925,7 @@ Partial Class PV
|
||||
If ObjVenta.GetVentaDetalle(DdlFacturas.SelectedValue.ToEntero) Then
|
||||
DdlPSAjuste.DataSource = ObjVenta.DtResultados
|
||||
DtPUFacturas = ObjVenta.DtResultados
|
||||
TxtFechaAjuste.Text = ObjVenta.DtResultados.Rows(0)("Fecha").ToString.ToDate.ToShortDateString
|
||||
End If
|
||||
ObjVenta.Dispose()
|
||||
Else
|
||||
@@ -4936,6 +4937,7 @@ Partial Class PV
|
||||
DdlPSAjuste.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
DtPUFacturas.AcceptChanges()
|
||||
UpAjuste.Update()
|
||||
CalculaPorcentajeAjuste()
|
||||
End Sub
|
||||
|
||||
Private Sub Ajuste()
|
||||
@@ -4987,7 +4989,6 @@ Partial Class PV
|
||||
TxtCodEnsamble.Text = Dr("CodigoEnsamble").ToString
|
||||
DdlTipoUso.SelectedValueExist(Dr("CveTipoUso").ToString)
|
||||
TxtCodLinea.Text = Dr("CodigoLinea").ToString
|
||||
TxtFechaAjuste.Text = Dr("FechaAjuste").ToString
|
||||
TxtCodInspeccion.Text = Dr("CodigoInspeccion").ToString
|
||||
TxtMesesUso.Text = Dr("Meses").ToString
|
||||
DdlTipoDefecto.SelectedValueExist(Dr("CveTipoDefecto").ToString)
|
||||
@@ -4997,7 +4998,8 @@ Partial Class PV
|
||||
DdlFacturas.SelectedValueExist(Dr("CveVenta").ToString)
|
||||
CargaPSAjuste()
|
||||
DdlPSAjuste.SelectedValueExist(Dr("CvePS").ToString)
|
||||
TxtPUFactura.Text = Dr("PUFactura").ToString.ToDecimal.FormatoNumero(4)
|
||||
TxtFechaAjuste.Text = Dr("FechaAjuste").ToString.ToDate.ToShortDateString
|
||||
TxtPUFactura.Text = Dr("PUFactura").ToString.ToDecimal.FormatoNumero(2)
|
||||
TxtPUFactura.Enabled = Not Dr("CveVenta").ToString.ToEntero > 0
|
||||
End If
|
||||
End Sub
|
||||
@@ -5021,7 +5023,7 @@ Partial Class PV
|
||||
End If
|
||||
Contador += 1
|
||||
Next
|
||||
TxtPUFactura.Text = PUFactura.FormatoNumero(4)
|
||||
TxtPUFactura.Text = PUFactura.FormatoNumero(2)
|
||||
End If
|
||||
|
||||
If Not DdlPSAjuste.SelectedValue.ToEntero > 0 AndAlso DdlFacturas.SelectedValue.ToEntero > 0 Then
|
||||
@@ -5040,7 +5042,7 @@ Partial Class PV
|
||||
End Sub
|
||||
|
||||
Private Sub CalculaPorcentajeAjuste()
|
||||
If DdlTipoUso.SelectedValue.ToEntero > 0 AndAlso DdlPSAjuste.SelectedValue.ToEntero > 0 AndAlso TxtMesesUso.Text <> "" Then
|
||||
If DdlTipoUso.SelectedValue.ToEntero > 0 AndAlso DdlPSAjuste.SelectedValue.ToEntero > 0 AndAlso TxtMesesUso.Text <> "" AndAlso DdlPS.SelectedValue.ToEntero > 0 Then
|
||||
Dim CveMarca As Integer = -1
|
||||
If GlobalDTPS(UsuarioActual.CveEmpresa, DdlPSAjuste.SelectedValue.ToEntero).Rows.Count > 0 Then
|
||||
CveMarca = GlobalDTPS(UsuarioActual.CveEmpresa, DdlPSAjuste.SelectedValue.ToEntero).Rows(0)("CveMarca").ToString.ToEntero
|
||||
@@ -5050,6 +5052,36 @@ Partial Class PV
|
||||
If ObjAcum.DtResultados.Rows.Count > 0 Then
|
||||
TxtPorcentajeAjuste.Text = (ObjAcum.DtResultados.Rows(0)("Valor").ToString.ToDouble / 100).ToString
|
||||
TxtImporteAjuste.Text = (TxtPorcentajeAjuste.Text.ToDouble * TxtPUFactura.Text.ToDouble).FormatoNumero
|
||||
|
||||
Dim CargoActual As Decimal = 0
|
||||
Dim CargoAnterior As Decimal = 0
|
||||
Dim CveTamaño As Integer = 0
|
||||
|
||||
If DdlPSAjuste.SelectedValue.ToEntero > 0 Then
|
||||
Dim Dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, DdlPSAjuste.SelectedValue.ToEntero).Rows(0)
|
||||
If Dr IsNot Nothing Then
|
||||
CargoAnterior = Dr("Cargo").ToString.ToDecimal
|
||||
End If
|
||||
End If
|
||||
|
||||
If DdlPS.SelectedValue.ToEntero > 0 Then
|
||||
Dim Dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, DdlPS.SelectedValue.ToEntero).Rows(0)
|
||||
If Dr IsNot Nothing Then
|
||||
CveTamaño = Dr("CveTamaño").ToString.ToEntero
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
|
||||
If GlobalDTAcumTamaños.FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveTamaño = {CveTamaño}").Rows(0) IsNot Nothing AndAlso GlobalDTAcumTamaños.FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveTamaño = {CveTamaño}").Rows.Count > 0 Then
|
||||
Dim DrCargo As DataRow = GlobalDTAcumTamaños.FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveTamaño = {CveTamaño}").Rows(0)
|
||||
If DrCargo IsNot Nothing Then
|
||||
CargoActual = DrCargo("Cargo").ToString.ToDecimal
|
||||
End If
|
||||
End If
|
||||
|
||||
TxtDescuentoAjuste.Text = ((TxtPUFactura.Text.ToDouble - TxtImporteAjuste.Text.ToDouble) - (CargoActual - CargoAnterior)).FormatoNumero
|
||||
TxtDescuentoAjuste.ToolTip = $"La diferencia de ajuste fue: {(TxtPUFactura.Text.ToDouble - TxtImporteAjuste.Text.ToDouble).FormatoNumero()}. La diferencia de tamaños fue: {(CargoActual - CargoAnterior).FormatoNumero}."
|
||||
End If
|
||||
End If
|
||||
ObjAcum.Dispose()
|
||||
@@ -5095,7 +5127,7 @@ Partial Class PV
|
||||
Row("CodigoLinea") = TxtCodLinea.Text
|
||||
Row("CodigoInspeccion") = TxtCodInspeccion.Text
|
||||
Row("Consecutivo") = TxtConsecutivoAjuste.Text
|
||||
Row("FechaAjuste") = TxtFechaAjuste.Text
|
||||
Row("FechaAjuste") = TxtFechaAjuste.Text.ToDate
|
||||
Row("Meses") = TxtMesesUso.Text.ToEntero
|
||||
Row("PorcentajeAjuste") = TxtPorcentajeAjuste.Text.ToDouble
|
||||
Row("NumPoliza") = TxtPoliza.Text
|
||||
@@ -5125,7 +5157,7 @@ Partial Class PV
|
||||
TmpDTAjustes.Rows(IndexAjuste)("CodigoLinea") = TxtCodLinea.Text
|
||||
TmpDTAjustes.Rows(IndexAjuste)("CodigoInspeccion") = TxtCodInspeccion.Text
|
||||
TmpDTAjustes.Rows(IndexAjuste)("Consecutivo") = TxtConsecutivoAjuste.Text
|
||||
TmpDTAjustes.Rows(IndexAjuste)("FechaAjuste") = TxtFechaAjuste.Text.ToEntero
|
||||
TmpDTAjustes.Rows(IndexAjuste)("FechaAjuste") = TxtFechaAjuste.Text.ToDate
|
||||
TmpDTAjustes.Rows(IndexAjuste)("Meses") = TxtMesesUso.Text.ToDouble
|
||||
TmpDTAjustes.Rows(IndexAjuste)("PorcentajeAjuste") = TxtPorcentajeAjuste.Text
|
||||
TmpDTAjustes.Rows(IndexAjuste)("NumPoliza") = TxtPoliza.Text.ToDouble
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
<asp:ListItem Text="Pedido" Value="Ped"></asp:ListItem>
|
||||
<asp:ListItem Text="Autorización" Value="PA"></asp:ListItem>
|
||||
<asp:ListItem Text="Pedido2" Value="Pd2"></asp:ListItem>
|
||||
<asp:ListItem Text="NC de Remisión" Value="RNC"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</td>
|
||||
<td class="text-right"><b>Estatus Factura:</b></td>
|
||||
|
||||
@@ -130,7 +130,7 @@
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtPS" CssClass="form-control Mayuscula" runat="server" MaxLength="846"></asp:TextBox>
|
||||
<label class="truncate" for="<%= TxtPS.ClientID.ToString()%>">Descripción del Producto / Servicio:</label>
|
||||
|
||||
@@ -212,6 +212,14 @@ Partial Class ProductosyServicios
|
||||
|
||||
InicializaEcommerce()
|
||||
|
||||
If UsuarioActual.CveEmpresa.Contiene(141) Then
|
||||
'DivDatos.Attributes("class") = "col-md-12"
|
||||
|
||||
DivDdlTipo.Visible = True
|
||||
DdlTipoPSDes.Attributes.Add("onChange", "CreaDescripcionPS();")
|
||||
|
||||
End If
|
||||
|
||||
If UsuarioActual.CveEmpresa.Contiene(1, 72, 80) And CvePS = -1 Then
|
||||
'DivDatos.Attributes("class") = "col-md-12"
|
||||
TxtPS.Enabled = False
|
||||
|
||||
@@ -661,6 +661,7 @@ Partial Class Ventas_RepProductosServiciosDetalle
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
|
||||
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
|
||||
params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
|
||||
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
|
||||
ImprimirPDF("Empresas/Grales/Formatos/RepProductosServiciosDetalle.rdlc", TmpDT, params, "ReportePS")
|
||||
|
||||
@@ -233,7 +233,7 @@
|
||||
<tr>
|
||||
<td id="dvInv" runat="server" class="dataTables_scrollHead" style="text-align: center!important; width: 42%; font-size: 14px;"><b>Venta</b></td>
|
||||
<td id="dvVen" runat="server" class="dataTables_scrollHead" style="text-align: center!important; font-size: 14px; border-right-color: white!important; border-left-color: white!important; width: 25%; border-style: solid;"><b>Costo</b></td>
|
||||
<td id="dvUt" runat="server" class="dataTables_scrollHead" style="text-align: center!important; width: 40%; font-size: 14px;"><b>Utilidad/Pérdida</b></td>
|
||||
<td id="dvUt" runat="server" class="dataTables_scrollHead" style="text-align: center!important; width: 42%; font-size: 14px;"><b>Utilidad/Pérdida</b></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
@@ -287,7 +287,7 @@
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
|
||||
<asp:HyperLinkField ItemStyle-HorizontalAlign="Center" HeaderText="% Rentabilidad" DataTextFormatString="{0:N}" DataTextField="Rentabilidad" DataNavigateUrlFields="CveVenta,CveVendedor,FechaI,FechaF,CveCliente,Orden,CveSubProyecto,CvePS,CveClasificacion" DataNavigateUrlFormatString="RepVentasUtilidadDetalle.aspx?CveVenta={0}&CveVendedor={1}&FechaI={2:d}&FechaF={3:d}&CveCliente={4}&Orden={5}&CveSubProyecto={6}&CvePS={7}&CveClasificacion={8}"/>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
|
||||
@@ -180,7 +180,9 @@ Partial Class Ventas_RepVentasUtilidad
|
||||
e.Row.BackColor = ColorTranslator.FromHtml("#95A5A6")
|
||||
End If
|
||||
|
||||
If Not e.Row.RowIndex = 0 AndAlso e.Row.DBCampo("CveVenta") <> "" Then
|
||||
If Not e.Row.RowIndex = 0 AndAlso e.Row.DBCampo("SubTotal").ToDecimal = 0 AndAlso e.Row.DBCampo("CveVenta").ToEntero > 0 Then
|
||||
e.Row.CssClass = "danger"
|
||||
ElseIf Not e.Row.RowIndex = 0 AndAlso e.Row.DBCampo("CveVenta") <> "" Then
|
||||
e.Row.Cells(0).BackColor = ColorTranslator.FromHtml("#e9e9e9")
|
||||
e.Row.Cells(1).BackColor = ColorTranslator.FromHtml("#e9e9e9")
|
||||
e.Row.Cells(2).BackColor = ColorTranslator.FromHtml("#e9e9e9")
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" Runat="Server">
|
||||
<style>
|
||||
.gvFull tr td:nth-child(4) {
|
||||
/*.gvFull tr td:nth-child(4) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
.gvFull tr th:nth-child(7) {
|
||||
display: none;
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
.Widthall {
|
||||
@@ -64,7 +64,8 @@
|
||||
.white a {
|
||||
color: white !important;
|
||||
}
|
||||
.select2 .select2-selection__rendered {
|
||||
|
||||
.select2 .select2-selection__rendered {
|
||||
line-height: 1;
|
||||
color: #111;
|
||||
}
|
||||
@@ -279,6 +280,48 @@
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<asp:UpdatePanel ID="UpBonificacion" runat="server" UpdateMode="Conditional" class="col-md-4">
|
||||
<ContentTemplate>
|
||||
<div class="portlet smmallpadding light bordered" id="Div2" runat="server">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<i class="icon-pin font-green"></i>
|
||||
<span class="caption-subject bold uppercase"><a id="A2" runat="server" class="Texto">Bonificación </a></span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tools">
|
||||
<a href="javascript:;" class="expand"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body form-horizontal form-row-sepe formnombottom" style="padding-top: 0px; margin-top: -5px;">
|
||||
<div class="form-body">
|
||||
<asp:GridView ID="GvBonificacion" runat="server" CssClass="table table-striped table-hover Widthall"
|
||||
AutoGenerateColumns="False" ClientIDMode="Static" EmptyDataText=""
|
||||
GridLines="None" DataKeyNames="CveVenta,Serie,Folio,SerieFolio,FolioFiscal,TipoDocto,CveConceptoContable,Importe">
|
||||
<Columns>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
|
||||
<HeaderTemplate>Factura</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="HplFactura" runat="server" Target="_blank" CssClass="Texto" Text='<%# Eval("SerieFolio") %>' NavigateUrl='<%# Eval("CveVenta", "/Ventas/Ventas.aspx?CveVenta={0}")%>'></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField HeaderText="TipoDocto" DataField="TipoDocto" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField HeaderText="Fecha" DataField="FechaAplicado" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField HeaderText="Total" DataField="SubTotal" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Anticipo/NC/IxC" DataField="Importe" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Mon" DataField="Moneda" ItemStyle-HorizontalAlign="Center" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<asp:UpdatePanel ID="UpDetallesCosto" runat="server" UpdateMode="Conditional" class="col-md-4">
|
||||
<ContentTemplate>
|
||||
<div class="portlet smmallpadding light bordered" id="Div1" runat="server">
|
||||
@@ -320,7 +363,7 @@
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<br />
|
||||
<asp:UpdatePanel ID="UpIndicador" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div id="DivUtilidad" visible="False" runat="server" class="col-md-3">
|
||||
@@ -371,10 +414,10 @@
|
||||
<ContentTemplate>
|
||||
<div id="dvCa" style="width:100%;top:40px">
|
||||
<table id="dTable" class="correcto table Widthall Titulos"><tr>
|
||||
<td id="Td1" runat="server" class="dataTables_scrollHead" style="text-align:center!important; font-size:14px; width:30%;"><b>Producto</b></td>
|
||||
<td id="dvInv" runat="server" class="dataTables_scrollHead" style="text-align:center!important; font-size:14px; width:25%; border-left-color: white!important;border-style: solid;border-right-color: white!important;"><b>Venta</b></td>
|
||||
<td id="dvVen" runat="server" class="dataTables_scrollHead" style="text-align:center!important; font-size:14px; border-right-color: white!important;border-left-color: white!important;width:18%;border-style: solid;"><b>Costo</b></td>
|
||||
<td id="dvUt" runat="server" class="dataTables_scrollHead" style="text-align:center!important;width: 35%;font-size:14px; "><b>Utilidad/Pérdida</b></td>
|
||||
<td id="Td1" runat="server" class="dataTables_scrollHead" style="text-align:center!important; font-size:14px; width:25%;"><b>Producto</b></td>
|
||||
<td id="dvInv" runat="server" class="dataTables_scrollHead" style="text-align:center!important; font-size:14px; width:30%; border-left-color: white!important;border-style: solid;border-right-color: white!important;"><b>Venta</b></td>
|
||||
<td id="dvVen" runat="server" class="dataTables_scrollHead" style="text-align:center!important; font-size:14px; border-right-color: white!important;border-left-color: white!important;width:15%;border-style: solid;"><b>Costo</b></td>
|
||||
<td id="dvUt" runat="server" class="dataTables_scrollHead" style="text-align:center!important;width: 15%;font-size:14px; "><b>Utilidad/Pérdida</b></td>
|
||||
</tr></table>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
@@ -383,51 +426,72 @@
|
||||
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Ventas Utilidad con los filtros especificados" ToolTip="Listado de Ventas" CssClass="table table-striped table-hover Widthall ScrollAD" data-sort="true" GridLines="None">
|
||||
<asp:GridView ID="GvDatos" runat="server" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron Ventas Utilidad con los filtros especificados" ToolTip="Listado de Ventas" CssClass="table table-striped table-hover Widthall ScrollAD" data-sort="true" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="Cant." ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center">
|
||||
|
||||
<asp:BoundField HeaderText="TipoDocto" DataField="TipoDocto" ItemStyle-HorizontalAlign="Center" />
|
||||
|
||||
<asp:TemplateField HeaderText="Cant." ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LbCantVenta" runat="server" Text='<%# If(Eval("CantVta").ToString() = "0", "-", Eval("CantVta", "{0:#,###.00}")) %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Código" ItemStyle-Width="10%">
|
||||
<asp:TemplateField HeaderText="Código" >
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LbCodigo" runat="server" Text='<%# If(Eval("Codigo").ToString() = "0", "-", Eval("Codigo", "{0:#,###.##}")) %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="PS" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Left">
|
||||
<asp:TemplateField HeaderText="PS" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LbPS" runat="server" Text='<%# If(Eval("PS").ToString() = "0", "-", Eval("PS", "{0:#,###.##}")) %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:HyperLinkField HeaderText="Folio" ItemStyle-Width="5%" DataNavigateUrlFields="CveVenta" DataTextField="SerieFolio" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}"/>
|
||||
<asp:HyperLinkField HeaderText="Folio" DataNavigateUrlFields="CveVenta" DataTextField="SerieFolio" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}"/>
|
||||
|
||||
|
||||
<asp:TemplateField HeaderText="P.U" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Right">
|
||||
<asp:TemplateField HeaderText="P.U" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LbPU1" runat="server" Text='<%# If(Eval("PUVta").ToString() = "0", "-", Eval("PUVta", "{0:#,###.00}")) %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Total" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Right">
|
||||
<asp:TemplateField HeaderText="SubTotal" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LbTotal1" runat="server" Text='<%# If(Eval("TotalVta").ToString() = "0", "-", Eval("TotalVta", "{0:#,###.00}")) %>'></asp:Label>
|
||||
<asp:Label ID="LbSubTotal" runat="server" Text='<%# If(Eval("SubTotal").ToString() = "0", "-", Eval("SubTotal", "{0:#,###.00}")) %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Descuento" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LbDescuento" runat="server" Text='<%# If(Eval("Descuento").ToString() = "0", "-", Eval("Descuento", "{0:#,###.00}")) %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Bonificacion" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LbBonificacion" runat="server" Text='<%# If(Eval("Bonificacion").ToString() = "0", "-", Eval("Bonificacion", "{0:#,###.00}")) %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="SubTotal2" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LbSubTotal2" runat="server" Text='<%# If(Eval("SubTotal2").ToString() = "0", "-", Eval("SubTotal2", "{0:#,###.00}")) %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
|
||||
<asp:HyperLinkField HeaderText="Folio" ItemStyle-Width="5%" DataNavigateUrlFields="CveMovimiento" DataTextField="FolioMovto" DataNavigateUrlFormatString="/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"/>
|
||||
<asp:HyperLinkField HeaderText="Folio" DataNavigateUrlFields="CveMovimiento" DataTextField="FolioMovto" DataNavigateUrlFormatString="/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"/>
|
||||
|
||||
<asp:TemplateField HeaderText="P.U " ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Right">
|
||||
<asp:TemplateField HeaderText="P.U " ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LbPUs" runat="server" Text='<%# If(Eval("PUInv").ToString() = "0", "-", Eval("PUInv", "{0:#,###.##}")) %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Total" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Right">
|
||||
<asp:TemplateField HeaderText="Total" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LbTotal" runat="server" Text='<%# If(Eval("TotalInv").ToString() = "0", "-", Eval("TotalInv", "{0:#,###.00}")) %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
@@ -437,25 +501,25 @@
|
||||
|
||||
|
||||
|
||||
<asp:TemplateField HeaderText="Utilidad" ItemStyle-Width="8%" ItemStyle-HorizontalAlign="Right">
|
||||
<asp:TemplateField HeaderText="Utilidad" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LbUt" runat="server" Text='<%# If(Eval("Utilidad").ToString() = "0", "-", Eval("Utilidad", "{0:#,###.00}")) %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="%" ItemStyle-Width="8%" ItemStyle-HorizontalAlign="Right">
|
||||
<asp:TemplateField HeaderText="%" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LbPorUtilidad" runat="server" Text='<%# If(Eval("PorUtilidad").ToString() = "0", "-", Eval("PorUtilidad", "{0:#,###.00}")) %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Pérdida" ItemStyle-Width="8%" ItemStyle-HorizontalAlign="Right">
|
||||
<asp:TemplateField HeaderText="Pérdida" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LbPerdida" runat="server" Text='<%# If(Eval("Perdida").ToString() = "0", "-", Eval("Perdida", "{0:#,###.00}")) %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="%" ItemStyle-Width="8%" ItemStyle-HorizontalAlign="Right">
|
||||
<asp:TemplateField HeaderText="%" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LbPorPerdida" runat="server" Text='<%# If(Eval("PorPerdida").ToString() = "0", "-", Eval("PorPerdida", "{0:#,###.00}")) %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
|
||||
@@ -196,7 +196,14 @@ Partial Class Ventas_RepVentasUtilidadDetalle
|
||||
LblPorUtilidad.Text = ((ObjVentas.Utilidad - ObjVentas.Perdida) / ObjVentas.SubTotalVenta * 100).ToString("N2")
|
||||
LblPerdida.Text = "$" + (ObjVentas.Perdida - ObjVentas.Utilidad).ToString("N2")
|
||||
LblPorPerdida.Text = ((ObjVentas.Perdida - ObjVentas.Utilidad) / ObjVentas.SubTotalVenta * 100).ToString("N2")
|
||||
|
||||
If ObjVentas.GetVentasAntNC(CveVenta, -1) Then
|
||||
GvBonificacion.DataSource = ObjVentas.DtResultados
|
||||
End If
|
||||
|
||||
ObjVentas.Dispose()
|
||||
GvBonificacion.DataBind()
|
||||
|
||||
|
||||
If ObjVentas.SubTotalVenta <> ObjVentas.SubTotalVentaDolares Then
|
||||
LbSubTotalDolares.Visible = True
|
||||
@@ -220,10 +227,12 @@ Partial Class Ventas_RepVentasUtilidadDetalle
|
||||
|
||||
End If
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.RowIndex = 0 Or e.Row.DBCampo("CveVentaDetalle") = "" Then
|
||||
If e.Row.DBCampo("CveVentaDetalle") = "" AndAlso e.Row.DBCampo("CveVenta") = "" Then
|
||||
e.Row.CssClass = "Totales"
|
||||
Else
|
||||
'e.Row.Cells(0).BackColor = ColorTranslator.FromHtml("#e9e9e9")
|
||||
|
||||
@@ -39,8 +39,10 @@
|
||||
|
||||
#chartdiv {
|
||||
width: 100%;
|
||||
height: 500px;
|
||||
height: 600px;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
@@ -170,8 +172,9 @@
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel ID="UpIndicador" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="row" >
|
||||
<div id="DivNeto" runat="server" class="col-md-offset-4 col-md-3">
|
||||
<div class="row" >
|
||||
<div class="col-md-3"></div>
|
||||
<div id="DivNeto" runat="server" class="col-md-3">
|
||||
<div id="DivClaseNeto" runat="server" class="dashboard-stat dashboard-stat-v2 green">
|
||||
<div class="visual"><i class="fa fa-bar-chart-o" '=""></i></div>
|
||||
<div class="details"><div class="number"><asp:Label ID="LblNombreNeto" runat="server"></asp:Label></div>
|
||||
@@ -183,6 +186,18 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="DivRentabilidad" runat="server" class=" col-md-3">
|
||||
<div id="DivClaseRentabilidad" runat="server" class="dashboard-stat dashboard-stat-v2 green">
|
||||
<div class="visual"><i class="fa fa-bar-chart-o" '=""></i></div>
|
||||
<div class="details"><div class="number"><asp:Label ID="LblNombreRentabilidad" runat="server"></asp:Label></div>
|
||||
<div class="desc"><label id="LblRentabilidadIndicador" runat="server" class="indicadortipo2 col-md-6 tooltips" data-original-title="Rentabilidad">
|
||||
<asp:Label ID="LblRentabilidad" runat="server"></asp:Label>%</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<br />
|
||||
</ContentTemplate>
|
||||
@@ -194,12 +209,16 @@
|
||||
<Columns>
|
||||
<asp:HyperLinkField ItemStyle-HorizontalAlign="Left" Target="_blank" HeaderText="Grupo" DataTextField="GPO" DataNavigateUrlFields="FechaI,FechaF,CveSubProyecto,CveCliente,CveVendedor,Grupo,GPO,CvePS,CveClasificacion" DataNavigateUrlFormatString="RepVentasUtilidad.aspx?FechaI={0}&FechaF={1}&CveSubProyecto={2}&CveCliente={3}&CveVendedor={4}&Gpo={5}&CveGpo={6}&CvePS={7}&CveClasificacion={8}" />
|
||||
<asp:BoundField ItemStyle-HorizontalAlign="Right" HeaderText="Ventas" DataField="Ventas" DataFormatString="{0:N2}" />
|
||||
<asp:BoundField ItemStyle-HorizontalAlign="Right" HeaderText="Descuento" DataField="Descuento" DataFormatString="{0:N2}" />
|
||||
<asp:BoundField ItemStyle-HorizontalAlign="Right" HeaderText="Bonificacion" DataField="Bonificacion" DataFormatString="{0:N2}" />
|
||||
<asp:BoundField ItemStyle-HorizontalAlign="Right" HeaderText="Costo" DataField="Costo" DataFormatString="{0:N2}" />
|
||||
<asp:BoundField ItemStyle-HorizontalAlign="Right" HeaderText="Utilidad" DataField="Utilidad" DataFormatString="{0:N2}" />
|
||||
<asp:BoundField ItemStyle-HorizontalAlign="Right" HeaderText="%" DataField="PorUtilidad" ItemStyle-Width="7px" DataFormatString="{0:N2}" />
|
||||
<asp:BoundField ItemStyle-HorizontalAlign="Right" HeaderText="Perdida" DataField="Perdida" DataFormatString="{0:N2}" />
|
||||
<asp:BoundField ItemStyle-HorizontalAlign="Right" HeaderText="%" DataField="PorPerdida" ItemStyle-Width="7px" DataFormatString="{0:N2}" />
|
||||
<asp:BoundField ItemStyle-HorizontalAlign="Right" HeaderText="Neto" DataField="Neto" DataFormatString="{0:N2}" />
|
||||
<asp:BoundField ItemStyle-HorizontalAlign="Right" HeaderText="%" DataField="PorNeto" ItemStyle-Width="7px" DataFormatString="{0:N2}" />
|
||||
<asp:BoundField ItemStyle-HorizontalAlign="Right" HeaderText="% Rentabilidad" DataField="Rentabilidad" ItemStyle-Width="7px" DataFormatString="{0:N2}" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
@@ -215,8 +234,20 @@
|
||||
</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div id="chartdiv"></div>
|
||||
<div class="row">
|
||||
|
||||
<label class="col-md-1 truncate">Ver:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlVer" runat="server" AutoPostBack="true" OnSelectedIndexChanged="DdlVer_SelectedIndexChanged" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
|
||||
<asp:ListItem Selected="True" Text="Neto" Value="1"></asp:ListItem>
|
||||
<asp:ListItem Text="Rentabilidad" Value="2"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<br />
|
||||
<div id="chartdiv"></div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal">Cerrar</button>
|
||||
</div>
|
||||
@@ -232,7 +263,7 @@
|
||||
<link rel="stylesheet" href="https://www.amcharts.com/lib/3/plugins/export/export.css" type="text/css" media="all" />
|
||||
<script src="https://www.amcharts.com/lib/3/themes/light.js"></script>
|
||||
<script>
|
||||
function CargaGraficaCompracion(data) {
|
||||
function CargaGraficaBarrasNeto(data) {
|
||||
var chart = AmCharts.makeChart("chartdiv", {
|
||||
"theme": "light",
|
||||
"type": "serial",
|
||||
@@ -251,21 +282,12 @@
|
||||
"startDuration": 1,
|
||||
"graphs": [
|
||||
{
|
||||
"balloonText": "Perdida [[category]]: <b>[[value]] [[moneda]]</b>",
|
||||
"balloonText": "Neto [[category]]: <b>[[value]] [[moneda]]</b>",
|
||||
"fillAlphas": 0.9,
|
||||
"lineAlpha": 0.2,
|
||||
"type": "column",
|
||||
"valueField": "perdida",
|
||||
"title": "Perdida"
|
||||
|
||||
},
|
||||
{
|
||||
"balloonText": "Utilidad [[category]]: <b>[[value]] [[moneda]]</b>",
|
||||
"fillAlphas": 0.9,
|
||||
"lineAlpha": 0.2,
|
||||
"type": "column",
|
||||
"valueField": "utilidad",
|
||||
"title": "Utilidad"
|
||||
"valueField": "neto",
|
||||
"title": "Neto"
|
||||
}],
|
||||
"plotAreaFillAlphas": 0.1,
|
||||
"depth3D": 60,
|
||||
@@ -295,6 +317,62 @@
|
||||
chart.validateNow();
|
||||
});
|
||||
}
|
||||
|
||||
function CargaGraficaBarrasRentabilidad(data) {
|
||||
var chart = AmCharts.makeChart("chartdiv", {
|
||||
"theme": "light",
|
||||
"type": "serial",
|
||||
"dataProvider": data,
|
||||
"legend": {
|
||||
"horizontalGap": 10,
|
||||
"maxColumns": 1,
|
||||
"position": "right",
|
||||
"useGraphSettings": true,
|
||||
"markerSize": 10
|
||||
},
|
||||
"valueAxes": [{
|
||||
"stackType": "3d",
|
||||
"position": "left"
|
||||
}],
|
||||
"startDuration": 1,
|
||||
"graphs": [
|
||||
{
|
||||
"balloonText": "Rentabilidad [[category]]: <b>[[value]] [[moneda]]</b>",
|
||||
"fillAlphas": 0.9,
|
||||
"lineAlpha": 0.2,
|
||||
"type": "column",
|
||||
"valueField": "rentabilidad",
|
||||
"title": "Rentabilidad"
|
||||
}],
|
||||
"plotAreaFillAlphas": 0.1,
|
||||
"depth3D": 60,
|
||||
"angle": 30,
|
||||
"categoryField": "gpo",
|
||||
"categoryAxis": {
|
||||
"gridPosition": "start",
|
||||
"labelRotation": 90
|
||||
},
|
||||
"export": {
|
||||
"enabled": true
|
||||
}
|
||||
});
|
||||
jQuery('.chart-input').off().on('input change', function () {
|
||||
var property = jQuery(this).data('property');
|
||||
var target = chart;
|
||||
chart.startDuration = 0;
|
||||
|
||||
if (property == 'topRadius') {
|
||||
target = chart.graphs[0];
|
||||
if (this.value == 0) {
|
||||
this.value = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
target[property] = this.value;
|
||||
chart.validateNow();
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
</asp:Content>
|
||||
|
||||
|
||||
@@ -136,6 +136,12 @@ Partial Class Ventas_RepVentasUtilidadPadre
|
||||
LblNeto.Text = Neto.ToString("N2")
|
||||
LblPorNeto.Text = PorNeto.ToString("N2")
|
||||
End If
|
||||
|
||||
LblNombreRentabilidad.Text = "Rentabilidad"
|
||||
DivClaseRentabilidad.Attributes.Add("class", "dashboard-stat dashboard-stat-v2 green")
|
||||
LblRentabilidadIndicador.Attributes.Add("data-original-title", "Rentabilidad")
|
||||
LblRentabilidad.Text = DtDatos.Rows(0)("Rentabilidad").ToString.ToDouble.ToString("N2")
|
||||
|
||||
End If
|
||||
|
||||
ObjVentas.Dispose()
|
||||
@@ -161,26 +167,52 @@ Partial Class Ventas_RepVentasUtilidadPadre
|
||||
|
||||
LblTituloGrafica.Text = $"Agrupado por: {Agrupador}"
|
||||
RegistraScript("$('#DivModalGrafica').modal('show')")
|
||||
Dim Dt As New DataTable()
|
||||
Dt.Columns.Add("gpo")
|
||||
Dt.Columns.Add("utilidad")
|
||||
Dt.Columns.Add("perdida")
|
||||
For Each Dr As DataRow In DtDatos.Rows
|
||||
If Dr("GPO").ToString <> "" Then
|
||||
Dim Row As DataRow = Nothing
|
||||
Row = Dt.NewRow()
|
||||
Row("gpo") = Dr("GPO").ToString
|
||||
Row("utilidad") = Dr("Utilidad").ToString.FormatoNumero
|
||||
Row("perdida") = Dr("Perdida").ToString.FormatoNumero
|
||||
Dt.Rows.Add(Row)
|
||||
End If
|
||||
Next
|
||||
CargaGrafica()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub CargaGrafica()
|
||||
If DdlVer.SelectedValue.ToEntero = 1 Then
|
||||
Dim Dt As New DataTable()
|
||||
Dt.Columns.Add("gpo")
|
||||
Dt.Columns.Add("neto")
|
||||
For Each Dr As DataRow In DtDatos.Rows
|
||||
If Dr("GPO").ToString <> "" Then
|
||||
Dim Row As DataRow = Nothing
|
||||
Row = Dt.NewRow()
|
||||
Row("gpo") = Dr("GPO").ToString
|
||||
Row("neto") = Dr("Neto").ToString.FormatoNumero
|
||||
Dt.Rows.Add(Row)
|
||||
End If
|
||||
Next
|
||||
|
||||
Dim query = From s In Dt.AsEnumerable() Select New With {.gpo = s("gpo").ToString(), .neto = s("neto").ToString().ToDouble()}
|
||||
Dim json As String = Newtonsoft.Json.JsonConvert.SerializeObject(query)
|
||||
RegistraScript($"CargaGraficaBarrasNeto({json})", "22")
|
||||
ElseIf DdlVer.SelectedValue.ToEntero = 2 Then
|
||||
Dim Dt2 As New DataTable()
|
||||
Dt2.Columns.Add("gpo")
|
||||
Dt2.Columns.Add("rentabilidad")
|
||||
For Each Dr As DataRow In DtDatos.Rows
|
||||
If Dr("GPO").ToString <> "" Then
|
||||
Dim Row As DataRow = Nothing
|
||||
Row = Dt2.NewRow()
|
||||
Row("gpo") = Dr("GPO").ToString
|
||||
Row("rentabilidad") = Dr("Rentabilidad").ToString.FormatoNumero
|
||||
Dt2.Rows.Add(Row)
|
||||
End If
|
||||
Next
|
||||
|
||||
Dim query2 = From s In Dt2.AsEnumerable() Select New With {.gpo = s("gpo").ToString(), .rentabilidad = s("rentabilidad").ToString().ToDouble()}
|
||||
Dim json2 As String = Newtonsoft.Json.JsonConvert.SerializeObject(query2)
|
||||
RegistraScript($"CargaGraficaBarrasRentabilidad({json2})", "23")
|
||||
End If
|
||||
|
||||
Dim query = From s In Dt.AsEnumerable() Select New With {.gpo = s("gpo").ToString(), .utilidad = s("utilidad").ToString().ToDouble(), .perdida = s("perdida").ToString().ToDouble}
|
||||
Dim json As String = Newtonsoft.Json.JsonConvert.SerializeObject(query)
|
||||
RegistraScript($"CargaGraficaCompracion({json})", "22")
|
||||
UPModalProd.Update()
|
||||
End Sub
|
||||
Protected Sub DdlVer_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
CargaGrafica()
|
||||
End Sub
|
||||
|
||||
|
||||
#End Region
|
||||
@@ -197,7 +229,12 @@ Partial Class Ventas_RepVentasUtilidadPadre
|
||||
e.Row.DBCampo("FechaI"), e.Row.DBCampo("FechaF"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveVendedor"),
|
||||
e.Row.DBCampo("Grupo"), e.Row.DBCampo("GPO"), e.Row.DBCampo("CvePS"), e.Row.DBCampo("CveClasificacion"))
|
||||
e.Row.Cells(0).Text = "<a class=""" & Css & """ href=""" & Liga & """>" & e.Row.Cells(0).Text & "</a>"
|
||||
Else
|
||||
e.Row.Cells(9).BackColor = Drawing.Color.LightGray
|
||||
End If
|
||||
|
||||
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -234,6 +271,7 @@ Partial Class Ventas_RepVentasUtilidadPadre
|
||||
params.Add(New ReportParameter("Filtros", StrFiltro.ToString))
|
||||
params.Add(New ReportParameter("Neto", LblNeto.Text))
|
||||
params.Add(New ReportParameter("PorNeto", $"{LblPorNeto.Text}%"))
|
||||
params.Add(New ReportParameter("Rentabilidad", $"{LblRentabilidad.Text}%"))
|
||||
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
@@ -248,4 +286,5 @@ Partial Class Ventas_RepVentasUtilidadPadre
|
||||
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
@@ -1238,6 +1238,7 @@
|
||||
<asp:HyperLink ID="HplFactura" runat="server" Target="_blank" CssClass="Texto" Text='<%# Eval("SerieFolio") %>' NavigateUrl='<%# Eval("CveVenta", "/Ventas/Ventas.aspx?CveVenta={0}")%>'></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField HeaderText="TipoDocto" DataField="TipoDocto" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField HeaderText="Fecha" DataField="FechaAplicado" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField HeaderText="Total" DataField="SubTotal" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Anticipo/NC/IxC" DataField="Importe" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
@@ -1252,6 +1253,7 @@
|
||||
<asp:HyperLink ID="HplFactura" runat="server" Target="_blank" CssClass="Texto" Text='<%# Eval("SerieFolio") %>' NavigateUrl='<%# Eval("CveVenta", "/Ventas/Ventas.aspx?CveVenta={0}")%>'></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField HeaderText="TipoDocto" DataField="TipoDocto" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField HeaderText="Fecha" DataField="FechaAplicado" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField HeaderText="Total" DataField="SubTotal" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Anticipo/NC/IxC" DataField="Importe" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
@@ -1419,7 +1421,7 @@
|
||||
</td>
|
||||
<td><b>T.C.:</b></td>
|
||||
<td>
|
||||
<asp:TextBox ID="TxtTipoCambio" onkeyup="ConvertirDllsPesos();" runat="server" CssClass="form-control input-sm" MaxLength="7" Text="1" Enabled="true" Width="70px" ClientIDMode="Static"></asp:TextBox>
|
||||
<asp:TextBox ID="TxtTipoCambio" onkeyup="ConvertirDllsPesos();" runat="server" CssClass="form-control input-sm" MaxLength="7" Text="1" Enabled="true" Width="70px" ClientIDMode="Static" Readonly ="true"></asp:TextBox>
|
||||
<asp:CompareValidator ID="CVTipoCambio" runat="server" ControlToValidate="TxtTipoCambio" Display="None" ErrorMessage="El campo <b>''Tipo de Cambio''</b> no tiene el formato correcto, por favor corrija e intente de nuevo (Solo formato numérico)." Operator="DataTypeCheck" Type="Double" ValidationGroup="GrpEmitirImprimir"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOTipoCambio" runat="server" HighlightCssClass="vco" TargetControlID="CVTipoCambio" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
<asp:Label runat="server" ID="LblTCValuacion" ToolTip="Última Valuación" Text="" Visible="false"></asp:Label>
|
||||
|
||||
@@ -1727,6 +1727,10 @@ Partial Class Ventas
|
||||
|
||||
DdlTipoComprobante.Items.Insert(DdlTipoComprobante.Items.Count, New ListItem("Pedido", "Pd2"))
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(344).ToString = "1" Then
|
||||
DdlTipoComprobante.Items.Insert(DdlTipoComprobante.Items.Count, New ListItem("NC de Remisión", "RNC"))
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(528) = "1" Then 'FUNCIONALIDAD. DE REGISTRO DE CUENTA PREDIAL.
|
||||
GvPS.Columns(ColumnaPredial).Visible = True
|
||||
thPredial1.Visible = True
|
||||
@@ -3772,7 +3776,7 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
TxtTipoCambio.Text = DbRowVenta("TipoCambio").ToString
|
||||
If DbRowVenta("TipoCambio").ToString.ToDecimal <> DbRowVenta("TipoCambioValuacion").ToString.ToDecimal Then
|
||||
If DbRowVenta("UltimasFluctuaciones").ToString <> "" Then
|
||||
LblTCValuacion.Text = String.Format("Ult. Val:{0}", DbRowVenta("UltimasFluctuaciones").ToString)
|
||||
LblTCValuacion.Visible = True
|
||||
End If
|
||||
@@ -6568,11 +6572,11 @@ Partial Class Ventas
|
||||
'ContPAQ El movimiento 1 es el de Venta
|
||||
Dim AutoConta As Boolean = UsuarioActual.Empresa.Funcionalidad(200) = "1"
|
||||
|
||||
If UsuarioActual.CveEmpresa = 119 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ant", "Rem", "Cot", "Ped", "Pd2", "PA", "NC") Then
|
||||
If UsuarioActual.CveEmpresa = 119 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ant", "Rem", "RNC", "Cot", "Ped", "Pd2", "PA", "NC") Then
|
||||
AutoConta = False
|
||||
End If
|
||||
|
||||
If AutoConta And UsuarioActual.Empresa.UsaContabilidad = True Then
|
||||
If AutoConta Then
|
||||
If idCuentaContabilizacion > 0 Then
|
||||
If ObjConta.ContabilizarPrePoliza(ObjFactura.CvePrePoliza, ObjFactura.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjContPaq) Then
|
||||
|
||||
@@ -6623,7 +6627,7 @@ Partial Class Ventas
|
||||
Dim EstatusSMS = 0
|
||||
|
||||
'TIMBRADO Y CASO ESPECIAL NOTA DE CREDITO
|
||||
If (TipoDoctoDevolucion = "" OrElse Not TipoDoctoDevolucion.Contiene("Rem", "Cot", "Ped", "DPe", "PA", "Pd2")) Then
|
||||
If (TipoDoctoDevolucion = "" OrElse Not TipoDoctoDevolucion.Contiene("Rem", "RNC", "Cot", "Ped", "DPe", "PA", "Pd2")) Then
|
||||
|
||||
Dim DebeTimbrar As Boolean = True
|
||||
If UsuarioActual.CveEmpresa.Contiene(1, 72, 80) Then
|
||||
@@ -9110,7 +9114,7 @@ Partial Class Ventas
|
||||
CvePlantilaPoliza = 4
|
||||
ElseIf ObjFactura.TipoDocto.Contiene("Egs", "Dev") Then
|
||||
CvePlantilaPoliza = 7
|
||||
ElseIf ObjFactura.TipoDocto = "Rem" Then
|
||||
ElseIf ObjFactura.TipoDocto.Contiene("Rem", "RNC") Then
|
||||
CvePlantilaPoliza = 4
|
||||
End If
|
||||
|
||||
@@ -9179,7 +9183,7 @@ Partial Class Ventas
|
||||
|
||||
Select Case ConceptoContable
|
||||
Case 1 'Cliente
|
||||
If Not ObjFactura.TipoDocto.Contiene("Egs", "Rem") Then
|
||||
If Not ObjFactura.TipoDocto.Contiene("Egs", "Rem", "RNC") Then
|
||||
importeMovimiento = (ObjFactura.Total - TotalOtrosConceptos) * ValorMultiplicador
|
||||
importeMX = importeMovimiento * tipoCambio * Multiplicador
|
||||
FechaMovimiento = ObjFactura.FechaPago
|
||||
@@ -9253,6 +9257,37 @@ Partial Class Ventas
|
||||
ViewState("SeGuardoPrePoliza") = True
|
||||
End If
|
||||
|
||||
Case 277 'Remisión del cliente
|
||||
|
||||
If ObjFactura.TipoDocto = "RNC" Then
|
||||
importeMovimiento = (ObjFactura.Total - TotalOtrosConceptos) * ValorMultiplicador
|
||||
importeMX = importeMovimiento * tipoCambio * Multiplicador
|
||||
FechaMovimiento = ObjFactura.FechaPago
|
||||
CveSubProyectoContabilizar = CveSubProyectoVenta
|
||||
If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}"
|
||||
|
||||
If tipoCambio = 1 Then
|
||||
IdCtaContable = ObjFactura.Cliente.IdCtaContClientes
|
||||
CveCuenta = ObjFactura.Cliente.CveCuentaClientes
|
||||
Else
|
||||
IdCtaContable = ObjFactura.Cliente.IdCtaContMonedaExtranjera
|
||||
CveCuenta = ObjFactura.Cliente.CveCuentaMonedaExtranjera
|
||||
End If
|
||||
IdCtaContableCliente = IdCtaContable
|
||||
CveCuentaCliente = CveCuenta
|
||||
|
||||
If ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, 277, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, ImporteMX:=importeMX, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, Contabilizable:=False, CveSubProyecto:=CveSubProyectoContabilizar) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, Not TipoMovimiento, importeMovimiento, Referencia, 278, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, ImporteMX:=importeMX, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, Contabilizable:=False, CveSubProyecto:=CveSubProyectoContabilizar) Then
|
||||
ErrorPrepoliza = True
|
||||
End If
|
||||
Else
|
||||
ErrorPrepoliza = True
|
||||
End If
|
||||
|
||||
importeMovimiento = 0
|
||||
ViewState("SeGuardoPrePoliza") = True
|
||||
End If
|
||||
|
||||
Case 12 'Nota de Credito
|
||||
If ObjFactura.TipoDocto.Contiene("Egs", "Dev") Then
|
||||
importeMovimiento = ObjFactura.Total * ValorMultiplicador
|
||||
@@ -9718,7 +9753,7 @@ Partial Class Ventas
|
||||
importeMovimiento = 0
|
||||
|
||||
Case 4 'Venta Clasificacion
|
||||
If Not ObjFactura.TipoDocto.Contiene("Rem", "Ant", "Egs", "Dev") Then
|
||||
If Not ObjFactura.TipoDocto.Contiene("Rem", "RNC", "Ant", "Egs", "Dev") Then
|
||||
|
||||
Dim ConceptoContableAplicar = 4
|
||||
Dim CveVentaAplicar = ObjFactura.CveVenta
|
||||
@@ -9896,7 +9931,7 @@ Partial Class Ventas
|
||||
|
||||
importeMovimiento = 0
|
||||
Case 103 'Descuento
|
||||
If Not ObjFactura.TipoDocto.Contiene("Rem") AndAlso DdlTipoAmortizacionAnticipo.SelectedValue = "-1" Then
|
||||
If Not ObjFactura.TipoDocto.Contiene("Rem", "RNC") AndAlso DdlTipoAmortizacionAnticipo.SelectedValue = "-1" Then
|
||||
|
||||
importeMovimiento = ObjFactura.Descuento * ValorMultiplicador
|
||||
importeMX = Math.Round(importeMovimiento, 2) * tipoCambio * Multiplicador
|
||||
@@ -9943,7 +9978,7 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
Case 8 'Ret IVA por Trasladar
|
||||
If Not ObjFactura.TipoDocto.Contiene("Rem") Then
|
||||
If Not ObjFactura.TipoDocto.Contiene("Rem", "RNC") Then
|
||||
importeMovimiento = ObjFactura.RetIVA * ValorMultiplicador
|
||||
importeMX = Math.Round(importeMovimiento, 2) * tipoCambio * Multiplicador
|
||||
FechaMovimiento = ObjFactura.FechaPago
|
||||
@@ -9974,7 +10009,7 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
Case 9 'Ret ISR por Trasladar
|
||||
If Not ObjFactura.TipoDocto.Contiene("Rem") Then
|
||||
If Not ObjFactura.TipoDocto.Contiene("Rem", "RNC") Then
|
||||
importeMovimiento = ObjFactura.RetISR * ValorMultiplicador
|
||||
importeMX = Math.Round(importeMovimiento, 2) * tipoCambio * Multiplicador
|
||||
FechaMovimiento = ObjFactura.FechaPago
|
||||
@@ -10004,7 +10039,7 @@ Partial Class Ventas
|
||||
End If
|
||||
End If
|
||||
Case 13 'Iva por Trasladar
|
||||
If Not ObjFactura.TipoDocto.Contiene("Rem") Then
|
||||
If Not ObjFactura.TipoDocto.Contiene("Rem", "RNC") Then
|
||||
importeMovimiento = ObjFactura.IVA * ValorMultiplicador
|
||||
importeMX = Math.Round(importeMovimiento * tipoCambio * Multiplicador, 2)
|
||||
FechaMovimiento = ObjFactura.FechaPago
|
||||
@@ -11154,6 +11189,7 @@ Partial Class Ventas
|
||||
|
||||
Dim ObjConta As New ClsContabilidad
|
||||
Dim ObjVenta As New ClsVentas(ObjConta.IniciaTransacSQL())
|
||||
Dim ObjIE As New ClsBancos(ObjConta.IniciaTransacSQL())
|
||||
Dim ObjContpaq As ClsContPAQi = Nothing
|
||||
|
||||
Dim CvePrepoliza As Integer
|
||||
@@ -11186,11 +11222,16 @@ Partial Class Ventas
|
||||
' FechaMaxima = "01/01/2018".ToDate
|
||||
'End If
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
CvePrepoliza = ObjConta.AddPrePolizas("Ventas/Anticipos", CvePlantillaPoliza, TxtTotal.Text.ToDecimal, TxtTotal.Text.ToDecimal, DdlMoneda.SelectedValue.ToEntero, TxtFechaAnticipoCliente.Text.ToDate, String.Format("{0} {1} {2}-{3}", If(EsAnticipo2017Jam, "Aplicación Anticipo 2017", ""), NombreCliente, Serie, TxtFolio.Text), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
|
||||
If CvePrepoliza > 0 Then
|
||||
Dim tipoCambioPago As Decimal = 1
|
||||
Dim tipoCambioVenta As Decimal = 1
|
||||
Dim tipoCambioVentaValuacion As Decimal = 1
|
||||
Dim PorcentajePago As Decimal = 100
|
||||
Dim dtConceptos As DataTable = Nothing
|
||||
Dim CveMonedaVenta = DdlMoneda.SelectedValue.ToEntero
|
||||
@@ -11214,21 +11255,42 @@ Partial Class Ventas
|
||||
For Each gvr As GridViewRow In GVAnticipos.Rows
|
||||
If gvr.FCCheckBox("Chk" & gvr.RowIndex).Checked Then
|
||||
|
||||
|
||||
Dim FechaUltimaFluctuacion As Date = MinFecha
|
||||
Dim TipoCambioFluctuacion As Decimal = 1
|
||||
If ObjIE.GetFluctuacionesBitacora(UsuarioActual.CveEmpresa) Then
|
||||
If ObjIE.DtResultados.Rows.Count > 0 Then
|
||||
Dim tFecha As Date = gvr.DataKey("Fecha").ToDate
|
||||
Dim Fecha As String = String.Format("{0}/{1}/{2}", tFecha.Year, tFecha.Month, tFecha.Day)
|
||||
Dim drr As DataRow = ObjIE.DtResultados.FiltroPrimero("Fecha < #" & Fecha & "#", "Fecha DESC")
|
||||
|
||||
If drr IsNot Nothing Then
|
||||
FechaUltimaFluctuacion = drr("Fecha").ToString.ToDate
|
||||
TipoCambioFluctuacion = drr("TipoCambio").ToString.ToDecimal
|
||||
End If
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
If DdlMoneda.SelectedValue.ToEntero = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then 'Si la venta viene en Pesos y se va a pagar en Pesos
|
||||
tipoCambioPago = 1
|
||||
tipoCambioVenta = 1
|
||||
tipoCambioVentaValuacion = 1
|
||||
PorcentajePago = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / gvr.DataKey("Original").ToDecimal
|
||||
ElseIf DdlMoneda.SelectedValue.ToEntero = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then 'Si la venta viene en Dolares y se va a pagar en Pesos
|
||||
tipoCambioPago = gvr.FCTextBox("TxtTC" & gvr.RowIndex).Text.ToDecimal
|
||||
tipoCambioVenta = TxtTipoCambio.Text.ToDecimal
|
||||
tipoCambioVentaValuacion = If(TxtFecha.Text.ToDate < FechaUltimaFluctuacion, TipoCambioFluctuacion, TxtTipoCambio.Text.ToDecimal)
|
||||
PorcentajePago = (gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal) / gvr.DataKey("Original").ToDecimal
|
||||
ElseIf DdlMoneda.SelectedValue.ToEntero = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then 'Si la venta viene en Dolares y se va a pagar en DOLARES
|
||||
tipoCambioPago = gvr.DataKey("TipoCambio").ToString.ToDecimal
|
||||
tipoCambioVenta = TxtTipoCambio.Text.ToDecimal
|
||||
tipoCambioVentaValuacion = If(TxtFecha.Text.ToDate < FechaUltimaFluctuacion, TipoCambioFluctuacion, TxtTipoCambio.Text.ToDecimal)
|
||||
PorcentajePago = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / gvr.DataKey("Original").ToDecimal
|
||||
ElseIf DdlMoneda.SelectedValue.ToEntero = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then 'Si la venta viene en pesos y se va a pagar en DOLARES
|
||||
tipoCambioPago = gvr.FCTextBox("TxtTC" & gvr.RowIndex).Text.ToDecimal
|
||||
tipoCambioVenta = 1
|
||||
tipoCambioVentaValuacion = 1
|
||||
PorcentajePago = (gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal) / gvr.DataKey("Original").ToDecimal
|
||||
End If
|
||||
|
||||
@@ -11255,17 +11317,17 @@ Partial Class Ventas
|
||||
importeMX = importeMovimiento
|
||||
ElseIf DdlMoneda.SelectedValue.ToEntero = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
|
||||
importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal
|
||||
importeMX = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal * tipoCambioVenta
|
||||
importeMX = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal * tipoCambioVentaValuacion
|
||||
ElseIf DdlMoneda.SelectedValue.ToEntero = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
|
||||
importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal
|
||||
importeMX = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal * tipoCambioVenta
|
||||
importeMX = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal * tipoCambioVentaValuacion
|
||||
ElseIf DdlMoneda.SelectedValue.ToEntero = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
|
||||
importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal
|
||||
importeMX = importeMovimiento
|
||||
End If
|
||||
importeMovimiento = Math.Round(importeMovimiento, 2)
|
||||
importeMX = Math.Round(importeMX, 2)
|
||||
TipoCambioGeneral = tipoCambioVenta
|
||||
TipoCambioGeneral = tipoCambioVentaValuacion
|
||||
|
||||
If CveMonedaVenta = 1 Then
|
||||
IdCtaContable = IdCtaContClientes
|
||||
@@ -11286,7 +11348,7 @@ Partial Class Ventas
|
||||
CveCuentaContabilizacion = 0
|
||||
End If
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrepoliza, TipoMovimiento, 0, Concepto, 207, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=Math.Round(importeMovimiento * tipoCambioVenta - importeMovimiento, 2, MidpointRounding.AwayFromZero), ImporteME:=importeMovimiento, CveCuenta:=CveCuenta, TipoCambio:=tipoCambioVenta) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrepoliza, TipoMovimiento, 0, Concepto, 207, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=Math.Round(importeMovimiento * tipoCambioVenta - importeMovimiento, 2, MidpointRounding.AwayFromZero), ImporteME:=importeMovimiento, CveCuenta:=CveCuenta, TipoCambio:=tipoCambioVentaValuacion) Then
|
||||
ErrorConta = True
|
||||
End If
|
||||
|
||||
@@ -11514,13 +11576,14 @@ Partial Class Ventas
|
||||
If CveMonedaVenta <> 1 OrElse gvr.DataKey("CveMoneda").ToEntero <> 1 Then
|
||||
IdCtaContable = UsuarioActual.Empresa.IdCuentaGananciaCambiaria
|
||||
CveCuenta = UsuarioActual.Empresa.CveCuentaGananciaCambiaria
|
||||
Dim TipoCambioGanancia As Decimal = If(Not (gvr.DataKey("CveIE").ToString.ToEntero > 0 AndAlso gvr.DataKey("CveConceptoContable").ToString().ToEntero = 66), tipoCambioVentaValuacion, tipoCambioVenta)
|
||||
|
||||
If tipoCambioPago > tipoCambioVenta AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
|
||||
importeMovimiento = (gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal * tipoCambioPago) - (gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal * tipoCambioVenta) 'Añadimos la diferencia de ganancia en la venta
|
||||
If tipoCambioPago > TipoCambioGanancia AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
|
||||
importeMovimiento = (gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal * tipoCambioPago) - (gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal * TipoCambioGanancia) 'Añadimos la diferencia de ganancia en la venta
|
||||
importeMovimiento = Math.Abs(Math.Round(importeMovimiento, 2))
|
||||
importeMX = importeMovimiento
|
||||
End If
|
||||
Dim TCImpuestos As Decimal = If(FuncionalidadFluctuacionImpuestos, tipoCambioVenta, tipoCambioPago)
|
||||
Dim TCImpuestos As Decimal = If(FuncionalidadFluctuacionImpuestos, TipoCambioGanancia, tipoCambioPago)
|
||||
TipoCambioGeneral = TCImpuestos
|
||||
Else
|
||||
importeMovimiento = 0
|
||||
@@ -11529,13 +11592,14 @@ Partial Class Ventas
|
||||
If CveMonedaVenta <> 1 OrElse gvr.DataKey("CveMoneda").ToEntero <> 1 Then
|
||||
IdCtaContable = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria
|
||||
CveCuenta = UsuarioActual.Empresa.CveCuentaPerdidaCambiaria
|
||||
Dim TipoCambioPerdida As Decimal = If(Not (gvr.DataKey("CveIE").ToString.ToEntero > 0 AndAlso gvr.DataKey("CveConceptoContable").ToString().ToEntero = 66), tipoCambioVentaValuacion, tipoCambioVenta)
|
||||
|
||||
If tipoCambioPago < tipoCambioVenta AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
|
||||
importeMovimiento = (gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal * tipoCambioVenta) - (gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal * tipoCambioPago) 'Añadimos la diferencia de perdida en la venta
|
||||
If tipoCambioPago < TipoCambioPerdida AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
|
||||
importeMovimiento = (gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal * TipoCambioPerdida) - (gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal * tipoCambioPago) 'Añadimos la diferencia de perdida en la venta
|
||||
importeMovimiento = Math.Abs(Math.Round(importeMovimiento, 2))
|
||||
importeMX = importeMovimiento
|
||||
End If
|
||||
Dim TCImpuestos As Decimal = If(FuncionalidadFluctuacionImpuestos, tipoCambioVenta, tipoCambioPago)
|
||||
Dim TCImpuestos As Decimal = If(FuncionalidadFluctuacionImpuestos, TipoCambioPerdida, tipoCambioPago)
|
||||
TipoCambioGeneral = TCImpuestos
|
||||
Else
|
||||
importeMovimiento = 0
|
||||
@@ -11598,6 +11662,8 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
ObjConta.Dispose()
|
||||
ObjIE.Dispose()
|
||||
|
||||
Else
|
||||
|
||||
'cuando no se ha registrado la venta
|
||||
@@ -19932,13 +19998,19 @@ Partial Class Ventas
|
||||
CalculaTotalesVenta(True)
|
||||
|
||||
|
||||
|
||||
'condicióon, en la que se verifica que el importe total de aplicación de la nota de crédito sea igual al del total de la nota de crédito, ej. saldo de la factura 1000.01 y la nota de crédito se generó po 1000.00
|
||||
If Not AplicaNCMasiva Then
|
||||
Dim TT As Decimal = TxtNCImporte.Text.ToDecimal
|
||||
If TT > TxtTotal.Text.ToDecimal Then TT = TxtTotal.Text.ToDecimal
|
||||
CargaNCDT(CveVenta, TT)
|
||||
End If
|
||||
|
||||
End If
|
||||
'verifica el tipo de cambio que se actualice
|
||||
If DdlMoneda.SelectedValue <> "1" Then
|
||||
TxtTipoCambio.Text = GlobalTipoCambio(Now).ToString
|
||||
End If
|
||||
LblTCValuacion.Visible = False
|
||||
UpPS.Update()
|
||||
|
||||
LBNotaCredito.Visible = False
|
||||
@@ -20337,6 +20409,26 @@ Partial Class Ventas
|
||||
TrFolioFiscal.Visible = False
|
||||
TxtFecha.Text = Now.ToShortDateString()
|
||||
TipoCambioFactura = TxtTipoCambio.Text.ToDecimal
|
||||
|
||||
If DdlMoneda.SelectedValue.ToEntero > 1 Then
|
||||
Dim ObjIE As New ClsBancos
|
||||
If ObjIE.GetFluctuacionesBitacora(UsuarioActual.CveEmpresa) Then
|
||||
If ObjIE.DtResultados.Rows.Count > 0 Then
|
||||
Dim tFecha As Date = TxtFecha.Text.ToDate
|
||||
Dim Fecha As String = String.Format("{0}/{1}/{2}", tFecha.Year, tFecha.Month, tFecha.Day)
|
||||
Dim drr As DataRow = ObjIE.DtResultados.FiltroPrimero("Fecha < #" & Fecha & "#", "Fecha DESC")
|
||||
|
||||
If drr IsNot Nothing Then
|
||||
TipoCambioFactura = drr("TipoCambio").ToString.ToDecimal
|
||||
End If
|
||||
|
||||
End If
|
||||
End If
|
||||
ObjIE.Dispose()
|
||||
Else
|
||||
TipoCambioFactura = 1
|
||||
End If
|
||||
|
||||
TxtTipoCambio.Text = GlobalTipoCambio(Now).ToString
|
||||
DivEstatusFac.Visible = False
|
||||
|
||||
|
||||
Reference in New Issue
Block a user