--FIX. Actualizar precios en franquicias cuando se selecciona el modo multiples precios lista
This commit is contained in:
@@ -343,7 +343,7 @@ Partial Class Ventas_ActualizarPrecios
|
|||||||
|
|
||||||
|
|
||||||
If Not TieneError Then
|
If Not TieneError Then
|
||||||
TieneError = ActualizarPreciosFranquicia(ObjPS, row.DataKey("Codigo"), row.DataKey("PS"), row.FCTextBox("TxtPrecio").Text.ToDecimal, row.FCTextBox("TxtPrecioMinimo").Text.ToDecimal, DdlPrecioLista.SelectedItem.Text)
|
TieneError = ActualizarPreciosFranquicia(ObjPS, row.DataKey("Codigo"), row.FCTextBox("TxtPrecio").Text.ToDecimal, row.FCTextBox("TxtPrecioMinimo").Text.ToDecimal, DdlPrecioLista.SelectedItem.Text)
|
||||||
Else
|
Else
|
||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
@@ -603,7 +603,7 @@ Partial Class Ventas_ActualizarPrecios
|
|||||||
Correcto = ObjPS.UpdatePSPreciosLista(PrecioNuevo, CvePrecioLista, Porcentaje, CvePS, UsuarioActual.CveUsuario, NowADS(), True)
|
Correcto = ObjPS.UpdatePSPreciosLista(PrecioNuevo, CvePrecioLista, Porcentaje, CvePS, UsuarioActual.CveUsuario, NowADS(), True)
|
||||||
If Correcto Then
|
If Correcto Then
|
||||||
RowsCargados += 1
|
RowsCargados += 1
|
||||||
TieneError = ActualizarPreciosFranquicia(ObjPS, row(0).ToString(), row(1).ToString(), PrecioNuevo, 0, DdlPrecioListaCarga.SelectedItem.Text)
|
TieneError = ActualizarPreciosFranquicia(ObjPS, row(0).ToString(), PrecioNuevo, 0, DdlPrecioListaCarga.SelectedItem.Text)
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
If CvePS > 0 AndAlso CvePrecioLista = -2 Then
|
If CvePS > 0 AndAlso CvePrecioLista = -2 Then
|
||||||
@@ -652,7 +652,7 @@ Partial Class Ventas_ActualizarPrecios
|
|||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Function ActualizarPreciosFranquicia(ObjPS As ClsProductosServicios, Codigo As String, PS As String, Precio As Decimal, PrecioMinimo As Decimal, PrecioLista As String) As Boolean
|
Private Function ActualizarPreciosFranquicia(ObjPS As ClsProductosServicios, Codigo As String, Precio As Decimal, PrecioMinimo As Decimal, PrecioLista As String, Optional UpdatePrecioMinimo As Boolean = True) As Boolean
|
||||||
Dim FranquiciasStr As String = UsuarioActual.Empresa.Funcionalidad(563)
|
Dim FranquiciasStr As String = UsuarioActual.Empresa.Funcionalidad(563)
|
||||||
Dim StrMsg As New StringBuilder
|
Dim StrMsg As New StringBuilder
|
||||||
Dim StrMsgError As New StringBuilder
|
Dim StrMsgError As New StringBuilder
|
||||||
@@ -674,7 +674,7 @@ Partial Class Ventas_ActualizarPrecios
|
|||||||
' Dim EmpresaFranquicia As String = GlobalDTEmpresas(CveEmpresa:=CveFranquicia).FiltroPrimeroValor("Empresa")
|
' 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)
|
' StrMsg.AppendFormat("El precio lista '{0}' no existe en la Franquicia '{1}'<br/>", DdlPrecioLista.SelectedItem.Text, EmpresaFranquicia)
|
||||||
'End If
|
'End If
|
||||||
If CvePrecioLisa > 0 AndAlso CvePS > 0 AndAlso Not ObjPS.UpdatePSPreciosLista(Precio, CvePrecioLisa, Porcentaje, CvePS, UsuarioActual.CveUsuario, NowADS(), If(RblTipo.SelectedValue = "Imp", True, False), PrecioMinimo:=PrecioMinimo) Then
|
If CvePrecioLisa > 0 AndAlso CvePS > 0 AndAlso Not ObjPS.UpdatePSPreciosLista(Precio, CvePrecioLisa, Porcentaje, CvePS, UsuarioActual.CveUsuario, NowADS(), If(RblTipo.SelectedValue = "Imp", True, False), PrecioMinimo:=If(UpdatePrecioMinimo, PrecioMinimo, 0)) Then
|
||||||
StrMsgError.AppendFormat("No se pudo actualizar el producto")
|
StrMsgError.AppendFormat("No se pudo actualizar el producto")
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
@@ -962,6 +962,8 @@ Partial Class Ventas_ActualizarPrecios
|
|||||||
Protected Sub LnkGuardarMultiple_Click(sender As Object, e As EventArgs)
|
Protected Sub LnkGuardarMultiple_Click(sender As Object, e As EventArgs)
|
||||||
Dim TieneError As Boolean = False
|
Dim TieneError As Boolean = False
|
||||||
|
|
||||||
|
Dim DtPS As DataTable = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa)
|
||||||
|
|
||||||
Dim ObjPS As New ClsProductosServicios
|
Dim ObjPS As New ClsProductosServicios
|
||||||
ObjPS.IniciaTransacSQL()
|
ObjPS.IniciaTransacSQL()
|
||||||
Try
|
Try
|
||||||
@@ -984,6 +986,28 @@ Partial Class Ventas_ActualizarPrecios
|
|||||||
|
|
||||||
TieneError = Not ObjPS.UpdatePSPreciosLista(Precio, CvePrecioLista, 0, CvePS, UsuarioActual.CveUsuario, NowADS(), True)
|
TieneError = Not ObjPS.UpdatePSPreciosLista(Precio, CvePrecioLista, 0, CvePS, UsuarioActual.CveUsuario, NowADS(), True)
|
||||||
|
|
||||||
|
If Not TieneError Then
|
||||||
|
|
||||||
|
Dim text As String = DtPreciosMultiple.Columns(indiceColumna).ColumnName
|
||||||
|
Dim splitValues As String() = text.Split("|"c)
|
||||||
|
|
||||||
|
If splitValues.Length > 1 Then
|
||||||
|
|
||||||
|
Dim PrecioLista As String = splitValues(1)
|
||||||
|
|
||||||
|
Dim DrPS = DtPS.FiltroPrimero($"CvePS = {CvePS}")
|
||||||
|
If DrPS IsNot Nothing Then
|
||||||
|
TieneError = ActualizarPreciosFranquicia(ObjPS, DrPS("Codigo").ToString(), Precio, 0, PrecioLista, UpdatePrecioMinimo:=False)
|
||||||
|
Else
|
||||||
|
TieneError = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
Else
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
|
||||||
If TieneError Then
|
If TieneError Then
|
||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
|
|||||||
Reference in New Issue
Block a user