- 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 'CveConcepto2 = 43
CveIE = -1 CveIE = -1
End If End If
Case Else
MsgError = "No se ha especificada opcion."
End Select End Select
@@ -3461,19 +3463,13 @@ Partial Class Bancos_PopIEVentas
ImporteMovimiento = 0 ImporteMovimiento = 0
End Select End Select
If ImporteMovimiento <> 0 AndAlso MsgError <> "" Then If ImporteMovimiento <> 0 AndAlso MsgError = "" Then
'Conta ContPAQ 'Conta ContPAQ
If IdCtaContable = 0 Then If IdCtaContable = 0 Then
CuentasContablesInvalidas.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString) CuentasContablesInvalidas.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString)
idCuentaContabilizacion = 0 idCuentaContabilizacion = 0
End If 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 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" MsgError = "No se pudo insertar la póliza"
Exit For Exit For

View File

@@ -1201,8 +1201,8 @@
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Serie"> <asp:TemplateField HeaderText="Serie">
<ItemTemplate> <ItemTemplate>
<asp:Literal ID="LtlSerie" 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("SerieLote") %>' Visible="false" runat="server" /> <asp:TextBox ID="TxtSerie" AutoPostBack="false" Text='<%# Eval("Serie") %>' Visible="false" runat="server" />
<asp:HiddenField runat="server" Value="" ID="HdnSerie" /> <asp:HiddenField runat="server" Value="" ID="HdnSerie" />
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </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 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 dr As DataRow = ObjeFacturas.DtResultados.Rows(0) ' no toma la cero, porque es el totalizador
Dim XMLDoc As New XmlDocument 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 If IO.File.Exists(Archivo) Then
Dim Validada As Boolean = True 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) CuentasContablesInvalidas.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", 6))("ConceptoContable").ToString)
idCuentaContabilizacion = 0 idCuentaContabilizacion = 0
End If 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 End If
Next 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 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 If RBLPago.SelectedValue.ToEntero = 4 Then
Exit Select 'Es credito el concepto 6 se agrega en CASE 17 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) CuentasContablesInvalidas.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", 49))("ConceptoContable").ToString)
idCuentaContabilizacion = 0 idCuentaContabilizacion = 0
End If 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 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 ErrorPrepoliza = True
End If End If
@@ -6741,13 +6749,9 @@ Partial Class Compras_Compras
' CveCuenta = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", String.Format("CveClasificacion = {0}", Row2("CveClasificacion"))).ToString.ToEntero ' CveCuenta = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", String.Format("CveClasificacion = {0}", Row2("CveClasificacion"))).ToString.ToEntero
End If End If
End If End If
'Conta ContPAQ
End If 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 'SEGMENTO DE NEGOCIO
@@ -6759,6 +6763,12 @@ Partial Class Compras_Compras
'AGREGA MOVIMIENTO 'AGREGA MOVIMIENTO
If importeMovimiento.RoundSQL <> 0 Then 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 tcvecon As Integer = 6
Dim tidctacon As Integer = 6 Dim tidctacon As Integer = 6
@@ -6796,6 +6806,9 @@ Partial Class Compras_Compras
End If End If
End If End If
Next Next
@@ -6873,6 +6886,11 @@ Partial Class Compras_Compras
CuentasContablesInvalidas.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString) CuentasContablesInvalidas.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString)
idCuentaContabilizacion = 0 idCuentaContabilizacion = 0
End If 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 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 ErrorPrepoliza = True
@@ -7128,6 +7146,11 @@ Partial Class Compras_Compras
CuentasContablesInvalidas.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString) CuentasContablesInvalidas.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString)
idCuentaContabilizacion = 0 idCuentaContabilizacion = 0
End If 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 'AMORTIZACIÓN NC ESPECIAL COMPLEMENTARIA
If ConceptoContableAnticipo.Contiene(60) And DdlMoneda.SelectedValue.ToEntero <> 1 And UsuarioActual.CveEmpresa.Contiene(119) Then 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) CuentasContablesInvalidas.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString)
idCuentaContabilizacion = 0 idCuentaContabilizacion = 0
End If 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 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 ErrorPrepoliza = True
@@ -9098,6 +9126,11 @@ Partial Class Compras_Compras
CuentasContablesInvalidas.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString) CuentasContablesInvalidas.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString)
idCuentaContabilizacion = 0 idCuentaContabilizacion = 0
End If 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 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 ErrorMovtosCxP = 1

View File

@@ -1788,7 +1788,7 @@
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </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: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" /> <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="Cantidad" DataField="Cantidad" DataFormatString="{0:#,##0.##}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="3%" />
<asp:BoundField HeaderText="Producto" DataField="CodigoPS" ItemStyle-Width="40%" /> <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="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> </Columns>
</asp:GridView> </asp:GridView>
</div> </div>
@@ -1882,7 +1882,7 @@
<asp:BoundField HeaderText="Cantidad" DataField="Cantidad" DataFormatString="{0:#,##0.##}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="3%" /> <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="Producto" DataField="CodigoPS" ItemStyle-Width="40%" />
<asp:BoundField HeaderText="Contrato Externo" DataField="ContratoExterno" ItemStyle-Width="3%" ItemStyle-HorizontalAlign="Left" /> <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> </Columns>
</asp:GridView> </asp:GridView>
</div> </div>

View File

@@ -2149,502 +2149,18 @@ Partial Class Contratos_Default
Else Else
Alert("No existe el archivo. Favor de subir un archivo excel a la plataforma.", TipoMensaje.MsgError) Alert("No existe el archivo. Favor de subir un archivo excel a la plataforma.", TipoMensaje.MsgError)
End If End If
End Sub End Sub
#End Region #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 End Class

View File

@@ -1378,7 +1378,7 @@
<asp:Literal Text='<%# Eval("CodigoPS") %>' ID="LtProducto" runat="server" /> <asp:Literal Text='<%# Eval("CodigoPS") %>' ID="LtProducto" runat="server" />
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </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="Lote" DataField="Lote" ItemStyle-Width="10%" Visible="false" />
<asp:BoundField HeaderText="FechaCaducidad" DataField="FechaCaducidad" DataFormatString="{0:d}" ItemStyle-Width="10%" Visible="false" /> <asp:BoundField HeaderText="FechaCaducidad" DataField="FechaCaducidad" DataFormatString="{0:d}" ItemStyle-Width="10%" Visible="false" />
</Columns> </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") 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 If ObjInventarios.GetMovimientosDetalle(CveMovimientoSalidaAjuste, UsuarioActual.CveEmpresa) Then
For Each Dr As DataRow In ObjInventarios.DtResultados.Rows 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 TieneError = True
Exit For Exit For
End If End If
@@ -6811,7 +6811,7 @@ Partial Class OC
Else Else
'DETALLE 'DETALLE
If e.Row.DBCampo("SerieLote") <> "" Then If e.Row.DBCampo("Serie") <> "" Then
GVInv.Columns(4).Visible = True GVInv.Columns(4).Visible = True
End If End If

View File

@@ -2216,7 +2216,7 @@ Partial Class Ventas_PortalCliente
TmpDT.Columns.Add("NoIdentificacion", GetType(String)) TmpDT.Columns.Add("NoIdentificacion", GetType(String))
TmpDT.Columns.Add("CveTipoPS", GetType(Integer)) TmpDT.Columns.Add("CveTipoPS", GetType(Integer))
TmpDT.Columns.Add("CveTipoInvPS", 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("CuentaPredial", GetType(String))
TmpDT.Columns.Add("Obs", GetType(String)) TmpDT.Columns.Add("Obs", GetType(String))
TmpDT.Columns.Add("TiempoEntrega", 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, 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, PU As Decimal, Descuento As Decimal,
CveProyecto As Integer, Proyecto As String, CveSubProyecto As Integer, SubProyecto As String, 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 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 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 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("Proyecto") = Proyecto
Row("CveSubProyecto") = CveSubProyecto Row("CveSubProyecto") = CveSubProyecto
Row("SubProyecto") = SubProyecto Row("SubProyecto") = SubProyecto
Row("SerieLote") = SerieLote Row("Serie") = Serie
Row("TiempoEntrega") = TiempoEntrega Row("TiempoEntrega") = TiempoEntrega
Row("Orden") = TmpDT.Rows.Count + 1 Row("Orden") = TmpDT.Rows.Count + 1
Row("Cantidad") = Cantidad Row("Cantidad") = Cantidad

View File

@@ -1325,7 +1325,7 @@
<asp:ListItem Text="UEPS" Value="2"></asp:ListItem> <asp:ListItem Text="UEPS" Value="2"></asp:ListItem>
<asp:ListItem Text="PEPS" Value="3"></asp:ListItem> <asp:ListItem Text="PEPS" Value="3"></asp:ListItem>
<asp:ListItem Text="Identificador" Value="4"></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> </asp:DropDownList>
</td> </td>
</tr> </tr>

View File

@@ -9064,7 +9064,7 @@ Partial Class Clientes
TmpDT.Columns.Add("NoIdentificacion", GetType(String)) TmpDT.Columns.Add("NoIdentificacion", GetType(String))
TmpDT.Columns.Add("CveTipoPS", GetType(Integer)) TmpDT.Columns.Add("CveTipoPS", GetType(Integer))
TmpDT.Columns.Add("CveTipoInvPS", 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("CuentaPredial", GetType(String))
TmpDT.Columns.Add("Obs", GetType(String)) TmpDT.Columns.Add("Obs", GetType(String))
TmpDT.Columns.Add("TiempoEntrega", 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, 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, PU As Decimal, Descuento As Decimal,
CveProyecto As Integer, Proyecto As String, CveSubProyecto As Integer, SubProyecto As String, 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 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 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 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("Proyecto") = Proyecto
Row("CveSubProyecto") = CveSubProyecto Row("CveSubProyecto") = CveSubProyecto
Row("SubProyecto") = SubProyecto Row("SubProyecto") = SubProyecto
Row("SerieLote") = SerieLote Row("Serie") = Serie
Row("TiempoEntrega") = TiempoEntrega Row("TiempoEntrega") = TiempoEntrega
Row("Orden") = TmpDT.Rows.Count + 1 Row("Orden") = TmpDT.Rows.Count + 1
Row("Cantidad") = Cantidad 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, 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, 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, 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, SATClaveUM As String, CveContratoDetalle As Integer, CveVentaDetalle As Integer, CveMovimientoDetallePedido As Integer, CveOrdenCompraDetalle As Integer,
CveVentaDetalleRemision As Integer, CveVentaDetalleCotizacion As Integer) CveVentaDetalleRemision As Integer, CveVentaDetalleCotizacion As Integer)
@@ -2018,7 +2018,7 @@ Partial Class Ventas_ClientesAbonar
Row("Total") = Math.Round(Total, 2) Row("Total") = Math.Round(Total, 2)
Row("TotalImporte") = Math.Round(Total, 2) Row("TotalImporte") = Math.Round(Total, 2)
Row("SerieLote") = SerieLote Row("Serie") = Serie
Row("TiempoEntrega") = TiempoEntrega Row("TiempoEntrega") = TiempoEntrega
Row("CvePresupuestoIngreso") = CvePresupuestoIngreso Row("CvePresupuestoIngreso") = CvePresupuestoIngreso
Row("EntregaDirecta") = EntregaDirecta Row("EntregaDirecta") = EntregaDirecta
@@ -2182,7 +2182,7 @@ Partial Class Ventas_ClientesAbonar
TmpDT.Columns.Add("NoIdentificacion", GetType(String)) TmpDT.Columns.Add("NoIdentificacion", GetType(String))
TmpDT.Columns.Add("CveTipoPS", GetType(Integer)) TmpDT.Columns.Add("CveTipoPS", GetType(Integer))
TmpDT.Columns.Add("CveTipoInvPS", 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("CuentaPredial", GetType(String))
TmpDT.Columns.Add("Obs", GetType(String)) TmpDT.Columns.Add("Obs", GetType(String))
TmpDT.Columns.Add("TiempoEntrega", GetType(String)) TmpDT.Columns.Add("TiempoEntrega", GetType(String))

View File

@@ -936,12 +936,11 @@
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Serie"> <asp:TemplateField HeaderText="Serie">
<ItemTemplate> <ItemTemplate>
<asp:Literal ID="LtlSerie" 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("SerieLote") %>' 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: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> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:BoundField DataField="Lote" HeaderText="Lote" /> <asp:BoundField DataField="Lote" HeaderText="Lote" />

View File

@@ -2924,7 +2924,7 @@ Partial Class PV
DtTemporal.Columns.Add("FechaCaducidad", Type.GetType("System.DateTime")) DtTemporal.Columns.Add("FechaCaducidad", Type.GetType("System.DateTime"))
End If 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(5).Visible = DtTemporal.MAX("Lote", "Lote <> ''") <> ""
GvInv.Columns(6).Visible = DtTemporal.MAX("FechaCaducidad", "FechaCaducidad <> ''") <> "" GvInv.Columns(6).Visible = DtTemporal.MAX("FechaCaducidad", "FechaCaducidad <> ''") <> ""
@@ -2989,7 +2989,7 @@ Partial Class PV
'COSTO ALMACEN 'COSTO ALMACEN
If UsuarioActual.Empresa.Funcionalidad(129).ToEntero > 0 AndAlso UsuarioActual.CveUsuario <> 1560 Then 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) CostoMenor = Costo + ((UsuarioActual.Empresa.Funcionalidad(129).ToDecimal / 100) * Costo)
'SI EL PRECIO ES MAYOR AL COSTO, SI PASA 'SI EL PRECIO ES MAYOR AL COSTO, SI PASA
If PU >= CostoMenor Then If PU >= CostoMenor Then
@@ -3000,7 +3000,7 @@ Partial Class PV
End If End If
If UsuarioActual.Empresa.Funcionalidad(133).ToEntero > 0 AndAlso UsuarioActual.CveUsuario <> 1560 Then 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) CostoMayor = Costo + ((UsuarioActual.Empresa.Funcionalidad(133).ToDecimal / 100) * Costo)
'SI EL PRECIO ES MAYOR AL COSTO, SI PASA 'SI EL PRECIO ES MAYOR AL COSTO, SI PASA
If PU <= CostoMayor Then 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, 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, 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 = "") Optional CveContratoDetalle As Integer = -1, Optional TiempoEntrega As String = "", Optional CodigoPS As String = "")
If Not CvePS > 0 Then If Not CvePS > 0 Then
@@ -3948,7 +3948,7 @@ Partial Class PV
Row("Proyecto") = Proyecto Row("Proyecto") = Proyecto
Row("CveSubProyecto") = CveSubProyecto Row("CveSubProyecto") = CveSubProyecto
Row("SubProyecto") = SubProyecto Row("SubProyecto") = SubProyecto
Row("SerieLote") = SerieLote Row("Serie") = Serie
Row("TiempoEntrega") = TiempoEntrega Row("TiempoEntrega") = TiempoEntrega
TmpDT.Rows.Add(Row) 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, 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, PU As Decimal, Descuento As Decimal,
CveProyecto As Integer, Proyecto As String, CveSubProyecto As Integer, SubProyecto As String, 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 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 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 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("Proyecto") = Proyecto
Row("CveSubProyecto") = CveSubProyecto Row("CveSubProyecto") = CveSubProyecto
Row("SubProyecto") = SubProyecto Row("SubProyecto") = SubProyecto
Row("SerieLote") = SerieLote Row("Serie") = Serie
Row("TiempoEntrega") = TiempoEntrega Row("TiempoEntrega") = TiempoEntrega
Row("Orden") = TmpDT.Rows.Count + 1 Row("Orden") = TmpDT.Rows.Count + 1
Row("Cantidad") = Cantidad 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, Dim Consec = AgregarProductoServicio(Cantidad, DdlUnidadMedida.SelectedValue.ToEntero, DdlUnidadMedida.SelectedItem.Text, DdlClasificacion.SelectedValue.ToEntero, DdlClasificacion.SelectedItem.Text,
CvePS, "", TxtObsPS.Text.Trim, PU, Descuento, CvePS, "", TxtObsPS.Text.Trim, PU, Descuento,
CveProyecto, Proyecto, DdlSubProyectoDatos.SelectedValue.ToEntero, DdlSubProyectoDatos.SelectedItem.Text, 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 If CveVentaDetalle <= 0 AndAlso Not EsCargo Then
Dim ListaPSCargo = CalculaUsados(Consec) 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, ' '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, ' ' 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, ' ' -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() ' LimpiaAgregar()
' End If ' End If
@@ -5391,17 +5391,17 @@ Partial Class PV
Dim Index = Row.RowIndex Dim Index = Row.RowIndex
Dim ObjInventarios As New ClsInventarios Dim ObjInventarios As New ClsInventarios
Dim Existencia = ObjInventarios.GetExistenciasPSSerie("", ddlAlmacen.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) 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 'Valida Existencia
If Existencia - ExistenciaActual <= 0 Then 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) 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.FCTextBox("TxtSerie").Text = ""
Row.FCHiddenField("HdnSerie").Value = "" Row.FCHiddenField("HdnSerie").Value = ""
TmpDT.Rows(Index)("SerieLote") = "" TmpDT.Rows(Index)("Serie") = ""
Else Else
Row.FCHiddenField("HdnSerie").Value = Row.FCTextBox("TxtSerie").Text 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 End If
TmpDT.AcceptChanges() TmpDT.AcceptChanges()
@@ -5428,7 +5428,7 @@ Partial Class PV
If Gvr.FCTextBox("TxtSerie").Visible = True And Gvr.FCTextBox("TxtSerie").Text.Trim <> "" Then 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) 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 'Valida Existencia
If Existencia - ExistenciaActual < 0 Or Existencia = 0 Then If Existencia - ExistenciaActual < 0 Or Existencia = 0 Then

View File

@@ -835,6 +835,38 @@
</div> </div>
</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"> <div class="row" style="margin-top: 5px;" id="DivProveedorCompra" runat="server" visible="false">
<label class="col-md-6 truncate">Proveedor de Compra</label> <label class="col-md-6 truncate">Proveedor de Compra</label>
<div class="col-md-6"> <div class="col-md-6">

View File

@@ -146,7 +146,7 @@ Partial Class ProductosyServicios
CargarAlias() CargarAlias()
CargaExistencias() CargaExistencias()
CargaGvSeccionAlmacen()
Else Else
'Configuración de Modalidad Insert 'Configuración de Modalidad Insert
RegistraScript("$('#C_Tab_TabPaquetes_tab').css('display' , 'none')") RegistraScript("$('#C_Tab_TabPaquetes_tab').css('display' , 'none')")
@@ -286,7 +286,7 @@ Partial Class ProductosyServicios
CveSATPS = -1 CveSATPS = -1
CargaCombosSeccionAlmacen() CargaCombosSeccionAlmacen()
DivSeccionAlmacen.Visible = UsuarioActual.Empresa.Funcionalidad(563).ToString = "1"
CreaDtSeccionAlmacen() CreaDtSeccionAlmacen()
If UsuarioActual.Empresa.UsaContabilidad Then If UsuarioActual.Empresa.UsaContabilidad Then
@@ -863,6 +863,16 @@ Partial Class ProductosyServicios
ViewState("CveSubFamilia") = ObjProductosServicios.DtResultados.Rows(0)("CveSubFamilia") 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() CargaCaracteristicas()
LnkUnificar.Visible = True LnkUnificar.Visible = True
@@ -1208,7 +1218,8 @@ Partial Class ProductosyServicios
CveUsuarioModifico:=UsuarioActual.CveUsuario, CveClasificacionDetalle:=DdlTipoPSDes.SelectedValue.ToEntero, CveTamaño:=DdlTamanio.SelectedValue.ToEntero, 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(), 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, 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 If Not ObjProductosServicios.LimpiaImpuestosLocales(CvePS) Then
TieneError = True TieneError = True
@@ -2530,9 +2541,10 @@ Partial Class ProductosyServicios
End Sub End Sub
Private Sub CargaGvSeccionAlmacen() Private Sub CargaGvSeccionAlmacen()
Dim ObjInv As New ClsInventarios 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 GvSeccionAlmacen.DataSource = ObjInv.DtResultados
DtSeccionAlmacen = ObjInv.DtResultados DtSeccionAlmacen = ObjInv.DtResultados
End If End If
ObjInv.Dispose() ObjInv.Dispose()
GvSeccionAlmacen.DataBind() GvSeccionAlmacen.DataBind()
@@ -2545,7 +2557,7 @@ Partial Class ProductosyServicios
DdlAlmacen.Items.Add(New ListItem("Seleccione", "-1")) DdlAlmacen.Items.Add(New ListItem("Seleccione", "-1"))
DdlAlmacen.DataBind() DdlAlmacen.DataBind()
DdlSeccionAlmacen.DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, -1) DdlSeccionAlmacen.DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero)
DdlSeccionAlmacen.Items.Add(New ListItem("Seleccione", "-1")) DdlSeccionAlmacen.Items.Add(New ListItem("Seleccione", "-1"))
DdlSeccionAlmacen.DataBind() DdlSeccionAlmacen.DataBind()

View File

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

View File

@@ -10,7 +10,7 @@
padding: 0px 5px; padding: 0px 5px;
} }
.nolineheight { .nolineheight TxtNombreCliente
line-height: 1; line-height: 1;
} }
@@ -1311,7 +1311,7 @@
<ContentTemplate> <ContentTemplate>
<div class="col-md-12"> <div class="col-md-12">
<asp:GridView ID="GvCodigosUnicos" runat="server" CssClass="table table-striped table-hover Widthall" AutoGenerateColumns="False" <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> <Columns>
<asp:TemplateField HeaderText="Código Único"> <asp:TemplateField HeaderText="Código Único">
<ItemTemplate> <ItemTemplate>
@@ -1646,16 +1646,16 @@
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Serie"> <asp:TemplateField HeaderText="Serie">
<ItemTemplate> <ItemTemplate>
<asp:Literal ID="LtlSerie" 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("SerieLote") %>' 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: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")%>' />--%> <%--<asp:HiddenField runat="server" ID="HdnSerieLote" Value='<%# Eval("SerieLote")%>' />--%>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:BoundField DataField="Lote" HeaderText="Lote" /> <asp:BoundField DataField="Lote" HeaderText="Lote" />
<asp:BoundField DataField="FechaCaducidad" HeaderText="FechaCaducidad" /> <asp:BoundField DataField="FechaCaducidad" HeaderText="FechaCaducidad" DataFormatString="{0:d}" />
</Columns> </Columns>
</asp:GridView> </asp:GridView>
</div> </div>
@@ -3543,7 +3543,7 @@
<div style="max-height: 300px; overflow-y: auto;"> <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" <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" 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> <Columns>
<asp:TemplateField> <asp:TemplateField>
<ItemTemplate> <ItemTemplate>
@@ -3567,7 +3567,7 @@
<ItemTemplate> <ItemTemplate>
<asp:Literal ID="LtlAnticipos" runat="server" Text='<%# Eval("Saldo", "{0:N2}") %>'></asp:Literal>&nbsp; <asp:Literal ID="LtlAnticipos" runat="server" Text='<%# Eval("Saldo", "{0:N2}") %>'></asp:Literal>&nbsp;
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField Visible="false"> <asp:TemplateField Visible="false">
<HeaderTemplate>Moneda Venta</HeaderTemplate> <HeaderTemplate>Moneda Venta</HeaderTemplate>
<ItemTemplate> <ItemTemplate>
@@ -5405,9 +5405,9 @@
<tr> <tr>
<td width="80px">Serie:</td> <td width="80px">Serie:</td>
<td> <td>
<asp:TextBox runat="server" ID="TxtSerieLote" Width="300px" ClientIDMode="Static" /> <asp:TextBox runat="server" ID="TxtSerie" 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> <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="VCESerieLote" runat="server" HighlightCssClass="vco" TargetControlID="RFVSerieLote" Width="300px"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="VCESerie" runat="server" HighlightCssClass="vco" TargetControlID="RFVSerie" Width="300px"></ajax:ValidatorCalloutExtender>
<td colspan="3" align="left"> <td colspan="3" align="left">
<asp:Label runat="server">Series total: </asp:Label><asp:Label runat="server" ID="lblSerieTotal">0</asp:Label> <asp:Label runat="server">Series total: </asp:Label><asp:Label runat="server" ID="lblSerieTotal">0</asp:Label>
</td> </td>
@@ -6310,7 +6310,7 @@
</div> </div>
</div> </div>
<div id="DivNombreCliente" runat="server" visible="false" class="form-group form-md-line-input input-iconright"> <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> <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> <label for="<%= TxtNombreCliente.ClientID.ToString()%>">Razón Social:</label>
</div> </div>
@@ -7231,7 +7231,8 @@
let TipoAnticipo = $('#<%= DdlTipoAmortizacionAnticipo.ClientID %>').val(); let TipoAnticipo = $('#<%= DdlTipoAmortizacionAnticipo.ClientID %>').val();
$get("HdnTipoDescuento").value = "3"; $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)); var SaldoCompra = parseFloat(parseFloat($get('HdnVentaSaldo').value).toFixed(2));
if (ToDouble($get('HdnCveVenta').value) == 0) SaldoCompra = Total; if (ToDouble($get('HdnCveVenta').value) == 0) SaldoCompra = Total;

View File

@@ -1311,36 +1311,36 @@ Partial Class Ventas
ViewState("DtContratosSerieDetalle") = value ViewState("DtContratosSerieDetalle") = value
End Set End Set
End Property End Property
Private Property CvePSSerieLote As Integer Private Property CvePSSerie As Integer
Get Get
Return CType(ViewState("CvePSSerieLote"), Integer) Return CType(ViewState("CvePSSerie"), Integer)
End Get End Get
Set(value As Integer) Set(value As Integer)
ViewState("CvePSSerieLote") = value ViewState("CvePSSerie") = value
End Set End Set
End Property End Property
Private Property CveUMSerieLote As Integer Private Property CveUMSerie As Integer
Get Get
Return CType(ViewState("CveUMSerieLote"), Integer) Return CType(ViewState("CveUMSerie"), Integer)
End Get End Get
Set(value As Integer) Set(value As Integer)
ViewState("CveUMSerieLote") = value ViewState("CveUMSerie") = value
End Set End Set
End Property End Property
Private Property CveConsecSerieLote As Integer Private Property CveConsecSerie As Integer
Get Get
Return CType(ViewState("CveConsecSerieLote"), Integer) Return CType(ViewState("CveConsecSerie"), Integer)
End Get End Get
Set(value As Integer) Set(value As Integer)
ViewState("CveConsecSerieLote") = value ViewState("CveConsecSerie") = value
End Set End Set
End Property End Property
Private Property LimitaCantidadSerieLote As Integer Private Property LimitaCantidadSerie As Integer
Get Get
Return CType(ViewState("LimitaCantidadSerieLote"), Integer) Return CType(ViewState("LimitaCantidadSerie"), Integer)
End Get End Get
Set(value As Integer) Set(value As Integer)
ViewState("LimitaCantidadSerieLote") = value ViewState("LimitaCantidadSerie") = value
End Set End Set
End Property End Property
@@ -2591,7 +2591,7 @@ Partial Class Ventas
TrPedido.Visible = False TrPedido.Visible = False
' TrKilometrajeTxt.Visible = True ' TrKilometrajeTxt.Visible = True
End If 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 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 '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 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 e.Row.FCRangeValidator("RVCant").MaximumValue = CantidadDisponible
LimitaCantidadSerieLote = 1 LimitaCantidadSerie = 1
Else Else
e.Row.FCRangeValidator("RVCant").MaximumValue = "10000000" e.Row.FCRangeValidator("RVCant").MaximumValue = "10000000"
LimitaCantidadSerieLote = 0 LimitaCantidadSerie = 0
End If End If
'CONSIGNACION DE VENTA 'CONSIGNACION DE VENTA
If CveAlmacenExistenciasContrato > 0 And e.Row.DBCampo("Inv_CveMetodoInventario").ToString().ToEntero() = 5 Then If CveAlmacenExistenciasContrato > 0 And e.Row.DBCampo("Inv_CveMetodoInventario").ToString().ToEntero() = 5 Then
GvContratoDetalles.Columns(8).Visible = True GvContratoDetalles.Columns(8).Visible = True
e.Row.FCButton("BtnSerieConsignacion").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 e.Row.FCTextBox("TxtCant").Enabled = False
End If End If
@@ -7752,6 +7752,19 @@ Partial Class Ventas
'GENERO LOS DATOS DE LA NC 'GENERO LOS DATOS DE LA NC
Dim tmpcon As DataTable = TmpDT.Clone Dim tmpcon As DataTable = TmpDT.Clone
tmpcon.Clear() 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("") Dim drpss As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlNCPSAnt.SelectedValue.ToEntero()).FiltroPrimero("")
@@ -7760,51 +7773,71 @@ Partial Class Ventas
Dim CveVentaP As Integer = 0 Dim CveVentaP As Integer = 0
For Each gvrt As GridViewRow In GVAnticipos.Rows For Each gvrt As GridViewRow In GVAnticipos.Rows
If gvrt.FCCheckBox(String.Format("Chk{0}", gvrt.RowIndex)).Checked Then If gvrt.FCCheckBox(String.Format("Chk{0}", gvrt.RowIndex)).Checked Then
Dim CveSub As Integer = TmpDT.FiltroPrimeroValor("CveSubProyecto").ToEntero() Dim CveSub As Integer = TmpDT.FiltroPrimeroValor("CveSubProyecto").ToEntero()
Dim dr As DataRow = tmpcon.NewRow Dim dr As DataRow = tmpcon.NewRow
Dim Cantidad As Decimal = 1 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 Dim tTipoAmortizacion As Integer = If(DdlTipoAmortizacionAnticipo.SelectedValue = "2", 1, 2)
dr("PorcentajeIVA") = PorcentajeIVA ' GlobalDTSubProyectos(-1,cves DrPS("IVA")
Else
dr("PorcentajeIVA") = drpss("IVA")
End If
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") DtImpuestos = CargaDtImpuestosNC(gvrt.DataKey("CveVenta").ToString().ToEntero(), gvrt.FCTextBox(String.Format("TxtAnticipo{0}", gvrt.RowIndex)).Text.ToDecimal, AplicaImpuestosLocales:=True, NCDescuento:=False, NivelTotal:=tTipoAmortizacion)
dr("Descuento") = Math.Round(0, NumeroDecimales)
dr("TipoDescuento") = HdnTipoDescuento.Value Dim query = From ddr In DtImpuestos
dr("Total") = (Cantidad * PU) Group By PorcentajeIVA = ddr("PorcentajeIVA").ToString().ToDecimal,
dr("CveClasificacion") = drpss("CveClasificacion") PorcentajeRetIVA = ddr("PorcentajeRetIVA").ToString().ToDecimal,
dr("CveSubProyecto") = CveSub PorcentajeRetISR = ddr("PorcentajeRetISR").ToString().ToDecimal,
dr("TotalImporte") = Math.Round(Cantidad * PU, NumeroDecimales) PorcentajeIEPS = ddr("PorcentajeIEPS").ToString().ToDecimal
CveVentaP = gvrt.DataKey("CveVenta").ToEntero() Into x = Group
tmpcon.Rows.Add(dr) Select ImportePU = x.Sum(Function(s) s("ImportePU").ToString().ToDecimal),
ii += 1 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 End If
Next Next
@@ -10096,71 +10129,81 @@ Partial Class Ventas
If row2.FCCheckBox("Chk" & row2.RowIndex).Checked Then If row2.FCCheckBox("Chk" & row2.RowIndex).Checked Then
CveIEAnticipo = row2.DataKey("CveIE").ToString().ToEntero() 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) 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 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 IdCtaContable = IdCtaContAnticipos
CveCuenta = CveCuentaAnticipos CveCuenta = CveCuentaAnticipos
CveSubProyectoContabilizar = CveSubProyectoVenta CveSubProyectoContabilizar = CveSubProyectoVenta
If importeMovimiento <> 0 Then 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 ErrorPrepoliza = True
Exit For Exit For
Else Else
ViewState("SeGuardoPrePoliza") = True 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 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 ErrorPrepoliza = True
Exit For Exit For
End If End If
'se hace acreditamiento de impuestos 'se hace acreditamiento de impuestos
'IVA X TRASLADAR 'IVA X TRASLADAR
Dim PorcentajeImpuestoPago As Decimal = TmpDT.MAX("PorcentajeIVA").ToDecimal Dim EsAnticipoEspecial As Boolean = False
'' 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
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) If IngresoIVA > 0 Then
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
IdCtaIVAXTrasladar = If(IdCtaIVAXTrasladar > 0, IdCtaIVAXTrasladar, UsuarioActual.Empresa.IdCuentaIVAxTrasladar)
If IngresoIEPS > 0 Then Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 13, NombreCliente, $"{ObjFactura.Serie}-{ObjFactura.Folio}", FolioIE.ToString())
'IEPS X TRASLADAR 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
Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 38, NombreCliente, $"{ObjFactura.Serie}-{ObjFactura.Folio}", FolioIE.ToString()) ErrorPrepoliza = True
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 Exit For
ErrorPrepoliza = True End If
Exit For '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 End If
'IEPS PAGADO
Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 39, NombreCliente, $"{ObjFactura.Serie}-{ObjFactura.Folio}", FolioIE.ToString()) If IngresoIEPS > 0 Then
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 'IEPS X TRASLADAR
ErrorPrepoliza = True Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 38, NombreCliente, $"{ObjFactura.Serie}-{ObjFactura.Folio}", FolioIE.ToString())
Exit For 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
End If
End If End If
End If
Next Next
End If End If
@@ -11200,7 +11243,7 @@ Partial Class Ventas
CveUnidad = Dr("CveUM").ToString().ToEntero() CveUnidad = Dr("CveUM").ToString().ToEntero()
Cantidad = Dr("Cantidad").ToString().ToDouble 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 OcurrioError = True
ErrorList.Add("Se deben especificar las Series de los productos de almacén") ErrorList.Add("Se deben especificar las Series de los productos de almacén")
Exit For Exit For
@@ -11240,7 +11283,7 @@ Partial Class Ventas
End If End If
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 OcurrioError = True
ErrorList.Add("Ocurrió un error al agregar los Movimientos de salida al Inventario.<br />") ErrorList.Add("Ocurrió un error al agregar los Movimientos de salida al Inventario.<br />")
Exit For Exit For
@@ -11996,7 +12039,12 @@ Partial Class Ventas
saldo = e.Row.DataKey("Saldo").ToString().ToDecimal saldo = e.Row.DataKey("Saldo").ToString().ToDecimal
If CveVenta <= 0 Then 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 e.Row.FCLiteral("LtlAnticipos").Text = saldo.FormatoNumero
End If 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 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 '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 If ObjInventario.EsDevolucionVenta = 2 Then
Return True Return True
End If End If
@@ -13279,12 +13327,15 @@ Partial Class Ventas
Dim CveUnidad As Integer = MovDet("CveUM").ToString().ToEntero() Dim CveUnidad As Integer = MovDet("CveUM").ToString().ToEntero()
Dim PU As Decimal = MovDet("PU").ToString().ToDecimal Dim PU As Decimal = MovDet("PU").ToString().ToDecimal
Dim CveProducto As Integer = MovDet("CvePS").ToString().ToEntero() 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() Dim CveVentaDetalle = MovDet("CveVentaDetalle").ToString().ToEntero()
'Entrada '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 OcurrioError = True
Exit For Exit For
End If End If
@@ -13292,7 +13343,7 @@ Partial Class Ventas
'Salida 'Salida
CveVentaDetalle = ObjInventario.VentaDetallePadreGet(CveVentaDetalle).ToString().ToEntero() CveVentaDetalle = ObjInventario.VentaDetallePadreGet(CveVentaDetalle).ToString().ToEntero()
If CveVentaDetalle > 0 Then 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 OcurrioError = True
Exit For Exit For
End If End If
@@ -14576,7 +14627,7 @@ Partial Class Ventas
AgregarProductoServicio(Cantidad, DdlUnidadMedida.SelectedValue.ToEntero(), DdlUnidadMedida.SelectedItem.Text, DdlClasificacion.SelectedValue.ToEntero(), DdlClasificacion.SelectedItem.Text, AgregarProductoServicio(Cantidad, DdlUnidadMedida.SelectedValue.ToEntero(), DdlUnidadMedida.SelectedItem.Text, DdlClasificacion.SelectedValue.ToEntero(), DdlClasificacion.SelectedItem.Text,
CvePS, "", TxtObsPS.Text.Trim, PU, ObjDescuento.ImporteDescuento, CvePS, "", TxtObsPS.Text.Trim, PU, ObjDescuento.ImporteDescuento,
DdlProyecto.SelectedValue.ToEntero(), DdlProyecto.SelectedItem.Text, DdlSubProyecto.SelectedValue.ToEntero(), DdlSubProyecto.SelectedItem.Text, 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() 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, 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, PU As Decimal, Descuento As Decimal,
CveProyecto As Integer, Proyecto As String, CveSubProyecto As Integer, SubProyecto As String, 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 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 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 CuentaPredial As String = "", Optional RegeneraIEPS As Boolean = True, Optional CveVentaDetallePedido2 As Integer = 0,
@@ -14745,7 +14796,7 @@ Partial Class Ventas
Row("Proyecto") = Proyecto Row("Proyecto") = Proyecto
Row("CveSubProyecto") = CveSubProyecto Row("CveSubProyecto") = CveSubProyecto
Row("SubProyecto") = SubProyecto Row("SubProyecto") = SubProyecto
Row("SerieLote") = SerieLote Row("Serie") = Serie
Row("TiempoEntrega") = TiempoEntrega Row("TiempoEntrega") = TiempoEntrega
Row("Orden") = TmpDT.Rows.Count + 1 Row("Orden") = TmpDT.Rows.Count + 1
Row("Cantidad") = Cantidad Row("Cantidad") = Cantidad
@@ -15021,7 +15072,7 @@ Partial Class Ventas
TmpDT.Columns.Add("NoIdentificacion", GetType(String)) TmpDT.Columns.Add("NoIdentificacion", GetType(String))
TmpDT.Columns.Add("CveTipoPS", GetType(Integer)) TmpDT.Columns.Add("CveTipoPS", GetType(Integer))
TmpDT.Columns.Add("CveTipoInvPS", 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("CuentaPredial", GetType(String))
TmpDT.Columns.Add("Obs", GetType(String)) TmpDT.Columns.Add("Obs", GetType(String))
TmpDT.Columns.Add("TiempoEntrega", 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 'Si no se ha terminado de surtir agregamos el movimiento
If Indice >= 0 Then 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 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) Dim CantidadSurtida As Double = If(dr("CantidadDisponible").ToString().ToDecimal < rowSurtidos("Cantidad").ToString().ToDouble, dr("CantidadDisponible").ToString().ToDecimal, rowSurtidos("Cantidad").ToString().ToDecimal)
MovDTCuadrados.ImportRow(dr) MovDTCuadrados.ImportRow(dr)
@@ -16219,7 +16270,10 @@ Partial Class Ventas
Dim CveUnidad As Integer = MovDet("CveUM").ToString().ToEntero() Dim CveUnidad As Integer = MovDet("CveUM").ToString().ToEntero()
Dim PU As Decimal = MovDet("PU").ToString().ToDecimal Dim PU As Decimal = MovDet("PU").ToString().ToDecimal
Dim CveProducto As Integer = MovDet("CvePS").ToString().ToEntero() 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() Dim Consec As Integer = DtRemisionesTmpDT.FiltroPrimeroValor("Consec", $"CveVentaDetalle = {MovDet("CveVentaDetalle").ToString()}").ToEntero()
'COMIENZA: VENTADETALLE 'COMIENZA: VENTADETALLE
@@ -16245,7 +16299,7 @@ Partial Class Ventas
CveMovimientoDetalleEntrada = MovDet("CveMovimientoDetalle").ToString().ToEntero() CveMovimientoDetalleEntrada = MovDet("CveMovimientoDetalle").ToString().ToEntero()
End If 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 ContadorMovtosDetalles += 1
Else Else
OcurrioError = True OcurrioError = True
@@ -17208,7 +17262,7 @@ Partial Class Ventas
For Each Row As DataRow In TmpDT.Rows For Each Row As DataRow In TmpDT.Rows
Dim CveVentaDetalle As Integer = Row("CveVentaDetalle").ToString().ToEntero() Dim CveVentaDetalle As Integer = Row("CveVentaDetalle").ToString().ToEntero()
If CveVentaDetalle > 0 Then 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 OcurrioError = True
Exit For Exit For
End If End If
@@ -17360,7 +17414,7 @@ Partial Class Ventas
Dim DrProducto As DataRow = Nothing Dim DrProducto As DataRow = Nothing
If TxtCantidad.Text.Trim.ToDouble <= 0 Then TxtCantidad.Text = "1" If TxtCantidad.Text.Trim.ToDouble <= 0 Then TxtCantidad.Text = "1"
Dim SerieLote As String = "" Dim SerieL As String = ""
Dim CodigoBarras As String = "" Dim CodigoBarras As String = ""
Dim CvePS As Integer Dim CvePS As Integer
@@ -17369,10 +17423,10 @@ Partial Class Ventas
'BUSCA POR SERIE E IGNORA CODIGO DE BARRAS (LIMPIA) 'BUSCA POR SERIE E IGNORA CODIGO DE BARRAS (LIMPIA)
If TxtCodigoSerie.Text.Trim <> "" Then If TxtCodigoSerie.Text.Trim <> "" Then
SerieLote = TxtCodigoSerie.Text.Trim().ToUpper() Dim Serie As String = TxtCodigoSerie.Text.Trim().ToUpper()
Dim Objinventarios As New ClsInventarios 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 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("SerieLote = '{0}'", SerieLote)) Dim ExistenciaActual = DtInv.SUM("Cantidad", String.Format("Serie = '{0}'", Serie))
CvePS = Objinventarios.CvePS CvePS = Objinventarios.CvePS
Objinventarios.Dispose() Objinventarios.Dispose()
@@ -17383,11 +17437,11 @@ Partial Class Ventas
HdnCvePS.Value = CvePS.ToString() HdnCvePS.Value = CvePS.ToString()
TxtCantidad.Text = "1" TxtCantidad.Text = "1"
Else 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
End If End If
Else 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() TxtCodigoSerie.Focus()
RegistraScript($"$('#{TxtCodigoSerie.ClientID}').select();") RegistraScript($"$('#{TxtCodigoSerie.ClientID}').select();")
Exit Sub Exit Sub
@@ -17400,7 +17454,7 @@ Partial Class Ventas
CodigoBarras = TxtCodigoBarras.Text.Trim() CodigoBarras = TxtCodigoBarras.Text.Trim()
DrProducto = GlobalDTPS(UsuarioActual.CveEmpresa).FiltroPrimero($"CodigoBarras = '{CodigoBarras}'") DrProducto = GlobalDTPS(UsuarioActual.CveEmpresa).FiltroPrimero($"CodigoBarras = '{CodigoBarras}'")
If DrProducto IsNot Nothing Then 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() TxtCodigoSerie.Focus()
Exit Sub Exit Sub
Else Else
@@ -17410,7 +17464,7 @@ Partial Class Ventas
Else Else
TxtCodigoBarras.Focus() TxtCodigoBarras.Focus()
RegistraScript($"$('#{TxtCodigoBarras.ClientID}').select();") 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 Exit Sub
End If End If
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(), '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, ' 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(), ' -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() LimpiaAgregar()
End If End If
@@ -17991,17 +18045,17 @@ Partial Class Ventas
Dim Index = Row.RowIndex Dim Index = Row.RowIndex
Dim ObjInventarios As New ClsInventarios Dim ObjInventarios As New ClsInventarios
Dim Existencia = ObjInventarios.GetExistenciasPSSerie(Row.FCTextBox("TxtSerie").Text.ToString(), ddlAlmacen.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa) 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 'Valida Existencia
If Existencia - ExistenciaActual <= 0 Then 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) 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.FCTextBox("TxtSerie").Text = ""
Row.FCHiddenField("HdnSerie").Value = "" Row.FCHiddenField("HdnSerie").Value = ""
TmpDT.Rows(Index)("SerieLote") = "" TmpDT.Rows(Index)("Serie") = ""
Else Else
Row.FCHiddenField("HdnSerie").Value = Row.FCTextBox("TxtSerie").Text 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 End If
TmpDT.AcceptChanges() TmpDT.AcceptChanges()
@@ -18027,8 +18081,8 @@ Partial Class Ventas
'SIN EXISTENCIA 'SIN EXISTENCIA
If Gvr.FCTextBox("TxtSerie").Visible = True And Gvr.FCTextBox("TxtSerie").Text.Trim <> "" Then 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) 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("SerieLote = '{0}'", Gvr.FCTextBox("TxtSerie").Text.Trim)) ExistenciaActual = DtInv.SUM("Cantidad", String.Format("Serie = '{0}'", Gvr.FCTextBox("TxtSerie").Text.Trim))
'Valida Existencia 'Valida Existencia
If Existencia - ExistenciaActual < 0 Then If Existencia - ExistenciaActual < 0 Then
@@ -18226,13 +18280,13 @@ Partial Class Ventas
DtTemporal.Columns.Add("Lote", Type.GetType("System.String")) DtTemporal.Columns.Add("Lote", Type.GetType("System.String"))
End If End If
If Not DtTemporal.Columns.Contains("Batch") Then If Not DtTemporal.Columns.Contains("FechaCaducidad") Then
DtTemporal.Columns.Add("Batch", Type.GetType("System.String")) DtTemporal.Columns.Add("FechaCaducidad", Type.GetType("System.DateTime"))
End If 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(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.DataSource = DtTemporal
GvInv.DataBind() GvInv.DataBind()
@@ -19922,7 +19976,7 @@ Partial Class Ventas
End If End If
For Each dr As DataRow In ObjInventarios.DtResultados.FiltraParametros($"ExistenciaPedido > 0 {Filtro}").Rows 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(), 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(), dr("CveProyecto").ToString().ToEntero(), dr("Proyecto").ToString(), dr("CveSubProyecto").ToString().ToEntero(), dr("SubProyecto").ToString(),
CveMovimientoDetallePedido:=dr("CveMovimientoDetalle").ToString().ToEntero()) CveMovimientoDetallePedido:=dr("CveMovimientoDetalle").ToString().ToEntero())
Next Next
@@ -20428,12 +20482,12 @@ Partial Class Ventas
If Dr("CveTipoInvPS").ToString().ToEntero() = 5 Then If Dr("CveTipoInvPS").ToString().ToEntero() = 5 Then
For Each Dr2 As DataRow In DtContratosSerieDetalle.FiltraParametros($"ConsecId = {Dr("CveContratoDetalle")}").Rows 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 If Existencia < 1 Then
Return False Return False
End If 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 Return False
End If End If
Next Next
@@ -20458,7 +20512,7 @@ Partial Class Ventas
If CveMovimientoEntradaGeneral > 0 Then If CveMovimientoEntradaGeneral > 0 Then
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalidaConsignacion, UsuarioActual.CveEmpresa) Then If ObjInventario.GetMovimientosDetalle(CveMovimientoSalidaConsignacion, UsuarioActual.CveEmpresa) Then
For Each Dr As DataRow In ObjInventario.DtResultados.Rows 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 Return False
End If End If
Next Next
@@ -20472,7 +20526,7 @@ Partial Class Ventas
If CveMovimientoEntradaGeneral > 0 Then If CveMovimientoEntradaGeneral > 0 Then
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalidaConsignacion, UsuarioActual.CveEmpresa) Then If ObjInventario.GetMovimientosDetalle(CveMovimientoSalidaConsignacion, UsuarioActual.CveEmpresa) Then
For Each Dr As DataRow In ObjInventario.DtResultados.Rows 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 Return False
End If End If
Next Next
@@ -20506,12 +20560,12 @@ Partial Class Ventas
Protected Sub BtnSerieConsignacion_Click(sender As Object, e As EventArgs) Protected Sub BtnSerieConsignacion_Click(sender As Object, e As EventArgs)
Dim Argumentos = CType(sender, Button).CommandArgument.Split("°"c) Dim Argumentos = CType(sender, Button).CommandArgument.Split("°"c)
CveConsecSerieLote = Argumentos(0).ToEntero() CveConsecSerie = Argumentos(0).ToEntero()
CvePSSerieLote = Argumentos(1).ToEntero() CvePSSerie = Argumentos(1).ToEntero()
CveUMSerieLote = Argumentos(2).ToEntero() CveUMSerie = Argumentos(2).ToEntero()
LbProducto.Text = Argumentos(3) LbProducto.Text = Argumentos(3)
LbCantidad.Text = If(Argumentos(4).ToDecimal < 0.0D, 0, Argumentos(4).ToDecimal).FormatoNumero LbCantidad.Text = If(Argumentos(4).ToDecimal < 0.0D, 0, Argumentos(4).ToDecimal).FormatoNumero
LimitaCantidadSerieLote = Argumentos(5).ToEntero() LimitaCantidadSerie = Argumentos(5).ToEntero()
CargaSerie() CargaSerie()
End Sub End Sub
@@ -20520,11 +20574,11 @@ Partial Class Ventas
Private Sub CargaSerie(Optional CerrarCompletado As Boolean = False) Private Sub CargaSerie(Optional CerrarCompletado As Boolean = False)
RegistraScript("$('#DivSerieConsignacion').modal();", "ModalLote") 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() GvSerie.DataBind()
lblSerieTotal.Text = GvSerie.Rows.Count.ToString() lblSerieTotal.Text = GvSerie.Rows.Count.ToString()
'VALIDA QUE SIGA AGREGANDO '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 BtnAgregarPS.Enabled = False
If CerrarCompletado Then If CerrarCompletado Then
RegistraScript("$('#DivSerieConsignacion').modal('hide');") RegistraScript("$('#DivSerieConsignacion').modal('hide');")
@@ -20534,22 +20588,21 @@ Partial Class Ventas
End If End If
UpSerieConsignacion.Update() UpSerieConsignacion.Update()
TxtSerieLote.Text = "" TxtSerie.Text = ""
TxtSerieLote.Focus() TxtSerie.Focus()
End Sub End Sub
Protected Sub BtnAgregarPS_Click(sender As Object, e As EventArgs) Protected Sub BtnAgregarPS_Click(sender As Object, e As EventArgs)
AgregaSerieLote(TxtSerieLote.Text.Replace(" ", String.Empty)) AgregaSerie(TxtSerie.Text.Replace(" ", String.Empty))
End Sub End Sub
Private Sub AgregaSerieLote(SerieLote As String) Private Sub AgregaSerie(Serie As String)
'SerieLote = SerieLote.Trim.Replace(" ", " ")
If SerieLote.Trim = "" Then If Serie.Trim = "" Then
Alert("El campo Serie es obligatorio. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia) Alert("El campo Serie es obligatorio. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
Exit Sub Exit Sub
End If End If
Dim SeriesArreglo = SerieLote.Trim.Split(";"c) Dim SeriesArreglo = Serie.Trim.Split(";"c)
'VALIDACION DE SERIES DUPLICADAS 'VALIDACION DE SERIES DUPLICADAS
Dim MensajeAlert As New StringBuilder Dim MensajeAlert As New StringBuilder
@@ -20558,13 +20611,13 @@ Partial Class Ventas
DtSeriesNuevas.Columns.Add("Serie", GetType(String)) DtSeriesNuevas.Columns.Add("Serie", GetType(String))
'PARA VALIDAR SI LA SERIE ES IGUAL AL CODIGO O CODIGOBARRAS '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 = GlobalDTProductosServicios(UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CvePS = {0}", CvePSSerie), "PS")
Dim dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePSSerieLote).FiltroPrimero("", "PS") Dim dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePSSerie).FiltroPrimero("", "PS")
For Each SerieRow In SeriesArreglo For Each SerieRow In SeriesArreglo
SerieRow = SerieRow.ToUpper 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 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.") MensajeAlert.Append($"<br/> El numero de Serie <b>""{SerieRow}""</b> proporcionado ya se encuentra ingresado.")
Continue For Continue For
@@ -20602,29 +20655,29 @@ Partial Class Ventas
Dim Row = DtContratosSerieDetalle.NewRow Dim Row = DtContratosSerieDetalle.NewRow
Index = Index + 1 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/>") MensajeSinExistencias.Append($"Serie: <b>{SerieRow} - En esta serie ocurrió un error por favor de comunicarse con soporte tecnico.</b>. <br/>")
Continue For Continue For
End If End If
'VERIFICA EXISTENCIAS '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 If Existencia < 1 Then
MensajeSinExistencias.Append($"Serie: <b>{SerieRow}</b>. <br/>") MensajeSinExistencias.Append($"Serie: <b>{SerieRow}</b>. <br/>")
Continue For Continue For
End If End If
Row("ConsecId") = CveConsecSerieLote Row("ConsecId") = CveConsecSerie
Row("Consec") = DtContratosSerieDetalle.Rows.Count + 1 Row("Consec") = DtContratosSerieDetalle.Rows.Count + 1
Row("CvePS") = CvePSSerieLote Row("CvePS") = CvePSSerie
Row("CveUM") = CveUMSerieLote Row("CveUM") = CveUMSerie
Row("Serie") = SerieRow Row("Serie") = SerieRow
DtContratosSerieDetalle.Rows.Add(Row) DtContratosSerieDetalle.Rows.Add(Row)
Next Next
ObjInventarios.Dispose() ObjInventarios.Dispose()
TxtSerieLote.Text = "" TxtSerie.Text = ""
CargaCantidadSerieGV() 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 Protected Sub GvSerie_RowDeleting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvSerie.RowDeleting
Try 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 For Each dr As DataRow In DtContratosSerieDetalle.Rows
If dr("Serie").ToString() = keySerieLote Then If dr("Serie").ToString() = keySerie Then
dr.Delete() dr.Delete()
End If End If
Next Next
@@ -20658,7 +20711,7 @@ Partial Class Ventas
Private Sub CargaCantidadSerieGV() Private Sub CargaCantidadSerieGV()
'MODIFICA CANTIDAD DEL GV CONTRATOS 'MODIFICA CANTIDAD DEL GV CONTRATOS
For Each Gvr As GridViewRow In GvContratoDetalles.Rows 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 Dim Contador = DtContratosSerieDetalle.FiltraParametros(String.Format("ConsecId = {0}", Gvr.DataKey("CveContratoDetalle"))).Rows.Count
Gvr.FCTextBox("TxtCant").Text = Contador.ToString() Gvr.FCTextBox("TxtCant").Text = Contador.ToString()
UPEstimaciones.Update() UPEstimaciones.Update()
@@ -21962,13 +22015,13 @@ Partial Class Ventas
If AplicaNCMasiva Then If AplicaNCMasiva Then
If NCDescuento Then If NCDescuento Then
For Each RNC In ListaNCDesc 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 Next
Else Else
For Each Gvr As GridViewRow In GvCxC.Rows For Each Gvr As GridViewRow In GvCxC.Rows
If Gvr.FCCheckBox("ChkCxC").Checked Then 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 'CARGA FACTURA A LA CUAL SE APLICA LA NC
AcumuladoNC += Gvr.FCTextBox("TxtImporte").Text.ToString().ToDecimal AcumuladoNC += Gvr.FCTextBox("TxtImporte").Text.ToString().ToDecimal
CargaNCDT(Gvr.DataKey("CveVenta").ToString().ToEntero(), 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 Next
End If End If
Else 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 EsNCAmortizacion Then
If DtAnticipoAmortizacion Is Nothing Then If DtAnticipoAmortizacion Is Nothing Then
@@ -21995,7 +22048,7 @@ Partial Class Ventas
End If End If
Else Else
For Each RNC In ListaRemisionesNC 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 Next
End If End If
@@ -22112,12 +22165,13 @@ Partial Class Ventas
End Sub 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 Total As Decimal = 0, SubTotal As Decimal = 0, Saldo As Decimal = 0
Dim TmpDT As DataTable = Nothing Dim TmpDT As DataTable = Nothing
Dim TmpDTImpuestos As DataTable = Nothing Dim TmpDTImpuestos As DataTable = Nothing
Dim ObjVentas As New ClsVentas Dim ObjVentas As New ClsVentas
If ObjVentas.GetVentaImpuestosLocales(CveVentaNC) Then If ObjVentas.GetVentaImpuestosLocales(CveVentaNC) Then
If ObjVentas.DtResultados.Rows.Count > 0 Then If ObjVentas.DtResultados.Rows.Count > 0 Then
@@ -22153,7 +22207,7 @@ Partial Class Ventas
DtImpuestosLocal.Columns.Add("ImporteRetISR", GetType(Decimal)) DtImpuestosLocal.Columns.Add("ImporteRetISR", GetType(Decimal))
DtImpuestosLocal.Columns.Add("ImporteIEPS", 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 Porcentaje As Decimal = ((Importe * 100) / ImporteReferencia) / 100
Dim FiltroStr As String = "" Dim FiltroStr As String = ""
Dim importePuTemp As Decimal = 0 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, 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, 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, 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, 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) 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("TotalImporte") = Math.Round(Total, NumeroDecimales)
Row("SerieLote") = SerieLote Row("Serie") = Serie
Row("TiempoEntrega") = TiempoEntrega Row("TiempoEntrega") = TiempoEntrega
Row("CvePresupuestoIngreso") = CvePresupuestoIngreso Row("CvePresupuestoIngreso") = CvePresupuestoIngreso
Row("EntregaDirecta") = EntregaDirecta Row("EntregaDirecta") = EntregaDirecta
@@ -23106,8 +23160,14 @@ Partial Class Ventas
End If 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") DdlTipoRelacionAnticipo.SelectedValueExist("7")
Else Else
DivConceptoNC.Visible = False DivConceptoNC.Visible = False