- Serie,Lote, Caducidad Seccion Almacen

This commit is contained in:
rrene
2020-05-18 18:11:45 -07:00
parent 9370a15316
commit d5d10c39a2
18 changed files with 385 additions and 736 deletions

View File

@@ -1555,6 +1555,8 @@ Partial Class Bancos_PopIEVentas
'CveConcepto2 = 43
CveIE = -1
End If
Case Else
MsgError = "No se ha especificada opcion."
End Select
@@ -3461,19 +3463,13 @@ Partial Class Bancos_PopIEVentas
ImporteMovimiento = 0
End Select
If ImporteMovimiento <> 0 AndAlso MsgError <> "" Then
If ImporteMovimiento <> 0 AndAlso MsgError = "" Then
'Conta ContPAQ
If IdCtaContable = 0 Then
CuentasContablesInvalidas.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString)
idCuentaContabilizacion = 0
End If
''Conta SIG
'If CveCuenta = 0 Then
' CuentasContablesInvalidasSIG.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString)
' CveCuentaContabilizacion = 0
'End If
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, ReferenciaConcepto, ConceptoContable, ConceptoMovimiento, Fecha, IdCtaContable, -1, CveIE, CveVenta, -1, CveSubProyectoContabilizar, CveCliente:=CveClienteOriginal, ImporteMX:=ImporteMX, CveCuenta:=CveCuenta, CvePersonal:=CvePersonal, TipoCambio:=TimpocambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=PorcentajeImpuesto) Then
MsgError = "No se pudo insertar la póliza"
Exit For

View File

@@ -1201,8 +1201,8 @@
</asp:TemplateField>
<asp:TemplateField HeaderText="Serie">
<ItemTemplate>
<asp:Literal ID="LtlSerie" Text='<%# Eval("SerieLote") %>' Visible="false" runat="server" />
<asp:TextBox ID="TxtSerie" AutoPostBack="false" Text='<%# Eval("SerieLote") %>' Visible="false" runat="server" />
<asp:Literal ID="LtlSerie" Text='<%# Eval("Serie") %>' Visible="false" runat="server" />
<asp:TextBox ID="TxtSerie" AutoPostBack="false" Text='<%# Eval("Serie") %>' Visible="false" runat="server" />
<asp:HiddenField runat="server" Value="" ID="HdnSerie" />
</ItemTemplate>
</asp:TemplateField>

View File

@@ -1624,7 +1624,7 @@ Partial Class Compras_Compras
LtlTareaNueva.Text = String.Format("<a class=""caption-subject bold font-green"" onclick=""OpenModalNewTareaUserControl(1,-1,{{CveCompra:{0}}});""> <i class=""fa fa-plus""'></i> Tarea</a>", CveCompra)
LtlTareaNueva.Text = String.Format("<a class=""caption-subject bold font-green"" onclick=""OpenModalNewTareaUserControl(1,-1,{{CveCompra:{0}}});""> <i class=""fa fa-plus""'></i> Tarea</a>", CveCompra)
End If
@@ -1704,7 +1704,7 @@ Partial Class Compras_Compras
Dim dr As DataRow = ObjeFacturas.DtResultados.Rows(0) ' no toma la cero, porque es el totalizador
Dim XMLDoc As New XmlDocument
Dim Archivo As String = String.Format("{0}\Compras\{1}\{2}", UsuarioActual.Empresa.Ruta, dr("RFCDe"), dr("XML"))
Dim Archivo As String = String.Format("{0}Empresas\{1}\Compras\{2}\{3}", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa, dr("RFCDe"), dr("XML"))
If IO.File.Exists(Archivo) Then
Dim Validada As Boolean = True
@@ -5811,7 +5811,11 @@ Partial Class Compras_Compras
CuentasContablesInvalidas.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", 6))("ConceptoContable").ToString)
idCuentaContabilizacion = 0
End If
'Conta SIG
If CveCuenta = 0 Then
CuentasContablesInvalidasSIG.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", 6))("ConceptoContable").ToString)
CveCuentaContabilizacion = 0
End If
End If
Next
@@ -6389,7 +6393,7 @@ Partial Class Compras_Compras
Dim AgregaMercanciaInventario As Boolean = UsuarioActual.CveEmpresa.Contiene(1, 72, 80, 119, 140, 141) AndAlso UsuarioActual.Empresa.UsaInventarios AndAlso Not UsuarioActual.Empresa.Funcionalidad(126) = "1"
Dim RegistraConcepto225 As Boolean = UsuarioActual.Empresa.UsaInventarios AndAlso DdlTipoComprobante.SelectedValue.Contiene("DEV") AndAlso Not UsuarioActual.Empresa.Funcionalidad(126) = "1"
Dim RegistraConcepto225 As Boolean = UsuarioActual.Empresa.UsaInventarios AndAlso DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV") AndAlso Not UsuarioActual.Empresa.Funcionalidad(126) = "1"
If RBLPago.SelectedValue.ToEntero = 4 Then
Exit Select 'Es credito el concepto 6 se agrega en CASE 17
@@ -6415,7 +6419,11 @@ Partial Class Compras_Compras
CuentasContablesInvalidas.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", 49))("ConceptoContable").ToString)
idCuentaContabilizacion = 0
End If
'Conta SIG
If CveCuenta = 0 Then
CuentasContablesInvalidasSIG.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", 49))("ConceptoContable").ToString)
CveCuentaContabilizacion = 0
End If
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Row2("CodAF").ToString, 49, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveActivoFijo:=Row2("CveActivoFijo").ToString.ToEntero, CveAcreedor:=CveAcreedor, CveIE:=CveIE, CvePersonal:=CvePersonal, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza) Then
ErrorPrepoliza = True
End If
@@ -6741,13 +6749,9 @@ Partial Class Compras_Compras
' CveCuenta = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", String.Format("CveClasificacion = {0}", Row2("CveClasificacion"))).ToString.ToEntero
End If
End If
'Conta ContPAQ
End If
'If IdCtaContable = 0 AndAlso DdlTipoComprobante.SelectedValue = "Fac" Then
' CuentasContablesInvalidas.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", 6))("ConceptoContable").ToString)
' idCuentaContabilizacion = 0
'End If
'SEGMENTO DE NEGOCIO
@@ -6759,6 +6763,12 @@ Partial Class Compras_Compras
'AGREGA MOVIMIENTO
If importeMovimiento.RoundSQL <> 0 Then
'Conta ContPAQ
' If IdCtaContable = 0 Then
' CuentasContablesInvalidas.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", 6))("ConceptoContable").ToString)
' idCuentaContabilizacion = 0
'End If
Dim tcvecon As Integer = 6
Dim tidctacon As Integer = 6
@@ -6796,6 +6806,9 @@ Partial Class Compras_Compras
End If
End If
Next
@@ -6873,6 +6886,11 @@ Partial Class Compras_Compras
CuentasContablesInvalidas.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString)
idCuentaContabilizacion = 0
End If
'Conta SIG
If CveCuenta = 0 Then
CuentasContablesInvalidasSIG.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString)
CveCuentaContabilizacion = 0
End If
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CveIE:=rw.DataKey("CveIE").ToString.ToEntero, CvePersonal:=CvePersonal, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, Contabilizable:=SeContabiliza) Then
ErrorPrepoliza = True
@@ -7128,6 +7146,11 @@ Partial Class Compras_Compras
CuentasContablesInvalidas.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString)
idCuentaContabilizacion = 0
End If
'Conta SIG
If CveCuenta = 0 Then
CuentasContablesInvalidas.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString)
idCuentaContabilizacion = 0
End If
'AMORTIZACIÓN NC ESPECIAL COMPLEMENTARIA
If ConceptoContableAnticipo.Contiene(60) And DdlMoneda.SelectedValue.ToEntero <> 1 And UsuarioActual.CveEmpresa.Contiene(119) Then
@@ -7458,6 +7481,11 @@ Partial Class Compras_Compras
CuentasContablesInvalidas.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString)
idCuentaContabilizacion = 0
End If
'COnta SIG
If CveCuenta = 0 Then
CuentasContablesInvalidasSIG.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString)
CveCuentaContabilizacion = 0
End If
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CveIE:=CveIE, CvePersonal:=CvePersonal, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=Math.Round(importeMN, 2, MidpointRounding.AwayFromZero), ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, PorcentajeImpuesto:=PorcentajeImpuesto, Contabilizable:=SeContabiliza) Then
ErrorPrepoliza = True
@@ -9098,6 +9126,11 @@ Partial Class Compras_Compras
CuentasContablesInvalidas.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString)
idCuentaContabilizacion = 0
End If
'Conta SIG
If CveCuenta = 0 Then
CuentasContablesInvalidasSIG.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString)
CveCuentaContabilizacion = 0
End If
If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaNueva, TipoMovimiento, ImporteMovimiento, Concepto, ConceptoContable, Concepto, Fecha, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=importeMN, CvePrePolizaOriginal:=CvePrePoliza, ImporteME:=If(tipoCambio = 1, 0, ImporteMovimiento), CveCuenta:=CveCuenta, PorcentajeImpuesto:=PorcentajeImpuesto) Then
ErrorMovtosCxP = 1

View File

@@ -1788,7 +1788,7 @@
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="SerieLote" DataField="SerieLote" ItemStyle-Width="10%" />
<asp:BoundField HeaderText="Serie" DataField="Serie" ItemStyle-Width="10%" />
<asp:BoundField HeaderText="Valor AF" DataField="ValorImporte" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="8%" />
<asp:HyperLinkField HeaderText="Devolución" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="15%" Target="_blank" DataNavigateUrlFields="CveVentaDevolucion" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" DataTextField="SerieFolioDevolucion" />
@@ -1843,7 +1843,7 @@
<asp:BoundField HeaderText="Cantidad" DataField="Cantidad" DataFormatString="{0:#,##0.##}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="3%" />
<asp:BoundField HeaderText="Producto" DataField="CodigoPS" ItemStyle-Width="40%" />
<asp:BoundField HeaderText="Contrato Externo" DataField="ContratoExterno" ItemStyle-Width="3%" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="SerieLote" DataField="SerieLote" ItemStyle-Width="10%" />
<asp:BoundField HeaderText="Serie" DataField="Serie" ItemStyle-Width="10%" />
</Columns>
</asp:GridView>
</div>
@@ -1882,7 +1882,7 @@
<asp:BoundField HeaderText="Cantidad" DataField="Cantidad" DataFormatString="{0:#,##0.##}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="3%" />
<asp:BoundField HeaderText="Producto" DataField="CodigoPS" ItemStyle-Width="40%" />
<asp:BoundField HeaderText="Contrato Externo" DataField="ContratoExterno" ItemStyle-Width="3%" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="SerieLote" DataField="SerieLote" ItemStyle-Width="10%" />
<asp:BoundField HeaderText="Serie" DataField="Serie" ItemStyle-Width="10%" />
</Columns>
</asp:GridView>
</div>

View File

@@ -2149,502 +2149,18 @@ Partial Class Contratos_Default
Else
Alert("No existe el archivo. Favor de subir un archivo excel a la plataforma.", TipoMensaje.MsgError)
End If
End Sub
End Sub
#End Region
'VIEJO ALMACEN
'#Region " MOVIMIENTOS ALMACEN "
' Private Sub CargaInventarios()
' If CveMovimiento > 0 Then
' Dim ObjInventarios As New ClsInventarios
' If ObjInventarios.GetMovimientos(CveMovimiento, 8, -1, UsuarioActual.CveEmpresa) Then
' TxtFechaAlmacen.Text = ObjInventarios.Fecha.ToShortDateString
' DdlAlmacen.SelectedValue = ObjInventarios.CveAlmacen.ToString
' TxtObservaciones.Text = ObjInventarios.Observaciones
' 'cargar también los movimentos detalle
' If ObjInventarios.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then
' DtMovimientos = ObjInventarios.DtResultados.FiltraParametros("", "CveMovimientoDetalle")
' DtMovimientos.Columns.Add("EstatusExistencia")
' DtMovimientos.Columns("No").AutoIncrement = True
' DtMovimientos.Columns("No").AutoIncrementSeed = DtMovimientos.Rows.Count + 1
' DtMovimientos.Columns("No").AutoIncrementStep = 1
' Dim keys(1) As DataColumn
' keys(0) = DtMovimientos.Columns("No")
' DtMovimientos.PrimaryKey = keys
' CargaGvDatos()
' 'BLOQUEA
' TxtFechaAlmacen.Enabled = False
' ImgFechaAlmacen.Enabled = False
' DdlAlmacen.Enabled = False
' TxtObservaciones.Enabled = False
' LbAgregarAlmacen.Visible = False
' 'TxtCantidadAlmacen.Enabled = False
' 'DdlUnidad.Enabled = False
' DdlProducto2.Enabled = False
' DdlClasificacion.Enabled = False
' TxtnSerieLote.Enabled = False
' DivCodigoSeriePS.Visible = False
' Else
' Alert("Ocurrió un error al cargar la información de los Activos Fijos. Por favor vuelva a intentar.", TipoMensaje.MsgError)
' End If
' Else
' Alert("Ocurrió un error al cargar la información de los Activos Fijos. Por favor vuelva a intentar.", TipoMensaje.MsgError)
' End If
' ObjInventarios.Dispose()
' End If
' End Sub
' Private Sub InicializaAlmacen()
' CreaDTAlmacen()
' CargaPS()
' TxtFechaAlmacen.Text = Now.ToShortDateString
' 'DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
' 'DdlAlmacen.DataBind()
' 'DdlAlmacen.Items.Insert(0, New ListItem("Seleccione", "-1"))
' End Sub
'#Region "CARGA DATOS"
' Protected Sub CreaDTAlmacen()
' Dim dt As New DataTable
' Dim column As DataColumn = New DataColumn("No")
' column.DataType = Type.GetType("System.Int32")
' With column
' .AutoIncrement = True
' .AutoIncrementSeed = 1
' .AutoIncrementStep = 1
' End With
' dt.Columns.Add(column)
' dt.Columns.Add("Cantidad", Type.GetType("System.Double"))
' dt.Columns.Add("CveUM", Type.GetType("System.Int32"))
' dt.Columns.Add("UnidadMedida")
' dt.Columns.Add("CvePS", Type.GetType("System.Int32"))
' dt.Columns.Add("PS")
' dt.Columns.Add("SerieLote")
' dt.Columns.Add("CveClasificacion", Type.GetType("System.Int32"))
' dt.Columns.Add("EstatusExistencia")
' DtMovimientos = dt
' CargaGvDatos()
' End Sub
' Private Sub CargaPS()
' DdlProducto2.setEsWebService(UsuarioActual.Empresa.Funcionalidad(105) = "1")
' If UsuarioActual.CveEmpresa = 66 Then
' DdlProducto2.ddlWS.Attributes.Add("data-pagina", "Inventarios")
' End If
' If Not DdlProducto2.UsaWebService AndAlso CType(DdlProducto2.DataSource, DataTable) Is Nothing Then
' DdlProducto2.DataSource = GlobalDTProductosServicios(UsuarioActual.CveEmpresa).FiltraParametros($"Inv_CveMetodoInventario = 5")
' DdlProducto2.DataBind()
' DdlProducto2.ddl.Items.Insert(0, New ListItem("----", "-1"))
' End If
' End Sub
'#End Region
'#Region "AGREGAR Y GUARDAR"
' Protected Sub btnAgregar_Click(sender As Object, e As EventArgs) Handles LBAgregar.Click
' BtnAgregarPS(1)
' End Sub
' Protected Sub BtnSerieAddNew_Click(sender As Object, e As EventArgs)
' BtnAgregarPS(1)
' End Sub
' Private Sub BtnAgregarPS(Cantidad As Double)
' Dim CveProducto As Integer = DdlProducto2.SelectedValue.ToEntero
' If CveProducto > 0 Then
' If TxtnSerieLote.Visible AndAlso TxtnSerieLote.Text = "" Then
' Alert("Serie-Lote es necesario", TipoMensaje.MsgAdvertencia)
' Exit Sub
' End If
' Dim Valido = ValidaExistencia(Cantidad, CveProducto, -1, TxtnSerieLote.Text) 'If(TxtnSerieLote.Visible, TxtnSerieLote.Text, "-1")
' If Valido Then
' AgregarPS(Cantidad, CveProducto, -1, TxtnSerieLote.Text) 'If(TxtnSerieLote.Visible, TxtnSerieLote.Text, "-1")
' End If
' End If
' End Sub
' Private Function ValidaExistencia(Cantidad As Double, CvePS As Integer, CveUnidadMedida As Integer, Optional SerieLote As String = "-1") As Boolean
' Dim Retorno = True
' Dim Inv As New ClsInventarios
' Dim Existencia As Double = Inv.GetExistenciasPS(CvePS, CveUnidadMedida, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, -1, TxtFechaAlmacen.Text.ToDate.ToString("yyyy/MM/dd 23:59"), SerieLote)
' Inv.Dispose()
' If Existencia - Cantidad - DtMovimientos.SUM("Cantidad", $"CvePS = {CvePS} AND CveUM = {CveUnidadMedida} {If(SerieLote <> "-1", $" AND SerieLote = '{SerieLote}'", "")}") < 0 Then
' If Existencia = 0 Then
' Alert("No hay existencia del producto", TipoMensaje.MsgAdvertencia)
' Else
' Alert(String.Format("Solo hay en existencia: {0}", Existencia), TipoMensaje.MsgAdvertencia)
' End If
' Retorno = False
' End If
' Return Retorno
' End Function
' Private Sub AgregarPS(Cantidad As Double, CvePS As Integer, CveUnidadMedida As Integer, Optional SerieLote As String = "-1")
' If Cantidad <= 0 Then
' Alert("La cantidad debe ser mayor a cero (0). Por favor verifique y vuelva a intentar", TipoMensaje.MsgAdvertencia)
' End If
' Dim CveClasificacion As Integer
' Dim DrPS As DataRow = GlobalDTProductosServicios(UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CvePS = {0}", CvePS))
' If DrPS IsNot Nothing Then CveClasificacion = DrPS("CveClasificacion").ToString.ToEntero
' Dim registro As DataRow = DtMovimientos.NewRow
' registro.Item("Cantidad") = Cantidad
' registro.Item("CveUM") = DrPS("CveUnidadMedida")
' registro.Item("UnidadMedida") = DrPS("UnidadMedida")
' registro.Item("CvePS") = CvePS
' registro.Item("PS") = DrPS("PS")
' registro.Item("SerieLote") = SerieLote
' registro.Item("CveClasificacion") = CveClasificacion
' registro.Item("EstatusExistencia") = "1"
' DtMovimientos.Rows.Add(registro)
' CargaGvDatos()
' LimpiaAgregar()
' End Sub
' Private Sub LimpiaAgregar()
' DdlClasificacion.SelectedValue = "-1"
' DdlClasificacion_SelectedIndexChanged(DdlClasificacion, EventArgs.Empty)
' 'TxtCantidad.Text = ""
' TxtnSerieLote.Text = ""
' 'TxtnSerieLote.Visible = False
' End Sub
' Protected Function GuardarAlmacen(ObjInventarios As ClsInventarios) As Boolean
' Dim ErrorMovInv As Boolean = False
' 'NO HACE NADA YA QUE TIENE MOVIMIENTO REGISTRADO O NO TENGA DETALLES EN EL GV
' If CveMovimiento > 0 Or GvDatos.Rows.Count = 0 Then
' Return ErrorMovInv
' End If
' 'VALIDA ESTATUS EXISTENCIA
' For Each dr As DataRow In DtMovimientos.Rows
' If dr("EstatusExistencia").ToString = "-1" Then
' Alert("Tiene que rectificar los movimientos con error.", TipoMensaje.MsgError)
' Return True
' End If
' Next
' Dim CveMovimientoSalida = 0
' Dim CveMovimientoEntrada = 0
' Dim IDPoliza As Integer = 0
' Dim FolioSalida = 0
' Dim FolioEntrada = 0
' Dim AlmacenEntrada = -1
' Dim ErrorAC As Boolean = False
' Dim ErrorExistencia = False
' Dim TextoError = ""
' Dim TextoExistencia As StringBuilder = New StringBuilder
' 'VALIDA EXISTENCIA
' Dim Existencia As Double
' TextoExistencia.Append("Los siguiente productos se ajustaron por falta de exitencia:<br/>")
' For Each dr As DataRow In DtMovimientos.Rows
' Existencia = ObjInventarios.GetExistenciasPS(dr("CvePS").ToString.ToEntero, dr("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, -1, TxtFechaAlmacen.Text.ToDate.ToString("yyyy/MM/dd 23:59"), If(dr("SerieLote").ToString = "", "-1", dr("SerieLote").ToString))
' Existencia -= DtMovimientos.SUM("Cantidad", $"CvePS = {dr("CvePS").ToString.ToEntero} AND CveUM = {dr("CveUM").ToString.ToEntero} {If(dr("SerieLote").ToString <> "-1", $" AND SerieLote = '{dr("SerieLote").ToString}'", "")}")
' If Existencia < 0 Then
' ErrorExistencia = True
' dr("EstatusExistencia") = "-1"
' dr("Cantidad") = Existencia
' TextoExistencia.AppendFormat("- #{0} {1}<br/>", dr("No").ToString, dr("PS").ToString)
' End If
' Next
' 'REGISTRA LA SALIDA Y ENTRADA (TRASPASO)
' If Not ErrorExistencia Then
' Dim Fecha As Date = TxtFechaAlmacen.Text.ToDate
' 'AGREGAMOS LA SALIDA DEL ALMACEN ORIGEN
' CveMovimientoSalida = ObjInventarios.AddMovimiento(DdlAlmacen.SelectedValue.ToEntero, 8, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, CveContrato:=CveContrato)
' FolioSalida = ObjInventarios.Folio
' If CveMovimientoSalida <= 0 Then
' TextoError = "No se pudo generar el movimiento de salida correctamente"
' ErrorMovInv = True
' Else
' For Each Dr As DataRow In DtMovimientos.Rows
' If Not ObjInventarios.AddMovimientoDetalle(CveMovimientoSalida, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, 0, -1, -1, Dr("SerieLote").ToString) Then
' ErrorMovInv = True
' TextoError = "Ocurrió un error al guardar los movimientos de salida"
' Exit For
' End If
' Next
' End If
' 'AGREGAMOS LA ENTRADA
' If Not ErrorMovInv Then
' AlmacenEntrada = 89
' CveMovimientoEntrada = ObjInventarios.AddMovimiento(AlmacenEntrada, 9, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, CveMovimientoRelacionado:=CveMovimientoSalida, CveContrato:=CveContrato)
' FolioEntrada = ObjInventarios.Folio
' If CveMovimientoEntrada <= 0 Then
' TextoError = "No se pudo generar el movimiento de entrada correctamente"
' ErrorMovInv = True
' Else
' If ObjInventarios.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
' For Each Dr As DataRow In ObjInventarios.DtResultados.Rows
' If Not ObjInventarios.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDouble, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString) Then
' ErrorMovInv = True
' TextoError = "Ocurrió un error al guardar los movimientos de entrada"
' Exit For
' End If
' Next
' End If
' End If
' End If
' If Not ErrorMovInv Then
' Dim Mensaje As StringBuilder = New StringBuilder
' Mensaje.Append("Se realizó con éxito el traspaso.")
' Mensaje.AppendFormat("<br/> Folio de Salida: <b><a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}"" target=""_blank"">{0}</a></b>", FolioSalida, CveMovimientoSalida)
' Mensaje.AppendFormat("<br/><a target='_blank' href='/Compras/PopUpVerFactura.aspx?P={0}'>Imprimir Reporte</a>", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoSalida)))
' Mensaje.AppendFormat("<br/> Folio de Entrada: <b><a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}"" target=""_blank"">{0}</a></b>", FolioEntrada, CveMovimientoEntrada)
' Mensaje.AppendFormat("<br/><a target='_blank' href='/Compras/PopUpVerFactura.aspx?P={0}'>Imprimir Reporte</a>", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoEntrada)))
' Alert(Mensaje.ToString, TipoMensaje.MsgInformacion)
' TxtResponsable.Text = ""
' TxtFechaAlmacen.Text = Now.ToShortDateString
' TxtObservaciones.Text = ""
' 'TxtCantidad.Text = ""
' DtMovimientos.Rows.Clear()
' CargaGvDatos()
' Else
' Alert(TextoError, TipoMensaje.MsgError)
' End If
' Else
' Alert(TextoExistencia.ToString, TipoMensaje.MsgError)
' ErrorMovInv = True
' End If
' 'SI OCURRIO UN ERROR EN LA EXISTENCIA RECARGAMOS EL GRID PARA COLOREAR LOS DETALLES CON ERROR
' If ErrorExistencia Then
' CargaGvDatos()
' End If
' Return ErrorMovInv
' End Function
'#End Region
'#Region " AGREGA CON TXT | CODIGO - SERIE "
' Protected Sub BtnCodigoPS_Click(sender As Object, e As EventArgs)
' If TxtCodigoPS.Text = "" Then
' Exit Sub
' End If
' TdSeriePS.Visible = False
' Dim DrPS = GlobalDTProductosServicios(UsuarioActual.CveEmpresa).FiltroPrimero($"CodigoBarras = '{TxtCodigoPS.Text}'")
' If DrPS Is Nothing Then
' Alert($"No se ha encontrado un producto del Codigo ""<b>{TxtCodigoPS.Text}</b>"". ", TipoMensaje.MsgAdvertencia, "window.setTimeout(Focus,200);")
' TxtCodigoPS.Text = ""
' Exit Sub
' End If
' If DrPS("Inv_CveMetodoInventario").ToString.ToEntero = 5 Then
' TdSeriePS.Visible = True
' TxtSeriePS.Focus()
' CvePSSerieLote = DrPS("CvePS").ToString.ToEntero
' CveUMSerieLote = DrPS("CveUnidadMedida").ToString.ToEntero
' Exit Sub
' End If
' AgregarPS(1, DrPS("CvePS").ToString.ToEntero, DrPS("CveUnidadMedida").ToString.ToEntero)
' TxtCodigoPS.Text = ""
' End Sub
' Protected Sub BtnSeriePS_Click(sender As Object, e As EventArgs)
' If TxtSeriePS.Text.Trim = "" Then
' Exit Sub
' End If
' 'TxtCantidad.Text = "1"
' Dim Valido = ValidaExistencia(1, CvePSSerieLote, CveUMSerieLote, TxtSeriePS.Text.Trim)
' If Valido Then
' AgregarPS(1, CvePSSerieLote, CveUMSerieLote, TxtSeriePS.Text.Trim)
' Else
' TxtSeriePS.Text = ""
' TxtSeriePS.Focus()
' Exit Sub
' End If
' TdSeriePS.Visible = False
' TxtSeriePS.Text = ""
' TxtCodigoPS.Text = ""
' TxtCodigoPS.Focus()
' End Sub
'#End Region
'#Region "DDL CLASIFICACION"
' Protected Sub DdlClasificacion_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlClasificacion.SelectedIndexChanged
' ChangeDdlProducto()
' End Sub
' Private Sub ChangeDdlProducto()
' If UsuarioActual.Empresa.Funcionalidad(105) = "" Then
' Dim filtro As String = ""
' If Not (DdlClasificacion.SelectedValue = "-1") Then
' If isWhitFamily() Then
' filtro = String.Format("AND CveSubFamilia={0}", DdlClasificacion.SelectedValue)
' Else
' filtro = String.Format("AND CveClasificacion={0}", DdlClasificacion.SelectedValue)
' End If
' End If
' DdlProducto2.DataSource = GlobalDTProductosServicios(UsuarioActual.CveEmpresa).FiltraParametros($"Inv_CveMetodoInventario = 5 {filtro}", "PS")
' DdlProducto2.DataBind()
' DdlProducto2.ddl.Items.Insert(0, New ListItem("----", "-1"))
' Else
' If isWhitFamily() Then
' DdlProducto2.ddlWS.Attributes.Add("data-idSubFamilia", DdlClasificacion.SelectedValue)
' Else
' DdlProducto2.ddlWS.Attributes.Add("data-idClasificacion", DdlClasificacion.SelectedValue)
' End If
' End If
' End Sub
' Protected Sub DdlProducto_ValueChanged(sender As Object, e As EventArgs) Handles DdlProducto2.selectedindexchange
' ElProductoChange()
' End Sub
' Private Sub ElProductoChange()
' 'TxtnSerieLote.Visible = False
' 'If DdlProducto2.SelectedValue.ToEntero > 0 Then
' ' If GlobalDTProductosServicios(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CvePS = {0} AND Inv_CveMetodoInventario = 5 ", DdlProducto2.SelectedValue), "PS").Rows.Count > 0 Then
' ' ThSerieLote.Visible = True
' ' TdSerieLote.Visible = True
' ' TxtnSerieLote.Visible = True
' ' GvDatos.Columns(2).Visible = True
' ' End If
' 'End If
' 'Dim objinv As New ClsInventarios
' 'If objinv.GetExistenciasProducto(DdlProducto2.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, -1, Now) Then
' ' If objinv.DtResultados.Rows.Count = 0 Then
' ' Alert("No hay existencias de este producto", TipoMensaje.MsgAdvertencia)
' ' End If
' 'End If
' 'UpGral.Update()
' End Sub
' Private Function isWhitFamily() As Boolean
' Return (UsuarioActual.CveEmpresa = 66)
' End Function
'#End Region
'#Region "GV DATOS"
' Private Sub CargaGvDatos()
' 'TxtnSerieLote.Visible = False
' 'ThSerieLote.Visible = False
' 'TdSerieLote.Visible = False
' 'GvDatos.Columns(4).Visible = False
' GvDatos.DataSource = DtMovimientos
' GvDatos.DataBind()
' UpGral.Update()
' End Sub
' Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound
' If e.Row.RowType = DataControlRowType.DataRow Then
' If CveMovimiento > 0 Then
' e.Row.FCLinkButton("lnkRemove").Visible = False
' End If
' If e.Row.DBCampo("EstatusExistencia").ToEntero < 0 Then
' e.Row.Cells(0).BackColor = Drawing.Color.Red
' End If
' If e.Row.DBCampo("SerieLote").ToString <> "-1" Then
' 'TxtnSerieLote.Visible = True
' 'ThSerieLote.Visible = True
' 'TdSerieLote.Visible = True
' 'GvDatos.Columns(2).Visible = True
' 'e.Row.Cells(2).Text = e.Row.DBCampo("SerieLote").ToString
' Else
' e.Row.Cells(2).Text = ""
' End If
' End If
' End Sub
' Protected Sub GvPS_RowDeleting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
' Dim DbRow As DataRow = Nothing
' DbRow = DtMovimientos.Rows(e.RowIndex)
' DtMovimientos.Rows.Remove(DbRow)
' CargaGvDatos()
' End Sub
'#End Region
'#End Region
End Class

View File

@@ -1378,7 +1378,7 @@
<asp:Literal Text='<%# Eval("CodigoPS") %>' ID="LtProducto" runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="Serie" DataField="SerieLote" ItemStyle-Width="10%" Visible="false" />
<asp:BoundField HeaderText="Serie" DataField="Serie" ItemStyle-Width="10%" Visible="false" />
<asp:BoundField HeaderText="Lote" DataField="Lote" ItemStyle-Width="10%" Visible="false" />
<asp:BoundField HeaderText="FechaCaducidad" DataField="FechaCaducidad" DataFormatString="{0:d}" ItemStyle-Width="10%" Visible="false" />
</Columns>

View File

@@ -2841,7 +2841,7 @@ Partial Class OC
Dim CveMovimientoEntradaAjuste = ObjInventarios.AddMovimiento(CveAlmacen, 2, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Modulo:="OC/G")
If ObjInventarios.GetMovimientosDetalle(CveMovimientoSalidaAjuste, UsuarioActual.CveEmpresa) Then
For Each Dr As DataRow In ObjInventarios.DtResultados.Rows
If Not ObjInventarios.AddMovimientoDetalle(CveMovimientoEntradaAjuste, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, DtInvOCDiferencias.FiltroPrimeroValor("ImporteMovto", $"CveOrdenCompraDetalle = {Dr("CveOrdenCompraDetalle").ToString.ToEntero}").ToDouble, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveOrdenCompraDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero) Then
If Not ObjInventarios.AddMovimientoDetalle(CveMovimientoEntradaAjuste, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, DtInvOCDiferencias.FiltroPrimeroValor("ImporteMovto", $"CveOrdenCompraDetalle = {Dr("CveOrdenCompraDetalle").ToString.ToEntero}").ToDouble, Dr("CveAF").ToString.ToEntero, -1, Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveOrdenCompraDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero) Then
TieneError = True
Exit For
End If
@@ -6811,7 +6811,7 @@ Partial Class OC
Else
'DETALLE
If e.Row.DBCampo("SerieLote") <> "" Then
If e.Row.DBCampo("Serie") <> "" Then
GVInv.Columns(4).Visible = True
End If

View File

@@ -2216,7 +2216,7 @@ Partial Class Ventas_PortalCliente
TmpDT.Columns.Add("NoIdentificacion", GetType(String))
TmpDT.Columns.Add("CveTipoPS", GetType(Integer))
TmpDT.Columns.Add("CveTipoInvPS", GetType(Integer))
TmpDT.Columns.Add("SerieLote", GetType(String))
TmpDT.Columns.Add("Serie", GetType(String))
TmpDT.Columns.Add("CuentaPredial", GetType(String))
TmpDT.Columns.Add("Obs", GetType(String))
TmpDT.Columns.Add("TiempoEntrega", GetType(String))
@@ -2482,7 +2482,7 @@ Partial Class Ventas_PortalCliente
Private Function AgregarProductoServicio(Cantidad As Decimal, CveUM As Integer, UM As String, CveClasificacion As Integer, Clasificacion As String, CvePS As Integer, PS As String, Obs As String,
PU As Decimal, Descuento As Decimal,
CveProyecto As Integer, Proyecto As String, CveSubProyecto As Integer, SubProyecto As String,
Optional SerieLote As String = "", Optional TiempoEntrega As String = "", Optional EntregaDirecta As Integer = 0,
Optional Serie As String = "", Optional TiempoEntrega As String = "", Optional EntregaDirecta As Integer = 0,
Optional CveContratoDetalle As Integer = 0, Optional CveVentaDetalle As Integer = 0, Optional CveMovimientoDetallePedido As Integer = 0,
Optional CveOrdenCompraDetalle As Integer = 0, Optional CveVentaDetalleRemision As Integer = 0, Optional CveVentaDetalleCotizacion As Integer = 0,
Optional CuentaPredial As String = "", Optional RegeneraIEPS As Boolean = True, Optional CveVentaDetallePedido2 As Integer = 0) As Boolean
@@ -2510,7 +2510,7 @@ Partial Class Ventas_PortalCliente
Row("Proyecto") = Proyecto
Row("CveSubProyecto") = CveSubProyecto
Row("SubProyecto") = SubProyecto
Row("SerieLote") = SerieLote
Row("Serie") = Serie
Row("TiempoEntrega") = TiempoEntrega
Row("Orden") = TmpDT.Rows.Count + 1
Row("Cantidad") = Cantidad

View File

@@ -1325,7 +1325,7 @@
<asp:ListItem Text="UEPS" Value="2"></asp:ListItem>
<asp:ListItem Text="PEPS" Value="3"></asp:ListItem>
<asp:ListItem Text="Identificador" Value="4"></asp:ListItem>
<asp:ListItem Text="SerieLote" Value="5"></asp:ListItem>
<asp:ListItem Text="Serie" Value="5"></asp:ListItem>
</asp:DropDownList>
</td>
</tr>

View File

@@ -9064,7 +9064,7 @@ Partial Class Clientes
TmpDT.Columns.Add("NoIdentificacion", GetType(String))
TmpDT.Columns.Add("CveTipoPS", GetType(Integer))
TmpDT.Columns.Add("CveTipoInvPS", GetType(Integer))
TmpDT.Columns.Add("SerieLote", GetType(String))
TmpDT.Columns.Add("Serie", GetType(String))
TmpDT.Columns.Add("CuentaPredial", GetType(String))
TmpDT.Columns.Add("Obs", GetType(String))
TmpDT.Columns.Add("TiempoEntrega", GetType(String))
@@ -9138,7 +9138,7 @@ Partial Class Clientes
Private Function AgregarProductoServicio(Cantidad As Decimal, CveUM As Integer, UM As String, CveClasificacion As Integer, Clasificacion As String, CvePS As Integer, PS As String, Obs As String,
PU As Decimal, Descuento As Decimal,
CveProyecto As Integer, Proyecto As String, CveSubProyecto As Integer, SubProyecto As String,
Optional SerieLote As String = "", Optional TiempoEntrega As String = "", Optional EntregaDirecta As Integer = 0,
Optional Serie As String = "", Optional TiempoEntrega As String = "", Optional EntregaDirecta As Integer = 0,
Optional CveContratoDetalle As Integer = 0, Optional CveVentaDetalle As Integer = 0, Optional CveMovimientoDetallePedido As Integer = 0,
Optional CveOrdenCompraDetalle As Integer = 0, Optional CveVentaDetalleRemision As Integer = 0, Optional CveVentaDetalleCotizacion As Integer = 0,
Optional CuentaPredial As String = "", Optional RegeneraIEPS As Boolean = True, Optional CveVentaDetallePedido2 As Integer = 0, Optional EsCargo As Boolean = False, Optional PorcentajeIVA As Decimal = 0D) As Boolean
@@ -9164,7 +9164,7 @@ Partial Class Clientes
Row("Proyecto") = Proyecto
Row("CveSubProyecto") = CveSubProyecto
Row("SubProyecto") = SubProyecto
Row("SerieLote") = SerieLote
Row("Serie") = Serie
Row("TiempoEntrega") = TiempoEntrega
Row("Orden") = TmpDT.Rows.Count + 1
Row("Cantidad") = Cantidad

View File

@@ -1973,7 +1973,7 @@ Partial Class Ventas_ClientesAbonar
CveClasificacion As Integer, Clasificacion As String, CveProyecto As Integer, CveSubProyecto As Integer,
Obs As String, Cantidad As Double, PU As Double, PorcentajeIVA As Double, ImporteIVA As Double, PorcentajeRetIVA As Double, ImporteRetIVA As Double,
PorcentajeRetISR As Double, ImporteRetISR As Double, PorcentajeIEPS As Double, ImporteIEPS As Double, TipoDescuento As Integer, Descuento As Double,
Total As Double, SerieLote As String, TiempoEntrega As String, CvePresupuestoIngreso As Integer, EntregaDirecta As Integer, SATClaveProdServ As String,
Total As Double, Serie As String, TiempoEntrega As String, CvePresupuestoIngreso As Integer, EntregaDirecta As Integer, SATClaveProdServ As String,
SATClaveUM As String, CveContratoDetalle As Integer, CveVentaDetalle As Integer, CveMovimientoDetallePedido As Integer, CveOrdenCompraDetalle As Integer,
CveVentaDetalleRemision As Integer, CveVentaDetalleCotizacion As Integer)
@@ -2018,7 +2018,7 @@ Partial Class Ventas_ClientesAbonar
Row("Total") = Math.Round(Total, 2)
Row("TotalImporte") = Math.Round(Total, 2)
Row("SerieLote") = SerieLote
Row("Serie") = Serie
Row("TiempoEntrega") = TiempoEntrega
Row("CvePresupuestoIngreso") = CvePresupuestoIngreso
Row("EntregaDirecta") = EntregaDirecta
@@ -2182,7 +2182,7 @@ Partial Class Ventas_ClientesAbonar
TmpDT.Columns.Add("NoIdentificacion", GetType(String))
TmpDT.Columns.Add("CveTipoPS", GetType(Integer))
TmpDT.Columns.Add("CveTipoInvPS", GetType(Integer))
TmpDT.Columns.Add("SerieLote", GetType(String))
TmpDT.Columns.Add("Serie", GetType(String))
TmpDT.Columns.Add("CuentaPredial", GetType(String))
TmpDT.Columns.Add("Obs", GetType(String))
TmpDT.Columns.Add("TiempoEntrega", GetType(String))

View File

@@ -936,12 +936,11 @@
</asp:TemplateField>
<asp:TemplateField HeaderText="Serie">
<ItemTemplate>
<asp:Literal ID="LtlSerie" Text='<%# Eval("SerieLote") %>' Visible="false" runat="server" />
<asp:TextBox ID="TxtSerie" AutoPostBack="false" Text='<%# Eval("SerieLote") %>' Visible="false" runat="server" />
<asp:Literal ID="LtlSerie" Text='<%# Eval("Serie") %>' Visible="false" runat="server" />
<asp:TextBox ID="TxtSerie" AutoPostBack="false" Text='<%# Eval("Serie") %>' Visible="false" runat="server" />
<asp:Button Text="" ID="BtnSerie" Style="display: none;" OnClick="BtnSerie_Click" runat="server" />
<asp:HiddenField runat="server" Value='<%# Eval("SerieLote") %>' ID="HdnSerie" />
<asp:HiddenField runat="server" Value='<%# Eval("Serie") %>' ID="HdnSerie" />
<%--<asp:HiddenField runat="server" ID="HdnSerieLote" Value='<%# Eval("SerieLote")%>' />--%>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Lote" HeaderText="Lote" />

View File

@@ -2924,7 +2924,7 @@ Partial Class PV
DtTemporal.Columns.Add("FechaCaducidad", Type.GetType("System.DateTime"))
End If
GvInv.Columns(4).Visible = DtTemporal.MAX("SerieLote", "SerieLote <> ''") <> "" Or CveVenta <= 0
GvInv.Columns(4).Visible = DtTemporal.MAX("Serie", "Serie <> ''") <> "" Or CveVenta <= 0
GvInv.Columns(5).Visible = DtTemporal.MAX("Lote", "Lote <> ''") <> ""
GvInv.Columns(6).Visible = DtTemporal.MAX("FechaCaducidad", "FechaCaducidad <> ''") <> ""
@@ -2989,7 +2989,7 @@ Partial Class PV
'COSTO ALMACEN
If UsuarioActual.Empresa.Funcionalidad(129).ToEntero > 0 AndAlso UsuarioActual.CveUsuario <> 1560 Then
Costo = ObjInventarios.GetCostoPS(dr("CvePS").ToString.ToEntero, dr("Cantidad").ToString.ToDouble, -1, dr("SerieLote").ToString, TxtFecha.Text.ToDate, -1)
Costo = ObjInventarios.GetCostoPS(dr("CvePS").ToString.ToEntero, dr("Cantidad").ToString.ToDouble, -1, dr("Serie").ToString, TxtFecha.Text.ToDate, -1)
CostoMenor = Costo + ((UsuarioActual.Empresa.Funcionalidad(129).ToDecimal / 100) * Costo)
'SI EL PRECIO ES MAYOR AL COSTO, SI PASA
If PU >= CostoMenor Then
@@ -3000,7 +3000,7 @@ Partial Class PV
End If
If UsuarioActual.Empresa.Funcionalidad(133).ToEntero > 0 AndAlso UsuarioActual.CveUsuario <> 1560 Then
Costo = ObjInventarios.GetCostoPS(dr("CvePS").ToString.ToEntero, dr("Cantidad").ToString.ToDouble, -1, dr("SerieLote").ToString, TxtFecha.Text.ToDate)
Costo = ObjInventarios.GetCostoPS(dr("CvePS").ToString.ToEntero, dr("Cantidad").ToString.ToDouble, -1, dr("Serie").ToString, TxtFecha.Text.ToDate)
CostoMayor = Costo + ((UsuarioActual.Empresa.Funcionalidad(133).ToDecimal / 100) * Costo)
'SI EL PRECIO ES MAYOR AL COSTO, SI PASA
If PU <= CostoMayor Then
@@ -3901,7 +3901,7 @@ Partial Class PV
Private Sub AddPS(Cantidad As Double, CveUM As Integer, UM As String, CveClasificacion As Integer, Clasificacion As String, CvePS As Integer, PS As String, Obs As String,
PU As Double, IVA As Double, RetIVA As Double, Descuento As Double, AsientoContableVentas As Integer, IdCtaContable As Integer, AplicaParaConcepto As Boolean,
Codigo As String, CveProyecto As Integer, Proyecto As String, CveSubProyecto As Integer, SubProyecto As String, Optional CveTipoPS As Integer = -1, Optional SerieLote As String = "",
Codigo As String, CveProyecto As Integer, Proyecto As String, CveSubProyecto As Integer, SubProyecto As String, Optional CveTipoPS As Integer = -1, Optional Serie As String = "",
Optional CveContratoDetalle As Integer = -1, Optional TiempoEntrega As String = "", Optional CodigoPS As String = "")
If Not CvePS > 0 Then
@@ -3948,7 +3948,7 @@ Partial Class PV
Row("Proyecto") = Proyecto
Row("CveSubProyecto") = CveSubProyecto
Row("SubProyecto") = SubProyecto
Row("SerieLote") = SerieLote
Row("Serie") = Serie
Row("TiempoEntrega") = TiempoEntrega
TmpDT.Rows.Add(Row)
@@ -4069,7 +4069,7 @@ Partial Class PV
Private Function AgregarProductoServicio(Cantidad As Decimal, CveUM As Integer, UM As String, CveClasificacion As Integer, Clasificacion As String, CvePS As Integer, PS As String, Obs As String,
PU As Decimal, Descuento As Decimal,
CveProyecto As Integer, Proyecto As String, CveSubProyecto As Integer, SubProyecto As String,
Optional SerieLote As String = "", Optional TiempoEntrega As String = "", Optional EntregaDirecta As Integer = 0,
Optional Serie As String = "", Optional TiempoEntrega As String = "", Optional EntregaDirecta As Integer = 0,
Optional CveContratoDetalle As Integer = 0, Optional CveVentaDetalle As Integer = 0, Optional CveMovimientoDetallePedido As Integer = 0,
Optional CveOrdenCompraDetalle As Integer = 0, Optional CveVentaDetalleRemision As Integer = 0, Optional CveVentaDetalleCotizacion As Integer = 0,
Optional CuentaPredial As String = "", Optional RegeneraIEPS As Boolean = True, Optional CveVentaDetallePedido2 As Integer = 0, Optional EsCargo As Boolean = False,
@@ -4128,7 +4128,7 @@ Partial Class PV
Row("Proyecto") = Proyecto
Row("CveSubProyecto") = CveSubProyecto
Row("SubProyecto") = SubProyecto
Row("SerieLote") = SerieLote
Row("Serie") = Serie
Row("TiempoEntrega") = TiempoEntrega
Row("Orden") = TmpDT.Rows.Count + 1
Row("Cantidad") = Cantidad
@@ -4599,7 +4599,7 @@ Partial Class PV
Dim Consec = AgregarProductoServicio(Cantidad, DdlUnidadMedida.SelectedValue.ToEntero, DdlUnidadMedida.SelectedItem.Text, DdlClasificacion.SelectedValue.ToEntero, DdlClasificacion.SelectedItem.Text,
CvePS, "", TxtObsPS.Text.Trim, PU, Descuento,
CveProyecto, Proyecto, DdlSubProyectoDatos.SelectedValue.ToEntero, DdlSubProyectoDatos.SelectedItem.Text,
SerieLote:="", TiempoEntrega:="", CuentaPredial:="", RegeneraIEPS:=ClienteDesglosaIEPS, CveVentaDetalle:=CveVentaDetalle, EsCargo:=EsCargo)
Serie:="", TiempoEntrega:="", CuentaPredial:="", RegeneraIEPS:=ClienteDesglosaIEPS, CveVentaDetalle:=CveVentaDetalle, EsCargo:=EsCargo)
If CveVentaDetalle <= 0 AndAlso Not EsCargo Then
Dim ListaPSCargo = CalculaUsados(Consec)
@@ -5067,7 +5067,7 @@ Partial Class PV
' 'AddPS(TxtCantidad.Text.Trim.ToDouble, DrProducto("CveUM").ToString.ToEntero, DrProducto("UnidadMedida").ToString, DrProducto("CveClasificacion").ToString.ToEntero, DrProducto("Clasificacion").ToString,
' ' DrProducto("CvePS").ToString.ToEntero, DrProducto("PS").ToString, TxtObsPS.Text.Trim, TxtPrecio.Text.Trim.ToDouble, HdnIVAPS.Value.ToDouble, 0, 0,
' ' -1, -1, True, DrProducto("Codigo").ToString, DdlProyecto.SelectedValue.ToEntero,
' ' DdlProyecto.SelectedItem.Text, DdlSubProyecto.SelectedValue.ToEntero, DdlSubProyecto.SelectedItem.Text, DrProducto("CveTipoPS").ToString.ToEntero, DrProducto("Inv_CveMetodoInventario").ToString.ToEntero, SerieLote:=SerieLote, CodigoPS:=DrProducto("PSCodigo").ToString)
' ' DdlProyecto.SelectedItem.Text, DdlSubProyecto.SelectedValue.ToEntero, DdlSubProyecto.SelectedItem.Text, DrProducto("CveTipoPS").ToString.ToEntero, DrProducto("Inv_CveMetodoInventario").ToString.ToEntero, SerieLote:=SerieLote, CodigoPS:=DrProducto("PSCodigo").ToString)
' LimpiaAgregar()
' End If
@@ -5391,17 +5391,17 @@ Partial Class PV
Dim Index = Row.RowIndex
Dim ObjInventarios As New ClsInventarios
Dim Existencia = ObjInventarios.GetExistenciasPSSerie("", ddlAlmacen.SelectedValue.ToEntero, UsuarioActual.CveEmpresa)
Dim ExistenciaActual = DtInv.SUM("Cantidad", String.Format("SerieLote = '{0}'", Row.FCTextBox("TxtSerie").Text.ToString))
Dim ExistenciaActual = DtInv.SUM("Cantidad", String.Format("Serie = '{0}'", Row.FCTextBox("TxtSerie").Text.ToString))
'Valida Existencia
If Existencia - ExistenciaActual <= 0 Then
Alert(String.Format("Not hay existencia suficiente del producto con la Serie: <b>{0}</b>. Por favor rectifique y vuelva a intentar", Row.FCTextBox("TxtSerie").Text.ToString), TipoMensaje.MsgAdvertencia)
Row.FCTextBox("TxtSerie").Text = ""
Row.FCHiddenField("HdnSerie").Value = ""
TmpDT.Rows(Index)("SerieLote") = ""
TmpDT.Rows(Index)("Serie") = ""
Else
Row.FCHiddenField("HdnSerie").Value = Row.FCTextBox("TxtSerie").Text
TmpDT.Rows(Index)("SerieLote") = Row.FCTextBox("TxtSerie").Text
TmpDT.Rows(Index)("Serie") = Row.FCTextBox("TxtSerie").Text
End If
TmpDT.AcceptChanges()
@@ -5428,7 +5428,7 @@ Partial Class PV
If Gvr.FCTextBox("TxtSerie").Visible = True And Gvr.FCTextBox("TxtSerie").Text.Trim <> "" Then
Existencia = ObjInventarios.GetExistenciasPSSerie(Gvr.FCTextBox("TxtSerie").Text.ToString, ddlAlmacen.SelectedValue.ToEntero, UsuarioActual.CveEmpresa)
ExistenciaActual = DtInv.SUM("Cantidad", String.Format("SerieLote = '{0}'", Gvr.FCTextBox("TxtSerie").Text.Trim))
ExistenciaActual = DtInv.SUM("Cantidad", String.Format("Serie = '{0}'", Gvr.FCTextBox("TxtSerie").Text.Trim))
'Valida Existencia
If Existencia - ExistenciaActual < 0 Or Existencia = 0 Then

View File

@@ -835,6 +835,38 @@
</div>
</div>
<div class="row" style="margin-top: 5px;">
<label class="col-md-6 truncate">Aplica Serie</label>
<div class="col-md-6">
<asp:CheckBox ID="ChkSerie" CssClass="make-switchsd" data-size="small" runat="server" Text=" " />
</div>
</div>
<div class="row" style="margin-top: 5px;">
<label class="col-md-6 truncate">Aplica Lote</label>
<div class="col-md-6">
<asp:CheckBox ID="ChkLote" CssClass="make-switchsd" data-size="small" runat="server" Text=" " />
</div>
</div>
<div class="row" style="margin-top: 5px;">
<label class="col-md-6 truncate">Aplica Caducidad</label>
<div class="col-md-6">
<asp:CheckBox ID="ChkCaducidad" CssClass="make-switchsd" data-size="small" runat="server" Text=" " />
</div>
</div>
<div class="row" style="margin-top: 5px;">
<label class="col-md-6 truncate">Aplica Sección</label>
<div class="col-md-6">
<asp:CheckBox ID="ChkSeccion" CssClass="make-switchsd" data-size="small" runat="server" Text=" " />
</div>
</div>
<div class="row" style="margin-top: 5px;" id="DivProveedorCompra" runat="server" visible="false">
<label class="col-md-6 truncate">Proveedor de Compra</label>
<div class="col-md-6">

View File

@@ -146,7 +146,7 @@ Partial Class ProductosyServicios
CargarAlias()
CargaExistencias()
CargaGvSeccionAlmacen()
Else
'Configuración de Modalidad Insert
RegistraScript("$('#C_Tab_TabPaquetes_tab').css('display' , 'none')")
@@ -286,7 +286,7 @@ Partial Class ProductosyServicios
CveSATPS = -1
CargaCombosSeccionAlmacen()
DivSeccionAlmacen.Visible = UsuarioActual.Empresa.Funcionalidad(563).ToString = "1"
CreaDtSeccionAlmacen()
If UsuarioActual.Empresa.UsaContabilidad Then
@@ -863,6 +863,16 @@ Partial Class ProductosyServicios
ViewState("CveSubFamilia") = ObjProductosServicios.DtResultados.Rows(0)("CveSubFamilia")
ChkSerie.Checked = ObjProductosServicios.AplicaSerie
ChkLote.Checked = ObjProductosServicios.AplicaLote
ChkCaducidad.Checked = ObjProductosServicios.AplicaCaducidad
ChkSeccion.Checked = ObjProductosServicios.AplicaSeccion
If ObjProductosServicios.AplicaSeccion Then
CargaGvSeccionAlmacen()
DivSeccionAlmacen.Visible = True
End If
CargaCaracteristicas()
LnkUnificar.Visible = True
@@ -1208,7 +1218,8 @@ Partial Class ProductosyServicios
CveUsuarioModifico:=UsuarioActual.CveUsuario, CveClasificacionDetalle:=DdlTipoPSDes.SelectedValue.ToEntero, CveTamaño:=DdlTamanio.SelectedValue.ToEntero,
CveModelo:=DdlModelo.SelectedValue.ToEntero(), CveMedida:=DdlMedida.SelectedValue.ToEntero(), CveRinTamaño:=DdlRin.SelectedValue.ToEntero(),
ClaveImpuestoEmpaque:=DdlImpEmpaque.SelectedValue.ToString, ClaveImpuestoUM:=DdlImpUM.SelectedValue.ToString, ClaveCategoriaToxicidad:=DdlCategoriaToxicidad.SelectedValue.ToString,
ClaveImpuestoTipoProducto:=DdlImpTipoProducto.SelectedValue.ToString, EsOutSourcing:=ChkEsOutSourcing.Checked) Then
ClaveImpuestoTipoProducto:=DdlImpTipoProducto.SelectedValue.ToString, EsOutSourcing:=ChkEsOutSourcing.Checked,
AplicaSerie:=ChkSerie.Checked, AplicaLote:=ChkLote.Checked, AplicaCaducidad:=ChkCaducidad.Checked, AplicaSeccion:=ChkSeccion.Checked) Then
If Not ObjProductosServicios.LimpiaImpuestosLocales(CvePS) Then
TieneError = True
@@ -2530,9 +2541,10 @@ Partial Class ProductosyServicios
End Sub
Private Sub CargaGvSeccionAlmacen()
Dim ObjInv As New ClsInventarios
If ObjInv.GetProductosServiciosAlmacenSeccion(CvePS, -1, -1) Then
If ObjInv.GetProductosServiciosAlmacenSeccion(CvePS, -1, -1, UsuarioActual.CveEmpresa) Then
GvSeccionAlmacen.DataSource = ObjInv.DtResultados
DtSeccionAlmacen = ObjInv.DtResultados
End If
ObjInv.Dispose()
GvSeccionAlmacen.DataBind()
@@ -2545,7 +2557,7 @@ Partial Class ProductosyServicios
DdlAlmacen.Items.Add(New ListItem("Seleccione", "-1"))
DdlAlmacen.DataBind()
DdlSeccionAlmacen.DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, -1)
DdlSeccionAlmacen.DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero)
DdlSeccionAlmacen.Items.Add(New ListItem("Seleccione", "-1"))
DdlSeccionAlmacen.DataBind()

View File

@@ -520,7 +520,7 @@ public partial class Ventas_RepConciliacionEmitidosSat : ClsPaginas
TmpDT.Columns.Add("NoIdentificacion", typeof(string));
TmpDT.Columns.Add("CveTipoPS", typeof(int));
TmpDT.Columns.Add("CveTipoInvPS", typeof(int));
TmpDT.Columns.Add("SerieLote", typeof(string));
TmpDT.Columns.Add("Serie", typeof(string));
TmpDT.Columns.Add("CuentaPredial", typeof(string));
TmpDT.Columns.Add("Obs", typeof(string));
TmpDT.Columns.Add("TiempoEntrega", typeof(string));
@@ -635,7 +635,7 @@ public partial class Ventas_RepConciliacionEmitidosSat : ClsPaginas
Row["Proyecto"] = DrSubProyecto["Proyecto"].ToString();
Row["CveSubProyecto"] = CveSubProyecto;
Row["SubProyecto"] = DrSubProyecto["SubProyecto"].ToString();
Row["SerieLote"] = "";
Row["Serie"] = "";
Row["TiempoEntrega"] = "";
Row["Orden"] = TmpDT.Rows.Count + 1;
Row["Cantidad"] = item.Cantidad;

View File

@@ -10,7 +10,7 @@
padding: 0px 5px;
}
.nolineheight {
.nolineheight TxtNombreCliente
line-height: 1;
}
@@ -1311,7 +1311,7 @@
<ContentTemplate>
<div class="col-md-12">
<asp:GridView ID="GvCodigosUnicos" runat="server" CssClass="table table-striped table-hover Widthall" AutoGenerateColumns="False"
DataKeyNames="CvePolizaVirtual,SerieLote,IdProductoPolizaVirtual,Total,Descuento,AnioVehiculo,FechaUsado,IdModeloAuto,IdMarcaAuto,IdBCI,TipoServicio,TipoPoliza,TieneUsado,IdMarcaUsado" ClientIDMode="Static" EmptyDataText="" GridLines="None">
DataKeyNames="CvePolizaVirtual,Serie,IdProductoPolizaVirtual,Total,Descuento,AnioVehiculo,FechaUsado,IdModeloAuto,IdMarcaAuto,IdBCI,TipoServicio,TipoPoliza,TieneUsado,IdMarcaUsado" ClientIDMode="Static" EmptyDataText="" GridLines="None">
<Columns>
<asp:TemplateField HeaderText="Código Único">
<ItemTemplate>
@@ -1646,16 +1646,16 @@
</asp:TemplateField>
<asp:TemplateField HeaderText="Serie">
<ItemTemplate>
<asp:Literal ID="LtlSerie" Text='<%# Eval("SerieLote") %>' Visible="false" runat="server" />
<asp:TextBox ID="TxtSerie" AutoPostBack="false" Text='<%# Eval("SerieLote") %>' Visible="false" runat="server" />
<asp:Literal ID="LtlSerie" Text='<%# Eval("Serie") %>' Visible="false" runat="server" />
<asp:TextBox ID="TxtSerie" AutoPostBack="false" Text='<%# Eval("Serie") %>' Visible="false" runat="server" />
<asp:Button Text="" ID="BtnSerie" Style="display: none;" OnClick="BtnSerie_Click" runat="server" />
<asp:HiddenField runat="server" Value='<%# Eval("SerieLote") %>' ID="HdnSerie" />
<asp:HiddenField runat="server" Value='<%# Eval("Serie") %>' ID="HdnSerie" />
<%--<asp:HiddenField runat="server" ID="HdnSerieLote" Value='<%# Eval("SerieLote")%>' />--%>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Lote" HeaderText="Lote" />
<asp:BoundField DataField="FechaCaducidad" HeaderText="FechaCaducidad" />
<asp:BoundField DataField="FechaCaducidad" HeaderText="FechaCaducidad" DataFormatString="{0:d}" />
</Columns>
</asp:GridView>
</div>
@@ -3543,7 +3543,7 @@
<div style="max-height: 300px; overflow-y: auto;">
<asp:GridView ID="GVAnticipos" runat="server" AutoGenerateColumns="False" ClientIDMode="Static" EmptyDataText="No se encontraron Anticipos del Cliente"
ToolTip="Listado de Anticipos" CssClass="GVAnticipos table table-striped table-hover Widthall" data-height="300" Style="text-align: center;" GridLines="None"
DataKeyNames="ISTotal,Saldo,CveIE,Folio,Tipo,CveVenta,CveConceptoContable,CveConceptoContableAmor, TotalAnticipo, SubTotalAnticipo, IVAAnticipo, ImpuestosLocalesAnticipo, SubTotalAmortizacion, SubTotal, Original, IVA, RetIVA, RetISR, IdCtaContableNC,FolioFiscal, CveClasificacionNC, IdCtaContableNCSIG, TipoCambio,TipoCambioPago,TipoCambioHoy, CveMoneda,Fecha,SaldoSubTotal">
DataKeyNames="ISTotal,Saldo,CveIE,Folio,Tipo,CveVenta,CveConceptoContable,CveConceptoContableAmor, TotalAnticipo, SubTotalAnticipo, IVAAnticipo, ImpuestosLocalesAnticipo, SubTotalAmortizacion, SubTotal, Original, IVA, RetIVA, RetISR, IdCtaContableNC,FolioFiscal, CveClasificacionNC, IdCtaContableNCSIG, TipoCambio,TipoCambioPago,TipoCambioHoy, CveMoneda,Fecha,SaldoSubTotal,SaldoConImpuestos">
<Columns>
<asp:TemplateField>
<ItemTemplate>
@@ -3567,7 +3567,7 @@
<ItemTemplate>
<asp:Literal ID="LtlAnticipos" runat="server" Text='<%# Eval("Saldo", "{0:N2}") %>'></asp:Literal>&nbsp;
</ItemTemplate>
</asp:TemplateField>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Moneda Venta</HeaderTemplate>
<ItemTemplate>
@@ -5405,9 +5405,9 @@
<tr>
<td width="80px">Serie:</td>
<td>
<asp:TextBox runat="server" ID="TxtSerieLote" Width="300px" ClientIDMode="Static" />
<asp:RequiredFieldValidator ID="RFVSerieLote" runat="server" ControlToValidate="TxtSerieLote" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Serie/Lote''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAgregaSerie"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCESerieLote" runat="server" HighlightCssClass="vco" TargetControlID="RFVSerieLote" Width="300px"></ajax:ValidatorCalloutExtender>
<asp:TextBox runat="server" ID="TxtSerie" Width="300px" ClientIDMode="Static" />
<asp:RequiredFieldValidator ID="RFVSerie" runat="server" ControlToValidate="TxtSerie" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Serie''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAgregaSerie"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCESerie" runat="server" HighlightCssClass="vco" TargetControlID="RFVSerie" Width="300px"></ajax:ValidatorCalloutExtender>
<td colspan="3" align="left">
<asp:Label runat="server">Series total: </asp:Label><asp:Label runat="server" ID="lblSerieTotal">0</asp:Label>
</td>
@@ -6310,7 +6310,7 @@
</div>
</div>
<div id="DivNombreCliente" runat="server" visible="false" class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtNombreCliente" CssClass="form-control " runat="server" MaxLength="50" CausesValidation="true"></asp:TextBox>
<asp:TextBox ID="TxtNombreCliente" CssClass="form-control " runat="server" MaxLength="150" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVNombreCliente" runat="server" ControlToValidate="TxtNombreCliente" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Nombre''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarCliente"></asp:RequiredFieldValidator>
<label for="<%= TxtNombreCliente.ClientID.ToString()%>">Razón Social:</label>
</div>
@@ -7231,7 +7231,8 @@
let TipoAnticipo = $('#<%= DdlTipoAmortizacionAnticipo.ClientID %>').val();
$get("HdnTipoDescuento").value = "3";
var Total = ToDouble($get('TxtSubTotal').value);
//si es con.nc,es.el.total
var Total = ToDouble($get(TipoAnticipo == 2? 'TxtTotal':'TxtSubTotal').value);
var SaldoCompra = parseFloat(parseFloat($get('HdnVentaSaldo').value).toFixed(2));
if (ToDouble($get('HdnCveVenta').value) == 0) SaldoCompra = Total;

View File

@@ -1311,36 +1311,36 @@ Partial Class Ventas
ViewState("DtContratosSerieDetalle") = value
End Set
End Property
Private Property CvePSSerieLote As Integer
Private Property CvePSSerie As Integer
Get
Return CType(ViewState("CvePSSerieLote"), Integer)
Return CType(ViewState("CvePSSerie"), Integer)
End Get
Set(value As Integer)
ViewState("CvePSSerieLote") = value
ViewState("CvePSSerie") = value
End Set
End Property
Private Property CveUMSerieLote As Integer
Private Property CveUMSerie As Integer
Get
Return CType(ViewState("CveUMSerieLote"), Integer)
Return CType(ViewState("CveUMSerie"), Integer)
End Get
Set(value As Integer)
ViewState("CveUMSerieLote") = value
ViewState("CveUMSerie") = value
End Set
End Property
Private Property CveConsecSerieLote As Integer
Private Property CveConsecSerie As Integer
Get
Return CType(ViewState("CveConsecSerieLote"), Integer)
Return CType(ViewState("CveConsecSerie"), Integer)
End Get
Set(value As Integer)
ViewState("CveConsecSerieLote") = value
ViewState("CveConsecSerie") = value
End Set
End Property
Private Property LimitaCantidadSerieLote As Integer
Private Property LimitaCantidadSerie As Integer
Get
Return CType(ViewState("LimitaCantidadSerieLote"), Integer)
Return CType(ViewState("LimitaCantidadSerie"), Integer)
End Get
Set(value As Integer)
ViewState("LimitaCantidadSerieLote") = value
ViewState("LimitaCantidadSerie") = value
End Set
End Property
@@ -2591,7 +2591,7 @@ Partial Class Ventas
TrPedido.Visible = False
' TrKilometrajeTxt.Visible = True
End If
LtlTareaNueva.Text = String.Format("<a class=""caption-subject bold font-green"" onclick=""OpenModalNewTareaUserControl(1,-1,{{CveVenta:{0}}});""> <i class=""fa fa-plus""'></i> Tarea</a>", CveVenta)
LtlTareaNueva.Text = String.Format("<a class=""caption-subject bold font-green"" onclick=""OpenModalNewTareaUserControl(1,-1,{{CveVenta:{0}}});""> <i class=""fa fa-plus""'></i> Tarea</a>", CveVenta)
End If
@@ -3379,17 +3379,17 @@ Partial Class Ventas
'Si es contrato flexible le damos una cantidad alta de lo contrario lo maximo es lo estipulado en el contrato
If e.Row.DataKey("LimitarCantidad").ToString() = "True" Or DdlTipoComprobante.SelectedValue.Contiene("Egs", "Dev") Or e.Row.DataKey("ModalidadDetalle").ToString() = "1" Then
e.Row.FCRangeValidator("RVCant").MaximumValue = CantidadDisponible
LimitaCantidadSerieLote = 1
LimitaCantidadSerie = 1
Else
e.Row.FCRangeValidator("RVCant").MaximumValue = "10000000"
LimitaCantidadSerieLote = 0
LimitaCantidadSerie = 0
End If
'CONSIGNACION DE VENTA
If CveAlmacenExistenciasContrato > 0 And e.Row.DBCampo("Inv_CveMetodoInventario").ToString().ToEntero() = 5 Then
GvContratoDetalles.Columns(8).Visible = True
e.Row.FCButton("BtnSerieConsignacion").Visible = True
e.Row.FCButton("BtnSerieConsignacion").CommandArgument = $"{e.Row.DBCampo("CveContratoDetalle")}°{e.Row.DBCampo("CvePS")}°{e.Row.DBCampo("CveUM")}°{e.Row.DBCampo("CodigoPS")}°{e.Row.DBCampo("Cantidad")}°{LimitaCantidadSerieLote}"
e.Row.FCButton("BtnSerieConsignacion").CommandArgument = $"{e.Row.DBCampo("CveContratoDetalle")}°{e.Row.DBCampo("CvePS")}°{e.Row.DBCampo("CveUM")}°{e.Row.DBCampo("CodigoPS")}°{e.Row.DBCampo("Cantidad")}°{LimitaCantidadSerie}"
e.Row.FCTextBox("TxtCant").Enabled = False
End If
@@ -7752,6 +7752,19 @@ Partial Class Ventas
'GENERO LOS DATOS DE LA NC
Dim tmpcon As DataTable = TmpDT.Clone
tmpcon.Clear()
Dim DtImpuestos As New DataTable
DtImpuestos.Columns.Add("ImportePU", GetType(Decimal))
DtImpuestos.Columns.Add("ImporteTotal", GetType(Decimal))
DtImpuestos.Columns.Add("PorcentajeIVA", GetType(Decimal))
DtImpuestos.Columns.Add("ImporteIVA", GetType(Decimal))
DtImpuestos.Columns.Add("PorcentajeRetIVA", GetType(Decimal))
DtImpuestos.Columns.Add("ImporteRetIVA", GetType(Decimal))
DtImpuestos.Columns.Add("PorcentajeRetISR", GetType(Decimal))
DtImpuestos.Columns.Add("ImporteRetISR", GetType(Decimal))
DtImpuestos.Columns.Add("PorcentajeIEPS", GetType(Decimal))
DtImpuestos.Columns.Add("ImporteIEPS", GetType(Decimal))
DtImpuestos.Columns.Add("CveSubProyecto", GetType(Integer))
DtImpuestos.AcceptChanges()
Dim drpss As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlNCPSAnt.SelectedValue.ToEntero()).FiltroPrimero("")
@@ -7760,51 +7773,71 @@ Partial Class Ventas
Dim CveVentaP As Integer = 0
For Each gvrt As GridViewRow In GVAnticipos.Rows
If gvrt.FCCheckBox(String.Format("Chk{0}", gvrt.RowIndex)).Checked Then
Dim CveSub As Integer = TmpDT.FiltroPrimeroValor("CveSubProyecto").ToEntero()
Dim dr As DataRow = tmpcon.NewRow
Dim Cantidad As Decimal = 1
Dim PU As Decimal = gvrt.FCTextBox(String.Format("TxtAnticipo{0}", gvrt.RowIndex)).Text.ToDecimal
Dim TotalCalculableImpuestos As Decimal = (Cantidad * (PU))
dr("CvePS") = drpss("CvePS")
dr("PS") = drpss("PS")
dr("OBS") = drpss("PS")
dr("PU") = PU
dr("Cantidad") = Cantidad
dr("CveUM") = drpss("CveUnidadMedida")
dr("SATClaveProdServ") = "84111506"
dr("SATClaveUM") = "ACT"
dr("Consec") = ii
If drpss("IVA").ToString() = "-1" Then
dr("PorcentajeIVA") = PorcentajeIVA ' GlobalDTSubProyectos(-1,cves DrPS("IVA")
Else
dr("PorcentajeIVA") = drpss("IVA")
End If
Dim tTipoAmortizacion As Integer = If(DdlTipoAmortizacionAnticipo.SelectedValue = "2", 1, 2)
dr("IVA") = dr("PorcentajeIVA")
dr("ImporteIVA") = Math.Round(dr("PorcentajeIVA").ToString().ToDecimal * TotalCalculableImpuestos, NumeroDecimales)
dr("ImporteRetIVA") = Math.Round(ClienteRetIVA * TotalCalculableImpuestos, NumeroDecimales)
dr("ImporteRetISR") = Math.Round(ClienteRetISR * TotalCalculableImpuestos, NumeroDecimales)
dr("PorcentajeRetIVA") = ClienteRetIVA
dr("PorcentajeRetISR") = ClienteRetISR
If UsuarioActual.Empresa.Funcionalidad(343) = "1" Then
dr("PorcentajeIEPS") = drpss("IEPSPorcentaje")
dr("ImporteIEPS") = Math.Round(drpss("IEPSPorcentaje").ToString().ToDecimal * TotalCalculableImpuestos, NumeroDecimales)
Else
dr("PorcentajeIEPS") = 0 ' DrPS("IEPSPorcentaje")
dr("ImporteIEPS") = 0 'Math.Round(DrPS("IEPSPorcentaje").ToString().ToDecimal * TotalCalculableImpuestos, NumeroDecimales)
End If
dr("IEPS") = dr("ImporteIEPS")
dr("Descuento") = Math.Round(0, NumeroDecimales)
dr("TipoDescuento") = HdnTipoDescuento.Value
dr("Total") = (Cantidad * PU)
dr("CveClasificacion") = drpss("CveClasificacion")
dr("CveSubProyecto") = CveSub
dr("TotalImporte") = Math.Round(Cantidad * PU, NumeroDecimales)
CveVentaP = gvrt.DataKey("CveVenta").ToEntero()
tmpcon.Rows.Add(dr)
ii += 1
DtImpuestos = CargaDtImpuestosNC(gvrt.DataKey("CveVenta").ToString().ToEntero(), gvrt.FCTextBox(String.Format("TxtAnticipo{0}", gvrt.RowIndex)).Text.ToDecimal, AplicaImpuestosLocales:=True, NCDescuento:=False, NivelTotal:=tTipoAmortizacion)
Dim query = From ddr In DtImpuestos
Group By PorcentajeIVA = ddr("PorcentajeIVA").ToString().ToDecimal,
PorcentajeRetIVA = ddr("PorcentajeRetIVA").ToString().ToDecimal,
PorcentajeRetISR = ddr("PorcentajeRetISR").ToString().ToDecimal,
PorcentajeIEPS = ddr("PorcentajeIEPS").ToString().ToDecimal
Into x = Group
Select ImportePU = x.Sum(Function(s) s("ImportePU").ToString().ToDecimal),
ImporteTotal = x.Sum(Function(s) s("ImporteTotal").ToString().ToDecimal),
ImporteIVA = x.Sum(Function(s) (s("ImporteIVA").ToString().ToDecimal)).RoundSQL(2), ' Math.Round(s("ImporteIVA").ToString().ToDecimal, 2)) * (1 + PorcentajeIEPS) * PorcentajeIVA,
ImporteRetIVA = x.Sum(Function(s) Math.Round(s("ImporteRetIVA").ToString().ToDecimal, 2)),' Math.Round(s("ImportePU").ToString().ToDecimal, 2)) * PorcentajeRetIVA,
ImporteRetISR = x.Sum(Function(s) Math.Round(s("ImporteRetISR").ToString().ToDecimal, 2)),' Math.Round(s("ImportePU").ToString().ToDecimal, 2)) * PorcentajeRetISR,
ImporteIEPS = x.Sum(Function(s) Math.Round(s("ImporteIEPS").ToString().ToDecimal, 2)), 'Math.Round(s("ImportePU").ToString().ToDecimal, 2)) * PorcentajeIEPS,
PorcentajeIVA = PorcentajeIVA,
PorcentajeRetIVA = PorcentajeRetIVA,
PorcentajeRetISR = PorcentajeRetISR,
PorcentajeIEPS = PorcentajeIEPS
DtImpuestos = query.QueryToDataTable(False)
For Each Drr As DataRow In DtImpuestos.Rows
dr("CvePS") = drpss("CvePS")
dr("PS") = drpss("PS")
dr("OBS") = drpss("PS")
dr("PU") = Drr("ImportePU").ToString().ToDecimal
dr("Cantidad") = Cantidad
dr("CveUM") = drpss("CveUnidadMedida")
dr("SATClaveProdServ") = "84111506"
dr("SATClaveUM") = "ACT"
dr("Consec") = ii
dr("PorcentajeIVA") = dr("PorcentajeIVA").ToString().ToDecimal
dr("IVA") = Drr("PorcentajeIVA")
dr("ImporteIVA") = Drr("ImporteIVA").ToString().ToDecimal
dr("ImporteRetIVA") = Drr("ImporteRetIVA").ToString().ToDecimal
dr("ImporteRetISR") = Drr("ImporteRetISR").ToString().ToDecimal
dr("PorcentajeRetIVA") = Drr("PorcentajeRetIVA").ToString().ToDecimal
dr("PorcentajeRetISR") = Drr("PorcentajeRetISR").ToString().ToDecimal
dr("PorcentajeIEPS") = Drr("PorcentajeIEPS").ToString().ToDecimal
dr("ImporteIEPS") = Drr("ImporteIEPS").ToString().ToDecimal
dr("IEPS") = Drr("ImporteIEPS").ToString().ToDecimal
dr("Descuento") = Math.Round(0, NumeroDecimales)
dr("TipoDescuento") = HdnTipoDescuento.Value
dr("Total") = Drr("ImporteTotal").ToString().ToDecimal
dr("CveClasificacion") = drpss("CveClasificacion")
dr("CveSubProyecto") = CveSub
dr("TotalImporte") = Drr("ImporteTotal").ToString().ToDecimal
CveVentaP = gvrt.DataKey("CveVenta").ToEntero()
tmpcon.Rows.Add(dr)
ii += 1
Next
End If
Next
@@ -10096,71 +10129,81 @@ Partial Class Ventas
If row2.FCCheckBox("Chk" & row2.RowIndex).Checked Then
CveIEAnticipo = row2.DataKey("CveIE").ToString().ToEntero()
importeMovimiento = row2.FCTextBox("TxtAnticipo" & row2.RowIndex).Text.ToDecimal '- ((row2.FCTextBox("TxtAnticipo" & row2.RowIndex).Text.ToDecimal / row2.DataKey("TotalAnticipo").ToDecimal) * row2.DataKey("IVAAnticipo").ToDecimal)
Dim ImporteAnticipo As Decimal = importeMovimiento
If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}"
If DdlTipoAmortizacionAnticipo.SelectedValue = "2" Then ImporteAnticipo = row2.FCTextBox("TxtAnticipo" & row2.RowIndex).Text.ToDecimal / row2.DataKey("TotalAnticipo").ToDecimal * row2.DataKey("SubTotalAnticipo").ToDecimal
IdCtaContable = IdCtaContAnticipos
CveCuenta = CveCuentaAnticipos
CveSubProyectoContabilizar = CveSubProyectoVenta
If importeMovimiento <> 0 Then
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, False, importeMovimiento, Referencia, 11, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=row2.DataKey("CveVenta").ToEntero(), CveVentaAmortizacion:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=importeMovimiento * tipoCambio, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=SeContabiliza) Then
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, False, ImporteAnticipo, Referencia, 11, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=row2.DataKey("CveVenta").ToEntero(), CveVentaAmortizacion:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=ImporteAnticipo * tipoCambio, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=SeContabiliza) Then
ErrorPrepoliza = True
Exit For
Else
ViewState("SeGuardoPrePoliza") = True
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, importeMovimiento, Referencia, 2, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=Dr("CveVenta").ToString().ToEntero(), CveCliente:=ObjFactura.CveCliente, ImporteMX:=importeMovimiento, ImporteME:=If(Dr("TCCambioValuacion").ToString().ToDecimal = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, CveIE:=CveIEAnticipo, CveVentaAmortizacion:=ObjFactura.CveVenta, TipoCambio:=Dr("TCCambioValuacion").ToString().ToDecimal, TipoCambioPago:=tipoCambio) Then
ErrorPrepoliza = True
Exit For
End If
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, importeMovimiento, Referencia, 2, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=Dr("CveVenta").ToString().ToEntero(), CveCliente:=ObjFactura.CveCliente, ImporteMX:=importeMovimiento, ImporteME:=If(Dr("TCCambioValuacion").ToString().ToDecimal = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, CveIE:=CveIEAnticipo, CveVentaAmortizacion:=ObjFactura.CveVenta, TipoCambio:=Dr("TCCambioValuacion").ToString().ToDecimal, TipoCambioPago:=tipoCambio) Then
ErrorPrepoliza = True
Exit For
End If
'se hace acreditamiento de impuestos
'IVA X TRASLADAR
Dim PorcentajeImpuestoPago As Decimal = TmpDT.MAX("PorcentajeIVA").ToDecimal
'' si se esta aplicando NC por amortizaion, se trasladan impuestos
If EsNCAmortizacion Then
Dim IngresoIVA As Decimal = TxtIVA.Text.ToDecimal
Dim IngresoIEPS As Decimal = TxtIEPS.Text.ToDecimal
Dim IngresoTotal As Decimal = TxtTotal.Text.ToDecimal
Dim EsAnticipoEspecial As Boolean = False
If IngresoIVA > 0 Then
If UsuarioActual.CveEmpresa.Contiene(1, 119) Then EsAnticipoEspecial = True
If EsAnticipoEspecial Then
Dim PorcentajeImpuestoPago As Decimal = TmpDT.MAX("PorcentajeIVA").ToDecimal
'' si se esta aplicando NC por amortizaion, se trasladan impuestos
If EsNCAmortizacion Then
Dim IngresoIVA As Decimal = TxtIVA.Text.ToDecimal
Dim IngresoIEPS As Decimal = TxtIEPS.Text.ToDecimal
Dim IngresoTotal As Decimal = TxtTotal.Text.ToDecimal
IdCtaIVAXTrasladar = If(IdCtaIVAXTrasladar > 0, IdCtaIVAXTrasladar, UsuarioActual.Empresa.IdCuentaIVAxTrasladar)
Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 13, NombreCliente, $"{ObjFactura.Serie}-{ObjFactura.Folio}", FolioIE.ToString())
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, (importeMovimiento * IngresoIVA) / IngresoTotal, Referencia, 13, Concepto, Fecha, IdCtaIVAXTrasladar, -1, CveVenta:=Dr("CveVenta").ToString().ToEntero(), CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=((importeMovimiento * IngresoIVA) / IngresoTotal) * tipoCambio * Multiplicador, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, PorcentajeImpuesto:=PorcentajeImpuestoPago) Then
ErrorPrepoliza = True
Exit For
End If
'IVA PAGADO
IdCtaIVATrasladado = If(IdCtaIVATrasladado > 0, IdCtaIVATrasladado, UsuarioActual.Empresa.IdCuentaIVATrasladado)
Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 61, NombreCliente, $"{ObjFactura.Serie}-{ObjFactura.Folio}", FolioIE.ToString())
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, Not TipoMovimiento, (importeMovimiento * IngresoIVA) / IngresoTotal, Referencia, 61, Concepto, Fecha, IdCtaIVATrasladado, -1, CveVenta:=Dr("CveVenta").ToString().ToEntero(), CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=((importeMovimiento * IngresoIVA) / IngresoTotal) * tipoCambio * Multiplicador, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, PorcentajeImpuesto:=PorcentajeImpuestoPago) Then
ErrorPrepoliza = True
Exit For
End If
End If
If IngresoIVA > 0 Then
If IngresoIEPS > 0 Then
'IEPS X TRASLADAR
Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 38, NombreCliente, $"{ObjFactura.Serie}-{ObjFactura.Folio}", FolioIE.ToString())
If IngresoIEPS > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, (importeMovimiento * IngresoIEPS) / IngresoTotal, Referencia, 38, Concepto, Fecha, UsuarioActual.Empresa.IdCuentaIEPSxTrasladar, -1, CveVenta:=Dr("CveVenta").ToString().ToEntero(), CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=((importeMovimiento * IngresoIEPS) / IngresoTotal) * tipoCambio * Multiplicador, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar) Then
ErrorPrepoliza = True
Exit For
IdCtaIVAXTrasladar = If(IdCtaIVAXTrasladar > 0, IdCtaIVAXTrasladar, UsuarioActual.Empresa.IdCuentaIVAxTrasladar)
Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 13, NombreCliente, $"{ObjFactura.Serie}-{ObjFactura.Folio}", FolioIE.ToString())
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, (importeMovimiento * IngresoIVA) / IngresoTotal, Referencia, 13, Concepto, Fecha, IdCtaIVAXTrasladar, -1, CveVenta:=Dr("CveVenta").ToString().ToEntero(), CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=((importeMovimiento * IngresoIVA) / IngresoTotal) * tipoCambio * Multiplicador, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, PorcentajeImpuesto:=PorcentajeImpuestoPago) Then
ErrorPrepoliza = True
Exit For
End If
'IVA PAGADO
IdCtaIVATrasladado = If(IdCtaIVATrasladado > 0, IdCtaIVATrasladado, UsuarioActual.Empresa.IdCuentaIVATrasladado)
Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 61, NombreCliente, $"{ObjFactura.Serie}-{ObjFactura.Folio}", FolioIE.ToString())
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, Not TipoMovimiento, (importeMovimiento * IngresoIVA) / IngresoTotal, Referencia, 61, Concepto, Fecha, IdCtaIVATrasladado, -1, CveVenta:=Dr("CveVenta").ToString().ToEntero(), CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=((importeMovimiento * IngresoIVA) / IngresoTotal) * tipoCambio * Multiplicador, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, PorcentajeImpuesto:=PorcentajeImpuestoPago) Then
ErrorPrepoliza = True
Exit For
End If
End If
'IEPS PAGADO
Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 39, NombreCliente, $"{ObjFactura.Serie}-{ObjFactura.Folio}", FolioIE.ToString())
If IngresoIEPS > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, Not TipoMovimiento, (importeMovimiento * IngresoIEPS) / IngresoTotal, Referencia, 39, Concepto, Fecha, UsuarioActual.Empresa.IdCuentaIEPSTrasladado, -1, CveVenta:=Dr("CveVenta").ToString().ToEntero(), CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=((importeMovimiento * IngresoIEPS) / IngresoTotal) * tipoCambio * Multiplicador, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar) Then
ErrorPrepoliza = True
Exit For
If IngresoIEPS > 0 Then
'IEPS X TRASLADAR
Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 38, NombreCliente, $"{ObjFactura.Serie}-{ObjFactura.Folio}", FolioIE.ToString())
If IngresoIEPS > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, (importeMovimiento * IngresoIEPS) / IngresoTotal, Referencia, 38, Concepto, Fecha, UsuarioActual.Empresa.IdCuentaIEPSxTrasladar, -1, CveVenta:=Dr("CveVenta").ToString().ToEntero(), CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=((importeMovimiento * IngresoIEPS) / IngresoTotal) * tipoCambio * Multiplicador, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar) Then
ErrorPrepoliza = True
Exit For
End If
'IEPS PAGADO
Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 39, NombreCliente, $"{ObjFactura.Serie}-{ObjFactura.Folio}", FolioIE.ToString())
If IngresoIEPS > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, Not TipoMovimiento, (importeMovimiento * IngresoIEPS) / IngresoTotal, Referencia, 39, Concepto, Fecha, UsuarioActual.Empresa.IdCuentaIEPSTrasladado, -1, CveVenta:=Dr("CveVenta").ToString().ToEntero(), CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=((importeMovimiento * IngresoIEPS) / IngresoTotal) * tipoCambio * Multiplicador, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar) Then
ErrorPrepoliza = True
Exit For
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
Next
End If
@@ -11200,7 +11243,7 @@ Partial Class Ventas
CveUnidad = Dr("CveUM").ToString().ToEntero()
Cantidad = Dr("Cantidad").ToString().ToDouble
If Dr("CveTipoInvPS").ToString().ToEntero() = 5 And Dr("SerieLote").ToString() = "" Then
If Dr("CveTipoInvPS").ToString().ToEntero() = 5 And Dr("Serie").ToString() = "" Then
OcurrioError = True
ErrorList.Add("Se deben especificar las Series de los productos de almacén")
Exit For
@@ -11240,7 +11283,7 @@ Partial Class Ventas
End If
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, Cantidad, CveUnidad, CveProducto, PU, -1, SerieLote:=Dr("SerieLote").ToString(), CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero()) Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, Cantidad, CveUnidad, CveProducto, PU, -1, Serie:=Dr("Serie").ToString(), CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero()) Then
OcurrioError = True
ErrorList.Add("Ocurrió un error al agregar los Movimientos de salida al Inventario.<br />")
Exit For
@@ -11996,7 +12039,12 @@ Partial Class Ventas
saldo = e.Row.DataKey("Saldo").ToString().ToDecimal
If CveVenta <= 0 Then
saldo = e.Row.DataKey("SaldoSubTotal").ToString().ToDecimal
If DdlTipoAmortizacionAnticipo.SelectedValue = "2" Then 'cuando es por NC, debe de tomar el total de su saldo respectivo
saldo = e.Row.DataKey("SaldoConImpuestos").ToString().ToDecimal
Else
saldo = e.Row.DataKey("SaldoSubTotal").ToString().ToDecimal
End If
e.Row.FCLiteral("LtlAnticipos").Text = saldo.FormatoNumero
End If
@@ -13240,7 +13288,7 @@ Partial Class Ventas
Protected Function CancelarMovimientoInventario(ByRef ObjInventario As ClsInventarios, ByRef ObjConta As ClsContabilidad, CveVentaNueva As Integer, CveVentaVieja As Integer) As Boolean
'SI YA ESTA QUEMADA DE ALMACEN LA VENTA, NO SE CANCELAN LOS MOVIMIENTOS DE INVENTARIO
If ObjInventario.GetEstatusVentaPorSurir(CveVentaVieja) Then
If ObjInventario.GetEstatusVentaPorSurtir(CveVentaVieja) Then
If ObjInventario.EsDevolucionVenta = 2 Then
Return True
End If
@@ -13279,12 +13327,15 @@ Partial Class Ventas
Dim CveUnidad As Integer = MovDet("CveUM").ToString().ToEntero()
Dim PU As Decimal = MovDet("PU").ToString().ToDecimal
Dim CveProducto As Integer = MovDet("CvePS").ToString().ToEntero()
Dim SerieLote As String = MovDet("SerieLote").ToString()
Dim Serie As String = MovDet("Serie").ToString()
Dim Lote As String = MovDet("Lote").ToString()
Dim FechaCaducidad As Date = MovDet("FechaCaducidad").ToString().ToDate
Dim CveVentaDetalle = MovDet("CveVentaDetalle").ToString().ToEntero()
'Entrada
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInventarioEntrada, Cantidad, CveUnidad, CveProducto, PU, -1, SerieLote:=SerieLote, CveVentaDetalle:=CveVentaDetalle) Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInventarioEntrada, Cantidad, CveUnidad, CveProducto, PU, -1, Serie:=Serie, Lote:=Lote, FechaCaducidad:=FechaCaducidad, CveVentaDetalle:=CveVentaDetalle) Then
OcurrioError = True
Exit For
End If
@@ -13292,7 +13343,7 @@ Partial Class Ventas
'Salida
CveVentaDetalle = ObjInventario.VentaDetallePadreGet(CveVentaDetalle).ToString().ToEntero()
If CveVentaDetalle > 0 Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInventarioSalida, Cantidad, CveUnidad, CveProducto, PU, -1, SerieLote:=SerieLote, CveVentaDetalle:=CveVentaDetalle) Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInventarioSalida, Cantidad, CveUnidad, CveProducto, PU, -1, Serie:=Serie, Lote:=Lote, FechaCaducidad:=FechaCaducidad, CveVentaDetalle:=CveVentaDetalle) Then
OcurrioError = True
Exit For
End If
@@ -14576,7 +14627,7 @@ Partial Class Ventas
AgregarProductoServicio(Cantidad, DdlUnidadMedida.SelectedValue.ToEntero(), DdlUnidadMedida.SelectedItem.Text, DdlClasificacion.SelectedValue.ToEntero(), DdlClasificacion.SelectedItem.Text,
CvePS, "", TxtObsPS.Text.Trim, PU, ObjDescuento.ImporteDescuento,
DdlProyecto.SelectedValue.ToEntero(), DdlProyecto.SelectedItem.Text, DdlSubProyecto.SelectedValue.ToEntero(), DdlSubProyecto.SelectedItem.Text,
SerieLote:=If(DIVCod.Visible, TxtCodigoSerie.Text.Trim, ""), TiempoEntrega:=TxtTiempoEntrega.Text, CuentaPredial:=TxtCuentaPredial.Text.Trim, RegeneraIEPS:=ClienteDesglosaIEPS, CvePromocionDetalle:=ObjDescuento.CvePromocionDetalle)
Serie:=If(DIVCod.Visible, TxtCodigoSerie.Text.Trim, ""), TiempoEntrega:=TxtTiempoEntrega.Text, CuentaPredial:=TxtCuentaPredial.Text.Trim, RegeneraIEPS:=ClienteDesglosaIEPS, CvePromocionDetalle:=ObjDescuento.CvePromocionDetalle)
CalculaUsados()
@@ -14706,7 +14757,7 @@ Partial Class Ventas
Private Function AgregarProductoServicio(Cantidad As Decimal, CveUM As Integer, UM As String, CveClasificacion As Integer, Clasificacion As String, CvePS As Integer, PS As String, Obs As String,
PU As Decimal, Descuento As Decimal,
CveProyecto As Integer, Proyecto As String, CveSubProyecto As Integer, SubProyecto As String,
Optional SerieLote As String = "", Optional TiempoEntrega As String = "", Optional EntregaDirecta As Integer = 0,
Optional Serie As String = "", Optional TiempoEntrega As String = "", Optional EntregaDirecta As Integer = 0,
Optional CveContratoDetalle As Integer = 0, Optional CveVentaDetalle As Integer = 0, Optional CveMovimientoDetallePedido As Integer = 0,
Optional CveOrdenCompraDetalle As Integer = 0, Optional CveVentaDetalleRemision As Integer = 0, Optional CveVentaDetalleCotizacion As Integer = 0,
Optional CuentaPredial As String = "", Optional RegeneraIEPS As Boolean = True, Optional CveVentaDetallePedido2 As Integer = 0,
@@ -14745,7 +14796,7 @@ Partial Class Ventas
Row("Proyecto") = Proyecto
Row("CveSubProyecto") = CveSubProyecto
Row("SubProyecto") = SubProyecto
Row("SerieLote") = SerieLote
Row("Serie") = Serie
Row("TiempoEntrega") = TiempoEntrega
Row("Orden") = TmpDT.Rows.Count + 1
Row("Cantidad") = Cantidad
@@ -15021,7 +15072,7 @@ Partial Class Ventas
TmpDT.Columns.Add("NoIdentificacion", GetType(String))
TmpDT.Columns.Add("CveTipoPS", GetType(Integer))
TmpDT.Columns.Add("CveTipoInvPS", GetType(Integer))
TmpDT.Columns.Add("SerieLote", GetType(String))
TmpDT.Columns.Add("Serie", GetType(String))
TmpDT.Columns.Add("CuentaPredial", GetType(String))
TmpDT.Columns.Add("Obs", GetType(String))
TmpDT.Columns.Add("TiempoEntrega", GetType(String))
@@ -16136,7 +16187,7 @@ Partial Class Ventas
'Si no se ha terminado de surtir agregamos el movimiento
If Indice >= 0 Then
' rowSurtidos("Surtido").ToString().ToDouble < rowSurtidos("Cantidad").ToString().ToDouble AndAlso (dr("CantidadDisponible").ToString().ToDouble - rowSurtidos("Surtido").ToString().ToDouble > 0 Or dr("SerieLote").ToString() <> "")
' rowSurtidos("Surtido").ToString().ToDouble < rowSurtidos("Cantidad").ToString().ToDouble AndAlso (dr("CantidadDisponible").ToString().ToDouble - rowSurtidos("Surtido").ToString().ToDouble > 0 Or dr("Serie").ToString() <> "")
If rowSurtidos("Surtido").ToString().ToDecimal < rowSurtidos("Cantidad").ToString().ToDecimal Then
Dim CantidadSurtida As Double = If(dr("CantidadDisponible").ToString().ToDecimal < rowSurtidos("Cantidad").ToString().ToDouble, dr("CantidadDisponible").ToString().ToDecimal, rowSurtidos("Cantidad").ToString().ToDecimal)
MovDTCuadrados.ImportRow(dr)
@@ -16219,7 +16270,10 @@ Partial Class Ventas
Dim CveUnidad As Integer = MovDet("CveUM").ToString().ToEntero()
Dim PU As Decimal = MovDet("PU").ToString().ToDecimal
Dim CveProducto As Integer = MovDet("CvePS").ToString().ToEntero()
Dim SerieLote As String = MovDet("SerieLote").ToString()
Dim Serie As String = MovDet("Serie").ToString()
Dim Lote As String = MovDet("Lote").ToString()
Dim FechaCaducidad As Date = MovDet("FechaCaducidad").ToString.ToDate
Dim CveSeccionAlmacen As Integer = MovDet("CveSeccionAlmacen").ToString.ToEntero
Dim Consec As Integer = DtRemisionesTmpDT.FiltroPrimeroValor("Consec", $"CveVentaDetalle = {MovDet("CveVentaDetalle").ToString()}").ToEntero()
'COMIENZA: VENTADETALLE
@@ -16245,7 +16299,7 @@ Partial Class Ventas
CveMovimientoDetalleEntrada = MovDet("CveMovimientoDetalle").ToString().ToEntero()
End If
If ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, Cantidad, CveUnidad, CveProducto, PU, -1, SerieLote:=SerieLote, CveVentaDetalle:=CveVentaDetalle, CveMovimientoDetalleEntrada:=CveMovimientoDetalleEntrada) Then
If ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, Cantidad, CveUnidad, CveProducto, PU, -1, CveSeccionAlmacen:=CVeSeccionAlmacen, Serie:=Serie, Lote:=Lote, FechaCaducidad:=FechaCaducidad, CveVentaDetalle:=CveVentaDetalle, CveMovimientoDetalleEntrada:=CveMovimientoDetalleEntrada) Then
ContadorMovtosDetalles += 1
Else
OcurrioError = True
@@ -17208,7 +17262,7 @@ Partial Class Ventas
For Each Row As DataRow In TmpDT.Rows
Dim CveVentaDetalle As Integer = Row("CveVentaDetalle").ToString().ToEntero()
If CveVentaDetalle > 0 Then
If Not ObjVentas.UpdateVentaDetalleRemision(Row("CveVentaDetalle").ToString().ToEntero(), Row("CvePS").ToString().ToEntero(), Row("Cantidad").ToString().ToDecimal, Row("PU").ToString().ToDecimal(), Row("ImporteIEPS").ToString().ToDecimal(), Row("Obs").ToString(), UsuarioActual.CveUsuario) Then
If Not ObjVentas.UpdateVentaDetalleRemision(Row("CveVentaDetalle").ToString().ToEntero(), Row("CvePS").ToString().ToEntero(), Row("Cantidad").ToString().ToDecimal, Row("PU").ToString().ToDecimal(), Row("ImporteIEPS").ToString().ToDecimal(), Row("PorcentajeIEPS").ToString().ToDecimal(), Row("Obs").ToString(), UsuarioActual.CveUsuario) Then
OcurrioError = True
Exit For
End If
@@ -17360,7 +17414,7 @@ Partial Class Ventas
Dim DrProducto As DataRow = Nothing
If TxtCantidad.Text.Trim.ToDouble <= 0 Then TxtCantidad.Text = "1"
Dim SerieLote As String = ""
Dim SerieL As String = ""
Dim CodigoBarras As String = ""
Dim CvePS As Integer
@@ -17369,10 +17423,10 @@ Partial Class Ventas
'BUSCA POR SERIE E IGNORA CODIGO DE BARRAS (LIMPIA)
If TxtCodigoSerie.Text.Trim <> "" Then
SerieLote = TxtCodigoSerie.Text.Trim().ToUpper()
Dim Serie As String = TxtCodigoSerie.Text.Trim().ToUpper()
Dim Objinventarios As New ClsInventarios
Dim Existencia = Objinventarios.GetExistenciasPS(-1, -1, UsuarioActual.CveEmpresa, -1, SerieLote:=SerieLote, ExcluyeAdelantado:=1, PendientePorSurtir:=1, RestringirAlmacenes:=1, ExcluyeApartados:=-1, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero())
Dim ExistenciaActual = DtInv.SUM("Cantidad", String.Format("SerieLote = '{0}'", SerieLote))
Dim Existencia = Objinventarios.GetExistenciasPS(-1, -1, UsuarioActual.CveEmpresa, -1, Serie:=Serie, ExcluyeAdelantado:=1, PendientePorSurtir:=1, RestringirAlmacenes:=1, ExcluyeApartados:=-1, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero())
Dim ExistenciaActual = DtInv.SUM("Cantidad", String.Format("Serie = '{0}'", Serie))
CvePS = Objinventarios.CvePS
Objinventarios.Dispose()
@@ -17383,11 +17437,11 @@ Partial Class Ventas
HdnCvePS.Value = CvePS.ToString()
TxtCantidad.Text = "1"
Else
Alert($"No se encontró un producto con la serie: <b>{SerieLote}</b>. Por favor verifique y vuelva a intentar ", TipoMensaje.MsgAdvertencia)
Alert($"No se encontró un producto con la serie: <b>{Serie}</b>. Por favor verifique y vuelva a intentar ", TipoMensaje.MsgAdvertencia)
End If
End If
Else
Alert(String.Format("No hay existencia suficiente del producto con la Serie: <b>{0}</b>. Por favor rectifique y vuelva a intentar", SerieLote), TipoMensaje.MsgAdvertencia)
Alert(String.Format("No hay existencia suficiente del producto con la Serie: <b>{0}</b>. Por favor rectifique y vuelva a intentar", Serie), TipoMensaje.MsgAdvertencia)
TxtCodigoSerie.Focus()
RegistraScript($"$('#{TxtCodigoSerie.ClientID}').select();")
Exit Sub
@@ -17400,7 +17454,7 @@ Partial Class Ventas
CodigoBarras = TxtCodigoBarras.Text.Trim()
DrProducto = GlobalDTPS(UsuarioActual.CveEmpresa).FiltroPrimero($"CodigoBarras = '{CodigoBarras}'")
If DrProducto IsNot Nothing Then
If DrProducto("Inv_CveMetodoInventario").ToString() = "5" Then 'si es serielote
If DrProducto("Inv_CveMetodoInventario").ToString() = "5" Then 'si es serie
TxtCodigoSerie.Focus()
Exit Sub
Else
@@ -17410,7 +17464,7 @@ Partial Class Ventas
Else
TxtCodigoBarras.Focus()
RegistraScript($"$('#{TxtCodigoBarras.ClientID}').select();")
Alert($"No se encontró un producto con el código de barras: <b>{SerieLote}</b>. Por favor verifique y vuelva a intentar ", TipoMensaje.MsgAdvertencia)
Alert($"No se encontró un producto con el código de barras: <b>{Serie}</b>. Por favor verifique y vuelva a intentar ", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
@@ -17479,7 +17533,7 @@ Partial Class Ventas
'AddPS(TxtCantidad.Text.Trim.ToDouble, DrProducto("CveUM").ToString().ToEntero(), DrProducto("UnidadMedida").ToString(), DrProducto("CveClasificacion").ToString().ToEntero(), DrProducto("Clasificacion").ToString(),
' DrProducto("CvePS").ToString().ToEntero(), DrProducto("PS").ToString(), TxtObsPS.Text.Trim, TxtPrecio.Text.Trim.ToDouble, HdnIVAPS.Value.ToDouble, 0, 0,
' -1, -1, True, DrProducto("Codigo").ToString(), DdlProyecto.SelectedValue.ToEntero(),
' DdlProyecto.SelectedItem.Text, DdlSubProyecto.SelectedValue.ToEntero(), DdlSubProyecto.SelectedItem.Text, DrProducto("CveTipoPS").ToString().ToEntero(), DrProducto("Inv_CveMetodoInventario").ToString().ToEntero(), SerieLote:=SerieLote, CodigoPS:=DrProducto("PSCodigo").ToString())
' DdlProyecto.SelectedItem.Text, DdlSubProyecto.SelectedValue.ToEntero(), DdlSubProyecto.SelectedItem.Text, DrProducto("CveTipoPS").ToString().ToEntero(), DrProducto("Inv_CveMetodoInventario").ToString().ToEntero(), Serie:=Serie, CodigoPS:=DrProducto("PSCodigo").ToString())
LimpiaAgregar()
End If
@@ -17991,17 +18045,17 @@ Partial Class Ventas
Dim Index = Row.RowIndex
Dim ObjInventarios As New ClsInventarios
Dim Existencia = ObjInventarios.GetExistenciasPSSerie(Row.FCTextBox("TxtSerie").Text.ToString(), ddlAlmacen.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa)
Dim ExistenciaActual = DtInv.SUM("Cantidad", String.Format("SerieLote = '{0}'", Row.FCTextBox("TxtSerie").Text.ToString()))
Dim ExistenciaActual = DtInv.SUM("Cantidad", String.Format("Serie = '{0}'", Row.FCTextBox("TxtSerie").Text.ToString()))
'Valida Existencia
If Existencia - ExistenciaActual <= 0 Then
Alert(String.Format("No hay existencia suficiente del producto con la Serie: <b>{0}</b>. Por favor rectifique y vuelva a intentar", Row.FCTextBox("TxtSerie").Text.ToString()), TipoMensaje.MsgAdvertencia)
Row.FCTextBox("TxtSerie").Text = ""
Row.FCHiddenField("HdnSerie").Value = ""
TmpDT.Rows(Index)("SerieLote") = ""
TmpDT.Rows(Index)("Serie") = ""
Else
Row.FCHiddenField("HdnSerie").Value = Row.FCTextBox("TxtSerie").Text
TmpDT.Rows(Index)("SerieLote") = Row.FCTextBox("TxtSerie").Text
TmpDT.Rows(Index)("Serie") = Row.FCTextBox("TxtSerie").Text
End If
TmpDT.AcceptChanges()
@@ -18027,8 +18081,8 @@ Partial Class Ventas
'SIN EXISTENCIA
If Gvr.FCTextBox("TxtSerie").Visible = True And Gvr.FCTextBox("TxtSerie").Text.Trim <> "" Then
Existencia = ObjInventarios.GetExistenciasPS(-1, -1, UsuarioActual.CveEmpresa, ddlAlmacen.SelectedValue.ToEntero(), SerieLote:=Gvr.FCTextBox("TxtSerie").Text.ToString(), ExcluyeAdelantado:=1, PendientePorSurtir:=1, RestringirAlmacenes:=1, ExcluyeApartados:=1)
ExistenciaActual = DtInv.SUM("Cantidad", String.Format("SerieLote = '{0}'", Gvr.FCTextBox("TxtSerie").Text.Trim))
Existencia = ObjInventarios.GetExistenciasPS(-1, -1, UsuarioActual.CveEmpresa, ddlAlmacen.SelectedValue.ToEntero(), Serie:=Gvr.FCTextBox("TxtSerie").Text.ToString(), ExcluyeAdelantado:=1, PendientePorSurtir:=1, RestringirAlmacenes:=1, ExcluyeApartados:=1)
ExistenciaActual = DtInv.SUM("Cantidad", String.Format("Serie = '{0}'", Gvr.FCTextBox("TxtSerie").Text.Trim))
'Valida Existencia
If Existencia - ExistenciaActual < 0 Then
@@ -18226,13 +18280,13 @@ Partial Class Ventas
DtTemporal.Columns.Add("Lote", Type.GetType("System.String"))
End If
If Not DtTemporal.Columns.Contains("Batch") Then
DtTemporal.Columns.Add("Batch", Type.GetType("System.String"))
If Not DtTemporal.Columns.Contains("FechaCaducidad") Then
DtTemporal.Columns.Add("FechaCaducidad", Type.GetType("System.DateTime"))
End If
GvInv.Columns(4).Visible = DtTemporal.MAX("SerieLote", "SerieLote <> ''") <> "" Or CveVenta <= 0
GvInv.Columns(4).Visible = DtTemporal.MAX("Serie", "Serie <> ''") <> "" Or CveVenta <= 0
GvInv.Columns(5).Visible = DtTemporal.MAX("Lote", "Lote <> ''") <> ""
GvInv.Columns(6).Visible = DtTemporal.MAX("Lote", "Lote <> ''") <> ""
GvInv.Columns(6).Visible = DtTemporal.MAX("FechaCaducidad").ToDate > MinFecha
GvInv.DataSource = DtTemporal
GvInv.DataBind()
@@ -19922,7 +19976,7 @@ Partial Class Ventas
End If
For Each dr As DataRow In ObjInventarios.DtResultados.FiltraParametros($"ExistenciaPedido > 0 {Filtro}").Rows
AgregarProductoServicio(dr("Cantidad").ToString().ToDecimal, dr("CveUM").ToString().ToEntero(), dr("UnidadMedida").ToString(), dr("CveClasificacion").ToString().ToEntero(), dr("Clasificacion").ToString(),
dr("CvePS").ToString().ToEntero(), dr("PS").ToString(), dr("SerieLote").ToString(), dr("PU").ToString().ToDecimal, 0.0D,
dr("CvePS").ToString().ToEntero(), dr("PS").ToString(), dr("Serie").ToString(), dr("PU").ToString().ToDecimal, 0.0D,
dr("CveProyecto").ToString().ToEntero(), dr("Proyecto").ToString(), dr("CveSubProyecto").ToString().ToEntero(), dr("SubProyecto").ToString(),
CveMovimientoDetallePedido:=dr("CveMovimientoDetalle").ToString().ToEntero())
Next
@@ -20428,12 +20482,12 @@ Partial Class Ventas
If Dr("CveTipoInvPS").ToString().ToEntero() = 5 Then
For Each Dr2 As DataRow In DtContratosSerieDetalle.FiltraParametros($"ConsecId = {Dr("CveContratoDetalle")}").Rows
Existencia = ObjInventario.GetExistenciasPS(CveProducto, CveUnidad, factura.CveEmpresa, CveAlmacenExistenciasContrato, SerieLote:=Dr2("Serie").ToString(), FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), ExcluyeAdelantado:=1, RestringirAlmacenes:=1, ExcluyeApartados:=1)
Existencia = ObjInventario.GetExistenciasPS(CveProducto, CveUnidad, factura.CveEmpresa, CveAlmacenExistenciasContrato, Serie:=Dr2("Serie").ToString(), FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), ExcluyeAdelantado:=1, RestringirAlmacenes:=1, ExcluyeApartados:=1)
If Existencia < 1 Then
Return False
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaConsignacion, 1, CveUnidad, CveProducto, 0, -1, SerieLote:=Dr2("Serie").ToString(), CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero()) Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaConsignacion, 1, CveUnidad, CveProducto, 0, -1, Serie:=Dr2("Serie").ToString(), CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero()) Then
Return False
End If
Next
@@ -20458,7 +20512,7 @@ Partial Class Ventas
If CveMovimientoEntradaGeneral > 0 Then
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalidaConsignacion, UsuarioActual.CveEmpresa) Then
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaGeneral, Dr("Cantidad").ToString().ToDouble, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), Dr("PU").ToString().ToDecimal, Dr("CveAF").ToString().ToEntero(), Dr("CveSeccionAlmacen").ToString().ToEntero(), Dr("SerieLote").ToString(), Lote:=Dr("Lote").ToString(), Batch:=Dr("Batch").ToString(), CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString().ToEntero(), CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero()) Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaGeneral, Dr("Cantidad").ToString().ToDouble, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), Dr("PU").ToString().ToDecimal, CveAF:=Dr("CveAF").ToString().ToEntero(), CveSeccionAlmacen:=Dr("CveSeccionAlmacen").ToString().ToEntero(), Serie:=Dr("Serie").ToString(), Lote:=Dr("Lote").ToString(), CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString().ToEntero(), CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero()) Then
Return False
End If
Next
@@ -20472,7 +20526,7 @@ Partial Class Ventas
If CveMovimientoEntradaGeneral > 0 Then
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalidaConsignacion, UsuarioActual.CveEmpresa) Then
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaGeneral, Dr("Cantidad").ToString().ToDouble, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), Dr("PU").ToString().ToDecimal, Dr("CveAF").ToString().ToEntero(), Dr("CveSeccionAlmacen").ToString().ToEntero(), Dr("SerieLote").ToString(), Lote:=Dr("Lote").ToString(), Batch:=Dr("Batch").ToString(), CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString().ToEntero(), CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero()) Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaGeneral, Dr("Cantidad").ToString().ToDouble, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), Dr("PU").ToString().ToDecimal, CveAF:=Dr("CveAF").ToString().ToEntero(), CveSeccionAlmacen:=Dr("CveSeccionAlmacen").ToString().ToEntero(), Serie:=Dr("Serie").ToString(), Lote:=Dr("Lote").ToString(), CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString().ToEntero(), CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero()) Then
Return False
End If
Next
@@ -20506,12 +20560,12 @@ Partial Class Ventas
Protected Sub BtnSerieConsignacion_Click(sender As Object, e As EventArgs)
Dim Argumentos = CType(sender, Button).CommandArgument.Split("°"c)
CveConsecSerieLote = Argumentos(0).ToEntero()
CvePSSerieLote = Argumentos(1).ToEntero()
CveUMSerieLote = Argumentos(2).ToEntero()
CveConsecSerie = Argumentos(0).ToEntero()
CvePSSerie = Argumentos(1).ToEntero()
CveUMSerie = Argumentos(2).ToEntero()
LbProducto.Text = Argumentos(3)
LbCantidad.Text = If(Argumentos(4).ToDecimal < 0.0D, 0, Argumentos(4).ToDecimal).FormatoNumero
LimitaCantidadSerieLote = Argumentos(5).ToEntero()
LimitaCantidadSerie = Argumentos(5).ToEntero()
CargaSerie()
End Sub
@@ -20520,11 +20574,11 @@ Partial Class Ventas
Private Sub CargaSerie(Optional CerrarCompletado As Boolean = False)
RegistraScript("$('#DivSerieConsignacion').modal();", "ModalLote")
GvSerie.DataSource = DtContratosSerieDetalle.FiltraParametros(String.Format("ConsecId = {0}", CveConsecSerieLote), "Consec DESC")
GvSerie.DataSource = DtContratosSerieDetalle.FiltraParametros(String.Format("ConsecId = {0}", CveConsecSerie), "Consec DESC")
GvSerie.DataBind()
lblSerieTotal.Text = GvSerie.Rows.Count.ToString()
'VALIDA QUE SIGA AGREGANDO
If DtContratosSerieDetalle.FiltraParametros(String.Format("ConsecId = {0}", CveConsecSerieLote)).Rows.Count = LbCantidad.Text.ToEntero() And LimitaCantidadSerieLote = 1 Then
If DtContratosSerieDetalle.FiltraParametros(String.Format("ConsecId = {0}", CveConsecSerie)).Rows.Count = LbCantidad.Text.ToEntero() And LimitaCantidadSerie = 1 Then
BtnAgregarPS.Enabled = False
If CerrarCompletado Then
RegistraScript("$('#DivSerieConsignacion').modal('hide');")
@@ -20534,22 +20588,21 @@ Partial Class Ventas
End If
UpSerieConsignacion.Update()
TxtSerieLote.Text = ""
TxtSerieLote.Focus()
TxtSerie.Text = ""
TxtSerie.Focus()
End Sub
Protected Sub BtnAgregarPS_Click(sender As Object, e As EventArgs)
AgregaSerieLote(TxtSerieLote.Text.Replace(" ", String.Empty))
AgregaSerie(TxtSerie.Text.Replace(" ", String.Empty))
End Sub
Private Sub AgregaSerieLote(SerieLote As String)
'SerieLote = SerieLote.Trim.Replace(" ", " ")
Private Sub AgregaSerie(Serie As String)
If SerieLote.Trim = "" Then
If Serie.Trim = "" Then
Alert("El campo Serie es obligatorio. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim SeriesArreglo = SerieLote.Trim.Split(";"c)
Dim SeriesArreglo = Serie.Trim.Split(";"c)
'VALIDACION DE SERIES DUPLICADAS
Dim MensajeAlert As New StringBuilder
@@ -20558,13 +20611,13 @@ Partial Class Ventas
DtSeriesNuevas.Columns.Add("Serie", GetType(String))
'PARA VALIDAR SI LA SERIE ES IGUAL AL CODIGO O CODIGOBARRAS
' Dim dr As DataRow = GlobalDTProductosServicios(UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CvePS = {0}", CvePSSerieLote), "PS")
Dim dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePSSerieLote).FiltroPrimero("", "PS")
' Dim dr As DataRow = GlobalDTProductosServicios(UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CvePS = {0}", CvePSSerie), "PS")
Dim dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePSSerie).FiltroPrimero("", "PS")
For Each SerieRow In SeriesArreglo
SerieRow = SerieRow.ToUpper
DtDuplicado = DtContratosSerieDetalle.FiltraParametros($"ConsecId = {CveConsecSerieLote} AND Serie = '{SerieRow}'")
DtDuplicado = DtContratosSerieDetalle.FiltraParametros($"ConsecId = {CveConsecSerie} AND Serie = '{SerieRow}'")
If DtDuplicado IsNot Nothing AndAlso DtDuplicado.Rows.Count > 0 Then
MensajeAlert.Append($"<br/> El numero de Serie <b>""{SerieRow}""</b> proporcionado ya se encuentra ingresado.")
Continue For
@@ -20602,29 +20655,29 @@ Partial Class Ventas
Dim Row = DtContratosSerieDetalle.NewRow
Index = Index + 1
If Index > LbCantidad.Text.ToEntero() And LimitaCantidadSerieLote = 1 Then
If Index > LbCantidad.Text.ToEntero() And LimitaCantidadSerie = 1 Then
MensajeSinExistencias.Append($"Serie: <b>{SerieRow} - En esta serie ocurrió un error por favor de comunicarse con soporte tecnico.</b>. <br/>")
Continue For
End If
'VERIFICA EXISTENCIAS
Dim Existencia = ObjInventarios.GetExistenciasPS(CvePSSerieLote, CveUMSerieLote, UsuarioActual.CveEmpresa, CveAlmacenExistenciasContrato, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), SerieLote:=SerieRow)
Dim Existencia = ObjInventarios.GetExistenciasPS(CvePSSerie, CveUMSerie, UsuarioActual.CveEmpresa, CveAlmacenExistenciasContrato, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), Serie:=SerieRow)
If Existencia < 1 Then
MensajeSinExistencias.Append($"Serie: <b>{SerieRow}</b>. <br/>")
Continue For
End If
Row("ConsecId") = CveConsecSerieLote
Row("ConsecId") = CveConsecSerie
Row("Consec") = DtContratosSerieDetalle.Rows.Count + 1
Row("CvePS") = CvePSSerieLote
Row("CveUM") = CveUMSerieLote
Row("CvePS") = CvePSSerie
Row("CveUM") = CveUMSerie
Row("Serie") = SerieRow
DtContratosSerieDetalle.Rows.Add(Row)
Next
ObjInventarios.Dispose()
TxtSerieLote.Text = ""
TxtSerie.Text = ""
CargaCantidadSerieGV()
@@ -20641,9 +20694,9 @@ Partial Class Ventas
Protected Sub GvSerie_RowDeleting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvSerie.RowDeleting
Try
Dim keySerieLote As String = e.Keys("Serie").ToString()
Dim keySerie As String = e.Keys("Serie").ToString()
For Each dr As DataRow In DtContratosSerieDetalle.Rows
If dr("Serie").ToString() = keySerieLote Then
If dr("Serie").ToString() = keySerie Then
dr.Delete()
End If
Next
@@ -20658,7 +20711,7 @@ Partial Class Ventas
Private Sub CargaCantidadSerieGV()
'MODIFICA CANTIDAD DEL GV CONTRATOS
For Each Gvr As GridViewRow In GvContratoDetalles.Rows
If Gvr.DataKey("CvePS").ToEntero() = CvePSSerieLote Then
If Gvr.DataKey("CvePS").ToEntero() = CvePSSerie Then
Dim Contador = DtContratosSerieDetalle.FiltraParametros(String.Format("ConsecId = {0}", Gvr.DataKey("CveContratoDetalle"))).Rows.Count
Gvr.FCTextBox("TxtCant").Text = Contador.ToString()
UPEstimaciones.Update()
@@ -21962,13 +22015,13 @@ Partial Class Ventas
If AplicaNCMasiva Then
If NCDescuento Then
For Each RNC In ListaNCDesc
DtImpuestos.Merge(CargaDtImpuestosNC(RNC.CveVenta, RNC.TotalRemNCAplicado, NCDescuento:=True, AplicaImpuestosLocales:=AplicaImpuestosLocales), True, MissingSchemaAction.Ignore)
DtImpuestos.Merge(CargaDtImpuestosNC(RNC.CveVenta, RNC.TotalRemNCAplicado, NCDescuento:=True, AplicaImpuestosLocales:=AplicaImpuestosLocales, NivelTotal:=DdlNCNivelImporte.SelectedValue.ToEntero()), True, MissingSchemaAction.Ignore)
Next
Else
For Each Gvr As GridViewRow In GvCxC.Rows
If Gvr.FCCheckBox("ChkCxC").Checked Then
DtImpuestos.Merge(CargaDtImpuestosNC(Gvr.DataKey("CveVenta").ToString().ToEntero(), Gvr.FCTextBox("TxtImporte").Text.ToString().ToDecimal, AplicaImpuestosLocales:=AplicaImpuestosLocales), True, MissingSchemaAction.Ignore)
DtImpuestos.Merge(CargaDtImpuestosNC(Gvr.DataKey("CveVenta").ToString().ToEntero(), Gvr.FCTextBox("TxtImporte").Text.ToString().ToDecimal, AplicaImpuestosLocales:=AplicaImpuestosLocales, NivelTotal:=DdlNCNivelImporte.SelectedValue.ToEntero()), True, MissingSchemaAction.Ignore)
'CARGA FACTURA A LA CUAL SE APLICA LA NC
AcumuladoNC += Gvr.FCTextBox("TxtImporte").Text.ToString().ToDecimal
CargaNCDT(Gvr.DataKey("CveVenta").ToString().ToEntero(), Gvr.FCTextBox("TxtImporte").Text.ToString().ToDecimal)
@@ -21976,7 +22029,7 @@ Partial Class Ventas
Next
End If
Else
DtImpuestos = CargaDtImpuestosNC(CveVenta, TxtNCImporte.Text.Trim.ToDecimal, AplicaImpuestosLocales:=AplicaImpuestosLocales)
DtImpuestos = CargaDtImpuestosNC(CveVenta, TxtNCImporte.Text.Trim.ToDecimal, AplicaImpuestosLocales:=AplicaImpuestosLocales, NivelTotal:=DdlNCNivelImporte.SelectedValue.ToEntero())
If EsNCAmortizacion Then
If DtAnticipoAmortizacion Is Nothing Then
@@ -21995,7 +22048,7 @@ Partial Class Ventas
End If
Else
For Each RNC In ListaRemisionesNC
DtImpuestos.Merge(CargaDtImpuestosNC(RNC.CveVenta, RNC.TotalRemNCAplicado, NCDescuento:=True, AplicaImpuestosLocales:=AplicaImpuestosLocales), True, MissingSchemaAction.Ignore)
DtImpuestos.Merge(CargaDtImpuestosNC(RNC.CveVenta, RNC.TotalRemNCAplicado, NCDescuento:=True, AplicaImpuestosLocales:=AplicaImpuestosLocales, NivelTotal:=DdlNCNivelImporte.SelectedValue.ToEntero()), True, MissingSchemaAction.Ignore)
Next
End If
@@ -22112,12 +22165,13 @@ Partial Class Ventas
End Sub
Private Function CargaDtImpuestosNC(CveVentaNC As Integer, Importe As Decimal, Optional NCDescuento As Boolean = False, Optional AplicaImpuestosLocales As Boolean = True) As DataTable
Private Function CargaDtImpuestosNC(CveVentaNC As Integer, Importe As Decimal, Optional NCDescuento As Boolean = False, Optional AplicaImpuestosLocales As Boolean = True, Optional NivelTotal As Integer = 1) As DataTable
Dim Total As Decimal = 0, SubTotal As Decimal = 0, Saldo As Decimal = 0
Dim TmpDT As DataTable = Nothing
Dim TmpDTImpuestos As DataTable = Nothing
Dim ObjVentas As New ClsVentas
If ObjVentas.GetVentaImpuestosLocales(CveVentaNC) Then
If ObjVentas.DtResultados.Rows.Count > 0 Then
@@ -22153,7 +22207,7 @@ Partial Class Ventas
DtImpuestosLocal.Columns.Add("ImporteRetISR", GetType(Decimal))
DtImpuestosLocal.Columns.Add("ImporteIEPS", GetType(Decimal))
Dim ImporteReferencia As Decimal = If(DdlNCNivelImporte.SelectedValue.ToEntero() = 1, Total, SubTotal)
Dim ImporteReferencia As Decimal = If(NivelTotal = 1, Total, SubTotal)
Dim Porcentaje As Decimal = ((Importe * 100) / ImporteReferencia) / 100
Dim FiltroStr As String = ""
Dim importePuTemp As Decimal = 0
@@ -22212,7 +22266,7 @@ Partial Class Ventas
CveClasificacion As Integer, Clasificacion As String, CveProyecto As Integer, Proyecto As String, CveSubProyecto As Integer, SubProyecto As String,
Obs As String, Cantidad As Double, PU As Double, PorcentajeIVA As Double, ImporteIVA As Double, PorcentajeRetIVA As Double, ImporteRetIVA As Double,
PorcentajeRetISR As Double, ImporteRetISR As Double, PorcentajeIEPS As Double, ImporteIEPS As Double, TipoDescuento As Integer, Descuento As Double,
Total As Double, SerieLote As String, TiempoEntrega As String, CvePresupuestoIngreso As Integer, EntregaDirecta As Integer, SATClaveProdServ As String,
Total As Double, Serie As String, TiempoEntrega As String, CvePresupuestoIngreso As Integer, EntregaDirecta As Integer, SATClaveProdServ As String,
SATClaveUM As String, CveContratoDetalle As Integer, CveVentaDetalle As Integer, CveMovimientoDetallePedido As Integer, CveOrdenCompraDetalle As Integer,
CveVentaDetalleRemision As Integer, CveVentaDetalleCotizacion As Integer, Optional CveTamaño As Integer = -1)
@@ -22258,7 +22312,7 @@ Partial Class Ventas
Row("TotalImporte") = Math.Round(Total, NumeroDecimales)
Row("SerieLote") = SerieLote
Row("Serie") = Serie
Row("TiempoEntrega") = TiempoEntrega
Row("CvePresupuestoIngreso") = CvePresupuestoIngreso
Row("EntregaDirecta") = EntregaDirecta
@@ -23106,8 +23160,14 @@ Partial Class Ventas
End If
If DdlTipoAmortizacionAnticipo.SelectedValue = "2" Then DivConceptoNC.Visible = True Else DivConceptoNC.Visible = False
If DdlTipoAmortizacionAnticipo.SelectedValue = "2" Then
'debo de cambiar la columna que se tomaria como total, por si tiene impuestos, la NC estaria abarcandolos
DivConceptoNC.Visible = True
Else
DivConceptoNC.Visible = False
End If
CargaAnticipos(CveCliente)
DdlTipoRelacionAnticipo.SelectedValueExist("7")
Else
DivConceptoNC.Visible = False