This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2020-03-21 13:02:10 -07:00
18 changed files with 359 additions and 279 deletions

View File

@@ -1899,7 +1899,8 @@ Public Class ClsVentas
End Function End Function
#Region " PROMOCIONES " #Region " PROMOCIONES "
Public Function GetPromociones(CvePromocion As Integer, Fecha As String, CveVendedor As Integer, CveCliente As Integer, Estatus As Integer, CveEmpresa As Integer, CveSubProyecto As Integer) As Boolean Public Function GetPromociones(CvePromocion As Integer, Fecha As String, CveVendedor As Integer, CveCliente As Integer, Estatus As Integer, CveEmpresa As Integer,
CveSubProyecto As Integer, Optional CveMarca As Integer = -1) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Vta_PromocionesGet") DataAdapter("PA_Vta_PromocionesGet")
@@ -1911,6 +1912,7 @@ Public Class ClsVentas
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente .Add("@CveCliente", SqlDbType.Int).Value = CveCliente
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@CveMarca", SqlDbType.Int).Value = CveMarca
End With End With
Try Try
@@ -1922,7 +1924,9 @@ Public Class ClsVentas
Return Retorno Return Retorno
End Function End Function
Public Function AddPromociones(Promocion As String, FechaInicio As Date, FechaFin As Date, CveVendedor As Integer, CveCliente As Integer, Estatus As Boolean, CveMoneda As Integer, CveUsuario As Integer, CveEmpresa As Integer, CveSubProyecto As Integer, TipoAplicacion As String) As Integer Public Function AddPromociones(Promocion As String, FechaInicio As Date, FechaFin As Date, CveVendedor As Integer, CveCliente As Integer, Estatus As Boolean,
CveMoneda As Integer, CveUsuario As Integer, CveEmpresa As Integer, CveSubProyecto As Integer, TipoAplicacion As String,
Optional CveMarca As Integer = -1) As Integer
Dim Retorno = -1 Dim Retorno = -1
DataAdapter("PA_Vta_PromocionesAdd") DataAdapter("PA_Vta_PromocionesAdd")
@@ -1939,6 +1943,7 @@ Public Class ClsVentas
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@TipoAplicacion", SqlDbType.VarChar).Value = TipoAplicacion .Add("@TipoAplicacion", SqlDbType.VarChar).Value = TipoAplicacion
.Add("@CveMarca", SqlDbType.Int).Value = CveMarca
.Add("@CvePromocion", SqlDbType.Int).Direction = ParameterDirection.Output .Add("@CvePromocion", SqlDbType.Int).Direction = ParameterDirection.Output
End With End With
@@ -1951,7 +1956,8 @@ Public Class ClsVentas
Return Retorno Return Retorno
End Function End Function
Public Function UpdatePromociones(Promocion As String, FechaInicio As Date, FechaFin As Date, CveVendedor As Integer, CveCliente As Integer, Estatus As Boolean, CveMoneda As Integer, CveUsuario As Integer, CvePromocion As Integer, CveSubProyecto As Integer) As Boolean Public Function UpdatePromociones(Promocion As String, FechaInicio As Date, FechaFin As Date, CveVendedor As Integer, CveCliente As Integer, Estatus As Boolean,
CveMoneda As Integer, CveUsuario As Integer, CvePromocion As Integer, CveSubProyecto As Integer, Optional CveMarca As Integer = -1) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Vta_PromocionesUpdate") DataAdapter("PA_Vta_PromocionesUpdate")
@@ -1967,6 +1973,7 @@ Public Class ClsVentas
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CvePromocion", SqlDbType.Float).Value = CvePromocion .Add("@CvePromocion", SqlDbType.Float).Value = CvePromocion
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@CveMarca", SqlDbType.Int).Value = CveMarca
End With End With
Try Try
@@ -2043,7 +2050,7 @@ Public Class ClsVentas
Public Function AddPromocionesDetalle(CvePromocion As Integer, CvePS As Integer, TipoPromocion As Integer, Promocion As Double, PUAnterior As Double, PUPromocion As Double, Public Function AddPromocionesDetalle(CvePromocion As Integer, CvePS As Integer, TipoPromocion As Integer, Promocion As Double, PUAnterior As Double, PUPromocion As Double,
AplicaRestriccion As Boolean, AplicaLunes As Boolean, AplicaMartes As Boolean, AplicaMiercoles As Boolean, AplicaJueves As Boolean, AplicaRestriccion As Boolean, AplicaLunes As Boolean, AplicaMartes As Boolean, AplicaMiercoles As Boolean, AplicaJueves As Boolean,
AplicaViernes As Boolean, AplicaSabado As Boolean, AplicaDomingo As Boolean, HoraInicio As DateTime, HoraFin As DateTime, Optional CantidadMinima As Integer = 1, AplicaViernes As Boolean, AplicaSabado As Boolean, AplicaDomingo As Boolean, HoraInicio As DateTime, HoraFin As DateTime, Optional CantidadMinima As Integer = 1,
Optional CveClasificacion As Integer = -1) As Boolean Optional CveClasificacion As Integer = -1, Optional CveRinTamaño As Integer = -1) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Vta_PromocionesDetalleAdd") DataAdapter("PA_Vta_PromocionesDetalleAdd")
@@ -2067,6 +2074,7 @@ Public Class ClsVentas
.Add("@HoraFin", SqlDbType.DateTime).Value = HoraFin .Add("@HoraFin", SqlDbType.DateTime).Value = HoraFin
.Add("@CantidadMinima", SqlDbType.Int).Value = CantidadMinima .Add("@CantidadMinima", SqlDbType.Int).Value = CantidadMinima
.Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion
.Add("@CveRinTamaño", SqlDbType.Int).Value = CveRinTamaño
End With End With
Try Try
@@ -2081,7 +2089,7 @@ Public Class ClsVentas
Public Function UpdatePromocionesDetalle(CvePromocionDetalle As Integer, CvePromocion As Integer, CvePS As Integer, TipoPromocion As Integer, Promocion As Double, PUAnterior As Double, Public Function UpdatePromocionesDetalle(CvePromocionDetalle As Integer, CvePromocion As Integer, CvePS As Integer, TipoPromocion As Integer, Promocion As Double, PUAnterior As Double,
PUPromocion As Double, AplicaRestriccion As Boolean, AplicaLunes As Boolean, AplicaMartes As Boolean, AplicaMiercoles As Boolean, PUPromocion As Double, AplicaRestriccion As Boolean, AplicaLunes As Boolean, AplicaMartes As Boolean, AplicaMiercoles As Boolean,
AplicaJueves As Boolean, AplicaViernes As Boolean, AplicaSabado As Boolean, AplicaDomingo As Boolean, HoraInicio As DateTime, HoraFin As DateTime, AplicaJueves As Boolean, AplicaViernes As Boolean, AplicaSabado As Boolean, AplicaDomingo As Boolean, HoraInicio As DateTime, HoraFin As DateTime,
Optional CantidadMinima As Integer = 1, Optional CveClasificacion As Integer = -1) As Boolean Optional CantidadMinima As Integer = 1, Optional CveClasificacion As Integer = -1, Optional CveRinTamaño As Integer = -1) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Vta_PromocionesDetalleUpdate") DataAdapter("PA_Vta_PromocionesDetalleUpdate")
@@ -2106,6 +2114,7 @@ Public Class ClsVentas
.Add("@CvePromocionDetalle", SqlDbType.Int).Value = CvePromocionDetalle .Add("@CvePromocionDetalle", SqlDbType.Int).Value = CvePromocionDetalle
.Add("@CantidadMinima", SqlDbType.Int).Value = CantidadMinima .Add("@CantidadMinima", SqlDbType.Int).Value = CantidadMinima
.Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion
.Add("@CveRinTamaño", SqlDbType.Int).Value = CveRinTamaño
End With End With
Try Try
@@ -4290,7 +4299,7 @@ Public Class ClsVentas
End Try End Try
Return retorno Return retorno
End Function End Function
Public Function AddMetasVendedores(CveVendedor As Integer, MesAño As Date, CveMarca As Integer, MetaCantidad As Integer, MetaImporte As Decimal, CveClasificacion As Integer) As Boolean Public Function AddMetasVendedores(CveVendedor As Integer, MesAño As Date, CveMarca As Integer, MetaCantidad As Integer, MetaImporte As Decimal, CveClasificacion As Integer, CveClasificacionSup As Integer) As Boolean
Dim retorno As Boolean = False Dim retorno As Boolean = False
DataAdapter("PA_Vta_MetasVendedoresAdd", CommandType.StoredProcedure) DataAdapter("PA_Vta_MetasVendedoresAdd", CommandType.StoredProcedure)
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
@@ -4300,6 +4309,7 @@ Public Class ClsVentas
.Add("@MetaCantidad", SqlDbType.Int).Value = MetaCantidad .Add("@MetaCantidad", SqlDbType.Int).Value = MetaCantidad
.Add("@MetaImporte", SqlDbType.Decimal).Value = MetaImporte .Add("@MetaImporte", SqlDbType.Decimal).Value = MetaImporte
.Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion
.Add("@CveClasificacionSup", SqlDbType.Int).Value = CveClasificacionSup
End With End With
Try Try
SqlAdapter.Fill(Data) SqlAdapter.Fill(Data)
@@ -4338,7 +4348,7 @@ Public Class ClsVentas
Return retorno Return retorno
End Function End Function
Public Function UpdateMetasVendedores(CveMeta As Integer, CveVendedor As Integer, MesAño As String, CveMarca As Integer, MetaCantidad As Integer, MetaImporte As Decimal, Public Function UpdateMetasVendedores(CveMeta As Integer, CveVendedor As Integer, MesAño As String, CveMarca As Integer, MetaCantidad As Integer, MetaImporte As Decimal,
CveClasificacion As Integer) As Boolean CveClasificacion As Integer, CveClasificacionSup As Integer) As Boolean
Dim retorno As Boolean = False Dim retorno As Boolean = False
DataAdapter("PA_Vta_MetasVendedoresUpdate", CommandType.StoredProcedure) DataAdapter("PA_Vta_MetasVendedoresUpdate", CommandType.StoredProcedure)
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
@@ -4349,6 +4359,7 @@ Public Class ClsVentas
.Add("@MetaCantidad", SqlDbType.Int).Value = MetaCantidad .Add("@MetaCantidad", SqlDbType.Int).Value = MetaCantidad
.Add("@MetaImporte", SqlDbType.Decimal).Value = MetaImporte .Add("@MetaImporte", SqlDbType.Decimal).Value = MetaImporte
.Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion
.Add("@CveClasificacionSup", SqlDbType.Int).Value = CveClasificacionSup
End With End With
Try Try
SqlAdapter.Fill(Data) SqlAdapter.Fill(Data)

View File

@@ -76,7 +76,6 @@ Public Class MyhubUserIdProvider
Private Function IUserIdProvider_GetUserId(request As IRequest) As String Implements IUserIdProvider.GetUserId Private Function IUserIdProvider_GetUserId(request As IRequest) As String Implements IUserIdProvider.GetUserId
Dim userId = Decripta(request.User.Identity.Name) 'MyCustomUserClass.FindUserId(request.User.Identity.Name) Dim userId = Decripta(request.User.Identity.Name) 'MyCustomUserClass.FindUserId(request.User.Identity.Name)
GuardaLog(String.Format("userId:{0}", userId))
Return userId.ToString() Return userId.ToString()
End Function End Function
End Class End Class

View File

@@ -33,8 +33,8 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState
If Not GetEventos(CveUsuario, CveEmpresa, FI, FF) Then If Not GetEventos(CveUsuario, CveEmpresa, FI, FF) Then
'Convierte el objeto de Eventos en JSON 'Convierte el objeto de Eventos en JSON
Dim oSerializer As System.Web.Script.Serialization.JavaScriptSerializer = New System.Web.Script.Serialization.JavaScriptSerializer 'Dim oSerializer As System.Web.Script.Serialization.JavaScriptSerializer = New System.Web.Script.Serialization.JavaScriptSerializer
Dim sJSON As String = oSerializer.Serialize(events) Dim sJSON As String = Newtonsoft.Json.JsonConvert.SerializeObject(events)
context.Response.Write(sJSON) context.Response.Write(sJSON)
End If End If

View File

@@ -363,7 +363,7 @@ Public Class SIGGPS : Implements IHttpHandler, IRequiresSessionState
strBody.Append("</tr>") strBody.Append("</tr>")
End If End If
strBody.Append("<tr>") strBody.Append("<tr>")
strBody.Append("<td style=""width: 187px;"" colspan=""3""><img src=""https://maps.googleapis.com/maps/api/staticmap?size=700x340&amp;zoom=14&amp;center=20.5269,-100.868&amp;path=&amp;markers=icon:http://gps.signalsgps.com/Imagenes/rsz_11rsz_car.png|20.5269,-100.868&amp;sensor=false&amp;key=AIzaSyAF7s8wwhzCVXDUYopc9mXxqaWB33cDro4"" /></td>") strBody.AppendFormat("<td style=""width: 187px;"" colspan=""3""><img src=""{0}"" /></td>", Row("Liga"))
strBody.Append("</tr>") strBody.Append("</tr>")
strBody.Append("</tbody>") strBody.Append("</tbody>")
strBody.Append("</table>") strBody.Append("</table>")

View File

@@ -129,7 +129,7 @@
<asp:TemplateField> <asp:TemplateField>
<ItemTemplate> <ItemTemplate>
<asp:Panel ID="PnlDetalleCompras" runat="server" CssClass="Texto"> <asp:Panel ID="PnlDetalleCompras" runat="server" CssClass="Texto">
<asp:GridView ID="GvD" runat="server" AutoGenerateColumns="False" CssClass="table detallerow table-hover" Style=" float: right; width: 95%;" DataKeyNames="IdCtaContable,Cargo,Abono" GridLines="None" OnRowDataBound="GvD_RowDataBound"> <asp:GridView ID="GvD" runat="server" AutoGenerateColumns="False" CssClass="table detallerow table-hover" Style=" float: right; width: 95%;" DataKeyNames="IdCtaContable,CveCuenta,Cargo,Abono" GridLines="None" OnRowDataBound="GvD_RowDataBound">
<Columns> <Columns>
<asp:BoundField DataField="ConceptoContable" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="150px" HeaderText="Movimiento"> <asp:BoundField DataField="ConceptoContable" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="150px" HeaderText="Movimiento">
<ItemStyle HorizontalAlign="Left" Width="150px" /> <ItemStyle HorizontalAlign="Left" Width="150px" />
@@ -142,7 +142,7 @@
<asp:BoundField DataField="SubProyecto" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="100px" HeaderText="SubProyecto"> <asp:BoundField DataField="SubProyecto" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="100px" HeaderText="SubProyecto">
<ItemStyle HorizontalAlign="Left" Width="120px" /> <ItemStyle HorizontalAlign="Left" Width="120px" />
</asp:BoundField> </asp:BoundField>
<asp:BoundField DataField="IdCtaContable" ItemStyle-Font-Italic="true" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="150px" ItemStyle-CssClass="truncate" HeaderText="Cuenta"> <asp:BoundField DataField="CodigoNombreCuenta" ItemStyle-Font-Italic="true" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="150px" ItemStyle-CssClass="truncate" HeaderText="Cuenta">
<ItemStyle CssClass="truncate" Font-Italic="True" HorizontalAlign="Left" Width="150px" /> <ItemStyle CssClass="truncate" Font-Italic="True" HorizontalAlign="Left" Width="150px" />
</asp:BoundField> </asp:BoundField>
<asp:TemplateField HeaderText="Cargos"> <asp:TemplateField HeaderText="Cargos">
@@ -249,7 +249,7 @@
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:BoundField DataField="SubProyecto" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="150px" HeaderText="SubProyecto" /> <asp:BoundField DataField="SubProyecto" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="150px" HeaderText="SubProyecto" />
<asp:BoundField DataField="IdCtaContable" ItemStyle-Font-Italic="true" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="150px" ItemStyle-CssClass="truncate" HeaderText="Cuenta" /> <asp:BoundField DataField="CodigoNombreCuenta" ItemStyle-Font-Italic="true" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="150px" ItemStyle-CssClass="truncate" HeaderText="Cuenta" />
<asp:TemplateField HeaderText="Cargos"> <asp:TemplateField HeaderText="Cargos">
<ItemTemplate> <ItemTemplate>
<asp:Literal ID="LtlC" runat="server" Text='<%# Eval("Cargo", "{0:N2}") %>'></asp:Literal> <asp:Literal ID="LtlC" runat="server" Text='<%# Eval("Cargo", "{0:N2}") %>'></asp:Literal>
@@ -345,7 +345,7 @@
<asp:TemplateField> <asp:TemplateField>
<ItemTemplate> <ItemTemplate>
<asp:Panel ID="PnlDetalleAnticipos" runat="server"> <asp:Panel ID="PnlDetalleAnticipos" runat="server">
<asp:GridView ID="GvD" runat="server" AutoGenerateColumns="false" CssClass="table detallerow table-hover" Style="text-align: center; float: right; width: 95%;" DataKeyNames="IdCtaContable, Cargo, Abono" GridLines="None" OnRowDataBound="GvD_RowDataBound"> <asp:GridView ID="GvD" runat="server" AutoGenerateColumns="false" CssClass="table detallerow table-hover" Style="text-align: center; float: right; width: 95%;" DataKeyNames="IdCtaContable,CveCuenta, Cargo, Abono" GridLines="None" OnRowDataBound="GvD_RowDataBound">
<Columns> <Columns>
<asp:BoundField DataField="ConceptoContable" ItemStyle-Font-Size="Smaller" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="150px" HeaderText="Movimiento" /> <asp:BoundField DataField="ConceptoContable" ItemStyle-Font-Size="Smaller" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="150px" HeaderText="Movimiento" />
<asp:TemplateField HeaderText="Concepto"> <asp:TemplateField HeaderText="Concepto">
@@ -354,7 +354,7 @@
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:BoundField DataField="SubProyecto" ItemStyle-Font-Size="Smaller" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="100px" HeaderText="SubProyecto" /> <asp:BoundField DataField="SubProyecto" ItemStyle-Font-Size="Smaller" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="100px" HeaderText="SubProyecto" />
<asp:BoundField DataField="IdCtaContable" ItemStyle-Font-Size="Smaller" ItemStyle-Font-Italic="true" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="150px" ItemStyle-CssClass="truncate" HeaderText="Cuenta" /> <asp:BoundField DataField="CodigoNombreCuenta" ItemStyle-Font-Size="Smaller" ItemStyle-Font-Italic="true" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="150px" ItemStyle-CssClass="truncate" HeaderText="Cuenta" />
<asp:BoundField DataField="Cargo" ItemStyle-Font-Size="Smaller" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" DataFormatString="{0:N2}" HeaderText="Cargos" /> <asp:BoundField DataField="Cargo" ItemStyle-Font-Size="Smaller" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" DataFormatString="{0:N2}" HeaderText="Cargos" />
<asp:BoundField DataField="Abono" ItemStyle-Font-Size="Smaller" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" DataFormatString="{0:N2}" HeaderText="Abonos" /> <asp:BoundField DataField="Abono" ItemStyle-Font-Size="Smaller" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" DataFormatString="{0:N2}" HeaderText="Abonos" />
</Columns> </Columns>
@@ -435,7 +435,7 @@
<asp:TemplateField> <asp:TemplateField>
<ItemTemplate> <ItemTemplate>
<asp:Panel ID="PnlDetalleAmortizaciones" runat="server"> <asp:Panel ID="PnlDetalleAmortizaciones" runat="server">
<asp:GridView ID="GvD" runat="server" AutoGenerateColumns="false" CssClass="table detallerow table-hover" Style="text-align: center; float: right; width: 95%;" DataKeyNames="IdCtaContable, Cargo, Abono" GridLines="None" OnRowDataBound="GvD_RowDataBound"> <asp:GridView ID="GvD" runat="server" AutoGenerateColumns="false" CssClass="table detallerow table-hover" Style="text-align: center; float: right; width: 95%;" DataKeyNames="IdCtaContable,CveCuenta, Cargo, Abono" GridLines="None" OnRowDataBound="GvD_RowDataBound">
<Columns> <Columns>
<asp:BoundField DataField="ConceptoContable" ItemStyle-Font-Size="Smaller" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="150px" HeaderText="Movimiento" /> <asp:BoundField DataField="ConceptoContable" ItemStyle-Font-Size="Smaller" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="150px" HeaderText="Movimiento" />
<asp:TemplateField HeaderText="Concepto"> <asp:TemplateField HeaderText="Concepto">
@@ -444,7 +444,7 @@
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:BoundField DataField="SubProyecto" ItemStyle-Font-Size="Smaller" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="100px" HeaderText="SubProyecto" /> <asp:BoundField DataField="SubProyecto" ItemStyle-Font-Size="Smaller" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="100px" HeaderText="SubProyecto" />
<asp:BoundField DataField="IdCtaContable" ItemStyle-Font-Size="Smaller" ItemStyle-Font-Italic="true" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="150px" ItemStyle-CssClass="truncate" HeaderText="Cuenta" /> <asp:BoundField DataField="CodigoNombreCuenta" ItemStyle-Font-Size="Smaller" ItemStyle-Font-Italic="true" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="150px" ItemStyle-CssClass="truncate" HeaderText="Cuenta" />
<asp:BoundField DataField="Cargo" ItemStyle-Font-Size="Smaller" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" DataFormatString="{0:N2}" HeaderText="Cargos" /> <asp:BoundField DataField="Cargo" ItemStyle-Font-Size="Smaller" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" DataFormatString="{0:N2}" HeaderText="Cargos" />
<asp:BoundField DataField="Abono" ItemStyle-Font-Size="Smaller" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" DataFormatString="{0:N2}" HeaderText="Abonos" /> <asp:BoundField DataField="Abono" ItemStyle-Font-Size="Smaller" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" DataFormatString="{0:N2}" HeaderText="Abonos" />
</Columns> </Columns>

View File

@@ -42,7 +42,7 @@ public partial class Contabilidad_ContabilizacionCompras : ClsPaginas
TienePermisoEditar = false; TienePermisoEditar = false;
DdlProveedores.setEsWebService(true); DdlProveedores.setEsWebService(true);
DdlProveedores.Attributes.Add("data-metodo", "getproveedores"); DdlProveedores.Attributes.Add("data-metodo", "getproveedores");
if (UsuarioActual.Empresa.UsaContabilidad) if (UsuarioActual.Empresa.TipoContabilidad == 2 && UsuarioActual.Empresa.UsaContabilidad)
{ {
TienePermisoEditar = false; TienePermisoEditar = false;
ClsContPAQi ObjCont = new ClsContPAQi(UsuarioActual.Empresa); ClsContPAQi ObjCont = new ClsContPAQi(UsuarioActual.Empresa);
@@ -66,22 +66,26 @@ public partial class Contabilidad_ContabilizacionCompras : ClsPaginas
//CargaDatos(); //CargaDatos();
if (UsuarioActual.CveRol == 1 || UsuarioActual.CveUsuario == 17 || UsuarioActual.CveUsuario == 171 || UsuarioActual.TienePermisoProceso(221))
{
TienePermisoEditar = true;
TienePermisoVerPoliza = true;
}
} }
else
if (UsuarioActual.CveRol == 1 || UsuarioActual.CveUsuario == 17 || UsuarioActual.CveUsuario == 171 || UsuarioActual.TienePermisoProceso(221))
{ {
Alert("Este módulo requiere el uso de Contabilidad.", ModExtensiones.TipoMensaje.MsgAdvertencia); TienePermisoEditar = true;
// BtnConsultar.Enabled = false; TienePermisoVerPoliza = true;
BtnContabilizarCompras.Enabled = false;
BtnContabilizarPagos.Enabled = false;
BtnContabilizarAnticipos.Enabled = false;
BtnContabilizarAmortizaciones.Enabled = false;
} }
txtFechaI.Text = DateTime.Now.ToShortDateString();
txtFechaF.Text = DateTime.Now.ToShortDateString();
//else
//{
// Alert("Este módulo requiere el uso de Contabilidad.", ModExtensiones.TipoMensaje.MsgAdvertencia);
// // BtnConsultar.Enabled = false;
// BtnContabilizarCompras.Enabled = false;
// BtnContabilizarPagos.Enabled = false;
// BtnContabilizarAnticipos.Enabled = false;
// BtnContabilizarAmortizaciones.Enabled = false;
//}
} }
BtnConsultar.Click += new EventHandler(this.BtnConsultar_Click); BtnConsultar.Click += new EventHandler(this.BtnConsultar_Click);
@@ -310,6 +314,7 @@ public partial class Contabilidad_ContabilizacionCompras : ClsPaginas
if (e.Row.RowType == DataControlRowType.DataRow) if (e.Row.RowType == DataControlRowType.DataRow)
{ {
int cuenta = e.Row.DataKey("IdCtaContable").ToString().ToEntero(); int cuenta = e.Row.DataKey("IdCtaContable").ToString().ToEntero();
int cvecuenta = e.Row.DataKey("CveCuenta").ToString().ToEntero();
int CveConcepto = e.Row.DBCampo("CveConceptoContable").ToEntero(); int CveConcepto = e.Row.DBCampo("CveConceptoContable").ToEntero();
if (CveConcepto.Contiene(5, 6, 14, 16, 17, 19, 206, 22, 23, 25, 26, 18, 60, 183, 184, 185, 186 ,205, 240, 243, 244, 248, 249,15,22,248,249,237)) if (CveConcepto.Contiene(5, 6, 14, 16, 17, 19, 206, 22, 23, 25, 26, 18, 60, 183, 184, 185, 186 ,205, 240, 243, 244, 248, 249,15,22,248,249,237))
@@ -337,21 +342,37 @@ public partial class Contabilidad_ContabilizacionCompras : ClsPaginas
e.Row.FCHyperLink("HplC").NavigateUrl = string.Format("/OC/OC.aspx?OC={0}", e.Row.DBCampo("CveOC")); e.Row.FCHyperLink("HplC").NavigateUrl = string.Format("/OC/OC.aspx?OC={0}", e.Row.DBCampo("CveOC"));
} }
if (UsuarioActual.Empresa.TipoContabilidad == 1) // conta SIG
if (cuenta > 0)
{ {
DataRow dr = DTmpC.FiltroPrimero(String.Format("Id = {0}", cuenta)); if (cvecuenta == 0)
{
e.Row.Cells[0].ForeColor = System.Drawing.Color.Red;
((GridViewRow)((GridView)e.Row.NamingContainer).BindingContainer).FCCheckBox("Chk").Visible = false;
}
if (dr != null) e.Row.Cells[3].Text = string.Format("{0}<br/>{1}", dr["CuentaFormato"], dr["Nombre"]);
} }
else else
{ {
e.Row.Cells[0].ForeColor = System.Drawing.Color.Red; if (UsuarioActual.Empresa.TipoContabilidad == 2) // conta Contpaq
{
((GridViewRow)((GridView)e.Row.NamingContainer).BindingContainer).FCCheckBox("Chk").Enabled = false; if (cuenta > 0)
((GridViewRow)((GridView)e.Row.NamingContainer).BindingContainer).FCCheckBox("Chk").ToolTip = "Hay conceptos sin cuenta asignada"; {
DataRow dr = DTmpC.FiltroPrimero(String.Format("Id = {0}", cuenta));
if (dr != null) e.Row.Cells[3].Text = string.Format("{0}<br/>{1}", dr["CuentaFormato"], dr["Nombre"]);
}
else
{
e.Row.Cells[0].ForeColor = System.Drawing.Color.Red;
((GridViewRow)((GridView)e.Row.NamingContainer).BindingContainer).FCCheckBox("Chk").Enabled = false;
((GridViewRow)((GridView)e.Row.NamingContainer).BindingContainer).FCCheckBox("Chk").ToolTip = "Hay conceptos sin cuenta asignada";
}
}
} }
if (Convert.ToDecimal(e.Row.DataKey("Cargo").ToString()) == 0) e.Row.Cells[4].Text = ""; if (Convert.ToDecimal(e.Row.DataKey("Cargo").ToString()) == 0) e.Row.Cells[4].Text = "";
if (Convert.ToDecimal(e.Row.DataKey("Abono").ToString()) == 0) e.Row.Cells[5].Text = ""; if (Convert.ToDecimal(e.Row.DataKey("Abono").ToString()) == 0) e.Row.Cells[5].Text = "";

View File

@@ -1884,114 +1884,117 @@ Partial Class Inventarios_RecepcionEntrega
'DEVOLUCION REMISION 'DEVOLUCION REMISION
If TipoMovimiento = 2 And TipoDocto = "Rem" Then If TipoMovimiento = 2 And TipoDocto = "Rem" Then
ConceptoMovimiento = 8 ConceptoMovimiento = 8
Almacen1 = CveAlmacenTraspasoDestino Almacen1 = CveAlmacenTraspasoDestino
CveAlmacenTraspasoDestino = DdlAlmacen.SelectedValue.ToEntero CveAlmacenTraspasoDestino = DdlAlmacen.SelectedValue.ToEntero
End If End If
'CANCELACION DE DEVOLUCION 'CANCELACION DE DEVOLUCION
If TipoMovimiento = 2 And TipoDocto = "Dev" And EsDevolucionVenta = 1 Then If TipoMovimiento = 2 And TipoDocto = "Dev" And EsDevolucionVenta = 1 Then
ConceptoMovimiento = 3 ConceptoMovimiento = 3
Almacen1 = DdlAlmacen.SelectedValue.ToEntero Almacen1 = DdlAlmacen.SelectedValue.ToEntero
CveAlmacenTraspasoDestino = DdlAlmacen.SelectedValue.ToEntero CveAlmacenTraspasoDestino = DdlAlmacen.SelectedValue.ToEntero
End If End If
CveMovimiento = ObjInventario.AddMovimiento(Almacen1, ConceptoMovimiento, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaSurtir, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Guia:=TxtGuia.Text, CveMovimiento = ObjInventario.AddMovimiento(Almacen1, ConceptoMovimiento, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaSurtir, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Guia:=TxtGuia.Text,
CveContrato:=CveContrato, CveAlmacenDestino:=CveAlmacenTraspasoDestino, Modulo:="RE/G7") CveContrato:=CveContrato, CveAlmacenDestino:=CveAlmacenTraspasoDestino, Modulo:="RE/G7")
Folio = ObjInventario.Folio Folio = ObjInventario.Folio
'SALIDA DE ALMACEN - SALIDA POR TRASPASO CUANDO ES REMISION - DEVOLUCION (SI ES TRASPASO Y TIENE CONTRATO NO HACE DEVOLUCIóN) 'SALIDA DE ALMACEN - SALIDA POR TRASPASO CUANDO ES REMISION - DEVOLUCION (SI ES TRASPASO Y TIENE CONTRATO NO HACE DEVOLUCIóN)
'If Not (CveContrato > 0 And CveAlmacenTraspasoDestino > 0) Then 'If Not (CveContrato > 0 And CveAlmacenTraspasoDestino > 0) Then
If CveMovimiento > 0 Then If CveMovimiento > 0 Then
'SACA LO DE TRASPASOS - APARTADO 'SACA LO DE TRASPASOS - APARTADO
For Each Dr1 As DataRow In DtTraspasos.Rows For Each Dr1 As DataRow In DtTraspasos.Rows
CveMovimientoSalida = Dr1("CveMovimientoEntrada").ToString.ToEntero CveMovimientoSalida = Dr1("CveMovimientoEntrada").ToString.ToEntero
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
If ObjInventario.DtResultados.Rows.Count = 0 Then If ObjInventario.DtResultados.Rows.Count = 0 Then
ErrorMovInv = True
TextoError = "Ocurrió un error, no se tienen registros que ingresar"
Exit Sub
End If
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDouble, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString) Then
ErrorMovInv = True ErrorMovInv = True
TextoError = "Ocurrió un error, no se tienen registros que ingresar" TextoError = "Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar."
Exit Sub Exit For
End If
Next
Else
ErrorMovInv = True
TextoError = "Ocurrió un error al obtener los registros"
End If
If ErrorMovInv Then Exit For
Next
'ES EL MOVIMIENTO PRINCIPAL
CantidadPendiente = 0
Dim Cont As Integer = 0
For Each Dr As DataRow In DtDatos.Rows
CantidadPendiente = Dr("CantidadGV").ToString.ToDecimal - Dr("CantidadTraspaso").ToString.ToDecimal
If CantidadPendiente > 0 Then
Dim PU As Decimal = 0
'SI FUE POR SERIELOTE
DtDetalle = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0} AND FueTraspaso IS NULL", Dr("Consec")))
DtDetalleLote = DtDatosDetalleLote.FiltraParametros(String.Format("ConsecId = {0} AND FueTraspaso IS NULL", Dr("Consec")))
If DtDetalle.Rows.Count > 0 Then
For Each Dr1 As DataRow In DtDetalle.Rows
If TipoMovimiento = 2 AndAlso DtExistencias IsNot Nothing Then
PU = DtExistencias.FiltroPrimeroValor("PU", $"CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString.ToEntero} AND SerieLote = '{Dr1("SerieLote").ToString}'").ToString.ToDecimal
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, 1, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, PU, -1, SerieLote:=Dr1("SerieLote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then
ErrorMovInv = True
TextoError = "Ocurrió un error al procesar los conceptos con serie. Por favor vuelva a intentar."
Exit For
End If
Next
ElseIf DtDetalleLote.Rows.Count > 0 Then
For Each Dr1 As DataRow In DtDetalleLote.Rows
If TipoMovimiento = 2 AndAlso DtExistencias IsNot Nothing Then
PU = DtExistencias.FiltroPrimeroValor("PU", $"CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString.ToEntero} AND SerieLote = '{Dr1("SerieLote").ToString}'").ToString.ToDecimal
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr1("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, PU, -1, Lote:=Dr1("Lote").ToString, Batch:=Dr1("Batch").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then
ErrorMovInv = True
TextoError = "Ocurrió un error al procesar los conceptos con serie. Por favor vuelva a intentar."
Exit For
End If
Next
Else
If TipoMovimiento = 2 AndAlso DtExistencias IsNot Nothing Then
PU = DtExistencias.FiltroPrimeroValor("PU", $"CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString.ToEntero}").ToString.ToDecimal
End If End If
For Each Dr As DataRow In ObjInventario.DtResultados.Rows If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, CantidadPendiente, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, PU, -1, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDouble, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString) Then ErrorMovInv = True
TextoError = "Ocurrió un error al procesar los conceptos de salida. Por favor vuelva a intentar."
Exit For
End If
End If
If ObjInventario.CveMovimientoDetalle > 0 AndAlso DtSeccionAlmacen.Rows.Count > 0 Then
For Each Dr2 As DataRow In DtSeccionAlmacen.FiltraParametros($"IndexSeccionAlmacen = {Cont}").Rows
If Not ObjInventario.AddMovimientosDetalleSeccionesAlmacen(ObjInventario.CveMovimientoDetalle, Dr2("CveSeccionAlmacen").ToString.ToEntero, -Dr2("CantidadSeccionAlmacen").ToString.ToDecimal) Then
ErrorMovInv = True ErrorMovInv = True
TextoError = "Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar." TextoError = "Ocurrió un error al procesar las secciones de almacen. Por favor vuelva a intentar."
Exit For Exit For
End If End If
Next Next
End If End If
If ErrorMovInv Then Exit For Cont += 1
Next End If
Next
'ES EL MOVIMIENTO PRINCIPAL Else
CantidadPendiente = 0 ErrorMovInv = True
Dim Cont As Integer = 0
For Each Dr As DataRow In DtDatos.Rows
CantidadPendiente = Dr("CantidadGV").ToString.ToDecimal - Dr("CantidadTraspaso").ToString.ToDecimal
If CantidadPendiente > 0 Then
Dim PU As Decimal = 0
'SI FUE POR SERIELOTE
DtDetalle = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0} AND FueTraspaso IS NULL", Dr("Consec")))
DtDetalleLote = DtDatosDetalleLote.FiltraParametros(String.Format("ConsecId = {0} AND FueTraspaso IS NULL", Dr("Consec")))
If DtDetalle.Rows.Count > 0 Then
For Each Dr1 As DataRow In DtDetalle.Rows
If TipoMovimiento = 2 AndAlso DtExistencias IsNot Nothing Then
PU = DtExistencias.FiltroPrimeroValor("PU", $"CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString.ToEntero} AND SerieLote = '{Dr1("SerieLote").ToString}'").ToString.ToDecimal
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, 1, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, PU, -1, SerieLote:=Dr1("SerieLote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then
ErrorMovInv = True
TextoError = "Ocurrió un error al procesar los conceptos con serie. Por favor vuelva a intentar."
Exit For
End If
Next
ElseIf DtDetalleLote.Rows.Count > 0 Then
For Each Dr1 As DataRow In DtDetalleLote.Rows
If TipoMovimiento = 2 AndAlso DtExistencias IsNot Nothing Then
PU = DtExistencias.FiltroPrimeroValor("PU", $"CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString.ToEntero} AND SerieLote = '{Dr1("SerieLote").ToString}'").ToString.ToDecimal
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr1("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, PU, -1, Lote:=Dr1("Lote").ToString, Batch:=Dr1("Batch").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then
ErrorMovInv = True
TextoError = "Ocurrió un error al procesar los conceptos con serie. Por favor vuelva a intentar."
Exit For
End If
Next
Else
If TipoMovimiento = 2 AndAlso DtExistencias IsNot Nothing Then
PU = DtExistencias.FiltroPrimeroValor("PU", $"CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString.ToEntero}").ToString.ToDecimal
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, CantidadPendiente, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, PU, -1, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then
ErrorMovInv = True
TextoError = "Ocurrió un error al procesar los conceptos de salida. Por favor vuelva a intentar."
Exit For
End If
End If
If ObjInventario.CveMovimientoDetalle > 0 AndAlso DtSeccionAlmacen.Rows.Count > 0 Then
For Each Dr2 As DataRow In DtSeccionAlmacen.FiltraParametros($"IndexSeccionAlmacen = {Cont}").Rows
If Not ObjInventario.AddMovimientosDetalleSeccionesAlmacen(ObjInventario.CveMovimientoDetalle, Dr2("CveSeccionAlmacen").ToString.ToEntero, -Dr2("CantidadSeccionAlmacen").ToString.ToDecimal) Then
ErrorMovInv = True
TextoError = "Ocurrió un error al procesar las secciones de almacen. Por favor vuelva a intentar."
Exit For
End If
Next
End If
Cont += 1
End If
Next
Else
ErrorMovInv = True
End If
End If End If
'End If End If
'End If
'ENTRADA POR TRASPASO CUANDO ES REMISION 'ENTRADA POR TRASPASO CUANDO ES REMISION
If Not ErrorMovInv Then If Not ErrorMovInv Then
If CveAlmacenTraspasoDestino > 0 AndAlso Not (TipoMovimiento = 2 And TipoDocto = "Dev" And EsDevolucionVenta = 1) Then ' TRASPASO CUANDO ES REMISION If CveAlmacenTraspasoDestino > 0 AndAlso Not (TipoMovimiento = 2 And TipoDocto = "Dev" And EsDevolucionVenta = 1) Then ' TRASPASO CUANDO ES REMISION
CveMovimientoEntrada = ObjInventario.AddMovimiento(CveAlmacenTraspasoDestino, 9, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaSurtir, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Guia:=TxtGuia.Text, CveContrato:=CveContrato, CveMovimientoEntrada = ObjInventario.AddMovimiento(CveAlmacenTraspasoDestino, 9, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaSurtir, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Guia:=TxtGuia.Text, CveContrato:=CveContrato,
CveMovimientoRelacionado:=CveMovimiento, CveAlmacenDestino:=DdlAlmacen.SelectedValue.ToEntero, Modulo:="RE/G8") CveMovimientoRelacionado:=CveMovimiento, CveAlmacenDestino:=DdlAlmacen.SelectedValue.ToEntero, Modulo:="RE/G8")
@@ -2001,7 +2004,7 @@ Partial Class Inventarios_RecepcionEntrega
TextoError = "No se pudo generar el movimiento de entrada correctamente" TextoError = "No se pudo generar el movimiento de entrada correctamente"
ErrorMovInv = True ErrorMovInv = True
Else Else
If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then
For Each Dr As DataRow In ObjInventario.DtResultados.Rows For Each Dr As DataRow In ObjInventario.DtResultados.Rows
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDouble, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString, EsInterno:=EsInterno, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero()) Then If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDouble, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString, EsInterno:=EsInterno, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero()) Then
ErrorMovInv = True ErrorMovInv = True
@@ -2009,6 +2012,9 @@ Partial Class Inventarios_RecepcionEntrega
Exit For Exit For
End If End If
Next Next
Else
ErrorMovInv = True
TextoError = "Ocurrió un error al guardar los movimientos de entrada"
End If End If
End If End If

View File

@@ -129,6 +129,7 @@
<script type="text/javascript" src="/Scripts/Notificaciones.js"></script> <script type="text/javascript" src="/Scripts/Notificaciones.js"></script>
<script> <script>
// aqui debe de llammarse Sr, para desconectar
window.addEventListener("beforeunload", NotificacionesADS.closeopenConexion); window.addEventListener("beforeunload", NotificacionesADS.closeopenConexion);
var prm = Sys.WebForms.PageRequestManager.getInstance(); var prm = Sys.WebForms.PageRequestManager.getInstance();
prm.add_initializeRequest(function (s, e) { prm.add_initializeRequest(function (s, e) {

View File

@@ -93,26 +93,26 @@ var NotificacionesADS = function () {
closeopenConexion() closeopenConexion()
} }
function loadConection() { function loadConection() {
VentanaConConexion = true; // VentanaConConexion = true;
localStorage.setItem("AdsNotificacionesIsConnected", valueok); //localStorage.setItem("AdsNotificacionesIsConnected", valueok);
if ($.connection) { //if ($.connection) {
let nointentos =0 // let nointentos =0
var proxy = $.connection.notificaciones; // var proxy = $.connection.notificaciones;
/*$.connection.hub.url = '/signalr';*/ // /*$.connection.hub.url = '/signalr';*/
$.connection.hub.disconnected(function () { // $.connection.hub.disconnected(function () {
setTimeout(function () { nointentos = nointentos + 1; if (nointentos < 4) { $.connection.hub.start().done(function () { nointentos = 0 }); console.log('Reconected'); } }, 120000); // setTimeout(function () { nointentos = nointentos + 1; if (nointentos < 4) { $.connection.hub.start().done(function () { nointentos = 0 }); console.log('Reconected'); } }, 120000);
}); // });
proxy.client.AlertaVentana = AlertaVentana; // proxy.client.AlertaVentana = AlertaVentana;
$.connection.hub.start().done(function () { // $.connection.hub.start().done(function () {
console.log('Bienvenido'); // console.log('Bienvenido');
}); // });
} else { //} else {
console.error('Signal Error (no se encontro $.connection)'); // console.error('Signal Error (no se encontro $.connection)');
} //}
window.addEventListener("beforeunload", beforeunloadcloseopenConexion); //window.addEventListener("beforeunload", beforeunloadcloseopenConexion);
} }
function initConnection() { function initConnection() {
let isconnected = localStorage.getItem("AdsNotificacionesIsConnected"); let isconnected = localStorage.getItem("AdsNotificacionesIsConnected");

View File

@@ -694,7 +694,7 @@
<script type="text/javascript" src="/Scripts/jquery.signalR-2.2.2.min.js"></script> <script type="text/javascript" src="/Scripts/jquery.signalR-2.2.2.min.js"></script>
<script type="text/javascript" src="/signalr/signalr/hubs"></script> <script type="text/javascript" src="/signalr/signalr/hubs"></script>
<%: Scripts.Render("~/Metronic/assets/global/scripts/JS") %> <%: Scripts.Render("~/Metronic/assets/global/scripts/JS") %>
<script type="text/javascript" src="/Scripts/Notificaciones.js"></script> <script type="text/javascript" src="/Scripts/Notificaciones.js?var1=1"></script>
<script type="text/javascript"> <script type="text/javascript">
NotificacionesADS.init(); NotificacionesADS.init();

View File

@@ -22,7 +22,7 @@
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server"> <asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveMeta,CveVendedor,CveMarca,CveClasificacion,Vendedor,MesAño,Marca,Clasificacion,MetaCantidad,MetaImporte" EmptyDataText="No se encontraron Motivo de Baja Registrados" ToolTip="Listado de Metas Vendedor" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center;width:100%" GridLines="None"> <asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveMeta,CveVendedor,CveMarca,CveClasificacion,CveClasificacionSup,Vendedor,MesAño,Marca,Clasificacion,MetaCantidad,MetaImporte" EmptyDataText="No se encontraron Motivo de Baja Registrados" ToolTip="Listado de Metas Vendedor" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center;width:100%" GridLines="None">
<Columns> <Columns>
<asp:TemplateField HeaderText ="Vendedor" ItemStyle-HorizontalAlign="Left"> <asp:TemplateField HeaderText ="Vendedor" ItemStyle-HorizontalAlign="Left">
<ItemTemplate> <ItemTemplate>
@@ -34,14 +34,14 @@
<ajax:ValidatorCalloutExtender ID="VCVendedor" runat="server" HighlightCssClass="vco" TargetControlID="RFVVendedor" Width="300px"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="VCVendedor" runat="server" HighlightCssClass="vco" TargetControlID="RFVVendedor" Width="300px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate> </EditItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText ="Marca" ItemStyle-HorizontalAlign="Left"> <asp:TemplateField HeaderText ="Clasificación superior">
<ItemTemplate> <ItemTemplate>
<asp:Literal ID="LtlMarca" runat="server" Text='<%# Eval("Marca", "&nbsp;{0}") %>'></asp:Literal> <asp:Literal ID="LtlClasificacionSup" runat="server" Text='<%# Eval("ClasificacionSup", "&nbsp;{0}") %>'></asp:Literal>
</ItemTemplate> </ItemTemplate>
<EditItemTemplate> <EditItemTemplate>
<asp:TextBox ID="TxtMarca" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("Marca") %>' ValidationGroup="GrpGV" Width="234px"></asp:TextBox> <asp:TextBox ID="TxtClasificacionSup" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("ClasificacionSup") %>' ValidationGroup="GrpGV" Width="234px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVMarca" runat="server" ControlToValidate="TxtMarca" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Marca''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator> <asp:RequiredFieldValidator ID="RFVClasificacionSup" runat="server" ControlToValidate="TxtClasificacionSup" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Clasificacion''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCMarca" runat="server" HighlightCssClass="vco" TargetControlID="RFVMarca" Width="300px"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="VCClasificacionSup" runat="server" HighlightCssClass="vco" TargetControlID="RFVClasificacionSup" Width="300px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate> </EditItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText ="Clasificacion"> <asp:TemplateField HeaderText ="Clasificacion">
@@ -54,6 +54,16 @@
<ajax:ValidatorCalloutExtender ID="VCClasificacion" runat="server" HighlightCssClass="vco" TargetControlID="RFVClasificacion" Width="300px"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="VCClasificacion" runat="server" HighlightCssClass="vco" TargetControlID="RFVClasificacion" Width="300px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate> </EditItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText ="Marca" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Literal ID="LtlMarca" runat="server" Text='<%# Eval("Marca", "&nbsp;{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtMarca" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("Marca") %>' ValidationGroup="GrpGV" Width="234px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVMarca" runat="server" ControlToValidate="TxtMarca" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Marca''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCMarca" runat="server" HighlightCssClass="vco" TargetControlID="RFVMarca" Width="300px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText ="MesAño"> <asp:TemplateField HeaderText ="MesAño">
<ItemTemplate> <ItemTemplate>
<asp:Literal ID="LtlMesAño" runat="server" Text='<%# Eval("MesAño", "&nbsp;{0}") %>'></asp:Literal> <asp:Literal ID="LtlMesAño" runat="server" Text='<%# Eval("MesAño", "&nbsp;{0}") %>'></asp:Literal>
@@ -120,6 +130,11 @@
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="TxtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender> <ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="TxtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFechaI" TargetControlID="TxtFechaI" PopupButtonID="ImgFechaI" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender> <ajax:CalendarExtender runat="server" ID="CEFechaI" TargetControlID="TxtFechaI" PopupButtonID="ImgFechaI" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
</div> </div>
<div class="form-group form-md-line-input input-iconright">
<label for="DdlMarcas">Clasificacion Superior:</label>
<asp:DropDownList ID="DdlClasificacionSup" runat="server" DataTextField="Clasificacion" DataValueField="CveClasificacion" CssClass="form-control input-sm select2me"></asp:DropDownList>
<i></i>
</div>
<div class="form-group form-md-line-input input-iconright"> <div class="form-group form-md-line-input input-iconright">
<label for="DdlMarcas">Clasificacion:</label> <label for="DdlMarcas">Clasificacion:</label>
<asp:DropDownList ID="DdlClasificacion" runat="server" DataTextField="Clasificacion" DataValueField="CveClasificacion" CssClass="form-control input-sm select2me"></asp:DropDownList> <asp:DropDownList ID="DdlClasificacion" runat="server" DataTextField="Clasificacion" DataValueField="CveClasificacion" CssClass="form-control input-sm select2me"></asp:DropDownList>

View File

@@ -45,6 +45,10 @@ Partial Class CatMetasVendedores
DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa) DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa)
DdlClasificacion.DataBind() DdlClasificacion.DataBind()
DdlClasificacion.Items.Insert(0, New ListItem("Todos", "-1")) DdlClasificacion.Items.Insert(0, New ListItem("Todos", "-1"))
DdlClasificacionSup.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa)
DdlClasificacionSup.DataBind()
DdlClasificacionSup.Items.Insert(0, New ListItem("Todos", "-1"))
End Sub End Sub
Protected Sub LnkAgregar_Click() Handles LnkAgregar.Click Protected Sub LnkAgregar_Click() Handles LnkAgregar.Click
@@ -53,24 +57,26 @@ Partial Class CatMetasVendedores
Protected Sub BtnAgregarMetaVendedor_Click(sender As Object, e As EventArgs) Handles BtnAgregarMetaVendedor.Click Protected Sub BtnAgregarMetaVendedor_Click(sender As Object, e As EventArgs) Handles BtnAgregarMetaVendedor.Click
If DdlVendedores.SelectedValue.ToEntero > 0 AndAlso TxtFechaI.Text <> "" AndAlso DdlMarcas.SelectedValue.ToEntero > 0 Then If DdlVendedores.SelectedValue.ToEntero > 0 AndAlso TxtFechaI.Text <> "" AndAlso DdlMarcas.SelectedValue.ToEntero > 0 AndAlso DdlClasificacionSup.SelectedValue.ToEntero > 0 Then
Dim ObjVentas As New ClsVentas Dim ObjVentas As New ClsVentas
If BtnAgregarMetaVendedor.Text = "Agregar" Then If BtnAgregarMetaVendedor.Text = "Agregar" Then
If ObjVentas.AddMetasVendedores(DdlVendedores.SelectedValue.ToEntero, TxtFechaI.Text, DdlMarcas.SelectedValue.ToEntero, TxtMetaCantidad.Text.ToEntero, If ObjVentas.AddMetasVendedores(DdlVendedores.SelectedValue.ToEntero, TxtFechaI.Text, DdlMarcas.SelectedValue.ToEntero, TxtMetaCantidad.Text.ToEntero,
TxtMetaImporte.Text.ToDecimal, DdlClasificacion.SelectedValue.ToEntero) Then TxtMetaImporte.Text.ToDecimal, DdlClasificacion.SelectedValue.ToEntero, DdlClasificacionSup.SelectedValue.ToEntero) Then
Alert("Se agregó la meta al vendedor") Alert("Se agregó la meta al vendedor")
Else Else
Alert("No se pudo agregar la meta al vendedor", TipoMensaje.MsgError) Alert("No se pudo agregar la meta al vendedor", TipoMensaje.MsgError)
End If End If
ElseIf BtnAgregarMetaVendedor.Text = "Actualizar" Then ElseIf BtnAgregarMetaVendedor.Text = "Actualizar" Then
If ObjVentas.UpdateMetasVendedores(CveMetaVendedor, DdlVendedores.SelectedValue.ToEntero, TxtFechaI.Text, DdlMarcas.SelectedValue.ToEntero, If ObjVentas.UpdateMetasVendedores(CveMetaVendedor, DdlVendedores.SelectedValue.ToEntero, TxtFechaI.Text, DdlMarcas.SelectedValue.ToEntero,
TxtMetaCantidad.TextMode.ToEntero, TxtMetaImporte.Text.ToDecimal, DdlClasificacion.SelectedValue.ToEntero) Then TxtMetaCantidad.Text.ToEntero, TxtMetaImporte.Text.ToDecimal, DdlClasificacion.SelectedValue.ToEntero,
DdlClasificacionSup.SelectedValue.ToEntero) Then
Alert("Se actualizó la información de la meta del vendedor") Alert("Se actualizó la información de la meta del vendedor")
Else Else
Alert("No se pudo actualizar la meta del vendedor", TipoMensaje.MsgError) Alert("No se pudo actualizar la meta del vendedor", TipoMensaje.MsgError)
End If End If
End If End If
Else Else
Alert(String.Format("Falta Seleccionar {0}{1}{2}", If(DdlVendedores.SelectedValue.ToEntero > 0, "", "Vendedor, "), If(DdlMarcas.SelectedValue.ToEntero > 0, "", "Marca, "), If(TxtFechaI.Text <> "", "", "Fecha, "))) Alert(String.Format("Falta Seleccionar {0}{1}{2}", If(DdlVendedores.SelectedValue.ToEntero > 0, "", "Vendedor, "), If(DdlMarcas.SelectedValue.ToEntero > 0, "", "Marca, "), If(TxtFechaI.Text <> "", "", "Fecha, ")))
End If End If
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD")) RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD"))
@@ -94,6 +100,7 @@ Partial Class CatMetasVendedores
CveMetaVendedor = GvRow.DataKey("CveMeta").ToEntero CveMetaVendedor = GvRow.DataKey("CveMeta").ToEntero
DdlVendedores.SelectedValue = GvRow.DataKey("CveVendedor") DdlVendedores.SelectedValue = GvRow.DataKey("CveVendedor")
TxtFechaI.Text = GvRow.DataKey("MesAño") TxtFechaI.Text = GvRow.DataKey("MesAño")
DdlClasificacionSup.SelectedValue = GvRow.DataKey("CveClasificacionSup")
DdlClasificacion.SelectedValue = GvRow.DataKey("CveClasificacion") DdlClasificacion.SelectedValue = GvRow.DataKey("CveClasificacion")
DdlMarcas.SelectedValue = GvRow.DataKey("CveMarca") DdlMarcas.SelectedValue = GvRow.DataKey("CveMarca")
TxtMetaCantidad.Text = GvRow.DataKey("MetaCantidad") TxtMetaCantidad.Text = GvRow.DataKey("MetaCantidad")

View File

@@ -37,14 +37,16 @@
padding-right: 4px !important; padding-right: 4px !important;
padding-left: 4px !important; padding-left: 4px !important;
} }
.GrupoSuperior{
background-color:#000077; .GrupoSuperior {
color:white; background-color: #000077;
font-weight:bold; color: white;
} font-weight: bold;
.GrupoSuperior:hover{
background-color:#000077;
} }
.GrupoSuperior:hover {
background-color: #000077;
}
</style> </style>
</asp:Content> </asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server"> <asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
@@ -63,16 +65,15 @@
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server"> <asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel runat="server" ID="UpFiltros"> <asp:UpdatePanel runat="server" ID="UpFiltros">
<ContentTemplate> <ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter" style=""> <div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle" style="min-height: 122px; position: relative;"> <div class="portlet-title portlet-filterT smalltitle" style="min-height: 45px; position: relative;">
<div class="tools"> <div class="tools">
<asp:Button ID="btConsultar" CssClass="btn btn-primary" runat="server" ValidationGroup="GrpConsultar" Text="Consultar" /></td> <asp:Button ID="btConsultar" CssClass="btn btn-primary" runat="server" ValidationGroup="GrpConsultar" Text="Consultar" /></td>
<a href="javascript:;" data-idchekbox="<%= chkexpand.ClientID%>" class=" <%= IIf(chkexpand.Checked = True, "collapse", "expand")%>"></a> <a href="javascript;" data-idchekbox="<%= chkexpand.ClientID%>" class=" <%= IIf(chkexpand.Checked = True, "collapse", "expand")%>"></a>
<asp:CheckBox ID="chkexpand" CssClass="hidden" runat="server" /> <asp:CheckBox ID="chkexpand" CssClass="hidden" runat="server" />
</div> </div>
<div class="titlefiltros caption magindate"> <div class="titlefiltros caption magindate">
<div class="row"> <div class="row">
<div class="col-md-1 truncate text-right">Fecha del mes: </div> <div class="col-md-1 truncate text-right">Fecha del mes: </div>
<div class="col-md-3 col-sm-2"> <div class="col-md-3 col-sm-2">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 95px !important; padding: 0px;"> <div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 95px !important; padding: 0px;">
@@ -83,44 +84,12 @@
</div> </div>
<ajax:MaskedEditExtender ID="MaskedEditExtender1" runat="server" TargetControlID="TxtFechaMes" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender> <ajax:MaskedEditExtender ID="MaskedEditExtender1" runat="server" TargetControlID="TxtFechaMes" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CalendarExtender1" TargetControlID="TxtFechaMes" PopupButtonID="ImgFechaMes" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender> <ajax:CalendarExtender runat="server" ID="CalendarExtender1" TargetControlID="TxtFechaMes" PopupButtonID="ImgFechaMes" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
</div> </div>
<div class="col-md-1 text-right">Sucursal: </div> <div class="col-md-1 text-right">Sucursal: </div>
<div class="col-md-3"> <div class="col-md-3">
<asp:DropDownList ID="DdlSubProyectoFiltro" runat="server" CssClass="form-control input-sm select2me" Width="50%" DataValueField="CveSubProyecto" DataTextField="SubProyecto"></asp:DropDownList> <asp:DropDownList ID="DdlSubProyectoFiltro" runat="server" CssClass="form-control input-sm select2me" Width="50%" DataValueField="CveSubProyecto" DataTextField="SubProyecto"></asp:DropDownList>
</div> </div>
<label class="col-md-1 text-right">Marca: </label>
<div class="col-md-3">
<asp:DropDownList ID="DdlMarcaFiltro" runat="server" DataTextField="Marca" DataValueField="CveMarca" Class="table-group-action-input form-control input-inline input-sm select2me" Width="50%"></asp:DropDownList>
</div>
</div>
<div class="row" style="margin-top: 10px">
<label class="col-md-1 text-right">Vendedor: </label>
<div class="col-md-3">
<asp:DropDownList ID="DdlVendedorFiltro" runat="server" Class="table-group-action-input form-control input-inline input-sm select2me" Width="50%" DataValueField="CveVendedor" DataTextField="Vendedor"></asp:DropDownList>
</div>
<label class="col-md-1 text-right">Categoria: </label>
<div class="col-md-3">
<asp:DropDownList ID="DdlCategoria" runat="server" Class="table-group-action-input form-control input-inline input-sm select2me" Width="50%" DataValueField="CveCategoria" DataTextField="Categoria"></asp:DropDownList>
</div>
<label class="col-md-1 text-right">Clasificaciones: </label>
<div class="col-md-3">
<asp:DropDownList ID="DdlClasificaciones" runat="server" Class="table-group-action-input form-control input-inline input-sm select2me" Width="50%" DataValueField="CveClasificacion" DataTextField="Clasificacion"></asp:DropDownList>
</div>
</div>
<div class="row" style="margin-top: 10px">
<label class="col-md-1 text-right">Sub Clasificaciones: </label>
<div class="col-md-3">
<asp:DropDownList ID="DdlClasificacion2" runat="server" Class="table-group-action-input form-control input-inline input-sm select2me" Width="50%" DataValueField="CveClasificacion" DataTextField="Clasificacion"></asp:DropDownList>
</div>
<label class="col-md-1 text-right">Cliente: </label>
<div class="col-md-3">
<asp:DropDownList ID="DdlCliente" runat="server" Class="table-group-action-input form-control input-inline input-sm select2me" Width="50%" DataValueField="CveCliente" DataTextField="NombreComercial"></asp:DropDownList>
</div>
<label class="col-md-1 text-right">Grupo: </label> <label class="col-md-1 text-right">Grupo: </label>
<div class="col-md-3"> <div class="col-md-3">
<asp:DropDownList ID="DdlGrupo" runat="server" Class="table-group-action-input form-control input-inline input-sm select2me" Width="50%"> <asp:DropDownList ID="DdlGrupo" runat="server" Class="table-group-action-input form-control input-inline input-sm select2me" Width="50%">
@@ -130,13 +99,37 @@
</asp:DropDownList> </asp:DropDownList>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="portlet-body magindate" <%= IIf(chkexpand.Checked = True, "", "style=""display:none;""")%>> <div class="portlet-body magindate" <%= IIf(chkexpand.Checked = True, "", "style=""display:none;""")%>>
<div class="row"> <div class="row">
<label class="col-md-1 text-right">Vendedor: </label>
<div class="col-md-3">
<asp:DropDownList ID="DdlVendedorFiltro" runat="server" Class="table-group-action-input form-control input-inline input-sm select2me" Width="50%" DataValueField="CveVendedor" DataTextField="Vendedor"></asp:DropDownList>
</div>
<label class="col-md-1 text-right">Categoria: </label>
<div class="col-md-3">
<asp:DropDownList ID="DdlCategoria" runat="server" Class="table-group-action-input form-control input-inline input-sm select2me" Width="50%" DataValueField="CveCategoria" DataTextField="Categoria"></asp:DropDownList>
</div>
<label class="col-md-1 text-right">Clasificaciones: </label>
<div class="col-md-3">
<asp:DropDownList ID="DdlClasificaciones" runat="server" Class="table-group-action-input form-control input-inline input-sm select2me" Width="50%" DataValueField="CveClasificacion" DataTextField="Clasificacion"></asp:DropDownList>
</div>
</div> </div>
<div class="row"> <div class="row">
<label class="col-md-1 text-right">Sub Clasificaciones: </label>
<div class="col-md-3">
<asp:DropDownList ID="DdlClasificacion2" runat="server" Class="table-group-action-input form-control input-inline input-sm select2me" Width="50%" DataValueField="CveClasificacion" DataTextField="Clasificacion"></asp:DropDownList>
</div>
<label class="col-md-1 text-right">Cliente: </label>
<div class="col-md-3">
<asp:DropDownList ID="DdlCliente" runat="server" Class="table-group-action-input form-control input-inline input-sm select2me" Width="50%" DataValueField="CveCliente" DataTextField="NombreComercial"></asp:DropDownList>
</div>
<label class="col-md-1 text-right">Marca: </label>
<div class="col-md-3">
<asp:DropDownList ID="DdlMarcaFiltro" runat="server" DataTextField="Marca" DataValueField="CveMarca" Class="table-group-action-input form-control input-inline input-sm select2me" Width="50%"></asp:DropDownList>
</div>
</div> </div>
<div id="DivFamiliaSubFamilia" class="row" runat="server" visible="false"> <div id="DivFamiliaSubFamilia" class="row" runat="server" visible="false">
</div> </div>
@@ -148,7 +141,7 @@
<asp:UpdatePanel ID="UPDatos" runat="server" RenderMode="Inline" UpdateMode="Conditional"> <asp:UpdatePanel ID="UPDatos" runat="server" RenderMode="Inline" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<asp:GridView ID="GV" runat="server" GridLines="None" BorderWidth="0" UseAccessibleHeader="true" DataKeyNames="Titulo,Etiqueta,RealMes,VtaMesAA,RealAcumulado,RealMesPorcentaje" <asp:GridView ID="GV" runat="server" GridLines="None" BorderWidth="0" UseAccessibleHeader="true" DataKeyNames="Titulo,Etiqueta,RealMes,VtaMesAA,RealAcumulado,RealMesPorcentaje"
CssClass="table table-striped table-advance Widthall ScrollAD" data-sort="true" ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true" CssClass="table table-advance Widthall ScrollAD" data-sort="true" ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true"
AutoGenerateColumns="False" AllowPaging="False" ShowFooter="False"> AutoGenerateColumns="False" AllowPaging="False" ShowFooter="False">
<Columns> <Columns>
<asp:TemplateField HeaderText="Grupo" ItemStyle-HorizontalAlign="Left"> <asp:TemplateField HeaderText="Grupo" ItemStyle-HorizontalAlign="Left">

View File

@@ -80,16 +80,16 @@ Partial Class MetasVendedores
Select Case e.Row.DataKey("Etiqueta") Select Case e.Row.DataKey("Etiqueta")
Case "GrupoSuperior" Case "GrupoSuperior"
e.Row.CssClass = "GrupoSuperior" e.Row.CssClass = "GrupoSuperior"
e.Row.FCLabel("lblRealMes").Text = "" ' e.Row.FCLabel("lblRealMes").Text = ""
e.Row.FCLabel("lblVtaMesAA").Text = "" ' e.Row.FCLabel("lblVtaMesAA").Text = ""
e.Row.FCLabel("lblObjMes").Text = "" ' e.Row.FCLabel("lblObjMes").Text = ""
e.Row.FCLabel("lblRealAcumulado").Text = "" ' e.Row.FCLabel("lblRealAcumulado").Text = ""
e.Row.FCLabel("lblRealMesPorcentaje").Text = "" ' e.Row.FCLabel("lblRealMesPorcentaje").Text = ""
e.Row.FCLabel("lblAAntAcumulado").Text = "" ' e.Row.FCLabel("lblAAntAcumulado").Text = ""
e.Row.FCLabel("lblObjAcumulado").Text = "" ' e.Row.FCLabel("lblObjAcumulado").Text = ""
e.Row.FCLabel("lblVarVSAAPerc").Text = "" ' e.Row.FCLabel("lblVarVSAAPerc").Text = ""
e.Row.FCLabel("lblVarVSAA").Text = "" ' e.Row.FCLabel("lblVarVSAA").Text = ""
e.Row.FCLabel("lblVarVSObjAcum").Text = "" ' e.Row.FCLabel("lblVarVSObjAcum").Text = ""
Case "Categoria" Case "Categoria"
e.Row.CssClass = "Totales" e.Row.CssClass = "Totales"
Case "Clasificacion" Case "Clasificacion"

View File

@@ -3017,7 +3017,7 @@
return; return;
//AUTOMOTRIZ-ACUMULADORES //AUTOMOTRIZ-ACUMULADORES
} else { } else {
let regex = new RegExp("^[1X]|^[0-9][A-HJ-M]([[0-2][0-9]|3[0-1])[0-9A-Z][ACEN][2-5]$"); let regex = new RegExp("^[1X]|^[0-9][A-HJ-M][0-3][0-9][A-Z][ACEN][2-5]$");
arguments.IsValid = regex.test(arguments.Value); arguments.IsValid = regex.test(arguments.Value);
return; return;
} }

View File

@@ -144,10 +144,10 @@ Partial Class Ventas_RepIngresos
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
Dim FI As String = If(TxtFechaInicio.Text = "", "", $"&emsp;<b>Fecha Inicio:</b>&nbsp;{TxtFechaInicio.Text}") Dim FI As String = If(TxtFechaInicio.Text = "", "", $"Fecha Inicio: {TxtFechaInicio.Text} ")
Dim FF As String = If(TxtFechaFin.Text = "", "", $"&emsp;<b>Fecha Fin:</b>&nbsp;{TxtFechaFin.Text}") Dim FF As String = If(TxtFechaFin.Text = "", "", $"Fecha Fin: {TxtFechaFin.Text} ")
Dim Tipo As String = If(DdlTipoDocto.SelectedValue = "-1", "", $"&emsp;<b>Tipo Docto.:</b>&nbsp;{DdlTipoDocto.SelectedItem.Text}") Dim Tipo As String = If(DdlTipoDocto.SelectedValue = "", "", $"Tipo Docto: {DdlTipoDocto.GetSelectedText} ")
Dim subProy As String = If(DdlSubProyecto.SelectedValue = "-1", "", $"&emsp;<b>SubProyecto:</b>&nbsp;{DdlSubProyecto.SelectedItem.Text}") Dim subProy As String = If(DdlSubProyecto.SelectedValue = "", "", $"SubProyecto: {DdlSubProyecto.GetSelectedText} ")
If DtDatos IsNot Nothing AndAlso DtDatos.Rows.Count > 0 Then If DtDatos IsNot Nothing AndAlso DtDatos.Rows.Count > 0 Then
@@ -156,7 +156,7 @@ Partial Class Ventas_RepIngresos
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)) params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
params.Add(New ReportParameter("AgrupadoPor", $"{FI}{FF}{Tipo}{subProy}")) params.Add(New ReportParameter("AgrupadoPor", $"{FI}{FF}{Tipo}{subProy}"))
params.Add(New ReportParameter("FechaImpresion", DateAndTime.Now))
If Imagen.Exists Then If Imagen.Exists Then
params.Add(New ReportParameter("LogoPath", logouri)) params.Add(New ReportParameter("LogoPath", logouri))
Else Else

View File

@@ -1599,7 +1599,7 @@
<div class="portlet box purpleAlmacen" id="DivSalidaAlmacen" runat="server"> <div class="portlet box purpleAlmacen" id="DivSalidaAlmacen" runat="server">
<div class="portlet-title"> <div class="portlet-title">
<div class="caption"> <div class="caption">
<i class="fa fa-dropbox"></i>Salida Almacen <i class="fa fa-dropbox"></i><asp:Literal ID="LltSalidaAlmacen" runat="server" Text="Salida Almacen"></asp:Literal>
</div> </div>
<div class="tools"> <div class="tools">
<a href="javascript:;" class="collapse"></a> <a href="javascript:;" class="collapse"></a>

View File

@@ -6245,7 +6245,7 @@ Partial Class Ventas
End If End If
If CveVenta > 0 And DdlTipoComprobante.SelectedValue <> "Cot" Then If (CveVenta > 0 And DdlTipoComprobante.SelectedValue <> "Cot") AndAlso Not AplicaDevolucion Then
If e.Row.DBCampo("CveConcepto").ToEntero = 3 Then CveAlmacenDevolucion = e.Row.DBCampo("CveAlmacen").ToEntero If e.Row.DBCampo("CveConcepto").ToEntero = 3 Then CveAlmacenDevolucion = e.Row.DBCampo("CveAlmacen").ToEntero
e.Row.FCCheckBox("cbInv").Visible = False e.Row.FCCheckBox("cbInv").Visible = False
End If End If
@@ -10997,9 +10997,9 @@ Partial Class Ventas
Dim OcurrioError As Boolean = False Dim OcurrioError As Boolean = False
Try Try
If UsuarioActual.Empresa.UsaInventarios AndAlso factura.TipoDocto.Contiene("Ing", "Egs", "Rem") Then If UsuarioActual.Empresa.UsaInventarios AndAlso factura.TipoDocto.Contiene("Ing", "Egs", "Rem", "Dev") Then
If RemisionesLista.Count > 0 Then If RemisionesLista.Count > 0 AndAlso factura.TipoDocto.Contiene("Ing", "Egs", "Rem") Then
For Each CveRemision As Integer In RemisionesLista For Each CveRemision As Integer In RemisionesLista
'El almacen general es el Primer Almacen de Material en la Sucursal 'El almacen general es el Primer Almacen de Material en la Sucursal
If Not TraspasoAlmacen(ObjInventario, CveRemision, ObjConta, True, 9) Then If Not TraspasoAlmacen(ObjInventario, CveRemision, ObjConta, True, 9) Then
@@ -11011,8 +11011,28 @@ Partial Class Ventas
If GvInv.Rows.Cast(Of GridViewRow)().Count(Function(gvr) gvr.FCCheckBox("cbInv").Checked) > 0 Then If GvInv.Rows.Cast(Of GridViewRow)().Count(Function(gvr) gvr.FCCheckBox("cbInv").Checked) > 0 Then
Dim Filtro As String = ""
Select Case factura.TipoDocto
Case "Ing", "Ped"
Filtro = "CveConcepto IN (3,40)"
Case "Dev"
Filtro = "CveConcepto IN (3,40)"
Case Else
Filtro = "CveConcepto = 9"
End Select
Dim DtExistencias As DataTable = Nothing
If ObjInventario.GetInv_Mov(Me.CveVentaDevolucion, UsuarioActual.CveEmpresa) Then
DtExistencias = ObjInventario.DtResultados.FiltraParametros($"CvePS Is Not NULL AND {Filtro}")
End If
Dim CveConceptoAlmacen As Integer = 3
If factura.TipoDocto = "Dev" Then
CveConceptoAlmacen = 18
End If
Dim CveAlmacen = ddlAlmacen.SelectedValue.ToEntero 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/E1") Dim CveMovimientoInventario As Integer = ObjInventario.AddMovimiento(CveAlmacen, CveConceptoAlmacen, factura.CveMoneda, factura.Fecha, -1, factura.CveUsuario, factura.CveEmpresa, -1, factura.CveVenta, -1, -1, Modulo:="Vta/E1")
If CveMovimientoInventario <= 0 Then If CveMovimientoInventario <= 0 Then
OcurrioError = True OcurrioError = True
@@ -11024,8 +11044,7 @@ Partial Class Ventas
Dim CveUnidad As Integer Dim CveUnidad As Integer
Dim CveProducto As Integer Dim CveProducto As Integer
Dim Existencia As Double Dim Existencia As Double
'Dim Pu As Double Dim PU As Decimal = 0
'DtInv.Clone()
Dim DtEquivalencias As DataTable Dim DtEquivalencias As DataTable
@@ -11042,7 +11061,7 @@ Partial Class Ventas
Exit For Exit For
End If End If
If UsuarioActual.CveEmpresa.Contiene({72, 80, 119}) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Rem", "Ing") AndAlso Dr("EntregaDirecta").ToString.ToEntero < 1 Then If CveConceptoAlmacen = 3 AndAlso UsuarioActual.CveEmpresa.Contiene({72, 80, 119}) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Rem", "Ing") AndAlso Dr("EntregaDirecta").ToString.ToEntero < 1 Then
Existencia = ObjInventario.GetExistenciasPS(CveProducto, CveUnidad, UsuarioActual.CveEmpresa, CveAlmacen, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeAdelantado:=1, RestringirAlmacenes:=1, ExcluyeApartados:=1) Existencia = ObjInventario.GetExistenciasPS(CveProducto, CveUnidad, UsuarioActual.CveEmpresa, CveAlmacen, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeAdelantado:=1, RestringirAlmacenes:=1, ExcluyeApartados:=1)
If Existencia < Cantidad Then If Existencia < Cantidad Then
OcurrioError = True OcurrioError = True
@@ -11066,7 +11085,17 @@ Partial Class Ventas
End If End If
If CveProducto > 0 Then If CveProducto > 0 Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, Cantidad, CveUnidad, CveProducto, 0, -1, SerieLote:=Dr("SerieLote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then 'SI ES ENTRADA DEBE TENER EL COSTO DE LA SALIDA
If CveConceptoAlmacen.Contiene(18) Then
PU = DtExistencias.FiltroPrimeroValor("PU", $"CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString.ToEntero}").ToString.ToDecimal
If PU <= 0 Then
ErrorList.Add("Ocurrió un error al obtener el costo.<br />")
OcurrioError = True
Exit For
End If
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, Cantidad, CveUnidad, CveProducto, PU, -1, SerieLote:=Dr("SerieLote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then
OcurrioError = True OcurrioError = True
ErrorList.Add("Ocurrió un error al agregar los Movimientos de salida al Inventario.<br />") ErrorList.Add("Ocurrió un error al agregar los Movimientos de salida al Inventario.<br />")
Exit For Exit For
@@ -11078,6 +11107,7 @@ Partial Class Ventas
End If End If
End If End If
PU = 0
i = i + 1 i = i + 1
Next Next
@@ -11086,6 +11116,15 @@ Partial Class Ventas
Dim DtCostos As DataTable = Nothing Dim DtCostos As DataTable = Nothing
Dim ValorInventario As Decimal = 0 Dim ValorInventario As Decimal = 0
Dim TotalCosto As Decimal = 0 Dim TotalCosto As Decimal = 0
Dim TipoMovto68 As Boolean = True
Dim TipoMovto69 As Boolean = False
If CveConceptoAlmacen.Contiene(18) Then
TipoMovto68 = False
TipoMovto69 = True
End If
If ObjInventario.GetMovimientosDetalle(CveMovimientoInventario, UsuarioActual.CveEmpresa) Then If ObjInventario.GetMovimientosDetalle(CveMovimientoInventario, UsuarioActual.CveEmpresa) Then
DtCostos = ObjInventario.DtResultados DtCostos = ObjInventario.DtResultados
TotalCosto = DtCostos.SUMD("Total").RoundSQL TotalCosto = DtCostos.SUMD("Total").RoundSQL
@@ -11110,7 +11149,7 @@ Partial Class Ventas
CveCuenta = GlobalDTClasificaciones(factura.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero CveCuenta = GlobalDTClasificaciones(factura.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero
If ValorInventario <> 0 Then If ValorInventario <> 0 Then
If Not ObjConta.AddPrePolizasDetalle(factura.CvePrePoliza, False, ValorInventario, factura.SerieFolio, 69, factura.SerieFolio, factura.Fecha, IdCtaContable, -1, CveVenta:=factura.CveVenta, CveCliente:=factura.CveCliente, CveSubProyecto:=factura.CveSubProyecto, CveClasificacion:=RowInv("CveClasificacion").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=ValorInventario, CveCuenta:=CveCuenta) Then If Not ObjConta.AddPrePolizasDetalle(factura.CvePrePoliza, TipoMovto69, ValorInventario, factura.SerieFolio, 69, factura.SerieFolio, factura.Fecha, IdCtaContable, -1, CveVenta:=factura.CveVenta, CveCliente:=factura.CveCliente, CveSubProyecto:=factura.CveSubProyecto, CveClasificacion:=RowInv("CveClasificacion").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=ValorInventario, CveCuenta:=CveCuenta) Then
OcurrioError = True OcurrioError = True
End If End If
End If End If
@@ -11120,15 +11159,16 @@ Partial Class Ventas
IdCtaContable = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", CveAlmacen)).ToEntero IdCtaContable = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", CveAlmacen)).ToEntero
If TotalCosto <> 0 Then If TotalCosto <> 0 Then
If Not ObjConta.AddPrePolizasDetalle(factura.CvePrePoliza, True, TotalCosto, factura.SerieFolio, 68, factura.SerieFolio, factura.Fecha, IdCtaContable, -1, CveVenta:=factura.CveVenta, CveCliente:=factura.CveCliente, CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=TotalCosto, CveCuenta:=CveCuenta, CveSubProyecto:=factura.CveSubProyecto) Then If Not ObjConta.AddPrePolizasDetalle(factura.CvePrePoliza, TipoMovto68, TotalCosto, factura.SerieFolio, 68, factura.SerieFolio, factura.Fecha, IdCtaContable, -1, CveVenta:=factura.CveVenta, CveCliente:=factura.CveCliente, CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=TotalCosto, CveCuenta:=CveCuenta, CveSubProyecto:=factura.CveSubProyecto) Then
OcurrioError = True OcurrioError = True
End If End If
End If End If
factura.Inv_CveMovimiento = CveMovimientoInventario
factura.Inv_ValorInventario = ValorInventario
End If End If
factura.Inv_CveMovimiento = CveMovimientoInventario
factura.Inv_ValorInventario = ValorInventario
End If End If
End If End If
@@ -17651,17 +17691,17 @@ Partial Class Ventas
End Sub End Sub
Private Function ValidaPagosContado() As Boolean Private Function ValidaPagosContado() As Boolean
Dim Retorno = False Dim Retorno = False
Dim Total As Decimal = TxtTotal.Text.ToDecimal()
'SI LA VENTA ES NUEVA VALIDAR TAMBIEN LOS PAGOS DE CONTADO 'SI LA VENTA ES NUEVA VALIDAR TAMBIEN LOS PAGOS DE CONTADO
If UsuarioActual.CveEmpresa = 141 AndAlso CveVenta <= 0 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant") Then If UsuarioActual.CveEmpresa = 141 AndAlso CveVenta <= 0 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant") Then
If Not PermiteCredito AndAlso (DtPagos Is Nothing OrElse DtPagos.Rows.Count = 0) Then If Not PermiteCredito AndAlso (DtPagos Is Nothing OrElse DtPagos.Rows.Count = 0) AndAlso Total > 0 Then
Alert("Es necesario especificar un pago.", TipoMensaje.MsgAdvertencia) Alert("Es necesario especificar un pago.", TipoMensaje.MsgAdvertencia)
Retorno = True Retorno = True
Return Retorno Return Retorno
End If End If
If Not PermiteCredito AndAlso DtPagos IsNot Nothing AndAlso DtPagos.Rows.Count > 0 Then If Not PermiteCredito AndAlso (DtPagos IsNot Nothing AndAlso DtPagos.Rows.Count > 0) AndAlso Total > 0 Then
Dim Total As Decimal = TxtTotal.Text.ToDecimal()
Dim TotalPago As Decimal = DtPagos.SUM("Importe").ToDecimal() Dim TotalPago As Decimal = DtPagos.SUM("Importe").ToDecimal()
If TotalPago < Total Then If TotalPago < Total Then
@@ -17682,8 +17722,8 @@ Partial Class Ventas
If UsuarioActual.CveEmpresa = 141 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant") Then If UsuarioActual.CveEmpresa = 141 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant") Then
If Not PermiteCredito AndAlso DtPagos IsNot Nothing AndAlso DtPagos.Rows.Count > 0 Then If Not PermiteCredito AndAlso DtPagos IsNot Nothing AndAlso DtPagos.Rows.Count > 0 AndAlso Total > 0 Then
Dim Total As Decimal = TxtTotal.Text.ToDecimal()
Dim TotalPago As Decimal = DtPagos.SUM("Importe").ToDecimal() Dim TotalPago As Decimal = DtPagos.SUM("Importe").ToDecimal()
If TotalPago < Total Then If TotalPago < Total Then
@@ -22200,47 +22240,34 @@ Partial Class Ventas
'AGREGAR LOS USADOS EN LA DEVOLUCION 'AGREGAR LOS USADOS EN LA DEVOLUCION
CalculaUsados(DtUsados) CalculaUsados(DtUsados)
'If DtUsados IsNot Nothing AndAlso DtUsados.Rows.Count > 0 Then
' Dim DtPSVenta As DataTable = TmpDT.Copy()
' For Each Row As DataRow In DtPSVenta.Rows
' Dim RowCargo As DataRow = DTTamanios.FiltroPrimero($"CveTamaño = { Row("CveTamaño").ToString.ToEntero } ")
' If RowCargo IsNot Nothing Then
' Dim CvePSCargo As Integer = RowCargo("CvePSCargo").ToString.ToEntero
' For Each RowUsado As DataRow In DtUsados.FiltraParametros($"CvePS = {CvePSCargo}").Rows
' 'If drow("CvePS").ToString.ToEntero = drow2("CvePSCargo").ToString.ToEntero Then
' 'End If
' Dim Cantidad As Decimal = RowUsado("Cantidad").ToString().ToDecimal()
' Dim Descuento As Decimal = Cantidad * RowUsado("Descuento").ToString.ToDecimal / RowUsado("Cantidad").ToString.ToDecimal
' Dim PU As Decimal = RowUsado("PU").ToString().ToDecimal()
' Dim Total As Decimal = (Cantidad * PU)
' Dim TotalImpuestos As Decimal = (Cantidad * PU) - Descuento
' Dim ImporteIVA As Decimal = TotalImpuestos * RowUsado("PorcentajeIVA").ToString.ToDecimal
' Dim ImporteRetIVA As Decimal = TotalImpuestos * RowUsado("PorcentajeRetIVA").ToString.ToDecimal
' Dim ImporteRetISR As Decimal = TotalImpuestos * RowUsado("PorcentajeRetISR").ToString.ToDecimal
' Dim ImporteIEPS As Decimal = TotalImpuestos * RowUsado("PorcentajeIEPS").ToString.ToDecimal
' AgregaTempDT(TmpDT, RowUsado("CvePS").ToString.ToEntero, RowUsado("PS").ToString, RowUsado("Codigo").ToString, RowUsado("CodigoPS").ToString,
' RowUsado("CveTipoPS").ToString.ToEntero, RowUsado("CveTipoInvPS").ToString.ToEntero,
' RowUsado("CveUM").ToString.ToEntero, RowUsado("UM").ToString, RowUsado("CveClasificacion").ToString.ToEntero,
' RowUsado("Clasificacion").ToString, RowUsado("CveProyecto").ToString.ToEntero, RowUsado("Proyecto").ToString,
' RowUsado("CveSubProyecto").ToString.ToEntero, RowUsado("SubProyecto").ToString,
' RowUsado("Obs").ToString, Cantidad, PU, RowUsado("PorcentajeIVA").ToString.ToDecimal, ImporteIVA,
' RowUsado("PorcentajeRetIVA").ToString.ToDecimal, ImporteRetIVA,
' RowUsado("PorcentajeRetISR").ToString.ToDecimal, ImporteRetISR, RowUsado("PorcentajeIEPS").ToString.ToDecimal,
' ImporteIEPS, -1, Descuento, Total, "", "", -1, -1,
' RowUsado("SATClaveProdServ").ToString, RowUsado("SATClaveUM").ToString, -1, RowUsado("CveVentaDetalle").ToString.ToEntero, -1, -1, -1, -1)
' Next
' End If
' Next
'End If
TrTipoRelacion.Visible = True TrTipoRelacion.Visible = True
DdlTiposRelacion.SelectedValueExist("3") DdlTiposRelacion.SelectedValueExist("3")
LimpiaDocumentoDEV() LimpiaDocumentoDEV()
If UsuarioActual.Empresa.Funcionalidad(567) = "1" Then
DivAlmacen.Visible = True
LltSalidaAlmacen.Text = "Devolución Almacen"
Dim DTAlmacen As DataTable
ddlAlmacen.Items.Clear()
DTAlmacen = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa).FiltraParametros($"CveSubProyecto = {DdlSubProyectoDatos.SelectedValue.ToEntero}")
ddlAlmacen.DataSource = DTAlmacen
If DTAlmacen Is Nothing Or DTAlmacen.Rows.Count = 0 Then
ddlAlmacen.Items.Insert(0, New ListItem(" Seleccione ", "-1"))
ddlAlmacen.SelectedValue = "-1"
End If
ddlAlmacen.DataBind()
If GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa).FiltraParametros($"CveSubProyecto = {DdlSubProyectoDatos.SelectedValue.ToEntero}").Rows.Count > 0 Then
ddlAlmacen.SelectedValueExist(UsuarioActual.CveAlmacen)
End If
GvInv.Columns(0).Visible = True
DtInv = TmpDT.Copy.FiltraParametros("CveTipoPS = 2")
CargaGVInv(DtInv)
End If
CambiaTipoDocto() CambiaTipoDocto()
CargaNC(CveVenta) CargaNC(CveVenta)
CalculaTotalesVenta() CalculaTotalesVenta()
@@ -24243,15 +24270,15 @@ Partial Class Ventas
Dim Retorno As Boolean = True Dim Retorno As Boolean = True
If UsuarioActual.CveEmpresa = 141 Then If UsuarioActual.CveEmpresa = 141 Then
If Not PermiteCredito AndAlso (DtPagos Is Nothing OrElse DtPagos.Rows.Count = 0) Then Dim Total As Decimal = TxtTotal.Text.ToDecimal()
If Not PermiteCredito AndAlso ((DtPagos Is Nothing OrElse DtPagos.Rows.Count = 0) AndAlso Total > 0) Then
Alert("Es necesario especificar un pago.", TipoMensaje.MsgAdvertencia) Alert("Es necesario especificar un pago.", TipoMensaje.MsgAdvertencia)
Retorno = False Retorno = False
Return Retorno Return Retorno
End If End If
If Not PermiteCredito AndAlso DtPagos IsNot Nothing AndAlso DtPagos.Rows.Count > 0 Then If Not PermiteCredito AndAlso DtPagos IsNot Nothing AndAlso DtPagos.Rows.Count > 0 AndAlso Total > 0 Then
Dim Total As Decimal = TxtTotal.Text.ToDecimal()
Dim TotalPago As Decimal = DtPagos.SUM("Importe").ToDecimal() Dim TotalPago As Decimal = DtPagos.SUM("Importe").ToDecimal()
If TotalPago < Total Then If TotalPago < Total Then