--
This commit is contained in:
@@ -178,8 +178,25 @@
|
||||
<div class="row">
|
||||
<div class=" col-md-12">
|
||||
<asp:Literal runat="server" ID="LblProductosCargados">P</asp:Literal>
|
||||
<asp:HiddenField ID="HdnPSRecoleccion" runat="server" />
|
||||
<asp:HiddenField ID="HdnCantidadRecoleccion" runat="server" />
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
A. Origen
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<asp:DropDownList ID="DdlAlmacenOrigen" CssClass="form-control input-sm select2me" DataTextField="Almacen" Width="100%" DataValueField="CveAlmacen" runat="server"></asp:DropDownList>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
A. Destino
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<asp:DropDownList ID="DdlAlmacenDestino" CssClass="form-control input-sm select2me" DataTextField="Almacen" Width="100%" DataValueField="CveAlmacen" runat="server"></asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
<div class="row">
|
||||
<div class=" col-md-2">
|
||||
@@ -225,7 +242,7 @@
|
||||
|
||||
<div class="row">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
@@ -246,6 +263,7 @@
|
||||
</asp:GridView>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
Imports System.Data
|
||||
Imports CrystalDecisions.Shared.Json
|
||||
Imports Extensiones
|
||||
Imports Modelos
|
||||
|
||||
|
||||
Partial Class Acumuladores_RepRecolecciones
|
||||
@@ -59,25 +60,27 @@ Partial Class Acumuladores_RepRecolecciones
|
||||
|
||||
Private Sub InicializaCombos()
|
||||
CargaPS()
|
||||
TxtFechaI.Text = NowADS().AddDays(-1).ToShortDateString
|
||||
TxtFechaF.Text = NowADS().AddDays(3).ToShortDateString
|
||||
TxtFechaI.Text = NowADS().AddMonths(-1).ToShortDateString
|
||||
TxtFechaF.Text = NowADS().AddMonths(1).ToShortDateString
|
||||
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.DataBind()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatos()
|
||||
|
||||
Dim ObjGeneral As New ClsGenerales
|
||||
|
||||
If (ObjGeneral.GetInvEntregaAlmacenRuta(-1, Now.AddMonths(-1), Now.AddMonths(1), UsuarioActual.CveEmpresa, 2, -1)) Then
|
||||
If (ObjGeneral.GetInvEntregaAlmacenRuta(-1, TxtFechaI.Text.ToDate, TxtFechaF.Text.ToDate, UsuarioActual.CveEmpresa, 2, -1)) Then
|
||||
GvR.DataSource = ObjGeneral.DtResultados
|
||||
End If
|
||||
|
||||
ObjGeneral.Dispose()
|
||||
|
||||
UPGv.DataBind()
|
||||
UpGral.Update()
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub gvR_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs)
|
||||
@@ -128,16 +131,18 @@ Partial Class Acumuladores_RepRecolecciones
|
||||
Private Sub CargaDatosRecoleccionDetallePS()
|
||||
|
||||
Dim ObjGenerales As New ClsGenerales()
|
||||
Dim Str As New StringBuilder
|
||||
Str.Append("Productos Definidos <br/>")
|
||||
If ObjGenerales.GetEntregaAlmacenRutaDetalle(CveEntregaAlmacen) Then
|
||||
For Each dr As DataRow In ObjGenerales.DtResultados.Rows
|
||||
Str.AppendFormat(" {0} - {1}<br/>", dr("Cantidad"), dr("CodigoPS"))
|
||||
Next
|
||||
LblProductosCargados.Text = Str.ToString
|
||||
End If
|
||||
Dim Str As New StringBuilder
|
||||
Str.Append("Productos Definidos <br/>")
|
||||
If ObjGenerales.GetEntregaAlmacenRutaDetalle(CveEntregaAlmacen) Then
|
||||
For Each dr As DataRow In ObjGenerales.DtResultados.Rows
|
||||
Str.AppendFormat(" {0} - {1}<br/>", dr("Cantidad"), dr("CodigoPS"))
|
||||
HdnPSRecoleccion.Value = dr("CvePS").ToString
|
||||
HdnCantidadRecoleccion.Value = dr("Cantidad").ToString
|
||||
Next
|
||||
LblProductosCargados.Text = Str.ToString
|
||||
End If
|
||||
|
||||
ObjGenerales.Dispose()
|
||||
ObjGenerales.Dispose()
|
||||
|
||||
GvModalPSRecoleccion.DataSource = DTRecoleccion
|
||||
GvModalPSRecoleccion.DataBind()
|
||||
@@ -158,43 +163,38 @@ Partial Class Acumuladores_RepRecolecciones
|
||||
End Function
|
||||
|
||||
Private Sub CargaPS()
|
||||
Dim ObjAcum As New ClsAcumuladores
|
||||
|
||||
Dim lista As New List(Of String)
|
||||
Dim Filtro As String = ""
|
||||
|
||||
For Each drow As DataRow In GlobalDTAcumTamaños(UsuarioActual.CveEmpresa).Rows
|
||||
|
||||
If drow("CvePSCargo").ToString.ToEntero > 0 Then
|
||||
lista.Add(drow("CvePSCargo").ToString)
|
||||
End If
|
||||
Next
|
||||
|
||||
If lista.Count > 0 Then
|
||||
|
||||
Filtro = "CvePS in(" & String.Join(",", lista) & ")"
|
||||
|
||||
DdlProducto2.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltraParametros(Filtro)
|
||||
DdlProducto2.DataBind()
|
||||
DdlProducto2.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
End If
|
||||
|
||||
ObjAcum.Dispose()
|
||||
End Sub
|
||||
|
||||
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()
|
||||
dRow("CveUnidadMedida") = DdlModalRecoleccionUnidad.SelectedValue.ToEntero()
|
||||
dRow("CveUsuario") = UsuarioActual.CveUsuario
|
||||
dRow("FechaIng") = NowADS()
|
||||
dRow("CodigoPS") = DdlProducto2.SelectedItem.Text
|
||||
dRow("Abreviatura") = DdlModalRecoleccionUnidad.SelectedItem.Text
|
||||
DTRecoleccion.Rows.Add(dRow)
|
||||
|
||||
dRow("CveEntregaAlmacenDetalle") = -1
|
||||
dRow("CveEntregaAlmacen") = CveEntregaAlmacen
|
||||
dRow("CvePS") = DdlProducto2.SelectedValue.ToEntero()
|
||||
dRow("Cantidad") = TxtModalRecoleccionCantidad.Text.ToEntero()
|
||||
dRow("CveUnidadMedida") = DdlModalRecoleccionUnidad.SelectedValue.ToEntero()
|
||||
dRow("CveUsuario") = UsuarioActual.CveUsuario
|
||||
dRow("FechaIng") = NowADS()
|
||||
dRow("CodigoPS") = DdlProducto2.SelectedItem.Text
|
||||
dRow("Abreviatura") = DdlModalRecoleccionUnidad.SelectedItem.Text
|
||||
DTRecoleccion.Rows.Add(dRow)
|
||||
|
||||
LimpiarControlesPS()
|
||||
CargaDatosRecoleccionDetallePS()
|
||||
@@ -208,5 +208,73 @@ Partial Class Acumuladores_RepRecolecciones
|
||||
UpModalRecoleccion.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub BtnModalRecoleccionGuardar_Click(sender As Object, e As EventArgs) Handles BtnModalRecoleccionGuardar.Click
|
||||
Dim ObjInventario As New ClsInventarios
|
||||
Dim ObjConta As New ClsContabilidad(ObjInventario.IniciaTransacSQL)
|
||||
Dim ErrorMovInv As Boolean = False
|
||||
Dim Fecha As DateTime = NowADS()
|
||||
Dim Concepto As String = "Traspaso Recolección"
|
||||
Dim CveMovimientoSalida As Integer = ObjInventario.AddMovimiento(DdlAlmacenOrigen.SelectedValue.ToEntero, 26, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1)
|
||||
Dim FolioSalida As Integer = ObjInventario.Folio
|
||||
Dim CveMovimientoEntrada As Integer = ObjInventario.AddMovimiento(DdlAlmacenDestino.SelectedValue.ToEntero, 27, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, CveMovimientoRelacionado:=CveMovimientoSalida)
|
||||
Dim CveUM As Integer = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=HdnPSRecoleccion.Value.ToEntero).FiltroPrimeroValor("CveUnidadMedida", "").ToEntero
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, HdnCantidadRecoleccion.Value.ToDecimal, CveUM, HdnPSRecoleccion.Value.ToEntero, 0) Then
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
'HdnPSRecoleccion
|
||||
For Each gvr As GridViewRow In GvModalPSRecoleccion.Rows
|
||||
Dim CveMovtoDetalle As Integer
|
||||
If ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, gvr.DataKey("Cantidad").ToDecimal, gvr.DataKey("CveUnidadMedida").ToEntero, gvr.DataKey("CvePS").ToEntero, 0) Then
|
||||
CveMovtoDetalle = ObjInventario.CveMovimientoDetalle
|
||||
Else
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
Next
|
||||
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
|
||||
Dim Cont As Integer = 0
|
||||
Dim dttSalida As DataTable = ObjInventario.DtResultados
|
||||
|
||||
If Not ErrorMovInv Then
|
||||
Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Inventario/TraspasoAlmacen", 53, 0, 0, 1, Fecha, Concepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
Dim importe As Decimal = dttSalida.SUMD("Total").RoundSQL
|
||||
Dim Contabilizable As Boolean = False
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importe, importe, 68, Concepto, Concepto, CveMovimientoAlmacen:=CveMovimientoSalida, Contabilizable:=Contabilizable) Then
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
|
||||
If Not ErrorMovInv AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importe, importe, 68, Concepto, Concepto, CveMovimientoAlmacen:=CveMovimientoEntrada, Contabilizable:=Contabilizable) Then
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
|
||||
If Not ErrorMovInv Then
|
||||
If ObjConta.ValidacionesPrePoliza(CvePrePoliza, UsuarioActual) Then
|
||||
If ObjConta.ValorPolizaDescuadre > 0 Then
|
||||
'MsgError = ObjMov.MensajePolizaDescuadre
|
||||
ErrorMovInv = True
|
||||
'GuardaLogAD($"Bancos/Transferencias | Error:{ObjMov.MensajePolizaDescuadre} Diferencia:{ObjMov.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
|
||||
End If
|
||||
Else
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
If Not ErrorMovInv Then
|
||||
ObjInventario.Commit()
|
||||
|
||||
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)
|
||||
Else
|
||||
ObjInventario.RollBack()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
@@ -977,12 +977,10 @@ Public Class ClsBancos
|
||||
|
||||
Public Function GeneraTimbrePago(CveIE As Integer, CveVenta As Integer, UsuarioActual As Usuario, Optional CveCliente As Integer = -1, Optional CFDIRelacionado As String = "-1", Optional EsRegeneracion As Boolean = False, Optional CvePrePoliza As Integer = -1, Optional FechaTimbrado As DateTime = MinFecha) As Boolean
|
||||
|
||||
|
||||
Dim Serie As String = "Pag"
|
||||
Dim Folio As Integer = -1
|
||||
Dim Retorno As Boolean = False
|
||||
Dim Estatus As Integer = 1
|
||||
|
||||
Dim dttpagos As DataTable = Nothing
|
||||
Dim dttpagosimpuestos As DataTable = Nothing
|
||||
Dim dr As Data.DataRow = Nothing
|
||||
@@ -996,7 +994,6 @@ Public Class ClsBancos
|
||||
|
||||
If FechaTimbrado = MinFecha Then
|
||||
Dim RowFiltro As DataRow = Nothing
|
||||
|
||||
RowFiltro = dttpagos.FiltroPrimero("")
|
||||
|
||||
If RowFiltro IsNot Nothing Then
|
||||
@@ -1018,10 +1015,8 @@ Public Class ClsBancos
|
||||
Else
|
||||
FechaTimbrado = ClsPaginas.NowADS()
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
Dim tCveComplementoPago As Integer = AddComplementoPago(If(CvePrePoliza > 0, CveIE, dr("CveIE").ToString.ToEntero), -1, Serie, Folio, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CvePrePoliza:=CvePrePoliza, Estatus:=Estatus)
|
||||
If tCveComplementoPago > 0 Then
|
||||
'Dim drr As Data.DataRow = dtt.Rows(0)
|
||||
@@ -1042,7 +1037,6 @@ Public Class ClsBancos
|
||||
If Cuentapago <> "" AndAlso Not Cuentapago.Length.Contiene(11, 18) Then
|
||||
Mensaje = $"La cuenta ordenante {Cuentapago} no cumple con el formato esperado 11, 18 caracteres."
|
||||
End If
|
||||
|
||||
If CuentaBeneficiario <> "" AndAlso Not (CuentaBeneficiario.Length.Contiene(10, 11, 15, 16, 18, 50)) Then
|
||||
Mensaje = $"{Mensaje} La Cuenta Beneficiario {CuentaBeneficiario} no cumple con el formato esperado 10, 11, 15, 16, 18, 50 caracteres."
|
||||
End If
|
||||
@@ -1058,7 +1052,6 @@ Public Class ClsBancos
|
||||
If Cuentapago <> "" AndAlso Not Cuentapago.Length.Contiene(16) Then
|
||||
Mensaje = $"La cuenta ordenante {Cuentapago} no cumple con el formato esperado 16 caracteres."
|
||||
End If
|
||||
|
||||
If CuentaBeneficiario <> "" AndAlso Not (CuentaBeneficiario.Length.Contiene(10, 11, 15, 16, 18, 50)) Then
|
||||
Mensaje = $"{Mensaje} La Cuenta Beneficiario {CuentaBeneficiario} no cumple con el formato esperado 10, 11, 15, 16, 18, 50 caracteres."
|
||||
End If
|
||||
@@ -1067,7 +1060,6 @@ Public Class ClsBancos
|
||||
If Cuentapago <> "" AndAlso Not Cuentapago.Length.Contiene(10, 11, 15, 16, 18, 50) Then
|
||||
Mensaje = $"La cuenta ordenante {Cuentapago} no cumple con el formato esperado 10, 11, 15, 16, 18, 50 caracteres."
|
||||
End If
|
||||
|
||||
If CuentaBeneficiario <> "" AndAlso Not (CuentaBeneficiario.Length.Contiene(10, 11, 15, 16, 18, 50)) Then
|
||||
Mensaje = $"{Mensaje} La Cuenta Beneficiario {CuentaBeneficiario} no cumple con el formato esperado 10, 11, 15, 16, 18, 50 caracteres."
|
||||
End If
|
||||
@@ -1075,13 +1067,11 @@ Public Class ClsBancos
|
||||
If Cuentapago <> "" AndAlso Not Cuentapago.Length.Contiene(10) Then
|
||||
Mensaje = $"La cuenta ordenante {Cuentapago} no cumple con el formato esperado 10 caracteres."
|
||||
End If
|
||||
|
||||
CuentaBeneficiario = ""
|
||||
Case "28"
|
||||
If Cuentapago <> "" AndAlso Not Cuentapago.Length.Contiene(16) Then
|
||||
Mensaje = $"La cuenta ordenante {Cuentapago} no cumple con el formato esperado 16 caracteres."
|
||||
End If
|
||||
|
||||
If CuentaBeneficiario <> "" AndAlso Not (CuentaBeneficiario.Length.Contiene(10, 11, 15, 16, 18, 50)) Then
|
||||
Mensaje = $"{Mensaje} La Cuenta Beneficiario {CuentaBeneficiario} no cumple con el formato esperado 10, 11, 15, 16, 18, 50 caracteres."
|
||||
End If
|
||||
@@ -1089,13 +1079,10 @@ Public Class ClsBancos
|
||||
If Cuentapago <> "" AndAlso Not Cuentapago.Length.Contiene(15, 16) Then
|
||||
Mensaje = $"La cuenta ordenante {Cuentapago} no cumple con el formato esperado 15, 16 caracteres."
|
||||
End If
|
||||
|
||||
If CuentaBeneficiario <> "" AndAlso Not (CuentaBeneficiario.Length.Contiene(10, 11, 15, 16, 18, 50)) Then
|
||||
Mensaje = $"{Mensaje} La Cuenta Beneficiario {CuentaBeneficiario} no cumple con el formato esperado 10, 11, 15, 16, 18, 50 caracteres."
|
||||
End If
|
||||
|
||||
Case Else
|
||||
|
||||
CuentaBeneficiario = ""
|
||||
Cuentapago = ""
|
||||
'RFCCliente = ""
|
||||
@@ -1103,10 +1090,6 @@ Public Class ClsBancos
|
||||
|
||||
End Select
|
||||
|
||||
'If EsCancelacion AndAlso (CFDIRelacionado = "-1" OrElse CFDIRelacionado = "") Then
|
||||
' Mensaje += " La cancelación debe de tener documento relacionado"
|
||||
'End If
|
||||
|
||||
If Not Mensaje.Length = 0 Then
|
||||
GuardaLog(Mensaje)
|
||||
Return False
|
||||
|
||||
@@ -1299,6 +1299,25 @@ Public Class ClsClientes
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function GetVentasRemisionesPagos(CveCliente As Integer, Ventas As String) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_VentasRemisionesPagos")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
|
||||
.Add("@Ventas", SqlDbType.VarChar).Value = Ventas
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al obtener los pagos de las remisiones.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' Obtiene las ventas que tienen Serie-Folio que no existen en la base de datos pero si en el xml y que esten en la base de datos pero no en el XML
|
||||
''' </summary>
|
||||
|
||||
@@ -9327,17 +9327,17 @@ Public Class ClsPaginas
|
||||
Pago.AplicaTraslado = False
|
||||
Contabilizable = False
|
||||
|
||||
If Pago.CveMonedaPago > 1 Then
|
||||
If VentaActual.CveMoneda > 1 Then
|
||||
'Agregamos la Extranjera
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePago, Pago.ImportePago, 295, Pago.Referencia, Concepto, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, ImporteME:=Pago.ImportePago, TipoCambio:=TCValuacionPago, CveSubProyecto:=VentaActual.CveSubProyecto) Then ErrorMovtos = True
|
||||
ImporteMN = (Pago.ImportePago * TCValuacionPago - Pago.ImportePago).RoundSQL
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePago, ImporteMN, 227, Pago.Referencia, Concepto, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, ImporteME:=Pago.ImportePago, TipoCambio:=TCValuacionPago, CveSubProyecto:=VentaActual.CveSubProyecto) Then ErrorMovtos = True
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePago, Pago.ImportePago, 295, Pago.Referencia, Concepto, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, ImporteME:=Pago.ImportePago, TipoCambio:=TCValuacionVenta, CveSubProyecto:=VentaActual.CveSubProyecto) Then ErrorMovtos = True
|
||||
ImporteMN = (Pago.ImportePago * TCValuacionVenta - Pago.ImportePago).RoundSQL
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePago, ImporteMN, 227, Pago.Referencia, Concepto, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, ImporteME:=Pago.ImportePago, TipoCambio:=TCValuacionVenta, CveSubProyecto:=VentaActual.CveSubProyecto) Then ErrorMovtos = True
|
||||
Else
|
||||
'Agregamos Nacional
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePago, Pago.ImportePago, 3, Pago.Referencia, Concepto, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambioPago:=Pago.TCPago) Then ErrorMovtos = True
|
||||
End If
|
||||
|
||||
If Not ErrorMovtos AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Pago.ImportePago, (Pago.ImportePago * TCValuacionPago).RoundSQL, 95, VentaActual.SerieFolio, VentaActual.SerieFolio, CveIE:=Pago.CveIE, CveVenta:=VentaActual.CveVenta, CveSubProyecto:=VentaActual.CveSubProyecto, CveCliente:=VentaActual.CveCliente, TipoCambio:=TCValuacionVenta, TipoCambioPago:=Pago.TCPago, PorcentajeImpuesto:=VentaActual.PorcentajeIVA, Contabilizable:=False) Then
|
||||
If Not ErrorMovtos AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Pago.ImportePago, (Pago.ImportePago * TCValuacionVenta).RoundSQL, 95, VentaActual.SerieFolio, VentaActual.SerieFolio, CveIE:=Pago.CveIE, CveVenta:=VentaActual.CveVenta, CveSubProyecto:=VentaActual.CveSubProyecto, CveCliente:=VentaActual.CveCliente, TipoCambio:=TCValuacionVenta, TipoCambioPago:=Pago.TCPago, PorcentajeImpuesto:=VentaActual.PorcentajeIVA, Contabilizable:=False) Then
|
||||
ErrorMovtos = True
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -413,7 +413,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") 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) As Integer
|
||||
Dim Retorno As Integer = -1
|
||||
|
||||
DataAdapter("PA_ProductosServiciosAdd")
|
||||
@@ -521,7 +521,7 @@ Public Class ClsProductosServicios
|
||||
|
||||
.Add("@CodigoAlterno", SqlDbType.VarChar).Value = CodigoAlterno
|
||||
.Add("@PSAlterno", SqlDbType.VarChar).Value = PSAlterno
|
||||
|
||||
.Add("@ProductoExhibicion", SqlDbType.Bit).Value = ProductoExhibicion
|
||||
|
||||
End With
|
||||
|
||||
@@ -658,7 +658,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") 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) As Boolean
|
||||
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
@@ -765,6 +765,7 @@ Public Class ClsProductosServicios
|
||||
.Add("@EcommerceCantidad", SqlDbType.SmallMoney).Value = EcommerceCantidad
|
||||
.Add("@CodigoAlterno", SqlDbType.VarChar).Value = CodigoAlterno
|
||||
.Add("@PSAlterno", SqlDbType.VarChar).Value = PSAlterno
|
||||
.Add("@ProductoExhibicion", SqlDbType.Bit).Value = ProductoExhibicion
|
||||
End With
|
||||
|
||||
Try
|
||||
@@ -2332,6 +2333,25 @@ Public Class ClsProductosServicios
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function GetPSPrecios(CvePrecioLista As Integer, Productos As String) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_ProductosPreciosGet")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CvePrecioLista", SqlDbType.Int).Value = CvePrecioLista
|
||||
.Add("@Productos", SqlDbType.VarChar).Value = Productos
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al obtener los precios de los productos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
|
||||
#Region " P S C O M P L E M E N T O S"
|
||||
|
||||
|
||||
@@ -654,134 +654,131 @@ Public Class Timbrado
|
||||
Return retorno
|
||||
End Function
|
||||
|
||||
Public Function PreparaTimbrePago(EmisorRFC As String, EmisorNombre As String, EmisorRegimenFiscal As String,
|
||||
ReceptorRFC As String, ReceptorNombre As String, Serie As String, Folio As String, FechaTimbrado As DateTime,
|
||||
CuentaPago As String, FechaPago As DateTime, FormaPago As String, MonedaPago As String, Monto As Decimal, LugarExpedicion As String,
|
||||
CuentaBeneficiario As String, TipoCambioP As Decimal, dttpagos As Data.DataTable,
|
||||
Optional UsoCFDI As String = "P01", Optional CFDIRelacionado As String = "", Optional EsCancelacion As Boolean = False) As CFDITimbre
|
||||
' validación extra para cuando es cancelación requiere el folio relacionado
|
||||
If EsCancelacion AndAlso CFDIRelacionado = "" Then
|
||||
Return Nothing
|
||||
End If
|
||||
'Public Function PreparaTimbrePago(EmisorRFC As String, EmisorNombre As String, EmisorRegimenFiscal As String,
|
||||
' ReceptorRFC As String, ReceptorNombre As String, Serie As String, Folio As String, FechaTimbrado As DateTime,
|
||||
' CuentaPago As String, FechaPago As DateTime, FormaPago As String, MonedaPago As String, Monto As Decimal, LugarExpedicion As String,
|
||||
' CuentaBeneficiario As String, TipoCambioP As Decimal, dttpagos As Data.DataTable,
|
||||
' Optional UsoCFDI As String = "P01", Optional CFDIRelacionado As String = "", Optional EsCancelacion As Boolean = False) As CFDITimbre
|
||||
' ' validación extra para cuando es cancelación requiere el folio relacionado
|
||||
' If EsCancelacion AndAlso CFDIRelacionado = "" Then
|
||||
' Return Nothing
|
||||
' End If
|
||||
|
||||
Dim Timbre As New CFDITimbre
|
||||
' Dim Timbre As New CFDITimbre
|
||||
|
||||
Timbre.Comprobante.TipoComprobante = "P"
|
||||
Timbre.Comprobante.Folio = Folio
|
||||
Timbre.Comprobante.Serie = Serie
|
||||
Timbre.Comprobante.Fecha = FechaTimbrado
|
||||
Timbre.Comprobante.FormadePago = ""
|
||||
Timbre.Comprobante.CondicionesdePago = ""
|
||||
Timbre.Comprobante.MetodoPago = ""
|
||||
Timbre.Comprobante.SubTotal = 0
|
||||
Timbre.Comprobante.Descuentos = 0
|
||||
Timbre.Comprobante.Moneda = "XXX"
|
||||
Timbre.Comprobante.TipoCambio = ""
|
||||
Timbre.Comprobante.Total = 0
|
||||
' Timbre.Comprobante.TipoComprobante = "P"
|
||||
' Timbre.Comprobante.Folio = Folio
|
||||
' Timbre.Comprobante.Serie = Serie
|
||||
' Timbre.Comprobante.Fecha = FechaTimbrado
|
||||
' Timbre.Comprobante.FormadePago = ""
|
||||
' Timbre.Comprobante.CondicionesdePago = ""
|
||||
' Timbre.Comprobante.MetodoPago = ""
|
||||
' Timbre.Comprobante.SubTotal = 0
|
||||
' Timbre.Comprobante.Descuentos = 0
|
||||
' Timbre.Comprobante.Moneda = "XXX"
|
||||
' Timbre.Comprobante.TipoCambio = ""
|
||||
' Timbre.Comprobante.Total = 0
|
||||
|
||||
Timbre.Comprobante.LugarExpedicion = LugarExpedicion
|
||||
' Timbre.Comprobante.LugarExpedicion = LugarExpedicion
|
||||
' Timbre.Emisor.RegimenFiscal = EmisorRegimenFiscal
|
||||
' Timbre.Emisor.Nombre = EmisorNombre
|
||||
' Timbre.Emisor.RFC = EmisorRFC
|
||||
|
||||
Timbre.Emisor.RegimenFiscal = EmisorRegimenFiscal
|
||||
Timbre.Emisor.Nombre = EmisorNombre
|
||||
Timbre.Emisor.RFC = EmisorRFC
|
||||
' Timbre.Receptor.RFC = ReceptorRFC
|
||||
' Timbre.Receptor.Nombre = ReceptorNombre
|
||||
' Timbre.Receptor.UsoCFDI = UsoCFDI
|
||||
|
||||
Timbre.Receptor.RFC = ReceptorRFC
|
||||
Timbre.Receptor.Nombre = ReceptorNombre
|
||||
Timbre.Receptor.UsoCFDI = UsoCFDI
|
||||
' If CFDIRelacionado <> "-1" And CFDIRelacionado <> "" Then
|
||||
' Timbre.CFDIRelacionados.TipoRelacion = "04"
|
||||
' Timbre.CFDIRelacionados.UUID.Add(CFDIRelacionado)
|
||||
' End If
|
||||
|
||||
If CFDIRelacionado <> "-1" And CFDIRelacionado <> "" Then
|
||||
Timbre.CFDIRelacionados.TipoRelacion = "04"
|
||||
Timbre.CFDIRelacionados.UUID.Add(CFDIRelacionado)
|
||||
End If
|
||||
' 'detalles
|
||||
' Dim concepto As New CFDIConceptos With {.Cantidad = 1,
|
||||
' .Descripcion = "Pago",
|
||||
' .ValorUnitario = 0,
|
||||
' .Importe = 0,
|
||||
' .Unidad = "",
|
||||
' .ClaveUnidad = "ACT",
|
||||
' .ClaveProdServ = "84111506",
|
||||
' .Noidentificacion = ""}
|
||||
' Timbre.Conceptos.Add(concepto)
|
||||
|
||||
'detalles
|
||||
' Select Case FormaPago
|
||||
' Case "01"
|
||||
' CuentaPago = ""
|
||||
' CuentaBeneficiario = ""
|
||||
' End Select
|
||||
|
||||
Dim concepto As New CFDIConceptos With {.Cantidad = 1,
|
||||
.Descripcion = "Pago",
|
||||
.ValorUnitario = 0,
|
||||
.Importe = 0,
|
||||
.Unidad = "",
|
||||
.ClaveUnidad = "ACT",
|
||||
.ClaveProdServ = "84111506",
|
||||
.Noidentificacion = ""}
|
||||
Timbre.Conceptos.Add(concepto)
|
||||
|
||||
Select Case FormaPago
|
||||
Case "01"
|
||||
CuentaPago = ""
|
||||
CuentaBeneficiario = ""
|
||||
|
||||
End Select
|
||||
|
||||
Dim ImporteCancelacion As Decimal = 1
|
||||
Dim MonedaCancelacion As String = "MXN"
|
||||
Dim TipoCambioCancelacion As Decimal = 1
|
||||
If EsCancelacion Then MonedaPago = MonedaCancelacion
|
||||
'como registra un peso por cada fatura que se cancele, se tiene que multiplicar por el numero de facturas, para que se pueda emitir el timbre
|
||||
If dttpagos IsNot Nothing AndAlso dttpagos.Rows.Count > 0 Then ImporteCancelacion = ImporteCancelacion * dttpagos.Rows.Count
|
||||
Timbre.ComplementoPagos.CtaOrdenante = CuentaPago
|
||||
Timbre.ComplementoPagos.CtaBeneficiario = CuentaBeneficiario
|
||||
Timbre.ComplementoPagos.FechaPago = FechaPago
|
||||
Timbre.ComplementoPagos.FormaDePagoP = FormaPago
|
||||
Timbre.ComplementoPagos.MonedaP = MonedaPago
|
||||
Timbre.ComplementoPagos.Monto = If(EsCancelacion, ImporteCancelacion, Monto).RoundSQL
|
||||
Timbre.ComplementoPagos.TipoCambioP = If(EsCancelacion, TipoCambioCancelacion, TipoCambioP)
|
||||
' Dim ImporteCancelacion As Decimal = 1
|
||||
' Dim MonedaCancelacion As String = "MXN"
|
||||
' Dim TipoCambioCancelacion As Decimal = 1
|
||||
' If EsCancelacion Then MonedaPago = MonedaCancelacion
|
||||
' 'como registra un peso por cada fatura que se cancele, se tiene que multiplicar por el numero de facturas, para que se pueda emitir el timbre
|
||||
' If dttpagos IsNot Nothing AndAlso dttpagos.Rows.Count > 0 Then ImporteCancelacion = ImporteCancelacion * dttpagos.Rows.Count
|
||||
' Timbre.ComplementoPagos.CtaOrdenante = CuentaPago
|
||||
' Timbre.ComplementoPagos.CtaBeneficiario = CuentaBeneficiario
|
||||
' Timbre.ComplementoPagos.FechaPago = FechaPago
|
||||
' Timbre.ComplementoPagos.FormaDePagoP = FormaPago
|
||||
' Timbre.ComplementoPagos.MonedaP = MonedaPago
|
||||
' Timbre.ComplementoPagos.Monto = If(EsCancelacion, ImporteCancelacion, Monto).RoundSQL
|
||||
' Timbre.ComplementoPagos.TipoCambioP = If(EsCancelacion, TipoCambioCancelacion, TipoCambioP)
|
||||
|
||||
|
||||
Dim VentaFolioFiscal, VentaSerie, VentaFolio, VentaAbreviaturaSAT, VentaMetodoPago As String
|
||||
Dim VentaImportePago, VentaImporteSaldoInsoluto, VentaImporteSaldoAnterior, VentaTipoCambio, PorcentajeIVA, PorcentajeIEPS As Decimal
|
||||
Dim VentaNumParcialidad As Integer
|
||||
' Dim VentaFolioFiscal, VentaSerie, VentaFolio, VentaAbreviaturaSAT, VentaMetodoPago As String
|
||||
' Dim VentaImportePago, VentaImporteSaldoInsoluto, VentaImporteSaldoAnterior, VentaTipoCambio, PorcentajeIVA, PorcentajeIEPS As Decimal
|
||||
' Dim VentaNumParcialidad As Integer
|
||||
|
||||
If dttpagos IsNot Nothing AndAlso dttpagos.Rows.Count > 0 Then
|
||||
' If dttpagos IsNot Nothing AndAlso dttpagos.Rows.Count > 0 Then
|
||||
|
||||
For Each dr As Data.DataRow In dttpagos.Rows
|
||||
VentaFolioFiscal = dr("FolioFiscal").ToString
|
||||
VentaSerie = dr("VentaSerie").ToString
|
||||
VentaFolio = dr("VentaFolio").ToString
|
||||
VentaAbreviaturaSAT = dr("VentaAbreviaturaSAT").ToString
|
||||
VentaMetodoPago = dr("MetodoPago").ToString
|
||||
VentaImportePago = dr("VentaImportePagado").ToString.ToDecimal
|
||||
VentaImporteSaldoInsoluto = dr("ImpSaldoInsoluto").ToString.ToDecimal
|
||||
VentaImporteSaldoAnterior = dr("ImpSaldoAnterior").ToString.ToDecimal
|
||||
VentaTipoCambio = dr("TipoCambio").ToString.ToDecimal
|
||||
VentaNumParcialidad = dr("NumParcialidad").ToString.ToEntero
|
||||
PorcentajeIVA = dr("PorcentajeIVA").ToString.ToDecimal
|
||||
PorcentajeIEPS = dr("PorcentajeIEPS").ToString.ToDecimal
|
||||
' si la moneda es igual, se omite el tipo de cambio de la venta
|
||||
If MonedaPago = VentaAbreviaturaSAT Then VentaTipoCambio = 0
|
||||
' For Each dr As Data.DataRow In dttpagos.Rows
|
||||
' VentaFolioFiscal = dr("FolioFiscal").ToString
|
||||
' VentaSerie = dr("VentaSerie").ToString
|
||||
' VentaFolio = dr("VentaFolio").ToString
|
||||
' VentaAbreviaturaSAT = dr("VentaAbreviaturaSAT").ToString
|
||||
' VentaMetodoPago = dr("MetodoPago").ToString
|
||||
' VentaImportePago = dr("VentaImportePagado").ToString.ToDecimal
|
||||
' VentaImporteSaldoInsoluto = dr("ImpSaldoInsoluto").ToString.ToDecimal
|
||||
' VentaImporteSaldoAnterior = dr("ImpSaldoAnterior").ToString.ToDecimal
|
||||
' VentaTipoCambio = dr("TipoCambio").ToString.ToDecimal
|
||||
' VentaNumParcialidad = dr("NumParcialidad").ToString.ToEntero
|
||||
' PorcentajeIVA = dr("PorcentajeIVA").ToString.ToDecimal
|
||||
' PorcentajeIEPS = dr("PorcentajeIEPS").ToString.ToDecimal
|
||||
' ' si la moneda es igual, se omite el tipo de cambio de la venta
|
||||
' If MonedaPago = VentaAbreviaturaSAT Then VentaTipoCambio = 0
|
||||
|
||||
'condiciones especiales para el pago en pesos, facturas en moneda extranjera
|
||||
If MonedaPago = "MXN" AndAlso VentaAbreviaturaSAT <> "MXN" Then
|
||||
VentaTipoCambio = 1 / VentaTipoCambio
|
||||
End If
|
||||
' 'condiciones especiales para el pago en pesos, facturas en moneda extranjera
|
||||
' If MonedaPago = "MXN" AndAlso VentaAbreviaturaSAT <> "MXN" Then
|
||||
' VentaTipoCambio = 1 / VentaTipoCambio
|
||||
' End If
|
||||
|
||||
' For Each drr As Data.DataRow In DtFacturasPagadas.Rows
|
||||
Dim doc As New CFDIComplementoPagosDocsRelacionados With {.IdDocumento = VentaFolioFiscal,
|
||||
.Serie = VentaSerie,
|
||||
.Folio = VentaFolio,
|
||||
.MonedaDR = VentaAbreviaturaSAT,
|
||||
.MetodoDePagoDR = VentaMetodoPago,
|
||||
.ImpPagado = If(EsCancelacion, 1, VentaImportePago),
|
||||
.ImpSaldoInsoluto = If(EsCancelacion, VentaImporteSaldoAnterior - 1, VentaImporteSaldoInsoluto),
|
||||
.ImpSaldoAnt = VentaImporteSaldoAnterior,
|
||||
.TipoCambioDR = VentaTipoCambio,
|
||||
.NumParcialidad = VentaNumParcialidad} 'If(drr("MetodoPago").ToString = "PUE", 0, drr("NumParcialidad").ToString.ToEntero)}
|
||||
Timbre.ComplementoPagos.DocumentosRelacionados.Add(doc)
|
||||
' ' For Each drr As Data.DataRow In DtFacturasPagadas.Rows
|
||||
' Dim doc As New CFDIComplementoPagosDocsRelacionados With {.IdDocumento = VentaFolioFiscal,
|
||||
' .Serie = VentaSerie,
|
||||
' .Folio = VentaFolio,
|
||||
' .MonedaDR = VentaAbreviaturaSAT,
|
||||
' .MetodoDePagoDR = VentaMetodoPago,
|
||||
' .ImpPagado = If(EsCancelacion, 1, VentaImportePago),
|
||||
' .ImpSaldoInsoluto = If(EsCancelacion, VentaImporteSaldoAnterior - 1, VentaImporteSaldoInsoluto),
|
||||
' .ImpSaldoAnt = VentaImporteSaldoAnterior,
|
||||
' .TipoCambioDR = VentaTipoCambio,
|
||||
' .NumParcialidad = VentaNumParcialidad} 'If(drr("MetodoPago").ToString = "PUE", 0, drr("NumParcialidad").ToString.ToEntero)}
|
||||
' Timbre.ComplementoPagos.DocumentosRelacionados.Add(doc)
|
||||
|
||||
Next
|
||||
End If
|
||||
'If drr("IVA").ToString.ToDouble > 0 Then
|
||||
If PorcentajeIVA > 0 Then Timbre.ComplementoPagos.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "T", .Base = VentaImportePago * PorcentajeIVA, .TasaOCuota = PorcentajeIVA, .Impuesto = "002"})
|
||||
'Timbre.ComplementoPagos.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "R", .Base = 0, .TasaOCuota = 0, .Impuesto = "002"})
|
||||
' Next
|
||||
' End If
|
||||
' 'If drr("IVA").ToString.ToDouble > 0 Then
|
||||
' If PorcentajeIVA > 0 Then Timbre.ComplementoPagos.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "T", .Base = VentaImportePago * PorcentajeIVA, .TasaOCuota = PorcentajeIVA, .Impuesto = "002"})
|
||||
' 'Timbre.ComplementoPagos.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "R", .Base = 0, .TasaOCuota = 0, .Impuesto = "002"})
|
||||
|
||||
If PorcentajeIEPS > 0 Then Timbre.ComplementoPagos.Impuestos.Add(New CFDIConceptosImpuestos With {.Base = VentaImportePago * PorcentajeIEPS, .TasaOCuota = PorcentajeIEPS, .Impuesto = "003"})
|
||||
' If PorcentajeIEPS > 0 Then Timbre.ComplementoPagos.Impuestos.Add(New CFDIConceptosImpuestos With {.Base = VentaImportePago * PorcentajeIEPS, .TasaOCuota = PorcentajeIEPS, .Impuesto = "003"})
|
||||
|
||||
|
||||
'Next
|
||||
' 'Next
|
||||
|
||||
Return Timbre
|
||||
' Return Timbre
|
||||
|
||||
End Function
|
||||
'End Function
|
||||
|
||||
Public Function PreparaTimbrePago40(EmisorRFC As String, EmisorNombre As String, EmisorRegimenFiscal As String,
|
||||
ReceptorRFC As String, ReceptorNombre As String, ReceptorDomicilioFiscal As String, ReceptorRegimenFiscal As String,
|
||||
@@ -2732,8 +2729,8 @@ Public Class Timbrado
|
||||
doc.ImpPagado,
|
||||
doc.ImpSaldoInsoluto,
|
||||
doc.ObjetoImpuesto)
|
||||
If doc.Impuestos IsNot Nothing Then
|
||||
|
||||
If doc.Impuestos IsNot Nothing Then
|
||||
''retenciones
|
||||
If (doc.Impuestos).Where(Function(x) x.TrasladooRetencion = "R").Count > 0 Then
|
||||
Dim j As Integer = 0
|
||||
@@ -2744,7 +2741,6 @@ Public Class Timbrado
|
||||
j += 1
|
||||
Next
|
||||
End If
|
||||
|
||||
''traslados
|
||||
If (doc.Impuestos).Where(Function(x) x.TrasladooRetencion = "T").Count > 0 Then
|
||||
Dim j As Integer = 0
|
||||
@@ -2756,7 +2752,6 @@ Public Class Timbrado
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
If (docp.Retenciones).Count > 0 Then
|
||||
@@ -2974,8 +2969,6 @@ Public Class Timbrado
|
||||
Alert($"Error al leer la llave privada: {ex.Message}", TipoMensaje.MsgError)
|
||||
Return "Error al leer la llave privada"
|
||||
End Try
|
||||
|
||||
|
||||
Try
|
||||
certByte = System.IO.File.ReadAllBytes(ArchivoCertificado)
|
||||
certBase64 = Convert.ToBase64String(certByte)
|
||||
@@ -2986,13 +2979,11 @@ Public Class Timbrado
|
||||
End Try
|
||||
#End Region
|
||||
|
||||
|
||||
sw.Stop()
|
||||
swTiempo.AppendFormat("Verificado : ({0}) {1} ", sw.ElapsedMilliseconds - swmili, sw.ElapsedMilliseconds)
|
||||
swmili = sw.ElapsedMilliseconds
|
||||
sw.Start()
|
||||
|
||||
|
||||
Dim RespGeneracionXML As String = GenerarXMLGoCFDIv40(cfdi, EmisorRFC, ArchivoCertificado, llaveBase64, Clave, Ventas, UsuarioActual, CvePACEspecial)
|
||||
|
||||
sw.Stop()
|
||||
@@ -3012,7 +3003,6 @@ Public Class Timbrado
|
||||
'Verifica el error
|
||||
If cfdi.Mensaje = "" Then
|
||||
Dim SelloCfdi As String
|
||||
|
||||
UUID = cfdi.CfdiInfo.UUID
|
||||
SelloCfdi = cfdi.CfdiInfo.SelloCfdi
|
||||
|
||||
|
||||
BIN
Bin/GoCfdi.dll
BIN
Bin/GoCfdi.dll
Binary file not shown.
@@ -1254,7 +1254,7 @@ Partial Class PopUpVerFactura
|
||||
Dim CveAlmacenTransitorioRecepcion As Integer = If(UrlParametros("CVEALMACENTRANSITORIORECEPCION") Is Nothing, -1, (UrlParametros("CVEALMACENTRANSITORIORECEPCION").ToString.ToEntero))
|
||||
Dim FolioBusquedaTrasitorio As Integer = If(UrlParametros("FOLIOBUSQUEDATRASITORIO") Is Nothing, -1, (UrlParametros("FOLIOBUSQUEDATRASITORIO").ToString.ToEntero))
|
||||
|
||||
Dim Consola As String = If(UrlParametros("CVEMOVIMIENTO") IsNot Nothing, UrlParametros("CVEMOVIMIENTO").ToString.Trim, "")
|
||||
Dim Consola As String = If(UrlParametros("CONSOLA") IsNot Nothing, UrlParametros("CONSOLA").ToString.Trim, "")
|
||||
|
||||
CargaMovimientosAlmacen(UrlParametros("CVEMOVIMIENTO").ToString.ToEntero, Resumen:=False, EsTransitorio:=EsTransitorio, CveAlmacenRecepcion:=CveAlmacenRecepcion, CveAlmacenTransitorioRecepcion:=CveAlmacenTransitorioRecepcion,
|
||||
FolioBusquedaTrasitorio:=FolioBusquedaTrasitorio, Consola:=Consola)
|
||||
@@ -1301,13 +1301,20 @@ Partial Class PopUpVerFactura
|
||||
End If
|
||||
End If
|
||||
|
||||
'IMPRIME VALE
|
||||
'IMPRIME ACUSE
|
||||
If UrlParametros("OP").ToString = "CAN" Then
|
||||
If UrlParametros("CVEVTA") IsNot Nothing AndAlso UrlParametros("CVEVTA").ToString.ToEntero > 0 Then
|
||||
ImprimeCancelacion(UrlParametros("CVEVTA").ToString.ToEntero)
|
||||
End If
|
||||
End If
|
||||
|
||||
'IMPRIME ETIQUETA
|
||||
If UrlParametros("OP").ToString = "ETIQUETA" Then
|
||||
If UrlParametros("PRODUCTOS") IsNot Nothing AndAlso UrlParametros("CVEPRECIOLISTA").ToString.ToEntero > 0 Then
|
||||
ImprimeEtiqueta(UrlParametros("PRODUCTOS").ToString, UrlParametros("CVEPRECIOLISTA").ToString.ToEntero)
|
||||
End If
|
||||
End If
|
||||
|
||||
'IMPRIME AFR
|
||||
If UrlParametros("OP").ToString = "AFR" Then
|
||||
If UrlParametros("CVEAFR") IsNot Nothing AndAlso UrlParametros("CVEAFR").ToString.ToEntero > 0 Then
|
||||
@@ -6020,6 +6027,25 @@ Partial Class PopUpVerFactura
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region "OP = 'E T I Q U E T A'"
|
||||
Public Sub ImprimeEtiqueta(CvesProductos As String, CvePrecioLista As Integer)
|
||||
Dim DtPrecios As DataTable = Nothing
|
||||
|
||||
Dim ObjVentas As New ClsProductosServicios
|
||||
If ObjVentas.GetPSPrecios(CvePrecioLista, CvesProductos) AndAlso ObjVentas.DtResultados IsNot Nothing AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then
|
||||
DtPrecios = ObjVentas.DtResultados.Copy()
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
|
||||
If DtPrecios IsNot Nothing Then
|
||||
Dim DirectorioArchivo As String = "Empresas/Grales/Formatos/Etiqueta.mrt"
|
||||
Dim params As New List(Of ReportParameter)
|
||||
|
||||
ImprimirPDFStimul(DirectorioArchivo, DtPrecios, params, "Precios")
|
||||
End If
|
||||
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region "IMPRESION POLIZAS"
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ Partial Class Inventarios_EntradasSalidas
|
||||
End Property
|
||||
Public Property CveConcepto() As Integer
|
||||
Get
|
||||
Return ViewState("CveConcepto").ToString.ToEntero
|
||||
Return IfNull(ViewState("CveConcepto"), "").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveConcepto") = value
|
||||
@@ -1249,6 +1249,8 @@ Partial Class Inventarios_EntradasSalidas
|
||||
DdlAlmacen.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
DdlAlmacen.DataBind()
|
||||
DdlAlmacen.SelectedIndex = 1 'toma el primer renglón
|
||||
DdlConcepto.Items.Insert(0, New ListItem("Entrada Usados", "42"))
|
||||
DdlConcepto.SelectedValue = "42"
|
||||
|
||||
Dim ObjGenerales As New ClsGenerales()
|
||||
|
||||
|
||||
@@ -583,7 +583,7 @@
|
||||
</div>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Dividir" ItemStyle-Width="80px" ItemStyle-HorizontalAlign="Center" Visible="false">
|
||||
<asp:TemplateField HeaderText="Dividir" ItemStyle-Width="80px" ItemStyle-HorizontalAlign="Center" Visible="True">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox runat="server" ID="TxtDividir" Width="30px"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="SoloNumeros2" runat="server" TargetControlID="TxtDividir" FilterType="Custom, Numbers" ValidChars="." />
|
||||
|
||||
@@ -3,6 +3,16 @@
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
|
||||
<style type="text/css">
|
||||
|
||||
.customCalendarStyle
|
||||
{
|
||||
position: relative; /* Asegura que z-index funcione */
|
||||
z-index: 9999;
|
||||
}
|
||||
</style>
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
Paquetes | Armado - Desarmado
|
||||
@@ -186,7 +196,9 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body">
|
||||
<asp:GridView ID="GvDatosArmado" DataKeyNames="Cantidad,CvePS,CveUM,Consec,AplicaSeccion,AplicaSerie,AplicaCaducidad,AplicaLote" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron datos con los filtros especificados" CssClass="table table-striped table-hover ScrollAD Widthall" BorderColor="#D3D3D3" data-heighterror="450" data-freezerows="1" GridLines="None">
|
||||
<asp:GridView ID="GvDatosArmado"
|
||||
DataKeyNames="Cantidad,CvePS,CveUM,Consec,AplicaSeccion,AplicaSerie,AplicaCaducidad,AplicaLote,CodigoPS" runat="server" AutoGenerateColumns="false"
|
||||
EmptyDataText="No se encontraron datos con los filtros especificados" CssClass="table table-striped table-hover Widthall" BorderColor="#D3D3D3" GridLines="None">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="Cant. Necesaria" DataField="Cantidad" ItemStyle-Width="15%" DataFormatString="{0:###,###,###,##0.##}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Cant. Disponible" DataField="CantidadDisponible2" ItemStyle-Width="15%" DataFormatString="{0:###,###,###,##0.##}" ItemStyle-HorizontalAlign="Right" />
|
||||
@@ -210,7 +222,8 @@
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Fecha Caducidad">
|
||||
<ItemTemplate>
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 120px !important; padding: 0px;">
|
||||
|
||||
<%-- <div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 120px !important; padding: 0px;">
|
||||
<asp:TextBox ID="TxtCaducidad" Text="" CssClass="form-control input-sm ADSMaskDate" Style="width: 78px" runat="server" Visible="false" Enabled="false"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton runat="server" ID="LnkCaducidad" class="btn default" Visible="false" Enabled="false"> <i class="fa fa-calendar"></i> </asp:LinkButton>
|
||||
@@ -220,12 +233,38 @@
|
||||
<asp:RequiredFieldValidator ID="RFVCaducidad" runat="server" ControlToValidate="TxtCaducidad" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Caducidad''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCECaducidad" runat="server" HighlightCssClass="vco" TargetControlID="RFVCaducidad"></ajax:ValidatorCalloutExtender>
|
||||
</span>
|
||||
</div>
|
||||
</div>--%>
|
||||
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 120px !important; padding: 0px;" runat="server" visible="false" id="DvFechaCaducidad" >
|
||||
<asp:TextBox ID="TxtCaducidad" Text="" CssClass="form-control input-sm ADSMaskDate" Style="width: 87px" runat="server" ></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton runat="server" ID="LnkCaducidad" class="btn default" > <i class="fa fa-calendar"></i> </asp:LinkButton>
|
||||
</span>
|
||||
<ajax:MaskedEditExtender ID="MEECaducidad" runat="server" TargetControlID="TxtCaducidad" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CECaducidad" TargetControlID="TxtCaducidad" PopupButtonID="LnkCaducidad" PopupPosition="TopLeft" Format="dd/MM/yyyy"
|
||||
> </ajax:CalendarExtender>
|
||||
|
||||
|
||||
<asp:RequiredFieldValidator ID="RFVCaducidad" runat="server" ControlToValidate="TxtCaducidad" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Caducidad''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCECaducidad" runat="server" HighlightCssClass="vco" TargetControlID="RFVCaducidad"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Dividir " ItemStyle-Width="80px" ItemStyle-HorizontalAlign="Center" Visible="True">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox runat="server" ID="TxtDividir" Width="30px" onkeydown="return evitarPostBack(event);"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="SoloNumeros2" runat="server" TargetControlID="TxtDividir" FilterType="Custom, Numbers" ValidChars="." />
|
||||
<asp:Button runat="server" ID="BtnDividir" Text="Dividir" OnClick="Dividir" Style="display: none;" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
|
||||
<asp:HiddenField runat="server" ClientIDMode="Static" ID="HdnCantidadMovimiento" />
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
@@ -468,7 +507,22 @@
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Fecha Caducidad">
|
||||
<ItemTemplate>
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 120px !important; padding: 0px;">
|
||||
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 120px !important; padding: 0px;" runat="server" visible="false" id="DvFechaCaducidad" >
|
||||
<asp:TextBox ID="TxtCaducidad" Text="" CssClass="form-control input-sm ADSMaskDate" Style="width: 87px" runat="server" ></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton runat="server" ID="LnkCaducidad" class="btn default" > <i class="fa fa-calendar"></i> </asp:LinkButton>
|
||||
</span>
|
||||
<ajax:MaskedEditExtender ID="MEECaducidad" runat="server" TargetControlID="TxtCaducidad" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CECaducidad" TargetControlID="TxtCaducidad" PopupButtonID="LnkCaducidad" PopupPosition="TopLeft" Format="dd/MM/yyyy"
|
||||
> </ajax:CalendarExtender>
|
||||
|
||||
|
||||
<asp:RequiredFieldValidator ID="RFVCaducidad" runat="server" ControlToValidate="TxtCaducidad" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Caducidad''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCECaducidad" runat="server" HighlightCssClass="vco" TargetControlID="RFVCaducidad"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
|
||||
<%--<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 120px !important; padding: 0px;">
|
||||
<asp:TextBox ID="TxtCaducidad" Text="" CssClass="form-control input-sm ADSMaskDate" Style="width: 78px" runat="server" Visible="false" Enabled="false"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton runat="server" ID="LnkCaducidad" class="btn default" Visible="false" Enabled="false"> <i class="fa fa-calendar"></i> </asp:LinkButton>
|
||||
@@ -478,9 +532,17 @@
|
||||
<asp:RequiredFieldValidator ID="RFVCaducidad" runat="server" ControlToValidate="TxtCaducidad" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Caducidad''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCECaducidad" runat="server" HighlightCssClass="vco" TargetControlID="RFVCaducidad"></ajax:ValidatorCalloutExtender>
|
||||
</span>
|
||||
</div>
|
||||
</div>--%>
|
||||
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Dividir " ItemStyle-Width="80px" ItemStyle-HorizontalAlign="Center" Visible="True">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox runat="server" ID="TxtDividir" Width="30px" onkeydown="return evitarPostBack(event);" ></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="SoloNumeros2" runat="server" TargetControlID="TxtDividir" FilterType="Custom, Numbers" ValidChars="." />
|
||||
<asp:Button runat="server" ID="BtnDividir" Text="Dividir" OnClick="DividirDesarmado" Style="display: none;" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
|
||||
@@ -630,6 +692,40 @@
|
||||
snd.currentTime = 0;
|
||||
}
|
||||
|
||||
|
||||
function Dividir(t) {
|
||||
$get("HdnCantidadMovimiento").value = $get(t).value;
|
||||
}
|
||||
|
||||
function LimitaCantidad(C, textbox, button) {
|
||||
|
||||
// var contenedor = $(textbox).parent().find("#" + buttonIdDiv);
|
||||
|
||||
if (ToDouble(textbox.value) >= C) {
|
||||
textbox.value = "";
|
||||
}
|
||||
|
||||
if (parseFloat(textbox.value) > 0) {
|
||||
$get(button).style.display = "";
|
||||
//$(contenedor).show();
|
||||
}
|
||||
else {
|
||||
$get(button).style.display = "none";
|
||||
//$(contenedor).hide();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function evitarPostBack(event) {
|
||||
if (event.keyCode === 13) {
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
</asp:Content>
|
||||
|
||||
|
||||
@@ -124,6 +124,38 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
|
||||
ViewState("DtExistenciasDesarmado") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Private Property DtDatosArmado As DataTable
|
||||
Get
|
||||
If ViewState("DtDatosArmado") Is Nothing Then
|
||||
ViewState("DtDatosArmado") = New DataTable
|
||||
End If
|
||||
|
||||
Return CType(ViewState("DtDatosArmado"), DataTable)
|
||||
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtDatosArmado") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Private Property DtDatosDesArmado As DataTable
|
||||
Get
|
||||
If ViewState("DtDatosDesArmado") Is Nothing Then
|
||||
ViewState("DtDatosDesArmado") = New DataTable
|
||||
End If
|
||||
|
||||
Return CType(ViewState("DtDatosDesArmado"), DataTable)
|
||||
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtDatosDesArmado") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
@@ -217,20 +249,20 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
|
||||
Limpia(TipoMovimiento)
|
||||
|
||||
Dim ObjProductosServicios As New ClsProductosServicios
|
||||
Dim DtDatos As New DataTable
|
||||
DtDatosArmado = New DataTable
|
||||
|
||||
Dim drP As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlPaqueteArmado.SelectedValue.ToEntero).FiltroPrimero("")
|
||||
|
||||
Dim CveUMTemp As Integer = drP("CveUM").ToString.ToEntero
|
||||
If ObjProductosServicios.GetPaqueteDetalle(DdlPaqueteArmado.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, CveUMTemp, TxtCantidadArmado.Text.ToDouble, DdlAlmacenArmado.SelectedValue.ToEntero, TxtFechaArmado.Text.ToDate, CveVendedor:=CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente)) Then
|
||||
DtDatos = ObjProductosServicios.DtResultados.FiltraParametros("CveTipoPS = 2").Copy
|
||||
DtDatosArmado = ObjProductosServicios.DtResultados.FiltraParametros("CveTipoPS = 2").Copy
|
||||
Else
|
||||
DtDatos = Nothing
|
||||
DtDatosArmado = Nothing
|
||||
Alert("Ocurrió un error al obtener los componentes del paquete. Por favor vuelva a intentar.", TipoMensaje.MsgError)
|
||||
End If
|
||||
ObjProductosServicios.Dispose()
|
||||
|
||||
If DtDatos Is Nothing Then
|
||||
If DtDatosArmado Is Nothing Then
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
@@ -238,15 +270,15 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
|
||||
CveCliente = If(RowClienteArmado.Visible, DdlClienteArmado.SelectedValue.ToEntero, -1)
|
||||
|
||||
|
||||
If DtDatos.Rows.Count > 0 Then
|
||||
For Each Dr As DataRow In DtDatos.Rows
|
||||
If DtDatosArmado.Rows.Count > 0 Then
|
||||
For Each Dr As DataRow In DtDatosArmado.Rows
|
||||
Dr("Cantidad") = Dr("Cantidad").ToString.ToDecimal * TxtCantidadArmado.Text.ToDecimal
|
||||
Next
|
||||
End If
|
||||
|
||||
Dim TextoExistencias As String = "No hay existencia suficiente de los siguientes componentes: <br/><br/>"
|
||||
Dim ErrorExistencias As Boolean = False
|
||||
For Each Dr As DataRow In DtDatos.Rows
|
||||
For Each Dr As DataRow In DtDatosArmado.Rows
|
||||
If Dr("CantidadDisponible2").ToString.ToDecimal < Dr("Cantidad").ToString.ToDecimal Then
|
||||
TextoExistencias += $"<br/>- Componente: <b>""{Dr("CodigoPS")}""</b>."
|
||||
ErrorExistencias = True
|
||||
@@ -280,13 +312,13 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
|
||||
CvePaqueteArmado = DdlPaqueteArmado.SelectedValue.ToEntero
|
||||
CveAlmacenArmado = DdlAlmacenArmado.SelectedValue.ToEntero
|
||||
|
||||
GvDatosArmado.DataSource = DtDatos
|
||||
GvDatosArmado.DataSource = DtDatosArmado
|
||||
GvDatosArmado.DataBind()
|
||||
|
||||
GvDatosArmado.Columns(4).Visible = DtDatos.MAX("AplicaSerie", "") = "True"
|
||||
GvDatosArmado.Columns(5).Visible = DtDatos.MAX("AplicaSeccion") = "True"
|
||||
GvDatosArmado.Columns(6).Visible = DtDatos.MAX("AplicaLote") = "True"
|
||||
GvDatosArmado.Columns(7).Visible = DtDatos.MAX("AplicaCaducidad") = "True"
|
||||
GvDatosArmado.Columns(4).Visible = DtDatosArmado.MAX("AplicaSerie", "") = "True"
|
||||
GvDatosArmado.Columns(5).Visible = DtDatosArmado.MAX("AplicaSeccion") = "True"
|
||||
GvDatosArmado.Columns(6).Visible = DtDatosArmado.MAX("AplicaLote") = "True"
|
||||
GvDatosArmado.Columns(7).Visible = DtDatosArmado.MAX("AplicaCaducidad") = "True"
|
||||
|
||||
'If ErrorExistencias Then
|
||||
' GvDatosArmado.Columns(4).Visible = False
|
||||
@@ -338,23 +370,23 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
|
||||
|
||||
|
||||
Dim ObjProductosServicios As New ClsProductosServicios
|
||||
Dim DtDatos As New DataTable
|
||||
DtDatosDesArmado = New DataTable
|
||||
|
||||
|
||||
If ObjProductosServicios.GetPaqueteDetalle(DdlPaqueteDesarmado.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, CveUMTemp, TxtCantidadDesarmado.Text.ToDouble, DdlAlmacenArmado.SelectedValue.ToEntero, TxtFechaArmado.Text.ToDate, CveVendedor:=CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente)) Then
|
||||
DtDatos = ObjProductosServicios.DtResultados.FiltraParametros("CveTipoPS = 2").Copy
|
||||
DtDatosDesArmado = ObjProductosServicios.DtResultados.FiltraParametros("CveTipoPS = 2").Copy
|
||||
Else
|
||||
DtDatos = Nothing
|
||||
DtDatosDesArmado = Nothing
|
||||
Alert("Ocurrió un error al obtener los componentes del paquete. Por favor vuelva a intentar.", TipoMensaje.MsgError)
|
||||
End If
|
||||
ObjProductosServicios.Dispose()
|
||||
|
||||
If DtDatos Is Nothing Then
|
||||
If DtDatosDesArmado Is Nothing Then
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If DtDatos.Rows.Count > 0 Then
|
||||
For Each Dr As DataRow In DtDatos.Rows
|
||||
If DtDatosDesArmado.Rows.Count > 0 Then
|
||||
For Each Dr As DataRow In DtDatosDesArmado.Rows
|
||||
Dr("Cantidad") = Dr("Cantidad").ToString.ToDecimal * TxtCantidadDesarmado.Text.ToDecimal
|
||||
Next
|
||||
End If
|
||||
@@ -372,13 +404,13 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
|
||||
CvePaqueteDesarmado = DdlPaqueteDesarmado.SelectedValue.ToEntero
|
||||
CveAlmacenDesarmado = DdlAlmacenDesarmado.SelectedValue.ToEntero
|
||||
|
||||
GvDatosDesarmado.DataSource = DtDatos
|
||||
GvDatosDesarmado.DataSource = DtDatosDesArmado
|
||||
GvDatosDesarmado.DataBind()
|
||||
|
||||
GvDatosArmado.Columns(4).Visible = DtDatos.MAX("AplicaSerie", "") = "True"
|
||||
GvDatosArmado.Columns(5).Visible = DtDatos.MAX("AplicaSeccion") = "True"
|
||||
GvDatosArmado.Columns(6).Visible = DtDatos.MAX("AplicaLote") = "True"
|
||||
GvDatosArmado.Columns(7).Visible = DtDatos.MAX("AplicaCaducidad") = "True"
|
||||
GvDatosArmado.Columns(4).Visible = DtDatosDesArmado.MAX("AplicaSerie", "") = "True"
|
||||
GvDatosArmado.Columns(5).Visible = DtDatosDesArmado.MAX("AplicaSeccion") = "True"
|
||||
GvDatosArmado.Columns(6).Visible = DtDatosDesArmado.MAX("AplicaLote") = "True"
|
||||
GvDatosArmado.Columns(7).Visible = DtDatosDesArmado.MAX("AplicaCaducidad") = "True"
|
||||
|
||||
BtnGuadarDesarmado.Visible = True
|
||||
|
||||
@@ -458,6 +490,91 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
|
||||
End If
|
||||
|
||||
|
||||
Dim TextoError As New StringBuilder
|
||||
If Tipo = 1 Then
|
||||
Dim ObjInventarioVal As New ClsInventarios
|
||||
Dim StrXML As New StringBuilder
|
||||
StrXML.Append("<conceptos>")
|
||||
Dim FechaCaducidad As Date
|
||||
Dim Lote As String = ""
|
||||
|
||||
Dim TieneErrorExistencia As Boolean = False
|
||||
|
||||
For Each GvRow As GridViewRow In GvDatosArmado.Rows
|
||||
|
||||
FechaCaducidad = If(CBool(GvRow.DataKey("AplicaCaducidad")) AndAlso GvRow.FCTextBox("TxtCaducidad").ToString().ToDate > MinFecha, GvRow.FCTextBox("TxtCaducidad").Text.ToDate, MinFecha)
|
||||
Lote = If(CBool(GvRow.DataKey("AplicaLote")), GvRow.FCTextBox("TxtLote").Text.Trim, "-1")
|
||||
|
||||
Dim Existencia As Decimal = ObjInventarioVal.GetExistenciasPS(GvRow.DataKey("CvePS").ToEntero, GvRow.DataKey("CveUM").ToEntero, UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacenArmado.SelectedValue.ToEntero(), FechaMovto:=TxtFechaArmado.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), Serie:="-1", Lote:=Lote, FechaCaducidad:=FechaCaducidad)
|
||||
|
||||
|
||||
If GvRow.DataKey("Cantidad").ToDecimal > Existencia Then
|
||||
TieneErrorExistencia = True
|
||||
|
||||
TextoError.AppendFormat("<b> - {0}</b> Existencia: {1:#,##0.##} <br/>", GvRow.DataKey("CodigoPS"), Existencia)
|
||||
|
||||
End If
|
||||
|
||||
''If Dr("CantidadGV").ToString().ToDecimal > 0 Then
|
||||
'If CBool(GvRow.DataKey("AplicaSerie")) Then
|
||||
' Alert("Aplica serie ")
|
||||
' TieneErrorExistencia = True
|
||||
' ' StrXML.AppendFormat("<concepto CvePS=""{0}"" CveUM=""{1}"" Cantidad= ""{2}"" CveSeccionAlmacen=""{3}"" Serie=""{4}"" Lote=""{5}"" FechaCaducidad=""{6}""></concepto>", GvRow.DataKey("CvePS"), GvRow.DataKey("CveUM"), 1, IfNull(Dr("CveSeccion"), -1), Dr1("Serie"), Lote, FechaCaducidad.ToString("yyyy/MM/dd"))
|
||||
|
||||
'Else
|
||||
' StrXML.AppendFormat("<concepto CvePS=""{0}"" CveUM=""{1}"" Cantidad= ""{2}"" CveSeccionAlmacen=""{3}"" Serie=""{4}"" Lote=""{5}"" FechaCaducidad=""{6}""></concepto>", GvRow.DataKey("CvePS"), GvRow.DataKey("CveUM"), GvRow.DataKey("Cantidad"), -1, "-1", Lote, FechaCaducidad.ToString("yyyy/MM/dd"))
|
||||
'End If
|
||||
|
||||
'End If
|
||||
Next
|
||||
|
||||
'For Each Dr As DataRow In DtDatos.Rows
|
||||
' FechaCaducidad = If(CBool(Dr("AplicaCaducidad")) AndAlso Dr("FechaCaducidad").ToString() <> "", Dr("FechaCaducidad").ToString().ToDate, MinFecha)
|
||||
' Lote = If(CBool(Dr("AplicaLote")), Dr("Lote").ToString().Trim, "-1")
|
||||
|
||||
' If Dr("CantidadGV").ToString().ToDecimal > 0 Then
|
||||
' If CBool(Dr("AplicaSerie")) Then
|
||||
' DtDetalle = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", Dr("Consec")))
|
||||
' For Each Dr1 As DataRow In DtDetalle.Rows
|
||||
' StrXML.AppendFormat("<concepto CvePS=""{0}"" CveUM=""{1}"" Cantidad= ""{2}"" CveSeccionAlmacen=""{3}"" Serie=""{4}"" Lote=""{5}"" FechaCaducidad=""{6}""></concepto>", Dr1("CvePS"), Dr1("CveUM"), 1, IfNull(Dr("CveSeccion"), -1), Dr1("Serie"), Lote, FechaCaducidad.ToString("yyyy/MM/dd"))
|
||||
' Next
|
||||
' Else
|
||||
' StrXML.AppendFormat("<concepto CvePS=""{0}"" CveUM=""{1}"" Cantidad= ""{2}"" CveSeccionAlmacen=""{3}"" Serie=""{4}"" Lote=""{5}"" FechaCaducidad=""{6}""></concepto>", Dr("CvePS"), Dr("CveUM"), Dr("CantidadGV"), IfNull(Dr("CveSeccion"), -1), "-1", Lote, FechaCaducidad.ToString("yyyy/MM/dd"))
|
||||
' End If
|
||||
' End If
|
||||
'Next
|
||||
|
||||
'StrXML.Append("</conceptos>")
|
||||
|
||||
|
||||
'If ObjInventarioVal.GetExistenciasPSXML(StrXML.ToString(), DdlAlmacenArmado.SelectedValue.ToEntero(), TxtFechaArmado.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), -1, CveVendedor, If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), If(Tipo = 2, 1, -1), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
' If ObjInventarioVal.DtResultados.Rows.Count > 0 Then
|
||||
' TieneErrorExistencia = True
|
||||
' For Each Dr As DataRow In ObjInventarioVal.DtResultados.Rows
|
||||
' TextoError.AppendFormat("<b> - {0}</b> Existencia: {1:#,##0.##} <br/>", Dr("CodigoPS"), Dr("Existencia"))
|
||||
' Next
|
||||
' End If
|
||||
'Else
|
||||
' TieneErrorExistencia = True
|
||||
'End If
|
||||
|
||||
If TieneErrorExistencia Then
|
||||
'ObjInventarioVal.RollBack()
|
||||
ObjInventarioVal.Dispose()
|
||||
|
||||
If TextoError.Length > 0 Then
|
||||
Alert($" Lo(s) siguiente(s) Productos <b>no tienen</b> existencia suficiente:<br/><br/>{TextoError}", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
Exit Sub
|
||||
|
||||
|
||||
Dim ObjInventario As New ClsInventarios
|
||||
Dim ObjConta As New ClsContabilidad(ObjInventario.IniciaTransacSQL())
|
||||
|
||||
@@ -832,20 +949,25 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
|
||||
CargaSeccionesAlmacen(e.Row.FCDropDownList("DdlSeccionAlmacen"), DdlAlmacenArmado.SelectedValue.ToEntero, e.Row.DBCampo("CvePS").ToEntero, UsuarioActual.CveEmpresa)
|
||||
End If
|
||||
|
||||
|
||||
Dim DvFechaCaducidad As HtmlGenericControl = TryCast(e.Row.FindControl("DvFechaCaducidad"), HtmlGenericControl)
|
||||
|
||||
If e.Row.DataKey("AplicaCaducidad") = "True" Then
|
||||
e.Row.FCTextBox("TxtCaducidad").Visible = True
|
||||
e.Row.FCLinkButton("LnkCaducidad").Visible = True
|
||||
'e.Row.FCTextBox("TxtCaducidad").Visible = True
|
||||
'e.Row.FCLinkButton("LnkCaducidad").Visible = True
|
||||
|
||||
e.Row.FCTextBox("TxtCaducidad").ReadOnly = False
|
||||
CType(e.Row.FindControl("RFVCaducidad"), RequiredFieldValidator).Enabled = True
|
||||
e.Row.FCTextBox("TxtCaducidad").Enabled = True
|
||||
'e.Row.FCTextBox("TxtCaducidad").ReadOnly = False
|
||||
''CType(e.Row.FindControl("RFVCaducidad"), RequiredFieldValidator).Enabled = True
|
||||
'e.Row.FCTextBox("TxtCaducidad").Enabled = True
|
||||
DvFechaCaducidad.Visible = True
|
||||
Else
|
||||
e.Row.FCTextBox("TxtCaducidad").Visible = False
|
||||
e.Row.FCLinkButton("LnkCaducidad").Visible = False
|
||||
e.Row.FCTextBox("TxtCaducidad").Enabled = True
|
||||
'e.Row.FCTextBox("TxtCaducidad").Visible = False
|
||||
'e.Row.FCLinkButton("LnkCaducidad").Visible = False
|
||||
'e.Row.FCTextBox("TxtCaducidad").Enabled = True
|
||||
|
||||
e.Row.FCTextBox("TxtCaducidad").ReadOnly = True
|
||||
CType(e.Row.FindControl("RFVCaducidad"), RequiredFieldValidator).Enabled = False
|
||||
'e.Row.FCTextBox("TxtCaducidad").ReadOnly = True
|
||||
''CType(e.Row.FindControl("RFVCaducidad"), RequiredFieldValidator).Enabled = False
|
||||
DvFechaCaducidad.Visible = False
|
||||
End If
|
||||
|
||||
e.Row.FCTextBox("TxtLote").Visible = e.Row.DataKey("AplicaLote") = "True"
|
||||
@@ -855,8 +977,120 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
|
||||
' e.Row.FCTextBox("TbCantidadF").Enabled = False
|
||||
'End If
|
||||
|
||||
e.Row.FCButton("BtnDividir").Attributes.Add("onclick", String.Format("Dividir('{0}');", e.Row.FCTextBox("TxtDividir").ClientID))
|
||||
e.Row.FCButton("BtnDividir").CommandArgument = e.Row.RowIndex.ToString()
|
||||
e.Row.FCTextBox("TxtDividir").Attributes.Add("onkeyup", String.Format("LimitaCantidad({0},this,'{1}');", e.Row.DBCampo("Cantidad"), e.Row.FCButton("BtnDividir").ClientID))
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub Dividir(sender As Object, e As EventArgs)
|
||||
Dim index2 As Integer = 0
|
||||
|
||||
If Not DtDatosArmado.Columns.Contains("Lote") Then
|
||||
DtDatosArmado.Columns.Add("Lote", GetType(String))
|
||||
End If
|
||||
|
||||
If Not DtDatosArmado.Columns.Contains("CveSeccion") Then
|
||||
DtDatosArmado.Columns.Add("CveSeccion", GetType(Integer))
|
||||
End If
|
||||
|
||||
If Not DtDatosArmado.Columns.Contains("FechaCaducidad") Then
|
||||
DtDatosArmado.Columns.Add("FechaCaducidad", GetType(String))
|
||||
End If
|
||||
|
||||
DtDatosArmado.AcceptChanges()
|
||||
|
||||
For Each Row As DataRow In DtDatosArmado.Rows
|
||||
|
||||
|
||||
Row("Lote") = GvDatosArmado.Rows(index2).FCTextBox("TxtLote").Text
|
||||
'End If
|
||||
'If GvDatosArmado.Rows(index2).FCDropDownList("DdlSeccionAlmacen").SelectedValue <> "-1" Then
|
||||
Row("CveSeccion") = GvDatosArmado.Rows(index2).FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero()
|
||||
' End If
|
||||
'If GvDatosArmado.Rows(index2).FCTextBox("TxtCaducidad").Text <> "" Then
|
||||
Row("FechaCaducidad") = GvDatosArmado.Rows(index2).FCTextBox("TxtCaducidad").Text
|
||||
'End If
|
||||
index2 += 1
|
||||
Next
|
||||
|
||||
DtDatosArmado.AcceptChanges()
|
||||
|
||||
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, Button)).NamingContainer, GridViewRow)
|
||||
Dim Index As Integer = gvRow.RowIndex
|
||||
Dim Cantidad As String = HdnCantidadMovimiento.Value
|
||||
Dim drOriginal As DataRow = DtDatosArmado.Rows(Index)
|
||||
Dim drNew As DataRow = DtDatosArmado.NewRow
|
||||
|
||||
drNew.ItemArray = drOriginal.ItemArray
|
||||
|
||||
drOriginal("Cantidad") = (drOriginal("Cantidad").ToString().ToDouble - Cantidad.ToDouble)
|
||||
|
||||
'Dim CantidadFOriginal As Double = drOriginal("CantidadF").ToString().ToDouble
|
||||
'drOriginal("CantidadF") = (drOriginal("CantidadF").ToString().ToDouble - Cantidad.ToDouble)
|
||||
|
||||
'Dim CantidadSOriginal As Double = drOriginal("CantidadS").ToString().ToDouble
|
||||
'drOriginal("CantidadS") = (CantidadSOriginal * drOriginal("CantidadF").ToString().ToDouble) / CantidadFOriginal
|
||||
|
||||
'Dim CantidadSeleccionadaOriginal As Double = drOriginal("CantidadSeleccionada").ToString().ToDouble
|
||||
'drOriginal("CantidadSeleccionada") = If(CantidadSeleccionadaOriginal > drOriginal("CantidadF").ToString().ToDouble, drOriginal("CantidadF").ToString().ToDouble, CantidadSeleccionadaOriginal)
|
||||
|
||||
'CantidadSeleccionadaOriginal = CantidadSeleccionadaOriginal - drOriginal("CantidadF").ToString().ToDouble
|
||||
|
||||
'Dim CostoIndirectoOriginal As Double = dr1("CostoIndirecto").ToString().ToDouble
|
||||
'dr1("CostoIndirecto") = (CostoIndirectoOriginal * dr1("CantidadF").ToString().ToDouble) / CantidadFOriginal
|
||||
'Dim CostoIndirectoExtranjeroOriginal As Double = dr1("CostoIndirectoExtranjero").ToString().ToDouble
|
||||
'dr1("CostoIndirectoExtranjero") = (CostoIndirectoExtranjeroOriginal * dr1("CantidadF").ToString().ToDouble) / CantidadFOriginal
|
||||
|
||||
DtDatosArmado.AcceptChanges()
|
||||
|
||||
drNew("Cantidad") = Cantidad.ToDecimal
|
||||
'drNew("CantidadF") = Cantidad.ToDouble
|
||||
'drNew("CantidadS") = (CantidadSOriginal * drNew("CantidadF").ToString().ToDouble) / CantidadFOriginal
|
||||
'drNew("CantidadSeleccionada") = If(CantidadSeleccionadaOriginal > 0, CantidadSeleccionadaOriginal, 0)
|
||||
'drNew("Seleccionado") = If(CantidadSeleccionadaOriginal > 0, True, False)
|
||||
'dr("CostoIndirecto") = (CostoIndirectoOriginal * dr("CantidadF").ToString().ToDouble) / CantidadFOriginal
|
||||
'dr("CostoIndirectoExtranjero") = (CostoIndirectoExtranjeroOriginal * dr("CantidadF").ToString().ToDouble) / CantidadFOriginal
|
||||
DtDatosArmado.Rows.InsertAt(drNew, Index)
|
||||
DtDatosArmado.AcceptChanges()
|
||||
|
||||
index2 = 1
|
||||
For Each Row As DataRow In DtDatosArmado.Rows
|
||||
Row("Consec") = index2
|
||||
index2 += 1
|
||||
Next
|
||||
DtDatosArmado.AcceptChanges()
|
||||
|
||||
|
||||
GvDatosArmado.DataSource = DtDatosArmado
|
||||
GvDatosArmado.DataBind()
|
||||
|
||||
|
||||
index2 = 0
|
||||
For Each Row As DataRow In DtDatosArmado.Rows
|
||||
'GvDatosArmado.Rows(index2).FCCheckBox("cbInv").Checked = CBool(Row("Seleccionado"))
|
||||
'If Row("CantidadSeleccionada").ToString() <> "" Then
|
||||
' GvDatosArmado.Rows(index2).FCTextBox("TbCantidadF").Text = Row("CantidadSeleccionada").ToString()
|
||||
'End If
|
||||
If Row("Lote").ToString() <> "" Then
|
||||
GvDatosArmado.Rows(index2).FCTextBox("TxtLote").Text = Row("Lote").ToString()
|
||||
End If
|
||||
If Row("CveSeccion").ToString() <> "" Then
|
||||
GvDatosArmado.Rows(index2).FCDropDownList("DdlSeccionAlmacen").SelectedValue = Row("CveSeccion").ToString()
|
||||
End If
|
||||
If Row("FechaCaducidad").ToString() <> "" Then
|
||||
GvDatosArmado.Rows(index2).FCTextBox("TxtCaducidad").Text = Row("FechaCaducidad").ToString().ToDate.ToShortDateString
|
||||
End If
|
||||
index2 += 1
|
||||
Next
|
||||
|
||||
UpDatosArmado.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
#Region " GV DESARMADO "
|
||||
@@ -875,27 +1109,132 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
|
||||
CargaSeccionesAlmacen(e.Row.FCDropDownList("DdlSeccionAlmacen"), DdlAlmacenDesarmado.SelectedValue.ToEntero, e.Row.DBCampo("CvePS").ToEntero, UsuarioActual.CveEmpresa)
|
||||
End If
|
||||
|
||||
Dim DvFechaCaducidad As HtmlGenericControl = TryCast(e.Row.FindControl("DvFechaCaducidad"), HtmlGenericControl)
|
||||
|
||||
If e.Row.DataKey("AplicaCaducidad") = "True" Then
|
||||
e.Row.FCTextBox("TxtCaducidad").Visible = True
|
||||
e.Row.FCLinkButton("LnkCaducidad").Visible = True
|
||||
'e.Row.FCTextBox("TxtCaducidad").Visible = True
|
||||
'e.Row.FCLinkButton("LnkCaducidad").Visible = True
|
||||
|
||||
e.Row.FCTextBox("TxtCaducidad").ReadOnly = False
|
||||
CType(e.Row.FindControl("RFVCaducidad"), RequiredFieldValidator).Enabled = True
|
||||
e.Row.FCTextBox("TxtCaducidad").Enabled = True
|
||||
'e.Row.FCTextBox("TxtCaducidad").ReadOnly = False
|
||||
''CType(e.Row.FindControl("RFVCaducidad"), RequiredFieldValidator).Enabled = True
|
||||
'e.Row.FCTextBox("TxtCaducidad").Enabled = True
|
||||
DvFechaCaducidad.Visible = True
|
||||
Else
|
||||
e.Row.FCTextBox("TxtCaducidad").Visible = False
|
||||
e.Row.FCLinkButton("LnkCaducidad").Visible = False
|
||||
e.Row.FCTextBox("TxtCaducidad").Enabled = True
|
||||
'e.Row.FCTextBox("TxtCaducidad").Visible = False
|
||||
'e.Row.FCLinkButton("LnkCaducidad").Visible = False
|
||||
'e.Row.FCTextBox("TxtCaducidad").Enabled = True
|
||||
|
||||
e.Row.FCTextBox("TxtCaducidad").ReadOnly = True
|
||||
CType(e.Row.FindControl("RFVCaducidad"), RequiredFieldValidator).Enabled = False
|
||||
'e.Row.FCTextBox("TxtCaducidad").ReadOnly = True
|
||||
''CType(e.Row.FindControl("RFVCaducidad"), RequiredFieldValidator).Enabled = False
|
||||
DvFechaCaducidad.Visible = False
|
||||
End If
|
||||
|
||||
|
||||
|
||||
'If e.Row.DataKey("AplicaCaducidad") = "True" Then
|
||||
' e.Row.FCTextBox("TxtCaducidad").Visible = True
|
||||
' e.Row.FCLinkButton("LnkCaducidad").Visible = True
|
||||
|
||||
' e.Row.FCTextBox("TxtCaducidad").ReadOnly = False
|
||||
' CType(e.Row.FindControl("RFVCaducidad"), RequiredFieldValidator).Enabled = True
|
||||
' e.Row.FCTextBox("TxtCaducidad").Enabled = True
|
||||
'Else
|
||||
' e.Row.FCTextBox("TxtCaducidad").Visible = False
|
||||
' e.Row.FCLinkButton("LnkCaducidad").Visible = False
|
||||
' e.Row.FCTextBox("TxtCaducidad").Enabled = True
|
||||
|
||||
' e.Row.FCTextBox("TxtCaducidad").ReadOnly = True
|
||||
' CType(e.Row.FindControl("RFVCaducidad"), RequiredFieldValidator).Enabled = False
|
||||
'End If
|
||||
|
||||
e.Row.FCTextBox("TxtLote").Visible = e.Row.DataKey("AplicaLote") = "True"
|
||||
|
||||
e.Row.FCTextBox("TxtCosto").Attributes.Add("onkeyup", "SumaValores();")
|
||||
|
||||
|
||||
e.Row.FCButton("BtnDividir").Attributes.Add("onclick", String.Format("Dividir('{0}');", e.Row.FCTextBox("TxtDividir").ClientID))
|
||||
e.Row.FCButton("BtnDividir").CommandArgument = e.Row.RowIndex.ToString()
|
||||
e.Row.FCTextBox("TxtDividir").Attributes.Add("onkeyup", String.Format("LimitaCantidad({0},this,'{1}');", e.Row.DBCampo("Cantidad"), e.Row.FCButton("BtnDividir").ClientID))
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub DividirDesarmado(sender As Object, e As EventArgs)
|
||||
Dim index2 As Integer = 0
|
||||
|
||||
If Not DtDatosDesArmado.Columns.Contains("Lote") Then
|
||||
DtDatosDesArmado.Columns.Add("Lote", GetType(String))
|
||||
End If
|
||||
|
||||
If Not DtDatosDesArmado.Columns.Contains("CveSeccion") Then
|
||||
DtDatosDesArmado.Columns.Add("CveSeccion", GetType(Integer))
|
||||
End If
|
||||
|
||||
If Not DtDatosDesArmado.Columns.Contains("FechaCaducidad") Then
|
||||
DtDatosDesArmado.Columns.Add("FechaCaducidad", GetType(String))
|
||||
End If
|
||||
|
||||
DtDatosDesArmado.AcceptChanges()
|
||||
|
||||
For Each Row As DataRow In DtDatosDesArmado.Rows
|
||||
Row("Lote") = GvDatosDesarmado.Rows(index2).FCTextBox("TxtLote").Text
|
||||
Row("CveSeccion") = GvDatosDesarmado.Rows(index2).FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero()
|
||||
Row("FechaCaducidad") = GvDatosDesarmado.Rows(index2).FCTextBox("TxtCaducidad").Text
|
||||
index2 += 1
|
||||
Next
|
||||
|
||||
DtDatosDesArmado.AcceptChanges()
|
||||
|
||||
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, Button)).NamingContainer, GridViewRow)
|
||||
Dim Index As Integer = gvRow.RowIndex
|
||||
Dim Cantidad As String = HdnCantidadMovimiento.Value
|
||||
Dim drOriginal As DataRow = DtDatosDesArmado.Rows(Index)
|
||||
Dim drNew As DataRow = DtDatosDesArmado.NewRow
|
||||
|
||||
drNew.ItemArray = drOriginal.ItemArray
|
||||
|
||||
drOriginal("Cantidad") = (drOriginal("Cantidad").ToString().ToDouble - Cantidad.ToDouble)
|
||||
|
||||
|
||||
|
||||
DtDatosDesArmado.AcceptChanges()
|
||||
|
||||
drNew("Cantidad") = Cantidad.ToDecimal
|
||||
|
||||
DtDatosDesArmado.Rows.InsertAt(drNew, Index)
|
||||
DtDatosDesArmado.AcceptChanges()
|
||||
|
||||
index2 = 1
|
||||
For Each Row As DataRow In DtDatosDesArmado.Rows
|
||||
Row("Consec") = index2
|
||||
index2 += 1
|
||||
Next
|
||||
DtDatosDesArmado.AcceptChanges()
|
||||
|
||||
|
||||
GvDatosDesarmado.DataSource = DtDatosDesArmado
|
||||
GvDatosDesarmado.DataBind()
|
||||
|
||||
|
||||
index2 = 0
|
||||
For Each Row As DataRow In DtDatosDesArmado.Rows
|
||||
|
||||
If Row("Lote").ToString() <> "" Then
|
||||
GvDatosDesarmado.Rows(index2).FCTextBox("TxtLote").Text = Row("Lote").ToString()
|
||||
End If
|
||||
If Row("CveSeccion").ToString() <> "" Then
|
||||
GvDatosDesarmado.Rows(index2).FCDropDownList("DdlSeccionAlmacen").SelectedValue = Row("CveSeccion").ToString()
|
||||
End If
|
||||
If Row("FechaCaducidad").ToString() <> "" Then
|
||||
GvDatosDesarmado.Rows(index2).FCTextBox("TxtCaducidad").Text = Row("FechaCaducidad").ToString().ToDate.ToShortDateString
|
||||
End If
|
||||
index2 += 1
|
||||
Next
|
||||
|
||||
UpDatosDesarmado.Update()
|
||||
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region " SERIE LOTE "
|
||||
|
||||
@@ -3330,6 +3330,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
Dim CveConceptoContableCostoME As Integer = -1
|
||||
Dim CveConceptoContableCostoComplementaria As Integer = -1
|
||||
Dim UsaComplementariaFleteImportaciones As Boolean = True
|
||||
If UsuarioActual.CveEmpresa = 119 Then UsaComplementariaFleteImportaciones = False
|
||||
|
||||
If DtCostos.Rows.Count > 0 Then
|
||||
If CveCompraSurtir > 0 Then
|
||||
@@ -3356,7 +3357,6 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
CveConceptoContableCosto = 176
|
||||
CveConceptoContableCostoME = 228
|
||||
CveConceptoContableCostoComplementaria = 229
|
||||
|
||||
UsaComplementariaFleteImportaciones = True
|
||||
|
||||
Else
|
||||
@@ -3456,7 +3456,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(200) = "1" Then
|
||||
If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then
|
||||
MensajeContabilidad = $"<br>Movimiento contabilizado en el folio: <b><a class='Texto' href = '/Contabilidad/RegPoliza.aspx?IdPoliza={ObjConta.ContaIdPoliza}'>{ObjConta.ContaFolio}</a></b><br>"
|
||||
MensajeContabilidad = $"<br>Movimiento contabilizado en el folio: <b><a class='Texto' href = '/Contabilidad/RegPrePolizaS.aspx?CvePrePoliza={CvePrePoliza}'>{ObjConta.ContaFolio}</a></b><br>"
|
||||
Else
|
||||
ErrorMovInv = True
|
||||
MensajeError = "Error al contabilizar los conceptos contables"
|
||||
|
||||
@@ -2933,7 +2933,7 @@ Partial Class OS_OrdenesServicios
|
||||
If DtOSSubProyectos IsNot Nothing Then
|
||||
|
||||
If ObjOS.GetSubProyectosEstatusInicial(-1, 3, UsuarioActual.CveEmpresa) Then
|
||||
TecnicosSubProyectos = ObjOS.DtResultados
|
||||
TecnicosSubProyectos = ObjOS.DtResultados.FiltraParametros("Estatus = True") 'solo usuario activos
|
||||
End If
|
||||
|
||||
For Each SubProyecto As DataRow In DtOSSubProyectos.Rows
|
||||
@@ -2946,8 +2946,6 @@ Partial Class OS_OrdenesServicios
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
|
||||
ObjOS.Dispose()
|
||||
|
||||
DdlUsuarioAtendio.DataSource = TecnicosResultado.FiltraParametros("", "Nombre")
|
||||
|
||||
@@ -1025,15 +1025,18 @@
|
||||
|
||||
<div class="modal-body">
|
||||
<ul>
|
||||
|
||||
<li>{"TipoDocumento"}</li>
|
||||
<li>{"SerieFolio"}</li>
|
||||
<li>{"Total"}</li>
|
||||
<li>{"Fecha"}</li>
|
||||
<li>{"FechaVencimiento"}</li>
|
||||
<li>{"NombreEmpresa"}</li>
|
||||
<li>{"NombreCliente"}</li>
|
||||
<li>{"NombreCliente"}</li>
|
||||
<li>{"NombreCliente"}</li>
|
||||
<li>{"Vigencia"}</li>
|
||||
<li>{"Sucursal"}</li>
|
||||
<li>{"DescripcionVenta"}</li>
|
||||
<li>{"AtencionA"}</li>
|
||||
</ul>
|
||||
</div>
|
||||
<br />
|
||||
|
||||
@@ -21,6 +21,11 @@ Partial Class ListadoContratos
|
||||
DdlTipoAF.DataSource = GlobalDTTipoActivoFijo(UsuarioActual.CveEmpresa)
|
||||
DdlTipoAF.DataBind()
|
||||
DdlTipoAF.Items.Insert(0, New ListItem("-", ""))
|
||||
'Lista Chofer'
|
||||
DdlChofer.DataSource = GlobalDTRHPersonal(UsuarioActual.CveEmpresa) 'solo puesto operador.y activos
|
||||
DdlChofer.DataBind()
|
||||
DdlChofer.Items.Insert(0, New ListItem("-", ""))
|
||||
UpModal.Update()
|
||||
End Sub
|
||||
Private Sub CargaDatos()
|
||||
Dim ObjContratos As New ClsContratos
|
||||
|
||||
@@ -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,NumeroParte,Porcentaje,CodigoPS"
|
||||
<asp:GridView ID="GVPrecios" runat="server" GridLines="None" DataKeyNames="CvePS, CvePrecioLista,PrecioLista,PS,Codigo,NumeroParte,Porcentaje,CodigoPS,ProductoExhibicion"
|
||||
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%">
|
||||
|
||||
@@ -296,34 +296,49 @@ Partial Class Ventas_ActualizarPrecios
|
||||
Alert("Se debe de especificar un porcentaje.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
Dim Correcto As Boolean = False
|
||||
|
||||
Dim TieneError As Boolean = False
|
||||
'Dim Importe As Decimal = If(TxtImporte.Text = "", -1, TxtImporte.Text.ToDecimal)
|
||||
Dim Porcentaje As Decimal = If(TxtPorcentaje.Text = "", -1, TxtPorcentaje.Text.ToDecimal)
|
||||
|
||||
Dim MensajeAlert As New StringBuilder
|
||||
Dim sbProductos As New StringBuilder
|
||||
|
||||
Dim ObjPS As New ClsProductosServicios
|
||||
ObjPS.IniciaTransacSQL()
|
||||
|
||||
For Each row As GridViewRow In GVPrecios.Rows
|
||||
|
||||
If row.FCCheckBox("chkPS").Checked Then
|
||||
Correcto = ObjPS.UpdatePSPreciosLista(row.FCTextBox("TxtPrecio").Text.ToDecimal, DdlPrecioLista.SelectedValue.ToEntero, Porcentaje, row.DataKey("CvePS").ToEntero, UsuarioActual.CveUsuario, NowADS(), If(RblTipo.SelectedValue = "Imp", True, False), PrecioMinimo:=row.FCTextBox("TxtPrecioMinimo").Text.ToDecimal)
|
||||
|
||||
If Correcto Then
|
||||
TieneError = ActualizarPreciosFranquicia(ObjPS, row.DataKey("Codigo"), row.DataKey("PS"), row.FCTextBox("TxtPrecio").Text.ToDecimal, row.FCTextBox("TxtPrecioMinimo").Text.ToDecimal, DdlPrecioLista.SelectedItem.Text)
|
||||
Else
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
If Correcto AndAlso Not TieneError Then
|
||||
Alert("Los Precios de lista de los Productos/Servicios se actualizaron correctamente")
|
||||
End If
|
||||
Try
|
||||
For Each row As GridViewRow In GVPrecios.Rows
|
||||
If row.FCCheckBox("chkPS").Checked Then
|
||||
TieneError = Not ObjPS.UpdatePSPreciosLista(row.FCTextBox("TxtPrecio").Text.ToDecimal, DdlPrecioLista.SelectedValue.ToEntero, Porcentaje, row.DataKey("CvePS").ToEntero, UsuarioActual.CveUsuario, NowADS(), If(RblTipo.SelectedValue = "Imp", True, False), PrecioMinimo:=row.FCTextBox("TxtPrecioMinimo").Text.ToDecimal)
|
||||
If CBool(row.DataKey("ProductoExhibicion")) Then
|
||||
sbProductos.AppendFormat("{0},", row.DataKey("CvePS").ToEntero)
|
||||
End If
|
||||
|
||||
|
||||
If Not TieneError Then
|
||||
TieneError = ActualizarPreciosFranquicia(ObjPS, row.DataKey("Codigo"), row.DataKey("PS"), row.FCTextBox("TxtPrecio").Text.ToDecimal, row.FCTextBox("TxtPrecioMinimo").Text.ToDecimal, DdlPrecioLista.SelectedItem.Text)
|
||||
Else
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
|
||||
If Not TieneError Then
|
||||
If UsuarioActual.Empresa.Funcionalidad(109) = "1" AndAlso sbProductos.Length > 0 Then
|
||||
MensajeAlert.AppendFormat("Los precios de lista de los productos/servicios se actualizaron correctamente. <br/> <b><a target='_blank' class='Texto' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar Etiquetas</a></b>", Encripta(String.Format("OP=ETIQUETA&CVEPRECIOLISTA={0}&PRODUCTOS={1}", DdlPrecioLista.SelectedValue.ToEntero, sbProductos.ToString())))
|
||||
Else
|
||||
MensajeAlert.Append("Los precios de lista de los productos/servicios se actualizaron correctamente.")
|
||||
End If
|
||||
|
||||
Alert(MensajeAlert.ToString())
|
||||
End If
|
||||
Catch ex As Exception
|
||||
TieneError = True
|
||||
GuardaLog(ex.ToString())
|
||||
End Try
|
||||
|
||||
If TieneError Then
|
||||
ObjPS.RollBack()
|
||||
Alert("Ocurrió un error al actualizar precios", TipoMensaje.MsgError)
|
||||
Else
|
||||
ObjPS.Commit()
|
||||
End If
|
||||
|
||||
@@ -2193,6 +2193,8 @@ Partial Class Clientes
|
||||
Cuerpo = Cuerpo.Replace("{""Vigencia""}", Dr("Vigencia").ToString())
|
||||
Cuerpo = Cuerpo.Replace("{""AtencionA""}", Dr("AtencionA").ToString())
|
||||
Cuerpo = Cuerpo.Replace("{""Sucursal""}", Dr("SubProyecto").ToString())
|
||||
Cuerpo = Cuerpo.Replace("{""DescripcionVenta""}", Dr("DescripcionVenta").ToString())
|
||||
Cuerpo = Cuerpo.Replace("{""AtencionA""}", Dr("AtencionA").ToString())
|
||||
|
||||
End If
|
||||
|
||||
@@ -2212,6 +2214,8 @@ Partial Class Clientes
|
||||
Asunto = Asunto.Replace("{""Vigencia""}", Dr("Vigencia").ToString())
|
||||
Asunto = Asunto.Replace("{""AtencionA""}", Dr("AtencionA").ToString())
|
||||
Asunto = Asunto.Replace("{""Sucursal""}", Dr("SubProyecto").ToString())
|
||||
Asunto = Asunto.Replace("{""DescripcionVenta""}", Dr("DescripcionVenta").ToString())
|
||||
Asunto = Asunto.Replace("{""AtencionA""}", Dr("AtencionA").ToString())
|
||||
|
||||
End If
|
||||
End If
|
||||
@@ -2231,6 +2235,8 @@ Partial Class Clientes
|
||||
Cuerpo = Cuerpo.Replace("{""Vigencia""}", Dr("Vigencia").ToString())
|
||||
Cuerpo = Cuerpo.Replace("{""AtencionA""}", Dr("AtencionA").ToString())
|
||||
Cuerpo = Cuerpo.Replace("{""Sucursal""}", Dr("SubProyecto").ToString())
|
||||
Cuerpo = Cuerpo.Replace("{""DescripcionVenta""}", Dr("DescripcionVenta").ToString())
|
||||
Cuerpo = Cuerpo.Replace("{""AtencionA""}", Dr("AtencionA").ToString())
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -2247,6 +2253,9 @@ Partial Class Clientes
|
||||
Asunto = Asunto.Replace("{""Vigencia""}", Dr("Vigencia").ToString())
|
||||
Asunto = Asunto.Replace("{""AtencionA""}", Dr("AtencionA").ToString())
|
||||
Asunto = Asunto.Replace("{""Sucursal""}", Dr("SubProyecto").ToString())
|
||||
Asunto = Asunto.Replace("{""DescripcionVenta""}", Dr("DescripcionVenta").ToString())
|
||||
Asunto = Asunto.Replace("{""AtencionA""}", Dr("AtencionA").ToString())
|
||||
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
@@ -5614,6 +5623,10 @@ Partial Class Clientes
|
||||
Cuerpo = Cuerpo.Replace("{""Vigencia""}", Dr("Vigencia").ToString())
|
||||
Cuerpo = Cuerpo.Replace("{""AtencionA""}", Dr("AtencionA").ToString())
|
||||
Cuerpo = Cuerpo.Replace("{""Sucursal""}", Dr("SubProyecto").ToString())
|
||||
Cuerpo = Cuerpo.Replace("{""DescripcionVenta""}", Dr("DescripcionVenta").ToString())
|
||||
Cuerpo = Cuerpo.Replace("{""AtencionA""}", Dr("AtencionA").ToString())
|
||||
|
||||
|
||||
|
||||
End If
|
||||
End If
|
||||
@@ -5632,6 +5645,8 @@ Partial Class Clientes
|
||||
Asunto = Asunto.Replace("{""Vigencia""}", Dr("Vigencia").ToString())
|
||||
Asunto = Asunto.Replace("{""AtencionA""}", Dr("AtencionA").ToString())
|
||||
Asunto = Asunto.Replace("{""Sucursal""}", Dr("SubProyecto").ToString())
|
||||
Asunto = Asunto.Replace("{""DescripcionVenta""}", Dr("DescripcionVenta").ToString())
|
||||
Asunto = Asunto.Replace("{""AtencionA""}", Dr("AtencionA").ToString())
|
||||
|
||||
End If
|
||||
End If
|
||||
@@ -5650,6 +5665,8 @@ Partial Class Clientes
|
||||
Cuerpo = Cuerpo.Replace("{""Vigencia""}", Dr("Vigencia").ToString())
|
||||
Cuerpo = Cuerpo.Replace("{""AtencionA""}", Dr("AtencionA").ToString())
|
||||
Cuerpo = Cuerpo.Replace("{""Sucursal""}", Dr("SubProyecto").ToString())
|
||||
Cuerpo = Cuerpo.Replace("{""DescripcionVenta""}", Dr("DescripcionVenta").ToString())
|
||||
Cuerpo = Cuerpo.Replace("{""AtencionA""}", Dr("AtencionA").ToString())
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -5667,6 +5684,9 @@ Partial Class Clientes
|
||||
Asunto = Asunto.Replace("{""Vigencia""}", Dr("Vigencia").ToString())
|
||||
Asunto = Asunto.Replace("{""AtencionA""}", Dr("AtencionA").ToString())
|
||||
Asunto = Asunto.Replace("{""Sucursal""}", Dr("SubProyecto").ToString())
|
||||
Asunto = Asunto.Replace("{""DescripcionVenta""}", Dr("DescripcionVenta").ToString())
|
||||
Asunto = Asunto.Replace("{""AtencionA""}", Dr("AtencionA").ToString())
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
@@ -159,10 +159,16 @@ Partial Class Ventas_FacturacionGlobal
|
||||
SbRemisiones.Remove(SbRemisiones.Length - 1, 1)
|
||||
|
||||
Dim DtRemisionesPS As New DataTable()
|
||||
Dim DtPagos As New DataTable()
|
||||
|
||||
Dim ObjClientes As New ClsClientes
|
||||
If ObjClientes.GetVentasRemisionesTotales(CveCliente, SbRemisiones.ToString(), 1) Then
|
||||
DtRemisionesPS = ObjClientes.DtResultados.Copy()
|
||||
End If
|
||||
|
||||
If ObjClientes.GetVentasRemisionesPagos(CveCliente, SbRemisiones.ToString()) Then
|
||||
DtPagos = ObjClientes.DtResultados.Copy()
|
||||
End If
|
||||
ObjClientes.Dispose()
|
||||
|
||||
Dim ObjFactura = Modelos.Factura.CrearVentaNueva(UsuarioActual, Me.CveSubProyecto, CveCliente, CveMoneda, "Ing")
|
||||
@@ -173,6 +179,7 @@ Partial Class Ventas_FacturacionGlobal
|
||||
ObjFactura.RemisionesLista = RemisionesLista
|
||||
ObjFactura.DtRemisionesPS = DtRemisionesPS
|
||||
ObjFactura.DtRemisiones = DtRemisiones.FiltraParametros($"CveVenta IN ({SbRemisiones.ToString()})")
|
||||
ObjFactura.DtPagos = DtPagos
|
||||
|
||||
For Each Dr As DataRow In DtRemisionesPS.Rows
|
||||
ObjFactura.AgregarPS(Dr("CvePS").ToString().ToEntero(), Dr("Cantidad").ToString().ToDecimal(), Dr("PU").ToString().ToDecimal(), Dr("Descuento").ToString().ToDecimal, Dr("Obs").ToString(), CveUM:=Dr("CveUM").ToString().ToEntero(),
|
||||
@@ -184,17 +191,14 @@ Partial Class Ventas_FacturacionGlobal
|
||||
'ObjFactura.DtInventario = ObjFactura.DtDetalle.FiltraParametros("CveTipoPs = 2")
|
||||
|
||||
Dim SbAlert As New StringBuilder()
|
||||
Dim urlFactura As String = ""
|
||||
|
||||
Dim Retorno As Modelos.Factura.MMensajeFactura = Nothing
|
||||
Try
|
||||
Retorno = ObjFactura.EmitirFactura(True)
|
||||
|
||||
If Retorno IsNot Nothing AndAlso Retorno.CveVenta > 0 Then
|
||||
SbAlert.AppendFormat("{0}<br>", Retorno.Mensajes(Retorno.Mensajes.Count - 1))
|
||||
SbAlert.AppendFormat("{0}", Retorno.Mensajes(Retorno.Mensajes.Count - 1))
|
||||
SbAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF Factura</a></li></ul><br/>", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", Retorno.CveVenta)))
|
||||
|
||||
urlFactura = $"/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", Retorno.CveVenta))}"
|
||||
Else
|
||||
SbAlert.Append("Ocurrió un error al generar la factura")
|
||||
End If
|
||||
|
||||
@@ -246,6 +246,10 @@
|
||||
<label>Aplica para Venta:</label>
|
||||
<asp:CheckBox ID="ChkAplicaParaVenta" CssClass="make-switchsd" data-size="small" runat="server" Checked="True" />
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright" id="DivPSExhibicion" runat="server" visible="false">
|
||||
<label>Producto de exhibición:</label>
|
||||
<asp:CheckBox ID="ChkPSExhibicion" CssClass="make-switchsd" data-size="small" runat="server" Checked="True" />
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright col-xs-3">
|
||||
<asp:TextBox ID="TxtVentaMinima" CssClass="form-control " runat="server"></asp:TextBox>
|
||||
<%--<ajax:FilteredTextBoxExtender ID="FTBETVentaMinima" TargetControlID="TxtVentaMinima" FilterType="Numbers" runat="server" ValidChars=".," />--%>
|
||||
|
||||
@@ -1113,6 +1113,11 @@ Partial Class ProductosyServicios
|
||||
DVCodigoPSAlterno.Visible = True
|
||||
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
|
||||
DivPSExhibicion.Visible = True
|
||||
ChkPSExhibicion.Checked = CBool(ObjProductosServicios.DtResultados.Rows(0)("ProductoExhibicion").ToString)
|
||||
End If
|
||||
Else
|
||||
Alert("El Producto o Servicio Solicitado no existe, por favor revise su búsqueda.", TipoMensaje.MsgAdvertencia)
|
||||
RegistraScript("$('#C_Tab_TabPaquetes_tab').css('display' , 'none')")
|
||||
@@ -1509,7 +1514,7 @@ Partial Class ProductosyServicios
|
||||
CveMaterialPeligroso:=DdlMaterialPeligroso.SelectedValue.ToEntero, CveEmbalaje:=DdlEmbalaje.SelectedValue.ToEntero, PesoKg:=TxtPesoKg.Text.ToDecimal, Dimensiones:=TxtDimensiones.Text.Trim,
|
||||
CveObjetoImpuesto:=DdlObjetoImpuesto.SelectedValue.ToEntero, Litraje:=TxtLitraje.Text.ToDecimal, RegistroRSCO:=TxtRegistroRSCO.Text, FechaVigenciaRSCO:=TxtFechaVigenciaRSCO.Text.ToDate, VigenciaIndeterminadaRSCO:=ChkFechaIndeterminadaRSCO.Checked,
|
||||
NombreComercial:=TxtNombreComercial.Text.Trim, NotasAdicionales:=TxtEcommerceNota.Text.Trim, EcommerceEtiquetas:=TxtEcommerceEtiquetas.Text.Trim.Replace(".", ""), EcommercePrecio:=TxtEcommercePrecio.Text.Trim.ToDecimal,
|
||||
CveClasificacionEcommerce:=DdlEcommerceClasificacion.SelectedValue.ToEntero, EcommerceCantidad:=TxtEcommerceCantidad.Text.Trim.ToDecimal, CodigoAlterno:=TxtCodigoAlterno.Text.Trim, PSAlterno:=TxtPSAlterno.Text.Trim) > 0 Then
|
||||
CveClasificacionEcommerce:=DdlEcommerceClasificacion.SelectedValue.ToEntero, EcommerceCantidad:=TxtEcommerceCantidad.Text.Trim.ToDecimal, CodigoAlterno:=TxtCodigoAlterno.Text.Trim, PSAlterno:=TxtPSAlterno.Text.Trim, ProductoExhibicion:=ChkPSExhibicion.Checked) > 0 Then
|
||||
ViewState("CvePS") = ObjProductosServicios.CvePS
|
||||
For Each GVR As GridViewRow In GvImpuestosLocales.Rows
|
||||
If GVR.FCCheckBox("ChkDeduccion").Checked Then
|
||||
@@ -1583,7 +1588,7 @@ Partial Class ProductosyServicios
|
||||
RegistroRSCO:=TxtRegistroRSCO.Text, FechaVigenciaRSCO:=TxtFechaVigenciaRSCO.Text.ToDate, VigenciaIndeterminadaRSCO:=ChkFechaIndeterminadaRSCO.Checked,
|
||||
NombreComercial:=TxtNombreComercial.Text.Trim, NotasAdicionales:=TxtEcommerceNota.Text.Trim, EcommerceEtiquetas:=TxtEcommerceEtiquetas.Text.Trim.Replace(".", ""), ActivoEcommerce:=ChkActivoEcommerce.Checked,
|
||||
EcommercePrecio:=TxtEcommercePrecio.Text.Trim.ToDecimal, CveClasificacionEcommerce:=DdlEcommerceClasificacion.SelectedValue.ToEntero, EcommerceCantidad:=TxtEcommerceCantidad.Text.Trim.ToDecimal,
|
||||
CodigoAlterno:=TxtCodigoAlterno.Text.Trim, PSAlterno:=TxtPSAlterno.Text.Trim) Then
|
||||
CodigoAlterno:=TxtCodigoAlterno.Text.Trim, PSAlterno:=TxtPSAlterno.Text.Trim, ProductoExhibicion:=ChkPSExhibicion.Checked) Then
|
||||
|
||||
If Not ObjProductosServicios.LimpiaImpuestosLocales(CvePS) Then
|
||||
TieneError = True
|
||||
|
||||
@@ -21095,6 +21095,7 @@ Partial Class Ventas
|
||||
Cuerpo = Cuerpo.Replace("{""Vigencia""}", TxtFechaVencimientoCotizacion.Text)
|
||||
Cuerpo = Cuerpo.Replace("{""AtencionA""}", TxtAtencionA.Text)
|
||||
Cuerpo = Cuerpo.Replace("{""Sucursal""}", DdlSubProyectoDatos.SelectedItem.Text)
|
||||
Cuerpo = Cuerpo.Replace("{""DescripcionVenta""}", TxtDescripcionVenta.Text)
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.AsuntoPlantillaMailVentaCotizacion.Trim.Length > 0 Then
|
||||
@@ -21109,6 +21110,7 @@ Partial Class Ventas
|
||||
Asunto = Asunto.Replace("{""Vigencia""}", TxtFechaVencimientoCotizacion.Text)
|
||||
Asunto = Asunto.Replace("{""AtencionA""}", TxtAtencionA.Text)
|
||||
Asunto = Asunto.Replace("{""Sucursal""}", DdlSubProyectoDatos.SelectedItem.Text)
|
||||
Asunto = Asunto.Replace("{""DescripcionVenta""}", TxtDescripcionVenta.Text)
|
||||
End If
|
||||
|
||||
Else
|
||||
@@ -21123,6 +21125,7 @@ Partial Class Ventas
|
||||
Cuerpo = Cuerpo.Replace("{""SerieFolio""}", SerieFolio)
|
||||
Cuerpo = Cuerpo.Replace("{""AtencionA""}", TxtAtencionA.Text)
|
||||
Cuerpo = Cuerpo.Replace("{""Sucursal""}", DdlSubProyectoDatos.SelectedItem.Text)
|
||||
Cuerpo = Cuerpo.Replace("{""DescripcionVenta""}", TxtDescripcionVenta.Text)
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.AsuntoPlantillaMailVenta.Trim.Length > 0 Then
|
||||
@@ -21136,6 +21139,7 @@ Partial Class Ventas
|
||||
Asunto = Asunto.Replace("{""SerieFolio""}", SerieFolio)
|
||||
Asunto = Asunto.Replace("{""AtencionA""}", TxtAtencionA.Text)
|
||||
Asunto = Asunto.Replace("{""Sucursal""}", DdlSubProyectoDatos.SelectedItem.Text)
|
||||
Asunto = Asunto.Replace("{""DescripcionVenta""}", TxtDescripcionVenta.Text)
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -36312,6 +36316,10 @@ Partial Class Ventas
|
||||
RegistraScript("$('#DvModalTipoVenta').modal('hide');")
|
||||
End Select
|
||||
|
||||
|
||||
LblDvModalTipoVentaTitulo.Text = RBLTipoVenta.SelectedItem.Text
|
||||
|
||||
|
||||
End If
|
||||
UpDvModalTipoVenta.Update()
|
||||
End Sub
|
||||
@@ -36402,6 +36410,9 @@ Partial Class Ventas
|
||||
GvProductosProcedimiento.DataBind()
|
||||
DVGvProductosProcedimiento.Visible = False
|
||||
|
||||
|
||||
LblDvModalTipoVentaTitulo.Text = "Tipo de Venta"
|
||||
|
||||
UpDvModalTipoVenta.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
Reference in New Issue
Block a user