Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -120,7 +120,7 @@ Public Class ClsExportaciones
|
||||
End Sub
|
||||
|
||||
#Region "EXPORTACIONES"
|
||||
Public Function GetExportacion(Optional CveExportacion As Integer = -1, Optional CveEmpresa As Integer = -1, Optional EsExportacion As Integer = 1, Optional FechaInicio As Date = MinFecha, Optional FechaFin As Date = MaxFecha) As Boolean
|
||||
Public Function GetExportacion(Optional CveExportacion As Integer = -1, Optional CveEmpresa As Integer = -1, Optional EsExportacion As Boolean = True, Optional FechaInicio As Date = MinFecha, Optional FechaFin As Date = MaxFecha) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Exp_ExportacionesRep")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
@@ -143,7 +143,7 @@ Public Class ClsExportaciones
|
||||
CveClienteExportador As Integer, CveClienteImportador As Integer, CveClienteConsignatario As Integer, CveAgente As Integer, ClaveAduana As Integer,
|
||||
CveProveedor As Integer, MedioTransporte As Integer, TipoContenedor As Integer, Sello1 As String, Sello2 As String, Sello3 As String, SCAC As String,
|
||||
CAAT As String, ContenedorPlaca As String, CveEmpresa As Integer, CveUsuario As Integer, CveDirExportador As Integer, CveDirConsignatario As Integer,
|
||||
CveIncoterm As Integer, Notas As String, CvePedimento As Integer, CveAgenteExtranjero As Integer, ITN As String, Vinculacion As Boolean) As Integer
|
||||
CveIncoterm As Integer, Notas As String, CvePedimento As Integer, CveAgenteExtranjero As Integer, ITN As String, Vinculacion As Boolean, EsExportacion As Boolean) As Integer
|
||||
Dim Retorno As Integer = -1
|
||||
DataAdapter("PA_Exp_ExportacionesAdd")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
@@ -177,6 +177,7 @@ Public Class ClsExportaciones
|
||||
.Add("@CveAgenteExtranjero", SqlDbType.Int).Value = CveAgenteExtranjero
|
||||
.Add("@ITN", SqlDbType.VarChar).Value = ITN
|
||||
.Add("@Vinculacion", SqlDbType.Bit).Value = Vinculacion
|
||||
.Add("@EsExportacion", SqlDbType.Bit).Value = EsExportacion
|
||||
|
||||
.Add("@CveExportacion", SqlDbType.Int).Direction = ParameterDirection.Output
|
||||
End With
|
||||
|
||||
@@ -35,6 +35,12 @@ public partial class Export_ExpDetalle : ClsPaginas
|
||||
get { return (ViewState["CveExportacionDetalle"] == null) ? -1 : Convert.ToInt32(ViewState["CveExportacionDetalle"]); }
|
||||
set { ViewState["CveExportacionDetalle"] = value; }
|
||||
}
|
||||
|
||||
private bool EsImportacion
|
||||
{
|
||||
get { return (ViewState["EsImportacion"] == null) ? false : Boolean.Parse(ViewState["EsImportacion"].ToString()); }
|
||||
set { ViewState["EsImportacion"] = value; }
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -42,6 +48,12 @@ public partial class Export_ExpDetalle : ClsPaginas
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
EsImportacion = false;
|
||||
if (!string.IsNullOrEmpty(Request["Opcion"]) && Request["Opcion"].Equals("I", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
EsImportacion = true;
|
||||
}
|
||||
|
||||
CveExportacion = !string.IsNullOrEmpty(Request["CveExportacion"]) ? Request["CveExportacion"].ToEntero() : -1;
|
||||
InicializarValores();
|
||||
CargaDatos();
|
||||
@@ -117,7 +129,8 @@ public partial class Export_ExpDetalle : ClsPaginas
|
||||
{
|
||||
DataTable DTExportaciones = new DataTable();
|
||||
ClsExportaciones Exportaciones = new ClsExportaciones();
|
||||
if (Exportaciones.GetExportacion(CveExportacion, UsuarioActual.CveEmpresa))
|
||||
bool EsExportacion = !EsImportacion;
|
||||
if (Exportaciones.GetExportacion(CveExportacion, UsuarioActual.CveEmpresa, EsExportacion))
|
||||
{
|
||||
DTExportaciones = Exportaciones.DtResultados;
|
||||
if (DTExportaciones.Rows.Count > 0)
|
||||
@@ -371,7 +384,7 @@ public partial class Export_ExpDetalle : ClsPaginas
|
||||
decimal DecOtros = ModExtensiones.ToDecimal(TxtDecOtros.Text);
|
||||
|
||||
ClsExportaciones Exportaciones = new ClsExportaciones();
|
||||
|
||||
bool EsExportacion = !EsImportacion;
|
||||
if (CveExportacion == -1)
|
||||
{
|
||||
int ExportacionGuardada = Exportaciones.AddExportacion(
|
||||
@@ -404,7 +417,8 @@ public partial class Export_ExpDetalle : ClsPaginas
|
||||
CvePedimento,
|
||||
CveAgenteExtranjero,
|
||||
ITN,
|
||||
Vinculacion
|
||||
Vinculacion,
|
||||
EsExportacion
|
||||
);
|
||||
if (ExportacionGuardada != -1)
|
||||
{
|
||||
@@ -442,8 +456,10 @@ public partial class Export_ExpDetalle : ClsPaginas
|
||||
}
|
||||
|
||||
//string Liga = "document.location.href=\"/Export/RepExportaciones.aspx\";";
|
||||
string Liga = $"document.location.href=\"/Export/ExpDetalle.aspx?CveExportacion={ExportacionGuardada}\";";
|
||||
Alert("La Exportación se ha agregado correctamente.", JSBtnAceptar: Liga);
|
||||
string liga = EsImportacion
|
||||
? $"document.location.href=\"/Export/ExpDetalle.aspx?CveExportacion={ExportacionGuardada}&Opcion=I\";"
|
||||
: $"document.location.href=\"/Export/ExpDetalle.aspx?CveExportacion={ExportacionGuardada}\";";
|
||||
Alert("La Exportación se ha agregado correctamente.", JSBtnAceptar: liga);
|
||||
}
|
||||
Exportaciones.Dispose();
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ public partial class Export_RepExportaciones : ClsPaginas
|
||||
protected void CargaExportaciones()
|
||||
{
|
||||
ClsExportaciones Exportaciones = new ClsExportaciones();
|
||||
int EsExportacion = EsImportacion ? 0 : 1; // 0 = importación, 1 = exportación
|
||||
bool EsExportacion = !EsImportacion;
|
||||
if (Exportaciones.GetExportacion(-1, UsuarioActual.CveEmpresa, EsExportacion))
|
||||
{
|
||||
GVExportaciones.DataSource = Exportaciones.DtResultados;
|
||||
|
||||
@@ -79,6 +79,8 @@ Partial Class Vta_CatCobranzaEstatus
|
||||
Alert("Error al actualizar")
|
||||
End If
|
||||
End If
|
||||
|
||||
GlobalDTVtaCobranzaEstatus(UsuarioActual.CveEmpresa) = Nothing
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
|
||||
@@ -92,6 +94,8 @@ Partial Class Vta_CatCobranzaEstatus
|
||||
Alert("Estatus de cobranza eliminado")
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
|
||||
GlobalDTVtaCobranzaEstatus(UsuarioActual.CveEmpresa) = Nothing
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatosTurno()
|
||||
|
||||
@@ -33,13 +33,13 @@
|
||||
</div>
|
||||
<div class="titlefiltros caption">
|
||||
<div class="row">
|
||||
<label class="col-md-1 truncate">Sucursal:</label>
|
||||
<div class="col-md-2">
|
||||
<label class="col-md-1 truncate" id="DivLblSucursal" runat="server">Sucursal:</label>
|
||||
<div class="col-md-2" id="DivSucursal" runat="server">
|
||||
<asp:DropDownList ID="DdlSubProyecto" runat="server" Width="100%" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<label class="col-md-1 truncate">Mes/Año:</label>
|
||||
<div class="col-md-1" style="min-width: 115px">
|
||||
<label class="col-md-1 truncate" id="DivLblMes" runat="server">Mes/Año:</label>
|
||||
<div class="col-md-1" style="min-width: 115px" id="DivMes" runat="server">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
|
||||
<asp:TextBox Width="80px" ID="txtMesAnio" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
@@ -54,8 +54,8 @@
|
||||
<asp:DropDownList ID="DdlVendedor" runat="server" Width="100%" DataTextField="Vendedor" DataValueField="CveVendedor" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<label title="Marca" data-toggle="tooltip" class="col-md-1 truncate">Marca:</label>
|
||||
<div class="col-md-2">
|
||||
<label title="Marca" data-toggle="tooltip" class="col-md-1 truncate" id="DivLblMarca" runat="server">Marca:</label>
|
||||
<div class="col-md-2" id="DivMarca" runat="server">
|
||||
<asp:DropDownList ID="DdlMarca" runat="server" Width="100%" DataTextField="Marca" DataValueField="CveMarca" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
@@ -70,7 +70,7 @@
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveMeta,CveVendedor,CveMarca,CveClasificacion,CveClasificacionSup,Vendedor,MesAño,Marca,Clasificacion,MetaCantidad,MetaImporte" EmptyDataText="No se encontraron metas registradas" ToolTip="Listado de Metas Vendedor" CssClass="table table-striped table-advance table-hover" Style=" width: 100%" GridLines="None">
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveMeta,CveVendedor,CveMarca,CveClasificacion,CveClasificacionSup,Vendedor,MesAño,Marca,Clasificacion,MetaCantidad,MetaImporte" EmptyDataText="No se encontraron metas registradas" ToolTip="Listado de Metas Vendedor" CssClass="table table-striped table-advance table-hover" Style="width: 100%" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="Vendedor" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
@@ -162,48 +162,54 @@
|
||||
<asp:Literal ID="LtlTituloModalTiposD" runat="server">Metas Vendedores</asp:Literal></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<label for="DdlVendedores">Vendedor:</label>
|
||||
<asp:DropDownList ID="DdlVendedores" runat="server" DataTextField="Vendedor" DataValueField="CveVendedor" CssClass="form-control input-sm select2me"></asp:DropDownList>
|
||||
<i></i>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<label for="MotivoTxt">Mes y Año:</label>
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 95px !important; padding: 0px;">
|
||||
<asp:TextBox Style="width: 110px !important;" ID="TxtFechaI" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="ImgFechaI" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
<div class="row" style="display: flex; align-items: center; margin-bottom: 10px;">
|
||||
<div class="col-md-2 truncate">Vendedor</div>
|
||||
<div class="col-md-10">
|
||||
<asp:DropDownList ID="DdlVendedores" runat="server" DataTextField="Vendedor" DataValueField="CveVendedor" CssClass="form-control input-sm select2me" Width="100%"></asp:DropDownList>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="TxtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CEFechaI" TargetControlID="TxtFechaI" PopupButtonID="ImgFechaI" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<label for="DdlMarcas">Clasificacion Superior:</label>
|
||||
<asp:DropDownList ID="DdlClasificacionSup" runat="server" DataTextField="Clasificacion" DataValueField="CveClasificacion" CssClass="form-control input-sm select2me"></asp:DropDownList>
|
||||
<i></i>
|
||||
<div class="row" style="display: flex; align-items: center; margin-bottom: 10px;" id="Div3" runat="server" visible="false">
|
||||
<div class="col-md-2 truncate">Marca</div>
|
||||
<div class="col-md-4">
|
||||
<asp:DropDownList ID="DdlMarcas" runat="server" DataTextField="Marca" DataValueField="CveMarca" CssClass="form-control input-sm select2me" Width="100%"></asp:DropDownList>
|
||||
</div>
|
||||
<div class="col-md-2 truncate">Mes y Año</div>
|
||||
<div class="col-md-4">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 95px !important; padding: 0px;">
|
||||
<asp:TextBox Style="width: 110px !important;" ID="TxtFechaI" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="ImgFechaI" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="TxtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CEFechaI" TargetControlID="TxtFechaI" PopupButtonID="ImgFechaI" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<label for="DdlMarcas">Clasificacion:</label>
|
||||
<asp:DropDownList ID="DdlClasificacion" runat="server" DataTextField="Clasificacion" DataValueField="CveClasificacion" CssClass="form-control input-sm select2me"></asp:DropDownList>
|
||||
<i></i>
|
||||
<div class="row" style="display: flex; align-items: center; margin-bottom: 10px;" id="Div2" runat="server" visible="false">
|
||||
<div class="col-md-2">Clasificación Superior</div>
|
||||
<div class="col-md-10">
|
||||
<asp:DropDownList ID="DdlClasificacionSup" runat="server" DataTextField="Clasificacion" DataValueField="CveClasificacion" CssClass="form-control input-sm select2me" Width="100%"></asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<label for="DdlMarcas">Marca:</label>
|
||||
<asp:DropDownList ID="DdlMarcas" runat="server" DataTextField="Marca" DataValueField="CveMarca" CssClass="form-control input-sm select2me"></asp:DropDownList>
|
||||
<i></i>
|
||||
<div class="row" style="display: flex; align-items: center; margin-bottom: 10px;" id="Div1" runat="server" visible="false">
|
||||
<label class="col-md-2 truncate">Clasificación</label>
|
||||
<div class="col-md-10">
|
||||
<asp:DropDownList ID="DdlClasificacion" runat="server" DataTextField="Clasificacion" DataValueField="CveClasificacion" CssClass="form-control input-sm select2me" Width="100%"></asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtMetaCantidad" CssClass="form-control " runat="server" MaxLength="70" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RfvTxtTiposD" runat="server" ControlToValidate="TxtMetaCantidad" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cantidad meta''</b> es necesario, por favor ingréselo." ValidationGroup="GrpTiposD"></asp:RequiredFieldValidator>
|
||||
<label for="MotivoTxt">Cantidad meta:</label>
|
||||
<i></i>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtMetaImporte" CssClass="form-control " runat="server" MaxLength="70" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RfvTxtMetaImporte" runat="server" ControlToValidate="TxtMetaImporte" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Importe meta''</b> es necesario, por favor ingréselo." ValidationGroup="GrpTiposD"></asp:RequiredFieldValidator>
|
||||
<label for="MotivoTxt">Importe meta:</label>
|
||||
<i></i>
|
||||
<div class="row" style="display: flex; align-items: center; margin-bottom: 10px;">
|
||||
<div class="col-md-2">Cantidad meta</div>
|
||||
<div class="col-md-4">
|
||||
<asp:TextBox ID="TxtMetaCantidad" CssClass="form-control" runat="server" MaxLength="70" CausesValidation="true"></asp:TextBox>
|
||||
<asp:CompareValidator ID="CVCantidad" runat="server" ControlToValidate="TxtMetaCantidad" Display="None" ErrorMessage="El campo <b>''Cantidad meta''</b> no tiene el formato correcto, por favor corrija e intente de nuevo (Solo formato numérico)." Operator="DataTypeCheck" Type="Double" ValidationGroup="GrpTiposD"></asp:CompareValidator>
|
||||
<asp:RequiredFieldValidator ID="RFVTxtMetaCantidad" runat="server" ControlToValidate="TxtMetaCantidad" Display="None" ErrorMessage="El campo <b>''Cantidad meta''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="GrpTiposD"></asp:RequiredFieldValidator>
|
||||
</div>
|
||||
<div class="col-md-2">Importe meta</div>
|
||||
<div class="col-md-4">
|
||||
<asp:TextBox ID="TxtMetaImporte" CssClass="form-control" runat="server" MaxLength="70" CausesValidation="true"></asp:TextBox>
|
||||
<asp:CompareValidator ID="CVImporte" runat="server" ControlToValidate="TxtMetaImporte" Display="None" ErrorMessage="El campo <b>''Cantidad meta''</b> no tiene el formato correcto, por favor corrija e intente de nuevo (Solo formato numérico)." Operator="DataTypeCheck" Type="Double" ValidationGroup="GrpTiposD"></asp:CompareValidator>
|
||||
<asp:RequiredFieldValidator ID="RFVTxtMetaImporte" runat="server" ControlToValidate="TxtMetaImporte" Display="None" ErrorMessage="El campo <b>''Importe meta''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="GrpTiposD"></asp:RequiredFieldValidator>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
|
||||
@@ -33,16 +33,31 @@ Partial Class CatMetasVendedores
|
||||
|
||||
Private Sub CargaDatos()
|
||||
Dim Mes As Integer = -1, Anio As Integer = -1
|
||||
If Not String.IsNullOrEmpty(txtMesAnio.Text) Then
|
||||
Dim FechaRef As DateTime = txtMesAnio.Text.ToDate()
|
||||
Mes = FechaRef.Month
|
||||
Anio = FechaRef.Year
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
If Not String.IsNullOrEmpty(txtMesAnio.Text) Then
|
||||
Dim FechaRef As DateTime = txtMesAnio.Text.ToDate()
|
||||
Mes = FechaRef.Month
|
||||
Anio = FechaRef.Year
|
||||
End If
|
||||
Else
|
||||
GvDatos.Columns(1).Visible = False
|
||||
GvDatos.Columns(2).Visible = False
|
||||
GvDatos.Columns(3).Visible = False
|
||||
GvDatos.Columns(4).Visible = False
|
||||
|
||||
DivLblSucursal.Visible = False
|
||||
DivSucursal.Visible = False
|
||||
DivLblMes.Visible = False
|
||||
DivMes.Visible = False
|
||||
DivLblMarca.Visible = False
|
||||
DivMarca.Visible = False
|
||||
End If
|
||||
|
||||
Dim ObjVentas As New ClsVentas
|
||||
If ObjVentas.GetMetasVendedores(UsuarioActual.CveEmpresa, CveSubProyecto:=DdlSubProyecto.SelectedValue.ToEntero(), CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), CveMarca:=DdlMarca.SelectedValue.ToEntero(), Mes:=Mes, Anio:=Anio) Then
|
||||
GvDatos.DataSource = ObjVentas.DtResultados
|
||||
DtDatos = ObjVentas.DtResultados
|
||||
If ObjVentas.GetMetasVendedores(UsuarioActual.CveEmpresa, CveSubProyecto:=DdlSubProyecto.SelectedValue.ToEntero(), CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), CveMarca:=DdlMarca.SelectedValue.ToEntero(), Mes:=Mes, Anio:=Anio) Then
|
||||
DtDatos = ObjVentas.DtResultados.Copy()
|
||||
GvDatos.DataSource = DtDatos
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
GvDatos.DataBind()
|
||||
@@ -64,7 +79,13 @@ Partial Class CatMetasVendedores
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatosModal()
|
||||
Private Sub CargaDatosModal()
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
Div1.Visible = True
|
||||
Div2.Visible = True
|
||||
Div3.Visible = True
|
||||
End If
|
||||
|
||||
DdlVendedores.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa)
|
||||
DdlVendedores.DataBind()
|
||||
DdlVendedores.Items.Insert(0, New ListItem("Seleccionar", "-1"))
|
||||
@@ -93,29 +114,50 @@ Partial Class CatMetasVendedores
|
||||
|
||||
Protected Sub BtnAgregarMetaVendedor_Click(sender As Object, e As EventArgs) Handles BtnAgregarMetaVendedor.Click
|
||||
|
||||
If DdlVendedores.SelectedValue.ToEntero > 0 AndAlso TxtFechaI.Text <> "" AndAlso DdlMarcas.SelectedValue.ToEntero > 0 AndAlso DdlClasificacionSup.SelectedValue.ToEntero > 0 Then
|
||||
Dim CveVendedor As Integer = DdlVendedores.SelectedValue.ToEntero()
|
||||
Dim Fecha As Date = MinFecha
|
||||
Dim CveMarca As Integer = -1
|
||||
Dim CveClasificacionSuperior As Integer = -1
|
||||
Dim CveClasificacion As Integer = -1
|
||||
|
||||
Dim ObjVentas As New ClsVentas
|
||||
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
|
||||
If Not (DdlVendedores.SelectedValue.ToEntero > 0 AndAlso TxtFechaI.Text <> "" AndAlso DdlMarcas.SelectedValue.ToEntero > 0 AndAlso DdlClasificacionSup.SelectedValue.ToEntero > 0) Then
|
||||
Alert(String.Format("Falta Seleccionar {0}{1}{2}", If(DdlVendedores.SelectedValue.ToEntero > 0, "", "Vendedor, "), If(DdlMarcas.SelectedValue.ToEntero > 0, "", "Marca, "), If(TxtFechaI.Text <> "", "", "Fecha, ")))
|
||||
Exit Sub
|
||||
End If
|
||||
Fecha = TxtFechaI.Text.ToDate()
|
||||
CveClasificacionSuperior = DdlClasificacionSup.SelectedValue.ToEntero
|
||||
CveClasificacion = DdlClasificacion.SelectedValue.ToEntero
|
||||
CveMarca = DdlMarca.SelectedValue.ToEntero
|
||||
|
||||
Else
|
||||
If Not (DdlVendedores.SelectedValue.ToEntero > 0) Then
|
||||
Alert("Falta Seleccionar el vendedor")
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
|
||||
Using ObjVentas As New ClsVentas
|
||||
If BtnAgregarMetaVendedor.Text = "Agregar" Then
|
||||
If ObjVentas.AddMetasVendedores(DdlVendedores.SelectedValue.ToEntero, TxtFechaI.Text.ToDate, DdlMarcas.SelectedValue.ToEntero, TxtMetaCantidad.Text.ToEntero,
|
||||
TxtMetaImporte.Text.ToDecimal, DdlClasificacion.SelectedValue.ToEntero, DdlClasificacionSup.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
If ObjVentas.AddMetasVendedores(CveVendedor, Fecha, DdlMarcas.SelectedValue.ToEntero, TxtMetaCantidad.Text.ToEntero, TxtMetaImporte.Text.ToDecimal, CveClasificacion, CveClasificacionSuperior, UsuarioActual.CveEmpresa) Then
|
||||
Alert("Se agregó la meta al vendedor")
|
||||
Else
|
||||
Alert("No se pudo agregar la meta al vendedor", TipoMensaje.MsgError)
|
||||
End If
|
||||
ElseIf BtnAgregarMetaVendedor.Text = "Actualizar" Then
|
||||
If ObjVentas.UpdateMetasVendedores(CveMetaVendedor, DdlVendedores.SelectedValue.ToEntero, TxtFechaI.Text, DdlMarcas.SelectedValue.ToEntero,
|
||||
TxtMetaCantidad.Text.ToEntero, TxtMetaImporte.Text.ToDecimal, DdlClasificacion.SelectedValue.ToEntero,
|
||||
DdlClasificacionSup.SelectedValue.ToEntero) Then
|
||||
If ObjVentas.UpdateMetasVendedores(CveMetaVendedor, CveVendedor, Fecha.ToString("dd/MM/yyyy"), CveMarca, TxtMetaCantidad.Text.ToEntero, TxtMetaImporte.Text.ToDecimal, CveClasificacion, CveClasificacionSuperior) Then
|
||||
Alert("Se actualizó la información de la meta del vendedor")
|
||||
Else
|
||||
Alert("No se pudo actualizar la meta del vendedor", TipoMensaje.MsgError)
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
Alert(String.Format("Falta Seleccionar {0}{1}{2}", If(DdlVendedores.SelectedValue.ToEntero > 0, "", "Vendedor, "), If(DdlMarcas.SelectedValue.ToEntero > 0, "", "Marca, "), If(TxtFechaI.Text <> "", "", "Fecha, ")))
|
||||
End If
|
||||
End If
|
||||
End Using
|
||||
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD"))
|
||||
|
||||
ResetDatosSeleccionadosModal()
|
||||
CargaDatos()
|
||||
UpDatos.Update()
|
||||
@@ -135,12 +177,17 @@ Partial Class CatMetasVendedores
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
CveMetaVendedor = GvRow.DataKey("CveMeta").ToEntero
|
||||
DdlVendedores.SelectedValue = GvRow.DataKey("CveVendedor")
|
||||
TxtFechaI.Text = GvRow.DataKey("MesAño")
|
||||
|
||||
DdlClasificacionSup.SelectedValueExist(GvRow.DataKey("CveClasificacionSup"))
|
||||
DdlClasificacion.SelectedValueExist(GvRow.DataKey("CveClasificacion"))
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
|
||||
TxtFechaI.Text = GvRow.DataKey("MesAño")
|
||||
|
||||
DdlClasificacionSup.SelectedValueExist(GvRow.DataKey("CveClasificacionSup"))
|
||||
DdlClasificacion.SelectedValueExist(GvRow.DataKey("CveClasificacion"))
|
||||
|
||||
DdlMarcas.SelectedValue = GvRow.DataKey("CveMarca")
|
||||
End If
|
||||
|
||||
DdlMarcas.SelectedValue = GvRow.DataKey("CveMarca")
|
||||
TxtMetaCantidad.Text = GvRow.DataKey("MetaCantidad")
|
||||
TxtMetaImporte.Text = GvRow.DataKey("MetaImporte")
|
||||
UpModalTiposD.Update()
|
||||
|
||||
@@ -1330,13 +1330,15 @@ Partial Class Ventas_ClientesAbonar
|
||||
If UsuarioActual.Empresa.Funcionalidad(382) = "1" AndAlso TxtAnticipo.Text.ToDecimal > 0 AndAlso MsgError = "" Then '' si es empresa GDiaz
|
||||
'generar un anticipo y registrarle el pago.
|
||||
|
||||
Dim tCveMoneda As Integer = 1
|
||||
Dim tCveMoneda As Integer = Me.CveMoneda
|
||||
Dim tCveFormaPago As Integer = GlobalDTTipoTransacciones().FiltroPrimeroValor("CveFormaPago", $"CveTipoTransaccion={DdlTipoTransaccion.SelectedValue}").ToEntero
|
||||
Dim tCvePS As Integer
|
||||
Dim tCveUM As Integer = 0
|
||||
Dim tCveSub As Integer = DdlSubProyectos.SelectedValue.ToEntero
|
||||
ObjFacturaAnt = Modelos.Factura.CrearVentaNueva(UsuarioActual, tCveSub, CveCliente, tCveMoneda, "Ant")
|
||||
ObjFacturaAnt.CveMoneda = tCveMoneda
|
||||
ObjFacturaAnt.TipoCambio = If(tCveMoneda = 1, 1, TxtTCDolares.Text.ToDecimal())
|
||||
ObjFacturaAnt.TipoCambioDolares = If(tCveMoneda = 1, 1, TxtTCDolares.Text.ToDecimal())
|
||||
ObjFacturaAnt.CveFormaPago = tCveFormaPago
|
||||
ObjFacturaAnt.CveMetodoPago = 1
|
||||
ObjFacturaAnt.ClaveMetodoPagoSAT = "PUE"
|
||||
@@ -1355,7 +1357,7 @@ Partial Class Ventas_ClientesAbonar
|
||||
RespAnt = ObjFacturaAnt.EmitirFactura(False, Transac:=ObjMov.IniciaTransacSQL(), Modulo:="Ventas/ClientesAbonarAnt", MostrarURL:=True)
|
||||
RespAnt.Factura = ObjFacturaAnt
|
||||
|
||||
If RespAnt IsNot Nothing AndAlso RespAnt.Factura IsNot Nothing Then
|
||||
If RespAnt IsNot Nothing AndAlso RespAnt.Factura IsNot Nothing AndAlso RespAnt.Factura.CveVenta > 0 Then
|
||||
|
||||
Dim VentaActual As New Venta(UsuarioActual)
|
||||
VentaActual.CveVenta = RespAnt.Factura.CveVenta
|
||||
@@ -1365,7 +1367,7 @@ Partial Class Ventas_ClientesAbonar
|
||||
VentaActual.TipoDocto = "Ant"
|
||||
VentaActual.SerieFolio = RespAnt.Factura.SerieFolio
|
||||
VentaActual.ClienteNombre = NombreComercial
|
||||
VentaActual.TC = 1
|
||||
VentaActual.TC = If(tCveMoneda = 1, 1, TxtTCDolares.Text.ToDecimal())
|
||||
VentaActual.Total = TxtAnticipo.Text.ToDecimal
|
||||
VentaActual.IVA = (tPorIVA * tPU).RoundSQL(2)
|
||||
|
||||
@@ -1381,6 +1383,8 @@ Partial Class Ventas_ClientesAbonar
|
||||
Pago.ImportePagoVenta = TxtAnticipo.Text.ToDecimal
|
||||
Pago.Referencia = TxtFolio.Text
|
||||
Pago.TipoPago = "XXX"
|
||||
Pago.TCPago = If(tCveMoneda = 1, 1, TxtTCDolares.Text.ToDecimal())
|
||||
|
||||
'If RblTipoPago.SelectedValue = "3" Then
|
||||
' Pago.TipoPago = "I"
|
||||
' Pago.FechaDocumentoRelacionado = FechaIngreso
|
||||
@@ -1390,6 +1394,8 @@ Partial Class Ventas_ClientesAbonar
|
||||
If MsgError = "" AndAlso AplicaPrePolizaPagoVenta(VentaActual, Pago, CvePrePoliza, ObjMov) Then
|
||||
MsgError = "No se pudo insertar la póliza"
|
||||
End If
|
||||
Else
|
||||
MsgError = "Ocurrió un error al generar el anticipo"
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
@@ -25368,7 +25368,7 @@ Partial Class Ventas
|
||||
End If
|
||||
TxtImporteContado.Text = TxtTotal.Text
|
||||
'SI ES MODALIDAD COBRANZA, NO MOSTRAR
|
||||
If (UsuarioActual.Empresa.Funcionalidad(109) = "1") Then
|
||||
If (UsuarioActual.Empresa.Funcionalidad(109) = "1" OrElse UsuarioActual.CveEmpresa = 197) Then
|
||||
DivContado.Visible = UsuarioActual.TienePermisoProceso(375)
|
||||
End If
|
||||
End If
|
||||
@@ -25885,7 +25885,7 @@ Partial Class Ventas
|
||||
Dim TienePagos As Boolean = ((Not (DtPagos Is Nothing OrElse DtPagos.Rows.Count = 0)) AndAlso (DtPagos IsNot Nothing AndAlso DtPagos.Rows.Count > 0)) OrElse AmortizacionNC > 0
|
||||
|
||||
'SI LA VENTA ES NUEVA VALIDAR TAMBIEN LOS PAGOS DE CONTADO
|
||||
If (UsuarioActual.Empresa.Funcionalidad(558) = "1" OrElse UsuarioActual.CveEmpresa = 197) AndAlso ((CveVenta <= 0 OrElse EsCreaApartirDe OrElse TipoDoctoViejo = "Cot") AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant")) Then
|
||||
If (UsuarioActual.Empresa.Funcionalidad(558) = "1") AndAlso ((CveVenta <= 0 OrElse EsCreaApartirDe OrElse TipoDoctoViejo = "Cot") AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant")) Then
|
||||
|
||||
If Not PermiteCredito AndAlso Not TienePagos AndAlso TxtTotal.Text.ToDecimal > 0 Then
|
||||
If MostrarAlertas Then
|
||||
|
||||
Reference in New Issue
Block a user