This commit is contained in:
HECTOR RODRIGUEZ
2021-03-11 16:57:42 -07:00
25 changed files with 3620 additions and 3179 deletions

View File

@@ -585,6 +585,14 @@
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpTurno" runat="server" UpdateMode="Conditional" class=" xspadding .nolineheight bordered whitoutcol" style="color: white;">
<ContentTemplate>
<div id="DivBloqueo" runat="server" style="width: 100%; text-align: center;" visible="false">
<asp:Button ID="BtnBloquearAcceso" CssClass="btn red-haze btn-outline btn-circle btn-sm" runat="server" Text="Bloquear Turno" OnClick="BtnBloquearAcceso_Click" />
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div>
@@ -833,7 +841,7 @@
<td>
<asp:UpdatePanel runat="server">
<ContentTemplate>
<asp:TextBox ID="TxtTotal" runat="server" ClientIDMode="Static" BorderStyle="None" Style="text-align: right; font-weight:bold" Text="0.00" Width="78px" ReadOnly="true"></asp:TextBox>
<asp:TextBox ID="TxtTotal" runat="server" ClientIDMode="Static" BorderStyle="None" Style="text-align: right; font-weight: bold" Text="0.00" Width="78px" ReadOnly="true"></asp:TextBox>
<asp:HiddenField ID="HdnVentaSaldo" runat="server" ClientIDMode="Static" Value="0" />
<asp:HiddenField ID="HdnTotalVenta" runat="server" ClientIDMode="Static" Value="0" />
</ContentTemplate>
@@ -1917,6 +1925,45 @@
</asp:Panel>
<!-- ModalPopupExtender -->
<%-- ******************************************** Bloqueo de Caja *************************************************************************************************************************************** --%>
<asp:Button ID="BtnShowBloqueo" runat="server" Text="Show Modal Popup" Style="visibility: hidden; display: none;" />
<asp:Button ID="BtnCloseBloqueo" runat="server" CssClass="btn btn-danger" Style="visibility: hidden; display: none;" Text="Cancelar" />
<!-- ModalPopupExtender -->
<cc1:ModalPopupExtender ID="mpeBloque" runat="server" PopupControlID="PanelBloqueo" TargetControlID="BtnShowBloqueo"
BackgroundCssClass="modalBackground">
</cc1:ModalPopupExtender>
<asp:Panel ID="PanelBloqueo" runat="server" CssClass="modalPopup" align="center" Style="display: none">
<table border="0" width="250px" cellspacing="1" style="background-color: White; padding-left: 10px;">
<tr style="background-color: #3598dc; color: #FFFFFF; font-size: 14px; text-align:center">
<td colspan="2"><asp:Label runat="server" Text="<i class='fa fa-lock fa-2 icontxt'></i>&nbsp;Acceso Restringido"/></td>
</tr>
<tr>
<td colspan="1">&nbsp;</td>
<td colspan="1">&nbsp;</td>
</tr>
<tr>
<td colspan="1">
<asp:Label runat="server" Text="Código de Acceso:" Font-Bold="true" Width="120px" />
</td>
<td colspan="1">
<asp:TextBox ID="TxtCodigoAcceso" runat="server" type="password" ></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVCodigoAcceso" runat="server" ControlToValidate="TxtCodigoAcceso" Display="None" ErrorMessage="<span class='has-error'><span id='username-error' class='help-block'>El campo <b>''Código de Acceso''</b> es necesario.</span></span>" ValidationGroup="GrpValidarCodigo"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td colspan="1">&nbsp;</td>
<td colspan="1">&nbsp;</td>
</tr>
</table>
<asp:Button ID="BtnCambiar" runat="server" CssClass="btn btn-success btn-sm" Text="Desbloquear" ValidationGroup="GrpValidarCodigo" OnClick="BtnCambiar_Click" />
&nbsp;
</asp:Panel>
<!-- ModalPopupExtender -->
<div id="DivEstadoCaja" class="modal ADS fade" role="dialog">
<div class="modal-dialog" style="width: 470px; min-width: 470px;">
<div class="modal-content">
@@ -2656,6 +2703,16 @@
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlMarcaPS" CssClass="form-control input-sm select2me" runat="server" DataTextField="Marca" DataValueField="CveMarca" Width="100%" OnSelectedIndexChanged="DdlMarcaPS_SelectedIndexChanged" AutoPostBack="true">
<asp:ListItem Selected="True" Text="Seleccione la Marca (Todas)" Value="-1"></asp:ListItem>
</asp:DropDownList>
<label for="<%= DdlMarcaPS.ClientID.ToString()%>">Marca:</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="form-group form-md-line-input input-iconright">
@@ -2840,6 +2897,16 @@
<br />
<div class="row">
<div class="col-md-9">
<div class="row">
<div class="col-md-12">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlMarcaPSAjuste" CssClass="form-control input-sm select2me" runat="server" DataTextField="Marca" DataValueField="CveMarca" Width="100%" OnSelectedIndexChanged="DdlMarcaPS_SelectedIndexChanged" AutoPostBack="true">
<asp:ListItem Selected="True" Text="Seleccione la Marca (Todas)" Value="-1"></asp:ListItem>
</asp:DropDownList>
<label for="<%= DdlMarcaPSAjuste.ClientID.ToString()%>">Marca:</label>
</div>
</div>
</div>
<div class="form-group form-md-line-input input-iconright">
<ADS:Dropdownlost ID="DdlPSAjuste" CssStyle="width: 100%;" CssClass=" form-control input-sm DdlPS" IncluyeTodos="false" CssClassDdl="select2me form-control" runat="server" CausesValidation="true" DataTextField="PSCodigo" DataValueField="CvePS" Onselectedindexchange="DdlPSAjuste_selectedindexchange"></ADS:Dropdownlost>
<asp:HiddenField ID="HdnPSAjusteMarca" ClientIDMode="Static" runat="server" Value="-1" />
@@ -2868,7 +2935,7 @@
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtEtiqueta" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox>
<label for="<%= TxtEtiqueta.ClientID.ToString()%>">Etiqueta:</label>
<label for="<%= TxtEtiqueta.ClientID.ToString()%>">Etiqueta:</label>
</div>
</div>
</div>
@@ -2945,11 +3012,11 @@
</div>
<div class="col-md-4">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtMesesUso" CssClass="form-control" runat="server" MaxLength="50" Enabled="false" style="font-weight:bold; font-size:20pt;"></asp:TextBox>
<asp:TextBox ID="TxtMesesUso" CssClass="form-control" runat="server" MaxLength="50" Enabled="false" Style="font-weight: bold; font-size: 20pt;"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVMesesUso" runat="server" ControlToValidate="TxtMesesUso" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Meses de Uso''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEMesesUso" runat="server" HighlightCssClass="vco" TargetControlID="RFVMesesUso"></ajax:ValidatorCalloutExtender>
<ajax:FilteredTextBoxExtender ID="FTBEMesesUso" runat="server" TargetControlID="TxtMesesUso" FilterType="Custom, Numbers" ValidChars="." />
<label for="<%= TxtMesesUso.ClientID.ToString()%>" style="font-weight:bold">Meses de Uso:</label>
<label for="<%= TxtMesesUso.ClientID.ToString()%>" style="font-weight: bold">Meses de Uso:</label>
</div>
</div>
</div>
@@ -2974,11 +3041,11 @@
</div>
<div class="col-md-4">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtPorcentajeAjuste" CssClass="form-control" Enabled="false" runat="server" MaxLength="50" style="font-weight:bold; font-size:20pt;"></asp:TextBox>
<asp:TextBox ID="TxtPorcentajeAjuste" CssClass="form-control" Enabled="false" runat="server" MaxLength="50" Style="font-weight: bold; font-size: 20pt;"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVPorcentajeAjuste" runat="server" ControlToValidate="TxtPorcentajeAjuste" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''% Ajuste''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEPorcentajeAjuste" runat="server" HighlightCssClass="vco" TargetControlID="RFVPorcentajeAjuste"></ajax:ValidatorCalloutExtender>
<ajax:FilteredTextBoxExtender ID="FTBEPorcentajeAjuste" runat="server" TargetControlID="TxtPorcentajeAjuste" FilterType="Custom, Numbers" ValidChars="." />
<label for="<%= TxtPorcentajeAjuste.ClientID.ToString()%>" style="font-weight:bold">% Ajuste:</label>
<label for="<%= TxtPorcentajeAjuste.ClientID.ToString()%>" style="font-weight: bold">% Ajuste:</label>
</div>
</div>
</div>
@@ -3008,11 +3075,11 @@
<div class="row" style="margin-top: 17px;">
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtImporteAjuste" CssClass="form-control" runat="server" Enabled="false" MaxLength="50" ></asp:TextBox>
<asp:TextBox ID="TxtImporteAjuste" CssClass="form-control" runat="server" Enabled="false" MaxLength="50"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVImporteAjuste" runat="server" ControlToValidate="TxtImporteAjuste" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Importe''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEImporteAjuste" runat="server" HighlightCssClass="vco" TargetControlID="RFVImporteAjuste"></ajax:ValidatorCalloutExtender>
<ajax:FilteredTextBoxExtender ID="FTBEImporteAjuste" runat="server" TargetControlID="TxtImporteAjuste" FilterType="Custom, Numbers" ValidChars="." />
<label for="<%= TxtImporteAjuste.ClientID.ToString()%>" style="font-weight:bold">Importe:</label>
<label for="<%= TxtImporteAjuste.ClientID.ToString()%>" style="font-weight: bold">Importe:</label>
</div>
</div>
<div class="col-md-6">
@@ -3046,6 +3113,20 @@
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
<script type="text/javascript">
// Get the input field
var txtCodigoAcceso = document.getElementById("C_TxtCodigoAcceso");
// Execute a function when the user releases a key on the keyboard
txtCodigoAcceso.addEventListener("keyup", function (event) {
// Number 13 is the "Enter" key on the keyboard
if (event.keyCode === 13) {
// Cancel the default action, if needed
event.preventDefault();
// Trigger the button element with a click
document.getElementById("C_BtnCambiar").click();
}
});
function ValidarCodigoEnsamble(source, arguments) {
let CveMarca = HdnPSAjusteMarca.value;
let CveClasificacion = HdnPSAjusteClasificacion.value;

View File

@@ -9,6 +9,7 @@ Imports System.Security.Cryptography.X509Certificates
Imports System.Globalization
Imports System.Net.Http
Imports Microsoft.Reporting.WebForms
Imports ADSSession
Partial Class PV
Inherits ClsPaginas
@@ -1007,6 +1008,25 @@ Partial Class PV
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
If UsuarioActual.Empresa.Funcionalidad(599) = "1" Then
Dim DrUsuario As DataRow = GlobalDTUsuarios(CveUsuario:=UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).Rows(0)
If DrUsuario("CodigoAcceso").ToString() <> "" Then
If UsuarioActual.SesionBloqueada Then
DivBloqueo.Visible = False
TxtCodigoAcceso.Focus()
RegistraScript("window.onload = function MuestraBloqueo() { document.getElementById(""C_BtnShowBloqueo"").click(); setTimeout(function(){ $('#C_TxtCodigoAcceso').focus(); }, 1000); }")
Else
DivBloqueo.Visible = True
End If
Else
DivBloqueo.Visible = False
End If
Else
DivBloqueo.Visible = False
End If
DdlBPPS.setEsWebService(True)
DdlBPPS.ddlWS.Attributes.Add("data-clear", "1")
ViewState("ProcesoCorrecto") = True
@@ -1116,6 +1136,8 @@ Partial Class PV
CargarAlmacenes()
CargaFormaEntrega()
CargaCuentasTerminal()
CargaMarcasFiltro()
If UsuarioActual.Empresa.Funcionalidad(531).ToString = "1" Then
CargaAjuste()
RVPorDesc.MaximumValue = UsuarioActual.DescuentoAutorizado.ToString
@@ -1231,6 +1253,21 @@ Partial Class PV
End If
End Sub
Private Sub CargaMarcasFiltro()
Using ObjMarcas As New ClsProductosServicios
If ObjMarcas.GetMarcas(UsuarioActual.CveEmpresa) Then
DdlMarcaPS.DataSource = ObjMarcas.DtResultados
DdlMarcaPSAjuste.DataSource = ObjMarcas.DtResultados
End If
End Using
DdlMarcaPS.DataBind()
DdlMarcaPSAjuste.DataBind()
UpModalVenta.Update()
UpAjuste.Update()
End Sub
Private Function CargaVenta() As Boolean
Dim Retorno As Boolean = False
'CARGA PARA FACTURACION
@@ -2722,7 +2759,7 @@ Partial Class PV
End If
DdlClasificacion.DataBind()
End Sub
Private Sub CargaPS(CveClasificacion As Integer, Objeto As ADServerControl.Dropdownlost, Optional AplicaAlmacen As Boolean = True)
Private Sub CargaPS(CveClasificacion As Integer, Objeto As ADServerControl.Dropdownlost, Optional AplicaAlmacen As Boolean = True, Optional CveMarca As Integer = -1)
Objeto.setEsWebService(UsuarioActual.Empresa.Funcionalidad(141).ToString = "1")
If Not UsuarioActual.Empresa.Funcionalidad(141).ToString = "1" Then
Objeto.ddl.Items.Clear()
@@ -2742,6 +2779,7 @@ Partial Class PV
Objeto.ddlWS.Attributes.Add("data-pagina", "-1")
End If
Objeto.ddlWS.Attributes.Add("data-aplicaparaventa", "1")
Objeto.ddlWS.Attributes.Add("data-cvemarca", CveMarca.ToString)
Objeto.ddlWS.Attributes.Add("data-Estatus", "1")
End If
End Sub
@@ -3038,6 +3076,18 @@ Partial Class PV
Protected Sub BtnEmitirImprimir_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnEmitirImprimir.Click
If UsuarioActual.Empresa.Funcionalidad(599) = "1" Then
Dim DrUsuario As DataRow = GlobalDTUsuarios(CveUsuario:=UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).Rows(0)
If DrUsuario("CodigoAcceso").ToString() <> "" Then
If UsuarioActual.SesionBloqueada Then
Alert("Acceso denegado. La sesión se encuentra bloqueada", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
End If
If Not CveCliente > 0 Then
Alert("Es necesario seleccionar el cliente al cual se le va a facturar.", TipoMensaje.MsgAdvertencia)
Exit Sub
@@ -3069,7 +3119,7 @@ Partial Class PV
'VALIDA PROMOCIONES Y EXISTENCIAS
Dim ObjVentas As New ClsVentas
If ObjVentas.GetPromocionesPS(-1, TxtFecha.Text.ToDateTime, DdlSubProyectoDatos.SelectedValue.ToEntero, CveCliente, DdlVendedor.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
If ObjVentas.GetPromocionesPS(-1, TxtFecha.Text.ToDateTime, DdlSubProyectoDatos.SelectedValue.ToEntero, CveCliente, DdlVendedor.SelectedValue.ToEntero, 1, UsuarioActual.CveEmpresa) Then
DtPromociones = ObjVentas.DtResultados
End If
ObjVentas.Dispose()
@@ -4533,7 +4583,7 @@ Partial Class PV
'VALIDA PROMOCIONES
Dim ObjVentas As New ClsVentas
If ObjVentas.GetPromocionesPS(-1, TxtFecha.Text.ToDateTime, DdlSubProyectoDatos.SelectedValue.ToEntero, CveCliente, DdlVendedor.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
If ObjVentas.GetPromocionesPS(-1, TxtFecha.Text.ToDateTime, DdlSubProyectoDatos.SelectedValue.ToEntero, CveCliente, DdlVendedor.SelectedValue.ToEntero, 1, UsuarioActual.CveEmpresa) Then
DtPromociones = ObjVentas.DtResultados
End If
ObjVentas.Dispose()
@@ -7350,4 +7400,93 @@ Partial Class PV
Public Property Valido As Boolean
End Class
Protected Sub DdlMarcaPS_SelectedIndexChanged(sender As Object, e As EventArgs)
CargaPS(DdlClasificacion.SelectedValue.ToEntero(), DdlPS, CveMarca:=DdlMarcaPS.SelectedValue.ToEntero())
UpModalVenta.Update()
End Sub
Protected Sub DdlMarcaPSAjuste_SelectedIndexChanged(sender As Object, e As EventArgs)
CargaPS(DdlClasificacion.SelectedValue.ToEntero(), DdlPSAjuste, CveMarca:=DdlMarcaPSAjuste.SelectedValue.ToEntero())
UpAjuste.Update()
End Sub
Protected Sub BtnCambiar_Click(sender As Object, e As EventArgs)
If String.IsNullOrEmpty(TxtCodigoAcceso.Text.Trim) Then
Alert("Es necesario un código de acceso", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim CveUsuarioNuevo As Integer = -1
Using ObjUsuarios As New ClsSisUsuarios
CveUsuarioNuevo = ObjUsuarios.ValidaUsuarioCodigoAcceso(TxtCodigoAcceso.Text.Trim, UsuarioActual.CveEmpresa)
End Using
Dim DrUsuario As DataRow = Nothing
If CveUsuarioNuevo > 0 Then
DrUsuario = GlobalDTUsuarios(CveUsuarioNuevo, UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 1", "", {"CveUsuario", "Usuario", "Nombre", "Contraseña", "CveEmpresa", "Rol"}).Rows(0)
End If
If DrUsuario IsNot Nothing Then
Dim tUsuario, tContraseña As String
Dim tCveEmpresa As Integer
tUsuario = DrUsuario("Usuario").ToString
tContraseña = DrUsuario("Contraseña").ToString
tCveEmpresa = DrUsuario("CveEmpresa").ToString.ToEntero
Dim ObjUsuario As New ClsSisUsuarios
Dim Usuario As Usuario
Usuario = ObjUsuario.ValidaUsuario(tUsuario, tContraseña, IMEI, tCveEmpresa)
ObjUsuario.Dispose()
If Usuario IsNot Nothing Then
Dim dt As Data.DataTable = GlobalDTUsuarios(Usuario.CveUsuario)
ADSSessionConfig.sessionUser = Usuario
ADSSessionConfig.sessionUser.CvePlataforma = 1
ADSSessionConfig.sessionDpage = False
ADSSessionConfig.sessionUser.ModoSimulacion = False
If dt IsNot Nothing Then
If dt.Rows.Count >= 1 Then
If dt.Rows.Count > 1 Then ADSSessionConfig.sessionUser.MultipleEmpresa = True
End If
End If
dt.Dispose()
Dim ObjEmpresa As New ClsSisEmpresas()
If ObjEmpresa.GetEmpresas(tCveEmpresa, "-1", "-1", "-1", "-1") Then
If ObjEmpresa.GetEmpresasFuncionalidades(tCveEmpresa) Then
Dim dttmp As Data.DataTable = ObjEmpresa.DtResultados
Dim EmpresasFuncionalidades As New HybridDictionary
For Each Row As Data.DataRow In dttmp.Rows
EmpresasFuncionalidades.Add(Convert.ToInt32(Row("CveFuncionalidad")), Row("Valor").ToString)
Next
ObjEmpresa.Empresa.SetFuncionalidades(EmpresasFuncionalidades)
End If
UsuarioActual.Empresa = ObjEmpresa.Empresa
ADSSessionConfig.sessionUser.CveEmpresa = ObjEmpresa.Empresa.CveEmpresa
ADSSession.ADSSessionConfig.SessionManager(ADSSession.OpcionSession.CambiarEmpresa, Nothing, ObjEmpresa.Empresa.CveEmpresa)
End If
ObjEmpresa.Dispose()
End If
Response.Redirect($"~/Ventas/PV.aspx")
Else
Alert("No existe el código de acceso", TipoMensaje.MsgAdvertencia)
End If
End Sub
Protected Sub BtnBloquearAcceso_Click(sender As Object, e As EventArgs)
UsuarioActual.SesionBloqueada = True
Response.Redirect($"~/Ventas/PV.aspx")
End Sub
End Class

View File

@@ -341,11 +341,39 @@ Partial Class Ventas_RepProductosServiciosDetalle
If AnioMes.Trim.Length = 7 Then
txtFechaI.Text = If(AnioMes <> "-1", String.Format("01/{0}/{1}", AnioMes.Substring(5, 2).PadLeft(2, "0"c), AnioMes.Substring(0, 4)), txtFechaI.Text)
FechaFtemporal = $"01/{AnioMes.Substring(5, 2).PadLeft(2, "0"c)}/{AnioMes.Substring(0, 4)}"
txtFechaF.Text = String.Format("{2}/{0}/{1}", AnioMes.Substring(5, 2).PadLeft(2, "0"c), AnioMes.Substring(0, 4), FechaFtemporal.ToDate.LastDayOfMonth.Day)
If FechaF = "-1" Then
txtFechaF.Text = String.Format("{2}/{0}/{1}", AnioMes.Substring(5, 2).PadLeft(2, "0"c), AnioMes.Substring(0, 4), FechaFtemporal.ToDate.LastDayOfMonth.Day)
Else
Dim FechaFRef As DateTime = FechaF.ToDateTime
Dim FechaFMonth As DateTime = String.Format("{2}/{0}/{1}", AnioMes.Substring(5, 2).PadLeft(2, "0"c), AnioMes.Substring(0, 4), FechaFtemporal.ToDate.LastDayOfMonth.Day).ToDate()
If FechaFRef > FechaFMonth Then
txtFechaF.Text = FechaFMonth.ToString("dd/MM/yyyy")
Else
txtFechaF.Text = FechaFRef.ToString("dd/MM/yyyy")
End If
End If
Else
txtFechaI.Text = If(AnioMes <> "-1", String.Format("01/{0}/{1}", AnioMes.Substring(5, 1).PadLeft(2, "0"c), AnioMes.Substring(0, 4)), txtFechaI.Text)
FechaFtemporal = $"01/{AnioMes.Substring(5, 1).PadLeft(2, "0"c)}/{AnioMes.Substring(0, 4)}"
txtFechaF.Text = String.Format("{2}/{0}/{1}", AnioMes.Substring(5, 1).PadLeft(2, "0"c), AnioMes.Substring(0, 4), FechaFtemporal.ToDate.LastDayOfMonth.Day)
If FechaF = "-1" Then
txtFechaF.Text = String.Format("{2}/{0}/{1}", AnioMes.Substring(5, 1).PadLeft(2, "0"c), AnioMes.Substring(0, 4), FechaFtemporal.ToDate.LastDayOfMonth.Day)
Else
Dim FechaFRef As DateTime = FechaF.ToDateTime
Dim FechaFMonth As DateTime = String.Format("{2}/{0}/{1}", AnioMes.Substring(5, 1).PadLeft(2, "0"c), AnioMes.Substring(0, 4), FechaFtemporal.ToDate.LastDayOfMonth.Day).ToDate
If FechaFRef > FechaFMonth Then
txtFechaF.Text = FechaFMonth.ToString("dd/MM/yyyy")
Else
txtFechaF.Text = FechaFRef.ToString("dd/MM/yyyy")
End If
End If
End If
End If

View File

@@ -6392,6 +6392,7 @@ Partial Class Ventas
Objeto.ddlWS.Attributes.Add("data-cveclasificacion", CveClasificacion.ToString())
Objeto.ddlWS.Attributes.Add("data-pagina", "ventas/ventas")
Objeto.ddlWS.Attributes.Add("data-Estatus", "1")
Objeto.ddlWS.Attributes.Add("data-AplicaparaVenta", "1")
End If
End Sub
@@ -11289,8 +11290,7 @@ Partial Class Ventas
CveCuentaIVATrasladado = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=TmpDT.MAX("PorcentajeIVA").ToDouble).Rows(0)("CveCuentaIVATrasladado").ToString().ToEntero()
End If
Dim UsaComplementariaClientes As Boolean = False
If UsuarioActual.CveEmpresa.Contiene(1, 119) Then UsaComplementariaClientes = True
Dim UsaComplementariaClientes As Boolean = True
If ObjConta.GetPlantillaConceptos(ObjFactura.CveEmpresa, CvePlantilaPoliza) Then
Dim dtt As DataTable = ObjConta.DtResultados
@@ -13005,8 +13005,8 @@ Partial Class Ventas
'If TotalCosto <> 0 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
End If
OcurrioError = True
End If
'End If
Else
@@ -13834,8 +13834,8 @@ Partial Class Ventas
Dim CuentasContablesInvalidasSIG As New StringBuilder
Dim ContaIdPoliza As Integer = 0
Dim ConceptoAmortizacion As Integer = 0
Dim UsaComplementariaClientes As Boolean = False
If UsuarioActual.CveEmpresa.Contiene(1, 119) Then UsaComplementariaClientes = True
Dim UsaComplementariaClientes As Boolean = True
'If UsuarioActual.CveEmpresa.Contiene(1, 119) Then UsaComplementariaClientes = True
'Dim FechaMaxima As Date = MinFecha
@@ -15119,7 +15119,7 @@ Partial Class Ventas
Dim ValorInventario As Decimal = 0
For Each RowInv As DataRow In tmpCostos.Rows
ValorInventario = DTMovimientosDetalles.SUM("Total", String.Format("CveClasificacion = {0}", RowInv("CveClasificacion"))).ToString().ToDecimal.RoundSQL()
ValorInventario = DTMovimientosDetalles.SUMD("Total", String.Format("CveClasificacion = {0}", RowInv("CveClasificacion"))).RoundAD()
IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaGasto", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
CveCuenta = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
@@ -15143,7 +15143,7 @@ Partial Class Ventas
End If
IdCtaContable = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen = {ddlAlmacen.SelectedValue}").ToEntero()
ValorInventario = DTMovimientosDetalles.SUMD("Total", $"CveMovimiento = {Mov("CveMovimiento")}").RoundSQL()
ValorInventario = DTMovimientosDetalles.SUMD("Total", $"CveMovimiento = {Mov("CveMovimiento")}").RoundAD()
If ValorInventario <> 0 Then
'Entrada
@@ -18449,7 +18449,7 @@ Partial Class Ventas
Return Not OcurrioError
End If
Dim TotalCosto As Decimal = DtCostos.SUMD("Total").RoundSQL
Dim TotalCosto As Decimal = DtCostos.SUMD("Total").RoundAD
If CvePrePoliza <= 0 Then
GenerarPrePolizaNueva = True
@@ -18462,7 +18462,7 @@ Partial Class Ventas
End If
For Each RowInv As DataRow In DtCostosDistinct.Rows
ValorInventario = DtCostos.SUMD("Total", String.Format("CveClasificacion = {0}", RowInv("CveClasificacion"))).RoundSQL
ValorInventario = DtCostos.SUMD("Total", String.Format("CveClasificacion = {0}", RowInv("CveClasificacion"))).RoundAD
IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
CveCuenta = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
TotalCostoAcumulado += ValorInventario
@@ -18603,10 +18603,10 @@ Partial Class Ventas
Dim ValorInventario As Decimal
Dim TotalCostoAcumulado As Decimal = 0D
Dim Cont As Integer = 1
Dim TotalCosto As Decimal = DtCostos.SUMD("Total").RoundSQL
Dim TotalCosto As Decimal = DtCostos.SUMD("Total").RoundAD
For Each RowInv As DataRow In DtCostosDistinct.Rows
ValorInventario = DtCostos.SUMD("Total", String.Format("CveClasificacion = {0}", RowInv("CveClasificacion"))).RoundSQL
ValorInventario = DtCostos.SUMD("Total", String.Format("CveClasificacion = {0}", RowInv("CveClasificacion"))).RoundAD
IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
CveCuenta = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
TotalCostoAcumulado += ValorInventario
@@ -18720,10 +18720,10 @@ Partial Class Ventas
Dim ValorInventario As Decimal
Dim TotalCostoAcumulado As Decimal = 0D
Dim Cont As Integer = 1
Dim TotalCosto As Decimal = DtCostos.SUMD("Total").RoundSQL
Dim TotalCosto As Decimal = DtCostos.SUMD("Total").RoundAD
For Each RowInv As DataRow In DtCostosDistinct.Rows
ValorInventario = DtCostos.SUMD("Total", String.Format("CveClasificacion = {0}", RowInv("CveClasificacion"))).RoundSQL
ValorInventario = DtCostos.SUMD("Total", String.Format("CveClasificacion = {0}", RowInv("CveClasificacion"))).RoundAD
IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
CveCuenta = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
TotalCostoAcumulado += ValorInventario
@@ -23675,11 +23675,7 @@ Partial Class Ventas
IdCuentaContableNoDeducible = 3114
End If
Dim UsaComplementaria As Boolean = False
If UsuarioActual.CveEmpresa = 119 Then
UsaComplementaria = True
End If
Dim UsaComplementaria As Boolean = True
If MsgError = "" Then
CvePrePoliza = ObjConta.AddPrePolizas("Ventas/Saldarr", 47, SaldoVenta, SaldoVenta, tCveMoneda, TxtFechaSaldarVenta.Text.ToDate, ConceptoPartida, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)