--Porcentaje Utilidad al agregar

This commit is contained in:
2024-11-05 16:46:34 -07:00
parent ddd7ab9253
commit 0a1ea63929
2 changed files with 24 additions and 1 deletions

View File

@@ -1260,7 +1260,9 @@
<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>
<th runat="server" visible="false" id="thCosto">
<asp:Literal ID="LtlHeaderCosto" runat="server" Text=""></asp:Literal>
</th>
</tr>
</table>
<%--</asp:Panel>--%>

View File

@@ -18365,6 +18365,27 @@ Partial Class Ventas
If UsuarioActual.CveEmpresa = 189 Then
AgregarPSAutomaticamente = False
Dim PuedeVerCosto As Boolean = UsuarioActual.TienePermisoProceso(201) OrElse UsuarioActual.TienePermisoProceso(385)
Dim Costo As Decimal = 0
If (CveVenta <= 0 OrElse EsCreaApartirDe) AndAlso DdlTipoComprobante.SelectedValue = "Cot" AndAlso PuedeVerCosto Then
GvPS.Columns(23).Visible = True
thCosto.Visible = True
thCosto2.Visible = True
Dim ObjInventarios As New ClsInventarios
Costo = ObjInventarios.GetCostoPS(CvePSParametro, 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(CvePSParametro, TxtCantidad.Text.Trim.ToDecimal, -1, "-1", TxtFecha.Text.ToDate, -1, CveTipoAlmacen:=1)
ObjInventarios.Dispose()
If Costo > 0 Then
LtlHeaderCosto.Text = String.Format("{0:N2} %", ((TxtPrecio.Text.ToDecimal() - Costo) / TxtPrecio.Text.ToDecimal()) * 100D)
End If
End If
End If
If AgregarPSAutomaticamente Then