This commit is contained in:
2022-05-27 19:25:26 -07:00
59 changed files with 9783 additions and 3829 deletions

View File

@@ -284,7 +284,7 @@ Partial Class CatMetasVendedores
Dim Correcto As Boolean = True
ObjMetas.IniciaTransacSQL()
Try
Dim DtVendedores As DataTable = GlobalDTVendedores(UsuarioActual.CveEmpresa)
Dim DtVendedores As DataTable = GlobalDTVendedores(UsuarioActual.CveEmpresa, Estatus:=-1, VendedorTipo:=-1)
Dim DtClasificaciones As DataTable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa)
Dim DtClasificaciones2 As DataTable = GlobalDTClasificaciones2(UsuarioActual.CveEmpresa)
@@ -293,7 +293,7 @@ Partial Class CatMetasVendedores
If Correcto Then
Dim TieneError As Boolean = False
Dim CveVendedor As Integer = DtVendedores.FiltroPrimeroValor("CveVendedor", String.Format("trim(Vendedor) LIKE '%{0}%'", row("Vendedor").ToString().TrimStart().TrimEnd())).ToEntero
Dim CveVendedor As Integer = DtVendedores.FiltroPrimeroValor("CveVendedor", String.Format("trim(Vendedor) LIKE '%{0}%'", row("Vendedor").ToString().TrimStart().TrimEnd().ToUpper)).ToEntero
Dim CveClasificacion As Integer = DtClasificaciones.FiltroPrimeroValor("CveClasificacion", String.Format("trim(Clasificacion)='{0}'", row("Clasificación Superior").ToString().TrimStart().TrimEnd())).ToEntero
Dim CveClasificacion2 As Integer = DtClasificaciones2.FiltroPrimeroValor("CveClasificacion", String.Format("trim(Clasificacion)='{0}'", row("Clasificación").ToString().TrimStart().TrimEnd())).ToEntero
Dim CveMarca As Integer = DtMarcas.FiltroPrimeroValor("CveMarca", String.Format("Marca='{0}'", row("Marca").ToString().TrimStart().TrimEnd())).ToEntero
@@ -309,6 +309,8 @@ Partial Class CatMetasVendedores
If Correcto Then
RowsCargados += 1
End If
Else
Correcto = False
End If
If Not Correcto Then
@@ -318,7 +320,7 @@ Partial Class CatMetasVendedores
Next
Catch ex As Exception
OnError("Ocurrió un error al cargar los precios.", ex)
OnError("Ocurrió un error al cargar las metas.", ex)
Finally
Dim MensajeFinal As New StringBuilder()

View File

@@ -225,6 +225,7 @@
<asp:BoundField DataField="Clasificacion2" HeaderText="Clasificacion 2" Visible="false" ItemStyle-Width="20px" />
<asp:BoundField DataField="Marca" HeaderText="Marca" Visible="false" ItemStyle-Width="20px" />
<asp:BoundField DataField="VentaMinima" HeaderText="Venta Mínima" Visible="false" ItemStyle-Width="20px" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" />
<asp:BoundField DataField="CodigoBarras" HeaderText="Código Barras" Visible="false" />
</Columns>
</asp:GridView>
</ContentTemplate>
@@ -301,6 +302,8 @@
<tr>
<td style="text-align: left;">
<asp:CheckBox ID="ChkVentaMinima" runat="server" Text="Venta Mínima" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkCodigoBarras" runat="server" Text="Código Barras" /></td>
</tr>
</tbody>
</table>

View File

@@ -117,6 +117,7 @@ Partial Class CatPS
GvDatos.Columns(11).Visible = ChkClasificacion2.Checked
GvDatos.Columns(12).Visible = ChkMarca.Checked
GvDatos.Columns(13).Visible = ChkVentaMinima.Checked
GvDatos.Columns(14).Visible = ChkCodigoBarras.Checked
CargaDatos()
OrdenaDatos()

View File

@@ -753,7 +753,7 @@ Partial Class Clientes
DivRetIVA.Visible = False
End If
If UsuarioActual.Empresa.Funcionalidad(350) = "1" Then
If UsuarioActual.Empresa.Funcionalidad(350).Contiene("1", "2") Then
divRegimen.Visible = True
End If
@@ -2082,7 +2082,7 @@ Partial Class Clientes
End Sub
Private Sub CargaComboCFDI()
Dim RegimenFiscalCliente = DdlRegimenFiscal.SelectedValue.ToString()
If UsuarioActual.Empresa.Funcionalidad(350) <> "1" Then
If Not UsuarioActual.Empresa.Funcionalidad(350).Contiene("1", "2") Then
RegimenFiscalCliente = "-1"
End If
@@ -10213,7 +10213,7 @@ Partial Class Clientes
DVRegimenSociedad.Visible = False
DivRazonSocial2.Attributes.Add("class", "col-md-12")
If RdTipoPersona.SelectedValue.ToEntero = 1 And UsuarioActual.Empresa.Funcionalidad(350) = "1" Then
If RdTipoPersona.SelectedValue.ToEntero = 1 And UsuarioActual.Empresa.Funcionalidad(350).Contiene("1", "2") Then
DivRazonSocial2.Attributes.Add("class", "col-md-8")
DVRegimenSociedad.Visible = True

View File

@@ -1082,7 +1082,7 @@ Partial Class Ventas_ClientesAbonar
Exit Select
End If
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago * tipoCambioVenta).RoundSQL
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago).RoundSQL
ImporteMN = (ImporteMovimiento * tipoCambioVenta).RoundSQL
TipoCambioGeneral = tipoCambioVenta
CveSubProyectoContabilizar = CveSubProyecto
@@ -1104,7 +1104,7 @@ Partial Class Ventas_ClientesAbonar
If EsAnticipoEspecial Then Exit Select
If gvr.DataKey("CveTipoRetencion").ToEntero = 4 Then
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago * tipoCambioVenta).RoundSQL
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago).RoundSQL
ImporteMN = (ImporteMovimiento * tipoCambioVenta).RoundSQL
TipoCambioGeneral = tipoCambioVenta
CveSubProyectoContabilizar = CveSubProyecto
@@ -1125,7 +1125,7 @@ Partial Class Ventas_ClientesAbonar
Case 9 'Ret ISR x Trasladar
If EsAnticipoEspecial Then Exit Select
ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago * tipoCambioVenta).RoundSQL
ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago).RoundSQL
ImporteMN = (ImporteMovimiento * tipoCambioVenta).RoundSQL
TipoCambioGeneral = tipoCambioVenta
CveSubProyectoContabilizar = CveSubProyecto
@@ -1147,7 +1147,7 @@ Partial Class Ventas_ClientesAbonar
Case 13 'Iva por Trasladar
If EsAnticipoEspecial Then Exit Select
ImporteMovimiento = (gvr.DataKey("IVA").ToDecimal * PorcentajePago * tipoCambioVenta).RoundSQL
ImporteMovimiento = (gvr.DataKey("IVA").ToDecimal * PorcentajePago).RoundSQL
ImporteMN = (ImporteMovimiento * tipoCambioVenta).RoundSQL
TipoCambioGeneral = tipoCambioVenta
CveSubProyectoContabilizar = CveSubProyecto
@@ -1167,7 +1167,7 @@ Partial Class Ventas_ClientesAbonar
Exit Select
End If
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago * tipoCambioVenta).RoundSQL
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago).RoundSQL
ImporteMN = (ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta)).RoundSQL
TipoCambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta)
CveSubProyectoContabilizar = CveSubProyecto
@@ -1188,7 +1188,7 @@ Partial Class Ventas_ClientesAbonar
If EsAnticipoEspecial Then Exit Select
If gvr.DataKey("CveTipoRetencion").ToEntero = 4 Then
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago * tipoCambioVenta).RoundSQL
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago).RoundSQL
ImporteMN = (ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta)).RoundSQL
TipoCambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta)
CveSubProyectoContabilizar = CveSubProyecto
@@ -1207,7 +1207,7 @@ Partial Class Ventas_ClientesAbonar
Case 63 'Ret ISR Trasladado
If EsAnticipoEspecial Then Exit Select
ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago * tipoCambioVenta).RoundSQL
ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago).RoundSQL
ImporteMN = (ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta)).RoundSQL
TipoCambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta)
CveSubProyectoContabilizar = CveSubProyecto
@@ -1229,7 +1229,7 @@ Partial Class Ventas_ClientesAbonar
Case 61 'Iva Trasladado
If EsAnticipoEspecial Then Exit Select
ImporteMovimiento = (gvr.DataKey("IVA").ToDecimal * PorcentajePago * tipoCambioVenta).RoundSQL
ImporteMovimiento = (gvr.DataKey("IVA").ToDecimal * PorcentajePago).RoundSQL
ImporteMN = (ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta)).RoundSQL
TipoCambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta)
CveSubProyectoContabilizar = CveSubProyecto
@@ -1246,7 +1246,7 @@ Partial Class Ventas_ClientesAbonar
Case 38 'IEPS por trasladar
If EsAnticipoEspecial Then Exit Select
ImporteMovimiento = (gvr.DataKey("IEPS").ToDecimal * PorcentajePago * tipoCambioVenta).RoundSQL
ImporteMovimiento = (gvr.DataKey("IEPS").ToDecimal * PorcentajePago).RoundSQL
ImporteMN = (ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta)).RoundSQL
TipoCambioGeneral = tipoCambioVenta
CveSubProyectoContabilizar = CveSubProyecto
@@ -1255,7 +1255,7 @@ Partial Class Ventas_ClientesAbonar
Case 39 'IEPS Trasladado
If EsAnticipoEspecial Then Exit Select
ImporteMovimiento = (gvr.DataKey("IEPS").ToDecimal * PorcentajePago * tipoCambioVenta).RoundSQL
ImporteMovimiento = (gvr.DataKey("IEPS").ToDecimal * PorcentajePago).RoundSQL
ImporteMN = (ImporteMovimiento * tipoCambioVenta).RoundSQL
TipoCambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta)

View File

@@ -110,7 +110,7 @@
<label class="col-md-1 text-right">Categoria: </label>
<div class="col-md-3">
<asp:DropDownList ID="DdlCategoria" runat="server" Class="table-group-action-input form-control input-inline input-sm select2me" Width="50%" DataValueField="CveCategoria" DataTextField="Categoria"></asp:DropDownList>
<asp:DropDownList ID="DdlCategoria" runat="server" Class="table-group-action-input form-control input-inline input-sm select2me" Width="50%" DataValueField="CveCategoria" DataTextField="Categoria" AutoPostBack="true"></asp:DropDownList>
</div>
<label class="col-md-1 text-right">Clasificaciones: </label>
<div class="col-md-3">
@@ -118,7 +118,7 @@
</div>
</div>
<div class="row">
<label class="col-md-1 text-right">Sub Clasificaciones: </label>
<label class="col-md-1 text-right">Sub Clasif: </label>
<div class="col-md-3">
<asp:DropDownList ID="DdlClasificacion2" runat="server" Class="table-group-action-input form-control input-inline input-sm select2me" Width="50%" DataValueField="CveClasificacion" DataTextField="Clasificacion"></asp:DropDownList>
</div>
@@ -130,6 +130,17 @@
<div class="col-md-3">
<asp:DropDownList ID="DdlMarcaFiltro" runat="server" DataTextField="Marca" DataValueField="CveMarca" Class="table-group-action-input form-control input-inline input-sm select2me" Width="50%"></asp:DropDownList>
</div>
</div>
<div class="row">
<label title="Distr" data-toggle="tooltip" class="col-md-1 truncate">Distribuidor:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlDistribuidor" runat="server" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
<asp:ListItem Text="Distribuidor" Value="1"></asp:ListItem>
<asp:ListItem Text="No Distribuidor" Value="0"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
<div id="DivFamiliaSubFamilia" class="row" runat="server" visible="false">
</div>
@@ -159,7 +170,7 @@
%Inte
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="lblRealMesPorcentaje" runat="server" Target="_blank" Text='<%# Eval("RealMesPorcentaje").ToString() %>'> </asp:Label>
<asp:Label ID="lblRealMesPorcentaje" runat="server" Target="_blank" Text='<%# Eval("RealMesPorcentaje", "{0:#,###}").ToString() %>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="" ItemStyle-HorizontalAlign="Center">
@@ -207,7 +218,7 @@
%Inte
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="lblRealAcumuladoPorcentaje" runat="server" Target="_blank" Text='<%# Eval("RealAcumuladoPorcentaje").ToString() %>'> </asp:Label>
<asp:Label ID="lblRealAcumuladoPorcentaje" runat="server" Target="_blank" Text='<%# Eval("RealAcumuladoPorcentaje", "{0:###.###}").ToString() %>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="" ItemStyle-HorizontalAlign="Center">

View File

@@ -15,8 +15,8 @@ Partial Class MetasVendedores
End Property
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
CargaDatosFiltros()
CargarDatosReporte()
CargaDatosFiltros()
End If
End Sub
Private Sub CargaDatosFiltros()
@@ -43,20 +43,18 @@ Partial Class MetasVendedores
DdlCategoria.DataBind()
DdlCategoria.Items.Insert(0, New ListItem("Todos", "-1"))
DdlClasificaciones.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa)
DdlClasificaciones.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa, UsoClasificacion:=1)
DdlClasificaciones.DataBind()
DdlClasificaciones.Items.Insert(0, New ListItem("Todos", "-1"))
DdlClasificacion2.DataSource = GlobalDTClasificaciones2(UsuarioActual.CveEmpresa)
DdlClasificacion2.DataBind()
DdlClasificacion2.Items.Insert(0, New ListItem("Todos", "-1"))
'DdlCliente.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa)
'DdlCliente.DataBind()
'DdlCliente.Items.Insert(0, New ListItem("Todos", "-1"))
DdlClasificacion2.Items.Insert(0, New ListItem("Todos", "-1"))
End Sub
Private Sub CargarDatosReporte()
Private Sub CargarDatos()
Dim CveCliente As Integer = -1
If DdlClientes.SelectedValue.ToEntero > 0 Then
CveCliente = DdlClientes.SelectedValue.ToEntero
@@ -65,7 +63,7 @@ Partial Class MetasVendedores
Dim ObjVentas As New ClsVentas
If ObjVentas.GetRepMetasVendedores(TxtFechaMes.Text, UsuarioActual.CveEmpresa, DdlVendedorFiltro.SelectedValue.ToEntero, DdlCategoria.SelectedValue.ToEntero,
DdlClasificaciones.SelectedValue.ToEntero, DdlClasificacion2.SelectedValue.ToEntero, DdlMarcaFiltro.SelectedValue.ToEntero,
DdlSubProyectoFiltro.SelectedValue.ToEntero, CveCliente, DdlGrupo.SelectedValue.ToEntero) Then
DdlSubProyectoFiltro.SelectedValue.ToEntero, CveCliente, DdlDistribuidor.SelectedValue.ToEntero, DdlGrupo.SelectedValue.ToEntero) Then
GV.DataSource = ObjVentas.DtResultados
DtDatos = ObjVentas.DtResultados
End If
@@ -74,7 +72,7 @@ Partial Class MetasVendedores
End Sub
Protected Sub btConsultar_Click(sender As Object, e As EventArgs) Handles btConsultar.Click
CargarDatosReporte()
CargarDatos()
UPDatos.Update()
End Sub
@@ -87,16 +85,7 @@ Partial Class MetasVendedores
Select Case e.Row.DBCampo("TipoFila")
Case "1"
e.Row.CssClass = "Totales"
' e.Row.FCLabel("lblRealMes").Text = ""
' e.Row.FCLabel("lblVtaMesAA").Text = ""
' e.Row.FCLabel("lblObjMes").Text = ""
' e.Row.FCLabel("lblRealAcumulado").Text = ""
' e.Row.FCLabel("lblRealMesPorcentaje").Text = ""
' e.Row.FCLabel("lblAAntAcumulado").Text = ""
' e.Row.FCLabel("lblObjAcumulado").Text = ""
' e.Row.FCLabel("lblVarVSAAPerc").Text = ""
' e.Row.FCLabel("lblVarVSAA").Text = ""
' e.Row.FCLabel("lblVarVSObjAcum").Text = ""
Case "2"
e.Row.CssClass = "SubTotales2"
Case "3"
@@ -128,5 +117,30 @@ Partial Class MetasVendedores
params.Add(New ReportParameter("Agente", DdlVendedorFiltro.SelectedItem.ToString))
ImprimirPDF("Empresas/Grales/Formatos/MetasVendedores.rdlc", DtDatos, params, "Rep. Metas por vendedores", "PDF", RDSName:="DataSet1")
End Sub
End Sub
Private Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("pEmp", UsuarioActual.Empresa.Empresa))
If Imagen.Exists Then
params.Add(New ReportParameter("pImg", $"file://{Imagen.FullName}"))
Else
params.Add(New ReportParameter("pImg", ""))
End If
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Usuario))
params.Add(New ReportParameter("FechaImpresion", Today))
params.Add(New ReportParameter("SubProyecto", DdlSubProyectoFiltro.SelectedItem.ToString))
params.Add(New ReportParameter("Agente", DdlVendedorFiltro.SelectedItem.ToString))
ImprimirPDF("Empresas/Grales/Formatos/MetasVendedores.rdlc", DtDatos, params, "Rep. Metas por vendedores", "Excel", RDSName:="DataSet1")
End Sub
Private Sub DdlCategoria_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlCategoria.SelectedIndexChanged
DdlClasificaciones.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveCategoria:=DdlCategoria.SelectedValue.ToEntero, UsoClasificacion:=1)
DdlClasificaciones.DataBind()
DdlClasificaciones.Items.Insert(0, New ListItem("Todos", "-1"))
End Sub
End Class

View File

@@ -3440,7 +3440,7 @@ Partial Class PV
Dim ObjAcum As New ClsAcumuladores
Dim ObjVentas As New ClsVentas(ObjAcum.IniciaTransacSQL())
Dim ObjContPaq As ClsContPAQi = Nothing
If UsuarioActual.Empresa.UsaAC OrElse UsuarioActual.Empresa.Funcionalidad(200) = "1" Then
If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso UsuarioActual.Empresa.UsaAC OrElse UsuarioActual.Empresa.Funcionalidad(200) = "1" Then
ObjContPaq = New ClsContPAQi(UsuarioActual.Empresa)
End If
@@ -8319,7 +8319,7 @@ Partial Class PV
DVRegimenSociedad.Visible = False
DivRazonSocial2.Attributes.Add("class", "col-md-12")
If RdTipoPersona.SelectedValue.ToEntero = 1 And UsuarioActual.Empresa.Funcionalidad(350) = "1" Then
If RdTipoPersona.SelectedValue.ToEntero = 1 And UsuarioActual.Empresa.Funcionalidad(350).Contiene("1", "2") Then
DivRazonSocial2.Attributes.Add("class", "col-md-8")
DVRegimenSociedad.Visible = True

View File

@@ -325,6 +325,7 @@ Partial Class ProductosyServicios
DivPSAdicionalVigencia.Visible = True
divCodigo2.Visible = True
divLitraje.Visible = True
DivClasificacion2.Visible = True
CargaPSAdicionalesVigencias()
End If
@@ -341,7 +342,7 @@ Partial Class ProductosyServicios
CargaCombosSeccionAlmacen()
If UsuarioActual.Empresa.Funcionalidad(350) = "1" Then 'emisión 4.0
If UsuarioActual.Empresa.Funcionalidad(350).Contiene("1", "2") Then 'emisión 4.0
DivObjetoImpuesto.Visible = True
DdlObjetoImpuesto.DataSource = GlobalDTSATObjetosImpuestos
DdlObjetoImpuesto.DataBind()

View File

@@ -412,7 +412,7 @@
<%--17--%>
<asp:BoundField HeaderText="Forma de Pago" DataField="FormaPago" ItemStyle-Width="5%" Visible="false" />
<%--18--%>
<asp:BoundField HeaderText="F. Emisión" DataField="FechaIng" DataFormatString="{0:d}" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center" Visible="false" />
<asp:BoundField HeaderText="Fecha Hora de Emisión" DataField="FechaIng" ItemStyle-Width="200px" ItemStyle-HorizontalAlign="Center" Visible="false" />
</Columns>

View File

@@ -212,8 +212,9 @@ Partial Class Ventas_RepProductosServiciosDetalle
DdlSubProyectoEjecucion.DataBind()
'Vendedor
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa)
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa, VendedorTipo:=-1).FiltraParametros("VendedorTipo in (1,4)") 'vendedores y vendedores de piso
DdlVendedor.DataBind()
If UsuarioActual.CveVendedor > 0 AndAlso Not UsuarioActual.TienePermisoProceso(263) Then
DdlVendedor.SelectedValueExist(UsuarioActual.CveVendedor.ToString())
DdlVendedor.Attributes.Add("disabled", "disabled")

View File

@@ -8821,7 +8821,7 @@ Partial Class Ventas
'CONTABILIDAD AUTOMATICA Y AC
If UsuarioActual.Empresa.UsaAC OrElse UsuarioActual.Empresa.Funcionalidad(200) = "1" Then
If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso UsuarioActual.Empresa.UsaAC Then
ObjContPaq = New ClsContPAQi(UsuarioActual.Empresa)
ObjContPaq.IniciaTransacSQL()
End If
@@ -19734,46 +19734,53 @@ Partial Class Ventas
End Sub
Private Sub EliminaPoliza()
Dim ObjAC As New ClsContPAQi(UsuarioActual.Empresa)
ObjAC.IniciaTransacSQL()
Dim ObjConta As New ClsContabilidad
ObjConta.IniciaTransacSQL()
Dim ErrorMovimiento = False
If UsuarioActual.Empresa.TipoContabilidad = 2 Then
'Elimina la poliza
If (UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.UsaContabilidad) AndAlso IdPoliza > 0 Then
If Not ObjAC.RemovePoliza(IdPoliza) Then
ErrorMovimiento = True
Dim ObjAC As New ClsContPAQi(UsuarioActual.Empresa)
ObjAC.IniciaTransacSQL()
Dim ObjConta As New ClsContabilidad
ObjConta.IniciaTransacSQL()
Dim ErrorMovimiento = False
'Elimina la poliza
If (UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.UsaContabilidad) AndAlso IdPoliza > 0 Then
If Not ObjAC.RemovePoliza(IdPoliza) Then
ErrorMovimiento = True
End If
End If
End If
'Desasocia la poliza
If Not ErrorMovimiento Then
If Not ObjConta.DesasociarPoliza(IdPoliza, UsuarioActual.CveEmpresa) Then
ErrorMovimiento = True
'Desasocia la poliza
If Not ErrorMovimiento Then
If Not ObjConta.DesasociarPoliza(IdPoliza, UsuarioActual.CveEmpresa) Then
ErrorMovimiento = True
End If
End If
End If
If Not ErrorMovimiento Then
If Not ObjConta.UpdatePrePolizasDetalleBloquear(CvePrePoliza, False) Then
ErrorMovimiento = True
If Not ErrorMovimiento Then
If Not ObjConta.UpdatePrePolizasDetalleBloquear(CvePrePoliza, False) Then
ErrorMovimiento = True
End If
End If
If Not ErrorMovimiento Then
Alert("La póliza ha sido desvinculada y eliminada con éxito.", TipoMensaje.MsgInformacion)
ObjAC.Commit()
ObjConta.Commit()
BtnDescontabilizar.Visible = False
Else
Alert("Ocurrió un error al desvincular y/o eliminar la póliza. Por favor intente de nuevo ", TipoMensaje.MsgError)
ObjAC.RollBack()
ObjConta.RollBack()
End If
ObjAC.Dispose()
ObjConta.Dispose()
End If
If Not ErrorMovimiento Then
Alert("La póliza ha sido desvinculada y eliminada con éxito.", TipoMensaje.MsgInformacion)
ObjAC.Commit()
ObjConta.Commit()
BtnDescontabilizar.Visible = False
Else
Alert("Ocurrió un error al desvincular y/o eliminar la póliza. Por favor intente de nuevo ", TipoMensaje.MsgError)
ObjAC.RollBack()
ObjConta.RollBack()
End If
ObjAC.Dispose()
ObjConta.Dispose()
End Sub
Protected Sub DdlPS_SelectedIndexChanged1(sender As Object, e As EventArgs)
@@ -22674,7 +22681,7 @@ Partial Class Ventas
CreaObjetosVenta()
If UsuarioActual.Empresa.UsaAC Then
If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso UsuarioActual.Empresa.UsaAC Then
ObjAC = New ClsContPAQi(UsuarioActual.Empresa) : ObjAC.IniciaTransacSQL()
End If
@@ -34070,7 +34077,7 @@ Partial Class Ventas
DVRegimenSociedad.Visible = False
DivRazonSocial2.Attributes.Add("class", "col-md-12")
If RdTipoPersona.SelectedValue.ToEntero = 1 And UsuarioActual.Empresa.Funcionalidad(350) = "1" Then
If RdTipoPersona.SelectedValue.ToEntero = 1 And UsuarioActual.Empresa.Funcionalidad(350).Contiene("1", "2") Then
DivRazonSocial2.Attributes.Add("class", "col-md-8")
DVRegimenSociedad.Visible = True
@@ -34534,35 +34541,42 @@ Partial Class Ventas
Protected Sub BtnGenerarPoliza_Click(sender As Object, e As EventArgs)
CreaObjetosVenta()
Dim ObjAC As New ClsContPAQi(UsuarioActual.Empresa)
Dim Msgok As New StringBuilder
If ObjFactura.TipoDocto.Contiene("Ing", "Egs", "OP", "Com") Then
Dim IDPoliza As Modelos.RetornoPolizaConta = GenerarPolizaAC(ObjAC, ObjFactura)
If UsuarioActual.Empresa.TipoContabilidad = 2 Then
If IDPoliza.IdPoliza > 0 Then
Dim ObjAC As New ClsContPAQi(UsuarioActual.Empresa)
Dim Msgok As New StringBuilder
If ObjFactura.TipoDocto.Contiene("Ing", "Egs", "OP", "Com") Then
Dim ObjVentas As New ClsVentas
Dim IDPoliza As Modelos.RetornoPolizaConta = GenerarPolizaAC(ObjAC, ObjFactura)
If ObjVentas.UpdateVentaPrePoliza(IDPoliza.IdPoliza, IDPoliza.FolioPoliza, CvePrePoliza, CveVenta, UsuarioActual.CveEmpresa) Then
If IDPoliza.IdPoliza > 0 Then
Dim ObjVentas As New ClsVentas
If ObjVentas.UpdateVentaPrePoliza(IDPoliza.IdPoliza, IDPoliza.FolioPoliza, CvePrePoliza, CveVenta, UsuarioActual.CveEmpresa) Then
'Si se facturó la cotización hay que vincular la venta
Msgok.AppendFormat("Abono Registrado Correctamente.<br/><br/> <a href='/Contabilidad/RegPoliza.aspx?IdPoliza={0}' target='_blank' class='Texto'>Ver Poliza</a>", IDPoliza)
End If
ObjVentas.Dispose()
'Si se facturó la cotización hay que vincular la venta
Msgok.AppendFormat("Abono Registrado Correctamente.<br/><br/> <a href='/Contabilidad/RegPoliza.aspx?IdPoliza={0}' target='_blank' class='Texto'>Ver Poliza</a>", IDPoliza)
Else
ErrorList.Add("Ocurrió un error al generar A.C. en la Factura.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
End If
ObjVentas.Dispose()
'Si se facturó la cotización hay que vincular la venta
Msgok.AppendFormat("Abono Registrado Correctamente.<br/><br/> <a href='/Contabilidad/RegPoliza.aspx?IdPoliza={0}' target='_blank' class='Texto'>Ver Poliza</a>", IDPoliza)
Else
ErrorList.Add("Ocurrió un error al generar A.C. en la Factura.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
Msgok.Append("Movimiento Registrado Correctamente.<br/><br/> ")
End If
ObjAC.Dispose()
Else
Msgok.Append("Movimiento Registrado Correctamente.<br/><br/> ")
End If
ObjAC.dispose
End Sub