funcionaldiad de franquicias, mejoras
This commit is contained in:
@@ -46,8 +46,7 @@
|
||||
</div>
|
||||
<label id="LblMarca" runat="server" visible="false" class="col-md-1 v-center truncate">Marca:</label>
|
||||
<div class="col-md-9">
|
||||
<asp:ListBox ID="DdlMarca" runat="server" DataTextField="Marca" DataValueField="CveMarca" data-text="Todos" SelectionMode="Multiple" CssClass="form-control ddlFiltros input-sm select2me Widthall" Style="width: 50%; height: 50px !important;">
|
||||
<asp:ListItem Text="Todas" Value="-1"></asp:ListItem>
|
||||
<asp:ListBox ID="DdlMarca" visible="false" runat="server" DataTextField="Marca" DataValueField="CveMarca" data-text="Todos" SelectionMode="Multiple" CssClass="form-control ddlFiltros input-sm select2me Widthall" Style="width: 50%; height: 50px !important;">
|
||||
</asp:ListBox>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -221,7 +221,7 @@ Partial Class Ventas_ActualizarPrecios
|
||||
|
||||
Next
|
||||
|
||||
If Correcto Then
|
||||
If Correcto AndAlso Not TieneError Then
|
||||
Alert("Los Precios de lista de los Productos/Servicios se actualizaron correctamente")
|
||||
End If
|
||||
|
||||
@@ -531,29 +531,38 @@ Partial Class Ventas_ActualizarPrecios
|
||||
|
||||
Private Function ActualizarPreciosFranquicia(ObjPS As ClsProductosServicios, Codigo As String, PS As String, Precio As Decimal, PrecioMinimo As Decimal, PrecioLista As String) As Boolean
|
||||
Dim FranquiciasStr As String = UsuarioActual.Empresa.Funcionalidad(563)
|
||||
Dim Franquicias = FranquiciasStr.Split(","c)
|
||||
Dim Porcentaje As Decimal = If(TxtPorcentaje.Text = "", -1, TxtPorcentaje.Text.ToDecimal)
|
||||
Dim StrMsg As New StringBuilder
|
||||
For Each Franquicia In Franquicias
|
||||
Dim CveFranquicia As Integer = Franquicia.ToEntero
|
||||
Dim CvePS As Integer = GlobalDTPS(CveFranquicia, Codigo:=Codigo).FiltroPrimeroValor("CvePS", "").ToEntero
|
||||
Dim CvePrecioLisa As Integer = GlobalDTPrecioListas(CveFranquicia).FiltroPrimeroValor("CvePrecioLista", String.Format("PrecioLista = '{0}'", PrecioLista)).ToEntero
|
||||
Dim StrMsgError As New StringBuilder
|
||||
If FranquiciasStr <> "" Then
|
||||
|
||||
If CvePS <= 0 Then
|
||||
Dim EmpresaFranquicia As String = GlobalDTEmpresas(CveEmpresa:=CveFranquicia).FiltroPrimeroValor("Empresa")
|
||||
StrMsg.AppendFormat("El producto '{0}' no se encuentra en la Franquicia '{1}'", PS, EmpresaFranquicia)
|
||||
Dim Franquicias = FranquiciasStr.Split(","c)
|
||||
Dim Porcentaje As Decimal = If(TxtPorcentaje.Text = "", -1, TxtPorcentaje.Text.ToDecimal)
|
||||
|
||||
End If
|
||||
If CvePrecioLisa <= 0 Then
|
||||
Dim EmpresaFranquicia As String = GlobalDTEmpresas(CveEmpresa:=CveFranquicia).FiltroPrimeroValor("Empresa")
|
||||
StrMsg.AppendFormat("El precio lista '{0}' no existe en la Franquicia '{1}'", DdlPrecioLista.SelectedItem.Text, EmpresaFranquicia)
|
||||
End If
|
||||
If CvePrecioLisa > 0 AndAlso CvePS > 0 AndAlso Not ObjPS.UpdatePSPreciosLista(Precio, CvePrecioLisa, Porcentaje, CvePS, UsuarioActual.CveUsuario, DateTime.Now, If(RblTipo.SelectedValue = "Imp", True, False), PrecioMinimo:=PrecioMinimo) Then
|
||||
StrMsg.AppendFormat("No se pudo actualizar el producto")
|
||||
End If
|
||||
Next
|
||||
For Each Franquicia In Franquicias
|
||||
Dim CveFranquicia As Integer = Franquicia.ToEntero
|
||||
Dim CvePS As Integer = GlobalDTPS(CveFranquicia, Codigo:=Codigo).FiltroPrimeroValor("CvePS", "").ToEntero
|
||||
Dim CvePrecioLisa As Integer = GlobalDTPrecioListas(CveFranquicia).FiltroPrimeroValor("CvePrecioLista", String.Format("PrecioLista = '{0}'", PrecioLista)).ToEntero
|
||||
|
||||
If StrMsg.ToString = "" Then
|
||||
If CvePS <= 0 Then
|
||||
Dim EmpresaFranquicia As String = GlobalDTEmpresas(CveEmpresa:=CveFranquicia).FiltroPrimeroValor("Empresa")
|
||||
StrMsg.AppendFormat("El producto '{0}' no se encuentra en la Franquicia '{1}' <br/>", PS, EmpresaFranquicia)
|
||||
|
||||
End If
|
||||
'If CvePrecioLisa <= 0 Then
|
||||
' Dim EmpresaFranquicia As String = GlobalDTEmpresas(CveEmpresa:=CveFranquicia).FiltroPrimeroValor("Empresa")
|
||||
' StrMsg.AppendFormat("El precio lista '{0}' no existe en la Franquicia '{1}'<br/>", DdlPrecioLista.SelectedItem.Text, EmpresaFranquicia)
|
||||
'End If
|
||||
If CvePrecioLisa > 0 AndAlso CvePS > 0 AndAlso Not ObjPS.UpdatePSPreciosLista(Precio, CvePrecioLisa, Porcentaje, CvePS, UsuarioActual.CveUsuario, DateTime.Now, If(RblTipo.SelectedValue = "Imp", True, False), PrecioMinimo:=PrecioMinimo) Then
|
||||
StrMsgError.AppendFormat("No se pudo actualizar el producto")
|
||||
End If
|
||||
Next
|
||||
|
||||
End If
|
||||
|
||||
If StrMsgError.ToString = "" Then
|
||||
If StrMsg.ToString <> "" Then
|
||||
Alert(StrMsg.ToString, TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
Return False
|
||||
Else
|
||||
Return True
|
||||
|
||||
Reference in New Issue
Block a user