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
|
End Sub
|
||||||
|
|
||||||
#Region "EXPORTACIONES"
|
#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
|
Dim Retorno As Boolean = False
|
||||||
DataAdapter("PA_Exp_ExportacionesRep")
|
DataAdapter("PA_Exp_ExportacionesRep")
|
||||||
With SqlAdapter.SelectCommand.Parameters
|
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,
|
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,
|
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,
|
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
|
Dim Retorno As Integer = -1
|
||||||
DataAdapter("PA_Exp_ExportacionesAdd")
|
DataAdapter("PA_Exp_ExportacionesAdd")
|
||||||
With SqlAdapter.SelectCommand.Parameters
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
@@ -177,6 +177,7 @@ Public Class ClsExportaciones
|
|||||||
.Add("@CveAgenteExtranjero", SqlDbType.Int).Value = CveAgenteExtranjero
|
.Add("@CveAgenteExtranjero", SqlDbType.Int).Value = CveAgenteExtranjero
|
||||||
.Add("@ITN", SqlDbType.VarChar).Value = ITN
|
.Add("@ITN", SqlDbType.VarChar).Value = ITN
|
||||||
.Add("@Vinculacion", SqlDbType.Bit).Value = Vinculacion
|
.Add("@Vinculacion", SqlDbType.Bit).Value = Vinculacion
|
||||||
|
.Add("@EsExportacion", SqlDbType.Bit).Value = EsExportacion
|
||||||
|
|
||||||
.Add("@CveExportacion", SqlDbType.Int).Direction = ParameterDirection.Output
|
.Add("@CveExportacion", SqlDbType.Int).Direction = ParameterDirection.Output
|
||||||
End With
|
End With
|
||||||
|
|||||||
@@ -35,6 +35,12 @@ public partial class Export_ExpDetalle : ClsPaginas
|
|||||||
get { return (ViewState["CveExportacionDetalle"] == null) ? -1 : Convert.ToInt32(ViewState["CveExportacionDetalle"]); }
|
get { return (ViewState["CveExportacionDetalle"] == null) ? -1 : Convert.ToInt32(ViewState["CveExportacionDetalle"]); }
|
||||||
set { ViewState["CveExportacionDetalle"] = value; }
|
set { ViewState["CveExportacionDetalle"] = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool EsImportacion
|
||||||
|
{
|
||||||
|
get { return (ViewState["EsImportacion"] == null) ? false : Boolean.Parse(ViewState["EsImportacion"].ToString()); }
|
||||||
|
set { ViewState["EsImportacion"] = value; }
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
@@ -42,6 +48,12 @@ public partial class Export_ExpDetalle : ClsPaginas
|
|||||||
{
|
{
|
||||||
if (!IsPostBack)
|
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;
|
CveExportacion = !string.IsNullOrEmpty(Request["CveExportacion"]) ? Request["CveExportacion"].ToEntero() : -1;
|
||||||
InicializarValores();
|
InicializarValores();
|
||||||
CargaDatos();
|
CargaDatos();
|
||||||
@@ -117,7 +129,8 @@ public partial class Export_ExpDetalle : ClsPaginas
|
|||||||
{
|
{
|
||||||
DataTable DTExportaciones = new DataTable();
|
DataTable DTExportaciones = new DataTable();
|
||||||
ClsExportaciones Exportaciones = new ClsExportaciones();
|
ClsExportaciones Exportaciones = new ClsExportaciones();
|
||||||
if (Exportaciones.GetExportacion(CveExportacion, UsuarioActual.CveEmpresa))
|
bool EsExportacion = !EsImportacion;
|
||||||
|
if (Exportaciones.GetExportacion(CveExportacion, UsuarioActual.CveEmpresa, EsExportacion))
|
||||||
{
|
{
|
||||||
DTExportaciones = Exportaciones.DtResultados;
|
DTExportaciones = Exportaciones.DtResultados;
|
||||||
if (DTExportaciones.Rows.Count > 0)
|
if (DTExportaciones.Rows.Count > 0)
|
||||||
@@ -371,7 +384,7 @@ public partial class Export_ExpDetalle : ClsPaginas
|
|||||||
decimal DecOtros = ModExtensiones.ToDecimal(TxtDecOtros.Text);
|
decimal DecOtros = ModExtensiones.ToDecimal(TxtDecOtros.Text);
|
||||||
|
|
||||||
ClsExportaciones Exportaciones = new ClsExportaciones();
|
ClsExportaciones Exportaciones = new ClsExportaciones();
|
||||||
|
bool EsExportacion = !EsImportacion;
|
||||||
if (CveExportacion == -1)
|
if (CveExportacion == -1)
|
||||||
{
|
{
|
||||||
int ExportacionGuardada = Exportaciones.AddExportacion(
|
int ExportacionGuardada = Exportaciones.AddExportacion(
|
||||||
@@ -404,7 +417,8 @@ public partial class Export_ExpDetalle : ClsPaginas
|
|||||||
CvePedimento,
|
CvePedimento,
|
||||||
CveAgenteExtranjero,
|
CveAgenteExtranjero,
|
||||||
ITN,
|
ITN,
|
||||||
Vinculacion
|
Vinculacion,
|
||||||
|
EsExportacion
|
||||||
);
|
);
|
||||||
if (ExportacionGuardada != -1)
|
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/RepExportaciones.aspx\";";
|
||||||
string Liga = $"document.location.href=\"/Export/ExpDetalle.aspx?CveExportacion={ExportacionGuardada}\";";
|
string liga = EsImportacion
|
||||||
Alert("La Exportación se ha agregado correctamente.", JSBtnAceptar: Liga);
|
? $"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();
|
Exportaciones.Dispose();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ public partial class Export_RepExportaciones : ClsPaginas
|
|||||||
protected void CargaExportaciones()
|
protected void CargaExportaciones()
|
||||||
{
|
{
|
||||||
ClsExportaciones Exportaciones = new ClsExportaciones();
|
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))
|
if (Exportaciones.GetExportacion(-1, UsuarioActual.CveEmpresa, EsExportacion))
|
||||||
{
|
{
|
||||||
GVExportaciones.DataSource = Exportaciones.DtResultados;
|
GVExportaciones.DataSource = Exportaciones.DtResultados;
|
||||||
|
|||||||
@@ -79,6 +79,8 @@ Partial Class Vta_CatCobranzaEstatus
|
|||||||
Alert("Error al actualizar")
|
Alert("Error al actualizar")
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
GlobalDTVtaCobranzaEstatus(UsuarioActual.CveEmpresa) = Nothing
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
|
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")
|
Alert("Estatus de cobranza eliminado")
|
||||||
End If
|
End If
|
||||||
ObjVentas.Dispose()
|
ObjVentas.Dispose()
|
||||||
|
|
||||||
|
GlobalDTVtaCobranzaEstatus(UsuarioActual.CveEmpresa) = Nothing
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub CargaDatosTurno()
|
Private Sub CargaDatosTurno()
|
||||||
|
|||||||
@@ -33,13 +33,13 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="titlefiltros caption">
|
<div class="titlefiltros caption">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<label class="col-md-1 truncate">Sucursal:</label>
|
<label class="col-md-1 truncate" id="DivLblSucursal" runat="server">Sucursal:</label>
|
||||||
<div class="col-md-2">
|
<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 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>
|
</asp:DropDownList>
|
||||||
</div>
|
</div>
|
||||||
<label class="col-md-1 truncate">Mes/Año:</label>
|
<label class="col-md-1 truncate" id="DivLblMes" runat="server">Mes/Año:</label>
|
||||||
<div class="col-md-1" style="min-width: 115px">
|
<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;">
|
<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>
|
<asp:TextBox Width="80px" ID="txtMesAnio" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||||
<span class="input-group-btn ">
|
<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 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>
|
</asp:DropDownList>
|
||||||
</div>
|
</div>
|
||||||
<label title="Marca" data-toggle="tooltip" class="col-md-1 truncate">Marca:</label>
|
<label title="Marca" data-toggle="tooltip" class="col-md-1 truncate" id="DivLblMarca" runat="server">Marca:</label>
|
||||||
<div class="col-md-2">
|
<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 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>
|
</asp:DropDownList>
|
||||||
</div>
|
</div>
|
||||||
@@ -70,7 +70,7 @@
|
|||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||||
<ContentTemplate>
|
<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>
|
<Columns>
|
||||||
<asp:TemplateField HeaderText="Vendedor" ItemStyle-HorizontalAlign="Left">
|
<asp:TemplateField HeaderText="Vendedor" ItemStyle-HorizontalAlign="Left">
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
@@ -162,13 +162,19 @@
|
|||||||
<asp:Literal ID="LtlTituloModalTiposD" runat="server">Metas Vendedores</asp:Literal></h4>
|
<asp:Literal ID="LtlTituloModalTiposD" runat="server">Metas Vendedores</asp:Literal></h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<div class="form-group form-md-line-input input-iconright">
|
<div class="row" style="display: flex; align-items: center; margin-bottom: 10px;">
|
||||||
<label for="DdlVendedores">Vendedor:</label>
|
<div class="col-md-2 truncate">Vendedor</div>
|
||||||
<asp:DropDownList ID="DdlVendedores" runat="server" DataTextField="Vendedor" DataValueField="CveVendedor" CssClass="form-control input-sm select2me"></asp:DropDownList>
|
<div class="col-md-10">
|
||||||
<i></i>
|
<asp:DropDownList ID="DdlVendedores" runat="server" DataTextField="Vendedor" DataValueField="CveVendedor" CssClass="form-control input-sm select2me" Width="100%"></asp:DropDownList>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group form-md-line-input input-iconright">
|
</div>
|
||||||
<label for="MotivoTxt">Mes y Año:</label>
|
<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;">
|
<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>
|
<asp:TextBox Style="width: 110px !important;" ID="TxtFechaI" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||||
<span class="input-group-btn ">
|
<span class="input-group-btn ">
|
||||||
@@ -178,32 +184,32 @@
|
|||||||
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="TxtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
<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>
|
<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 Superior:</label>
|
|
||||||
<asp:DropDownList ID="DdlClasificacionSup" runat="server" DataTextField="Clasificacion" DataValueField="CveClasificacion" CssClass="form-control input-sm select2me"></asp:DropDownList>
|
|
||||||
<i></i>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group form-md-line-input input-iconright">
|
<div class="row" style="display: flex; align-items: center; margin-bottom: 10px;" id="Div2" runat="server" visible="false">
|
||||||
<label for="DdlMarcas">Clasificacion:</label>
|
<div class="col-md-2">Clasificación Superior</div>
|
||||||
<asp:DropDownList ID="DdlClasificacion" runat="server" DataTextField="Clasificacion" DataValueField="CveClasificacion" CssClass="form-control input-sm select2me"></asp:DropDownList>
|
<div class="col-md-10">
|
||||||
<i></i>
|
<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>
|
</div>
|
||||||
<div class="form-group form-md-line-input input-iconright">
|
<div class="row" style="display: flex; align-items: center; margin-bottom: 10px;" id="Div1" runat="server" visible="false">
|
||||||
<asp:TextBox ID="TxtMetaCantidad" CssClass="form-control " runat="server" MaxLength="70" CausesValidation="true"></asp:TextBox>
|
<label class="col-md-2 truncate">Clasificación</label>
|
||||||
<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>
|
<div class="col-md-10">
|
||||||
<label for="MotivoTxt">Cantidad meta:</label>
|
<asp:DropDownList ID="DdlClasificacion" runat="server" DataTextField="Clasificacion" DataValueField="CveClasificacion" CssClass="form-control input-sm select2me" Width="100%"></asp:DropDownList>
|
||||||
<i></i>
|
</div>
|
||||||
|
</div>
|
||||||
|
<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 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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
|
|||||||
@@ -33,16 +33,31 @@ Partial Class CatMetasVendedores
|
|||||||
|
|
||||||
Private Sub CargaDatos()
|
Private Sub CargaDatos()
|
||||||
Dim Mes As Integer = -1, Anio As Integer = -1
|
Dim Mes As Integer = -1, Anio As Integer = -1
|
||||||
|
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||||
If Not String.IsNullOrEmpty(txtMesAnio.Text) Then
|
If Not String.IsNullOrEmpty(txtMesAnio.Text) Then
|
||||||
Dim FechaRef As DateTime = txtMesAnio.Text.ToDate()
|
Dim FechaRef As DateTime = txtMesAnio.Text.ToDate()
|
||||||
Mes = FechaRef.Month
|
Mes = FechaRef.Month
|
||||||
Anio = FechaRef.Year
|
Anio = FechaRef.Year
|
||||||
End If
|
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
|
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
|
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.Copy()
|
||||||
DtDatos = ObjVentas.DtResultados
|
GvDatos.DataSource = DtDatos
|
||||||
End If
|
End If
|
||||||
ObjVentas.Dispose()
|
ObjVentas.Dispose()
|
||||||
GvDatos.DataBind()
|
GvDatos.DataBind()
|
||||||
@@ -65,6 +80,12 @@ Partial Class CatMetasVendedores
|
|||||||
End Sub
|
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.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa)
|
||||||
DdlVendedores.DataBind()
|
DdlVendedores.DataBind()
|
||||||
DdlVendedores.Items.Insert(0, New ListItem("Seleccionar", "-1"))
|
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
|
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 BtnAgregarMetaVendedor.Text = "Agregar" Then
|
||||||
If ObjVentas.AddMetasVendedores(DdlVendedores.SelectedValue.ToEntero, TxtFechaI.Text.ToDate, DdlMarcas.SelectedValue.ToEntero, TxtMetaCantidad.Text.ToEntero,
|
If ObjVentas.AddMetasVendedores(CveVendedor, Fecha, DdlMarcas.SelectedValue.ToEntero, TxtMetaCantidad.Text.ToEntero, TxtMetaImporte.Text.ToDecimal, CveClasificacion, CveClasificacionSuperior, UsuarioActual.CveEmpresa) Then
|
||||||
TxtMetaImporte.Text.ToDecimal, DdlClasificacion.SelectedValue.ToEntero, DdlClasificacionSup.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
|
|
||||||
Alert("Se agregó la meta al vendedor")
|
Alert("Se agregó la meta al vendedor")
|
||||||
Else
|
Else
|
||||||
Alert("No se pudo agregar la meta al vendedor", TipoMensaje.MsgError)
|
Alert("No se pudo agregar la meta al vendedor", TipoMensaje.MsgError)
|
||||||
End If
|
End If
|
||||||
ElseIf BtnAgregarMetaVendedor.Text = "Actualizar" Then
|
ElseIf BtnAgregarMetaVendedor.Text = "Actualizar" Then
|
||||||
If ObjVentas.UpdateMetasVendedores(CveMetaVendedor, DdlVendedores.SelectedValue.ToEntero, TxtFechaI.Text, DdlMarcas.SelectedValue.ToEntero,
|
If ObjVentas.UpdateMetasVendedores(CveMetaVendedor, CveVendedor, Fecha.ToString("dd/MM/yyyy"), CveMarca, TxtMetaCantidad.Text.ToEntero, TxtMetaImporte.Text.ToDecimal, CveClasificacion, CveClasificacionSuperior) Then
|
||||||
TxtMetaCantidad.Text.ToEntero, TxtMetaImporte.Text.ToDecimal, DdlClasificacion.SelectedValue.ToEntero,
|
|
||||||
DdlClasificacionSup.SelectedValue.ToEntero) Then
|
|
||||||
Alert("Se actualizó la información de la meta del vendedor")
|
Alert("Se actualizó la información de la meta del vendedor")
|
||||||
Else
|
Else
|
||||||
Alert("No se pudo actualizar la meta del vendedor", TipoMensaje.MsgError)
|
Alert("No se pudo actualizar la meta del vendedor", TipoMensaje.MsgError)
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
Else
|
End Using
|
||||||
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
|
|
||||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD"))
|
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD"))
|
||||||
|
|
||||||
ResetDatosSeleccionadosModal()
|
ResetDatosSeleccionadosModal()
|
||||||
CargaDatos()
|
CargaDatos()
|
||||||
UpDatos.Update()
|
UpDatos.Update()
|
||||||
@@ -135,12 +177,17 @@ Partial Class CatMetasVendedores
|
|||||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||||
CveMetaVendedor = GvRow.DataKey("CveMeta").ToEntero
|
CveMetaVendedor = GvRow.DataKey("CveMeta").ToEntero
|
||||||
DdlVendedores.SelectedValue = GvRow.DataKey("CveVendedor")
|
DdlVendedores.SelectedValue = GvRow.DataKey("CveVendedor")
|
||||||
|
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||||
|
|
||||||
TxtFechaI.Text = GvRow.DataKey("MesAño")
|
TxtFechaI.Text = GvRow.DataKey("MesAño")
|
||||||
|
|
||||||
DdlClasificacionSup.SelectedValueExist(GvRow.DataKey("CveClasificacionSup"))
|
DdlClasificacionSup.SelectedValueExist(GvRow.DataKey("CveClasificacionSup"))
|
||||||
DdlClasificacion.SelectedValueExist(GvRow.DataKey("CveClasificacion"))
|
DdlClasificacion.SelectedValueExist(GvRow.DataKey("CveClasificacion"))
|
||||||
|
|
||||||
DdlMarcas.SelectedValue = GvRow.DataKey("CveMarca")
|
DdlMarcas.SelectedValue = GvRow.DataKey("CveMarca")
|
||||||
|
End If
|
||||||
|
|
||||||
TxtMetaCantidad.Text = GvRow.DataKey("MetaCantidad")
|
TxtMetaCantidad.Text = GvRow.DataKey("MetaCantidad")
|
||||||
TxtMetaImporte.Text = GvRow.DataKey("MetaImporte")
|
TxtMetaImporte.Text = GvRow.DataKey("MetaImporte")
|
||||||
UpModalTiposD.Update()
|
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
|
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.
|
'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 tCveFormaPago As Integer = GlobalDTTipoTransacciones().FiltroPrimeroValor("CveFormaPago", $"CveTipoTransaccion={DdlTipoTransaccion.SelectedValue}").ToEntero
|
||||||
Dim tCvePS As Integer
|
Dim tCvePS As Integer
|
||||||
Dim tCveUM As Integer = 0
|
Dim tCveUM As Integer = 0
|
||||||
Dim tCveSub As Integer = DdlSubProyectos.SelectedValue.ToEntero
|
Dim tCveSub As Integer = DdlSubProyectos.SelectedValue.ToEntero
|
||||||
ObjFacturaAnt = Modelos.Factura.CrearVentaNueva(UsuarioActual, tCveSub, CveCliente, tCveMoneda, "Ant")
|
ObjFacturaAnt = Modelos.Factura.CrearVentaNueva(UsuarioActual, tCveSub, CveCliente, tCveMoneda, "Ant")
|
||||||
ObjFacturaAnt.CveMoneda = tCveMoneda
|
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.CveFormaPago = tCveFormaPago
|
||||||
ObjFacturaAnt.CveMetodoPago = 1
|
ObjFacturaAnt.CveMetodoPago = 1
|
||||||
ObjFacturaAnt.ClaveMetodoPagoSAT = "PUE"
|
ObjFacturaAnt.ClaveMetodoPagoSAT = "PUE"
|
||||||
@@ -1355,7 +1357,7 @@ Partial Class Ventas_ClientesAbonar
|
|||||||
RespAnt = ObjFacturaAnt.EmitirFactura(False, Transac:=ObjMov.IniciaTransacSQL(), Modulo:="Ventas/ClientesAbonarAnt", MostrarURL:=True)
|
RespAnt = ObjFacturaAnt.EmitirFactura(False, Transac:=ObjMov.IniciaTransacSQL(), Modulo:="Ventas/ClientesAbonarAnt", MostrarURL:=True)
|
||||||
RespAnt.Factura = ObjFacturaAnt
|
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)
|
Dim VentaActual As New Venta(UsuarioActual)
|
||||||
VentaActual.CveVenta = RespAnt.Factura.CveVenta
|
VentaActual.CveVenta = RespAnt.Factura.CveVenta
|
||||||
@@ -1365,7 +1367,7 @@ Partial Class Ventas_ClientesAbonar
|
|||||||
VentaActual.TipoDocto = "Ant"
|
VentaActual.TipoDocto = "Ant"
|
||||||
VentaActual.SerieFolio = RespAnt.Factura.SerieFolio
|
VentaActual.SerieFolio = RespAnt.Factura.SerieFolio
|
||||||
VentaActual.ClienteNombre = NombreComercial
|
VentaActual.ClienteNombre = NombreComercial
|
||||||
VentaActual.TC = 1
|
VentaActual.TC = If(tCveMoneda = 1, 1, TxtTCDolares.Text.ToDecimal())
|
||||||
VentaActual.Total = TxtAnticipo.Text.ToDecimal
|
VentaActual.Total = TxtAnticipo.Text.ToDecimal
|
||||||
VentaActual.IVA = (tPorIVA * tPU).RoundSQL(2)
|
VentaActual.IVA = (tPorIVA * tPU).RoundSQL(2)
|
||||||
|
|
||||||
@@ -1381,6 +1383,8 @@ Partial Class Ventas_ClientesAbonar
|
|||||||
Pago.ImportePagoVenta = TxtAnticipo.Text.ToDecimal
|
Pago.ImportePagoVenta = TxtAnticipo.Text.ToDecimal
|
||||||
Pago.Referencia = TxtFolio.Text
|
Pago.Referencia = TxtFolio.Text
|
||||||
Pago.TipoPago = "XXX"
|
Pago.TipoPago = "XXX"
|
||||||
|
Pago.TCPago = If(tCveMoneda = 1, 1, TxtTCDolares.Text.ToDecimal())
|
||||||
|
|
||||||
'If RblTipoPago.SelectedValue = "3" Then
|
'If RblTipoPago.SelectedValue = "3" Then
|
||||||
' Pago.TipoPago = "I"
|
' Pago.TipoPago = "I"
|
||||||
' Pago.FechaDocumentoRelacionado = FechaIngreso
|
' Pago.FechaDocumentoRelacionado = FechaIngreso
|
||||||
@@ -1390,6 +1394,8 @@ Partial Class Ventas_ClientesAbonar
|
|||||||
If MsgError = "" AndAlso AplicaPrePolizaPagoVenta(VentaActual, Pago, CvePrePoliza, ObjMov) Then
|
If MsgError = "" AndAlso AplicaPrePolizaPagoVenta(VentaActual, Pago, CvePrePoliza, ObjMov) Then
|
||||||
MsgError = "No se pudo insertar la póliza"
|
MsgError = "No se pudo insertar la póliza"
|
||||||
End If
|
End If
|
||||||
|
Else
|
||||||
|
MsgError = "Ocurrió un error al generar el anticipo"
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|||||||
@@ -25368,7 +25368,7 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
TxtImporteContado.Text = TxtTotal.Text
|
TxtImporteContado.Text = TxtTotal.Text
|
||||||
'SI ES MODALIDAD COBRANZA, NO MOSTRAR
|
'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)
|
DivContado.Visible = UsuarioActual.TienePermisoProceso(375)
|
||||||
End If
|
End If
|
||||||
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
|
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
|
'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 Not PermiteCredito AndAlso Not TienePagos AndAlso TxtTotal.Text.ToDecimal > 0 Then
|
||||||
If MostrarAlertas Then
|
If MostrarAlertas Then
|
||||||
|
|||||||
Reference in New Issue
Block a user