This commit is contained in:
AbrahamCastilloV
2024-02-28 18:44:27 -07:00
37 changed files with 2468 additions and 1794 deletions

View File

@@ -143,33 +143,33 @@ Partial Class AF_ValesCombustible
#Region "DDL CHANGED & CHK CHANGED & TXT CHANGUED"
Private Sub DdlActivoFijo_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlActivoFijo.SelectedIndexChanged
Dim ObjValesCombustible As New ClsAF
If ObjValesCombustible.GetValesCombustible(-1, -1, -1, -1, DdlActivoFijo.SelectedValue.ToEntero, -1, -1, -1, -1, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1) Then
Dim dtAF As DataTable = ObjValesCombustible.DtResultados.FiltraParametros("", Orderby:="CveVale DESC")
If dtAF.Rows.Count > 0 Then
Dim dr As DataRow = dtAF.Rows(0)
LblFecha.Text = dr("Fecha").ToString
LblLitrosAF.Text = dr("Litros").ToString
LblCombustible.Text = dr("Combustible").ToString
LblOdometro.Text = dr("Odometro").ToString
'Dim ObjValesCombustible As New ClsAF
'If ObjValesCombustible.GetValesCombustible(-1, -1, -1, -1, DdlActivoFijo.SelectedValue.ToEntero, -1, -1, -1, -1, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1) Then
' Dim dtAF As DataTable = ObjValesCombustible.DtResultados.FiltraParametros("", Orderby:="CveVale DESC")
' If dtAF.Rows.Count > 0 Then
' Dim dr As DataRow = dtAF.Rows(0)
' LblFecha.Text = dr("Fecha").ToString
' LblLitrosAF.Text = dr("Litros").ToString
' LblCombustible.Text = dr("Combustible").ToString
' LblOdometro.Text = dr("Odometro").ToString
If dr("CvePersonal").ToString.ToEntero > 0 Then
LbPersonal.Text = String.Format("{0}, {1}", dr("NombreCompleto").ToString, dr("Recibe").ToString)
Else
LbPersonal.Text = dr("NombreCompleto").ToString
End If
' If dr("CvePersonal").ToString.ToEntero > 0 Then
' LbPersonal.Text = String.Format("{0}, {1}", dr("NombreCompleto").ToString, dr("Recibe").ToString)
' Else
' LbPersonal.Text = dr("NombreCompleto").ToString
' End If
Else
LblFecha.Text = ""
LblLitrosAF.Text = ""
LblCombustible.Text = ""
LblOdometro.Text = ""
LbPersonal.Text = ""
UpConsumo.Update()
End If
End If
ObjValesCombustible.Dispose()
' Else
' LblFecha.Text = ""
' LblLitrosAF.Text = ""
' LblCombustible.Text = ""
' LblOdometro.Text = ""
' LbPersonal.Text = ""
' UpConsumo.Update()
' End If
'End If
'ObjValesCombustible.Dispose()
End Sub
'Private Sub DdProveedorVinculacion_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdProveedorVinculacion.SelectedIndexChanged
@@ -297,8 +297,8 @@ Partial Class AF_ValesCombustible
'Si TipoVale es 1 = Externo
If ChkExterno.Checked = True Then
CveVale = ObjVales.AddValesCombustible(FolioUsuario, 0, DdlProveedores.SelectedValue.ToEntero, DdlActivoFijo.SelectedValue.ToEntero, DdlRHPersonal.SelectedValue.ToEntero, TxtFechaVale.Text.ToDate, TxtNombreRecibe.Text, DdlSubProyecto.SelectedValue.ToEntero, TxtObservciones.Text, TxtOdometroActual.Text.ToEntero, DdlCombustible.SelectedValue.ToEntero, TxtLitros.Text.ToDouble, 1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
Folio = ObjVales.FolioVale
'CveVale = ObjVales.AddValesCombustible(FolioUsuario, 0, DdlProveedores.SelectedValue.ToEntero, DdlActivoFijo.SelectedValue.ToEntero, DdlRHPersonal.SelectedValue.ToEntero, TxtFechaVale.Text.ToDate, TxtNombreRecibe.Text, DdlSubProyecto.SelectedValue.ToEntero, TxtObservciones.Text, TxtOdometroActual.Text.ToEntero, DdlCombustible.SelectedValue.ToEntero, TxtLitros.Text.ToDouble, 1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
'Folio = ObjVales.FolioVale
If CveVale < 0 Then
@@ -307,8 +307,8 @@ Partial Class AF_ValesCombustible
ElseIf ChkInterno.Checked = True Then
CveVale = ObjVales.AddValesCombustible(FolioUsuario, 0, DdlProveedores.SelectedValue.ToEntero, DdlActivoFijo.SelectedValue.ToEntero, DdlRHPersonal.SelectedValue.ToEntero, TxtFechaVale.Text.ToDate, TxtNombreRecibe.Text, DdlSubProyecto.SelectedValue.ToEntero, TxtObservciones.Text, TxtOdometroActual.Text.ToEntero, DdlCombustible.SelectedValue.ToEntero, TxtLitros.Text.ToDouble, 2, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
Folio = ObjVales.FolioVale
'CveVale = ObjVales.AddValesCombustible(FolioUsuario, 0, DdlProveedores.SelectedValue.ToEntero, DdlActivoFijo.SelectedValue.ToEntero, DdlRHPersonal.SelectedValue.ToEntero, TxtFechaVale.Text.ToDate, TxtNombreRecibe.Text, DdlSubProyecto.SelectedValue.ToEntero, TxtObservciones.Text, TxtOdometroActual.Text.ToEntero, DdlCombustible.SelectedValue.ToEntero, TxtLitros.Text.ToDouble, 2, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
'Folio = ObjVales.FolioVale
'AGREGAMOS LA SALIDA
@@ -339,37 +339,37 @@ Partial Class AF_ValesCombustible
'Si el odometro es mayor a la proxima recarga
Else
'Si TipoVale es 1 = Externo
If ChkExterno.Checked = True Then
CveVale = ObjVales.AddValesCombustible(FolioUsuario, 0, DdlProveedores.SelectedValue.ToEntero, DdlActivoFijo.SelectedValue.ToEntero, DdlRHPersonal.SelectedValue.ToEntero, TxtFechaVale.Text.ToDate, TxtNombreRecibe.Text, DdlSubProyecto.SelectedValue.ToEntero, TxtObservciones.Text, TxtOdometroActual.Text.ToEntero, DdlCombustible.SelectedValue.ToEntero, TxtLitros.Text.ToEntero, 1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
Folio = ObjVales.FolioVale
'If ChkExterno.Checked = True Then
' CveVale = ObjVales.AddValesCombustible(FolioUsuario, 0, DdlProveedores.SelectedValue.ToEntero, DdlActivoFijo.SelectedValue.ToEntero, DdlRHPersonal.SelectedValue.ToEntero, TxtFechaVale.Text.ToDate, TxtNombreRecibe.Text, DdlSubProyecto.SelectedValue.ToEntero, TxtObservciones.Text, TxtOdometroActual.Text.ToEntero, DdlCombustible.SelectedValue.ToEntero, TxtLitros.Text.ToEntero, 1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
' Folio = ObjVales.FolioVale
If CveVale < 0 Then
ErrorMovInv = True
End If
' If CveVale < 0 Then
' ErrorMovInv = True
' End If
'Si TipoVale es 2 = Interno
ElseIf ChkInterno.Checked = True Then
CveVale = ObjVales.AddValesCombustible(FolioUsuario, 0, DdlProveedores.SelectedValue.ToEntero, DdlActivoFijo.SelectedValue.ToEntero, DdlRHPersonal.SelectedValue.ToEntero, TxtFechaVale.Text.ToDate, TxtNombreRecibe.Text, DdlSubProyecto.SelectedValue.ToEntero, TxtObservciones.Text, TxtOdometroActual.Text.ToEntero, DdlCombustible.SelectedValue.ToEntero, TxtLitros.Text.ToDouble, 2, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
Folio = ObjVales.FolioVale
' 'Si TipoVale es 2 = Interno
'ElseIf ChkInterno.Checked = True Then
' CveVale = ObjVales.AddValesCombustible(FolioUsuario, 0, DdlProveedores.SelectedValue.ToEntero, DdlActivoFijo.SelectedValue.ToEntero, DdlRHPersonal.SelectedValue.ToEntero, TxtFechaVale.Text.ToDate, TxtNombreRecibe.Text, DdlSubProyecto.SelectedValue.ToEntero, TxtObservciones.Text, TxtOdometroActual.Text.ToEntero, DdlCombustible.SelectedValue.ToEntero, TxtLitros.Text.ToDouble, 2, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
' Folio = ObjVales.FolioVale
'AGREGAMOS LA SALIDA
CveMovimientoSalida = ObjInventario.AddMovimiento(DdlAlmacen.SelectedValue.ToEntero, 3, 1, TxtFechaVale.Text.Trim.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1)
FolioSalida = ObjInventario.Folio
' 'AGREGAMOS LA SALIDA
' CveMovimientoSalida = ObjInventario.AddMovimiento(DdlAlmacen.SelectedValue.ToEntero, 3, 1, TxtFechaVale.Text.Trim.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1)
' FolioSalida = ObjInventario.Folio
If CveMovimientoSalida <= 0 Then
TextoError = "No se pudo generar el movimiento de salida correctamente"
ErrorMovInv = True
Else
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, TxtLitros.Text.Trim.ToEntero, CveUM, CvePS, -1, DdlActivoFijo.SelectedValue.ToEntero) Then
ErrorMovInv = True
TextoError = "Ocurrió un error al guardar los movimientos"
End If
' If CveMovimientoSalida <= 0 Then
' TextoError = "No se pudo generar el movimiento de salida correctamente"
' ErrorMovInv = True
' Else
' If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, TxtLitros.Text.Trim.ToEntero, CveUM, CvePS, -1, DdlActivoFijo.SelectedValue.ToEntero) Then
' ErrorMovInv = True
' TextoError = "Ocurrió un error al guardar los movimientos"
' End If
End If
' End If
Else
Alert("Debe Seleccionar un Tipo de Vale", TipoMensaje.MsgError)
End If
'Else
' Alert("Debe Seleccionar un Tipo de Vale", TipoMensaje.MsgError)
'End If
End If
If Not ErrorMovInv Then
@@ -397,51 +397,51 @@ Partial Class AF_ValesCombustible
Private Sub BtnActualizar_Click(sender As Object, e As EventArgs) Handles BtnActualizar.Click
Dim ObjValesCombustible As New ClsAF
For Each gvr As GridViewRow In GVBuscar.Rows
If gvr.RowType = DataControlRowType.DataRow Then
If gvr.FCCheckBox("Chk").Checked Then
Dim CveProveedor = If(gvr.FCDropDownList("DdlBuscarP").Visible, gvr.FCDropDownList("DdlBuscarP").SelectedValue.ToEntero, gvr.FCLiteral("LtlProveedor").Text.ToEntero)
ObjValesCombustible.UpdateValeCombustible(gvr.DataKey("CveVale").ToEntero, gvr.DataKey("CveCompra").ToEntero, CveProveedor, gvr.FCTextBox("TxtNombreRecibe").Text, gvr.FCTextBox("TxtCantidad").Text.ToDouble, gvr.FCTextBox("TxtRecibo").Text.ToEntero, gvr.FCTextBox("TxtImporte").Text.ToEntero, UsuarioActual.CveEmpresa)
Alert("Se Actualizo con exito")
ActualizarM()
Else
Alert("Seleccione una opcion")
End If
End If
'Dim ObjValesCombustible As New ClsAF
'For Each gvr As GridViewRow In GVBuscar.Rows
' If gvr.RowType = DataControlRowType.DataRow Then
' If gvr.FCCheckBox("Chk").Checked Then
' Dim CveProveedor = If(gvr.FCDropDownList("DdlBuscarP").Visible, gvr.FCDropDownList("DdlBuscarP").SelectedValue.ToEntero, gvr.FCLiteral("LtlProveedor").Text.ToEntero)
' ObjValesCombustible.UpdateValeCombustible(gvr.DataKey("CveVale").ToEntero, gvr.DataKey("CveCompra").ToEntero, CveProveedor, gvr.FCTextBox("TxtNombreRecibe").Text, gvr.FCTextBox("TxtCantidad").Text.ToDouble, gvr.FCTextBox("TxtRecibo").Text.ToEntero, gvr.FCTextBox("TxtImporte").Text.ToEntero, UsuarioActual.CveEmpresa)
' Alert("Se Actualizo con exito")
' ActualizarM()
' Else
' Alert("Seleccione una opcion")
' End If
' End If
Next
ObjValesCombustible.Dispose()
'Next
'ObjValesCombustible.Dispose()
End Sub
Private Sub BtnBuscar_Click(sender As Object, e As EventArgs) Handles BtnBuscar.Click
Dim ObjValesCombustible As New ClsAF
'Dim ObjValesCombustible As New ClsAF
If ObjValesCombustible.GetValesCombustible(-1, -1, If(TxtBuscar.Text.Equals(""), -1, TxtBuscar.Text.ToEntero), DdlBuscarProveedor.SelectedValue.ToEntero, DdlBuscarActivo.SelectedValue.ToEntero, -1, -1, -1, -1, DdlBuscarPersonal.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1) Then
GVBuscar.DataSource = ObjValesCombustible.DtResultados
If ObjValesCombustible.DtResultados.Rows.Count > 0 Then
BtnActualizar.Visible = True
End If
Else
GVBuscar.DataSource = Nothing
BtnActualizar.Visible = False
End If
ObjValesCombustible.Dispose()
GVBuscar.DataBind()
UpBuscar.Update()
'If ObjValesCombustible.GetValesCombustible(-1, -1, If(TxtBuscar.Text.Equals(""), -1, TxtBuscar.Text.ToEntero), DdlBuscarProveedor.SelectedValue.ToEntero, DdlBuscarActivo.SelectedValue.ToEntero, -1, -1, -1, -1, DdlBuscarPersonal.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1) Then
' GVBuscar.DataSource = ObjValesCombustible.DtResultados
' If ObjValesCombustible.DtResultados.Rows.Count > 0 Then
' BtnActualizar.Visible = True
' End If
'Else
' GVBuscar.DataSource = Nothing
' BtnActualizar.Visible = False
'End If
'ObjValesCombustible.Dispose()
'GVBuscar.DataBind()
'UpBuscar.Update()
End Sub
Private Sub ActualizarM()
Dim ObjValesCombustible As New ClsAF
'Dim ObjValesCombustible As New ClsAF
If ObjValesCombustible.GetValesCombustible(-1, -1, If(TxtBuscar.Text.Equals(""), -1, TxtBuscar.Text.ToEntero), DdlBuscarProveedor.SelectedValue.ToEntero, DdlBuscarActivo.SelectedValue.ToEntero, -1, -1, -1, -1, DdlBuscarPersonal.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1) Then
GVBuscar.DataSource = ObjValesCombustible.DtResultados
Else
GVBuscar.DataSource = Nothing
End If
ObjValesCombustible.Dispose()
GVBuscar.DataBind()
UpBuscar.Update()
'If ObjValesCombustible.GetValesCombustible(-1, -1, If(TxtBuscar.Text.Equals(""), -1, TxtBuscar.Text.ToEntero), DdlBuscarProveedor.SelectedValue.ToEntero, DdlBuscarActivo.SelectedValue.ToEntero, -1, -1, -1, -1, DdlBuscarPersonal.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1) Then
' GVBuscar.DataSource = ObjValesCombustible.DtResultados
'Else
' GVBuscar.DataSource = Nothing
'End If
'ObjValesCombustible.Dispose()
'GVBuscar.DataBind()
'UpBuscar.Update()
End Sub
#End Region

View File

@@ -257,6 +257,12 @@
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtFolioGarantia" CssClass="form-control" runat="server" MaxLength="70" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RfvTxtFolioGarantia" runat="server" ControlToValidate="TxtFolioGarantia" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Folio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpFolioGarantia"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="REVFolioGarantia"
ControlToValidate="TxtFolioGarantia" runat="server" CssClass="help-block errorimput"
ErrorMessage="solo números" ValidationGroup="GrpFolioGarantia"
ValidationExpression="\d+">
</asp:RegularExpressionValidator>
<ajax:FilteredTextBoxExtender ID="FilteredTextBoxExtender1" runat="server" Enabled="True" TargetControlID="TxtFolioGarantia" FilterType="Numbers" FilterMode="ValidChars"></ajax:FilteredTextBoxExtender>
<label for="<%= TxtFolioGarantia.ClientID.ToString()%>">Folio:</label>
<i></i>
</div>

View File

@@ -86,16 +86,17 @@
>
<Columns>
<asp:BoundField DataField="CodigoPS" HeaderText="Grupo" ReadOnly="true" ></asp:BoundField>
<asp:BoundField DataField="Inicial" HeaderText="Inicial" ReadOnly="true" DataFormatString="{0:N0}"><ItemStyle HorizontalAlign="Center"></ItemStyle></asp:BoundField>
<asp:BoundField DataField="E_Almacen" HeaderText="E.Alm" ReadOnly="true" DataFormatString="{0:N0}"><ItemStyle HorizontalAlign="Center"></ItemStyle></asp:BoundField>
<asp:BoundField DataField="E_Pub" HeaderText="E.Pub" ReadOnly="true" DataFormatString="{0:N0}"><ItemStyle HorizontalAlign="Center"></ItemStyle></asp:BoundField>
<asp:BoundField DataField="E_Traspaso" HeaderText="E.Tras" ReadOnly="true" DataFormatString="{0:N0}"><ItemStyle HorizontalAlign="Center"></ItemStyle></asp:BoundField>
<asp:BoundField DataField="E_Compra" HeaderText="E.Compra" ReadOnly="true" DataFormatString="{0:N0}"><ItemStyle HorizontalAlign="Center"></ItemStyle></asp:BoundField>
<asp:BoundField DataField="E_Otros" HeaderText="Otros" ReadOnly="true" DataFormatString="{0:N0}"><ItemStyle HorizontalAlign="Center"></ItemStyle></asp:BoundField>
<asp:BoundField DataField="S_Almacen" HeaderText="S.Alm" ReadOnly="true" DataFormatString="{0:N0}"><ItemStyle HorizontalAlign="Center"></ItemStyle></asp:BoundField>
<asp:BoundField DataField="S_Traspaso" HeaderText="S.Tras" ReadOnly="true" DataFormatString="{0:N0}"><ItemStyle HorizontalAlign="Center"></ItemStyle></asp:BoundField>
<asp:BoundField DataField="S_Otros" HeaderText="Otros" ReadOnly="true" DataFormatString="{0:N0}"><ItemStyle HorizontalAlign="Center"></ItemStyle></asp:BoundField>
<asp:BoundField DataField="Exist_Actual" HeaderText="Exist. Actual" ReadOnly="true" DataFormatString="{0:N0}"><ItemStyle HorizontalAlign="Center"></ItemStyle></asp:BoundField>
<asp:BoundField DataField="Inicial" HeaderText="Inicial" ReadOnly="true" DataFormatString="{0:N0}"><ItemStyle HorizontalAlign="Right"></ItemStyle></asp:BoundField>
<asp:BoundField DataField="E_Almacen" HeaderText="E.Alm" ReadOnly="true" DataFormatString="{0:N0}"><ItemStyle HorizontalAlign="Right"></ItemStyle></asp:BoundField>
<asp:BoundField DataField="E_Pub" HeaderText="E.Pub" ReadOnly="true" DataFormatString="{0:N0}"><ItemStyle HorizontalAlign="Right"></ItemStyle></asp:BoundField>
<asp:BoundField DataField="E_Traspaso" HeaderText="E.Tras" ReadOnly="true" DataFormatString="{0:N0}"><ItemStyle HorizontalAlign="Right"></ItemStyle></asp:BoundField>
<asp:BoundField DataField="E_Compra" HeaderText="E.Compra" ReadOnly="true" DataFormatString="{0:N0}"><ItemStyle HorizontalAlign="Right"></ItemStyle></asp:BoundField>
<asp:BoundField DataField="E_Recoleccion" HeaderText="E.Rec" ReadOnly="true" DataFormatString="{0:N0}"><ItemStyle HorizontalAlign="Right"></ItemStyle></asp:BoundField>
<asp:BoundField DataField="E_Otros" HeaderText="Otros" ReadOnly="true" DataFormatString="{0:N0}"><ItemStyle HorizontalAlign="Right"></ItemStyle></asp:BoundField>
<asp:BoundField DataField="S_Almacen" HeaderText="S.Alm" ReadOnly="true" DataFormatString="{0:N0}"><ItemStyle HorizontalAlign="Right"></ItemStyle></asp:BoundField>
<asp:BoundField DataField="S_Traspaso" HeaderText="S.Tras" ReadOnly="true" DataFormatString="{0:N0}"><ItemStyle HorizontalAlign="Right"></ItemStyle></asp:BoundField>
<asp:BoundField DataField="S_Otros" HeaderText="Otros" ReadOnly="true" DataFormatString="{0:N0}"><ItemStyle HorizontalAlign="Right"></ItemStyle></asp:BoundField>
<asp:BoundField DataField="Exist_Actual" HeaderText="Exist. Actual" ReadOnly="true" DataFormatString="{0:N0}"><ItemStyle HorizontalAlign="Right"></ItemStyle></asp:BoundField>
</Columns>
</asp:GridView>
</ContentTemplate>

View File

@@ -13,14 +13,7 @@
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<asp:UpdatePanel runat="server" ID="UpAgregar">
<ContentTemplate>
<li>
<asp:LinkButton runat="server" ID="BtnAgregarTiposUso" data-toggle="tooltip" data-placement="left" title="Agregar Tipo de Uso" Text="<i class='fa fa-plus'></i> Agregar Uso"></asp:LinkButton>
</li>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
@@ -32,7 +25,7 @@
<div class="portlet solid grey-cascade portlet-filter" id="idnecesaria">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-primary" Visible="true" />
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-primary" OnClick="BtnConsultar_Click" />
<a href="javascript:;" class="expand"></a>
</div>
<div class="titlefiltros caption">
@@ -74,6 +67,15 @@
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="TxtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<label class="col-md-1 " style="width: 80px;">Estatus:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlEstatus" CssClass="select2me" runat="server">
<asp:ListItem Text="Vigente" Value="0" Selected="True"></asp:ListItem>
<asp:ListItem Text="Clasificado" Value="1"></asp:ListItem>
<asp:ListItem Text="Cerrado" Value="2"></asp:ListItem>
<asp:ListItem Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>
</div>
@@ -92,7 +94,7 @@
<ContentTemplate>
<asp:GridView ID="GvR" runat="server" AutoGenerateColumns="False" OnRowDataBound="gvR_RowDataBound"
DataKeyNames="CveEntregaAlmacen,Orden,CveDireccionOrigen,CveSubProyecto,Estatus,CveTimbre,CveCliente,FolioReferencia,Referencia"
DataKeyNames="CveEntregaAlmacen,CveSubProyecto,Estatus,CveCliente,FolioReferencia,Referencia"
EmptyDataText="No se encontraron registros"
CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn"
data-sort="true"
@@ -134,29 +136,29 @@
</asp:TemplateField>
<asp:TemplateField HeaderText="Referencia" >
<ItemTemplate>
&nbsp;<asp:Literal ID="LblRef" runat="server" Text='<%# Eval("Referencia") %>'></asp:Literal>
&nbsp;<asp:Label ID="LblRef" runat="server" Text='<%# Eval("Referencia") %>'></asp:Label>
&nbsp;<asp:Label ID="Label1" runat="server" Text='<%# Eval("CveEntregaAlmacen") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Dirección" >
<asp:TemplateField HeaderText="">
<ItemTemplate>
<div class="truncate" style="width: 150px;">
&nbsp;<asp:Literal ID="LblDir" runat="server" Text='<%# Eval("Direccion") %>'></asp:Literal>
</div>
<asp:HyperLink ID="HplR" runat="server" Target="_blank" visible="false" AlternateText="Registrar" ToolTip="Registrar entrada" CssClass="btn btn-circle btn-sm yellow" Text="<i class='fa fa-location-arrow'></i>" />
<asp:HyperLink ID="HplEnt" runat="server" NavigateUrl='<%# Eval("CveMovimientoEntrada", "/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}") %>' CssClass="Texto" Text='<%# Eval("FolioEntrada") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="">
<ItemTemplate>
<asp:HyperLink ID="HplR" runat="server" visible="false" AlternateText="Registrar" ToolTip="Registrar entrada" CssClass="btn btn-circle btn-sm yellow" Text="<i class='fa fa-location-arrow'></i>" />
<asp:LinkButton ID="LnkGvDatosRecoleccionEditar" runat="server" Visible="false" OnClick="LnkGvDatosRecoleccionEditar_Click" AlternateText="Editar" ToolTip="Actualizar" CausesValidation="False" CssClass="btn btn-circle btn-xs blue" Text="<i class='fa fa-pencil'></i>" />
<asp:TemplateField HeaderText="">
<ItemTemplate>
<asp:LinkButton ID="LnkGvDatosRecoleccionEditar" runat="server" Visible="false" OnClick="LnkGvDatosRecoleccionEditar_Click" AlternateText="Editar" ToolTip="Actualizar" CssClass="btn btn-circle btn-xs blue" Text="<i class='fa fa-pencil'></i>" />
<asp:HyperLink ID="HplTra" runat="server" NavigateUrl='<%# Eval("CveMovimientoTraslado", "/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}") %>' CssClass="Texto" Text='<%# Eval("FolioTraslado") %>' />
</ItemTemplate>
<ItemStyle Width="100px" HorizontalAlign="Center"></ItemStyle>
</asp:TemplateField>
</asp:TemplateField>
<asp:TemplateField HeaderText="Factura" >
<ItemTemplate>
<asp:HyperLink ID="HplCompra" runat="server" NavigateUrl='<%# Eval("CveCompra", "/Compras/Compras.aspx?CveCompra={0}") %>' CssClass="Texto" Text='<%# Eval("FolioCompra") %>' />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</div>
@@ -242,21 +244,19 @@
</div>
<div class="row">
</div>
</div>
<div class="row">
<div class="col-md-12">
<asp:GridView ID="GvModalPSRecoleccion" DataKeyNames="CveEntregaAlmacenDetalle,CodigoPS,CvePS,CveUnidadMedida,Cantidad" runat="server"
ShowHeader="true" AutoGenerateColumns="False" EmptyDataText="" ToolTip="Listado de Movimientos" CssClass="Widthall table table-striped table-hover" GridLines="None">
<Columns>
<asp:BoundField HeaderText="Cantidad" DataField="Cantidad" ItemStyle-Width="86px" HeaderStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Unidad" DataField="Abreviatura" ItemStyle-Width="86px" />
<asp:BoundField HeaderText="Producto" DataField="CodigoPS" ItemStyle-Width="500px" />
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="LnkModalGvModalPSRecoleccionEliminar" runat="server" CssClass="btn btn-circle btn-xs red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Seguro que desea eliminar el producto?" data-btn-ok-label="si"></asp:LinkButton>
<asp:LinkButton ID="LnkModalGvModalPSRecoleccionEliminar" runat="server" CommandArgument='<%# Eval("CveEntregaAlmacenDetalle") %>' CssClass="btn btn-circle btn-xs red" OnClick="LnkModalGvModalPSRecoleccionEliminar_Click" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Seguro que desea eliminar el producto?" data-btn-ok-label="si"></asp:LinkButton>
</ItemTemplate>
<ItemStyle Width="160px" HorizontalAlign="Center"></ItemStyle>
</asp:TemplateField>
@@ -266,10 +266,7 @@
</div>
</div>
</div>
<div class="modal-footer">
<asp:UpdatePanel runat="server">

View File

@@ -62,7 +62,7 @@ Partial Class Acumuladores_RepRecolecciones
CargarCentrosDeCosto(Nothing, DdlSubProyecto, Nothing, LblSubProyecto)
DdlAlmacenOrigen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen IN (4)")
DdlAlmacenOrigen.DataBind()
DdlAlmacenDestino.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen IN (21) and Almacen like '%sado%'")
DdlAlmacenDestino.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen IN (22) and Almacen like '%sado%'")
DdlAlmacenDestino.DataBind()
End Sub
@@ -70,7 +70,7 @@ Partial Class Acumuladores_RepRecolecciones
Private Sub CargaDatos()
Dim ObjGeneral As New ClsGenerales
If ObjGeneral.GetInvEntregaAlmacenRuta(-1, TxtFechaI.Text.ToDate, TxtFechaF.Text.ToDate, UsuarioActual.CveEmpresa, 2, -1) Then
If ObjGeneral.GetInvEntregaAlmacenRuta(DdlSubProyecto.SelectedValue.ToEntero, TxtFechaI.Text.ToDate, TxtFechaF.Text.ToDate, UsuarioActual.CveEmpresa, 3, DdlEstatus.SelectedValue.ToEntero) Then
GvR.DataSource = ObjGeneral.DtResultados
End If
ObjGeneral.Dispose()
@@ -82,20 +82,20 @@ Partial Class Acumuladores_RepRecolecciones
Protected Sub gvR_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
Dim LnkEditar As LinkButton = e.Row.FCLinkButton("LnkGvDatosRecoleccionEditar")
If e.Row.DataKey("Estatus") = "0" OrElse e.Row.DataKey("Estatus") = "" Then
If e.Row.DBCampo("CveMovimientoEntrada") = "" Then
e.Row.FCHyperLink("HplR").Visible = True
e.Row.FCLabel("LblRef").ToolTip = e.Row.DBCampo("CveEntregaAlmacen")
e.Row.FCHyperLink("HplR").NavigateUrl = "/Inventarios/EntradasSalidas.aspx?CveEntregaAlmacen=" & e.Row.DBCampo("CveEntregaAlmacen")
End If
If e.Row.DBCampo("CveMovimientoEntrada") <> "" AndAlso e.Row.DBCampo("CveMovimientoTraslado") = "" Then
Dim LnkEditar As LinkButton = e.Row.FCLinkButton("LnkGvDatosRecoleccionEditar")
'If e.Row.DBCampo("Estatus") = "0" OrElse e.Row.DBCampo("Estatus") = "" Then
LnkEditar.Visible = True
'End If
End If
' If e.Row.DataKey("Estatus") = "1" Then
e.Row.FCHyperLink("HplR").Visible = True
e.Row.FCHyperLink("HplR").NavigateUrl = "/Inventarios/EntradasSalidas.aspx?CveEntregaAlmacen=" & e.Row.DBCampo("CveEntregaAlmacen")
'End If
If e.Row.DataKey("CveTimbre") <> "" Then
e.Row.FCCheckBox("Chk").Visible = False
End If
End If
End Sub
@@ -103,8 +103,6 @@ Partial Class Acumuladores_RepRecolecciones
Dim LnkEliminar As LinkButton = CType(sender, LinkButton)
Dim GvRow As GridViewRow = CType(LnkEliminar.NamingContainer, GridViewRow)
CveEntregaAlmacen = GvRow.DataKey("CveEntregaAlmacen").ToEntero()
Dim CveDireccionOrigen As Integer = GvRow.DataKey("CveDireccionOrigen").ToEntero()
CargaDatosRecoleccionDetallePS()
LtlModalRecoleccionTitulo.Text = "Definición de tamaños"
@@ -117,7 +115,6 @@ Partial Class Acumuladores_RepRecolecciones
ElProductoChange()
End Sub
Private Sub ElProductoChange()
DdlModalRecoleccionUnidad.Items.Clear()
DdlModalRecoleccionUnidad.DataSource = GlobalDTProductosServiciosEquivalencias(DdlProducto2.SelectedValue.ToEntero(), -1, UsuarioActual.CveEmpresa)
@@ -138,7 +135,6 @@ Partial Class Acumuladores_RepRecolecciones
Next
LblProductosCargados.Text = Str.ToString
End If
ObjGenerales.Dispose()
GvModalPSRecoleccion.DataSource = DTRecoleccion
@@ -146,8 +142,10 @@ Partial Class Acumuladores_RepRecolecciones
UpModalRecoleccion.Update()
End Sub
Private Function InitDTRecoleccion() As DataTable
Dim Columnaid = New DataColumn() With {.ColumnName = "CveEntregaAlmacenDetalle", .DataType = Type.GetType("System.Int32"), .AutoIncrement = True, .AutoIncrementSeed = 1, .AutoIncrementStep = 1}
Dim DT As DataTable = New DataTable()
DT.Columns.Add("CveEntregaAlmacenDetalle", System.Type.[GetType]("System.Int32"))
DT.Columns.Add(Columnaid)
DT.Columns.Add("CveEntregaAlmacen", System.Type.[GetType]("System.Int32"))
DT.Columns.Add("CvePS", System.Type.[GetType]("System.Int32"))
DT.Columns.Add("Cantidad", System.Type.[GetType]("System.Double"))
@@ -182,7 +180,6 @@ Partial Class Acumuladores_RepRecolecciones
Protected Sub LnkModalAgregarPS_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim dRow As DataRow = DTRecoleccion.NewRow()
dRow("CveEntregaAlmacenDetalle") = -1
dRow("CveEntregaAlmacen") = CveEntregaAlmacen
dRow("CvePS") = DdlProducto2.SelectedValue.ToEntero()
dRow("Cantidad") = TxtModalRecoleccionCantidad.Text.ToEntero()
@@ -190,7 +187,7 @@ Partial Class Acumuladores_RepRecolecciones
dRow("CveUsuario") = UsuarioActual.CveUsuario
dRow("FechaIng") = NowADS()
dRow("CodigoPS") = DdlProducto2.SelectedItem.Text
dRow("Abreviatura") = DdlModalRecoleccionUnidad.SelectedItem.Text
dRow("Abreviatura") = If(DdlModalRecoleccionUnidad.SelectedItem IsNot Nothing, DdlModalRecoleccionUnidad.SelectedItem.Text, "")
DTRecoleccion.Rows.Add(dRow)
LimpiarControlesPS()
@@ -207,7 +204,6 @@ Partial Class Acumuladores_RepRecolecciones
Private Sub BtnModalRecoleccionGuardar_Click(sender As Object, e As EventArgs) Handles BtnModalRecoleccionGuardar.Click
Dim Cantidad As Decimal = HdnCantidadRecoleccion.Value.ToDecimal
Dim CantidadDefinido As Decimal = 0
For Each gvr As GridViewRow In GvModalPSRecoleccion.Rows
@@ -220,6 +216,7 @@ Partial Class Acumuladores_RepRecolecciones
Dim ObjInventario As New ClsInventarios
Dim ObjConta As New ClsContabilidad(ObjInventario.IniciaTransacSQL)
Dim ObjGral As New ClsGenerales(ObjInventario.IniciaTransacSQL)
Dim ErrorMovInv As Boolean = False
Dim Fecha As DateTime = NowADS()
Dim Concepto As String = "Traspaso Recolección"
@@ -268,22 +265,48 @@ Partial Class Acumuladores_RepRecolecciones
ErrorMovInv = True
End If
End If
If Not ErrorMovInv Then
ObjGral.UpdateInvEntregaAlmacenEstatus(CveEntregaAlmacen, UsuarioActual.CveEmpresa, 1)
End If
End If
End If
If Not ErrorMovInv Then
ObjInventario.Commit()
GvModalPSRecoleccion.DataBind()
DTRecoleccion.Clear()
RegistraScript("$('#DivModalRecoleccion').modal('hide');")
Dim MensajeAlert As New StringBuilder
MensajeAlert.Append("Se realizó con éxito el traspaso.")
MensajeAlert.AppendFormat("<br/> Folio de Salida: <b><a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}"" class='Texto' target=""_blank"">{0}</a></b>", FolioSalida, CveMovimientoSalida)
'MensajeAlert.AppendFormat("<br/><a target='_blank' class='Texto' href='/Compras/PopUpVerFactura.aspx?P={0}'>Imprimir Reporte</a>", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoSalida)))
Alert(MensajeAlert.ToString)
CargaDatos()
Else
ObjInventario.RollBack()
End If
End Sub
Protected Sub LnkModalGvModalPSRecoleccionEliminar_Click(sender As Object, e As EventArgs)
Dim LnkEliminar As LinkButton = CType(sender, LinkButton)
Dim GvRow As GridViewRow = CType(LnkEliminar.NamingContainer, GridViewRow)
Dim CveEntregaAlmacenDetalle = GvRow.DataKey("CveEntregaAlmacenDetalle").ToEntero()
Dim drss As DataRow() = DTRecoleccion.Select($"CveEntregaAlmacenDetalle = {CveEntregaAlmacenDetalle}")
If drss.Count > 0 Then
DTRecoleccion.Rows.Remove(drss(0))
End If
DTRecoleccion.AcceptChanges()
GvModalPSRecoleccion.DataSource = DTRecoleccion
GvModalPSRecoleccion.DataBind()
End Sub
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
CargaDatos()
End Sub
End Class

View File

@@ -3151,105 +3151,105 @@ Public Class ClsAF
#End Region
#Region "ValesCombustible"
Public Function AddValesCombustible(FolioUsuario As Integer, CveCompra As Integer, CveProveedor As Integer, CveAF As Integer, CvePersonal As Integer, Fecha As Date, NombreRecibe As String, CveSubProyecto As Integer, Observaciones As String, Odometro As Integer, CveCombustible As Integer, Litros As Double, TipoVale As Integer, CveUsuario As Integer, CveEmpresa As Integer, Optional Recibo As Integer = -1, Optional Importe As Integer = -1) As Integer
Dim Retorno As Integer = -1
'Public Function AddValesCombustible(FolioUsuario As Integer, CveCompra As Integer, CveProveedor As Integer, CveAF As Integer, CvePersonal As Integer, Fecha As Date, NombreRecibe As String, CveSubProyecto As Integer, Observaciones As String, Odometro As Integer, CveCombustible As Integer, Litros As Double, TipoVale As Integer, CveUsuario As Integer, CveEmpresa As Integer, Optional Recibo As Integer = -1, Optional Importe As Integer = -1) As Integer
' Dim Retorno As Integer = -1
DataAdapter("PA_AF_ValesCombustibleAdd")
' DataAdapter("PA_AF_ValesCombustibleAdd")
With SqlAdapter.SelectCommand.Parameters
.Add("@FolioUsuario", SqlDbType.Int).Value = FolioUsuario
.Add("@CveCompra", SqlDbType.Int).Value = CveCompra
.Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
.Add("@CveAF", SqlDbType.Int).Value = CveAF
.Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal
.Add("@NombreRecibe", SqlDbType.VarChar).Value = NombreRecibe
.Add("@Fecha", SqlDbType.Date).Value = Fecha
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones
.Add("@Odometro", SqlDbType.Int).Value = Odometro
.Add("@CveCombustible", SqlDbType.Int).Value = CveCombustible
.Add("@Litros", SqlDbType.Float).Value = Litros
.Add("@Recibo", SqlDbType.Float).Value = Recibo
.Add("@Importe", SqlDbType.Float).Value = Importe
.Add("@TipoVale", SqlDbType.Int).Value = TipoVale
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveVale", SqlDbType.Int).Direction = ParameterDirection.Output
.Add("@vFolio", SqlDbType.Int).Direction = ParameterDirection.Output
End With
' With SqlAdapter.SelectCommand.Parameters
' .Add("@FolioUsuario", SqlDbType.Int).Value = FolioUsuario
' .Add("@CveCompra", SqlDbType.Int).Value = CveCompra
' .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
' .Add("@CveAF", SqlDbType.Int).Value = CveAF
' .Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal
' .Add("@NombreRecibe", SqlDbType.VarChar).Value = NombreRecibe
' .Add("@Fecha", SqlDbType.Date).Value = Fecha
' .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
' .Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones
' .Add("@Odometro", SqlDbType.Int).Value = Odometro
' .Add("@CveCombustible", SqlDbType.Int).Value = CveCombustible
' .Add("@Litros", SqlDbType.Float).Value = Litros
' .Add("@Recibo", SqlDbType.Float).Value = Recibo
' .Add("@Importe", SqlDbType.Float).Value = Importe
' .Add("@TipoVale", SqlDbType.Int).Value = TipoVale
' .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
' .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
' .Add("@CveVale", SqlDbType.Int).Direction = ParameterDirection.Output
' .Add("@vFolio", SqlDbType.Int).Direction = ParameterDirection.Output
' End With
Try
SqlAdapter.Fill(Data)
FolioVale = SqlAdapter.SelectCommand.Parameters("@vFolio").Value.ToString.ToEntero
Retorno = SqlAdapter.SelectCommand.Parameters("@CveVale").Value.ToString.ToEntero
Catch Ex1 As SqlException
If Ex1.Message.Contains("Número: 2627;") Then
Alert("Ya existe un Vale de Combustible con el mismo nombre: " & Descripcion & ".", TipoMensaje.MsgAdvertencia)
Else
Me.OnError("Ocurrió un error al Guardar el Vale de Combustible.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End If
Catch ex As Exception
' Try
' SqlAdapter.Fill(Data)
' FolioVale = SqlAdapter.SelectCommand.Parameters("@vFolio").Value.ToString.ToEntero
' Retorno = SqlAdapter.SelectCommand.Parameters("@CveVale").Value.ToString.ToEntero
' Catch Ex1 As SqlException
' If Ex1.Message.Contains("Número: 2627;") Then
' Alert("Ya existe un Vale de Combustible con el mismo nombre: " & Descripcion & ".", TipoMensaje.MsgAdvertencia)
' Else
' Me.OnError("Ocurrió un error al Guardar el Vale de Combustible.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
' End If
' Catch ex As Exception
End Try
' End Try
Return Retorno
' Return Retorno
End Function
Public Function GetValesCombustible(CveCompra As Integer, CveValeCombustible As Integer, Folio As Integer, CveProveedor As Integer, CveAF As Integer, CveSubProyecto As Integer, Odometro As Integer, CveCombustible As Integer, Litros As Double, CvePersonal As Integer, CveUsuario As Integer, CveEmpresa As Integer, Recibo As Integer, Importe As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_AF_ValesCombustibleGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveCompra", SqlDbType.Int).Value = CveCompra
.Add("@CveValeCombustible", SqlDbType.Int).Value = CveValeCombustible
.Add("@Folio", SqlDbType.Int).Value = Folio
.Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
.Add("@CveAF", SqlDbType.Int).Value = CveAF
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@Odometro", SqlDbType.Int).Value = Odometro
.Add("@CveCombustible", SqlDbType.Int).Value = CveCombustible
.Add("@Litros", SqlDbType.Float).Value = Litros
.Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@Recibo", SqlDbType.Int).Value = Recibo
.Add("@Importe", SqlDbType.Int).Value = Importe
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener el Catálogo de Estatus de Vales Combustible.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
'End Function
'Public Function GetValesCombustible(CveCompra As Integer, CveValeCombustible As Integer, Folio As Integer, CveProveedor As Integer, CveAF As Integer, CveSubProyecto As Integer, Odometro As Integer, CveCombustible As Integer, Litros As Double, CvePersonal As Integer, CveUsuario As Integer, CveEmpresa As Integer, Recibo As Integer, Importe As Integer) As Boolean
' Dim Retorno As Boolean = False
' DataAdapter("PA_AF_ValesCombustibleGet")
' With SqlAdapter.SelectCommand.Parameters
' .Add("@CveCompra", SqlDbType.Int).Value = CveCompra
' .Add("@CveValeCombustible", SqlDbType.Int).Value = CveValeCombustible
' .Add("@Folio", SqlDbType.Int).Value = Folio
' .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
' .Add("@CveAF", SqlDbType.Int).Value = CveAF
' .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
' .Add("@Odometro", SqlDbType.Int).Value = Odometro
' .Add("@CveCombustible", SqlDbType.Int).Value = CveCombustible
' .Add("@Litros", SqlDbType.Float).Value = Litros
' .Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal
' .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
' .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
' .Add("@Recibo", SqlDbType.Int).Value = Recibo
' .Add("@Importe", SqlDbType.Int).Value = Importe
' End With
' Try
' SqlAdapter.Fill(Data)
' Retorno = True
' Catch ex As Exception
' OnError("Ocurrió un error al obtener el Catálogo de Estatus de Vales Combustible.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
' End Try
Return Retorno
End Function
Public Function UpdateValeCombustible(CveVale As Integer, CveCompra As Integer, CveProveedor As Integer, NombreRecibe As String, Litros As Double, Recibo As Integer, Importe As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
' Return Retorno
'End Function
'Public Function UpdateValeCombustible(CveVale As Integer, CveCompra As Integer, CveProveedor As Integer, NombreRecibe As String, Litros As Double, Recibo As Integer, Importe As Integer, CveEmpresa As Integer) As Boolean
' Dim Retorno As Boolean = False
DataAdapter("PA_AF_ValesCombustibleUpdate")
' DataAdapter("PA_AF_ValesCombustibleUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveVale", SqlDbType.Int).Value = CveVale
.Add("@CveCompra", SqlDbType.Int).Value = CveCompra
.Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
.Add("@NombreRecibe", SqlDbType.VarChar).Value = NombreRecibe
.Add("@Litros", SqlDbType.Float).Value = Litros
.Add("@Recibo", SqlDbType.Int).Value = Recibo
.Add("@Importe", SqlDbType.Int).Value = Importe
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
' With SqlAdapter.SelectCommand.Parameters
' .Add("@CveVale", SqlDbType.Int).Value = CveVale
' .Add("@CveCompra", SqlDbType.Int).Value = CveCompra
' .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
' .Add("@NombreRecibe", SqlDbType.VarChar).Value = NombreRecibe
' .Add("@Litros", SqlDbType.Float).Value = Litros
' .Add("@Recibo", SqlDbType.Int).Value = Recibo
' .Add("@Importe", SqlDbType.Int).Value = Importe
' .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
' End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch Ex1 As SqlException
OnError("Ocurrió un error al actualizar la cuenta contable en el Activo Fijo", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
Catch ex As Exception
OnError("Ocurrió un error al actualizar la cuenta contable en el Activo Fijo.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
' Try
' SqlAdapter.Fill(Data)
' Retorno = True
' Catch Ex1 As SqlException
' OnError("Ocurrió un error al actualizar la cuenta contable en el Activo Fijo", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
' Catch ex As Exception
' OnError("Ocurrió un error al actualizar la cuenta contable en el Activo Fijo.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
' End Try
Return Retorno
End Function
' Return Retorno
'End Function
#End Region
#Region "M E T R I C A S"

View File

@@ -3989,6 +3989,26 @@ Public Class ClsGenerales
Return Retorno
End Function
Public Function UpdateInvEntregaAlmacenEstatus(CveEntregaAlmacen As Integer, CveEmpresa As Integer, Estatus As Integer, Optional CveCompra As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Inv_EntregaAlmacenEstatusUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveEntregaAlmacen", SqlDbType.Int).Value = CveEntregaAlmacen
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@Estatus", SqlDbType.Int).Value = Estatus
.Add("@CveCompra", SqlDbType.Int).Value = CveCompra
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al actualizar estatus entrega almacen", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function AsignaEntregaAlmacenRuta(CveCamion As Integer, CveChofer As Integer, FechaEntrega As Date, FechaLlegada As DateTime, CveEntregaAlmacen As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Inv_EntregaAlmacenRutaAsignar")

View File

@@ -2178,7 +2178,7 @@ Public Class ClsInventarios
Return Retorno
End Function
Public Function GetExistenciasProductosLike(PS As String, CveClasificacion As Integer, CveSubProyecto As Integer, Estatus As Integer, AplicaParaVenta As Integer, CveEmpresa As Integer, Optional CveMarca As Integer = -1, Optional MostrarTodosAlmacenes As Boolean = False) As Boolean
Public Function GetExistenciasProductosLike(PS As String, CveClasificacion As Integer, CveSubProyecto As Integer, Estatus As Integer, AplicaParaVenta As Integer, CveEmpresa As Integer, Optional CveMarca As Integer = -1, Optional MostrarTodosAlmacenes As Boolean = False, Optional CveAlmacen As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_ProductosServiciosInventario")
@@ -2191,6 +2191,7 @@ Public Class ClsInventarios
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveMarca", SqlDbType.Int).Value = CveMarca
.Add("@MostrarTodosAlmacenes", SqlDbType.Bit).Value = MostrarTodosAlmacenes
.Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen
End With
Try

View File

@@ -652,7 +652,7 @@ Public Class ClsOS
CveUsuario As Integer, CveEmpresa As Integer, CveCotizacion As Integer, CveVenta As Integer, CveOSPadre As Integer, CveOSTipo As Integer, Optional CveClienteSucursal As Integer = -1,
Optional Direccion As String = "-1", Optional Telefono As String = "", Optional CveModeloAuto As Integer = -1, Optional Año As String = "-1", Optional Correo As String = "",
Optional Condiciones As String = "", Optional CveMedico As Integer = -1, Optional CveProcedimiento As Integer = -1, Optional CveTipoVenta As Integer = -1, Optional FechaCita As DateTime = MinFecha,
Optional Paciente As String = "-1", Optional IdentificadorCliente As String = "-1") As Boolean
Optional Paciente As String = "-1", Optional IdentificadorCliente As String = "-1", Optional FolioAdicional As String = "-1") As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_OS_OrdenesServiciosAdd")
@@ -686,6 +686,8 @@ Public Class ClsOS
.Add("@Paciente", SqlDbType.VarChar).Value = Paciente
.Add("@IdentificadorCliente", SqlDbType.VarChar).Value = IdentificadorCliente
.Add("@FolioAdicional", SqlDbType.VarChar).Value = FolioAdicional
.Add("@CveOS", SqlDbType.Int).Direction = ParameterDirection.Output
.Add("@vFolio", SqlDbType.Int).Direction = ParameterDirection.Output
@@ -732,7 +734,7 @@ Public Class ClsOS
CveOSTipo As Integer, Optional CveClienteSucursal As Integer = -1, Optional Direccion As String = "-1", Optional Telefono As String = "", Optional CveModeloAuto As Integer = -1,
Optional Año As String = "-1", Optional CveSubProyecto As Integer = -1, Optional Correo As String = "-1", Optional Condiciones As String = "",
Optional CveMedico As Integer = -1, Optional CveProcedimiento As Integer = -1, Optional CveTipoVenta As Integer = -1, Optional FechaCita As DateTime = MinFecha,
Optional Paciente As String = "-1", Optional IdentificadorCliente As String = "-1") As Boolean
Optional Paciente As String = "-1", Optional IdentificadorCliente As String = "-1", Optional FolioAdicional As String = "-1") As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_OS_OrdenesServiciosUpdate")
@@ -761,6 +763,7 @@ Public Class ClsOS
.Add("@FechaCita", SqlDbType.DateTime).Value = FechaCita
.Add("@Paciente", SqlDbType.VarChar).Value = Paciente
.Add("@IdentificadorCliente", SqlDbType.VarChar).Value = IdentificadorCliente
.Add("@FolioAdicional", SqlDbType.VarChar).Value = FolioAdicional
End With

View File

@@ -7020,6 +7020,7 @@ Public Class ClsPaginas
params.Add(New ReportParameter("FechaCirugia", Vta.FechaEjecucion.ToString("dd/MM/yyyy HH:mm")))
params.Add(New ReportParameter("Paciente", Vta.Paciente))
params.Add(New ReportParameter("Episodio", Vta.Episodio))
params.Add(New ReportParameter("Alfa1", Vta.Alfa1))
End If
'VSH

View File

@@ -413,7 +413,8 @@ Public Class ClsProductosServicios
Optional CveMaterialPeligroso As Integer = -1, Optional CveEmbalaje As Integer = -1, Optional PesoKg As Decimal = -1, Optional Dimensiones As String = "", Optional CveObjetoImpuesto As Integer = 0,
Optional RegistroRSCO As String = "-1", Optional FechaVigenciaRSCO As Date = MinFecha, Optional VigenciaIndeterminadaRSCO As Boolean = False, Optional CveTipoEmpacado As Integer = -1, Optional CveTipoOrganico As Integer = -1,
Optional NombreComercial As String = "", Optional NotasAdicionales As String = "", Optional EcommerceEtiquetas As String = "", Optional ActivoEcommerce As Boolean = False, Optional EcommercePrecio As Decimal = 0,
Optional CveClasificacionEcommerce As Integer = -1, Optional EcommerceCantidad As Decimal = 0, Optional CodigoAlterno As String = "-1", Optional PSAlterno As String = "-1", Optional ProductoExhibicion As Boolean = False) As Integer
Optional CveClasificacionEcommerce As Integer = -1, Optional EcommerceCantidad As Decimal = 0, Optional CodigoAlterno As String = "-1", Optional PSAlterno As String = "-1", Optional ProductoExhibicion As Boolean = False,
Optional Imagen As String = "") As Integer
Dim Retorno As Integer = -1
DataAdapter("PA_ProductosServiciosAdd")
@@ -522,7 +523,7 @@ Public Class ClsProductosServicios
.Add("@CodigoAlterno", SqlDbType.VarChar).Value = CodigoAlterno
.Add("@PSAlterno", SqlDbType.VarChar).Value = PSAlterno
.Add("@ProductoExhibicion", SqlDbType.Bit).Value = ProductoExhibicion
.Add("@Imagen", SqlDbType.VarChar).Value = Imagen
End With
Try
@@ -658,7 +659,7 @@ Public Class ClsProductosServicios
Optional CveMaterialPeligroso As Integer = -1, Optional CveEmbalaje As Integer = -1, Optional PesoKg As Decimal = -1, Optional Dimensiones As String = "", Optional CveObjetoImpuesto As Integer = 0,
Optional RegistroRSCO As String = "-1", Optional FechaVigenciaRSCO As Date = MinFecha, Optional VigenciaIndeterminadaRSCO As Boolean = False, Optional CveTipoEmpacado As Integer = -1, Optional CveTipoOrganico As Integer = -1,
Optional NombreComercial As String = "", Optional NotasAdicionales As String = "", Optional EcommerceEtiquetas As String = "", Optional ActivoEcommerce As Boolean = False, Optional EcommercePrecio As Decimal = 0,
Optional CveClasificacionEcommerce As Integer = -1, Optional EcommerceCantidad As Decimal = 0, Optional CodigoAlterno As String = "-1", Optional PSAlterno As String = "-1", Optional ProductoExhibicion As Boolean = False) As Boolean
Optional CveClasificacionEcommerce As Integer = -1, Optional EcommerceCantidad As Decimal = 0, Optional CodigoAlterno As String = "-1", Optional PSAlterno As String = "-1", Optional ProductoExhibicion As Boolean = False, Optional Imagen As String = "") As Boolean
Dim Retorno As Boolean = False
@@ -766,6 +767,7 @@ Public Class ClsProductosServicios
.Add("@CodigoAlterno", SqlDbType.VarChar).Value = CodigoAlterno
.Add("@PSAlterno", SqlDbType.VarChar).Value = PSAlterno
.Add("@ProductoExhibicion", SqlDbType.Bit).Value = ProductoExhibicion
.Add("@Imagen", SqlDbType.VarChar).Value = Imagen
End With
Try

View File

@@ -214,6 +214,25 @@ Public Class ClsTransportes
Return Retorno
End Function
Public Function CancelarViaje(CveViajePasajero As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Trans_ViajesPasajerosCancelarUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveViajePasajero", SqlDbType.Int).Value = CveViajePasajero
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al cancelar el boleto.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function GetRemisionBoleto(CveViajePasajero As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False

View File

@@ -5246,7 +5246,7 @@ Namespace Modelos
End If
If Not TieneError Then
If Not ObjTransportes.UpdateViajesPasajeros(CveViajePasajero) Then
If Not ObjTransportes.CancelarViaje(CveViajePasajero) Then
TieneError = True
End If
End If
@@ -5259,8 +5259,10 @@ Namespace Modelos
TieneError = True
End If
End If
If Not ObjEventos.AddEventoBitacora("se canceló el boleto:" & Row("Obs").ToString(), "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveVenta) Then
ErrorList.Add("Ocurrió un error al agregar la bitacora de cancelación de boleto.")
TieneError = True
End If
If Not TieneError Then
@@ -5277,7 +5279,6 @@ Namespace Modelos
End If
End If
End If
End If
Catch ex As Exception
TieneError = True
@@ -6275,14 +6276,17 @@ Namespace Modelos
'VERIFICA LOS MOVIMIENTOS DE DEVOLUCION YA GENERADOS QUE TENGAN EXISTENCIA EN (ENTREGA POR ADELANTADO)
If Not ErrorCancelar Then
If ObjInventario.GetInv_Mov(CveVenta, UsuarioActual.CveEmpresa) Then
DtMovRemision = ObjInventario.DtResultados.FiltraParametros("CveTipoAlmacen = 10")
CveAlmacenGeneral = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen", "CveTipoAlmacen IN (1,4)").ToString().ToEntero()
DtMovRemision = ObjInventario.DtResultados.FiltraParametros("CveTipoAlmacen IN (10,4)")
CveAlmacenGeneral = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen", "CveTipoAlmacen IN (1,4)").ToEntero()
'SI ES SERVICIO A DOMICILIO DEBE REGRESAR A ESTE TIPO DE ALMACEN
If Me.ServicioDomicilio Then
CveAlmacenGeneral = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen", "CveTipoAlmacen = 29").ToString().ToEntero()
CveAlmacenGeneral = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen", "CveTipoAlmacen = 29").ToEntero()
End If
CveAlmacenExA = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen", "CveTipoAlmacen = 10").ToString().ToEntero()
CveAlmacenExA = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen", "CveTipoAlmacen = 10").ToEntero()
If CveAlmacenExA <= 0 Then
CveAlmacenExA = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen", "CveTipoAlmacen = 4").ToEntero()
End If
CveMovimientoUsado = ObjInventario.DtResultados.FiltroPrimeroValor("CveMovimiento", "CvePS IS NULL AND CveConcepto = 42").ToEntero()
CveAlmacenUsado = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen", "CvePS IS NULL AND CveConcepto = 42").ToEntero()

View File

@@ -788,6 +788,15 @@ Namespace Extensiones
DateTime.TryParseExact(Str, format, System.Globalization.CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.None, fecha)
Return fecha
End Function
<Runtime.CompilerServices.Extension()>
Public Function ToBool(Str As String) As Boolean
If Str <> "" Then
Str = HttpUtility.HtmlDecode(Str).Trim
Return CBool(Str)
Else
Return False
End If
End Function
<Runtime.CompilerServices.Extension()>
Public Function FormatoNumero(Str As String, Optional Decimales As Integer = 2) As String

View File

@@ -927,6 +927,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
Dim UsoClasificacion = IfNull(context.Request("usoclasificacion"), "-1").ToString.ToEntero
Dim AplicaParaVenta = IfNull(context.Request("aplicaparaventa"), "1").ToString.ToEntero
Dim CveMarca = IfNull(context.Request("cvemarca"), "-1").ToString.ToEntero
Dim CveAlmacen = IfNull(context.Request("cvealmacen"), "-1").ToString.ToEntero
Dim UsaGlobal As Boolean = True
Dim MostrarTodosAlmacenes As Boolean = False
@@ -941,7 +942,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
Dim objInv As New ClsInventarios
Try
If objInv.GetExistenciasProductosLike(Name, CveClasificacion, CveSubProyecto, Estatus.ToEntero, AplicaParaVenta, CveEmpresa, CveMarca, MostrarTodosAlmacenes:=MostrarTodosAlmacenes) Then
If objInv.GetExistenciasProductosLike(Name, CveClasificacion, CveSubProyecto, Estatus.ToEntero, AplicaParaVenta, CveEmpresa, CveMarca, MostrarTodosAlmacenes:=MostrarTodosAlmacenes, CveAlmacen:=CveAlmacen) Then
' limpio los almacenes donde no tiene ningun producto existencia

View File

@@ -50,6 +50,7 @@ Partial Class Bancos_FluctuacionCambiaria
DdlAnio.Items.Add(New ListItem(NowADS().Year.ToString(), NowADS().Year.ToString()))
'Año Anterior
DdlAnio.Items.Add(New ListItem(NowADS().AddYears(-1).Year.ToString(), NowADS().AddYears(-1).Year.ToString()))
DdlAnio.Items.Add(New ListItem(NowADS().AddYears(-2).Year.ToString(), NowADS().AddYears(-2).Year.ToString()))
For i As Integer = 1 To 12
Dim fecha As DateTime = New DateTime(DdlAnio.SelectedValue.ToEntero(), i, 1)

View File

@@ -531,7 +531,7 @@
<asp:DropDownList ID="DdlRecoleccion" runat="server" AutoPostBack="true" DataTextField="Referencia" DataValueField="CveEntregaAlmacen" OnSelectedIndexChanged="DdlFolioGarantia_SelectedIndexChanged" CssClass="form-control input-sm input-small select2me">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:Button ID="BtnRecolecciónAplicar" runat="server" Text="Aplicar" CssClass="default" OnClick="BtnRecolecciónAplicar_Click" />
<asp:Button ID="BtnRecolecciónAplicar" runat="server" Text="Aplicar" CssClass="default" />
</div>
</div>
</div>
@@ -1186,7 +1186,7 @@
<asp:UpdatePanel ID="UpInv" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvInv" runat="server" DataKeyNames="Total,PU,Cantidad,CvePS" AutoGenerateColumns="false" GridLines="None" EmptyDataText="Aun no hay registros." ShowHeaderWhenEmpty="True" CssClass="table table-striped table-hover Widthall" Visible="false">
<asp:GridView ID="GvInv" runat="server" DataKeyNames="Total,PU,Cantidad,CvePS" AutoGenerateColumns="false" GridLines="None" EmptyDataText="Aun no hay registros." ShowHeaderWhenEmpty="True" CssClass="table table-striped table-hover Widthall mysmallbtn" Visible="false">
<Columns>
<asp:TemplateField ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center">
<HeaderTemplate>
@@ -1205,7 +1205,7 @@
<asp:TextBox ID="TxtDividir" Visible="false" runat="server" Width="30px"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="SoloNumeros2" runat="server" TargetControlID="TxtDividir" FilterType="Custom, Numbers" ValidChars="." />
<asp:Button Text="D" ID="BtnDividirCompra" runat="server" OnClick="BtnDividirCompra_Click" Style="display: none;" />
<asp:Button Text="SerieLote" ID="BtnSerieLote" OnClick="BtnSerieLote_Click" CssClass="btn btn-primary" runat="server" />
<asp:Button Text="Serie" ID="BtnSerieLote" OnClick="BtnSerieLote_Click" CssClass="btn btn-primary mysmallbtn" runat="server" />
</ItemTemplate>
<HeaderStyle CssClass="Titulos" />
</asp:TemplateField>
@@ -3295,11 +3295,11 @@
</asp:GridView>
</td>
</tr>
<tr>
<%-- <tr>
<td colspan="2" align="center">
<asp:Button Text="Aplicar Vinculacion" CssClass="btn btn-primary" ID="BtnValesVincular" OnClick="BtnValesVincular_Click" runat="server" />
</td>
</tr>
</tr>--%>
<tr>
<td>
<br />

View File

@@ -10,6 +10,7 @@ Imports System.Threading.Tasks
Imports Newtonsoft.Json
Imports Extensiones
Imports MoreLinq
Imports ClbNegBICFDv3_3
Partial Class Compras_Compras
Inherits ClsPaginas
@@ -1341,7 +1342,7 @@ Partial Class Compras_Compras
CambiaEjercicioAC()
End If
UpConsignaciones.Update()
UpINV.Update()
UpInv.Update()
'DdlIVA.Visible = True ' cuando es compra manual
'If UsuarioActual.CveEmpresa = 126 Then
' CargaOrdenCorte()
@@ -1735,6 +1736,50 @@ Partial Class Compras_Compras
End If
End If
Dim SbValRet As New StringBuilder
For Each concepto As XmlNode In nodeconceptos
' Obtener la descripción del concepto
Dim descripcion As String = ValorXML(concepto, "Descripcion")
Dim importeValue As Decimal = Decimal.Parse(ValorXML(concepto, "Importe"))
' Seleccionar el nodo de Impuestos dentro de Concepto, si existe
Dim impuestosNode As XmlNode = concepto.SelectSingleNode("cfdi:Impuestos", namespaces)
If Not impuestosNode Is Nothing Then
' Seleccionar los nodos de Retencion dentro de Impuestos
Dim retenciones As XmlNodeList = impuestosNode.SelectNodes("cfdi:Retenciones/cfdi:Retencion", namespaces)
For Each retencion As XmlNode In retenciones
' Obtener los valores de los atributos Base e Importe
Dim baseValue As Decimal = Decimal.Parse(ValorXML(retencion, "Base"))
Dim impuesto As String = ValorXML(retencion, "Impuesto")
If impuesto = "001" Then
impuesto = "Retención ISR"
ElseIf impuesto = "002" Then
impuesto = "Retención IVA"
ElseIf impuesto = "003" Then
impuesto = "IEPS"
End If
' Validar si Base coincide con Importe
If baseValue <> importeValue Then
'SbValRet.Append($"La base e importe de la retención del impuesto {impuesto} no coinciden para {descripcion}. Base: {baseValue.ToString()}, Importe: {importeValue.ToString()} <br>")
SbValRet.Append($"Producto: {descripcion} La base e importe del impuesto {impuesto} no coincide Base: {baseValue.ToString()}, Importe Producto: {importeValue.ToString()} <br>")
End If
Next
End If
Next
If SbValRet.ToString.Trim.Length > 0 Then
Alert(SbValRet.ToString, TipoMensaje.MsgAdvertencia)
End If
Else
CargaConceptosXML(XMLDoc)
End If
@@ -1761,7 +1806,6 @@ Partial Class Compras_Compras
DdlTipoCompra.Items.Add(New ListItem("Apoyo Logístico", "9"))
DdlTipoCompra.Items.Add(New ListItem("NC Por Devolución", "11"))
DdlTipoCompra.Items.Add(New ListItem("Garantía", "12"))
DdlTipoCompra.Items.Add(New ListItem("Recolección", "14"))
Case "T"
DdlTipoCompra.Items.Clear()
DdlTipoCompra.Items.Add(New ListItem("Apoyo Logístico", "9"))
@@ -4041,7 +4085,6 @@ Partial Class Compras_Compras
End If
End If
If CierrePeriodo Then
Alert("El periodo de la compra actual ya se encuentra cerrado. No podra registrar la compra.", TipoMensaje.MsgAdvertencia)
Exit Sub
@@ -4139,7 +4182,7 @@ Partial Class Compras_Compras
End If
End If
If UsuarioActual.Empresa.Funcionalidad(538).ToEntero = 1 Then
If UsuarioActual.Empresa.Funcionalidad(538) = "1" Then
If TmpDT.MIN("CvePS").ToEntero <= 0 Then
Alert("Todos los Productos/Servicios deben estar registrados o aliados a un productos ya registrado.", TipoMensaje.MsgAdvertencia)
Exit Sub
@@ -4190,7 +4233,7 @@ Partial Class Compras_Compras
If GvInv.HeaderRow.FCCheckBox("cbAll").Checked = True Then
For Each Dr As DataRow In DtInv.Rows
If Dr("CveMetodoInventario").ToString.ToEntero = 5 Then
If Dr("CveMetodoInventario").ToString = "5" Then
Cantidad = DtDatosDetalle.FiltraParametros(String.Format("CvePS = {0}", Dr("CvePS").ToString)).Rows.Count
If Cantidad < Dr("Cantidad").ToString.ToEntero Then
Alert("No hay productos a los que no se le ha asociado Serie", TipoMensaje.MsgError)
@@ -4347,7 +4390,7 @@ Partial Class Compras_Compras
UM.Dispose()
PSS.Dispose()
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso DdlTipoCompra.SelectedValue.Contiene("12", "14") Then 'cuando es garantía, debe de especificar la salida de almacen
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso DdlTipoCompra.SelectedValue.Contiene("12") Then 'cuando es garantía, debe de especificar la salida de almacen
If Not GvInv.HeaderRow.FCCheckBox("cbAll").Checked OrElse GvInv.HeaderRow.FCDropDownList("ddlAlmacen").SelectedValue.ToEntero <= 0 Then
Alert("No ha especificado la salida de almacen en la garantía.", TipoMensaje.MsgAdvertencia)
Exit Sub
@@ -4382,28 +4425,25 @@ Partial Class Compras_Compras
Dim EntradaComoGastoConAlmacen As Boolean = False
If GvInv.Rows.Count > 0 AndAlso GvInv.HeaderRow.FCCheckBox("cbAll").Checked Then
Dim CvealamcenSeleccionado As Integer = -1
Dim CvealmacenSeleccionado As Integer = -1
For Each GvRow As GridViewRow In GvInv.Rows
If GvRow.RowType = DataControlRowType.DataRow Then
CvealamcenSeleccionado = GvRow.FCDropDownList("ddlEAlmacen").SelectedValue.ToEntero
If CvealamcenSeleccionado > 0 Then
CvealmacenSeleccionado = GvRow.FCDropDownList("ddlEAlmacen").SelectedValue.ToEntero
If CvealmacenSeleccionado > 0 Then
Exit For
End If
End If
Next
If CvealamcenSeleccionado > 0 Then
Dim ModalidadAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=CvealamcenSeleccionado).FiltroPrimeroValor("CveModalidad").ToEntero
If CvealmacenSeleccionado > 0 Then
Dim ModalidadAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=CvealmacenSeleccionado).FiltroPrimeroValor("CveModalidad").ToEntero
If ModalidadAlmacen = 0 Then
EntradaComoGastoConAlmacen = True
End If
End If
End If
'si hay necesidad de actualizar el globaldtps
If RegeneraPS Then
'Dim Hilo As New System.Threading.Thread(AddressOf GeneraGlobalDT)
@@ -4455,7 +4495,7 @@ Partial Class Compras_Compras
Dim ObjAcar As New ClsAcarreos(ObjCompras.IniciaTransacSQL())
Dim ObjCGame As New ClsCGame(ObjCompras.IniciaTransacSQL())
Dim ObjProductosServicios As New ClsProductosServicios(ObjCompras.IniciaTransacSQL())
Dim ObjGrales As New ClsGenerales(ObjCompras.IniciaTransacSQL())
Dim ObjContaAC As ClsContPAQi = Nothing
@@ -5103,14 +5143,16 @@ Partial Class Compras_Compras
End If
'Vincula Vales
If IdVale.Count > 0 Then
For Each cve As Integer In IdVale
If Not ObjAF.UpdateValeCombustible(cve, CveCompra, -1, "", -1, -1, -1, UsuarioActual.CveEmpresa) Then
ErrorAF = True
Exit For
End If
Next
End If
'If IdVale.Count > 0 Then
' For Each cve As Integer In IdVale
' If Not ObjAF.UpdateValeCombustible(cve, CveCompra, -1, "", -1, -1, -1, UsuarioActual.CveEmpresa) Then
' ErrorAF = True
' Exit For
' End If
' Next
'End If
'AGREGA AF COMPRA - Cuando es Compra se guarda CveCompraDetalle en AF
If Row("TipoAF").ToString.ToEntero = 2 Then
@@ -5135,6 +5177,12 @@ Partial Class Compras_Compras
Next
''TERMINA: INSERTA DETALLES DE LA COMPRA
If DdlTipoCompra.SelectedValue = "14" Then 'recolección
If Not ObjGrales.UpdateInvEntregaAlmacenEstatus(DdlRecoleccion.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, 2, CveCompra) Then
ErrorDetalles = True
End If
End If
'QUEMA SALDOS DE INV-COMPRA | MERCANCIA RECIBIDA POR ADELANTADO (OC) | PP 176
If OCVinculada And Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") Then
For Each Row As DataRow In TmpDT.FiltraParametros("CveTipoPS = 2").Rows
@@ -5290,11 +5338,11 @@ Partial Class Compras_Compras
CveConceptoMovimiento = 13
tCveFolioGarantia = DdlFolioGarantia.SelectedValue.ToEntero
End If
'recolección
If DdlTipoCompra.SelectedValue = "14" Then 'recolección
CveConceptoMovimiento = 42
tCveEntregaAlmacen = DdlRecoleccion.SelectedValue.ToEntero
End If
''recolección
'If DdlTipoCompra.SelectedValue = "14" Then 'recolección
' CveConceptoMovimiento = 42
' tCveEntregaAlmacen = DdlRecoleccion.SelectedValue.ToEntero
'End If
End If
If (DdlTipoComprobante.SelectedValue = "Fac" AndAlso CveCompraRefacturacion <= 0) OrElse CveConceptoMovimiento = 13 Then
@@ -6323,7 +6371,7 @@ Partial Class Compras_Compras
Dim RegistroCuentaPuente As Boolean = False
'NC CON PRODUCTOS - CUENTA PUENTE
If DdlTipoComprobante.SelectedValue = "NC" And DdlTipoCompra.SelectedValue.Contiene("9", "12", "14") Then
If DdlTipoComprobante.SelectedValue = "NC" And DdlTipoCompra.SelectedValue.Contiene("9", "12") Then
RegistraConcepto225 = True
End If
@@ -10229,7 +10277,7 @@ Partial Class Compras_Compras
If UsuarioActual.Empresa.UsaAC Then e.Row.FCCheckBox("cbInv").Enabled = False
Dim StrTipo As String = "CveTipoAlmacen IN (1,2,7,14,19)"
If DdlTipoCompra.SelectedValue.Contiene("9", "12", "14") Then StrTipo = "CveTipoAlmacen IN (21)"
If DdlTipoCompra.SelectedValue.Contiene("9", "12") Then StrTipo = "CveTipoAlmacen IN (21)"
If EsDevolucionApoyoLogistico Then StrTipo = "CveTipoAlmacen = 27"
e.Row.FCDropDownList("ddlEAlmacen").DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros(StrTipo)
@@ -13553,44 +13601,23 @@ Partial Class Compras_Compras
Private Sub BtnValesCombustibleVer_Click(sender As Object, e As EventArgs) Handles BtnValesCombustibleVer.Click
'Private Sub BtnValesCombustibleVer_Click(sender As Object, e As EventArgs) Handles BtnValesCombustibleVer.Click
Dim AF As New ClsAF
' Dim AF As New ClsAF
If AF.GetValesCombustible(-1, -1, -1, CveProveedor, -1, -1, -1, -1, -1, -1, -1, UsuarioActual.CveEmpresa, -1, -1) Then
GvVales.DataSource = AF.DtResultados
End If
' If AF.GetValesCombustible(-1, -1, -1, CveProveedor, -1, -1, -1, -1, -1, -1, -1, UsuarioActual.CveEmpresa, -1, -1) Then
' GvVales.DataSource = AF.DtResultados
' End If
AF.Dispose()
GvVales.DataBind()
DivValesCombustible.Visible = True
RegistraScript(String.Format("$('#{0}').modal('show')", DivValesCombustible.ClientID))
UPPValesCombustible.Update()
End Sub
' AF.Dispose()
' GvVales.DataBind()
' DivValesCombustible.Visible = True
' RegistraScript(String.Format("$('#{0}').modal('show')", DivValesCombustible.ClientID))
' UPPValesCombustible.Update()
'End Sub
#End Region
#Region " VALES COMBUSTIBLES "
Protected Sub BtnValesVincular_Click(sender As Object, e As EventArgs)
IdVale = New List(Of Integer)
For Each row As GridViewRow In GvVales.Rows
If row.FCCheckBox("ChkVale").Checked Then
IdVale.Add(row.DataKey("CveVale").ToEntero)
End If
Next
If IdVale.Count <= 0 Then
Alert("Debe elegir por lo menos un vale de combustible. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
Else
Alert("Los vales selecciondos están listos para vincular")
RegistraScript(String.Format("$('#{0}').modal('hide')", DivValesCombustible.ClientID))
'For Each cve In IdVale
' Alert(cve.ToString)
'Next
End If
End Sub
#End Region
#Region " VINCULAR OC "
Private Sub InicializaOC()
@@ -14286,7 +14313,7 @@ Partial Class Compras_Compras
If DrTipoGasto IsNot Nothing Then
CveTipoGasto = DrTipoGasto("CveTipoGasto").ToString.ToEntero
TipoGasto = DrTipoGasto("TipoGasto").ToString
End IfclsVa
End If
End If
AddPS(Cantidad, CveUM, UM, CveClasificacion, Clasificacion, CvePS, PS, CveTipoPS, CveSubProyectoContrato, SubProyecto, Proyecto, CveProyecto, Obs, PU, Total, IVA, RetIVA, RetISR, IEPSPS, IEPSPSIVA, Descuento, CveOrdenCompraDetalle, False,
@@ -16749,7 +16776,7 @@ Partial Class Compras_Compras
If DrPS IsNot Nothing Then
Row("PSCodigo") = If(PSCodigo = "", DrPS("PSCodigo").ToString, PSCodigo)
Row("CveMetodoInventario") = DrPS("Inv_CveMetodoInventario").ToString.ToEntero
If Not DdlTipoCompra.SelectedValue.Contiene("12", "14") AndAlso DrPS("AplicaSerie").ToString = "True" Then
If Not DdlTipoCompra.SelectedValue.Contiene("12") AndAlso DrPS("AplicaSerie").ToString = "True" Then
Row("CveMetodoInventario") = "1"
End If
Else
@@ -18969,42 +18996,40 @@ Partial Class Compras_Compras
Protected Sub DdlTipoCompra_SelectedIndexChanged(sender As Object, e As EventArgs)
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV") Then 'cuando es emp acumuladora
If DdlTipoCompra.SelectedValue.Contiene("9", "10", "12") Then 'Al seleccionar apoyo logístico se cargan los amancenes de devoculcion proveedor para dar entrada
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then 'cuando es emp acumuladora
If DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV") Then
If DdlTipoCompra.SelectedValue.Contiene("9", "10", "12") Then 'Al seleccionar apoyo logístico se cargan los amancenes de devoculcion proveedor para dar entrada
If DdlTipoCompra.SelectedValue = "12" Then 'cuando es emp acumuladora
divFolioGarantia.Visible = True
Using objAcum As New ClsAcumuladores
If objAcum.FoliosGarantiaGet(-1, UsuarioActual.Empresa.CveEmpresa, Estatus:=2, TipoFolio:="-1", Area:=-1, CveSubProyecto:=-1) Then
DdlFolioGarantia.DataSource = objAcum.DtResultados.FiltraParametros("", "FechaIng DESC")
DdlFolioGarantia.DataBind()
End If
End Using
End If
'cambia si hay ps con uso de serie
For Each dr As DataRow In TmpDT.Rows
dr("CveMetodoInventario") = 1
Next
CargaGvInv()
Else
If DdlTipoCompra.SelectedValue.Contiene("14") Then 'Recolección
divRecoleccion.Visible = True
Using objAcum As New ClsGenerales
If objAcum.GetInvEntregaAlmacenRuta(-1, MinFecha, MaxFecha, UsuarioActual.Empresa.CveEmpresa, 2, Estatus:=0) Then
DdlRecoleccion.DataSource = objAcum.DtResultados.FiltraParametros("", "Referencia DESC")
DdlRecoleccion.DataBind()
End If
End Using
If DdlTipoCompra.SelectedValue = "12" Then
divFolioGarantia.Visible = True
Using objAcum As New ClsAcumuladores
If objAcum.FoliosGarantiaGet(-1, UsuarioActual.Empresa.CveEmpresa, Estatus:=2, TipoFolio:="-1", Area:=-1, CveSubProyecto:=-1) Then
DdlFolioGarantia.DataSource = objAcum.DtResultados.FiltraParametros("", "FechaIng DESC")
DdlFolioGarantia.DataBind()
End If
End Using
End If
'cambia si hay ps con uso de serie
For Each dr As DataRow In TmpDT.Rows
dr("CveMetodoInventario") = 1
Next
CargaGvInv()
End If
ElseIf DdlTipoComprobante.SelectedValue.Contiene("Fac") Then
If DdlTipoCompra.SelectedValue.Contiene("14") Then 'Recolección
divRecoleccion.Visible = True
Using objAcum As New ClsGenerales
If objAcum.GetInvEntregaAlmacenRuta(-1, MinFecha, MaxFecha, UsuarioActual.Empresa.CveEmpresa, 3, Estatus:=1) Then
DdlRecoleccion.DataSource = objAcum.DtResultados.FiltraParametros("", "Referencia DESC")
End If
End Using
DdlRecoleccion.DataBind()
CargaGvInv()
End If
End If
End If
End Sub
#End Region
@@ -19764,6 +19789,10 @@ Partial Class Compras_Compras
Dim cantidad As Decimal = dr("CantidadDisponible").ToString.ToDecimal
AddPS(cantidad, dr("CveUM").ToString.ToEntero, "", dr("CveClasificacion").ToString.ToEntero, "", dr("CvePS").ToString.ToEntero, dr("PS").ToString, 2, tCveSub.ToString, "SE", "SE", "", "", pu, Total, Porcentaje, 0, 0, 0, 0, 0, PorcentajeIVA:=Porcentaje, TCalculaTotales:=True, CveTipoGasto:=tCveTipoGasto)
Next
'cambia si hay ps con uso de serie
For Each dr As DataRow In TmpDT.Rows
dr("CveMetodoInventario") = 1
Next
AddPS2()
End If
@@ -20107,6 +20136,10 @@ Partial Class Compras_Compras
DdlRefacturacionFacturas.Items.Insert(0, New ListItem("Seleccione", "-1"))
End Sub
Protected Sub BtnRecolecciónAplicar_Click(sender As Object, e As EventArgs)
End Sub
End Class

View File

@@ -4575,32 +4575,32 @@ Partial Class PopUpVerFactura
#Region "OP = 'VAL' - IMPRIME PDF VAL"
Private Sub GenerarPDFVale(CveVale As Integer)
Dim ObjAF As New ClsAF
If ObjAF.GetValesCombustible(-1, CveVale, -1, -1, -1, -1, -1, -1, -1, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1) Then
Dim dtVC As DataTable = ObjAF.DtResultados
Dim dr As DataRow = dtVC.Rows(0)
'Dim ObjAF As New ClsAF
'If ObjAF.GetValesCombustible(-1, CveVale, -1, -1, -1, -1, -1, -1, -1, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1) Then
' Dim dtVC As DataTable = ObjAF.DtResultados
' Dim dr As DataRow = dtVC.Rows(0)
Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("Folio", dr("Folio").ToString))
params.Add(New ReportParameter("Proveedor", dr("RazonSocial").ToString))
params.Add(New ReportParameter("Obra", dr("SubProyecto").ToString))
params.Add(New ReportParameter("NoEconomico", dr("Codigo").ToString))
params.Add(New ReportParameter("Fecha", dr("Fecha").ToString))
params.Add(New ReportParameter("Operador", dr("NombreCompleto").ToString))
params.Add(New ReportParameter("Combustible", dr("Combustible").ToString))
params.Add(New ReportParameter("LitrosCombustible", dr("Litros").ToString))
ImprimirPDF(String.Format(UsuarioActual.Empresa.Ruta & "/Formatos/ValesCombustible.rdlc", UsuarioActual.Empresa.Ruta), dtVC, params)
' Dim params As New List(Of ReportParameter)
' params.Add(New ReportParameter("Folio", dr("Folio").ToString))
' params.Add(New ReportParameter("Proveedor", dr("RazonSocial").ToString))
' params.Add(New ReportParameter("Obra", dr("SubProyecto").ToString))
' params.Add(New ReportParameter("NoEconomico", dr("Codigo").ToString))
' params.Add(New ReportParameter("Fecha", dr("Fecha").ToString))
' params.Add(New ReportParameter("Operador", dr("NombreCompleto").ToString))
' params.Add(New ReportParameter("Combustible", dr("Combustible").ToString))
' params.Add(New ReportParameter("LitrosCombustible", dr("Litros").ToString))
' ImprimirPDF(String.Format(UsuarioActual.Empresa.Ruta & "/Formatos/ValesCombustible.rdlc", UsuarioActual.Empresa.Ruta), dtVC, params)
'ImprimirPDFview(String.Format(UsuarioActual.Empresa.Ruta & "/Formatos/ValesCombustible.rdlc", UsuarioActual.Empresa.Ruta), lrds, params, "formato", "pdf", ReportViewer1)
'Dim Archivo As New System.IO.FileInfo(String.Format("Empresas\1\Formatos\ValesCombustible.rdlc", UsuarioActual.Empresa.Rulrdsta))
'If Archivo.Exists Then
' 'ImprimirPDFview(String.Format(UsuarioActual.Empresa.Ruta & "/Formatos/ValesCombustible.rdlc", UsuarioActual.Empresa.Ruta), lrds, params, "formato", "pdf", ReportViewer1)
' 'Dim Archivo As New System.IO.FileInfo(String.Format("Empresas\1\Formatos\ValesCombustible.rdlc", UsuarioActual.Empresa.Rulrdsta))
' 'If Archivo.Exists Then
'Else
' 'params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
' ImprimirPDF("/Empresas/1/Formatos/ValesCombustible.rdlc", dtVC, params, "ValeCombustible")
'End If
End If
ObjAF.Dispose()
' 'Else
' ' 'params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
' ' ImprimirPDF("/Empresas/1/Formatos/ValesCombustible.rdlc", dtVC, params, "ValeCombustible")
' 'End If
'End If
'ObjAF.Dispose()
End Sub
#End Region
@@ -6040,6 +6040,9 @@ Partial Class PopUpVerFactura
If DtPrecios IsNot Nothing Then
Dim DirectorioArchivo As String = "Empresas/Grales/Formatos/Etiqueta.mrt"
If System.IO.File.Exists(UsuarioActual.Empresa.Ruta + "Formatos/Etiqueta.mrt") Then
DirectorioArchivo = UsuarioActual.Empresa.Ruta + "Formatos/Etiqueta.mrt"
End If
Dim params As New List(Of ReportParameter)
ImprimirPDFStimul(DirectorioArchivo, DtPrecios, params, "Precios")

View File

@@ -85,7 +85,7 @@
<Relations isList="true" count="0" />
<Report isRef="0" />
<Resources isList="true" count="0" />
<Variables isList="true" count="93">
<Variables isList="true" count="94">
<value>ReportParameters,ClienteCodigo,ClienteCodigo,ReportParameter1,System.String,,False,False,True,False,_x003C__x003F_xml_x0020_version_x003D__x0022_1.0_x0022__x0020_encoding_x003D__x0022_utf-16_x0022__x0020_standalone_x003D__x0022_yes_x0022__x003F__x003E__x003C_StiSerializer_x0020_version_x003D__x0022_1.02_x0022__x0020_type_x003D__x0022_Net_x0022__x0020_application_x003D__x0022_State_x0022__x003E__x003C_SortDirection_x003E_None_x003C__x002F_SortDirection_x003E__x003C_BindingVariable_x0020_isNull_x003D__x0022_true_x0022__x0020__x002F__x003E__x003C_Keys_x0020_isList_x003D__x0022_true_x0022__x0020_count_x003D__x0022_0_x0022__x0020__x002F__x003E__x003C_Values_x0020_isList_x003D__x0022_true_x0022__x0020_count_x003D__x0022_0_x0022__x0020__x002F__x003E__x003C_CheckedStates_x0020_isList_x003D__x0022_true_x0022__x0020_count_x003D__x0022_0_x0022__x0020__x002F__x003E__x003C__x002F_StiSerializer_x003E_,_x0035_4a879e0a10d464ba2f01e0372efb9ca</value>
<value>ReportParameters,ClienteTelefono,ClienteTelefono,ReportParameter1,System.String,,False,False,True,False,,_x0036_22a3a61b2f247a6ab5d7dc6c66568db</value>
<value>ReportParameters,ClienteContacto,ClienteContacto,ReportParameter1,System.String,,False,False,True,False,,_x0035_c52eccfce4d4681a1c62017e690c7c1</value>
@@ -179,6 +179,7 @@
<value>ReportParameters,FechaCirugia,FechaCirugia,,System.String,,False,False,True,False,_x003C__x003F_xml_x0020_version_x003D__x0022_1.0_x0022__x0020_encoding_x003D__x0022_utf-16_x0022__x0020_standalone_x003D__x0022_yes_x0022__x003F__x003E__x003C_StiSerializer_x0020_version_x003D__x0022_1.02_x0022__x0020_type_x003D__x0022_Net_x0022__x0020_application_x003D__x0022_State_x0022__x003E__x003C_SortDirection_x003E_None_x003C__x002F_SortDirection_x003E__x003C_BindingVariable_x0020_isNull_x003D__x0022_true_x0022__x0020__x002F__x003E__x003C_Keys_x0020_isList_x003D__x0022_true_x0022__x0020_count_x003D__x0022_0_x0022__x0020__x002F__x003E__x003C_Values_x0020_isList_x003D__x0022_true_x0022__x0020_count_x003D__x0022_0_x0022__x0020__x002F__x003E__x003C_CheckedStates_x0020_isList_x003D__x0022_true_x0022__x0020_count_x003D__x0022_0_x0022__x0020__x002F__x003E__x003C_DateTimeType_x003E_DateAndTime_x003C__x002F_DateTimeType_x003E__x003C__x002F_StiSerializer_x003E_,_x0039_11bc963c59b4b6cb4b0ce36a86c40e1</value>
<value>ReportParameters,Paciente,Paciente,ReportParameter1,System.String,,False,False,True,False,_x003C__x003F_xml_x0020_version_x003D__x0022_1.0_x0022__x0020_encoding_x003D__x0022_utf-16_x0022__x0020_standalone_x003D__x0022_yes_x0022__x003F__x003E__x003C_StiSerializer_x0020_version_x003D__x0022_1.02_x0022__x0020_type_x003D__x0022_Net_x0022__x0020_application_x003D__x0022_State_x0022__x003E__x003C_SortDirection_x003E_None_x003C__x002F_SortDirection_x003E__x003C_BindingVariable_x0020_isNull_x003D__x0022_true_x0022__x0020__x002F__x003E__x003C_Keys_x0020_isList_x003D__x0022_true_x0022__x0020_count_x003D__x0022_0_x0022__x0020__x002F__x003E__x003C_Values_x0020_isList_x003D__x0022_true_x0022__x0020_count_x003D__x0022_0_x0022__x0020__x002F__x003E__x003C_CheckedStates_x0020_isList_x003D__x0022_true_x0022__x0020_count_x003D__x0022_0_x0022__x0020__x002F__x003E__x003C_DateTimeType_x003E_DateAndTime_x003C__x002F_DateTimeType_x003E__x003C_CheckedColumn_x003E_null_x003B__x003C__x002F_CheckedColumn_x003E__x003C__x002F_StiSerializer_x003E_</value>
<value>ReportParameters,Episodio,Episodio,ReportParameter1,System.String,,False,False,True,False,_x003C__x003F_xml_x0020_version_x003D__x0022_1.0_x0022__x0020_encoding_x003D__x0022_utf-16_x0022__x0020_standalone_x003D__x0022_yes_x0022__x003F__x003E__x003C_StiSerializer_x0020_version_x003D__x0022_1.02_x0022__x0020_type_x003D__x0022_Net_x0022__x0020_application_x003D__x0022_State_x0022__x003E__x003C_SortDirection_x003E_None_x003C__x002F_SortDirection_x003E__x003C_BindingVariable_x0020_isNull_x003D__x0022_true_x0022__x0020__x002F__x003E__x003C_Keys_x0020_isList_x003D__x0022_true_x0022__x0020_count_x003D__x0022_0_x0022__x0020__x002F__x003E__x003C_Values_x0020_isList_x003D__x0022_true_x0022__x0020_count_x003D__x0022_0_x0022__x0020__x002F__x003E__x003C_CheckedStates_x0020_isList_x003D__x0022_true_x0022__x0020_count_x003D__x0022_0_x0022__x0020__x002F__x003E__x003C_DateTimeType_x003E_DateAndTime_x003C__x002F_DateTimeType_x003E__x003C_CheckedColumn_x003E_null_x003B__x003C__x002F_CheckedColumn_x003E__x003C__x002F_StiSerializer_x003E_</value>
<value>ReportParameters,Alfa1,Alfa1,ReportParameter1,System.String,,False,False,True,False,_x003C__x003F_xml_x0020_version_x003D__x0022_1.0_x0022__x0020_encoding_x003D__x0022_utf-16_x0022__x0020_standalone_x003D__x0022_yes_x0022__x003F__x003E__x003C_StiSerializer_x0020_version_x003D__x0022_1.02_x0022__x0020_type_x003D__x0022_Net_x0022__x0020_application_x003D__x0022_State_x0022__x003E__x003C_SortDirection_x003E_None_x003C__x002F_SortDirection_x003E__x003C_BindingVariable_x0020_isNull_x003D__x0022_true_x0022__x0020__x002F__x003E__x003C_Keys_x0020_isList_x003D__x0022_true_x0022__x0020_count_x003D__x0022_0_x0022__x0020__x002F__x003E__x003C_Values_x0020_isList_x003D__x0022_true_x0022__x0020_count_x003D__x0022_0_x0022__x0020__x002F__x003E__x003C_CheckedStates_x0020_isList_x003D__x0022_true_x0022__x0020_count_x003D__x0022_0_x0022__x0020__x002F__x003E__x003C_DateTimeType_x003E_DateAndTime_x003C__x002F_DateTimeType_x003E__x003C_CheckedColumn_x003E_null_x003B__x003C__x002F_CheckedColumn_x003E__x003C__x002F_StiSerializer_x003E_</value>
</Variables>
</Dictionary>
<EngineVersion>EngineV2</EngineVersion>
@@ -1488,7 +1489,8 @@ Sello digital del SAT:
<Page isRef="7" />
<Parent isRef="62" />
<Text>Paciente: {Paciente}
Episodio: {Episodio}</Text>
Episodio: {Episodio}
Folio Remisión: {Alfa1}</Text>
<TextBrush>Black</TextBrush>
<Type>Expression</Type>
</Text9>

File diff suppressed because it is too large Load Diff

View File

@@ -39,6 +39,8 @@
<asp:RadioButtonList runat="server" ID="RblFormato">
<asp:ListItem Value="1" Text="Proveedores" Selected="True"></asp:ListItem>
<asp:ListItem Value="3" Text="Factura - Proveedor"></asp:ListItem>
<asp:ListItem Value="18" Text="Factura - Proveedor Detalle"></asp:ListItem>
<asp:ListItem Value="13" Text="Anticipo Proveedores"></asp:ListItem>
<asp:ListItem Value="2" Text="Clientes"></asp:ListItem>
<asp:ListItem Value="4" Text="Factura - Cliente"></asp:ListItem>

View File

@@ -225,7 +225,7 @@ Partial Class General_SaldosIniciales
ElseIf RblFormato.SelectedValue = "3" Or RblFormato.SelectedValue = "4" Or RblFormato.SelectedValue = "17" Then
ElseIf RblFormato.SelectedValue = "3" Or RblFormato.SelectedValue = "4" Or RblFormato.SelectedValue = "17" Or RblFormato.SelectedValue = "18" Then
If Not dt.Columns(0).ColumnName = "Sucursal" Then
Alert("El nombre de la primera columna debe ser 'Sucursal'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
@@ -293,54 +293,84 @@ Partial Class General_SaldosIniciales
Exit Sub
End If
If Not dt.Columns(15).ColumnName = "Folio Fiscal" Then
Alert("El nombre de la decimosexta columna debe ser 'Folio Fiscalo'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If Not dt.Columns(16).ColumnName = "PorcentajeIVA" Then
Alert("El nombre de la decimoséptima columna debe ser 'PorcentajeIVA'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If RblFormato.SelectedValue = "3" Or RblFormato.SelectedValue = "18" Then
'If RblFormato.SelectedValue = "4" Then
' If Not dt.Columns(15).ColumnName = "ImpuestoLocal" Then
' Alert("El nombre de la diesciseisava columna debe ser 'ImpuestoLocal'. Favor de corregirlo", TipoMensaje.MsgError)
' Exit Sub
' End If
' If Not dt.Columns(16).ColumnName = "Amort.Ant" Then
' Alert("El nombre de la diescisieteava columna debe ser 'Amort.Ant'. Favor de corregirlo", TipoMensaje.MsgError)
' Exit Sub
' End If
'End If
If RblFormato.SelectedValue = "17" Then
If Not dt.Columns(17).ColumnName = "Cantidad" Then
Alert("El nombre de la Decimoctava columna debe ser 'Cantidad'. Favor de corregirlo", TipoMensaje.MsgError)
If Not dt.Columns(15).ColumnName = "PorcentajeIVA" Then
Alert("El nombre de la quinceava columna debe ser 'PorcentajeIVA'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If Not dt.Columns(18).ColumnName = "PU" Then
Alert("El nombre de la Decimonovena columna debe ser 'PU'. Favor de corregirlo", TipoMensaje.MsgError)
If Not dt.Columns(16).ColumnName = "ImpuestosLocales" Then
Alert("El nombre de la quinceava columna debe ser 'ImpuestosLocales'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If Not dt.Columns(19).ColumnName = "IVA" Then
Alert("El nombre de la Vigésima columna debe ser 'IVA'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If RblFormato.SelectedValue = "18" Then
If Not dt.Columns(17).ColumnName = "Cantidad" Then
Alert("El nombre de la Decimoctava columna debe ser 'Cantidad'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If Not dt.Columns(20).ColumnName = "IEPS" Then
Alert("El nombre de la Vigésimo primera columna debe ser 'IEPS'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
If Not dt.Columns(18).ColumnName = "Codigo" Then
Alert("El nombre de la Decimonovena columna debe ser 'Codigo'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If Not dt.Columns(19).ColumnName = "PU" Then
Alert("El nombre de la Vigésima columna debe ser 'PU'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If Not dt.Columns(20).ColumnName = "IVADetalle" Then
Alert("El nombre de la Vigésimo primera columna debe ser 'IVADetalle'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If Not dt.Columns(21).ColumnName = "IEPS" Then
Alert("El nombre de la Vigésimo segunda columna debe ser 'IEPS'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
End If
End If
If RblFormato.SelectedValue = "4" Or RblFormato.SelectedValue = "17" Then
If Not dt.Columns(15).ColumnName = "Folio Fiscal" Then
Alert("El nombre de la decimosexta columna debe ser 'Folio Fiscalo'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If Not dt.Columns(16).ColumnName = "PorcentajeIVA" Then
Alert("El nombre de la decimoséptima columna debe ser 'PorcentajeIVA'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If RblFormato.SelectedValue = "17" Then
If Not dt.Columns(17).ColumnName = "Cantidad" Then
Alert("El nombre de la Decimoctava columna debe ser 'Cantidad'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If Not dt.Columns(18).ColumnName = "Codigo" Then
Alert("El nombre de la Decimonovena columna debe ser 'Codigo'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If Not dt.Columns(19).ColumnName = "PU" Then
Alert("El nombre de la Vigésima columna debe ser 'PU'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If Not dt.Columns(20).ColumnName = "IVADetalle" Then
Alert("El nombre de la Vigésimo primera columna debe ser 'IVADetalle'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If Not dt.Columns(21).ColumnName = "IEPS" Then
Alert("El nombre de la Vigésimo segunda columna debe ser 'IEPS'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
End If
End If
ElseIf RblFormato.SelectedValue = "5" Then
If Not dt.Columns(0).ColumnName = "Codigo" Then
@@ -1444,7 +1474,7 @@ Partial Class General_SaldosIniciales
'P R O V E E D O R E S - F A C T U R A S
ElseIf RblFormato.SelectedValue = "3" Then
ElseIf RblFormato.SelectedValue = "3" Or RblFormato.SelectedValue = "18" Then
#Region "P R O V E E D O R E S - F A C T U R A S"
@@ -1469,6 +1499,9 @@ Partial Class General_SaldosIniciales
Dim CveClasificacion As Integer = drr("CveClasificacion").ToString().ToEntero()
Dim dtsubp As DataTable = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa)
Dim CountRow As Integer = 1
For Each Row As DataRow In dt.FiltraParametros("RFC <> ''").Rows
Dim Sucursal As String = dtsubp.FiltroPrimeroValor("CveSubProyecto", $"SubProyecto = '{Row("Sucursal").ToString()}'")
RFC = Row("RFC").ToString().Trim
@@ -1529,6 +1562,45 @@ Partial Class General_SaldosIniciales
TipoCambio = GlobalTipoCambio(Fecha).ToString
End If
Dim IEPSDetalle As Decimal = 0
Dim CantidadDetalle As Decimal = 0
Dim PUDetalle As Decimal = 0
Dim IVADetalle As Decimal = 0
If RblFormato.SelectedValue = "18" Then
Dim CodigoDetalle As String = Row("Codigo").ToString
If CodigoDetalle.Trim.Length > 0 Then
Dim DrDetalles As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa).FiltroPrimero($"Codigo = '{CodigoDetalle}'")
If DrDetalles IsNot Nothing Then
CvePS = DrDetalles("CvePS").ToString().ToEntero()
CveUnidadMedida = DrDetalles("CveUnidadMedida").ToString().ToEntero()
CveClasificacion = DrDetalles("CveClasificacion").ToString().ToEntero()
Else
Alert($"El código del producto no se encontro, error en registro {CountRow}")
ErrorCompras = True
End If
Else
Alert($"El código es requerido, error en registro {CountRow}")
ErrorCompras = True
End If
IEPSDetalle = Row("IEPS").ToString.ToDecimal
CantidadDetalle = Row("Cantidad").ToString.ToDecimal
PUDetalle = Row("PU").ToString.ToDecimal
IVADetalle = Row("IVA").ToString.ToDecimal
If CantidadDetalle = 0 Then
Alert($"No se especifico la cantidad, error en registro {CountRow}")
ErrorCompras = True
End If
End If
'PrePóliza
Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Compras/SaldoInicial", 1, Total, Total, CveMoneda, Fecha, String.Format("{0}-{1}", Serie, Folio), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If Not CvePrePoliza > 0 Then
@@ -1548,10 +1620,30 @@ Partial Class General_SaldosIniciales
CveCompra = ObjCompras.CveCompra
'Compra Detalle
If Not ObjCompras.AddCompraDetalle(CveCompra, CveUnidadMedida, CvePS, CveSubProyecto, -1, 0, 1, SubTotal, SubTotal * PorcentajeIVA, SubTotal, 0, "Carga Inicial", -1, IVAPorcentaje:=PorcentajeIVA, RetIVAPorcentaje:=RetIVAPorcentaje, RetISRPorcentaje:=RetISRPorcentaje) Then
ErrorCompras = True
Exit For
If RblFormato.SelectedValue = "18" Then
Dim TotalDetalles As Decimal = SubTotal
If PUDetalle > 0 Then
TotalDetalles = (CantidadDetalle * PUDetalle) + IVA - RetIVA - RetISR + IEPSDetalle
End If
If Math.Abs(TotalDetalles - Total) > 0.01 Then
ErrorCompras = True
Alert($"Registro {CountRow} El total no councide con el calculo de los detalles, total: {Total.ToString("###,###,###.00")} calculo detatalles: {TotalDetalles.ToString("###,###,###.00")}", TipoMensaje.MsgAdvertencia)
Exit For
End If
If Not ObjCompras.AddCompraDetalle(CveCompra, CveUnidadMedida, CvePS, CveSubProyecto, -1, 0, CantidadDetalle, PUDetalle, (CantidadDetalle * PUDetalle) * PorcentajeIVA, TotalDetalles, 0, "Carga Inicial", -1, IVAPorcentaje:=PorcentajeIVA, RetIVAPorcentaje:=RetIVAPorcentaje, RetISRPorcentaje:=RetISRPorcentaje, IEPSPS:=IEPSDetalle) Then
ErrorCompras = True
Exit For
End If
Else
If Not ObjCompras.AddCompraDetalle(CveCompra, CveUnidadMedida, CvePS, CveSubProyecto, -1, 0, 1, SubTotal, SubTotal * PorcentajeIVA, SubTotal, 0, "Carga Inicial", -1, IVAPorcentaje:=PorcentajeIVA, RetIVAPorcentaje:=RetIVAPorcentaje, RetISRPorcentaje:=RetISRPorcentaje) Then
ErrorCompras = True
Exit For
End If
End If
If ImpuestosLocales > 0 Then 'se agrega como parte de la partida, sin iva.
If Not ObjCompras.AddCompraDetalle(CveCompra, CveUnidadMedida, CvePS, CveSubProyecto, -1, 0, 1, ImpuestosLocales, ImpuestosLocales, ImpuestosLocales, 0, "Carga Inicial", -1, IVAPorcentaje:=0, RetIVAPorcentaje:=0, RetISRPorcentaje:=0) Then
ErrorCompras = True
@@ -1580,6 +1672,7 @@ Partial Class General_SaldosIniciales
End If
Encontrados = Encontrados + 1
CountRow = CountRow + 1
Next
Catch ex As Exception
@@ -1669,6 +1762,7 @@ Partial Class General_SaldosIniciales
Dim FolioFiscal As String = If(dt.Columns.Contains("Folio Fiscal"), Row("Folio Fiscal").ToString(), "")
Dim PorcentajeIVA As Decimal = If(dt.Columns.Contains("PorcentajeIVA"), Round(Row("PorcentajeIVA").ToString().ToDecimal, 4), 0)
Dim PorcentajeRetIVA As Decimal = If(dt.Columns.Contains("PorcentajeRetIVA"), Round(Row("PorcentajeRetIVA").ToString().ToDecimal, 4), 0)
Dim PorcentajeRetISR As Decimal = If(dt.Columns.Contains("PorcentajeRetISR"), Round(Row("PorcentajeRetISR").ToString().ToDecimal, 4), 0)
Dim PedidoContrato As String = If(dt.Columns.Contains("Pedido"), Row("Pedido").ToString(), "")
@@ -1688,7 +1782,7 @@ Partial Class General_SaldosIniciales
Dim CodigoDetalle As String = Row("Codigo").ToString
If CodigoDetalle.Trim.Length > 0 Then
Dim DrDetalles As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa).FiltroPrimero($"Codigo = {CodigoDetalle}")
Dim DrDetalles As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa).FiltroPrimero($"Codigo = '{CodigoDetalle}'")
If DrDetalles IsNot Nothing Then
CvePS = DrDetalles("CvePS").ToString().ToEntero()
@@ -1795,9 +1889,14 @@ Partial Class General_SaldosIniciales
TotalDetalles = (CantidadDetalle * PUDetalle) + IVA - RetIVA - RetISR + IEPSDetalle
End If
If Math.Abs(TotalDetalles - Total) > 0.01 Then
ErrorVentas = True
Alert($"Registro {CountRow} El total no councide con el calculo de los detalles, total: {Total.ToString("###,###,###.00")} calculo detatalles: {TotalDetalles.ToString("###,###,###.00")}", TipoMensaje.MsgAdvertencia)
Exit For
End If
If Not ObjVentas.AddVentaDetalle(CveVenta, CvePS, CantidadDetalle, CveUnidadMedida, PUDetalle * CantidadDetalle, IVADetalle, TotalDetalles, "Saldo Inicial", 0, 0, Sucursal.ToEntero(), 0,
PorcentajeIVA:=PorcentajeIVA, PorcentajeRetIVA:=PorcentajeRetIVA, ImporteRetIVA:=RetIVA, IEPS:=IEPSDetalle) Then
PorcentajeIVA:=PorcentajeIVA, PorcentajeRetIVA:=PorcentajeRetIVA, ImporteRetIVA:=RetIVA, IEPS:=IEPSDetalle, PorcentajeRetISR:=PorcentajeRetISR) Then
ErrorVentas = True
Exit For
End If
@@ -1811,9 +1910,6 @@ Partial Class General_SaldosIniciales
Dim ConceptoContable As Integer = 1
Dim ConceptoContablePago As Integer = 2
If TipoDocto = "Egs" Then
@@ -1842,8 +1938,13 @@ Partial Class General_SaldosIniciales
'If IEPS > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, IEPS, Folio.ToString(), 38, String.Format("{0}-{1}", Serie, Folio), CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=IEPS) Then ErrorVentas = True : Exit For
If RetIVA > 0 Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, RetIVA, RetIVA, 8, Folio.ToString(), String.Format("{0}-{1}", Serie, Folio), CveVenta:=CveVenta, CveCliente:=CveCliente, PorcentajeImpuesto:=PorcentajeIVA, Contabilizable:=False) Then ErrorVentas = True : Exit For
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, RetIVA, RetIVA, 8, Folio.ToString(), String.Format("{0}-{1}", Serie, Folio), CveVenta:=CveVenta, CveCliente:=CveCliente, PorcentajeImpuesto:=PorcentajeRetIVA, Contabilizable:=False) Then ErrorVentas = True : Exit For
End If
If RetISR > 0 Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, RetISR, RetISR, 9, Folio.ToString(), String.Format("{0}-{1}", Serie, Folio), CveVenta:=CveVenta, CveCliente:=CveCliente, PorcentajeImpuesto:=PorcentajeRetISR, Contabilizable:=False) Then ErrorVentas = True : Exit For
End If
If ImpuestoLocal > 0 Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImpuestoLocal, ImpuestoLocal, 27, Folio.ToString(), String.Format("{0}-{1}", Serie, Folio), CveVenta:=CveVenta, CveCliente:=CveCliente, PorcentajeImpuesto:=PorcentajeIVA, Contabilizable:=False) Then ErrorVentas = True : Exit For
End If
@@ -2387,7 +2488,7 @@ Partial Class General_SaldosIniciales
Dim AlmacenRef As DataTable = GlobalDTAlmacen(UsuarioActual.CveEmpresa)
Dim contadorMovimientos As Integer = 0
Dim listadoMovimientos As String = ""
Dim mensajeError As String = ""
Dim mensajeError As New StringBuilder
Dim Fecha As DateTime = (TxtFecha.Text).ToDate
Try
For Each almacenSinRepetir As DataRow In dt.FiltraParametros("Almacen <> ''", DistinctColumns:={"Almacen"}).Rows
@@ -2403,6 +2504,7 @@ Partial Class General_SaldosIniciales
contadorMovimientos += 1
Dim RowPS As DataRow = ProductosServiciosRef.FiltroPrimero($"Codigo = '{nuevaEntrada("CodigoPS")}' ")
If RowPS IsNot Nothing Then
Dim CvePS As Integer = RowPS("CvePS").ToString().ToEntero()
Dim CveUM As Integer = RowPS("CveUnidadMedida").ToString().ToEntero()
If CveUM > 0 Then
@@ -2415,47 +2517,47 @@ Partial Class General_SaldosIniciales
Dim PU As Decimal = If(Valor = 0, 0, (Valor / Cantidad))
If Not ObjMovimientos.AddMovimientoDetalle(movimientoCabecera, Cantidad, CveUM, CvePS, PU, -1, -1, Serie:=Serie, Lote:=Lote, FechaCaducidad:=FechaCaducidad) Then
mensajeError = "No se logró generar el detalle del movimiento"
mensajeError.Append("No se logró generar el detalle del movimiento")
Throw New Exception()
End If
Else
mensajeError = $"La unidad de medida no se reconoce para el producto servicio:{nuevaEntrada("CodigoPS")}"
mensajeError.Append($"La unidad de medida no se reconoce para el producto servicio:{nuevaEntrada("CodigoPS")}")
Throw New Exception()
End If
Else
mensajeError = "" '$"No se encontró el producto o servicio con código ""{nuevaEntrada("CodigoPS")}"""
'Throw New Exception()
mensajeError.Append($"No se encontró el producto o servicio con código ""{nuevaEntrada("CodigoPS")}"" <br>")
' Throw New Exception()
End If
Next
If contadorMovimientos = 0 Then
mensajeError = $"No se encontraros registros del almacen: ""{almacenActual}"""
mensajeError.Append($"No se encontraros registros del almacen: ""{almacenActual}""")
Throw New Exception()
Exit For
End If
Else
mensajeError = $"No se registró el encabezado ""{almacenActual}"""
mensajeError.Append($"No se registró el encabezado ""{almacenActual}""")
Throw New Exception()
Exit For
End If
Else
mensajeError = $"No se encontró el almacén con nombre ""{almacenActual}"""
mensajeError.Append($"No se encontró el almacén con nombre ""{almacenActual}""")
Throw New Exception()
Exit For
End If
Next
Catch ex As Exception
If mensajeError = "" Then
mensajeError = "Error técnico, informar a soporte" & ex.Message
If mensajeError.ToString = "" Then
mensajeError.Append("Error técnico, informar a soporte" & ex.Message)
End If
ObjMovimientos.RollBack()
End Try
If mensajeError = "" Then
If mensajeError.ToString = "" Then
ObjMovimientos.Commit()
Alert($"Se cargaron correctamente {contadorMovimientos} movimientos<br/><br/>{listadoMovimientos}")
Else
Alert(mensajeError, TipoMensaje.MsgError)
Alert(mensajeError.ToString, TipoMensaje.MsgError)
ObjMovimientos.RollBack()
End If
@@ -3083,6 +3185,8 @@ Partial Class General_SaldosIniciales
Directorio = ModExtensiones.DirectorioBaseEmpresas & "Empresas\Grales\SaldosIniciales\FormatoClasificaciones.xlsx"
ElseIf RblFormato.SelectedValue = "17" Then
Directorio = ModExtensiones.DirectorioBaseEmpresas & "Empresas\Grales\SaldosIniciales\FormatoClientes-Facturas-Detalles.xlsx"
ElseIf RblFormato.SelectedValue = "18" Then
Directorio = ModExtensiones.DirectorioBaseEmpresas & "Empresas\Grales\SaldosIniciales\FormatoProveedores-Facturas-Detalles.xlsx"
End If
If Not (Directorio = "") Then

View File

@@ -148,7 +148,7 @@ Partial Class Inventarios_EntradasSalidas
Public Property CveEntregaAlmacen() As Integer
Get
Return ViewState("CveEntregaAlmacen").ToString.ToEntero
Return IfNull(ViewState("CveEntregaAlmacen"), "-1", ViewState("CveEntregaAlmacen")).ToString().ToEntero()
End Get
Set(value As Integer)
ViewState("CveEntregaAlmacen") = value
@@ -5982,7 +5982,7 @@ Partial Class Inventarios_EntradasSalidas
MensajeAlert.Append("<br/><br/>")
If ObjTimbres.Timbrar() Then
If ObjTimbres.Timbrar(4) Then
Try
PdfFactura(ObjTimbres.ObjFactura)

View File

@@ -2133,6 +2133,8 @@
</span>
</div>
</div>
</div>
<div class="row ">
<div class="col-md-4 col-md-offset-1 form-group">
<div class="input-group">
<span class="input-group-addon">
@@ -2152,14 +2154,14 @@
</div>
<hr />
<div class="row">
<label class="col-md-2">Usuario:</label>
<label class="col-md-2">Solicitar a:</label>
<div class="col-md-9">
<asp:DropDownList ID="DdlSAUsuario" CssClass="form-control input-sm select2me" DataTextField="Nombre" DataValueField="CveUsuario" runat="server"></asp:DropDownList>
<asp:DropDownList ID="DdlSAUsuario" CssClass="form-control input-sm select2me" DataTextField="Nombre" DataValueField="CveUsuario" runat="server" Width="100%"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVSAUsuario" runat="server" InitialValue="-1" ControlToValidate="DdlSAUsuario" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Usuario''</b> es necesario, por favor ingréselo." ValidationGroup="GrpModalSolicitarAnticipo"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCESAUsuario" runat="server" HighlightCssClass="vco" TargetControlID="RFVSAUsuario" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<hr />
<div class="row">
<label class="col-md-2">Observaciones:</label>
<div class="col-md-9">

View File

@@ -8359,7 +8359,7 @@ Partial Class OC_OC
If GlobalDTOCEstatus(CveEmpresaActual).FiltroPrimeroValor("TipoTermino", $"CveEstatus = {CveEstatus}").ToEntero.Contiene(0, 3) Then
BtnSolicitudAnticipo.Visible = True
DdlSAUsuario.DataSource = GlobalDTUsuarios(-1, CveEmpresaActual)
DdlSAUsuario.DataSource = GlobalDTUsuarios(-1, CveEmpresaActual).FiltraParametros("", "Nombre")
DdlSAUsuario.DataBind()
DdlSAUsuario.Items.Insert(0, New ListItem("Seleccione", "-1"))
End If

View File

@@ -297,7 +297,7 @@
</div>
<div class="col-md-4" style="margin-top: 5px; text-align: left">
<asp:Label runat="server" ID="LblFolioAdicional"></asp:Label>
<asp:TextBox runat="server" ID="TxtFolioAdicional" MaxLength="50"></asp:TextBox>
</div>
<div class="col-md-2" style="margin-top: 5px">

View File

@@ -473,7 +473,7 @@ Partial Class OS_OrdenesServicios
DVFechaCita2.Visible = True
DVEpisodioPaciente.Visible = True
DivFolioAdicional.Visible = True
DvTxtPacienteModal.Visible = True
DvTxtEpisodioModal.Visible = True
DvTxtFolioRemisionModal.Visible = True
@@ -733,8 +733,8 @@ Partial Class OS_OrdenesServicios
TxtPaciente.Text = ObjOS.Paciente
TxtIdentificadorCliente.Text = ObjOS.IdentificadorCliente
LblFolioAdicional.Text = ObjOS.FolioAdicional
DivFolioAdicional.Visible = If(ObjOS.FolioAdicional.Trim.Length > 0, True, False)
TxtFolioAdicional.Text = ObjOS.FolioAdicional
@@ -1351,7 +1351,7 @@ Partial Class OS_OrdenesServicios
UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCotizacion, -1, -1, DdlTipoOrdenOS.SelectedValue.ToEntero, CveClienteSucursal:=DdlSucursalCliente.SelectedValue.ToEntero,
Direccion:=TxtDireccion.Text, Telefono:=TxtTelefono.Text, CveModeloAuto:=DdlModeloAuto.SelectedValue.ToEntero, Año:=TxtAnio.Text, CveMedico:=DdlMedico.SelectedValue.ToEntero,
CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero, CveTipoVenta:=DdlTipoVenta.SelectedValue.ToEntero, FechaCita:=FechaCita,
Paciente:=TxtPaciente.Text.Trim, IdentificadorCliente:=TxtIdentificadorCliente.Text.Trim) Then
Paciente:=TxtPaciente.Text.Trim, IdentificadorCliente:=TxtIdentificadorCliente.Text.Trim, FolioAdicional:=TxtFolioAdicional.Text.Trim) Then
Errores = True
End If
CargaCliente(CveCliente)
@@ -1455,7 +1455,7 @@ Partial Class OS_OrdenesServicios
DdlTipoOrdenOS.SelectedValue.ToEntero, CveClienteSucursal:=DdlSucursalCliente.SelectedValue.ToEntero, Direccion:=TxtDireccion.Text, Telefono:=TxtTelefono.Text,
CveModeloAuto:=DdlModeloAuto.SelectedValue.ToEntero, Año:=TxtAnio.Text, CveMedico:=DdlMedico.SelectedValue.ToEntero,
CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero, CveTipoVenta:=DdlTipoVenta.SelectedValue.ToEntero, FechaCita:=FechaCita,
Paciente:=TxtPaciente.Text.Trim, IdentificadorCliente:=TxtIdentificadorCliente.Text.Trim) Then
Paciente:=TxtPaciente.Text.Trim, IdentificadorCliente:=TxtIdentificadorCliente.Text.Trim, FolioAdicional:=TxtFolioAdicional.Text.Trim) Then
For Each Row As DataRow In TmpDT.Rows
If Not Errores Then
Dim CvePS As Integer = Row("CvePS").ToString.ToEntero
@@ -3037,7 +3037,10 @@ Partial Class OS_OrdenesServicios
Select Case DdlTipoVenta.SelectedValue.ToEntero
Case 2, 3
Case 1, 2
Opcion = 1
Exit Select
Case 3 ' por el momento ya no se usa
Opcion = 2
Exit Select
Case 5
@@ -3074,6 +3077,7 @@ Partial Class OS_OrdenesServicios
If UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then
TxtPacienteModal.Text = TxtPaciente.Text
TxtEpisodioModal.Text = TxtIdentificadorCliente.Text
TxtFolioRemisionModal.Text = TxtFolioAdicional.Text
End If
If DdlTipoVenta.SelectedValue.ToEntero = 5 Then

View File

@@ -1274,7 +1274,8 @@ function setwebservice(idDdlWS, idhdValue, idhdText, btn) {
aplicaparaventa: (!(DdlWS.data('aplicaparaventa')) || DdlWS.data('aplicaparaventa') == '') ? -1 : DdlWS.data('aplicaparaventa'),
cvemarca: (!(DdlWS.data('cvemarca')) || DdlWS.data('cvemarca') == '') ? -1 : DdlWS.data('cvemarca'),
esdistribuidor: (!(DdlWS.data('esdistribuidor')) || DdlWS.data('esdistribuidor') == '') ? -1 : DdlWS.data('esdistribuidor'),
cveclienteclasificacion: (!(DdlWS.data('cveclienteclasificacion')) || DdlWS.data('cveclienteclasificacion') == '') ? -1 : DdlWS.data('cveclienteclasificacion')
cveclienteclasificacion: (!(DdlWS.data('cveclienteclasificacion')) || DdlWS.data('cveclienteclasificacion') == '') ? -1 : DdlWS.data('cveclienteclasificacion'),
cvealmacen: (!(DdlWS.data('cvealmacen')) || DdlWS.data('cvealmacen') == '') ? -1 : DdlWS.data('cvealmacen')
//Metodo: metodo

View File

@@ -73,6 +73,10 @@ div
background-color: #EBF4E4; padding: 1px; color: #3C3C3C; vertical-align: middle;
font-size: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; height:25px;
}
input.fechahora {
width: 130px;
line-height: 22px;
}
.contenido {
background-color: #FFFFFF; font-size: 10px;
@@ -727,4 +731,4 @@ ul.treeviewarbol li input[type=checkbox]:checked + div:before{
}
.form-line .catcuentas.right{
width:230px;
}
}

View File

@@ -34,10 +34,13 @@
</div>
</div>
<asp:UpdatePanel ID="UPPD" runat="server">
<Triggers>
</Triggers>
<ContentTemplate>
<div class="portlet light xspadding bordered margin-bottom-10">
<asp:GridView ID="GvBoletos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontró ningún boleto registrado"
CssClass="table table-striped table-hover Widthall ScrollAD mysmallbtn" GridLines="None"
OnRowDataBound="GvBoletos_RowDataBound"
data-sort="true" DataKeyNames="CveViajePasajero,Asiento,Nombre, Visa,Celular,Sexo,Estatus,Partida,Destino, Importe,FechaIng, Agencia, TelefonoAgencia">
<Columns>
<asp:TemplateField HeaderText="No. Asiento">
@@ -89,8 +92,8 @@
<asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Acciones">
<ItemTemplate>
<asp:LinkButton ID="BtnEditar" runat="server" AlternateText="Editar"
CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" ToolTip="Editar" />
<%--<asp:LinkButton ID="BtnEditar" runat="server" AlternateText="Editar"
CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" ToolTip="Editar" />--%>
<asp:LinkButton ID="BtnCancelar" runat="server" AlternateText="Activar"
CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-cancel'></i>"
data-toggle="confirmation" data-popout="true" data-original-title='<%# If(Eval("Estatus").ToString = "True", "Cancelar Boleto", "Reactivar") %>'

View File

@@ -1,88 +1,88 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports ADSNetLibrary.Helpers
Imports ADSNetLibrary.SIGAPI.Helpers
Imports Extensiones.ModExtensiones
Imports Microsoft.Reporting.WebForms
Partial Class ListadoBoletos
Inherits ClsPaginas
Private Property CveViaje As Integer
Get
Return ViewState("CveViaje").ToString().ToEntero
End Get
Set(value As Integer)
ViewState("CveViaje") = value
End Set
End Property
Private Property Ruta As String
Get
Return ViewState("Ruta").ToString()
End Get
Set(value As String)
ViewState("Ruta") = value
End Set
End Property
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
If Request.QueryString("CveViaje") Is Nothing Then
Response.Redirect("/Transportes/RepViajes.aspx")
End If
CveViaje = Request.QueryString("CveViaje").ToEntero
Ruta = IfNull(Request("Ruta"), "").ToString
LblViaje.Text = Ruta
CargaDatos()
End If
End Sub
Private Sub CargaDatos()
Dim ObjTransportes As New ClsTransportes
If ObjTransportes.GetViajesPasajeros(CveViaje) Then
GvBoletos.DataSource = ObjTransportes.DtResultados
End If
ObjTransportes.Dispose()
GvBoletos.DataBind()
End Sub
Protected Sub ImprimirBoleto(sender As Object, e As EventArgs)
Dim dtResult As New DataTable()
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
Dim Fecha As Date = GvRow.DataKey("FechaIng").ToDate
Dim Importe As Decimal = GvRow.DataKey("Importe").ToDecimal
Dim params As New List(Of ReportParameter) From {
New ReportParameter("Ruta", Ruta),
New ReportParameter("Origen", GvRow.DataKey("Partida")),
New ReportParameter("Destino", GvRow.DataKey("Destino")),
New ReportParameter("FechaSalida", Fecha.ToShortDateString()),
New ReportParameter("HoraSalida", Fecha.ToString("HH:mm")),
New ReportParameter("Nombre", GvRow.DataKey("Nombre")),
New ReportParameter("Visa", GvRow.DataKey("Visa")),
New ReportParameter("Celular", GvRow.DataKey("Celular")),
New ReportParameter("Importe", Math.Round(Importe, 1).ToString),
New ReportParameter("TipoBoleto", "Tipo Boleto"),
New ReportParameter("Agencia", GvRow.DataKey("Agencia")),
New ReportParameter("TelefonoAgencia", GvRow.DataKey("TelefonoAgencia")),
New ReportParameter("Asiento", GvRow.DataKey("Asiento"))
}
ImprimirPDFStimul($"{UsuarioActual.Empresa.Ruta}Formatos\Boleto.mrt", dtResult, params, NombreArchivo:="Boleto")
'Empresas/Grales/Formatos/EntradaSalida.mrt
'Empresas/188/Formatos/Boleto.mrt
End Sub
Protected Sub BtnCancelar_Click(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
Dim CveViajePasajero As Integer = GvRow.DataKey("CveViajePasajero").ToEntero()
Dim Estatus As String = GvRow.DataKey("Estatus")
Option Explicit On
Option Strict On
Imports System.Data
Imports ADSNetLibrary.Helpers
Imports ADSNetLibrary.SIGAPI.Helpers
Imports Extensiones.ModExtensiones
Imports Microsoft.Reporting.WebForms
Partial Class ListadoBoletos
Inherits ClsPaginas
Private Property CveViaje As Integer
Get
Return ViewState("CveViaje").ToString().ToEntero
End Get
Set(value As Integer)
ViewState("CveViaje") = value
End Set
End Property
Private Property Ruta As String
Get
Return ViewState("Ruta").ToString()
End Get
Set(value As String)
ViewState("Ruta") = value
End Set
End Property
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
If Request.QueryString("CveViaje") Is Nothing Then
Response.Redirect("/Transportes/RepViajes.aspx")
End If
CveViaje = Request.QueryString("CveViaje").ToEntero
Ruta = IfNull(Request("Ruta"), "").ToString
LblViaje.Text = Ruta
CargaDatos()
End If
End Sub
Private Sub CargaDatos()
Dim ObjTransportes As New ClsTransportes
If ObjTransportes.GetViajesPasajeros(CveViaje) Then
GvBoletos.DataSource = ObjTransportes.DtResultados
End If
ObjTransportes.Dispose()
GvBoletos.DataBind()
End Sub
Protected Sub ImprimirBoleto(sender As Object, e As EventArgs)
Dim dtResult As New DataTable()
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
Dim Fecha As Date = GvRow.DataKey("FechaIng").ToDate
Dim Importe As Decimal = GvRow.DataKey("Importe").ToDecimal
Dim params As New List(Of ReportParameter) From {
New ReportParameter("Ruta", Ruta),
New ReportParameter("Origen", GvRow.DataKey("Partida")),
New ReportParameter("Destino", GvRow.DataKey("Destino")),
New ReportParameter("FechaSalida", Fecha.ToShortDateString()),
New ReportParameter("HoraSalida", Fecha.ToString("HH:mm")),
New ReportParameter("Nombre", GvRow.DataKey("Nombre")),
New ReportParameter("Visa", GvRow.DataKey("Visa")),
New ReportParameter("Celular", GvRow.DataKey("Celular")),
New ReportParameter("Importe", Importe.FormatoNumero(2)),
New ReportParameter("TipoBoleto", "Tipo Boleto"),
New ReportParameter("Agencia", GvRow.DataKey("Agencia")),
New ReportParameter("TelefonoAgencia", GvRow.DataKey("TelefonoAgencia")),
New ReportParameter("Asiento", GvRow.DataKey("Asiento"))
}
ImprimirPDFStimul($"{UsuarioActual.Empresa.Ruta}Formatos\Boleto.mrt", dtResult, params, NombreArchivo:="Boleto")
'Empresas/Grales/Formatos/EntradaSalida.mrt
'Empresas/188/Formatos/Boleto.mrt
End Sub
Protected Sub BtnCancelar_Click(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
Dim CveViajePasajero As Integer = GvRow.DataKey("CveViajePasajero").ToEntero()
Dim Estatus As String = GvRow.DataKey("Estatus")
Dim cambiarEstatus As Boolean = Not Estatus.ToBool
Dim TieneError As Boolean = False
Dim TieneError As Boolean = False
Try
Dim DtRem As DataTable = Nothing
@@ -120,7 +120,7 @@ Partial Class ListadoBoletos
Else
'SI NO TIENE VENTA, SOLO CANCELAR EL BOLETO
Dim ObjTran2 As New ClsTransportes
If Not ObjTran2.UpdateViajesPasajeros(CveViajePasajero) Then
If Not ObjTran2.CancelarViaje(CveViajePasajero) Then
TieneError = True
End If
ObjTran2.Dispose()
@@ -129,16 +129,21 @@ Partial Class ListadoBoletos
End If
Catch ex As Exception
TieneError = True
GuardaLog(ex.ToString())
Finally
GuardaLog(ex.ToString())
Finally
If TieneError Then
Alert($"Ocurrió un error al cancelar el boleto.", TipoMensaje.MsgError)
Else
Alert($"El boleto ha sido cancelado correctamente.")
End If
CargaDatos()
End Try
CargaDatos()
End Try
End Sub
Protected Sub GvBoletos_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
ScriptManager.GetCurrent(Me).RegisterPostBackControl(e.Row.FCLinkButton("BtnImprimir"))
End If
End Sub
End Class

View File

@@ -4,7 +4,7 @@
Inherits="ListadoContratos" %>
<asp:Content ID="Content1" ContentPlaceHolderID="E" runat="Server">
Listado de Contratos
Contratos
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">

View File

@@ -32,11 +32,11 @@ Partial Class ListadoContratos
End Sub
Private Sub InicializaCombos()
'Lista Tipo AF
DdlTipoAF.DataSource = GlobalDTTipoActivoFijo(UsuarioActual.CveEmpresa)
DdlTipoAF.DataSource = GlobalDTTipoActivoFijo(UsuarioActual.CveEmpresa).FiltraParametros("MedidaVehicularClave IN (2,3)")
DdlTipoAF.DataBind()
DdlTipoAF.Items.Insert(0, New ListItem("-", ""))
DdlTipoUnidad.DataSource = GlobalDTTipoActivoFijo(UsuarioActual.CveEmpresa)
DdlTipoUnidad.DataSource = GlobalDTTipoActivoFijo(UsuarioActual.CveEmpresa).FiltraParametros("MedidaVehicularClave IN (2,3)")
DdlTipoUnidad.DataBind()
DdlTipoUnidad.Items.Insert(0, New ListItem("-", ""))
'Lista Chofer'

View File

@@ -539,12 +539,12 @@ Partial Class Ventas_PVCobranza
Dim ExistePDF As Boolean = False
Dim ArchivoPDF As String = String.Format("{0}/PDF/{1}/{2}.pdf", UsuarioActual.Empresa.Ruta, ObjFactura.TipoDocto, ObjFactura.SerieFolio)
If System.IO.File.Exists(ArchivoPDF) Then
If ObjFactura.TipoDocto = "Rem" AndAlso System.IO.File.Exists(ArchivoPDF) Then
ExistePDF = True
Else
'REGENERAR EL PDF
Try
GenerarPDFVenta(CveVenta, AplicaPagare:="1", GuardarPDF:=True, RegenerarPDF:=True, DescargarArchivo:=False)
GenerarPDFVenta(CveVenta, AplicaPagare:="1", GuardarPDF:=True, RegenerarPDF:=True, DescargarArchivo:=False, EsTicket:=True)
If System.IO.File.Exists(ArchivoPDF) Then
ExistePDF = True
End If

View File

@@ -209,6 +209,9 @@
<li>
<asp:HyperLink ID="HplDownPDF" Target="_blank" runat="server" Visible="false"> <i class="fa fa-file-pdf-o" style="font-weight:bold;"></i> Imprimir PDF</asp:HyperLink>
</li>
<li>
<asp:HyperLink ID="HplImprimirTicket" Target="_blank" runat="server" Visible="false"> <i class="fa fa-file-pdf-o" style="font-weight:bold;"></i> Imprimir Ticket</asp:HyperLink>
</li>
<li>
<asp:LinkButton ID="LnkDescargaDirecta" runat="server" Visible="false" OnClick="LnkDescargaDirecta_Click"> <i class="fa fa-file-pdf-o" style="font-weight:bold;"></i> Impresión directa</asp:LinkButton>
</li>
@@ -305,7 +308,6 @@
<li>
<asp:LinkButton ID="LBCancelarPedido" runat="server" CausesValidation="False" CommandName="Delete" Text="<i class='fa fa-ban'></i> Cancelar Pedido" OnClick="LBCancelarPedido_Click" data-toggle="confirmation" data-popout="true" data-original-title="¿Estás seguro que deseas cancelar el Pedido?" data-btn-ok-label="si" Visible="false" />
</li>
<asp:Panel runat="server" ID="PnlImprimir" Visible="False">
<li>
<asp:LinkButton runat="server" ID="LnkImprimir"><i class="fa fa-print"></i> Imprimir</asp:LinkButton>
@@ -604,7 +606,7 @@
<b>Fecha de Cirugia:</b>
</td>
<td runat="server" id="TdFechaOS2" visible="true">
<asp:TextBox ID="TxtFechaOS" type="datetime-local" runat="server" CssClass="make-switchsd" CausesValidation="true" Style="width: 130px"></asp:TextBox>
<asp:TextBox ID="TxtFechaOS" type="datetime-local" runat="server" CausesValidation="true" CssClass="fechahora" Style="width: 130px; line-height: 22px;"></asp:TextBox>
</td>
</tr>
<tr runat="server" id="TrVentasMedicas3" visible="false">
@@ -970,6 +972,13 @@
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional" class=" xspadding .nolineheight bordered whitoutcol" style="color: white;">
<ContentTemplate>
<div id="DivBloqueoAcceso" runat="server" style="width: 100%; text-align: center;" visible="false">
<asp:Button ID="BtnBloquearAcceso" ClientIDMode="Static" CssClass="btn red-haze btn-outline btn-circle btn-sm" runat="server" Text="Bloquear Turno" OnClick="BtnBloquearAcceso_Click" />
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<asp:UpdatePanel ID="Updatetabs" runat="server" UpdateMode="Conditional">
@@ -1604,7 +1613,7 @@
<td style="border: 1px none white"><b>Amort. Ant.:</b></td>
<td>
<asp:Label ID="LblAmortizacion" ClientIDMode="Static" runat="server" Style="text-align: right;" Text="0.00" Width="78px"></asp:Label></td>
<td align="right">&nbsp;<asp:LinkButton ID="ImgAntiPend" runat="server" Text=" <i class='fa fa-money font-green'></i> " AlternateText="Cancelación de Anticipos" Style="cursor: pointer;" />
<td align="right">&nbsp;<asp:LinkButton ID="ImgAntiPend" runat="server" OnClick="ImgAntiPend_Click" Text=" <i class='fa fa-money font-green'></i> " AlternateText="Cancelación de Anticipos" Style="cursor: pointer;" />
</td>
</tr>
@@ -4358,9 +4367,10 @@
<ajax:ValidatorCalloutExtender ID="VCEPorPS" runat="server" HighlightCssClass="vco" TargetControlID="CVPorPS" Width="300px"></ajax:ValidatorCalloutExtender>
&nbsp;(%)
</td>
<td><label style="display:none;">IVA</label></td>
<td>
<asp:Label ID="LblIVADescPS" runat="server" ClientIDMode="Static" Text="0.00" style="display:none;"></asp:Label>
<label style="display: none;">IVA</label></td>
<td>
<asp:Label ID="LblIVADescPS" runat="server" ClientIDMode="Static" Text="0.00" Style="display: none;"></asp:Label>
</td>
</tr>
<tr>
@@ -4378,7 +4388,7 @@
</td>
<td><b>
<asp:Label ID="LblUtilidadPorcentaje" runat="server" ClientIDMode="Static" Text="0.00"></asp:Label></b>
&nbsp
&nbsp
<asp:Label ID="LblPrecioCompra" runat="server" ClientIDMode="Static" Text="0.00"></asp:Label></td>
</tr>
<tr>
@@ -4401,6 +4411,50 @@
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div id="ModalPermisoDesc" class="modal ADS fade" role="dialog">
<asp:Panel runat="server" ID="UpAutorizarDesc" DefaultButton="BtnAutorizarDescuento">
<div class="modal-dialog">
<!-- Modal content-->
<asp:UpdatePanel runat="server" class="modal-content">
<ContentTemplate>
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">
<asp:Label ID="Label2" runat="server" ClientIDMode="Static" Text="Autorizar descuento"></asp:Label>
</h4>
</div>
<div class="modal-body">
<div class="form-group">
<div class="row">
<div class="col-md-12 v-center" style="display: flex">
<i class="fa fa-user fa-2 icontxt" style="font-size: 20px!important;"></i>
&nbsp;
<asp:TextBox ID="txtUserDesc" runat="server" CssClass="form-control" placeholder="Usuario" ClientIDMode="Static" AutoComplete="off"></asp:TextBox>
</div>
</div>
<asp:RequiredFieldValidator ID="RfvUsuario" runat="server" ControlToValidate="txtUserDesc" Display="Static" ErrorMessage="<span class='has-error'><span id='username-error' class='help-block'>El campo <b>''Usuario''</b> es necesario.</span></span>" ValidationGroup="GrpAutorizarDesc"></asp:RequiredFieldValidator>
</div>
<div class="form-group">
<div class="row">
<div class="col-md-12 v-center" style="display: flex">
<i class="fa fa-lock fa-2 icontxt" style="font-size: 20px!important;"></i>
&nbsp;
<asp:TextBox ID="txtPassDesc" runat="server" CssClass="form-control" placeholder="Contraseña" type="password" ClientIDMode="Static" AutoComplete="off"></asp:TextBox>
</div>
</div>
<asp:RequiredFieldValidator ID="RfvContraseña" runat="server" ControlToValidate="txtPassDesc" Display="Static" ErrorMessage="<span class='has-error'><span id='username-error' class='help-block'>El campo <b>''Contraseña''</b> es necesario.</span></span>" ValidationGroup="GrpAutorizarDesc"></asp:RequiredFieldValidator>
</div>
</div>
<div class="modal-footer">
<asp:Button ID="BtnAutorizarDescuento" runat="server" Text="Aplicar" ValidationGroup="GrpAutorizarDesc" CssClass="btn btn-primary" OnClick="BtnAutorizarDescuento_Click" />
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</asp:Panel>
</div>
<div id="DivAnticipos" class="modal ADS fade" role="dialog">
<asp:UpdatePanel runat="server" ID="UpAnticipos" UpdateMode="Conditional" class="modal-dialog">
<ContentTemplate>
@@ -8631,7 +8685,41 @@
</asp:UpdatePanel>
</div>
<asp:Button ID="BtnShowBloqueoAcceso" runat="server" Text="Show Modal Popup" Style="visibility: hidden; display: none;" />
<asp:Button ID="BtnCloseBloqueoAcceso" runat="server" CssClass="btn btn-danger" Style="visibility: hidden; display: none;" Text="Cancelar" />
<!-- ModalPopupExtender -->
<cc1:ModalPopupExtender ID="mpeBloque" runat="server" PopupControlID="PanelBloqueoAcceso" TargetControlID="BtnShowBloqueoAcceso"
BackgroundCssClass="modalBackground">
</cc1:ModalPopupExtender>
<asp:Panel ID="PanelBloqueoAcceso" 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" style="text-align: center">
<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="2"><span class='has-error'><span id='username-error' class='help-block'>
<asp:Literal ID="LtlMensajeBloqueo" runat="server" Text=""></asp:Literal></span></span></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>
@@ -9749,45 +9837,57 @@
function CalculaDescPS() {
console.log("evento descuento");
if ($get("TxtPorPS").value != "") {
var PorcentajeDescuento = parseFloat($get("TxtPorPS").value);
let PorcentajeDescuento = parseFloat($get("TxtPorPS").value);
if (PorcentajeDescuento < 0 || PorcentajeDescuento > 99) {
alert("No se puede aplicar ese porcentaje de descuento");
$get("TxtPorPS").value = "0";
recalcularUtilidad(0);
return;
}
var ivaPor = parseFloat($get("HdnIVADescPS").value) ;
let ivaPor = parseFloat($get("HdnIVADescPS").value) ;
var subTotal = parseFloat($get("LblSubtotalDescPS").innerText.replace(",", "").replace(",", ""));
let subTotal = parseFloat($get("LblSubtotalDescPS").innerText.replace(",", "").replace(",", ""));
$get("LblDescPS").innerText = formato_numero(((subTotal * PorcentajeDescuento) / 100), 2, '.', ',');
var descuento = parseFloat($get("LblDescPS").innerText.replace(",", "").replace(",", ""));
let descuento = parseFloat($get("LblDescPS").innerText.replace(",", "").replace(",", ""));
$get("LblIVADescPS").innerText = formato_numero(((subTotal - descuento) * ivaPor), 2, '.', ',');
var importeIVA =parseFloat($get("LblIVADescPS").innerText.replace(",", "").replace(",", ""));
let importeIVA =parseFloat($get("LblIVADescPS").innerText.replace(",", "").replace(",", ""));
var Total = (subTotal - descuento) + importeIVA;
let Total = (subTotal - descuento) + importeIVA;
$get("LblTotalFinalDescPS").innerText = formato_numero(Total, 2, '.', ',');
$get("HdnDescPS").value = descuento;
var totalCompra = parseFloat($get("HdnTotalCompra").value);
if (totalCompra > 0) {
var totalRedondeado = parseFloat($get("LblTotalFinalDescPS").innerText.replace(",", "").replace(",", ""));
var utilidad = ((totalRedondeado - totalCompra) / totalRedondeado) * 100;
recalcularUtilidad(descuento)
} else {
let subTotal = parseFloat($get("LblSubtotalDescPS").innerText.replace(",", "").replace(",", ""));
$get("LblIVADescPS").innerText = formato_numero((subTotal * ivaPor), 2, '.', ',');
let importeIVA =parseFloat($get("LblIVADescPS").innerText.replace(",", "").replace(",", ""));
let Total = (subTotal) + importeIVA;
$get("LblUtilidadPorcentaje").innerText = formato_numero(utilidad, 2, '.', ',');
}
}
else {
$get("LblTotalFinalDescPS").innerText = "0.00";
$get("LblTotalFinalDescPS").innerText = formato_numero(Total, 2, '.', ',');
$get("LblDescPS").innerText = "0.00";
$get("LblIVADescPS").innerText = "0.00";
$get("LblUtilidadPorcentaje").innerText = "0.00";
$get("HdnDescPS").innerText = "0.00";
recalcularUtilidad(0);
}
}
function recalcularUtilidad(descuento){
let totalCompra = parseFloat($get("HdnTotalCompra").value);
if (totalCompra > 0) {
let subTotal = parseFloat($get("LblSubtotalDescPS").innerText.replace(",", "").replace(",", ""));
let subTotal2 = subTotal - descuento;
let utilidad = ((subTotal2 - totalCompra) / subTotal2) * 100;
$get("LblUtilidadPorcentaje").innerText = formato_numero(utilidad, 2, '.', ',');
}
}
@@ -10147,7 +10247,7 @@
$get("HdnTipoDescuento").value = "3";
//si es con.nc,es.el.total
var Total = ToDouble($get(TipoAnticipo == 2 ? 'TxtTotal' : 'TxtSubTotal').value);
var Total = ToDouble($get((TipoAnticipo == 2 || TipoAnticipo == 4) ? 'TxtTotal' : 'TxtSubTotal').value);
var SaldoCompra = parseFloat(parseFloat($get('HdnVentaSaldo').value).toFixed(2));
if (ToDouble($get('HdnCveVenta').value) == 0) SaldoCompra = Total;

View File

@@ -157,6 +157,15 @@ Partial Class Ventas
End Set
End Property
Private Property TmpDTAnticiposNCIxCCliente As DataTable
Get
Return If(IsNothing(ViewState("TmpDTAnticiposNCIxCCliente")), Nothing, CType(ViewState("TmpDTAnticiposNCIxCCliente"), DataTable))
End Get
Set(value As DataTable)
ViewState("TmpDTAnticiposNCIxCCliente") = value
End Set
End Property
Private Property TmpDTError As DataTable
Get
Return If(IsNothing(ViewState("TmpDTError")), Nothing, CType(ViewState("TmpDTError"), DataTable))
@@ -2311,6 +2320,21 @@ Partial Class Ventas
End Property
Public Property CveAlamcenFiltroDdl As Integer
Get
If ViewState("CveAlamcenFiltroDdl") Is Nothing Then
ViewState("CveAlamcenFiltroDdl") = -1
End If
Return ViewState("CveAlamcenFiltroDdl").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("CveAlamcenFiltroDdl") = value
End Set
End Property
#Region "VENTA MEDICA"
Property EsVentaMedica As Boolean
@@ -2485,7 +2509,7 @@ Partial Class Ventas
TxtFechaFRem.Text = NowADS().ToShortDateString
TxtFechaFPedido.Text = NowADS().ToShortDateString
TxtFechaFOC.Text = NowADS().ToShortDateString
ValidaUsuarioAcceso()
TrSinExistencia.Visible = UsuarioActual.TienePermisoProceso(276)
@@ -2572,7 +2596,7 @@ Partial Class Ventas
ImgDescTotal.Visible = False
ImgDescTotal.Attributes.Add("onclick", "javascript:$('#ModalDescuento').modal(); $get('LblTitulo1').style.display = ''; $get('LblTitulo2').style.display = 'none'; $get('LblTituloTipo1').style.display = ''; $get('LblTituloTipo2').style.display = 'none'; $get('HdnTipoDescuento').value = '2'; $get('LblPrecio1').style.display = 'none'; $get('LblTotalPS1').style.display = 'none'; $get('LblSubTotal1').style.display = ''; $get('LblAmort').style.display = 'none'; $get('BtnAplicarDescP').style.display = 'none'; $get('BtnAplicarDescG').style.display = ''; $get('TrMotivoDescuento').style.display = '';")
ImgAntiPend.Attributes.Add("onclick", "$get('HdnTipoDescuento').value = '3'; MuestraAnticipos();")
'ImgAntiPend.Attributes.Add("onclick", "$get('HdnTipoDescuento').value = '3'; MuestraAnticipos();")
ImgOtrosConceptos.Attributes.Add("onclick", "javascript:$('#ModalOtrosConceptos').modal();")
'LkbAgregarComplementos.Attributes.Add("onclick", "javascript:$('#ModalComplementos').modal();")
'ImgCerrar.Attributes.Add("OnClick", "$('#DivAnticipos').hide();")
@@ -3528,7 +3552,135 @@ Partial Class Ventas
End Sub
#Region "Bloqueo Pantalla"
Private Sub ValidaUsuarioAcceso()
'VERIFICAR SI LA SESION SE ENCUENTRA BLOQUEADA
If UsuarioActual.Empresa.Funcionalidad(599) = "1" Then
Dim DrUsuario As DataRow = GlobalDTUsuarios(CveUsuario:=UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("")
If DrUsuario IsNot Nothing AndAlso DrUsuario("CodigoAcceso").ToString() <> "" Then
If UsuarioActual.SesionBloqueada Then
DivBloqueoAcceso.Visible = False
Dim strScript As New StringBuilder
strScript.Append("window.onload = function MuestraBloqueo() { document.getElementById(""C_BtnShowBloqueoAcceso"").click(); setTimeout(function(){ $('#C_TxtCodigoAcceso').focus(); ")
If UsuarioActual.ErrorDesbloqueo Then
LtlMensajeBloqueo.Text = UsuarioActual.MsgErrorDesbloqueo
'strScript.AppendFormat("alert('{0}');", UsuarioActual.MsgErrorDesbloqueo)
End If
strScript.Append("}, 500); }")
RegistraScript(strScript.ToString())
UsuarioActual.SesionBloqueada = True
UsuarioActual.ErrorDesbloqueo = False
UsuarioActual.MsgErrorDesbloqueo = ""
BtnEmitirImprimir.Visible = False
Exit Sub
Else
DivBloqueoAcceso.Visible = True
End If
Else
DivBloqueoAcceso.Visible = False
End If
Else
DivBloqueoacceso.Visible = False
End If
End Sub
Protected Sub BtnCambiar_Click(sender As Object, e As EventArgs)
UsuarioActual.ErrorDesbloqueo = False
UsuarioActual.MsgErrorDesbloqueo = ""
If String.IsNullOrEmpty(TxtCodigoAcceso.Text.Trim) Then
UsuarioActual.SesionBloqueada = True
UsuarioActual.ErrorDesbloqueo = True
UsuarioActual.MsgErrorDesbloqueo = "Es necesario un código de acceso"
Response.Redirect($"~/Ventas/Ventas.aspx")
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)
ADSSession.ADSSessionConfig.sessionUser = Usuario
ADSSession.ADSSessionConfig.sessionUser.CvePlataforma = 1
ADSSession.ADSSessionConfig.sessionDpage = False
ADSSession.ADSSessionConfig.sessionUser.ModoSimulacion = False
If dt IsNot Nothing Then
If dt.Rows.Count >= 1 Then
If dt.Rows.Count > 1 Then ADSSession.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
ADSSession.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/Ventas.aspx")
Else
UsuarioActual.SesionBloqueada = True
UsuarioActual.ErrorDesbloqueo = True
UsuarioActual.MsgErrorDesbloqueo = "El código de acceso no es correcto"
Response.Redirect($"~/Ventas/Ventas.aspx")
End If
End Sub
Protected Sub BtnBloquearAcceso_Click(sender As Object, e As EventArgs)
UsuarioActual.SesionBloqueada = True
Response.Redirect($"~/Ventas/Ventas.aspx")
End Sub
#End Region
Private Sub CargaListasPrecios()
DivPrecioLista.Visible = True
@@ -4784,6 +4936,13 @@ Partial Class Ventas
End If
End If
If UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then
TxtAlfa1.Text = DbRowVenta("Alfa1").ToString
End If
End Using
End If
@@ -4937,7 +5096,10 @@ Partial Class Ventas
End If
Case "Rem"
'IPP 15 Julio 2017
If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
TxtAtencionA.Text = DbRowVenta("AtencionA").ToString()
End If
Trsaldo.Visible = True
HplSaldoAuxiliar.NavigateUrl = String.Format("/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxCClientes&CveCliente={0}&CveVenta={1}&TB_iframe=true&height=550&width=920", DbRowVenta("CveCliente"), DbRowVenta("CveVenta"))
HplPagado.NavigateUrl = String.Format("/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxCClientes&CveCliente={0}&CveVenta={1}&TB_iframe=true&height=550&width=920", DbRowVenta("CveCliente"), DbRowVenta("CveVenta"))
@@ -7909,8 +8071,16 @@ Partial Class Ventas
Objeto.ddlWS.Attributes.Add("data-pagina", "ventas/ventas")
Objeto.ddlWS.Attributes.Add("data-AplicaparaVenta", "1")
End If
If UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then
Objeto.Attributes.Add("data-CveAlmacen", $"{CveAlamcenFiltroDdl}")
Objeto.ddlWS.Attributes.Add("data-CveAlmacen", $"{CveAlamcenFiltroDdl}")
End If
End If
End Sub
Private Sub CargaPSRemision(CveClasificacion As Integer, Objeto As ADServerControl.Dropdownlost)
@@ -8279,7 +8449,7 @@ Partial Class Ventas
e.Row.FCLinkButton("imgE").Visible = True
End If
If UsuarioActual.Empresa.Funcionalidad(109) = "1" AndAlso UsuarioActual.TienePermisoProceso(374) Then
If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
e.Row.FCLinkButton("LnkDescuentos").Visible = True
End If
@@ -9643,6 +9813,9 @@ Partial Class Ventas
HplImprimirPDFStimulsoft.Visible = True
HplImprimirPDFStimulsoft.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=0&STIMULSOFT=1", CveVenta)))
HplImprimirTicket.Visible = True
HplImprimirTicket.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1&TICKET=1&REGENERAR=1", CveVenta)))
End If
End If
@@ -10685,7 +10858,13 @@ Partial Class Ventas
Liga = $"document.location.href=""/CRM/Acercamiento.aspx?CveAcercamiento={CveAcercamientoCRM}&OPTAB=COT"";"
Alert(MensajeAlert.ToString(), TipoMensaje.MsgInformacion, Liga, TextoConfirmacion:="Aceptar", TextoSegundoBoton:=Nothing, JSBtn2:=Nothing, ShowCloseButton:=False)
Else
Alert(MensajeAlert.ToString(), TipoMensaje.MsgDosBotones, Liga, TextoConfirmacion:="Seguir Registrando", TextoSegundoBoton:="Ir al Cliente", JSBtn2:=Liga2, ShowCloseButton:=False)
'SI TIENE MODULO DE COBRANZA, NO MARDAR AL CLIENTE, DEBE SEGUIR REGISTRANDO
If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
Alert(MensajeAlert.ToString(), TipoMensaje.MsgInformacion, Liga, TextoConfirmacion:="Seguir Registrando", ShowCloseButton:=False)
Else
Alert(MensajeAlert.ToString(), TipoMensaje.MsgDosBotones, Liga, TextoConfirmacion:="Seguir Registrando", TextoSegundoBoton:="Ir al Cliente", JSBtn2:=Liga2, ShowCloseButton:=False)
End If
End If
MensajeAlert.Clear()
@@ -10700,9 +10879,9 @@ Partial Class Ventas
OnError("Ocurrió un error al limpiar los datos", ex)
End Try
If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
ImpresionDirectaPDF()
End If
'If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
' ImpresionDirectaPDF()
'End If
Else
ObjVentas.RollBack()
@@ -10928,7 +11107,7 @@ Partial Class Ventas
ObjFacturaDevolucion.Alfa1 = TxtAlfa1.Text.Trim
End If
ObjFacturaDevolucion.AtencionA = If(ObjFacturaDevolucion.TipoDocto = "Cot" Or (ObjFacturaDevolucion.TipoDocto.Contiene("Ing", "Rem") AndAlso LblRFC.Text = "XAXX010101000"), TxtAtencionA.Text, "-1")
ObjFacturaDevolucion.AtencionA = ""
ObjFacturaDevolucion.MotivoDescuento = TxtMotivoDescuento.Text.Trim
ObjFacturaDevolucion.Observaciones = TxtObsFact.Text.Trim
ObjFacturaDevolucion.Det_OrdenCompra = TxtDet_OrdenCompra.Text.Trim
@@ -11211,7 +11390,7 @@ Partial Class Ventas
ObjFacturaBonificacion.Alfa1 = TxtAlfa1.Text.Trim
End If
ObjFacturaBonificacion.AtencionA = If(ObjFacturaBonificacion.TipoDocto = "Cot" Or (ObjFacturaBonificacion.TipoDocto.Contiene("Ing", "Rem") AndAlso LblRFC.Text = "XAXX010101000"), TxtAtencionA.Text, "-1")
ObjFacturaBonificacion.AtencionA = ""
ObjFacturaBonificacion.MotivoDescuento = TxtMotivoDescuento.Text.Trim
ObjFacturaBonificacion.Observaciones = TxtObsFact.Text.Trim
ObjFacturaBonificacion.Det_OrdenCompra = TxtDet_OrdenCompra.Text.Trim
@@ -11728,7 +11907,7 @@ Partial Class Ventas
ObjFactura.CveSubProyecto = DdlSubProyectoDatos.SelectedValue.ToEntero()
ObjFactura.CveSubProyectoCobranza = DdlSubProyectoCobranza.SelectedValue.ToEntero()
ObjFactura.CveSubProyectoEjecucion = DdlSubProyectoEjecucion.SelectedValue.ToEntero()
ObjFactura.AtencionA = If(ObjFactura.TipoDocto = "Cot" Or (ObjFactura.TipoDocto.Contiene("Ing", "Rem") AndAlso LblRFC.Text = "XAXX010101000"), TxtAtencionA.Text, "-1")
ObjFactura.AtencionA = TxtAtencionA.Text
ObjFactura.MotivoDescuento = TxtMotivoDescuento.Text.Trim
ObjFactura.Observaciones = TxtObsFact.Text.Trim
ObjFactura.Det_OrdenCompra = TxtDet_OrdenCompra.Text.Trim
@@ -13323,7 +13502,17 @@ Partial Class Ventas
If UsuarioActual.Empresa.Funcionalidad(578) = "1" AndAlso EsVentaMedica Then
CveAlmacenTraspasoDestino = CveAlmacenAsignado
If DdlSucursalCliente.SelectedValue.ToEntero > 0 Then
Dim objclientes As New ClsClientes
If objclientes.GetSucursales(CveCliente, -1) Then
CveAlmacenTraspasoDestino = objclientes.DtResultados.FiltroPrimeroValor("CveAlmacenAsignado", $" CveClienteSucursal = {DdlSucursalCliente.SelectedValue.ToEntero}").ToEntero
End If
objclientes.Dispose()
End If
If Not CveAlmacenTraspasoDestino > 0 Then
CveAlmacenTraspasoDestino = CveAlmacenAsignado
End If
If RBLTipoVenta.SelectedValue.ToEntero = 2 Then
If Not ChkRequiereTecnico.Checked Then
@@ -14637,6 +14826,11 @@ Partial Class Ventas
Next
Else
'If DdlTipoAmortizacionAnticipo.SelectedValue <> "4" Then
'End If
For Each row2 As GridViewRow In GVAnticipos.Rows
If row2.DataKey("CveConceptoContable").ToString().ToEntero() = 12 Then
@@ -15222,6 +15416,49 @@ Partial Class Ventas
End If
End If
'If Not ErrorPrepoliza AndAlso UsuarioActual.Empresa.Funcionalidad(109) = "1" AndAlso ObjFactura.TipoDocto = "Ing" AndAlso DdlTipoAmortizacionAnticipo.SelectedValue = "4" AndAlso ObjFactura.CveMoneda = 1 Then
' For Each row2 As GridViewRow In GVAnticipos.Rows
' If row2.DataKey("CveConceptoContable").ToString().ToEntero() = 12 Then
' If row2.FCCheckBox("Chk" & row2.RowIndex).Checked Then
' importeMovimiento = row2.FCTextBox("TxtAnticipo" & row2.RowIndex).Text.ToDecimal '- ((row2.FCTextBox("TxtAnticipo" & row2.RowIndex).Text.ToDecimal / row2.DataKey("TotalAnticipo").ToDecimal) * row2.DataKey("IVAAnticipo").ToDecimal)
' Dim ImporteAnticipo As Decimal = importeMovimiento
' Dim CveMonedaAnticipo As Integer = row2.DataKey("CveMoneda").ToString().ToEntero()
' Dim ObjFacturaRef As New Modelos.Factura(UsuarioActual, row2.DataKey("CveVenta").ToEntero(), UsuarioActual.CveEmpresa, CargaDTDetalle:=False, VerificaAlmacen:=False, CargaDatosCliente:=False, CargaDatosRelacionados:=False)
' Dim ventaRef As New Venta(ObjFacturaRef, UsuarioActual)
' ObjFacturaRef.Dispose()
' If ventaRef.TipoDocto = "Dev" Then
' Dim Pago As New VentaPago
' Pago.Fecha = ObjFactura.Fecha
' Pago.FechaDocumentoRelacionado = ObjFactura.Fecha
' Pago.ImportePagoVenta = importeMovimiento
' Pago.ImportePago = importeMovimiento
' Pago.CveMonedaPago = ObjFactura.CveMoneda
' Pago.TCPago = ObjFactura.TipoCambio
' Pago.TipoPago = "NC"
' Pago.CveVentaAmortizacion = ObjFactura.CveVenta 'Dr("CveVenta").ToString().ToEntero()
' Pago.AplicaTraslado = False
' Pago.Referencia = Concepto
' 'Pago.CveConceptoPago = 251
' ErrorPrepoliza = AplicaPrePolizaPagoVenta(ventaRef, Pago, ObjFactura.CvePrePoliza, ObjConta)
' Else
' ErrorPrepoliza = True
' ErrorList.Add("No se puede aplicar un documento diferente a una devolución")
' End If
' End If
' End If
' Next
'End If
If ObjConta.ValidacionesPrePoliza(ObjFactura.CvePrePoliza, UsuarioActual, Opcion:=2, AutoConta:=AutoConta) Then
If ObjConta.ValorPolizaDescuadre > 0 Then
If ObjConta.ValorPolizaDescuadre = 2 Then
@@ -15906,7 +16143,9 @@ Partial Class Ventas
Dim ObjMovtos As New ClsMovimientos()
If ObjMovtos.GetAnticiposNCIxCCliente(CveCliente) Then
Dim DtMovtos As DataTable = ObjMovtos.DtResultados.FiltraParametros($"Saldo > 0 AND SaldoSubtotal > 0 {If(CveVenta < 0, $"AND Tipo = 'Ant' ", "")} {If(DdlTipoComprobante.SelectedValue = "Ant", "AND Tipo = 'NC'", "")}")
Me.TmpDTAnticiposNCIxCCliente = ObjMovtos.DtResultados.Copy()
Dim DtMovtos As DataTable = Me.TmpDTAnticiposNCIxCCliente.FiltraParametros($"Saldo > 0 AND SaldoSubtotal > 0 {If(CveVenta < 0, $"AND Tipo = 'Ant' ", "")} {If(DdlTipoComprobante.SelectedValue = "Ant", "AND Tipo = 'NC'", "")}")
If UsuarioActual.CveEmpresa.Contiene(72, 80, 146) Then
DtMovtos = DtMovtos.FiltraParametros($"{If(CveVenta < 0, $"Tipo = 'Ant'{If(DdlTipoComprobante.SelectedValue = "Ing", $" AND CveMoneda ={DdlMoneda.SelectedValue.ToEntero()}", "")} ", "")}")
End If
@@ -16013,7 +16252,7 @@ Partial Class Ventas
saldo = e.Row.DataKey("Saldo").ToString().ToDecimal
If CveVenta <= 0 Then
If DdlTipoAmortizacionAnticipo.SelectedValue = "2" Then 'cuando es por NC, debe de tomar el total de su saldo respectivo
If DdlTipoAmortizacionAnticipo.SelectedValue.Contiene("2") Then 'cuando es por NC, debe de tomar el total de su saldo respectivo
saldo = e.Row.DataKey("SaldoConImpuestos").ToString().ToDecimal
Else
saldo = e.Row.DataKey("SaldoSubTotal").ToString().ToDecimal
@@ -16025,6 +16264,10 @@ Partial Class Ventas
e.Row.FCLiteral("LtlAnticipos").Text = saldo.FormatoNumero
End If
If CveVenta <= 0 AndAlso DdlTipoAmortizacionAnticipo.SelectedValue.Contiene("4") Then
saldo = e.Row.DataKey("Saldo").ToString().ToDecimal
End If
End If
saldo = saldo.RoundSQL()
@@ -16318,7 +16561,7 @@ Partial Class Ventas
'cuando no se ha registrado la venta
If DdlTipoAmortizacionAnticipo.SelectedValue.Contiene("1", "2", "3") Then
If DdlTipoAmortizacionAnticipo.SelectedValue.Contiene("1", "2", "3", "4") Then
Dim Amortizacion As Decimal = 0
Dim ImpuestosLocalesTemporal As Decimal = 0
@@ -16464,6 +16707,27 @@ Partial Class Ventas
HdnTieneAnticiposVinculados.Value = "1"
End If
'cuando es PAGO CON DEVOLUCION
If DdlTipoAmortizacionAnticipo.SelectedValue = "4" Then
For Each gvr As GridViewRow In GVAnticipos.Rows
If gvr.FCCheckBox("Chk" & gvr.RowIndex) IsNot Nothing AndAlso gvr.FCCheckBox("Chk" & gvr.RowIndex).Checked AndAlso gvr.DataKey("CveConceptoContable").ToEntero().Contiene(12) Then
Amortizacion += gvr.FCTextBox(String.Format("TxtAnticipo{0}", gvr.RowIndex)).Text.ToDecimal ' - ((gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / gvr.DataKey("TotalAnticipo").ToDecimal) * gvr.DataKey("IVAAnticipo").ToDecimal)
End If
Next
LblAntAplicados.Text = String.Format("Pago con devolución: {0:C}", Amortizacion) : LblAntAplicados.Visible = True
HdnAnticipos.Value = Amortizacion.RoundSQL(2).ToString()
Amortizacion = 0
HdnTipoDescuento.Value = "-1"
HdnDescuento.Value = "0"
RegistraScript("BorraDescuentos();")
HdnTieneAnticiposVinculados.Value = "1"
End If
CalculaTotalesVenta(ValidarDescuentos:=True)
End If
End If
@@ -21357,22 +21621,24 @@ Partial Class Ventas
Exit Sub
End If
Dim ObjContrato As New ClsContratos
If ObjContrato.GetEstimacionesPorFacturar(-1, CveCliente, DdlContrato.SelectedValue.ToEntero(), 0, UsuarioActual.CveEmpresa) Then
GvEst.DataSource = ObjContrato.DtResultados
If ObjContrato.DtResultados.Rows.Count > 0 Then
'BtnEstimacion.Visible = True
DdlContrato.Items.Clear()
DdlContrato.Items.Add(New ListItem("Todos", "-1"))
DdlContrato.DataSource = ObjContrato.DtResultados.FiltraParametros("CveContrato > 0", "NumeroContrato", DistinctColumns:={"CveContrato", "NumeroContrato"})
If DdlContrato.SelectedValue.ToEntero() > 0 Then
Dim ObjContrato As New ClsContratos
If ObjContrato.GetEstimacionesPorFacturar(-1, CveCliente, DdlContrato.SelectedValue.ToEntero(), 0, UsuarioActual.CveEmpresa) Then
GvEst.DataSource = ObjContrato.DtResultados
If ObjContrato.DtResultados.Rows.Count > 0 Then
'BtnEstimacion.Visible = True
DdlContrato.Items.Clear()
DdlContrato.Items.Add(New ListItem("Todos", "-1"))
DdlContrato.DataSource = ObjContrato.DtResultados.FiltraParametros("CveContrato > 0", "NumeroContrato", DistinctColumns:={"CveContrato", "NumeroContrato"})
End If
End If
ObjContrato.Dispose()
DdlContrato.DataBind()
GvEst.DataBind()
End If
ObjContrato.Dispose()
DdlContrato.DataBind()
GvEst.DataBind()
UPEstimaciones.Update()
End Sub
@@ -24047,20 +24313,29 @@ Partial Class Ventas
Using ObjPS As New ClsProductosServicios
Dim PrecioCompra = ObjPS.GetUltimoPrecioCompra(UsuarioActual.CveEmpresa, GvRow.DataKey("CvePS").ToEntero())
If PrecioCompra > 0 Then
Dim TotalCompra = (PrecioCompra * GvRow.DataKey("Cantidad").ToDouble() * (1 + GvRow.DataKey("IVA").ToDecimal()))
HdnTotalCompra.Value = TotalCompra.ToString()
Dim SubTotalCompra = (PrecioCompra * GvRow.DataKey("Cantidad").ToDouble())
HdnTotalCompra.Value = SubTotalCompra.ToString()
LblPrecioCompra.Text = $"PU Compra: {(PrecioCompra).FormatoNumero(2)}"
Dim TotalRedondeado = GvRow.DataKey("Total").ToDecimal() + GvRow.DataKey("ImporteIVA").ToDecimal()
Dim SubTotal = GvRow.DataKey("Total").ToDecimal()
Dim PorUtilidad = ((TotalRedondeado - TotalCompra) / TotalRedondeado) * 100D
Dim PorUtilidad = ((SubTotal - SubTotalCompra) / SubTotal) * 100D
LblUtilidadPorcentaje.Text = PorUtilidad.FormatoNumero(2)
End If
End Using
UpDescPS.Update()
RegistraScript("$('#ModalDescPS').modal({backdrop: 'static', keyboard: false});")
If UsuarioActual.TienePermisoProceso(374) Then
RegistraScript("$('#ModalDescPS').modal({backdrop: 'static', keyboard: false});")
Else
txtUserDesc.Text = ""
txtPassDesc.Text = ""
'UpAutorizarDesc.Update()
txtUserDesc.Focus()
RegistraScript("$('#ModalPermisoDesc').modal({backdrop: 'static', keyboard: false});$('#txtUserDesc').focus();", "A2")
End If
Else
DdlPS_SelectedIndexChanged(Nothing, Nothing)
End If
@@ -24667,7 +24942,7 @@ Partial Class Ventas
'LOS PEDIDOS SE DEBE CANCELAR EN UN PROCESO DISTINTO
If UsuarioActual.Empresa.Funcionalidad(578) = "1" AndAlso ObjFacturaCancelacion.TipoDocto = "Ped" Then
ChkDevAlm.Checked = False
ChkDevAlm.Checked = True
End If
resp = ObjFacturaCancelacion.CancelarFactura(ChkDevAlm.Checked, ListaRemisionesCancelar, CveMotivoCancelacion:=DdlMotivoCancelacion.SelectedValue.ToEntero(), Motivo:=TxtMotivoCancelacion.Text.Trim(), CveEstadoCancelacion:=Me.CveEstadoCancelacion)
@@ -30345,6 +30620,22 @@ Partial Class Ventas
divAnticipoMsg.Visible = False
If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
If DdlTipoComprobante.SelectedValue = "Ing" AndAlso DdlTipoAmortizacionAnticipo.SelectedValue = "4" Then
Dim DtMovtos As DataTable = Me.TmpDTAnticiposNCIxCCliente.FiltraParametros($"Saldo > 0 And SaldoSubtotal > 0 {If(CveVenta < 0, $"AND Tipo = 'NC' ", "")}")
divAmortizacionTipoRelacion.Visible = False
GVAnticipos.DataSource = DtMovtos
GVAnticipos.DataBind()
Else
Dim DtMovtos As DataTable = Me.TmpDTAnticiposNCIxCCliente.FiltraParametros($"Saldo > 0 AND SaldoSubtotal > 0 {If(CveVenta < 0, $"AND Tipo = 'Ant' ", "")} {If(DdlTipoComprobante.SelectedValue = "Ant", "AND Tipo = 'NC'", "")}")
divAmortizacionTipoRelacion.Visible = True
If UsuarioActual.CveEmpresa.Contiene(72, 80, 146) Then
DtMovtos = DtMovtos.FiltraParametros($"{If(CveVenta < 0, $"Tipo = 'Ant'{If(DdlTipoComprobante.SelectedValue = "Ing", $" AND CveMoneda ={DdlMoneda.SelectedValue.ToEntero()}", "")} ", "")}")
End If
End If
End If
If DdlTipoAmortizacionAnticipo.SelectedValue.Contiene("1", "2") Then
'cuando es amortización por descuento, debe tener seleccionado descuentos previamente registrados
If DdlTipoAmortizacionAnticipo.SelectedValue = "1" AndAlso LblDescuentos.Text.ToDecimal <= 0 Then
@@ -36304,9 +36595,10 @@ Partial Class Ventas
DdlProcedimiento.SelectedValueExist(dRow("CveProcedimiento").ToString.ToEntero)
TxtPaciente.Text = dRow("Paciente").ToString
TxtEpisodio.Text = dRow("Episodio").ToString
SeEstaFActurandoVentaMedica = True
TxtAlfa1.Text = dRow("Alfa1").ToString
CveTipoVenta = dRow("CveTipoVenta").ToString.ToEntero
ChkRequiereTecnico_CheckedChanged(Nothing, Nothing)
SeEstaFActurandoVentaMedica = True
End If
objVenta.Dispose()
End If
@@ -36376,34 +36668,6 @@ Partial Class Ventas
End Sub
'Private Sub CargaSucursalesModal(CveClienteSeleccionado As Integer)
' DdlSucursalClienteModal.Items.Clear()
' DdlSucursalClienteModal.ClearSelection()
' DdlSucursalClienteModal.SelectedValue = Nothing
' Dim ObjCliente As New ClsClientes
' If ObjCliente.GetSucursales(CveClienteSeleccionado) Then
' DdlSucursalClienteModal.DataSource = ObjCliente.DtResultados
' If ObjCliente.DtResultados.Rows.Count > 0 Then
' DvModalClientesucursal.Visible = True
' Else
' DvModalClientesucursal.Visible = False
' End If
' Else
' DvModalClientesucursal.Visible = False
' DdlSucursalClienteModal.DataSource = Nothing
' End If
' ObjCliente.Dispose()
' DdlSucursalClienteModal.DataBind()
' DdlSucursalClienteModal.Items.Insert(0, New ListItem("Matriz", "-1"))
' UpDvModalTipoVenta.FindDataSourceControl
'End Sub
Private Sub CargaDdlClientesSucursal()
@@ -36500,13 +36764,6 @@ Partial Class Ventas
UpDvModalTipoVenta.Update()
End Sub
'Protected Sub DdlClientesWS_selectedindexchange(sender As Object, e As EventArgs)
' CargaPSProcedimiento(DdlProcedimiento.SelectedValue.ToEntero, DdlClientesWS.SelectedValue.ToEntero, DdlSubProyectoDatos.SelectedValue.ToEntero)
' 'CargaSucursalesModal(DdlClientesWS.SelectedValue.ToEntero)
'End Sub
Protected Sub DdlClienteSucursal_SelectedIndexChanged(sender As Object, e As EventArgs)
Dim CveClienteSplit As Integer = -1
@@ -36570,9 +36827,7 @@ Partial Class Ventas
ChkRequiereTecnicoModal.Enabled = True
'DdlClientesWS.txtText.Value = ""
'DdlClientesWS.txtValue.Value = ""
'DdlClientesWS.ddl.SelectedValueExist(-1)
DdlClienteSucursal.SelectedValueExist(-1)
DvModalRequiereOSFecha.Visible = False
@@ -36634,8 +36889,6 @@ Partial Class Ventas
End If
End If
For Each GvRow As GridViewRow In GvProductosProcedimiento.Rows
Dim Cantidad As Decimal = GvRow.FCTextBox("TxtCantidad").Text.ToDecimal
Dim CveUnidadMedida As Integer = GvRow.DataKey("CveUnidadMedida").ToEntero
@@ -36717,6 +36970,9 @@ Partial Class Ventas
End If
DdlTipoComprobante.Enabled = False
CargaCliente(CveCliente)
@@ -36769,10 +37025,17 @@ Partial Class Ventas
UpParametros.Update()
End If
If RBLTipoVenta.SelectedValue.Contiene("5", "6") Then
AsignaAlamacenWS()
CargaPS(-1, DdlPS)
End If
RegistraScript("$('#DvModalTipoVenta').modal('hide');")
UpCliente.Update()
End Sub
Protected Sub GvProductosProcedimiento_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DataKey("Precio").ToDecimal = 0 Then
@@ -36932,6 +37195,27 @@ Partial Class Ventas
CargaProcedimientos(HdnCveProcedimientoNuevo.Value.ToEntero)
End Sub
Private Sub AsignaAlamacenWS()
CveAlamcenFiltroDdl = -1
If UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then
If DdlSucursalCliente.SelectedValue.ToEntero > 0 Then
Dim objclientes As New ClsClientes
If objclientes.GetSucursales(CveCliente, -1) Then
CveAlamcenFiltroDdl = objclientes.DtResultados.FiltroPrimeroValor("CveAlmacenAsignado", $" CveClienteSucursal = {DdlSucursalCliente.SelectedValue.ToEntero}").ToEntero
End If
objclientes.Dispose()
End If
If Not CveAlamcenFiltroDdl > 0 Then
CveAlamcenFiltroDdl = If(CveAlmacenAsignado > 0, CveAlmacenAsignado, -1)
End If
End If
End Sub
#End Region
'Protected Sub LnkCancelarSoloCFDI_Click(sender As Object, e As EventArgs)
@@ -37038,5 +37322,46 @@ Partial Class Ventas
End Sub
Protected Sub BtnAutorizarDescuento_Click(sender As Object, e As EventArgs)
Dim UsuarioAutorizar As Usuario = Nothing
Using ObjUsuario As New ClsSisUsuarios
UsuarioAutorizar = ObjUsuario.ValidaUsuario(txtUserDesc.Text.Trim, Encripta(txtPassDesc.Text), ModExtensiones.IMEI, CveEmpresa:=UsuarioActual.CveEmpresa)
If UsuarioAutorizar IsNot Nothing Then
If UsuarioAutorizar.TienePermisoProceso(374) Then
txtUserDesc.Text = ""
txtPassDesc.Text = ""
'UpAutorizarDesc.Update()
RegistraScript("$('#ModalPermisoDesc').modal('hide');$('#ModalDescPS').modal({backdrop: 'static', keyboard: false});", "AUT")
Else
Alert("El usuario no tiene permiso para autorizar", TipoMensaje.MsgAdvertencia)
End If
Else
Alert("No se encontro el usuario para autorizar", TipoMensaje.MsgAdvertencia)
End If
End Using
End Sub
Protected Sub ImgAntiPend_Click(sender As Object, e As EventArgs)
' $get('HdnTipoDescuento').value = '3'; MuestraAnticipos();
HdnTipoDescuento.Value = "3"
If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
If DdlTipoAmortizacionAnticipo.Items.FindByValue("4") Is Nothing Then
DdlTipoAmortizacionAnticipo.Items.Insert(1, New ListItem("Pago con devolución", "4"))
End If
DdlTipoAmortizacionAnticipo.SelectedValueExist("4")
DdlTipoRelacionAnticipo.SelectedValueExist("-1")
DdlTipoAmortizacionAnticipo_SelectedIndexChanged(DdlTipoAmortizacionAnticipo, EventArgs.Empty)
divAmortizacionTipoRelacion.Visible = False
End If
UpAnticipos.Update()
RegistraScript("MuestraAnticipos();", "AE")
End Sub
End Class