This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2024-01-10 00:08:26 -07:00
39 changed files with 1649 additions and 179 deletions

View File

@@ -207,7 +207,7 @@
<input type="text" id="TxtBuscar" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBuscar','{0}')", GVPrecios.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBuscar','{0}')", GVPrecios.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<asp:GridView ID="GVPrecios" runat="server" GridLines="None" DataKeyNames="CvePS, CvePrecioLista,PrecioLista,PS,Codigo,Codigo2,Porcentaje,CodigoPS"
<asp:GridView ID="GVPrecios" runat="server" GridLines="None" DataKeyNames="CvePS, CvePrecioLista,PrecioLista,PS,Codigo,NumeroParte,Porcentaje,CodigoPS"
CssClass="table table-striped table-advance table-hover Widthall ScrollAD" AutoGenerateColumns="False" data-sort="true" EmptyDataText="No se encontraron registros">
<Columns>
<asp:TemplateField ItemStyle-HorizontalAlign="center" ItemStyle-Width="5%">
@@ -216,13 +216,12 @@
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Codigo" ItemStyle-Width="5%" HeaderText="Código" />
<%--<asp:BoundField DataField="Codigo2" ItemStyle-Width="5%" HeaderText="Código CPK"/>--%>
<asp:TemplateField ItemStyle-Width="5%" Visible="false" >
<HeaderTemplate>
<asp:Literal ID="LtlCodigo2" runat="server" Text='<%# If(UsuarioActual.Empresa.Funcionalidad(531) = "1", "Código CPK", "Numero de parte") %>'></asp:Literal>
<asp:Literal ID="LtlNumeroParte" runat="server" Text='<%# If(UsuarioActual.Empresa.Funcionalidad(531) = "1", "Código CPK", "Numero de parte") %>'></asp:Literal>
</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlCodigo2" runat="server" Text='<%# Eval("Codigo2", "{0}")%>'></asp:Literal>
<asp:Literal ID="LtlNumeroParte" runat="server" Text='<%# Eval("NumeroParte", "{0}")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="PS" HeaderText="Producto/Servicio" />

View File

@@ -405,7 +405,7 @@ Partial Class Ventas_ActualizarPrecios
Select New With
{
.Codigo = row.DataKey("Codigo"),
.Codigo2 = row.DataKey("Codigo2"),
.NumeroParte = row.DataKey("NumeroParte"),
.PS = row.DataKey("PS"),
.Precio = row.FCTextBox("TxtPrecio").Text.ToDecimal()
}).QueryToDataTable(True)
@@ -436,7 +436,7 @@ Partial Class Ventas_ActualizarPrecios
DtExcel.Columns("Codigo").ColumnName = "Código"
DtExcel.Columns("PS").ColumnName = "Producto / Servicio"
DtExcel.Columns("Codigo2").ColumnName = "Número de parte"
DtExcel.Columns("NumeroParte").ColumnName = "Número de parte"
If UsuarioActual.Empresa.Funcionalidad(531) = "1" OrElse UsuarioActual.Empresa.Funcionalidad(578) = "1" Then 'Empresa Acumuladores
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
@@ -687,7 +687,7 @@ Partial Class Ventas_ActualizarPrecios
NewRow("Código") = Row("Codigo")
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then 'Empresa Acumuladores
NewRow("Código CPK") = Row("Codigo2")
NewRow("Código CPK") = Row("NumeroParte")
End If
NewRow("Producto/Servicio") = Row("PS")

View File

@@ -225,7 +225,7 @@
<div class="col-md-12">
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False"
DataKeyNames="CveMedico,Medico,CedulaProfesional,FechaNacimiento,Notas,DiasAtencion,Horario,Lugar,Estatus,CveUsuario,FechaIng,CveEmpresa,Telefono,Mail,CveMedicoEspecialidad,CveMedicoSubEspecialidad,Celular,Consultorio,Torre"
DataKeyNames="CveMedico,Medico,CedulaProfesional,FechaNacimiento,Notas,DiasAtencion,Horario,Lugar,Estatus,CveUsuario,FechaIng,CveEmpresa,Telefono,Mail,CveMedicoEspecialidad,CveMedicoSubEspecialidad,Celular,Consultorio,Torre,Usuario"
data-sort="true"
EmptyDataText="No se encontraron Medicos Registrados" ToolTip="Listado de Medicos" CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" GridLines="None">
<Columns>
@@ -278,13 +278,13 @@
</asp:TemplateField>
<asp:TemplateField HeaderText="Fecha Ing." ItemStyle-HorizontalAlign="Center">
<asp:TemplateField HeaderText="Fecha Ing." ItemStyle-HorizontalAlign="Center" Visible="false">
<ItemTemplate>
<asp:Literal ID="LtlFechaIng" runat="server" Text='<%# Eval("FechaIng", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Usuario" ItemStyle-HorizontalAlign="Center">
<asp:TemplateField HeaderText="Usuario" ItemStyle-HorizontalAlign="Center" Visible="false">
<ItemTemplate>
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
</ItemTemplate>
@@ -548,6 +548,22 @@
</div>
<div class="row" runat="server" id="DVUsuarioFechaIng" visible ="false">
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtUsuario" CssClass="form-control " runat="server" MaxLength="250" CausesValidation="true" Enabled="false"></asp:TextBox>
<label for="<%= TxtUsuario.ClientID.ToString()%>">Usuario:</label>
</div>
</div>
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright" >
<asp:TextBox ID="TxtFechaIng" CssClass="form-control " runat="server" MaxLength="250" CausesValidation="true" Enabled="false"></asp:TextBox>
<label for="<%= TxtFechaIng.ClientID.ToString()%>">Fecha Ing.:</label>
</div>
</div>
</div>
</div>
</div>

View File

@@ -161,6 +161,10 @@ Partial Class Ventas_CatMedicos
DdlEspecialidad.SelectedValueExist(-1)
DdlSubEspecialidad.SelectedValueExist(-1)
TxtTorre.Text = ""
DVUsuarioFechaIng.Visible = False
TxtFechaIng.Text = ""
TxtUsuario.Text = ""
DVEstatus.Visible = False
ChkEstatus.Checked = True
@@ -196,6 +200,10 @@ Partial Class Ventas_CatMedicos
DdlSubEspecialidad.SelectedValueExist(GvRow.DataKey("CveMedicoSubEspecialidad").ToEntero)
TxtTorre.Text = GvRow.DataKey("Torre")
DVUsuarioFechaIng.Visible = True
TxtFechaIng.Text = GvRow.DataKey("FechaIng").ToDateTime.ToString("dd/MM/yyyy hh:mm:ss tt")
TxtUsuario.Text = GvRow.DataKey("Usuario")
DVEstatus.Visible = True
LbAgregar.Text = "Actualizar"
LtlTituloModal.Text = $"Actualizar Médico {TxtCedulaProfecional.Text}"

View File

@@ -1,11 +1,9 @@
Option Explicit On
Option Strict On
Imports System.Activities.Expressions
Imports System.Data
Imports System.Data.SqlClient
Imports System.IO
Imports ADSNetLibrary.SIGAPI.Models.RH.Response
Imports Extensiones
Imports ZXing
@@ -487,14 +485,10 @@ Partial Class ProductosyServicios
If ObjGral.GetModelos(UsuarioActual.CveEmpresa) Then
DdlModelo.DataSource = ObjGral.DtResultados.Copy()
End If
If ObjGral.GetMedidas(UsuarioActual.CveEmpresa) Then
DdlMedida.DataSource = ObjGral.DtResultados.Copy()
End If
If ObjGral.GetRimTamanios(UsuarioActual.CveEmpresa) Then
DdlRin.DataSource = ObjGral.DtResultados.Copy()
End If
ObjGral.Dispose()
DdlMedida.DataSource = GlobalDTPSMedidas(UsuarioActual.CveEmpresa)
DdlRin.DataSource = GlobalDTPSRinTamaños(UsuarioActual.CveEmpresa)
DdlModelo.DataBind()
DdlMedida.DataBind()
DdlRin.DataBind()
@@ -948,7 +942,7 @@ Partial Class ProductosyServicios
DdlMarca.SelectedValue = ObjProductosServicios.CveMarca.ToString
DdlMarcaPSDes.SelectedValue = ObjProductosServicios.CveMarca.ToString
TxtCodigo.Text = ObjProductosServicios.Codigo
TxtNumeroParte.Text = ObjProductosServicios.Codigo2
TxtNumeroParte.Text = ObjProductosServicios.NumeroParte
TxtCodigoBarras.Text = ObjProductosServicios.CodigoBarras
CodigoBarrasCargado = ObjProductosServicios.CodigoBarras
TxtLitraje.Text = ObjProductosServicios.DtResultados.Rows(0)("Litraje").ToString
@@ -3138,12 +3132,10 @@ Partial Class ProductosyServicios
If ObjGral.GetModelos(CveEmpresaFranquicia) Then
CveModelo = ObjGral.DtResultados.FiltroPrimeroValor("CveModelo", String.Format("Modelo = '{0}'", DdlModelo.SelectedItem.Text)).ToEntero
End If
If ObjGral.GetMedidas(CveEmpresaFranquicia) Then
CveMedida = ObjGral.DtResultados.FiltroPrimeroValor("CveMedida", String.Format("Medida = '{0}'", DdlMedida.SelectedItem.Text)).ToEntero
End If
If ObjGral.GetRimTamanios(CveEmpresaFranquicia) Then
CveRin = ObjGral.DtResultados.FiltroPrimeroValor("CveRinTamaño", String.Format("RinTamaño = '{0}'", DdlRin.SelectedItem.Text)).ToEntero
End If
CveMedida = GlobalDTPSMedidas(CveEmpresaFranquicia).FiltroPrimeroValor("CveMedida", String.Format("Medida = '{0}'", DdlMedida.SelectedItem.Text)).ToEntero
CveRin = GlobalDTPSRinTamaños(CveEmpresaFranquicia).FiltroPrimeroValor("CveRinTamaño", String.Format("RinTamaño = '{0}'", DdlRin.SelectedItem.Text)).ToEntero
ObjGral.Dispose()
@@ -3177,7 +3169,7 @@ Partial Class ProductosyServicios
End If
If Agregar Then
If Not ObjPS.AddPS(CveClasificacion, -1, CveUnidadMedida, TxtCodigo.Text.Trim, TxtCodigo2.Text.Trim, TxtCodigoBarras.Text.Trim, PSS, TxtPrecio.Text.Trim.ToDouble, DdlIVA.SelectedValue.ToDouble,
If Not ObjPS.AddPS(CveClasificacion, -1, CveUnidadMedida, TxtCodigo.Text.Trim, TxtNumeroParte.Text.Trim, TxtCodigoBarras.Text.Trim, PSS, TxtPrecio.Text.Trim.ToDouble, DdlIVA.SelectedValue.ToDouble,
(TxtRetIVA.Text.Trim.ToDouble / 100), ChkInventariable.Checked, DdlProveedor.txtValue.Value.ToEntero, True, ChkAplicaParaVenta.Checked, UsuarioActual.CveUsuario,
CveEmpresaFranquicia, CveMetodoInv, EsPaquete, CveTipoPS:=DdlTipoPS.SelectedValue.ToEntero, FuePorXML:=False, TipoServicio:=-1, CveClasificacion2:=CveClasificacion2,
CveMarca:=CveMarcaFranquicia, AlmacenSeccion:=TxtAlmacenSeccion.Text.Trim, AplicaIEPS:=ChkAplicaIeps.Checked, IEPSPorcentaje:=DdlIEPSPorcentaje.SelectedValue.ToDecimal,
@@ -3197,7 +3189,7 @@ Partial Class ProductosyServicios
If ObjPS.GetPS(-1, -1, CveEmpresaFranquicia, Codigo:=TxtCodigo.Text.Trim.ToUpper) Then
Dim CvePS As Integer = ObjPS.DtResultados.FiltroPrimeroValor("CvePS", String.Format(" Codigo = '{0}'", TxtCodigo.Text.Trim.ToUpper)).ToEntero()
If Not ObjPS.UpdatePS(CveClasificacion, -1, CveUnidadMedida, TxtCodigo.Text.Trim, TxtCodigo2.Text.Trim, TxtCodigoBarras.Text.Trim, PSS, TxtPrecio.Text.Trim.ToDouble, DdlIVA.SelectedValue.ToDouble,
If Not ObjPS.UpdatePS(CveClasificacion, -1, CveUnidadMedida, TxtCodigo.Text.Trim, TxtNumeroParte.Text.Trim, TxtCodigoBarras.Text.Trim, PSS, TxtPrecio.Text.Trim.ToDouble, DdlIVA.SelectedValue.ToDouble,
(TxtRetIVA.Text.Trim.ToDouble / 100), ChkInventariable.Checked, -1, True, ChkAplicaParaVenta.Checked, ChkEstado.Checked, UsuarioActual.CveUsuario, CvePS, CveMetodoInv,
EsPaquete, DdlSATPS.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, CveTipoPS:=DdlTipoPS.SelectedValue.ToEntero, TipoServicio:=-1, CveClasificacion2:=CveClasificacion2, CveMarca:=CveMarcaFranquicia,
AlmacenSeccion:=TxtAlmacenSeccion.Text.Trim, AplicaIEPS:=ChkAplicaIeps.Checked, IEPSPorcentaje:=DdlIEPSPorcentaje.SelectedValue.ToDecimal,

View File

@@ -1976,7 +1976,10 @@
<asp:LinkButton ID="ImgCalendarFechaEje" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaEje" runat="server" TargetControlID="TxtFechaEjecucion" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<div runat="server" id="DVMEEFechaEje" visible="true">
<ajax:MaskedEditExtender ID="MEEFechaEje" runat="server" TargetControlID="TxtFechaEjecucion" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
</div>
<ajax:CalendarExtender runat="server" ID="CEFechaEje" TargetControlID="TxtFechaEjecucion" PopupButtonID="ImgCalendarFechaEje" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVFechaEje" runat="server" ControlToValidate="TxtFechaEjecucion" Display="None" ErrorMessage="El campo <b>''Fecha de Ejecución''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="GrpEmitirImprimir"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CVFechaEje" runat="server" ControlToValidate="TxtFechaEjecucion" Display="None" ErrorMessage="El campo <b>''Fecha Ejecución''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpEmitirImprimir"></asp:CompareValidator>
@@ -4202,7 +4205,7 @@
<asp:Button ID="BtnEditar" runat="server" Text="Editar" CssClass="btn myventasbutton btn-primary" Visible="false" />
<asp:LinkButton ID="BtnAdjuntar" runat="server" Visible="false" Text="<i class='fa-upload fa' style=' color: white;'></i> Adjuntar" data-toggle="modal" data-target="#ModalAdjuntar" CssClass="btn myventasbutton btn-primary" />
<asp:LinkButton ID="BtnArchivoAdjunto" runat="server" Visible="false" Text="" Font-Size="14px" />
<br /><asp:LinkButton ID="BtnArchivoAdjunto" runat="server" Visible="false" Text="" Font-Size="14px" />
<asp:LinkButton ID="BtnEliminarAdjunto" runat="server" Visible="false" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="confirmar" data-btn-ok-label="si" />
</td>

View File

@@ -2737,7 +2737,12 @@ Partial Class Ventas
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then BtnCrearApartirDe.Visible = False
If UsuarioActual.TienePermisoProceso(302) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Egs") Then BtnEditar.Visible = True
If UsuarioActual.TienePermisoProceso(302) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Rem") Then BtnPermisoEditarRemision.Visible = True
If UsuarioActual.TienePermisoProceso(302) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Rem", "Ped") Then BtnPermisoEditarRemision.Visible = True
If DdlTipoComprobante.SelectedValue = "Ped" Then
BtnPermisoEditarRemision.Text = "Editar Pedido"
BtnEditarRemision.Text = "Actualizar Pedido"
End If
DivFechaAnticipoCliente.Visible = True
TxtFechaAnticipoCliente.Text = NowADS().ToShortDateString
@@ -3386,19 +3391,27 @@ Partial Class Ventas
End If
End If
If CveVenta <= 0 AndAlso UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then
EsVentaMedica = True
CargaTiposVenta()
If CveCliente > 0 Then
SeleccionarClienteSucursal(CveCliente:=CveCliente)
If UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then
If CveVenta <= 0 Then
EsVentaMedica = True
CargaTiposVenta()
If CveCliente > 0 Then
SeleccionarClienteSucursal(CveCliente:=CveCliente)
End If
End If
If CveVenta >= 0 Then
HLFAgregarOS.Visible = True
HLFAgregarOS.NavigateUrl = $"/OS/OrdenesServicios.aspx?CveVenta={CveVenta}"
End If
End If
If CveVenta >= 0 AndAlso UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then
HLFAgregarOS.Visible = True
HLFAgregarOS.NavigateUrl = $"/OS/OrdenesServicios.aspx?CveVenta={CveVenta}"
TxtPrecio.Enabled = False
'ocultar la columna de subproyecto
GvPS.Columns(ColumnaSubProyecto).Visible = False
ThProyecto.Visible = False
ThProyecto2.Visible = False
TxtCantidad.Text = "1"
TxtCantidad.Focus()
End If
If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
@@ -5193,7 +5206,7 @@ Partial Class Ventas
HdnTotalVenta.Value = DbRowVenta("Total").ToString().FormatoNumero(2)
TxtMotivoDescuento.Text = DbRowVenta("MotivoDescuento").ToString()
TxtObsFact.Text = DbRowVenta("Observaciones").ToString()
LblUsuario.Text = DbRowVenta("Nombre").ToString()
LblUsuario.Text = DbRowVenta("Nombre").ToString().SubStringADS(30)
LblFechaRegistro.Text = DbRowVenta("FechaIng").ToString().ToDate.ToShortDateString
LblSeTimbro.Text = DbRowVenta("SeTimbro").ToString()
LblMail.Text = DbRowVenta("EnvioMail").ToString()
@@ -5316,7 +5329,13 @@ Partial Class Ventas
End If
TxtFechaEjecucion.Text = DbRowVenta("FechaEjecucion").ToString().ToDateTime.ToString("dd/MM/yyyy")
If DbRowVenta("CveMedico").ToString.ToEntero > 0 AndAlso DbRowVenta("CveProcedimiento").ToString.ToEntero > 0 Then
TxtFechaEjecucion.Text = DbRowVenta("FechaEjecucion").ToString().ToDateTime.ToString("dd/MM/yyyy HH:mm")
DVMEEFechaEje.Visible = False
Else
TxtFechaEjecucion.Text = DbRowVenta("FechaEjecucion").ToString().ToDateTime.ToString("dd/MM/yyyy")
End If
'DdlSucursalEjecucion.SelectedValueExist(DbRowVenta("CveSucursalEjecucion").ToString())
'DdlSucursalCobranza.SelectedValueExist(DbRowVenta("CveSucursalCobranza").ToString())
DdlSucursalCliente.SelectedValueExist(DbRowVenta("CveClienteSucursal").ToString())
@@ -8188,6 +8207,10 @@ Partial Class Ventas
GvPS.Rows(e.NewEditIndex).FCTextBox("TxtDescuento").Enabled = False
End If
If EsVentaMedica Then
GvPS.Rows(e.NewEditIndex).FCTextBox("TxtPrecio").Enabled = False
End If
If CveCicloComercial > 0 Then
For Each gvr As GridViewRow In GvContratoDetalles.Rows
If gvr.RowType = DataControlRowType.DataRow Then
@@ -13524,7 +13547,7 @@ Partial Class Ventas
If EsVentaMedica AndAlso ErrorList.Count = 0 AndAlso ChkRequiereTecnico.Checked Then
GeneraOS(ObjVentas.IniciaTransacSQL, ErrorList)
GeneraOS(ObjVentas.IniciaTransacSQL, ErrorList, CveVentaOS:=factura.CveVenta, SerieFolioOS:=factura.SerieFolio)
If ErrorList.Count = 0 Then
If Not ObjOS.UpdateVentaOS(factura.CveVenta, CveOSVentaMedica) Then
@@ -16798,16 +16821,22 @@ Partial Class Ventas
DdlUnidadMedida.DataBind()
DdlUnidadMedida.SelectedValueExist(drPS("CveUnidadMedida").ToString())
If drPS("CveTipoPS").ToString() = "1" Then 'Si es servicio
If UsuarioActual.Empresa.Funcionalidad(558).ToString() = "1" Then 'Si es Empresa llantera
TxtPrecio.Enabled = True
Else
'TxtPrecio.Enabled = False
End If
If EsVentaMedica Then
TxtPrecio.Enabled = False
Else
TxtPrecio.Enabled = True
If drPS("CveTipoPS").ToString() = "1" Then 'Si es servicio
If UsuarioActual.Empresa.Funcionalidad(558).ToString() = "1" Then 'Si es Empresa llantera
TxtPrecio.Enabled = True
Else
'TxtPrecio.Enabled = False
End If
Else
TxtPrecio.Enabled = True
End If
End If
Dim PSCodigoSAT As String = drPS("SATClavePS").ToString
If UsuarioActual.TienePermisoProceso(68) AndAlso Not PSCodigoSAT.Contiene("84111506", "80141610") Then TxtPrecio.Enabled = False
@@ -18001,17 +18030,12 @@ Partial Class Ventas
'YOKOHAMA
If UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso CveRinTamañoPS > 0 AndAlso CveMarcaPromocion.Contiene(800, 912, 1238, 1381, 1456, 1528, 1600, 1672, 1807) Then
Dim DtRines As DataTable = Nothing
Dim ObjGral As New ClsGenerales
If ObjGral.GetRimTamanios(UsuarioActual.CveEmpresa) Then
DtRines = ObjGral.DtResultados.Copy()
End If
ObjGral.Dispose()
If CveMarcaPromocion > 0 Then
ObjDescuento.NombrePromo = "YOKOHAMA VERANO" 'dr("NombrePromocion").ToString()
ObjDescuento.CveMarca = CveMarcaPromocion
Dim Rin As String = DtRines.FiltroPrimeroValor("RinTamaño", $"CveRinTamaño = {CveRinTamañoPS}")
Dim Rin As String = GlobalDTPSRinTamaños(UsuarioActual.CveEmpresa, CveRinTamañoPS).FiltroPrimeroValor("RinTamaño", "")
Dim PromoDescuento As Decimal = (Descuento * (1 + If(IncluyeImpuestos, PorcentajeIVA, 0))).RoundSQL(2)
ObjDescuento.ObsDescuento = String.Format("RIN {0} BONO ${1:N2}", Rin, PromoDescuento)
@@ -21676,6 +21700,9 @@ Partial Class Ventas
ViewState("CveClienteAnterior") = CveCliente
DdlMedicoObservaciones.Enabled = True
DdlProcedimientoObservaciones.Enabled = True
Dim CantidadFacturadaRemision As Decimal = 0
'EN BDH NO DEBE PERMITIR EDITAR EL PU
@@ -21716,7 +21743,14 @@ Partial Class Ventas
TxtObsPS.Enabled = True
DdlProyecto.Enabled = True
DdlSubProyecto.Enabled = True
TxtPrecio.Enabled = True
If EsVentaMedica Then
TxtPrecio.Enabled = False
Else
TxtPrecio.Enabled = True
End If
LbAgregar.Enabled = True
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 = '';")
LblSubTotal1.Text = TxtSubTotal.Text
@@ -21731,6 +21765,7 @@ Partial Class Ventas
UpPS.Update()
UpCliente.Update()
UPObservaciones.Update()
End Sub
Private Sub BtnEditarRemision_Click(sender As Object, e As EventArgs) Handles BtnEditarRemision.Click
Dim OcurrioError As Boolean = False
@@ -21825,7 +21860,7 @@ Partial Class Ventas
PedidoContrato:=TxtPedidoContrato.Text, AtencionA:=TxtAtencionA.Text.Trim, CveMetodoPago33:=DdlMetodoPago33.SelectedValue.ToEntero(),
CveFormaPago33:=DdlFormaPago33.SelectedValue.ToEntero(), TipoDocto:="Rem", CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal,
OrdenCompra:=TxtOrdenCompra.Text, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, Kilometraje:=TxtKilometraje.Text.ToDouble, CveUsoCFDi:=DdlUsoCFDI.SelectedValue.ToEntero(),
CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), ServicioDomicilio:=TrServicioDomicilio.Visible) Then
CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), ServicioDomicilio:=TrServicioDomicilio.Visible, CveMedico:=DdlMedicoObservaciones.SelectedValue.ToEntero, CveProcedimiento:=DdlProcedimientoObservaciones.SelectedValue.ToEntero) Then
OcurrioError = True
End If
@@ -26192,7 +26227,26 @@ Partial Class Ventas
#Region " SALDAR VENTA "
Protected Sub BtnSaldarVenta_Click(sender As Object, e As EventArgs)
SaldarVenta()
'SaldarVenta()
Dim ObjCancelacion As New Timbrado
Dim FolioFiscal As String = LblFolioFiscal.Text
Dim RFCEmisor As String = UsuarioActual.Empresa.RFC
Dim RFCReceptor As String = LblRFC.Text
Dim CvePACCancelacion As Integer = 4
Dim RespCancelacion As RespuestaCancelacionSAT = ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscal, TxtTotal.Text.ToDecimal, RFCReceptor, RFCEmisor, CvePACCancelacion, CveSATMotivoCancelacion:=3)
If RespCancelacion.Verificado Then
Else
Alert("Los servicios de cancelación del SAT no se encuentran disponibles o presentan time out. Intente de nuevo en unos minutos.<br/>Origen del error: WebService www.sat.gob.mx", TipoMensaje.MsgError)
End If
End Sub
Private Sub SaldarVenta()
'Dim ObjVenta As New ClsVentas
@@ -33619,6 +33673,9 @@ Partial Class Ventas
UpPS.Update()
End If
TxtDescripcionVenta.Enabled = True
UpCliente.Update()
UpParametros.Update()
UPObservaciones.Update()
UpFacturar.Update()
@@ -33637,7 +33694,7 @@ Partial Class Ventas
ObjVentas.IniciaTransacSQL()
If Not ObjVentas.UpdateObservacionesVenta(Me.CveVenta, UsuarioActual.CveEmpresa, DdlVendedor.SelectedValue.ToEntero(), TxtObsFact.Text, RblPaqueteria.SelectedValue.ToEntero(), TxtCorreoNotificaciones.Text,
TxtObsAlmacen.Text, TxtPedidoContrato.Text, TxtOrdenCompra.Text, TxtFechaPago.Text, DdlUsoCFDI.SelectedValue.ToEntero) Then
TxtObsAlmacen.Text, TxtPedidoContrato.Text, TxtOrdenCompra.Text, TxtFechaPago.Text, DdlUsoCFDI.SelectedValue.ToEntero, DescripcionVenta:=TxtDescripcionVenta.Text.Trim) Then
TieneError = True
End If
@@ -36314,7 +36371,7 @@ Partial Class Ventas
End Sub
Private Function GeneraOS(ByRef TransacSQL As SqlTransaction, ByRef errorList As List(Of String)) As Boolean
Private Function GeneraOS(ByRef TransacSQL As SqlTransaction, ByRef errorList As List(Of String), CveVentaOS As Integer, SerieFolioOS As String) As Boolean
Dim Errores As Boolean = False
@@ -36350,18 +36407,22 @@ Partial Class Ventas
Dim CveOsDetalle = ObjOrdenServicio.AddOrdenesServiciosDetalle(ObjOrdenServicio.CveOS, CvePSDetalle, 1, -1, -1, $"Venta: {LblSerie.Text}-{TxtFolio.Text}", False, True, False, -1, "-1", "-1", "-1", "", UsuarioActual.CveUsuario, Archivo:="")
If CveOsDetalle > 0 Then
'MENSAJE PRINCIPAL
'Dim MensajeAlertOS As New StringBuilder
MensajeAlert.AppendFormat(String.Format("<br/>La Orden de Servicio: <b>{0}</b> se generó correctamente.<br/>", ObjOrdenServicio.Folio))
MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF</a></li></ul><br/>", Encripta(String.Format("OP=OS&CVEOS={0}", ObjOrdenServicio.CveOS)))
'Dim Liga = $"document.location.href=""/OS/RepOrdenesServicios.aspx"";"
'Alert(MensajeAlertOS.ToString, TipoMensaje.MsgInformacion, Liga)
Else
errorList.Add("Se presento un error al guardar la el detalle de la orden de servicio.")
Errores = True
End If
End If
If Not Errores Then
Dim ObjEventos As New ClsOIEventos(TransacSQL)
Dim LigaVenta As String = String.Format("Pedido en Folio: <a href=""/Ventas/Ventas.aspx?CveVenta={0}"" target=""_blank"">{1}</a>", CveVentaOS, SerieFolioOS)
If Not ObjEventos.AddEventoBitacora(LigaVenta, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveOS:=CveOSVentaMedica) Then
errorList.Add("Se presento un error al guardar la bitacora de la orden de servicio.")
Errores = True
End If
End If
Return If(Errores, False, True)