diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index e43dd1307..c2a581513 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -1530,13 +1530,14 @@ Public Class ClsInventarios Return Retorno End Function - Public Function GetRepResumenMovimientosDiario(Fecha As Date, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + Public Function GetRepResumenMovimientosDiario(Fecha As Date, CveUsuario As Integer, CveEmpresa As Integer, CveAlmacen As Integer) As Boolean Dim retorno As Boolean = False DataAdapter("PA_Inv_RepResumenMovimientosDiarioGet", CommandType.StoredProcedure) With SqlAdapter.SelectCommand.Parameters .Add("@Fecha", SqlDbType.Date).Value = Fecha .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen End With Try SqlAdapter.Fill(Data) diff --git a/App_Code/ClsOC.vb b/App_Code/ClsOC.vb index 5e6cc5b5c..1314f0721 100644 --- a/App_Code/ClsOC.vb +++ b/App_Code/ClsOC.vb @@ -715,7 +715,7 @@ Public Class ClsOC Optional PorcentajeIVA As Decimal = 0.16D, Optional IVA As Decimal = 0, Optional RetIVA As Decimal = 0, Optional RetISR As Decimal = 0, Optional FechaExpiracion As Date = Nothing, Optional CveCotizacion As Integer = -1, Optional FolioAdicional As String = "", Optional EntregaDirecta As Integer = -1, Optional CveDireccionEnvio As Integer = -1, Optional Guia As String = "-1", Optional IEPS As Decimal = -1, Optional CveIEAnticipo As Integer = -1, Optional ImporteAnticipo As Decimal = 0, Optional UsoCFDI As Integer = -1, Optional Promocion As String = "-1", Optional CveProveedorContacto As Integer = -1, Optional NumRemision As String = "-1", - Optional CveColectiva As Integer = -1, Optional MetodoPago As Integer = -1, Optional CveSubProyectoEntrega As Integer = -1, Optional PorcentajeProntoPago As Decimal = 0) As Boolean + Optional CveColectiva As Integer = -1, Optional MetodoPago As Integer = -1, Optional CveSubProyectoEntrega As Integer = -1, Optional PorcentajeProntoPago As Decimal = 0, Optional EsTemporal As Boolean = False) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_OC_OrdenesCompraAdd") @@ -763,6 +763,8 @@ Public Class ClsOC .Add("@MetodoPago", SqlDbType.Int).Value = MetodoPago ' 0 Contado, 1 Credito .Add("@CveSubProyectoEntrega", SqlDbType.Int).Value = CveSubProyectoEntrega ' 0 Contado, 1 Credito .Add("@PorcentajeProntoPago", SqlDbType.Decimal).Value = PorcentajeProntoPago + .Add("@EsTemporal", SqlDbType.Bit).Value = EsTemporal + .Add("@vCveOrdenCompra", SqlDbType.Int).Direction = ParameterDirection.Output .Add("@vFolio", SqlDbType.Int).Direction = ParameterDirection.Output diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index c01821bed..99877e120 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -4599,12 +4599,14 @@ Public Class ClsVentas Public Function GetRepPSPeriodo(FechaI As Date, FechaF As Date, FechaIEjec As Date, FechaFEjec As Date, CveCliente As Integer, CveSubProyectoEjecucion As Integer, - CveVendedor As Integer, CveUsuario As Integer, CveEstatus As Integer, IVA As String, CveEmpresa As Integer, Gpo As Integer, Optional TipoDocto As String = "-1", - Optional CveProyecto As Integer = -1, Optional CveSubProyecto As Integer = -1, Optional TipoCambio As Integer = 1, Optional TCEspecifico As Decimal = -1, - Optional CveUsuarioConsulta As Integer = -1, Optional VerEn As Integer = -1, Optional CvePS As Integer = -1, Optional CveClasificacion As Integer = -1, - Optional CveCategoria As Integer = -1, Optional TipoFecha As Integer = 1, Optional CveClienteClasificacion As Integer = -1, Optional ModalidadContable As Boolean = False) As Boolean + CveVendedor As Integer, CveUsuario As Integer, CveEstatus As Integer, IVA As String, CveEmpresa As Integer, Gpo As Integer, Optional TipoDocto As String = "-1", + Optional CveProyecto As Integer = -1, Optional CveSubProyecto As Integer = -1, Optional TipoCambio As Integer = 1, Optional TCEspecifico As Decimal = -1, + Optional CveUsuarioConsulta As Integer = -1, Optional VerEn As Integer = -1, Optional CvePS As Integer = -1, Optional CveClasificacion As Integer = -1, + Optional CveCategoria As Integer = -1, Optional TipoFecha As Integer = 1, Optional CveClienteClasificacion As Integer = -1, Optional ModalidadContable As Boolean = False, + Optional OpVista As Integer = 1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_VentasGetRepPeriodoPS") + SqlAdapter.SelectCommand.CommandTimeout = 0 With SqlAdapter.SelectCommand.Parameters '.Add("@CveVenta", SqlDbType.Int).Value = CveVenta .Add("@FechaI", SqlDbType.Date).Value = FechaI @@ -4632,6 +4634,7 @@ Public Class ClsVentas .Add("@TipoFecha", SqlDbType.Int).Value = TipoFecha .Add("@CveClienteClasificacion", SqlDbType.Int).Value = CveClienteClasificacion .Add("@ModalidadContable", SqlDbType.Bit).Value = ModalidadContable + .Add("@OpVista", SqlDbType.Int).Value = OpVista End With Try SqlAdapter.Fill(Data) diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 0591bf004..e1f8ef44c 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -7395,6 +7395,7 @@ Partial Class Compras_Compras End If End If + Pago.OtroGastoIngreso = -ImporComisionAnticipo ErrorPrepoliza = AplicaPrePolizaPagoCompra(CompraActual, Pago, CvePrePoliza, ObjConta) diff --git a/Contabilidad/RepBalanzaComprobacion.aspx b/Contabilidad/RepBalanzaComprobacion.aspx index 49604813d..3cec952cb 100644 --- a/Contabilidad/RepBalanzaComprobacion.aspx +++ b/Contabilidad/RepBalanzaComprobacion.aspx @@ -155,6 +155,12 @@ + + + + + + diff --git a/Contabilidad/RepBalanzaComprobacion.aspx.vb b/Contabilidad/RepBalanzaComprobacion.aspx.vb index f8e63ff9c..ed2233a4c 100644 --- a/Contabilidad/RepBalanzaComprobacion.aspx.vb +++ b/Contabilidad/RepBalanzaComprobacion.aspx.vb @@ -155,10 +155,13 @@ Partial Class Contabilidad2_RepBalanzaComprobacion Alert("Ocurrio un error al cargar los datos del Anexo del Catálogo", TipoMensaje.MsgError) End If ObjConta.Dispose() + If DdlVista.SelectedValue = "1" Then - GvDatos.Columns(6).Visible = True + GvDatos.Columns(7).Visible = True + GvDatos.Columns(0).Visible = True Else - GvDatos.Columns(6).Visible = False + GvDatos.Columns(7).Visible = False + GvDatos.Columns(0).Visible = False End If CargaGrid() @@ -220,7 +223,7 @@ Partial Class Contabilidad2_RepBalanzaComprobacion e.Row.FCLabel("LbSaldoActual").Visible = True e.Row.FCLabel("LbSaldoActual").Text = String.Format("{0}
{1}", e.Row.DBCampo("SaldoAD").FormatoNumero, e.Row.DBCampo("SaldoAA").FormatoNumero) Else - If ModoImpresion Then e.Row.Cells(5).Text = e.Row.FCHyperLink("HLSaldoActual").Text Else e.Row.FCHyperLink("HLSaldoActual").NavigateUrl = String.Format("/Contabilidad/RepMovimientosAuxiliaresCatalogo.aspx?CveCuenta={0}&FI={1}&FF={2}&CveProyecto={3}&CveSubProyecto={4}", e.Row.DBCampo("ID"), FechaInicio.ToShortDateString, FechaFin.ToShortDateString, CveProyecto, CveSubProyecto) + If ModoImpresion Then e.Row.Cells(6).Text = e.Row.FCHyperLink("HLSaldoActual").Text Else e.Row.FCHyperLink("HLSaldoActual").NavigateUrl = String.Format("/Contabilidad/RepMovimientosAuxiliaresCatalogo.aspx?CveCuenta={0}&FI={1}&FF={2}&CveProyecto={3}&CveSubProyecto={4}", e.Row.DBCampo("ID"), FechaInicio.ToShortDateString, FechaFin.ToShortDateString, CveProyecto, CveSubProyecto) End If End If End Sub @@ -247,8 +250,14 @@ Partial Class Contabilidad2_RepBalanzaComprobacion End Sub Private Sub ImprimirReporte(Optional Formato As String = "PDF") + + Dim reportpath As String = "Contabilidad/Reportes/RepBalanzaComprobacion.rdlc" 'Contable + 'ubicacion del rdlc - Dim reportpath As String = "Contabilidad/Reportes/RepBalanzaComprobacion.rdlc" + If DdlVista.SelectedValue.ToEntero = 1 Then 'SAT + reportpath = "Contabilidad/Reportes/RepBalanzaComprobacionSAT.rdlc" 'Contable + End If + 'nombre del reporte Dim fileName As String = "BalanzaComprobacion" 'parametros a enviar al reporte @@ -273,6 +282,12 @@ Partial Class Contabilidad2_RepBalanzaComprobacion Function WSDocumento(SubProyecto As String, DtDatos As DataTable) As IXLWorksheet + Dim ColumnaAumento As Integer = 0 + + If DdlVista.SelectedValue.ToEntero = 1 Then + ColumnaAumento = 1 + End If + Dim WBAnexoSalvar = New ClosedXML.Excel.XLWorkbook Dim WBReporte = New ClosedXML.Excel.XLWorkbook() diff --git a/Contabilidad/Reportes/RepBalanzaComprobacionSAT.rdlc b/Contabilidad/Reportes/RepBalanzaComprobacionSAT.rdlc new file mode 100644 index 000000000..e1b1315b6 --- /dev/null +++ b/Contabilidad/Reportes/RepBalanzaComprobacionSAT.rdlc @@ -0,0 +1,1849 @@ + + + 0 + + + + System.Data.DataSet + /* Local Connection */ + + c1c71852-6fe8-4864-a742-cae14c1bf38d + + + + + + DataSet + /* Local Query */ + + + + Id + System.String + + + Nombre + System.String + + + Tipo + System.String + + + CveTipo + System.Int16 + + + CtaMayor + System.Int16 + + + Nivel + System.Int16 + + + Clasificacion + System.String + + + Sup + System.String + + + Orden + System.String + + + SaldoInicial + System.Int16 + + + SaldoActual + System.Int16 + + + Cargos + System.Int16 + + + Abonos + System.Int16 + + + Codigo + System.String + + + SaldoID + System.Int16 + + + SaldoIA + System.Int16 + + + TotalCargos + System.Int16 + + + TotalAbonos + System.Int16 + + + SaldoAD + System.Int16 + + + SaldoAA + System.Int16 + + + + DataSet + C:\Users\Caudillo\Documents\Visual Studio 2013\WebSites\WebSite3\App_Code\DataSet.xsd + DataTable1 + + + + + + + + + + + + + + true + true + + + + + =Parameters!pEmp.Value + + + + + + + Textbox1 + 0.98806cm + 20.2388cm + + + 2pt + 2pt + 2pt + 2pt + + + + External + = Parameters!pImg.Value + Fit + 1.98547cm + 3.43894cm + 1 + + + + + + true + true + + + + + Balanza de Comprobación del + + + + =Parameters!pFechaIni.Value + + + + al + + + + =Parameters!pFechaFin.Value + + + + + + + Textbox5 + 0.98806cm + 0.99741cm + 20.2388cm + 2 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + 1.19062cm + + + 2.24832cm + + + 6.04544cm + + + 2.87929cm + + + 2.5cm + + + 2.5cm + + + 2.87513cm + + + + + 0.6cm + + + + + true + true + + + + + + + + + + + + Textbox18 + + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox2 + + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox4 + + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Saldos Iniciales + + + + + + + Textbox7 + + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox9 + + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox10 + + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Saldos Actuales + + + + + + + Textbox11 + + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + Nivel + + + + + + + Textbox19 + + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Cuenta + + + + + + + Textbox13 + + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Nombre + + + + + + + Textbox15 + + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Deudor Acreedor + + + + + + + Textbox17 + + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Cargos + + + + + + + Textbox21 + + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Abonos + + + + + + + Textbox23 + + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Deudor Acreedor + + + + + + + Textbox25 + + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.45cm + + + + + true + true + + + + + =Fields!Nivel.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Codigo.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + =Fields!Nombre.Value + + + + + + 2pt + 2pt + 2pt + 2pt + Horizontal + + + + + + + + true + true + + + + + =Fields!SaldoInicial.Value + + + + + + + SaldoInicial + + + 2pt + =Iif(Fields!CveTipo.Value=1,"17pt","2pt") + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Cargos.Value + + + + + + + Cargos1 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Abonos.Value + + + + + + + Abonos + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!SaldoActual.Value + + + + + + + SaldoActual + + + 2pt + =Iif(Fields!CveTipo.Value=1,"17pt","2pt") + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Sumas Iguales + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Last(Fields!SaldoID.Value) + + + + + + + SaldoID + + + 2pt + 17pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Last(Fields!TotalAbonos.Value) + + + + + + + TotalAbonos + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Last(Fields!TotalCargos.Value) + + + + + + + TotalCargos + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Last(Fields!SaldoAD.Value) + + + + + + + SaldoAD + + + 2pt + 17pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Last(Fields!SaldoIA.Value) + + + + + + + SaldoIA + + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox33 + + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox34 + + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Last(Fields!SaldoAA.Value) + + + + + + + SaldoAA + + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + + + After + true + + + After + true + + + + + + Before + + + Before + + + + true + DataSet1 + 2.04159cm + 2.85cm + 20.2388cm + 3 + + + + + + true + 5.50443cm + 20.2388cm + + + + + + 2.1671in + + + + =Parameters!pFechaIni.Value + + + + al + + + + =Parameters!pFechaFin.Value + + + + + + + Textbox5 + 0.6cm + 20.2388cm + + = (Globals.PageNumber=1) + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + 0.6cm + true + true + + + true + true + + + + + ="Página " & Globals.PageNumber & " de " & Globals.TotalPages + + + + + + + Textbox3 + 0cm + 14.86367cm + 0.6cm + 5.37513cm + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + ="Fecha Impresión:" & vbCrLf & DateTime.Now.ToString("dd/MM/yyyy HH:mmm") + + + + + + + Textbox8 + 0cm + 0.6cm + 3.43894cm + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + ="Usuario Imprimio: " & Parameters!UsuarioImprimio.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 29.7cm + 21cm + 0.25cm + 0.25cm + 0.5cm + 1cm + 0.13cm + - - - - - - - - Folio fiscal: - - - - =Parameters!FolioFiscal.Value - - - - - - - =Parameters!FechaCertificacion.Value - - - - Número de serie del Certificado de Sello Digital: - - - - =Parameters!CertificadoContribuyente.Value - - - - - - - =Parameters!SerieCertificadoSAT.Value - - - - - - - - - - - - - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - External - =Parameters!QR.Value - FitProportional - 0.0444in - 6.56374in - 1.13974in - 1.53682in - 1 - - - - - - true - 3.53788in - 0.03589in - 1.21305in - 8.22763in - - - - - - true - true - - - - - Domicilio fiscal: - - - - - - - - - - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - - - - - TIPO DE DOCUMENTO: - - - - =Parameters!Tipo.Value - - - - - - - - - - - - - Serie: - - - - =Parameters!Serie.Value - - - - Folio: - - - - =Parameters!Folio.Value - - - - - - - - - Fecha: - - - - - - - - = Parameters!Fecha.Value - - - - - - - - - Régimen fiscal: - - - - Regimen General de Ley Personas Morales - - - - - - - - - - - Textbox4 - 0.05022in - 4.90719in - 1.00267in - 3.35633in - 2 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - 0.54927in - - - 1.05064in - - - 0.98425in - - - 1.11327in - - - 4.57762in - - - - - 0.19645in - - - - - true - true - - - - - CANT - - - - - - - Textbox22 - - - #008204 - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - UNIDAD - - - - - - #008204 - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - CÓDIGO - - - - - - #008204 - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - CLAVE SAT - - - - - - - Textbox29 - - - #008204 - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - DESCRIPCIÓN - - - - - - - Textbox17 - - - #008204 - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.14436in - - - - - true - true - - - - - =Fields!Cantidad.Value - - - - - - - Cantidad1 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!UM.Value - - - - - - - UM - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Noidentificacion.Value - - - - - - - Noidentificacion - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!SATClaveProdServ.Value - - - - - - - SATClaveProdServ - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!PS.Value & " " & Fields!Obs.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - - - After - - - - - - - DsOC - 2.25503in - 0.04048in - 0.34081in - 8.27505in - 3 - - - - - - true - true - - - - - - - - #008204 - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - - - - #008204 - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - - - - #008204 - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!Observaciones.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - Embedded - jam3 - FitProportional - 0.13104cm - 0.08425cm - 2.5433cm - 4.13cm - 8 - - - - - - true - true - - - - - Almacén Origen: - - - - =Parameters!AlmOrigen.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Almacén Destino: - - - - =Parameters!AlmDestino.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!DireccionOrigen.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!DireccionDestino.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - 12.81558cm - - - - - 21.12145cm - - - 0.63499cm - true - true - - - true - true - - - - - Fecha Impresión: - - - - =Parameters!FechaImpresion.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - ="Página " & Globals.PageNumber & " de " & Globals.TotalPages - - - - - - - Textbox35 - 0.11289cm - 18.37079cm - 0.41981cm - 2.5cm - 1 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - 27.94cm - 21.59cm - 0cm - 0cm - 0.5cm - 0.5cm - 1.27cm - + + + + + + + + Folio fiscal: + + + + =Parameters!FolioFiscal.Value + + + + + + + =Parameters!FechaCertificacion.Value + + + + Número de serie del Certificado de Sello Digital: + + + + =Parameters!CertificadoContribuyente.Value + + + + + + + =Parameters!SerieCertificadoSAT.Value + + + + + + + + + + + + + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + External + =Parameters!QR.Value + FitProportional + 0.0444in + 6.56374in + 1.13974in + 1.53682in + 1 + + + + + + true + 3.53788in + 0.03589in + 1.21305in + 8.22763in + + + + + + true + true + + + + + Domicilio fiscal: + + + + + + + + + + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + + + + + TIPO DE DOCUMENTO: + + + + =Parameters!Tipo.Value + + + + + + + + + + + + + Serie: + + + + =Parameters!Serie.Value + + + + Folio: + + + + =Parameters!Folio.Value + + + + + + + + + Fecha: + + + + + + + + = Parameters!Fecha.Value + + + + + + + + + Régimen fiscal: + + + + Regimen General de Ley Personas Morales + + + + + + + + + + + Textbox4 + 0.05022in + 4.90719in + 1.00267in + 3.35633in + 2 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + 0.54927in + + + 1.05064in + + + 0.98425in + + + 1.11327in + + + 4.57762in + + + + + 0.19645in + + + + + true + true + + + + + CANT + + + + + + + Textbox22 + + + #008204 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + UNIDAD + + + + + + #008204 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + CÓDIGO + + + + + + #008204 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + CLAVE SAT + + + + + + + Textbox29 + + + #008204 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + DESCRIPCIÓN + + + + + + + Textbox17 + + + #008204 + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.14436in + + + + + true + true + + + + + =Fields!Cantidad.Value + + + + + + + Cantidad1 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!UM.Value + + + + + + + UM + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Noidentificacion.Value + + + + + + + Noidentificacion + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!SATClaveProdServ.Value + + + + + + + SATClaveProdServ + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!PS.Value & " " & Fields!Obs.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + After + + + + + + + DsOC + 2.25503in + 0.04048in + 0.34081in + 8.27505in + 3 + + + + + + true + true + + + + + + + + #008204 + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + + + + #008204 + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + + + + #008204 + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Observaciones.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + Embedded + jam3 + FitProportional + 0.13104cm + 0.08425cm + 2.5433cm + 4.13cm + 8 + + + + + + true + true + + + + + Almacén Origen: + + + + =Parameters!AlmOrigen.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Almacén Destino: + + + + =Parameters!AlmDestino.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!DireccionOrigen.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!DireccionDestino.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + 12.81558cm + + + + + 21.12145cm + + + 0.63499cm + true + true + + + true + true + + + + + Fecha Impresión: + + + + =Parameters!FechaImpresion.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + ="Página " & Globals.PageNumber & " de " & Globals.TotalPages + + + + + + + Textbox35 + 0.11289cm + 18.37079cm + 0.41981cm + 2.5cm + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 27.94cm + 21.59cm + 0cm + 0cm + 0.5cm + 0.5cm + 1.27cm + @@ -446,7 +449,7 @@ Capturó: - + @@ -492,15 +495,25 @@ + + + - + %Desc. Pronto Pago: + + + + + + + diff --git a/OC/OC.aspx.vb b/OC/OC.aspx.vb index 81e15d68b..1e98a49a1 100644 --- a/OC/OC.aspx.vb +++ b/OC/OC.aspx.vb @@ -7,7 +7,7 @@ Imports System.IO Imports Extensiones Imports GemBox.Spreadsheet Imports Newtonsoft.Json -Imports Telerik.Web.Apoc + Partial Class OC_OC Inherits ClsPaginas @@ -657,6 +657,19 @@ Partial Class OC_OC End Set End Property + Private Property EsGrupoDiaz As Boolean + Get + If ViewState("EsGrupoDiaz") Is Nothing Then + ViewState("EsGrupoDiaz") = False + End If + + Return Boolean.Parse(ViewState("EsGrupoDiaz").ToString) + End Get + Set(value As Boolean) + ViewState("EsGrupoDiaz") = value + End Set + End Property + #End Region Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load @@ -664,7 +677,11 @@ Partial Class OC_OC If Not Page.IsPostBack Then GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa) = Nothing NotificacionCorreo = True - If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then NotificacionCorreo = False + + If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then + NotificacionCorreo = False + EsGrupoDiaz = True + End If CargaDatosAgregarPS() CveProveedorOriginal = -1 @@ -1031,20 +1048,21 @@ Partial Class OC_OC End If End If - If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then + If EsGrupoDiaz Then chkSubProyectoEntrega.Visible = True LblPrioridad.Text = "Sucursal" DdlPrioridad.Visible = False DdlSubProyectoGral.Visible = True TrDescuentoEscalonado.Visible = True TrDescuentoProntoPago.Visible = True + TrBotonesInvTemporal.Visible = True End If If UsuarioActual.Empresa.CveEmpresa = 189 AndAlso CveOrdenCompra <> Nothing AndAlso CveOrdenCompra > 0 Then BtnEdicionMasiva.Visible = True End If - If CveOrdenCompra > 0 AndAlso UsuarioActual.Empresa.Funcionalidad(382) = "1" OrElse UsuarioActual.CveRol = 1 Then + If CveOrdenCompra > 0 AndAlso EsGrupoDiaz OrElse UsuarioActual.CveRol = 1 Then LnkDescargarPSExcel.Visible = True End If @@ -1056,7 +1074,7 @@ Partial Class OC_OC If CveOrdenCompra > 0 Then GvD.Columns(20).Visible = False Else - If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then + If EsGrupoDiaz Then TxtCant.Text = "1" TxtCant.Focus() RegistraScript("abrirDdlPS();", "A1") @@ -2032,7 +2050,7 @@ Partial Class OC_OC objOC.Dispose() GvVentaRelacionadas.DataBind() - If TieneInventario Then + If TieneInventario Or EsGrupoDiaz Then 'CARGA MOVTOS DE ALMACEN InicializaMovtosAlmacen() End If @@ -2377,7 +2395,7 @@ Partial Class OC_OC End If End If - If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then + If EsGrupoDiaz Then txtPrecioUnitario.Focus() UPPDetalle.Update() End If @@ -2918,7 +2936,7 @@ Partial Class OC_OC RequiereCotizacion:=ChkCotizacion.Checked, CveCliente:=Ddlcliente.txtValue.Value.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, PrioridadObservacion:=txtobsprioridad.Text, PorcentajeIVA:=Math.Round(DdlIVA.SelectedValue.ToDecimal - 1, 2), IVA:=IVA, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, CveCotizacion:=CveCotizacion, FolioAdicional:=TxtFolioAdicional.Text, EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1), CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1), Guia:=TxtGuia.Text.Trim, IEPS:=TxtIEPS.Text.ToDecimal, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero, Promocion:=Promocion, CveProveedorContacto:=CveProveedorContacto, NumRemision:=TxtNumRemision.Text.Trim(), MetodoPago:=DdlMetodoPago.SelectedValue.ToEntero(), - CveSubProyectoEntrega:=DdlSubProyectoEntrega.SelectedValue.ToEntero, PorcentajeProntoPago:=PorcentajeProntoPago) Then + CveSubProyectoEntrega:=DdlSubProyectoEntrega.SelectedValue.ToEntero, PorcentajeProntoPago:=PorcentajeProntoPago, EsTemporal:=ChkEsTemporal.Checked) Then CveOrdenCompraPadre = OC.CveOrdenCompra If CveOrdenCompraPadre > 0 Then @@ -2965,7 +2983,7 @@ Partial Class OC_OC PorcentajeIVA:=Math.Round(DdlIVA.SelectedValue.ToDecimal - 1, 2), IVA:=IVA, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, CveCotizacion:=CveCotizacion, FolioAdicional:=TxtFolioAdicional.Text, EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1), CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1), Guia:=TxtGuia.Text.Trim, IEPS:=TxtIEPS.Text.ToDecimal, CveIEAnticipo:=CveIEAnticipo, ImporteAnticipo:=ImporteAnticipos, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero, Promocion:=Promocion, CveProveedorContacto:=CveProveedorContacto, NumRemision:=TxtNumRemision.Text, MetodoPago:=DdlMetodoPago.SelectedValue.ToEntero(), CveSubProyectoEntrega:=DdlSubProyectoEntrega.SelectedValue.ToEntero, - PorcentajeProntoPago:=PorcentajeProntoPago) Then + PorcentajeProntoPago:=PorcentajeProntoPago, EsTemporal:=ChkEsTemporal.Checked) Then CveOrdenCompra = OC.CveOrdenCompra CveEstatus = CboE.SelectedValue.ToEntero @@ -3061,6 +3079,8 @@ Partial Class OC_OC End If + + If Not TieneError Then If Conta IsNot Nothing Then Conta.Commit() OC.Commit() @@ -3635,7 +3655,7 @@ Partial Class OC_OC PorcentajeIVA:=PorIVA, IVA:=IVACot, RetIVA:=RetIVA.ToString.ToDecimal, RetISR:=RetISR.ToString.ToDecimal, IDPoliza:=IdPoliza, CveCotizacion:=CveCotizacion, FolioAdicional:=TxtFolioAdicional.Text, EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1), CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1), IEPS:=TxtIEPS.Text.ToDecimal, CveIEAnticipo:=CveIEAnticipo, ImporteAnticipo:=ImporteAnticipos, Promocion:=Promocion, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero, NumRemision:=TxtNumRemision.Text.Trim, MetodoPago:=DdlMetodoPago.SelectedValue.ToEntero(), - CveSubProyectoEntrega:=DdlSubProyectoEntrega.SelectedValue.ToEntero, PorcentajeProntoPago:=PorcentajeProntoPago) Then + CveSubProyectoEntrega:=DdlSubProyectoEntrega.SelectedValue.ToEntero, PorcentajeProntoPago:=PorcentajeProntoPago, EsTemporal:=ChkEsTemporal.Checked) Then 'CREA POLIZA POR CADA PROVEEDOR @@ -3717,7 +3737,9 @@ Partial Class OC_OC CveUsuario, CveEmpresaActual, 0, pCveProveedor:=DdlProveedores.SelectedValue.ToEntero, pCveProveedorSucursal:=DdlProveedorSucursal.SelectedValue.ToEntero, CveUsuarioAsignado:=DdlUsuariosAsignado.SelectedValue.ToEntero(), CveCliente:=Ddlcliente.txtValue.Value.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, PrioridadObservacion:=txtobsprioridad.Text, PorcentajeIVA:=Math.Round(DdlIVA.SelectedValue.ToDecimal - 1, 2), IVA:=IVA, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, IDPoliza:=IDPolizaPresupuestal, CveCotizacion:=CveCotizacion, FolioAdicional:=TxtFolioAdicional.Text, EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1), CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1), IEPS:=TxtIEPS.Text.ToDecimal, CveIEAnticipo:=CveIEAnticipo, ImporteAnticipo:=ImporteAnticipos, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero, - Promocion:=Promocion, NumRemision:=TxtNumRemision.Text.Trim, MetodoPago:=DdlMetodoPago.SelectedValue.ToEntero(), CveSubProyectoEntrega:=DdlSubProyectoEntrega.SelectedValue.ToEntero, PorcentajeProntoPago:=PorcentajeProntoPago) Then + Promocion:=Promocion, NumRemision:=TxtNumRemision.Text.Trim, MetodoPago:=DdlMetodoPago.SelectedValue.ToEntero(), CveSubProyectoEntrega:=DdlSubProyectoEntrega.SelectedValue.ToEntero, PorcentajeProntoPago:=PorcentajeProntoPago, + EsTemporal:=ChkEsTemporal.Checked) Then + 'USA AC @@ -7497,7 +7519,9 @@ Partial Class OC_OC Dim ObjInventarios As New ClsInventarios If ObjInventarios.GetMovimientosOC(CveOrdenCompra, CveEmpresaActual) Then + TabAlmacen.Visible = True + If ObjInventarios.DtResultados.Rows.Count > 0 Then GVInv.DataSource = ObjInventarios.DtResultados If ObjInventarios.DtResultados.Rows.Count > 0 Then @@ -7508,6 +7532,10 @@ Partial Class OC_OC LnkCambiarMoneda.Visible = True End If End If + Else + If EsGrupoDiaz Then + TabAlmacen.Visible = False + End If End If End If @@ -9698,6 +9726,248 @@ Partial Class OC_OC FileExcel.Save(Response, $"OC_{CveOrdenCompra}.xlsx", SaveOptions.XlsxDefault) End Sub + + Function RegistroInventarioTemporal(ByRef transaccion As SqlTransaction, CveOCInv As Integer, CveConceptoInv As Integer) As Boolean + + + + Dim Respuesta As Boolean = True + + Dim ObjOC As New ClsOC(transaccion) + Dim DTDetalleOC As New DataTable + + If ObjOC.GetOrdenesDetalle(CveOCInv, UsuarioActual.CveEmpresa) Then + DTDetalleOC = ObjOC.DtResultados.FiltraParametros(" CveTipoPS = 2 ") + + If DTDetalleOC.Rows.Count = 0 Then 'No hay PSs Tipo Producto + Return True + End If + + Else + Return False + End If + + Dim tCveSubProyecto As Integer = UsuarioActual.CveSubProyecto + If ModalidadSubProyectoGeneral Then tCveSubProyecto = DdlSubProyectoGral.SelectedValue.ToEntero + + If tCveSubProyecto <= 0 Then + tCveSubProyecto = GetCveSubProyectoDetalles() + End If + + If tCveSubProyecto <= 0 Then + Alert("Sub Proyecto no asignado.") + Return False + End If + + Dim CveAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $" CveSubProyecto = {tCveSubProyecto} AND CveTipoAlmacen = 1 ").ToEntero + + If CveAlmacen <= 0 Then + Alert("Almacén no asignado.") + Return False + End If + + + Dim ObjConta As New ClsContabilidad(transaccion) + Dim ObjInventario As New ClsInventarios(transaccion) + + + 'Dim CveConceptoInv As Integer = If(TipoTermino = 1, 3, 2) + + Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Inv/OC", 53, 0, 0, 1, TxtFecha.Text.Replace(",", "").ToDate, TxtDescrip.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=3) + + Dim CveMovimiento As Integer = ObjInventario.AddMovimiento(CveAlmacen, CveConceptoInv, 1, NowADS, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, tCveSubProyecto, -1, Observaciones:=TxtDescrip.Text, Modulo:="OC/1") + Dim FolioMto As Integer = ObjInventario.Folio + + If CveMovimiento <= 0 OrElse CvePrePoliza <= 0 Then + Alert("No se pudo almacenar el movimiento correctamente", TipoMensaje.MsgError) + ObjInventario.RollBack() 'deshace lo insertado + Else + + Dim Mensaje As String = "" + + ''VALIDA EXISTENCIAS + Dim Cont As Integer = 0 + If CveConceptoInv = 3 Then + + For Each Dr As DataRow In DTDetalleOC.Rows + 'Dim FechaCaducidadVal As Date = If(Dr("AplicaCaducidad").ToString = "True", Dr("FechaCaducidad").ToString.ToDate, MinFecha) + Dim FechaMovtoExistenciaStr As String = $"{NowADS.ToString("yyyy/MM/dd")} {NowADS.ToString("HH:mm")}" + + If ObjInventario.GetExistenciasPS(Dr("CvePS").ToString.ToEntero, Dr("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, CveAlmacen, FechaMovto:=FechaMovtoExistenciaStr) >= Dr("Cantidad").ToString.ToDouble Then + If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, -1, Observaciones:=Dr("Descripcion").ToString, CveUsuarioModifico:=UsuarioActual.CveUsuario, CveOrdenCompraDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero) Then + Mensaje = "Error al guardar los movimientos" + Respuesta = False + Exit For + End If + Else + + If UsuarioActual.TienePermisoProceso(114) Then + If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, -1, Observaciones:=Dr("Descripcion").ToString, CveUsuarioModifico:=UsuarioActual.CveUsuario, CveOrdenCompraDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero) Then + Mensaje = "Error al guardar los movimientos" + Respuesta = False + Exit For + End If + Else + Mensaje = String.Format("No hay existencias suficientes del producto: {0}", Dr("PS")) + Alert(Mensaje, TipoMensaje.MsgAdvertencia) + Respuesta = False + Exit For + End If + + End If + Cont += 1 + Next + + Else + For Each Dr As DataRow In DTDetalleOC.Rows + + Dim ImporteConcepto As Decimal = 0 + + If CveConceptoInv = 2 AndAlso DdlMoneda.SelectedValue.ToEntero = 2 Then + ImporteConcepto = Dr("PU").ToString.ToDecimal * GlobalTipoCambio(TxtFecha.Text.Replace(",", "").ToDate).ToDecimal + Else + ImporteConcepto = Dr("PU").ToString.ToDecimal + End If + + If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, ImporteConcepto, Observaciones:=Dr("Descripcion").ToString, CveUsuarioModifico:=UsuarioActual.CveUsuario, CveOrdenCompraDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero) Then + Mensaje = "Error al guardar los movimientos" + Respuesta = False + Exit For + + End If + Cont += 1 + Next + End If + + Dim EsContabilizable As Boolean = False + + 'Registro la prepóliza + If Respuesta AndAlso ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then + Dim tValorInventario As Decimal = ObjInventario.DtResultados.SUMD("Total", "").RoundSQL() + Dim tValorOtro As Decimal = tValorInventario + + Dim TipoMovtoAlmacen As Boolean = False + Dim TipoMovtoOtro As Boolean = True + + + Dim drA2 As DataRow = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveAlmacen = {0}", CveAlmacen)) + If drA2 IsNot Nothing Then + tCveSubProyecto = drA2("CveSubProyecto").ToString.ToEntero + End If + + Dim OrigenMov As Integer = GlobalDTInvConceptos.FiltroPrimeroValor("Origen", "CveConcepto = " & CveConceptoInv).ToEntero + If OrigenMov = 1 Then TipoMovtoAlmacen = False Else TipoMovtoAlmacen = True + TipoMovtoOtro = Not TipoMovtoAlmacen + + Dim CveConceptoContable As Integer = 260 + Dim CveClasificacion As Integer = -1 + Select Case CveConceptoInv + Case 2, 32 + CveConceptoContable = 78 + EsContabilizable = True + Case 28, 31 + CveConceptoContable = 51 + If CveConceptoInv = 28 Then + ''cuando es 28, es otros ingresos.78 + CveConceptoContable = 78 + End If + EsContabilizable = True + Case 30 + CveConceptoContable = 181 + TipoMovtoOtro = False + If DdlSubProyecto.Visible = True AndAlso DdlSubProyecto.SelectedValue.ToEntero > 0 Then tCveSubProyecto = DdlSubProyecto.SelectedValue.ToEntero + + Case 34 + CveConceptoContable = 51 + EsContabilizable = True + Case 13, 29 + CveConceptoContable = 69 + TipoMovtoOtro = True + tValorOtro = -tValorOtro + Dim drr As DataRow = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimero("") + If drr IsNot Nothing Then + CveClasificacion = drr("CveClasificacion").ToString.ToEntero + End If + Case 3 + CveConceptoContable = 51 + EsContabilizable = True + Case Else + CveConceptoContable = 95 + + End Select + + '2-78 + Dim Obs As String = TxtDescrip.Text + + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoAlmacen, tValorInventario, tValorInventario, 68, Obs, Obs, CveMovimientoAlmacen:=CveMovimiento, CveClasificacion:=CveClasificacion, Contabilizable:=EsContabilizable) Then + Respuesta = False + Else + + 'Dim Total As Decimal = 0 + If CveConceptoContable.Contiene(181, 78, 51, 69) Then + Dim Dt As DataTable = ObjInventario.DtResultados.FiltraParametros("", "", {"CveClasificacion"}).Copy + + For Each Dr As DataRow In Dt.Rows + Dim Total As Decimal = ObjInventario.DtResultados.FiltraParametros($"CveClasificacion = {Dr("CveClasificacion")}").SUM("Total").RoundSQL() + + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovtoAlmacen, Total, Total, CveConceptoContable, lblFolio.Text, Obs, 0, CveMovimientoAlmacen:=CveMovimiento, CveClasificacion:=Dr("CveClasificacion").ToString.ToEntero, CveSubProyecto:=tCveSubProyecto) Then + Respuesta = False + End If + Next + Else + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovtoAlmacen, tValorInventario, tValorInventario, CveConceptoContable, Obs, Obs, CveMovimientoAlmacen:=CveMovimiento, CveClasificacion:=CveClasificacion, Contabilizable:=EsContabilizable) Then + Respuesta = False + End If + End If + End If + Else + Respuesta = False + End If + + End If + + If Respuesta Then + Alert($"Movimiento Guardado Correctamente Folio:{FolioMto} CveMovmiento: {CveMovimiento}") + End If + + Return Respuesta + + End Function + + + + Protected Sub BtnInvTempEntrada_Click(sender As Object, e As EventArgs) + Dim ObjOC As New ClsOC + + Try + If RegistroInventarioTemporal(ObjOC.IniciaTransacSQL(), CveOrdenCompra, 2) Then + ObjOC.Commit() + Else + ObjOC.RollBack() + End If + Catch ex As Exception + ObjOC.RollBack() + Finally + ObjOC.Dispose() + End Try + + End Sub + + Protected Sub BtnInvTempSalida_Click(sender As Object, e As EventArgs) + Dim ObjOC As New ClsOC + Try + If RegistroInventarioTemporal(ObjOC.IniciaTransacSQL(), CveOrdenCompra, 3) Then + ObjOC.Commit() + Else + ObjOC.RollBack() + End If + Catch ex As Exception + ObjOC.RollBack() + Finally + ObjOC.Dispose() + End Try + + End Sub End Class diff --git a/Ventas/RepProductosServiciosPeriodo.aspx b/Ventas/RepProductosServiciosPeriodo.aspx index 19fad8d2f..a71ec8df8 100644 --- a/Ventas/RepProductosServiciosPeriodo.aspx +++ b/Ventas/RepProductosServiciosPeriodo.aspx @@ -239,6 +239,14 @@
+ + +
+ + Importe + Cantidad + +
diff --git a/Ventas/RepProductosServiciosPeriodo.aspx.cs b/Ventas/RepProductosServiciosPeriodo.aspx.cs index 43ee37266..45db249c9 100644 --- a/Ventas/RepProductosServiciosPeriodo.aspx.cs +++ b/Ventas/RepProductosServiciosPeriodo.aspx.cs @@ -270,7 +270,7 @@ public partial class Ventas_RepProductosServiciosPeriodo : ClsPaginas DdlGrupo.SelectedValue.ToEntero(), DdlTipoComprobante.SelectedValue, DdlProyecto.SelectedValue.ToEntero(), DdlSubProyecto.SelectedValue.ToEntero(), RblTipoCambio.SelectedValue.ToEntero(), TCEspecifico, CveUsuarioConsulta: UsuarioActual.CveUsuario, VerEn: VerEn, CvePS: DdlPS.SelectedValue.ToEntero(), CveClasificacion: DdlClasificacion.SelectedValue.ToEntero(), CveCategoria: DdlCategoria.SelectedValue.ToEntero(), TipoFecha: DdlTipoFecha.SelectedValue.ToEntero(), - CveClienteClasificacion: DdlClienteClasificacion.SelectedValue.ToEntero(), ModalidadContable: !ChkLecturaAdmin.Checked)) + CveClienteClasificacion: DdlClienteClasificacion.SelectedValue.ToEntero(), ModalidadContable: !ChkLecturaAdmin.Checked, OpVista: DdlVista.SelectedValue.ToEntero())) { GvDatos.DataSource = ObjVentas.DtResultados; DtVentas = ObjVentas.DtResultados;