From 57ddb1b71a39a6e971aad3fbe74c2f15054854a4 Mon Sep 17 00:00:00 2001 From: rrene Date: Fri, 1 Jul 2022 14:36:04 -0700 Subject: [PATCH 01/11] -- cambio en prepoliza --- App_Code/Modelos.vb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index 5557cc9c2..e027c01b7 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -2247,13 +2247,13 @@ Namespace Modelos For Each RowInv As DataRow In DtMovimientosEntrada.Rows ValorInventario = DtMovimientosEntrada.SUMD("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").ToString.ToDecimal.RoundSQL - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, -ValorInventario, Concepto, tCveConcepto, Concepto, -1, CveVenta:=CveVenta, CveClasificacion:=RowInv("CveClasificacion").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=-ValorInventario, CveSubProyecto:=tCveSubProyecto) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, -ValorInventario, -ValorInventario, Concepto, tCveConcepto, Concepto, -1, CveVenta:=CveVenta, CveClasificacion:=RowInv("CveClasificacion").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimiento, CveSubProyecto:=tCveSubProyecto) Then CveMovimiento = -1 Exit For End If Next - If CveMovimiento > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, MovAlmacen, -DtMovimientosEntrada.SUMD("Total").RoundSQL, Concepto, 68, Concepto, -1, CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=-DtMovimientosEntrada.SUMD("Total").RoundSQL) Then + If CveMovimiento > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, MovAlmacen, -DtMovimientosEntrada.SUMD("Total").RoundSQL, -DtMovimientosEntrada.SUMD("Total").RoundSQL, Concepto, 68, Concepto, -1, CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimiento) Then CveMovimiento = -1 End If End If From 8f91592b21ac2ad9e42a47540cdbfe7c699c4f4b Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Fri, 1 Jul 2022 19:35:55 -0700 Subject: [PATCH 02/11] No matener la conexion en toda la carga de la venta, validacion de saldos de RNC --- Ventas/Ventas.aspx.vb | 2472 +++++++++++++++++++++-------------------- 1 file changed, 1284 insertions(+), 1188 deletions(-) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index b5cbe9e05..b8286dbce 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -4400,1172 +4400,1188 @@ Partial Class Ventas CveVenta = If(CvePedido > 0, CvePedido, CveVenta) Dim DtAntRelacionados As DataTable = Nothing - - Dim ObjVentas As New ClsVentas() - - If ObjVentas.GetVentasRelacionadas(CveVenta, UsuarioActual.CveEmpresa) Then - DtAntRelacionados = ObjVentas.DtResultados.FiltraParametros("TipoDocto IN ('Ing','Ant','Egs','Dev')") - End If - Dim SerieFolioPadre As String + Dim DbRowVenta As DataRow = Nothing - If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) Then - - If ObjVentas.DtResultados IsNot Nothing AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then - Dim DbRowVenta As DataRow = ObjVentas.DtResultados.Rows(0) - Dim CveCliente As Integer = DbRowVenta("CveCliente").ToString().ToEntero() - HdnCveVenta.Value = CveVenta.ToString() - - Me.EsGarantia = CBool(DbRowVenta("EsGarantia")) - - RFCReceptorVenta = DbRowVenta("RFCReceptor").ToString() - 'Adjuntar archivo - Adjunto = DbRowVenta("Adjunto").ToString() - If Adjunto <> "" Then - BtnArchivoAdjunto.Text = Adjunto - BtnArchivoAdjunto.Visible = True - BtnEliminarAdjunto.Visible = False - BtnAdjuntar.Visible = False - - tdAdjuntar.Style.Item("display") = "none" - tdAdjunto.Style.Item("display") = "block" - - Else - DivAdjuntar.Visible = False - + 'CARGA DTs DE VENTAS + If CveVenta > 0 Then + Using ObjVentas As New ClsVentas() + If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) Then + If ObjVentas.DtResultados IsNot Nothing AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then + DbRowVenta = ObjVentas.DtResultados.Copy().Rows(0) + Else + ViewState("CveVenta") = -1 + Alert("El documento solicitado no existe, favor de revisar su búsqueda.", TipoMensaje.MsgAdvertencia) + End If End If - ViewState("CveSubProyectoVenta") = DbRowVenta("CveSubProyecto").ToString().ToEntero() - - - - Me.CveEstatusFacturaPadre = DbRowVenta("CveEstatusFacturaPadre").ToString().ToEntero() - 'CargaEncabezado - If Not (CveRemision > 0 Or CveCotizacion > 0) Then - DdlTipoComprobante.SelectedValue = DbRowVenta("TipoDocto").ToString() - - If UsuarioActual.TienePermisoProceso(274) Then - TrAntEspecial.Visible = DdlTipoComprobante.SelectedValue = "Ant" - End If - - If TrAntEspecial.Visible Then - ChkAntEspecial.Enabled = False - ChkAntEspecial.Checked = If(DbRowVenta("AnticipoEspecial").ToString() = "True", True, False) - End If - CargaEstatusFactura(DdlTipoComprobante.SelectedValue) - CveEstatus = DbRowVenta("CveEstatusFactura").ToString().ToEntero() - LbEstatus.Text = DbRowVenta("EstatusFactura").ToString() - ViewState("SaldoVenta") = DbRowVenta("Saldo").ToString() - AplicaCancelarRemision = CBool(DbRowVenta("AplicaCancelarRemision").ToString()) - If AplicaCancelarRemision AndAlso CveEstatus.Contiene(2, 3) AndAlso DdlTipoComprobante.SelectedValue = "Ing" Then DivCanRem.Visible = True - VentaSaldoAlmacen = DbRowVenta("SaldoAlmacen").ToString().ToDecimal - - If CveEstatus = 5 Then LbCancelarDocumento.Enabled = False - 'If CveEstatus = 20 Then - ' LbCancelarDocumentoManual.Visible = True - 'End If - - - If (Not CveEstatus.Contiene(4, 5, 12, 13, 20, 23) OrElse (CveEstatus = 5 AndAlso DbRowVenta("CveEstatusRefacturacion").ToString().ToEntero() = 4)) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Egs", "Ant") AndAlso UsuarioActual.TienePermisoProceso(159) Then - Dim TienePermiso As String = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, -1).FiltroPrimeroValor("CveSubProyecto", String.Format("CveSubProyecto = {0}", DbRowVenta("CveSubProyecto"))) - If TienePermiso <> "" Then - LkRefacturacion.Visible = True - If (CveEstatus = 5 AndAlso DbRowVenta("CveEstatusRefacturacion").ToString().ToEntero() = 4) Then - RefacturarCancelada = True - End If - End If - End If - - If DbRowVenta("CveVentaRelacionada").ToString().ToEntero() > 0 Then - TrRefacturadaa.Visible = True - HplRefacturadaEn.NavigateUrl = String.Format("/Ventas/Ventas.aspx?CveVenta={0}", DbRowVenta("CveVentaRelacionada")) - HplRefacturadaEn.Text = DbRowVenta("SerieFolioRelacionada").ToString() - LblAlertRefacInv.Visible = True - End If - - If DdlTipoComprobante.SelectedValue.Contiene("Egs", "Ing", "Ant", "Dev", "Rem", "DPe", "RNC", "Pd2", "Cot") AndAlso Not CveEstatus.Contiene(4, 5, 10, 12, 13, 20, 23) Then - If UsuarioActual.TienePermisoProceso(159) Then - Dim TienePermiso As String = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, -1).FiltroPrimeroValor("CveSubProyecto", String.Format("CveSubProyecto = {0}", DbRowVenta("CveSubProyecto"))) - If TienePermiso <> "" Then - LbCancelarDocumento.Visible = True - 'If UsuarioActual.CveEmpresa = 119 And Not UsuarioActual.CveUsuario.Contiene(100, 1703) Then '[IPP] AD y Jesus de JAM - ' 'si es del mes anterior no permita cancelar - ' If Not DdlTipoComprobante.SelectedValue.Contiene("Rem") Then - ' If DbRowVenta("Fecha").ToString().ToDate <= Now.AddMonths(-1).LastDayOfMonth Then - ' LbCancelarDocumento.Visible = False - ' End If - ' End If - 'End If - End If - - End If - End If - - Dim TipoEstatus As Integer = GlobalDTEstatusFactura().FiltroPrimeroValor("TipoEstatus", $"CveEstatusFactura = {CveEstatus}").ToEntero() - - If UsuarioActual.Empresa.Funcionalidad(135).Contiene("1", "2") AndAlso DdlTipoComprobante.SelectedValue.Contiene("Cot") Then - If UsuarioActual.TienePermisoProceso(116) Then - LbCancelarDocumento.Visible = True - If TipoEstatus = 2 Then - LbCancelarDocumento.Visible = False - ElseIf TipoEstatus = 5 Then - LbCancelarDocumento.Visible = False - End If - End If - End If - - If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso CBool(DbRowVenta("ServicioDomicilio")) Then - TrServicioDomicilio.Visible = True + If DbRowVenta IsNot Nothing Then + If ObjVentas.GetVentasRelacionadas(CveVenta, UsuarioActual.CveEmpresa) Then + DtAntRelacionados = ObjVentas.DtResultados.FiltraParametros("TipoDocto IN ('Ing','Ant','Egs','Dev')") End If 'CargaDetalle If ObjVentas.GetVentaDetalle(CveVenta) Then - TmpDT = ObjVentas.DtResultados + TmpDT = ObjVentas.DtResultados.Copy() + TmpDT.Columns.Add("EntregaDirecta", GetType(Integer)) TmpDT.Columns.Add("CveMovimientoDetallePedido", GetType(Integer)) TmpDT.Columns.Add("CveVentaDetalleRNC", GetType(Integer)) TmpDT.Columns.Add("TieneProntoPago", GetType(String)) TmpDT.Columns.Add("ImporteProntoPago", GetType(Decimal)) - GvPS.DataSource = ObjVentas.DtResultados - GvPS.DataBind() - - 'IEPS A NIVEL DETALLE - 'TxtIEPS.Text = If(TmpDT.SUM("IEPS") > 0, TmpDT.SUM("IEPS").FormatoNumero, TxtIEPS.Text) End If - If UsuarioActual.TienePermisoProceso(318) Then - If DdlTipoComprobante.SelectedValue.Contiene("Egs", "Ing", "Ant", "Dev") AndAlso String.IsNullOrEmpty(DbRowVenta("FolioFiscal").ToString.Trim) Then HplFolioFiscalModal.Visible = True + 'CargaFirmas + If ObjVentas.GetVentasFirmas(CveVenta) Then + If ObjVentas.DtResultados.Rows.Count > 0 Then + DTmpF = ObjVentas.DtResultados.Copy() + End If End If - Select Case DbRowVenta("TipoDocto").ToString() - Case "Ing" - Trsaldo.Visible = True - HplSaldoAuxiliar.NavigateUrl = String.Format("/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxCClientes&CveCliente={0}&CveVenta={1}&TB_iframe=true&height=550&width=920", DbRowVenta("CveCliente"), DbRowVenta("CveVenta")) - HplPagado.NavigateUrl = String.Format("/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxCClientes&CveCliente={0}&CveVenta={1}&TB_iframe=true&height=550&width=920", DbRowVenta("CveCliente"), DbRowVenta("CveVenta")) - If SaldoVenta > 0 And UsuarioActual.TienePermisoProceso(100) Then - HLPagar.Visible = True - HLPagar.NavigateUrl = $"/Bancos/PopIEVentas.aspx?CveVenta={CveVenta}&TB_iframe=true&height=500&width=675" - HlCuentaTerminal.Visible = True + 'CARGA IMPUESTOS LOCALES + If ObjVentas.GetVentaImpuestosLocales(CveVenta) Then + If ObjVentas.DtResultados.Rows.Count > 0 Then + TmpDTImpuestos = ObjVentas.DtResultados.Copy() + End If + End If + + 'CARGA ANTICIPOS + If Not (CveRemision > 0 Or CveCotizacion > 0) Then + If DbRowVenta("TipoDocto").ToString().Contiene("Ing", "Ant") Then + 'carga as notas de credito vinculadas + If ObjVentas.GetVentasAntNC(CveVenta, -1) Then + TmpDTDocumentosRelacionados = ObjVentas.DtResultados.Copy() + GvAntNC.DataSource = TmpDTDocumentosRelacionados + GvAntNC.Caption = "
(Anticipos/NC/IxC) Vinculados
" + GvAntNC.DataBind() End If - CargarSaldoAuxiliar(CveCliente) - TabAuxiliarConta.Visible = UsuarioActual.TienePermisoProceso(306) - Dim TienePermiso As String = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, -1).FiltroPrimeroValor("CveSubProyecto", String.Format("CveSubProyecto = {0}", DbRowVenta("CveSubProyecto"))) - If TienePermiso <> "" Then ' si tiene acceso en el subproyecto - 'LkNotaCredito.Visible = UsuarioActual.TienePermisoProceso(175) - If UsuarioActual.TienePermisoProceso(264) Then - InicializaAplicaDevolucion(TmpDT) + End If + + If DbRowVenta("TipoDocto").ToString().Contiene("Egs", "Dev", "Ant") Then + Dim AplicaAmortizacion As Boolean = False + If DbRowVenta("TipoDocto").ToString().Contiene("Ant") Then AplicaAmortizacion = True + + If ObjVentas.GetVentasAntNC(-1, CveVenta, AplicaAmortizacion) Then + + TmpDTNCVinculadas = ObjVentas.DtResultados.Copy() + GvNC.DataSource = TmpDTNCVinculadas + GvNC.Caption = "
Ventas Aplicadas
" + GvNC.DataBind() + InicializaDTVentasNC() + + For Each Dr As DataRow In TmpDTNCVinculadas.Rows + If Dr("CveConceptoContable").ToString().ToEntero() = 91 Then + CargaNCDT(Dr("CveVenta").ToString().ToEntero(), Dr("Importe").ToString().ToDecimal, Dr("FolioFiscal").ToString(), TC:=Dr("TipoCambio").ToString().ToDecimal) + End If + Next + + If GvNC.Rows.Count > 0 Then + ImgAntiPend.Visible = False End If + + End If + End If + End If + + 'CARGA REMISIONES + If ObjVentas.GetRemisionesRelacionadas(CveVenta, DbRowVenta("TipoDocto").ToString()) Then + GvRemisiones.Caption = "
Remisiones/Facturas
" + GvRemisiones.DataSource = ObjVentas.DtResultados.Copy() + GvCancelarRemisiones.DataSource = ObjVentas.DtResultados.Copy() + + GvRemisiones.DataBind() + GvCancelarRemisiones.DataBind() + + '[IPP] SI ES REMISION PARA CANCELARLA NO DEBE TENER NINGUNA FACTURADA RELACIONADA - 24Abril2018 + If DbRowVenta("TipoDocto").ToString().Contiene("Rem") And GvRemisiones.Rows.Count > 0 Then + LbCancelarDocumento.Visible = False + End If + + 'SI TIENE REMISIONES Y VA A CANCELAR ES NECESARIO EL MOVIMIENTO DE DEVOLUCION + If DbRowVenta("TipoDocto").ToString().Contiene("Ing", "Ant") AndAlso GvRemisiones.Rows.Count > 0 Then + ChkDevAlm.Checked = True + ChkDevAlm.Enabled = False + 'LiDevolucionAlmacen.Visible = False + End If + + End If + + 'SI ES COTIZACION PUEDE GENERAR UNA OC PARA MODIFICAR LOS IMPORTES + If DbRowVenta("TipoDocto").ToString() = "Cot" AndAlso UsuarioActual.Empresa.Funcionalidad(583) = "1" Then + Dim DtOCGeneradas As DataTable = Nothing + If ObjVentas.GetVentasCotizacionesOC(Me.CveVenta, -1, UsuarioActual.CveEmpresa) Then + DtOCGeneradas = ObjVentas.DtResultados.Copy() + End If + If DtOCGeneradas IsNot Nothing AndAlso DtOCGeneradas.Rows.Count > 0 Then + LtGenerarOC.Visible = False + Else + LtGenerarOC.Visible = True + End If + End If + + 'CARGA GV DE OC RELACIONADAS + If ObjVentas.GetOCRelacionadas(CveVenta) Then + If ObjVentas.DtResultados.Rows.Count > 0 Then + DivOCRelacionadas.Visible = True + GvOCRelacionadas.DataSource = ObjVentas.DtResultados + GvOCRelacionadas.DataBind() + End If + End If + + End If + End Using + End If + + If DbRowVenta IsNot Nothing Then + 'CARGAR PS + GvPS.DataSource = TmpDT + GvPS.DataBind() + + Dim CveCliente As Integer = DbRowVenta("CveCliente").ToString().ToEntero() + HdnCveVenta.Value = CveVenta.ToString() + + Me.EsGarantia = CBool(DbRowVenta("EsGarantia")) + + RFCReceptorVenta = DbRowVenta("RFCReceptor").ToString() + 'Adjuntar archivo + Adjunto = DbRowVenta("Adjunto").ToString() + If Adjunto <> "" Then + BtnArchivoAdjunto.Text = Adjunto + BtnArchivoAdjunto.Visible = True + BtnEliminarAdjunto.Visible = False + BtnAdjuntar.Visible = False + + tdAdjuntar.Style.Item("display") = "none" + tdAdjunto.Style.Item("display") = "block" + + Else + DivAdjuntar.Visible = False + End If + + ViewState("CveSubProyectoVenta") = DbRowVenta("CveSubProyecto").ToString().ToEntero() + + Me.CveEstatusFacturaPadre = DbRowVenta("CveEstatusFacturaPadre").ToString().ToEntero() + 'CargaEncabezado + If Not (CveRemision > 0 Or CveCotizacion > 0) Then + DdlTipoComprobante.SelectedValue = DbRowVenta("TipoDocto").ToString() + + If UsuarioActual.TienePermisoProceso(274) Then + TrAntEspecial.Visible = DdlTipoComprobante.SelectedValue = "Ant" + End If + + If TrAntEspecial.Visible Then + ChkAntEspecial.Enabled = False + ChkAntEspecial.Checked = If(DbRowVenta("AnticipoEspecial").ToString() = "True", True, False) + End If + CargaEstatusFactura(DdlTipoComprobante.SelectedValue) + CveEstatus = DbRowVenta("CveEstatusFactura").ToString().ToEntero() + LbEstatus.Text = DbRowVenta("EstatusFactura").ToString() + ViewState("SaldoVenta") = DbRowVenta("Saldo").ToString() + AplicaCancelarRemision = CBool(DbRowVenta("AplicaCancelarRemision").ToString()) + If AplicaCancelarRemision AndAlso CveEstatus.Contiene(2, 3) AndAlso DdlTipoComprobante.SelectedValue = "Ing" Then DivCanRem.Visible = True + VentaSaldoAlmacen = DbRowVenta("SaldoAlmacen").ToString().ToDecimal + + If CveEstatus = 5 Then LbCancelarDocumento.Enabled = False + 'If CveEstatus = 20 Then + ' LbCancelarDocumentoManual.Visible = True + 'End If + + + If (Not CveEstatus.Contiene(4, 5, 12, 13, 20, 23) OrElse (CveEstatus = 5 AndAlso DbRowVenta("CveEstatusRefacturacion").ToString().ToEntero() = 4)) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Egs", "Ant") AndAlso UsuarioActual.TienePermisoProceso(159) Then + Dim TienePermiso As String = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, -1).FiltroPrimeroValor("CveSubProyecto", String.Format("CveSubProyecto = {0}", DbRowVenta("CveSubProyecto"))) + If TienePermiso <> "" Then + LkRefacturacion.Visible = True + If (CveEstatus = 5 AndAlso DbRowVenta("CveEstatusRefacturacion").ToString().ToEntero() = 4) Then + RefacturarCancelada = True + End If + End If + End If + + If DbRowVenta("CveVentaRelacionada").ToString().ToEntero() > 0 Then + TrRefacturadaa.Visible = True + HplRefacturadaEn.NavigateUrl = String.Format("/Ventas/Ventas.aspx?CveVenta={0}", DbRowVenta("CveVentaRelacionada")) + HplRefacturadaEn.Text = DbRowVenta("SerieFolioRelacionada").ToString() + LblAlertRefacInv.Visible = True + End If + + If DdlTipoComprobante.SelectedValue.Contiene("Egs", "Ing", "Ant", "Dev", "Rem", "DPe", "RNC", "Pd2", "Cot") AndAlso Not CveEstatus.Contiene(4, 5, 10, 12, 13, 20, 23) Then + If UsuarioActual.TienePermisoProceso(159) Then + Dim TienePermiso As String = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, -1).FiltroPrimeroValor("CveSubProyecto", String.Format("CveSubProyecto = {0}", DbRowVenta("CveSubProyecto"))) + If TienePermiso <> "" Then + LbCancelarDocumento.Visible = True + 'If UsuarioActual.CveEmpresa = 119 And Not UsuarioActual.CveUsuario.Contiene(100, 1703) Then '[IPP] AD y Jesus de JAM + ' 'si es del mes anterior no permita cancelar + ' If Not DdlTipoComprobante.SelectedValue.Contiene("Rem") Then + ' If DbRowVenta("Fecha").ToString().ToDate <= Now.AddMonths(-1).LastDayOfMonth Then + ' LbCancelarDocumento.Visible = False + ' End If + ' End If + 'End If + End If + + End If + End If + + Dim TipoEstatus As Integer = GlobalDTEstatusFactura().FiltroPrimeroValor("TipoEstatus", $"CveEstatusFactura = {CveEstatus}").ToEntero() + + If UsuarioActual.Empresa.Funcionalidad(135).Contiene("1", "2") AndAlso DdlTipoComprobante.SelectedValue.Contiene("Cot") Then + If UsuarioActual.TienePermisoProceso(116) Then + LbCancelarDocumento.Visible = True + If TipoEstatus = 2 Then + LbCancelarDocumento.Visible = False + ElseIf TipoEstatus = 5 Then + LbCancelarDocumento.Visible = False + End If + End If + End If + + If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso CBool(DbRowVenta("ServicioDomicilio")) Then + TrServicioDomicilio.Visible = True + End If + + If UsuarioActual.TienePermisoProceso(318) Then + If DdlTipoComprobante.SelectedValue.Contiene("Egs", "Ing", "Ant", "Dev") AndAlso String.IsNullOrEmpty(DbRowVenta("FolioFiscal").ToString.Trim) Then HplFolioFiscalModal.Visible = True + End If + + Select Case DbRowVenta("TipoDocto").ToString() + Case "Ing" + Trsaldo.Visible = True + HplSaldoAuxiliar.NavigateUrl = String.Format("/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxCClientes&CveCliente={0}&CveVenta={1}&TB_iframe=true&height=550&width=920", DbRowVenta("CveCliente"), DbRowVenta("CveVenta")) + HplPagado.NavigateUrl = String.Format("/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxCClientes&CveCliente={0}&CveVenta={1}&TB_iframe=true&height=550&width=920", DbRowVenta("CveCliente"), DbRowVenta("CveVenta")) + If SaldoVenta > 0 And UsuarioActual.TienePermisoProceso(100) Then + HLPagar.Visible = True + HLPagar.NavigateUrl = $"/Bancos/PopIEVentas.aspx?CveVenta={CveVenta}&TB_iframe=true&height=500&width=675" + HlCuentaTerminal.Visible = True + End If + CargarSaldoAuxiliar(CveCliente) + TabAuxiliarConta.Visible = UsuarioActual.TienePermisoProceso(306) + Dim TienePermiso As String = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, -1).FiltroPrimeroValor("CveSubProyecto", String.Format("CveSubProyecto = {0}", DbRowVenta("CveSubProyecto"))) + If TienePermiso <> "" Then ' si tiene acceso en el subproyecto + 'LkNotaCredito.Visible = UsuarioActual.TienePermisoProceso(175) + If UsuarioActual.TienePermisoProceso(264) Then + InicializaAplicaDevolucion(TmpDT) + End If + End If + + + HplDownXML.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=FactVta&CVEVENTA={0}&EXT={1}&SERIEFOLIO={2}&TIPODOCTO={3}", CveVenta, "XML", DbRowVenta("SerieFolio"), DbRowVenta("TipoDocto")))) + Case "Egs" + HplDownXML.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=FactVta&CVEVENTA={0}&EXT={1}&SERIEFOLIO={2}&TIPODOCTO={3}", CveVenta, "XML", DbRowVenta("SerieFolio"), DbRowVenta("TipoDocto")))) + HdnFolioFiscalNC.Value = DbRowVenta("FolioFiscalPadre").ToString() + Trsaldo.Visible = True + HplSaldoAuxiliar.NavigateUrl = String.Format("/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxCClientes&CveCliente={0}&CveVenta={1}&TB_iframe=true&height=550&width=920", DbRowVenta("CveCliente"), DbRowVenta("CveVenta")) + HplPagado.NavigateUrl = String.Format("/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxCClientes&CveCliente={0}&CveVenta={1}&TB_iframe=true&height=550&width=920", DbRowVenta("CveCliente"), DbRowVenta("CveVenta")) + Case "Rem" + 'IPP 15 Julio 2017 + Trsaldo.Visible = True + HplSaldoAuxiliar.NavigateUrl = String.Format("/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxCClientes&CveCliente={0}&CveVenta={1}&TB_iframe=true&height=550&width=920", DbRowVenta("CveCliente"), DbRowVenta("CveVenta")) + HplPagado.NavigateUrl = String.Format("/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxCClientes&CveCliente={0}&CveVenta={1}&TB_iframe=true&height=550&width=920", DbRowVenta("CveCliente"), DbRowVenta("CveVenta")) + If SaldoVenta > 0 And UsuarioActual.TienePermisoProceso(100) Then + HLPagar.Visible = True + HLPagar.NavigateUrl = $"/Bancos/PopIEVentas.aspx?CveVenta={CveVenta}&TB_iframe=true&height=500&width=675" + HlCuentaTerminal.Visible = True + End If + + If UsuarioActual.CveEmpresa = 80 Then + LtlImprimir.Text = String.Format("
  • Imprimir
  • ", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=0", CveVenta))) + End If + DiasCredito = DbRowVenta("DiasCredito").ToString().ToEntero() + EsDiasCreditoFijo = CBool(DbRowVenta("EsDiasCreditoFijo").ToString()) + Case "RNC" + Trsaldo.Visible = True + HplSaldoAuxiliar.NavigateUrl = String.Format("/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxCClientes&CveCliente={0}&CveVenta={1}&TB_iframe=true&height=550&width=920", DbRowVenta("CveCliente"), DbRowVenta("CveVenta")) + HplPagado.NavigateUrl = String.Format("/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxCClientes&CveCliente={0}&CveVenta={1}&TB_iframe=true&height=550&width=920", DbRowVenta("CveCliente"), DbRowVenta("CveVenta")) + + Case "OP" + TdOrdenPago.Visible = True + DdlOrdenPago.SelectedValue = DbRowVenta("Num3").ToString() + DdlOrdenPago.Enabled = False + Case "Cot" + TxtAtencionA.Text = DbRowVenta("AtencionA").ToString() + TxtFechaVencimientoCotizacion.Text = DbRowVenta("Vigencia").ToString() + PnlImprimir.Visible = True + HLOrdendeCompra.Visible = True + HLOrdendeCompra.NavigateUrl = String.Format("/OC/OC.aspx?Tipo=Req&CveCotizacion={0}", CveVenta) + + Dim ObjOS As New ClsOS() + If ObjOS.GetCotizacionOS(CveVenta) Then + If ObjOS.DtResultados.Rows.Count > 0 Then + Dim DbRowOS As DataRow = ObjOS.DtResultados.Rows(0) + ViewState("CveOS") = DbRowOS("CveOS").ToString().ToEntero() + CargaOS(CveOS) End If + Else + HLOrdenServicio.Visible = True + HLOrdenServicio.NavigateUrl = String.Format("/OS/OrdenesServicios.aspx?CveCotizacion={0}", CveVenta) + End If + ObjOS.Dispose() - HplDownXML.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=FactVta&CVEVENTA={0}&EXT={1}&SERIEFOLIO={2}&TIPODOCTO={3}", CveVenta, "XML", DbRowVenta("SerieFolio"), DbRowVenta("TipoDocto")))) - Case "Egs" - HplDownXML.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=FactVta&CVEVENTA={0}&EXT={1}&SERIEFOLIO={2}&TIPODOCTO={3}", CveVenta, "XML", DbRowVenta("SerieFolio"), DbRowVenta("TipoDocto")))) - HdnFolioFiscalNC.Value = DbRowVenta("FolioFiscalPadre").ToString() - Trsaldo.Visible = True - HplSaldoAuxiliar.NavigateUrl = String.Format("/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxCClientes&CveCliente={0}&CveVenta={1}&TB_iframe=true&height=550&width=920", DbRowVenta("CveCliente"), DbRowVenta("CveVenta")) - HplPagado.NavigateUrl = String.Format("/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxCClientes&CveCliente={0}&CveVenta={1}&TB_iframe=true&height=550&width=920", DbRowVenta("CveCliente"), DbRowVenta("CveVenta")) - Case "Rem" - 'IPP 15 Julio 2017 - Trsaldo.Visible = True - HplSaldoAuxiliar.NavigateUrl = String.Format("/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxCClientes&CveCliente={0}&CveVenta={1}&TB_iframe=true&height=550&width=920", DbRowVenta("CveCliente"), DbRowVenta("CveVenta")) - HplPagado.NavigateUrl = String.Format("/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxCClientes&CveCliente={0}&CveVenta={1}&TB_iframe=true&height=550&width=920", DbRowVenta("CveCliente"), DbRowVenta("CveVenta")) - If SaldoVenta > 0 And UsuarioActual.TienePermisoProceso(100) Then - HLPagar.Visible = True - HLPagar.NavigateUrl = $"/Bancos/PopIEVentas.aspx?CveVenta={CveVenta}&TB_iframe=true&height=500&width=675" - HlCuentaTerminal.Visible = True - End If - - If UsuarioActual.CveEmpresa = 80 Then - LtlImprimir.Text = String.Format("
  • Imprimir
  • ", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=0", CveVenta))) - End If - DiasCredito = DbRowVenta("DiasCredito").ToString().ToEntero() - EsDiasCreditoFijo = CBool(DbRowVenta("EsDiasCreditoFijo").ToString()) - Case "RNC" - Trsaldo.Visible = True - HplSaldoAuxiliar.NavigateUrl = String.Format("/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxCClientes&CveCliente={0}&CveVenta={1}&TB_iframe=true&height=550&width=920", DbRowVenta("CveCliente"), DbRowVenta("CveVenta")) - HplPagado.NavigateUrl = String.Format("/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxCClientes&CveCliente={0}&CveVenta={1}&TB_iframe=true&height=550&width=920", DbRowVenta("CveCliente"), DbRowVenta("CveVenta")) - - Case "OP" - TdOrdenPago.Visible = True - DdlOrdenPago.SelectedValue = DbRowVenta("Num3").ToString() - DdlOrdenPago.Enabled = False - Case "Cot" - TxtAtencionA.Text = DbRowVenta("AtencionA").ToString() - TxtFechaVencimientoCotizacion.Text = DbRowVenta("Vigencia").ToString() + If UsuarioActual.CveEmpresa.Contiene(4, 7, 11, 12, 145) Then PnlImprimir.Visible = True : LnkImprimir.OnClientClick = "javascript:ImprimirCotizacion();return false;" + 'Deshabilitar impresión cuando no esté supervisada + If DbRowVenta("TipoEstatus").ToString().ToEntero() = 2 Or UsuarioActual.Empresa.Funcionalidad(113) = "1" Then PnlImprimir.Visible = True - HLOrdendeCompra.Visible = True - HLOrdendeCompra.NavigateUrl = String.Format("/OC/OC.aspx?Tipo=Req&CveCotizacion={0}", CveVenta) + Else + HplDownPDF.Visible = False + PnlImprimir.Visible = False + End If - Dim ObjOS As New ClsOS() - If ObjOS.GetCotizacionOS(CveVenta) Then - If ObjOS.DtResultados.Rows.Count > 0 Then - Dim DbRowOS As DataRow = ObjOS.DtResultados.Rows(0) - ViewState("CveOS") = DbRowOS("CveOS").ToString().ToEntero() - CargaOS(CveOS) + + 'SI LA AUTORIZACION ES POR SUPERVISOR, BUSCA EL SUPERVISOR QUE TIENE EL VENDEDOR + If UsuarioActual.Empresa.Funcionalidad(135) = "1" Then + 'Reviso cuales son los supervisores + Dim Objeto As New ClsVtaVendedores + + If Objeto.GetVendedores(UsuarioActual.CveEmpresa) Then + Dim DTVendedores As New DataTable + If DbRowVenta("CveVendedor").ToString().ToEntero() > 0 AndAlso UsuarioActual.CveVendedor > 0 Then + DTVendedores = Objeto.DtResultados.FiltraParametros(String.Format("CveVendedor = {0}", DbRowVenta("CveVendedor").ToString())).FiltraParametros(String.Format("CveSupervisor = {0}", UsuarioActual.CveVendedor)) End If - Else - HLOrdenServicio.Visible = True - HLOrdenServicio.NavigateUrl = String.Format("/OS/OrdenesServicios.aspx?CveCotizacion={0}", CveVenta) - End If - ObjOS.Dispose() - - If UsuarioActual.CveEmpresa.Contiene(4, 7, 11, 12, 145) Then PnlImprimir.Visible = True : LnkImprimir.OnClientClick = "javascript:ImprimirCotizacion();return false;" - 'Deshabilitar impresión cuando no esté supervisada - If DbRowVenta("TipoEstatus").ToString().ToEntero() = 2 Or UsuarioActual.Empresa.Funcionalidad(113) = "1" Then - PnlImprimir.Visible = True - Else - HplDownPDF.Visible = False - PnlImprimir.Visible = False - End If - - - 'SI LA AUTORIZACION ES POR SUPERVISOR, BUSCA EL SUPERVISOR QUE TIENE EL VENDEDOR - If UsuarioActual.Empresa.Funcionalidad(135) = "1" Then - 'Reviso cuales son los supervisores - Dim Objeto As New ClsVtaVendedores - - If Objeto.GetVendedores(UsuarioActual.CveEmpresa) Then - Dim DTVendedores As New DataTable - If DbRowVenta("CveVendedor").ToString().ToEntero() > 0 AndAlso UsuarioActual.CveVendedor > 0 Then - DTVendedores = Objeto.DtResultados.FiltraParametros(String.Format("CveVendedor = {0}", DbRowVenta("CveVendedor").ToString())).FiltraParametros(String.Format("CveSupervisor = {0}", UsuarioActual.CveVendedor)) - End If - - 'Verifico si es su supervisor asignado - If DTVendedores.Rows.Count > 0 Then - LkCotizacionAutorizar.Visible = True - - If TipoEstatus = 2 Then - LkCotizacionAutorizar.Visible = False - ElseIf TipoEstatus = 5 Then - LkCotizacionAutorizar.Visible = False - End If - End If - DTVendedores.Dispose() - End If - Objeto.Dispose() - End If - - 'SI LA AUTORIZACION ES POR PERMISO, BUSCA QUE EL USUARIO TENGA EL PERMISO PARA AUTORIZAR - If UsuarioActual.Empresa.Funcionalidad(135) = "2" Then - 'Reviso cuales son los supervisores - If UsuarioActual.TienePermisoProceso(116) Then + 'Verifico si es su supervisor asignado + If DTVendedores.Rows.Count > 0 Then LkCotizacionAutorizar.Visible = True + If TipoEstatus = 2 Then LkCotizacionAutorizar.Visible = False ElseIf TipoEstatus = 5 Then LkCotizacionAutorizar.Visible = False End If End If + DTVendedores.Dispose() End If - - Case "Ant" - Trsaldo.Visible = True - HplSaldoAuxiliar.NavigateUrl = String.Format("/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxCClientes&CveCliente={0}&CveVenta={1}&TB_iframe=true&height=550&width=920", DbRowVenta("CveCliente"), DbRowVenta("CveVenta")) - HplPagado.NavigateUrl = String.Format("/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxCClientes&CveCliente={0}&CveVenta={1}&TB_iframe=true&height=550&width=920", DbRowVenta("CveCliente"), DbRowVenta("CveVenta")) - 'LkNotaCredito.Visible = True - HplDownXML.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=FactVta&CVEVENTA={0}&EXT={1}&SERIEFOLIO={2}&TIPODOCTO={3}", CveVenta, "XML", DbRowVenta("SerieFolio"), DbRowVenta("TipoDocto")))) - 'visualizo el saldo de anticipos, para cuando se aplique una Nota de crédito, decida si afecta anticipos o a DSV - LblNCSaldoAnticipo.Visible = True - ChkAplicaNCAnticipo.Visible = True - ChkAplicaNCAnticipo.Checked = True - If SaldoVenta > 0 And UsuarioActual.TienePermisoProceso(100) Then - HLPagar.Visible = True - HLPagar.NavigateUrl = $"/Bancos/PopIEVentas.aspx?CveVenta={CveVenta}&TB_iframe=true&height=500&width=675" - HlCuentaTerminal.Visible = True - End If - Me.SaldoAnticipo = DbRowVenta("SaldoAnticipo").ToString().ToDecimal - If SaldoAnticipo > 0 Then - InicializaDTAnticiposAmortizacion() - ChkAplicaNCAnticipo.Enabled = False - Else - ChkAplicaNCAnticipo.Enabled = False - ChkAplicaNCAnticipo.Checked = False - End If - 'If DbRowVenta("SaldoAnticipo").ToString().ToDouble <= 0 Then ChkAplicaNCAnticipo.Checked = False : ChkAplicaNCAnticipo.Enabled = False - LblNCSaldoAnticipo.Text = String.Format("Saldo Anticipo: $ {0}", DbRowVenta("SaldoAnticipo").ToString().ToDouble.FormatoNumero) - Case "Dev" - DdlTipoComprobante.Items.Insert(0, New ListItem("Devolucion", "Dev")) - HplDownXML.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=FactVta&CVEVENTA={0}&EXT={1}&SERIEFOLIO={2}&TIPODOCTO={3}", CveVenta, "XML", DbRowVenta("SerieFolio"), DbRowVenta("TipoDocto")))) - HdnFolioFiscalNC.Value = DbRowVenta("FolioFiscalPadre").ToString() - 'ViewState("CveDevolucion") = DbRowVenta("CveVentaPadre").ToString().ToEntero() - Trsaldo.Visible = True - HplSaldoAuxiliar.NavigateUrl = String.Format("/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxCClientes&CveCliente={0}&CveVenta={1}&TB_iframe=true&height=550&width=920", DbRowVenta("CveCliente"), DbRowVenta("CveVenta")) - HplPagado.NavigateUrl = String.Format("/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxCClientes&CveCliente={0}&CveVenta={1}&TB_iframe=true&height=550&width=920", DbRowVenta("CveCliente"), DbRowVenta("CveVenta")) - Case "Ped" - DdlTipoComprobante.Items.Insert(0, New ListItem("Pedido", "Ped")) - Case "DPe" - DdlTipoComprobante.Items.Insert(5, New ListItem("Devolución de perdido", "DPe")) - Case "PeC" - DdlTipoComprobante.Items.Insert(5, New ListItem("Pedido de Consignación", "PeC")) - Case "PA" - If UsuarioActual.TienePermisoProceso(199) Then - BtnGenerarRemision.Visible = If(CveEstatus = 16, True, False) - Else - BtnGenerarRemision.Visible = False - End If - CvePedidoA = CveVenta - DiasCredito = DbRowVenta("DiasCredito").ToString().ToEntero() - EsDiasCreditoFijo = CBool(DbRowVenta("EsDiasCreditoFijo").ToString()) - Case "Pd2" - CvePedido2 = CveVenta - BtnGeneraAutorizacion.Visible = If(CveEstatus <> 21, True, False) - If UsuarioActual.TienePermisoProceso(199) Then - BtnGenerarRemision.Visible = If(CveEstatus <> 21, True, False) - Else - BtnGenerarRemision.Visible = False - End If - End Select - - DdlTipoComprobante.SelectedValue = DbRowVenta("TipoDocto").ToString() - - End If - - DdlTipoRelacionARelacionar.SelectedValueExist(DbRowVenta("CveTipoRelacion").ToString()) - - 'contado 0, credito 1, terminal 2 - If DbRowVenta("CondicionesPago").ToString().ToEntero() = 1 Then - RBLPago.SelectedValue = "1" - RBLPago_SelectedIndexChanged(Nothing, Nothing) - UPCondicionesPago.Update() - ElseIf DbRowVenta("CondicionesPago").ToString().ToEntero() = 0 Then - RBLPago.SelectedValue = "2" - RBLPago.Items(0).Enabled = False - RBLPago_SelectedIndexChanged(Nothing, Nothing) - UPCondicionesPago.Update() - Else - DdlCuentasTerminal.SelectedValue = DbRowVenta("CveCuentaTerminal").ToString() - RBLPago.SelectedValue = "3" - RBLPago.Items(0).Enabled = False - RBLPago_SelectedIndexChanged(Nothing, Nothing) - UPCondicionesPago.Update() - End If - - - 'ESCONDE ACCIONES - LnkRemisiones.Visible = False - LnkPedido2SinFacturar.Visible = False - LnkCotizaciones.Visible = False - LnkOCs.Visible = False - UpnTools.Update() - - DivEstatusFac.Visible = True - HdnCveCliente.Value = CveCliente.ToString() - ViewState("CveCliente") = CveCliente - ViewState("CveEmpresaCRM") = DbRowVenta("CveEmpresaCRM").ToString().ToEntero() - ViewState("CveAcercamientoCRM") = DbRowVenta("CveAcercamientoCRM").ToString().ToEntero() - Entrega = DbRowVenta("Entrega").ToString() - Vigencia = DbRowVenta("Vigencia").ToString().ToDate.ToShortDateString - HplSaldoAuxiliar.Text = DbRowVenta("Saldo").ToString().FormatoNumero(2) - If Not HplSaldoAuxiliar.Text.ToDouble > 0 Then - HplSaldoAuxiliar.Visible = False - HplPagado.Visible = True - Dim EsCancelado = GlobalDTEstatusFactura().FiltroPrimeroValor("TipoEstatus", $"CveEstatusFactura = {CveEstatus}").ToEntero() = 5 - If EsCancelado Then - HplPagado.Text = "CANCELADO" - End If - If ViewState("CveCotizacion") IsNot Nothing AndAlso ViewState("CveCotizacion").ToString().ToEntero() > 0 AndAlso DdlTipoComprobante.SelectedValue = "Ing" Then - ImgAntiPend.Visible = True - Else - ImgAntiPend.Visible = False - End If - - End If - HdnPagado.Value = DbRowVenta("Pagado").ToString() - TxtTotal.Text = DbRowVenta("Total").ToString().FormatoNumero(2) - HdnVentaSaldo.Value = (SaldoVenta).ToString() - CvePrePoliza = DbRowVenta("CvePrePoliza").ToString().ToEntero() - CveVentaFacturada = DbRowVenta("CveVentaFacturada").ToString().ToEntero() - - CveVentaRelacion = DbRowVenta("CveVentaRelacion").ToString().ToEntero() - ImporteRelacion = DbRowVenta("ImporteRelacion").ToString().ToDouble - - DdlMoneda.SelectedValue = DbRowVenta("CveMoneda").ToString() - CambiaMoneda() - - If DbRowVenta("TipoDocto").ToString() = "Pd2" Then - 'CANTIDAD FACTURADA - If TmpDT.SUM("CantidadFacturadaPed2") > 0 Then - GvPS.Columns(7).Visible = True - ThCantidadFacturada.Visible = True - ThCantidadFacturada2.Visible = True - Else - GvPS.Columns(7).Visible = False - ThCantidadFacturada.Visible = False - ThCantidadFacturada2.Visible = False - End If - - ''ACTIVA EDITAR - ''SOLO LA PUEDE EDITAR USUATIOACTUAL-VENDEDOR | NO DEBE ESTAR FACTURADA - 'If (UsuarioActual.CveUsuario = DbRowVenta("CveUsuario").ToString().ToEntero() Or UsuarioActual.CveVendedor = DdlVendedor.SelectedValue.ToEntero()) And TmpDT.SUM("CantidadFacturadaCot") = 0 Then 'And TmpDT.SUM("CantidadFacturadaCot") < TmpDT.SUM("Cantidad") - ' BtnPermisoEditarCotizacion.Visible = True - 'End If - - 'ACTIVA BOTONERA | DEBE TENER CONCEPTOS PENDIENTES DE FACTURAR - 'If TmpDT.SUM("CantidadFacturadaPed2") < TmpDT.SUM("Cantidad") Then - ' BtnGenerarRemision.Visible = If(CveEstatus = 10, False, True) - ' BtnsFacturar.Visible = True - 'End If - ElseIf DbRowVenta("TipoDocto").ToString() = "Cot" AndAlso CveCotizacion > 0 Then - CveEstatusCotizacion = DbRowVenta("CveEstatusFactura").ToString().ToEntero() - End If - - - If CveEmpresaCRM > 0 And Not CveCliente > 0 Then - CargaEmpresaCRM(CveEmpresaCRM) - Else - CveEmpresaCRM = IIf(CveEmpresaCRM > 0, CveEmpresaCRM, 0).ToString().ToEntero() - CargaCliente(CveCliente, -1) 'Estatus activo, se requiere para cargar una factura en la que el cliente a sido eliminado - End If - - ViewState("CveAlmacenTransitorio") = DbRowVenta("CveAlmacenTraspasoDestino").ToString().ToEntero() - DevolucionAlmacen = DbRowVenta("EsDevolucionVenta").ToString().ToEntero() - - 'sino esta cargada la información del metodo de pago que le corresponde, la recarga para que se le pueda asignar - If DdlMetodoPago33.SelectedValue <> DbRowVenta("CveMetodoPago33").ToString() Then - CargaFormaPago(DbRowVenta("CveMetodoPago33").ToString().ToEntero()) - End If - DdlMetodoPago33.SelectedValueExist(DbRowVenta("CveMetodoPago33").ToString()) - DdlFormaPago33.SelectedValueExist(DbRowVenta("CveFormaPago33").ToString().ToEntero()) - - Me.CveMetodoPago33Venta = DbRowVenta("CveMetodoPago33").ToString().ToEntero() - Me.CveFormaPago33Venta = DbRowVenta("CveFormaPago33").ToString().ToEntero() - Me.CveVendedorVenta = DbRowVenta("CveVendedor").ToString().ToEntero() - - 'SI YA TIENE UN VALOR ASIGNADO SELECCIONA EL GUARDADO - 'If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso Me.CveVenta > 0 AndAlso Me.CveVendedorVenta > 0 Then - ' Dim Vendedor = GlobalDTVendedores(UsuarioActual.CveEmpresa, VendedorTipo:=1).FiltroPrimeroValor("Vendedor", String.Format("CveVendedor = {0}", Me.CveVendedorVenta)) - ' 'SI NO ENCUENTRA BUSCA EN LOS VENDEDORES DEL PV - ' If String.IsNullOrEmpty(Vendedor) Then - ' Vendedor = GlobalDTVendedores(UsuarioActual.CveEmpresa, VendedorTipo:=4).FiltroPrimeroValor("Vendedor", String.Format("CveVendedor = {0}", Me.CveVendedorVenta)) - ' End If - ' DdlVendedor.SelectedValueExistInsert(Me.CveVendedorVenta, Vendedor) - 'End If - - If DdlFormaPago33.SelectedValue <> DbRowVenta("CveFormaPago33").ToString() And DbRowVenta("CveFormaPago33").ToString() <> "" Then - 'sino está seleccionada la asginada la debe de cargar - Dim Nombre As String = GlobalDTVtaFormaPago().FiltroPrimeroValor("FormaPagoSAT", String.Format("CveFormaPago={0}", DbRowVenta("CveFormaPago33"))) - DdlFormaPago33.Items.Add(New ListItem(Nombre, DbRowVenta("CveFormaPago33").ToString())) - DdlFormaPago33.SelectedValueExist(DbRowVenta("CveFormaPago33").ToString().ToEntero()) - End If - - DdlUsoCFDI.SelectedValueExist(DbRowVenta("CveUsoCFDI").ToString()) - - If UsuarioActual.CveEmpresa = 126 Then CargaOrdenProduccion(2, CveVenta) - - If DbRowVenta("CveTipoRelacion").ToString().ToEntero() > 0 Then - TrTipoRelacion.Visible = True - DdlTiposRelacion.SelectedValueExist(DbRowVenta("CveTipoRelacion").ToString().ToEntero()) - - 'RELACIONAR ANTICIPOS APLICADOS - If DbRowVenta("CveTipoRelacion").ToString().ToEntero() = 7 AndAlso DtAntRelacionados IsNot Nothing AndAlso DtAntRelacionados.Rows.Count > 0 Then - DdlTipoRelacionAnticipo.SelectedValueExist(7) - ListaAnticiposAplicados = New List(Of MAnticipoRelacionado)() - For Each RowAnt As DataRow In DtAntRelacionados.Rows - ListaAnticiposAplicados.Add(New MAnticipoRelacionado() With {.CveVenta = RowAnt("CveVentaRelacionada").ToString().ToEntero(), .FolioFiscal = RowAnt("FolioFiscal").ToString()}) - Next - Else - HdnFolioFiscalNC.Value = DbRowVenta("FolioFiscalPadre").ToString() - End If - End If - - If DbRowVenta("Saldo").ToString().ToDouble < 0.01 Then - If ViewState("CveCotizacion") IsNot Nothing AndAlso ViewState("CveCotizacion").ToString().ToEntero() > 0 AndAlso DdlTipoComprobante.SelectedValue = "Ing" Then - ImgAntiPend.Visible = True - Else - ImgAntiPend.Visible = False - End If - ElseIf Opcion <> "Op" Then - ImgAntiPend.Visible = True - End If - If UsuarioActual.CveRol.Contiene(1, 1155) Then LiLnkGuias.Visible = True - - LiComplementoPago.Visible = True - - - ViewState("FolioFiscal") = DbRowVenta("FolioFiscal").ToString() - - SerieVenta = DbRowVenta("Serie").ToString() - LblSerie.Text = SerieVenta - ViewState("Serie") = DbRowVenta("Serie").ToString() - ViewState("Folio") = DbRowVenta("Folio").ToString().ToEntero() - TxtFolio.Text = DbRowVenta("Folio").ToString() - 'TxtDocto.Text = DbRowVenta("Ref").ToString() - 'TxtNumCtaPago.Text = DbRowVenta("NumeroCuenta").ToString() - LblFolioFiscal.Text = DbRowVenta("FolioFiscal").ToString() - TxtFecha.Text = DbRowVenta("Fecha").ToString() - TxtSubTotal.Text = DbRowVenta("SubTotal").ToString().FormatoNumero(2) - LblDescuentos.Text = DbRowVenta("Descuento").ToString().FormatoNumero(2) - LblAmortizacion.Text = DbRowVenta("Amortizacion").ToString().FormatoNumero(2) - TxtSubTotal2.Text = (TxtSubTotal.Text.Replace(",", "").Trim.Trim.ToDouble - LblDescuentos.Text.Replace(",", "").Trim.Trim.ToDouble - LblAmortizacion.Text.Replace(",", "").Trim.Trim.ToDouble).FormatoNumero(2) - TxtIVA.Text = DbRowVenta("IVA").ToString().FormatoNumero(2) - TxtRetIVA.Text = DbRowVenta("RetIVA").ToString().FormatoNumero(2) - TxtCorreoNotificaciones.Text = DbRowVenta("CorreoNotificacion").ToString() - - If TxtRetIVA.Text.ToDecimal() > 0 Then - TrRetIVA.Style.Add("display", "") - UsuarioActual.Empresa.MostrarRetIVA = True - If DdlTipoRetencion.SelectedValue.ToEntero() > 0 Then - DdlTipoRetencion.Visible = True - End If - If TmpDT IsNot Nothing Then - Dim PorcentajeRetIVA = (TmpDT.MAX("PorcentajeRetIVA").ToDecimal() * 100) - LblRetIVA.Text = PorcentajeRetIVA.FormatoNumero(2) - End If - - End If - TxtRetISR.Text = DbRowVenta("RetISR").ToString().FormatoNumero(2) - TxtIEPS.Text = DbRowVenta("IEPS").ToString().FormatoNumero(2) - TrIEPS.Visible = TxtIEPS.Text.ToDouble > 0 - TxtTotal.Text = DbRowVenta("Total").ToString().FormatoNumero(2) - HdnTotalVenta.Value = DbRowVenta("Total").ToString().FormatoNumero(2) - TxtMotivoDescuento.Text = DbRowVenta("MotivoDescuento").ToString() - TxtObsFact.Text = DbRowVenta("Observaciones").ToString() - LblUsuario.Text = DbRowVenta("Nombre").ToString() - LblFechaRegistro.Text = DbRowVenta("FechaIng").ToString().ToDate.ToShortDateString - LblSeTimbro.Text = DbRowVenta("SeTimbro").ToString() - LblMail.Text = DbRowVenta("EnvioMail").ToString() - TxtFechaPago.Text = DbRowVenta("FechaVencimiento").ToString() - TxtFechaVencimientoCotizacion.Text = Vigencia - TxtDet_OrdenCompra.Text = DbRowVenta("Det_OrdenCompra").ToString() - TxtDet_FechaOrdenCompra.Text = DbRowVenta("Det_FechaOrdenCompra").ToString() - HdnIVAOriginal.Value = TxtIVA.Text - TxtPedidoContrato.Text = DbRowVenta("PedidoContrato").ToString() - TxtPedidoContrato.Enabled = False - TxtKilometraje.Text = DbRowVenta("Kilometraje").ToString().PadLeft(6, "0"c) - - HdnAmortizacion.Value = LblAmort.Text.ToDouble.ToString() - HdnSubTotalDescuestos.Value = (TxtSubTotal.Text.Replace(",", "").ToDouble - LblDescuentos.Text.Replace(",", "").ToDouble - LblAmortizacion.Text.Trim.Replace(",", "").ToDouble - TxtRetISR.Text.Replace(",", "").ToDouble).FormatoNumero(2) - 'DdlAmortizacionConceptos.SelectedValue = DbRowVenta("AnticipoPosicion").ToString() - 'ChkAnticipoEnSubTotal.Checked = DbRowVenta("AnticipoEnSubTotal").ToString() = "True" - DdlTipoAmortizacionAnticipo.SelectedValueExist(DbRowVenta("CveTipoAmortizacionAnticipo")) - DdlTiposRelacion.SelectedValueExist(DbRowVenta("CveTipoRelacion")) - - 'Si es AMORTIZACIÓN ANTICIPO SOBRE FACTURA EN CERO no debe timbrar - If DbRowVenta("CveTipoAmortizacionAnticipo").ToString().ToEntero() = 3 Then - BtnEmitir.Visible = False - End If - - 'HdnAmortizacion.Value = LblAmort.Text.ToDouble.ToString() - 'HdnSubTotalDescuestos.Value = (TxtSubTotal.Text.Replace(",", "").ToDouble - LblDescuentos.Text.Replace(",", "").ToDouble - LblAmortizacion.Text.Trim.Replace(",", "").ToDouble - TxtRetISR.Text.Replace(",", "").ToDouble).FormatoNumero(2) - 'DdlAmortizacionConceptos.SelectedValue = DbRowVenta("AnticipoPosicion").ToString() - 'ChkAnticipoEnSubTotal.Checked = DbRowVenta("AnticipoEnSubTotal").ToString() = "True" - - - If DbRowVenta("CveTipoRelacion").ToString().ToEntero() > 0 Then - TrTipoRelacion2.Visible = True - LblTipoRelacion.Text = DbRowVenta("TipoRelacion").ToString() - HdnFolioFiscalNC.Value = DbRowVenta("FolioFiscalPadre").ToString() - - - - End If - - - TxtOrdenCompra.Text = DbRowVenta("OrdenCompra").ToString() - TxtOrdenCompra.Enabled = False - - TxtObsAlmacen.Text = DbRowVenta("ObservacionesAlmacen").ToString() - CvePAC = DbRowVenta("CvePAC").ToString().ToEntero() - - If DbRowVenta("Saldo").ToString().ToDecimal > 0 AndAlso UsuarioActual.TienePermisoProceso(204) AndAlso Not UsuarioActual.CveEmpresa.Contiene(119) Then - TxtFechaSaldarVenta.Text = TxtFecha.Text - CEFechaSaldarVenta.StartDate = TxtFecha.Text.ToDate - HLSaldarVenta.Visible = True - End If - - - If (UsuarioActual.TienePermisoProceso(166) Or UsuarioActual.CveRol = 1) AndAlso (LblFolioFiscal.Text = "" Or LblFolioFiscal.Text = "test") Then - LkEliminarFactura.Visible = True - End If - If (UsuarioActual.CveRol = 1) AndAlso (LblFolioFiscal.Text <> "") Then - LnkUUIDRelacionados.Visible = True - End If - - 'Envio Direccion - If DbRowVenta("CveDireccionEnvio").ToString().ToEntero() > 0 AndAlso DbRowVenta("CveDireccionEnvio").ToString() IsNot Nothing Then - ChkDireccionEnvio.Checked = True - DdlDireccionEnvio.SelectedValueExist(DbRowVenta("CveDireccionEnvio").ToString().ToEntero()) - 'DdlDireccionEnvio_SelectedIndexChanged(DdlDireccionEnvio, EventArgs.Empty) - DdlDireccionEnvio.Enabled = False - ChkDireccionEnvio.Enabled = False - DdlDireccionEnvio.Visible = True - trDireccionEnvio.Visible = True - If UsuarioActual.TienePermisoProceso(333) Then LnkEditarDir.Visible = True - End If - - 'ESTATUS FACTURA - If Not (CveRemision > 0 Or CveCotizacion > 0) Then - CveEstatus = DbRowVenta("CveEstatusFactura").ToString().ToEntero() - - End If - - TxtTipoCambio.Text = DbRowVenta("TipoCambio").ToString() - If DbRowVenta("UltimasFluctuaciones").ToString() <> "" Then - LblTCValuacion.Text = String.Format("Ult. Val:{0}", DbRowVenta("UltimasFluctuaciones").ToString()) - LblTCValuacion.Visible = True - End If - - ViewState("SelloCancelacion") = DbRowVenta("SelloCancelacion").ToString() - ViewState("FechaCancelacion") = DbRowVenta("FechaCancelacion").ToString().ToDateTime - TxtAtencionA.Text = DbRowVenta("AtencionA").ToString() - TxtTelefonoGenerico.Text = DbRowVenta("TelefonoGenerico").ToString() - CveVentaPadre = DbRowVenta("CveVentaPadre").ToString().ToEntero() - SerieFolioPadre = DbRowVenta("SerieFolioPadre").ToString() - - If DdlVendedor.SelectedValue.ToEntero() > 0 AndAlso Not UsuarioActual.TienePermisoProceso(161) Then - DdlVendedor.Enabled = False - End If - - If CveVentaPadre > 0 Then - If IsNothing(Request("CveDevolucion")) AndAlso IsNumeric(Request("CveDevolucion")) Then - DdlNCFactura.Visible = True - Else - DdlNCFactura.Visible = False - End If - trNCFactura.Visible = True - LblSerieFolioPadre.Visible = True - LblSerieFolioPadre.Text = String.Format("{1}", CveVentaPadre, SerieFolioPadre) - - End If - - TxtFechaEjecucion.Text = DbRowVenta("FechaEjecucion").ToString().ToDateTime.ToString("dd/MM/yyyy") - 'DdlSucursalEjecucion.SelectedValueExist(DbRowVenta("CveSucursalEjecucion").ToString()) - 'DdlSucursalCobranza.SelectedValueExist(DbRowVenta("CveSucursalCobranza").ToString()) - DdlSucursalCliente.SelectedValueExist(DbRowVenta("CveClienteSucursal").ToString()) - 'DdlSucursal.SelectedValueExist(DbRowVenta("CveSucursal").ToString()) - 'DdlSubProyectoDatos.SelectedValueExist(DbRowVenta("CveSubProyecto").ToString()) - - If DdlSubProyectoDatos.Items.Count = 0 Then - DdlSubProyectoDatos.Items.Insert(0, New ListItem("Seleccione", "-1")) - End If - DdlSubProyectoDatos.SelectedValueExistInsert(DbRowVenta("CveSubProyecto").ToString(), DbRowVenta("SubProyecto").ToString()) - DdlSubProyecto.SelectedValueExist(DbRowVenta("CveSubProyecto").ToString()) - - CargarAlmacenes() - - If DdlSubProyectoCobranza.Items.Count = 0 Then - DdlSubProyectoCobranza.Items.Insert(0, New ListItem("Seleccione", "-1")) - End If - DdlSubProyectoCobranza.SelectedValueExistInsert(DbRowVenta("CveSubProyectoCobranza").ToString(), GlobalDTSubProyectos(-1, DbRowVenta("CveSubProyectoCobranza").ToString().ToEntero()).FiltroPrimeroValor("SubProyecto").ToString()) - - If DdlSubProyectoEjecucion.Items.Count = 0 Then - DdlSubProyectoEjecucion.Items.Insert(0, New ListItem("Seleccione", "-1")) - End If - DdlSubProyectoEjecucion.SelectedValueExistInsert(DbRowVenta("CveSubProyectoEjecucion").ToString(), GlobalDTSubProyectos(-1, DbRowVenta("CveSubProyectoEjecucion").ToString().ToEntero()).FiltroPrimeroValor("SubProyecto").ToString()) - - CargaClienteSucursal(DbRowVenta("CveClienteSucursal").ToString().ToEntero()) - - If DbRowVenta("CveContrato").ToString().ToEntero() > 0 Then - CveContrato = DbRowVenta("CveContrato").ToString().ToEntero() - NumeroContrato = DbRowVenta("NumeroContrato").ToString() - DescripcionContrato = DbRowVenta("DescripcionContrato").ToString() - DdlContrato.Visible = False - HLContrato.Text = $"{DbRowVenta("NumeroContrato")} - {DbRowVenta("DescripcionContrato")}" - HLContrato.NavigateUrl = $"/Contratos/Contrato.aspx?CveContrato={CveContrato}" - 'trPresupuesto.Visible = True - 'HplPresupuesto.NavigateUrl = String.Format(" / Presupuestos / Presupuesto.aspx?CvePresupuesto={0}", DbRowVenta("CveContrato").ToString()) - Else - NumeroContrato = "" - DescripcionContrato = "" - End If - - 'DdlEstatus.Items.Remove(DdlEstatus.Items.FindByText("Cotización")) - - If DbRowVenta("SeTimbro").ToString() <> "No" Then - HplDownXML.Visible = True - 'If HLImprimir.Visible = False Then - HplDownPDF.Visible = True - 'End If - ElseIf UsuarioActual.Empresa.TipoFacturacion = "CBB" OrElse DdlTipoComprobante.SelectedValue = "Cot" Then - 'If drv("TipoEstatus").ToString().ToEntero() = 2 AndAlso drv("TipoDocto").ToString() = "Cot" Then - ' ImgDownPDF.Visible = True - 'Else - HplDownPDF.Visible = False - 'End If - ElseIf UsuarioActual.Empresa.TipoFacturacion = "CFDi" AndAlso DbRowVenta("SeTimbro").ToString() = "No" AndAlso DbRowVenta("CveEstatusFactura").ToString() = "2" AndAlso DbRowVenta("TipoDocto").ToString().Contiene("Ing", "Egs", "Dev", "Ant") Then - TrEmitir.Visible = True - If TxtFecha.Text.ToDate < Now.AddDays(-3) Then - TxtFecha.Enabled = True - End If - End If - - 'NO DEBE IMPRIMIR PDF DE COTIZACION - If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso DbRowVenta("TipoDocto").ToString() = "Cot" Then - HplDownPDF.Visible = False - End If - - If DbRowVenta("SeTimbro").ToString() = "Si" Then - TrEmitir.Visible = False - End If - - 'CargaAcuseCancelacion - If DbRowVenta("CveEstatusFactura").ToString().Contiene("5", "20") Then - ImgDownCancelacion.Visible = True - ImgDownCancelacion.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=CAN&CVEVTA={0}", CveVenta))) - End If - IdPoliza = DbRowVenta("IdPoliza").ToString().ToEntero() - - 'Carga si es Contabilizada - If IdPoliza > 0 Then - HLContabilizada.Text = "Si" - HLContabilizada.NavigateUrl = $"/Contabilidad/RegPoliza.aspx?IdPoliza={DbRowVenta("IdPoliza")}" - trContabilizada.Visible = True - If UsuarioActual.TienePermisoProceso(107) Then BtnDescontabilizar.Visible = True - - Else - 'cuando no este contabilizada y usa AC, habilita el boton para generar la poliza - If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso UsuarioActual.Empresa.UsaAC AndAlso UsuarioActual.CveRol = 1 Then - BtnGenerarPoliza.Visible = True - End If - If UsuarioActual.Empresa.Funcionalidad(200) = "1" Then - BtnContabilizar.Visible = True - End If - End If - - If DbRowVenta("IdPolizaCancelacion").ToString().ToEntero() > 0 Then - HPLContaCancelacion.Text = "Cancelación" - HPLContaCancelacion.NavigateUrl = String.Format("/Contabilidad/RegPoliza.aspx?IdPoliza={0}", DbRowVenta("IdPolizaCancelacion")) - trContabilizada.Visible = True - End If - - - If UsuarioActual.Empresa.UsaOS AndAlso DbRowVenta("CveOS").ToString().ToEntero() = 0 Then - BtnGenerarOS.Visible = True - BtnGenerarOS.OnClientClick = String.Format("javascriptwindow.location.href = '/OS/OrdenesServicios.aspx?CveVenta={0}'; return false;", CveVenta) - ' BtnGenerarOS.OnClientClick = String.Format("/OS/OrdenesServicios.aspx?CveVenta={0}", CveVenta) - End If - - - '[IPP] COMENTADO 12/MARZO/2018 -SABRA QUE SE QUERIA ESCONDER - 'If DbRowVenta("TipoDocto").ToString() = "Rem" Then - ' GvPS.Columns(11).Visible = False - ' GvPS.Columns(12).Visible = False - 'End If - - - 'Ocultamos los botones Clonar y Ordenar - GvPS.Columns(19).Visible = False - GvPS.Columns(20).Visible = False - - 'CargaFirmas - If ObjVentas.GetVentasFirmas(CveVenta) Then - If ObjVentas.DtResultados.Rows.Count > 0 Then - DTmpF = ObjVentas.DtResultados - GvFirmas.DataSource = ObjVentas.DtResultados - GvFirmas.DataBind() - Else - GvFirmas.DataSource = Nothing - End If - End If - - 'CARGA IMPUESTOS LOCALES - If ObjVentas.GetVentaImpuestosLocales(CveVenta) Then - If ObjVentas.DtResultados.Rows.Count > 0 Then - TrOtros.Visible = True - TmpDTImpuestos = ObjVentas.DtResultados - GvImpuestosLocales2.DataSource = ObjVentas.DtResultados - GvImpuestosLocales2.DataBind() - - GvImpuestosLocales2.Enabled = False - GvImpuestosLocales2.Visible = True - End If - End If - - DdlVendedor.SelectedValue = If(DbRowVenta("CveVendedor").ToString = "", "0", DbRowVenta("CveVendedor").ToString) 'si viene dbnull, que ponga cero. - DdlTipoComprobante.Enabled = False - 'TxtDocto.Enabled = False - - 'PORLET CLIENTE - 'DESACTIVA CAMBIO DE CLIENTE - HlCliente.Attributes.Remove("class") - HlCliente.Attributes.Add("class", "Texto disabled") - TxtCodigo.ReadOnly = True - ChkEnviarFactura.Enabled = False - ChkDireccionEnvio.Enabled = False - TxtAtencionA.Enabled = False - TxtFechaVencimientoCotizacion.Enabled = False - - TxtCantidad.Enabled = False - DdlClasificacion.Enabled = False - - DdlPS.Enabled = False - TxtObsPS.Enabled = False - DdlProyecto.Enabled = False - DdlSubProyecto.Enabled = False - TxtPrecio.Enabled = False - ImgDescPU.Attributes.Clear() - ImgDescTotal.Attributes.Clear() - ImgDescConcepto.Attributes.Clear() - LbAgregar.Enabled = False - LnkAgregarPyME.Enabled = False - DdlCuentasTerminal.Enabled = False - - For Each Row As GridViewRow In GvPS.Rows - Row.FCLiteral("LtlConsecutivo").Text = (Row.RowIndex + 1).ToString() - Next - GvPS.Columns(ColumnaEditar).HeaderText = "" - GvPS.Columns(ColumnaEliminar).HeaderText = "" - 'GvPS.Columns(ColumnaEliminar).Visible = False - - TxtObsFact.Enabled = False - TxtObsAlmacen.Enabled = False - TxtMotivoDescuento.Enabled = False - 'GvLeyendasFiscales.Enabled = False - TxtSubTotal.ReadOnly = True - TxtIVA.ReadOnly = True - TxtRetIVA.ReadOnly = True - TxtRetISR.ReadOnly = True - TxtIEPS.ReadOnly = True - TxtTotal.ReadOnly = True - - 'Sección Detalle - DdlMoneda.Enabled = False - DdlTipoRetencion.Enabled = False - TxtFechaEjecucion.ReadOnly = True - ImgCalendarFechaEje.Enabled = False - 'DdlSucursalEjecucion.Enabled = False - 'DdlSucursalCobranza.Enabled = False - DdlVendedor.Enabled = False - DdlSucursalCliente.Enabled = False - TxtTiempoEntrega.Enabled = False - TxtAlfa1.ReadOnly = True - TxtAlfa2.ReadOnly = True - TxtAlfa3.ReadOnly = True - TxtNum1.ReadOnly = True - TxtNum2.ReadOnly = True - TxtNum3.ReadOnly = True - TxtFech1.ReadOnly = True : ImgFech1.Enabled = False - TxtFech2.ReadOnly = True : ImgFech2.Enabled = False - TxtFech3.ReadOnly = True : ImgFech3.Enabled = False - ChkConvertirDoctoPesos.Enabled = False - ChkConvertirDolares.Enabled = False - - TxtTipoCambio.Enabled = UsuarioActual.CveEmpresa.Contiene(13, 83) - TxtTipoCambioDlls.Enabled = UsuarioActual.CveEmpresa.Contiene(13, 83) - TxtTipoCambio.ReadOnly = Not UsuarioActual.CveEmpresa.Contiene(13, 83) - TxtTipoCambioDlls.ReadOnly = Not UsuarioActual.CveEmpresa.Contiene(13, 83) - - 'Condiciones de Pago - RBLPago.Enabled = False - DdlFormaPago33.Enabled = False - DdlUsoCFDI.Enabled = False - DdlMetodoPago33.Enabled = False - 'TxtNumCtaPago.Enabled = False - If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem", "Cot") Then - TxtFechaPago.ReadOnly = Not UsuarioActual.TienePermisoProceso(260) - LnkUpdateFechaVencimiento.Visible = UsuarioActual.TienePermisoProceso(260) - Else - TxtFechaPago.ReadOnly = False - End If - - imgCalendario.Enabled = False - DdlFuenteRecaudacion.Enabled = False - - TrVistaPrevia.Visible = False - BtnEmitirImprimir.Visible = False - 'CargaLeyendasFiscales - ViewState("VentaFolio") = If(LblSerie.Text.Trim.Length = 0, TxtFolio.Text.Trim, LblSerie.Text.Trim & "-" & TxtFolio.Text.Trim) - - CalculaTotalesVenta(False) - - 'JJMQ 20160506: Se agrego para la validacion de pago de contado. - 'CVImporteContado.ValueToCompare = TxtTotal.Text.Replace(",", "") - - 'CARGA ANTICIPOS - If Not (CveRemision > 0 Or CveCotizacion > 0) Then - If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem") Then - 'carga as notas de credito vinculadas - If ObjVentas.GetVentasAntNC(CveVenta, -1) Then - GvAntNC.DataSource = ObjVentas.DtResultados - TmpDTDocumentosRelacionados = ObjVentas.DtResultados - GvAntNC.Caption = "
    (Anticipos/NC/IxC) Vinculados
    " - GvAntNC.DataBind() + Objeto.Dispose() End If - End If - If DdlTipoComprobante.SelectedValue.Contiene("Egs", "Dev", "Ant") Then - Dim AplicaAmortizacion As Boolean = False - If DdlTipoComprobante.SelectedValue.Contiene("Ant") Then AplicaAmortizacion = True - - If ObjVentas.GetVentasAntNC(-1, CveVenta, AplicaAmortizacion) Then - GvNC.DataSource = ObjVentas.DtResultados - TmpDTNCVinculadas = ObjVentas.DtResultados - GvNC.Caption = "
    Ventas Aplicadas
    " - GvNC.DataBind() - InicializaDTVentasNC() - For Each Dr As DataRow In ObjVentas.DtResultados.Rows - If Dr("CveConceptoContable").ToString().ToEntero() = 91 Then - CargaNCDT(Dr("CveVenta").ToString().ToEntero(), Dr("Importe").ToString().ToDecimal, Dr("FolioFiscal").ToString(), TC:=Dr("TipoCambio").ToString().ToDecimal) + 'SI LA AUTORIZACION ES POR PERMISO, BUSCA QUE EL USUARIO TENGA EL PERMISO PARA AUTORIZAR + If UsuarioActual.Empresa.Funcionalidad(135) = "2" Then + 'Reviso cuales son los supervisores + If UsuarioActual.TienePermisoProceso(116) Then + LkCotizacionAutorizar.Visible = True + If TipoEstatus = 2 Then + LkCotizacionAutorizar.Visible = False + ElseIf TipoEstatus = 5 Then + LkCotizacionAutorizar.Visible = False End If - Next + End If End If - End If - End If - If GvNC.Rows.Count > 0 Then + Case "Ant" + Trsaldo.Visible = True + HplSaldoAuxiliar.NavigateUrl = String.Format("/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxCClientes&CveCliente={0}&CveVenta={1}&TB_iframe=true&height=550&width=920", DbRowVenta("CveCliente"), DbRowVenta("CveVenta")) + HplPagado.NavigateUrl = String.Format("/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxCClientes&CveCliente={0}&CveVenta={1}&TB_iframe=true&height=550&width=920", DbRowVenta("CveCliente"), DbRowVenta("CveVenta")) + 'LkNotaCredito.Visible = True + HplDownXML.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=FactVta&CVEVENTA={0}&EXT={1}&SERIEFOLIO={2}&TIPODOCTO={3}", CveVenta, "XML", DbRowVenta("SerieFolio"), DbRowVenta("TipoDocto")))) + 'visualizo el saldo de anticipos, para cuando se aplique una Nota de crédito, decida si afecta anticipos o a DSV + LblNCSaldoAnticipo.Visible = True + ChkAplicaNCAnticipo.Visible = True + ChkAplicaNCAnticipo.Checked = True + If SaldoVenta > 0 And UsuarioActual.TienePermisoProceso(100) Then + HLPagar.Visible = True + HLPagar.NavigateUrl = $"/Bancos/PopIEVentas.aspx?CveVenta={CveVenta}&TB_iframe=true&height=500&width=675" + HlCuentaTerminal.Visible = True + End If + Me.SaldoAnticipo = DbRowVenta("SaldoAnticipo").ToString().ToDecimal + If SaldoAnticipo > 0 Then + InicializaDTAnticiposAmortizacion() + ChkAplicaNCAnticipo.Enabled = False + Else + ChkAplicaNCAnticipo.Enabled = False + ChkAplicaNCAnticipo.Checked = False + End If + 'If DbRowVenta("SaldoAnticipo").ToString().ToDouble <= 0 Then ChkAplicaNCAnticipo.Checked = False : ChkAplicaNCAnticipo.Enabled = False + LblNCSaldoAnticipo.Text = String.Format("Saldo Anticipo: $ {0}", DbRowVenta("SaldoAnticipo").ToString().ToDouble.FormatoNumero) + Case "Dev" + DdlTipoComprobante.Items.Insert(0, New ListItem("Devolucion", "Dev")) + HplDownXML.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=FactVta&CVEVENTA={0}&EXT={1}&SERIEFOLIO={2}&TIPODOCTO={3}", CveVenta, "XML", DbRowVenta("SerieFolio"), DbRowVenta("TipoDocto")))) + HdnFolioFiscalNC.Value = DbRowVenta("FolioFiscalPadre").ToString() + 'ViewState("CveDevolucion") = DbRowVenta("CveVentaPadre").ToString().ToEntero() + Trsaldo.Visible = True + HplSaldoAuxiliar.NavigateUrl = String.Format("/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxCClientes&CveCliente={0}&CveVenta={1}&TB_iframe=true&height=550&width=920", DbRowVenta("CveCliente"), DbRowVenta("CveVenta")) + HplPagado.NavigateUrl = String.Format("/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxCClientes&CveCliente={0}&CveVenta={1}&TB_iframe=true&height=550&width=920", DbRowVenta("CveCliente"), DbRowVenta("CveVenta")) + Case "Ped" + DdlTipoComprobante.Items.Insert(0, New ListItem("Pedido", "Ped")) + Case "DPe" + DdlTipoComprobante.Items.Insert(5, New ListItem("Devolución de perdido", "DPe")) + Case "PeC" + DdlTipoComprobante.Items.Insert(5, New ListItem("Pedido de Consignación", "PeC")) + Case "PA" + If UsuarioActual.TienePermisoProceso(199) Then + BtnGenerarRemision.Visible = If(CveEstatus = 16, True, False) + Else + BtnGenerarRemision.Visible = False + End If + CvePedidoA = CveVenta + DiasCredito = DbRowVenta("DiasCredito").ToString().ToEntero() + EsDiasCreditoFijo = CBool(DbRowVenta("EsDiasCreditoFijo").ToString()) + Case "Pd2" + CvePedido2 = CveVenta + BtnGeneraAutorizacion.Visible = If(CveEstatus <> 21, True, False) + If UsuarioActual.TienePermisoProceso(199) Then + BtnGenerarRemision.Visible = If(CveEstatus <> 21, True, False) + Else + BtnGenerarRemision.Visible = False + End If + End Select + + DdlTipoComprobante.SelectedValue = DbRowVenta("TipoDocto").ToString() + + End If + + DdlTipoRelacionARelacionar.SelectedValueExist(DbRowVenta("CveTipoRelacion").ToString()) + + 'contado 0, credito 1, terminal 2 + If DbRowVenta("CondicionesPago").ToString().ToEntero() = 1 Then + RBLPago.SelectedValue = "1" + RBLPago_SelectedIndexChanged(Nothing, Nothing) + UPCondicionesPago.Update() + ElseIf DbRowVenta("CondicionesPago").ToString().ToEntero() = 0 Then + RBLPago.SelectedValue = "2" + RBLPago.Items(0).Enabled = False + RBLPago_SelectedIndexChanged(Nothing, Nothing) + UPCondicionesPago.Update() + Else + DdlCuentasTerminal.SelectedValue = DbRowVenta("CveCuentaTerminal").ToString() + RBLPago.SelectedValue = "3" + RBLPago.Items(0).Enabled = False + RBLPago_SelectedIndexChanged(Nothing, Nothing) + UPCondicionesPago.Update() + End If + + + 'ESCONDE ACCIONES + LnkRemisiones.Visible = False + LnkPedido2SinFacturar.Visible = False + LnkCotizaciones.Visible = False + LnkOCs.Visible = False + UpnTools.Update() + + DivEstatusFac.Visible = True + HdnCveCliente.Value = CveCliente.ToString() + ViewState("CveCliente") = CveCliente + ViewState("CveEmpresaCRM") = DbRowVenta("CveEmpresaCRM").ToString().ToEntero() + ViewState("CveAcercamientoCRM") = DbRowVenta("CveAcercamientoCRM").ToString().ToEntero() + Entrega = DbRowVenta("Entrega").ToString() + Vigencia = DbRowVenta("Vigencia").ToString().ToDate.ToShortDateString + HplSaldoAuxiliar.Text = DbRowVenta("Saldo").ToString().FormatoNumero(2) + If Not HplSaldoAuxiliar.Text.ToDouble > 0 Then + HplSaldoAuxiliar.Visible = False + HplPagado.Visible = True + Dim EsCancelado = GlobalDTEstatusFactura().FiltroPrimeroValor("TipoEstatus", $"CveEstatusFactura = {CveEstatus}").ToEntero() = 5 + If EsCancelado Then + HplPagado.Text = "CANCELADO" + End If + If ViewState("CveCotizacion") IsNot Nothing AndAlso ViewState("CveCotizacion").ToString().ToEntero() > 0 AndAlso DdlTipoComprobante.SelectedValue = "Ing" Then + ImgAntiPend.Visible = True + Else ImgAntiPend.Visible = False End If - 'CARGA REMISIONES - If ObjVentas.GetRemisionesRelacionadas(CveVenta, DdlTipoComprobante.SelectedValue) Then - GvRemisiones.Caption = "
    Remisiones/Facturas
    " - GvRemisiones.DataSource = ObjVentas.DtResultados - GvCancelarRemisiones.DataSource = ObjVentas.DtResultados + End If + HdnPagado.Value = DbRowVenta("Pagado").ToString() + TxtTotal.Text = DbRowVenta("Total").ToString().FormatoNumero(2) + HdnVentaSaldo.Value = (SaldoVenta).ToString() + CvePrePoliza = DbRowVenta("CvePrePoliza").ToString().ToEntero() + CveVentaFacturada = DbRowVenta("CveVentaFacturada").ToString().ToEntero() - GvRemisiones.DataBind() - GvCancelarRemisiones.DataBind() + CveVentaRelacion = DbRowVenta("CveVentaRelacion").ToString().ToEntero() + ImporteRelacion = DbRowVenta("ImporteRelacion").ToString().ToDouble - '[IPP] SI ES REMISION PARA CANCELARLA NO DEBE TENER NINGUNA FACTURADA RELACIONADA - 24Abril2018 - If DdlTipoComprobante.SelectedValue.Contiene("Rem") And GvRemisiones.Rows.Count > 0 Then - LbCancelarDocumento.Visible = False - End If - - 'SI TIENE REMISIONES Y VA A CANCELAR ES NECESARIO EL MOVIMIENTO DE DEVOLUCION - If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant") AndAlso GvRemisiones.Rows.Count > 0 Then - ChkDevAlm.Checked = True - ChkDevAlm.Enabled = False - 'LiDevolucionAlmacen.Visible = False - End If + DdlMoneda.SelectedValue = DbRowVenta("CveMoneda").ToString() + CambiaMoneda() + If DbRowVenta("TipoDocto").ToString() = "Pd2" Then + 'CANTIDAD FACTURADA + If TmpDT.SUM("CantidadFacturadaPed2") > 0 Then + GvPS.Columns(7).Visible = True + ThCantidadFacturada.Visible = True + ThCantidadFacturada2.Visible = True + Else + GvPS.Columns(7).Visible = False + ThCantidadFacturada.Visible = False + ThCantidadFacturada2.Visible = False End If - tdVigencia.Visible = DdlTipoComprobante.SelectedValue.Contiene("Cot") - tdFechaVigencia.Visible = DdlTipoComprobante.SelectedValue.Contiene("Cot") + ''ACTIVA EDITAR + ''SOLO LA PUEDE EDITAR USUATIOACTUAL-VENDEDOR | NO DEBE ESTAR FACTURADA + 'If (UsuarioActual.CveUsuario = DbRowVenta("CveUsuario").ToString().ToEntero() Or UsuarioActual.CveVendedor = DdlVendedor.SelectedValue.ToEntero()) And TmpDT.SUM("CantidadFacturadaCot") = 0 Then 'And TmpDT.SUM("CantidadFacturadaCot") < TmpDT.SUM("Cantidad") + ' BtnPermisoEditarCotizacion.Visible = True + 'End If - If DbRowVenta("TipoDocto").ToString() = "Rem" Then - 'CANTIDAD FACTURADA - If TmpDT.SUM("CantidadFacturadaRem") > 0 Then - GvPS.Columns(6).Visible = True - ThCantidadFacturadaRem.Visible = True - ThCantidadFacturadaRem2.Visible = True - Else - GvPS.Columns(6).Visible = False - ThCantidadFacturadaRem.Visible = False - ThCantidadFacturadaRem2.Visible = False - End If - - 'ACTIVA EDITAR - 'SOLO LA PUEDE EDITAR CON PROCESO | DEBE TENER CONCEPTOS PENDIENTES DE FACTURAR - If UsuarioActual.TienePermisoProceso(202) And TmpDT.SUM("CantidadFacturadaRem") < TmpDT.SUM("Cantidad") Then - BtnPermisoEditarRemision.Visible = True - End If - - 'ACTIVA BOTONERA | DEBE TENER CONCEPTOS PENDIENTES DE FACTURAR - If TmpDT.SUM("CantidadFacturadaRem") < TmpDT.SUM("Cantidad") Then - BtnsFacturar.Visible = True - - LBFacturarAnticipo.Visible = UsuarioActual.TienePermisoProceso(274) - - 'ACTIVA CONVERSION DE MONEDA - If DdlMoneda.SelectedValue.ToEntero() = 1 Then - TrConversionDolares.Visible = True - ChkConvertirDolares.Enabled = Not UsuarioActual.TienePermisoProceso(324) - TxtTipoCambioDlls.Enabled = True - Else - TrConversionTipoCambio.Visible = True - ChkConvertirDoctoPesos.Enabled = Not UsuarioActual.TienePermisoProceso(324) - TxtTipoCambio.Enabled = True - End If - End If - - 'Si es Empresa de Acumuladores - If CveVenta > 0 AndAlso UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso DbRowVenta("TipoDocto").ToString() = "Rem" AndAlso (GlobalDTEstatusFactura().FiltroPrimeroValor("TipoEstatus", $"CveEstatusFactura = {Me.CveEstatus}").ToEntero() <> 5) Then - - BtnsFacturar.Visible = False - - Dim DtUsadosPendientes As DataTable = Nothing - Dim DtGarantiasPendientes As DataTable = Nothing - - Dim ObjUsados As New ClsVentas - - If ObjUsados.GetVentasUsados(CveVenta, -1, DbRowVenta("Fecha").ToString().ToDateTime, UsuarioActual.CveEmpresa) Then - DtUsadosPendientes = ObjUsados.DtResultados.Copy() - End If - - If ObjUsados.GetVentasGarantiaPendiente(CveVenta, Now, UsuarioActual.CveEmpresa) Then - DtGarantiasPendientes = ObjUsados.DtResultados.Copy() - End If - - 'If ObjUsados.GetVentasGarantiaPendiente(CveVenta, -1, Now, UsuarioActual.CveEmpresa) Then - ' DtGarantiasPendientes = ObjUsados.DtResultados.Copy() - 'End If - ObjUsados.Dispose() - - 'Si ya se surtió y recibió - If DbRowVenta("SaldoAlmacen").ToString().ToDecimal > 0 OrElse TmpDT.MAX("CveTipoPS") = "1" Then - BtnsFacturar.Visible = True - End If - - 'VERIFICA SI YA SE FACTURO COMPLETAMENTE - If TmpDT.SUM("CantidadFacturadaRem") = TmpDT.SUM("Cantidad") Then - BtnsFacturar.Visible = False - End If - - 'VERIFICA SI TIENE USADOS O GARANTIAS PENDIENTES - If BtnsFacturar.Visible Then - If (Not EsGarantia AndAlso (DtUsadosPendientes IsNot Nothing AndAlso DtUsadosPendientes.Rows.Count > 0)) Then - BtnsFacturar.Visible = False - Alert("Tiene usados pendiente de recibir", TipoMensaje.MsgAdvertencia) - End If - - If (EsGarantia AndAlso (DtGarantiasPendientes IsNot Nothing AndAlso DtGarantiasPendientes.Rows.Count > 0)) Then - Alert("Tiene garantías pendientes de recibir", TipoMensaje.MsgAdvertencia) - BtnsFacturar.Visible = False - End If - End If + 'ACTIVA BOTONERA | DEBE TENER CONCEPTOS PENDIENTES DE FACTURAR + 'If TmpDT.SUM("CantidadFacturadaPed2") < TmpDT.SUM("Cantidad") Then + ' BtnGenerarRemision.Visible = If(CveEstatus = 10, False, True) + ' BtnsFacturar.Visible = True + 'End If + ElseIf DbRowVenta("TipoDocto").ToString() = "Cot" AndAlso CveCotizacion > 0 Then + CveEstatusCotizacion = DbRowVenta("CveEstatusFactura").ToString().ToEntero() + End If - LBFacturarAnticipo.Visible = UsuarioActual.TienePermisoProceso(274) - End If + If CveEmpresaCRM > 0 And Not CveCliente > 0 Then + CargaEmpresaCRM(CveEmpresaCRM) + Else + CveEmpresaCRM = IIf(CveEmpresaCRM > 0, CveEmpresaCRM, 0).ToString().ToEntero() + CargaCliente(CveCliente, -1) 'Estatus activo, se requiere para cargar una factura en la que el cliente a sido eliminado + End If + ViewState("CveAlmacenTransitorio") = DbRowVenta("CveAlmacenTraspasoDestino").ToString().ToEntero() + DevolucionAlmacen = DbRowVenta("EsDevolucionVenta").ToString().ToEntero() + + 'sino esta cargada la información del metodo de pago que le corresponde, la recarga para que se le pueda asignar + If DdlMetodoPago33.SelectedValue <> DbRowVenta("CveMetodoPago33").ToString() Then + CargaFormaPago(DbRowVenta("CveMetodoPago33").ToString().ToEntero()) + End If + DdlMetodoPago33.SelectedValueExist(DbRowVenta("CveMetodoPago33").ToString()) + DdlFormaPago33.SelectedValueExist(DbRowVenta("CveFormaPago33").ToString().ToEntero()) + + Me.CveMetodoPago33Venta = DbRowVenta("CveMetodoPago33").ToString().ToEntero() + Me.CveFormaPago33Venta = DbRowVenta("CveFormaPago33").ToString().ToEntero() + Me.CveVendedorVenta = DbRowVenta("CveVendedor").ToString().ToEntero() + + 'SI YA TIENE UN VALOR ASIGNADO SELECCIONA EL GUARDADO + 'If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso Me.CveVenta > 0 AndAlso Me.CveVendedorVenta > 0 Then + ' Dim Vendedor = GlobalDTVendedores(UsuarioActual.CveEmpresa, VendedorTipo:=1).FiltroPrimeroValor("Vendedor", String.Format("CveVendedor = {0}", Me.CveVendedorVenta)) + ' 'SI NO ENCUENTRA BUSCA EN LOS VENDEDORES DEL PV + ' If String.IsNullOrEmpty(Vendedor) Then + ' Vendedor = GlobalDTVendedores(UsuarioActual.CveEmpresa, VendedorTipo:=4).FiltroPrimeroValor("Vendedor", String.Format("CveVendedor = {0}", Me.CveVendedorVenta)) + ' End If + ' DdlVendedor.SelectedValueExistInsert(Me.CveVendedorVenta, Vendedor) + 'End If + + If DdlFormaPago33.SelectedValue <> DbRowVenta("CveFormaPago33").ToString() And DbRowVenta("CveFormaPago33").ToString() <> "" Then + 'sino está seleccionada la asginada la debe de cargar + Dim Nombre As String = GlobalDTVtaFormaPago().FiltroPrimeroValor("FormaPagoSAT", String.Format("CveFormaPago={0}", DbRowVenta("CveFormaPago33"))) + DdlFormaPago33.Items.Add(New ListItem(Nombre, DbRowVenta("CveFormaPago33").ToString())) + DdlFormaPago33.SelectedValueExist(DbRowVenta("CveFormaPago33").ToString().ToEntero()) + End If + + DdlUsoCFDI.SelectedValueExist(DbRowVenta("CveUsoCFDI").ToString()) + + If UsuarioActual.CveEmpresa = 126 Then CargaOrdenProduccion(2, CveVenta) + + If DbRowVenta("CveTipoRelacion").ToString().ToEntero() > 0 Then + TrTipoRelacion.Visible = True + DdlTiposRelacion.SelectedValueExist(DbRowVenta("CveTipoRelacion").ToString().ToEntero()) + + 'RELACIONAR ANTICIPOS APLICADOS + If DbRowVenta("CveTipoRelacion").ToString().ToEntero() = 7 AndAlso DtAntRelacionados IsNot Nothing AndAlso DtAntRelacionados.Rows.Count > 0 Then + DdlTipoRelacionAnticipo.SelectedValueExist(7) + ListaAnticiposAplicados = New List(Of MAnticipoRelacionado)() + For Each RowAnt As DataRow In DtAntRelacionados.Rows + ListaAnticiposAplicados.Add(New MAnticipoRelacionado() With {.CveVenta = RowAnt("CveVentaRelacionada").ToString().ToEntero(), .FolioFiscal = RowAnt("FolioFiscal").ToString()}) + Next + Else + HdnFolioFiscalNC.Value = DbRowVenta("FolioFiscalPadre").ToString() + End If + End If + + If DbRowVenta("Saldo").ToString().ToDouble < 0.01 Then + If ViewState("CveCotizacion") IsNot Nothing AndAlso ViewState("CveCotizacion").ToString().ToEntero() > 0 AndAlso DdlTipoComprobante.SelectedValue = "Ing" Then + ImgAntiPend.Visible = True + Else + ImgAntiPend.Visible = False + End If + ElseIf Opcion <> "Op" Then + ImgAntiPend.Visible = True + End If + If UsuarioActual.CveRol.Contiene(1, 1155) Then LiLnkGuias.Visible = True + + LiComplementoPago.Visible = True + + + ViewState("FolioFiscal") = DbRowVenta("FolioFiscal").ToString() + + SerieVenta = DbRowVenta("Serie").ToString() + LblSerie.Text = SerieVenta + ViewState("Serie") = DbRowVenta("Serie").ToString() + ViewState("Folio") = DbRowVenta("Folio").ToString().ToEntero() + TxtFolio.Text = DbRowVenta("Folio").ToString() + 'TxtDocto.Text = DbRowVenta("Ref").ToString() + 'TxtNumCtaPago.Text = DbRowVenta("NumeroCuenta").ToString() + LblFolioFiscal.Text = DbRowVenta("FolioFiscal").ToString() + TxtFecha.Text = DbRowVenta("Fecha").ToString() + TxtSubTotal.Text = DbRowVenta("SubTotal").ToString().FormatoNumero(2) + LblDescuentos.Text = DbRowVenta("Descuento").ToString().FormatoNumero(2) + LblAmortizacion.Text = DbRowVenta("Amortizacion").ToString().FormatoNumero(2) + TxtSubTotal2.Text = (TxtSubTotal.Text.Replace(",", "").Trim.Trim.ToDouble - LblDescuentos.Text.Replace(",", "").Trim.Trim.ToDouble - LblAmortizacion.Text.Replace(",", "").Trim.Trim.ToDouble).FormatoNumero(2) + TxtIVA.Text = DbRowVenta("IVA").ToString().FormatoNumero(2) + TxtRetIVA.Text = DbRowVenta("RetIVA").ToString().FormatoNumero(2) + TxtCorreoNotificaciones.Text = DbRowVenta("CorreoNotificacion").ToString() + + If TxtRetIVA.Text.ToDecimal() > 0 Then + TrRetIVA.Style.Add("display", "") + UsuarioActual.Empresa.MostrarRetIVA = True + If DdlTipoRetencion.SelectedValue.ToEntero() > 0 Then + DdlTipoRetencion.Visible = True + End If + If TmpDT IsNot Nothing Then + Dim PorcentajeRetIVA = (TmpDT.MAX("PorcentajeRetIVA").ToDecimal() * 100) + LblRetIVA.Text = PorcentajeRetIVA.FormatoNumero(2) End If - If DbRowVenta("TipoDocto").ToString().Contiene("Cot", "Pd2") Then - 'CANTIDAD FACTURADA - If TmpDT.SUM("CantidadFacturadaCot") > 0 Then - GvPS.Columns(7).Visible = True - ThCantidadFacturada.Visible = True - ThCantidadFacturada2.Visible = True - Else - GvPS.Columns(7).Visible = False - ThCantidadFacturada.Visible = False - ThCantidadFacturada2.Visible = False - End If + End If + TxtRetISR.Text = DbRowVenta("RetISR").ToString().FormatoNumero(2) + TxtIEPS.Text = DbRowVenta("IEPS").ToString().FormatoNumero(2) + TrIEPS.Visible = TxtIEPS.Text.ToDouble > 0 + TxtTotal.Text = DbRowVenta("Total").ToString().FormatoNumero(2) + HdnTotalVenta.Value = DbRowVenta("Total").ToString().FormatoNumero(2) + TxtMotivoDescuento.Text = DbRowVenta("MotivoDescuento").ToString() + TxtObsFact.Text = DbRowVenta("Observaciones").ToString() + LblUsuario.Text = DbRowVenta("Nombre").ToString() + LblFechaRegistro.Text = DbRowVenta("FechaIng").ToString().ToDate.ToShortDateString + LblSeTimbro.Text = DbRowVenta("SeTimbro").ToString() + LblMail.Text = DbRowVenta("EnvioMail").ToString() + TxtFechaPago.Text = DbRowVenta("FechaVencimiento").ToString() + TxtFechaVencimientoCotizacion.Text = Vigencia + TxtDet_OrdenCompra.Text = DbRowVenta("Det_OrdenCompra").ToString() + TxtDet_FechaOrdenCompra.Text = DbRowVenta("Det_FechaOrdenCompra").ToString() + HdnIVAOriginal.Value = TxtIVA.Text + TxtPedidoContrato.Text = DbRowVenta("PedidoContrato").ToString() + TxtPedidoContrato.Enabled = False + TxtKilometraje.Text = DbRowVenta("Kilometraje").ToString().PadLeft(6, "0"c) - 'ACTIVA EDITAR - 'SOLO LA PUEDE EDITAR USUATIOACTUAL-VENDEDOR | NO DEBE ESTAR FACTURADA - If (UsuarioActual.CveUsuario = DbRowVenta("CveUsuario").ToString().ToEntero() Or UsuarioActual.CveVendedor = DdlVendedor.SelectedValue.ToEntero()) And TmpDT.SUM("CantidadFacturadaCot") = 0 Then 'And TmpDT.SUM("CantidadFacturadaCot") < TmpDT.SUM("Cantidad") - BtnPermisoEditarCotizacion.Visible = True - End If + HdnAmortizacion.Value = LblAmort.Text.ToDouble.ToString() + HdnSubTotalDescuestos.Value = (TxtSubTotal.Text.Replace(",", "").ToDouble - LblDescuentos.Text.Replace(",", "").ToDouble - LblAmortizacion.Text.Trim.Replace(",", "").ToDouble - TxtRetISR.Text.Replace(",", "").ToDouble).FormatoNumero(2) + 'DdlAmortizacionConceptos.SelectedValue = DbRowVenta("AnticipoPosicion").ToString() + 'ChkAnticipoEnSubTotal.Checked = DbRowVenta("AnticipoEnSubTotal").ToString() = "True" + DdlTipoAmortizacionAnticipo.SelectedValueExist(DbRowVenta("CveTipoAmortizacionAnticipo")) + DdlTiposRelacion.SelectedValueExist(DbRowVenta("CveTipoRelacion")) - 'SOLO LA PUEDE EDITAR USUATIOACTUAL-VENDEDOR | NO DEBE ESTAR FACTURADA - If UsuarioActual.TienePermisoProceso(281) And TmpDT.SUM("CantidadFacturadaCot") = 0 Then 'And TmpDT.SUM("CantidadFacturadaCot") < TmpDT.SUM("Cantidad") - BtnPermisoEditarCotizacion.Visible = True - End If + 'Si es AMORTIZACIÓN ANTICIPO SOBRE FACTURA EN CERO no debe timbrar + If DbRowVenta("CveTipoAmortizacionAnticipo").ToString().ToEntero() = 3 Then + BtnEmitir.Visible = False + End If - 'ACTIVA BOTONERA | DEBE TENER CONCEPTOS PENDIENTES DE FACTURAR - VerificarBtnFacturarCotizacion(DbRowVenta("CveVendedor").ToString().ToEntero()) + 'HdnAmortizacion.Value = LblAmort.Text.ToDouble.ToString() + 'HdnSubTotalDescuestos.Value = (TxtSubTotal.Text.Replace(",", "").ToDouble - LblDescuentos.Text.Replace(",", "").ToDouble - LblAmortizacion.Text.Trim.Replace(",", "").ToDouble - TxtRetISR.Text.Replace(",", "").ToDouble).FormatoNumero(2) + 'DdlAmortizacionConceptos.SelectedValue = DbRowVenta("AnticipoPosicion").ToString() + 'ChkAnticipoEnSubTotal.Checked = DbRowVenta("AnticipoEnSubTotal").ToString() = "True" + + + If DbRowVenta("CveTipoRelacion").ToString().ToEntero() > 0 Then + TrTipoRelacion2.Visible = True + LblTipoRelacion.Text = DbRowVenta("TipoRelacion").ToString() + HdnFolioFiscalNC.Value = DbRowVenta("FolioFiscalPadre").ToString() + End If + + + TxtOrdenCompra.Text = DbRowVenta("OrdenCompra").ToString() + TxtOrdenCompra.Enabled = False + + TxtObsAlmacen.Text = DbRowVenta("ObservacionesAlmacen").ToString() + CvePAC = DbRowVenta("CvePAC").ToString().ToEntero() + + If DbRowVenta("Saldo").ToString().ToDecimal > 0 AndAlso UsuarioActual.TienePermisoProceso(204) AndAlso Not UsuarioActual.CveEmpresa.Contiene(119) Then + TxtFechaSaldarVenta.Text = TxtFecha.Text + CEFechaSaldarVenta.StartDate = TxtFecha.Text.ToDate + HLSaldarVenta.Visible = True + End If + + + If (UsuarioActual.TienePermisoProceso(166) Or UsuarioActual.CveRol = 1) AndAlso (LblFolioFiscal.Text = "" Or LblFolioFiscal.Text = "test") Then + LkEliminarFactura.Visible = True + End If + If (UsuarioActual.CveRol = 1) AndAlso (LblFolioFiscal.Text <> "") Then + LnkUUIDRelacionados.Visible = True + End If + + 'Envio Direccion + If DbRowVenta("CveDireccionEnvio").ToString().ToEntero() > 0 AndAlso DbRowVenta("CveDireccionEnvio").ToString() IsNot Nothing Then + ChkDireccionEnvio.Checked = True + DdlDireccionEnvio.SelectedValueExist(DbRowVenta("CveDireccionEnvio").ToString().ToEntero()) + 'DdlDireccionEnvio_SelectedIndexChanged(DdlDireccionEnvio, EventArgs.Empty) + DdlDireccionEnvio.Enabled = False + ChkDireccionEnvio.Enabled = False + DdlDireccionEnvio.Visible = True + trDireccionEnvio.Visible = True + If UsuarioActual.TienePermisoProceso(333) Then LnkEditarDir.Visible = True + End If + + 'ESTATUS FACTURA + If Not (CveRemision > 0 Or CveCotizacion > 0) Then + CveEstatus = DbRowVenta("CveEstatusFactura").ToString().ToEntero() + + End If + + TxtTipoCambio.Text = DbRowVenta("TipoCambio").ToString() + If DbRowVenta("UltimasFluctuaciones").ToString() <> "" Then + LblTCValuacion.Text = String.Format("Ult. Val:{0}", DbRowVenta("UltimasFluctuaciones").ToString()) + LblTCValuacion.Visible = True + End If + + ViewState("SelloCancelacion") = DbRowVenta("SelloCancelacion").ToString() + ViewState("FechaCancelacion") = DbRowVenta("FechaCancelacion").ToString().ToDateTime + TxtAtencionA.Text = DbRowVenta("AtencionA").ToString() + TxtTelefonoGenerico.Text = DbRowVenta("TelefonoGenerico").ToString() + CveVentaPadre = DbRowVenta("CveVentaPadre").ToString().ToEntero() + SerieFolioPadre = DbRowVenta("SerieFolioPadre").ToString() + + If DdlVendedor.SelectedValue.ToEntero() > 0 AndAlso Not UsuarioActual.TienePermisoProceso(161) Then + DdlVendedor.Enabled = False + End If + + If CveVentaPadre > 0 Then + If IsNothing(Request("CveDevolucion")) AndAlso IsNumeric(Request("CveDevolucion")) Then + DdlNCFactura.Visible = True + Else + DdlNCFactura.Visible = False End If + trNCFactura.Visible = True + LblSerieFolioPadre.Visible = True + LblSerieFolioPadre.Text = String.Format("{1}", CveVentaPadre, SerieFolioPadre) - If UsuarioActual.Empresa.Funcionalidad(280) = "1" Then - RblPaqueteria.SelectedValue = If(DbRowVenta("FormaPaqueteria").ToString = "", "1", DbRowVenta("FormaPaqueteria").ToString) - RblPaqueteria.Enabled = False + End If + + TxtFechaEjecucion.Text = DbRowVenta("FechaEjecucion").ToString().ToDateTime.ToString("dd/MM/yyyy") + 'DdlSucursalEjecucion.SelectedValueExist(DbRowVenta("CveSucursalEjecucion").ToString()) + 'DdlSucursalCobranza.SelectedValueExist(DbRowVenta("CveSucursalCobranza").ToString()) + DdlSucursalCliente.SelectedValueExist(DbRowVenta("CveClienteSucursal").ToString()) + 'DdlSucursal.SelectedValueExist(DbRowVenta("CveSucursal").ToString()) + 'DdlSubProyectoDatos.SelectedValueExist(DbRowVenta("CveSubProyecto").ToString()) + + If DdlSubProyectoDatos.Items.Count = 0 Then + DdlSubProyectoDatos.Items.Insert(0, New ListItem("Seleccione", "-1")) + End If + DdlSubProyectoDatos.SelectedValueExistInsert(DbRowVenta("CveSubProyecto").ToString(), DbRowVenta("SubProyecto").ToString()) + DdlSubProyecto.SelectedValueExist(DbRowVenta("CveSubProyecto").ToString()) + + CargarAlmacenes() + + If DdlSubProyectoCobranza.Items.Count = 0 Then + DdlSubProyectoCobranza.Items.Insert(0, New ListItem("Seleccione", "-1")) + End If + DdlSubProyectoCobranza.SelectedValueExistInsert(DbRowVenta("CveSubProyectoCobranza").ToString(), GlobalDTSubProyectos(-1, DbRowVenta("CveSubProyectoCobranza").ToString().ToEntero()).FiltroPrimeroValor("SubProyecto").ToString()) + + If DdlSubProyectoEjecucion.Items.Count = 0 Then + DdlSubProyectoEjecucion.Items.Insert(0, New ListItem("Seleccione", "-1")) + End If + DdlSubProyectoEjecucion.SelectedValueExistInsert(DbRowVenta("CveSubProyectoEjecucion").ToString(), GlobalDTSubProyectos(-1, DbRowVenta("CveSubProyectoEjecucion").ToString().ToEntero()).FiltroPrimeroValor("SubProyecto").ToString()) + + CargaClienteSucursal(DbRowVenta("CveClienteSucursal").ToString().ToEntero()) + + If DbRowVenta("CveContrato").ToString().ToEntero() > 0 Then + CveContrato = DbRowVenta("CveContrato").ToString().ToEntero() + NumeroContrato = DbRowVenta("NumeroContrato").ToString() + DescripcionContrato = DbRowVenta("DescripcionContrato").ToString() + DdlContrato.Visible = False + HLContrato.Text = $"{DbRowVenta("NumeroContrato")} - {DbRowVenta("DescripcionContrato")}" + HLContrato.NavigateUrl = $"/Contratos/Contrato.aspx?CveContrato={CveContrato}" + 'trPresupuesto.Visible = True + 'HplPresupuesto.NavigateUrl = String.Format(" / Presupuestos / Presupuesto.aspx?CvePresupuesto={0}", DbRowVenta("CveContrato").ToString()) + Else + NumeroContrato = "" + DescripcionContrato = "" + End If + + 'DdlEstatus.Items.Remove(DdlEstatus.Items.FindByText("Cotización")) + + If DbRowVenta("SeTimbro").ToString() <> "No" Then + HplDownXML.Visible = True + 'If HLImprimir.Visible = False Then + HplDownPDF.Visible = True + 'End If + ElseIf UsuarioActual.Empresa.TipoFacturacion = "CBB" OrElse DdlTipoComprobante.SelectedValue = "Cot" Then + 'If drv("TipoEstatus").ToString().ToEntero() = 2 AndAlso drv("TipoDocto").ToString() = "Cot" Then + ' ImgDownPDF.Visible = True + 'Else + HplDownPDF.Visible = False + 'End If + ElseIf UsuarioActual.Empresa.TipoFacturacion = "CFDi" AndAlso DbRowVenta("SeTimbro").ToString() = "No" AndAlso DbRowVenta("CveEstatusFactura").ToString() = "2" AndAlso DbRowVenta("TipoDocto").ToString().Contiene("Ing", "Egs", "Dev", "Ant") Then + TrEmitir.Visible = True + If TxtFecha.Text.ToDate < Now.AddDays(-3) Then + TxtFecha.Enabled = True End If + End If - If UsuarioActual.CveEmpresa = 48 Then - TxtFecha.AutoPostBack = True - End If + 'NO DEBE IMPRIMIR PDF DE COTIZACION + If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso DbRowVenta("TipoDocto").ToString() = "Cot" Then + HplDownPDF.Visible = False + End If - CargaCodigoUnico() + If DbRowVenta("SeTimbro").ToString() = "Si" Then + TrEmitir.Visible = False + End If - 'SI ES COTIZACION PUEDE GENERAR UNA OC PARA MODIFICAR LOS IMPORTES - If DdlTipoComprobante.SelectedValue = "Cot" AndAlso UsuarioActual.Empresa.Funcionalidad(583) = "1" Then - Dim DtOCGeneradas As DataTable = Nothing - If ObjVentas.GetVentasCotizacionesOC(Me.CveVenta, -1, UsuarioActual.CveEmpresa) Then - DtOCGeneradas = ObjVentas.DtResultados.Copy() - End If - If DtOCGeneradas IsNot Nothing AndAlso DtOCGeneradas.Rows.Count > 0 Then - LtGenerarOC.Visible = False - Else - LtGenerarOC.Visible = True - End If - End If + 'CargaAcuseCancelacion + If DbRowVenta("CveEstatusFactura").ToString().Contiene("5", "20") Then + ImgDownCancelacion.Visible = True + ImgDownCancelacion.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=CAN&CVEVTA={0}", CveVenta))) + End If + IdPoliza = DbRowVenta("IdPoliza").ToString().ToEntero() - DdlTipoRetencion.SelectedValueExist(DbRowVenta("CveTipoRetencion").ToString()) - - Me.FacturarSucursal = CBool(DbRowVenta("FacturarSucursal").ToString()) - - If Me.FacturarSucursal Then - HabilitarFacturacionSucursal() - End If - - CargaPS(-1, DdlPS) - - 'CARGA GV DE OC RELACIONADAS - If CveVenta > 0 AndAlso ObjVentas.GetOCRelacionadas(CveVenta) Then - If ObjVentas.DtResultados.Rows.Count > 0 Then - DivOCRelacionadas.Visible = True - GvOCRelacionadas.DataSource = ObjVentas.DtResultados - - End If - End If - GvOCRelacionadas.DataBind() - - - 'Verifico si tiene la funcionalidad (135) - If DdlTipoComprobante.SelectedValue = "Cot" AndAlso UsuarioActual.Empresa.Funcionalidad(135).Contiene("1", "2") Then - - Select Case UsuarioActual.Empresa.Funcionalidad(135) - Case "1" ' POR SUPERVISOR - Dim ObjVendedores As New ClsVtaVendedores - - If ObjVendedores.GetVendedores(UsuarioActual.CveEmpresa) Then - Dim DTVendedores As New DataTable - If DbRowVenta("CveVendedor").ToString().ToEntero() > 0 AndAlso UsuarioActual.CveVendedor > 0 Then - DTVendedores = ObjVendedores.DtResultados.FiltraParametros(String.Format("CveVendedor = {0}", DbRowVenta("CveVendedor").ToString())).FiltraParametros(String.Format("CveSupervisor = {0}", UsuarioActual.CveVendedor)) - End If - - 'Verifico si es su supervisor asignado - If DTVendedores.Rows.Count > 0 Then - If GlobalDTEstatusFactura().FiltroPrimeroValor("TipoEstatus", $"CveEstatusFactura = {Me.CveEstatus}").ToEntero() = 2 Then - BtnsFacturar.Visible = True - BtnGenerarRemision.Visible = True - Else - BtnsFacturar.Visible = False - BtnGenerarRemision.Visible = False - End If - End If - - DTVendedores.Dispose() - End If - ObjVendedores.Dispose() - - Case "2" ' POR PERMISO - If GlobalDTEstatusFactura().FiltroPrimeroValor("TipoEstatus", $"CveEstatusFactura = {Me.CveEstatus}").ToEntero() = 2 Then - BtnsFacturar.Visible = UsuarioActual.TienePermisoProceso(60) - If UsuarioActual.TienePermisoProceso(199) Then - BtnGenerarRemision.Visible = If(CveEstatus = 10, False, True) - Else - BtnGenerarRemision.Visible = False - End If - Else - BtnsFacturar.Visible = False - BtnGenerarRemision.Visible = False - End If - - End Select - - - End If - - If DdlTipoComprobante.SelectedValue = "Cot" Then - If GlobalDTEstatusFactura().FiltroPrimeroValor("TipoEstatus", $"CveEstatusFactura = {Me.CveEstatus}").ToEntero() = 5 Then - BtnsFacturar.Visible = False - BtnGenerarRemision.Visible = False - End If - End If - - If DdlTipoComprobante.SelectedValue = "Rem" Then - If GlobalDTEstatusFactura().FiltroPrimeroValor("TipoEstatus", $"CveEstatusFactura = {Me.CveEstatus}").ToEntero() = 5 Then - BtnsFacturar.Visible = False - BtnEmitirImprimir.Visible = False - BtnPermisoEditarRemision.Visible = False - End If - End If - - UpPS.Update() - UpContado.Update() - UpEstatus.Update() - Retorno = True + 'Carga si es Contabilizada + If IdPoliza > 0 Then + HLContabilizada.Text = "Si" + HLContabilizada.NavigateUrl = $"/Contabilidad/RegPoliza.aspx?IdPoliza={DbRowVenta("IdPoliza")}" + trContabilizada.Visible = True + If UsuarioActual.TienePermisoProceso(107) Then BtnDescontabilizar.Visible = True Else - ViewState("CveVenta") = -1 - Alert("El documento solicitado no existe, favor de revisar su búsqueda.", TipoMensaje.MsgAdvertencia) + 'cuando no este contabilizada y usa AC, habilita el boton para generar la poliza + If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso UsuarioActual.Empresa.UsaAC AndAlso UsuarioActual.CveRol = 1 Then + BtnGenerarPoliza.Visible = True + End If + If UsuarioActual.Empresa.Funcionalidad(200) = "1" Then + BtnContabilizar.Visible = True + End If End If + + If DbRowVenta("IdPolizaCancelacion").ToString().ToEntero() > 0 Then + HPLContaCancelacion.Text = "Cancelación" + HPLContaCancelacion.NavigateUrl = String.Format("/Contabilidad/RegPoliza.aspx?IdPoliza={0}", DbRowVenta("IdPolizaCancelacion")) + trContabilizada.Visible = True + End If + + + If UsuarioActual.Empresa.UsaOS AndAlso DbRowVenta("CveOS").ToString().ToEntero() = 0 Then + BtnGenerarOS.Visible = True + BtnGenerarOS.OnClientClick = String.Format("javascriptwindow.location.href = '/OS/OrdenesServicios.aspx?CveVenta={0}'; return false;", CveVenta) + ' BtnGenerarOS.OnClientClick = String.Format("/OS/OrdenesServicios.aspx?CveVenta={0}", CveVenta) + End If + + + '[IPP] COMENTADO 12/MARZO/2018 -SABRA QUE SE QUERIA ESCONDER + 'If DbRowVenta("TipoDocto").ToString() = "Rem" Then + ' GvPS.Columns(11).Visible = False + ' GvPS.Columns(12).Visible = False + 'End If + + + 'Ocultamos los botones Clonar y Ordenar + GvPS.Columns(19).Visible = False + GvPS.Columns(20).Visible = False + + GvFirmas.DataSource = DTmpF + GvFirmas.DataBind() + + If TmpDTImpuestos IsNot Nothing AndAlso TmpDTImpuestos.Rows.Count > 0 Then + TrOtros.Visible = True + GvImpuestosLocales2.DataSource = TmpDTImpuestos + GvImpuestosLocales2.DataBind() + + GvImpuestosLocales2.Enabled = False + GvImpuestosLocales2.Visible = True + End If + + DdlVendedor.SelectedValue = If(DbRowVenta("CveVendedor").ToString = "", "0", DbRowVenta("CveVendedor").ToString) 'si viene dbnull, que ponga cero. + DdlTipoComprobante.Enabled = False + 'TxtDocto.Enabled = False + + 'PORLET CLIENTE + 'DESACTIVA CAMBIO DE CLIENTE + HlCliente.Attributes.Remove("class") + HlCliente.Attributes.Add("class", "Texto disabled") + TxtCodigo.ReadOnly = True + ChkEnviarFactura.Enabled = False + ChkDireccionEnvio.Enabled = False + TxtAtencionA.Enabled = False + TxtFechaVencimientoCotizacion.Enabled = False + + TxtCantidad.Enabled = False + DdlClasificacion.Enabled = False + + DdlPS.Enabled = False + TxtObsPS.Enabled = False + DdlProyecto.Enabled = False + DdlSubProyecto.Enabled = False + TxtPrecio.Enabled = False + ImgDescPU.Attributes.Clear() + ImgDescTotal.Attributes.Clear() + ImgDescConcepto.Attributes.Clear() + LbAgregar.Enabled = False + LnkAgregarPyME.Enabled = False + DdlCuentasTerminal.Enabled = False + + For Each Row As GridViewRow In GvPS.Rows + Row.FCLiteral("LtlConsecutivo").Text = (Row.RowIndex + 1).ToString() + Next + GvPS.Columns(ColumnaEditar).HeaderText = "" + GvPS.Columns(ColumnaEliminar).HeaderText = "" + 'GvPS.Columns(ColumnaEliminar).Visible = False + + TxtObsFact.Enabled = False + TxtObsAlmacen.Enabled = False + TxtMotivoDescuento.Enabled = False + 'GvLeyendasFiscales.Enabled = False + TxtSubTotal.ReadOnly = True + TxtIVA.ReadOnly = True + TxtRetIVA.ReadOnly = True + TxtRetISR.ReadOnly = True + TxtIEPS.ReadOnly = True + TxtTotal.ReadOnly = True + + 'Sección Detalle + DdlMoneda.Enabled = False + DdlTipoRetencion.Enabled = False + TxtFechaEjecucion.ReadOnly = True + ImgCalendarFechaEje.Enabled = False + 'DdlSucursalEjecucion.Enabled = False + 'DdlSucursalCobranza.Enabled = False + DdlVendedor.Enabled = False + DdlSucursalCliente.Enabled = False + TxtTiempoEntrega.Enabled = False + TxtAlfa1.ReadOnly = True + TxtAlfa2.ReadOnly = True + TxtAlfa3.ReadOnly = True + TxtNum1.ReadOnly = True + TxtNum2.ReadOnly = True + TxtNum3.ReadOnly = True + TxtFech1.ReadOnly = True : ImgFech1.Enabled = False + TxtFech2.ReadOnly = True : ImgFech2.Enabled = False + TxtFech3.ReadOnly = True : ImgFech3.Enabled = False + ChkConvertirDoctoPesos.Enabled = False + ChkConvertirDolares.Enabled = False + + TxtTipoCambio.Enabled = UsuarioActual.CveEmpresa.Contiene(13, 83) + TxtTipoCambioDlls.Enabled = UsuarioActual.CveEmpresa.Contiene(13, 83) + TxtTipoCambio.ReadOnly = Not UsuarioActual.CveEmpresa.Contiene(13, 83) + TxtTipoCambioDlls.ReadOnly = Not UsuarioActual.CveEmpresa.Contiene(13, 83) + + 'Condiciones de Pago + RBLPago.Enabled = False + DdlFormaPago33.Enabled = False + DdlUsoCFDI.Enabled = False + DdlMetodoPago33.Enabled = False + 'TxtNumCtaPago.Enabled = False + If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem", "Cot") Then + TxtFechaPago.ReadOnly = Not UsuarioActual.TienePermisoProceso(260) + LnkUpdateFechaVencimiento.Visible = UsuarioActual.TienePermisoProceso(260) + Else + TxtFechaPago.ReadOnly = False + End If + + imgCalendario.Enabled = False + DdlFuenteRecaudacion.Enabled = False + + TrVistaPrevia.Visible = False + BtnEmitirImprimir.Visible = False + 'CargaLeyendasFiscales + ViewState("VentaFolio") = If(LblSerie.Text.Trim.Length = 0, TxtFolio.Text.Trim, LblSerie.Text.Trim & "-" & TxtFolio.Text.Trim) + + CalculaTotalesVenta(False) + + 'JJMQ 20160506: Se agrego para la validacion de pago de contado. + 'CVImporteContado.ValueToCompare = TxtTotal.Text.Replace(",", "") + + tdVigencia.Visible = DdlTipoComprobante.SelectedValue.Contiene("Cot") + tdFechaVigencia.Visible = DdlTipoComprobante.SelectedValue.Contiene("Cot") + + If DbRowVenta("TipoDocto").ToString() = "Rem" Then + 'CANTIDAD FACTURADA + If TmpDT.SUM("CantidadFacturadaRem") > 0 Then + GvPS.Columns(6).Visible = True + ThCantidadFacturadaRem.Visible = True + ThCantidadFacturadaRem2.Visible = True + Else + GvPS.Columns(6).Visible = False + ThCantidadFacturadaRem.Visible = False + ThCantidadFacturadaRem2.Visible = False + End If + + 'ACTIVA EDITAR + 'SOLO LA PUEDE EDITAR CON PROCESO | DEBE TENER CONCEPTOS PENDIENTES DE FACTURAR + If UsuarioActual.TienePermisoProceso(202) And TmpDT.SUM("CantidadFacturadaRem") < TmpDT.SUM("Cantidad") Then + BtnPermisoEditarRemision.Visible = True + End If + + 'ACTIVA BOTONERA | DEBE TENER CONCEPTOS PENDIENTES DE FACTURAR + If TmpDT.SUM("CantidadFacturadaRem") < TmpDT.SUM("Cantidad") Then + BtnsFacturar.Visible = True + + LBFacturarAnticipo.Visible = UsuarioActual.TienePermisoProceso(274) + + 'ACTIVA CONVERSION DE MONEDA + If DdlMoneda.SelectedValue.ToEntero() = 1 Then + TrConversionDolares.Visible = True + ChkConvertirDolares.Enabled = Not UsuarioActual.TienePermisoProceso(324) + TxtTipoCambioDlls.Enabled = True + Else + TrConversionTipoCambio.Visible = True + ChkConvertirDoctoPesos.Enabled = Not UsuarioActual.TienePermisoProceso(324) + TxtTipoCambio.Enabled = True + End If + End If + + 'Si es Empresa de Acumuladores + If CveVenta > 0 AndAlso UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso DbRowVenta("TipoDocto").ToString() = "Rem" AndAlso (GlobalDTEstatusFactura().FiltroPrimeroValor("TipoEstatus", $"CveEstatusFactura = {Me.CveEstatus}").ToEntero() <> 5) Then + + BtnsFacturar.Visible = False + + Dim DtUsadosPendientes As DataTable = Nothing + Dim DtGarantiasPendientes As DataTable = Nothing + + Dim ObjUsados As New ClsVentas + + If ObjUsados.GetVentasUsados(CveVenta, -1, DbRowVenta("Fecha").ToString().ToDateTime, UsuarioActual.CveEmpresa) Then + DtUsadosPendientes = ObjUsados.DtResultados.Copy() + End If + + If ObjUsados.GetVentasGarantiaPendiente(CveVenta, Now, UsuarioActual.CveEmpresa) Then + DtGarantiasPendientes = ObjUsados.DtResultados.Copy() + End If + + 'If ObjUsados.GetVentasGarantiaPendiente(CveVenta, -1, Now, UsuarioActual.CveEmpresa) Then + ' DtGarantiasPendientes = ObjUsados.DtResultados.Copy() + 'End If + + ObjUsados.Dispose() + + Dim SaldoAlmacenExA As Decimal = 0 + 'Dim SaldoAlmacenUsados As Decimal = 0 + + Using ObjInventarios As New ClsInventarios + 'VERIFICA SI HACE FALTA DEVOLVER PRODUCTOS Y USADOS EN ESPECIFICO + If ObjInventarios.GetSaldoVentaDetalleAlmacen(CveVenta, UsuarioActual.CveEmpresa) Then + SaldoAlmacenExA = ObjInventarios.DtResultados.SUMD("SaldoAlmacen", $"CveTipoAlmacen = 10") + 'SaldoAlmacenUsados = ObjInventarios.DtResultados.SUMD("SaldoAlmacen", $"CveTipoAlmacen = 22") + End If + End Using + + 'Si ya se surtió y recibió + If SaldoAlmacenExA > 0 OrElse TmpDT.MAX("CveTipoPS") = "1" Then + BtnsFacturar.Visible = True + End If + + 'VERIFICA SI YA SE FACTURO COMPLETAMENTE + If TmpDT.SUM("CantidadFacturadaRem") = TmpDT.SUM("Cantidad") Then + BtnsFacturar.Visible = False + End If + + 'VERIFICA SI TIENE USADOS O GARANTIAS PENDIENTES + If BtnsFacturar.Visible Then + If (Not EsGarantia AndAlso (DtUsadosPendientes IsNot Nothing AndAlso DtUsadosPendientes.Rows.Count > 0)) Then + BtnsFacturar.Visible = False + Alert("Tiene usados pendiente de recibir", TipoMensaje.MsgAdvertencia) + End If + + If (EsGarantia AndAlso (DtGarantiasPendientes IsNot Nothing AndAlso DtGarantiasPendientes.Rows.Count > 0)) Then + Alert("Tiene garantías pendientes de recibir", TipoMensaje.MsgAdvertencia) + BtnsFacturar.Visible = False + End If + End If + + + LBFacturarAnticipo.Visible = UsuarioActual.TienePermisoProceso(274) + End If + + End If + + If DbRowVenta("TipoDocto").ToString().Contiene("Cot", "Pd2") Then + 'CANTIDAD FACTURADA + If TmpDT.SUM("CantidadFacturadaCot") > 0 Then + GvPS.Columns(7).Visible = True + ThCantidadFacturada.Visible = True + ThCantidadFacturada2.Visible = True + Else + GvPS.Columns(7).Visible = False + ThCantidadFacturada.Visible = False + ThCantidadFacturada2.Visible = False + End If + + 'ACTIVA EDITAR + 'SOLO LA PUEDE EDITAR USUATIOACTUAL-VENDEDOR | NO DEBE ESTAR FACTURADA + If (UsuarioActual.CveUsuario = DbRowVenta("CveUsuario").ToString().ToEntero() Or UsuarioActual.CveVendedor = DdlVendedor.SelectedValue.ToEntero()) And TmpDT.SUM("CantidadFacturadaCot") = 0 Then 'And TmpDT.SUM("CantidadFacturadaCot") < TmpDT.SUM("Cantidad") + BtnPermisoEditarCotizacion.Visible = True + End If + + 'SOLO LA PUEDE EDITAR USUATIOACTUAL-VENDEDOR | NO DEBE ESTAR FACTURADA + If UsuarioActual.TienePermisoProceso(281) And TmpDT.SUM("CantidadFacturadaCot") = 0 Then 'And TmpDT.SUM("CantidadFacturadaCot") < TmpDT.SUM("Cantidad") + BtnPermisoEditarCotizacion.Visible = True + End If + + 'ACTIVA BOTONERA | DEBE TENER CONCEPTOS PENDIENTES DE FACTURAR + VerificarBtnFacturarCotizacion(DbRowVenta("CveVendedor").ToString().ToEntero()) + End If + + If UsuarioActual.Empresa.Funcionalidad(280) = "1" Then + RblPaqueteria.SelectedValue = If(DbRowVenta("FormaPaqueteria").ToString = "", "1", DbRowVenta("FormaPaqueteria").ToString) + RblPaqueteria.Enabled = False + End If + + If UsuarioActual.CveEmpresa = 48 Then + TxtFecha.AutoPostBack = True + End If + + CargaCodigoUnico() + + DdlTipoRetencion.SelectedValueExist(DbRowVenta("CveTipoRetencion").ToString()) + + Me.FacturarSucursal = CBool(DbRowVenta("FacturarSucursal").ToString()) + + If Me.FacturarSucursal Then + HabilitarFacturacionSucursal() + End If + + CargaPS(-1, DdlPS) + + 'Verifico si tiene la funcionalidad (135) + If DdlTipoComprobante.SelectedValue = "Cot" AndAlso UsuarioActual.Empresa.Funcionalidad(135).Contiene("1", "2") Then + + Select Case UsuarioActual.Empresa.Funcionalidad(135) + Case "1" ' POR SUPERVISOR + Dim ObjVendedores As New ClsVtaVendedores + + If ObjVendedores.GetVendedores(UsuarioActual.CveEmpresa) Then + Dim DTVendedores As New DataTable + If DbRowVenta("CveVendedor").ToString().ToEntero() > 0 AndAlso UsuarioActual.CveVendedor > 0 Then + DTVendedores = ObjVendedores.DtResultados.FiltraParametros(String.Format("CveVendedor = {0}", DbRowVenta("CveVendedor").ToString())).FiltraParametros(String.Format("CveSupervisor = {0}", UsuarioActual.CveVendedor)) + End If + + 'Verifico si es su supervisor asignado + If DTVendedores.Rows.Count > 0 Then + If GlobalDTEstatusFactura().FiltroPrimeroValor("TipoEstatus", $"CveEstatusFactura = {Me.CveEstatus}").ToEntero() = 2 Then + BtnsFacturar.Visible = True + BtnGenerarRemision.Visible = True + Else + BtnsFacturar.Visible = False + BtnGenerarRemision.Visible = False + End If + End If + + DTVendedores.Dispose() + End If + ObjVendedores.Dispose() + + Case "2" ' POR PERMISO + If GlobalDTEstatusFactura().FiltroPrimeroValor("TipoEstatus", $"CveEstatusFactura = {Me.CveEstatus}").ToEntero() = 2 Then + BtnsFacturar.Visible = UsuarioActual.TienePermisoProceso(60) + If UsuarioActual.TienePermisoProceso(199) Then + BtnGenerarRemision.Visible = If(CveEstatus = 10, False, True) + Else + BtnGenerarRemision.Visible = False + End If + Else + BtnsFacturar.Visible = False + BtnGenerarRemision.Visible = False + End If + + End Select + + + End If + + If DdlTipoComprobante.SelectedValue = "Cot" Then + If GlobalDTEstatusFactura().FiltroPrimeroValor("TipoEstatus", $"CveEstatusFactura = {Me.CveEstatus}").ToEntero() = 5 Then + BtnsFacturar.Visible = False + BtnGenerarRemision.Visible = False + End If + End If + + If DdlTipoComprobante.SelectedValue = "Rem" Then + If GlobalDTEstatusFactura().FiltroPrimeroValor("TipoEstatus", $"CveEstatusFactura = {Me.CveEstatus}").ToEntero() = 5 Then + BtnsFacturar.Visible = False + BtnEmitirImprimir.Visible = False + BtnPermisoEditarRemision.Visible = False + End If + End If + + UpPS.Update() + UpContado.Update() + UpEstatus.Update() + Retorno = True + End If - ObjVentas.Dispose() Return Retorno End Function @@ -26690,6 +26706,33 @@ Partial Class Ventas 'GvRemisionesNCBon.DataSource = Me.TmpDTRNCBonificacionesSeleccionadas 'GvRemisionesNCBon.DataBind() + Dim SaldoMaximoUtilizable As Decimal = 0 + + If CargarSoloGarantias Then + Dim SaldoMaximo As Decimal = DtNC.SUMD("Saldo", "TipoRNC = 1 AND EsGarantia = True") + If SaldoMaximo > 0 Then + SaldoMaximoUtilizable = SaldoMaximo + Else + SaldoMaximoUtilizable = 0 + End If + Else + Dim ObjAcum As New ClsAcumuladores + If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) Then + Dim RowUsadosNC As DataRow = ObjAcum.DtResultados.Rows(2) + DivSMU.Visible = True + + Dim SaldoMaximo As Decimal = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal() + If SaldoMaximo > 0 Then + SaldoMaximoUtilizable = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal() + Else + SaldoMaximoUtilizable = 0 + End If + + Else + SaldoMaximoUtilizable = 0 + End If + ObjAcum.Dispose() + End If If CveVentaUsado > 0 Then DivSMU.Visible = True @@ -26702,44 +26745,21 @@ Partial Class Ventas End Using If DtDetalleUsado IsNot Nothing Then - Dim SaldoMaximoUsados As Decimal = DtDetalleUsado.SUM("Total", "EsCargo = True").ToDecimal() + DtDetalleUsado.SUM("ImporteIVA", "EsCargo = True").ToDecimal() - HdnSaldoMaximoUsados.Value = SaldoMaximoUsados.ToString() - LtlSMU.Text = String.Format("{0:N2}", SaldoMaximoUsados) - End If - - Else - If CargarSoloGarantias Then - Dim SaldoMaximo As Decimal = DtNC.SUMD("Saldo", "TipoRNC = 1 AND EsGarantia = True") - If SaldoMaximo > 0 Then - HdnSaldoMaximoUsados.Value = SaldoMaximo.ToString() - LtlSMU.Text = SaldoMaximo.FormatoNumero(2) + Dim SaldoMaximoUsadosFactura As Decimal = DtDetalleUsado.SUM("Total", "EsCargo = True").ToDecimal() + DtDetalleUsado.SUM("ImporteIVA", "EsCargo = True").ToDecimal() + If SaldoMaximoUtilizable < SaldoMaximoUsadosFactura Then + HdnSaldoMaximoUsados.Value = SaldoMaximoUtilizable.ToString() + LtlSMU.Text = String.Format("{0:N2}", SaldoMaximoUtilizable) Else - HdnSaldoMaximoUsados.Value = "0" - LtlSMU.Text = "0" + HdnSaldoMaximoUsados.Value = SaldoMaximoUsadosFactura.ToString() + LtlSMU.Text = String.Format("{0:N2}", SaldoMaximoUsadosFactura) End If Else - Dim ObjAcum As New ClsAcumuladores - If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) Then - Dim RowUsadosNC As DataRow = ObjAcum.DtResultados.Rows(2) - DivSMU.Visible = True - - Dim SaldoMaximo As Decimal = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal() - If SaldoMaximo > 0 Then - HdnSaldoMaximoUsados.Value = RowUsadosNC("ValorConImpuestos").ToString() - LtlSMU.Text = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal().FormatoNumero(2) - Else - HdnSaldoMaximoUsados.Value = "0" - LtlSMU.Text = "0" - End If - - Else - 'DivSMU.Visible = False - HdnSaldoMaximoUsados.Value = "0" - LtlSMU.Text = "0" - End If - ObjAcum.Dispose() + HdnSaldoMaximoUsados.Value = SaldoMaximoUtilizable.ToString() + LtlSMU.Text = String.Format("{0:N2}", SaldoMaximoUtilizable) End If - + Else + HdnSaldoMaximoUsados.Value = SaldoMaximoUtilizable.ToString() + LtlSMU.Text = SaldoMaximoUtilizable.FormatoNumero(2) End If Else HdnSaldoMaximoUsados.Value = "0" @@ -26778,9 +26798,44 @@ Partial Class Ventas End If GvDescNCCargos.DataBind() - Dim SaldoMaximoUsados As Decimal = Me.TmpDT.SUM("Total", "EsCargo = True").ToDecimal() + Me.TmpDT.SUM("ImporteIVA", "EsCargo = True").ToDecimal() - HdnSaldoMaximoUsados.Value = SaldoMaximoUsados.ToString() - LblSaldoMaximoUsados.Text = String.Format("{0:N2}", SaldoMaximoUsados) + Dim SaldoMaximoUtilizable As Decimal = 0 + + If CargarSoloGarantias Then + Dim SaldoMaximo As Decimal = DtNC.SUMD("Saldo", "TipoRNC = 1 AND EsGarantia = True") + If SaldoMaximo > 0 Then + SaldoMaximoUtilizable = SaldoMaximo + Else + SaldoMaximoUtilizable = 0 + End If + Else + Dim ObjAcum As New ClsAcumuladores + If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) Then + Dim RowUsadosNC As DataRow = ObjAcum.DtResultados.Rows(2) + DivSMU.Visible = True + + Dim SaldoMaximo As Decimal = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal() + If SaldoMaximo > 0 Then + SaldoMaximoUtilizable = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal() + Else + SaldoMaximoUtilizable = 0 + End If + + Else + SaldoMaximoUtilizable = 0 + End If + ObjAcum.Dispose() + End If + + Dim SaldoMaximoUsadosFactura As Decimal = Me.TmpDT.SUM("Total", "EsCargo = True").ToDecimal() + Me.TmpDT.SUM("ImporteIVA", "EsCargo = True").ToDecimal() + + If SaldoMaximoUtilizable < SaldoMaximoUsadosFactura Then + HdnSaldoMaximoUsados.Value = SaldoMaximoUtilizable.ToString() + LblSaldoMaximoUsados.Text = String.Format("{0:N2}", SaldoMaximoUtilizable) + Else + HdnSaldoMaximoUsados.Value = SaldoMaximoUsadosFactura.ToString() + LblSaldoMaximoUsados.Text = String.Format("{0:N2}", SaldoMaximoUsadosFactura) + End If + Else HdnSaldoMaximoUsados.Value = "0" LblSaldoMaximoUsados.Text = "0" @@ -26820,6 +26875,27 @@ Partial Class Ventas GvRemisionesNCDetalle.DataBind() 'GvRemisionesNCBon.DataBind() + Dim SaldoMaximoUtilizable As Decimal = 0 + + If CargaSoloGarantias Then + Dim SaldoMaximo As Decimal = TmpDTRNCDetalle.SUMD("Total", "TipoRNC = 1") + If SaldoMaximo > 0 Then + SaldoMaximoUtilizable = SaldoMaximo + Else + SaldoMaximoUtilizable = 0 + End If + Else + Dim ObjAcum As New ClsAcumuladores + If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) Then + Dim RowUsadosNC As DataRow = ObjAcum.DtResultados.Rows(2) + DivSMU.Visible = True + SaldoMaximoUtilizable = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal() + Else + 'DivSMU.Visible = False + SaldoMaximoUtilizable = 0 + End If + ObjAcum.Dispose() + End If If CveVentaUsado > 0 Then DivSMU.Visible = True @@ -26833,49 +26909,26 @@ Partial Class Ventas If DtDetalleUsado IsNot Nothing Then Dim SaldoMaximoUsados As Decimal = DtDetalleUsado.SUM("Total", "EsCargo = True").ToDecimal() + DtDetalleUsado.SUM("ImporteIVA", "EsCargo = True").ToDecimal() + HdnSaldoMaximoUsados.Value = SaldoMaximoUtilizable.ToString() - If SaldoMaximoUsados > 0 Then + If SaldoMaximoUtilizable < SaldoMaximoUsados Then + HdnSaldoMaximoUsados.Value = SaldoMaximoUtilizable.ToString() + LtlSMU.Text = String.Format("{0:N2}", SaldoMaximoUtilizable) + Else HdnSaldoMaximoUsados.Value = SaldoMaximoUsados.ToString() LtlSMU.Text = String.Format("{0:N2}", SaldoMaximoUsados) - Else - HdnSaldoMaximoUsados.Value = "0" - LtlSMU.Text = "0" End If End If - Else - If CargaSoloGarantias Then - Dim SaldoMaximo As Decimal = TmpDTRNCDetalle.SUMD("Total", "TipoRNC = 1") - If SaldoMaximo > 0 Then - HdnSaldoMaximoUsados.Value = SaldoMaximo.ToString() - LtlSMU.Text = SaldoMaximo.FormatoNumero(2) - Else - HdnSaldoMaximoUsados.Value = "0" - LtlSMU.Text = "0" - End If - Else - Dim ObjAcum As New ClsAcumuladores - If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) Then - Dim RowUsadosNC As DataRow = ObjAcum.DtResultados.Rows(2) - DivSMU.Visible = True - HdnSaldoMaximoUsados.Value = RowUsadosNC("ValorConImpuestos").ToString() - LtlSMU.Text = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal().FormatoNumero(2) - Else - 'DivSMU.Visible = False - HdnSaldoMaximoUsados.Value = "0" - LtlSMU.Text = "0" - End If - ObjAcum.Dispose() - End If - + HdnSaldoMaximoUsados.Value = SaldoMaximoUtilizable.ToString() + LtlSMU.Text = SaldoMaximoUtilizable.FormatoNumero(2) End If UpModalRemisionesNC.Update() UpDescNC.Update() End Sub Private Sub CargaRNCDetalleDesc(Optional CargarSoloGarantias As Boolean = False) - Dim DtNC As DataTable = Nothing Dim ObjMovtos As New ClsMovimientos() If ObjMovtos.GetRemisionesNCCliente(CveCliente, True, CveMoneda:=-1) Then @@ -26896,14 +26949,42 @@ Partial Class Ventas End If GvDescNCCargosDetalle.DataBind() + Dim SaldoMaximoUtilizable As Decimal = 0 + + If CargarSoloGarantias Then + Dim SaldoMaximo As Decimal = TmpDTRNCDetalle.SUMD("Saldo", "TipoRNC = 1 AND EsGarantia = True") + If SaldoMaximo > 0 Then + SaldoMaximoUtilizable = SaldoMaximo + Else + SaldoMaximoUtilizable = 0 + End If + Else + Dim ObjAcum As New ClsAcumuladores + If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) Then + Dim RowUsadosNC As DataRow = ObjAcum.DtResultados.Rows(2) + DivSMU.Visible = True + + Dim SaldoMaximo As Decimal = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal() + If SaldoMaximo > 0 Then + SaldoMaximoUtilizable = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal() + Else + SaldoMaximoUtilizable = 0 + End If + + Else + SaldoMaximoUtilizable = 0 + End If + ObjAcum.Dispose() + End If + Dim SaldoMaximoUsados As Decimal = Me.TmpDT.SUM("Total", "EsCargo = True").ToDecimal() + Me.TmpDT.SUM("ImporteIVA", "EsCargo = True").ToDecimal() - If SaldoMaximoUsados > 0 Then + If SaldoMaximoUtilizable < SaldoMaximoUsados Then + HdnSaldoMaximoUsados.Value = SaldoMaximoUtilizable.ToString() + LblSaldoMaximoUsados.Text = String.Format("{0:N2}", SaldoMaximoUtilizable) + Else HdnSaldoMaximoUsados.Value = SaldoMaximoUsados.ToString() LblSaldoMaximoUsados.Text = String.Format("{0:N2}", SaldoMaximoUsados) - Else - HdnSaldoMaximoUsados.Value = "0" - LblSaldoMaximoUsados.Text = "0" End If UpDescNC.Update() @@ -26940,6 +27021,16 @@ Partial Class Ventas GvRemisionesNCBonDetalle.DataSource = TmpDTRNCDetalle.FiltraParametros("TipoRNC = 2") GvRemisionesNCBonDetalle.DataBind() + Dim SaldoMaximoUtilizable As Decimal = 0 + If TmpDTRNCBonificacionesSeleccionadas IsNot Nothing Then + Dim SaldoMaximo As Decimal = TmpDTRNCBonificacionesSeleccionadas.SUMD("Saldo") + If SaldoMaximo > 0 Then + SaldoMaximoUtilizable = SaldoMaximo + Else + SaldoMaximoUtilizable = 0 + End If + End If + If DdlVentaUsado.SelectedValue.ToEntero() > 0 Then Dim DtDetalleFactura As DataTable = Nothing Using ObjVentas As New ClsVentas @@ -26949,21 +27040,18 @@ Partial Class Ventas End Using Dim ImporteBon As Decimal = DtDetalleFactura.SUMD("PUBonificacion") * (1 + DtDetalleFactura.MAX("PorcentajeIVA").ToDecimal()) - LtlSMUBon.Text = String.Format("{0:N2}", ImporteBon) - HdnSMUBon.Value = ImporteBon.ToString() + If SaldoMaximoUtilizable < ImporteBon Then + LtlSMUBon.Text = String.Format("{0:N2}", SaldoMaximoUtilizable) + HdnSMUBon.Value = SaldoMaximoUtilizable.ToString() + Else + LtlSMUBon.Text = String.Format("{0:N2}", ImporteBon) + HdnSMUBon.Value = ImporteBon.ToString() + End If DtDetalleFactura.Dispose() Else - If TmpDTRNCBonificacionesSeleccionadas IsNot Nothing Then - Dim SaldoMaximo As Decimal = TmpDTRNCBonificacionesSeleccionadas.SUMD("Saldo") - If SaldoMaximo > 0 Then - HdnSMUBon.Value = SaldoMaximo.ToString() - LtlSMUBon.Text = SaldoMaximo.FormatoNumero(2) - Else - HdnSMUBon.Value = "0" - LtlSMUBon.Text = "0" - End If - End If + HdnSMUBon.Value = SaldoMaximoUtilizable.ToString() + LtlSMUBon.Text = SaldoMaximoUtilizable.FormatoNumero(2) End If UpModalRemisionesNC.Update() @@ -27077,6 +27165,9 @@ Partial Class Ventas 'LtlSMUBon.Text = String.Format("{0:N2}", SMUBon) 'HdnSMUBon.Value = SMUBon.ToString() + + Dim SaldoMaximoUtilizable As Decimal = TmpDTRNCBonificacionesSeleccionadas.SUMD("Saldo") + If DdlVentaUsado.SelectedValue.ToEntero() > 0 Then Dim DtDetalleFactura As DataTable = Nothing Using ObjVentas As New ClsVentas @@ -27086,15 +27177,20 @@ Partial Class Ventas End Using Dim ImporteBon As Decimal = DtDetalleFactura.SUMD("PUBonificacion") * (1 + DtDetalleFactura.MAX("PorcentajeIVA").ToDecimal()) - LtlSMUBon.Text = String.Format("{0:N2}", ImporteBon) - HdnSMUBon.Value = ImporteBon.ToString() + If SaldoMaximoUtilizable < ImporteBon Then + LtlSMUBon.Text = String.Format("{0:N2}", SaldoMaximoUtilizable) + HdnSMUBon.Value = SaldoMaximoUtilizable.ToString() + Else + LtlSMUBon.Text = String.Format("{0:N2}", ImporteBon) + HdnSMUBon.Value = ImporteBon.ToString() + End If + DtDetalleFactura.Dispose() Else - Dim SaldoMaximo As Decimal = TmpDTRNCBonificacionesSeleccionadas.SUMD("Saldo") - If SaldoMaximo > 0 Then - HdnSMUBon.Value = SaldoMaximo.ToString() - LtlSMUBon.Text = SaldoMaximo.FormatoNumero(2) + If SaldoMaximoUtilizable > 0 Then + HdnSMUBon.Value = SaldoMaximoUtilizable.ToString() + LtlSMUBon.Text = SaldoMaximoUtilizable.FormatoNumero(2) Else HdnSMUBon.Value = "0" LtlSMUBon.Text = "0" From a28cc5492db74445fc44ab0807bc7d84c3406632 Mon Sep 17 00:00:00 2001 From: JORGE LUIS CAUDILLO ESPARZA Date: Mon, 4 Jul 2022 10:47:41 -0700 Subject: [PATCH 03/11] --- App_Code/ClsNominas.vb | 23 + App_Code/ClsRH.vb | 16 +- Ashx/SIGWeb.ashx | 138 + Compras/PopUpVerFactura.aspx.vb | 97 +- GPS/ReciboNom.rdlc | 6663 +++++++++++++++++++ GPS/RepUnidades.aspx | 5 +- GPS/ReporteUnidadesnoTransmiten.aspx | 1 + General/SaldosIniciales.aspx.vb | 13 +- Metronic/assets/admin/layout/css/custom.css | 5 + Nomina/Nomina.aspx.cs | 14 +- RH/CatPersonal.aspx | 13 +- RH/Personal.aspx.vb | 2 +- Scripts/custom.js | 28 +- vwd.webinfo | 4 + 14 files changed, 6988 insertions(+), 34 deletions(-) create mode 100644 GPS/ReciboNom.rdlc diff --git a/App_Code/ClsNominas.vb b/App_Code/ClsNominas.vb index 97b0491bc..6eca35de7 100644 --- a/App_Code/ClsNominas.vb +++ b/App_Code/ClsNominas.vb @@ -3267,6 +3267,29 @@ Public Class ClsNominas Return retorno End Function + Public Function PreNominaTotalSemana(numeroPeriodo As Int32, cveEmpresa As Int32, cveSubProyecto As Int32, cveTipoNomina As Int32, tipoTrabajador As String, ejercicio As Int32, facturado As Boolean) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_RH_PreNominaTotalSemana", CommandType.StoredProcedure) + addParameters("@NumeroPeriodo", SqlDbType.Int, numeroPeriodo) + addParameters("@CveEmpresa", SqlDbType.Int, cveEmpresa) + addParameters("@CveSubProyecto", SqlDbType.Int, cveSubProyecto) + addParameters("@CveTipoNomina", SqlDbType.Int, cveTipoNomina) + addParameters("@TipoTrabajador", SqlDbType.VarChar, tipoTrabajador) + addParameters("@Ejercicio", SqlDbType.Int, ejercicio) + addParameters("@Facturado", SqlDbType.Bit, facturado) + retorno = RunQuery("Ocurrió un error al obtener el PA_RH_PreNominaTotalSemana.") + Return retorno + End Function + Public Function Embarque_TableroGet(cveEmpresa As Int32, cveSubproyecto As Int32, cveEstatus As Int32, cveCultivoCuadro As Int32) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_Agro_Embarque_TableroGet", CommandType.StoredProcedure) + addParameters("@CveEmpresa", SqlDbType.Int, cveEmpresa) + addParameters("@CveSubproyecto", SqlDbType.Int, cveSubproyecto) + addParameters("@CveEstatus", SqlDbType.Int, cveEstatus) + addParameters("@CveCultivoCuadro", SqlDbType.Int, cveCultivoCuadro) + retorno = RunQuery("Ocurrió un error al obtener el PA_Agro_Embarque_TableroGet.") + Return retorno + End Function #Region "IDisposable Support" ' IDisposable diff --git a/App_Code/ClsRH.vb b/App_Code/ClsRH.vb index 685365dad..338e50251 100644 --- a/App_Code/ClsRH.vb +++ b/App_Code/ClsRH.vb @@ -11,6 +11,13 @@ Public Class ClsRH #Region "Campos" 'SQL + + Private noguardoXcurp As Boolean = False + Public ReadOnly Property noguardoXcurpb As Boolean + Get + noguardoXcurpb = noguardoXcurp + End Get + End Property Private SqlConexion As SqlConnection Private SqlAdapter As SqlDataAdapter Private SqlTransacc As SqlTransaction @@ -1915,8 +1922,7 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo End Try Return Retorno - End Function - + End Function Public Function AddPersonal(Codigo As String, APaterno As String, AMaterno As String, Nombres As String, Correo As String, FechaIngreso As Date, CveTipoPeriodo As Integer, NumeroSS As String, SeInscribioSS As Boolean, SalarioDiarioPago As Double, SalarioDiario As Double, SDI As Double, SalarioDiarioSS As Double, Bono As Double, NumDiasAguinaldo As Integer, PorPrimaVacacional As Double, CveMetodoPago As Integer, FechaInicioContrato As Date, FechaFinContrato As String, CveTipoContrato As Integer, Ubicacion As String, CveTurno As Integer, CvePuesto As Integer, CveDepartamento As Integer, CveRuta As Integer, CveEscolaridad As Integer, @@ -1928,7 +1934,7 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo Optional Pensionado As Boolean = False, Optional CveMedioTransporte As Integer = -1, Optional CveRegistroPatronal As Integer = -1, Optional CveEmpresaAsignado As Integer = -1) As Boolean Dim Retorno As Boolean = False - + Dim noguardoXcurp = False SqlDataAdapter("PA_RH_PersonalAdd") With SqlAdapter.SelectCommand.Parameters @@ -2033,7 +2039,9 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo ElseIf Ex1.Message.Contains("Chk_RH_PersonalSalarioIMSS") Then Alert("El nuevo personal no se guardo debido a que se presento un problema al calcular el salario", TipoMensaje.MsgAdvertencia) GuardaLog(String.Format("{0} DESCRIPCIÓN DETALLADA: {1} {2} {3}", "Ocurrió un error al guardar el nuevo personal.", Ex1.ToString, vbCrLf, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())) - ElseIf Ex1.Message.Contains("dbo.Vw_Val_Nom_Curps") Then + ElseIf Ex1.Message.Contains("dbo.Vw_Val_Nom_Curps") Then + Retorno = True + noguardoXcurp = True Alert(String.Format("El nuevo personal no se guardo, ya existe un personal con esta curp '{0}'", CURP), TipoMensaje.MsgAdvertencia) GuardaLog(String.Format("{0} DESCRIPCIÓN DETALLADA: {1} {2} {3}", "Ocurrió un error al guardar el nuevo personal.", Ex1.ToString, vbCrLf, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())) Else diff --git a/Ashx/SIGWeb.ashx b/Ashx/SIGWeb.ashx index fb2ff5d71..b47839ef4 100644 --- a/Ashx/SIGWeb.ashx +++ b/Ashx/SIGWeb.ashx @@ -1529,6 +1529,144 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState xfile.SetAttributeValue("EXT", Path.GetExtension(urfile)) xfile.SetAttributeValue("urlfile", urfile) xfolder.Add(xfile) + Dim fecha As String = "" + Dim uuid As String = "" + If Path.GetExtension(urfile).ToUpper() = ".XML" Then + fecha = "" + uuid = "" + Dim settings As System.Xml.XmlReaderSettings = New System.Xml.XmlReaderSettings() + settings.ConformanceLevel = System.Xml.ConformanceLevel.Fragment + settings.IgnoreWhitespace = True + settings.IgnoreComments = True + Using xtr As System.Xml.XmlReader = System.Xml.XmlReader.Create(urfile, settings) + Dim canread As Boolean = True + Dim keyComprobante As String = "cfdi:Comprobante" + Dim keyCfdiRelacionados As String = "cfdi:CfdiRelacionados" + Dim keyEmisor As String = "cfdi:Emisor" + Dim keyReceptor As String = "cfdi:Receptor" + Dim keyConceptos As String = "cfdi:Conceptos" + Dim keyImpuestos As String = "cfdi:Impuestos" + Dim keyComplemento As String = "cfdi:Complemento" + xtr.Read() + + While xtr.Read() + If xtr.NodeType = System.Xml.XmlNodeType.Element AndAlso xtr.Name = keyComprobante Then + + Dim Nivel As Integer = xtr.Depth + Dim cont As Boolean = xtr.MoveToFirstAttribute() + While cont + + Select Case xtr.Name.ToUpper() + Case "XMLNS:CFDI" + 'xmlCFDI.comprobante.xmlns_cfdi = xtr.Value + Case "XMLNS:XSI" + 'xmlCFDI.comprobante.xmlns_xsi = xtr.Value + 'Case "XSI:SCHEMALOCATION" + ' xmlCFDI.comprobante.xsi_schemaLocation = xtr.Value + 'Case "VERSION" + ' xmlCFDI.comprobante.Version = xtr.Value + 'Case "SERIE" + ' xmlCFDI.comprobante.Serie = xtr.Value + 'Case "FOLIO" + ' xmlCFDI.comprobante.Folio = xtr.Value + Case "FECHA" + fecha = xtr.Value + 'Case "MONEDA" + ' xmlCFDI.comprobante.Moneda = xtr.Value + 'Case "SUBTOTAL" + ' Dim SubTotal As Decimal = 0 + ' Decimal.TryParse(xtr.Value, SubTotal) + ' xmlCFDI.comprobante.SubTotal = SubTotal + 'Case "TOTAL" + ' Dim Total As Decimal = 0 + ' Decimal.TryParse(xtr.Value, Total) + ' xmlCFDI.comprobante.Total = Total + 'Case "DESCUENTO" + ' Dim Descuento As Decimal = 0 + ' Decimal.TryParse(xtr.Value, Descuento) + ' xmlCFDI.comprobante.Descuento = Descuento + 'Case "TIPOCAMBIO" + ' Dim TipoCambio As Decimal = 0 + ' Decimal.TryParse(xtr.Value, TipoCambio) + ' xmlCFDI.comprobante.TipoCambio = TipoCambio + 'Case "TIPODECOMPROBANTE" + ' xmlCFDI.comprobante.TipoDeComprobante = xtr.Value + 'Case "FORMAPAGO" + ' xmlCFDI.comprobante.FormaPago = xtr.Value + 'Case "FORMADEPAGO" + ' xmlCFDI.comprobante.FormaPago = xtr.Value + 'Case "METODOPAGO" + ' xmlCFDI.comprobante.MetodoPago = xtr.Value + 'Case "METODODEPAGO" + ' xmlCFDI.comprobante.MetodoPago = xtr.Value + 'Case "CONDICIONESDEPAGO" + ' xmlCFDI.comprobante.CondicionesDePago = xtr.Value + 'Case "LUGAREXPEDICION" + ' xmlCFDI.comprobante.LugarExpedicion = xtr.Value + 'Case "CONFIRMACION" + ' xmlCFDI.comprobante.Confirmacion = xtr.Value + 'Case "NOCERTIFICADO" + ' xmlCFDI.comprobante.NoCertificado = xtr.Value + 'Case "SELLO" + ' xmlCFDI.comprobante.Sello = xtr.Value + 'Case "CERTIFICADO" + ' xmlCFDI.comprobante.Certificado = xtr.Value + End Select + + cont = xtr.MoveToNextAttribute() + End While + + cont = xtr.MoveToFirstAttribute() + While xtr.Read() AndAlso xtr.NodeType <> System.Xml.XmlNodeType.Element + End While + End If + + + + If xtr.NodeType = System.Xml.XmlNodeType.Element AndAlso xtr.Name = keyComplemento Then + Dim cDepth As Integer = xtr.Depth + While xtr.Read() AndAlso xtr.NodeType <> System.Xml.XmlNodeType.Element + End While + + While xtr.Read() AndAlso xtr.Depth > cDepth + + If xtr.NodeType = System.Xml.XmlNodeType.Element AndAlso xtr.LocalName = "TimbreFiscalDigital" Then + 'xmlCFDI.complemento.xmlns_tfd = xtr.GetAttribute("xmlns:tfd") + 'xmlCFDI.complemento.xsi_schemaLocation = xtr.GetAttribute("xsi:schemaLocation") + 'xmlCFDI.complemento.Version = xtr.GetAttribute("Version") + uuid = xtr.GetAttribute("UUID") + 'xmlCFDI.complemento.FechaTimbrado = xtr.GetAttribute("FechaTimbrado") + 'xmlCFDI.complemento.RfcProvCertif = xtr.GetAttribute("RfcProvCertif") + 'xmlCFDI.complemento.SelloCFD = If((xmlCFDI.comprobante.Version = "3.3" OrElse xmlCFDI.comprobante.Version = "4.0"), xtr.GetAttribute("SelloCFD"), xtr.GetAttribute("selloCFD")) + 'xmlCFDI.complemento.NoCertificadoSAT = If(xmlCFDI.comprobante.Version = "3.3", xtr.GetAttribute("NoCertificadoSAT"), xtr.GetAttribute("noCertificadoSAT")) + 'xmlCFDI.complemento.SelloSAT = If((xmlCFDI.comprobante.Version = "3.3" OrElse xmlCFDI.comprobante.Version = "4.0"), xtr.GetAttribute("SelloSAT"), xtr.GetAttribute("selloSAT")) + End If + + + End While + End If + End While + xtr.Close() + xtr. + End Using + If (System.IO.File.Exists(urfile)) Then + Dim fechita As DateTime = fecha.ToDateTime() + + Dim direct As String = $"C:\Users\caudi\Desktop\Nueva carpeta\APH20210302\{fechita:yyyyMMdd}\" + + If Not System.IO.Directory.Exists(direct) Then + System.IO.Directory.CreateDirectory(direct) + End If + Dim fileurl As String = $"{direct}{Path.GetFileName(urfile)}" + If uuid.Length Then + fileurl = $"{direct}{uuid}{Path.GetExtension(urfile)}" + End If + System.IO.File.Move(urfile, fileurl) + Dim x = "" + + End If + + End If Next xmlarchivos.Add(xfolder) diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index 052b64ca0..3dbb9b2f6 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -198,27 +198,110 @@ Partial Class PopUpVerFactura End If If Request("onlyPrint") IsNot Nothing Then - If Request("onlyPrint").ToString() = "Pallet" Then + If Request("onlyPrint").ToString() = "Pallet" AndAlso Not IsNothing(Request("CvePallet")) Then imprimirpallet2(Request("CvePallet").ToString.ToEntero()) End If - If Request("onlyPrint").ToString() = "PalletCaja" Then + If Request("onlyPrint").ToString() = "PalletCaja" AndAlso Not IsNothing(Request("CvePallet")) Then imprimirpallet(Request("CvePallet").ToString.ToEntero()) End If - If Request("onlyPrint").ToString() = "manifiesto" Then + If Request("onlyPrint").ToString() = "manifiesto" AndAlso Not IsNothing(Request("cveEmbarqueManifiesto")) Then imprimirManifiesto(Request("cveEmbarqueManifiesto").ToString.ToEntero()) End If - If Request("onlyPrint").ToString() = "manifiestoRemision" Then + If Request("onlyPrint").ToString() = "manifiestoRemision" AndAlso Not IsNothing(Request("cveEmbarqueManifiesto")) Then imprimirManifiestoRemision(Request("cveEmbarqueManifiesto").ToString.ToEntero()) End If - If Request("onlyPrint").ToString() = "manifiestoCartaPorte" Then + If Request("onlyPrint").ToString() = "manifiestoCartaPorte" AndAlso Not IsNothing(Request("cveEmbarqueManifiesto")) Then imprimirManifiestoCartaPorte(Request("cveEmbarqueManifiesto").ToString.ToEntero()) End If + + If Request("onlyPrint").ToString() = "rfctxtvalidar" Then + rfctxtvalidar() + End If + If Request("onlyPrint").ToString() = "Recibo" Then + ReciboAgropecuaria() + End If End If - End If + End If End Sub + Private Sub ReciboAgropecuaria() + Dim numeroPeriodo As Integer = 0 + Dim cveSubProyecto As Integer = -1 + Dim cveTipoNomina As Integer = -1 + Dim ejercicio As Integer = 0 + Dim cvePersonal As Integer = 0 + Dim tipoTrabajador As String = "" + Dim facturado As Boolean = False + If Not IsNothing(Request("numeroPeriodo")) Then + numeroPeriodo = Request("numeroPeriodo").ToString.ToEntero() + End If + If Not IsNothing(Request("ejercicio")) Then + ejercicio = Request("ejercicio").ToString.ToEntero() + End If + If Not IsNothing(Request("cvePersonal")) Then + cvePersonal = Request("cvePersonal").ToString.ToEntero() + End If + Dim params As New List(Of ReportParameter) + Dim lrds As New List(Of ReportDataSource) + Using objnom As New ClsNominas + If objnom.PreNominaTotalSemana(numeroPeriodo, UsuarioActual.CveEmpresa, cveSubProyecto, cveTipoNomina, tipoTrabajador, ejercicio, facturado) Then + Dim dt As New DataTable + dt = objnom.DtResultados.FiltraParametros("CvePersonal >0") + If (cvePersonal > 0) Then + dt = dt.FiltraParametros($"CvePersonal ={cvePersonal }") + End If + + lrds.Add(New ReportDataSource With {.Name = "DataSet1", .Value = dt}) + End If + + End Using + + 'endimg + '"Empresas/Grales/Formatos/EquiposGPS.rdlc" + '"D:\\ADSistemas\\Proyectos\\SIG\\SIGIT\\GPS\\PalletEtiqueta.rdlc" + ImprimirPDF("GPS/ReciboNom.rdlc", lrds, params, "Pallet", Content_Disposition:="Inline") + End Sub + Private Sub rfctxtvalidar() + Dim numeroPeriodo As Integer = 0 + Dim cveSubProyecto As Integer = -1 + Dim cveTipoNomina As Integer = -1 + Dim ejercicio As Integer = 0 + Dim cvePersonal As Integer = 0 + Dim tipoTrabajador As String = "" + Dim facturado As Boolean = False + If Not IsNothing(Request("numeroPeriodo")) Then + numeroPeriodo = Request("numeroPeriodo").ToString.ToEntero() + End If + If Not IsNothing(Request("ejercicio")) Then + ejercicio = Request("ejercicio").ToString.ToEntero() + End If + If Not IsNothing(Request("cvePersonal")) Then + cvePersonal = Request("cvePersonal").ToString.ToEntero() + End If + Dim RFCs As New StringBuilder + Dim contador = 0 + Using objnom As New ClsNominas + If objnom.PreNominaTotalSemana(numeroPeriodo, UsuarioActual.CveEmpresa, cveSubProyecto, cveTipoNomina, tipoTrabajador, ejercicio, facturado) Then + For Each item As DataRow In objnom.DtResultados.Select("CvePersonal > 0") + Dim rfc As String = item("RFC").ToString().Trim() + If rfc.Length > 0 Then + contador = contador + 1 + RFCs.AppendLine(String.Format("{0}|{1}", contador, rfc)) + End If + Next + End If + + End Using + Response.Clear() + Response.ContentType = "text/plain" + Response.AppendHeader("content-disposition", "attachment;filename=RFCs_Validacion_Masiva.txt") + + 'Response.Write(contador.ToString()) + Response.Write(RFCs.ToString()) + Response.End() + End Sub Private Sub imprimirManifiesto(cveEmbarqueManifiesto As Integer) Dim NoEmbarque As String = "" @@ -506,7 +589,6 @@ Partial Class PopUpVerFactura ImprimirPDF("GPS/EmbarqueManifiestoRemision.rdlc", lrds, params, "Remisión", Content_Disposition:="Inline") End Sub - Private Sub imprimirManifiestoCartaPorte(cveEmbarqueManifiesto As Integer) Dim NoEmbarque As String = "" Dim Fecha As String = "" @@ -675,7 +757,6 @@ Partial Class PopUpVerFactura End Sub - Private Sub imprimirpallet2(cvePallet As Integer) Dim Envase As String = "" Dim Tamano As String = "" diff --git a/GPS/ReciboNom.rdlc b/GPS/ReciboNom.rdlc new file mode 100644 index 000000000..567941e6e --- /dev/null +++ b/GPS/ReciboNom.rdlc @@ -0,0 +1,6663 @@ + + + 0 + + + + System.Data.DataSet + /* Local Connection */ + + db271139-498f-42f1-b0bc-9c6d57014da7 + + + + + + DataSet + /* Local Query */ + + + + RFC + System.String + + + Dias + System.String + + + NumeroPeriodo + System.String + + + Codigo + System.String + + + NombreCompleto + System.String + + + SubProyecto + System.String + + + NumeroSS + System.String + + + FechaInicio + System.String + + + FubProyecto + System.String + + + NetoPagar + System.String + + + Sindicato + System.String + + + SalarioDia1 + System.String + + + SalarioDia2 + System.String + + + SalarioDia3 + System.String + + + SalarioDia4 + System.String + + + SalarioDia5 + System.String + + + SalarioDia6 + System.String + + + SalarioDia7 + System.String + + + + DataSet + C:\Users\Caudillo\Documents\Visual Studio 2013\WebSites\WebSite3\App_Code\DataSet.xsd + DataTable1 + + + + + + + + + + + + + + + 1.94437cm + + + 1.81208cm + + + 1.55764cm + + + 1.5841cm + + + 1.63701cm + + + 1.5841cm + + + 1.31951cm + + + 1.37243cm + + + 1.47826cm + + + 1.31951cm + + + 1.9016cm + + + 1.61055cm + + + + + 1.34083cm + + + + + true + true + + + + + + + + + + + + Black + + 1pt + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + AGROPECUARIA JAM S.A. DE C.V +CARRETERA A BAHIA DE KINO KM 12 COL, LA MANGA +HERMOSILLO, SONORA + + + + + + + Textbox4 + + + + Black + + 1pt + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + 9 + + + + + + + + + + + + + + Embedded + logojam + FitProportional + + + + Black + + 1pt + + + Black + + 1pt + + + + + + + + + true + true + + + + + + + + + Black + + 1pt + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + Semana No.: + + + + + + + Textbox10 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!NumeroPeriodo.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Punto de Pago: + + + + + + + Textbox12 + + + 2pt + 2pt + 2pt + 2pt + + + 2 + + + + + + + true + true + + + + + =Fields!SubProyecto.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + 3 + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + Del: + + + + + + + Textbox13 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!FechaInicio.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + No: + + + + + + + Textbox15 + + + 2pt + 2pt + 2pt + 2pt + + + 2 + + + + + + + true + true + + + + + =Fields!Codigo.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + 2 + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + Al: + + + + + + + Textbox16 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!FechaFin.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Nombre: + + + + + + + Textbox18 + + + 2pt + 2pt + 2pt + 2pt + + + 2 + + + + + + + true + true + + + + + =Fields!NombreCompleto.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + 7 + + + + + + + + + + + + true + true + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + Días Trab.: + + + + + + + Textbox19 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Dias.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Fecha de Pago: + + + + + + + Textbox21 + + + 2pt + 2pt + 2pt + 2pt + + + 2 + + + + + + + true + true + + + + + =Fields!FechaFin.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + 2 + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + Faltas: + + + + + + + Textbox58 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + NSS: + + + + + + + Textbox60 + + + 2pt + 2pt + 2pt + 2pt + + + 2 + + + + + + + true + true + + + + + =Fields!NumeroSS.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + 2 + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + Fijo: + + + + + + + Textbox67 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + FORMA DE PAGO: + + + + + + + Textbox69 + + + 2pt + 2pt + 2pt + 2pt + + + 2 + + + + + + + true + true + + + + + Efectivo + + + + + + 2pt + 2pt + 2pt + 2pt + + + 2 + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + PERCEPCIONES + + + + + + + Black + + 1pt + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + 2 + + + + + + + true + true + + + + + JUE + + + + + + + Textbox78 + + + + Black + + 1pt + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + VIE + + + + + + + Textbox79 + + + + Black + + 1pt + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + SAB + + + + + + + Textbox80 + + + + Black + + 1pt + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + DOM + + + + + + + Textbox81 + + + + Black + + 1pt + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + LUN + + + + + + + Textbox82 + + + + Black + + 1pt + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + MAR + + + + + + + Textbox83 + + + + Black + + 1pt + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + MIE + + + + + + + Textbox84 + + + + Black + + 1pt + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + DEDUCCIONES + + + + + + + Black + + 1pt + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + 2 + + + + + + + true + true + + + + + IMPORTE + + + + + + + Black + + 1pt + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + Sueldo Diario + + + + + + 2pt + 2pt + 2pt + 2pt + + + 2 + + + + + + + true + true + + + + + + + + + + + + Textbox87 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox88 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox89 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox90 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox91 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox92 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox93 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Sindicato + + + + + + 2pt + 2pt + 2pt + 2pt + + + 2 + + + + + + + true + true + + + + + =Fields!Sindicato.Value + + + + + + + Sindicato + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + Proporc. Septimo Día + + + + + + 2pt + 2pt + 2pt + 2pt + + + 2 + + + + + + + true + true + + + + + + + + + + + + Textbox105 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox106 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox107 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox108 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox109 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox110 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox111 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Comedor + + + + + + 2pt + 2pt + 2pt + 2pt + + + 2 + + + + + + + true + true + + + + + 0.00 + + + + + + + Textbox245 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + Proporc. Aguinaldo + + + + + + 2pt + 2pt + 2pt + 2pt + + + 2 + + + + + + + true + true + + + + + + + + + + + + Textbox96 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox97 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox98 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox99 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox100 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox101 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox102 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Infonavit + + + + + + 2pt + 2pt + 2pt + 2pt + + + 2 + + + + + + + true + true + + + + + 0.00 + + + + + + + Textbox246 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + Proporc Utilidades + + + + + + 2pt + 2pt + 2pt + 2pt + + + 2 + + + + + + + true + true + + + + + + + + + + + + Textbox114 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox115 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox116 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox117 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox118 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox119 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox120 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Fonacot + + + + + + 2pt + 2pt + 2pt + 2pt + + + 2 + + + + + + + true + true + + + + + 0.00 + + + + + + + Textbox247 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + Vac. v Prima Vac 50% + + + + + + 2pt + 2pt + 2pt + 2pt + + + 2 + + + + + + + true + true + + + + + + + + + + + + Textbox123 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox124 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox125 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox126 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox127 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox128 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox129 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Herrmientas + + + + + + 2pt + 2pt + 2pt + 2pt + + + 2 + + + + + + + true + true + + + + + 0.00 + + + + + + + Textbox248 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + Horas Extras + + + + + + 2pt + 2pt + 2pt + 2pt + + + 2 + + + + + + + true + true + + + + + + + + + + + + Textbox132 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox133 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox134 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox135 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox136 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox137 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox138 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Otras Deducciones + + + + + + 2pt + 2pt + 2pt + 2pt + + + 2 + + + + + + + true + true + + + + + 0.00 + + + + + + + Textbox249 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + Bono + + + + + + 2pt + 2pt + 2pt + 2pt + + + 2 + + + + + + + true + true + + + + + + + + + + + + Textbox141 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox142 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox143 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox144 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox145 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox146 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox147 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + 2 + + + + + + + true + true + + + + + + + + + + + + Textbox250 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + Otras Perc. + + + + + + 2pt + 2pt + 2pt + 2pt + + + 2 + + + + + + + true + true + + + + + + + + + + + + Textbox177 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox178 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox179 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox180 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox181 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox182 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox183 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Total deducciones + + + + + + 2pt + 2pt + 2pt + 2pt + + + 2 + + + + + + + true + true + + + + + =Fields!Sindicato.Value + + + + + + + Sindicato1 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox186 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox187 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox188 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox189 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox190 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox191 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox192 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox252 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + Percepcion Diaria + + + + + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + 2 + + + + + + + true + true + + + + + =Fields!SalarioDia1.Value + + + + + + + SalarioDia1 + + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!SalarioDia2.Value + + + + + + + SalarioDia2 + + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!SalarioDia3.Value + + + + + + + SalarioDia3 + + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!SalarioDia4.Value + + + + + + + SalarioDia4 + + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!SalarioDia5.Value + + + + + + + SalarioDia5 + + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!SalarioDia6.Value + + + + + + + SalarioDia6 + + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!SalarioDia7.Value + + + + + + + SalarioDia7 + + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Neto a Pagar + + + + + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + 2 + + + + + + + true + true + + + + + =Fields!NetoPagar.Value + + + + + + + NetoPagar + + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.94396cm + + + + + true + true + + + + + Recibi de AGROPECUARIA JAM S.A. DE C.V. la cantidad neta a que este documente se refiere estando conforme con las percepciones, deducciones y faltas que aparecen especificadas, sin que a la feche se me adeude cantidad alguna por otro concepto. NO RESERVANDOME NINGUNA RECLAMACION POSTERIOR, + + + + + + 2pt + 2pt + 2pt + 2pt + + + 9 + + + + + + + + + + + + + + true + true + + + + + + + + + +Firma del Trabajador + + + + + + + Textbox213 + + + Bottom + 2pt + 2pt + 2pt + 2pt + + + 3 + + + + + + + + 0.41479cm + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox32 + + + Bottom + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox33 + + + Bottom + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox34 + + + Bottom + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DataSet1 + 0.15557cm + 0.10265cm + 12.89958cm + 19.12116cm + + + + + + 5.31354in +