--FERRETERA.

crear la impresión de etiquetas de productos y precios, campo nuevo. en PS (producto de exhibición)
This commit is contained in:
2024-02-09 14:58:12 -07:00
parent 7ffd1160b7
commit 2c4d8cca9a
6 changed files with 97 additions and 27 deletions

View File

@@ -296,34 +296,49 @@ Partial Class Ventas_ActualizarPrecios
Alert("Se debe de especificar un porcentaje.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim Correcto As Boolean = False
Dim TieneError As Boolean = False
'Dim Importe As Decimal = If(TxtImporte.Text = "", -1, TxtImporte.Text.ToDecimal)
Dim Porcentaje As Decimal = If(TxtPorcentaje.Text = "", -1, TxtPorcentaje.Text.ToDecimal)
Dim MensajeAlert As New StringBuilder
Dim sbProductos As New StringBuilder
Dim ObjPS As New ClsProductosServicios
ObjPS.IniciaTransacSQL()
For Each row As GridViewRow In GVPrecios.Rows
If row.FCCheckBox("chkPS").Checked Then
Correcto = ObjPS.UpdatePSPreciosLista(row.FCTextBox("TxtPrecio").Text.ToDecimal, DdlPrecioLista.SelectedValue.ToEntero, Porcentaje, row.DataKey("CvePS").ToEntero, UsuarioActual.CveUsuario, NowADS(), If(RblTipo.SelectedValue = "Imp", True, False), PrecioMinimo:=row.FCTextBox("TxtPrecioMinimo").Text.ToDecimal)
If Correcto Then
TieneError = ActualizarPreciosFranquicia(ObjPS, row.DataKey("Codigo"), row.DataKey("PS"), row.FCTextBox("TxtPrecio").Text.ToDecimal, row.FCTextBox("TxtPrecioMinimo").Text.ToDecimal, DdlPrecioLista.SelectedItem.Text)
Else
Exit Sub
End If
End If
Next
If Correcto AndAlso Not TieneError Then
Alert("Los Precios de lista de los Productos/Servicios se actualizaron correctamente")
End If
Try
For Each row As GridViewRow In GVPrecios.Rows
If row.FCCheckBox("chkPS").Checked Then
TieneError = Not ObjPS.UpdatePSPreciosLista(row.FCTextBox("TxtPrecio").Text.ToDecimal, DdlPrecioLista.SelectedValue.ToEntero, Porcentaje, row.DataKey("CvePS").ToEntero, UsuarioActual.CveUsuario, NowADS(), If(RblTipo.SelectedValue = "Imp", True, False), PrecioMinimo:=row.FCTextBox("TxtPrecioMinimo").Text.ToDecimal)
If CBool(row.DataKey("ProductoExhibicion")) Then
sbProductos.AppendFormat("{0},", row.DataKey("CvePS").ToEntero)
End If
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)
Else
Exit For
End If
End If
Next
If Not TieneError Then
If UsuarioActual.Empresa.Funcionalidad(109) = "1" AndAlso sbProductos.Length > 0 Then
MensajeAlert.AppendFormat("Los precios de lista de los productos/servicios se actualizaron correctamente. <br/> <b><a target='_blank' class='Texto' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar Etiquetas</a></b>", Encripta(String.Format("OP=ETIQUETA&CVEPRECIOLISTA={0}&PRODUCTOS={1}", DdlPrecioLista.SelectedValue.ToEntero, sbProductos.ToString())))
Else
MensajeAlert.Append("Los precios de lista de los productos/servicios se actualizaron correctamente.")
End If
Alert(MensajeAlert.ToString())
End If
Catch ex As Exception
TieneError = True
GuardaLog(ex.ToString())
End Try
If TieneError Then
ObjPS.RollBack()
Alert("Ocurrió un error al actualizar precios", TipoMensaje.MsgError)
Else
ObjPS.Commit()
End If