This commit is contained in:
rakcsle
2022-03-01 08:37:07 -07:00
19 changed files with 2329 additions and 147 deletions

View File

@@ -893,14 +893,15 @@ Public Class ClsAcumuladores
End Try
Return Retorno
End Function
Public Function UpdateEnvioPolizaVirutal(CvePolizaVirtual As Integer, Envio As Boolean, FechaEnvio As DateTime, CodigoUnico As String) As Boolean
Public Function UpdateEnvioPolizaVirtual(CvePolizaVirtual As Integer, Envio As Boolean, FechaEnvio As DateTime, CodigoUnico As String, RespuestaEnvio As String) As Boolean
Dim Retorno As Boolean = False
SqlDataAdapter("PA_Vta_PolizaVirtualEnvioUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@CvePolizaVirtual", SqlDbType.Int).Value = CvePolizaVirtual
.Add("@Envio", SqlDbType.TinyInt).Value = Envio
.Add("@FechaEnvio", SqlDbType.DateTime).Value = FechaEnvio
.Add("@CodigoUnico", SqlDbType.VarChar).Value = CodigoUnico
.Add("@CodigoUnico", SqlDbType.VarChar).Value = CodigoUnico
.Add("@RespuestaEnvio", SqlDbType.VarChar).Value = RespuestaEnvio
End With
Try
SqlAdapter.Fill(Data)

View File

@@ -3613,11 +3613,13 @@ Public Class ClsGenerales
#Region " P O L I Z A V I R T U A L "
Public Function ModelosAutosGet(CveEmpresa As Integer) As Boolean
Public Function ModelosAutosGet(Estatus As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Gral_ModelosAutosGet")
With SqlAdapter.SelectCommand.Parameters
With SqlAdapter.SelectCommand.Parameters
.Add("@Estatus", SqlDbType.Int).Value = Estatus
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)

View File

@@ -1564,8 +1564,8 @@ Namespace Modelos
End If
If DtPolizasVirtuales IsNot Nothing Then
If DtPolizasVirtuales.Select($"CvePS={Row("CvePS").ToString.ToEntero}").Length > 0 Then
Dim RowPoliza As DataRow = DtPolizasVirtuales.Select($"CvePS={Row("CvePS").ToString.ToEntero}")(0)
If DtPolizasVirtuales.Select($"Consec = {Row("Consec").ToString()} AND CvePS={Row("CvePS").ToString.ToEntero}").Length > 0 Then
Dim RowPoliza As DataRow = DtPolizasVirtuales.Select($"Consec = {Row("Consec").ToString()} AND CvePS={Row("CvePS").ToString.ToEntero}")(0)
RowPoliza("CveVentaDetalle") = ObjVentas.CveVentaDetalle
End If
End If
@@ -1625,7 +1625,7 @@ Namespace Modelos
'POLIZA VIRTUAL
If factura.DtPolizasVirtuales IsNot Nothing AndAlso factura.DtPolizasVirtuales.Rows.Count > 0 Then
If Not GuardarPolizasVirtuales(ObjVentas.IniciaTransacSQL(), ObjFactura:=factura) Then
If Not GuardarPolizasVirtuales(ObjAcum, ObjFactura:=factura) Then
ErrorList.Add("Ocurrió un error al actualizar el distribuidor.")
End If
End If
@@ -2225,13 +2225,11 @@ Namespace Modelos
Return CveMovimiento
End Function
Private Function GuardarPolizasVirtuales(SqlTransaccion As SqlClient.SqlTransaction, ObjFactura As Modelos.Factura) As Boolean
Private Function GuardarPolizasVirtuales(ByRef ObjAcum As ClsAcumuladores, ObjFactura As Modelos.Factura) As Boolean
Dim Resultado As Boolean = True
If UsuarioActual.Empresa.Funcionalidad(531).ToEntero > 0 AndAlso ObjFactura.TipoDocto.Contiene("Rem") Then
Dim ObjAcum As New ClsAcumuladores(SqlTransaccion)
For Each drow As DataRow In ObjFactura.DtPolizasVirtuales.Rows
If ObjAcum.AddPolizaVirtual(ObjFactura.CveVenta, drow("CveVentaDetalle").ToString().ToEntero(), drow("CvePS").ToString.ToEntero, drow("Cantidad").ToString.ToDecimal, drow("PU").ToString.ToDecimal, drow("Descuento").ToString.ToDecimal,
drow("Total").ToString.ToDecimal, drow("TipoServicio").ToString.ToEntero, drow("TipoPoliza").ToString.ToEntero, drow("CveModeloAuto").ToString.ToEntero, drow("AnioVehiculo").ToString.ToEntero, CBool(drow("TieneUsado").ToString),

File diff suppressed because it is too large Load Diff

View File

@@ -635,8 +635,8 @@ Partial Class Bancos_PopIECompras
CveMonedaFiltros = dr("CveMoneda").ToString.ToEntero
SerieFolio = dr("SerieFolio").ToString
TipoCambioOriginal = dr("TipoCambioOriginal").ToString.ToDecimal
NombreProveedor = GlobalDTCompProveedores(UsuarioActual.CveEmpresa).FiltroPrimeroValor("RazonSocial", String.Format("CveProveedor = {0}", CveProveedor))
NombreProveedor = dr("RazonSocial").ToString 'GlobalDTCompProveedores(UsuarioActual.CveEmpresa).FiltroPrimeroValor("RazonSocial", String.Format("CveProveedor = {0}", CveProveedor))
CveSubProyecto = dr("CveSubProyecto").ToString.ToEntero
LtlTitulo.Text = "Cuentas por Pagar"
@@ -1908,7 +1908,11 @@ Partial Class Bancos_PopIECompras
ElseIf MovimientoPagar.ConceptoRetISR = 2 Then
funcionalidad = 317
ConceptoContable = 243
ElseIf MovimientoPagar.ConceptoRetISR = 3 Then
funcionalidad = 348
ConceptoContable = 327
End If
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = MovimientoPagar.RetISR * PorcentajePago
ImporteMX = ImporteMovimiento
@@ -1951,6 +1955,9 @@ Partial Class Bancos_PopIECompras
ElseIf MovimientoPagar.ConceptoRetISR = 2 Then
funcionalidad = 318
ConceptoContable = 244
ElseIf MovimientoPagar.ConceptoRetISR = 3 Then
funcionalidad = 348
ConceptoContable = 328
End If
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = MovimientoPagar.RetISR * PorcentajePago

View File

@@ -1172,6 +1172,9 @@ Partial Class Bancos_ProveedoresAbonar
ElseIf gvr.DataKey("CveRetISRConcepto").ToEntero = 2 Then
funcionalidad = 317
ConceptoContable = 243
ElseIf gvr.DataKey("CveRetISRConcepto").ToEntero = 3 Then
funcionalidad = 348
ConceptoContable = 328
End If
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
@@ -1214,6 +1217,9 @@ Partial Class Bancos_ProveedoresAbonar
ElseIf gvr.DataKey("CveRetISRConcepto").ToEntero = 2 Then
funcionalidad = 318
ConceptoContable = 244
ElseIf gvr.DataKey("CveRetISRConcepto").ToEntero = 3 Then
funcionalidad = 348
ConceptoContable = 328
End If
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
@@ -1229,8 +1235,8 @@ Partial Class Bancos_ProveedoresAbonar
ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
End If
ImporteMovimiento = Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero)
importeMX = Math.Round(importeMX, 2, MidpointRounding.AwayFromZero)
ImporteMovimiento = ImporteMovimiento.RoundSQL
importeMX = importeMX.RoundSQL
TipoCambioGeneral = TipoCambioPago
If TipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{TipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
@@ -1272,8 +1278,8 @@ Partial Class Bancos_ProveedoresAbonar
ImporteMovimiento = gvr.DataKey("IVA").ToDecimal
importeMX = ImporteMovimiento * tipoCambioCompra
End If
ImporteMovimiento = Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero)
importeMX = Math.Round(importeMX, 2)
ImporteMovimiento = ImporteMovimiento.RoundSQL
importeMX = importeMX.RoundSQL
If tipoCambioCompra > 1 Then ConceptoMovimiento += $" TC:{tipoCambioCompra} ${ImporteMovimiento.FormatoNumero(2)}"
Else

View File

@@ -573,7 +573,7 @@
<ItemTemplate>
<asp:Literal ID="LtlConceptoContable" runat="server" Text='<%# Eval("ConceptoContable") %>'></asp:Literal><br />
</ItemTemplate>
<ItemStyle HorizontalAlign="Left" Width="150px" />
<ItemStyle HorizontalAlign="Left" Width="125px" />
</asp:TemplateField>
<asp:TemplateField>
@@ -581,8 +581,7 @@
<ItemTemplate>
<asp:HyperLink ID="HlReferencia" Target="_blank" runat="server" Text='<%# Eval("FolioFactura") %>'></asp:HyperLink>
<br />
</ItemTemplate>
<ItemStyle HorizontalAlign="Left" Width="150px" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>

View File

@@ -360,8 +360,9 @@ Partial Class RepCxCDetalle
DdlGrupo.SelectedValueExist(CveAgrupador)
'Carga Vendedor
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa)
DdlVendedor.DataBind()
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa, VendedorTipo:=-1).FiltraParametros("VendedorTipo in (1,4)")
DdlVendedor.DataBind()
DdlVendedor.SelectedValueExist(CveVendedor)
If UsuarioActual.CveVendedor > 0 AndAlso Not UsuarioActual.TienePermisoProceso(263) Then
DdlVendedor.SelectedValueExist(UsuarioActual.CveVendedor.ToString())
DdlVendedor.Attributes.Add("disabled", "disabled")

View File

@@ -176,7 +176,7 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas
}
else
{
SBError.AppendLine($"Factura {row.DataKey("SerieFolio")} error al agregar entrega alamcen. ");
SBError.AppendLine($"Factura {row.DataKey("SerieFolio")} error al agregar entrega almacen. ");
TieneError = true;
break;
}
@@ -205,6 +205,7 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas
StringBuilder MensajeAlert = new StringBuilder();
//recorrer para timbrar
MensajeAlert.Append(" Entregas creadas correctamente <br/><br/>");
bool huboerror = false;
foreach (int cvetimbre in ListaTimbres)
{
@@ -216,9 +217,7 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas
MensajeAlert.AppendFormat("<a class='texto' style='color:#337ab7' href='/Compras/PopUpVerFactura.aspx?P={0}' target='_blank'>XML &nbsp;<i class='fa fa-file'></i></i></a>&nbsp;&nbsp;", ModExtensiones.Encripta(String.Format("OP=DesXmlTra&CveTimbre={0}&EXT={1}&FOLIO={2}&TIPODOCTO={3}", cvetimbre, "XML", ObjTimbres.ObjFactura.SerieFolio, ObjTimbres.ObjFactura.TipoDocto)));
MensajeAlert.AppendFormat("<a class='texto' style='color:#337ab7' href='/Compras/PopUpVerFactura.aspx?P={0}' target='_blank'>PDF &nbsp;<i class='fa fa-ad-pdf'></i></i></i></a>&nbsp;", ModExtensiones.Encripta(String.Format("OP=CARPOTIMBRE&CVETIMBRE={0}", cvetimbre)));
MensajeAlert.Append("<br/>");
Alert(MensajeAlert.ToString(), ModExtensiones.TipoMensaje.MsgInformacion);
CargaDatos();
DdlChofer.SelectedValueExist("-1");
DdlUnidadCamion.SelectedValueExist("-1");
ChkEmitirCartaPorte.Checked = false;
@@ -228,9 +227,12 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas
}
else
{
huboerror = true;
MensajeAlert.AppendFormat("<ul><li>{0}</li></ul>", ObjTimbres.MsgError);
}
}
}
Alert(MensajeAlert.ToString(), ModExtensiones.TipoMensaje.MsgInformacion);
CargaDatos();
UpDatos.Update();
}
else

View File

@@ -762,6 +762,10 @@ Partial Class Inventarios_RecepcionUsados
ObjRemisionNC = Nothing
End If
If TmpDTAjustes IsNot Nothing Then
TmpDTAjustes.Rows.Clear()
End If
CveRemisionRecibida = -1
EsDistribuidor = False
DdlClientes.SelectedValueExist("-1")

View File

@@ -107,12 +107,12 @@ Partial Class Inventarios_RepAnomalias
GvF.Columns(3).Visible = True 'proveedor
GvS.Columns(3).Visible = True 'proveedor
GvC.Columns(3).Visible = True 'proveedor
GvF.Columns(16).Visible = UsuarioActual.Procesos(201) 'costo
GvS.Columns(16).Visible = UsuarioActual.Procesos(201) 'costo
GvC.Columns(16).Visible = UsuarioActual.Procesos(201) 'costo
GvF.Columns(17).Visible = UsuarioActual.Procesos(201) 'costo
GvS.Columns(17).Visible = UsuarioActual.Procesos(201) 'costo
GvC.Columns(17).Visible = UsuarioActual.Procesos(201) 'costo
GvGrupos.Columns(1).Visible = True 'clasificación
GvGrupos.Columns(2).Visible = True 'proveedor
GvGrupos.Columns(15).Visible = UsuarioActual.Procesos(201) 'costo
GvGrupos.Columns(17).Visible = UsuarioActual.Procesos(201) 'costo
End If
If Inventario.GetInventarioFisico(CveInventarioFisico, UsuarioActual.CveEmpresa, -1, -1, UsuarioActual.CveUsuario) Then

View File

@@ -236,7 +236,7 @@
</ItemTemplate>
<ItemStyle Width="7.5%" HorizontalAlign="Right"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Right" HeaderText="Exist. Final">
<asp:TemplateField ItemStyle-HorizontalAlign="Right" HeaderText="Exist. Final" ItemStyle-CssClass="LightGray">
<ItemTemplate>
<asp:Label ID="lbSaldoF" runat="server" Text='<%# If(Eval("SaldoFCant").ToString() = "0", "-", Eval("SaldoFCant", "{0:#,###.######}")) %>'></asp:Label>
</ItemTemplate>
@@ -261,7 +261,7 @@
</ItemTemplate>
<ItemStyle Width="7.5%" HorizontalAlign="Right"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Right" HeaderText="Saldo Final">
<asp:TemplateField ItemStyle-HorizontalAlign="Right" HeaderText="Saldo Final" >
<ItemTemplate>
<asp:Label ID="lbSaldoF2" runat="server" Text='<%# If(Eval("SaldoFImp").ToString() = "0", "-", Eval("SaldoFImp", "{0:N2}")) %>'></asp:Label>
</ItemTemplate>

View File

@@ -108,7 +108,7 @@ Partial Class Inventarios_ReporteEntradasSalidas
GvM.Columns(15).Visible = TienePermisoImportes
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
GvM.Columns(10).Visible = TienePermisoImportes
GvM.Columns(10).Visible = True
End If
End Sub
@@ -309,7 +309,7 @@ Partial Class Inventarios_ReporteEntradasSalidas
Else
e.Row.Cells(9).BackColor = Drawing.Color.LightGray
e.Row.Cells(13).BackColor = Drawing.Color.LightGray
e.Row.Cells(14).BackColor = Drawing.Color.LightGray
'e.Row.FCLabel("lbSaldoI").Text = If(e.Row.DBCampo("SaldoIniCant").ToString().ToEntero = 0, "-", e.Row.DBCampo("SaldoIniCant").ToDouble.ToString("N2"))
'e.Row.FCLabel("lbEntradasCant").Text = If(e.Row.DBCampo("EntradaCant").ToString().ToEntero = 0, "-", e.Row.DBCampo("EntradaCant").ToDouble.ToString("N2"))

View File

@@ -527,7 +527,9 @@ public partial class General_RepEntregaAlmacenRuta : ClsPaginas
}
else
{
if( ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscalCancelar, 0, RFCReceptor, RFCEmisor, CvePACCancelacion,CveSATMotivoCancelacion: 3)) {
ModExtensiones.RespuestaCancelacionSAT Resp = ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscalCancelar, 0, RFCReceptor, RFCEmisor, CvePACCancelacion, CveSATMotivoCancelacion: 3);
if (Resp.Verificado) {
if (ObjGenerales.CancelarTimbreTimbrado(CveTimbre, DateTime.Now, CvePACCancelacion, ObjCancelacion.CancelacionAcuse, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
{

View File

@@ -1449,26 +1449,26 @@ Partial Class Clientes
' CargaGridRetenciones()
' CargaDocs()
CargaCombos()
CargaDocumentacionCliente()
'CargaMetodosPago33()
'CargaFormaPago33()
'CargaComboCFDI()
'CargarPagosNoBancarios()
CargaDocumentacionCliente()
'CargaMetodosPago33()
'CargaFormaPago33()
'CargaComboCFDI()
'CargarPagosNoBancarios()
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
LnkPorcentajeMarcas.Visible = True
LnkPorcentajePrecios.Visible = True
If UsuarioActual.TienePermisoProceso(279) Then
TrPreciosPP.Visible = True
TrAgregarPMarca.Visible = True
BtnGuardarPorcentajesMarca.Visible = True
BtnGuardarPorcentajes.Visible = True
End If
LnkPorcentajePrecios.Visible = True
If UsuarioActual.TienePermisoProceso(279) Then
TrPreciosPP.Visible = True
TrAgregarPMarca.Visible = True
BtnGuardarPorcentajesMarca.Visible = True
BtnGuardarPorcentajes.Visible = True
End If
End If
@@ -8972,27 +8972,27 @@ Partial Class Clientes
CargaDTPorcentajePrecios(DTPorcentajePrecios.FiltraParametros("Estatus <> 'D' "))
End Sub
Protected Sub GvM_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvM.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If UsuarioActual.TienePermisoProceso(279) Then
e.Row.FCLinkButton("imgE").Visible = True
e.Row.FCLinkButton("lnkRemove").Visible = True
End If
End If
End Sub
Protected Sub GvP_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvP.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If UsuarioActual.TienePermisoProceso(279) Then
e.Row.FCLinkButton("imgE").Visible = True
e.Row.FCLinkButton("lnkRemove").Visible = True
End If
End If
End Sub
Protected Sub GvM_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvM.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow AndAlso Not (e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5) Then
If UsuarioActual.TienePermisoProceso(279) Then
e.Row.FCLinkButton("imgE").Visible = True
e.Row.FCLinkButton("lnkRemove").Visible = True
End If
End If
End Sub
Protected Sub GvP_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvP.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow AndAlso Not (e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5) Then
If UsuarioActual.TienePermisoProceso(279) Then
e.Row.FCLinkButton("imgE").Visible = True
e.Row.FCLinkButton("lnkRemove").Visible = True
End If
End If
End Sub
Protected Sub GvM_RowEditing(sender As Object, e As GridViewEditEventArgs) Handles GvM.RowEditing
GvM.EditIndex = e.NewEditIndex
@@ -10466,7 +10466,7 @@ Partial Class Clientes
Alert("Los cambios se guardaron satisfactoriamente.")
End Using
End Sub
End Sub
End Class

View File

@@ -2872,7 +2872,7 @@
<label>Año:</label>
<br />
<asp:TextBox ID="TxtAnioVehiculo" type="number" runat="server" Height="100%" Width="100%" CssClass="form-control" ></asp:TextBox>
<asp:CustomValidator ID="CVAnio" runat="server" ClientValidationFunction="ValidaAnioVehiculo" ValidateEmptyText="true" ControlToValidate="TxtAnioVehiculo" Display="Dynamic" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Año''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:CustomValidator>
<asp:CustomValidator ID="CVAnio" runat="server" ClientValidationFunction="ValidaAnioVehiculo" ValidateEmptyText="true" ControlToValidate="TxtAnioVehiculo" Display="Dynamic" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Año''</b> esta vacío o no tiene el formato correcto, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:CustomValidator>
</div>
</div>
<div class="row">
@@ -3281,7 +3281,19 @@
//VALIDA SOLO SI SE SELECCIONO UN USADO
var cveUsado = ToDouble($get("C_DdlRecepcionUsados").value);
if (cveUsado > 0) {
args.IsValid = (ToDouble(args.Value) > 0);
var anio = ToDouble(args.Value);
if (anio > 0) {
var valido = true;
if (anio < 1900) {
valido = false;
}
if (anio.toString().length != 4) {
valido = false;
}
args.IsValid = valido;
} else {
args.IsValid = false;
}
} else {
args.IsValid = true;
}

View File

@@ -3430,27 +3430,27 @@ Partial Class PV
If Retorno IsNot Nothing AndAlso Retorno.CveVenta > 0 Then
If ObjFactura.TipoDocto = "Rem" Then
If ObjAcum.GetPolizasVirtuales(Retorno.CveVenta) Then
Dim DtPoliza As DataTable = ObjAcum.DtResultados.Copy()
'If ObjFactura.TipoDocto = "Rem" Then
' If ObjAcum.GetPolizasVirtuales(Retorno.CveVenta) Then
' Dim DtPoliza As DataTable = ObjAcum.DtResultados.Copy()
For Each Row As DataRow In ObjFactura.DtPolizasVirtuales.Rows
Dim CvePolizaVirtual As Integer = DtPoliza.FiltroPrimeroValor("CvePolizaVirtual", $"CveVentaDetalle={Row("CveVentaDetalle")}").ToEntero()
' For Each Row As DataRow In ObjFactura.DtPolizasVirtuales.Rows
' Dim CvePolizaVirtual As Integer = DtPoliza.FiltroPrimeroValor("CvePolizaVirtual", $"CveVentaDetalle={Row("CveVentaDetalle")}").ToEntero()
If Not ObjAcum.UpdatePolizaVirtual(CvePolizaVirtual, Row("CveMarcaUsado").ToString().ToEntero(), Row("FechaUsado").ToString().ToDateTime()) Then
SbAlert.Append("Error al guardar la póliza virtual")
TieneError = True
Exit For
End If
Next
' If Not ObjAcum.UpdatePolizaVirtual(CvePolizaVirtual, Row("CveMarcaUsado").ToString().ToEntero(), Row("FechaUsado").ToString().ToDateTime()) Then
' SbAlert.Append("Error al guardar la póliza virtual")
' TieneError = True
' Exit For
' End If
' Next
DtPoliza.Dispose()
Else
SbAlert.Append("Error al obtener la póliza virtual")
TieneError = True
End If
' DtPoliza.Dispose()
' Else
' SbAlert.Append("Error al obtener la póliza virtual")
' TieneError = True
' End If
End If
'End If
If ObjAcum.GetGarantiasDetalle(Retorno.CveVenta) Then
Dim RowGarantia As DataRow = ObjAcum.DtResultados.FiltroPrimero("")
@@ -4790,6 +4790,9 @@ Partial Class PV
DdlRecepcionUsados.SelectedValueExist("-1")
DivRecepcionUsados.Visible = False
DdlMarca.SelectedValueExist("-1")
TxtFechaVigencia.Text = Now.ToString("dd/MM/yyyy")
LimpiaAjuste()
UPPDescuento.Update()
@@ -5295,7 +5298,7 @@ Partial Class PV
divagregrarotrops.Visible = False
Ajuste()
AddPolizaVirtual(DdlPS.SelectedValue.ToEntero())
'AddPolizaVirtual(DdlPS.SelectedValue.ToEntero())
'BUSCA EN TMPDT LOS DATOS DE USADOS
If TmpDT.Rows.Count > 0 AndAlso TmpDTRecepcionUsados IsNot Nothing AndAlso TmpDTRecepcionUsados.Rows.Count > 0 Then
@@ -5334,11 +5337,29 @@ Partial Class PV
Exit Sub
End If
If String.IsNullOrEmpty(TxtAnioVehiculo.Text.Trim()) Then
Alert("El campo año esta vacío.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
If TxtAnioVehiculo.Text.ToDecimal() < 1900 Then
Alert("El campo año debe ser mayor a 1900.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Else
If Not String.IsNullOrEmpty(TxtAnioVehiculo.Text.Trim()) Then
If TxtAnioVehiculo.Text.ToDecimal() < 1900 Then
Alert("El año del vehiculo del vehículo no tiene el formato correcto.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
End If
If AgregarPS() Then
If ChkAjuste.Checked Then GuardaAjuste()
AddPolizaVirtual(DdlPS.SelectedValue.ToEntero())
CalculaTotalesVenta()
If ChkAgregar.Checked = True And Modalidad = "A" Then
@@ -5404,17 +5425,19 @@ Partial Class PV
CveProyecto, Proyecto, DdlSubProyectoDatos.SelectedValue.ToEntero, DdlSubProyectoDatos.SelectedItem.Text,
Serie:="", TiempoEntrega:="", CuentaPredial:="", RegeneraIEPS:=ClienteDesglosaIEPS, CveVentaDetalle:=CveVentaDetalle, EsCargo:=EsCargo)
Dim ListaPSCargo As List(Of MConceptoUsado) = Nothing
If CveVentaDetalle <= 0 AndAlso Not EsCargo Then
Dim ListaPSCargo = CalculaUsados(Consec)
If ListaPSCargo.Count > 0 Then
CalculaRecepcionUsados(CvePS, ListaPSCargo, Cantidad, Consec)
End If
ListaPSCargo = CalculaUsados(Consec)
ElseIf CveVentaDetalle > 0 AndAlso Not EsCargo Then
EliminarUsados()
Dim ListaPSCargo = CalculaUsados(Consec, LimpiarUsados:=False)
If ListaPSCargo.Count > 0 Then
CalculaRecepcionUsados(CvePS, ListaPSCargo, Cantidad, Consec)
End If
ListaPSCargo = CalculaUsados(Consec, LimpiarUsados:=False)
End If
If ListaPSCargo IsNot Nothing AndAlso ListaPSCargo.Count > 0 Then
CalculaRecepcionUsados(CvePS, ListaPSCargo, Cantidad, Consec)
For Each Usado As MConceptoUsado In ListaPSCargo
AddPolizaVirtual(DdlPS.SelectedValue.ToEntero(), Usado.Consecutivo)
Next
End If
Return True
@@ -7386,6 +7409,7 @@ Partial Class PV
#Region "P O L I Z A - V I R T U A L"
Private Sub CreaDTmpDTPolizaVirtual()
TmpDTPolizaVirtual = New DataTable
TmpDTPolizaVirtual.Columns.Add("Consec", GetType(Integer))
TmpDTPolizaVirtual.Columns.Add("CvePS", GetType(Integer))
TmpDTPolizaVirtual.Columns.Add("Cantidad", GetType(Decimal))
TmpDTPolizaVirtual.Columns.Add("PU", GetType(Decimal))
@@ -7402,14 +7426,14 @@ Partial Class PV
TmpDTPolizaVirtual.Columns.Add("CveBCIUsado", GetType(Integer))
TmpDTPolizaVirtual.Columns.Add("CveMarcaUsado", GetType(Integer))
End Sub
Private Function AddPolizaVirtual(CvePS As Integer) As Boolean
Private Function AddPolizaVirtual(CvePS As Integer, Consec As Integer) As Boolean
Dim Retorno As Boolean = True
If Modalidad = "U" Then
If TmpDTPolizaVirtual.Rows.Count > 0 Then
Dim Elimino As Boolean = False
For Each RowPoliza As DataRow In TmpDTPolizaVirtual.Rows
If RowPoliza("CvePS").ToString().ToEntero() = CvePS Then
If RowPoliza("Consec").ToString().ToEntero() = Consec AndAlso RowPoliza("CvePS").ToString().ToEntero() = CvePS Then
RowPoliza.Delete()
Elimino = True
Exit For
@@ -7475,6 +7499,8 @@ Partial Class PV
End If
Dim Row As DataRow = TmpDTPolizaVirtual.NewRow()
Row("Consec") = Consec
Row("CvePS") = CvePS
Row("Cantidad") = Cantidad
Row("PU") = PU
@@ -7524,7 +7550,7 @@ Partial Class PV
EmitirImprimirNew()
End Sub
Private Sub CalculaRecepcionUsados(CvePS As Integer, ListaPSCargo As List(Of Integer), CantidadUsado As Decimal, ConsecPSPadre As Integer)
Private Sub CalculaRecepcionUsados(CvePS As Integer, ListaPSCargo As List(Of MConceptoUsado), CantidadUsado As Decimal, ConsecPSPadre As Integer)
If Modalidad = "U" Then
If TmpDTRecepcionUsados.Rows.Count > 0 Then
@@ -7600,8 +7626,8 @@ Partial Class PV
End If
Dim StrCargos As New StringBuilder
For Each CvePSCargo As Integer In ListaPSCargo
StrCargos.AppendFormat(" {0},", CvePSCargo)
For Each Usado As MConceptoUsado In ListaPSCargo
StrCargos.AppendFormat(" {0},", Usado.CvePS)
Next
StrCargos.Remove(StrCargos.Length - 1, 1)
@@ -7718,12 +7744,16 @@ Partial Class PV
CalculaTotalesVenta()
End Sub
Private Function CalculaUsados(Consec As Integer, Optional LimpiarUsados As Boolean = True) As List(Of Integer)
Public Class MConceptoUsado
Public Property Consecutivo As Integer
Public Property CvePS As Integer
End Class
Private Function CalculaUsados(Consec As Integer, Optional LimpiarUsados As Boolean = True) As List(Of MConceptoUsado)
If Modalidad = "U" AndAlso LimpiarUsados Then
EliminarUsados(Consec)
End If
Dim ListaPScargo As New List(Of Integer)
Dim ListaPScargo As New List(Of MConceptoUsado)
Dim DTTamanios As DataTable = GlobalDTAcumTamaños()
Dim DTCvePSCostos = DTTamanios.FiltraParametros("", "", {"CvePSCargo"})
@@ -7828,7 +7858,7 @@ Partial Class PV
drowPsTamaños("PS").ToString, "", drowPsTamaños("PU").ToString.ToDecimal, 0, -1, "", drowPsTamaños("CveSubProyecto").ToString.ToEntero,
drowPsTamaños("SubProyecto").ToString, EsCargo:=True, ConsecPSPadre:=drowPsTamaños("ConsecPSPadre").ToString.ToEntero, EliminarDB:=CBool(drowPsTamaños("EliminarDB").ToString()))
If Consec > 0 Then
ListaPScargo.Add(drowPsTamaños("CvePS").ToString.ToEntero)
ListaPScargo.Add(New MConceptoUsado() With {.Consecutivo = Consec, .CvePS = drowPsTamaños("CvePS").ToString.ToEntero})
End If
End If
Next

View File

@@ -4985,6 +4985,11 @@ Partial Class Ventas
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
@@ -7504,6 +7509,13 @@ Partial Class Ventas
e.Row.FCLinkButton("imgE").Visible = False
e.Row.FCLinkButton("imgD").Visible = False
End If
'EN BDH NO DEBE PODER EDITAR LOS PS
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
e.Row.FCLinkButton("imgE").Visible = False
e.Row.FCLinkButton("imgD").Visible = False
End If
End If
'CANTIDAD FACTURADA
@@ -8164,6 +8176,12 @@ Partial Class Ventas
Exit Sub
End If
'VENDEDOR OBLIGATORIO
If DdlVendedor.SelectedValue.ToEntero() <= 0 AndAlso UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso DdlTipoComprobante.SelectedValue = "Ing" Then
Alert("Debe seleccionar un vendedor.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
'SI TIENE ANTICIPOS Y ESTA AMORTIZADO AL 100% EL DOCUMENTO (SALDO = 0) | NO VALIDA PU DEL CONCEPTO
If Not (LblAmortizacion.Text.ToDouble > 0 And TxtTotal.Text.ToDouble <= 0) Then
If Not DdlTipoComprobante.SelectedValue.Contiene("Ped", "Ant", "DPe") Then
@@ -8543,6 +8561,11 @@ Partial Class Ventas
HplDownPDF.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", CveVenta)))
End If
'NO DEBE IMPRIMIR PDF DE COTIZACION
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso DdlTipoComprobante.SelectedValue = "Cot" Then
HplDownPDF.Visible = False
End If
UpnTools.Update()
End Sub
@@ -9272,17 +9295,21 @@ Partial Class Ventas
If DdlTipoComprobante.SelectedValue = "Cot" Then
If Not CveEmpresaCRM > 0 Then
If CveVenta > 0 Then MensajeAlert = New StringBuilder
Dim ArchivoCotizacion As New System.IO.FileInfo(String.Format("{0}Formatos/Cotizacion.rdlc", UsuarioActual.Empresa.Ruta))
If Opcion = "Cot" And UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
MensajeAlert.AppendFormat("<b><a class='Texto' href=""Ventas.aspx?CveVenta={0}"">Facturar</a></b><br/><br/>", CveVenta)
End If
'EN EMPRESA DE ACUMULADORES NO DESCARGAR EL PDF
If UsuarioActual.Empresa.Funcionalidad(531) <> "1" Then
If CveVenta > 0 Then MensajeAlert = New StringBuilder
Dim ArchivoCotizacion As New System.IO.FileInfo(String.Format("{0}Formatos/Cotizacion.rdlc", UsuarioActual.Empresa.Ruta))
If ArchivoCotizacion.Exists Then
MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF</a></li></ul><br/>", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=0", CveVenta)))
Else
MensajeAlert.Append("Ocurrió un error al generar el PDF. Por favor vuelva a entrar a la factura para imprimir el PDF. ")
If Opcion = "Cot" And UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
MensajeAlert.AppendFormat("<b><a class='Texto' href=""Ventas.aspx?CveVenta={0}"">Facturar</a></b><br/><br/>", CveVenta)
End If
If ArchivoCotizacion.Exists Then
MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF</a></li></ul><br/>", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=0", CveVenta)))
Else
MensajeAlert.Append("Ocurrió un error al generar el PDF. Por favor vuelva a entrar a la factura para imprimir el PDF. ")
End If
End If
GeneraPDFCotizacion(ChkEnviarFactura.Checked) ' MANDA CORREO
@@ -17235,7 +17262,7 @@ Partial Class Ventas
DdlVendedorSucursal.SelectedValue = Nothing
If UsuarioActual.Empresa.Funcionalidad(302) = "1" AndAlso DdlSubProyectoDatos.SelectedValue.ToEntero() > 0 Then
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("(CveSubProyecto IS NULL OR CveSubProyecto = {0})", DdlSubProyectoDatos.SelectedValue)).FiltraParametros("VendedorTipo = 1")
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa, VendedorTipo:=-1).FiltraParametros(String.Format("VendedorTipo IN (1,4) AND (CveSubProyecto IS NULL OR CveSubProyecto = {0})", DdlSubProyectoDatos.SelectedValue))
Else
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa).FiltraParametros("VendedorTipo = 1")
End If
@@ -17281,11 +17308,11 @@ Partial Class Ventas
End If
If CveVendedorActual > 0 Then
Dim VendedorActual As String = GlobalDTVendedores(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Vendedor", $"CveVendedor = {CveVendedorActual}")
Dim VendedorActual As String = GlobalDTVendedores(UsuarioActual.CveEmpresa, VendedorTipo:=-1).FiltroPrimeroValor("Vendedor", $"CveVendedor = {CveVendedorActual}")
'SI NO ENCUENTRA BUSCA EN LOS VENDEDORES DEL PV
If String.IsNullOrEmpty(VendedorActual) Then
VendedorActual = GlobalDTVendedores(UsuarioActual.CveEmpresa, VendedorTipo:=4).FiltroPrimeroValor("Vendedor", String.Format("CveVendedor = {0}", CveVendedorActual))
End If
'If String.IsNullOrEmpty(VendedorActual) Then
' VendedorActual = GlobalDTVendedores(UsuarioActual.CveEmpresa, VendedorTipo:=4).FiltroPrimeroValor("Vendedor", String.Format("CveVendedor = {0}", CveVendedorActual))
'End If
If String.IsNullOrEmpty(VendedorActual) Then
DdlVendedor.SelectedValueExist(CveVendedorActual)
@@ -17294,17 +17321,10 @@ Partial Class Ventas
End If
End If
If UsuarioActual.CveEmpresa = 140 Then
If Not UsuarioActual.TienePermisoProceso(161) Then
DdlVendedor.Enabled = False
End If
Else
If DdlVendedor.SelectedValue.ToEntero() > 0 AndAlso Not UsuarioActual.TienePermisoProceso(161) Then
DdlVendedor.Enabled = False
End If
If DdlVendedor.SelectedValue.ToEntero() > 0 AndAlso Not UsuarioActual.TienePermisoProceso(161) Then
DdlVendedor.Enabled = False
End If
'multiples vendedores visible
If UsuarioActual.TienePermisoProceso(153) Then
DdlVendedor.Enabled = True

View File

@@ -134,7 +134,12 @@ Public Class WSGPSApp
Clientes.Add(New WsClientePortalGPS With {.CveCliente = Row("CveCliente").ToString.ToEntero, .Cliente = Row("Cliente").ToString})
Next
If UsuarioActual.CveCliente <= 0 AndAlso Clientes.Any() Then
UsuarioRetorno.CveCliente = Clientes.FirstOrDefault().CveCliente
UsuarioRetorno.CveCliente = Clientes.FirstOrDefault().CveCliente
If UsuarioRetorno.CveCliente > 0 Then
If UsuarioActual.Empresa.Funcionalidad(704).Contiene(UsuarioRetorno.CveCliente.ToString()) Then
UsuarioRetorno.RastreoSoloInicio = True
End If
End If
End If
End If
End If
@@ -196,7 +201,15 @@ Public Class WSGPSApp
Clientes.Add(New WsClientePortalGPS With {.CveCliente = Row("CveCliente").ToString.ToEntero, .Cliente = Row("Cliente").ToString})
Next
If UsuarioActual.CveCliente <= 0 AndAlso Clientes.Any() Then
UsuarioRetorno.CveCliente = Clientes.FirstOrDefault().CveCliente
UsuarioRetorno.CveCliente = Clientes.FirstOrDefault().CveCliente
If UsuarioActual.CveCliente <= 0 AndAlso Clientes.Any() Then
UsuarioRetorno.CveCliente = Clientes.FirstOrDefault().CveCliente
If UsuarioRetorno.CveCliente > 0 Then
If UsuarioActual.Empresa.Funcionalidad(704).Contiene(UsuarioRetorno.CveCliente.ToString()) Then
UsuarioRetorno.RastreoSoloInicio = True
End If
End If
End If
End If
End If
End If
@@ -1126,7 +1139,8 @@ Namespace ADGPSModels
Public Property Contrasenia As String
Public Property TienePermisoOC As Boolean
Public Property TienePermisoPS As Boolean
Public Property TienePermisoPS As Boolean
Public Property RastreoSoloInicio As Boolean = False
End Class
<Serializable>