This commit is contained in:
2024-03-06 11:34:25 -07:00
14 changed files with 563 additions and 93 deletions

View File

@@ -420,7 +420,7 @@ Public Class ClsContratos
Public Function UpdateContratos(CveContrato As Integer, NumeroContrato As String, DescripcionContrato As String, NumeroLicitacion As String, CveProveedor As Integer, CveCliente As Integer, CveProspecto As Integer, FechaInicial As DateTime, FechaFinal As DateTime, Public Function UpdateContratos(CveContrato As Integer, NumeroContrato As String, DescripcionContrato As String, NumeroLicitacion As String, CveProveedor As Integer, CveCliente As Integer, CveProspecto As Integer, FechaInicial As DateTime, FechaFinal As DateTime,
Ubicacion As String, Responsable As String, CveSubProyecto As Integer, PorIVA As Double, PorAnticipo As Double, PorAmortizacionAnticipo As Double, PorGarantia As Double, Archivo As String, Geom As String, Ubicacion As String, Responsable As String, CveSubProyecto As Integer, PorIVA As Double, PorAnticipo As Double, PorAmortizacionAnticipo As Double, PorGarantia As Double, Archivo As String, Geom As String,
CveContratoPadre As Integer, CveUsuario As Integer, CveEmpresa As Integer, EsPresupuestal As Boolean, Minimo As Double, Maximo As Double, Importe As Double, CveMoneda As Integer, ModalidadDetalle As Integer, CveContratoPadre As Integer, CveUsuario As Integer, CveEmpresa As Integer, EsPresupuestal As Boolean, Minimo As Double, Maximo As Double, Importe As Double, CveMoneda As Integer, ModalidadDetalle As Integer,
Optional CveContratosEstatus As Integer = -1, Optional CveContratoTipo As Integer = -1, Optional TipoCambio As Double = 1.0, Optional CveSucursalCliente As Integer = -1, Optional CveAlmacenOrigen As Integer = -1, Optional CveAlmacenDestino As Integer = -1, Optional PorcentajeComision As Integer = -1, Optional CveContratosEstatus As Integer = -1, Optional CveContratoTipo As Integer = -1, Optional TipoCambio As Double = -1, Optional CveSucursalCliente As Integer = -1, Optional CveAlmacenOrigen As Integer = -1, Optional CveAlmacenDestino As Integer = -1, Optional PorcentajeComision As Integer = -1,
Optional TipoGarantia As Integer = -1, Optional Folio As Integer = -1, Optional FechaVenc As Date = Nothing, Optional EstatusFianza As Integer = -1, Optional CveContratoPlantilla As Integer = -1, Optional CveCuentaEquipo As Integer = -1, Optional TipoGarantia As Integer = -1, Optional Folio As Integer = -1, Optional FechaVenc As Date = Nothing, Optional EstatusFianza As Integer = -1, Optional CveContratoPlantilla As Integer = -1, Optional CveCuentaEquipo As Integer = -1,
Optional CveVendedor As Integer = -1, Optional Observaciones As String = "", Optional CveDireccionEnvio As Integer = -1, Optional AplicaImpuestosLocales As Boolean = False, Optional CorreoNotificacionPedDev As String = "", Optional FacturacionCicilica As Boolean = False, Optional FacturacionCiclicaAutomatico As Boolean = False, Optional CveVendedor As Integer = -1, Optional Observaciones As String = "", Optional CveDireccionEnvio As Integer = -1, Optional AplicaImpuestosLocales As Boolean = False, Optional CorreoNotificacionPedDev As String = "", Optional FacturacionCicilica As Boolean = False, Optional FacturacionCiclicaAutomatico As Boolean = False,
Optional DiaMesFacturacion As Integer = 1, Optional CvePeriodo As Integer = -1, Optional ObservacionesGenerales As String = "", Optional CveTipoAF As Integer = Nothing, Optional CveChofer As Integer = Nothing, Optional CveChofer2 As Integer = Nothing, Optional CveAF As Integer = Nothing, Optional CantidadPasajeros As Integer = Nothing, Optional CvePartida As Integer = Nothing, Optional CveDestino As Integer = Nothing, Optional CveMasivo As Integer = Nothing) As Boolean Optional DiaMesFacturacion As Integer = 1, Optional CvePeriodo As Integer = -1, Optional ObservacionesGenerales As String = "", Optional CveTipoAF As Integer = Nothing, Optional CveChofer As Integer = Nothing, Optional CveChofer2 As Integer = Nothing, Optional CveAF As Integer = Nothing, Optional CantidadPasajeros As Integer = Nothing, Optional CvePartida As Integer = Nothing, Optional CveDestino As Integer = Nothing, Optional CveMasivo As Integer = Nothing) As Boolean
@@ -450,8 +450,8 @@ Public Class ClsContratos
.Add("@CveContratoPadre", SqlDbType.Int).Value = CveContratoPadre .Add("@CveContratoPadre", SqlDbType.Int).Value = CveContratoPadre
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@EsPresupuestal", SqlDbType.Int).Value = EsPresupuestal .Add("@EsPresupuestal", SqlDbType.Bit).Value = EsPresupuestal
.Add("@CveContratoTipo", SqlDbType.SmallInt).Value = CveContratoTipo .Add("@CveContratoTipo", SqlDbType.Int).Value = CveContratoTipo
.Add("@ImporteMin", SqlDbType.Money).Value = Minimo .Add("@ImporteMin", SqlDbType.Money).Value = Minimo
.Add("@ImporteMax", SqlDbType.Money).Value = Maximo .Add("@ImporteMax", SqlDbType.Money).Value = Maximo
.Add("@Importe", SqlDbType.Money).Value = Importe .Add("@Importe", SqlDbType.Money).Value = Importe
@@ -471,7 +471,7 @@ Public Class ClsContratos
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
.Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones .Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones
.Add("@CveDireccionEnvio", SqlDbType.Int).Value = CveDireccionEnvio .Add("@CveDireccionEnvio", SqlDbType.Int).Value = CveDireccionEnvio
.Add("@AplicaImpuestosLocales", SqlDbType.Bit).Value = If(AplicaImpuestosLocales, 1, 0) .Add("@AplicaImpuestosLocales", SqlDbType.Bit).Value = AplicaImpuestosLocales
.Add("@CorreoNotificacionPedDev", SqlDbType.VarChar).Value = CorreoNotificacionPedDev .Add("@CorreoNotificacionPedDev", SqlDbType.VarChar).Value = CorreoNotificacionPedDev
.Add("@FacturacionCicilica", SqlDbType.Bit).Value = FacturacionCicilica .Add("@FacturacionCicilica", SqlDbType.Bit).Value = FacturacionCicilica
.Add("@FacturacionCiclicaAutomatico", SqlDbType.Bit).Value = FacturacionCiclicaAutomatico .Add("@FacturacionCiclicaAutomatico", SqlDbType.Bit).Value = FacturacionCiclicaAutomatico

View File

@@ -1545,7 +1545,7 @@ Public Class ClsProductosServicios
Public Function AddMarcas(Marca As String, Estatus As Boolean, CveUsuario As Integer, CveEmpresa As Integer) As Boolean Public Function AddMarcas(Marca As String, Estatus As Boolean, CveUsuario As Integer, CveEmpresa As Integer, Optional ActualizarFranquicias As Boolean = False) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Gral_MarcasAdd") DataAdapter("PA_Gral_MarcasAdd")
@@ -1555,6 +1555,7 @@ Public Class ClsProductosServicios
.Add("@Estatus", SqlDbType.Bit).Value = Estatus .Add("@Estatus", SqlDbType.Bit).Value = Estatus
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@ActualizarFranquicias", SqlDbType.Bit).Value = ActualizarFranquicias
End With End With
Try Try
@@ -1597,7 +1598,7 @@ Public Class ClsProductosServicios
Public Function UpdateMarca(Marca As String, CveMarca As Integer, Estatus As Boolean) As Boolean Public Function UpdateMarca(Marca As String, CveMarca As Integer, Estatus As Boolean, CveEmpresa As Integer, Optional ActualizarFranquicias As Boolean = False) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Gral_MarcasUpdate") DataAdapter("PA_Gral_MarcasUpdate")
@@ -1605,6 +1606,8 @@ Public Class ClsProductosServicios
.Add("@Marca", SqlDbType.VarChar).Value = Marca .Add("@Marca", SqlDbType.VarChar).Value = Marca
.Add("@CveMarca", SqlDbType.Int).Value = CveMarca .Add("@CveMarca", SqlDbType.Int).Value = CveMarca
.Add("@Estatus", SqlDbType.Bit).Value = Estatus .Add("@Estatus", SqlDbType.Bit).Value = Estatus
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@ActualizarFranquicias", SqlDbType.Bit).Value = ActualizarFranquicias
End With End With
Try Try

View File

@@ -921,7 +921,23 @@
<asp:Button runat="server" ID="btnProrateo" Visible="false" Text="Prorratear" CommandArgument="Compras" CssClass="btn btn-success" /> <asp:Button runat="server" ID="btnProrateo" Visible="false" Text="Prorratear" CommandArgument="Compras" CssClass="btn btn-success" />
<asp:Button runat="server" ID="btnProrateo2" Visible="false" Text="Prorratear Nomina" CommandArgument="Nomina" CssClass="btn btn-success" /> <asp:Button runat="server" ID="btnProrateo2" Visible="false" Text="Prorratear Nomina" CommandArgument="Nomina" CssClass="btn btn-success" />
<asp:Button runat="server" ID="BtnProrateoDeducible" Visible="false" Text="Prorratear 8.5%" CommandArgument="Prorratear Deducible" CssClass="btn btn-success" /> <asp:Button runat="server" ID="BtnProrateoDeducible" Visible="false" Text="Prorratear 8.5%" CommandArgument="Prorratear Deducible" CssClass="btn btn-success" />
</div> </div>
<asp:UpdatePanel ID="UpDVAtencionOCAnticipo" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div style="z-index: 5; position: relative;">
<div class="alert alert-danger alert-dismissable" runat="server" id="DVAtencionOCAnticipo" visible="false" style="padding: 5px; margin-bottom: 5px; padding-right: 25px;">
<button type="button" class="close" data-dismiss="alert" style="margin-top: 5px;" aria-hidden="true"></button>
<strong style="font-size: 20px; margin-right: 25px;">Atención! </strong>
El Proveedor tiene Saldo a favor pendiente por aplicar
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div> </div>
<div class="col-md-6 "> <div class="col-md-6 ">

View File

@@ -714,6 +714,18 @@ Partial Class Compras_Compras
ViewState("CveMetodoPago") = value ViewState("CveMetodoPago") = value
End Set End Set
End Property End Property
Private Property MetodoPagoOC As Integer
Get
If ViewState("MetodoPagoOC") Is Nothing Then
ViewState("MetodoPagoOC") = -1
End If
Return ViewState("MetodoPagoOC").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("MetodoPagoOC") = value
End Set
End Property
Private Property TipoCambio As Decimal Private Property TipoCambio As Decimal
Get Get
Return ViewState("TipoCambio").ToString.ToDecimal Return ViewState("TipoCambio").ToString.ToDecimal
@@ -1018,6 +1030,20 @@ Partial Class Compras_Compras
End Set End Set
End Property End Property
Private Property CveIEAnticipo As Integer
Get
If ViewState("CveIEAnticipo") Is Nothing Then
ViewState("CveIEAnticipo") = -1
End If
Return ViewState("CveIEAnticipo").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("CveIEAnticipo") = value
End Set
End Property
Public Property FechaCompraOriginal As Date Public Property FechaCompraOriginal As Date
Get Get
Return ViewState("FechaCompraOriginal").ToString.ToDate Return ViewState("FechaCompraOriginal").ToString.ToDate
@@ -3967,6 +3993,12 @@ Partial Class Compras_Compras
'------------------ INICIA VALIDACIONES ------------------ '------------------ INICIA VALIDACIONES ------------------
If MetodoPagoOC = 0 AndAlso RBLPago.SelectedValue.ToEntero <> 2 Then
Alert("La orden de compra se definió de contado, favor de especificar la compra de contado.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim CveSubProyectoPrincipal As Integer = AsignarSubProyectoPrincipal() Dim CveSubProyectoPrincipal As Integer = AsignarSubProyectoPrincipal()
If Not CveSubProyectoPrincipal > 0 Then If Not CveSubProyectoPrincipal > 0 Then
@@ -13656,6 +13688,7 @@ Partial Class Compras_Compras
CargaOC() CargaOC()
End Sub End Sub
Private Sub CargaOC() Private Sub CargaOC()
MetodoPagoOC = -1
Dim EntregaDirecta As Integer = 0 Dim EntregaDirecta As Integer = 0
DivOCSolicitudAnticipo.Visible = False DivOCSolicitudAnticipo.Visible = False
DivOCSolicitudAnticipoModal.Visible = False DivOCSolicitudAnticipoModal.Visible = False
@@ -13694,6 +13727,7 @@ Partial Class Compras_Compras
HdnVCveOC.Value += String.Format("{0}{1}", If(HdnVCveOC.Value <> "", ",", ""), OC.DtResultados.Rows(0)("CveOrdenCompra").ToString) HdnVCveOC.Value += String.Format("{0}{1}", If(HdnVCveOC.Value <> "", ",", ""), OC.DtResultados.Rows(0)("CveOrdenCompra").ToString)
HdnCveEstatusOC.Value += String.Format("{0}{1}", If(HdnCveEstatusOC.Value <> "", ",", ""), OC.DtResultados.Rows(0)("CveEstatusSiguiente").ToString) HdnCveEstatusOC.Value += String.Format("{0}{1}", If(HdnCveEstatusOC.Value <> "", ",", ""), OC.DtResultados.Rows(0)("CveEstatusSiguiente").ToString)
EntregaDirecta += If(OC.DtResultados.Rows(0)("EntregaDirecta").ToString = "True", 1, 0) EntregaDirecta += If(OC.DtResultados.Rows(0)("EntregaDirecta").ToString = "True", 1, 0)
MetodoPagoOC = OC.DtResultados.Rows(0)("MetodoPagoOC").ToString.ToEntero
End If End If
End If End If
Next Next
@@ -13709,6 +13743,7 @@ Partial Class Compras_Compras
HdnVCveOC.Value += String.Format("{0}{1}", If(HdnVCveOC.Value <> "", ",", ""), OC.DtResultados.Rows(0)("CveOrdenCompra").ToString) HdnVCveOC.Value += String.Format("{0}{1}", If(HdnVCveOC.Value <> "", ",", ""), OC.DtResultados.Rows(0)("CveOrdenCompra").ToString)
HdnCveEstatusOC.Value += String.Format("{0}{1}", If(HdnCveEstatusOC.Value <> "", ",", ""), OC.DtResultados.Rows(0)("CveEstatusSiguiente").ToString) HdnCveEstatusOC.Value += String.Format("{0}{1}", If(HdnCveEstatusOC.Value <> "", ",", ""), OC.DtResultados.Rows(0)("CveEstatusSiguiente").ToString)
EntregaDirecta += If(OC.DtResultados.Rows(0)("EntregaDirecta").ToString = "True", 1, 0) EntregaDirecta += If(OC.DtResultados.Rows(0)("EntregaDirecta").ToString = "True", 1, 0)
MetodoPagoOC = OC.DtResultados.Rows(0)("MetodoPagoOC").ToString.ToEntero
End If End If
End If End If
Next Next
@@ -13751,7 +13786,9 @@ Partial Class Compras_Compras
Protected Sub BtnVOC_Click(sender As Object, e As EventArgs) Protected Sub BtnVOC_Click(sender As Object, e As EventArgs)
VinculaOC() VinculaOC()
End Sub End Sub
Private Sub VinculaOC() Private Sub VinculaOC()
CveIEAnticipo = -1
If TxtOC.Text <> "" Then If TxtOC.Text <> "" Then
'VARIABLES 'VARIABLES
@@ -13798,6 +13835,7 @@ Partial Class Compras_Compras
If ObjOC.DtResultados.Rows(0)("CveIEAnticipo").ToString.ToEntero > 0 Then If ObjOC.DtResultados.Rows(0)("CveIEAnticipo").ToString.ToEntero > 0 Then
FoliosOCAnticipo += $"{ObjOC.DtResultados.Rows(0)("FolioOC").ToString}," FoliosOCAnticipo += $"{ObjOC.DtResultados.Rows(0)("FolioOC").ToString},"
FoliosOCAnticipoIE += $"{ObjOC.DtResultados.Rows(0)("FolioIEAnticipo").ToString}," FoliosOCAnticipoIE += $"{ObjOC.DtResultados.Rows(0)("FolioIEAnticipo").ToString},"
CveIEAnticipo = ObjOC.DtResultados.Rows(0)("CveIEAnticipo").ToString.ToEntero
DivOCSolicitudAnticipo.Visible = True DivOCSolicitudAnticipo.Visible = True
DivOCSolicitudAnticipoModal.Visible = True DivOCSolicitudAnticipoModal.Visible = True
End If End If
@@ -13889,6 +13927,9 @@ Partial Class Compras_Compras
If DivOCSolicitudAnticipo.Visible And FoliosOCAnticipo.Length > 0 Then If DivOCSolicitudAnticipo.Visible And FoliosOCAnticipo.Length > 0 Then
LtSolicitudAnticipoFoliosOC.Text = $"La(s) siguiente(s) OC: {FoliosOCAnticipo.Substring(0, FoliosOCAnticipo.Length - 1)}. tienen vinculado un anticipo" LtSolicitudAnticipoFoliosOC.Text = $"La(s) siguiente(s) OC: {FoliosOCAnticipo.Substring(0, FoliosOCAnticipo.Length - 1)}. tienen vinculado un anticipo"
LtSolicitudAnticipoFoliosIE.Text = $" {FoliosOCAnticipoIE.Substring(0, FoliosOCAnticipoIE.Length - 1)}" LtSolicitudAnticipoFoliosIE.Text = $" {FoliosOCAnticipoIE.Substring(0, FoliosOCAnticipoIE.Length - 1)}"
DVAtencionOCAnticipo.Visible = True
UpDVAtencionOCAnticipo.Update()
End If End If
'PROMOCIONES 'PROMOCIONES
@@ -14436,8 +14477,29 @@ Partial Class Compras_Compras
'ANTICIPO OC 'ANTICIPO OC
If DivOCSolicitudAnticipo.Visible Then If DivOCSolicitudAnticipo.Visible Then
If CveIEAnticipo > 0 Then
DVAtencionOCAnticipo.Visible = True
UpDVAtencionOCAnticipo.Update()
End If
Dim scripsSeccion As String = ""
For Each gvRow As GridViewRow In GVAnticipos.Rows
If gvRow.DataKey("CveIE").ToEntero = CveIEAnticipo Then
Dim Chk As CheckBox = gvRow.FCCheckBox("Chk")
scripsSeccion = scripsSeccion & $"$('#{Chk.ClientID}').click();"
'RegistraScript($"$('#{Chk.ClientID}').click();", "100")
End If
Next
RegistraScript("MuestraAnticipos();", "MuestaAnticiposOC") RegistraScript("MuestraAnticipos();", "MuestaAnticiposOC")
RegistraScript("
setTimeout(function() {
" & scripsSeccion & "
}, 200)
")
UpAnticipos.Update() UpAnticipos.Update()
End If End If
CalculaTotales() CalculaTotales()

View File

@@ -10,6 +10,7 @@ Imports iText.Barcodes.Dmcode
Imports Microsoft.Reporting.WebForms Imports Microsoft.Reporting.WebForms
Imports Modelos Imports Modelos
Imports Stimulsoft.Base.Context Imports Stimulsoft.Base.Context
Imports ZXing
Partial Class PopUpVerFactura Partial Class PopUpVerFactura
@@ -6039,6 +6040,13 @@ Partial Class PopUpVerFactura
ObjVentas.Dispose() ObjVentas.Dispose()
If DtPrecios IsNot Nothing Then If DtPrecios IsNot Nothing Then
DtPrecios.Columns.Add(New DataColumn("CBBase64", GetType(String)))
For Each Row As DataRow In DtPrecios.Rows
Row("CBBase64") = Convert.ToBase64String(GeneraCodigoQR(Row("CodigoBarras").ToString(), 40, 150, 0, "CODE_39", True))
Next
Dim DirectorioArchivo As String = "Empresas/Grales/Formatos/Etiqueta.mrt" Dim DirectorioArchivo As String = "Empresas/Grales/Formatos/Etiqueta.mrt"
If System.IO.File.Exists(UsuarioActual.Empresa.Ruta + "Formatos/Etiqueta.mrt") Then If System.IO.File.Exists(UsuarioActual.Empresa.Ruta + "Formatos/Etiqueta.mrt") Then
DirectorioArchivo = UsuarioActual.Empresa.Ruta + "Formatos/Etiqueta.mrt" DirectorioArchivo = UsuarioActual.Empresa.Ruta + "Formatos/Etiqueta.mrt"
@@ -6153,4 +6161,94 @@ Partial Class PopUpVerFactura
#End Region #End Region
Private Function GeneraCodigoQR(CodigoBarras As String, Alto As Integer, Largo As Integer, Margen As Integer, Formato As String, Optional PureBacode As Boolean = False) As Byte()
Dim barcodeWriter As New BarcodeWriter
Dim opciones As New ZXing.Common.EncodingOptions
Dim FormatoBar As New BarcodeFormat
'Dim Respuesta As Byte()
opciones.Height = Alto
opciones.Width = Largo
opciones.Margin = Margen
opciones.PureBarcode = PureBacode
barcodeWriter.Options = opciones
Select Case Formato
Case "All_1D"
barcodeWriter.Format = BarcodeFormat.All_1D
Exit Select
Case "AZTEC"
barcodeWriter.Format = BarcodeFormat.AZTEC
Exit Select
Case "CODABAR"
barcodeWriter.Format = BarcodeFormat.CODABAR
Exit Select
Case "CODE_128"
barcodeWriter.Format = BarcodeFormat.CODE_128
Exit Select
Case "CODE_39"
barcodeWriter.Format = BarcodeFormat.CODE_39
Exit Select
Case "CODE_93"
barcodeWriter.Format = BarcodeFormat.CODE_93
Exit Select
Case "DATA_MATRIX"
barcodeWriter.Format = BarcodeFormat.DATA_MATRIX
Exit Select
Case "EAN_13"
barcodeWriter.Format = BarcodeFormat.EAN_13
Exit Select
Case "EAN_8"
barcodeWriter.Format = BarcodeFormat.EAN_8
Exit Select
Case "IMB"
barcodeWriter.Format = BarcodeFormat.IMB
Exit Select
Case "ITF"
barcodeWriter.Format = BarcodeFormat.ITF
Exit Select
Case "MAXICODE"
barcodeWriter.Format = BarcodeFormat.MAXICODE
Exit Select
Case "MSI"
barcodeWriter.Format = BarcodeFormat.MSI
Exit Select
Case "PDF_417"
barcodeWriter.Format = BarcodeFormat.PDF_417
Exit Select
Case "PLESSEY"
barcodeWriter.Format = BarcodeFormat.PLESSEY
Exit Select
Case "QR_CODE"
barcodeWriter.Format = BarcodeFormat.QR_CODE
Exit Select
Case "RSS_14"
barcodeWriter.Format = BarcodeFormat.RSS_14
Exit Select
Case "RSS_EXPANDED"
barcodeWriter.Format = BarcodeFormat.RSS_EXPANDED
Exit Select
Case "UPC_A"
barcodeWriter.Format = BarcodeFormat.UPC_A
Exit Select
Case "UPC_E"
barcodeWriter.Format = BarcodeFormat.UPC_E
Exit Select
Case "UPC_EAN_EXTENSION"
barcodeWriter.Format = BarcodeFormat.UPC_EAN_EXTENSION
Exit Select
End Select
Dim imgCod As Drawing.Bitmap = barcodeWriter.Write(CodigoBarras)
Dim memoriStream As New System.IO.MemoryStream
imgCod.Save(memoriStream, Drawing.Imaging.ImageFormat.Bmp)
'Respuesta = Convert.ToBase64String(memoriStream.ToArray())
Return memoriStream.ToArray()
End Function
End Class End Class

View File

@@ -62,23 +62,42 @@ Partial Class General_CatMarcas
Dim ObjPS As New ClsProductosServicios Dim ObjPS As New ClsProductosServicios
Dim CveMarca = gvRow.DataKey("CveMarca").ToEntero Dim CveMarca = gvRow.DataKey("CveMarca").ToEntero
If ObjPS.RemoveMarca(CveMarca) Then If ObjPS.RemoveMarca(CveMarca) Then
Alert("Se borró correctamente de la base de Datos.", TipoMensaje.MsgInformacion) Alert("Se borró correctamente de la base de Datos.", TipoMensaje.MsgInformacion)
Else Else
Alert("La marca esta siendo utilizada por un Producto", TipoMensaje.MsgError) Alert("La marca esta siendo utilizada por un Producto", TipoMensaje.MsgError)
End If End If
ObjPS.Dispose()
CargaDatos()
End Sub
Protected Sub LnkAgregarMarca_Click(sender As Object, e As EventArgs)
LimpiaModal()
Modalidad = "A"
BtnGuardar.Text = "Agregar"
DivEstatus.Visible = False
UpModal.Update()
RegistraScript("$('#DModalMarca').modal()")
ObjPS.Dispose() ObjPS.Dispose()
CargaDatos()
End Sub
Protected Sub LnkAgregarMarca_Click(sender As Object, e As EventArgs)
LimpiaModal()
Modalidad = "A"
BtnGuardar.Text = "Agregar"
DivEstatus.Visible = False
UpModal.Update()
RegistraScript("$('#DModalMarca').modal()")
End Sub
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs)
Dim ActualizarFranquicias As Boolean = False
If UsuarioActual.Empresa.Funcionalidad(563) <> "" AndAlso UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
ActualizarFranquicias = True
End If
Dim ObjPS As New ClsProductosServicios
ObjPS.IniciaTransacSQL()
Dim TieneError As Boolean = False
Try
If Modalidad = "A" Then
If Not ObjPS.AddMarcas(TxtMarca.Text, True, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, ActualizarFranquicias:=ActualizarFranquicias) Then
TieneError = True TieneError = True
End If
ElseIf Modalidad = "U" Then
If Not ObjPS.UpdateMarca(TxtMarca.Text, CveMarca, ChkEstatus.Checked, UsuarioActual.CveEmpresa, ActualizarFranquicias:=ActualizarFranquicias) Then
TieneError = True
End If
End If End If
Catch ex As Exception Catch ex As Exception
TieneError = True TieneError = True

View File

@@ -2502,7 +2502,8 @@ Partial Class General_SaldosIniciales
For Each nuevaEntrada As DataRow In dt.FiltraParametros($"TRIM(Almacen) = '{almacenActual}'").Rows For Each nuevaEntrada As DataRow In dt.FiltraParametros($"TRIM(Almacen) = '{almacenActual}'").Rows
contadorMovimientos += 1 contadorMovimientos += 1
Dim RowPS As DataRow = ProductosServiciosRef.FiltroPrimero($"Codigo = '{nuevaEntrada("CodigoPS")}' ") 'Dim RowPS As DataRow = ProductosServiciosRef.FiltroPrimero($"Codigo = '{nuevaEntrada("CodigoPS").ToString.Trim}' ")
Dim RowPS As DataRow = ProductosServiciosRef.FiltroPrimero($"Codigo = '{nuevaEntrada("CodigoPS").ToString.Trim(" "c)}' ")
If RowPS IsNot Nothing Then If RowPS IsNot Nothing Then
Dim CvePS As Integer = RowPS("CvePS").ToString().ToEntero() Dim CvePS As Integer = RowPS("CvePS").ToString().ToEntero()

View File

@@ -4398,7 +4398,7 @@ Partial Class Inventarios_EntradasSalidas
If Valido Then If Valido Then
Dim CveClasificacion As Integer Dim CveClasificacion As Integer
Dim CveUM As Double Dim CveUM As Integer
Dim CodigoPS As String = "" Dim CodigoPS As String = ""
Dim PS As String = "" Dim PS As String = ""
@@ -4415,6 +4415,14 @@ Partial Class Inventarios_EntradasSalidas
PS = dr("PS").ToString.ToString PS = dr("PS").ToString.ToString
End If End If
Dim CantidadExistencia = GetExistencias(CvePS, CveUM, UsuarioActual.CveEmpresa, DdlAlmacenCambioVigencias.SelectedValue.ToEntero, CveSeccionAlmacen, Serie, Lote, Caducidad.ToDateTime())
If Cantidad > CantidadExistencia Then
Dim msg = $"El producto {PS} no tiene existencia. " + If(Serie.Length > 0, $"Serie: {Serie} ", "") + If(Lote.Length > 0, $"Lote: {Lote} ", "") + If(Caducidad.ToDateTime() > MinFecha, $"Caducidad: {Caducidad} ", "")
Alert(msg, TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim registro As DataRow = DtMovimientosCambioVigencias.NewRow Dim registro As DataRow = DtMovimientosCambioVigencias.NewRow
registro.Item("Cantidad") = Cantidad registro.Item("Cantidad") = Cantidad
registro.Item("CveUM") = CveUM registro.Item("CveUM") = CveUM

View File

@@ -455,7 +455,7 @@
<tr id="TrMetodoPago" runat="server" visible="false"> <tr id="TrMetodoPago" runat="server" visible="false">
<td><b>Método de pago:</b></td> <td><b>Método de pago:</b></td>
<td> <td>
<asp:DropDownList ID="DdlMetodoPago" CssClass="form-control select2me" runat="server" Width="100%" CausesValidation="true"> <asp:DropDownList ID="DdlMetodoPago" CssClass="form-control select2me" runat="server" Width="100%" CausesValidation="true" AutoPostBack="true" OnSelectedIndexChanged="DdlMetodoPago_SelectedIndexChanged">
<asp:ListItem Text="-" Value="-1"></asp:ListItem> <asp:ListItem Text="-" Value="-1"></asp:ListItem>
<asp:ListItem Text="Contado" Value="0"></asp:ListItem> <asp:ListItem Text="Contado" Value="0"></asp:ListItem>
<asp:ListItem Text="Crédito" Value="1"></asp:ListItem> <asp:ListItem Text="Crédito" Value="1"></asp:ListItem>
@@ -1563,6 +1563,89 @@
<br /> <br />
<div class="row"> <div class="row">
<asp:UpdatePanel runat="server" ID="UpPanelDVAnticiposContado" class="portlet-body form" UpdateMode="Conditional">
<ContentTemplate>
<div class="col-md-3" runat="server" id="DVAnticposContado" visible="false">
<div class="portlet light xspadding bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Anticipos </span>
</div>
<div class="tools">
<a href="javascript;" class="expand" data-original-title="" title=""></a>
</div>
</div>
<div class="portlet-body">
<div class="row ">
<label class="col-md-3">Porcentaje:</label>
<div class="col-md-9 form-group">
<div class="input-group" style="max-width:150px">
<asp:TextBox ID="TxtSAImPorcentajeContado" min="0" max="100" CssClass="form-control input-sm" runat="server" onkeyup="SAImPorcentajeContadokeyup()" ClientIDMode="Static" ></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVSAImPorcentajeContado" runat="server" ControlToValidate="TxtSAImPorcentajeContado" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Porcentaje''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCESAImPorcentajeContado" runat="server" Enabled="True" HighlightCssClass="vco" TargetControlID="RFVSAImPorcentajeContado" Width="300px"></ajax:ValidatorCalloutExtender>
<ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtSAImPorcentajeContado" ValidChars="1234567890." />
<span class="input-group-addon">
<i style="font-weight: 700;">%</i>
</span>
</div>
</div>
</div>
<div class="row ">
<label class="col-md-3">Importe:</label>
<div class="col-md-9 form-group">
<div class="input-group" style="max-width:150px">
<asp:TextBox ID="TxtSAImporteContado" min="0" max='<%=LblTotal.Text.ToString()%>' CssClass="form-control input-sm" runat="server" onkeyup="SAImporteContadokeyup()" ClientIDMode="Static" ></asp:TextBox>
<asp:RangeValidator ID="RVSAImporteContado" CssClass="form-control" runat="server" ControlToValidate="TxtSAImporteContado" Display="None" Type="Double" MinimumValue="1.00" MaximumValue="2147483647" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Importe''</b> debe ser mayor a cero." ValidationGroup="GrpGuardar"></asp:RangeValidator>
<ajax:ValidatorCalloutExtender ID="VCESAImporteContado" runat="server" HighlightCssClass="vco" TargetControlID="RVSAImporteContado" Width="300px"></ajax:ValidatorCalloutExtender>
<ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtSAImporteContado" ValidChars="1234567890." />
<span class="input-group-addon">
<i style="font-weight: 700;">$</i>
</span>
<div class="input-group" style="text-align: right!important">
<asp:Label runat="server" ID="LblSaldoOCAnticipoContado"></asp:Label>
</div>
</div>
</div>
</div>
<div class="row">
<label class="col-md-3">Solicitar a:</label>
<div class="col-md-9">
<asp:DropDownList ID="DdlSAUsuarioContado" CssClass="form-control input-sm select2me" DataTextField="Nombre" DataValueField="CveUsuario" runat="server" Width="100%"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVSAUsuarioContado" runat="server" InitialValue="-1" ControlToValidate="DdlSAUsuarioContado" 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="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCESAUsuarioContado" runat="server" HighlightCssClass="vco" TargetControlID="RFVSAUsuarioContado" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
</div><br />
<div class="row">
<label class="col-md-3">Observaciones:</label>
<div class="col-md-9">
<asp:TextBox ID="TxtSAObservacionesContado" CssClass="form-control input-sm" runat="server" Style="width: 100%; height: 40px;" ValidationGroup="GrpGuardar" TextMode="MultiLine" Rows="5" />
</div>
</div>
</div>
<div class="portlet-footer">
<%--<button id="CancelarSolicitarAnticipoContado" type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
<asp:Button Text="Guardar" ID="BtnSolicitarAnticipoContado" CssClass="btn btn-primary" ValidationGroup="GrpGuardar" runat="server" />--%>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<div class="col-md-3"> <div class="col-md-3">
<div class="portlet light xspadding bordered"> <div class="portlet light xspadding bordered">
@@ -2912,10 +2995,34 @@
$('#<%= TxtSAImPorcentaje.ClientID%>').val(FormatoNumero(importe, 2).replace(/,/g, "")); $('#<%= TxtSAImPorcentaje.ClientID%>').val(FormatoNumero(importe, 2).replace(/,/g, ""));
}); });
<%--$('#<%= TxtSAImPorcentajeContado.ClientID%>').keyup(function () {
console.log($(this).val());
var importe = (ToDouble($(this).val()) / 100) * ToDouble($get("LblTotal").value.replace(/,/g, ''));
$('#<%= TxtSAImporteContado.ClientID%>').val( FormatoNumero(importe, 2).replace(/,/g, "") );
});
$('#<%= TxtSAImporteContado.ClientID%>').keyup(function () {
var importe = (100 * ToDouble($(this).val())) / ToDouble($get("LblTotal").value.replace(/,/g, ""));
$('#<%= TxtSAImPorcentajeContado.ClientID%>').val(FormatoNumero(importe, 2).replace(/,/g, ""));
});--%>
$get('HdnWidth').value = $("#DivConceptosContenido").width(); $get('HdnWidth').value = $("#DivConceptosContenido").width();
}); });
function SAImPorcentajeContadokeyup() {
var importe = (ToDouble($('#TxtSAImPorcentajeContado').val()) / 100) * ToDouble($get("LblTotal").value.replace(/,/g, ''));
$('#TxtSAImporteContado').val(FormatoNumero(importe, 2).replace(/,/g, ""));
}
function SAImporteContadokeyup() {
var importe = (100 * ToDouble($('#TxtSAImporteContado').val())) / ToDouble($get("LblTotal").value.replace(/,/g, ""));
$('#TxtSAImPorcentajeContado').val(FormatoNumero(importe, 2).replace(/,/g, ""));
}
function showDivEC(CveCotizacion) { function showDivEC(CveCotizacion) {
$('#<%=TxtMotivoEliminacion.ClientID%>').val(""); $('#<%=TxtMotivoEliminacion.ClientID%>').val("");
$('#divEliminarCotizacion').modal(); $('#divEliminarCotizacion').modal();

View File

@@ -2,6 +2,7 @@
Option Strict On Option Strict On
Imports System.Data Imports System.Data
Imports System.Data.SqlClient
Imports System.IO Imports System.IO
Imports Extensiones Imports Extensiones
Imports GemBox.Spreadsheet Imports GemBox.Spreadsheet
@@ -2820,6 +2821,15 @@ Partial Class OC_OC
End If End If
If Not TieneError AndAlso DdlMetodoPago.SelectedValue.ToEntero = 0 AndAlso TipoOC = "OC" Then
If Not GeneraAnticpoContado(CveOrdenCompra, OC.IniciaTransacSQL()) Then
TieneError = True
End If
End If
If Not TieneError Then If Not TieneError Then
If Conta IsNot Nothing Then Conta.Commit() If Conta IsNot Nothing Then Conta.Commit()
OC.Commit() OC.Commit()
@@ -3207,6 +3217,15 @@ Partial Class OC_OC
'If Not TieneError AndAlso DdlMetodoPago.SelectedValue.ToEntero = 0 AndAlso TipoOC = "OC" Then
' If Not GeneraAnticpoContado(CveOrdenCompra, OC.IniciaTransacSQL()) Then
' TieneError = True
' End If
'End If
'COMMIT 'COMMIT
If Not TieneError Then If Not TieneError Then
'If MonedaTexto <> DdlMoneda.SelectedItem.Text Then 'If MonedaTexto <> DdlMoneda.SelectedItem.Text Then
@@ -3258,6 +3277,9 @@ Partial Class OC_OC
End If End If
End If End If
'TERMINA TODO POR SI OCURRIÓ ALGO RARO 'TERMINA TODO POR SI OCURRIÓ ALGO RARO
If TieneError Then If TieneError Then
If OC IsNot Nothing Then OC.RollBack() If OC IsNot Nothing Then OC.RollBack()
@@ -5377,12 +5399,24 @@ Partial Class OC_OC
End If End If
End Sub End Sub
Private Sub EnviaCorreoSolicitudAnticipo(CveEvento As Integer) Private Sub EnviaCorreoSolicitudAnticipo(CveEvento As Integer, Optional ImporteAnticipo As Decimal = 0)
Dim Param As New List(Of String) Dim Param As New List(Of String)
Dim DtPara As DataTable = GlobalDTUsuarios(DdlSAUsuario.SelectedValue.ToString.ToEntero, CveEmpresaActual) Dim DtPara As DataTable = GlobalDTUsuarios(DdlSAUsuario.SelectedValue.ToString.ToEntero, CveEmpresaActual)
If DdlMetodoPago.SelectedValue.ToEntero = 0 Then
DtPara = GlobalDTUsuarios(DdlSAUsuarioContado.SelectedValue.ToString.ToEntero, CveEmpresaActual)
End If
Param.Add(DtPara.Rows(0)("Correo").ToString()) 'Para Param.Add(DtPara.Rows(0)("Correo").ToString()) 'Para
Param.Add("Solicitud de anticipo de Orden de Compra") 'Asunto Param.Add("Solicitud de anticipo de Orden de Compra") 'Asunto
Param.Add(GeneraCorreoAnticipo(lblFolio.Text, DtPara.Rows(0)("Nombre").ToString(), String.Format("http://sig.adssistemas.mx/OI/EventoDetalle.aspx?CveTipoEvento=1&CveEvento={0}", CveEvento), TxtSAImporte.Text, DdlProveedores.SelectedText))
If ImporteAnticipo = 0 Then
ImporteAnticipo = TxtSAImporte.Text.ToDecimal
End If
Param.Add(GeneraCorreoAnticipo(lblFolio.Text, DtPara.Rows(0)("Nombre").ToString(), String.Format("http://sig.adssistemas.mx/OI/EventoDetalle.aspx?CveTipoEvento=1&CveEvento={0}", CveEvento), ImporteAnticipo.ToString, DdlProveedores.SelectedText))
Param.Add(String.Format("{0}PDF\OC-{1}.pdf", UsuarioActual.Empresa.Ruta, CveOrdenCompra)) Param.Add(String.Format("{0}PDF\OC-{1}.pdf", UsuarioActual.Empresa.Ruta, CveOrdenCompra))
Dim Hilo As New Threading.Thread(AddressOf MandaCorreoAnticipo) Dim Hilo As New Threading.Thread(AddressOf MandaCorreoAnticipo)
Hilo.Start(Param) Hilo.Start(Param)
@@ -8846,4 +8880,80 @@ Partial Class OC_OC
End Sub End Sub
Protected Sub DdlMetodoPago_SelectedIndexChanged(sender As Object, e As EventArgs)
DVAnticposContado.Visible = False
If DdlMetodoPago.SelectedValue.ToEntero = 0 Then
DVAnticposContado.Visible = True
DdlSAUsuarioContado.DataSource = GlobalDTUsuarios(-1, CveEmpresaActual).FiltraParametros("CvePlataforma = 1", "Nombre")
DdlSAUsuarioContado.DataBind()
DdlSAUsuarioContado.Items.Insert(0, New ListItem("Seleccione", "-1"))
'CargaAnticiposSolicitudesContado()
End If
UpPanelDVAnticiposContado.Update()
End Sub
Protected Function GeneraAnticpoContado(CveOrdenCompraContado As Integer, ByRef transaccionSql As SqlTransaction) As Boolean
Dim respuesta As Boolean = False
If TxtSAImporteContado.Text.ToDecimal > LblTotal.Text.ToDecimal Then
Alert("El importe solicitado supera el saldo de la orden de compra", TipoMensaje.MsgAdvertencia)
Return False
End If
Dim Descripcion As New StringBuilder
Descripcion.AppendFormat("Importe anticipo : ${0} ({1}%) - <a target=""_blank"" href=""/Bancos/IE.aspx?Opcion=EGSSINFACT&CveOC={2}"">Pagar anticipo</a> - <b>Observacion:</b> {2} ", TxtSAImporteContado.Text.FormatoNumero, TxtSAImPorcentajeContado.Text, CveOrdenCompraContado, TxtSAObservacionesContado.Text)
Descripcion.AppendFormat("Orden de compra : {0} - <a target=""_blank"" href=""/OC/OC.aspx?OC={1}"">Ir a la orden de compra</a> - <a target=""_blank"" href=""/Compras/PopUpVerFactura.aspx?P={2}"">Imprimir OC</a>", Folio, CveOrdenCompraContado, Encripta(String.Format("OP=OC&CVEOC={0}", CveOrdenCompraContado)))
Dim Asunto As String = $"{lblFolio.Text} - Solicitud de anticipo "
Dim ObjOC As New ClsOC(transaccionSql)
Dim ObjOI As New ClsOIEventos(ObjOC.IniciaTransacSQL)
Dim TieneError As Boolean = False
If ObjOI.AddEventoTarea(Asunto, Descripcion.ToString, 1, UsuarioActual.CveUsuario, DdlSAUsuarioContado.SelectedValue.ToString.ToEntero, NowADS(), NowADS().AddMinutes(15), -1, 1, -1, "-1", -1, -1, -1, -1, -1, CveOrdenCompraContado.ToEntero, -1, -1, UsuarioActual.CveUsuario, -1, CveEmpresaActual) Then
If Not ObjOC.AddSolicitudAnticipo(CveOrdenCompraContado, TxtSAImporteContado.Text.ToDecimal, CveEmpresaActual) Then
TieneError = True
End If
Else
TieneError = True
End If
If Not ObjOI.AddEventoBitacora($"Solicitud de anticipo de orden de compra por ${TxtSAImporteContado.Text.FormatoNumero}", "-1", UsuarioActual.CveUsuario, CveEmpresaActual, CveOC:=CveOrdenCompraContado) Then
TieneError = True
End If
If Not TieneError Then
EnviaCorreoSolicitudAnticipo(ObjOI.CveEvento, TxtSAImporteContado.Text.ToDecimal)
'LIMPIA
DdlSAUsuarioContado.SelectedValue = "-1"
TxtSAImporteContado.Text = ""
TxtSAObservacionesContado.Text = ""
TxtSAImPorcentajeContado.Text = ""
Alert("La solicitud de anticipo ha sido enviada correctamente.", TipoMensaje.MsgInformacion)
Else
Alert("Ocurrió un error al hacer la solicitud de anticipo.", TipoMensaje.MsgError)
End If
If TieneError Then
respuesta = False
Else
respuesta = True
End If
Return respuesta
End Function
End Class End Class

View File

@@ -114,7 +114,7 @@
<div class="portlet-body rowpadding"> <div class="portlet-body rowpadding">
<div class="row my-1"> <div class="row my-1">
<label class="col-md-4 bold text-primary">Folio</label> <label class="col-md-4 bold text-primary">Folio</label>
<asp:Label class="col-md-8" runat="server" ID="LbFolio" Text="Folio"></asp:Label> <asp:Label class="col-md-8" runat="server" ID="LbFolio" Text=""></asp:Label>
<asp:Label runat="server" ID="LbCveSubProyecto" Visible="false"></asp:Label> <asp:Label runat="server" ID="LbCveSubProyecto" Visible="false"></asp:Label>
</div> </div>
@@ -273,16 +273,26 @@
</div> </div>
<div class="portlet-body rowpadding"> <div class="portlet-body rowpadding">
<asp:LinkButton runat="server" ID="BtnDescargar" class="btn btn-warning" OnClick="DescargarArchivo" <div class="row">
Visible="false"><i class='fa fa-download' ></i>Descargar</asp:LinkButton> <div class="col-md-12" style="text-align: center;">
<asp:TextBox Style="display: none" ID="TxtArchivo" ClientIDMode="Static" runat="server" <asp:UpdatePanel ID="UPAFUL" runat="server" UpdateMode="Conditional">
Width="200px"></asp:TextBox>
<asp:Label ID="LbArchivo" ClientIDMode="Static" runat="server" Visible="false" <ContentTemplate>
Width="200px"></asp:Label> <asp:LinkButton runat="server" ID="BtnDescargar" class="btn btn-warning" Visible="false"><i class='fa fa-download' aria-hidden='true'></i> Descargar</asp:LinkButton>
<button type="button" class="btn btn-primary" runat="server" clientidmode="Static" <asp:TextBox Style="display: none" ID="TxtArchivo" ClientIDMode="Static" runat="server"
id="Button1" data-toggle="modal" data-target="#ModalUpload" visible="true"> Width="200px"></asp:TextBox>
<i class="fa fa-upload"
aria-hidden="true"></i>Subir Archivo</button> <button type="button" class="btn btn-primary" runat="server" clientidmode="Static"
id="Button1" data-toggle="modal" data-target="#ModalUpload" visible="true"><i class="fa fa-upload"
aria-hidden="true"></i>Subir Archivo</button>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="BtnDescargar" />
</Triggers>
</asp:UpdatePanel>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
@@ -303,7 +313,8 @@
<ContentTemplate> <ContentTemplate>
<asp:GridView ID="GvViajesPasajeros" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontró ningún boleto registrado" <asp:GridView ID="GvViajesPasajeros" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontró ningún boleto registrado"
CssClass="table table-striped table-hover Widthall ScrollAD mysmallbtn" GridLines="None" CssClass="table table-striped table-hover Widthall ScrollAD mysmallbtn" GridLines="None"
data-sort="true" DataKeyNames="CveViajePasajero, CveViaje, CveDestinoFinal, CveVendedor, Importe, Asiento, Nombre, Visa, Celular, Observacion, Estatus, CveUsuario, FechaIng, Sexo, Partida, Destino, Vendedor"> data-sort="true" DataKeyNames="CveViajePasajero, CveViaje, CveDestinoFinal, CveVendedor, Importe, Asiento, Nombre, Visa, Celular, Observacion, Estatus, CveUsuario, FechaIng, Sexo, Partida, Destino, Vendedor, Agencia, TelefonoAgencia"
OnRowDataBound="GvViajesPasajeros_RowDataBound">
<Columns> <Columns>
<asp:TemplateField HeaderText="No. Asiento"> <asp:TemplateField HeaderText="No. Asiento">
<ItemTemplate> <ItemTemplate>
@@ -400,7 +411,7 @@
<div class="row"> <div class="row">
<%-- Datos del Boleto --%> <%-- Datos del Boleto --%>
<div class="col-md-8"> <div class="col-md-8">
<asp:Panel runat="server" ID="PnEditarViaje" Visible="false"> <asp:Panel runat="server" ID="PnEditarViaje" Visible="true">
<div class="row margin-bottom-5"> <div class="row margin-bottom-5">
<label class="col-md-4 bold">Ruta</label> <label class="col-md-4 bold">Ruta</label>
<div class="col-md-8"> <div class="col-md-8">
@@ -851,9 +862,10 @@
<div class="modal-footer"> <div class="modal-footer">
<asp:UpdatePanel runat="server"> <asp:UpdatePanel runat="server">
<ContentTemplate> <ContentTemplate>
<asp:Button runat="server" ClientIDMode="Static" Text="Guardar" CssClass="btn btn-primary" <asp:Button ID="BtnGuardarArchivo" runat="server" ClientIDMode="Static" Text="Guardar"
OnClick="GuardarArchivo" /> CssClass="btn btn-primary" />
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button> <button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
</div> </div>

View File

@@ -16,6 +16,14 @@ Partial Class RepContratoDetalle
ViewState("CveContrato") = value ViewState("CveContrato") = value
End Set End Set
End Property End Property
Private Property ArchivoUpdate As String
Get
Return ViewState("ArchivoUpdate").ToString
End Get
Set(value As String)
ViewState("ArchivoUpdate") = value
End Set
End Property
Private Property CveContratoTipo As Integer Private Property CveContratoTipo As Integer
Get Get
Return CType(ViewState("CveContratoTipo"), Integer) Return CType(ViewState("CveContratoTipo"), Integer)
@@ -24,6 +32,14 @@ Partial Class RepContratoDetalle
ViewState("CveContratoTipo") = value ViewState("CveContratoTipo") = value
End Set End Set
End Property End Property
Private Property CveContratoEstatus As Integer
Get
Return CType(ViewState("CveContratoEstatus"), Integer)
End Get
Set(value As Integer)
ViewState("CveContratoEstatus") = value
End Set
End Property
Private Property CveMasivo As Integer Private Property CveMasivo As Integer
Get Get
Return CType(ViewState("CveMasivo"), Integer) Return CType(ViewState("CveMasivo"), Integer)
@@ -85,6 +101,8 @@ Partial Class RepContratoDetalle
CargaDatos() CargaDatos()
AsientoSeleccionado = "" AsientoSeleccionado = ""
CveViajePasajero = 0 CveViajePasajero = 0
Session("FileExtension") = ""
ArchivoUpdate = ""
End If End If
End Sub End Sub
@@ -92,7 +110,7 @@ Partial Class RepContratoDetalle
'Lista Tipo AF 'Lista Tipo AF
DdlTipoAF.DataSource = GlobalDTTipoActivoFijo(UsuarioActual.CveEmpresa) DdlTipoAF.DataSource = GlobalDTTipoActivoFijo(UsuarioActual.CveEmpresa)
DdlTipoAF.DataBind() DdlTipoAF.DataBind()
DdlTipoAF.Items.Insert(0, New ListItem("-", "")) DdlTipoAF.Items.Insert(0, New ListItem("-", "0"))
End Sub End Sub
Private Sub CargaDatos() Private Sub CargaDatos()
'Información General 'Información General
@@ -117,11 +135,14 @@ Partial Class RepContratoDetalle
TxtDolares.Text = Contrato.Rows(0)("Importe").ToString TxtDolares.Text = Contrato.Rows(0)("Importe").ToString
TxtPesos.Text = Contrato.Rows(0)("ImporteMax").ToString TxtPesos.Text = Contrato.Rows(0)("ImporteMax").ToString
TxtAnticipo.Text = Contrato.Rows(0)("ImporteMin").ToString TxtAnticipo.Text = Contrato.Rows(0)("ImporteMin").ToString
If Not String.IsNullOrEmpty(Contrato.Rows(0)("Archivo").ToString) Then CveContratoEstatus = Contrato.Rows(0)("CveContratosEstatus").ToString.ToEntero
BtnDescargar.Visible = True If Not IsDBNull(ObjContratos.Archivo) AndAlso ObjContratos.Archivo <> "" AndAlso ObjContratos.Archivo <> "-1" AndAlso ObjContratos.Archivo <> $"{ObjContratos.CveContrato}." Then
LbArchivo.Text = Contrato.Rows(0)("Archivo").ToString
LbArchivo.Visible = True
ViewState("FUrl") = Path.Combine(UsuarioActual.Empresa.Ruta, "CONTRATOS", ObjContratos.Archivo) ViewState("FUrl") = Path.Combine(UsuarioActual.Empresa.Ruta, "CONTRATOS", ObjContratos.Archivo)
'A2.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=CONTRATO&CveEmpresa={0}&Archivo={1}", ObjContratos.CveEmpresa, ViewState("FUrl").ToString)))
BtnDescargar.Visible = True
Else
BtnDescargar.Visible = False
A1.Visible = True
End If End If
'Boletos Vendidos 'Boletos Vendidos
If Contrato.Rows(0)("CveContratoTipo").ToString() = "35" Then If Contrato.Rows(0)("CveContratoTipo").ToString() = "35" Then
@@ -141,12 +162,13 @@ Partial Class RepContratoDetalle
Response.Redirect($"~/Transportes/RepContratos.aspx") Response.Redirect($"~/Transportes/RepContratos.aspx")
End If End If
ObjContratos.Dispose() ObjContratos.Dispose()
UpTabContainer.Update()
End Sub End Sub
#End Region #End Region
#Region "Información General" #Region "Información General"
Protected Sub GuardarArchivo(sender As Object, e As EventArgs) Protected Sub BtnGuardarArchivo_Click1(sender As Object, e As EventArgs) Handles BtnGuardarArchivo.Click
Dim FileExtension As String = "-1" Dim FileExtension As String = "-1"
Dim Filesgral As List(Of Archivo) = Anexo.getfiles().Archivos Dim Filesgral As List(Of Archivo) = Anexo.getfiles().Archivos
Dim Filename As String = "" Dim Filename As String = ""
@@ -162,7 +184,7 @@ Partial Class RepContratoDetalle
For Each fileItem As Archivo In Filesgral For Each fileItem As Archivo In Filesgral
FileExtension = IO.Path.GetExtension($"{AppDomain.CurrentDomain.BaseDirectory}Temp\{fileItem.filename}").Replace(".", "") FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "")
Session("FileExtension") = FileExtension Session("FileExtension") = FileExtension
Dim tempArray() As String Dim tempArray() As String
tempArray = fileItem.filename.ToString().Split("-".ToCharArray()) tempArray = fileItem.filename.ToString().Split("-".ToCharArray())
@@ -177,15 +199,18 @@ Partial Class RepContratoDetalle
'ImgArchivo.Src = "/imagenes/accept.png" 'ImgArchivo.Src = "/imagenes/accept.png"
Next Next
UpTabContainer.Update() UPAFUL.Update()
RegistraScript("$('#ModalUpload').modal('hide')", "hidemodal1") RegistraScript("$('#ModalUpload').modal('hide')", "hidemodal1")
Button1.Visible = True A1.Visible = True
If Not FileExtension = "-1" Then If Not FileExtension = "-1" Then
BtnDescargar.Visible = True BtnDescargar.Visible = True
End If End If
UpdateContrato(sender, e)
End Sub End Sub
Protected Sub DescargarArchivo(sender As Object, e As EventArgs) Private Sub BtnDescargar_Click(sender As Object, e As EventArgs) Handles BtnDescargar.Click
DescargarArchivo()
End Sub
Private Sub DescargarArchivo()
Dim File As New FileInfo(ViewState("FUrl").ToString) Dim File As New FileInfo(ViewState("FUrl").ToString)
If File.Exists Then 'set appropriate headers If File.Exists Then 'set appropriate headers
@@ -209,18 +234,25 @@ Partial Class RepContratoDetalle
End If 'nothing in the URL as HTTP GET End If 'nothing in the URL as HTTP GET
End Sub End Sub
Protected Sub UpdateContrato(sender As Object, e As EventArgs) Protected Sub UpdateContrato(sender As Object, e As EventArgs)
Dim ArchivoUpdate As String = "-1"
If Session("FileExtension").ToString <> "" Then
ArchivoUpdate = "." & Session("FileExtension").ToString
Else
End If
Dim ObjContratos As New ClsContratos Dim ObjContratos As New ClsContratos
ObjContratos.IniciaTransacSQL()
Try Try
If ObjContratos.UpdateContratos(CveContrato, LbFolio.Text, TxtDescripcion.Text, "", -1, DdlClientes.SelectedValue.ToEntero, -1, TxtFechaSalida.Text.ToDate, TxtFechaRegreso.Text.ToDate, TxtUbicacion.Text, "", LbCveSubProyecto.Text.ToEntero, -1, -1, -1, -1, LbArchivo.Text, "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, TxtAnticipo.Text.ToDecimal, TxtPesos.Text.ToDecimal, TxtDolares.Text.ToDecimal, -1, -1) Then 'ObjContratos.AddContratos(LbFolio.Text, TxtDescripcion.Text, "", UsuarioActual.CveProveedor, DdlClientes.SelectedValue.ToEntero, -1, TxtFechaSalida.Text.ToDate, TxtFechaRegreso.Text.ToDate, TxtUbicacion.Text, "", 10, -1, -1, -1, -1, LbArchivo.Text, "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, TxtAnticipo.Text.ToDecimal, TxtPesos.Text.ToDecimal, TxtDolares.Text.ToDecimal, DdlMoneda.SelectedValue.ToEntero, 0, CveContratoTipo:=34, CveContratosEstatus:=50, CveTipoAF:=DdlTipoAF.SelectedValue.ToEntero, CantidadPasajeros:=TxtCantidadPasajeros.Text.ToEntero, Observaciones:=TxtObservaciones.Text)
If ObjContratos.UpdateContratos(CveContrato, LbFolio.Text, TxtDescripcion.Text, "", UsuarioActual.CveProveedor, DdlClientes.SelectedValue.ToEntero, -1, TxtFechaSalida.Text.ToDate, TxtFechaRegreso.Text.ToDate, TxtUbicacion.Text, "", LbCveSubProyecto.Text.ToEntero, -1, -1, -1, -1, ArchivoUpdate, "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, TxtAnticipo.Text.ToDecimal, TxtPesos.Text.ToDecimal, TxtDolares.Text.ToDecimal, -1, 0, CveContratoTipo:=CveContratoTipo, CveTipoAF:=DdlTipoAF.SelectedValue.ToEntero, CveContratosEstatus:=CveContratoEstatus) Then
Alert("Contrato actualizado correctamente") Alert("Contrato actualizado correctamente")
End If End If
ObjContratos.Commit() ObjContratos.Commit()
Catch ex As Exception Catch ex As Exception
Alert($"Ocurrió un ocurrió un error al actualizar su boleto", TipoMensaje.MsgError) Alert("Ocurrió un ocurrió un error al actualizar su boleto", TipoMensaje.MsgError)
ObjContratos.RollBack() ObjContratos.RollBack()
Finally Finally
Alert("Contrato actualizado correctamente")
ObjContratos.Dispose() ObjContratos.Dispose()
CargaDatos() CargaDatos()
End Try End Try
@@ -267,7 +299,7 @@ Partial Class RepContratoDetalle
AsientoSeleccionado = buttonID AsientoSeleccionado = buttonID
TxtAsiento.Text = buttonID.Substring(1) TxtAsiento.Text = buttonID.Substring(1)
UpBoletos.Update() UpTabContainer.Update()
RegistraScript(String.Format("$('#{0}').modal('show');", "ModalEditar")) RegistraScript(String.Format("$('#{0}').modal('show');", "ModalEditar"))
End Sub End Sub
Protected Sub UpdateBoleto(sender As Object, e As EventArgs) Protected Sub UpdateBoleto(sender As Object, e As EventArgs)
@@ -292,8 +324,12 @@ Partial Class RepContratoDetalle
Finally Finally
Alert("Su asiento fue actualizado correctamente") Alert("Su asiento fue actualizado correctamente")
ObjTransportes.Dispose() ObjTransportes.Dispose()
CargaDatos()
End Try End Try
RegistraScript(String.Format("$('#{0}').modal('hide');", "ModalEditar"))
UpTabContainer.Update()
UpPasajeros.Update()
CargaDatos()
End Sub End Sub
Protected Sub OnChangeRuta(sender As Object, e As EventArgs) Protected Sub OnChangeRuta(sender As Object, e As EventArgs)
Dim ObjTransportes As New ClsTransportes Dim ObjTransportes As New ClsTransportes
@@ -330,6 +366,7 @@ Partial Class RepContratoDetalle
ViajeActual = dt ViajeActual = dt
End Sub End Sub
Protected Sub ImprimirBoleto(sender As Object, e As EventArgs) Protected Sub ImprimirBoleto(sender As Object, e As EventArgs)
Dim dtResult As New DataTable() Dim dtResult As New DataTable()
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
Dim Fecha As Date = GvRow.DataKey("FechaIng").ToDate Dim Fecha As Date = GvRow.DataKey("FechaIng").ToDate
@@ -346,21 +383,22 @@ Partial Class RepContratoDetalle
New ReportParameter("Celular", GvRow.DataKey("Celular")), New ReportParameter("Celular", GvRow.DataKey("Celular")),
New ReportParameter("Importe", Math.Round(Importe, 1).ToString), New ReportParameter("Importe", Math.Round(Importe, 1).ToString),
New ReportParameter("TipoBoleto", "Tipo Boleto"), New ReportParameter("TipoBoleto", "Tipo Boleto"),
New ReportParameter("Agencia", GvRow.DataKey("Agencia")), New ReportParameter("Agencia", "Agencia"),
New ReportParameter("TelefonoAgencia", GvRow.DataKey("TelefonoAgencia")), New ReportParameter("TelefonoAgencia", "TelefonoAgencia"),
New ReportParameter("Asiento", GvRow.DataKey("Asiento")) New ReportParameter("Asiento", GvRow.DataKey("Asiento"))
} }
ImprimirPDFStimul($"{UsuarioActual.Empresa.Ruta}Formatos\Boleto.mrt", dtResult, params, NombreArchivo:="Boleto") ImprimirPDFStimul($"{UsuarioActual.Empresa.Ruta}Formatos\Boleto.mrt", dtResult, params, NombreArchivo:="Boleto")
'Empresas/Grales/Formatos/EntradaSalida.mrt End Sub
'Empresas/188/Formatos/Boleto.mrt Protected Sub GvViajesPasajeros_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 Sub
Protected Sub EditarBoleto(sender As Object, e As EventArgs) Protected Sub EditarBoleto(sender As Object, e As EventArgs)
End Sub End Sub
Protected Sub CambiarBoleto(sender As Object, e As EventArgs) Protected Sub CambiarBoleto(sender As Object, e As EventArgs)
DdlRuta.ClearSelection()
PnEditarViaje.Visible = True PnEditarViaje.Visible = True
PnEditarUsuario.Visible = False PnEditarUsuario.Visible = False
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
@@ -384,14 +422,15 @@ Partial Class RepContratoDetalle
If ObjContratos.GetContratosReporte(UsuarioActual.CveEmpresa, MinFecha, MaxFecha, -1, CveEstatus:=-1, CveTipoContrato:=35) Then If ObjContratos.GetContratosReporte(UsuarioActual.CveEmpresa, MinFecha, MaxFecha, -1, CveEstatus:=-1, CveTipoContrato:=35) Then
For Each row As DataRow In ObjContratos.DtResultados.Rows For Each row As DataRow In ObjContratos.DtResultados.Rows
Dim fecha As DateTime = row("FechaInicial").ToString.ToDateTime Dim fecha As DateTime = row("FechaInicial").ToString.ToDateTime
' Asigna los valores de la columna deseada al ListItem 'Asigna los valores de la columna deseada al ListItem
Dim listItem As New ListItem(row("SubProyecto").ToString() + " - " + fecha.ToShortDateString + " - " + fecha.ToShortTimeString, row("CveContrato").ToString()) Dim listItem As New ListItem(row("SubProyecto").ToString() + " - " + fecha.ToShortDateString + " - " + fecha.ToShortTimeString, row("CveContrato").ToString())
' Agrega el ListItem al DropDownList 'Agrega el ListItem al DropDownList
DdlRuta.Items.Add(listItem) DdlRuta.Items.Add(listItem)
Next Next
End If End If
DdlRuta.SelectedValue = GvRow.DataKey("CveViaje") DdlRuta.SelectedValue = GvRow.DataKey("CveViaje")
ObjContratos.Dispose() ObjContratos.Dispose()
UpTabContainer.Update()
RegistraScript(String.Format("$('#{0}').modal('show');", "ModalEditar")) RegistraScript(String.Format("$('#{0}').modal('show');", "ModalEditar"))
End Sub End Sub
Protected Sub BtnCancelar_Click(sender As Object, e As EventArgs) Protected Sub BtnCancelar_Click(sender As Object, e As EventArgs)

View File

@@ -1,8 +1,8 @@
Option Explicit On Option Explicit On
Option Strict On Option Strict On
Imports System.Data Imports System.Data
Imports Extensiones
Imports Extensiones.ModExtensiones Imports Extensiones.ModExtensiones
Partial Class ListadoViajes Partial Class ListadoViajes
Inherits ClsPaginas Inherits ClsPaginas
@@ -24,6 +24,8 @@ Partial Class ListadoViajes
End Set End Set
End Property End Property
#End Region #End Region
#Region "Carga Página"
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then If Not IsPostBack Then
@@ -38,18 +40,7 @@ Partial Class ListadoViajes
DdlRutas.DataBind() DdlRutas.DataBind()
Dim ObjRutas As New ClsTransportes() Dim ObjRutas As New ClsTransportes()
'If ObjRutas.GetRutas(-1, -1, -1, "", True, DateTime.Now) Then
' If ObjRutas.DtResultados.Rows.Count > 0 Then
' DdlRutas.DataSource = ObjRutas.DtResultados
' DdlRutas.DataBind()
' DdlRutas.Items.Insert(0, New ListItem("Seleccione Ruta", ""))
' End If
'End If
'DdlRutas.DataSource = ObjRutas.DtResultados
' DdlRutas.DataBind()
' DdlRutas.Items.Insert(0, New ListItem("Seleccione Ruta", ""))
'Lista Destinos'
If ObjRutas.GetDestinos() Then If ObjRutas.GetDestinos() Then
If ObjRutas.DtResultados.Rows.Count > 0 Then If ObjRutas.DtResultados.Rows.Count > 0 Then
@@ -73,17 +64,12 @@ Partial Class ListadoViajes
End If End If
ObjContratos.Dispose() ObjContratos.Dispose()
GvContratos.DataBind() GvContratos.DataBind()
'If ObjContratos.GetContratos(-1, UsuarioActual.CveEmpresa, TipoContrato:=35) Then
' GvContratos.DataSource = ObjContratos.DtResultados
' GvContratos.DataBind()
'End If
End Sub End Sub
#End Region
Private Sub LBAgregarViaje_Click(sender As Object, e As EventArgs) Handles LBAgregarViaje.Click Private Sub LBAgregarViaje_Click(sender As Object, e As EventArgs) Handles LBAgregarViaje.Click
MostrarModal() MostrarModal()
End Sub End Sub
Public Sub MostrarModal() Public Sub MostrarModal()
'Generar Folio 'Generar Folio
Dim CveSubProyecto As Integer = GlobalDTSubProyectos(-1, -1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", "TipoSucursal = 1").ToEntero Dim CveSubProyecto As Integer = GlobalDTSubProyectos(-1, -1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", "TipoSucursal = 1").ToEntero
@@ -104,10 +90,9 @@ Partial Class ListadoViajes
RegistraScript(String.Format("$('#{0}').modal('show');", "ModalAgregar")) RegistraScript(String.Format("$('#{0}').modal('show');", "ModalAgregar"))
End Sub End Sub
Protected Sub AddViaje(sender As Object, e As EventArgs) Protected Sub AddViaje(sender As Object, e As EventArgs)
'Generador de Viajes Masivos 'Generador de Viajes Masivos
Dim CveSubProyecto As Integer = DdlRutas.SelectedValue.ToEntero 'GlobalDTSubProyectos(-1, -1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", "TipoSucursal = 1").ToEntero Dim CveSubProyecto As Integer = GlobalDTSubProyectos(-1, -1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", "TipoSucursal = 1").ToEntero
If IsMasivo.Checked = True Then If IsMasivo.Checked = True Then
If TxtFechaInicial.Text = "" Or TxtFrecuencia.Text = "" Then If TxtFechaInicial.Text = "" Or TxtFrecuencia.Text = "" Then
Alert("Es necesario agregar la fecha inicial y la frecuencia", TipoMensaje.MsgAdvertencia) Alert("Es necesario agregar la fecha inicial y la frecuencia", TipoMensaje.MsgAdvertencia)
@@ -136,13 +121,15 @@ Partial Class ListadoViajes
End If End If
'Agregamos contrato 'Agregamos contrato
ObjContratos.IniciaTransacSQL() ObjContratos.IniciaTransacSQL()
If ObjContratos.AddContratos(LbFolio.Text, "", "", UsuarioActual.CveProveedor, -1, -1, fecha, fecha, "", "", CveSubProyecto, -1, -1, -1, -1, "", "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, -1, -1, -1, -1, 0, CveContratoTipo:=35, CveContratosEstatus:=50, CvePartida:=DdlPartida.SelectedValue.ToEntero, CveDestino:=DdlDestino.SelectedValue.ToEntero, CveMasivo:=CveMasivo, CveVendedor:=UsuarioActual.CveVendedor) > 0 Then If ObjContratos.AddContratos(LbFolio.Text, "", "", UsuarioActual.CveProveedor, -1, -1, fecha, fecha, "", "", DdlRutas.SelectedValue.ToEntero, -1, -1, -1, -1, "", "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, -1, -1, -1, -1, 0, CveContratoTipo:=35, CveContratosEstatus:=50, CvePartida:=DdlPartida.SelectedValue.ToEntero, CveDestino:=DdlDestino.SelectedValue.ToEntero, CveMasivo:=CveMasivo, CveVendedor:=UsuarioActual.CveVendedor) > 0 Then
ObjContratos.Commit() ObjContratos.Commit()
End If End If
'Actualizamos Folio 'Actualizamos Folio
ObjFolio.IniciaTransacSQL()
If ObjFolio.UpdateFolioActual(CveSubProyecto, "Con", True, UsuarioActual.CveEmpresa) Then If ObjFolio.UpdateFolioActual(CveSubProyecto, "Con", True, UsuarioActual.CveEmpresa) Then
ObjFolio.Dispose() ObjFolio.Commit()
End If End If
ObjFolio.Dispose()
Next Next
Alert("Viajes Masivos generados correctamente.") Alert("Viajes Masivos generados correctamente.")
Catch ex As Exception Catch ex As Exception
@@ -183,16 +170,17 @@ Partial Class ListadoViajes
TxtFechaViaje.Text = "" TxtFechaViaje.Text = ""
'Actualizamos Folio 'Actualizamos Folio
Dim ObjFolios As New ClsGralFolios Dim ObjFolios As New ClsGralFolios
ObjFolios.IniciaTransacSQL()
If ObjFolios.UpdateFolioActual(CveSubProyecto, "Con", True, UsuarioActual.CveEmpresa) Then If ObjFolios.UpdateFolioActual(CveSubProyecto, "Con", True, UsuarioActual.CveEmpresa) Then
ObjFolios.Dispose() ObjFolios.Commit()
End If End If
ObjFolios.Dispose()
ObjContratos.Dispose() ObjContratos.Dispose()
CargaDatos() CargaDatos()
End Try End Try
End If End If
End Sub End Sub
Protected Sub ToggleMasivo(sender As Object, e As EventArgs) Protected Sub ToggleMasivo(sender As Object, e As EventArgs)
DivFechaMasivo.Visible = IsMasivo.Checked DivFechaMasivo.Visible = IsMasivo.Checked
RegistraScript(String.Format("$('#{0}').modal('show');", "ModalAgregar")) RegistraScript(String.Format("$('#{0}').modal('show');", "ModalAgregar"))

View File

@@ -2208,7 +2208,7 @@ Partial Class ProductosyServicios
#Region "Codigo Barras" #Region "Codigo Barras"
'Codigo barras/QR se retorna como una imagen bmp 'Codigo barras/QR se retorna como una imagen bmp
Private Function GeneraCodigoQR(CodigoBarras As String, Alto As Integer, Largo As Integer, Margen As Integer, Formato As String) As Byte() Private Function GeneraCodigoQR(CodigoBarras As String, Alto As Integer, Largo As Integer, Margen As Integer, Formato As String, Optional PureBacode As Boolean = False) As Byte()
Dim barcodeWriter As New BarcodeWriter Dim barcodeWriter As New BarcodeWriter
Dim opciones As New ZXing.Common.EncodingOptions Dim opciones As New ZXing.Common.EncodingOptions
@@ -2218,7 +2218,7 @@ Partial Class ProductosyServicios
opciones.Height = Alto opciones.Height = Alto
opciones.Width = Largo opciones.Width = Largo
opciones.Margin = Margen opciones.Margin = Margen
opciones.PureBarcode = PureBacode
barcodeWriter.Options = opciones barcodeWriter.Options = opciones
Select Case Formato Select Case Formato
@@ -3582,6 +3582,13 @@ Partial Class ProductosyServicios
ObjVentas.Dispose() ObjVentas.Dispose()
If DtPrecios IsNot Nothing Then If DtPrecios IsNot Nothing Then
DtPrecios.Columns.Add(New DataColumn("CBBase64", GetType(String)))
For Each Row As DataRow In DtPrecios.Rows
Row("CBBase64") = Convert.ToBase64String(GeneraCodigoQR(Row("CodigoBarras").ToString(), 40, 150, 0, "CODE_39", True))
Next
Dim DirectorioArchivo As String = "Empresas/Grales/Formatos/Etiqueta.mrt" Dim DirectorioArchivo As String = "Empresas/Grales/Formatos/Etiqueta.mrt"
If System.IO.File.Exists(UsuarioActual.Empresa.Ruta + "Formatos/Etiqueta.mrt") Then If System.IO.File.Exists(UsuarioActual.Empresa.Ruta + "Formatos/Etiqueta.mrt") Then
DirectorioArchivo = UsuarioActual.Empresa.Ruta + "Formatos/Etiqueta.mrt" DirectorioArchivo = UsuarioActual.Empresa.Ruta + "Formatos/Etiqueta.mrt"