This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2020-01-06 18:28:16 -07:00
25 changed files with 1796 additions and 1219 deletions

View File

@@ -75,31 +75,30 @@ Partial Class Ventas_ActualizarPrecios
Public Sub CargaPreciosLista()
DdlPrecioLista.ITEMS.Clear
Dim ObjVta As New ClsVentas
Dim primerItem As String = ""
If ObjVta.GetPrecioListas(UsuarioActual.CveEmpresa) Then
DdlPrecioLista.DataSource = ObjVta.DtResultados.Copy()
DdlPrecioListaCarga.DataSource = ObjVta.DtResultados.Copy()
primerItem = ObjVta.DtResultados.FiltroPrimeroValor("CvePrecioLista")
End If
ObjVta.Dispose()
DdlPrecioLista.Items.Clear()
If UsuarioActual.Empresa.Funcionalidad(404).ToString = "1" Then 'si manneja precios de lista
Dim ObjVta As New ClsVentas
Dim primerItem As String = ""
If ObjVta.GetPrecioListas(UsuarioActual.CveEmpresa) Then
DdlPrecioLista.DataSource = ObjVta.DtResultados.Copy()
DdlPrecioListaCarga.DataSource = ObjVta.DtResultados.Copy()
primerItem = ObjVta.DtResultados.FiltroPrimeroValor("CvePrecioLista")
End If
ObjVta.Dispose()
DdlPrecioLista.DataBind()
DdlPrecioListaCarga.DataBind()
DdlPrecioLista.DataBind()
DdlPrecioListaCarga.DataBind()
If (DdlPrecioLista.Items.Count = 1) Then
DdlPrecioLista.Items.FindByValue(primerItem).Selected = True
End If
DdlPrecioLista.Items.Insert(0, New ListItem("Seleccione", "-1"))
If UsuarioActual.CveEmpresa.Contiene(1, 140) Then
If (DdlPrecioLista.Items.Count = 1) Then
DdlPrecioLista.Items.FindByValue(primerItem).Selected = True
End If
Else
DdlPrecioLista.Items.Insert(0, New ListItem("Sin Precio Lista", "-2"))
DdlPrecioListaCarga.Items.Insert(0, New ListItem("Sin Precio Lista", "-2"))
DdlPrecioListaCarga.Items.Insert(0, New ListItem("Sin Precio Lista", "-2"))
End If
End Sub
Public Sub CargaPS()

View File

@@ -258,7 +258,7 @@
<asp:UpdatePanel runat="server" ID="UpPorcentajeMarcas" RenderMode="Inline" UpdateMode="Conditional">
<ContentTemplate>
<li>
<asp:LinkButton ID="LnkPorcentajeMarcas" Visible="False" data-toggle="tooltip" data-placement="left" title="Condiciones Comerciales" runat="server" Text="<i class='fa fa-pencil'></i> Modificar Precio por Marca"></asp:LinkButton>
<asp:LinkButton ID="LnkPorcentajeMarcas" Visible="False" data-toggle="tooltip" data-placement="left" title="Condiciones Comerciales" runat="server" Text="<i class='fa fa-pencil'></i>Condiciones Comerciales"></asp:LinkButton>
</li>
</ContentTemplate>
</asp:UpdatePanel>

View File

@@ -261,7 +261,7 @@
<asp:UpdatePanel ID="UPVentas" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvCxC" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Cuentas por Cobrar Pendientes"
DataKeyNames="TipoDocto,CveVenta,CveCliente,SerieFolio,Original,SubTotal,IVA,IEPS,RetIVA,RetISR,Num3,CveSubProyecto,CveMoneda,Saldo,TipoCambio, RFC,UUID,Fecha,PorcentajeIVA"
DataKeyNames="TipoDocto,CveVenta,CveCliente,SerieFolio,Original,SubTotal,IVA,IEPS,RetIVA,RetISR,Num3,CveSubProyecto,CveMoneda,Saldo,TipoCambio, RFC,UUID,Fecha,PorcentajeIVA,DescuentoProntoPago"
CssClass="table table-striped table-advance table-hover Widthall" Style="text-align: center;" GridLines="None">
<Columns>
<asp:TemplateField>
@@ -338,6 +338,12 @@
<asp:RangeValidator ID="RVComision" runat="server" Enabled="false" ErrorMessage="*" ControlToValidate="TxtComision" Display="Dynamic" Type="Double"></asp:RangeValidator>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false" ItemStyle-HorizontalAlign="Center">
<HeaderTemplate>Descuento Pronto Pago</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlDescuentoProntoPago" runat="server" Text='<%# Eval("DescuentoProntoPago", "{0:N2}") %>'></asp:Literal>&nbsp;
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="300px">
<HeaderTemplate>Auxiliar</HeaderTemplate>
<ItemTemplate>

View File

@@ -445,16 +445,22 @@ Partial Class Ventas_ClientesAbonar
Dim FechaCorte As Date = IIf(CveIESustitucion > 0, (FechaCorteIE.ToDate).ToShortDateString, DateTime.Now.AddYears(1).ToShortDateString).ToString.ToDate
Dim SumDescuentoProntoPago As Double = 0.0
If Mov.GetCxCClienteDetalle(ViewState("CveCliente").ToString.ToEntero, FechaI, FechaF, pCveMoneda, CveSubProyecto, UsuarioActual.CveEmpresa, CveClienteSucursal, FechaCorte:=FechaCorte, CveIESustitucion:=CveIESustitucion) Then
Dim TmpCxCAux As DataTable
TmpCxCAux = Mov.DtResultados.FiltraParametros("Saldo > 0", "Fecha,SerieFolio")
SumDescuentoProntoPago = TmpCxCAux.SUM("DescuentoProntoPago")
GvCxC.DataSource = Mov.DtResultados.FiltraParametros("Saldo > 0", "Fecha,SerieFolio")
GvCxC.DataBind()
CveMoneda = pCveMoneda
End If
End If
TxtImporte.Text = ""
TxtObservaciones.Text = ""
If SumDescuentoProntoPago > 0.0 Then
GvCxC.Columns("DescuentoProntoPago").Visible = True
End If
Mov.Dispose()
UPVentas.Update()
@@ -608,8 +614,7 @@ Partial Class Ventas_ClientesAbonar
e.Row.FCCheckBox("Chk").Attributes.Add("onclick", String.Format("FnSuma(this,{0},{1}); FnCambia({2},this,{1},0,{3},{4});", e.Row.FCTextBox("TxtAbonar").ClientID, e.Row.DBCampo("Saldo"), e.Row.FCCheckBox("Chk").ClientID, CveMonedaFiltro, moneda))
If Not UsuarioActual.Empresa.Funcionalidad(536) = "1" Then
'si es remisión y factura no timbrada
If e.Row.DBCampo("TipoDocto") = "Rem" OrElse (e.Row.DBCampo("TipoDocto") = "Ing" AndAlso e.Row.DBCampo("FolioFiscal") = "") Then
If e.Row.DBCampo("TipoDocto") = "Rem" Then
e.Row.FCCheckBox("Chk").Visible = False ' que no se pueda pagar si es remisión
e.Row.Cells(0).ToolTip = "El documento es remisión y no se puede realizar el pago"
End If
@@ -872,6 +877,7 @@ Partial Class Ventas_ClientesAbonar
CveVentasPago.Add(gvr.DataKey("CveVenta").ToEntero)
SeriesPago.Add(gvr.DataKey("SerieFolio"))
Dim tipoCambioVentaDiferenciaCambiaria As Double = 1
Dim EsAnticipoEspecial As Boolean = False
If gvr.DataKey("TipoDocto") = "Ant" AndAlso UsuarioActual.CveEmpresa.Contiene(1, 119) Then EsAnticipoEspecial = True
@@ -1243,7 +1249,7 @@ Partial Class Ventas_ClientesAbonar
If CveMoneda <> 1 OrElse gvr.DataKey("CveMoneda").ToEntero <> 1 Then
IdCtaContable = UsuarioActual.Empresa.IdCuentaGananciaCambiaria
CveCuenta = UsuarioActual.Empresa.CveCuentaGananciaCambiaria
tipoCambioVentaDiferenciaCambiaria = If(gvr.DataKey("Fecha").ToDate < FechaUltimaFluctuacion, TipoCambioFluctuacion, gvr.DataKey("TipoCambio").ToDecimal)
Dim TCImpuestos As Decimal = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta)
@@ -1281,7 +1287,7 @@ Partial Class Ventas_ClientesAbonar
If CveMoneda <> 1 OrElse gvr.DataKey("CveMoneda").ToEntero <> 1 Then
IdCtaContable = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria
CveCuenta = UsuarioActual.Empresa.CveCuentaPerdidaCambiaria
tipoCambioVentaDiferenciaCambiaria = If(gvr.DataKey("Fecha").ToDate < FechaUltimaFluctuacion, TipoCambioFluctuacion, gvr.DataKey("TipoCambio").ToDecimal)
Dim TCImpuestos As Decimal = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta)
Dim Diferencia As Decimal = ((gvr.FCTextBox("TxtAbonar").Text.ToDecimal) * tipoCambioVentaValuacion) - ((gvr.FCTextBox("TxtAbonar").Text.ToDecimal) * tipoCambioPago) 'Añadimos la diferencia de perdida en la venta

View File

@@ -5965,7 +5965,7 @@
</div>
<%--APLICAR REMISIONES DE NC--%>
<div id="ModalAplicarRemisionesNC" class="modal ADS fade" role="dialog">
<asp:UpdatePanel ID="UpModalRemisionesNC" class="modal-dialog rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
<asp:UpdatePanel ID="UpModalRemisionesNC" class="modal-dialog rowpadding modal-lg" tabindex="-1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content">
<div class="modal-header">
@@ -5988,6 +5988,7 @@
</ItemTemplate>
</asp:TemplateField>
<asp:HyperLinkField DataNavigateUrlFields="CveVenta" Target="_blank" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" DataTextField="Folio" HeaderText="Folio" ItemStyle-Width="150px" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Observaciones" DataField="Observaciones" />
<asp:BoundField HeaderText="Fecha" DataField="Fecha" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" />
<asp:TemplateField HeaderText="Total" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>

View File

@@ -5840,9 +5840,9 @@ Partial Class Ventas
If Not EsValido Then
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}</b> <br/>", Costo)
MensajeCosto.AppendFormat("El rango menor aceptado es: {0}% <b>${1}</b> <br/>", UsuarioActual.Empresa.Funcionalidad(129).ToEntero, CostoMenor)
MensajeCosto.AppendFormat("El precio indicado es: <b>${0}</b> ({1}% de ganancia) <br/>", PU.FormatoNumero, (If(Costo > 0, ((PU - Costo) * 100) / Costo, 0)).FormatoNumero)
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 precio indicado es: <b>${0:#,###.00}</b> ({1}% de ganancia) <br/>", PU.FormatoNumero, (If(Costo > 0, ((PU - Costo) * 100) / Costo, 0)).FormatoNumero)
End If
@@ -5855,9 +5855,9 @@ Partial Class Ventas
If Not EsValidoMayor Then
MensajeCosto.AppendFormat("El Producto <b>{0}</b>. No se puede vender a un precio mayor de su rango aceptado<br/>", HdnPS.Value)
If TienePermisoImportes Then
MensajeCosto.AppendFormat("El costo del producto es: <b>${0}</b> <br/>", Costo)
MensajeCosto.AppendFormat("El rango mayor aceptado es: {0}% <b>${1}</b> <br/>", UsuarioActual.Empresa.Funcionalidad(133).ToEntero, CostoMayor)
MensajeCosto.AppendFormat("El precio indicado es: <b>${0}</b> ({1}% de ganancia) <br/>", PU.FormatoNumero, (If(Costo > 0, ((PU - Costo) * 100) / Costo, 0)).FormatoNumero)
MensajeCosto.AppendFormat("El costo del producto es: <b>${0:#,###.00}</b> <br/>", Costo)
MensajeCosto.AppendFormat("El rango mayor aceptado es: {0}% <b>${1:#,###.00}</b> <br/>", UsuarioActual.Empresa.Funcionalidad(133).ToEntero, CostoMayor)
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
Alert(MensajeCosto.ToString, TipoMensaje.MsgAdvertencia)
e.Cancel = True
@@ -6422,18 +6422,18 @@ 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}$</b> <br/>", Costo)
MensajeCosto.AppendFormat("El rango menor aceptado es: {0} <b>{1}$</b> <br/>", UsuarioActual.Empresa.Funcionalidad(129).ToEntero, CostoMenor)
MensajeCosto.AppendFormat("El precio indicado es: <b>{0}$</b> ({1}% de ganancia) <br/>", PU.FormatoNumero, If(Costo > 0, ((PU - Costo) * 100) / Costo, 0))
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 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
If Not EsValidoMayor Then
MensajeCosto.AppendFormat("El Producto <b>{0}</b>. No se puede vender a un precio mayor de su rango aceptado<br/>", dr("PS").ToString)
If TienePermisoImportes Then
MensajeCosto.AppendFormat("El costo del producto es: <b>{0}$</b> <br/>", Costo)
MensajeCosto.AppendFormat("El rango mayor aceptado es: {0} <b>{1}$</b> <br/>", UsuarioActual.Empresa.Funcionalidad(133).ToEntero, CostoMayor)
MensajeCosto.AppendFormat("El precio indicado es: <b>{0}$</b> ({1}% de ganancia) <br/>", PU.FormatoNumero, If(Costo > 0, ((PU - Costo) * 100) / Costo, 0))
MensajeCosto.AppendFormat("El costo del producto es: <b>{0:#,###.00}$</b> <br/>", Costo)
MensajeCosto.AppendFormat("El rango mayor aceptado es: {0} <b>{1:#,###.00}$</b> <br/>", UsuarioActual.Empresa.Funcionalidad(133).ToEntero, CostoMayor)
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
@@ -6454,6 +6454,27 @@ Partial Class Ventas
End If
End If
'Valida si en caso de que el detalle tenga llantas o polizas se agreguén kilometraje/serie en la parte de observaciones(solo para el caso de empresas llanteras)
If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
If TxtObsFact.Text = "" Then
Dim FaltaObservacion As Integer = -1
For Each PS As GridViewRow In GvPS.Rows
Dim PsRenglon As GridViewRow = PS
Dim CveClasificacion As Integer = PsRenglon.DataKey("CveClasificacion").ToEntero
If CveClasificacion = 20345 Or CveClasificacion = 20342 Then
FaltaObservacion = CveClasificacion
Exit For
End If
Next
If FaltaObservacion = 20345 Then
Alert("No se ha especificado la <strong>serie</strong> para la poliza en la sección de Observaciones", TipoMensaje.MsgAdvertencia)
Exit Sub
ElseIf FaltaObservacion = 20342 Then
Alert("No se ha especificado el <strong>kilometraje</strong> para la llanta en el sección de Observaciones", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
End If
If UsuarioActual.Empresa.Funcionalidad(135) = "1" And DdlTipoComprobante.SelectedValue = "Cot" Then
Alert("Se mando autorización al supervisor.", TipoMensaje.MsgInformacion)
@@ -6494,6 +6515,7 @@ Partial Class Ventas
End If
EmitirImprimirNew()
End Sub
#End Region
@@ -10658,7 +10680,7 @@ Partial Class Ventas
If GvInv.Rows.Cast(Of GridViewRow)().Count(Function(gvr) gvr.FCCheckBox("cbInv").Checked) > 0 Then
Dim CveAlmacen = ddlAlmacen.SelectedValue.ToEntero
Dim CveMovimientoInventario As Integer = ObjInventario.AddMovimiento(CveAlmacen, 3, factura.CveMoneda, factura.Fecha, -1, factura.CveUsuario, factura.CveEmpresa, -1, factura.CveVenta, -1, -1, Modulo:="Vta/E")
Dim CveMovimientoInventario As Integer = ObjInventario.AddMovimiento(CveAlmacen, 3, factura.CveMoneda, factura.Fecha, -1, factura.CveUsuario, factura.CveEmpresa, -1, factura.CveVenta, -1, -1, Modulo:="Vta/E1")
If CveMovimientoInventario <= 0 Then
OcurrioError = True
@@ -12667,8 +12689,8 @@ Partial Class Ventas
Dim Fecha As Date = Now
'Creamos el movimiento de entrada y el movimiento de salida
Dim CveMovimientoInventarioEntrada As Integer = ObjInventario.AddMovimiento(CveAlmacen, 18, CveMoneda, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveDevolucion, -1, -1, MovimientoFijo:=True, Modulo:="Vta/E")
Dim CveMovimientoInventarioSalida As Integer = ObjInventario.AddMovimiento(CveAlmacen, 3, CveMoneda, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaNueva, -1, -1, MovimientoFijo:=True, Modulo:="Vta/E")
Dim CveMovimientoInventarioEntrada As Integer = ObjInventario.AddMovimiento(CveAlmacen, 18, CveMoneda, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveDevolucion, -1, -1, MovimientoFijo:=True, Modulo:="Vta/E2")
Dim CveMovimientoInventarioSalida As Integer = ObjInventario.AddMovimiento(CveAlmacen, 3, CveMoneda, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaNueva, -1, -1, MovimientoFijo:=True, Modulo:="Vta/E3")
If CveMovimientoInventarioEntrada > 0 AndAlso CveMovimientoInventarioSalida > 0 Then
@@ -13065,7 +13087,7 @@ Partial Class Ventas
Dim PorcentajePrecio As Double = 0
If PrecioSugerido = 0 Then
CvePrecioListaPS = GlobalDTCliente(UsuarioActual.CveEmpresa, -1).FiltroPrimeroValor("CvePrecioLista", $"CveCliente = {CveCliente}").ToEntero
CvePrecioListaPS = GlobalDTCliente(UsuarioActual.CveEmpresa, Estatus:=-1, CveCliente:=CveCliente).FiltroPrimeroValor("CvePrecioLista").ToEntero
If CvePrecioListaPS > 0 Then
Dim ObjPS As New ClsProductosServicios
If ObjPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, CvePrecioListaPS, CvePS:=CvePSParametro) Then
@@ -13089,13 +13111,16 @@ Partial Class Ventas
End If
Dim PrecioBaseCosto As Decimal = 0
Dim ObjClasificaciones As New ClsClasificaciones
If ObjClasificaciones.GetClasificaciones() Then
PrecioBaseCosto = ObjClasificaciones.DtResultados.FiltroPrimeroValor("PrecioBaseCosto", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveClasificacion = {drPS("CveClasificacion")}").ToDecimal
End If
'Dim ObjClasificaciones As New ClsClasificaciones
'If ObjClasificaciones.GetClasificaciones() Then
' PrecioBaseCosto = ObjClasificaciones.DtResultados.FiltroPrimeroValor("PrecioBaseCosto", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveClasificacion = {drPS("CveClasificacion")}").ToDecimal
'End If
If PrecioSugerido > 0 Then
Dim PrecioBaseCosto As Decimal = 0
PrecioBaseCosto = GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveClasificacion:=drPS("CveClasificacion").ToString.ToEntero).FiltroPrimeroValor("PrecioBaseCosto", "").ToDecimal
If PrecioBaseCosto > 0 Then
PrecioSugerido = PrecioSugerido * ((PrecioBaseCosto / 100) + 1)
End If
@@ -13733,11 +13758,11 @@ Partial Class Ventas
Dim MensajeCosto As New StringBuilder
Dim TienePermisoImportes As Boolean = UsuarioActual.TienePermisoProceso(201)
If Not EsValido Then
MensajeCosto.AppendFormat("El Producto <b>{0}</b>. No se puede vender a un precio menor de su Costo <br/>", HdnPS.Value)
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}</b> <br/>", Costo)
MensajeCosto.AppendFormat("El rango menor aceptado es: {0}% <b>${1}</b> <br/>", UsuarioActual.Empresa.Funcionalidad(129).ToEntero, CostoMenor)
MensajeCosto.AppendFormat("El precio indicado es: <b>${0}</b> ({1}% de ganancia) <br/>", PU.FormatoNumero, (If(Costo > 0, ((PU - Costo) * 100) / Costo, 0)).FormatoNumero)
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 precio indicado es: <b>${0:#,###.00}</b> ({1}% de ganancia) <br/>", PU.FormatoNumero, (If(Costo > 0, ((PU - Costo) * 100) / Costo, 0)).FormatoNumero)
End If
Alert(String.Format(MensajeCosto.ToString), TipoMensaje.MsgAdvertencia)
@@ -13748,9 +13773,9 @@ Partial Class Ventas
If Not EsValidoMayor Then
MensajeCosto.AppendFormat("El Producto <b>{0}</b>. No se puede vender a un precio mayor de su rango aceptado<br/>", HdnPS.Value)
If TienePermisoImportes Then
MensajeCosto.AppendFormat("El costo del producto es: <b>${0}</b> <br/>", Costo)
MensajeCosto.AppendFormat("El rango mayor aceptado es: {0}% <b>${1}</b> <br/>", UsuarioActual.Empresa.Funcionalidad(133).ToEntero, CostoMayor)
MensajeCosto.AppendFormat("El precio indicado es: <b>${0}</b> ({1}% de ganancia) <br/>", PU.FormatoNumero, (If(Costo > 0, ((PU - Costo) * 100) / Costo, 0)).FormatoNumero)
MensajeCosto.AppendFormat("El costo del producto es: <b>${0:#,###.00}</b> <br/>", Costo)
MensajeCosto.AppendFormat("El rango mayor aceptado es: {0}% <b>${1:#,###.00}</b> <br/>", UsuarioActual.Empresa.Funcionalidad(133).ToEntero, CostoMayor)
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
Alert(MensajeCosto.ToString, TipoMensaje.MsgAdvertencia)
Return False
@@ -15320,24 +15345,25 @@ Partial Class Ventas
If ErrorList.Count = 0 AndAlso MovDetalle.Rows.Count > 0 Then
Dim CveMovimientoSalidaPorTraspaso As Integer = -1
Dim CveConceptoSalidaAlmacen As Integer = 3
'SALIDA DEFINITIVA DEL SISTEMA
If UsuarioActual.Empresa.Funcionalidad(575) = "1" Then
'Le damos salida normal
If ConSalida Then
GeneroMovimientoAlmacen = GenerarMovimientoAlmacen(ObjInventario, MovDetalle, CveAlmacenSalida, 40, CveMoneda, CveRemision, AplicaMovimientoDetalleEntrada:=AplicaMovimientoDetalleEntrada, MovimientoPrePoliza:=True, ObjConta:=ObjConta) > 0
CveConceptoSalidaAlmacen = 40
''Le damos salida normal
'If ConSalida Then
' GeneroMovimientoAlmacen = GenerarMovimientoAlmacen(ObjInventario, MovDetalle, CveAlmacenSalida, 40, CveMoneda, CveVenta, AplicaMovimientoDetalleEntrada:=AplicaMovimientoDetalleEntrada, MovimientoPrePoliza:=True, ObjConta:=ObjConta) > 0
If Not GeneroMovimientoAlmacen Then
OcurrioError = True
Exit For
End If
' If Not GeneroMovimientoAlmacen Then
' OcurrioError = True
' Exit For
' End If
If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then
If Not GeneroMovimientoAlmacen Then
OcurrioError = Not GenerarMovimientoAlmacenVirtual(CveRemision, ObjInventario, ObjFactura)
End If
End If
End If
' If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then
' If Not GeneroMovimientoAlmacen Then
' OcurrioError = Not GenerarMovimientoAlmacenVirtual(CveRemision, ObjInventario, ObjFactura)
' End If
' End If
'End If
Else
'Le damos salida de apartado por traspaso
CveMovimientoSalidaPorTraspaso = GenerarMovimientoAlmacen(ObjInventario, MovDetalle, CveAlmacenSalida, 8, CveMoneda, CveRemision, AplicaMovimientoDetalleEntrada:=AplicaMovimientoDetalleEntrada)
@@ -15357,23 +15383,24 @@ Partial Class Ventas
End If
End If
'Le damos salida normal
If ConSalida AndAlso Not OcurrioError Then
If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then
OcurrioError = Not GenerarMovimientoAlmacenVirtual(CveRemision, ObjInventario, ObjFactura)
End If
If Not OcurrioError Then
GeneroMovimientoAlmacen = GenerarMovimientoAlmacen(ObjInventario, MovDetalle, CveAlmacenEntrada, 3, CveMoneda, ObjFactura.CveVenta, MovimientoPrePoliza:=True, ObjConta:=ObjConta) > 0
If Not GeneroMovimientoAlmacen Then
OcurrioError = True
Exit For
End If
End If
End If
'Le damos salida normal
If ConSalida AndAlso Not OcurrioError Then
If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then
OcurrioError = Not GenerarMovimientoAlmacenVirtual(CveRemision, ObjInventario, ObjFactura)
End If
If Not OcurrioError Then
GeneroMovimientoAlmacen = GenerarMovimientoAlmacen(ObjInventario, MovDetalle, CveAlmacenEntrada, CveConceptoSalidaAlmacen, CveMoneda, ObjFactura.CveVenta, MovimientoPrePoliza:=True, ObjConta:=ObjConta) > 0
If Not GeneroMovimientoAlmacen Then
OcurrioError = True
Exit For
End If
End If
End If
Else
@@ -15493,7 +15520,7 @@ Partial Class Ventas
'Creamos el movimiento
Dim CveMovimientoInventario As Integer = ObjInventario.AddMovimiento(CveAlmacen, ConceptoEntrada, CveMoneda, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta, -1, -1,
CveMovimientoRelacionado:=CveMovimientoRelacionado, Modulo:="Vta/E")
CveMovimientoRelacionado:=CveMovimientoRelacionado, Modulo:="Vta/E4")
If CveMovimientoInventario > 0 Then
@@ -15518,7 +15545,7 @@ Partial Class Ventas
'COMIENZA: VENTADETALLE
'CUANDO SEA SALIDA VA POR LA VENTA DETALLE DE LA FACTURA DE LA REMISION - OJO!! SOLO FUNCIONA HASTA ORITA QUE SE HACE SALIDA SOLO CUANDO SE FACTURA LA REMISION
Dim CveVentaDetalle = If(ConceptoEntrada = 3, TmpDT.FiltroPrimeroValor("CveVentaDetalle", $"Consec={Consec}").ToEntero, MovDet("CveVentaDetalle").ToString.ToEntero)
Dim CveVentaDetalle = If(ConceptoEntrada.Contiene(3, 40), TmpDT.FiltroPrimeroValor("CveVentaDetalle", $"Consec={Consec}").ToEntero, MovDet("CveVentaDetalle").ToString.ToEntero)
'CUANDO LA VENTADETALLE NO TENGA VALOR DEBE MARCAR ERROR, NUEVA RESTRICCION DE ALMACEN
If CveVentaDetalle < 0 Then
Alert("no se encontro la venta detalle. Por favor comuniquese con atención SIG.", TipoMensaje.ToastError)
@@ -19422,7 +19449,7 @@ Partial Class Ventas
'MOVIMIENTO DE SALIDA POR TRASPASO DEL ALMACEN DE CONSIGNACION
CveMovimientoSalidaConsignacion = ObjInventario.AddMovimiento(CveAlmacenExistenciasContrato, 8, 1, factura.Fecha, -1, factura.CveUsuario, factura.CveEmpresa, -1, factura.CveVenta, -1, -1, Modulo:="Vta/E")
CveMovimientoSalidaConsignacion = ObjInventario.AddMovimiento(CveAlmacenExistenciasContrato, 8, 1, factura.Fecha, -1, factura.CveUsuario, factura.CveEmpresa, -1, factura.CveVenta, -1, -1, Modulo:="Vta/E5")
If CveMovimientoSalidaConsignacion > 0 Then
Dim CveProducto As Integer
Dim CveUnidad As Integer
@@ -19465,7 +19492,7 @@ Partial Class Ventas
'ENTRADA POR TRASPASO A GENERAL
CveMovimientoEntradaGeneral = ObjInventario.AddMovimiento(CveAlmacenOrigenContrato, 9, 1, factura.Fecha, -1, factura.CveUsuario, factura.CveEmpresa, -1, factura.CveVenta, -1, -1, CveMovimientoRelacionado:=CveMovimientoSalidaConsignacion, Modulo:="Vta/E")
CveMovimientoEntradaGeneral = ObjInventario.AddMovimiento(CveAlmacenOrigenContrato, 9, 1, factura.Fecha, -1, factura.CveUsuario, factura.CveEmpresa, -1, factura.CveVenta, -1, -1, CveMovimientoRelacionado:=CveMovimientoSalidaConsignacion, Modulo:="Vta/E6")
If CveMovimientoEntradaGeneral > 0 Then
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalidaConsignacion, UsuarioActual.CveEmpresa) Then
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
@@ -19479,7 +19506,7 @@ Partial Class Ventas
End If
'SALIDA GENERAL
CveMovimientoEntradaGeneral = ObjInventario.AddMovimiento(CveAlmacenOrigenContrato, 3, 1, factura.Fecha, -1, factura.CveUsuario, factura.CveEmpresa, -1, factura.CveVenta, -1, -1, Modulo:="Vta/E")
CveMovimientoEntradaGeneral = ObjInventario.AddMovimiento(CveAlmacenOrigenContrato, 3, 1, factura.Fecha, -1, factura.CveUsuario, factura.CveEmpresa, -1, factura.CveVenta, -1, -1, Modulo:="Vta/E7")
If CveMovimientoEntradaGeneral > 0 Then
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalidaConsignacion, UsuarioActual.CveEmpresa) Then
For Each Dr As DataRow In ObjInventario.DtResultados.Rows