This commit is contained in:
2019-11-22 09:53:14 -07:00
16 changed files with 21586 additions and 16140 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -4303,6 +4303,13 @@ Partial Class Compras_Compras
If RBLPago.SelectedValue.ToEntero = 4 And EstatusCredito.Contiene(1, 101) Then If RBLPago.SelectedValue.ToEntero = 4 And EstatusCredito.Contiene(1, 101) Then
CveEstatusFactura = 6 CveEstatusFactura = 6
End If End If
'hay amortización directa como descuento. RMF Temporal
If UsuarioActual.CveEmpresa = 119 Then
If LblAmortizacion.Text.ToDouble > 0 AndAlso TxtDescuento.Text.ToDouble = 0 Then
TxtDescuento.Text = LblAmortizacion.Text
LblAmortizacion.Text = "0.00"
End If
End If
'Compra 'Compra
If ObjCompras.AddCompra(DdlTipoComprobante.SelectedValue, TxtDescripcion.Text.Trim, TxtSerie.Text.Trim, TxtFolio.Text.Trim, TxtFolioSecundario.Text.Trim, CveProveedor, TxtSubTotal.Text.ToDouble, TxtDescuento.Text.ToDouble, If ObjCompras.AddCompra(DdlTipoComprobante.SelectedValue, TxtDescripcion.Text.Trim, TxtSerie.Text.Trim, TxtFolio.Text.Trim, TxtFolioSecundario.Text.Trim, CveProveedor, TxtSubTotal.Text.ToDouble, TxtDescuento.Text.ToDouble,
@@ -6889,24 +6896,24 @@ Partial Class Compras_Compras
Dim ImporteIVA As Decimal = Math.Round(PorcentajePagoAnt * TxtIVA.Text.ToDecimal, 2) Dim ImporteIVA As Decimal = Math.Round(PorcentajePagoAnt * TxtIVA.Text.ToDecimal, 2)
'Agregamos el 14 'Agregamos el 14
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteIVA, Referencia, 14, Concepto, FechaMovimiento, CtaIvaxAcreditar, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorLocal, CveAcreedor:=CveAcreedor, CveIE:=Ant.CveIE, CveColectiva:=CveColectiva, ImporteMX:=ImporteIVA * tipoCambioActual * Multiplicador, ImporteME:=If(tipoCambioActual = 1, 0, ImporteIVA), CveCuenta:=CveCuentaIvaxAcreditar, PorcentajeImpuesto:=PorcentajeImpuestoAnticipo, Contabilizable:=SeContabiliza) Then If ImporteIVA > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteIVA, Referencia, 14, Concepto, FechaMovimiento, CtaIvaxAcreditar, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorLocal, CveAcreedor:=CveAcreedor, CveIE:=Ant.CveIE, CveColectiva:=CveColectiva, ImporteMX:=ImporteIVA * tipoCambioActual * Multiplicador, ImporteME:=If(tipoCambioActual = 1, 0, ImporteIVA), CveCuenta:=CveCuentaIvaxAcreditar, PorcentajeImpuesto:=PorcentajeImpuestoAnticipo, Contabilizable:=SeContabiliza) Then
ErrorPrepoliza = True ErrorPrepoliza = True
End If End If
'Agregamos el 19 'Agregamos el 19
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, ImporteIVA, Referencia, 19, Concepto, FechaMovimiento, CtaIvaAcreditable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorLocal, CveAcreedor:=CveAcreedor, CveIE:=Ant.CveIE, CveColectiva:=CveColectiva, ImporteMX:=ImporteIVA * tipoCambioActual * Multiplicador, ImporteME:=If(tipoCambioActual = 1, 0, ImporteIVA), PorcentajeImpuesto:=PorcentajeImpuestoAnticipo, Contabilizable:=SeContabiliza) Then If ImporteIVA > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, ImporteIVA, Referencia, 19, Concepto, FechaMovimiento, CtaIvaAcreditable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorLocal, CveAcreedor:=CveAcreedor, CveIE:=Ant.CveIE, CveColectiva:=CveColectiva, ImporteMX:=ImporteIVA * tipoCambioActual * Multiplicador, ImporteME:=If(tipoCambioActual = 1, 0, ImporteIVA), PorcentajeImpuesto:=PorcentajeImpuestoAnticipo, Contabilizable:=SeContabiliza) Then
ErrorPrepoliza = True ErrorPrepoliza = True
End If End If
Dim ImporteIEPS As Decimal = Math.Round(PorcentajePagoAnt * TxtIEPS.Text.ToDecimal, 2) Dim ImporteIEPS As Decimal = Math.Round(PorcentajePagoAnt * TxtIEPS.Text.ToDecimal, 2)
'Agregamos el 25 'Agregamos el 25
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteIEPS, Referencia, 25, Concepto, FechaMovimiento, CtaIvaxAcreditar, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorLocal, CveAcreedor:=CveAcreedor, CveIE:=Ant.CveIE, CveColectiva:=CveColectiva, ImporteMX:=ImporteIVA * tipoCambioActual * Multiplicador, ImporteME:=If(tipoCambioActual = 1, 0, ImporteIVA), CveCuenta:=CveCuentaIvaxAcreditar, PorcentajeImpuesto:=PorcentajeImpuestoAnticipo, Contabilizable:=SeContabiliza) Then If ImporteIEPS > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteIEPS, Referencia, 25, Concepto, FechaMovimiento, CtaIvaxAcreditar, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorLocal, CveAcreedor:=CveAcreedor, CveIE:=Ant.CveIE, CveColectiva:=CveColectiva, ImporteMX:=ImporteIVA * tipoCambioActual * Multiplicador, ImporteME:=If(tipoCambioActual = 1, 0, ImporteIVA), CveCuenta:=CveCuentaIvaxAcreditar, PorcentajeImpuesto:=PorcentajeImpuestoAnticipo, Contabilizable:=SeContabiliza) Then
ErrorPrepoliza = True ErrorPrepoliza = True
End If End If
'Agregamos el 26 'Agregamos el 26
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, ImporteIEPS, Referencia, 26, Concepto, FechaMovimiento, CtaIvaAcreditable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorLocal, CveAcreedor:=CveAcreedor, CveIE:=Ant.CveIE, CveColectiva:=CveColectiva, ImporteMX:=ImporteIVA * tipoCambioActual * Multiplicador, ImporteME:=If(tipoCambioActual = 1, 0, ImporteIVA), PorcentajeImpuesto:=PorcentajeImpuestoAnticipo, Contabilizable:=SeContabiliza) Then If ImporteIEPS > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, ImporteIEPS, Referencia, 26, Concepto, FechaMovimiento, CtaIvaAcreditable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorLocal, CveAcreedor:=CveAcreedor, CveIE:=Ant.CveIE, CveColectiva:=CveColectiva, ImporteMX:=ImporteIVA * tipoCambioActual * Multiplicador, ImporteME:=If(tipoCambioActual = 1, 0, ImporteIVA), PorcentajeImpuesto:=PorcentajeImpuestoAnticipo, Contabilizable:=SeContabiliza) Then
ErrorPrepoliza = True ErrorPrepoliza = True
End If End If
End If End If
@@ -6989,10 +6996,10 @@ Partial Class Compras_Compras
CveCuentaPago = CveCuentaProveedorExtranjera CveCuentaPago = CveCuentaProveedorExtranjera
End If End If
''Agregamos el 17 'Agregamos el 17
'If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, importeMovimiento, Referencia, 17, Concepto, FechaMovimiento, IdCtaContablePago, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorLocal, CveAcreedor:=CveAcreedor, CveIE:=Ant.CveIE, CveColectiva:=CveColectiva, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuentaPago, Contabilizable:=SeContabiliza) Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, importeMovimiento, Referencia, 17, Concepto, FechaMovimiento, IdCtaContablePago, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorLocal, CveAcreedor:=CveAcreedor, CveIE:=Ant.CveIE, CveColectiva:=CveColectiva, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuentaPago, Contabilizable:=SeContabiliza) Then
' ErrorPrepoliza = True ErrorPrepoliza = True
'End If End If
End If End If
' FLUCTUACION CAMBIARIA ' FLUCTUACION CAMBIARIA
@@ -14800,7 +14807,7 @@ Partial Class Compras_Compras
AddPS2(False) AddPS2(False)
'AJUSTE DE REDONDEO O DIFERENCIA PERMITIDA DE IMPORTE 'AJUSTE DE REDONDEO O DIFERENCIA PERMITIDA DE IMPORTE
AjustaImporteUltimoConcepto((If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, TmpDT.SUMD("ImporteSinImpuestos"), TxtSubTotal.Text.ToDouble) + TxtOtrosImpuestos.Text.ToDouble).ToDecimal - If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, TmpDT.SUM("ImporteSinImpuestos").ToString.ToDecimal, TmpDT.SUM("Total").ToString.ToDecimal)) AjustaImporteUltimoConcepto((If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, TmpDT.SUMD("ImporteSinImpuestos"), TxtSubTotal2.Text.ToDouble) + TxtOtrosImpuestos.Text.ToDouble).ToDecimal - If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, TmpDT.SUM("ImporteSinImpuestos").ToString.ToDecimal, TmpDT.SUM("Total").ToString.ToDecimal))
'AjustaImporteUltimoConcepto(TxtSubTotal2.Text.ToDecimal + TxtOtrosImpuestos.Text.ToDecimal - (TmpDT.SUM("Total").ToString.ToDecimal)) 'AjustaImporteUltimoConcepto(TxtSubTotal2.Text.ToDecimal + TxtOtrosImpuestos.Text.ToDecimal - (TmpDT.SUM("Total").ToString.ToDecimal))

View File

@@ -1223,7 +1223,7 @@ Partial Class PopUpVerFactura
Remision, Proveedor, CalleOrigen, NoExtOrigen, ColoniaOrigen, LocalidadOrigen, MunicipioOrigen, Remision, Proveedor, CalleOrigen, NoExtOrigen, ColoniaOrigen, LocalidadOrigen, MunicipioOrigen,
EstadoOrigen, PaisOrigen, CPOrigen, CalleDestino, NoExtDestino, ColoniaDestino, LocalidadDestino, EstadoOrigen, PaisOrigen, CPOrigen, CalleDestino, NoExtDestino, ColoniaDestino, LocalidadDestino,
MunicipioDestino, EstadoDestino, PaisDestino, CPDestino, FechaMovimiento, NombreCapturo, PuestoRecibio, MunicipioDestino, EstadoDestino, PaisDestino, CPDestino, FechaMovimiento, NombreCapturo, PuestoRecibio,
PuestoEnrego, RazonSocial, ResponsableCarga, ResponsableRecibio) PuestoEnrego, RazonSocial, ResponsableCarga, ResponsableRecibio, NombreCliente)
End Sub End Sub
Private Sub PUanacExtr(CveMoneda As Integer) 'preciounitario a moneda nacional o extranjera Private Sub PUanacExtr(CveMoneda As Integer) 'preciounitario a moneda nacional o extranjera
@@ -1240,7 +1240,7 @@ Partial Class PopUpVerFactura
Remision As String, Proveedor As String, CalleOrigen As String, NoExtOrigen As String, ColoniaOrigen As String, LocalidadOrigen As String, MunicipioOrigen As String, Remision As String, Proveedor As String, CalleOrigen As String, NoExtOrigen As String, ColoniaOrigen As String, LocalidadOrigen As String, MunicipioOrigen As String,
EstadoOrigen As String, PaisOrigen As String, CPOrigen As String, CalleDestino As String, NoExtDestino As String, ColoniaDestino As String, LocalidadDestino As String, MunicipioDestino As String, EstadoOrigen As String, PaisOrigen As String, CPOrigen As String, CalleDestino As String, NoExtDestino As String, ColoniaDestino As String, LocalidadDestino As String, MunicipioDestino As String,
EstadoDestino As String, PaisDestino As String, CPDestino As String, FechaMovimiento As Date, NombreCapturo As String, PuestoRecibio As String, PuestoEntrego As String, EstadoDestino As String, PaisDestino As String, CPDestino As String, FechaMovimiento As Date, NombreCapturo As String, PuestoRecibio As String, PuestoEntrego As String,
RazonSocial As String, ResponsableCarga As String, ResponsableRecibio As String) RazonSocial As String, ResponsableCarga As String, ResponsableRecibio As String, NombreCliente As String)
Select Case CveConcepto Select Case CveConcepto
@@ -1402,8 +1402,8 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("Fecha", Fecha)) params.Add(New ReportParameter("Fecha", Fecha))
params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy"))) params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("Folio", Folio)) params.Add(New ReportParameter("Folio", Folio))
params.Add(New ReportParameter("FacturadoA", NombreCliente))
params.Add(New ReportParameter("FacturaProveedor", If(CveCompra > 0 AndAlso dr IsNot Nothing, dr("SerieFolio").ToString, ""))) params.Add(New ReportParameter("FacturaProveedor", If(CveCompra > 0 AndAlso dr IsNot Nothing, dr("SerieFolio").ToString, "")))
params.Add(New ReportParameter("FacturadoA", RazonSocial))
params.Add(New ReportParameter("Descuentos", If(CveCompra > 0 AndAlso dr IsNot Nothing, (dr("Descuentos").ToString.ToDouble).FormatoNumero(2), ""))) params.Add(New ReportParameter("Descuentos", If(CveCompra > 0 AndAlso dr IsNot Nothing, (dr("Descuentos").ToString.ToDouble).FormatoNumero(2), "")))
params.Add(New ReportParameter("IVA", If(CveCompra > 0 AndAlso dr IsNot Nothing, dr("IVA").ToString.FormatoNumero(2), ""))) params.Add(New ReportParameter("IVA", If(CveCompra > 0 AndAlso dr IsNot Nothing, dr("IVA").ToString.FormatoNumero(2), "")))
params.Add(New ReportParameter("Total", If(CveCompra > 0 AndAlso dr IsNot Nothing, dr("Total").ToString.FormatoNumero(2), ""))) params.Add(New ReportParameter("Total", If(CveCompra > 0 AndAlso dr IsNot Nothing, dr("Total").ToString.FormatoNumero(2), "")))
@@ -1586,7 +1586,7 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("Almacen", Almacen)) params.Add(New ReportParameter("Almacen", Almacen))
params.Add(New ReportParameter("Fecha", Fecha)) params.Add(New ReportParameter("Fecha", Fecha))
params.Add(New ReportParameter("FacturaProveedor", FolioVenta)) params.Add(New ReportParameter("FacturaProveedor", FolioVenta))
params.Add(New ReportParameter("FacturadoA", DtMovimientos(0)("Nombre").ToString)) params.Add(New ReportParameter("FacturadoA", If(DtMovimientos(0)("Nombre").ToString <> "", DtMovimientos(0)("Nombre").ToString, NombreCliente)))
params.Add(New ReportParameter("Observaciones", Observaciones)) params.Add(New ReportParameter("Observaciones", Observaciones))
params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy"))) params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("Folio", Folio)) params.Add(New ReportParameter("Folio", Folio))
@@ -1672,6 +1672,7 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("Total", "")) params.Add(New ReportParameter("Total", ""))
'params.Add(New ReportParameter("NombreEntrego", String.Format("ENTREGÓ{0}{1}", vbCrLf, Capturo))) 'params.Add(New ReportParameter("NombreEntrego", String.Format("ENTREGÓ{0}{1}", vbCrLf, Capturo)))
params.Add(New ReportParameter("NombreRecibio", String.Format("RECIBIÓ{0}{1}", vbCrLf, Recibio))) params.Add(New ReportParameter("NombreRecibio", String.Format("RECIBIÓ{0}{1}", vbCrLf, Recibio)))
params.Add(New ReportParameter("FacturadoA", NombreCliente))
If (UsuarioActual.CveEmpresa = 72) Then If (UsuarioActual.CveEmpresa = 72) Then
params.Add(New ReportParameter("DomicilioFiscal", DomicilioFiscalCompu)) params.Add(New ReportParameter("DomicilioFiscal", DomicilioFiscalCompu))
End If End If
@@ -1700,6 +1701,7 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("Total", "")) params.Add(New ReportParameter("Total", ""))
'params.Add(New ReportParameter("NombreEntrego", String.Format("ENTREGÓ{0}{1}", vbCrLf, Capturo))) 'params.Add(New ReportParameter("NombreEntrego", String.Format("ENTREGÓ{0}{1}", vbCrLf, Capturo)))
params.Add(New ReportParameter("NombreRecibio", String.Format("RECIBIÓ{0}{1}", vbCrLf, Recibio))) params.Add(New ReportParameter("NombreRecibio", String.Format("RECIBIÓ{0}{1}", vbCrLf, Recibio)))
params.Add(New ReportParameter("FacturadoA", NombreCliente))
If (UsuarioActual.CveEmpresa = 72) Then If (UsuarioActual.CveEmpresa = 72) Then
params.Add(New ReportParameter("DomicilioFiscal", DomicilioFiscalCompu)) params.Add(New ReportParameter("DomicilioFiscal", DomicilioFiscalCompu))
End If End If
@@ -2364,7 +2366,7 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("Total", "")) params.Add(New ReportParameter("Total", ""))
'params.Add(New ReportParameter("NombreEntrego", String.Format("ENTREGÓ{0}{1}", vbCrLf, Capturo))) 'params.Add(New ReportParameter("NombreEntrego", String.Format("ENTREGÓ{0}{1}", vbCrLf, Capturo)))
params.Add(New ReportParameter("NombreRecibio", String.Format("RECIBIÓ{0}{1}", vbCrLf, Recibio))) params.Add(New ReportParameter("NombreRecibio", String.Format("RECIBIÓ{0}{1}", vbCrLf, Recibio)))
params.Add(New ReportParameter("FacturadoA", NombreCliente))
If (UsuarioActual.CveEmpresa = 72) Then If (UsuarioActual.CveEmpresa = 72) Then
params.Add(New ReportParameter("DomicilioFiscal", DomicilioFiscalCompu)) params.Add(New ReportParameter("DomicilioFiscal", DomicilioFiscalCompu))
End If End If
@@ -2393,6 +2395,7 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("Total", "")) params.Add(New ReportParameter("Total", ""))
'params.Add(New ReportParameter("NombreEntrego", String.Format("ENTREGÓ{0}{1}", vbCrLf, Capturo))) 'params.Add(New ReportParameter("NombreEntrego", String.Format("ENTREGÓ{0}{1}", vbCrLf, Capturo)))
params.Add(New ReportParameter("NombreRecibio", String.Format("RECIBIÓ{0}{1}", vbCrLf, Recibio))) params.Add(New ReportParameter("NombreRecibio", String.Format("RECIBIÓ{0}{1}", vbCrLf, Recibio)))
params.Add(New ReportParameter("FacturadoA", NombreCliente))
If (UsuarioActual.CveEmpresa = 72) Then If (UsuarioActual.CveEmpresa = 72) Then
params.Add(New ReportParameter("DomicilioFiscal", DomicilioFiscalCompu)) params.Add(New ReportParameter("DomicilioFiscal", DomicilioFiscalCompu))
End If End If
@@ -2421,6 +2424,7 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("Total", "")) params.Add(New ReportParameter("Total", ""))
'params.Add(New ReportParameter("NombreEntrego", String.Format("ENTREGÓ{0}{1}", vbCrLf, Capturo))) 'params.Add(New ReportParameter("NombreEntrego", String.Format("ENTREGÓ{0}{1}", vbCrLf, Capturo)))
params.Add(New ReportParameter("NombreRecibio", String.Format("RECIBIÓ{0}{1}", vbCrLf, Recibio))) params.Add(New ReportParameter("NombreRecibio", String.Format("RECIBIÓ{0}{1}", vbCrLf, Recibio)))
params.Add(New ReportParameter("FacturadoA", NombreCliente))
If (UsuarioActual.CveEmpresa = 72) Then If (UsuarioActual.CveEmpresa = 72) Then
params.Add(New ReportParameter("DomicilioFiscal", DomicilioFiscalCompu)) params.Add(New ReportParameter("DomicilioFiscal", DomicilioFiscalCompu))
End If End If
@@ -2448,6 +2452,7 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("Total", "")) params.Add(New ReportParameter("Total", ""))
'params.Add(New ReportParameter("NombreEntrego", String.Format("ENTREGÓ{0}{1}", vbCrLf, Capturo))) 'params.Add(New ReportParameter("NombreEntrego", String.Format("ENTREGÓ{0}{1}", vbCrLf, Capturo)))
params.Add(New ReportParameter("NombreRecibio", String.Format("RECIBIÓ{0}{1}", vbCrLf, Recibio))) params.Add(New ReportParameter("NombreRecibio", String.Format("RECIBIÓ{0}{1}", vbCrLf, Recibio)))
params.Add(New ReportParameter("FacturadoA", NombreCliente))
If (UsuarioActual.CveEmpresa = 72) Then If (UsuarioActual.CveEmpresa = 72) Then
params.Add(New ReportParameter("DomicilioFiscal", DomicilioFiscalCompu)) params.Add(New ReportParameter("DomicilioFiscal", DomicilioFiscalCompu))
End If End If

View File

@@ -291,7 +291,7 @@
<asp:HiddenField runat="server" ID="HdnFechasComprasVinculadas" Value="-1" ClientIDMode="Static" /> <asp:HiddenField runat="server" ID="HdnFechasComprasVinculadas" Value="-1" ClientIDMode="Static" />
<asp:GridView ID="GvCxP" GridLines="None" CssClass="table table-hover table-advance Widthall" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Cuentas por Pagar pendientes" DataKeyNames="CveCompra,FechaCompra,Proveedor,SerieFolio,Original,SubTotal,IVA,RetIVA,RetISR,IdCtaContProveedores,IdCtaContProveedoresSIG,CvePrePoliza,IdPoliza,CveRetIVAConcepto,CveRetISRConcepto,IVAPorcentaje"> <asp:GridView ID="GvCxP" GridLines="None" CssClass="table table-hover table-advance Widthall" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Cuentas por Pagar pendientes" DataKeyNames="CveCompra,FechaCompra,Proveedor,SerieFolio,Original,SubTotal,IVA,RetIVA,RetISR,IdCtaContProveedores,IdCtaContProveedoresSIG,CvePrePoliza,IdPoliza,CveRetIVAConcepto,CveRetISRConcepto,IVAPorcentaje,NoDeducible,IVADeducible,IVANoDeducible">
<Columns> <Columns>
<asp:TemplateField> <asp:TemplateField>
<HeaderTemplate> <HeaderTemplate>

View File

@@ -696,12 +696,21 @@ Partial Class Compras_ReembolsosComprobaciones
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, True, gvr.DataKey("IVA").ToDecimal * PorcentajePago, Referencia, 14, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, If(IdCtaContIVAXAcreditar > 0, IdCtaContIVAXAcreditar, IdCtaIVAxAcreditar), -1, CveIE:=CveIEPago, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.DataKey("IVA").ToDecimal * PorcentajePago), ImporteMX:=(gvr.DataKey("IVA").ToDecimal * PorcentajePago) * tipoCambio, CveCuenta:=CveCuentaIVAxAcreditar, CvePrePolizaOriginal:=CvePrePolizaPagoOriginal, CvePersonal:=CvePersonal, PorcentajeImpuesto:=PorcentajeIVA) Then If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, True, gvr.DataKey("IVA").ToDecimal * PorcentajePago, Referencia, 14, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, If(IdCtaContIVAXAcreditar > 0, IdCtaContIVAXAcreditar, IdCtaIVAxAcreditar), -1, CveIE:=CveIEPago, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.DataKey("IVA").ToDecimal * PorcentajePago), ImporteMX:=(gvr.DataKey("IVA").ToDecimal * PorcentajePago) * tipoCambio, CveCuenta:=CveCuentaIVAxAcreditar, CvePrePolizaOriginal:=CvePrePolizaPagoOriginal, CvePersonal:=CvePersonal, PorcentajeImpuesto:=PorcentajeIVA) Then
MsgError = "Detalle" MsgError = "Detalle"
End If End If
Dim ImporteNOIVA As Decimal = gvr.DataKey("IVA").ToDecimal * PorcentajePago
'Agrego el IVA 'Agrego el IVA
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, False, gvr.DataKey("IVA").ToDecimal * PorcentajePago, Referencia, 19, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, If(IdCtaContIVAAcreditable > 0, IdCtaContIVAAcreditable, IdCtaIVAAcreditable), -1, CveIE:=CveIEPago, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.DataKey("IVA").ToDecimal * PorcentajePago), ImporteMX:=(gvr.DataKey("IVA").ToDecimal * PorcentajePago) * tipoCambio, CveCuenta:=CveCuentaIVAAcreditable, CvePrePolizaOriginal:=CvePrePolizaPagoOriginal, CvePersonal:=CvePersonal, PorcentajeImpuesto:=PorcentajeIVA) Then If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, False, gvr.DataKey("IVA").ToDecimal * PorcentajePago, Referencia, 19, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, If(IdCtaContIVAAcreditable > 0, IdCtaContIVAAcreditable, IdCtaIVAAcreditable), -1, CveIE:=CveIEPago, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.DataKey("IVA").ToDecimal * PorcentajePago), ImporteMX:=(gvr.DataKey("IVA").ToDecimal * PorcentajePago) * tipoCambio, CveCuenta:=CveCuentaIVAAcreditable, CvePrePolizaOriginal:=CvePrePolizaPagoOriginal, CvePersonal:=CvePersonal, PorcentajeImpuesto:=PorcentajeIVA) Then
MsgError = "Detalle" MsgError = "Detalle"
End If End If
End If End If
If gvr.DataKey("NoDeducible") Then
Dim ImporteNOIVA As Decimal = gvr.DataKey("IVANoDeducible").ToDecimal * PorcentajePago
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, False, ImporteNOIVA, Referencia, 280, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, If(IdCtaContIVAAcreditable > 0, IdCtaContIVAAcreditable, IdCtaIVAAcreditable), -1, CveIE:=CveIEPago, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.DataKey("IVA").ToDecimal * PorcentajePago), ImporteMX:=(gvr.DataKey("IVA").ToDecimal * PorcentajePago) * tipoCambio, CveCuenta:=CveCuentaIVAAcreditable, CvePrePolizaOriginal:=CvePrePolizaPagoOriginal, CvePersonal:=CvePersonal, PorcentajeImpuesto:=PorcentajeIVA) Then
MsgError = "Detalle"
End If
End If
End If End If
If MsgError = "" AndAlso gvr.DataKey("RetIVA").ToDecimal > 0 Then If MsgError = "" AndAlso gvr.DataKey("RetIVA").ToDecimal > 0 Then
@@ -1494,7 +1503,7 @@ Partial Class Compras_ReembolsosComprobaciones
Protected Sub GvChequesFYE_RowDataBound(sender As Object, e As GridViewRowEventArgs) Protected Sub GvChequesFYE_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then If e.Row.RowType = DataControlRowType.DataRow Then
e.Row.FCHyperLink("HLFYE").NavigateUrl = String.Format("/RH/Personal.aspx?CvePersonal={0}", e.Row.DBCampo("CvePersonal")) e.Row.FCHyperLink("HLFYE").NavigateUrl = String.Format("/RH/Personal.aspx?CvePersonal={0}", e.Row.DBCampo("CvePersonal"))
e.Row.FCHyperLink("HLCheque").NavigateUrl = String.Format("/Bancos/IE.aspx?CveIE={0}", e.Row.DBCampo("CveIE")) 'e.Row.FCHyperLink("HLCheque").NavigateUrl = String.Format("/Bancos/IE.aspx?CveIE={0}", e.Row.DBCampo("CveIE"))
End If End If
End Sub End Sub

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -523,8 +523,8 @@
<DataSetName>DsInventarios</DataSetName> <DataSetName>DsInventarios</DataSetName>
<Top>0.17639cm</Top> <Top>0.17639cm</Top>
<Left>0.12931cm</Left> <Left>0.12931cm</Left>
<Height>1.11095cm</Height> <Height>1.11096cm</Height>
<Width>17.80043cm</Width> <Width>17.80045cm</Width>
<Style> <Style>
<Border> <Border>
<Style>None</Style> <Style>None</Style>
@@ -567,10 +567,10 @@
<Height>0.82291in</Height> <Height>0.82291in</Height>
<Style /> <Style />
</Body> </Body>
<Width>7.12873in</Width> <Width>7.05896in</Width>
<Page> <Page>
<PageHeader> <PageHeader>
<Height>3.79401cm</Height> <Height>4.11151cm</Height>
<PrintOnFirstPage>true</PrintOnFirstPage> <PrintOnFirstPage>true</PrintOnFirstPage>
<PrintOnLastPage>true</PrintOnLastPage> <PrintOnLastPage>true</PrintOnLastPage>
<ReportItems> <ReportItems>
@@ -644,7 +644,7 @@
<Value>=Parameters!LogoPath.Value</Value> <Value>=Parameters!LogoPath.Value</Value>
<Sizing>FitProportional</Sizing> <Sizing>FitProportional</Sizing>
<Top>0.3175cm</Top> <Top>0.3175cm</Top>
<Left>0.16459cm</Left> <Left>0.19987cm</Left>
<Height>1.66316cm</Height> <Height>1.66316cm</Height>
<Width>3.43141cm</Width> <Width>3.43141cm</Width>
<ZIndex>2</ZIndex> <ZIndex>2</ZIndex>
@@ -669,7 +669,7 @@
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox15</rd:DefaultName> <rd:DefaultName>Textbox15</rd:DefaultName>
<Top>2.09104cm</Top> <Top>2.40854cm</Top>
<Left>2.30482cm</Left> <Left>2.30482cm</Left>
<Height>0.6cm</Height> <Height>0.6cm</Height>
<Width>9.54145cm</Width> <Width>9.54145cm</Width>
@@ -685,7 +685,6 @@
</Style> </Style>
</Textbox> </Textbox>
<Textbox Name="Textbox18"> <Textbox Name="Textbox18">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether> <KeepTogether>true</KeepTogether>
<Paragraphs> <Paragraphs>
<Paragraph> <Paragraph>
@@ -699,7 +698,7 @@
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox18</rd:DefaultName> <rd:DefaultName>Textbox18</rd:DefaultName>
<Top>2.83214cm</Top> <Top>3.14964cm</Top>
<Left>2.30482cm</Left> <Left>2.30482cm</Left>
<Height>0.6cm</Height> <Height>0.6cm</Height>
<Width>9.54145cm</Width> <Width>9.54145cm</Width>
@@ -731,7 +730,7 @@
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox16</rd:DefaultName> <rd:DefaultName>Textbox16</rd:DefaultName>
<Top>2.843cm</Top> <Top>3.1605cm</Top>
<Left>0.14172cm</Left> <Left>0.14172cm</Left>
<Height>0.6cm</Height> <Height>0.6cm</Height>
<Width>2.11724cm</Width> <Width>2.11724cm</Width>
@@ -766,7 +765,7 @@
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox14</rd:DefaultName> <rd:DefaultName>Textbox14</rd:DefaultName>
<Top>2.09104cm</Top> <Top>2.40854cm</Top>
<Left>0.12931cm</Left> <Left>0.12931cm</Left>
<Height>0.6cm</Height> <Height>0.6cm</Height>
<Width>2.12965cm</Width> <Width>2.12965cm</Width>
@@ -872,7 +871,7 @@
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox4</rd:DefaultName> <rd:DefaultName>Textbox4</rd:DefaultName>
<Top>2.84301cm</Top> <Top>3.16051cm</Top>
<Left>12.17799cm</Left> <Left>12.17799cm</Left>
<Height>0.59999cm</Height> <Height>0.59999cm</Height>
<Width>1.80326cm</Width> <Width>1.80326cm</Width>
@@ -888,7 +887,6 @@
</Style> </Style>
</Textbox> </Textbox>
<Textbox Name="Textbox10"> <Textbox Name="Textbox10">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether> <KeepTogether>true</KeepTogether>
<Paragraphs> <Paragraphs>
<Paragraph> <Paragraph>
@@ -904,10 +902,10 @@
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox6</rd:DefaultName> <rd:DefaultName>Textbox6</rd:DefaultName>
<Top>2.09105cm</Top> <Top>2.40855cm</Top>
<Left>13.98125cm</Left> <Left>13.98125cm</Left>
<Height>0.6cm</Height> <Height>0.6cm</Height>
<Width>3.94849cm</Width> <Width>3.65324cm</Width>
<ZIndex>10</ZIndex> <ZIndex>10</ZIndex>
<Style> <Style>
<Border> <Border>
@@ -938,10 +936,10 @@
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox32</rd:DefaultName> <rd:DefaultName>Textbox32</rd:DefaultName>
<Top>2.84301cm</Top> <Top>3.16051cm</Top>
<Left>13.98125cm</Left> <Left>13.98125cm</Left>
<Height>0.59999cm</Height> <Height>0.59999cm</Height>
<Width>3.94849cm</Width> <Width>3.65324cm</Width>
<ZIndex>11</ZIndex> <ZIndex>11</ZIndex>
<Style> <Style>
<Border> <Border>
@@ -970,7 +968,7 @@
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox3</rd:DefaultName> <rd:DefaultName>Textbox3</rd:DefaultName>
<Top>2.09105cm</Top> <Top>2.40855cm</Top>
<Left>12.17799cm</Left> <Left>12.17799cm</Left>
<Height>0.59999cm</Height> <Height>0.59999cm</Height>
<Width>1.80326cm</Width> <Width>1.80326cm</Width>

View File

@@ -141,7 +141,7 @@
<div class="titlefiltros caption "> <div class="titlefiltros caption ">
<div class="row" style="padding-top: 10px; position: relative;"> <div class="row" style="padding-top: 10px; position: relative;">
<asp:Label runat="server" ID="LblPS" CssClass="col-md-1 truncate" style="max-width: 80px;">Producto:</asp:Label> <asp:Label runat="server" ID="LblPS" CssClass="col-md-1 truncate" Style="max-width: 80px;">Producto:</asp:Label>
<div class="col-md-2 " style="min-width: 250px; max-width: 300px;"> <div class="col-md-2 " style="min-width: 250px; max-width: 300px;">
<ADS:Dropdownlost ID="ddlProducto2" runat="server" AutoPostBack="False" DataTextField="PSCodigo" IncluyeTodos="false" DataValueField="CvePS" CssClassDdl="select2me" CssStyle="width: 250px; "></ADS:Dropdownlost> <ADS:Dropdownlost ID="ddlProducto2" runat="server" AutoPostBack="False" DataTextField="PSCodigo" IncluyeTodos="false" DataValueField="CvePS" CssClassDdl="select2me" CssStyle="width: 250px; "></ADS:Dropdownlost>
</div> </div>
@@ -181,37 +181,49 @@
<asp:CheckBox ID="ChkAgruparAlmacen" CssClass="md-checksd" runat="server" Text="Agrupar Almacenes" Checked="False" Visible="false" /> <asp:CheckBox ID="ChkAgruparAlmacen" CssClass="md-checksd" runat="server" Text="Agrupar Almacenes" Checked="False" Visible="false" />
</div> </div>
</div>
</div>
</div>
<div class="portlet-body" <%= IIf(chkexpand.Checked = True, "", "style=""display:none;""")%>>
<div class="row">
<label class="col-md-1 truncate">Clasificación:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlClasificacion" CssClass="select2me" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="Clasificacion" DataValueField="CveClasificacion" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 250px !important;">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
<label class="col-md-1 truncate">Unidad Medida:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlUnidadMedida" runat="server" CssClass="select2me " Style="width: 200px !important;" DataTextField="UnidadMedida" DataValueField="CveUnidadMedida">
<asp:ListItem Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
<div class="col-md-1">
<asp:CheckBox ID="cbEntrada" CssClass="md-checksd" runat="server" Text="Entrada" Checked="True" />
</div>
<div class="col-md-1">
<asp:CheckBox ID="cbSalida" CssClass="md-checksd" runat="server" Text="Salida" Checked="True" />
</div>
<div class="col-md-2">
<button type="button" class="btn btn-default" data-toggle="modal" data-target="#ModalTiposAlmacen">Filtrar tipos almacén</button>
</div>
<div id="DivSerie" runat="server" visible="false">
<label class="col-md-1 truncate" style="max-width: 80px;">Serie:</label>
<div class="col-md-1 ">
<asp:TextBox ID="TxtSerie" CssClass="form-control input-sm" runat="server" Width="90px" />
</div> </div>
</div> </div>
</div>
<div class="portlet-body" <%= IIf(chkexpand.Checked = True, "", "style=""display:none;""")%>>
<div class="row">
<label class="col-md-1 truncate">Clasificación:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlClasificacion" CssClass="select2me" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="Clasificacion" DataValueField="CveClasificacion" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 250px !important;">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
<label class="col-md-1 truncate">Unidad Medida:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlUnidadMedida" runat="server" CssClass="select2me " Style="width: 200px !important;" DataTextField="UnidadMedida" DataValueField="CveUnidadMedida">
<asp:ListItem Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
<div class="col-md-1">
<asp:CheckBox ID="cbEntrada" CssClass="md-checksd" runat="server" Text="Entrada" Checked="True" />
</div>
<div class="col-md-1">
<asp:CheckBox ID="cbSalida" CssClass="md-checksd" runat="server" Text="Salida" Checked="True" />
</div>
<div class="col-md-2">
<button type="button" class="btn btn-default" data-toggle="modal" data-target="#ModalTiposAlmacen">Filtrar tipos almacén</button>
</div>
</div>
</div> </div>
</div> </div>
</div>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
@@ -307,8 +319,13 @@
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-12 text-right"> <div class="col-md-12">
<asp:Literal ID="LtIndicador_Mensaje" Text="" runat="server" /> <div class="col-md-6 text-left">
<asp:Literal ID="LtIndicador_MensajeSerie" Text="" runat="server" />
</div>
<div class="col-md-6 text-right">
<asp:Literal ID="LtIndicador_Mensaje" Text="" runat="server" />
</div>
</div> </div>
</div> </div>
</ContentTemplate> </ContentTemplate>
@@ -408,6 +425,7 @@
<AlternatingRowStyle CssClass="TextoAlterno" /> <AlternatingRowStyle CssClass="TextoAlterno" />
</asp:GridView> </asp:GridView>
</div> </div>
</ContentTemplate> </ContentTemplate>
<Triggers> <Triggers>
<asp:AsyncPostBackTrigger ControlID="btConsultar" EventName="Click" /> <asp:AsyncPostBackTrigger ControlID="btConsultar" EventName="Click" />
@@ -454,7 +472,7 @@
</div> </div>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
</div> </div>
</asp:Content> </asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server"> <asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content> </asp:Content>

View File

@@ -1,378 +1,402 @@
Option Strict On Option Strict On
Option Explicit On Option Explicit On
Imports System.Data Imports System.Data
Imports Extensiones Imports Extensiones
Imports Microsoft.Reporting.WebForms Imports Microsoft.Reporting.WebForms
Partial Class Inventarios_Kardex Partial Class Inventarios_Kardex
Inherits ClsPaginas Inherits ClsPaginas
#Region "P R O P I E D A D E S" #Region "P R O P I E D A D E S"
'Public Property DtKardex As DataTable 'Public Property DtKardex As DataTable
' Get ' Get
' Return CType(ViewState("DtKardex"), DataTable) ' Return CType(ViewState("DtKardex"), DataTable)
' End Get ' End Get
' Set(value As DataTable) ' Set(value As DataTable)
' ViewState("DtKardex") = value ' ViewState("DtKardex") = value
' End Set ' End Set
'End Property 'End Property
Private Property CveMovimiento() As Integer Private Property CveMovimiento() As Integer
Get Get
Return If(IsNothing(ViewState("CveMovimiento")), -1, CInt(ViewState("CveMovimiento"))) Return If(IsNothing(ViewState("CveMovimiento")), -1, CInt(ViewState("CveMovimiento")))
End Get End Get
Set Set
ViewState("CveMovimiento") = Value ViewState("CveMovimiento") = Value
End Set End Set
End Property End Property
#End Region #End Region
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not IsPostBack Then If Not IsPostBack Then
TxtFechaI.Text = Now.AddMonths(-1).ToShortDateString TxtFechaI.Text = Now.AddMonths(-1).ToShortDateString
TxtFechaF.Text = Now.ToShortDateString TxtFechaF.Text = Now.ToShortDateString
CargaCombos() CargaCombos()
ddlAlmacen.Items.Insert(0, New ListItem("Todos", "-1")) ddlAlmacen.Items.Insert(0, New ListItem("Todos", "-1"))
If Not UsuarioActual.CveEmpresa.Contiene(4, 7, 11, 12, 13, 66) Then If Not UsuarioActual.CveEmpresa.Contiene(4, 7, 11, 12, 13, 66) Then
GvM.Columns(6).Visible = True ' SerieLote GvM.Columns(6).Visible = True ' SerieLote
GvM.Columns(7).Visible = True ' FCaducidad GvM.Columns(7).Visible = True ' FCaducidad
End If End If
If UsuarioActual.TienePermisoProceso(258) Then GvM.Columns(1).Visible = True If UsuarioActual.TienePermisoProceso(258) Then GvM.Columns(1).Visible = True
ddlAlmacen.SelectedValue = If(Request("CveAlmacen") IsNot Nothing, Request("CveAlmacen").ToString, "-1") ddlAlmacen.SelectedValue = If(Request("CveAlmacen") IsNot Nothing, Request("CveAlmacen").ToString, "-1")
If Request("FechaI") IsNot Nothing AndAlso Request("FechaI") <> "-1" Then TxtFechaI.Text = Request("FechaI").ToString If Request("FechaI") IsNot Nothing AndAlso Request("FechaI") <> "-1" Then TxtFechaI.Text = Request("FechaI").ToString
If Request("FechaF") IsNot Nothing AndAlso Request("FechaF") <> "-1" Then TxtFechaF.Text = Request("FechaF").ToString If Request("FechaF") IsNot Nothing AndAlso Request("FechaF") <> "-1" Then TxtFechaF.Text = Request("FechaF").ToString
If IfNull(Request("CvePS"), "-1").ToString.ToEntero > 0 Then CargarKardex(Request("CvePS").ToString.ToEntero) If IfNull(Request("CvePS"), "-1").ToString.ToEntero > 0 Then CargarKardex(Request("CvePS").ToString.ToEntero)
ddlProducto2.SelectedValue = If(Request("CvePS") IsNot Nothing, Request("CvePS").ToString, "-1") ddlProducto2.SelectedValue = If(Request("CvePS") IsNot Nothing, Request("CvePS").ToString, "-1")
If Request("CvePS") IsNot Nothing And Request("CvePS") <> "-1" Then If Request("CvePS") IsNot Nothing And Request("CvePS") <> "-1" Then
ddlProducto2.SelectedValue = If(Request("CvePS") IsNot Nothing, Request("CvePS").ToString, "-1") ddlProducto2.SelectedValue = If(Request("CvePS") IsNot Nothing, Request("CvePS").ToString, "-1")
ddlProducto_SelectedIndexChanged(ddlProducto2, EventArgs.Empty) ddlProducto_SelectedIndexChanged(ddlProducto2, EventArgs.Empty)
End If End If
CargaPermisos() CargaPermisos()
If UsuarioActual.CveUsuario = 100 Then If UsuarioActual.CveUsuario = 100 Then
LblPS.ToolTip = ddlProducto2.SelectedValue LblPS.ToolTip = ddlProducto2.SelectedValue
End If End If
End If End If
End Sub End Sub
#Region " INICIALIZA VALORES " #Region " INICIALIZA VALORES "
Private Sub CargaPermisos() Private Sub CargaPermisos()
Dim TienePermisoImportes As Boolean = UsuarioActual.TienePermisoProceso(201) Dim TienePermisoImportes As Boolean = UsuarioActual.TienePermisoProceso(201)
GvM.Columns(11).Visible = TienePermisoImportes ' costo GvM.Columns(11).Visible = TienePermisoImportes ' costo
GvM.Columns(12).Visible = TienePermisoImportes ' importe GvM.Columns(12).Visible = TienePermisoImportes ' importe
GvM.Columns(14).Visible = TienePermisoImportes ' valor GvM.Columns(14).Visible = TienePermisoImportes ' valor
End Sub End Sub
Private Function isWithFamily() As Boolean Private Function isWithFamily() As Boolean
Return (UsuarioActual.CveEmpresa = 66) Return (UsuarioActual.CveEmpresa = 66)
End Function End Function
Private Sub CargaCombos() Private Sub CargaCombos()
CargaFuncionalidad105() CargaFuncionalidad105()
CargaPS() CargaPS()
ddlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1) ddlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1)
ddlAlmacen.DataBind() ddlAlmacen.DataBind()
If IfNull(Request("CveAlmacen"), "-1").ToString.ToEntero > 0 Then ddlAlmacen.SelectedValueExist(Request("CveAlmacen").ToString) If IfNull(Request("CveAlmacen"), "-1").ToString.ToEntero > 0 Then ddlAlmacen.SelectedValueExist(Request("CveAlmacen").ToString)
CargaClasificaciones() CargaClasificaciones()
CBLTiposAlmacen.DataSource = GlobalDTTipoAlmacen(-1) CBLTiposAlmacen.DataSource = GlobalDTTipoAlmacen(-1)
CBLTiposAlmacen.DataBind() CBLTiposAlmacen.DataBind()
For Each item As ListItem In CBLTiposAlmacen.Items For Each item As ListItem In CBLTiposAlmacen.Items
If item.Text = "Entrega Adelantado" Then If item.Text = "Entrega Adelantado" Then
item.Selected = False item.Selected = False
Else Else
item.Selected = True item.Selected = True
End If End If
Next Next
End Sub End Sub
Private Sub CargaFuncionalidad105() Private Sub CargaFuncionalidad105()
ddlProducto2.setEsWebService(UsuarioActual.Empresa.Funcionalidad(105) = "1") ddlProducto2.setEsWebService(UsuarioActual.Empresa.Funcionalidad(105) = "1")
If ddlProducto2.UsaWebService Then If ddlProducto2.UsaWebService Then
ddlProducto2.ddlWS.Attributes.Add("data-Estatus", "-1") ddlProducto2.ddlWS.Attributes.Add("data-Estatus", "-1")
ddlProducto2.ddlWS.Attributes.Add("data-pagina", "Inventarios") ddlProducto2.ddlWS.Attributes.Add("data-pagina", "Inventarios")
ddlProducto2.ddlWS.Attributes.Add("data-cveclasificacion", DdlClasificacion.SelectedValue) ddlProducto2.ddlWS.Attributes.Add("data-cveclasificacion", DdlClasificacion.SelectedValue)
'DdlClasificacion.AutoPostBack = False 'DdlClasificacion.AutoPostBack = False
Else Else
ddlProducto2.ddl.Items.Add(New ListItem("Seleccione", "-1")) ddlProducto2.ddl.Items.Add(New ListItem("Seleccione", "-1"))
ddlProducto2.ddl.Items.Add(New ListItem("*** Actualizar listado de Productos o Servicios ***", "-2")) ddlProducto2.ddl.Items.Add(New ListItem("*** Actualizar listado de Productos o Servicios ***", "-2"))
End If End If
End Sub End Sub
Private Sub CargaClasificaciones() Private Sub CargaClasificaciones()
Dim CveClasificacion = If(Request("CveClasificacion") IsNot Nothing, Request("CveClasificacion").ToString, "-1") Dim CveClasificacion = If(Request("CveClasificacion") IsNot Nothing, Request("CveClasificacion").ToString, "-1")
If isWithFamily() Then If isWithFamily() Then
DdlClasificacion.DataSource = GlobalDTSubFamilias(UsuarioActual.CveEmpresa).FiltraParametros("", Orderby:="Clasificacion") DdlClasificacion.DataSource = GlobalDTSubFamilias(UsuarioActual.CveEmpresa).FiltraParametros("", Orderby:="Clasificacion")
Else Else
Dim ObjClasificaciones As New ClsClasificaciones Dim ObjClasificaciones As New ClsClasificaciones
If UsuarioActual.Empresa.UsaAC Then If UsuarioActual.Empresa.UsaAC Then
If ObjClasificaciones.GetClasificacionesExistencias(UsuarioActual.CveEmpresa) Then If ObjClasificaciones.GetClasificacionesExistencias(UsuarioActual.CveEmpresa) Then
DdlClasificacion.DataSource = ObjClasificaciones.DtResultados DdlClasificacion.DataSource = ObjClasificaciones.DtResultados
' DdlClasificacion.DataBind() ' DdlClasificacion.DataBind()
End If End If
Else Else
If ObjClasificaciones.GetClasificacionesExistencias(UsuarioActual.CveEmpresa) Then If ObjClasificaciones.GetClasificacionesExistencias(UsuarioActual.CveEmpresa) Then
DdlClasificacion.DataSource = ObjClasificaciones.DtResultados DdlClasificacion.DataSource = ObjClasificaciones.DtResultados
' DdlClasificacion.DataBind() ' DdlClasificacion.DataBind()
End If End If
End If End If
ObjClasificaciones.Dispose() ObjClasificaciones.Dispose()
End If End If
'DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltraParametros("", "Clasificacion") 'DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltraParametros("", "Clasificacion")
DdlClasificacion.DataBind() DdlClasificacion.DataBind()
DdlClasificacion.SelectedValueExist(CveClasificacion) DdlClasificacion.SelectedValueExist(CveClasificacion)
End Sub End Sub
#End Region #End Region
#Region " CARGA PS " #Region " CARGA PS "
Protected Sub DdlClasificacion_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlClasificacion.SelectedIndexChanged Protected Sub DdlClasificacion_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlClasificacion.SelectedIndexChanged
CargaPS() CargaPS()
End Sub End Sub
Private Sub CargaPS() Private Sub CargaPS()
If Not ddlProducto2.UsaWebService Then If Not ddlProducto2.UsaWebService Then
Dim Filtro = If(DdlClasificacion.SelectedValue.ToEntero > 0, String.Format("CveClasificacion={0} And CveTipoPS=2", DdlClasificacion.SelectedValue), "CveTipoPS=2") Dim Filtro = If(DdlClasificacion.SelectedValue.ToEntero > 0, String.Format("CveClasificacion={0} And CveTipoPS=2", DdlClasificacion.SelectedValue), "CveTipoPS=2")
ddlProducto2.ddl.Items.Clear() ddlProducto2.ddl.Items.Clear()
ddlProducto2.DataSource = GlobalDTPS(UsuarioActual.CveEmpresa).FiltraParametros(Filtro, "PSCodigo") ddlProducto2.DataSource = GlobalDTPS(UsuarioActual.CveEmpresa).FiltraParametros(Filtro, "PSCodigo")
ddlProducto2.DataBind() ddlProducto2.DataBind()
ddlProducto2.ddl.Items.Insert(0, New ListItem(" Seleccione ", "-1")) ddlProducto2.ddl.Items.Insert(0, New ListItem(" Seleccione ", "-1"))
Else Else
ddlProducto2.ddlWS.Attributes.Add("data-cveclasificacion", DdlClasificacion.SelectedValue) ddlProducto2.ddlWS.Attributes.Add("data-cveclasificacion", DdlClasificacion.SelectedValue)
ddlProducto2.SelectedText = "" ddlProducto2.SelectedText = ""
ddlProducto2.SelectedValue = "-1" ddlProducto2.SelectedValue = "-1"
End If End If
End Sub End Sub
Protected Sub ddlProducto_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ddlProducto2.selectedindexchange Protected Sub ddlProducto_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ddlProducto2.selectedindexchange
DdlUnidadMedida.Items.Clear() DdlUnidadMedida.Items.Clear()
DdlUnidadMedida.DataSource = GlobalDTProductosServiciosEquivalencias(ddlProducto2.SelectedValue.ToEntero, -1) DdlUnidadMedida.DataSource = GlobalDTProductosServiciosEquivalencias(ddlProducto2.SelectedValue.ToEntero, -1)
DdlUnidadMedida.DataBind() DdlUnidadMedida.DataBind()
DdlUnidadMedida.Items.Insert(0, New ListItem("Todos", "-1")) DdlUnidadMedida.Items.Insert(0, New ListItem("Todos", "-1"))
If UsuarioActual.CveUsuario = 100 Then If UsuarioActual.CveUsuario = 100 Then
LblPS.ToolTip = ddlProducto2.SelectedValue LblPS.ToolTip = ddlProducto2.SelectedValue
End If End If
End Sub
#End Region TxtSerie.Text = ""
If ddlProducto2.SelectedValue.ToEntero > 0 Then
#Region " CARGA DATOS " Dim Dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, ddlProducto2.SelectedValue.ToEntero).FiltroPrimero("")
Protected Sub btConsultar_Click(sender As Object, e As EventArgs) Handles btConsultar.Click If Dr IsNot Nothing Then
CargaDatos() If Dr("Inv_CveMetodoInventario").ToString.ToEntero = 5 Then
End Sub DivSerie.Visible = True
Else
Private Sub CargaDatos() DivSerie.Visible = False
Dim CveProducto As Integer = ddlProducto2.SelectedValue.ToEntero End If
End If
If CveProducto > 0 Then End If
Dim DtTemp = CargarKardex(CveProducto)
If DtTemp IsNot Nothing Then End Sub
'CARGA INDICADORES #End Region
If UsuarioActual.TienePermisoProceso(201) Then
DivIndicadores.Visible = True #Region " CARGA DATOS "
Protected Sub btConsultar_Click(sender As Object, e As EventArgs) Handles btConsultar.Click
Dim Dr = DtTemp.FiltroUltimo("") CargaDatos()
Dim TC = If(GlobalTipoCambio(Now) > 0, GlobalTipoCambio(Now), 1) End Sub
LtIndicador_Existencia.Text = Dr("Existencias").ToString.FormatoNumero() Private Sub CargaDatos()
Dim CveProducto As Integer = ddlProducto2.SelectedValue.ToEntero
LtIndicador_ValorPesos.Text = Dr("ValorInventario").ToString.FormatoNumero()
LtIndicador_ValorDolares.Text = (Dr("ValorInventario").ToString.ToDouble / TC).FormatoNumero() If CveProducto > 0 Then
Dim DtTemp = CargarKardex(CveProducto)
Dim CostoPromedio = If(Dr("Existencias").ToString.ToDouble > 0, Dr("ValorInventario").ToString.ToDouble / Dr("Existencias").ToString.ToDouble, 0) If DtTemp IsNot Nothing Then
LtIndicador_CPPesos.Text = CostoPromedio.FormatoNumero() 'CARGA INDICADORES
LtIndicador_CPDolares.Text = (CostoPromedio / TC).FormatoNumero() If UsuarioActual.TienePermisoProceso(201) Then
DivIndicadores.Visible = True
LtIndicador_UCPesos.Text = Dr("UltimoCosto").ToString.FormatoNumero()
LtIndicador_UCDolares.Text = Dr("UltimoCostoUSD").ToString.FormatoNumero() Dim Dr = DtTemp.FiltroUltimo("")
Dim TC = If(GlobalTipoCambio(Now) > 0, GlobalTipoCambio(Now), 1)
LtIndicador_Mensaje.Text = $"* Importes calculados con el tipo de cambio del dia <b> $ {TC.FormatoNumero(4)} </b>"
LtIndicador_Existencia.Text = Dr("Existencias").ToString.FormatoNumero()
UpIndicadores.Update()
LtIndicador_ValorPesos.Text = Dr("ValorInventario").ToString.FormatoNumero()
GvM.Attributes.Add("data-heighterror", "430") LtIndicador_ValorDolares.Text = (Dr("ValorInventario").ToString.ToDouble / TC).FormatoNumero()
Else
GvM.Attributes.Add("data-heighterror", "270") Dim CostoPromedio = If(Dr("Existencias").ToString.ToDouble > 0, Dr("ValorInventario").ToString.ToDouble / Dr("Existencias").ToString.ToDouble, 0)
End If LtIndicador_CPPesos.Text = CostoPromedio.FormatoNumero()
GvM.DataSource = DtTemp LtIndicador_CPDolares.Text = (CostoPromedio / TC).FormatoNumero()
GvM.DataBind()
End If LtIndicador_UCPesos.Text = Dr("UltimoCosto").ToString.FormatoNumero()
Else LtIndicador_UCDolares.Text = Dr("UltimoCostoUSD").ToString.FormatoNumero()
Alert("Seleccione un producto.", TipoMensaje.MsgAdvertencia)
End If LtIndicador_Mensaje.Text = $"* Importes calculados con el tipo de cambio del dia <b> $ {TC.FormatoNumero(4)} </b>"
End Sub
If TxtSerie.Text <> "" Then
Private Function CargarKardex(CvePS As Integer) As DataTable LtIndicador_MensajeSerie.Text = $"* Existencia y costos calculada por numero de serie: <b> {TxtSerie.Text} </b>"
Dim dt As DataTable = Nothing Else
LtIndicador_MensajeSerie.Text = ""
Dim Entrada As Boolean = cbEntrada.Checked End If
Dim Salida As Boolean = cbSalida.Checked
UpIndicadores.Update()
Dim FechaI As String = If(TxtFechaI.Text <> "" AndAlso TxtFechaI.Text <> "__/__/____", TxtFechaI.Text, "-1")
Dim FechaF As String = If(TxtFechaF.Text <> "" AndAlso TxtFechaF.Text <> "__/__/____", TxtFechaF.Text, "-1") GvM.Attributes.Add("data-heighterror", "430")
Dim CveAlmacen As Integer = ddlAlmacen.SelectedValue.ToEntero Else
If CvePS > 0 Then ddlProducto2.SelectedText = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimeroValor("PSCodigo", "") GvM.Attributes.Add("data-heighterror", "270")
End If
Dim CveTiposAlmacen = "" GvM.DataSource = DtTemp
For Each item As ListItem In CBLTiposAlmacen.Items GvM.DataBind()
CveTiposAlmacen += If(item.Selected, $"{item.Value},", "") End If
Next Else
Alert("Seleccione un producto.", TipoMensaje.MsgAdvertencia)
Dim ObjInventarios As New ClsInventarios End If
If ObjInventarios.GetKardex(Entrada, Salida, CvePS, FechaI, FechaF, CveAlmacen, CveTiposAlmacen.Substring(0, CveTiposAlmacen.Length - 1), DdlUnidadMedida.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, ChkAgruparAlmacen.Checked) Then End Sub
dt = ObjInventarios.DtResultados.Copy
End If Private Function CargarKardex(CvePS As Integer) As DataTable
ObjInventarios.Dispose() Dim dt As DataTable = Nothing
Return dt Dim Entrada As Boolean = cbEntrada.Checked
End Function Dim Salida As Boolean = cbSalida.Checked
Protected Sub gvMovimientos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvM.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then Dim FechaI As String = If(TxtFechaI.Text <> "" AndAlso TxtFechaI.Text <> "__/__/____", TxtFechaI.Text, "-1")
Dim FechaF As String = If(TxtFechaF.Text <> "" AndAlso TxtFechaF.Text <> "__/__/____", TxtFechaF.Text, "-1")
e.Row.Cells(0).ToolTip = e.Row.DBCampo("FechaMovto") Dim CveAlmacen As Integer = ddlAlmacen.SelectedValue.ToEntero
If CvePS > 0 Then ddlProducto2.SelectedText = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimeroValor("PSCodigo", "")
If UsuarioActual.TienePermisoProceso(201) Then 'PERMISO PARA VER IMPORTES
If e.Row.DBCampo("CveCompra") <> "" Then Dim CveTiposAlmacen = ""
e.Row.FCHyperLink("hlFolioD").NavigateUrl = String.Format("/Compras/Compras.aspx?CveCompra={0}", e.Row.DBCampo("CveCompra")) For Each item As ListItem In CBLTiposAlmacen.Items
ElseIf e.Row.DBCampo("CveVenta") <> "" Then CveTiposAlmacen += If(item.Selected, $"{item.Value},", "")
e.Row.FCHyperLink("hlFolioD").NavigateUrl = String.Format("/Ventas/Ventas.aspx?CveVenta={0}", e.Row.DBCampo("CveVenta")) Next
ElseIf e.Row.DBCampo("CveOrdenCompra") <> "" Then
e.Row.FCHyperLink("hlFolioD").NavigateUrl = String.Format("/OC/OC.aspx?OC={0}", e.Row.DBCampo("CveOrdenCompra")) Dim Serie As String = If(TxtSerie.Text <> "", TxtSerie.Text, "-1")
End If
End If Dim ObjInventarios As New ClsInventarios
If ObjInventarios.GetKardex(Entrada, Salida, CvePS, FechaI, FechaF, CveAlmacen, CveTiposAlmacen.Substring(0, CveTiposAlmacen.Length - 1), DdlUnidadMedida.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, ChkAgruparAlmacen.Checked, Serie) Then
If GvM.Columns(1).Visible Then dt = ObjInventarios.DtResultados.Copy
If Not e.Row.DBCampo("CveMovimiento").ToEntero > 0 Then End If
e.Row.Cells(1).Text = "" ObjInventarios.Dispose()
End If
End If Return dt
End Function
If e.Row.DBCampo("Concepto").Contains("TOTAL GENERAL") Then Protected Sub gvMovimientos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvM.RowDataBound
e.Row.CssClass = "Totales" If e.Row.RowType = DataControlRowType.DataRow Then
ElseIf e.Row.DBCampo("Concepto").Contains("SALDO INICIAL") Then
e.Row.CssClass = "SubTotales" e.Row.Cells(0).ToolTip = e.Row.DBCampo("FechaMovto")
End If
If UsuarioActual.TienePermisoProceso(201) Then 'PERMISO PARA VER IMPORTES
End If If e.Row.DBCampo("CveCompra") <> "" Then
End Sub e.Row.FCHyperLink("hlFolioD").NavigateUrl = String.Format("/Compras/Compras.aspx?CveCompra={0}", e.Row.DBCampo("CveCompra"))
#End Region ElseIf e.Row.DBCampo("CveVenta") <> "" Then
e.Row.FCHyperLink("hlFolioD").NavigateUrl = String.Format("/Ventas/Ventas.aspx?CveVenta={0}", e.Row.DBCampo("CveVenta"))
#Region " IMPRIMIR " ElseIf e.Row.DBCampo("CveOrdenCompra") <> "" Then
Protected Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click e.Row.FCHyperLink("hlFolioD").NavigateUrl = String.Format("/OC/OC.aspx?OC={0}", e.Row.DBCampo("CveOrdenCompra"))
'Imprimir("Excel") End If
GenerarPDF("Excel") End If
End Sub
Private Sub Imprimir(Optional reporte As String = "PDF") If GvM.Columns(1).Visible Then
If Not e.Row.DBCampo("CveMovimiento").ToEntero > 0 Then
Dim DtKardex As DataTable = Nothing e.Row.Cells(1).Text = ""
DtKardex = CargarKardex(ddlProducto2.SelectedValue.ToEntero) End If
If (Not IsNothing(DtKardex)) Then End If
Dim params As New List(Of ReportParameter)
If IO.File.Exists(String.Format("{0}/Formatos/Kardex.rdlc", UsuarioActual.Empresa.Ruta)) Then If e.Row.DBCampo("Concepto").Contains("TOTAL GENERAL") Then
ImprimirPDF(String.Format("Empresas/{0}/Formatos/Kardex.rdlc", UsuarioActual.CveEmpresa), DtKardex, params, "ReporteKardex", reporte) e.Row.CssClass = "Totales"
Else ElseIf e.Row.DBCampo("Concepto").Contains("SALDO INICIAL") Then
ImprimirPDF("Empresas/Grales/Formatos/Kardex.rdlc", DtKardex, params, "Reporte Kardex", reporte) e.Row.CssClass = "SubTotales"
End If End If
DtKardex.Dispose()
End If End If
End Sub
End Sub #End Region
Private Sub ImgImprimir_Click(sender As Object, e As EventArgs) Handles ImgImprimir.Click
GenerarPDF() #Region " IMPRIMIR "
End Sub Protected Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click
Private Sub GenerarPDF(Optional Formato As String = "PDF") 'Imprimir("Excel")
Dim Movimientos As New ClsInventarios GenerarPDF("Excel")
Dim CvePS As Integer = ddlProducto2.SelectedValue.ToEntero End Sub
Dim Entrada As Boolean = cbEntrada.Checked Private Sub Imprimir(Optional reporte As String = "PDF")
Dim Salida As Boolean = cbSalida.Checked
Dim DtKardex As DataTable = Nothing
Dim FechaI As String = If(TxtFechaI.Text <> "" AndAlso TxtFechaI.Text <> "__/__/____", TxtFechaI.Text, "-1") DtKardex = CargarKardex(ddlProducto2.SelectedValue.ToEntero)
Dim FechaF As String = If(TxtFechaF.Text <> "" AndAlso TxtFechaF.Text <> "__/__/____", TxtFechaF.Text, "-1") If (Not IsNothing(DtKardex)) Then
Dim CveAlmacen As Integer = ddlAlmacen.SelectedValue.ToEntero Dim params As New List(Of ReportParameter)
If IO.File.Exists(String.Format("{0}/Formatos/Kardex.rdlc", UsuarioActual.Empresa.Ruta)) Then
ImprimirPDF(String.Format("Empresas/{0}/Formatos/Kardex.rdlc", UsuarioActual.CveEmpresa), DtKardex, params, "ReporteKardex", reporte)
Dim Almacen = If(ddlAlmacen.SelectedValue = "-1", "", $"&emsp;<b>Almacén:</b>&nbsp;{ddlAlmacen.SelectedItem.Text}") Else
Dim UM = If(DdlUnidadMedida.SelectedValue = "-1", "", $"&emsp;<b>Unidad de Medida:</b>&nbsp;{DdlUnidadMedida.SelectedItem.Text}") ImprimirPDF("Empresas/Grales/Formatos/Kardex.rdlc", DtKardex, params, "Reporte Kardex", reporte)
Dim FechaIn As String = If(TxtFechaI.Text = "", "", $"&emsp;<b>Fecha Inicio:</b>&nbsp;{TxtFechaI.Text}") End If
Dim FechaFn As String = If(TxtFechaF.Text = "", "", $"&emsp;<b>Fecha Fin:</b>&nbsp;{TxtFechaF.Text}") DtKardex.Dispose()
Dim EntradaSalida As String = "" End If
If cbEntrada.Checked And cbSalida.Checked Then End Sub
EntradaSalida = "Entradas y Salidas" Private Sub ImgImprimir_Click(sender As Object, e As EventArgs) Handles ImgImprimir.Click
ElseIf cbEntrada.Checked And cbSalida.Checked = False Then GenerarPDF()
EntradaSalida = "Solo Entradas" End Sub
ElseIf cbEntrada.Checked = False And cbSalida.Checked Then Private Sub GenerarPDF(Optional Formato As String = "PDF")
EntradaSalida = "Solo Salidas" Dim Movimientos As New ClsInventarios
End If Dim CvePS As Integer = ddlProducto2.SelectedValue.ToEntero
Dim Entrada As Boolean = cbEntrada.Checked
Dim Salida As Boolean = cbSalida.Checked
If Movimientos.GetKardex(Entrada, Salida, CvePS, FechaI, FechaF, CveAlmacen, "1", DdlUnidadMedida.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, ChkAgruparAlmacen.Checked) Then
Dim FechaI As String = If(TxtFechaI.Text <> "" AndAlso TxtFechaI.Text <> "__/__/____", TxtFechaI.Text, "-1")
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) Dim FechaF As String = If(TxtFechaF.Text <> "" AndAlso TxtFechaF.Text <> "__/__/____", TxtFechaF.Text, "-1")
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) Dim CveAlmacen As Integer = ddlAlmacen.SelectedValue.ToEntero
Dim dt As DataTable = Movimientos.DtResultados
Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) Dim Almacen = If(ddlAlmacen.SelectedValue = "-1", "", $"&emsp;<b>Almacén:</b>&nbsp;{ddlAlmacen.SelectedItem.Text}")
params.Add(New ReportParameter("FechaInicio", FechaI)) Dim UM = If(DdlUnidadMedida.SelectedValue = "-1", "", $"&emsp;<b>Unidad de Medida:</b>&nbsp;{DdlUnidadMedida.SelectedItem.Text}")
params.Add(New ReportParameter("FechaFin", FechaF)) Dim FechaIn As String = If(TxtFechaI.Text = "", "", $"&emsp;<b>Fecha Inicio:</b>&nbsp;{TxtFechaI.Text}")
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)) Dim FechaFn As String = If(TxtFechaF.Text = "", "", $"&emsp;<b>Fecha Fin:</b>&nbsp;{TxtFechaF.Text}")
params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString)) Dim EntradaSalida As String = ""
params.Add(New ReportParameter("Producto", ddlProducto2.SelectedText))
params.Add(New ReportParameter("AgrupadoPor", $"<b>Agrupado Por:</b>&nbsp;{EntradaSalida}{Almacen}{UM}{FechaIn}{FechaFn}")) If cbEntrada.Checked And cbSalida.Checked Then
EntradaSalida = "&emsp;Entradas y Salidas"
If Imagen.Exists Then ElseIf cbEntrada.Checked And cbSalida.Checked = False Then
params.Add(New ReportParameter("LogoPath", logouri)) EntradaSalida = "&emsp;Solo Entradas"
Else ElseIf cbEntrada.Checked = False And cbSalida.Checked Then
params.Add(New ReportParameter("LogoPath", "")) EntradaSalida = "&emsp;Solo Salidas"
End If End If
ImprimirPDF("Empresas/Grales/Formatos/RepKardex.rdlc", dt, params, "ReporteKardex", Formato)
Else Dim Serie As String = If(TxtSerie.Text <> "", TxtSerie.Text, "-1")
Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia)
End If Dim SerieAgrupado As String = If(TxtSerie.Text = "", "", $"<b>Existencia y costos calculada por numero de serie:</b>&nbsp;{TxtSerie.Text} ")
End Sub If Movimientos.GetKardex(Entrada, Salida, CvePS, FechaI, FechaF, CveAlmacen, "1", DdlUnidadMedida.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, ChkAgruparAlmacen.Checked, Serie) Then
#End Region
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
#Region "EDITAR FECHA" Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
Dim dt As DataTable = Movimientos.DtResultados
Protected Sub LnkEditarFecha_Click(sender As Object, e As EventArgs) Dim params As New List(Of ReportParameter)
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow) params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
CveMovimiento = gvRow.DataKey("CveMovimiento").ToEntero params.Add(New ReportParameter("FechaInicio", FechaI))
TxtFecha.Text = gvRow.DataKey("FechaMovto").ToDateTime.ToString("yyyy-MM-ddTHH:mm") params.Add(New ReportParameter("FechaFin", FechaF))
RegistraScript("$('#DModalEditarFecha').modal()") params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
UpModalEditarFecha.Update() params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
End Sub params.Add(New ReportParameter("Producto", ddlProducto2.SelectedText))
params.Add(New ReportParameter("AgrupadoPor", $"<b>Agrupado Por:</b>&nbsp;{SerieAgrupado}{EntradaSalida}{Almacen}{UM}{FechaIn}{FechaFn}"))
Protected Sub BtnEditarFecha_Click(sender As Object, e As EventArgs) If Imagen.Exists Then
Dim ObjMov As New ClsMovimientos params.Add(New ReportParameter("LogoPath", logouri))
If ObjMov.UpdateMovimientoFecha(TxtFecha.Text.ToDateTime, CveMovimiento) Then Else
Alert("Actualizada correctamente a : " + TxtFecha.Text.ToDateTime.ToString("yyyy-MM-dd HH:mm")) params.Add(New ReportParameter("LogoPath", ""))
RegistraScript("$('#DModalEditarFecha').modal('hide')") End If
CargaDatos() ImprimirPDF("Empresas/Grales/Formatos/RepKardex.rdlc", dt, params, "ReporteKardex", Formato)
UPDatos.Update() Else
End If Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia)
ObjMov.Dispose() End If
End Sub
End Sub
#End Region #End Region
#Region "EDITAR FECHA"
End Class
Protected Sub LnkEditarFecha_Click(sender As Object, e As EventArgs)
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
CveMovimiento = gvRow.DataKey("CveMovimiento").ToEntero
TxtFecha.Text = gvRow.DataKey("FechaMovto").ToDateTime.ToString("yyyy-MM-ddTHH:mm")
RegistraScript("$('#DModalEditarFecha').modal()")
UpModalEditarFecha.Update()
End Sub
Protected Sub BtnEditarFecha_Click(sender As Object, e As EventArgs)
Dim ObjMov As New ClsMovimientos
If ObjMov.UpdateMovimientoFecha(TxtFecha.Text.ToDateTime, CveMovimiento) Then
Alert("Actualizada correctamente a : " + TxtFecha.Text.ToDateTime.ToString("yyyy-MM-dd HH:mm"))
RegistraScript("$('#DModalEditarFecha').modal('hide')")
CargaDatos()
UPDatos.Update()
End If
ObjMov.Dispose()
End Sub
#End Region
End Class

File diff suppressed because one or more lines are too long

View File

@@ -4228,21 +4228,7 @@ Partial Class Ventas
End If End If
End If End If
'ACTIVA BOTONERA | SI SON SERVICIOS DEBE PERMITIR FACTURAR End If
If TmpDT.MAX("CveTipoPS") = "1" Then
BtnsFacturar.Visible = True
'ACTIVA CONVERSION DE MONEDA
If DdlMoneda.SelectedValue.ToEntero = 1 Then
TrConversionDolares.Visible = True
ChkConvertirDolares.Enabled = True
TxtTipoCambioDlls.Enabled = True
Else
TrConversionTipoCambio.Visible = True
ChkConvertirDoctoPesos.Enabled = True
TxtTipoCambio.Enabled = True
End If
End If
'Si es Empresa de Acumuladores 'Si es Empresa de Acumuladores
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then