This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2022-11-26 15:18:28 -07:00
23 changed files with 13115 additions and 6279 deletions

View File

@@ -1102,7 +1102,8 @@ Public Class ClsCRM
End Function End Function
Public Function RepAcercamientosDetalle(CveEmpresa As Int32, cveVendedor As Int32, cveMedioCaptacion As Int32, cveProbabilidadAcercamiento As Int32, cveEtapaProceso As Int32, sFecha As String, sFechaIni As String, Public Function RepAcercamientosDetalle(CveEmpresa As Int32, cveVendedor As Int32, cveMedioCaptacion As Int32, cveProbabilidadAcercamiento As Int32, cveEtapaProceso As Int32, sFecha As String, sFechaIni As String,
sFechaFin As String, Optional CveTipoProceso As Integer = -1, Optional CveRechazoMotivo As Integer = -1) As Boolean sFechaFin As String, Optional CveTipoProceso As Integer = -1, Optional CveRechazoMotivo As Integer = -1, Optional EnPausa As Integer = -1, Optional CveGiroClasificacion As Integer = -1,
Optional EsRechazo As Boolean = False) As Boolean
Dim retorno As Boolean = False Dim retorno As Boolean = False
DataAdapter("PA_CRM_RepAcercamientosDetalle", CommandType.StoredProcedure) DataAdapter("PA_CRM_RepAcercamientosDetalle", CommandType.StoredProcedure)
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
@@ -1116,6 +1117,9 @@ Public Class ClsCRM
.Add("@SFechaFin", SqlDbType.VarChar).Value = sFechaFin .Add("@SFechaFin", SqlDbType.VarChar).Value = sFechaFin
.Add("@CveTipoProceso", SqlDbType.Int).Value = CveTipoProceso .Add("@CveTipoProceso", SqlDbType.Int).Value = CveTipoProceso
.Add("@CveRechazoMotivo", SqlDbType.Int).Value = CveRechazoMotivo .Add("@CveRechazoMotivo", SqlDbType.Int).Value = CveRechazoMotivo
.Add("@EnPausa", SqlDbType.Int).Value = EnPausa
.Add("@CveGiroClasificacion", SqlDbType.Int).Value = CveGiroClasificacion
.Add("@EsRechazo", SqlDbType.Bit).Value = EsRechazo
End With End With
Try Try
SqlAdapter.Fill(Data) SqlAdapter.Fill(Data)

View File

@@ -904,7 +904,8 @@ Public Class ClsCompras
Public Function GetRepProductosServicios(CveProyecto As Integer, CveSubProyecto As String, CveCategoria As String, CveClasificacion As Integer, CvePS As Integer, FechaI As Date, Public Function GetRepProductosServicios(CveProyecto As Integer, CveSubProyecto As String, CveCategoria As String, CveClasificacion As Integer, CvePS As Integer, FechaI As Date,
FechaF As Date, CveProveedor As Integer, CveUsuario As Integer, CveEstatus As Integer, CveEmpresa As Integer, Gpo As Integer, FechaF As Date, CveProveedor As Integer, CveUsuario As Integer, CveEstatus As Integer, CveEmpresa As Integer, Gpo As Integer,
CveFamilia As Integer, CveSubFamilia As Integer, CveTipoActivoFijo As String, CveSubTipoActivoFijo As String, CveActivoFijo As Integer, TipoCambio As Integer, Optional TCEspecifico As Double = -1, Optional TipoGasto As String = "-1", CveFamilia As Integer, CveSubFamilia As Integer, CveTipoActivoFijo As String, CveSubTipoActivoFijo As String, CveActivoFijo As Integer, TipoCambio As Integer, Optional TCEspecifico As Double = -1, Optional TipoGasto As String = "-1",
Optional CveUsuarioConsulta As Integer = -1, Optional TipoDocto As String = "-1", Optional Deducible As Integer = -1, Optional CveCultivo As String = "-1") As Boolean Optional CveUsuarioConsulta As Integer = -1, Optional TipoDocto As String = "-1", Optional Deducible As Integer = -1, Optional CveCultivo As String = "-1",
Optional CveTipoProveedor As Integer = -1, Optional CveProveedorClasificacion As Integer = -1) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Comp_GetRepPS") DataAdapter("PA_Comp_GetRepPS")
@@ -934,6 +935,8 @@ Public Class ClsCompras
.Add("@TipoDocto", SqlDbType.VarChar).Value = TipoDocto .Add("@TipoDocto", SqlDbType.VarChar).Value = TipoDocto
.Add("@Deducible", SqlDbType.Int).Value = Deducible .Add("@Deducible", SqlDbType.Int).Value = Deducible
.Add("@CveCultivo", SqlDbType.VarChar).Value = CveCultivo .Add("@CveCultivo", SqlDbType.VarChar).Value = CveCultivo
.Add("@CveTipoProveedor", SqlDbType.VarChar).Value = CveTipoProveedor
.Add("@CveProveedorClasificacion", SqlDbType.VarChar).Value = CveProveedorClasificacion
End With End With

View File

@@ -4989,6 +4989,7 @@ Public Class ClsPaginas
PaginaDict.Add("/General/CatMedidas.aspx".ToUpper(), 712) PaginaDict.Add("/General/CatMedidas.aspx".ToUpper(), 712)
PaginaDict.Add("/General/CatSatListado69B.aspx".ToUpper, 1038) PaginaDict.Add("/General/CatSatListado69B.aspx".ToUpper, 1038)
PaginaDict.Add("/General/CatMedidaEquivalencia.aspx".ToUpper(), 773) PaginaDict.Add("/General/CatMedidaEquivalencia.aspx".ToUpper(), 773)
PaginaDict.Add("/General/RepIndicadorResumen.aspx".ToUpper(), 110)
#End Region #End Region
@@ -7185,7 +7186,7 @@ Public Class ClsPaginas
CEId = "" CEId = ""
Try Try
CEId = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).SelectSingleNode("//cce11:Destinatario", namespaces).Attributes("NumRegIdTrib").InnerText 'XmlDoc.SelectNodes("//cfdi:Complemento/tfd:TimbreFiscalDigital/cce11:Destinatario") CEId = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).SelectSingleNode("//cce11:Receptor", namespaces).Attributes("NumRegIdTrib").InnerText 'XmlDoc.SelectNodes("//cfdi:Complemento/tfd:TimbreFiscalDigital/cce11:Destinatario")
Catch ex As Exception Catch ex As Exception
End Try End Try
@@ -8217,7 +8218,7 @@ Public Class ClsPaginas
TmpDTImpuestos.Columns.Add("Importe", GetType(Double)) TmpDTImpuestos.Columns.Add("Importe", GetType(Double))
TmpDTImpuestos.Columns.Add("Orden", GetType(Integer)) TmpDTImpuestos.Columns.Add("Orden", GetType(Integer))
If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa, False) AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then
Dim dtVentas As DataTable = ObjVentas.DtResultados Dim dtVentas As DataTable = ObjVentas.DtResultados
' se rellenan los campos de la factura ' se rellenan los campos de la factura

View File

@@ -77,6 +77,11 @@
.MultiLineTextBox { .MultiLineTextBox {
resize: none; resize: none;
} }
.listTerminado{
text-decoration: line-through;
}
</style> </style>
<style> <style>
@@ -587,7 +592,7 @@
<div class="col-md-12"> <div class="col-md-12">
<asp:GridView ID="GVcheklist" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD Widthall GVcheklist mysmallbtn" AutoGenerateColumns="False" <asp:GridView ID="GVcheklist" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD Widthall GVcheklist mysmallbtn" AutoGenerateColumns="False"
DataKeyNames="CveEventoCheckList,CveEvento,CveTipoEvento,EventoComentario,Estatus,CveUsuario,Usuario,FechaIng"> DataKeyNames="CveEventoCheckList,CveEvento,CveTipoEvento,EventoComentario,Estatus,CveUsuario,Usuario,FechaIng" OnRowDataBound="GVcheklist_RowDataBound">
<Columns> <Columns>
<asp:TemplateField HeaderText="" ItemStyle-Width="30"> <asp:TemplateField HeaderText="" ItemStyle-Width="30">
<ItemTemplate> <ItemTemplate>
@@ -598,7 +603,7 @@
<ItemTemplate> <ItemTemplate>
<%--<pre>--%> <%--<pre>--%>
<span class="pre"> <span class="pre">
<asp:Literal ID="lbleventoComentario" runat="server" Text='<%# Eval("EventoComentario")%>'> </asp:Literal> <asp:Label ID="lbleventoComentario" runat="server" Text='<%# Eval("EventoComentario")%>'> </asp:Label>
</span> </span>
<%--</pre>--%> <%--</pre>--%>
</ItemTemplate> </ItemTemplate>

View File

@@ -312,7 +312,7 @@ public partial class CRM_Acercamiento : ClsPaginas
CargaCheckLis(); CargaCheckLis();
} }
CargarPS(); CargarPS();
BtnGuardarAcercamiento.Visible = true; //BtnGuardarAcercamiento.Visible = true;
} }
} }
@@ -2074,4 +2074,21 @@ public partial class CRM_Acercamiento : ClsPaginas
#endregion #endregion
protected void GVcheklist_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow) {
var Estatus = Boolean.Parse(e.Row.DataKey("Estatus"));
CheckBox chk = e.Row.FCCheckBox("");
if (Estatus)
{
e.Row.FCLabel("lbleventoComentario").Attributes.Add("class", "listTerminado");
}
}
}
} }

View File

@@ -1015,6 +1015,8 @@ public partial class CRM_EmpresaCRM : ClsPaginas
protected void LnkEditarContacto_Click(object sender, EventArgs e) protected void LnkEditarContacto_Click(object sender, EventArgs e)
{ {
CargaGridTipoContacto();
EsEditarContacto = true; EsEditarContacto = true;
limpiarCamposModalContato(); limpiarCamposModalContato();
@@ -1030,7 +1032,7 @@ public partial class CRM_EmpresaCRM : ClsPaginas
IndexDTContacto = GvRow.RowIndex; IndexDTContacto = GvRow.RowIndex;
CargaGridTipoContacto();
UPModalContacto.Update(); UPModalContacto.Update();

View File

@@ -178,7 +178,7 @@ public partial class CRM_RepAcercamientosProcesos : ClsPaginas
hypt.HeaderText = $"Total"; hypt.HeaderText = $"Total";
hypt.DataNavigateUrlFields = new string[] { "CveGrupo1", "CveGrupo2", "Grupo1" }; hypt.DataNavigateUrlFields = new string[] { "CveGrupo1", "CveGrupo2", "Grupo1" };
string strfilstros =string.Format("&cveVendedor={0}&cveMedioCaptacion={1}&cveProbabilidadAcercamiento={2}", cveVendedor, cveMedioCaptacion, cveProbabilidadAcercamiento); string strfilstros =string.Format("&cveVendedor={0}&cveMedioCaptacion={1}&cveProbabilidadAcercamiento={2}", cveVendedor, cveMedioCaptacion, cveProbabilidadAcercamiento);
hypt.DataNavigateUrlFormatString = $"/CRM/RepAcercamientosProcesosDetalle.aspx?CveTipoProceso={DdlTipoProceso.SelectedValue}&CveGrupo1={DdlGrupo1.SelectedValue}&FechaInicio={TxtFechaInicio.Text}&FechaFin={TxtFechaFin.Text}{strfilstros}"; hypt.DataNavigateUrlFormatString = $"/CRM/RepAcercamientosProcesosDetalle.aspx?CveTipoProceso={DdlTipoProceso.SelectedValue}&CveGrupo1={DdlGrupo1.SelectedValue}&FechaInicio={TxtFechaInicio.Text}&FechaFin={TxtFechaFin.Text}{strfilstros}&EnPausa={DdlEnPausa.SelectedValue}&CveEtapaProceso={DdlEtapaProceso.SelectedValue}&CveGiroClasificacion={DdlGiroClasificacion.SelectedValue}";
switch (idgrupo1) switch (idgrupo1)
{ {
case 1: case 1:
@@ -196,7 +196,7 @@ public partial class CRM_RepAcercamientosProcesos : ClsPaginas
case 4: case 4:
test.HeaderText = "Fecha"; test.HeaderText = "Fecha";
Agrupador = "Fecha"; Agrupador = "Fecha";
hypt.DataNavigateUrlFormatString = $"/CRM/RepAcercamientosProcesosDetalle.aspx?CveTipoProceso={DdlGrupo1.SelectedValue}&CveGrupo1={{0}}&CveGrupo2={{1}}&FechaInicio={{2}}&FechaFin={{2}}{strfilstros}"; hypt.DataNavigateUrlFormatString = $"/CRM/RepAcercamientosProcesosDetalle.aspx?CveTipoProceso={DdlGrupo1.SelectedValue}&CveGrupo1={{0}}&CveGrupo2={{1}}&FechaInicio={{2}}&FechaFin={{2}}{strfilstros}&EnPausa={DdlEnPausa.SelectedValue}&CveEtapaProceso={DdlEtapaProceso.SelectedValue}&CveGiroClasificacion={DdlGiroClasificacion.SelectedValue}";
break; break;
case 6: case 6:
test.HeaderText = "Giro"; test.HeaderText = "Giro";
@@ -216,7 +216,7 @@ public partial class CRM_RepAcercamientosProcesos : ClsPaginas
hyp.DataTextField = $"C_{row["CveEtapaProceso"]}"; hyp.DataTextField = $"C_{row["CveEtapaProceso"]}";
hyp.HeaderText = $"{row["EtapaProceso"]}"; hyp.HeaderText = $"{row["EtapaProceso"]}";
hyp.DataNavigateUrlFields = new string[]{ "CveGrupo1","CveGrupo2"}; hyp.DataNavigateUrlFields = new string[]{ "CveGrupo1","CveGrupo2"};
hyp.DataNavigateUrlFormatString = $"/CRM/RepAcercamientosProcesosDetalle.aspx?CveTipoProceso={DdlGrupo1.SelectedValue}&CveGrupo1={{0}}&CveGrupo2={{1}}&FechaInicio={TxtFechaInicio.Text}&FechaFin={TxtFechaFin.Text}&cveEtapaProceso={row["CveEtapaProceso"]}"; hyp.DataNavigateUrlFormatString = $"/CRM/RepAcercamientosProcesosDetalle.aspx?CveTipoProceso={DdlGrupo1.SelectedValue}&CveGrupo1={{0}}&CveGrupo2={{1}}&FechaInicio={TxtFechaInicio.Text}&FechaFin={TxtFechaFin.Text}&cveEtapaProceso={row["CveEtapaProceso"]}&EnPausa={DdlEnPausa.SelectedValue}&CveEtapaProceso={DdlEtapaProceso.SelectedValue}&CveGiroClasificacion={DdlGiroClasificacion.SelectedValue}";
GVRepAcercamientosEtapas.Columns.Add(hyp); GVRepAcercamientosEtapas.Columns.Add(hyp);
} }
} }

View File

@@ -252,6 +252,27 @@
<div class="col-md-2"> <div class="col-md-2">
<asp:DropDownList ID="DdlGiroClasificacion" Width="100%" runat="server" DataValueField="CveClienteClasificacion" DataTextField="ClienteClasificacion" AppendDataBoundItems="true" CssClass="form-control select2me"></asp:DropDownList> <asp:DropDownList ID="DdlGiroClasificacion" Width="100%" runat="server" DataValueField="CveClienteClasificacion" DataTextField="ClienteClasificacion" AppendDataBoundItems="true" CssClass="form-control select2me"></asp:DropDownList>
</div> </div>
<label class="col-md-1" >En Pausa:</label>
<div class="col-md-1">
<asp:DropDownList ID="DdlEnPausa" Width="100%" runat="server" CssClass="form-control input-sm select2me" >
<asp:ListItem Value="-1">Todo</asp:ListItem>
<asp:ListItem Value="0">Activos</asp:ListItem>
<asp:ListItem Value="1">En Pausa</asp:ListItem>
</asp:DropDownList>
</div>
<%-- <label class="col-md-1" >Etapa:</label>
<div class="col-md-1">
<asp:DropDownList ID="DdlEtapaProceso" Width="100%" runat="server" CssClass="form-control input-sm select2me" DataTextField="EtapaProceso" DataValueField="CveEtapaProceso">
</asp:DropDownList>
</div>--%>
<%-- <asp:Label class="col-md-1 " style=" margin-top: 5px;" runat="server" Text="Giro:" AssociatedControlID="DdlGiroClasificacion"></asp:Label>
<div class="col-md-1">
<asp:DropDownList ID="DropDownList1" Width="100%" runat ="server" DataValueField="CveClienteClasificacion" DataTextField="ClienteClasificacion" AppendDataBoundItems="true" CssClass="form-control select2me"></asp:DropDownList>
</div>--%>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -9,6 +9,8 @@ using System.Data;
using System.Text; using System.Text;
using System.IO; using System.IO;
using Microsoft.Reporting.WebForms; using Microsoft.Reporting.WebForms;
using ADSNetLibrary.SIGAPI.Models.CRM.Request;
using ADSNetLibrary.SIGAPI.Services.CRM;
public partial class CRM_RepAcercamientosProcesosDetalle : ClsPaginas public partial class CRM_RepAcercamientosProcesosDetalle : ClsPaginas
{ {
@@ -62,6 +64,21 @@ public partial class CRM_RepAcercamientosProcesosDetalle : ClsPaginas
set { ViewState["RsFechaFin"] = value; } set { ViewState["RsFechaFin"] = value; }
} }
private bool REsRechazo
{
get {
if(ViewState["REsRechazo"] == null)
{
ViewState["REsRechazo"] = false;
}
return bool.Parse(ViewState["REsRechazo"].ToString()) ;
}
set { ViewState["REsRechazo"] =(bool) value; }
}
private DataTable DtMedioCaptacion private DataTable DtMedioCaptacion
{ {
get get
@@ -112,15 +129,20 @@ public partial class CRM_RepAcercamientosProcesosDetalle : ClsPaginas
CveRechazoMotivo = Request["CveRechazoMotivo"] == null ? -1 : Request["CveRechazoMotivo"].ToString().ToEntero(); CveRechazoMotivo = Request["CveRechazoMotivo"] == null ? -1 : Request["CveRechazoMotivo"].ToString().ToEntero();
REsRechazo = Request["EsRechazo"] == null ? false : (Request["EsRechazo"].ToString().ToEntero()==1?true:false);
RsFecha = Request["Fecha"] == null ? Extensiones.ModExtensiones.MinFecha.ToString() : Request["Fecha"].ToString(); RsFecha = Request["Fecha"] == null ? Extensiones.ModExtensiones.MinFecha.ToString() : Request["Fecha"].ToString();
RsFechaIni = Request["FechaInicio"] == null ? Extensiones.ModExtensiones.MinFecha.ToString() : Request["FechaInicio"].ToString(); RsFechaIni = Request["FechaInicio"] == null ? Extensiones.ModExtensiones.MinFecha.ToString() : Request["FechaInicio"].ToString();
RsFechaFin = Request["FechaFin"] == null ? Extensiones.ModExtensiones.MaxFecha.ToString() : Request["FechaFin"].ToString(); RsFechaFin = Request["FechaFin"] == null ? Extensiones.ModExtensiones.MaxFecha.ToString() : Request["FechaFin"].ToString();
TxtFechaInicio.Text = Request["FechaInicio"] == null ? Extensiones.ModExtensiones.MinFecha.ToString() : Request["FechaInicio"].ToString(); TxtFechaInicio.Text = Request["FechaInicio"] == null ? Extensiones.ModExtensiones.MinFecha.ToString() : Request["FechaInicio"].ToString();
TxtFechaFin.Text = Request["FechaFin"] == null ? Extensiones.ModExtensiones.MaxFecha.ToString() : Request["FechaFin"].ToString(); TxtFechaFin.Text = Request["FechaFin"] == null ? Extensiones.ModExtensiones.MaxFecha.ToString() : Request["FechaFin"].ToString();
try { RsFechaIni = RsFechaIni.ToDateTime().ToString("yyyy/MM/dd"); TxtFechaInicio.Text = RsFechaIni.ToDateTime().ToString("dd/MM/yyyy"); } try { RsFechaIni = RsFechaIni.ToDateTime().ToString("yyyy/MM/dd"); TxtFechaInicio.Text = RsFechaIni.ToDateTime().ToString("dd/MM/yyyy"); }
catch (Exception) { RsFechaIni = ""; } catch (Exception) { RsFechaIni = ""; }
try { RsFechaFin = RsFechaFin.ToDateTime().ToString("yyyy/MM/dd"); TxtFechaFin.Text = RsFechaFin.ToDateTime().ToString("dd/MM/yyyy"); } try { RsFechaFin = RsFechaFin.ToDateTime().ToString("yyyy/MM/dd"); TxtFechaFin.Text = RsFechaFin.ToDateTime().ToString("dd/MM/yyyy"); }
catch (Exception) { RsFechaFin = ""; } catch (Exception) { RsFechaFin = ""; }
switch (RCveTipoProceso) switch (RCveTipoProceso)
{ {
case 1: case 1:
@@ -145,6 +167,10 @@ public partial class CRM_RepAcercamientosProcesosDetalle : ClsPaginas
DdlVendedor.SelectedValueExist(RcveVendedor); DdlVendedor.SelectedValueExist(RcveVendedor);
DdlMedioCaptacion.SelectedValueExist(RcveMedioCaptacion); DdlMedioCaptacion.SelectedValueExist(RcveMedioCaptacion);
DdlProbabilidad.SelectedValueExist(RcveProbabilidadAcercamiento); DdlProbabilidad.SelectedValueExist(RcveProbabilidadAcercamiento);
//Request["CveTipoProceso"] == null ? -1 : Request["CveTipoProceso"].ToString().ToEntero()
DdlEnPausa.SelectedValueExist(Request["EnPausa"] == null ? -1 : Request["EnPausa"].ToString().ToEntero());
DdlGiroClasificacion.SelectedValueExist(Request["CveGiroClasificacion"] == null ? -1 : Request["CveGiroClasificacion"].ToString().ToEntero());
cargarDatos(); cargarDatos();
} }
} }
@@ -214,6 +240,7 @@ public partial class CRM_RepAcercamientosProcesosDetalle : ClsPaginas
DdlTipoProceso.SelectedValue = CveTipoProceso; DdlTipoProceso.SelectedValue = CveTipoProceso;
} }
upDatosRepA.Update(); upDatosRepA.Update();
} }
protected void DdlTipoProceso_Change(object sender, EventArgs e) protected void DdlTipoProceso_Change(object sender, EventArgs e)
@@ -234,7 +261,8 @@ public partial class CRM_RepAcercamientosProcesosDetalle : ClsPaginas
{ {
ClsCRM ObjRepA = new ClsCRM(); ClsCRM ObjRepA = new ClsCRM();
ObjRepA.RepAcercamientosDetalle(UsuarioActual.CveEmpresa, RcveVendedor, RcveMedioCaptacion, RcveProbabilidadAcercamiento, RcveEtapaProceso, RsFecha, RsFechaIni, ObjRepA.RepAcercamientosDetalle(UsuarioActual.CveEmpresa, RcveVendedor, RcveMedioCaptacion, RcveProbabilidadAcercamiento, RcveEtapaProceso, RsFecha, RsFechaIni,
RsFechaFin,CveTipoProceso:DdlTipoProceso.SelectedValue.ToEntero(), CveRechazoMotivo: CveRechazoMotivo); RsFechaFin,CveTipoProceso:DdlTipoProceso.SelectedValue.ToEntero(), CveRechazoMotivo: CveRechazoMotivo, EnPausa: DdlEnPausa.SelectedValue.ToEntero(), CveGiroClasificacion: DdlGiroClasificacion.SelectedValue.ToEntero(),
EsRechazo: REsRechazo);
GVRepAcercamientosDetalle.DataSource = ObjRepA.DtResultados; GVRepAcercamientosDetalle.DataSource = ObjRepA.DtResultados;
DTRepAcercamientosDetalle = ObjRepA.DtResultados; DTRepAcercamientosDetalle = ObjRepA.DtResultados;
ObjRepA.Dispose(); ObjRepA.Dispose();

View File

@@ -159,12 +159,12 @@ public partial class CRM_RepAcercamientosRechazos : ClsPaginas
if (DdlGrupo1.SelectedValue == "1") { if (DdlGrupo1.SelectedValue == "1") {
hypt.DataNavigateUrlFields = new string[] { "CveGrupo1", "CveGrupo2", "Grupo1", "CveVendedor" }; hypt.DataNavigateUrlFields = new string[] { "CveGrupo1", "CveGrupo2", "Grupo1", "CveVendedor" };
strfilstros = string.Format("&cveMedioCaptacion={0}&cveProbabilidadAcercamiento={1}", cveMedioCaptacion, cveProbabilidadAcercamiento); strfilstros = string.Format("&cveMedioCaptacion={0}&cveProbabilidadAcercamiento={1}", cveMedioCaptacion, cveProbabilidadAcercamiento);
hypt.DataNavigateUrlFormatString = $"/CRM/RepAcercamientosProcesosDetalle.ASPX?CveTipoProceso={cveTipoProceso}&CveGrupo1={{0}}&CveGrupo2={{1}}&cveVendedor={{3}}&FechaInicio={TxtFechaInicio.Text}&FechaFin={TxtFechaFin.Text}{strfilstros}"; hypt.DataNavigateUrlFormatString = $"/CRM/RepAcercamientosProcesosDetalle.ASPX?CveTipoProceso={cveTipoProceso}&CveGrupo1={{0}}&CveGrupo2={{1}}&cveVendedor={{3}}&FechaInicio={TxtFechaInicio.Text}&FechaFin={TxtFechaFin.Text}{strfilstros}&EnPausa={DdlEnPausa.SelectedValue}&CveEtapaProceso={DdlEtapaProceso.SelectedValue}&CveGiroClasificacion={DdlGiroClasificacion.SelectedValue}&EsRechazo=1";
} }
else { else {
hypt.DataNavigateUrlFields = new string[] { "CveGrupo1", "CveGrupo2" , "Grupo1" }; hypt.DataNavigateUrlFields = new string[] { "CveGrupo1", "CveGrupo2" , "Grupo1" };
strfilstros = string.Format("&cveVendedor={0}&cveMedioCaptacion={1}&cveProbabilidadAcercamiento={2}", cveVendedor, cveMedioCaptacion, cveProbabilidadAcercamiento); strfilstros = string.Format("&cveVendedor={0}&cveMedioCaptacion={1}&cveProbabilidadAcercamiento={2}", cveVendedor, cveMedioCaptacion, cveProbabilidadAcercamiento);
hypt.DataNavigateUrlFormatString = $"/CRM/RepAcercamientosProcesosDetalle.ASPX?CveTipoProceso={cveTipoProceso}&CveGrupo1={{0}}&CveGrupo2={{1}}&c&FechaInicio={TxtFechaInicio.Text}&FechaFin={TxtFechaFin.Text}{strfilstros}"; hypt.DataNavigateUrlFormatString = $"/CRM/RepAcercamientosProcesosDetalle.ASPX?CveTipoProceso={cveTipoProceso}&CveGrupo1={{0}}&CveGrupo2={{1}}&c&FechaInicio={TxtFechaInicio.Text}&FechaFin={TxtFechaFin.Text}{strfilstros}&EnPausa={DdlEnPausa.SelectedValue}&CveEtapaProceso={DdlEtapaProceso.SelectedValue}&CveGiroClasificacion={DdlGiroClasificacion.SelectedValue}&EsRechazo=1";
} }
switch (idgrupo1) switch (idgrupo1)
{ {
@@ -183,7 +183,7 @@ public partial class CRM_RepAcercamientosRechazos : ClsPaginas
case 4: case 4:
test.HeaderText = "Fecha"; test.HeaderText = "Fecha";
Agrupador = "Fecha"; Agrupador = "Fecha";
hypt.DataNavigateUrlFormatString = $"/CRM/RepAcercamientosProcesosDetalle.ASPX?CveTipoProceso={cveTipoProceso}&CveGrupo1={{0}}&CveGrupo2={{1}}&FechaInicio={{2}}&FechaFin={{2}}{strfilstros}"; hypt.DataNavigateUrlFormatString = $"/CRM/RepAcercamientosProcesosDetalle.ASPX?CveTipoProceso={cveTipoProceso}&CveGrupo1={{0}}&CveGrupo2={{1}}&FechaInicio={{2}}&FechaFin={{2}}{strfilstros}&EnPausa={DdlEnPausa.SelectedValue}&CveEtapaProceso={DdlEtapaProceso.SelectedValue}&CveGiroClasificacion={DdlGiroClasificacion.SelectedValue}&EsRechazo=1";
break; break;
} }
GVRepAcercamientosEtapas.Columns.Add(test); GVRepAcercamientosEtapas.Columns.Add(test);
@@ -195,7 +195,7 @@ public partial class CRM_RepAcercamientosRechazos : ClsPaginas
hyp.DataTextField = $"C_{row["CveRechazoMotivo"]}"; hyp.DataTextField = $"C_{row["CveRechazoMotivo"]}";
hyp.HeaderText = $"{row["RechazoMotivo"]}"; hyp.HeaderText = $"{row["RechazoMotivo"]}";
hyp.DataNavigateUrlFields = new string[] { "CveGrupo1", "CveGrupo2", "CveVendedor" }; hyp.DataNavigateUrlFields = new string[] { "CveGrupo1", "CveGrupo2", "CveVendedor" };
hyp.DataNavigateUrlFormatString = $"/CRM/RepAcercamientosProcesosDetalle.ASPX?CveTipoProceso={cveTipoProceso}&CveGrupo1={{0}}&CveGrupo2={{1}}&CveVendedor={{2}}&FechaInicio={TxtFechaInicio.Text}&FechaFin={TxtFechaFin.Text}{strfilstros}&CveRechazoMotivo={row["CveRechazoMotivo"]}"; hyp.DataNavigateUrlFormatString = $"/CRM/RepAcercamientosProcesosDetalle.ASPX?CveTipoProceso={cveTipoProceso}&CveGrupo1={{0}}&CveGrupo2={{1}}&CveVendedor={{2}}&FechaInicio={TxtFechaInicio.Text}&FechaFin={TxtFechaFin.Text}{strfilstros}&CveRechazoMotivo={row["CveRechazoMotivo"]}&EnPausa={DdlEnPausa.SelectedValue}&CveEtapaProceso={DdlEtapaProceso.SelectedValue}&CveGiroClasificacion={DdlGiroClasificacion.SelectedValue}&EsRechazo=1";
GVRepAcercamientosEtapas.Columns.Add(hyp); GVRepAcercamientosEtapas.Columns.Add(hyp);
} }

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,480 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepIndicadorResumen.aspx.vb" Inherits="General_RepIndicadorResumen" %>
<asp:Content ID="Content1" ContentPlaceHolderID="H" runat="Server">
<%-- <li>
<asp:LinkButton ID="LnkExportar" runat="server"><i class="fa fa-ad-excel"></i> Exportar</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="LnkImprimir" runat="server"><i class="fa fa-print"></i> Imprimir</asp:LinkButton>
</li>--%>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="Css" runat="Server">
<style>
.dataTables_scrollHead {
background-color: #95A5A6;
color: white;
}
.table-scrollable {
margin-top: 0px !important;
margin-bottom: 0px !important;
}
.margenbound {
margin-left: 15px;
text-align: right;
}
.amChartsAttribution {
margin-top: -2px;
margin-bottom: 8px;
visibility: hidden;
}
div[id^=chartdiv] {
width: 100%;
height: 500px;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="E" runat="Server">
Reporte de Resumen de Indicadores
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="C" runat="Server">
<%--Tabla con los campos para filtrar--%>
<asp:UpdatePanel runat="server">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter" style="">
<div class="portlet-title portlet-filterT smalltitle" style="min-height: 49px; position: relative;">
<div class="tools">
<asp:Button ID="btnConsultar" CssClass="btn btn-primary" runat="server" ValidationGroup="GrpConsultar" Text="Consultar" /></td>
<a href="javascript:;" data-idchekbox="<%= chkexpand.ClientID%>" class=" <%= IIf(chkexpand.Checked = True, "collapse", "expand")%>"></a>
<asp:CheckBox ID="chkexpand" CssClass="hidden" runat="server" />
</div>
<div class="titlefiltros caption magindate">
<div class="row">
<div class="col-md-1 truncate" style="text-align: right!important">Fecha Inicio</div>
<div class="col-md-1">
<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: 80px !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 class="col-md-1 truncate" style="text-align: right!important">Fecha Fin</div>
<div class="col-md-1 ">
<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: 80px !important;" ID="TxtFechaF" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgFechaF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="TxtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CalendarExtender1" TargetControlID="TxtFechaF" PopupButtonID="ImgFechaF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
</div>
<div class="col-md-1 truncate" style="text-align: right!important; margin-left: 20px">SubProyecto</div>
<div class="col-md-1">
<asp:DropDownList ID="DdlSubProyecto" CssClass="form-control input-sm select2me" runat="server" Width="150px" DataTextField="SubProyecto" DataValueField="CveSubProyecto">
</asp:DropDownList>
</div>
</div>
</div>
</div>
<div class="portlet-body magindate" <%= IIf(chkexpand.Checked = True, "", "style=""display:none;""")%>>
</div>
</div>
<div class="row">
<div class="col-md-6"></div>
<div class="col-md-6 amChartsAttribution">
<a href="http://www.amcharts.com/" class="amChartsLegend" id="amChartsAttribution">JS charts by amCharts</a>
</div>
</div>
<asp:UpdatePanel ID="UPPMov" runat="server" RenderMode="Inline" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-md-6">
<asp:UpdatePanel ID="UPTablaVxP" runat="server" class="portlet light xspadding bordered " align="left" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span id="SpObs" runat="server" class="caption-subject bold uppercase">Ventas por Productos </span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="tools">
<a href="javascript:;" class="collapse"></a>
</div>
</div>
<div class="portlet-body formnombottom">
<asp:GridView ID="GvVxP" runat="server" GridLines="None"
CssClass="table table-striped table-advance table-hover ScrollAD " ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true"
AutoGenerateColumns="False" AllowPaging="False" ShowFooter="False">
<Columns>
<asp:BoundField DataField="Gpo" HeaderText="Prod/Serv" ItemStyle-Width="300px" />
<asp:BoundField DataFormatString="{0:n}" DataField="Cantidad" ItemStyle-CssClass="margenbound" HeaderText="Cantidad" />
<asp:BoundField DataFormatString="{0:n}" DataField="SubTotal" ItemStyle-CssClass="margenbound" HeaderText="SubTotal" />
</Columns>
</asp:GridView>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="col-md-6">
<asp:UpdatePanel ID="UPGraficaVxP" runat="server" class="portlet light xspadding bordered " align="center" style="" UpdateMode="Conditional" Visible="false">
<ContentTemplate>
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span id="Span4" runat="server" class="caption-subject bold uppercase">Ventas por Productos - Gráfica </span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="tools">
<a href="javascript:;" class="collapse"></a>
</div>
</div>
<div class="portlet-body formnombottom">
<div id="chartdiv_vxp"></div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
<div class="row">
<div class="col-md-6">
<asp:UpdatePanel ID="UPTablaCxP192" runat="server" class="portlet light xspadding bordered " align="left" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span id="Span8" runat="server" class="caption-subject bold uppercase">Compras por Productos - Proveedor Productor</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="tools">
<a href="javascript:;" class="collapse"></a>
</div>
</div>
<div class="portlet-body formnombottom">
<asp:GridView ID="GvCxP192" runat="server" GridLines="None"
CssClass="table table-striped table-advance table-hover ScrollAD " ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true"
AutoGenerateColumns="False" AllowPaging="False" ShowFooter="False">
<Columns>
<asp:BoundField DataField="Gpo" HeaderText="Prod/Serv" ItemStyle-Width="300px" />
<asp:BoundField DataFormatString="{0:n}" DataField="Cantidad" ItemStyle-CssClass="margenbound" HeaderText="Cantidad" />
<asp:BoundField DataFormatString="{0:n}" DataField="SubTotal" ItemStyle-CssClass="margenbound" HeaderText="SubTotal" />
</Columns>
</asp:GridView>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="col-md-6">
<asp:UpdatePanel ID="UPGraficaCxP192" runat="server" class="portlet light xspadding bordered " align="center" style="" UpdateMode="Conditional" Visible="false">
<ContentTemplate>
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span id="Span9" runat="server" class="caption-subject bold uppercase">Compras por Productos - Proveedor Productor - Gráfica </span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="tools">
<a href="javascript:;" class="collapse"></a>
</div>
</div>
<div class="portlet-body formnombottom">
<div id="chartdiv_cxp192"></div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
<div class="row">
<div class="col-md-6">
<asp:UpdatePanel ID="UPTablaCxP" runat="server" class="portlet light xspadding bordered " align="left" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span id="Span1" runat="server" class="caption-subject bold uppercase">Compras por Productos </span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="tools">
<a href="javascript:;" class="collapse"></a>
</div>
</div>
<div class="portlet-body formnombottom">
<asp:GridView ID="GvCxP" runat="server" GridLines="None"
CssClass="table table-striped table-advance table-hover ScrollAD " ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true"
AutoGenerateColumns="False" AllowPaging="False" ShowFooter="False">
<Columns>
<asp:BoundField DataField="Gpo" HeaderText="Prod/Serv" ItemStyle-Width="300px" />
<asp:BoundField DataFormatString="{0:n}" DataField="Cantidad" ItemStyle-CssClass="margenbound" HeaderText="Cantidad" />
<asp:BoundField DataFormatString="{0:n}" DataField="SubTotal" ItemStyle-CssClass="margenbound" HeaderText="SubTotal" />
</Columns>
</asp:GridView>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="col-md-6">
<asp:UpdatePanel ID="UPGraficaCxP" runat="server" class="portlet light xspadding bordered " align="center" style="" UpdateMode="Conditional" Visible="false">
<ContentTemplate>
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span id="Span2" runat="server" class="caption-subject bold uppercase">Compras por Productos - Gráfica </span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="tools">
<a href="javascript:;" class="collapse"></a>
</div>
</div>
<div class="portlet-body formnombottom">
<div id="chartdiv_cxp"></div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
<div class="row">
<div class="col-md-6">
<asp:UpdatePanel ID="UPTablaCCxC" runat="server" class="portlet light xspadding bordered " align="left" style="" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span id="Span3" runat="server" class="caption-subject bold uppercase">Cuentas por cobrar por Cliente </span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="tools">
<a href="javascript:;" class="collapse"></a>
</div>
</div>
<div class="portlet-body formnombottom">
<asp:GridView ID="GvCCxC" runat="server" GridLines="None"
CssClass="table table-striped table-advance table-hover ScrollAD " ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true"
AutoGenerateColumns="False" AllowPaging="False" ShowFooter="False">
<Columns>
<asp:BoundField DataField="Gpo" HeaderText="Cliente" />
<asp:BoundField DataFormatString="{0:n}" DataField="Saldo" ItemStyle-CssClass="margenbound" HeaderText="Saldo" />
</Columns>
</asp:GridView>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="col-md-6">
<asp:UpdatePanel ID="UPGraficaCCxC" runat="server" class="portlet light xspadding bordered " align="center" style="" UpdateMode="Conditional" Visible="false">
<ContentTemplate>
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span id="Span5" runat="server" class="caption-subject bold uppercase">Cuentas por cobrar por Cliente - Gráfica </span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="tools">
<a href="javascript:;" class="collapse"></a>
</div>
</div>
<div class="portlet-body formnombottom">
<div id="chartdiv_ccxc"></div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
<div class="row">
<div class="col-md-6">
<asp:UpdatePanel ID="UPTablaCPxP" runat="server" class="portlet light xspadding bordered " align="left" style="" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span id="Span6" runat="server" class="caption-subject bold uppercase">Cuentas por pagar por Proveedor </span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="tools">
<a href="javascript:;" class="collapse"></a>
</div>
</div>
<div class="portlet-body formnombottom">
<asp:GridView ID="GvCPxP" runat="server" GridLines="None"
CssClass="table table-striped table-advance table-hover ScrollAD " ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true"
AutoGenerateColumns="False" AllowPaging="False" ShowFooter="False">
<Columns>
<asp:BoundField DataField="Gpo" HeaderText="Cliente" />
<asp:BoundField DataFormatString="{0:n}" DataField="Saldo" ItemStyle-CssClass="margenbound" HeaderText="Saldo" />
</Columns>
</asp:GridView>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="col-md-6">
<asp:UpdatePanel ID="UPGraficaCPxP" runat="server" class="portlet light xspadding bordered " align="center" style="" UpdateMode="Conditional" Visible="false">
<ContentTemplate>
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span id="Span7" runat="server" class="caption-subject bold uppercase">Cuentas por pagar por Proveedor - Gráfica </span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="tools">
<a href="javascript:;" class="collapse"></a>
</div>
</div>
<div class="portlet-body formnombottom">
<div id="chartdiv_cpxp"></div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnConsultar" EventName="Click" />
</Triggers>
</asp:UpdatePanel>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
<script src="https://www.amcharts.com/lib/3/amcharts.js"></script>
<script src="https://www.amcharts.com/lib/3/serial.js"></script>
<script src="https://www.amcharts.com/lib/3/pie.js"></script>
<script src="https://www.amcharts.com/lib/3/plugins/export/export.min.js"></script>
<link rel="stylesheet" href="https://www.amcharts.com/lib/3/plugins/export/export.css" type="text/css" media="all" />
<script src="https://www.amcharts.com/lib/3/themes/light.js"></script>
<script>
function CargaGraficasPastel(json) {
// Configuración genérica para todas las gráficas
const chartconfig = {
"hideCredits": true,
"type": "pie",
"theme": "light",
"dataProvider": [], // se sobrescribe con la sección indicada del JSON en makeChart
"valueField": "Valor",
"titleField": "Texto",
//"legend": {
// "valueLabels": {
// "text": "{value.value}"
// }
//},
"outlineAlpha": 0.4,
"depth3D": 0,
"balloonText": "[[title]]<br><span style='font-size:14px'><b>[[value]]</b> ([[percents]]% [[Moneda]])</span>",
"angle": 0,
"export": {
"enabled": true
}
}
// document.querySelectorAll('div[id^=chartdiv]').forEach((chartdiv) => {
// AmCharts.makeChart(chartdiv, chartconfig);
// });
AmCharts.makeChart("chartdiv_vxp", { ...chartconfig, dataProvider: json["VxP"] }); // Ventas x Producto
AmCharts.makeChart("chartdiv_cxp", { ...chartconfig, dataProvider: json["CxP"] }); // Compras x Producto TipoProveedor 1
AmCharts.makeChart("chartdiv_cxp192", { ...chartconfig, dataProvider: json["CxP192"] }); // Compras x Producto ProveedorClasificacion 192
AmCharts.makeChart("chartdiv_ccxc", { ...chartconfig, dataProvider: json["CCxC"] }); // Cuentas por Cobrar x Cliente
AmCharts.makeChart("chartdiv_cpxp", { ...chartconfig, dataProvider: json["CPxP"] }); // Cuentas por Pagar x Proveedor
document.getElementById('amChartsAttribution').style.visibility = 'visible';
}
/*
function CargaGraficasBarras(json) {
var chart = AmCharts.makeChart("chartdiv2", {
"type": "serial",
"theme": "light",
"dataProvider": json,
"startDuration": 2,
"valueAxes": [{
"position": "left",
"title": "Ventas"
}],
"graphs": [{
"balloonText": "[[category]]: <b>[[value]]</b> [[Moneda]]",
"colorField": "Color",
"fillAlphas": 1,
"lineAlpha": 0.1,
"type": "column",
"valueField": "Valor"
}],
"depth3D": 20,
"angle": 30,
"chartCursor": {
"categoryBalloonEnabled": false,
"cursorAlpha": 0,
"zoomable": false
},
"categoryField": "Texto",
"categoryAxis": {
"gridPosition": "start",
"labelRotation": 90
},
"export": {
"enabled": true
}
});
}*/
</script>
</asp:Content>

View File

@@ -0,0 +1,485 @@
Imports System.Data
Imports Extensiones
Imports Microsoft.Reporting.WebForms
Partial Class General_RepIndicadorResumen
Inherits ClsPaginas
#Region "propiedades"
Private Property VxP As DataTable
Get
If ViewState("VxP") Is Nothing Then
Return New DataTable
Else
Return DirectCast(ViewState("VxP"), DataTable)
End If
End Get
Set(value As DataTable)
ViewState("VxP") = value
End Set
End Property
Private Property CxP As DataTable
Get
If ViewState("CxP") Is Nothing Then
Return New DataTable
Else
Return DirectCast(ViewState("CxP"), DataTable)
End If
End Get
Set(value As DataTable)
ViewState("CxP") = value
End Set
End Property
Private Property CxP192 As DataTable
Get
If ViewState("CxP192") Is Nothing Then
Return New DataTable
Else
Return DirectCast(ViewState("CxP192"), DataTable)
End If
End Get
Set(value As DataTable)
ViewState("CxP192") = value
End Set
End Property
Private Property CCxC As DataTable
Get
If ViewState("CCxC") Is Nothing Then
Return New DataTable
Else
Return DirectCast(ViewState("CCxC"), DataTable)
End If
End Get
Set(value As DataTable)
ViewState("CCxC") = value
End Set
End Property
Private Property CPxP As DataTable
Get
If ViewState("CPxP") Is Nothing Then
Return New DataTable
Else
Return DirectCast(ViewState("CPxP"), DataTable)
End If
End Get
Set(value As DataTable)
ViewState("CPxP") = value
End Set
End Property
Private Property DtColor As DataTable
Get
If ViewState("DtColor") Is Nothing Then
Return New DataTable
Else
Return DirectCast(ViewState("DtColor"), DataTable)
End If
End Get
Set(value As DataTable)
ViewState("DtColor") = value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not IsPostBack Then
CargaCombos()
CargaDatos()
End If
End Sub
Private Sub CargaCombos()
'Carga SubProyectos
DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1)
DdlSubProyecto.DataBind()
DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
TxtFechaI.Text = $"01/{Now.Month}/{Now.Year}"
TxtFechaF.Text = Now.ToString("dd/MM/yyyy")
CreaDataTableColor()
End Sub
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles btnConsultar.Click
CargaDatos()
End Sub
Private Sub CargaDatos()
Dim ObjVentas As New ClsVentas
Dim ObjCompras As New ClsCompras
Dim ObjMovtos As New ClsMovimientos()
If ObjVentas.GetRepProductosServicios(-1, DdlSubProyecto.SelectedValue.ToEntero, -1, -1, -1, TxtFechaI.Text.Trim(), TxtFechaF.Text.Trim(), MinFecha, MaxFecha, -1,
-1, -1, -1, -1, "-1", UsuarioActual.CveEmpresa, 5, CveUsuarioConsulta:=UsuarioActual.CveUsuario, TipoCambio:=1) Then
VxP = ObjVentas.DtResultados
GvVxP.DataSource = VxP
Else
GvVxP.DataSource = Nothing
VxP = Nothing
End If
If ObjCompras.GetRepProductosServicios(-1, DdlSubProyecto.SelectedValue.ToEntero, -1, -1, -1, TxtFechaI.Text.Trim(), TxtFechaF.Text.Trim(), -1, -1, -1,
UsuarioActual.CveEmpresa, 5, -1, -1, "-1", "-1", -1, TipoCambio:=1, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveProveedorClasificacion:=192) Then
CxP192 = ObjCompras.DtResultados
GvCxP192.DataSource = CxP192
Else
GvCxP192.DataSource = Nothing
CxP192 = Nothing
End If
If ObjCompras.GetRepProductosServicios(-1, DdlSubProyecto.SelectedValue.ToEntero, -1, -1, -1, TxtFechaI.Text.Trim(), TxtFechaF.Text.Trim(), -1, -1, -1,
UsuarioActual.CveEmpresa, 5, -1, -1, "-1", "-1", -1, TipoCambio:=1, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveTipoProveedor:=1) Then
CxP = ObjCompras.DtResultados
GvCxP.DataSource = CxP
Else
GvCxP.DataSource = Nothing
CxP = Nothing
End If
Dim FechaCorte As String = $"31/12/{Now.Year}"
If ObjMovtos.GetCxC(TxtFechaI.Text, TxtFechaF.Text, -1, DdlSubProyecto.SelectedValue.ToEntero, -1, -1, -1, "-1", UsuarioActual.CveEmpresa, 5, -1, 1, -1,
"-1", "-1", "-1", FechaCorte:=FechaCorte.ToDate, CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then
CCxC = ObjMovtos.DtResultados
GvCCxC.DataSource = CCxC
Else
GvCCxC.DataSource = Nothing
CCxC = Nothing
End If
If ObjMovtos.GetCxP(TxtFechaI.Text, TxtFechaF.Text, -1, DdlSubProyecto.SelectedValue.ToEntero, -1, -1, -1, "-1", UsuarioActual.CveEmpresa, 5, -1, 1, -1,
"-1", "-1", "-1", FechaCorte:=FechaCorte.ToDate, CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then
CPxP = ObjMovtos.DtResultados
GvCPxP.DataSource = CPxP
Else
GvCPxP.DataSource = Nothing
CPxP = Nothing
End If
ObjVentas.Dispose()
ObjCompras.Dispose()
ObjMovtos.Dispose()
GvVxP.DataBind()
GvCxP192.DataBind()
GvCxP.DataBind()
GvCCxC.DataBind()
GvCPxP.DataBind()
' Mostrar gráficos solo si hay datos en su respectiva tabla
If GvVxP.Rows.Count > 0 Then
UPGraficaVxP.Visible = True
Else
UPGraficaVxP.Visible = False
End If
If GvCxP.Rows.Count > 0 Then
UPGraficaCxP.Visible = True
Else
UPGraficaCxP.Visible = False
End If
If GvCxP192.Rows.Count > 0 Then
UPGraficaCxP192.Visible = True
Else
UPGraficaCxP192.Visible = False
End If
If GvCCxC.Rows.Count > 0 Then
UPGraficaCCxC.Visible = True
Else
UPGraficaCCxC.Visible = False
End If
If GvCPxP.Rows.Count > 0 Then
UPGraficaCPxP.Visible = True
Else
UPGraficaCPxP.Visible = False
End If
' Si no había datos en ninguna tabla no cargar función de gráficos
If (GvVxP.Rows.Count = 0 AndAlso GvCxP.Rows.Count = 0 AndAlso GvCxP192.Rows.Count = 0 AndAlso GvCCxC.Rows.Count = 0 AndAlso GvCPxP.Rows.Count = 0) Then Exit Sub
GraficasPastel()
'GraficasBarras()
End Sub
Protected Sub GvVxP_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvVxP.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("Orden") = "" Then
e.Row.CssClass = "Totales"
End If
End If
End Sub
Protected Sub GvCxP_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvCxP.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("Orden") = "" Then
e.Row.CssClass = "Totales"
End If
End If
End Sub
Protected Sub GvCCxC_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvCCxC.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("Orden") = "" Then
e.Row.CssClass = "Totales"
End If
End If
End Sub
Protected Sub GvCPxP_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvCPxP.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("Orden") = "" Then
e.Row.CssClass = "Totales"
End If
End If
End Sub
Private Sub CreaDataTableColor()
DtColor = New DataTable
DtColor.Columns.Add("Color")
Dim RowColor As DataRow = Nothing
RowColor = DtColor.NewRow()
RowColor("Color") = "#FF0F00"
DtColor.Rows.Add(RowColor)
RowColor = Nothing
RowColor = DtColor.NewRow()
RowColor("Color") = "#FF6600"
DtColor.Rows.Add(RowColor)
RowColor = Nothing
RowColor = DtColor.NewRow()
RowColor("Color") = "#FF9E01"
DtColor.Rows.Add(RowColor)
RowColor = Nothing
RowColor = DtColor.NewRow()
RowColor("Color") = "#FCD202"
DtColor.Rows.Add(RowColor)
RowColor = Nothing
RowColor = DtColor.NewRow()
RowColor("Color") = "#F8FF01"
DtColor.Rows.Add(RowColor)
RowColor = Nothing
RowColor = DtColor.NewRow()
RowColor("Color") = "#B0DE09"
DtColor.Rows.Add(RowColor)
RowColor = Nothing
RowColor = DtColor.NewRow()
RowColor("Color") = "#04D215"
DtColor.Rows.Add(RowColor)
RowColor = Nothing
RowColor = DtColor.NewRow()
RowColor("Color") = "#0D8ECF"
DtColor.Rows.Add(RowColor)
RowColor = Nothing
RowColor = DtColor.NewRow()
RowColor("Color") = "#0D52D1"
DtColor.Rows.Add(RowColor)
RowColor = Nothing
RowColor = DtColor.NewRow()
RowColor("Color") = "#2A0CD0"
DtColor.Rows.Add(RowColor)
RowColor = Nothing
RowColor = DtColor.NewRow()
RowColor("Color") = "#8A0CCF"
DtColor.Rows.Add(RowColor)
RowColor = Nothing
RowColor = DtColor.NewRow()
RowColor("Color") = "#CD0D74"
DtColor.Rows.Add(RowColor)
RowColor = Nothing
RowColor = DtColor.NewRow()
RowColor("Color") = "#754DEB"
DtColor.Rows.Add(RowColor)
RowColor = Nothing
RowColor = DtColor.NewRow()
RowColor("Color") = "#DDDDDD"
DtColor.Rows.Add(RowColor)
RowColor = Nothing
RowColor = DtColor.NewRow()
RowColor("Color") = "#999999"
DtColor.Rows.Add(RowColor)
RowColor = Nothing
RowColor = DtColor.NewRow()
RowColor("Color") = "#333333"
DtColor.Rows.Add(RowColor)
RowColor = Nothing
RowColor = DtColor.NewRow()
RowColor("Color") = "#000000"
DtColor.Rows.Add(RowColor)
End Sub
Private Sub GraficasPastel()
Dim DtVxP, DtCxP, DtCxP192, DtCCxC, DtCPxP As New DataTable
Dim RowColorIndex As Integer = 0
'Ventas x Producto
DtVxP.Reset()
DtVxP.Columns.Add("Texto")
DtVxP.Columns.Add("Valor")
DtVxP.Columns.Add("Color")
DtVxP.Columns.Add("Moneda")
RowColorIndex = 0
For Each Dr As DataRow In VxP.Rows
If Not Dr("Orden").ToString = "" Then
Dim Row As DataRow = Nothing
Row = DtVxP.NewRow()
Row("Texto") = $"{Dr("GPO").ToString} {GlobalDTMonedas().FiltraParametros($"CveMoneda = {Dr("CveMoneda").ToString}").Rows(0)("Abreviatura").ToString}"
Row("Valor") = Dr("SubTotal").ToString.FormatoNumero
Row("Color") = DtColor.Rows(RowColorIndex)("Color").ToString
Row("Moneda") = Dr("Moneda").ToString
DtVxP.Rows.Add(Row)
RowColorIndex += 1
If RowColorIndex = 17 Then
RowColorIndex = 0
End If
End If
Next
Dim query_vxp = From s In DtVxP.AsEnumerable() Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Color = s("Color").ToString(), .Moneda = s("Moneda").ToString()}
'Compras x Producto TipoProveedor=1
DtCxP.Reset()
DtCxP.Columns.Add("Texto")
DtCxP.Columns.Add("Valor")
DtCxP.Columns.Add("Color")
DtCxP.Columns.Add("Moneda")
RowColorIndex = 0
For Each Dr As DataRow In CxP.Rows
If Not Dr("Orden").ToString = "" Then
Dim Row As DataRow = Nothing
Row = DtCxP.NewRow()
Row("Texto") = $"{Dr("GPO").ToString} {GlobalDTMonedas().FiltraParametros($"CveMoneda = {Dr("CveMoneda").ToString}").Rows(0)("Abreviatura").ToString}"
Row("Valor") = Dr("SubTotal").ToString.FormatoNumero
Row("Color") = DtColor.Rows(RowColorIndex)("Color").ToString
Row("Moneda") = Dr("Moneda").ToString
DtCxP.Rows.Add(Row)
RowColorIndex += 1
If RowColorIndex = 17 Then
RowColorIndex = 0
End If
End If
Next
Dim query_cxp = From s In DtCxP.AsEnumerable() Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Color = s("Color").ToString(), .Moneda = s("Moneda").ToString()}
'Compras x Producto ProveedorClasificacion=192
DtCxP192.Reset()
DtCxP192.Columns.Add("Texto")
DtCxP192.Columns.Add("Valor")
DtCxP192.Columns.Add("Color")
DtCxP192.Columns.Add("Moneda")
RowColorIndex = 0
For Each Dr As DataRow In CxP192.Rows
If Not Dr("Orden").ToString = "" Then
Dim Row As DataRow = Nothing
Row = DtCxP192.NewRow()
Row("Texto") = $"{Dr("GPO").ToString} {GlobalDTMonedas().FiltraParametros($"CveMoneda = {Dr("CveMoneda").ToString}").Rows(0)("Abreviatura").ToString}"
Row("Valor") = Dr("SubTotal").ToString.FormatoNumero
Row("Color") = DtColor.Rows(RowColorIndex)("Color").ToString
Row("Moneda") = Dr("Moneda").ToString
DtCxP192.Rows.Add(Row)
RowColorIndex += 1
If RowColorIndex = 17 Then
RowColorIndex = 0
End If
End If
Next
Dim query_cxp192 = From s In DtCxP192.AsEnumerable() Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Color = s("Color").ToString(), .Moneda = s("Moneda").ToString()}
'Alert(Newtonsoft.Json.JsonConvert.SerializeObject(CCxC.Rows))
'Cuentas por cobrar x Cliente
DtCCxC.Reset()
DtCCxC.Columns.Add("Texto")
DtCCxC.Columns.Add("Valor")
DtCCxC.Columns.Add("Color")
DtCCxC.Columns.Add("Moneda")
RowColorIndex = 0
For Each Dr As DataRow In CCxC.Rows
If Not Dr("Orden").ToString = "" Then
Dim Row As DataRow = Nothing
Row = DtCCxC.NewRow()
Row("Texto") = $"{Dr("GPO").ToString} {GlobalDTMonedas().FiltraParametros($"CveMoneda = {Dr("CveMoneda").ToString}").Rows(0)("Abreviatura").ToString}"
Row("Valor") = Dr("Saldo").ToString.FormatoNumero
Row("Color") = DtColor.Rows(RowColorIndex)("Color").ToString
Row("Moneda") = Dr("Moneda").ToString
DtCCxC.Rows.Add(Row)
RowColorIndex += 1
If RowColorIndex = 17 Then
RowColorIndex = 0
End If
End If
Next
Dim query_ccxc = From s In DtCCxC.AsEnumerable() Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Color = s("Color").ToString(), .Moneda = s("Moneda").ToString()}
'Cuentas por pagar x Proveedor
DtCPxP.Reset()
DtCPxP.Columns.Add("Texto")
DtCPxP.Columns.Add("Valor")
DtCPxP.Columns.Add("Color")
DtCPxP.Columns.Add("Moneda")
RowColorIndex = 0
For Each Dr As DataRow In CPxP.Rows
If Not Dr("Orden").ToString = "" Then
Dim Row As DataRow = Nothing
Row = DtCPxP.NewRow()
Row("Texto") = $"{Dr("GPO").ToString} {GlobalDTMonedas().FiltraParametros($"CveMoneda = {Dr("CveMoneda").ToString}").Rows(0)("Abreviatura").ToString}"
Row("Valor") = Dr("Saldo").ToString.FormatoNumero
Row("Color") = DtColor.Rows(RowColorIndex)("Color").ToString
Row("Moneda") = Dr("Moneda").ToString
DtCPxP.Rows.Add(Row)
RowColorIndex += 1
If RowColorIndex = 17 Then
RowColorIndex = 0
End If
End If
Next
Dim query_cpxp = From s In DtCPxP.AsEnumerable() Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Color = s("Color").ToString(), .Moneda = s("Moneda").ToString()}
'Serializar datos agrupándolos en su respectivo DataTable, todos en un solo JSON
Dim json As String = Newtonsoft.Json.JsonConvert.SerializeObject(New With {.VxP = query_vxp, .CxP = query_cxp, .CxP192 = query_cxp192, .CCxC = query_ccxc, .CPxP = query_cpxp})
'Dim json As String = Newtonsoft.Json.JsonConvert.SerializeObject(New With {.VxP = query_vxp, .CCxC = New String() {}})
'Alert(json)
RegistraScript($"CargaGraficasPastel({json})", "22")
UPPMov.Update()
End Sub
Private Sub GraficasBarras()
'Dim Dt As New DataTable()
'Dt.Columns.Add("Texto")
'Dt.Columns.Add("Valor")
'Dt.Columns.Add("Color")
'Dt.Columns.Add("Moneda")
'Dim RowColorIndex As Integer = 0
'For Each Dr As DataRow In VxC.Rows
' If Not Dr("Orden").ToString = "" Then
' Dim Row As DataRow = Nothing
' Row = Dt.NewRow()
' Row("Texto") = $"{Dr("GPO").ToString} {GlobalDTMonedas().FiltraParametros($"CveMoneda = {Dr("CveMoneda").ToString}").Rows(0)("Abreviatura").ToString}"
' Row("Valor") = Dr("SubTotal").ToString.FormatoNumero
' Row("Color") = DtColor.Rows(RowColorIndex)("Color").ToString
' Row("Moneda") = Dr("Moneda").ToString
' Dt.Rows.Add(Row)
' RowColorIndex += 1
' If RowColorIndex = 17 Then
' RowColorIndex = 0
' End If
' End If
'Next
'Dim query = From s In Dt.AsEnumerable() Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Color = s("Color").ToString(), .Moneda = s("Moneda").ToString()}
'Dim json As String = Newtonsoft.Json.JsonConvert.SerializeObject(query)
'RegistraScript($"CargaGraficasBarras({json})", "22")
'UPPMov.Update()
End Sub
End Class

View File

@@ -609,6 +609,12 @@
<asp:TextBox ID="TxtObservacionesRecepcion" TextMode="MultiLine" Rows="2" runat="server" Width="300px"></asp:TextBox> <asp:TextBox ID="TxtObservacionesRecepcion" TextMode="MultiLine" Rows="2" runat="server" Width="300px"></asp:TextBox>
</div> </div>
</div> </div>
<div class="row" id="DivRealizarDevolucion" runat="server" visible="false">
<label class="col-sm-3">Realizar Devolución:</label>
<div class="col-sm-9">
<asp:CheckBox ID="ChkRealizarDevolucion" runat="server" Checked="false" />
</div>
</div>
<div class="row"> <div class="row">
<div style="text-align: center;" class="col-sm-12"> <div style="text-align: center;" class="col-sm-12">
<asp:UpdatePanel runat="server"> <asp:UpdatePanel runat="server">

View File

@@ -1460,6 +1460,9 @@ Partial Class Inventarios_TraspasoAlmacen
End Sub End Sub
Private Sub CargaRecepcion() Private Sub CargaRecepcion()
DivRealizarDevolucion.Visible = False
ChkRealizarDevolucion.Checked = False
Dim Dtt As DataTable = Nothing Dim Dtt As DataTable = Nothing
FolioBusqueda = If(TxtFolioRecepcion.Text = "", -1, TxtFolioRecepcion.Text.ToEntero) FolioBusqueda = If(TxtFolioRecepcion.Text = "", -1, TxtFolioRecepcion.Text.ToEntero)
@@ -1506,6 +1509,11 @@ Partial Class Inventarios_TraspasoAlmacen
If UsuarioActual.TienePermisoProceso(290) Then If UsuarioActual.TienePermisoProceso(290) Then
BtnCancelarTraspaso.Visible = True BtnCancelarTraspaso.Visible = True
End If End If
If UsuarioActual.Empresa.Funcionalidad(162) = "1" Then
DivRealizarDevolucion.Visible = True
ChkRealizarDevolucion.Checked = True
End If
End If End If
@@ -1518,6 +1526,7 @@ Partial Class Inventarios_TraspasoAlmacen
UpDatosRecepcion.Update() UpDatosRecepcion.Update()
UPDivCodigoSeriePSRecepcion.Update() UPDivCodigoSeriePSRecepcion.Update()
UPDatosAlmacen.Update()
End Sub End Sub
Protected Sub GvDatosRecepcion_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatosRecepcion.RowDataBound Protected Sub GvDatosRecepcion_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatosRecepcion.RowDataBound
@@ -1815,6 +1824,225 @@ Partial Class Inventarios_TraspasoAlmacen
End Sub End Sub
Private Class MCancelacionTraspaso
Public Property TieneError As Boolean = False
Public Property MsgError As String = ""
Public Property CveMovimientoEntrada As Integer = -1
Public Property FolioEntrada As Integer = 0
Public Property CveMovimientoSalidaTransitorio As Integer = -1
Public Property FolioSalidaTransitorio As Integer = 0
End Class
Private Function CancelarTraspaso(ByRef ObjInventario As ClsInventarios, ByRef ObjConta As ClsContabilidad, CveAlmacenDestino As Integer, Fecha As DateTime) As MCancelacionTraspaso
Dim Retorno As New MCancelacionTraspaso()
Dim ErrorMovInv As Boolean = False
Try
Dim CveMovimientoEntrada = ObjInventario.AddMovimiento(CveAlmacenDestino, 27, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1,
Observaciones:=TxtObservacionesRecepcion.Text.Trim, Recibio:=TxtRecibio.Text, CveAlmacenDestino:=CveAlmacenDestino,
CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="TA/C")
If CveMovimientoEntrada <= 0 Then
Retorno.MsgError = "No se pudo generar el movimiento"
ErrorMovInv = True
End If
Retorno.CveMovimientoEntrada = CveMovimientoEntrada
Retorno.FolioEntrada = ObjInventario.Folio
'AGREGAMOS LA SALIDA
Dim CveMovimientoSalidaTransitorio = ObjInventario.AddMovimiento(CveAlmacenTransitorio, 8, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1,
Observaciones:=TxtObservacionesRecepcion.Text.Trim, CveAlmacenDestino:=CveAlmacenDestino,
CveMovimientoRelacionado:=CveMovimientoEntrada, Modulo:="TA/G12")
Retorno.CveMovimientoSalidaTransitorio = CveMovimientoSalidaTransitorio
Dim CvePrePoliza As Integer = -1
Dim Concepto As String = TxtObservacionesRecepcion.Text
If Concepto = "" Then Concepto = "Cancelación Traspaso"
If Not ErrorMovInv Then
Retorno.FolioSalidaTransitorio = ObjInventario.Folio
CvePrePoliza = ObjConta.AddPrePolizas("Inventario/TraspasoAlmacen", 53, 0, 0, 1, Fecha, Concepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If CvePrePoliza <= 0 Then
Retorno.MsgError = "No se pudo generar la Poliza para la cancelación"
ErrorMovInv = True
End If
End If
If CveMovimientoEntrada <= 0 And Not ErrorMovInv Then
Retorno.MsgError = "No se pudo generar el movimiento de entrada correctamente"
ErrorMovInv = True
Else
Dim CveMovimientoDetalleSalida As Integer = 0
Dim importe As Double = 0
Dim Dtt As DataTable = Nothing
FolioBusqueda = TxtFolioRecepcion.Text.ToEntero
If ObjInventario.GetMovimientosTransitorios(DdlAlmacenRecepcion.SelectedValue.ToEntero, -1, DdlAlmacenTransitorioRecepcion.SelectedValue.ToEntero, -1, FolioBusqueda, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario) Then
Dtt = ObjInventario.DtResultados.FiltraParametros(String.Format("CveTipoAlmacenDestino <> 4"))
Else
Dtt = Nothing
End If
If Dtt IsNot Nothing Then
For Each GvRow As DataRow In Dtt.Rows
Dim CvePS As Integer = GvRow("CvePS").ToString().ToEntero
'DEBE CONSIDERAR SOLO LAS FILAS QUE TENGA PRODUCTOS, NO EL TOTALIZADOR
If CvePS > 0 Then
CveMovimientoDetalleSalida = GvRow("CveMovimientoDetalle").ToString.ToEntero
Dim Cantidad As Decimal = GvRow("Cantidad").ToString.ToDecimal
Dim PrecioUnitario As Decimal = GvRow("PU").ToString.ToDecimal
If CveMovimientoDetalleSalida <= 0 Then
ErrorMovInv = True
Retorno.MsgError = "Ocurrió un error al guardar los movimientos de salida"
Exit For
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Cantidad, GvRow("CveUM").ToString().ToEntero, CvePS, PrecioUnitario, -1, -1, Serie:=GvRow("Serie").ToString, Lote:=GvRow("Lote").ToString(), FechaCaducidad:=GvRow("FechaCaducidad").ToString().ToDate, CveMovimientoDetalleEntrada:=CveMovimientoDetalleSalida) Then
ErrorMovInv = True
Retorno.MsgError = "Ocurrió un error al guardar los movimientos de entrada"
Exit For
End If
'MOV, Alm, Transito
If GvRow("CveMovimientoDetalleTransitorio").ToString.ToEntero > 0 Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaTransitorio, Cantidad, GvRow("CveUM").ToString.ToEntero, CvePS, PrecioUnitario, CveSeccionAlmacen:=-3, Serie:=GvRow("Serie").ToString, Lote:=GvRow("Lote").ToString, FechaCaducidad:=GvRow("FechaCaducidad").ToString().ToDate, CveMovimientoDetalleEntrada:=GvRow("CveMovimientoDetalleTransitorio").ToString.ToEntero) Then
ErrorMovInv = True
Retorno.MsgError = "Ocurrió un error al guardar los movimientos de salida"
Exit For
End If
Else
CveMovimientoSalidaTransitorio = 0
End If
importe += Cantidad * PrecioUnitario
End If
Next
Else
ErrorMovInv = True
Retorno.MsgError = "Ocurrió un error al guardar los movimientos de salida"
End If
'VIRTUAL ENTRADA
If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then
Dim CveAlmacenVirtual As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=GvDatosRecepcion.Rows(0).DataKey("CveAlmacenSalida").ToEntero).FiltroPrimeroValor("CveAlmacenVirtual", "").ToEntero()
Dim CveAlmacenVirtualSalida As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=CveAlmacenTransitorio).FiltroPrimeroValor("CveAlmacenVirtual", "").ToEntero()
'SI EL ALMACEN ORIGEN ES DE APOPYO LOGISTICO EL ALMACEN VIRTUAL DEBE SER DE APOYO LOGISTICO
'Dim CveAlmacenVirtual As Integer = -1
'If CveTipoAlmacenOrigen = 27 Then
' CveAlmacenVirtual = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $" CveTipoAlmacen =25 AND CveSubProyecto={CveSubProyecto}").ToEntero()
'Else
' CveAlmacenVirtual = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $" CveTipoAlmacen =24 AND CveSubProyecto={CveSubProyecto}").ToEntero()
'End If
Dim CveMovimientoVirtualEntrada As Integer = -1
Dim CveMovimientoVirtualSalida As Integer = -1
'VERIFICA SI TIENE ALMACEN VIRTUAL ASIGNADA
If CveAlmacenVirtual > 0 And CveAlmacenVirtualSalida > 0 Then
Dim dtvirtual As DataTable = Nothing
Dim importePoliza As Decimal = 0
If ObjInventario.GetMovimientosDetalleVirtual(CveMovimientoEntrada, UsuarioActual.CveEmpresa, CveMovimientoRelacionado:=CveMovimientoSalida) Then
dtvirtual = ObjInventario.DtResultados
If dtvirtual.Rows.Count > 0 Then
CveMovimientoVirtualEntrada = ObjInventario.AddMovimiento(CveAlmacenVirtual, 36, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservacionesRecepcion.Text.Trim, CveMovimientoRelacionado:=CveMovimientoEntrada, Modulo:="TA/C2")
CveMovimientoVirtualSalida = ObjInventario.AddMovimiento(CveAlmacenVirtualSalida, 37, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservacionesRecepcion.Text.Trim, CveMovimientoRelacionado:=CveMovimientoSalidaTransitorio, Modulo:="TA/C3")
Dim FolioVirtualEntrada = ObjInventario.Folio
For Each RowVirtual As DataRow In dtvirtual.Rows
Dim CvePS = RowVirtual("CvePS").ToString().ToEntero()
Dim CantidadUsado As Decimal = RowVirtual("Cantidad").ToString().ToDecimal()
Dim PU As Decimal = RowVirtual("PUOriginal").ToString().ToDecimal()
Dim CveUM As Integer = RowVirtual("CveUM").ToString().ToEntero()
Dim CostoIndirecto As Decimal = RowVirtual("CostoIndirecto").ToString().ToDecimal()
importePoliza = importePoliza + (CantidadUsado * PU)
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtualEntrada, CantidadUsado, CveUM, CvePS, PU, -1, CostoIndirecto:=CostoIndirecto, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
ErrorMovInv = True
Exit For
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtualSalida, CantidadUsado, CveUM, CvePS, PU, -1, CostoIndirecto:=CostoIndirecto, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
ErrorMovInv = True
Exit For
End If
Next
End If
'Else
' TextoError = "No se pudo registrar el movimiento virtual"
' ErrorMovInv = True
End If
If Not ErrorMovInv AndAlso (CveMovimientoSalida > 0 And CveMovimientoVirtualEntrada > 0) Then
Dim CvePrePolizaMovVirtual As Integer = ObjConta.AddPrePolizas("TA/C2|TA/C3", 53, importePoliza, importePoliza, 1, TxtFecha.Text.ToDate, "TA/C2|TA/C3", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If CvePrePolizaMovVirtual > 0 Then
If Not ErrorMovInv AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePolizaMovVirtual, True, importePoliza, importePoliza, 68, TxtObservacionesRecepcion.Text, TxtObservacionesRecepcion.Text, -1, -1, CveMovimientoAlmacen:=CveMovimientoVirtualSalida, Contabilizable:=False) Then
ErrorMovInv = True
End If
If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaMovVirtual, False, importePoliza, importePoliza, 68, TxtObservacionesRecepcion.Text, TxtObservacionesRecepcion.Text, -1, -1, CveMovimientoAlmacen:=CveMovimientoVirtualEntrada, Contabilizable:=False) Then
ErrorMovInv = True
End If
Else
ErrorMovInv = True
End If
End If
'Else
' TextoError = "La Sucursal no tiene creado un almacen virtual"
' ErrorMovInv = True
End If
End If
If Not ErrorMovInv Then
Dim ImporteDecimal As Decimal = importe.ToDecimal.RoundAD
Dim IdCtaContable As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenTransitorioRecepcion.SelectedValue.ToEntero)).ToEntero
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteDecimal, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1,
CveMovimientoAlmacen:=CveMovimientoEntrada, ImporteMX:=ImporteDecimal, Contabilizable:=False) Then
ErrorMovInv = True
Retorno.MsgError = "Ocurrió un error al cancelar el traspaso"
End If
If CveMovimientoSalidaTransitorio > 0 Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteDecimal, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1,
CveMovimientoAlmacen:=CveMovimientoSalidaTransitorio, ImporteMX:=ImporteDecimal, Contabilizable:=False) Then
ErrorMovInv = True
Retorno.MsgError = "Ocurrió un error al cancelar el traspaso"
End If
End If
End If
End If
Catch ex As Exception
ErrorMovInv = True
Retorno.MsgError = "Ocurrió un error al cancelar el traspaso"
OnError("Ocurrió un erro al cancelar el traspaso", ex)
End Try
Retorno.TieneError = ErrorMovInv
Return Retorno
End Function
Protected Sub BtnRecibir_Click(sender As Object, e As EventArgs) Protected Sub BtnRecibir_Click(sender As Object, e As EventArgs)
If GvDatosRecepcion.Rows.Count > 0 Then If GvDatosRecepcion.Rows.Count > 0 Then
'Valida Movimientos 'Valida Movimientos
@@ -2039,6 +2267,13 @@ Partial Class Inventarios_TraspasoAlmacen
End If End If
End If End If
Dim CancelacionTraspaso As MCancelacionTraspaso = Nothing
If UsuarioActual.Empresa.Funcionalidad(162) = "1" AndAlso ChkRealizarDevolucion.Checked AndAlso Not ErrorMovInv Then
CancelacionTraspaso = CancelarTraspaso(ObjInventario, ObjConta, GvDatosRecepcion.Rows(0).DataKey("CveAlmacenSalida").ToEntero, TxtFechaRecepcion.Text.ToDateTime())
If CancelacionTraspaso IsNot Nothing Then
ErrorMovInv = CancelacionTraspaso.TieneError
End If
End If
If Not ErrorMovInv Then If Not ErrorMovInv Then
@@ -2053,6 +2288,9 @@ Partial Class Inventarios_TraspasoAlmacen
Mensaje.AppendFormat("<br/><a target='_blank' href='/Compras/PopUpVerFactura.aspx?P={0}'>Imprimir Reporte</a>", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoEntrada))) 'onclick='ImprimirTraslado()' Mensaje.AppendFormat("<br/><a target='_blank' href='/Compras/PopUpVerFactura.aspx?P={0}'>Imprimir Reporte</a>", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoEntrada))) 'onclick='ImprimirTraslado()'
If CveMovimientoVirtualEntrada > 0 Then Mensaje.AppendFormat("<br/><br/><br/>Folio Virtual <b> <a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}"" target=""_blank"">{2}</a> </b> <br/><a target='_blank' href='/Compras/PopUpVerFactura.aspx?P={0}'>Imprimir Reporte</a>", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoVirtualEntrada)), CveMovimientoVirtualEntrada, FolioVirtualEntrada) 'onclick='ImprimirTraslado()' If CveMovimientoVirtualEntrada > 0 Then Mensaje.AppendFormat("<br/><br/><br/>Folio Virtual <b> <a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}"" target=""_blank"">{2}</a> </b> <br/><a target='_blank' href='/Compras/PopUpVerFactura.aspx?P={0}'>Imprimir Reporte</a>", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoVirtualEntrada)), CveMovimientoVirtualEntrada, FolioVirtualEntrada) 'onclick='ImprimirTraslado()'
If CancelacionTraspaso IsNot Nothing Then
If CancelacionTraspaso.CveMovimientoEntrada > 0 Then Mensaje.AppendFormat("<br/><br/><br/>Folio Devolución <b> <a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}"" target=""_blank"">{2}</a> </b> <br/><a target='_blank' href='/Compras/PopUpVerFactura.aspx?P={0}'>Imprimir Reporte</a>", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CancelacionTraspaso.CveMovimientoEntrada)), CancelacionTraspaso.CveMovimientoEntrada, CancelacionTraspaso.FolioEntrada) 'onclick='ImprimirTraslado()'
End If
Alert(Mensaje.ToString, TipoMensaje.MsgInformacion) Alert(Mensaje.ToString, TipoMensaje.MsgInformacion)

View File

@@ -2965,7 +2965,7 @@ Partial Class Clientes
'HLRemision.HRef = $"/Ventas/Ventas.aspx?CveRemision={e.Row.DBCampo("CveVenta")}" 'HLRemision.HRef = $"/Ventas/Ventas.aspx?CveRemision={e.Row.DBCampo("CveVenta")}"
Dim Liga As String = String.Format("< a class=""Texto"" href=""/Ventas/Ventas.aspx?CveVenta={0}"">", e.Row.DBCampo("CveVenta")) Dim Liga As String = String.Format("< a class=""Texto"" href=""/Ventas/Ventas.aspx?CveVenta={0}"">", e.Row.DBCampo("CveVenta"))
HLSendMail.HRef = String.Format("javascript:(function mail(){{$get('HdnTipoDocto').value='{0}';$get('HdnCveVenta').value='{1}';$get('HdnFolioVenta').value='{2}';$get('TxtParaMail').value='{3}';$get('HdnSerieFolio').value='{4}';$get('HdnSubProyecto').value='{5}';$('#ModalDivMail').modal();return false;}})();", e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("CveVenta"), e.Row.DBCampo("folio"), e.Row.DBCampo("Correo"), e.Row.DBCampo("SerieFolio"), e.Row.DBCampo("SubProyecto")) HLSendMail.HRef = String.Format("javascript:(function mail(){{$get('HdnTipoDocto').value='{0}';$get('HdnCveVenta').value='{1}';$get('HdnFolioVenta').value='{2}';$get('TxtParaMail').value='{3}';$get('HdnSerieFolio').value='{4}';$get('HdnSubProyecto').value='{5}';$('#ModalDivMail').modal();void(0);}})();", e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("CveVenta"), e.Row.DBCampo("folio"), e.Row.DBCampo("Correo"), e.Row.DBCampo("SerieFolio"), e.Row.DBCampo("SubProyecto"))
e.Row.FCLiteral("LtlFactura").Text = String.Format("<a class=""Texto"" href=""/Ventas/Ventas.aspx?CveVenta={0}"">{1}</a>", e.Row.DBCampo("CveVenta"), e.Row.DBCampo("Folio")) e.Row.FCLiteral("LtlFactura").Text = String.Format("<a class=""Texto"" href=""/Ventas/Ventas.aspx?CveVenta={0}"">{1}</a>", e.Row.DBCampo("CveVenta"), e.Row.DBCampo("Folio"))
UpSendMail.Update() UpSendMail.Update()

View File

@@ -962,6 +962,9 @@ Partial Class ProductosyServicios
' DdlPSAdicional.SelectedText = "Seleccione" ' DdlPSAdicional.SelectedText = "Seleccione"
'End If 'End If
DdlEmpacado.SelectedValueExist(ObjProductosServicios.DtResultados.Rows(0)("CveTipoEmpacado").ToString)
DdlTipoOrganico.SelectedValueExist(ObjProductosServicios.DtResultados.Rows(0)("CveTipoOrganico").ToString)
Try Try
DdlClasificacion_SelectedIndexChanged(DdlClasificacion, Nothing) DdlClasificacion_SelectedIndexChanged(DdlClasificacion, Nothing)
@@ -1450,6 +1453,7 @@ Partial Class ProductosyServicios
CveTipoFactor:=DdlTipoFactor.SelectedValue.ToEntero, CveFraccionArancelaria:=DdlFraccionArancelaria.SelectedValue.ToEntero, CveTipoFactor:=DdlTipoFactor.SelectedValue.ToEntero, CveFraccionArancelaria:=DdlFraccionArancelaria.SelectedValue.ToEntero,
CveClasificacionDetalle:=DdlTipoPSDes.SelectedValue.ToEntero, CveTamaño:=CveTamaño, CveClasificacionDetalle:=DdlTipoPSDes.SelectedValue.ToEntero, CveTamaño:=CveTamaño,
CveModelo:=DdlModelo.SelectedValue.ToEntero(), CveMedida:=DdlMedida.SelectedValue.ToEntero(), CveRinTamaño:=DdlRin.SelectedValue.ToEntero(), CveModelo:=DdlModelo.SelectedValue.ToEntero(), CveMedida:=DdlMedida.SelectedValue.ToEntero(), CveRinTamaño:=DdlRin.SelectedValue.ToEntero(),
CveTipoEmpacado:=DdlEmpacado.SelectedValue.ToEntero(), CveTipoOrganico:=DdlTipoOrganico.SelectedValue.ToEntero(),
ClaveImpuestoEmpaque:=DdlImpEmpaque.SelectedValue.ToString, ClaveImpuestoUM:=DdlImpUM.SelectedValue.ToString, ClaveCategoriaToxicidad:=DdlCategoriaToxicidad.SelectedValue.ToString, ClaveImpuestoEmpaque:=DdlImpEmpaque.SelectedValue.ToString, ClaveImpuestoUM:=DdlImpUM.SelectedValue.ToString, ClaveCategoriaToxicidad:=DdlCategoriaToxicidad.SelectedValue.ToString,
ClaveImpuestoTipoProducto:=DdlImpTipoProducto.SelectedValue.ToString, EsOutSourcing:=ChkEsOutSourcing.Checked, TiempoCaducidad:=TiempoCaducidad, CvePSAdicionalVigencia:=DdlPSAdicionalVigencia.SelectedValue.ToEntero(), PrecioLibre:=ChkPrecioLibre.Checked, ClaveImpuestoTipoProducto:=DdlImpTipoProducto.SelectedValue.ToString, EsOutSourcing:=ChkEsOutSourcing.Checked, TiempoCaducidad:=TiempoCaducidad, CvePSAdicionalVigencia:=DdlPSAdicionalVigencia.SelectedValue.ToEntero(), PrecioLibre:=ChkPrecioLibre.Checked,
CveMaterialPeligroso:=DdlMaterialPeligroso.SelectedValue.ToEntero, CveEmbalaje:=DdlEmbalaje.SelectedValue.ToEntero, PesoKg:=TxtPesoKg.Text.ToDecimal, Dimensiones:=TxtDimensiones.Text.Trim, CveMaterialPeligroso:=DdlMaterialPeligroso.SelectedValue.ToEntero, CveEmbalaje:=DdlEmbalaje.SelectedValue.ToEntero, PesoKg:=TxtPesoKg.Text.ToDecimal, Dimensiones:=TxtDimensiones.Text.Trim,
@@ -1500,6 +1504,7 @@ Partial Class ProductosyServicios
CveTipoFactor:=DdlTipoFactor.SelectedValue.ToEntero, CveFraccionArancelaria:=DdlFraccionArancelaria.SelectedValue.ToEntero, CveTipoFactor:=DdlTipoFactor.SelectedValue.ToEntero, CveFraccionArancelaria:=DdlFraccionArancelaria.SelectedValue.ToEntero,
CveUsuarioModifico:=UsuarioActual.CveUsuario, CveClasificacionDetalle:=DdlTipoPSDes.SelectedValue.ToEntero, CveTamaño:=CveTamaño, CveUsuarioModifico:=UsuarioActual.CveUsuario, CveClasificacionDetalle:=DdlTipoPSDes.SelectedValue.ToEntero, CveTamaño:=CveTamaño,
CveModelo:=DdlModelo.SelectedValue.ToEntero(), CveMedida:=DdlMedida.SelectedValue.ToEntero(), CveRinTamaño:=DdlRin.SelectedValue.ToEntero(), CveModelo:=DdlModelo.SelectedValue.ToEntero(), CveMedida:=DdlMedida.SelectedValue.ToEntero(), CveRinTamaño:=DdlRin.SelectedValue.ToEntero(),
CveTipoEmpacado:=DdlEmpacado.SelectedValue.ToEntero(), CveTipoOrganico:=DdlTipoOrganico.SelectedValue.ToEntero(),
ClaveImpuestoEmpaque:=DdlImpEmpaque.SelectedValue.ToString, ClaveImpuestoUM:=DdlImpUM.SelectedValue.ToString, ClaveCategoriaToxicidad:=DdlCategoriaToxicidad.SelectedValue.ToString, ClaveImpuestoEmpaque:=DdlImpEmpaque.SelectedValue.ToString, ClaveImpuestoUM:=DdlImpUM.SelectedValue.ToString, ClaveCategoriaToxicidad:=DdlCategoriaToxicidad.SelectedValue.ToString,
ClaveImpuestoTipoProducto:=DdlImpTipoProducto.SelectedValue.ToString, EsOutSourcing:=ChkEsOutSourcing.Checked, ClaveImpuestoTipoProducto:=DdlImpTipoProducto.SelectedValue.ToString, EsOutSourcing:=ChkEsOutSourcing.Checked,
AplicaSerie:=ChkSerie.Checked, AplicaLote:=ChkLote.Checked, AplicaCaducidad:=ChkCaducidad.Checked, AplicaSeccion:=ChkSeccion.Checked, TiempoCaducidad:=TiempoCaducidad, CvePSAdicionalVigencia:=DdlPSAdicionalVigencia.SelectedValue.ToEntero(), PrecioLibre:=ChkPrecioLibre.Checked, AplicaSerie:=ChkSerie.Checked, AplicaLote:=ChkLote.Checked, AplicaCaducidad:=ChkCaducidad.Checked, AplicaSeccion:=ChkSeccion.Checked, TiempoCaducidad:=TiempoCaducidad, CvePSAdicionalVigencia:=DdlPSAdicionalVigencia.SelectedValue.ToEntero(), PrecioLibre:=ChkPrecioLibre.Checked,

View File

@@ -73,8 +73,6 @@ Partial Class Ventas_RepVentasResumen
CargaCombos() CargaCombos()
CargaDatos() CargaDatos()
GraficaPastel()
GraficaBarras()
End If End If
End Sub End Sub
@@ -142,19 +140,16 @@ Partial Class Ventas_RepVentasResumen
Datos = Nothing Datos = Nothing
End If End If
ObjVentas.Dispose()
ObjMovtos.Dispose()
GvVxP.DataBind() GvVxP.DataBind()
GvVxC.DataBind() GvVxC.DataBind()
GvPxC.DataBind() GvPxC.DataBind()
GvCxC.DataBind() GvCxC.DataBind()
ObjVentas.Dispose() GraficaPastel()
ObjMovtos.Dispose() GraficaBarras()
GvVxP.Dispose()
GvVxC.Dispose()
GvPxC.Dispose()
GvCxC.Dispose()
End Sub End Sub
Protected Sub GvVxP_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvVxP.RowDataBound Protected Sub GvVxP_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvVxP.RowDataBound

View File

@@ -404,7 +404,8 @@
<div class="caption font-green"> <div class="caption font-green">
<i class="icon-pin font-green"></i> <i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase"><a id="HlCliente" href="javascript:void(0);" runat="server" class="Texto" onclick="javascript:AbrirVentana('/Ventas/PopUpBuscarClientes.aspx?Opt=Fact', 800, 547, 'N', 'PopUpBuscar')">Cliente: </a></span> <span class="caption-subject bold uppercase"><a id="HlCliente" href="javascript:void(0);" runat="server" class="Texto" onclick="javascript:AbrirVentana('/Ventas/PopUpBuscarClientes.aspx?Opt=Fact', 800, 547, 'N', 'PopUpBuscar')">
<asp:Label runat="server" id="LblTituloPorletCliente" Text ="Cliente:"> </asp:Label></a></span>
<asp:LinkButton ID="LnkAgregarCliente" runat="server" AlternateText="Agregar Cliente" Text="<i class='fa fa-plus-square'></i>" /> <asp:LinkButton ID="LnkAgregarCliente" runat="server" AlternateText="Agregar Cliente" Text="<i class='fa fa-plus-square'></i>" />
<asp:TextBox ID="TxtCodigo" runat="server" AutoPostBack="true" BorderStyle="None" Width="65px"></asp:TextBox> <asp:TextBox ID="TxtCodigo" runat="server" AutoPostBack="true" BorderStyle="None" Width="65px"></asp:TextBox>
<asp:HiddenField ID="HdnCveCliente" runat="server" ClientIDMode="Static" Value="-1" /> <asp:HiddenField ID="HdnCveCliente" runat="server" ClientIDMode="Static" Value="-1" />
@@ -424,20 +425,15 @@
<div class="form-body"> <div class="form-body">
<table border="0" width="463px"> <table border="0" width="463px">
<tr align="left">
<tr align="left" runat="server" id="trNombreCliente">
<td width="95px"><b>Nombre:</b>&nbsp;</td> <td width="95px"><b>Nombre:</b>&nbsp;</td>
<td width="200px"> <td width="200px">
<asp:Label ID="LblCliente" runat="server" Text="Cliente"></asp:Label></td> <asp:Label ID="LblCliente" runat="server" Text="Cliente"></asp:Label></td>
<td width="85px" runat="server" id="LblEnviarMail"><b>Enviar Mail:</b></td> <td width="85px" runat="server" id="LblEnviarMail"><b>Enviar Mail:</b></td>
<td width="135px"> <td width="135px">
<asp:CheckBox ID="ChkEnviarFactura" runat="server" /></td> <asp:CheckBox ID="ChkEnviarFactura" runat="server" /></td>
</tr> </tr>
<%-- <tr runat="server" id="trFacturacionSucursal" visible="false">
<td><b>Facturar Sucursal :</b></td>
<td>
<asp:CheckBox ID="ChkFacturarSucursal" runat="server" OnCheckedChanged="ChkFacturarSucursal_CheckedChanged" />
</td>
</tr>--%>
<tr runat="server" id="trsucursalciente" visible="false"> <tr runat="server" id="trsucursalciente" visible="false">
<td align="left"><b> <td align="left"><b>
<asp:Label ID="LblSucursal" runat="server" Text="Sucursal"></asp:Label> <asp:Label ID="LblSucursal" runat="server" Text="Sucursal"></asp:Label>
@@ -510,6 +506,26 @@
</table> </table>
</td> </td>
</tr> </tr>
<%--CRM--%>
<tr align="left" runat="server" id="trCRM1" visible="false">
<td width="95px"><b>Empresa:</b>&nbsp;</td>
<td width="200px">
<asp:Label ID="LblEmpresaCRM" runat="server" Text="Cliente"></asp:Label></td>
</tr>
<tr align="left" runat="server" id="trCRM2" visible="false" >
<td><b>RFC:</b>&nbsp;</td>
<td>
<asp:Label ID="LblRFCCRM" runat="server" Text="AAA010101AAA"></asp:Label></td>
</tr>
<tr align="left" runat="server" id="trCRM3" visible="false" >
<td><b>Medio de Captación::</b>&nbsp;</td>
<td>
<asp:Label ID="LblMedioCaptacionCRM" runat="server" Text=""></asp:Label></td>
</tr>
<%--CRM--%>
<tr runat="server" id="TrAtencionA" visible="false"> <tr runat="server" id="TrAtencionA" visible="false">
<td><b>Atención A:</b></td> <td><b>Atención A:</b></td>
<td> <td>
@@ -536,16 +552,20 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
</div> </div>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
<asp:UpdatePanel ID="UpEmpresaCRM" runat="server" Visible="false" UpdateMode="Conditional" class="portlet light xspadding bordered whitoutcol" style="width: 473px;"> <%-- <asp:UpdatePanel ID="UpEmpresaCRM" runat="server" Visible="false" UpdateMode="Conditional" class="portlet light xspadding bordered whitoutcol" style="width: 473px;">
<ContentTemplate> <ContentTemplate>
<div class="portlet-title"> <div class="portlet-title">
<div class="caption font-green"> <div class="caption font-green" >
<i class="icon-pin font-green"></i> <i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">EMPRESA CRM </span> <span class="caption-subject bold uppercase">EMPRESA CRM </span>
</div> </div>
@@ -557,26 +577,15 @@
<div class="form-body"> <div class="form-body">
<table border="0" width="463px"> <table border="0" width="463px">
<tr align="left">
<td width="95px"><b>Empresa:</b>&nbsp;</td>
<td width="200px">
<asp:Label ID="LblEmpresaCRM" runat="server" Text="Cliente"></asp:Label></td>
</tr>
<tr align="left">
<td><b>RFC:</b>&nbsp;</td>
<td>
<asp:Label ID="LblRFCCRM" runat="server" Text="AAA010101AAA"></asp:Label></td>
</tr>
<tr align="left">
<td><b>Medio de Captación::</b>&nbsp;</td>
<td>
<asp:Label ID="LblMedioCaptacionCRM" runat="server" Text=""></asp:Label></td>
</tr>
</table> </table>
</div> </div>
</div> </div>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>--%>
<asp:UpdatePanel ID="UpParametros" runat="server" UpdateMode="Conditional" class="portlet light xspadding .nolineheight bordered whitoutcol" style="width: 310px;"> <asp:UpdatePanel ID="UpParametros" runat="server" UpdateMode="Conditional" class="portlet light xspadding .nolineheight bordered whitoutcol" style="width: 310px;">
<ContentTemplate> <ContentTemplate>
@@ -1406,6 +1415,29 @@
</div> </div>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<table id="TbDescuentosAdicionales" border="0" rules="none" class="well TextTab" style="float: right;" runat="server" visible="false">
<tr align="right">
<td style="border: 1px none white"><b>Descuento Adicional Por Pago:</b></td>
<td>
<asp:Label ID="LblDescuentoAdicional" ClientIDMode="Static" runat="server" Style="text-align: right;" Text="0.00" Width="78px"></asp:Label></td>
<td align="right">&nbsp;
</td>
</tr>
<tr align="right">
<td style="border: 1px none white"><b>Total Original:</b></td>
<td>
<asp:Label ID="LblTotalOriginal" ClientIDMode="Static" runat="server" Style="text-align: right;" Text="0.00" Width="78px"></asp:Label></td>
<td align="right">&nbsp;
</td>
</tr>
<tr align="right">
<td style="border: 1px none white"><b>Total a Pagar:</b></td>
<td>
<asp:Label ID="LblTotalAPagarAdicional" ClientIDMode="Static" runat="server" Style="text-align: right;" Text="0.00" Width="78px"></asp:Label></td>
<td align="right">&nbsp;
</td>
</tr>
</table>
<table id="TbDescuentosRNC" border="0" rules="none" class="well TextTab" style="float: right;" runat="server" visible="false"> <table id="TbDescuentosRNC" border="0" rules="none" class="well TextTab" style="float: right;" runat="server" visible="false">
<tr align="right"> <tr align="right">
<td style="border: 1px none white"><b>Descuentos RNC:</b></td> <td style="border: 1px none white"><b>Descuentos RNC:</b></td>
@@ -2449,127 +2481,127 @@
</div> </div>
<div class="portlet-body"> <div class="portlet-body">
<div class="rowpadding"> <div class="rowpadding">
<asp:UpdatePanel ID="UpComercioExterior" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<label class="col-md-2 form-group form-md-line-input">Tipo Operación:</label>
<div class="col-md-4 form-group form-md-line-input">
<asp:Label ID="LblTipoOperacion" runat="server"></asp:Label>
</div>
<label class="col-md-2 form-group form-md-line-input">Clave Pedimento:</label>
<div class="col-md-4 form-group form-md-line-input">
<asp:Label ID="LblClavePedimento" runat="server"></asp:Label>
</div>
</div>
<div class="row">
<div class="col-md-2 form-group form-md-line-input col-md-offset-3">
<label >Incoterm:</label>
</div>
<div class="col-md-4 form-group form-md-line-input col-md-offset-3">
<asp:DropDownList ID="DdlIncoterm" CssClass="form-control select2me" AppendDataBoundItems="true" Width="100%" runat="server" DataTextField="ClaveSATIncotermDescripcion" DataValueField="CveIncoterm">
</asp:DropDownList>
</div>
</div>
<div class="row">
<label class="col-md-2 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">Motivo Traslado:</label>
<div class="col-md-4 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:DropDownList ID="DdlSATMotivoTraslado" Width="100%" runat="server" CssClass="select2me" DataTextField="ClaveSATMotivoTrasladoDescripcion" DataValueField="CveMotivoTraslado"></asp:DropDownList>
</div>
<label class="col-md-2 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">Num Reg IdTrib:</label>
<div class="col-md-4 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:TextBox ID="TxtNumRegIdTrib" CssClass="form-control input-sm" runat="server" Width="100%"></asp:TextBox>
</div>
</div>
<div class="row">
<div class="col-md-12">
<asp:UpdatePanel ID="UPPDestina" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-md-2 form-group form-md-line-input"><span>Nombre:</span></div>
<div class="col-md-4 form-group form-md-line-input">
<asp:TextBox ID="TxtDestinatarioNombre" CssClass="form-control input-sm" runat="server" Width="100%"></asp:TextBox>
</div>
</div>
<div class="row">
<div class="col-md-2 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;"><span>Calle:</span></div>
<div class="col-md-4 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:TextBox ID="TxtComExtCalle" CssClass="form-control input-sm" runat="server" Width="100%"></asp:TextBox>
</div>
<div class="col-md-1 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;"><span>Núm.</span></div>
<div class="col-md-2 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:TextBox ID="TxtComExtNumero" CssClass="form-control input-sm" runat="server" Width="55px"></asp:TextBox>
</div>
<div class="col-md-1 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;"><span>CP.</span></div>
<div class="col-md-2 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:TextBox ID="TxtComExtCP" CssClass="form-control input-sm" runat="server" Width="65px"></asp:TextBox>
</div>
</div>
<div class="row">
<div class="col-md-2 form-group form-md-line-input"><span>Pais:</span></div>
<div class="col-md-4 form-group form-md-line-input">
<asp:DropDownList ID="DdlComExtPais" AutoPostBack="true" OnSelectedIndexChanged="DdlPais_SelectedIndexChanged" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" runat="server" DataTextField="ClaveSATPaisDescripcion" DataValueField="CvePais"></asp:DropDownList>
<asp:TextBox ID="TxtComExtPais" CssClass="form-control input-sm" runat="server" Width="100%" Visible="false"></asp:TextBox>
</div>
<div class="col-md-2 form-group form-md-line-input"><span>Estado:</span></div>
<div class="col-md-4 form-group form-md-line-input">
<asp:DropDownList ID="DdlComExtEstado" AutoPostBack="true" OnSelectedIndexChanged="DdlEstado_SelectedIndexChanged" Visible="false" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" runat="server" DataTextField="ClaveSATEstadoNombreEstado" DataValueField="CveEstado"></asp:DropDownList>
<asp:TextBox ID="TxtComExtEstado" CssClass="form-control input-sm" runat="server" Width="100%" Visible="false"></asp:TextBox>
</div>
</div>
<div class="row">
<div class="col-md-2 form-group form-md-line-input"><span>Municipio:</span></div>
<div class="col-md-4 form-group form-md-line-input">
<asp:DropDownList ID="DdlComExtMunicipio" AutoPostBack="true" OnSelectedIndexChanged="DdlMunicipio_SelectedIndexChanged" Visible="false" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" runat="server" DataTextField="ClaveSATMunicipioDescripcion" DataValueField="CveMunicipio"></asp:DropDownList>
<asp:TextBox ID="TxtComExtMunicipio" CssClass="form-control input-sm" runat="server" Width="100%" Visible="false"></asp:TextBox>
</div>
<div class="col-md-2 form-group form-md-line-input"><span>Colonia:</span></div>
<div class="col-md-4 form-group form-md-line-input">
<asp:DropDownList ID="DdlComExtColonia" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" Visible="false" runat="server" DataTextField="ClaveSATColoniaNombreAsentamiento" DataValueField="CveColonia"></asp:DropDownList>
<asp:TextBox ID="TxtComExtColonia" CssClass="form-control input-sm" runat="server" Width="100%" Visible="false"></asp:TextBox>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpComercioExterior" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<label class="col-md-2 form-group form-md-line-input">Tipo Operación:</label>
<div class="col-md-4 form-group form-md-line-input">
<asp:Label ID="LblTipoOperacion" runat="server"></asp:Label>
</div>
<label class="col-md-2 form-group form-md-line-input">Clave Pedimento:</label>
<div class="col-md-4 form-group form-md-line-input">
<asp:Label ID="LblClavePedimento" runat="server"></asp:Label>
</div>
</div> </div>
</div> <div class="row">
<div class="row"> <div class="col-md-2 form-group form-md-line-input col-md-offset-3">
<div class="col-md-12"> <label>Incoterm:</label>
Convertir a unidad Aduana </div>
<div class="col-md-4 form-group form-md-line-input col-md-offset-3">
<asp:DropDownList ID="DdlIncoterm" CssClass="form-control select2me" AppendDataBoundItems="true" Width="100%" runat="server" DataTextField="ClaveSATIncotermDescripcion" DataValueField="CveIncoterm">
</asp:DropDownList>
</div>
</div>
<div class="row">
<%-- <label class="col-md-2 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">Motivo Traslado:</label>
<div class="col-md-4 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:DropDownList ID="DdlSATMotivoTraslado" Width="100%" runat="server" CssClass="select2me" DataTextField="ClaveSATMotivoTrasladoDescripcion" DataValueField="CveMotivoTraslado"></asp:DropDownList>
</div>--%>
<label class="col-md-2 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">Num Reg IdTrib:</label>
<div class="col-md-4 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:TextBox ID="TxtNumRegIdTrib" CssClass="form-control input-sm" runat="server" Width="100%"></asp:TextBox>
</div>
</div>
<div class="row">
<div class="col-md-12">
<asp:UpdatePanel ID="UPPDestina" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-md-2 form-group form-md-line-input"><span>Nombre:</span></div>
<div class="col-md-4 form-group form-md-line-input">
<asp:TextBox ID="TxtDestinatarioNombre" CssClass="form-control input-sm" runat="server" Width="100%"></asp:TextBox>
</div>
</div>
<div class="row">
<div class="col-md-2 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;"><span>Calle:</span></div>
<div class="col-md-4 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:TextBox ID="TxtComExtCalle" CssClass="form-control input-sm" runat="server" Width="100%"></asp:TextBox>
</div>
<div class="col-md-1 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;"><span>Núm.</span></div>
<div class="col-md-2 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:TextBox ID="TxtComExtNumero" CssClass="form-control input-sm" runat="server" Width="55px"></asp:TextBox>
</div>
<div class="col-md-1 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;"><span>CP.</span></div>
<div class="col-md-2 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:TextBox ID="TxtComExtCP" CssClass="form-control input-sm" runat="server" Width="65px"></asp:TextBox>
</div>
</div>
<div class="row">
<div class="col-md-2 form-group form-md-line-input"><span>Pais:</span></div>
<div class="col-md-4 form-group form-md-line-input">
<asp:DropDownList ID="DdlComExtPais" AutoPostBack="true" OnSelectedIndexChanged="DdlPais_SelectedIndexChanged" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" runat="server" DataTextField="ClaveSATPaisDescripcion" DataValueField="CvePais"></asp:DropDownList>
<asp:TextBox ID="TxtComExtPais" CssClass="form-control input-sm" runat="server" Width="100%" Visible="false"></asp:TextBox>
</div>
<div class="col-md-2 form-group form-md-line-input"><span>Estado:</span></div>
<div class="col-md-4 form-group form-md-line-input">
<asp:DropDownList ID="DdlComExtEstado" AutoPostBack="true" OnSelectedIndexChanged="DdlEstado_SelectedIndexChanged" Visible="false" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" runat="server" DataTextField="ClaveSATEstadoNombreEstado" DataValueField="CveEstado"></asp:DropDownList>
<asp:TextBox ID="TxtComExtEstado" CssClass="form-control input-sm" runat="server" Width="100%" Visible="false"></asp:TextBox>
</div>
</div>
<div class="row">
<div class="col-md-2 form-group form-md-line-input"><span>Municipio:</span></div>
<div class="col-md-4 form-group form-md-line-input">
<asp:DropDownList ID="DdlComExtMunicipio" AutoPostBack="true" OnSelectedIndexChanged="DdlMunicipio_SelectedIndexChanged" Visible="false" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" runat="server" DataTextField="ClaveSATMunicipioDescripcion" DataValueField="CveMunicipio"></asp:DropDownList>
<asp:TextBox ID="TxtComExtMunicipio" CssClass="form-control input-sm" runat="server" Width="100%" Visible="false"></asp:TextBox>
</div>
<div class="col-md-2 form-group form-md-line-input"><span>Colonia:</span></div>
<div class="col-md-4 form-group form-md-line-input">
<asp:DropDownList ID="DdlComExtColonia" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" Visible="false" runat="server" DataTextField="ClaveSATColoniaNombreAsentamiento" DataValueField="CveColonia"></asp:DropDownList>
<asp:TextBox ID="TxtComExtColonia" CssClass="form-control input-sm" runat="server" Width="100%" Visible="false"></asp:TextBox>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
<div class="row">
<div class="col-md-12">
Convertir a unidad Aduana
<asp:TextBox ID="TxtComExtConvertir" runat="server" Width="60px"></asp:TextBox><asp:Button ID="BtnComExtConvertirUnidad" runat="server" Text="Convertir" /> <asp:TextBox ID="TxtComExtConvertir" runat="server" Width="60px"></asp:TextBox><asp:Button ID="BtnComExtConvertirUnidad" runat="server" Text="Convertir" />
<asp:GridView ID="GvComercioExterior" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="100%" data-sort="true" AutoGenerateColumns="False" <asp:GridView ID="GvComercioExterior" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="100%" data-sort="true" AutoGenerateColumns="False"
EmptyDataText="No hay datos disponibles" DataKeyNames="Cantidad,Codigo,ClaveSATFraccionArancelaria,ClaveSATUnidadAduana" OnRowDataBound="GvComercioExterior_RowDataBound"> EmptyDataText="No hay datos disponibles" DataKeyNames="Cantidad,Codigo,ClaveSATFraccionArancelaria,ClaveSATUnidadAduana" OnRowDataBound="GvComercioExterior_RowDataBound">
<Columns> <Columns>
<asp:TemplateField HeaderText="Cantidad"> <asp:TemplateField HeaderText="Cantidad">
<ItemTemplate> <ItemTemplate>
<asp:TextBox ID="TxtCantidad" runat="server" Text='<%# Eval("Cantidad", "{0:#,##0.##}") %>' Width="50px"></asp:TextBox> <asp:TextBox ID="TxtCantidad" runat="server" Text='<%# Eval("Cantidad", "{0:#,##0.##}") %>' Width="50px"></asp:TextBox>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:BoundField DataField="CodigoPS" HeaderText="Producto ó Servicio" /> <asp:BoundField DataField="CodigoPS" HeaderText="Producto ó Servicio" />
<asp:TemplateField HeaderText="Valor Unitario"> <asp:TemplateField HeaderText="Valor Unitario">
<ItemTemplate> <ItemTemplate>
<asp:TextBox ID="TxtValorUnitario" runat="server" Text='<%# Eval("PU", "{0:N2}") %>' Width="60px"></asp:TextBox> <asp:TextBox ID="TxtValorUnitario" runat="server" Text='<%# Eval("PU", "{0:N2}") %>' Width="60px"></asp:TextBox>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:BoundField DataField="ClaveSATFraccionArancelariaDescripcion" HeaderText="Fracción Arancelaria" /> <asp:BoundField DataField="ClaveSATFraccionArancelariaDescripcion" HeaderText="Fracción Arancelaria" />
<asp:BoundField DataField="ClaveSATUnidadAduanaDescripcion" HeaderText="Unidad Aduana" /> <asp:BoundField DataField="ClaveSATUnidadAduanaDescripcion" HeaderText="Unidad Aduana" />
<asp:TemplateField HeaderText="Total USD"> <asp:TemplateField HeaderText="Total USD">
<ItemTemplate> <ItemTemplate>
<asp:Label ID="LblTotalUSD" Text='<%# (CDbl(Eval("Cantidad").ToString) * CDbl(Eval("PU").ToString)).ToString("N2") %>' runat="server"></asp:Label> <asp:Label ID="LblTotalUSD" Text='<%# (CDbl(Eval("Cantidad").ToString) * CDbl(Eval("PU").ToString)).ToString("N2") %>' runat="server"></asp:Label>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Marca"> <asp:TemplateField HeaderText="Marca">
<ItemTemplate> <ItemTemplate>
<asp:TextBox ID="TxtMarca" runat="server" Text="" Width="70px"></asp:TextBox> <asp:TextBox ID="TxtMarca" runat="server" Text="" Width="70px"></asp:TextBox>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
</Columns> </Columns>
</asp:GridView> </asp:GridView>
</div>
</div> </div>
</div> </ContentTemplate>
</ContentTemplate> </asp:UpdatePanel>
</asp:UpdatePanel>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -2407,7 +2407,7 @@ Partial Class Ventas
UpFacturar.Update() UpFacturar.Update()
'CargaTiposDocumentos() 'CargaTiposDocumentos()
TrEmitir.Visible = False TrEmitir.Visible = False
If UsuarioActual.CveRol = 1 OrElse UsuarioActual.CveEmpresa.Contiene(13, 83) Then If UsuarioActual.CveRol = 1 OrElse UsuarioActual.CveEmpresa.Contiene(13, 83, 172, 173) Then
DivCartaPorte.Visible = True DivCartaPorte.Visible = True
End If End If
ViewState("EstablecioFolio") = False ViewState("EstablecioFolio") = False
@@ -2512,7 +2512,13 @@ Partial Class Ventas
TrObsAlmacen.Visible = False TrObsAlmacen.Visible = False
TrTxtObsAlmacen.Visible = False TrTxtObsAlmacen.Visible = False
TrPedido.Visible = False TrPedido.Visible = False
TrOC.Visible = False TrOC.Visible = False
DdlTipoComprobante.SelectedValue = "Op" DdlTipoComprobante.SelectedValue = "Op"
Else Else
Opcion = "Ing" Opcion = "Ing"
@@ -5993,6 +5999,21 @@ Partial Class Ventas
DdlFormaCliente.DataBind() DdlFormaCliente.DataBind()
DdlMetodoCliente.DataSource = GlobalDTVtaMetodoPago DdlMetodoCliente.DataSource = GlobalDTVtaMetodoPago
DdlMetodoCliente.DataBind() DdlMetodoCliente.DataBind()
If CveMetodoPago = 1 AndAlso DdlTipoComprobante.SelectedValue = "Cot" AndAlso UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso TbDescuentosAdicionales.Visible Then
If TmpDT.SUMD("Descuento") > 0 Then
Dim TotalDescuento As Decimal = TmpDT.SUMD("Total", "Descuento > 0") * 0.05D
Dim RowDescuentos = TmpDT.Select("Descuento > 0")
If RowDescuentos IsNot Nothing Then
LblDescuentoAdicional.Text = TotalDescuento.FormatoNumero(2)
CalculaTotalesVenta()
End If
Else
LblDescuentoAdicional.Text = "0.00"
End If
UpPS.Update()
End If
'End If 'End If
End Sub End Sub
Private Sub CargaUsoCFDI() Private Sub CargaUsoCFDI()
@@ -6149,6 +6170,8 @@ Partial Class Ventas
If CveSubProyecto > 0 Then DdlSubProyecto.SelectedValueExist(CveSubProyecto) If CveSubProyecto > 0 Then DdlSubProyecto.SelectedValueExist(CveSubProyecto)
End Sub End Sub
Private Sub CargaEmpresaCRM(CveEmpresaCRM As Integer) Private Sub CargaEmpresaCRM(CveEmpresaCRM As Integer)
Dim ObjCRM As New ClsCRM Dim ObjCRM As New ClsCRM
If ObjCRM.GetEmpresasCRM(UsuarioActual.CveEmpresa, CveEmpresaCRM) Then If ObjCRM.GetEmpresasCRM(UsuarioActual.CveEmpresa, CveEmpresaCRM) Then
@@ -6165,7 +6188,8 @@ Partial Class Ventas
TxtCodigo.ReadOnly = True TxtCodigo.ReadOnly = True
UpCliente.Visible = True UpCliente.Visible = True
UpEmpresaCRM.Visible = False
'UpEmpresaCRM.Visible = False
Else Else
LblEmpresaCRM.Text = ObjCRM.DtResultados.Rows(0)("Empresa").ToString() LblEmpresaCRM.Text = ObjCRM.DtResultados.Rows(0)("Empresa").ToString()
LblRFCCRM.Text = ObjCRM.DtResultados.Rows(0)("RFC").ToString() LblRFCCRM.Text = ObjCRM.DtResultados.Rows(0)("RFC").ToString()
@@ -6175,8 +6199,28 @@ Partial Class Ventas
LblEnviarMail.Visible = False LblEnviarMail.Visible = False
UPCondicionesPago.Visible = True UPCondicionesPago.Visible = True
UpCliente.Visible = False 'UpCliente.Visible = False
UpEmpresaCRM.Visible = True 'UpEmpresaCRM.Visible = True
trNombreCliente.Visible = False
trsucursalciente.Visible = False
TrDireccion.Visible = False
TrCiudad.Visible = False
TrRFC.Visible = False
TrOP.Visible = False
trDireccionEnvio.Visible = False
TrAtencionA.Visible = True
trCRM1.Visible = True
trCRM2.Visible = True
trCRM3.Visible = True
LblTituloPorletCliente.Text = "EMPRESA CRM"
tdTelefonoGen.Visible = False
tdTxtTelefonoGen.Visible = False
End If End If
Me.CveVendedorEmpresaCRM = ObjCRM.DtResultados.Rows(0)("CveVendedorAsignado").ToString().ToEntero() Me.CveVendedorEmpresaCRM = ObjCRM.DtResultados.Rows(0)("CveVendedorAsignado").ToString().ToEntero()
@@ -6184,16 +6228,22 @@ Partial Class Ventas
DdlVendedor.SelectedValueExist(ObjCRM.DtResultados.Rows(0)("CveVendedorAsignado").ToString()) DdlVendedor.SelectedValueExist(ObjCRM.DtResultados.Rows(0)("CveVendedorAsignado").ToString())
DdlVendedor.Enabled = False DdlVendedor.Enabled = False
LbAgregar.Enabled = True LbAgregar.Enabled = True
'TrAtencionA.Visible = True
TrOC.Visible = True
End If End If
ThTiempoEntrega.Visible = True ThTiempoEntrega.Visible = True
ThTiempoEntrega2.Visible = True ThTiempoEntrega2.Visible = True
GvPS.Columns(5).Visible = True GvPS.Columns(5).Visible = True
End If End If
ObjCRM.Dispose() ObjCRM.Dispose()
End Sub End Sub
Private Sub CargaCliente(CveCliente As Integer, Optional Estatus As Integer = -1) Private Sub CargaCliente(CveCliente As Integer, Optional Estatus As Integer = -1)
If CveCliente <= 0 Then Exit Sub If CveCliente <= 0 Then Exit Sub
@@ -6423,9 +6473,9 @@ Partial Class Ventas
End If End If
If ObjCliente.AplicaComercioExterior Then If ObjCliente.AplicaComercioExterior Then
DdlSATMotivoTraslado.DataSource = GlobalDTSATMotivoTraslado 'DdlSATMotivoTraslado.DataSource = GlobalDTSATMotivoTraslado
DdlSATMotivoTraslado.DataBind() 'DdlSATMotivoTraslado.DataBind()
DdlSATMotivoTraslado.SelectedValueExist(ObjCliente.CveMotivoTraslado) 'DdlSATMotivoTraslado.SelectedValueExist(ObjCliente.CveMotivoTraslado)
DdlIncoterm.Items.Clear() DdlIncoterm.Items.Clear()
DdlIncoterm.DataSource = GlobalDTIncoterm() DdlIncoterm.DataSource = GlobalDTIncoterm()
DdlIncoterm.DataBind() DdlIncoterm.DataBind()
@@ -7298,7 +7348,9 @@ Partial Class Ventas
LblEstado.Text = ObjCliente.DtResultados.Rows(0)("Estado").ToString() LblEstado.Text = ObjCliente.DtResultados.Rows(0)("Estado").ToString()
'TxtNumCtaPago.Text = ObjCliente.DtResultados.Rows(0)("NumCtaPago").ToString() 'TxtNumCtaPago.Text = ObjCliente.DtResultados.Rows(0)("NumCtaPago").ToString()
LblTelefono.Text = ObjCliente.DtResultados.Rows(0)("Telefono").ToString() LblTelefono.Text = ObjCliente.DtResultados.Rows(0)("Telefono").ToString()
LblCP.Text = ObjCliente.DtResultados.Rows(0)("CP").ToString() If Not UsuarioActual.Empresa.Funcionalidad(350) = "1" Then
LblCP.Text = ObjCliente.DtResultados.Rows(0)("CP").ToString()
End If
ViewState("CliLocalidad") = ObjCliente.DtResultados.Rows(0)("Localidad").ToString() ViewState("CliLocalidad") = ObjCliente.DtResultados.Rows(0)("Localidad").ToString()
ViewState("CliPais") = ObjCliente.DtResultados.Rows(0)("Pais").ToString() ViewState("CliPais") = ObjCliente.DtResultados.Rows(0)("Pais").ToString()
ViewState("CliNoExt") = ObjCliente.DtResultados.Rows(0)("NoExt").ToString() ViewState("CliNoExt") = ObjCliente.DtResultados.Rows(0)("NoExt").ToString()
@@ -8557,7 +8609,6 @@ Partial Class Ventas
#End Region #End Region
#Region " EMITIR IMPRIMIR - GUARDAR " #Region " EMITIR IMPRIMIR - GUARDAR "
Protected Sub BtnEmitirImprimir_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnEmitirImprimir.Click Protected Sub BtnEmitirImprimir_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnEmitirImprimir.Click
Try Try
EmitirImprimir() EmitirImprimir()
@@ -9184,11 +9235,12 @@ Partial Class Ventas
Dim ArchivoSti As New System.IO.FileInfo(String.Format("{0}Formatos/Factura.mrt", UsuarioActual.Empresa.Ruta)) Dim ArchivoSti As New System.IO.FileInfo(String.Format("{0}Formatos/Factura.mrt", UsuarioActual.Empresa.Ruta))
Dim ArchivoSti2 As New System.IO.FileInfo(String.Format("{0}Formatos/Remision.mrt", UsuarioActual.Empresa.Ruta)) Dim ArchivoSti2 As New System.IO.FileInfo(String.Format("{0}Formatos/Remision.mrt", UsuarioActual.Empresa.Ruta))
Dim ArchivoSti3 As New System.IO.FileInfo(String.Format("{0}Formatos/Cotizacion.mrt", UsuarioActual.Empresa.Ruta))
LnkImprimir.Visible = False LnkImprimir.Visible = False
'If (UsuarioActual.CveEmpresa.Contiene(1, 4, 5, 7, 11, 12, 72, 80, 81, 83) And UsuarioActual.CveUsuario = 100) Or UsuarioActual.CveEmpresa.Contiene(80, 83) Or UsuarioActual.CveUsuario = 100 Then 'If (UsuarioActual.CveEmpresa.Contiene(1, 4, 5, 7, 11, 12, 72, 80, 81, 83) And UsuarioActual.CveUsuario = 100) Or UsuarioActual.CveEmpresa.Contiene(80, 83) Or UsuarioActual.CveUsuario = 100 Then
If (Archivo.Exists Or Archivo2.Exists Or ArchivoSti.Exists Or ArchivoSti2.Exists) And IfNull(CveVenta, 0).ToString().ToEntero() > 0 Then If (Archivo.Exists Or Archivo2.Exists Or ArchivoSti.Exists Or ArchivoSti2.Exists Or ArchivoSti3.Exists) And IfNull(CveVenta, 0).ToString().ToEntero() > 0 Then
HplDownPDF.Visible = True HplDownPDF.Visible = True
HplDownPDF.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", CveVenta))) HplDownPDF.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", CveVenta)))
If UsuarioActual.CveRol = 1 Then If UsuarioActual.CveRol = 1 Then
@@ -9218,10 +9270,8 @@ Partial Class Ventas
Exit Sub Exit Sub
End If End If
CreaObjetosVenta(TipoDoctoViejo:=TipoDoctoViejo)
'Verifica versión 3.3.() 'Verifica versión 3.3.()
If ObjFactura.Version = "3.3" AndAlso Not DdlTipoComprobante.SelectedValue.Contiene("Ped", "PeC") Then If (Not UsuarioActual.Empresa.Funcionalidad(350) = "1") AndAlso Not DdlTipoComprobante.SelectedValue.Contiene("Ped", "PeC") Then
Dim dttsat As DataTable = TmpDT.FiltraParametros("ISNULL(SATClaveProdServ,'') = '' OR ISNULL(SATClaveUM,'') = '' ") Dim dttsat As DataTable = TmpDT.FiltraParametros("ISNULL(SATClaveProdServ,'') = '' OR ISNULL(SATClaveUM,'') = '' ")
If dttsat IsNot Nothing AndAlso dttsat.Rows.Count > 0 Then If dttsat IsNot Nothing AndAlso dttsat.Rows.Count > 0 Then
Dim str As New StringBuilder Dim str As New StringBuilder
@@ -9253,6 +9303,40 @@ Partial Class Ventas
End If End If
End If End If
'CREA UNA COPIA DE SEGURIDAD PARA LOS DATOS DEL TMPDT
If TmpDTError Is Nothing OrElse TmpDTError.Rows.Count = 0 Then
TmpDTError = TmpDT.Copy()
End If
If UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso TbDescuentosAdicionales.Visible Then
If LblDescuentoAdicional.Text.ToDecimal() > 0 Then
Dim TotalDescuento As Decimal = LblDescuentoAdicional.Text.ToDecimal() / (1D + TmpDT.MAX("PorcentajeIVA").ToString().ToDecimal())
Dim RowDescuentos = TmpDT.Select("Descuento > 0")
If RowDescuentos IsNot Nothing Then
Dim Row As DataRow = RowDescuentos(0)
Row("Descuento") = Row("Descuento").ToString().ToDecimal() + TotalDescuento
Dim TotalCalculableImpuestos As Decimal = (Row("Cantidad").ToString().ToDecimal() * Row("PU").ToString().ToDecimal()) - Row("Descuento").ToString().ToDecimal()
Row("ImporteIVA") = (TotalCalculableImpuestos * Row("PorcentajeIVA").ToString().ToDecimal()).RoundSQL(2)
CalculaTotalesVenta(RecalcularTotalOriginal:=False)
'UpPS.Update()
'VALIDA EL CALCULO DE LOS DESCUENTOS
If (LblTotalOriginal.Text.ToDecimal() - LblDescuentoAdicional.Text.ToDecimal()) <> TxtTotal.Text.ToDecimal() Then
TmpDT = TmpDTError.Copy()
CalculaTotalesVenta(RecalcularTotalOriginal:=False)
Alert("Ocurrió un error al procesar los datos de la Venta. Los descuentos no coinciden con el importe final", TipoMensaje.MsgError)
Exit Sub
End If
End If
End If
End If
CreaObjetosVenta(TipoDoctoViejo:=TipoDoctoViejo)
If ObjFactura Is Nothing Or (ObjFactura.Cliente Is Nothing And Not CveEmpresaCRM > 0) Then If ObjFactura Is Nothing Or (ObjFactura.Cliente Is Nothing And Not CveEmpresaCRM > 0) Then
Alert("Ocurrió un error al procesar los datos de la Venta.", TipoMensaje.MsgError) Alert("Ocurrió un error al procesar los datos de la Venta.", TipoMensaje.MsgError)
ObjFactura = Nothing ObjFactura = Nothing
@@ -10138,6 +10222,7 @@ Partial Class Ventas
MensajeAlert = Nothing MensajeAlert = Nothing
If ObjContPaq IsNot Nothing Then ObjContPaq.Dispose() If ObjContPaq IsNot Nothing Then ObjContPaq.Dispose()
TmpDT = TmpDTError.Copy TmpDT = TmpDTError.Copy
CalculaTotalesVenta(RecalcularTotalOriginal:=False)
Else Else
ObjVentas.RollBack() ObjVentas.RollBack()
@@ -10161,7 +10246,7 @@ Partial Class Ventas
MensajeAlert = Nothing MensajeAlert = Nothing
If ObjContPaq IsNot Nothing Then ObjContPaq.Dispose() If ObjContPaq IsNot Nothing Then ObjContPaq.Dispose()
TmpDT = TmpDTError.Copy TmpDT = TmpDTError.Copy
CalculaTotalesVenta(RecalcularTotalOriginal:=False)
End If End If
ObjFactura = Nothing ObjFactura = Nothing
ListaNotasCreditoGeneradas = Nothing ListaNotasCreditoGeneradas = Nothing
@@ -12197,115 +12282,116 @@ Partial Class Ventas
i += 1 i += 1
Next Next
Dim AplicaComercioExteriorSubProyecto As Boolean Dim AplicaComercioExteriorSubProyecto As Boolean = True
If ChkEmitirComercioExterior.Checked Then If ChkEmitirComercioExterior.Checked Then
AplicaComercioExteriorSubProyecto = If(GlobalDTSubProyectos(-1, Obj.CveSubProyecto, CveEmpresa:=UsuarioActual.CveEmpresa)(0)("AplicaComercioExterior").ToString() = "True", True, False) 'AplicaComercioExteriorSubProyecto = If(GlobalDTSubProyectos(-1, Obj.CveSubProyecto, CveEmpresa:=UsuarioActual.CveEmpresa)(0)("AplicaComercioExterior").ToString() = "True", True, False)
Timbre.Complementos.ComercioExterior11.AplicaComercioExteriorSubProyecto = AplicaComercioExteriorSubProyecto Timbre.Complementos.ComercioExterior11.AplicaComercioExteriorSubProyecto = AplicaComercioExteriorSubProyecto
If Obj.Cliente.AplicaComercioExterior And AplicaComercioExteriorSubProyecto Then 'DATOS GENERALES
'DATOS GENERALES
Timbre.Comprobante.Exportacion = "02" Timbre.Comprobante.Exportacion = "02"
Timbre.Complementos.ComercioExterior11.TipoOperacion = GlobalDTTipoOperacion().FiltraParametros($"CveTipoOperacion={CveTipoOperacion}")(0)("ClaveSATTipoOperacion").ToString() Timbre.Complementos.ComercioExterior11.TipoOperacion = GlobalDTTipoOperacion().FiltraParametros($"CveTipoOperacion={CveTipoOperacion}")(0)("ClaveSATTipoOperacion").ToString()
Timbre.Complementos.ComercioExterior11.ClavedePedimento = GlobalDTClavePedimento().FiltraParametros($"CvePedimento={CvePedimento}")(0)("ClaveSATPedimento").ToString() Timbre.Complementos.ComercioExterior11.ClavedePedimento = GlobalDTClavePedimento().FiltraParametros($"CvePedimento={CvePedimento}")(0)("ClaveSATPedimento").ToString()
Timbre.Complementos.ComercioExterior11.CertificadoOrigen = "0" Timbre.Complementos.ComercioExterior11.CertificadoOrigen = "0"
Timbre.Complementos.ComercioExterior11.Incoterm = GlobalDTIncoterm.FiltroPrimeroValor("ClaveSATIncoterm", $"CveIncoterm={DdlIncoterm.SelectedValue}") Timbre.Complementos.ComercioExterior11.Incoterm = GlobalDTIncoterm.FiltroPrimeroValor("ClaveSATIncoterm", $"CveIncoterm={DdlIncoterm.SelectedValue}")
Timbre.Complementos.ComercioExterior11.Subdivision = "0" Timbre.Complementos.ComercioExterior11.Subdivision = "0"
Timbre.Complementos.ComercioExterior11.TipoCambioUSD = If(Obj.CveMoneda = 1, 1, Obj.TipoCambio) Timbre.Complementos.ComercioExterior11.TipoCambioUSD = If(Obj.CveMoneda = 1, 1, Obj.TipoCambio)
If Timbre.Comprobante.TipoComprobante = "T" Then
Timbre.Complementos.ComercioExterior11.MotivoTraslado = GlobalDTSATMotivoTraslado.FiltroPrimeroValor("ClaveSATMotivoTraslado", $"CveMotivoTraslado={DdlSATMotivoTraslado.SelectedValue}")
Else
Timbre.Complementos.ComercioExterior11.MotivoTraslado = ""
End If
'EMISOR Timbre.Complementos.ComercioExterior11.MotivoTraslado = ""
Dim Dr As DataRow
Dr = Nothing
If GlobalDTSubProyectos(-1, DdlSubProyectoDatos.SelectedValue.ToEntero(), CveEmpresa:=UsuarioActual.CveEmpresa).Rows.Count > 0 Then
Dr = GlobalDTSubProyectos(-1, DdlSubProyectoDatos.SelectedValue.ToEntero(), CveEmpresa:=UsuarioActual.CveEmpresa)(0)
End If
Timbre.Complementos.ComercioExterior11.Emisor.CURP = UsuarioActual.Empresa.CURP
Timbre.Complementos.ComercioExterior11.Emisor.Calle = Dr("Calle").ToString()
Timbre.Complementos.ComercioExterior11.Emisor.NumeroExterior = Dr("NoExt").ToString()
Timbre.Complementos.ComercioExterior11.Emisor.NumeroInterior = Dr("NoInt").ToString()
Timbre.Complementos.ComercioExterior11.Emisor.Colonia = Dr("ClaveSATColonia").ToString()
Timbre.Complementos.ComercioExterior11.Emisor.Localidad = ""
Timbre.Complementos.ComercioExterior11.Emisor.Municipio = Dr("ClaveSATMunicipio").ToString()
Timbre.Complementos.ComercioExterior11.Emisor.Estado = Dr("ClaveSATEstado").ToString()
Timbre.Complementos.ComercioExterior11.Emisor.Pais = Dr("ClaveSATPais").ToString()
Timbre.Complementos.ComercioExterior11.Emisor.CP = Dr("ClaveSATCP").ToString()
Dim ComExtPais, ComExtEstado, ComExtMunicipio, ComExtColonia, ComExtCalle, ComExtNumero, ComExtCP As String 'If Timbre.Comprobante.TipoComprobante = "T" Then
ComExtColonia = "" : ComExtMunicipio = "" ' Timbre.Complementos.ComercioExterior11.MotivoTraslado = GlobalDTSATMotivoTraslado.FiltroPrimeroValor("ClaveSATMotivoTraslado", $"CveMotivoTraslado={DdlSATMotivoTraslado.SelectedValue}")
ComExtPais = GlobalDTGralPaises.FiltroPrimeroValor("ClaveSATPais", $"CvePais={DdlComExtPais.SelectedValue}") 'Else
ComExtCalle = TxtComExtCalle.Text.Trim ' Timbre.Complementos.ComercioExterior11.MotivoTraslado = ""
ComExtNumero = TxtComExtNumero.Text.Trim 'End If
ComExtCP = TxtComExtCP.Text.Trim
If ComExtPais = "MEX" Then 'EMISOR
Dim Dr As DataRow
Dr = Nothing
If GlobalDTSubProyectos(-1, DdlSubProyectoDatos.SelectedValue.ToEntero(), CveEmpresa:=UsuarioActual.CveEmpresa).Rows.Count > 0 Then
Dr = GlobalDTSubProyectos(-1, DdlSubProyectoDatos.SelectedValue.ToEntero(), CveEmpresa:=UsuarioActual.CveEmpresa)(0)
End If
Timbre.Complementos.ComercioExterior11.Emisor.CURP = UsuarioActual.Empresa.CURP
Timbre.Complementos.ComercioExterior11.Emisor.Calle = Dr("Calle").ToString()
Timbre.Complementos.ComercioExterior11.Emisor.NumeroExterior = Dr("NoExt").ToString()
Timbre.Complementos.ComercioExterior11.Emisor.NumeroInterior = Dr("NoInt").ToString()
Timbre.Complementos.ComercioExterior11.Emisor.Colonia = Dr("ClaveSATColonia").ToString()
Timbre.Complementos.ComercioExterior11.Emisor.Localidad = ""
Timbre.Complementos.ComercioExterior11.Emisor.Municipio = Dr("ClaveSATMunicipio").ToString()
Timbre.Complementos.ComercioExterior11.Emisor.Estado = Dr("ClaveSATEstado").ToString()
Timbre.Complementos.ComercioExterior11.Emisor.Pais = Dr("ClaveSATPais").ToString()
Timbre.Complementos.ComercioExterior11.Emisor.CP = Dr("ClaveSATCP").ToString()
Dim ComExtPais, ComExtEstado, ComExtMunicipio, ComExtColonia, ComExtCalle, ComExtNumero, ComExtCP As String
ComExtColonia = "" : ComExtMunicipio = ""
ComExtPais = GlobalDTGralPaises.FiltroPrimeroValor("ClaveSATPais", $"CvePais={DdlComExtPais.SelectedValue}")
ComExtCalle = TxtComExtCalle.Text.Trim
ComExtNumero = TxtComExtNumero.Text.Trim
ComExtCP = TxtComExtCP.Text.Trim
If ComExtPais = "MEX" Then
ComExtEstado = GlobalDTGralEstados(ComExtPais).FiltroPrimeroValor("ClaveSATEstado", $"CveEstado={DdlComExtEstado.SelectedValue}")
ComExtMunicipio = GlobalDTGralMunicipios(ComExtEstado).FiltroPrimeroValor("ClaveSATMunicipio", $"CveMunicipio={DdlComExtMunicipio.SelectedValue}")
ComExtColonia = GlobalDTGralColonias("-1", "-1", "-1", CveColonia:=DdlComExtColonia.SelectedValue.ToEntero).FiltroPrimeroValor("ClaveSATColonia", "")
Else
If ComExtPais.Contiene("USA", "CAN") Then
ComExtEstado = GlobalDTGralEstados(ComExtPais).FiltroPrimeroValor("ClaveSATEstado", $"CveEstado={DdlComExtEstado.SelectedValue}") ComExtEstado = GlobalDTGralEstados(ComExtPais).FiltroPrimeroValor("ClaveSATEstado", $"CveEstado={DdlComExtEstado.SelectedValue}")
ComExtMunicipio = GlobalDTGralMunicipios(ComExtEstado).FiltroPrimeroValor("ClaveSATMunicipio", $"CveMunicipio={DdlComExtMunicipio.SelectedValue}")
ComExtColonia = GlobalDTGralColonias("-1", "-1", "-1", CveColonia:=DdlComExtColonia.SelectedValue.ToEntero).FiltroPrimeroValor("ClaveSATColonia", "")
Else Else
If ComExtPais.Contiene("USA", "CAN") Then ComExtEstado = TxtComExtEstado.Text.Trim
ComExtEstado = GlobalDTGralEstados(ComExtPais).FiltroPrimeroValor("ClaveSATEstado", $"CveEstado={DdlComExtEstado.SelectedValue}")
Else
ComExtEstado = TxtComExtEstado.Text.Trim
End If
ComExtMunicipio = TxtComExtMunicipio.Text.Trim
ComExtColonia = TxtComExtColonia.Text.Trim
End If End If
ComExtMunicipio = TxtComExtMunicipio.Text.Trim
ComExtColonia = TxtComExtColonia.Text.Trim
End If
'RECEPTOR 'RECEPTOR
Timbre.Complementos.ComercioExterior11.Receptor.NumRegIdTrib = If(Timbre.Comprobante.Version = "4.0", Obj.Cliente.NumRegIdTrib, "") ' EN LA VERSION 3.3 NO DEBE DE REGISTRARSE ESTE VALOR Timbre.Complementos.ComercioExterior11.Receptor.NumRegIdTrib = If(Timbre.Comprobante.Version = "4.0", Obj.Cliente.NumRegIdTrib, "") ' EN LA VERSION 3.3 NO DEBE DE REGISTRARSE ESTE VALOR
Timbre.Complementos.ComercioExterior11.Receptor.Calle = ComExtCalle Timbre.Complementos.ComercioExterior11.Receptor.Calle = ComExtCalle
Timbre.Complementos.ComercioExterior11.Receptor.NumeroExterior = ComExtNumero Timbre.Complementos.ComercioExterior11.Receptor.NumeroExterior = ComExtNumero
Timbre.Complementos.ComercioExterior11.Receptor.NumeroInterior = "" Timbre.Complementos.ComercioExterior11.Receptor.NumeroInterior = ""
Timbre.Complementos.ComercioExterior11.Receptor.Colonia = ComExtColonia Timbre.Complementos.ComercioExterior11.Receptor.Colonia = ComExtColonia
Timbre.Complementos.ComercioExterior11.Receptor.Localidad = "" Timbre.Complementos.ComercioExterior11.Receptor.Localidad = ""
Timbre.Complementos.ComercioExterior11.Receptor.Referencia = Obj.Cliente.ReferenciaFiscal Timbre.Complementos.ComercioExterior11.Receptor.Referencia = Obj.Cliente.ReferenciaFiscal
Timbre.Complementos.ComercioExterior11.Receptor.Municipio = ComExtMunicipio Timbre.Complementos.ComercioExterior11.Receptor.Municipio = ComExtMunicipio
Timbre.Complementos.ComercioExterior11.Receptor.CP = ComExtCP Timbre.Complementos.ComercioExterior11.Receptor.CP = ComExtCP
Timbre.Complementos.ComercioExterior11.Receptor.Estado = ComExtEstado Timbre.Complementos.ComercioExterior11.Receptor.Estado = ComExtEstado
Timbre.Complementos.ComercioExterior11.Receptor.Pais = ComExtPais Timbre.Complementos.ComercioExterior11.Receptor.Pais = ComExtPais
Timbre.Receptor.ResidenciaFiscal = Obj.Cliente.ClaveSATPais Timbre.Receptor.ResidenciaFiscal = Obj.Cliente.ClaveSATPais
Timbre.Receptor.NumeroRegistroTributario = Obj.Cliente.NumRegIdTrib Timbre.Receptor.NumeroRegistroTributario = Obj.Cliente.NumRegIdTrib
'DESTINATARIO 'DESTINATARIO
Timbre.Complementos.ComercioExterior11.Destinatario = Nothing Timbre.Complementos.ComercioExterior11.Destinatario = Nothing
'Timbre.Complementos.ComercioExterior11.Destinatario.Nombre = TxtDestinatarioNombre.Text.Trim 'Timbre.Complementos.ComercioExterior11.Destinatario.Nombre = TxtDestinatarioNombre.Text.Trim
'Timbre.Complementos.ComercioExterior11.Destinatario.Calle = ComExtCalle 'Timbre.Complementos.ComercioExterior11.Destinatario.Calle = ComExtCalle
'Timbre.Complementos.ComercioExterior11.Destinatario.NumeroExterior = ComExtNumero 'Timbre.Complementos.ComercioExterior11.Destinatario.NumeroExterior = ComExtNumero
'Timbre.Complementos.ComercioExterior11.Destinatario.NumeroInterior = "" 'Timbre.Complementos.ComercioExterior11.Destinatario.NumeroInterior = ""
'Timbre.Complementos.ComercioExterior11.Destinatario.Colonia = ComExtColonia 'Timbre.Complementos.ComercioExterior11.Destinatario.Colonia = ComExtColonia
'Timbre.Complementos.ComercioExterior11.Destinatario.Localidad = "" 'Timbre.Complementos.ComercioExterior11.Destinatario.Localidad = ""
'Timbre.Complementos.ComercioExterior11.Destinatario.Referencia = Obj.Cliente.ReferenciaFiscal 'Timbre.Complementos.ComercioExterior11.Destinatario.Referencia = Obj.Cliente.ReferenciaFiscal
'Timbre.Complementos.ComercioExterior11.Destinatario.Municipio = ComExtMunicipio 'Timbre.Complementos.ComercioExterior11.Destinatario.Municipio = ComExtMunicipio
'Timbre.Complementos.ComercioExterior11.Destinatario.CP = ComExtCP 'Timbre.Complementos.ComercioExterior11.Destinatario.CP = ComExtCP
'Timbre.Complementos.ComercioExterior11.Destinatario.Estado = ComExtEstado 'Timbre.Complementos.ComercioExterior11.Destinatario.Estado = ComExtEstado
'Timbre.Complementos.ComercioExterior11.Destinatario.Pais = ComExtPais 'Timbre.Complementos.ComercioExterior11.Destinatario.Pais = ComExtPais
'Timbre.Complementos.ComercioExterior11.Destinatario.NumRegIdTrib = TxtNumRegIdTrib.Text.Trim 'Timbre.Complementos.ComercioExterior11.Destinatario.NumRegIdTrib = TxtNumRegIdTrib.Text.Trim
'MERCANCIAS 'MERCANCIAS
For Each Gvr As GridViewRow In GvComercioExterior.Rows For Each Gvr As GridViewRow In GvComercioExterior.Rows
Dim mercancia As New CFDIComercioExterior11Mercancias With {.CantidadAduana = Gvr.FCTextBox("TxtCantidad").Text.ToDecimal, Dim mercancia As New CFDIComercioExterior11Mercancias With {.CantidadAduana = Gvr.FCTextBox("TxtCantidad").Text.ToDecimal,
.FraccionArancelaria = Gvr.DataKey("ClaveSATFraccionArancelaria").ToString(), .FraccionArancelaria = Gvr.DataKey("ClaveSATFraccionArancelaria").ToString(),
.UnidadAduana = Gvr.DataKey("ClaveSATUnidadAduana").ToString(), .UnidadAduana = Gvr.DataKey("ClaveSATUnidadAduana").ToString(),
.ValorDolares = Math.Round(Gvr.FCTextBox("TxtCantidad").Text.ToDecimal * Gvr.FCTextBox("TxtValorUnitario").Text.ToDecimal, 2), .ValorDolares = Math.Round(Gvr.FCTextBox("TxtCantidad").Text.ToDecimal * Gvr.FCTextBox("TxtValorUnitario").Text.ToDecimal, 2),
.ValorUnitarioAduana = Gvr.FCTextBox("TxtValorUnitario").Text.ToDecimal, .ValorUnitarioAduana = Gvr.FCTextBox("TxtValorUnitario").Text.ToDecimal,
.NoIdentificacion = Gvr.DataKey("Codigo")} .NoIdentificacion = Gvr.DataKey("Codigo")}
If Gvr.FCTextBox("TxtMarca").Text <> "" Then If Gvr.FCTextBox("TxtMarca").Text <> "" Then
mercancia.DescripcionesEspecificas.Marca = Gvr.FCTextBox("TxtMarca").Text mercancia.DescripcionesEspecificas.Marca = Gvr.FCTextBox("TxtMarca").Text
End If End If
Timbre.Complementos.ComercioExterior11.Mercancias.Add(mercancia) Timbre.Complementos.ComercioExterior11.Mercancias.Add(mercancia)
i += 1 i += 1
Next Next
End If
Else Else
@@ -17750,7 +17836,7 @@ Partial Class Ventas
End If End If
'SI NO TIENE LA FUNCIONALIDAD VALIDARA LAS MONEDAS 'SI NO TIENE LA FUNCIONALIDAD VALIDARA LAS MONEDAS
If Not UsuarioActual.Empresa.Funcionalidad(524) <> "" Then If UsuarioActual.Empresa.Funcionalidad(524) <> "" Then
If TmpDT IsNot Nothing AndAlso TmpDT.Rows.Count >= 1 Then If TmpDT IsNot Nothing AndAlso TmpDT.Rows.Count >= 1 Then
Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).Rows(0) Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).Rows(0)
If DrPS IsNot Nothing Then If DrPS IsNot Nothing Then
@@ -17969,6 +18055,12 @@ Partial Class Ventas
ObjDescuento.ImporteDescuento = 0 ObjDescuento.ImporteDescuento = 0
Return ObjDescuento Return ObjDescuento
End If End If
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Cot") AndAlso CveRinTamañoPS > 0 Then
If UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso Not TbDescuentosAdicionales.Visible Then
TbDescuentosAdicionales.Visible = True
End If
End If
End If End If
Dim dr As DataRow = Nothing Dim dr As DataRow = Nothing
@@ -19241,7 +19333,7 @@ Partial Class Ventas
ConfiguraTipoDocto() ConfiguraTipoDocto()
End If End If
End Sub End Sub
Private Sub CalculaTotalesVenta(Optional RecalculaImpuestosLocales As Boolean = True, Optional NCDescuento As Boolean = False, Optional ValidarDescuentos As Boolean = False) Private Sub CalculaTotalesVenta(Optional RecalculaImpuestosLocales As Boolean = True, Optional NCDescuento As Boolean = False, Optional ValidarDescuentos As Boolean = False, Optional RecalcularTotalOriginal As Boolean = True)
Dim TotalSubTotal As Decimal = TmpDT.SUMD("TotalImporte") Dim TotalSubTotal As Decimal = TmpDT.SUMD("TotalImporte")
Dim TotalSubTotalRef As Decimal = TotalSubTotal Dim TotalSubTotalRef As Decimal = TotalSubTotal
@@ -19346,6 +19438,12 @@ Partial Class Ventas
LblTotalAPagar.Text = (TxtTotal.Text.ToDecimal() - TotalRemNCAplicado - TotalProntoPago).FormatoNumero LblTotalAPagar.Text = (TxtTotal.Text.ToDecimal() - TotalRemNCAplicado - TotalProntoPago).FormatoNumero
If RecalcularTotalOriginal Then
LblTotalOriginal.Text = (TxtTotal.Text.ToDecimal()).FormatoNumero
End If
LblTotalAPagarAdicional.Text = (LblTotalOriginal.Text.ToDecimal() - LblDescuentoAdicional.Text.ToDecimal()).FormatoNumero
LblAmort.Text = TxtSubTotal.Text LblAmort.Text = TxtSubTotal.Text
If CveVenta <= 0 OrElse (CveDevolucion > 0 And NuevaFactura = 1) Then If CveVenta <= 0 OrElse (CveDevolucion > 0 And NuevaFactura = 1) Then
HdnVentaSaldo.Value = Total.ToString() HdnVentaSaldo.Value = Total.ToString()
@@ -22071,6 +22169,9 @@ Partial Class Ventas
Dim saldo = TxtTotal.Text.Replace(",", "").ToDouble - abonado Dim saldo = TxtTotal.Text.Replace(",", "").ToDouble - abonado
'CVImporteContado.ValueToCompare = (saldo.FormatoNumero(2).ToDouble).ToString() 'CVImporteContado.ValueToCompare = (saldo.FormatoNumero(2).ToDouble).ToString()
LblDescuentoAdicional.Text = "0.00"
CalculaTotalesVenta()
CargaGridContado() CargaGridContado()
UpContado.Update() UpContado.Update()
End Sub End Sub
@@ -22322,6 +22423,40 @@ Partial Class Ventas
End If End If
End If End If
Dim VieneDeCotizacion As Boolean = False
If DtCotizacionesPS IsNot Nothing AndAlso DtCotizacionesPS.Rows.Count > 0 Then
VieneDeCotizacion = True
End If
If DdlTipoComprobante.SelectedValue = "Ing" AndAlso (Not VieneDeCotizacion) AndAlso UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso DtPagos IsNot Nothing AndAlso TbDescuentosAdicionales.Visible Then
If TmpDT.SUMD("Descuento") > 0 AndAlso DtPagos.SUMD("Importe", "MesesSinIntereses <=0") = TxtTotal.Text.ToDecimal() Then
Dim TotalDescuento As Decimal = TmpDT.SUMD("Total", "Descuento > 0") * 0.05D
Dim RowDescuentos = TmpDT.Select("Descuento > 0")
If RowDescuentos IsNot Nothing Then
LblDescuentoAdicional.Text = TotalDescuento.FormatoNumero(2)
'Dim Row As DataRow = RowDescuentos(0)
'Row("Descuento") = Row("Descuento").ToString().ToDecimal() + TotalDescuento
'Dim TotalCalculableImpuestos As Decimal = (Row("Cantidad").ToString().ToDecimal() * Row("PU").ToString().ToDecimal()) - Row("Descuento").ToString().ToDecimal()
'Row("ImporteIVA") = (TotalCalculableImpuestos * Row("PorcentajeIVA").ToString().ToDecimal()).RoundSQL(2)
'BtnAgregarPago.Enabled = False
CalculaTotalesVenta()
Dim RowPago = DtPagos.Rows(0)
RowPago("Importe") = LblTotalAPagarAdicional.Text.ToDecimal()
End If
Else
LblDescuentoAdicional.Text = "0.00"
End If
UpPS.Update()
End If
CargaGridContado() CargaGridContado()
UpContado.Update() UpContado.Update()
@@ -22360,7 +22495,7 @@ Partial Class Ventas
If (Not PermiteCredito OrElse RBLPago.SelectedValue = "2") AndAlso TienePagos AndAlso TxtTotal.Text.ToDecimal > 0 Then If (Not PermiteCredito OrElse RBLPago.SelectedValue = "2") AndAlso TienePagos AndAlso TxtTotal.Text.ToDecimal > 0 Then
Dim TotalPago As Decimal = DtPagos.SUM("Importe").ToDecimal() + AmortizacionNC Dim TotalPago As Decimal = DtPagos.SUM("Importe").ToDecimal() + AmortizacionNC
If TotalPago <> TxtTotal.Text.ToDecimal Then If TotalPago <> (TxtTotal.Text.ToDecimal - LblDescuentoAdicional.Text.ToDecimal()) Then
If MostrarAlertas Then If MostrarAlertas Then
Alert("La suma de los pagos debe ser igual al total de la venta.", TipoMensaje.MsgAdvertencia) Alert("La suma de los pagos debe ser igual al total de la venta.", TipoMensaje.MsgAdvertencia)
End If End If
@@ -29481,7 +29616,8 @@ Partial Class Ventas
Dim PU As Decimal = If(AplicaPUEditado, Gv.FCTextBox("TxtPrecioEditado").Text.ToDecimal, Gv.DataKey("PU").ToDecimal) Dim PU As Decimal = If(AplicaPUEditado, Gv.FCTextBox("TxtPrecioEditado").Text.ToDecimal, Gv.DataKey("PU").ToDecimal)
Dim Total As Decimal = (Cantidad * PU) Dim Total As Decimal = (Cantidad * PU)
Dim TotalImpuestos As Decimal = (Cantidad * PU) - Descuento Dim TotalImpuestos As Decimal = (Cantidad * PU) - Descuento
Dim ImporteIVA As Decimal = TotalImpuestos * Gv.DataKey("PorcentajeIVA").ToString().ToDecimal Dim TotalCalculableImpuestosIVA = TotalImpuestos * (1 + Gv.DataKey("PorcentajeIEPS").ToString().ToDecimal)
Dim ImporteIVA As Decimal = TotalCalculableImpuestosIVA * Gv.DataKey("PorcentajeIVA").ToString().ToDecimal
Dim ImporteRetIVA As Decimal = TotalImpuestos * Gv.DataKey("PorcentajeRetIVA").ToString().ToDecimal Dim ImporteRetIVA As Decimal = TotalImpuestos * Gv.DataKey("PorcentajeRetIVA").ToString().ToDecimal
Dim ImporteRetISR As Decimal = TotalImpuestos * Gv.DataKey("PorcentajeRetISR").ToString().ToDecimal Dim ImporteRetISR As Decimal = TotalImpuestos * Gv.DataKey("PorcentajeRetISR").ToString().ToDecimal
Dim ImporteIEPS As Decimal = TotalImpuestos * Gv.DataKey("PorcentajeIEPS").ToString().ToDecimal Dim ImporteIEPS As Decimal = TotalImpuestos * Gv.DataKey("PorcentajeIEPS").ToString().ToDecimal
@@ -35535,6 +35671,9 @@ Partial Class Ventas
Protected Sub ChkEmitirComercioExterior_CheckedChanged(sender As Object, e As EventArgs) Protected Sub ChkEmitirComercioExterior_CheckedChanged(sender As Object, e As EventArgs)
If CveVenta <= 0 OrElse EsCreaApartirDe Then If CveVenta <= 0 OrElse EsCreaApartirDe Then
ViewState("AplicaComercioExterior") = ChkEmitirComercioExterior.Checked
If ChkEmitirComercioExterior.Checked Then If ChkEmitirComercioExterior.Checked Then
DdlMoneda.SelectedValueExist("2") DdlMoneda.SelectedValueExist("2")
CambiaMoneda() CambiaMoneda()

View File

@@ -1,590 +0,0 @@
<?xml version="1.0"?>
<!--
Visual Studio global web project settings.
-->
<VisualWebDeveloper>
<StartupServices>
<Service ID="{C0C07587-41A7-46C8-8FBD-3F9C8EBE2DDC}"/>
</StartupServices>
</VisualWebDeveloper>