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/PVCobranza.aspx.vb b/Ventas/PVCobranza.aspx.vb index 46e4426d4..e1df226c7 100644 --- a/Ventas/PVCobranza.aspx.vb +++ b/Ventas/PVCobranza.aspx.vb @@ -504,6 +504,7 @@ Partial Class Ventas_PVCobranza VentaActual.PorcentajeIVA = DbRowVenta("PorcentajeIVA").ToString.ToDecimal VentaActual.UsuarioActual = UsuarioActual VentaActual.CveSubProyecto = DbRowVenta("CveSubProyecto").ToString.ToEntero + Dim CveVendedor As Integer = DbRowVenta("CveVendedor").ToString.ToEntero If tCveCorte <= 0 AndAlso DbRowVenta("CveCorte").ToString.ToEntero > 0 Then tCveCorte = DbRowVenta("CveCorte").ToString.ToEntero @@ -529,7 +530,7 @@ Partial Class Ventas_PVCobranza CveVentaRemision = HdnCveVenta.Value.ToEntero - respFactura = GenerarFactura(VentaActual, ObjVentas2, ObjClientes) + respFactura = GenerarFactura(CveVendedor, VentaActual, ObjVentas2, ObjClientes) If respFactura Is Nothing Then MsgError = "Ocurrió un error al generar la factura" @@ -552,7 +553,7 @@ Partial Class Ventas_PVCobranza 'GENERAR NC PARA AMORTIZACION If MsgError = "" AndAlso UsuarioActual.CveEmpresa.Contiene(189) AndAlso HdnTipoAmortizacion.Value = "2" Then - respNC = GenerarNC(VentaActual, ObjVentas2) + respNC = GenerarNC(CveVendedor, VentaActual, ObjVentas2) If respNC IsNot Nothing Then If respNC.TieneError Then @@ -760,7 +761,7 @@ Partial Class Ventas_PVCobranza UpL.Update() End Sub - Private Function GenerarFactura(ByRef VentaRemision As Venta, ByRef ObjVentas As ClsVentas, ByRef ObjClientes As ClsClientes) As Modelos.Factura.MMensajeFactura + Private Function GenerarFactura(CveVendedor As Integer, ByRef VentaRemision As Venta, ByRef ObjVentas As ClsVentas, ByRef ObjClientes As ClsClientes) As Modelos.Factura.MMensajeFactura Dim Retorno As Modelos.Factura.MMensajeFactura = Nothing Dim SbAlert As New StringBuilder() @@ -878,6 +879,8 @@ Partial Class Ventas_PVCobranza ObjFactura.DtAnticiposAplicados = DtAnticipos End If + ObjFactura.CveVendedor = CveVendedor + Retorno = ObjFactura.EmitirFactura(False, Transac:=ObjVentas.IniciaTransacSQL(), Modulo:="Cobranza/GuardarVenta", MostrarURL:=True) Retorno.Factura = ObjFactura @@ -945,7 +948,7 @@ Partial Class Ventas_PVCobranza Return Retorno End Function - Private Function GenerarNC(ByRef Venta As Venta, ByRef ObjVentas As ClsVentas) As Modelos.Factura.MMensajeFactura + Private Function GenerarNC(CveVendedor As Integer, ByRef Venta As Venta, ByRef ObjVentas As ClsVentas) As Modelos.Factura.MMensajeFactura Dim Retorno As Modelos.Factura.MMensajeFactura = Nothing Dim SbAlert As New StringBuilder() @@ -1026,6 +1029,8 @@ Partial Class Ventas_PVCobranza ObjNC.CveMetodoPago33 = 1 ObjNC.CveMetodoPago = 1 + ObjNC.CveVendedor = CveVendedor + Retorno = ObjNC.EmitirFactura(False, Transac:=ObjVentas.IniciaTransacSQL(), Modulo:="Cobranza/GuardarVenta", MostrarURL:=True) Retorno.Factura = ObjNC @@ -1127,34 +1132,39 @@ Partial Class Ventas_PVCobranza Private Function RegistraIE(Metodo As Integer, CveBancoCuenta As Integer, ImportePago As Decimal, Fecha As Date, CvePrePoliza As Integer, VentaActual As Venta, ByRef ObjIE As ClsBancos, ByRef ObjConta As ClsContabilidad, ByRef ObjVentas As ClsVentas, tCveCorte As Integer, Optional Obs As String = "", Optional CveAutorizacion As String = "", Optional CveSubProyecto As Integer = -1) As String Dim Retorno As String = "" - Dim CveIEPago As Integer = 0 - Dim ErrorConta As Boolean - If String.IsNullOrEmpty(Obs) Then - Obs = VentaActual.SerieFolio + If CveBancoCuenta > 0 Then + Dim CveIEPago As Integer = 0 + Dim ErrorConta As Boolean + If String.IsNullOrEmpty(Obs) Then + Obs = VentaActual.SerieFolio + End If + CveIEPago = ObjIE.AddBancos_IE(CveBancoCuenta, Metodo, Fecha, "-1", VentaActual.ClienteNombre, ImportePago, 1, 1, Obs, "", False, True, 0, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCorte:=tCveCorte, CveAutorizacion:=CveAutorizacion, CveSubProyecto:=CveSubProyecto) + If CveIEPago > 0 Then + Dim Pago As New VentaPago + Pago.ImportePagoVenta = ImportePago + Pago.ImportePago = ImportePago + Pago.CveIE = CveIEPago + Pago.CveMonedaPago = VentaActual.CveMoneda + Pago.Fecha = NowADS() + Pago.Referencia = VentaActual.SerieFolio + + ErrorConta = AplicaPrePolizaPagoVenta(VentaActual, Pago, CvePrePoliza, ObjConta) + If ErrorConta Then + Retorno = "Error en aplicación de pago" + End If + Dim MetodoPago As Integer = If(Metodo = 13, 1, If(Metodo = 12, 4, If(Metodo = 11, 5, If(Metodo = 3, 2, 3)))) + If Not ErrorConta AndAlso Not ObjVentas.AddVta_VentaPago(VentaActual.CveVenta, MetodoPago, ImportePago) Then + Retorno = "Error en aplicación de pago.." + ErrorConta = True + End If + Else + Retorno = "Pago en Bancos no registrado" + ErrorConta = True + End If + Else + Retorno = "No se ha especificado la cuenta" End If - CveIEPago = ObjIE.AddBancos_IE(CveBancoCuenta, Metodo, Fecha, "-1", VentaActual.ClienteNombre, ImportePago, 1, 1, Obs, "", False, True, 0, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCorte:=tCveCorte, CveAutorizacion:=CveAutorizacion, CveSubProyecto:=CveSubProyecto) - If CveIEPago > 0 Then - Dim Pago As New VentaPago - Pago.ImportePagoVenta = ImportePago - Pago.ImportePago = ImportePago - Pago.CveIE = CveIEPago - Pago.CveMonedaPago = VentaActual.CveMoneda - Pago.Fecha = NowADS() - Pago.Referencia = VentaActual.SerieFolio - ErrorConta = AplicaPrePolizaPagoVenta(VentaActual, Pago, CvePrePoliza, ObjConta) - If ErrorConta Then - Retorno = "Error en aplicación de pago" - End If - Dim MetodoPago As Integer = If(Metodo = 13, 1, If(Metodo = 12, 4, If(Metodo = 11, 5, If(Metodo = 3, 2, 3)))) - If Not ErrorConta AndAlso Not ObjVentas.AddVta_VentaPago(VentaActual.CveVenta, MetodoPago, ImportePago) Then - Retorno = "Error en aplicación de pago.." - ErrorConta = True - End If - Else - Retorno = "Pago en Bancos no registrado" - ErrorConta = True - End If Return Retorno End Function 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; diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 786790ece..2f3587400 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -3629,6 +3629,8 @@ Partial Class Ventas ImgAntiPend.Visible = False End If + InicializaDevolucionAlmacen() + End If End Sub @@ -6846,6 +6848,8 @@ Partial Class Ventas RBLPago.Items(0).Enabled = True + Dim CveUsoCFDICliente As Integer = -1 + Dim ObjCliente As New ClsClientes() If ObjCliente.GetClientes(CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa, Estatus, TipoCliente:=-1) Then @@ -6999,46 +7003,10 @@ Partial Class Ventas DdlMetodoPago33.Enabled = True End If - Dim CveCotizacion As Integer = IfNull(ViewState("CveCotizacion"), 0).ToString().ToEntero() Me.CveMetodoPago33Cliente = ObjCliente.CveMetodoPago33 Me.CveFormaPago33Cliente = ObjCliente.CveFormaPago33 - - If (CveVenta <= 0 AndAlso CveCotizacion <= 0) Or EsCreaApartirDe Or NuevaFactura = 1 OrElse ModalidadEdicion Then - 'CveMetodoPagoCliente = ObjCliente.CveMetodoPago - If UsuarioActual.Empresa.Funcionalidad(589) = "1" Then - 'SI EL METODO DE PAGO ES PUE, SELECCIONA CONTADO - If Me.CveMetodoPago33Cliente = 1 Then - RBLPago.SelectedValue = "2" - ElseIf Me.CveMetodoPago33Cliente = 3 Then - RBLPago.SelectedValue = "1" - End If - RBLPago_SelectedIndexChanged(RBLPago, Nothing) - UPCondicionesPago.Update() - Else - DdlMetodoPago33.SelectedValueExist(ObjCliente.CveMetodoPago33) - CambiaMetodoPago33() - DdlFormaPago33.SelectedValueExist(ObjCliente.CveFormaPago33) - End If - DdlUsoCFDI.SelectedValueExist(ObjCliente.CveUsoCFDI) - 'SI ES RFC GENERICO NO TIENE OBLIGACIONES FISCALES - If LblRFC.Text.Contiene("XAXX010101000", "XEXX010101000") Then - 'S01 Sin efectos fiscales. - DdlUsoCFDI.SelectedValueExist("23") - DdlUsoCFDI.Enabled = False - RegimenFiscalCliente = "616" - ClienteCodigoRegimenFiscal = "616" - Else - If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then - DdlUsoCFDI.Enabled = True - End If - - If NuevaFactura = 1 Then - DdlUsoCFDI.Enabled = True - End If - End If - - End If + CveUsoCFDICliente = ObjCliente.CveUsoCFDI PlazoCobranza = ObjCliente.PlazoCobranza PlazoCobranzaRemision = ObjCliente.PlazoCobranzaRemision @@ -7388,6 +7356,48 @@ Partial Class Ventas CargaRestriccionesCreditoCliente(True, CveVentaRef) + Dim CveCotizacion As Integer = IfNull(ViewState("CveCotizacion"), 0).ToString().ToEntero() + + If (CveVenta <= 0 AndAlso CveCotizacion <= 0) Or EsCreaApartirDe Or NuevaFactura = 1 OrElse ModalidadEdicion Then + 'CveMetodoPagoCliente = ObjCliente.CveMetodoPago + If UsuarioActual.Empresa.Funcionalidad(589) = "1" Then + 'SI EL METODO DE PAGO ES PUE, SELECCIONA CONTADO + If Me.CveMetodoPago33Cliente = 1 Then + RBLPago.SelectedValue = "2" + ElseIf Me.CveMetodoPago33Cliente = 3 Then + RBLPago.SelectedValue = "1" + 'SI ESTA BLOQUEADO EL CREDITO, DEJAR CONTADO + If Not RBLPago.Items(0).Enabled Then + RBLPago.SelectedValue = "2" + End If + End If + RBLPago_SelectedIndexChanged(RBLPago, Nothing) + UPCondicionesPago.Update() + Else + DdlMetodoPago33.SelectedValueExist(Me.CveMetodoPago33Cliente) + CambiaMetodoPago33() + DdlFormaPago33.SelectedValueExist(Me.CveFormaPago33Cliente) + End If + DdlUsoCFDI.SelectedValueExist(CveUsoCFDICliente) + 'SI ES RFC GENERICO NO TIENE OBLIGACIONES FISCALES + If LblRFC.Text.Contiene("XAXX010101000", "XEXX010101000") Then + 'S01 Sin efectos fiscales. + DdlUsoCFDI.SelectedValueExist("23") + DdlUsoCFDI.Enabled = False + RegimenFiscalCliente = "616" + ClienteCodigoRegimenFiscal = "616" + Else + If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then + DdlUsoCFDI.Enabled = True + End If + + If NuevaFactura = 1 Then + DdlUsoCFDI.Enabled = True + End If + End If + + End If + If CveVenta <= 0 Then CalculaLineasAdicionales() HabilitaRemisionPublicoGeneral = 0 @@ -8986,6 +8996,17 @@ Partial Class Ventas GvPS.Rows(e.NewEditIndex).FCTextBox("TxtDescuento").Enabled = False End If + If (CveVenta <= 0 OrElse EsCreaApartirDe) AndAlso UsuarioActual.Empresa.Funcionalidad(531) = "1" Then + Try + If GvPS.Rows(e.NewEditIndex).DataKey("CvePrecioLista").ToString().ToEntero() > 0 Then + GvPS.Rows(e.NewEditIndex).FCTextBox("TxtPrecio").Enabled = False + End If + Catch ex As Exception + End Try + + GvPS.Rows(e.NewEditIndex).FCTextBox("TxtDescuento").Enabled = False + End If + If EsVentaMedica Then GvPS.Rows(e.NewEditIndex).FCTextBox("TxtPrecio").Enabled = False @@ -9021,6 +9042,8 @@ Partial Class Ventas End If + UpPS.Update() + End Sub Protected Sub GvPS_RowCancelingEdit(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvPS.RowCancelingEdit GvPS.EditIndex = -1 @@ -12623,7 +12646,12 @@ Partial Class Ventas If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then ObjFactura.Medico = DdlMedico.SelectedItem.Text ObjFactura.Procedimiento = DdlProcedimiento.SelectedItem.Text - ObjFactura.FechaParaSurtir = TxtFechaOS.Text.Trim.ToDateTime + + Dim FechaParaSurtir As DateTime = MinFecha + If TxtFechaOS.Text.Replace(",", "").ToDateTime() > MinFecha Then + FechaParaSurtir = TxtFechaOS.Text.Replace(",", "").ToDateTime() + End If + ObjFactura.FechaParaSurtir = FechaParaSurtir End If 'CONVERTIR REMISION - TIPO MONEDA -DOLARES A PESOS