Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -269,6 +269,14 @@
|
||||
<i></i>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright col-xs-3" id="DivPorMinimoUtilidad" runat="server" visible="false">
|
||||
<asp:TextBox ID="TxtPorMinimoUtilidad" CssClass="form-control" runat="server"></asp:TextBox>
|
||||
<asp:RangeValidator ID="RVPorMinUtilidad" runat="server" Type="Double" MinimumValue="0" MaximumValue="99" ErrorMessage="El campo <b>''% Minimo de utilidad''</b> debe tener un valor entre 0 y 99, por favor ingréselo." ControlToValidate="TxtPorMinimoUtilidad" Display="None" ValidationGroup="GrpGuardar"></asp:RangeValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEPorMinUtilidad" runat="server" HighlightCssClass="vco" TargetControlID="RVPorMinUtilidad" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
<label class="truncate" style="padding-left: 1px;" for="<%= TxtPorMinimoUtilidad.ClientID.ToString()%>">% Minimo de utilidad:</label>
|
||||
<i></i>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class=" col-md-12">
|
||||
<div runat="server" id="DivCompuesto" class="form-group form-md-line-input input-iconright" visible="false">
|
||||
@@ -1828,11 +1836,11 @@
|
||||
|
||||
<asp:TemplateField HeaderText="Editar" ItemStyle-Width="40px">
|
||||
<EditItemTemplate>
|
||||
<center>
|
||||
<asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update"
|
||||
CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpGV" />
|
||||
<asp:LinkButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel"
|
||||
CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
|
||||
<center>
|
||||
<asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update"
|
||||
CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpGV" />
|
||||
<asp:LinkButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel"
|
||||
CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
|
||||
</center>
|
||||
</EditItemTemplate>
|
||||
<ItemTemplate>
|
||||
@@ -2340,17 +2348,17 @@
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
|
||||
<ADS:Dropdownlost runat="server" ID="DdlPSAdicional" CssClass="form-control input-sm DdlPS" CssClassDdl="select2me" CssStyle="width:100%" DataTextField="PSCodigo" DataValueField="CvePS" />
|
||||
<label for="<%= DdlPSAdicional.ClientID.ToString()%>" >Producto/Servicio:</label>
|
||||
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
|
||||
<ADS:Dropdownlost runat="server" ID="DdlPSAdicional" CssClass="form-control input-sm DdlPS" CssClassDdl="select2me" CssStyle="width:100%" DataTextField="PSCodigo" DataValueField="CvePS" />
|
||||
<label for="<%= DdlPSAdicional.ClientID.ToString()%>">Producto/Servicio:</label>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6" id="DivTipoAdicional" runat="server" visible="false">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<label style="top: 0;margin-bottom: 0; font-size: 13px; color: #888888;opacity: 1;">Tipo:</label>
|
||||
<label style="top: 0; margin-bottom: 0; font-size: 13px; color: #888888; opacity: 1;">Tipo:</label>
|
||||
<asp:RadioButtonList ID="RblTipoAdicional" runat="server" RepeatDirection="Horizontal">
|
||||
<asp:ListItem Value="1" Selected="True">Adicional</asp:ListItem>
|
||||
<asp:ListItem Value="2">Similar</asp:ListItem>
|
||||
@@ -2363,7 +2371,7 @@
|
||||
<div class="form-group form-md-line-input input-iconright" style="width: 200px!important;">
|
||||
<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<label style="top: 0;margin-bottom: 0; font-size: 13px; color: #888888;opacity: 1;">Cantidad:</label>
|
||||
<label style="top: 0; margin-bottom: 0; font-size: 13px; color: #888888; opacity: 1;">Cantidad:</label>
|
||||
<asp:RadioButtonList ID="RBLCantidad" runat="server" RepeatDirection="Horizontal" AutoPostBack="True" OnSelectedIndexChanged="RBLCantidad_SelectedIndexChanged1">
|
||||
<asp:ListItem Value="1" Selected="True">Depende del PS</asp:ListItem>
|
||||
<asp:ListItem Value="2">Fijo</asp:ListItem>
|
||||
|
||||
@@ -449,6 +449,7 @@ Partial Class ProductosyServicios
|
||||
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
|
||||
DivPSAdicionales.Visible = True
|
||||
DivTipoAdicional.Visible = True
|
||||
DivPorMinimoUtilidad.Visible = True
|
||||
End If
|
||||
|
||||
CvePSAdicional = -1
|
||||
@@ -1148,6 +1149,10 @@ Partial Class ProductosyServicios
|
||||
DivPSExhibicion.Visible = True
|
||||
ChkPSExhibicion.Checked = CBool(ObjProductosServicios.DtResultados.Rows(0)("ProductoExhibicion").ToString)
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
|
||||
TxtPorMinimoUtilidad.Text = ObjProductosServicios.DtResultados.Rows(0)("PorcentajeMinimoUtilidad").ToString
|
||||
End If
|
||||
Else
|
||||
Alert("El Producto o Servicio Solicitado no existe, por favor revise su búsqueda.", TipoMensaje.MsgAdvertencia)
|
||||
RegistraScript("$('#C_Tab_TabPaquetes_tab').css('display' , 'none')")
|
||||
@@ -1543,8 +1548,9 @@ Partial Class ProductosyServicios
|
||||
CvePSAdicionalVigencia:=DdlPSAdicionalVigencia.SelectedValue.ToEntero(), PrecioLibre:=ChkPrecioLibre.Checked,
|
||||
CveMaterialPeligroso:=DdlMaterialPeligroso.SelectedValue.ToEntero, CveEmbalaje:=DdlEmbalaje.SelectedValue.ToEntero, PesoKg:=TxtPesoKg.Text.ToDecimal, Dimensiones:=TxtDimensiones.Text.Trim,
|
||||
CveObjetoImpuesto:=DdlObjetoImpuesto.SelectedValue.ToEntero, Litraje:=TxtLitraje.Text.ToDecimal, RegistroRSCO:=TxtRegistroRSCO.Text, FechaVigenciaRSCO:=TxtFechaVigenciaRSCO.Text.ToDate, VigenciaIndeterminadaRSCO:=ChkFechaIndeterminadaRSCO.Checked,
|
||||
NombreComercial:=TxtNombreComercial.Text.Trim, NotasAdicionales:=TxtEcommerceNota.Text.Trim, EcommerceEtiquetas:=TxtEcommerceEtiquetas.Text.Trim.Replace(".", ""), EcommercePrecio:=TxtEcommercePrecio.Text.Trim.ToDecimal,
|
||||
CveClasificacionEcommerce:=DdlEcommerceClasificacion.SelectedValue.ToEntero, EcommerceCantidad:=TxtEcommerceCantidad.Text.Trim.ToDecimal, CodigoAlterno:=TxtCodigoAlterno.Text.Trim, PSAlterno:=TxtPSAlterno.Text.Trim, ProductoExhibicion:=ChkPSExhibicion.Checked) > 0 Then
|
||||
NombreComercial:=TxtNombreComercial.Text.Trim, NotasAdicionales:=TxtEcommerceNota.Text.Trim, EcommerceEtiquetas:=TxtEcommerceEtiquetas.Text.Trim.Replace(".", ""), EcommercePrecio:=TxtEcommercePrecio.Text.Trim.ToDecimal,
|
||||
CveClasificacionEcommerce:=DdlEcommerceClasificacion.SelectedValue.ToEntero, EcommerceCantidad:=TxtEcommerceCantidad.Text.Trim.ToDecimal, CodigoAlterno:=TxtCodigoAlterno.Text.Trim, PSAlterno:=TxtPSAlterno.Text.Trim, ProductoExhibicion:=ChkPSExhibicion.Checked,
|
||||
PorcentajeMinimoUtilidad:=TxtPorMinimoUtilidad.Text.ToDecimal()) > 0 Then
|
||||
ViewState("CvePS") = ObjProductosServicios.CvePS
|
||||
For Each GVR As GridViewRow In GvImpuestosLocales.Rows
|
||||
If GVR.FCCheckBox("ChkDeduccion").Checked Then
|
||||
@@ -1618,7 +1624,7 @@ Partial Class ProductosyServicios
|
||||
RegistroRSCO:=TxtRegistroRSCO.Text, FechaVigenciaRSCO:=TxtFechaVigenciaRSCO.Text.ToDate, VigenciaIndeterminadaRSCO:=ChkFechaIndeterminadaRSCO.Checked,
|
||||
NombreComercial:=TxtNombreComercial.Text.Trim, NotasAdicionales:=TxtEcommerceNota.Text.Trim, EcommerceEtiquetas:=TxtEcommerceEtiquetas.Text.Trim.Replace(".", ""), ActivoEcommerce:=ChkActivoEcommerce.Checked,
|
||||
EcommercePrecio:=TxtEcommercePrecio.Text.Trim.ToDecimal, CveClasificacionEcommerce:=DdlEcommerceClasificacion.SelectedValue.ToEntero, EcommerceCantidad:=TxtEcommerceCantidad.Text.Trim.ToDecimal,
|
||||
CodigoAlterno:=TxtCodigoAlterno.Text.Trim, PSAlterno:=TxtPSAlterno.Text.Trim, ProductoExhibicion:=ChkPSExhibicion.Checked) Then
|
||||
CodigoAlterno:=TxtCodigoAlterno.Text.Trim, PSAlterno:=TxtPSAlterno.Text.Trim, ProductoExhibicion:=ChkPSExhibicion.Checked, PorcentajeMinimoUtilidad:=TxtPorMinimoUtilidad.Text.ToDecimal()) Then
|
||||
|
||||
If Not ObjProductosServicios.LimpiaImpuestosLocales(CvePS) Then
|
||||
TieneError = True
|
||||
|
||||
@@ -281,7 +281,6 @@
|
||||
<asp:UpdatePanel runat="server">
|
||||
<ContentTemplate>
|
||||
<asp:Button ID="BtnGuardar" Text="Guardar" CssClass="btn btn-primary" ValidationGroup="GrpGuardar" OnClick="BtnGuardar_Click" runat="server" />
|
||||
|
||||
<asp:Button ID="ButBtnEliminar" Text="Eliminar" CssClass="btn btn-danger" OnClick="BtnEliminar_Click" runat="server" Visible="false"
|
||||
data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si"
|
||||
/>
|
||||
|
||||
@@ -7,6 +7,7 @@ Imports DocumentFormat.OpenXml.Drawing.Diagrams
|
||||
Imports Extensiones
|
||||
Imports iText.StyledXmlParser.Css.Resolve.Shorthand.Impl
|
||||
Imports Microsoft.Owin.Security.Provider
|
||||
Imports Telerik.Web.UI
|
||||
|
||||
Partial Class Ventas_Promociones
|
||||
Inherits ClsPaginas
|
||||
@@ -84,18 +85,18 @@ Partial Class Ventas_Promociones
|
||||
End Property
|
||||
|
||||
|
||||
Private Property DTPSUltimoCosto As DataTable
|
||||
Get
|
||||
If ViewState("DTPSUltimoCosto") Is Nothing Then
|
||||
ViewState("DTPSUltimoCosto") = New DataTable
|
||||
End If
|
||||
'Private Property DTPSUltimoCosto As DataTable
|
||||
' Get
|
||||
' If ViewState("DTPSUltimoCosto") Is Nothing Then
|
||||
' ViewState("DTPSUltimoCosto") = New DataTable
|
||||
' End If
|
||||
|
||||
Return CType(ViewState("DTPSUltimoCosto"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DTPSUltimoCosto") = value
|
||||
End Set
|
||||
End Property
|
||||
' Return CType(ViewState("DTPSUltimoCosto"), DataTable)
|
||||
' End Get
|
||||
' Set(value As DataTable)
|
||||
' ViewState("DTPSUltimoCosto") = value
|
||||
' End Set
|
||||
'End Property
|
||||
|
||||
Private Property PermisoAutorizPromocionPorcentaje As Boolean
|
||||
Get
|
||||
@@ -158,7 +159,7 @@ Partial Class Ventas_Promociones
|
||||
PorMinMasCostoVentaFnc129 = UsuarioActual.Empresa.Funcionalidad(129).ToDecimal
|
||||
PermisoAutorizPromocionPorcentaje = UsuarioActual.TienePermisoProceso(386)
|
||||
|
||||
EmpresaFnc382 = If(UsuarioActual.Empresa.Funcionalidad(352) = "1", True, False) 'Grupo díaz
|
||||
EmpresaFnc382 = If(UsuarioActual.Empresa.Funcionalidad(382) = "1", True, False) 'Grupo díaz
|
||||
'EmpresaFnc382 = True ''Para pruebas
|
||||
|
||||
CvePromocion = -1
|
||||
@@ -173,7 +174,6 @@ Partial Class Ventas_Promociones
|
||||
LnkAgrgarPlantillaPS.Visible = False
|
||||
|
||||
|
||||
|
||||
ValidaPromosiones(False)
|
||||
If EmpresaFnc382 AndAlso ChkEstatus.Checked = False AndAlso BloqueadoPromocionPorcentaje AndAlso Not PermisoAutorizPromocionPorcentaje Then
|
||||
ChkEstatus.Enabled = False
|
||||
@@ -345,20 +345,20 @@ Partial Class Ventas_Promociones
|
||||
|
||||
Private Sub CargaDTUltimoCosto()
|
||||
|
||||
If Not EmpresaFnc382 Then
|
||||
Exit Sub
|
||||
If EmpresaFnc382 Then
|
||||
Dim DTPSUltimoCosto = New DataTable
|
||||
|
||||
Dim ObjInv As New ClsInventarios
|
||||
|
||||
If ObjInv.GetUltimoCosto(UsuarioActual.CveEmpresa) Then
|
||||
DTPSUltimoCosto = ObjInv.DtResultados
|
||||
End If
|
||||
|
||||
ObjInv.Dispose()
|
||||
End If
|
||||
|
||||
|
||||
DTPSUltimoCosto = New DataTable
|
||||
|
||||
Dim ObjInv As New ClsInventarios
|
||||
|
||||
If ObjInv.GetUltimoCosto(UsuarioActual.CveEmpresa) Then
|
||||
DTPSUltimoCosto = ObjInv.DtResultados
|
||||
End If
|
||||
|
||||
ObjInv.Dispose()
|
||||
|
||||
|
||||
End Sub
|
||||
@@ -619,6 +619,16 @@ Partial Class Ventas_Promociones
|
||||
End If
|
||||
|
||||
|
||||
Dim DTPSUltimoCosto = New DataTable
|
||||
|
||||
Dim ObjInv As New ClsInventarios
|
||||
If ObjInv.GetUltimoCosto(UsuarioActual.CveEmpresa) Then
|
||||
DTPSUltimoCosto = ObjInv.DtResultados
|
||||
End If
|
||||
ObjInv.Dispose()
|
||||
|
||||
|
||||
|
||||
If PorMinMasCostoVentaFnc129 > 0 Then
|
||||
|
||||
For Each dRow As DataRow In TempDT.Rows
|
||||
@@ -792,6 +802,11 @@ Partial Class Ventas_Promociones
|
||||
End If
|
||||
|
||||
ObjVentas.Dispose()
|
||||
|
||||
If Not TieneError AndAlso BloqueadoPromocionPorcentaje Then
|
||||
MandaCorreoNotificacionPromocionBloqueo(CvePromocion, TxtPromocion.Text.Trim)
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -847,24 +862,6 @@ Partial Class Ventas_Promociones
|
||||
|
||||
If Not TieneError Then
|
||||
|
||||
'366 Estatus
|
||||
|
||||
'367 CvePS
|
||||
'368 PUPromocion
|
||||
'369 CveTipoPromocion
|
||||
'370 Cantidad Minima
|
||||
'371 AplicaRestriccion
|
||||
'372 HoraInicio
|
||||
'373 HoraFin
|
||||
|
||||
'374 AplicaLunes
|
||||
'375 AplicaMartes
|
||||
'376 AplicaMiercoles
|
||||
'377 AplicaJueves
|
||||
'378 AplicaViernes
|
||||
'379 AplicaSabado
|
||||
'380 AplicaDomingo
|
||||
'381 IncluyeImpuestos
|
||||
|
||||
|
||||
Dim Dr2 As DataRow = TempDTOrigial.FiltraParametros($"CvePromocionDetalle = {Dr("CvePromocionDetalle").ToString}").Rows(0)
|
||||
@@ -893,12 +890,7 @@ Partial Class Ventas_Promociones
|
||||
End If
|
||||
|
||||
|
||||
'If Not TieneError And Dr("AplicaRestriccion").ToString <> Dr2("AplicaRestriccion").ToString Then
|
||||
' If Not ObjGral.AddHistorialBitacora(371, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Dr2("AplicaRestriccion").ToString, $"{Dr("CodigoPS").ToString} - {Dr("AplicaRestriccion").ToString}", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, "Se elimino " & Dr("CodigoPS").ToString, "PS", "", CvePromocion:=CvePromocion) Then
|
||||
' TieneError = True
|
||||
' Exit For
|
||||
' End If
|
||||
'End If
|
||||
|
||||
|
||||
If Not TieneError And Dr("HoraInicio").ToString <> Dr2("HoraInicio").ToString Then
|
||||
If Not ObjGral.AddHistorialBitacora(372, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Dr("HoraInicio").ToString, $"{Dr("CodigoPS").ToString} - {Dr2("HoraInicio").ToString}", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, "Se elimino " & Dr("CodigoPS").ToString, "PS", "", CvePromocion:=CvePromocion) Then
|
||||
@@ -1043,7 +1035,7 @@ Partial Class Ventas_Promociones
|
||||
If EmpresaFnc382 AndAlso EstatusOriginal = False AndAlso ChkEstatus.Checked And BloqueadoPromocionPorcentaje Then
|
||||
|
||||
Dim objGeneral As New ClsGenerales(ObjVentas.IniciaTransacSQL)
|
||||
If Not objGeneral.AddHistorialBitacora(360, -1, -1, -1, -1, -1, -1, -1, "Si Autoriza con bloqueo", "No", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 0, "", "", "", CvePromocion:=CvePromocion) Then
|
||||
If Not objGeneral.AddHistorialBitacora(360, -1, -1, -1, -1, -1, -1, -1, "Se Autorizo con bloqueo", "No", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 0, "", "", "", CvePromocion:=CvePromocion) Then
|
||||
TieneError = True
|
||||
End If
|
||||
|
||||
@@ -1069,6 +1061,51 @@ Partial Class Ventas_Promociones
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region "ENVIAR CORREO PROMOSION BLOQUEADA"
|
||||
|
||||
|
||||
Private Sub MandaCorreoNotificacionPromocionBloqueo(CvePromocionNueva As Integer, PromocionNueva As String)
|
||||
Dim Asunto, Para, ArrayCC, Body, URL As String
|
||||
Asunto = $"Promoción {PromocionNueva} requiere autorización"
|
||||
Para = ""
|
||||
ArrayCC = ""
|
||||
URL = ""
|
||||
|
||||
If Request.Url.Port = 80 Then
|
||||
URL = $"{Request.Url.Scheme}://{Request.Url.Host}{Request.Url.AbsolutePath}?CvePromocion={CvePromocionNueva}"
|
||||
Else
|
||||
URL = $"{Request.Url.Scheme}://{Request.Url.Host}:{Request.Url.Port}{Request.Url.AbsolutePath}?CvePromocion={CvePromocionNueva}"
|
||||
End If
|
||||
|
||||
Body = $"Se a registrado promoción que requiere autorización <a href='{URL}' >{PromocionNueva}</a>"
|
||||
|
||||
Dim objUsu As New ClsSisUsuarios
|
||||
Dim ListaCorreos As New List(Of String)
|
||||
If objUsu.GetPermisosPorUsuarioProcesos(-1, -1, -1, -1, 386, CveEmpresa:=UsuarioActual.CveEmpresa) Then
|
||||
For Each dRow As DataRow In objUsu.DtResultados.Rows
|
||||
If dRow("Correo").ToString.Trim.Length > 0 Then
|
||||
ListaCorreos.Add(dRow("Correo").ToString)
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
objUsu.Dispose()
|
||||
|
||||
If ListaCorreos.Count > 0 Then
|
||||
|
||||
Para = String.Join(";", ListaCorreos)
|
||||
|
||||
Dim Mail As New ClsSisMail()
|
||||
Dim LSRutasMail As New List(Of ClsSisMail.ArchivoMail)
|
||||
Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body, ArrayCC, LSRutasMail)
|
||||
|
||||
End If
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region " ELIMINAR "
|
||||
Protected Sub BtnEliminar_Click(sender As Object, e As EventArgs)
|
||||
@@ -1114,22 +1151,6 @@ Partial Class Ventas_Promociones
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
'Protected Sub DdlTipoPromocion_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlTipoPromocion.SelectedIndexChanged
|
||||
' If DdlTipoPromocion.SelectedValue = "3" Then
|
||||
' DivCantMinima.Visible = True
|
||||
' Else
|
||||
' DivCantMinima.Visible = False
|
||||
' End If
|
||||
'End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs)
|
||||
|
||||
@@ -1294,11 +1315,6 @@ Partial Class Ventas_Promociones
|
||||
ObjPS.Dispose()
|
||||
|
||||
|
||||
'Dim ObjGral As New ClsGenerales
|
||||
'If ObjGral.GetRinTamanios(UsuarioActual.CveEmpresa) Then
|
||||
' DTRines = ObjGral.DtResultados
|
||||
'End If
|
||||
'ObjGral.Dispose()
|
||||
DTRines = GlobalDTPSRinTamaños(UsuarioActual.CveEmpresa)
|
||||
|
||||
Dim RegistroActual As Integer = 1
|
||||
@@ -1308,8 +1324,6 @@ Partial Class Ventas_Promociones
|
||||
|
||||
Dim ClasificacionStr, CodigoStr, TipoPromocionStr, PromocionStr, CantidadMinimaStr, RinStr, IncluyeImpuestosStr As String
|
||||
|
||||
|
||||
|
||||
ClasificacionStr = dRow("Clasificacion").ToString.Trim
|
||||
CodigoStr = dRow("Codigo").ToString.Trim
|
||||
TipoPromocionStr = dRow("TipoPromocion").ToString.Trim
|
||||
@@ -1387,7 +1401,6 @@ Partial Class Ventas_Promociones
|
||||
|
||||
Next
|
||||
|
||||
|
||||
If Errores.ToString.Length = 0 Then
|
||||
DTPlantilla.AcceptChanges()
|
||||
Return True
|
||||
@@ -1396,20 +1409,23 @@ Partial Class Ventas_Promociones
|
||||
Return False
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
End Function
|
||||
|
||||
Protected Sub DdlPS_selectedindexchange(sender As Object, e As EventArgs)
|
||||
|
||||
Dim DTPSUltimoCosto = New DataTable
|
||||
|
||||
Dim ObjInv As New ClsInventarios
|
||||
If ObjInv.GetUltimoCosto(UsuarioActual.CveEmpresa) Then
|
||||
DTPSUltimoCosto = ObjInv.DtResultados
|
||||
End If
|
||||
ObjInv.Dispose()
|
||||
|
||||
LblUltimoCosto.Text = DTPSUltimoCosto.FiltroPrimeroValor("UltimoCosto", $"CvePS = {DdlPS.SelectedValue}").FormatoNumero
|
||||
LblCostoPromedio.Text = DTPSUltimoCosto.FiltroPrimeroValor("CostoPromedio", $"CvePS = {DdlPS.SelectedValue}").FormatoNumero
|
||||
|
||||
UpAgregar.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
End Class
|
||||
@@ -242,7 +242,9 @@
|
||||
<asp:HyperLinkField ItemStyle-HorizontalAlign="Left" Target="_blank" HeaderText="Grupo" DataTextField="GPO" DataNavigateUrlFields="FechaI,FechaF,CveSubProyecto,CveCliente,CveVendedor,Grupo,GPO,CvePS,CveClasificacion,CveMarca,CveCategoria" DataNavigateUrlFormatString="RepVentasUtilidad.aspx?FechaI={0}&FechaF={1}&CveSubProyecto={2}&CveCliente={3}&CveVendedor={4}&Gpo={5}&CveGpo={6}&CvePS={7}&CveClasificacion={8}&CveMarca={9}&CveCategoria={10}" />
|
||||
<asp:BoundField ItemStyle-HorizontalAlign="Right" HeaderText="Ventas" DataField="Ventas" DataFormatString="{0:N2}" />
|
||||
<asp:BoundField ItemStyle-HorizontalAlign="Right" HeaderText="Crédito" DataField="Credito" DataFormatString="{0:N2}" />
|
||||
<asp:BoundField ItemStyle-HorizontalAlign="Right" HeaderText="% Crédito" DataField="PorcentajeCredito" ItemStyle-Width="30px" />
|
||||
<asp:BoundField ItemStyle-HorizontalAlign="Right" HeaderText="Contado" DataField="Contado" DataFormatString="{0:N2}" />
|
||||
<asp:BoundField ItemStyle-HorizontalAlign="Right" HeaderText="% Contado" DataField="PorcentajeCredito" ItemStyle-Width="30px" />
|
||||
|
||||
<asp:BoundField ItemStyle-HorizontalAlign="Right" HeaderText="%" DataField="ProcentajeVentas" DataFormatString="{0:N2}" ItemStyle-Width="30px" />
|
||||
<asp:BoundField ItemStyle-HorizontalAlign="Right" HeaderText="Descuento" DataField="Descuento" DataFormatString="{0:N2}" />
|
||||
|
||||
@@ -32,6 +32,11 @@ Partial Class Ventas_RepVentasUtilidadPadre
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
If UsuarioActual.Empresa.Funcionalidad(382) <> "1" Then
|
||||
GvDatos.Columns(3).Visible = False
|
||||
GvDatos.Columns(5).Visible = False
|
||||
End If
|
||||
|
||||
CargaCombos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -1131,6 +1131,7 @@
|
||||
<th></th>
|
||||
<th runat="server" visible="false" id="nomostrar2"></th>
|
||||
<th runat="server" visible="false" id="thProntoPago2"></th>
|
||||
<th runat="server" visible="false" id="thCosto2"></th>
|
||||
</tr>
|
||||
<tr class="TextTab" runat="server" id="TrEdit">
|
||||
<th>
|
||||
@@ -1254,9 +1255,10 @@
|
||||
<%--<th style="text-align: center;">
|
||||
<asp:LinkButton ID="LbVerInventario" ClientIDMode="Static" runat="server" CssClass="btn btn-circle btn-sm purple" Text="<i class='icon-magnifier'></i>"></asp:LinkButton>
|
||||
</th>--%>
|
||||
<th runat="server" id="thOrden"></th>
|
||||
<th runat="server" visible="false" id="nomostrar"></th>
|
||||
<th runat="server" visible="false" id="thProntoPago"></th>
|
||||
|
||||
<th runat="server" visible="false" id="thCosto"></th>
|
||||
</tr>
|
||||
</table>
|
||||
<%--</asp:Panel>--%>
|
||||
@@ -1519,6 +1521,8 @@
|
||||
</asp:TemplateField>
|
||||
<%--22--%>
|
||||
<asp:BoundField DataField="TieneProntoPago" HeaderText="Pronto Pago" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center" ReadOnly="true" Visible="false" />
|
||||
<%--23--%>
|
||||
<asp:BoundField DataField="Costo" HeaderText="Costo" DataFormatString="{0:0.######}" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Right" ReadOnly="true" Visible="false" />
|
||||
</Columns>
|
||||
<RowStyle CssClass="Texto" />
|
||||
<AlternatingRowStyle CssClass="TextoAlterno" />
|
||||
|
||||
@@ -1370,6 +1370,15 @@ Partial Class Ventas
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property ListaDevolucionesAplicadas As List(Of Modelos.MAnticipoRelacionado)
|
||||
Get
|
||||
Return If(IsNothing(ViewState("ListaDevolucionesAplicadas")), Nothing, CType(ViewState("ListaDevolucionesAplicadas"), List(Of Modelos.MAnticipoRelacionado)))
|
||||
End Get
|
||||
Set(value As List(Of Modelos.MAnticipoRelacionado))
|
||||
ViewState("ListaDevolucionesAplicadas") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property CveTimbreCartaPorteVenta As Integer
|
||||
Get
|
||||
Return If(IsNothing(ViewState("CveTimbreCartaPorteVenta")), -1, ViewState("CveTimbreCartaPorteVenta").ToString().ToEntero())
|
||||
@@ -2805,6 +2814,9 @@ Partial Class Ventas
|
||||
TmpDT.Columns.Add("NumeroPedimento", GetType(String))
|
||||
TmpDT.Columns.Add("CodigoAlterno", GetType(String))
|
||||
TmpDT.Columns.Add("PSAlterno", GetType(String))
|
||||
TmpDT.Columns.Add("Costo", GetType(Decimal))
|
||||
TmpDT.Columns("Costo").DefaultValue = 0D
|
||||
|
||||
GvPS.DataSource = ObjVentas.DtResultados
|
||||
GvPS.DataBind()
|
||||
|
||||
@@ -2823,6 +2835,9 @@ Partial Class Ventas
|
||||
If ObjCGame.ManifiestoForVtaGet(UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, Request("CveManifiesto").ToEntero()) Then
|
||||
GvPS.DataSource = ObjCGame.DtResultados
|
||||
TmpDT = ObjCGame.DtResultados
|
||||
TmpDT.Columns.Add("Costo", GetType(Decimal))
|
||||
TmpDT.Columns("Costo").DefaultValue = 0D
|
||||
|
||||
GvPS.DataBind()
|
||||
End If
|
||||
|
||||
@@ -2866,6 +2881,8 @@ Partial Class Ventas
|
||||
TmpDT.Columns.Add("NumeroPedimento", GetType(String))
|
||||
TmpDT.Columns.Add("CodigoAlterno", GetType(String))
|
||||
TmpDT.Columns.Add("PSAlterno", GetType(String))
|
||||
TmpDT.Columns.Add("Costo", GetType(Decimal))
|
||||
TmpDT.Columns("Costo").DefaultValue = 0D
|
||||
GvPS.DataSource = ObjVentas.DtResultados
|
||||
GvPS.DataBind()
|
||||
|
||||
@@ -4922,6 +4939,9 @@ Partial Class Ventas
|
||||
TmpDT.Columns.Add("ImporteProntoPago", GetType(Decimal))
|
||||
TmpDT.Columns.Add("AFDepreciacion", GetType(Decimal))
|
||||
TmpDT.Columns.Add("AFValorInicial", GetType(Decimal))
|
||||
|
||||
TmpDT.Columns.Add("Costo", GetType(Decimal))
|
||||
TmpDT.Columns("Costo").DefaultValue = 0D
|
||||
End If
|
||||
|
||||
CargaAFVenta()
|
||||
@@ -5844,6 +5864,7 @@ Partial Class Ventas
|
||||
'Ocultamos los botones Clonar y Ordenar
|
||||
GvPS.Columns(19).Visible = False
|
||||
GvPS.Columns(20).Visible = False
|
||||
thOrden.Visible = False
|
||||
|
||||
GvFirmas.DataSource = DTmpF
|
||||
GvFirmas.DataBind()
|
||||
@@ -9125,8 +9146,18 @@ Partial Class Ventas
|
||||
Dim CostoMenor As Decimal = 0
|
||||
Dim CostoMayor As Decimal = 0
|
||||
|
||||
Dim PorcentajeMinimoCostoEmpresa = UsuarioActual.Empresa.Funcionalidad(129).ToDecimal
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
|
||||
If DatarowPS IsNot Nothing Then
|
||||
If DatarowPS("PorcentajeMinimoUtilidad").ToString().ToDecimal() > 0 Then
|
||||
PorcentajeMinimoCostoEmpresa = DatarowPS("PorcentajeMinimoUtilidad").ToString().ToDecimal()
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
'PRECIO MINIMO
|
||||
If UsuarioActual.Empresa.Funcionalidad(129).ToEntero() > 0 AndAlso UsuarioActual.CveUsuario <> 1560 Then
|
||||
If PorcentajeMinimoCostoEmpresa > 0 AndAlso UsuarioActual.CveUsuario <> 1560 Then
|
||||
'' NOTA. si tiene preciominimo, debe de validarlos e ignorar el costo, pero se debe de considerar el TC, para el costo
|
||||
If PrecioMinimo > 0 Then
|
||||
'SI EL PRECIO ES MAYOR AL COSTO, SI PASA
|
||||
@@ -9134,7 +9165,7 @@ Partial Class Ventas
|
||||
EsValido = True
|
||||
End If
|
||||
Else
|
||||
CostoMenor = Costo + ((UsuarioActual.Empresa.Funcionalidad(129).ToDecimal / 100) * Costo)
|
||||
CostoMenor = Costo + ((PorcentajeMinimoCostoEmpresa / 100) * Costo)
|
||||
'SI EL PRECIO ES MAYOR AL COSTO, SI PASA
|
||||
If PU * If(DdlMoneda.SelectedValue.ToEntero() = 1, 1, TxtTipoCambio.Text.ToDecimal) >= CostoMenor Then
|
||||
EsValido = True
|
||||
@@ -9172,7 +9203,7 @@ Partial Class Ventas
|
||||
MensajeCosto.AppendFormat("El Producto <b>{0}</b>. No se puede vender a un precio menor de su Costo <br/>", DatarowPS("PS").ToString())
|
||||
If TienePermisoImportes Then
|
||||
MensajeCosto.AppendFormat("El costo del producto es: <b>${0:#,###.00}</b> <br/>", Costo)
|
||||
MensajeCosto.AppendFormat("El rango menor aceptado es: {0:#,###.00}% <b>${1}</b> <br/>", UsuarioActual.Empresa.Funcionalidad(129).ToEntero(), CostoMenor)
|
||||
MensajeCosto.AppendFormat("El rango menor aceptado es: {0:#,###.00}% <b>${1}</b> <br/>", PorcentajeMinimoCostoEmpresa, CostoMenor)
|
||||
MensajeCosto.AppendFormat("El precio indicado es: <b>${0:#,###.00}</b> ({1}% de ganancia) <br/>", PU.FormatoNumero, (If(Costo > 0, ((PU - Costo) * 100) / Costo, 0)).FormatoNumero)
|
||||
End If
|
||||
|
||||
@@ -10103,8 +10134,19 @@ Partial Class Ventas
|
||||
|
||||
End If
|
||||
|
||||
Dim PorcentajeMinimoCostoEmpresa = UsuarioActual.Empresa.Funcionalidad(129).ToDecimal
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
|
||||
Dim DrPSCosto As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=dr("CvePS").ToString().ToEntero()).Rows(0)
|
||||
If DrPSCosto IsNot Nothing Then
|
||||
If DrPSCosto("PorcentajeMinimoUtilidad").ToString().ToDecimal() > 0 Then
|
||||
PorcentajeMinimoCostoEmpresa = DrPSCosto("PorcentajeMinimoUtilidad").ToString().ToDecimal()
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
'PRECIO MINIMO
|
||||
If UsuarioActual.Empresa.Funcionalidad(129).ToEntero() > 0 AndAlso UsuarioActual.CveUsuario <> 1560 Then
|
||||
If PorcentajeMinimoCostoEmpresa > 0 AndAlso UsuarioActual.CveUsuario <> 1560 Then
|
||||
'' NOTA. si tiene preciominimo, debe de validarlos e ignorar el costo, pero se debe de considerar el TC, para el costo
|
||||
If PrecioMinimo > 0 Then
|
||||
'SI EL PRECIO ES MAYOR AL COSTO, SI PASA
|
||||
@@ -10112,7 +10154,7 @@ Partial Class Ventas
|
||||
EsValido = True
|
||||
End If
|
||||
Else
|
||||
CostoMenor = Costo + ((UsuarioActual.Empresa.Funcionalidad(129).ToDecimal / 100) * Costo)
|
||||
CostoMenor = Costo + ((PorcentajeMinimoCostoEmpresa / 100) * Costo)
|
||||
'SI EL PRECIO ES MAYOR AL COSTO, SI PASA
|
||||
If PU * If(DdlMoneda.SelectedValue.ToEntero() = 1, 1, TxtTipoCambio.Text.ToDecimal) >= CostoMenor Then
|
||||
EsValido = True
|
||||
@@ -10151,7 +10193,7 @@ Partial Class Ventas
|
||||
MensajeCosto.AppendFormat("El Producto <b>{0}</b>. No se puede vender a un precio menor de su Costo ni a un precio mayor de su rango aceptado<br/>", dr("PS").ToString())
|
||||
If TienePermisoImportes Then
|
||||
MensajeCosto.AppendFormat("El costo del producto es: <b>{0:#,###.00}$</b> <br/>", Costo)
|
||||
MensajeCosto.AppendFormat("El rango menor aceptado es: {0} <b>{1:#,###.00}$</b> <br/>", UsuarioActual.Empresa.Funcionalidad(129).ToEntero(), CostoMenor)
|
||||
MensajeCosto.AppendFormat("El rango menor aceptado es: {0} <b>{1:#,###.00}$</b> <br/>", PorcentajeMinimoCostoEmpresa, CostoMenor)
|
||||
MensajeCosto.AppendFormat("El precio indicado es: <b>{0:#,###.00}$</b> ({1}% de ganancia) <br/>", PU.FormatoNumero, If(Costo > 0, ((PU - Costo) * 100) / Costo, 0))
|
||||
End If
|
||||
End If
|
||||
@@ -10948,6 +10990,10 @@ Partial Class Ventas
|
||||
ListaAnticiposAplicados.Clear()
|
||||
End If
|
||||
|
||||
If ListaDevolucionesAplicadas IsNot Nothing Then
|
||||
ListaDevolucionesAplicadas.Clear()
|
||||
End If
|
||||
|
||||
'ENVIAR POLIZA VIRTUAL
|
||||
If ErrorList.Count = 0 Then
|
||||
If UsuarioActual.Empresa.Funcionalidad(576) = "1" AndAlso EsProduccion Then
|
||||
@@ -13472,6 +13518,26 @@ Partial Class Ventas
|
||||
Next
|
||||
End If
|
||||
|
||||
'DEVOLUCIONES DE OTRA VENTA, APLICADAS EN UNA NUEVA
|
||||
If UsuarioActual.CveEmpresa.Contiene(1, 189) AndAlso Obj.TipoDocto = "Ing" AndAlso DdlTipoAmortizacionAnticipo.SelectedValue = "4" Then
|
||||
If ListaDevolucionesAplicadas IsNot Nothing AndAlso ListaDevolucionesAplicadas.Count > 0 Then
|
||||
Timbre.CFDIRelacionados.UUID.Clear()
|
||||
For Each Dev As Modelos.MAnticipoRelacionado In ListaDevolucionesAplicadas
|
||||
Timbre.CFDIRelacionados.UUID.Add(Dev.FolioFiscal)
|
||||
Next
|
||||
|
||||
'TEMPORAL- DEBE SER TIPO RELACION "01 - Nota de crédito de los documentos relacionados"
|
||||
Dim CveTipoRelacion As Integer = 1
|
||||
|
||||
Obj.CveTipoRelacion = CveTipoRelacion
|
||||
|
||||
Dim RowTipoRelacion As DataRow = GlobalDTVtaTiposRelacion().FiltroPrimero($"CveTipoRelacion = {CveTipoRelacion}")
|
||||
|
||||
Timbre.CFDIRelacionados.TipoRelacion = RowTipoRelacion("SATClaveTipoRelacion").ToString()
|
||||
Timbre.CFDIRelacionados.TipoRelacionTexto = RowTipoRelacion("SATTipoRelacion").ToString()
|
||||
End If
|
||||
End If
|
||||
|
||||
Dim totSubTotal As Decimal = Obj.SubTotal
|
||||
Dim totIVA As Decimal = Obj.IVA
|
||||
Dim totRetIVA As Decimal = Obj.RetIVA
|
||||
@@ -17438,6 +17504,12 @@ Partial Class Ventas
|
||||
ListaAnticiposAplicados = New List(Of Modelos.MAnticipoRelacionado)
|
||||
End If
|
||||
|
||||
If ListaDevolucionesAplicadas IsNot Nothing Then
|
||||
ListaDevolucionesAplicadas.Clear()
|
||||
Else
|
||||
ListaDevolucionesAplicadas = New List(Of Modelos.MAnticipoRelacionado)
|
||||
End If
|
||||
|
||||
HdnIVACalculado.Value = HdnIVAOriginal.Value
|
||||
For Each gvr As GridViewRow In GVAnticipos.Rows
|
||||
If gvr.FCCheckBox("Chk" & gvr.RowIndex) IsNot Nothing AndAlso gvr.FCCheckBox("Chk" & gvr.RowIndex).Checked AndAlso gvr.DataKey("CveConceptoContable").ToEntero().Contiene(3) Then
|
||||
@@ -17448,6 +17520,13 @@ Partial Class Ventas
|
||||
|
||||
'CvePSAmortizacion = GlobalDTPS(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePS", "CveConceptoContable = 11").ToEntero()
|
||||
End If
|
||||
|
||||
'AGREGAR LAS DEV
|
||||
If UsuarioActual.CveEmpresa.Contiene(1, 189) AndAlso DdlTipoAmortizacionAnticipo.SelectedValue.Contiene("4") Then
|
||||
If gvr.FCCheckBox("Chk" & gvr.RowIndex) IsNot Nothing AndAlso gvr.FCCheckBox("Chk" & gvr.RowIndex).Checked AndAlso gvr.DataKey("CveConceptoContable").ToEntero().Contiene(12) Then
|
||||
ListaDevolucionesAplicadas.Add(New Modelos.MAnticipoRelacionado() With {.CveVenta = gvr.DataKey("CveVenta").ToEntero(), .FolioFiscal = gvr.DataKey("FolioFiscal")})
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
'Amortizacion += TmpDTImpuestos.SUM("Importe").ToDecimal 'RMF. 2018.12.20- saque de la jugada en la amortización los impuestos locales
|
||||
|
||||
@@ -19300,8 +19379,19 @@ Partial Class Ventas
|
||||
Dim CostoMenor As Decimal = 0.0D
|
||||
Dim CostoMayor As Decimal = 0.0D
|
||||
|
||||
Dim PorcentajeMinimoCostoEmpresa = UsuarioActual.Empresa.Funcionalidad(129).ToDecimal
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
|
||||
Dim DrPSCosto As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).Rows(0)
|
||||
If DrPSCosto IsNot Nothing Then
|
||||
If DrPSCosto("PorcentajeMinimoUtilidad").ToString().ToDecimal() > 0 Then
|
||||
PorcentajeMinimoCostoEmpresa = DrPSCosto("PorcentajeMinimoUtilidad").ToString().ToDecimal()
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
'PRECIO MINIMO
|
||||
If UsuarioActual.Empresa.Funcionalidad(129).ToEntero() > 0 AndAlso UsuarioActual.CveUsuario <> 1560 Then
|
||||
If PorcentajeMinimoCostoEmpresa > 0 AndAlso UsuarioActual.CveUsuario <> 1560 Then
|
||||
'' NOTA. si tiene preciominimo, debe de validarlos e ignorar el costo, pero se debe de considerar el TC, para el costo
|
||||
If PrecioMinimo > 0 Then
|
||||
'SI EL PRECIO ES MAYOR AL COSTO, SI PASA
|
||||
@@ -19309,7 +19399,7 @@ Partial Class Ventas
|
||||
EsValido = True
|
||||
End If
|
||||
Else
|
||||
CostoMenor = Costo + ((UsuarioActual.Empresa.Funcionalidad(129).ToDecimal / 100) * Costo)
|
||||
CostoMenor = Costo + ((PorcentajeMinimoCostoEmpresa / 100) * Costo)
|
||||
'SI EL PRECIO ES MAYOR AL COSTO, SI PASA
|
||||
If PU * If(DdlMoneda.SelectedValue.ToEntero() = 1, 1, TxtTipoCambio.Text.ToDecimal) >= CostoMenor Then
|
||||
EsValido = True
|
||||
@@ -19363,7 +19453,7 @@ Partial Class Ventas
|
||||
MensajeCosto.AppendFormat("El Producto <b>{0}-{1}</b>. No se puede vender a un precio menor de su Costo <br/>", HdnCodigoPS.Value, HdnPS.Value)
|
||||
If TienePermisoImportes Then
|
||||
MensajeCosto.AppendFormat("El costo del producto es: <b>${0:#,###.00}</b> <br/>", Costo)
|
||||
MensajeCosto.AppendFormat("El rango menor aceptado es: {0}% <b>${1:#,###.00}</b> <br/>", UsuarioActual.Empresa.Funcionalidad(129).ToEntero(), CostoMenor)
|
||||
MensajeCosto.AppendFormat("El rango menor aceptado es: {0}% <b>${1:#,###.00}</b> <br/>", PorcentajeMinimoCostoEmpresa, CostoMenor)
|
||||
MensajeCosto.AppendFormat("El precio indicado es: <b>${0:#,###.00}</b> ({1}% de ganancia) <br/>", PU.FormatoNumero, (If(Costo > 0, ((PU - Costo) * 100) / Costo, 0)).FormatoNumero)
|
||||
End If
|
||||
|
||||
@@ -19677,11 +19767,23 @@ Partial Class Ventas
|
||||
NumTurnos = TxtNumTurnos.Text.ToDecimal()
|
||||
End If
|
||||
|
||||
'SI TIENE PERMISO PARA VER COSTO, QUE LO AGREGUE AL TMPDT
|
||||
Dim Costo As Decimal = 0
|
||||
If UsuarioActual.Empresa.Funcionalidad(382) = "1" AndAlso UsuarioActual.TienePermisoProceso(385) Then
|
||||
Dim ObjInventarios As New ClsInventarios
|
||||
|
||||
Costo = ObjInventarios.GetCostoPS(CvePS, TxtCantidad.Text.Trim.ToDecimal, -1, "-1", TxtFecha.Text.ToDate, DdlSubProyectoDatos.SelectedValue.ToEntero(), CveTipoAlmacen:=1)
|
||||
'si el costo es cero, puede ser que no halla movimientos del producto, en esa sucursal. y se volverá a sacar sin especificar sucursal
|
||||
If Costo <= 0 Then Costo = ObjInventarios.GetCostoPS(CvePS, TxtCantidad.Text.Trim.ToDecimal, -1, "-1", TxtFecha.Text.ToDate, -1, CveTipoAlmacen:=1)
|
||||
|
||||
ObjInventarios.Dispose()
|
||||
End If
|
||||
|
||||
AgregarProductoServicio(Cantidad, DdlUnidadMedida.SelectedValue.ToEntero(), DdlUnidadMedida.SelectedItem.Text, DdlClasificacion.SelectedValue.ToEntero(), DdlClasificacion.SelectedItem.Text,
|
||||
CvePS, "", TxtObsPS.Text.TrimEnd, PU, ObjDescuento.ImporteDescuento,
|
||||
DdlProyecto.SelectedValue.ToEntero(), DdlProyecto.SelectedItem.Text, DdlSubProyecto.SelectedValue.ToEntero(), DdlSubProyecto.SelectedItem.Text,
|
||||
Serie:=If(DIVCod.Visible, TxtCodigoSerie.Text.Trim, ""), TiempoEntrega:=TxtTiempoEntrega.Text, CuentaPredial:=TxtCuentaPredial.Text.Trim, RegeneraIEPS:=ClienteDesglosaIEPS, CvePromocionDetalle:=ObjDescuento.CvePromocionDetalle,
|
||||
ImporteProntoPago:=ObjDescuento.ImporteProntoPago, ObjDescuento:=ObjDescuento, CvePrecioLista:=CvePrecioListaPS, PrecioLista:=PrecioListaPS, NumTurnos:=NumTurnos)
|
||||
ImporteProntoPago:=ObjDescuento.ImporteProntoPago, ObjDescuento:=ObjDescuento, CvePrecioLista:=CvePrecioListaPS, PrecioLista:=PrecioListaPS, NumTurnos:=NumTurnos, Costo:=Costo)
|
||||
|
||||
CalculaUsados()
|
||||
|
||||
@@ -19833,7 +19935,8 @@ Partial Class Ventas
|
||||
Optional CveOrdenCompraDetalle As Integer = 0, Optional CveVentaDetalleRemision As Integer = 0, Optional CveVentaDetalleCotizacion As Integer = 0, Optional CuentaPredial As String = "",
|
||||
Optional RegeneraIEPS As Boolean = True, Optional CveVentaDetallePedido2 As Integer = 0, Optional SeActualiza As Boolean = False, Optional CvePromocionDetalle As Integer = -1, Optional EsCargo As Boolean = False,
|
||||
Optional ImporteProntoPago As Decimal = 0, Optional ByRef ObjDescuento As Modelos.VentaDescuentos = Nothing, Optional CvePrecioLista As Integer = -1, Optional PrecioLista As String = "",
|
||||
Optional CveActivoFijo As Integer = -1, Optional AFDepreciacion As Decimal = 0D, Optional AFValorInicial As Decimal = 0D, Optional NumTurnos As Decimal = 0D, Optional CantidadConversion As Decimal = 0) As Boolean
|
||||
Optional CveActivoFijo As Integer = -1, Optional AFDepreciacion As Decimal = 0D, Optional AFValorInicial As Decimal = 0D, Optional NumTurnos As Decimal = 0D, Optional CantidadConversion As Decimal = 0,
|
||||
Optional Costo As Decimal = 0) As Boolean
|
||||
|
||||
Dim Retorno As Boolean = False
|
||||
Try
|
||||
@@ -20090,6 +20193,7 @@ Partial Class Ventas
|
||||
Row("AFValorInicial") = AFValorInicial
|
||||
|
||||
Row("NumTurnos") = NumTurnos
|
||||
Row("Costo") = Costo
|
||||
|
||||
Row("CodigoAlterno") = DrPS("CodigoAlterno")
|
||||
Row("PSAlterno") = DrPS("PSAlterno")
|
||||
@@ -20356,6 +20460,9 @@ Partial Class Ventas
|
||||
TmpDT.Columns("CantidadConversion").DefaultValue = 0
|
||||
|
||||
TmpDT.Columns.Add("TotalConImpuestos", GetType(Decimal))
|
||||
|
||||
TmpDT.Columns.Add("Costo", GetType(Decimal))
|
||||
TmpDT.Columns("Costo").DefaultValue = 0D
|
||||
End Sub
|
||||
Private Sub CreaDTmpC()
|
||||
DTmpC = New DataTable
|
||||
@@ -21305,6 +21412,16 @@ Partial Class Ventas
|
||||
HlAgregarExcel.Visible = True
|
||||
End If
|
||||
|
||||
If (CveVenta <= 0 OrElse EsCreaApartirDe) AndAlso UsuarioActual.Empresa.Funcionalidad(382) = "1" AndAlso DdlTipoComprobante.SelectedValue = "Cot" Then
|
||||
GvPS.Columns(23).Visible = True
|
||||
thCosto.Visible = True
|
||||
thCosto2.Visible = True
|
||||
Else
|
||||
GvPS.Columns(23).Visible = False
|
||||
thCosto.Visible = False
|
||||
thCosto2.Visible = False
|
||||
End If
|
||||
UpPS.Update()
|
||||
UpCargaExceles.Update()
|
||||
|
||||
UpFacturar.Update()
|
||||
@@ -24425,7 +24542,7 @@ Partial Class Ventas
|
||||
'SI ES AMORTIZACION POR NOTA DE CREDITO DEBE SUMAR LA TOTALIDAD PARA COMPARAR EL PAGO
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant") AndAlso DdlTipoAmortizacionAnticipo.SelectedValue.Contiene("2", "4") Then
|
||||
For Each gvr As GridViewRow In GVAnticipos.Rows
|
||||
If gvr.FCCheckBox("Chk" & gvr.RowIndex) IsNot Nothing AndAlso gvr.FCCheckBox("Chk" & gvr.RowIndex).Checked AndAlso gvr.DataKey("CveConceptoContable").ToEntero().Contiene(3, 12) Then
|
||||
If gvr.FCCheckBox("Chk" & gvr.RowIndex) IsNot Nothing AndAlso gvr.FCCheckBox("Chk" & gvr.RowIndex).Checked AndAlso gvr.DataKey("CveConceptoContable").ToEntero().Contiene(3, 12, 66) Then
|
||||
AmortizacionNC += gvr.FCTextBox(String.Format("TxtAnticipo{0}", gvr.RowIndex)).Text.ToDecimal
|
||||
End If
|
||||
Next
|
||||
@@ -27045,6 +27162,7 @@ Partial Class Ventas
|
||||
GvPS.Columns(17).Visible = False
|
||||
GvPS.Columns(19).Visible = False
|
||||
GvPS.Columns(20).Visible = False
|
||||
thOrden.Visible = False
|
||||
|
||||
DdlVendedor.SelectedValue = DbRowVenta("CveVendedor").ToString()
|
||||
DdlTipoComprobante.Enabled = False
|
||||
@@ -30920,6 +31038,8 @@ Partial Class Ventas
|
||||
'TmpDT.Columns.Add("CveActivoFijo", GetType(Integer))
|
||||
TmpDT.Columns.Add("AFDepreciacion", GetType(Decimal))
|
||||
TmpDT.Columns.Add("AFValorInicial", GetType(Decimal))
|
||||
TmpDT.Columns.Add("Costo", GetType(Decimal))
|
||||
TmpDT.Columns("Costo").DefaultValue = 0D
|
||||
End If
|
||||
Dim FechaFactura As DateTime = NowADS()
|
||||
|
||||
@@ -31562,6 +31682,8 @@ Partial Class Ventas
|
||||
GvPS.Columns(18).Visible = False
|
||||
GvPS.Columns(19).Visible = False
|
||||
GvPS.Columns(20).Visible = False
|
||||
thOrden.Visible = False
|
||||
|
||||
DivRemisionesFacturadas.Visible = False
|
||||
DivAnticiposVinculados.Visible = False
|
||||
|
||||
@@ -36366,6 +36488,8 @@ Partial Class Ventas
|
||||
TmpDT.Columns.Add("CveMovimientoDetallePedido", GetType(Integer))
|
||||
TmpDT.Columns.Add("AFDepreciacion", GetType(Decimal))
|
||||
TmpDT.Columns.Add("AFValorInicial", GetType(Decimal))
|
||||
TmpDT.Columns.Add("Costo", GetType(Decimal))
|
||||
TmpDT.Columns("Costo").DefaultValue = 0D
|
||||
End If
|
||||
|
||||
If ObjVentas.GetVenta(CveVentaNC, UsuarioActual.CveEmpresa, VerificaAlmacen:=False) Then
|
||||
@@ -36530,6 +36654,8 @@ Partial Class Ventas
|
||||
TmpDT.Columns("NumTurnos").DefaultValue = 0D
|
||||
TmpDT.Columns.Add("NumeroPedimento", GetType(String))
|
||||
TmpDT.Columns.Add("TotalConImpuestos", GetType(Decimal))
|
||||
TmpDT.Columns.Add("Costo", GetType(Decimal))
|
||||
TmpDT.Columns("Costo").DefaultValue = 0D
|
||||
|
||||
Return TmpDT
|
||||
End Function
|
||||
|
||||
Reference in New Issue
Block a user