This commit is contained in:
2024-05-23 22:27:42 -07:00
14 changed files with 1467 additions and 869 deletions

View File

@@ -5918,44 +5918,60 @@
}
function chkAnt(t, txt, importe, TotalSaldoCompra, CveMonedaAnticipo, TCAnticipo, CveMonedaOriginal, TCCompra) {
var Total = ToDouble($get('TxtTotal').value);
debugger;
var txtvalue = ToDouble(txt.value);
var ImportePago, ImporteCompra;
function chkAnt(t, txt, importe, TotalSaldoCompra, CveMonedaAnticipo, TCAnticipo, CveMonedaOriginal, TCCompra, txtComision) {
var Total = ToDouble($get('TxtTotal').value);
debugger;
var txtvalue = ToDouble(txt.value);
var ImportePago, ImporteCompra;
var TCC = TCCompra / TCAnticipo;
var importevalue = ToDouble(importe);
var TCC = TCCompra / TCAnticipo;
var importevalue = ToDouble(importe);
if (CveMonedaAnticipo != CveMonedaOriginal) {
if (CveMonedaAnticipo == 1 && CveMonedaOriginal == 2) {
txtvalue = ToDouble(txtvalue / TCAnticipo);
importevalue = ToDouble(importevalue / TCAnticipo);
} else if (CveMonedaAnticipo == 2 && CveMonedaOriginal == 1) {
txtvalue = ToDouble(txtvalue * TCAnticipo);
importevalue = ToDouble(importevalue * TCAnticipo);
if (CveMonedaAnticipo != CveMonedaOriginal) {
if (CveMonedaAnticipo == 1 && CveMonedaOriginal == 2) {
txtvalue = ToDouble(txtvalue / TCAnticipo);
importevalue = ToDouble(importevalue / TCAnticipo);
} else if (CveMonedaAnticipo == 2 && CveMonedaOriginal == 1) {
txtvalue = ToDouble(txtvalue * TCAnticipo);
importevalue = ToDouble(importevalue * TCAnticipo);
}
}
}
else { TCC = 1; }
var DifSaldo = (TotalSaldoCompra - FnSumaValoresAnt()).toFixed(2); // le agrego lo del valor actual para validarlo
else { TCC = 1; }
var DifSaldo = (TotalSaldoCompra - FnSumaValoresAnt());//.toFixed(2); // le agrego lo del valor actual para validarlo
if (t.checked)
{
if (DifSaldo > importevalue) {
txt.value = toFixed(ToDouble(importevalue * TCC), 2);
} else {
txt.value = toFixed(ToDouble(DifSaldo * TCC), 2);
}
if (txtComision !== undefined && txtComision !== null) {
let difFinal = (DifSaldo - importevalue) * TCC;
if (difFinal > 0 && difFinal < 1) {
txtComision.value = toFixed(roundToTwo(difFinal), 2);
}
}
} else {
txt.value = "";
}
$("#LblTotalAnticipos").text(FormatoNumero(FnSumaValoresAnt(), 2));
$("#LblAplicadoCompraAnt").text(FormatoNumero(FnSumaValoresAnt(), 2));
$("#LblAplicadoCompraAntComision").text(FormatoNumero(FnSumaValoresAntComisiones(), 2));
$("#LblSaldoFactura").text(FormatoNumero(TotalSaldoCompra - FnSumaValoresAnt(), 2));
if (t.checked)
{
if (DifSaldo > importevalue) {
txt.value = toFixed(ToDouble(importevalue*TCC),2);
} else {
txt.value = toFixed(ToDouble(DifSaldo*TCC),2);
}
} else {
txt.value = "";
}
$("#LblTotalAnticipos").text(FormatoNumero(FnSumaValoresAnt(), 2));
$("#LblAplicadoCompraAnt").text(FormatoNumero(FnSumaValoresAnt(), 2));
$("#LblAplicadoCompraAntComision").text(FormatoNumero(FnSumaValoresAntComisiones(), 2));
$("#LblSaldoFactura").text(FormatoNumero(TotalSaldoCompra - FnSumaValoresAnt(), 2));
function roundToTwo(num) {
return Math.round(num * 100) / 100;
}
function FnCambiaAnt(chk, txt, saldo, TotalSaldo, CveMonedaAnticipo, TCAnticipo, CveMonedaOriginal, txtComision) {

View File

@@ -1875,407 +1875,407 @@ Partial Class Compras_Compras
CreaDTConceptos()
CargaComprobanteXML(XMLDoc)
If NuevaValidacionXML = 1 OrElse (Version = "3.3" OrElse Version = "4.0") Then
Dim Xml As String
Dim nodo As XmlNode = XMLDoc.DocumentElement
Dim Version As String = ValorXML(nodo, "version")
Dim Prefijo As String = If(XMLDoc.DocumentElement.Prefix = "", "cfd", XMLDoc.DocumentElement.Prefix)
Dim cfdVer As String = ""
Dim namespaces As New XmlNamespaceManager(XMLDoc.NameTable)
Dim Xml As String
Dim nodo As XmlNode = XMLDoc.DocumentElement
Dim Version As String = ValorXML(nodo, "version")
Dim Prefijo As String = If(XMLDoc.DocumentElement.Prefix = "", "cfd", XMLDoc.DocumentElement.Prefix)
Dim cfdVer As String = ""
Dim namespaces As New XmlNamespaceManager(XMLDoc.NameTable)
If Version = "3.2" Then
Prefijo = "cfd"
cfdVer = "http://www.sat.gob.mx/cfd/2"
ElseIf Version = "3.3" Then
cfdVer = "http://www.sat.gob.mx/cfd/3"
Else ' se considera que es la version 4.0
cfdVer = "http://www.sat.gob.mx/cfd/4"
End If
'If Prefijo.ToLower <> "cfdi" Then cfdVer = "http://www.sat.gob.mx/cfd/2"
namespaces.AddNamespace(Prefijo, cfdVer)
namespaces.AddNamespace("aerolineas", "http://www.sat.gob.mx/aerolineas")
namespaces.AddNamespace("tfd", "http://www.sat.gob.mx/TimbreFiscalDigital")
namespaces.AddNamespace("implocal", "http://www.sat.gob.mx/implocal")
namespaces.AddNamespace("registrofiscal", "http://www.sat.gob.mx/registrofiscal")
Dim nodeconceptos As XmlNode = XMLDoc.SelectSingleNode(String.Format("//{0}:Conceptos", Prefijo), namespaces)
Xml = Replace(nodeconceptos.OuterXml, "<cfdi:", "<")
Xml = Xml.Replace("</cfdi:", "</")
Xml = Xml.Replace("xmlns:cfdi=""http://www.sat.gob.mx/cfd/3""", "")
Xml = Xml.Replace("xmlns:cfdi=""http://www.sat.gob.mx/cfd/4""", "")
Xml = Xml.Replace("&quot;", "") 'comillas
Xml = System.Web.HttpUtility.HtmlDecode(Xml.ToString)
Xml = Xml.Replace(Chr(13), "") 'salto de linea
Xml = Xml.Replace(Chr(10), "")
Xml = Xml.Replace("<br />", "") 'salto de linea html
Xml = Xml.Replace("&lt;br&gt;", "")
Xml = Xml.Replace("&lt;", "")
Xml = Xml.Replace("&", "") 'adicional, si hay otros
If ObjeFacturas.GetFacturasComparacionXML(Version, Xml, UsuarioActual.CveEmpresa) Then
TmpDT = ObjeFacturas.DtResultados
TmpDT.Columns.Add("CveSATPSActualizado")
SubTotalConceptos = TmpDT.SUMD("Total").RoundSQL
If Not TmpDT.Columns.Contains("Amortizacion") Then
TmpDT.Columns.Add("Amortizacion", GetType(Decimal))
End If
AddPS2(False)
'VALIDA QUE EL XML SI VIENE CON EL CODIGO SAT 01010101
Dim ProductosCodigoSATNoPermitidos As New StringBuilder("")
For Each drr As DataRow In TmpDT.FiltraParametros("ClaveProdServ = '01010101'").Rows
ProductosCodigoSATNoPermitidos.AppendFormat("{0}</br>", drr("PS"))
Next
If TmpDT.MAX("RetISRPorcentaje").ToDecimal = 0.0125 Then RetISRResico = True
If TmpDT.MAX("RetIVAPorcentaje").ToDecimal = 0.04 Then RetIVAFlete = True
If ProductosCodigoSATNoPermitidos.ToString.Length > 0 Then
Dim mensajeAdvertencia As String = String.Format("El XML que intenta registrar contiene partidas o artículos con código SAT ‘01010101’ el cual no es aceptado, hable con su proveedor para cancelar y/o refacturar un XML válido.<br/> Partidas o artículos con código ‘01010101’: </br></br>{0}", ProductosCodigoSATNoPermitidos.ToString)
Alert(mensajeAdvertencia, TipoMensaje.MsgAdvertencia)
If UsuarioActual.CveEmpresa.Contiene(119, 158) AndAlso Not UsuarioActual.CveUsuario.Contiene(1719, 1721) Then BtnGuardar.Enabled = False '' solo se activa para el usuario Sara.JAM
BtnGuardar.ToolTip = "No se permite registrar facturas con conceptos con código '01010101'. Solicite al proveedor un nuevo comprobante."
End If
End If
Dim SbValRet As New StringBuilder
For Each concepto As XmlNode In nodeconceptos
' Obtener la descripción del concepto
Dim descripcion As String = ValorXML(concepto, "Descripcion")
Dim importeValue As Decimal = Decimal.Parse(ValorXML(concepto, "Importe"))
' Seleccionar el nodo de Impuestos dentro de Concepto, si existe
Dim impuestosNode As XmlNode = concepto.SelectSingleNode("cfdi:Impuestos", namespaces)
If Not impuestosNode Is Nothing Then
' Seleccionar los nodos de Retencion dentro de Impuestos
Dim retenciones As XmlNodeList = impuestosNode.SelectNodes("cfdi:Retenciones/cfdi:Retencion", namespaces)
For Each retencion As XmlNode In retenciones
' Obtener los valores de los atributos Base e Importe
Dim baseValue As Decimal = Decimal.Parse(ValorXML(retencion, "Base"))
Dim impuesto As String = ValorXML(retencion, "Impuesto")
If impuesto = "001" Then
impuesto = "Retención ISR"
ElseIf impuesto = "002" Then
impuesto = "Retención IVA"
ElseIf impuesto = "003" Then
impuesto = "IEPS"
End If
' Validar si Base coincide con Importe
If baseValue <> importeValue Then
'SbValRet.Append($"La base e importe de la retención del impuesto {impuesto} no coinciden para {descripcion}. Base: {baseValue.ToString()}, Importe: {importeValue.ToString()} <br>")
SbValRet.Append($"Producto: {descripcion} La base e importe del impuesto {impuesto} no coincide Base: {baseValue.ToString()}, Importe Producto: {importeValue.ToString()} <br>")
End If
Next
End If
Next
If SbValRet.ToString.Trim.Length > 0 Then
Alert(SbValRet.ToString, TipoMensaje.MsgAdvertencia)
End If
Else
CargaConceptosXML(XMLDoc)
If Version = "3.2" Then
Prefijo = "cfd"
cfdVer = "http://www.sat.gob.mx/cfd/2"
ElseIf Version = "3.3" Then
cfdVer = "http://www.sat.gob.mx/cfd/3"
Else ' se considera que es la version 4.0
cfdVer = "http://www.sat.gob.mx/cfd/4"
End If
Select Case TipoComprobante
Case "ingreso" : DdlTipoComprobante.SelectedValue = "Fac" : DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("NC")) : DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("DEV"))
Case "egreso" : DdlTipoComprobante.SelectedValue = "NC" : DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Fac")) : DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Ant")) : ChkAplicaNotaCredito.Enabled = False
Case "I"
DdlTipoComprobante.SelectedValue = "Fac"
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("NC"))
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("DEV"))
DdlTipoCompra.Items.Remove(DdlTipoCompra.Items.FindByValue("6"))
DdlTipoCompra.Items.Remove(DdlTipoCompra.Items.FindByValue("11"))
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then DdlTipoCompra.Items.Add(New ListItem("Recolección", "14"))
Case "E"
DdlTipoComprobante.SelectedValue = "NC"
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Fac"))
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Ant"))
ChkAplicaNotaCredito.Enabled = False
'If Prefijo.ToLower <> "cfdi" Then cfdVer = "http://www.sat.gob.mx/cfd/2"
DdlTipoCompra.Items.Clear()
DdlTipoCompra.Items.Add(New ListItem("Seleccione", "-1"))
DdlTipoCompra.Items.Add(New ListItem("NC Con Productos", "6"))
DdlTipoCompra.Items.Add(New ListItem("Apoyo Logístico", "9"))
DdlTipoCompra.Items.Add(New ListItem("NC Por Devolución", "11"))
DdlTipoCompra.Items.Add(New ListItem("Garantía", "12"))
Case "T"
DdlTipoCompra.Items.Clear()
DdlTipoCompra.Items.Add(New ListItem("Apoyo Logístico", "9"))
DdlTipoComprobante.SelectedValue = "Fac"
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("NC"))
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("DEV"))
namespaces.AddNamespace(Prefijo, cfdVer)
namespaces.AddNamespace("aerolineas", "http://www.sat.gob.mx/aerolineas")
namespaces.AddNamespace("tfd", "http://www.sat.gob.mx/TimbreFiscalDigital")
namespaces.AddNamespace("implocal", "http://www.sat.gob.mx/implocal")
namespaces.AddNamespace("registrofiscal", "http://www.sat.gob.mx/registrofiscal")
End Select
Dim nodeconceptos As XmlNode = XMLDoc.SelectSingleNode(String.Format("//{0}:Conceptos", Prefijo), namespaces)
Xml = Replace(nodeconceptos.OuterXml, "<cfdi:", "<")
Xml = Xml.Replace("</cfdi:", "</")
Xml = Xml.Replace("xmlns:cfdi=""http://www.sat.gob.mx/cfd/3""", "")
Xml = Xml.Replace("xmlns:cfdi=""http://www.sat.gob.mx/cfd/4""", "")
Xml = Xml.Replace("&quot;", "") 'comillas
Xml = System.Web.HttpUtility.HtmlDecode(Xml.ToString)
Xml = Xml.Replace(Chr(13), "") 'salto de linea
Xml = Xml.Replace(Chr(10), "")
Xml = Xml.Replace("<br />", "") 'salto de linea html
Xml = Xml.Replace("&lt;br&gt;", "")
Xml = Xml.Replace("&lt;", "")
Xml = Xml.Replace("&", "") 'adicional, si hay otros
'DIV ALIAS
CargaPSAlias()
RFC = dr("RFCDe").ToString
RFCProveedor = RFC
TxtFecha.Text = dr("FechaFactura").ToString.ToDate.ToShortDateString
TxtSerie.Text = dr("Serie").ToString
TxtFolio.Text = dr("Folio").ToString
DdlValidadaSAT.SelectedValue = If(dr("FueValidado").ToString.Contiene("Si", "1"), "Si", "No")
DdlValidadaSAT.Enabled = False
LblTipoFact.Text = dr("TipoFactura").ToString
SerieVieja = dr("Serie").ToString
LblMetodoPago.Text = MetodoPago
Dim SubTotal2, IVA, IEPS As Decimal
IVA = TrasladoIVA
If Not UsuarioActual.TienePermisoProceso(130) Then
TxtFolio.Enabled = False
TxtSerie.Enabled = False
End If
'PERMISO PARA MODIFICACIÓN DE FECHA AUN CON FACTURA
TxtFecha.Enabled = UsuarioActual.TienePermisoProceso(216)
ImgFecha.Enabled = UsuarioActual.TienePermisoProceso(216)
CEFecha.Enabled = UsuarioActual.TienePermisoProceso(216)
TxtSubTotal.Enabled = False
TxtDescuento.Enabled = False
TxtSubTotal2.Enabled = False
TxtIVA.Enabled = False
TxtTotal.Enabled = False
DdlProveedor.Enabled = False
If TxtFolio.Text.Trim = "" Then TxtFolio.Enabled = True : TxtSerie.Enabled = True
If UsuarioActual.TienePermisoProceso(112) Then
PermisoEdicionManual = True
TxtSubTotal.Enabled = True
TxtDescuento.Enabled = True
TxtSubTotal2.Enabled = True
TxtIVA.Enabled = True
TxtTotal.Enabled = True
End If
If UsuarioActual.Empresa.Funcionalidad(118) = "1" AndAlso DdlTipoComprobante.SelectedValue = "Fac" Then
VerVales.Visible = True
End If
If TieneAnticiposXML Then 'si tiene anticipos, limpia los descuentos
'LblAmortizacion.Text = ImporteAnticipo.FormatoNumero
TxtDescuento.Text = "0.00"
LblAmortizacion.Text = Descuentos.FormatoNumero
'limpia los descuentos
For Each drr As DataRow In TmpDT.Rows
'drr("Total") = drr("Total").ToString.ToDecimal + drr("Descuento").ToString.ToDecimal
drr("Amortizacion") = drr("Descuento") 'pasamos el importe de descuento a amortizacion
drr("Descuento") = 0.00
Next
Amortizaciones = Descuentos
Descuentos = 0
End If
Dim Msg As String = ""
If Version = "3.3" Or Version = "4.0" Then
If ObjeFacturas.GetFacturasComparacionXML(Version, Xml, UsuarioActual.CveEmpresa) Then
TmpDT = ObjeFacturas.DtResultados
TmpDT.Columns.Add("CveSATPSActualizado")
SubTotalConceptos = TmpDT.SUMD("Total").RoundSQL
If Not TmpDT.Columns.Contains("Amortizacion") Then
TmpDT.Columns.Add("Amortizacion", GetType(Decimal))
End If
TmpDT.AcceptChanges()
ValidacionesTotalesXml()
Else
'PRUEBA
'http://rm/Compras/Compras.aspx?CveFactura=122518 Emp: 48
'tTotal = Math.Round(SubTotal2 + IVA - RetencionIVA - RetencionISR + IEPS + OtrosImpuestos, 2)
HdnCompraSaldo.Value = Total.ToString
CompraSaldo = Total
Dim AjustaUltimoConcepto As Boolean = False
AddPS2(False)
'AGREGA IEPS COMO CONCEPTO
If TrasladoIEPS > 0 And UsuarioActual.Empresa.Funcionalidad(112).ToString.ToEntero > 0 Then
AgregarConceptoIEPS(TrasladoIEPS, UsuarioActual.Empresa.Funcionalidad(112).ToString.ToEntero)
' TrasladoIEPS = 0
'VALIDA QUE EL XML SI VIENE CON EL CODIGO SAT 01010101
Dim ProductosCodigoSATNoPermitidos As New StringBuilder("")
For Each drr As DataRow In TmpDT.FiltraParametros("ClaveProdServ = '01010101'").Rows
ProductosCodigoSATNoPermitidos.AppendFormat("{0}</br>", drr("PS"))
Next
If TmpDT.MAX("RetISRPorcentaje").ToDecimal = 0.0125 Then RetISRResico = True
If TmpDT.MAX("RetIVAPorcentaje").ToDecimal = 0.04 Then RetIVAFlete = True
If ProductosCodigoSATNoPermitidos.ToString.Length > 0 Then
Dim mensajeAdvertencia As String = String.Format("El XML que intenta registrar contiene partidas o artículos con código SAT ‘01010101’ el cual no es aceptado, hable con su proveedor para cancelar y/o refacturar un XML válido.<br/> Partidas o artículos con código ‘01010101’: </br></br>{0}", ProductosCodigoSATNoPermitidos.ToString)
Alert(mensajeAdvertencia, TipoMensaje.MsgAdvertencia)
If UsuarioActual.CveEmpresa.Contiene(119, 158) AndAlso Not UsuarioActual.CveUsuario.Contiene(1719, 1721) Then BtnGuardar.Enabled = False '' solo se activa para el usuario Sara.JAM
BtnGuardar.ToolTip = "No se permite registrar facturas con conceptos con código '01010101'. Solicite al proveedor un nuevo comprobante."
End If
'en otro impuesto lo esta registrando en ajuste en automatico
If OtrosImpuestos > 0 Then
AjustaUltimoConcepto = True
End If
If RFC = "CFE370814QI0" Then ' RFC de CFE, se hace un ajuste por diferencia para sacar el DAP
'OtrosImpuestos = Total - (SubTotal2 + IVA)
'este importe lo vamos a meter al gasto
'AjustaImporteUltimoConcepto(OtrosImpuestos)
OtrosImpuestos = 1
AjustaUltimoConcepto = True
'SubTotal2 = SubTotal
End If
Dim SubTotalReal As Decimal = 0
SubTotalReal = Math.Round(Total + RetencionISR + RetencionIVA - IVA + Descuentos - TrasladoIEPS, 2) ' NO se incluye otros impuestos para ajustar esa cifra
Dim DiferenciaTotales As Decimal = SubTotalReal - Math.Round(SubTotalConceptos, 2)
If DiferenciaTotales <> 0 Then
'Verificamos IEPS y Otros Impuestos
'restricccion general, que si el subtotal de los conceptos no cuadra con Total + RetISR + RetIVA - IVA <> SubTotalConeptos, ajuste al final
If TrasladoIEPS > 0 OrElse OtrosImpuestos > 0 OrElse Math.Abs(DiferenciaTotales) < 1 Then
'Condicion necesaria cuando hay IVA pero no hay diferencia
If DiferenciaTotales <> 0 Then
If DiferenciaTotales < 50 OrElse AjustaUltimoConcepto = True Then
Dim IA As Decimal = Total + RetencionISR + RetencionIVA - IVA - SubTotalConceptos - TrasladoIEPS + Descuentos
AjustaImporteUltimoConcepto(IA, True)
ElseIf DiferenciaTotales > 50 Then
PnlAjusteProductos.Visible = True
Dim Porcentaje As Double = Math.Round((SubTotalConceptos - SubTotalReal) / SubTotalConceptos * 100, 2)
TxtAjustePorcentaje.Text = Porcentaje.FormatoNumero
Msg &= String.Format("La Factura presenta anomalias en los importes mostrados, estas anomalias impiden que se editen las partidas. Por favor realice el ajuste correspondiente <br>")
ImgBtnBuscarOC.Visible = False : TxtOC.Enabled = False
'Ocultamos la opcion de Editar y Eliminar hasta que se arreglen las anomalias
For Each Row As GridViewRow In GvPS.Rows
Row.FCLinkButton("imgE").Visible = False
Row.FCLinkButton("imgD").Visible = False
Next
End If
End If
TrasladoIEPS = 0 : OtrosImpuestos = 0 : SubTotal2 = SubTotal
Else
PnlAjusteProductos.Visible = True
Dim Porcentaje As Double = If(SubTotalConceptos > 0, Math.Round((SubTotalConceptos - SubTotalReal) / SubTotalConceptos * 100, 2), 0)
TxtAjustePorcentaje.Text = Porcentaje.FormatoNumero
Msg &= String.Format("La Factura presenta anomalias en los importes mostrados, estas anomalias impiden que se editen las partidas. Por favor realice el ajuste correspondiente <br>")
ImgBtnBuscarOC.Visible = False : TxtOC.Enabled = False
'Ocultamos la opcion de Editar y Eliminar hasta que se arreglen las anomalias
For Each Row As GridViewRow In GvPS.Rows
Row.FCLinkButton("imgE").Visible = False
Row.FCLinkButton("imgD").Visible = False
Next
End If
End If
'Si no hay diferencias pero tenemos descuento, se ofrece la opcion para ajustar el gasto
If Descuentos > 0 Then
'[IPP] PARCHE: Factura TELMEX para APH 12/ENERO/2018
If CveFactura = 286290 Then
Else
PnlAjusteProductos.Visible = True
Dim Porcentaje As Double = Math.Round((Descuentos) / (SubTotalConceptos) * 100, 4)
TxtAjustePorcentaje.Text = Porcentaje.FormatoNumero(4)
Msg &= String.Format("La Factura presenta anomalias en los importes mostrados, estas anomalias impiden que se editen las partidas. Por favor realice el ajuste correspondiente <br>")
ImgBtnBuscarOC.Visible = False : TxtOC.Enabled = False
'Ocultamos la opcion de Editar y Eliminar hasta que se arreglen las anomalias
For Each Row As GridViewRow In GvPS.Rows
Row.FCLinkButton("imgE").Visible = False
Row.FCLinkButton("imgD").Visible = False
Next
End If
End If
SubTotal2 = SubTotalReal - Descuentos
If Descuentos > 0 Then
TrDescuento.Visible = True
End If
If Msg <> "" Then
Alert(Msg, TipoMensaje.MsgAdvertencia)
BtnGuardar.Enabled = False
End If
'AJUSTAMOS SUBTOTAL EN CASO DE SER DIFERENTE AL SUBTOTAL2 DEL XML (TOTAL - IVA)
If SubTotal2 <> SubTotal Then
SubTotal = SubTotalConceptos
End If
TxtSubTotal.Text = SubTotal.FormatoNumero
TxtDescuento.Text = Descuentos.FormatoNumero
TxtSubTotal2.Text = SubTotal2.FormatoNumero
TxtIVA.Text = IVA.FormatoNumero
TxtTotal.Text = Total.ToString.FormatoNumero
HfTotalCompra.Value = Total.ToString
CompraSaldo = Total
CalculaTotalPorDevengar()
TxtDocumentoImporteFE.Text = Total.ToString
RVDocumentoImporte.MaximumValue = Math.Round(Total, 2).ToString
RVDocumentoImporteFE.MaximumValue = RVDocumentoImporte.MaximumValue
RVDocumentoImporteCaja.MaximumValue = RVDocumentoImporte.MaximumValue
TxtDocumentoImporte.Text = Total.FormatoNumero
TxtDocumentoImporteCaja.Text = Total.FormatoNumero
TxtRetIVA.Text = RetencionIVA.FormatoNumero
TxtRetISR.Text = RetencionISR.FormatoNumero
TxtIEPS.Text = IEPS.FormatoNumero
If IEPS > 0 Then TrIEPS.Visible = True
If RetencionIVA > 0 Then TrRetIVA.Visible = True
If RetencionISR > 0 Then TrRetISR.Visible = True
TxtOtrosImpuestos.Text = OtrosImpuestos.FormatoNumero
If OtrosImpuestos > 0 Then TrOtrosImpuestos.Visible = True
HFDiferenciaCompra.Value = TxtTotal.Text
'ASIGNA VALORES ORIGINALES PARA GUARDAR
AsignaValoresOriginales(SubTotal, SubTotal2, IVA, RetencionIVA, RetencionISR, Total)
End If
TxtFechaPago.Text = (TxtFecha.Text.ToDate.AddDays(LblDiasCredito.Text.ToEntero)).ToShortDateString
Dim drMon As DataRow = GlobalDTMonedas.FiltroPrimero(String.Format(" (Abreviatura LIKE '%{0}%' OR Moneda LIKE '%{0}%' )", Moneda))
Dim SbValRet As New StringBuilder
For Each concepto As XmlNode In nodeconceptos
' Obtener la descripción del concepto
Dim descripcion As String = ValorXML(concepto, "Descripcion")
Dim importeValue As Decimal = Decimal.Parse(ValorXML(concepto, "Importe"))
' Seleccionar el nodo de Impuestos dentro de Concepto, si existe
Dim impuestosNode As XmlNode = concepto.SelectSingleNode("cfdi:Impuestos", namespaces)
If Not impuestosNode Is Nothing Then
' Seleccionar los nodos de Retencion dentro de Impuestos
Dim retenciones As XmlNodeList = impuestosNode.SelectNodes("cfdi:Retenciones/cfdi:Retencion", namespaces)
For Each retencion As XmlNode In retenciones
' Obtener los valores de los atributos Base e Importe
Dim baseValue As Decimal = Decimal.Parse(ValorXML(retencion, "Base"))
Dim impuesto As String = ValorXML(retencion, "Impuesto")
If impuesto = "001" Then
impuesto = "Retención ISR"
ElseIf impuesto = "002" Then
impuesto = "Retención IVA"
ElseIf impuesto = "003" Then
impuesto = "IEPS"
End If
' Validar si Base coincide con Importe
If baseValue <> importeValue Then
'SbValRet.Append($"La base e importe de la retención del impuesto {impuesto} no coinciden para {descripcion}. Base: {baseValue.ToString()}, Importe: {importeValue.ToString()} <br>")
SbValRet.Append($"Producto: {descripcion} La base e importe del impuesto {impuesto} no coincide Base: {baseValue.ToString()}, Importe Producto: {importeValue.ToString()} <br>")
End If
Next
End If
Next
If SbValRet.ToString.Trim.Length > 0 Then
Alert(SbValRet.ToString, TipoMensaje.MsgAdvertencia)
End If
Else
CargaConceptosXML(XMLDoc)
End If
Select Case TipoComprobante
Case "ingreso" : DdlTipoComprobante.SelectedValue = "Fac" : DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("NC")) : DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("DEV"))
Case "egreso" : DdlTipoComprobante.SelectedValue = "NC" : DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Fac")) : DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Ant")) : ChkAplicaNotaCredito.Enabled = False
Case "I"
DdlTipoComprobante.SelectedValue = "Fac"
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("NC"))
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("DEV"))
DdlTipoCompra.Items.Remove(DdlTipoCompra.Items.FindByValue("6"))
DdlTipoCompra.Items.Remove(DdlTipoCompra.Items.FindByValue("11"))
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then DdlTipoCompra.Items.Add(New ListItem("Recolección", "14"))
Case "E"
DdlTipoComprobante.SelectedValue = "NC"
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Fac"))
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Ant"))
ChkAplicaNotaCredito.Enabled = False
DdlTipoCompra.Items.Clear()
DdlTipoCompra.Items.Add(New ListItem("Seleccione", "-1"))
DdlTipoCompra.Items.Add(New ListItem("NC Con Productos", "6"))
DdlTipoCompra.Items.Add(New ListItem("Apoyo Logístico", "9"))
DdlTipoCompra.Items.Add(New ListItem("NC Por Devolución", "11"))
DdlTipoCompra.Items.Add(New ListItem("Garantía", "12"))
Case "T"
DdlTipoCompra.Items.Clear()
DdlTipoCompra.Items.Add(New ListItem("Apoyo Logístico", "9"))
DdlTipoComprobante.SelectedValue = "Fac"
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("NC"))
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("DEV"))
End Select
'DIV ALIAS
CargaPSAlias()
RFC = dr("RFCDe").ToString
RFCProveedor = RFC
TxtFecha.Text = dr("FechaFactura").ToString.ToDate.ToShortDateString
TxtSerie.Text = dr("Serie").ToString
TxtFolio.Text = dr("Folio").ToString
DdlValidadaSAT.SelectedValue = If(dr("FueValidado").ToString.Contiene("Si", "1"), "Si", "No")
DdlValidadaSAT.Enabled = False
LblTipoFact.Text = dr("TipoFactura").ToString
SerieVieja = dr("Serie").ToString
LblMetodoPago.Text = MetodoPago
Dim SubTotal2, IVA, IEPS As Decimal
IVA = TrasladoIVA
If Not UsuarioActual.TienePermisoProceso(130) Then
TxtFolio.Enabled = False
TxtSerie.Enabled = False
End If
'PERMISO PARA MODIFICACIÓN DE FECHA AUN CON FACTURA
TxtFecha.Enabled = UsuarioActual.TienePermisoProceso(216)
ImgFecha.Enabled = UsuarioActual.TienePermisoProceso(216)
CEFecha.Enabled = UsuarioActual.TienePermisoProceso(216)
TxtSubTotal.Enabled = False
TxtDescuento.Enabled = False
TxtSubTotal2.Enabled = False
TxtIVA.Enabled = False
TxtTotal.Enabled = False
DdlProveedor.Enabled = False
If TxtFolio.Text.Trim = "" Then TxtFolio.Enabled = True : TxtSerie.Enabled = True
If UsuarioActual.TienePermisoProceso(112) Then
PermisoEdicionManual = True
TxtSubTotal.Enabled = True
TxtDescuento.Enabled = True
TxtSubTotal2.Enabled = True
TxtIVA.Enabled = True
TxtTotal.Enabled = True
End If
If UsuarioActual.Empresa.Funcionalidad(118) = "1" AndAlso DdlTipoComprobante.SelectedValue = "Fac" Then
VerVales.Visible = True
End If
If TieneAnticiposXML Then 'si tiene anticipos, limpia los descuentos
'LblAmortizacion.Text = ImporteAnticipo.FormatoNumero
TxtDescuento.Text = "0.00"
LblAmortizacion.Text = Descuentos.FormatoNumero
'limpia los descuentos
For Each drr As DataRow In TmpDT.Rows
'drr("Total") = drr("Total").ToString.ToDecimal + drr("Descuento").ToString.ToDecimal
drr("Amortizacion") = drr("Descuento") 'pasamos el importe de descuento a amortizacion
drr("Descuento") = 0.00
Next
Amortizaciones = Descuentos
Descuentos = 0
End If
Dim Msg As String = ""
If Version = "3.3" Or Version = "4.0" Then
If Not TmpDT.Columns.Contains("Amortizacion") Then
TmpDT.Columns.Add("Amortizacion", GetType(Decimal))
End If
TmpDT.AcceptChanges()
ValidacionesTotalesXml()
Else
'PRUEBA
'http://rm/Compras/Compras.aspx?CveFactura=122518 Emp: 48
'tTotal = Math.Round(SubTotal2 + IVA - RetencionIVA - RetencionISR + IEPS + OtrosImpuestos, 2)
HdnCompraSaldo.Value = Total.ToString
CompraSaldo = Total
Dim AjustaUltimoConcepto As Boolean = False
'AGREGA IEPS COMO CONCEPTO
If TrasladoIEPS > 0 And UsuarioActual.Empresa.Funcionalidad(112).ToString.ToEntero > 0 Then
AgregarConceptoIEPS(TrasladoIEPS, UsuarioActual.Empresa.Funcionalidad(112).ToString.ToEntero)
' TrasladoIEPS = 0
End If
'en otro impuesto lo esta registrando en ajuste en automatico
If OtrosImpuestos > 0 Then
AjustaUltimoConcepto = True
End If
If RFC = "CFE370814QI0" Then ' RFC de CFE, se hace un ajuste por diferencia para sacar el DAP
'OtrosImpuestos = Total - (SubTotal2 + IVA)
'este importe lo vamos a meter al gasto
'AjustaImporteUltimoConcepto(OtrosImpuestos)
OtrosImpuestos = 1
AjustaUltimoConcepto = True
'SubTotal2 = SubTotal
End If
Dim SubTotalReal As Decimal = 0
SubTotalReal = Math.Round(Total + RetencionISR + RetencionIVA - IVA + Descuentos - TrasladoIEPS, 2) ' NO se incluye otros impuestos para ajustar esa cifra
Dim DiferenciaTotales As Decimal = SubTotalReal - Math.Round(SubTotalConceptos, 2)
If DiferenciaTotales <> 0 Then
'Verificamos IEPS y Otros Impuestos
'restricccion general, que si el subtotal de los conceptos no cuadra con Total + RetISR + RetIVA - IVA <> SubTotalConeptos, ajuste al final
If TrasladoIEPS > 0 OrElse OtrosImpuestos > 0 OrElse Math.Abs(DiferenciaTotales) < 1 Then
'Condicion necesaria cuando hay IVA pero no hay diferencia
If DiferenciaTotales <> 0 Then
If DiferenciaTotales < 50 OrElse AjustaUltimoConcepto = True Then
Dim IA As Decimal = Total + RetencionISR + RetencionIVA - IVA - SubTotalConceptos - TrasladoIEPS + Descuentos
AjustaImporteUltimoConcepto(IA, True)
ElseIf DiferenciaTotales > 50 Then
PnlAjusteProductos.Visible = True
Dim Porcentaje As Double = Math.Round((SubTotalConceptos - SubTotalReal) / SubTotalConceptos * 100, 2)
TxtAjustePorcentaje.Text = Porcentaje.FormatoNumero
Msg &= String.Format("La Factura presenta anomalias en los importes mostrados, estas anomalias impiden que se editen las partidas. Por favor realice el ajuste correspondiente <br>")
ImgBtnBuscarOC.Visible = False : TxtOC.Enabled = False
'Ocultamos la opcion de Editar y Eliminar hasta que se arreglen las anomalias
For Each Row As GridViewRow In GvPS.Rows
Row.FCLinkButton("imgE").Visible = False
Row.FCLinkButton("imgD").Visible = False
Next
End If
End If
TrasladoIEPS = 0 : OtrosImpuestos = 0 : SubTotal2 = SubTotal
Else
PnlAjusteProductos.Visible = True
Dim Porcentaje As Double = If(SubTotalConceptos > 0, Math.Round((SubTotalConceptos - SubTotalReal) / SubTotalConceptos * 100, 2), 0)
TxtAjustePorcentaje.Text = Porcentaje.FormatoNumero
Msg &= String.Format("La Factura presenta anomalias en los importes mostrados, estas anomalias impiden que se editen las partidas. Por favor realice el ajuste correspondiente <br>")
ImgBtnBuscarOC.Visible = False : TxtOC.Enabled = False
'Ocultamos la opcion de Editar y Eliminar hasta que se arreglen las anomalias
For Each Row As GridViewRow In GvPS.Rows
Row.FCLinkButton("imgE").Visible = False
Row.FCLinkButton("imgD").Visible = False
Next
End If
End If
'Si no hay diferencias pero tenemos descuento, se ofrece la opcion para ajustar el gasto
If Descuentos > 0 Then
'[IPP] PARCHE: Factura TELMEX para APH 12/ENERO/2018
If CveFactura = 286290 Then
Else
PnlAjusteProductos.Visible = True
Dim Porcentaje As Double = Math.Round((Descuentos) / (SubTotalConceptos) * 100, 4)
TxtAjustePorcentaje.Text = Porcentaje.FormatoNumero(4)
Msg &= String.Format("La Factura presenta anomalias en los importes mostrados, estas anomalias impiden que se editen las partidas. Por favor realice el ajuste correspondiente <br>")
ImgBtnBuscarOC.Visible = False : TxtOC.Enabled = False
'Ocultamos la opcion de Editar y Eliminar hasta que se arreglen las anomalias
For Each Row As GridViewRow In GvPS.Rows
Row.FCLinkButton("imgE").Visible = False
Row.FCLinkButton("imgD").Visible = False
Next
End If
End If
SubTotal2 = SubTotalReal - Descuentos
If Descuentos > 0 Then
TrDescuento.Visible = True
End If
If Msg <> "" Then
Alert(Msg, TipoMensaje.MsgAdvertencia)
BtnGuardar.Enabled = False
End If
'AJUSTAMOS SUBTOTAL EN CASO DE SER DIFERENTE AL SUBTOTAL2 DEL XML (TOTAL - IVA)
If SubTotal2 <> SubTotal Then
SubTotal = SubTotalConceptos
End If
TxtSubTotal.Text = SubTotal.FormatoNumero
TxtDescuento.Text = Descuentos.FormatoNumero
TxtSubTotal2.Text = SubTotal2.FormatoNumero
TxtIVA.Text = IVA.FormatoNumero
TxtTotal.Text = Total.ToString.FormatoNumero
HfTotalCompra.Value = Total.ToString
CompraSaldo = Total
CalculaTotalPorDevengar()
TxtDocumentoImporteFE.Text = Total.ToString
RVDocumentoImporte.MaximumValue = Math.Round(Total, 2).ToString
RVDocumentoImporteFE.MaximumValue = RVDocumentoImporte.MaximumValue
RVDocumentoImporteCaja.MaximumValue = RVDocumentoImporte.MaximumValue
TxtDocumentoImporte.Text = Total.FormatoNumero
TxtDocumentoImporteCaja.Text = Total.FormatoNumero
TxtRetIVA.Text = RetencionIVA.FormatoNumero
TxtRetISR.Text = RetencionISR.FormatoNumero
TxtIEPS.Text = IEPS.FormatoNumero
If IEPS > 0 Then TrIEPS.Visible = True
If RetencionIVA > 0 Then TrRetIVA.Visible = True
If RetencionISR > 0 Then TrRetISR.Visible = True
TxtOtrosImpuestos.Text = OtrosImpuestos.FormatoNumero
If OtrosImpuestos > 0 Then TrOtrosImpuestos.Visible = True
HFDiferenciaCompra.Value = TxtTotal.Text
'ASIGNA VALORES ORIGINALES PARA GUARDAR
AsignaValoresOriginales(SubTotal, SubTotal2, IVA, RetencionIVA, RetencionISR, Total)
End If
TxtFechaPago.Text = (TxtFecha.Text.ToDate.AddDays(LblDiasCredito.Text.ToEntero)).ToShortDateString
Dim drMon As DataRow = GlobalDTMonedas.FiltroPrimero(String.Format(" (Abreviatura LIKE '%{0}%' OR Moneda LIKE '%{0}%' )", Moneda))
If drMon IsNot Nothing Then
DdlMoneda.SelectedValue = drMon("CveMoneda").ToString
CveMoneda = drMon("CveMoneda").ToString.ToEntero
Else
'sino busco en la tabla de alias
drMon = GlobalDTMonedasAlias.FiltroPrimero(String.Format("MonedaAlias LIKE '%{0}%' ", Moneda))
If drMon IsNot Nothing Then
DdlMoneda.SelectedValue = drMon("CveMoneda").ToString
CveMoneda = drMon("CveMoneda").ToString.ToEntero
Else
'sino busco en la tabla de alias
drMon = GlobalDTMonedasAlias.FiltroPrimero(String.Format("MonedaAlias LIKE '%{0}%' ", Moneda))
If drMon IsNot Nothing Then
DdlMoneda.SelectedValue = drMon("CveMoneda").ToString
CveMoneda = drMon("CveMoneda").ToString.ToEntero
Else
LblMoneda.Text = Moneda
LblMoneda.ForeColor = Drawing.Color.Red
End If
End If
If DdlMoneda.SelectedValue.ToEntero > 1 Then
If TipoCambio <= 10 Then
TipoCambio = GlobalTipoCambio(TxtFecha.Text.ToDate).ToDecimal
End If
TxtFecha.Attributes.Remove("onblur")
If UsuarioActual.Empresa.UsaAC Then
TxtFecha.Attributes.Add("onblur", "CambiaFecha();CambiaFechaTC();")
Else
TxtFecha.Attributes.Add("onblur", "CambiaFechaTC();")
End If
End If
If TipoCambio > 0 And DdlMoneda.SelectedValue.ToEntero > 1 Then LblTC.Text = String.Format("TC: {0}", TipoCambio.ToString("N4"))
'DF - 10-04-17
If UsuarioActual.TienePermisoProceso(187) Then
TxtSerie.Enabled = True
End If
If LblMetodoPago.Text = "" AndAlso TipoComprobante <> "T" Then
Alert("El xml no contiene la etiqueta 'método de pago', favor de verificar la emisión con el proveedor.", TipoMensaje.MsgAdvertencia)
BtnGuardar.Visible = False
LblMoneda.Text = Moneda
LblMoneda.ForeColor = Drawing.Color.Red
End If
End If
Else
If DdlMoneda.SelectedValue.ToEntero > 1 Then
If TipoCambio <= 10 Then
TipoCambio = GlobalTipoCambio(TxtFecha.Text.ToDate).ToDecimal
End If
TxtFecha.Attributes.Remove("onblur")
If UsuarioActual.Empresa.UsaAC Then
TxtFecha.Attributes.Add("onblur", "CambiaFecha();CambiaFechaTC();")
Else
TxtFecha.Attributes.Add("onblur", "CambiaFechaTC();")
End If
End If
If TipoCambio > 0 And DdlMoneda.SelectedValue.ToEntero > 1 Then LblTC.Text = String.Format("TC: {0}", TipoCambio.ToString("N4"))
'DF - 10-04-17
If UsuarioActual.TienePermisoProceso(187) Then
TxtSerie.Enabled = True
End If
If LblMetodoPago.Text = "" AndAlso TipoComprobante <> "T" Then
Alert("El xml no contiene la etiqueta 'método de pago', favor de verificar la emisión con el proveedor.", TipoMensaje.MsgAdvertencia)
BtnGuardar.Visible = False
End If
End If
Else
Alert("No se Encontró la Factura", TipoMensaje.MsgAdvertencia)
BtnGuardar.Visible = False
End If
@@ -3549,12 +3549,23 @@ Partial Class Compras_Compras
ViewState("CveProveedor") = ObjProveedor.CveProveedor
HdnCveProveedor.Value = ObjProveedor.CveProveedor.ToString
TxtFechaPago.Text = (TxtFecha.Text.ToDate.AddDays(LblDiasCredito.Text.ToEntero)).ToShortDateString
RFCProveedor = ObjProveedor.RFC
'comentado RMF.2024.05.21. en anticipos parciales, está bloquenado
'If MetodoPagoOC = 0 AndAlso RBLPago.SelectedValue.ToEntero <> 2 Then
CveRegimenFiscalProveedor = ObjProveedor.CveRegimenFiscal
If CveFactura > 0 Then
' Dim ImporteAnticipoComision As Decimal = 0
' If ArrAnticipos.Count > 0 Then
' For Each Ant As Compras_Compras.Anticipos In ArrAnticipos
' ImporteAnticipoComision += Ant.ImporteComision
' Next
' End If
If RetIVAOriginal > 0 Then
' If (LblSaldoFactura.Text.ToDecimal - ImporteAnticipoComision) > 0 Then
' Alert("La orden de compra se definió de contado, favor de especificar la compra de contado.", TipoMensaje.MsgAdvertencia)
' Exit Sub
' End If
'End If
If RetIVAOriginal > 0 Then
Dim CalRetIVAPor As Decimal = (RetIVAOriginal * 1 / SubTotal2Original).RoundAD(6).ToDecimal
If (CalRetIVAPor).RoundSQL(5) = 0.10666 OrElse (CalRetIVAPor).RoundSQL(5) = 0.05333 Then
@@ -4193,21 +4204,10 @@ Partial Class Compras_Compras
'------------------ INICIA VALIDACIONES ------------------
'comentado RMF.2024.05.21. en anticipos parciales, está bloquenado
'If MetodoPagoOC = 0 AndAlso RBLPago.SelectedValue.ToEntero <> 2 Then
' Dim ImporteAnticipoComision As Decimal = 0
' If ArrAnticipos.Count > 0 Then
' For Each Ant As Compras_Compras.Anticipos In ArrAnticipos
' ImporteAnticipoComision += Ant.ImporteComision
' Next
' End If
' If (LblSaldoFactura.Text.ToDecimal - ImporteAnticipoComision) > 0 Then
' Alert("La orden de compra se definió de contado, favor de especificar la compra de contado.", TipoMensaje.MsgAdvertencia)
' Exit Sub
' End If
'End If
If MetodoPagoOC = 0 AndAlso RBLPago.SelectedValue.ToEntero <> 2 AndAlso LblSaldoFactura.Text.ToDecimal > 0 Then
Alert("La orden de compra se definió de contado, favor de especificar la compra de contado.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim CveSubProyectoPrincipal As Integer = AsignarSubProyectoPrincipal()
@@ -7251,20 +7251,22 @@ Partial Class Compras_Compras
ErrorPrepoliza = True
End If
Else
Dim ImporteAntMNComision As Decimal = (ImporteAnt + ImporComisionAnticipo) * TipoCambioAnt
'Dim ImporteAntMNComision As Decimal = (ImporteAnt + ImporComisionAnticipo) * TipoCambioAnt
Dim ImporteAntMNComision As Decimal = (ImporteAnt) * TipoCambioAnt
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, (ImporteAnt + ImporComisionAnticipo), ImporteAntMNComision, ConceptoContableAnticipo, Referencia, Concepto, CveCompra:=CveCompraNC, CveCompraAmortizacion:=CveCompra, CveProveedor:=CveProveedorLocal, CveIE:=Ant.CveIE, ImporteME:=If(tipoCambioActual = 1, 0, (ImporteAnt + ImporComisionAnticipo)), TipoCambio:=TipoCambioAnt, Contabilizable:=SeContabiliza) Then
'If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, (ImporteAnt + ImporComisionAnticipo), ImporteAntMNComision, ConceptoContableAnticipo, Referencia, Concepto, CveCompra:=CveCompraNC, CveCompraAmortizacion:=CveCompra, CveProveedor:=CveProveedorLocal, CveIE:=Ant.CveIE, ImporteME:=If(tipoCambioActual = 1, 0, (ImporteAnt + ImporComisionAnticipo)), TipoCambio:=TipoCambioAnt, Contabilizable:=SeContabiliza) Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, (ImporteAnt), ImporteAntMNComision, ConceptoContableAnticipo, Referencia, Concepto, CveCompra:=CveCompraNC, CveCompraAmortizacion:=CveCompra, CveProveedor:=CveProveedorLocal, CveIE:=Ant.CveIE, ImporteME:=If(tipoCambioActual = 1, 0, (ImporteAnt)), TipoCambio:=TipoCambioAnt, Contabilizable:=SeContabiliza) Then
ErrorPrepoliza = True
End If
End If
If TxtTotal.Text.ToDouble > 0 AndAlso TieneAnticiposXML = False Then
Dim Pago As New CompraPago
Pago.ImportePago = importeMovimiento
Pago.ImportePago = importeMovimiento + ImporComisionAnticipo
Pago.CveIE = Ant.CveIE
Pago.TCPago = Ant.TCCompra
Pago.CveMonedaPago = If(Ant.TCCompra > 1, 2, 1)
Pago.OtroGastoIngreso = ImporComisionAnticipo
Pago.OtroGastoIngreso = -ImporComisionAnticipo
ErrorPrepoliza = AplicaPrePolizaPagoCompra(CompraActual, Pago, CvePrePoliza, ObjConta)
End If
@@ -8491,7 +8493,8 @@ Partial Class Compras_Compras
Dim ImporteAnticipo As Decimal = 0
If ArrAnticipos.Count > 0 Then
For Each Ant As Compras_Compras.Anticipos In ArrAnticipos
ImporteAnticipo += Ant.Importe
'ImporteAnticipo += (Ant.Importe + Ant.ImporteComision)
ImporteAnticipo += (Ant.Importe)
Next
End If
@@ -9773,22 +9776,30 @@ Partial Class Compras_Compras
Dim tTCFecha As Double = If(Not e.Row.DBCampo("TCCompra").ToDouble > 1, GlobalTipoCambio(e.Row.DBCampo("Fecha").ToDate), e.Row.DBCampo("TCCompra").ToDouble)
e.Row.FCCheckBox("Chk").Attributes.Add("onclick", String.Format("chkAnt(this,{0},{1},{2},{3},{4},{5},{6});",
If UsuarioActual.Empresa.CveEmpresa.Contiene(13, 83) Then
e.Row.FCCheckBox("Chk").Attributes.Add("onclick", String.Format("chkAnt(this,{0},{1},{2},{3},{4},{5},{6},{7});",
e.Row.FCTextBox("TxtAnticipo").ClientID,
e.Row.DBCampo("Saldo"),
If(CveCompra > 0, CompraSaldo, ImporteAmortizacion),
e.Row.DBCampo("CveMoneda"),
e.Row.DBCampo("TCCompra").ToDouble,
DdlMoneda.SelectedValue,
IIf(DdlMoneda.SelectedValue = "1", 1, TxtTC.Text))) 'SI ES UNA COMPRA NUEVA SE PONE EL TOTAL, SI NO EL SALDO
IIf(DdlMoneda.SelectedValue = "1", 1, TxtTC.Text),
e.Row.FCTextBox("TxtComision").ClientID
)) 'SI ES UNA COMPRA NUEVA SE PONE EL TOTAL, SI NO EL SALDO
If UsuarioActual.Empresa.CveEmpresa.Contiene(13, 83) Then
e.Row.FCTextBox("TxtAnticipo").Attributes.Add("onKeyUp", String.Format("FnCambiaAnt({0},this,{1},{2},{3},{4},{5},{6});",
e.Row.FCCheckBox("Chk").ClientID,
e.Row.DBCampo("Saldo"),
If(CveCompra > 0, CompraSaldo, ImporteAmortizacion), e.Row.DBCampo("CveMoneda").ToEntero,
If(CveCompra > 0, CompraSaldo, ImporteAmortizacion),
e.Row.DBCampo("CveMoneda").ToEntero,
tTCFecha,
DdlMoneda.SelectedValue.ToEntero,
e.Row.FCTextBox("TxtComision").ClientID)) 'SI ES UNA COMPRA NUEVA SE PONE EL TOTAL, SI NO EL SALDO
@@ -9802,6 +9813,17 @@ Partial Class Compras_Compras
DdlMoneda.SelectedValue.ToEntero,
e.Row.FCTextBox("TxtAnticipo").ClientID))
Else
e.Row.FCCheckBox("Chk").Attributes.Add("onclick", String.Format("chkAnt(this,{0},{1},{2},{3},{4},{5},{6});",
e.Row.FCTextBox("TxtAnticipo").ClientID,
e.Row.DBCampo("Saldo"),
If(CveCompra > 0, CompraSaldo, ImporteAmortizacion),
e.Row.DBCampo("CveMoneda"),
e.Row.DBCampo("TCCompra").ToDouble,
DdlMoneda.SelectedValue,
IIf(DdlMoneda.SelectedValue = "1", 1, TxtTC.Text)
)) 'SI ES UNA COMPRA NUEVA SE PONE EL TOTAL, SI NO EL SALDO
e.Row.FCTextBox("TxtAnticipo").Attributes.Add("onKeyUp", String.Format("FnCambiaAnt({0},this,{1},{2},{3},{4},{5});",
e.Row.FCCheckBox("Chk").ClientID,
e.Row.DBCampo("Saldo"),

View File

@@ -10,6 +10,17 @@
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<asp:UpdatePanel runat="server" ID="UpAcciones" UpdateMode="Conditional">
<ContentTemplate>
<li>
<asp:LinkButton runat="server" ID="LnkAccionesAgregarClasificacion" data-toggle="tooltip" Visible ="false" OnClick="LnkAccionesAgregarClasificacion_Click"
data-placement="left" title="Agregar Clasificación" Text="<i class='fa fa-plus'></i> Agregar Clasificación"></asp:LinkButton>
</li>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
@@ -98,7 +109,7 @@
</div>
</div>
<div class="portlet-body">
<div class="rowpadding">
<div class="rowpadding" id="content" >
<asp:UpdatePanel ID="UpGvClasificaciones" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvPresupuestos" runat="server" ShowFooter="true" GridLines="None" EmptyDataText="No se encontraron presupuestos" CssClass="table table-hover table-striped Widthall ScrollAD" AutoGenerateColumns="False" data-heighterror="600"
@@ -162,12 +173,50 @@
<div class="row">
<div class="col-md-5"></div>
<div class="col-md-2">
<asp:Button ID="BtnGuardar" runat="server" OnClick="BtnGuardar_Click" Text="Guardar" CssClass="btn btn-primary" ValidationGroup="GrpGuardar" />
<asp:Button ID="BtnGuardar" runat="server" OnClick="BtnGuardar_Click" Text="Guardar" CssClass="btn btn-primary" ValidationGroup="GrpGuardar" />
</div>
<div class="col-md-5"></div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<div id="DVModalAgregarClasificacion" class="modal ADS fade" role="dialog">
<div class="modal-dialog" style="width: 450px;">
<asp:UpdatePanel runat="server" class="modal-content" ID="UpModalAgregarClasicicacion" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">
<asp:Literal ID="LtlTituloModalAgregarClasificacion" runat="server">Agregar Clasificación</asp:Literal></h4>
</div>
<div class="modal-body">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlModalClasificacion" CssClass="form-control select2me" runat="server" DataTextField="Clasificacion" DataValueField="CveClasificacion" Width="100%" >
<asp:ListItem Value="-1">Seleccione Una</asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlModalClasificacion" InitialValue="-1" runat="server" ControlToValidate="DdlModalClasificacion" CssClass="help-block errorimput"
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Clasificación''</b> es necesario, por favor ingréselo."
ValidationGroup="GrpGuardarMedico"></asp:RequiredFieldValidator>
<label for="<%= DdlModalClasificacion.ClientID.ToString()%>">Clasificación:</label>
<i></i>
</div>
</div>
<div class="modal-footer">
<asp:Button ID="LnkModalAgregarClasificacion" runat="server" class="btn btn-success" Text="Agregar" ValidationGroup="GrpAgregarClasificacion" OnClick="LnkModalAgregarClasificacion_Click" />
<button id="BtnModalCancelarAgregarClasificacion" runat="server" type="button" class="btn default" data-dismiss="modal">Cancelar</button>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
<script type="text/javascript">
@@ -292,6 +341,23 @@
return numero;
}
//function scrollToTableCell(text) {
// const table = document.getElementById('ADSH-C_GvPresupuestos');
// const rows = table.getElementsByTagName('tr');
// for (let row of rows) {
// const cells = row.getElementsByTagName('td');
// for (let cell of cells) {
// if (cell.textContent.includes(text)) {
// cell.scrollIntoView({ behavior: 'smooth' });
// cell.classList.add('highlight');
// return;
// }
// }
// }
//}
</script>
</asp:Content>

View File

@@ -88,11 +88,13 @@ Partial Class Contratos_ModificarPresupuesto
#Region "C A R G A - D A T O S"
Private Sub CargaDatos()
Dim CvePresupuesto = DdlPresupuesto.SelectedValue.ToEntero
Dim Nombre = "-1"
Dim CveSubProyecto = -1
Dim CveUsuario = -1
Dim Agrupador = 1 'CLASIFICACION
If CvePresupuesto > 0 Then
TxtFecha.Text = NowADS().ToString("dd/MM/yyyy")
Dim DrPresupuesto = DtPresupuestos.FiltroPrimero($"CvePresupuesto = {CvePresupuesto}")
@@ -131,10 +133,22 @@ Partial Class Contratos_ModificarPresupuesto
GvPresupuestos.Columns(3).Visible = True
GvPresupuestos.Columns(4).Visible = True
End Select
Else
DtClasificaciones = New DataTable
GvPresupuestos.DataSource = DtClasificaciones
GvPresupuestos.DataBind()
End If
ValidaAcciones()
End Sub
Protected Sub GvPresupuestos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvPresupuestos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
Dim StrTipo = DdlTipo.SelectedValue
@@ -286,4 +300,74 @@ Partial Class Contratos_ModificarPresupuesto
End If
End Sub
Private Sub ValidaAcciones()
LnkAccionesAgregarClasificacion.Visible = False
If DtClasificaciones IsNot Nothing AndAlso DtClasificaciones.Rows.Count > 0 Then
LnkAccionesAgregarClasificacion.Visible = True
End If
UpAcciones.Update()
End Sub
Protected Sub LnkAccionesAgregarClasificacion_Click(sender As Object, e As EventArgs)
CargaAccionesDdlclasificaciones()
RegistraScript("$('#DVModalAgregarClasificacion').modal();")
End Sub
Private Sub CargaAccionesDdlclasificaciones()
Dim dtClasificaciones As DataTable = Me.DtClasificaciones.Copy
Dim globalDtClasificacionesn As DataTable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltraParametros("Tipo = 1 AND Estado = 1 ").Copy
Dim filteredRecords = From globalRow In globalDtClasificacionesn.AsEnumerable()
Where Not dtClasificaciones.AsEnumerable().Any(Function(dtRow) dtRow.Field(Of Integer)("CveClasificacion") = globalRow.Field(Of Integer)("CveClasificacion"))
Select globalRow
Dim resultTable As DataTable = globalDtClasificacionesn.Clone()
For Each row In filteredRecords
resultTable.ImportRow(row)
Next
DdlModalClasificacion.DataSource = resultTable
DdlModalClasificacion.DataBind()
DdlModalClasificacion.Items.Insert(0, New ListItem("Seleccione Una", "-1"))
UpModalAgregarClasicicacion.Update()
End Sub
Protected Sub LnkModalAgregarClasificacion_Click(sender As Object, e As EventArgs)
Dim CvePresupuesto = DdlPresupuesto.SelectedValue.ToEntero
Dim CveClasificacion As Integer = DdlModalClasificacion.SelectedValue.ToEntero
If CveClasificacion > 0 Then
Dim ObjCont As New ClsContratos
Dim TieneError As Boolean = False
If Not ObjCont.AddPresupuestosDetalle(CvePresupuesto, CveClasificacion, -1, 0, "") Then
TieneError = True
End If
ObjCont.Dispose()
If Not TieneError Then
RegistraScript($"$('#DVModalAgregarClasificacion').modal('hide');")
Alert($"Clasificación {DdlModalClasificacion.SelectedItem.Text} agregada correctamente.")
CargaDatos()
UpGvClasificaciones.Update()
End If
End If
End Sub
End Class

View File

@@ -402,6 +402,7 @@
<Value>=Fields!SerieFolio.Value</Value>
<Style>
<FontSize>8pt</FontSize>
<Color>=IIF(Fields!CveVenta.Value = nothing,"White","Black")</Color>
</Style>
</TextRun>
</TextRuns>
@@ -415,6 +416,7 @@
<Border>
<Style>None</Style>
</Border>
<BackgroundColor>=IIF(Fields!CveVenta.Value = nothing,IIF(Fields!MetodoPago.Value = "","#5E738B","#578EBE"),"White")</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
@@ -434,6 +436,7 @@
<Value>=Fields!NombreComercial.Value</Value>
<Style>
<FontSize>8pt</FontSize>
<Color>=IIF(Fields!CveVenta.Value = nothing,"White","Black")</Color>
</Style>
</TextRun>
</TextRuns>
@@ -447,6 +450,7 @@
<Border>
<Style>None</Style>
</Border>
<BackgroundColor>=IIF(Fields!CveVenta.Value = nothing,IIF(Fields!MetodoPago.Value = "","#5E738B","#578EBE"),"White")</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
@@ -468,6 +472,7 @@
<Style>
<FontSize>8pt</FontSize>
<Format>#,0.00</Format>
<Color>=IIF(Fields!CveVenta.Value = nothing,"White","Black")</Color>
</Style>
</TextRun>
</TextRuns>
@@ -481,6 +486,7 @@
<Border>
<Style>None</Style>
</Border>
<BackgroundColor>=IIF(Fields!CveVenta.Value = nothing,IIF(Fields!MetodoPago.Value = "","#5E738B","#578EBE"),"White")</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
@@ -501,6 +507,7 @@
<Value>=Fields!MetodoPago.Value</Value>
<Style>
<FontSize>8pt</FontSize>
<Color>=IIF(Fields!CveVenta.Value = nothing,"White","Black")</Color>
</Style>
</TextRun>
</TextRuns>
@@ -514,6 +521,7 @@
<Border>
<Style>None</Style>
</Border>
<BackgroundColor>=IIF(Fields!CveVenta.Value = nothing,IIF(Fields!MetodoPago.Value = "","#5E738B","#578EBE"),"White")</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
@@ -1668,6 +1676,10 @@
<CommandText>/* Local Query */</CommandText>
</Query>
<Fields>
<Field Name="CveVenta">
<DataField>CveVenta</DataField>
<rd:TypeName>System.Integer</rd:TypeName>
</Field>
<Field Name="SerieFolio">
<DataField>SerieFolio</DataField>
<rd:TypeName>System.String</rd:TypeName>

View File

@@ -182,6 +182,7 @@
<Value>=Fields!SerieFolio.Value</Value>
<Style>
<FontSize>8pt</FontSize>
<Color>=IIF(Fields!CveVenta.Value = nothing,"White","Black")</Color>
</Style>
</TextRun>
</TextRuns>
@@ -195,6 +196,7 @@
<Border>
<Style>None</Style>
</Border>
<BackgroundColor>=IIF(Fields!CveVenta.Value = nothing,IIF(Fields!MetodoPago.Value = "","#5E738B","#578EBE"),"White")</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
@@ -214,6 +216,7 @@
<Value>=Fields!NombreComercial.Value</Value>
<Style>
<FontSize>8pt</FontSize>
<Color>=IIF(Fields!CveVenta.Value = nothing,"White","Black")</Color>
</Style>
</TextRun>
</TextRuns>
@@ -227,6 +230,7 @@
<Border>
<Style>None</Style>
</Border>
<BackgroundColor>=IIF(Fields!CveVenta.Value = nothing,IIF(Fields!MetodoPago.Value = "","#5E738B","#578EBE"),"White")</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
@@ -248,6 +252,7 @@
<Style>
<FontSize>8pt</FontSize>
<Format>#,0.00</Format>
<Color>=IIF(Fields!CveVenta.Value = nothing,"White","Black")</Color>
</Style>
</TextRun>
</TextRuns>
@@ -261,6 +266,7 @@
<Border>
<Style>None</Style>
</Border>
<BackgroundColor>=IIF(Fields!CveVenta.Value = nothing,IIF(Fields!MetodoPago.Value = "","#5E738B","#578EBE"),"White")</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
@@ -281,6 +287,7 @@
<Value>=Fields!MetodoPago.Value</Value>
<Style>
<FontSize>8pt</FontSize>
<Color>=IIF(Fields!CveVenta.Value = nothing,"White","Black")</Color>
</Style>
</TextRun>
</TextRuns>
@@ -294,6 +301,7 @@
<Border>
<Style>None</Style>
</Border>
<BackgroundColor>=IIF(Fields!CveVenta.Value = nothing,IIF(Fields!MetodoPago.Value = "","#5E738B","#578EBE"),"White")</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
@@ -2577,6 +2585,10 @@
<CommandText>/* Local Query */</CommandText>
</Query>
<Fields>
<Field Name="CveVenta">
<DataField>CveVenta</DataField>
<rd:TypeName>System.Integer</rd:TypeName>
</Field>
<Field Name="SerieFolio">
<DataField>SerieFolio</DataField>
<rd:TypeName>System.String</rd:TypeName>

View File

@@ -717,6 +717,11 @@ Partial Class Inventarios_EntregaAlmacen
LbObservacionesAlmacen.Text = drE("ObservacionesAlmacen").ToString()
CveVentaSurtir = CveVenta
CveOSSurtir = CveOS
If TipoDocto = "Ped" And CveOSSurtir <= 0 Then
CveOSSurtir = drE("CveOS").ToString().ToEntero
End If
CveTipoVenta = drE("CveTipoVenta").ToString().ToEntero
CveAlmacenTraspasoDestino = drE(If(EsDevolucionVenta = 1 And TipoDocto <> "Rem" And TipoDocto <> "Ped", "CveAlmacenTraspasoOrigen", "CveAlmacenTraspasoDestino")).ToString().ToEntero()
CveAlmacenTraspasoOrigen = drE(If(EsDevolucionVenta = 1 And TipoDocto <> "Rem" And TipoDocto <> "Ped", "CveAlmacenTraspasoDestino", "CveAlmacenTraspasoOrigen")).ToString().ToEntero()
@@ -1062,7 +1067,8 @@ Partial Class Inventarios_EntregaAlmacen
If CargaBitacora Then
CargaBitacoraSerie()
End If
End If
Else
End If
End If
@@ -4352,7 +4358,13 @@ Partial Class Inventarios_EntregaAlmacen
Private Sub RecargaporAlmacenes()
If DdlAlmacen.SelectedValue <> "-1" Then
CargaGvDatos()
If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then
CargaGvDatos(False)
Else
CargaGvDatos()
End If
End If
End Sub

View File

@@ -2646,6 +2646,10 @@ Partial Class OC_OC
End Function
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click
If Not ValidaTotales() Then
Exit Sub
End If
'VALIDACIONES PARA GUARDAR
If ValidaGuardar() Then Exit Sub
@@ -2653,6 +2657,8 @@ Partial Class OC_OC
Exit Sub
End If
Dim MsgError As String = "Hubo un error al registrar"
'VARIABLES
Dim CveProveedorSucursal As Integer = -1
@@ -3348,6 +3354,30 @@ Partial Class OC_OC
End Sub
Private Function ValidaTotales() As Boolean
Dim Subtotal As Decimal = DtDetalle.SUMD("Total", "Total > 0") + DtDetalle.SUMD("Descuento")
Dim Descuento As Decimal = DtDetalle.SUMD("Descuento").RoundSQL
Dim SubTotalIEPSIVA As Decimal = DtDetalle.SUMD("IEPSPSIVA")
Dim IVA As Decimal = DtDetalle.SUMD("IVA") + SubTotalIEPSIVA
Dim SubTotalIEPS As Decimal = DtDetalle.SUMD("IEPSPS")
Dim SubTotalRetIVA As Decimal = DtDetalle.SUMD("RetIVA")
Dim SubTotalRetISR As Decimal = DtDetalle.SUMD("RetISR")
Dim Total As Decimal = (Subtotal - Descuento + IVA + SubTotalIEPS - SubTotalRetIVA - SubTotalRetISR)
Dim Diferencia As Decimal = (Total - LblTotal.Text.ToDecimal).RoundSQL(2)
If Math.Abs(Diferencia) > 0 Then
Alert($"Existe una diferencia de {Diferencia.ToString("###,###,###.00")} entre el Total y las Partidas.", TipoMensaje.MsgAdvertencia)
Return False
Else
Return True
End If
End Function
Protected Function GeneraOrdenes(ByRef objOrdenCompra As ClsOC, Conta As ClsContPAQi, ByRef ObjInventarios As ClsInventarios) As Boolean
'If Ddlcliente.txtValue.Value.ToEntero > 0 And DdlVendedor.SelectedValue.ToEntero <= 0 Then

View File

@@ -227,7 +227,7 @@ Partial Class UserControl_AddMedico
TxtFechaIng.Text = ""
TxtUsuario.Text = ""
DdlVendedor.SelectedValueExist(-1)
DdlVendedor.SelectedValueExist(UsuarioActual.CveVendedor)
CargaGVMedicoClienteSucursal(-1, UsuarioActual.CveEmpresa)

View File

@@ -186,33 +186,31 @@ Partial Class Ventas_CatClasificaciones2
Protected Sub LbAgregarS_Click(sender As Object, e As EventArgs) Handles LbAgregarS.Click
Dim ObjClasificaciones As New ClsClasificaciones
'If ObjClasificaciones.AddClasificaciones(TxtClasificacionS.Text.Trim, "",
' -1, "", -1, "", -1, "",
' DdlCategoriaS.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, RequiereAFCompra:=False, RequiereAFInsumo:=False, RequierePersonal:=False) Then
If ObjClasificaciones.AddClasificaciones(TxtClasificacionS.Text.Trim, "", DdlCategoriaS.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, RequiereAFCompra:=False, RequiereAFInsumo:=False, RequierePersonal:=False) Then
' 'DdlCuentaGastoS.SelectedValue.ToEntero, DdlCuentaGastoS.SelectedItem.Text,
' 'DdlCuentaAnticipoS.SelectedValue.ToEntero, DdlCuentaAnticipoS.SelectedItem.Text,
' 'DdlCuentaInventarioS.SelectedValue.ToEntero, DdlCuentaInventarioS.SelectedItem.Text,
' TxtClasificacionS.Text = ""
' Alert("La nueva Clasificación se guardó correctamente.", TipoMensaje.MsgInformacion)
' UpTitulosS.Update()
'DdlCuentaGastoS.SelectedValue.ToEntero, DdlCuentaGastoS.SelectedItem.Text,
'DdlCuentaAnticipoS.SelectedValue.ToEntero, DdlCuentaAnticipoS.SelectedItem.Text,
'DdlCuentaInventarioS.SelectedValue.ToEntero, DdlCuentaInventarioS.SelectedItem.Text,
TxtClasificacionS.Text = ""
Alert("La nueva Clasificación se guardó correctamente.", TipoMensaje.MsgInformacion)
UpTitulosS.Update()
' If ObjClasificaciones.GetClasificaciones(-1, 4) Then
' GlobalDTClasificaciones2(UsuarioActual.CveEmpresa) = Nothing
' ViewState("DTClasificacion2") = ObjClasificaciones.DtResultados.FiltraParametros(String.Format("CveEmpresa = {0}", UsuarioActual.CveEmpresa))
' GlobalDTClasificaciones2(UsuarioActual.CveEmpresa) = ObjClasificaciones.DtResultados.FiltraParametros(String.Format("CveEmpresa = {0}", UsuarioActual.CveEmpresa))
' End If
If ObjClasificaciones.GetClasificaciones(-1, 4) Then
GlobalDTClasificaciones2(UsuarioActual.CveEmpresa) = Nothing
ViewState("DTClasificacion2") = ObjClasificaciones.DtResultados.FiltraParametros(String.Format("CveEmpresa = {0}", UsuarioActual.CveEmpresa))
GlobalDTClasificaciones2(UsuarioActual.CveEmpresa) = ObjClasificaciones.DtResultados.FiltraParametros(String.Format("CveEmpresa = {0}", UsuarioActual.CveEmpresa))
End If
' 'DdlCuentaGastoS.SelectedValue = "-1"
' 'DdlCuentaAnticipoS.SelectedValue = "-1"
' 'DdlCuentaInventarioS.SelectedValue = "-1"
'DdlCuentaGastoS.SelectedValue = "-1"
'DdlCuentaAnticipoS.SelectedValue = "-1"
'DdlCuentaInventarioS.SelectedValue = "-1"
' If ViewState("Orden2").ToString() <> String.Empty Then
' CargaGridS(ViewState("Orden2").ToString())
' Else
' CargaGridS("")
' End If
'End If
If ViewState("Orden2").ToString() <> String.Empty Then
CargaGridS(ViewState("Orden2").ToString())
Else
CargaGridS("")
End If
End If
ObjClasificaciones.Dispose()
End Sub

View File

@@ -17,9 +17,7 @@
<li>
<asp:HyperLink NavigateUrl="#" data-toggle="modal" data-target="#DivPersonalizar" ID="ImgPersonalizar" runat="server"> <i class="fa fa-pencil"></i> Personalizar</asp:HyperLink>
</li>
<%--<li>
<asp:HyperLink NavigateUrl="#" data-toggle="modal" data-target="#DivCorporativo" ID="HyperLink1" runat="server"> <i class="fa fa-building"></i> Agregar Corporativo</asp:HyperLink>
</li>--%>
<li>
<asp:HyperLink NavigateUrl="#" data-toggle="modal" data-target="#DivUnificarCliente" ID="ImgUnificar" runat="server" Visible="false"> <i class="fa fa-pencil"></i> Unificar Clientes</asp:HyperLink>
</li>
@@ -34,29 +32,28 @@
<asp:UpdatePanel ID="UpFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT portletfiltrostitlee">
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="LbFiltrar" runat="server" CausesValidation="true" CssClass=" btn btn-primary " Text="Consultar" ValidationGroup="GrpFiltrar"></asp:Button>
<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 ">
<div class="row">
<div class="col-md-1" style="font-size: medium; max-width: 100px!important">Nombre:</div>
<div class="col-md-2 " style="max-width: 283px!important">
<div class="row" style="height: 32px;">
<div class="col-md-1 truncate" >Nombre:</div>
<div class="col-md-2 truncate" style="max-width: 283px!important">
<asp:TextBox ID="TxtNombre" runat="server" Style="display: inline-block;" CssClass=" form-control input-sm select2me" CausesValidation="true" MaxLength="30" ValidationGroup="GrpFiltrar" Width="100%"></asp:TextBox>
</div>
<div class="col-md-1 " style="font-size: medium; max-width: 100px!important">RFC:</div>
<div class=" col-md-2 " style="max-width: 283px!important">
<div class="col-md-1 truncate" >RFC:</div>
<div class=" col-md-2 truncate" style="max-width: 283px!important">
<asp:TextBox ID="TxtRFC" runat="server" Style="display: inline-block;" CssClass=" form-control input-sm select2me" CausesValidation="true" MaxLength="40" ValidationGroup="GrpFiltrar" Width="100%"></asp:TextBox>
</div>
<div class="col-md-1 " style="font-size: medium; max-width: 100px!important">Estatus:</div>
<div class=" col-md-2 " style="max-width: 283px!important">
<div class="col-md-1 truncate" >Estatus:</div>
<div class=" col-md-1 truncate" style="max-width: 283px!important">
<asp:DropDownList ID="DdlEstatus" runat="server" CssClass=" form-control input-sm select2me" ValidationGroup="GrpFiltrar" Width="100%">
<asp:ListItem Value="-1">Todos</asp:ListItem>
<asp:ListItem Selected="True" Value="1">Activo</asp:ListItem>
@@ -64,9 +61,20 @@
</asp:DropDownList>
</div>
<div class="col-md-1">
<%--<div class="col-md-1">
<asp:CheckBox runat="server" ID ="ChkPermiteCredito" CssClass="md-checksd" Text="Permite Crédito" />
</div>
</div>--%>
<div class="col-md-1 truncate">
Permite Crédito:
</div>
<div class="col-md-1 truncate" style="max-width: 283px!important">
<asp:DropDownList ID="DdlPermiteCredito" runat="server" CssClass=" form-control input-sm select2me" Width="100%">
<asp:ListItem Selected="True" Value="-1">Todos</asp:ListItem>
<asp:ListItem Value="1">Si</asp:ListItem>
<asp:ListItem Value="0">No</asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>
@@ -75,18 +83,18 @@
<div class="portlet-body" <%= IIf(chkexpand.Checked = True, "", "style=""display:none;""")%>>
<div class="row">
<div class="col-md-1 " style="font-size: medium; max-width: 100px!important">Sucursal:</div>
<div class=" col-md-2 " style="max-width: 283px!important">
<div class="col-md-1 truncate" >Sucursal:</div>
<div class=" col-md-2 truncate" style="max-width: 283px!important">
<asp:DropDownList ID="DdlSubProyecto" runat="server" DataValueField="CveSubProyecto" DataTextField="SubProyecto" CssClass=" form-control input-sm select2me" ValidationGroup="GrpFiltrar" Width="100%">
</asp:DropDownList>
</div>
<div class="col-md-1 " style="font-size: medium; max-width: 100px!important">Clasif:</div>
<div class=" col-md-2 " style="max-width: 283px!important">
<div class="col-md-1 truncate" >Clasificación:</div>
<div class=" col-md-2 truncate" style="max-width: 283px!important">
<asp:DropDownList ID="DdlClasificaciones" runat="server" DataValueField="CveClienteClasificacion" DataTextField="ClienteClasificacion" CssClass=" form-control input-sm select2me" ValidationGroup="GrpFiltrar" Width="100%">
</asp:DropDownList>
</div>
<div class="col-md-1 " style="font-size: medium; max-width: 100px!important">Tipo:</div>
<div class=" col-md-2 " style="max-width: 283px!important">
<div class="col-md-1 truncate" >Tipo:</div>
<div class=" col-md-1 truncate" style="max-width: 283px!important">
<asp:DropDownList ID="DdlTipoCliente" runat="server" CssClass=" form-control input-sm select2me" ValidationGroup="GrpFiltrar" Width="100%">
<asp:ListItem Value="-1">Todos</asp:ListItem>
<asp:ListItem Selected="True" Value="1">Frecuente</asp:ListItem>
@@ -94,10 +102,10 @@
</asp:DropDownList>
</div>
<div class="col-md-1 truncate" style="font-size: medium; max-width: 100px!important">
<div class="col-md-1 truncate" >
Vendedor:
</div>
<div class="col-md-2 " style="max-width: 283px!important">
<div class="col-md-2 truncate" style="max-width: 283px!important">
<asp:DropDownList ID="DdlVendedor" runat="server" DataTextField="Vendedor" DataValueField="CveVendedor" ValidationGroup="GrpFiltrar" CssClass=" form-control input-sm select2me" Width="100%">
</asp:DropDownList>
</div>
@@ -105,6 +113,7 @@
</div>
</div>
</div>
@@ -121,8 +130,9 @@
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet-body">
<table class="table table-striped" style="border: 1px solid #D3D3D3; min-width: 985px; width: 100%; display: none;">
<%-- <table class="table table-striped" style="border: 1px solid #D3D3D3; min-width: 985px; width: 100%; display: none;">
<thead>
<tr class="Titulos">
<th width="100px">
@@ -175,347 +185,365 @@
</th>
</tr>
</thead>
</table>
</table>--%>
<div style="">
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Clientes registrados" ShowHeader="true"
DataKeyNames="FechaLimiteCredito"
CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" BorderWidth="1" BorderColor="#D3D3D3" GridLines="None">
<Columns>
<asp:TemplateField Visible="true" ItemStyle-Width="100" HeaderText="Código">
<ItemTemplate>
<asp:Literal ID="LtlCodigo" runat="server" Text='<%# Eval("Codigo") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Nombre" ItemStyle-Width="320px">
<ItemTemplate>
<asp:Literal ID="LtlNombre" runat="server" Text='<%# Eval("Nombre", "{0}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="RFC" ItemStyle-Width="100">
<ItemTemplate>
<asp:Literal ID="LtlRFC" runat="server" Text='<%# Eval("RFC") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Sucursal" ItemStyle-Width="80">
<ItemTemplate>
<asp:Literal ID="LtlSucursal" runat="server" Text='<%# Eval("SubProyecto") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Teléfono" ItemStyle-Width="60">
<ItemTemplate>
<asp:Literal ID="LtlTelefono" runat="server" Text='<%# Eval("Telefono") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Vendedor" Visible="false" ItemStyle-Width="150" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Literal ID="LtlVendedor" runat="server" Text='<%# Eval("Vendedor") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Estatus">
<ItemTemplate>
<asp:Literal ID="LtlEstatus" runat="server" Text='<%# Eval("Estatus") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Fecha">
<ItemTemplate>
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("Fecha", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Usuario" ItemStyle-Width="150px" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Nombre Corto</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlNombreCorto" runat="server" Text='<%# Eval("NombreCorto") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>No Ext</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlNoExt" runat="server" Text='<%# Eval("NoExt") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>No Int</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlNoInt" runat="server" Text='<%# Eval("NoInt") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Colonia</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlColonia" runat="server" Text='<%# Eval("Colonia") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Ciudad</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlCiudad" runat="server" Text='<%# Eval("Ciudad") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Estado</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlEstado" runat="server" Text='<%# Eval("Estado") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>País</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlPais" runat="server" Text='<%# Eval("Pais") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>CP</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlCP" runat="server" Text='<%# Eval("CP") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Contacto</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlContacto" runat="server" Text='<%# Eval("Contacto") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Correo Env. Factura</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlMail" runat="server" Text='<%# Eval("Mail") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Recepción Facturas</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlRecepcionFacturas" runat="server" Text='<%# Eval("RecepcionPagos") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Ret IVA</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlRetIVA" runat="server" Text='<%# Eval("RetIVA") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Ret ISR</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlRetISR" runat="server" Text='<%# Eval("RetISR") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Plazo Cobranza</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlPlazoCobranza" runat="server" Text='<%# Eval("PlazoCobranza") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Límite Crédito</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlLimiteCredito" runat="server" Text='<%# Eval("LimiteCredito", "{0:N2}") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
</asp:TemplateField>
<div class="row">
<div class="col-md-12">
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Clientes registrados" ShowHeader="true"
DataKeyNames="FechaLimiteCredito"
CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" data-sort="true" BorderWidth="1" BorderColor="#D3D3D3" GridLines="None">
<Columns>
<asp:TemplateField Visible="true" ItemStyle-Width="100" HeaderText="Código">
<ItemTemplate>
<asp:Literal ID="LtlCodigo" runat="server" Text='<%# Eval("Codigo") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Nombre" ItemStyle-Width="320px">
<ItemTemplate>
<asp:Literal ID="LtlNombre" runat="server" Text='<%# Eval("Nombre", "{0}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="RFC" ItemStyle-Width="100">
<ItemTemplate>
<asp:Literal ID="LtlRFC" runat="server" Text='<%# Eval("RFC") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Sucursal" ItemStyle-Width="80">
<ItemTemplate>
<asp:Literal ID="LtlSucursal" runat="server" Text='<%# Eval("SubProyecto") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Teléfono" ItemStyle-Width="60">
<ItemTemplate>
<asp:Literal ID="LtlTelefono" runat="server" Text='<%# Eval("Telefono") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Vendedor" Visible="false" ItemStyle-Width="150" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Literal ID="LtlVendedor" runat="server" Text='<%# Eval("Vendedor") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Estatus">
<ItemTemplate>
<asp:Literal ID="LtlEstatus" runat="server" Text='<%# Eval("Estatus") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Fecha">
<ItemTemplate>
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("Fecha", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Usuario" ItemStyle-Width="150px" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Nombre Corto</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlNombreCorto" runat="server" Text='<%# Eval("NombreCorto") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>No Ext</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlNoExt" runat="server" Text='<%# Eval("NoExt") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>No Int</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlNoInt" runat="server" Text='<%# Eval("NoInt") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Colonia</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlColonia" runat="server" Text='<%# Eval("Colonia") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Ciudad</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlCiudad" runat="server" Text='<%# Eval("Ciudad") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Estado</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlEstado" runat="server" Text='<%# Eval("Estado") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>País</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlPais" runat="server" Text='<%# Eval("Pais") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>CP</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlCP" runat="server" Text='<%# Eval("CP") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Contacto</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlContacto" runat="server" Text='<%# Eval("Contacto") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Correo Env. Factura</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlMail" runat="server" Text='<%# Eval("Mail") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Recepción Facturas</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlRecepcionFacturas" runat="server" Text='<%# Eval("RecepcionPagos") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Ret IVA</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlRetIVA" runat="server" Text='<%# Eval("RetIVA") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Ret ISR</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlRetISR" runat="server" Text='<%# Eval("RetISR") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Plazo Cobranza</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlPlazoCobranza" runat="server" Text='<%# Eval("PlazoCobranza") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Límite Crédito</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlLimiteCredito" runat="server" Text='<%# Eval("LimiteCredito", "{0:N2}") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
</asp:TemplateField>
<%--<asp:TemplateField Visible="false">
<HeaderTemplate>CIE</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlCIE" runat="server" Text='<%# Eval("ConvenioCIE") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>--%>
<asp:TemplateField Visible="false" ItemStyle-HorizontalAlign="Left">
<HeaderTemplate>Calle</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlCalle" runat="server" Text='<%# Eval("Direccion") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false" ItemStyle-HorizontalAlign="Left">
<HeaderTemplate>Celular</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlTelefonoOtro" runat="server" Text='<%# Eval("Celular") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false" ItemStyle-HorizontalAlign="Left">
<HeaderTemplate>Correo Env. Cotización</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlCorreoCotizacion" runat="server" Text='<%# Eval("MailCotizacion") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false" ItemStyle-HorizontalAlign="Left">
<HeaderTemplate>Otro Telefono</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlOtroTelefono" runat="server" Text='<%# Eval("TelefonoOtros") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="true" ItemStyle-HorizontalAlign="center" ItemStyle-Width="100px">
<HeaderTemplate>Permite Crédito</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlPermiteCredito" runat="server" Text='<%# Eval("PermiteCreditoStr") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="true" ItemStyle-HorizontalAlign="center" ItemStyle-Width="100px">
<HeaderTemplate>F Limite Crédito</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlFechaLimiteCredito" runat="server"></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
<asp:TemplateField Visible="false" ItemStyle-HorizontalAlign="Left">
<HeaderTemplate>Calle</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlCalle" runat="server" Text='<%# Eval("Direccion") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false" ItemStyle-HorizontalAlign="Left">
<HeaderTemplate>Celular</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlTelefonoOtro" runat="server" Text='<%# Eval("Celular") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false" ItemStyle-HorizontalAlign="Left">
<HeaderTemplate>Correo Env. Cotización</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlCorreoCotizacion" runat="server" Text='<%# Eval("MailCotizacion") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false" ItemStyle-HorizontalAlign="Left">
<HeaderTemplate>Otro Telefono</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlOtroTelefono" runat="server" Text='<%# Eval("TelefonoOtros") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="true" ItemStyle-HorizontalAlign="center" ItemStyle-Width="100px">
<HeaderTemplate>F Limite Crédito</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlFechaLimiteCredito" runat="server" ></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
<HeaderStyle CssClass="Titulos" />
</asp:GridView>
</div>
<div id="DivPersonalizar" class="modal fade" role="dialog">
<asp:UpdatePanel ID="UPPersonalizar" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div id="DivPersonalizar" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">
<asp:Label ID="Label1" runat="server" ClientIDMode="Static" Text="Personalizar Columnas"></asp:Label></h4>
</div>
<div class="modal-body">
<table class="table table-striped table-advance table-hover">
<thead>
<tr>
<td style="text-align: left">
<asp:CheckBox ID="ChkNombre" runat="server" Text="Nombre" Checked="true" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkRFC" runat="server" Text="RFC" Checked="true" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkSucursal" runat="server" Text="Sucursal" Checked="true" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkTelefono" runat="server" Text="Teléfono" Checked="true" /></td>
</tr>
<tr>
<td style="text-align: left">
<asp:CheckBox ID="ChkEstadoSis" runat="server" Text="Estado (Sis)" Checked="true" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkFechaIng" runat="server" Text="Fecha Captura (Sis)" Checked="true" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkUsuario" runat="server" Text="Usuario Capturó (Sis)" Checked="true" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkCodigo" runat="server" Text="Código" /></td>
</tr>
<tr>
<td style="text-align: left">
<asp:CheckBox ID="ChkNombreCorto" runat="server" Text="Nombre Corto" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkVendedor" runat="server" Text="Vendedor" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkNoExt" runat="server" Text="No Ext" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkNoInt" runat="server" Text="No Int" /></td>
</tr>
<tr>
<td style="text-align: left">
<asp:CheckBox ID="ChkColonia" runat="server" Text="Colonia" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkCiudad" runat="server" Text="Ciudad" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkEstado" runat="server" Text="Estado" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkPais" runat="server" Text="País" /></td>
</tr>
<tr>
<td style="text-align: left">
<asp:CheckBox ID="ChkCP" runat="server" Text="C.P." /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkContacto" runat="server" Text="Contacto" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkMail" runat="server" Text="Correo Envió Facturación" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkRecepcionFacturas" runat="server" Text="Recepción Facturas" /></td>
</tr>
<tr>
<td style="text-align: left">
<asp:CheckBox ID="ChkRetIVA" runat="server" Text="Ret. IVA" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkRetISR" runat="server" Text="Ret. ISR" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkPlazoCobranza" runat="server" Text="Plazo Cobranza" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkLimiteCredito" runat="server" Text="Límite Crédito" /></td>
</tr>
<tr>
<td style="text-align: left">
<asp:CheckBox ID="ChkCalle" runat="server" Text="Calle" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkCelular" runat="server" Text="Celular" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkCorreoCotizacion" runat="server" Text="Correo Envió Cotización" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkOtroTelefono" runat="server" Text="Otro Telefono" /></td>
</tr>
<tr>
<td style="text-align: left">
<asp:CheckBox ID="ChkPermiteCredito" runat="server" Checked="true" Text="Permite Crédito" /></td>
<td style="text-align: left">
<asp:CheckBox ID="chkFechaLimiteCredito" runat="server" Checked="true" Text="Fecha Limite Crédito" /></td>
<td style="text-align: left"></td>
<td style="text-align: left"></td>
</tr>
</thead>
</table>
</div>
<div class="modal-footer">
<div class="row">
<div class="col-md-6" style="text-align: left">
<asp:CheckBox ID="ChkGuardarPersonalizacion" runat="server" Text=" Guarda Personalización" TextAlign="Right" />
</div>
<div class="col-md-6">
<%--<button type="button" class="btn btn-success" data-dismiss="modal" onclick="$('#BtnPersonalizar').click();">Personalizar</button>
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>--%>
<asp:Button ID="BtnPersonalizar" runat="server" Text="Personalizar" class="btn btn-success" />
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
</div>
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<div id="DivUnificarCliente" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">
<asp:Label ID="Label1" runat="server" ClientIDMode="Static" Text="Personalizar Columnas"></asp:Label></h4>
</div>
<div class="modal-body">
<table class="table table-striped table-advance table-hover">
<thead>
<tr>
<td style="text-align: left">
<asp:CheckBox ID="ChkNombre" runat="server" Text="Nombre" Checked="true" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkRFC" runat="server" Text="RFC" Checked="true" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkSucursal" runat="server" Text="Sucursal" Checked="true" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkTelefono" runat="server" Text="Teléfono" Checked="true" /></td>
</tr>
<tr>
<td style="text-align: left">
<asp:CheckBox ID="ChkEstadoSis" runat="server" Text="Estado (Sis)" Checked="true" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkFechaIng" runat="server" Text="Fecha Captura (Sis)" Checked="true" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkUsuario" runat="server" Text="Usuario Capturó (Sis)" Checked="true" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkCodigo" runat="server" Text="Código" /></td>
</tr>
<tr>
<td style="text-align: left">
<asp:CheckBox ID="ChkNombreCorto" runat="server" Text="Nombre Corto" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkVendedor" runat="server" Text="Vendedor" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkNoExt" runat="server" Text="No Ext" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkNoInt" runat="server" Text="No Int" /></td>
</tr>
<tr>
<td style="text-align: left">
<asp:CheckBox ID="ChkColonia" runat="server" Text="Colonia" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkCiudad" runat="server" Text="Ciudad" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkEstado" runat="server" Text="Estado" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkPais" runat="server" Text="País" /></td>
</tr>
<tr>
<td style="text-align: left">
<asp:CheckBox ID="ChkCP" runat="server" Text="C.P." /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkContacto" runat="server" Text="Contacto" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkMail" runat="server" Text="Correo Envió Facturación" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkRecepcionFacturas" runat="server" Text="Recepción Facturas" /></td>
</tr>
<tr>
<td style="text-align: left">
<asp:CheckBox ID="ChkRetIVA" runat="server" Text="Ret. IVA" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkRetISR" runat="server" Text="Ret. ISR" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkPlazoCobranza" runat="server" Text="Plazo Cobranza" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkLimiteCredito" runat="server" Text="Límite Crédito" /></td>
</tr>
<tr>
<td style="text-align: left">
<asp:CheckBox ID="ChkCalle" runat="server" Text="Calle" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkCelular" runat="server" Text="Celular" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkCorreoCotizacion" runat="server" Text="Correo Envió Cotización" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkOtroTelefono" runat="server" Text="Otro Telefono" /></td>
</tr>
<tr>
<td style="text-align: left">
<asp:CheckBox ID="chkFechaLimiteCredito" runat="server" Checked="true" Text="Fecha Limite Crédito" /></td>
<td style="text-align: left">
</td>
<td style="text-align: left">
</td>
<td style="text-align: left">
</td>
</tr>
</thead>
</table>
</div>
<div class="modal-footer">
<asp:Button ID="BtnPersonalizar" runat="server" Text="Personalizar" class="btn btn-success" />
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
</div>
</div>
</div>
</div>
<div id="DivUnificarCliente" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<asp:UpdatePanel ID="UpUnificar" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="myModalLabel4">Unificar Clientes</h4>
</div>
<div class="modal-body">
<asp:UpdatePanel ID="UpBodyUnificar" runat="server" UpdateMode="Conditional">
<asp:UpdatePanel ID="UpUnificar" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-md-6">
<label>Cliente a Unificar: </label>
<br />
<%--<asp:DropDownList ID="DdlClienteAUnificar" runat="server" CssClass="select2me" DataTextField="CodigoNombre" DataValueField="CveCliente" Width="100%"></asp:DropDownList>--%>
<ADS:Dropdownlost CssClassDdl="select2me" ID="DdlClienteAUnificar" data-metodo="getcliente" runat="server" DataTextField="NombreComercial" DataValueField="CveCliente" CssStyle="width:150px;"></ADS:Dropdownlost>
</div>
<div class="col-md-6">
<label>En: </label>
<br />
<%--<asp:DropDownList ID="DdlClienteOriginal" runat="server" CssClass="select2me" DataTextField="CodigoNombre" DataValueField="CveCliente" Width="100%"></asp:DropDownList>--%>
<ADS:Dropdownlost CssClassDdl="select2me" ID="DdlClienteOriginal" data-metodo="getcliente" runat="server" DataTextField="NombreComercial" DataValueField="CveCliente" CssStyle="width:150px;"></ADS:Dropdownlost>
</div>
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="myModalLabel4">Unificar Clientes</h4>
</div>
<br />
<div class="text-center">
<asp:Button ID="BtnUnificar" runat="server" CausesValidation="true" CssClass=" btn btn-primary " Text="Unificar"></asp:Button>
<div class="modal-body">
<asp:UpdatePanel ID="UpBodyUnificar" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-md-6">
<label>Cliente a Unificar: </label>
<br />
<%--<asp:DropDownList ID="DdlClienteAUnificar" runat="server" CssClass="select2me" DataTextField="CodigoNombre" DataValueField="CveCliente" Width="100%"></asp:DropDownList>--%>
<ADS:Dropdownlost CssClassDdl="select2me" ID="DdlClienteAUnificar" data-metodo="getcliente" runat="server" DataTextField="NombreComercial" DataValueField="CveCliente" CssStyle="width:150px;"></ADS:Dropdownlost>
</div>
<div class="col-md-6">
<label>En: </label>
<br />
<%--<asp:DropDownList ID="DdlClienteOriginal" runat="server" CssClass="select2me" DataTextField="CodigoNombre" DataValueField="CveCliente" Width="100%"></asp:DropDownList>--%>
<ADS:Dropdownlost CssClassDdl="select2me" ID="DdlClienteOriginal" data-metodo="getcliente" runat="server" DataTextField="NombreComercial" DataValueField="CveCliente" CssStyle="width:150px;"></ADS:Dropdownlost>
</div>
</div>
<br />
<div class="text-center">
<asp:Button ID="BtnUnificar" runat="server" CausesValidation="true" CssClass=" btn btn-primary " Text="Unificar"></asp:Button>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
@@ -553,7 +581,7 @@
</asp:Panel>
<%-- FIN OC X SURTIR --%>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -41,6 +41,10 @@ Partial Class CatClientes
Me.Form.DefaultButton = LbFiltrar.UniqueID
CargaPersonalizacion()
End If
End Sub
@@ -55,7 +59,10 @@ Partial Class CatClientes
If TxtRFC.Text.Trim <> String.Empty Then RFC = TxtRFC.Text.Trim
If ObjClientes.GetClientes(-1, Nombre, "-1", "-1", RFC, "-1", "-1", DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, Estatus:=DdlEstatus.SelectedValue.ToEntero, CveClienteClasificacion:=DdlClasificaciones.SelectedValue.ToEntero, TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, PermiteCreditoFiltro:=If(ChkPermiteCredito.Checked, 1, -1)) Then
'If ObjClientes.GetClientes(-1, Nombre, "-1", "-1", RFC, "-1", "-1", DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, Estatus:=DdlEstatus.SelectedValue.ToEntero, CveClienteClasificacion:=DdlClasificaciones.SelectedValue.ToEntero, TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, PermiteCreditoFiltro:=If(ChkPermiteCredito.Checked, 1, -1)) Then
If ObjClientes.GetClientes(-1, Nombre, "-1", "-1", RFC, "-1", "-1", DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, Estatus:=DdlEstatus.SelectedValue.ToEntero, CveClienteClasificacion:=DdlClasificaciones.SelectedValue.ToEntero, TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, PermiteCreditoFiltro:=DdlPermiteCredito.SelectedValue.ToEntero) Then
If ObjClientes.DtResultados.Rows.Count > 0 Then
DTDatos = ObjClientes.DtResultados
Else
@@ -124,48 +131,7 @@ Partial Class CatClientes
End Sub
Protected Sub BtnPersonalizar_Click(sender As Object, e As System.EventArgs) Handles BtnPersonalizar.Click
GvDatos.Columns(0).Visible = ChkCodigo.Checked
GvDatos.Columns(1).Visible = ChkNombre.Checked
GvDatos.Columns(2).Visible = ChkRFC.Checked
GvDatos.Columns(3).Visible = ChkSucursal.Checked
GvDatos.Columns(4).Visible = ChkTelefono.Checked
GvDatos.Columns(5).Visible = ChkVendedor.Checked
GvDatos.Columns(6).Visible = ChkEstadoSis.Checked
GvDatos.Columns(7).Visible = ChkFechaIng.Checked
GvDatos.Columns(8).Visible = ChkUsuario.Checked
GvDatos.Columns(9).Visible = ChkNombreCorto.Checked
' GvDatos.Columns(10).Visible = ChkVendedor.Checked
GvDatos.Columns(10).Visible = ChkNoExt.Checked
GvDatos.Columns(11).Visible = ChkNoInt.Checked
GvDatos.Columns(12).Visible = ChkColonia.Checked
GvDatos.Columns(13).Visible = ChkCiudad.Checked
GvDatos.Columns(14).Visible = ChkEstado.Checked
GvDatos.Columns(15).Visible = ChkPais.Checked
GvDatos.Columns(16).Visible = ChkCP.Checked
GvDatos.Columns(17).Visible = ChkContacto.Checked
GvDatos.Columns(18).Visible = ChkMail.Checked
GvDatos.Columns(19).Visible = ChkRecepcionFacturas.Checked
GvDatos.Columns(20).Visible = ChkRetIVA.Checked
GvDatos.Columns(21).Visible = ChkRetISR.Checked
GvDatos.Columns(22).Visible = ChkPlazoCobranza.Checked
GvDatos.Columns(23).Visible = ChkLimiteCredito.Checked
'GvDatos.Columns(24).Visible = ChkCIE.Checked
GvDatos.Columns(24).Visible = ChkCalle.Checked
GvDatos.Columns(25).Visible = ChkCelular.Checked
GvDatos.Columns(26).Visible = ChkCorreoCotizacion.Checked
GvDatos.Columns(27).Visible = ChkOtroTelefono.Checked
GvDatos.Columns(28).Visible = chkFechaLimiteCredito.Checked
CargaDatos()
UPDatos.Update()
End Sub
Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
@@ -302,7 +268,359 @@ Partial Class CatClientes
#Region "P E R S O N A L I Z A R"
Protected Sub BtnPersonalizar_Click(sender As Object, e As System.EventArgs) Handles BtnPersonalizar.Click
If ChkGuardarPersonalizacion.Checked Then
GuardaPersonalizacion()
End If
Personaliza()
End Sub
Private Sub GuardaPersonalizacion()
Dim objUsuario As New ClsSisUsuarios
Dim ListPersonalizada As New List(Of String)
If ChkCodigo.Checked Then
ListPersonalizada.Add("Codigo")
End If
If ChkNombre.Checked Then
ListPersonalizada.Add("Nombre")
End If
If ChkRFC.Checked Then
ListPersonalizada.Add("RFC")
End If
If ChkSucursal.Checked Then
ListPersonalizada.Add("Sucursal")
End If
If ChkTelefono.Checked Then
ListPersonalizada.Add("Telefono")
End If
If ChkVendedor.Checked Then
ListPersonalizada.Add("Vendedor")
End If
If ChkEstadoSis.Checked Then
ListPersonalizada.Add("EstadoSis")
End If
If ChkFechaIng.Checked Then
ListPersonalizada.Add("FechaIng")
End If
If ChkUsuario.Checked Then
ListPersonalizada.Add("Usuario")
End If
If ChkNombreCorto.Checked Then
ListPersonalizada.Add("NombreCorto")
End If
If ChkNoExt.Checked Then
ListPersonalizada.Add("NoExt")
End If
If ChkNoInt.Checked Then
ListPersonalizada.Add("NoInt")
End If
If ChkColonia.Checked Then
ListPersonalizada.Add("Colonia")
End If
If ChkCiudad.Checked Then
ListPersonalizada.Add("Ciudad")
End If
If ChkEstado.Checked Then
ListPersonalizada.Add("Estado")
End If
If ChkPais.Checked Then
ListPersonalizada.Add("Pais")
End If
If ChkCP.Checked Then
ListPersonalizada.Add("CP")
End If
If ChkContacto.Checked Then
ListPersonalizada.Add("Contacto")
End If
If ChkMail.Checked Then
ListPersonalizada.Add("Mail")
End If
If ChkRecepcionFacturas.Checked Then
ListPersonalizada.Add("RecepcionFacturas")
End If
If ChkRetIVA.Checked Then
ListPersonalizada.Add("RetIVA")
End If
If ChkRetISR.Checked Then
ListPersonalizada.Add("RetISR")
End If
If ChkPlazoCobranza.Checked Then
ListPersonalizada.Add("PlazoCobranza")
End If
If ChkLimiteCredito.Checked Then
ListPersonalizada.Add("LimiteCredito")
End If
'If ChkCIE.Checked Then
' ListPersonalizada.Add("CIE")
'End If
If ChkCalle.Checked Then
ListPersonalizada.Add("Calle")
End If
If ChkCelular.Checked Then
ListPersonalizada.Add("Celular")
End If
If ChkCorreoCotizacion.Checked Then
ListPersonalizada.Add("CorreoCotizacion")
End If
If ChkOtroTelefono.Checked Then
ListPersonalizada.Add("OtroTelefono")
End If
If ChkPermiteCredito.Checked Then
ListPersonalizada.Add("PermiteCredito")
End If
If chkFechaLimiteCredito.Checked Then
ListPersonalizada.Add("FechaLimiteCredito")
End If
If objUsuario.AddUsuariosPersonalizaciones(UsuarioActual, "CatClientes.aspx", String.Join("|", ListPersonalizada)) Then
'Alert("Personalizacion guardada")
End If
objUsuario.Dispose()
End Sub
Private Sub CargaPersonalizacion()
Dim strBasePersonalizacion As String = UsuarioActual.Personalizaciones("CatClientes.aspx")
If strBasePersonalizacion.Trim.Length > 0 Then
ChkCodigo.Checked = False
ChkNombre.Checked = False
ChkRFC.Checked = False
ChkSucursal.Checked = False
ChkTelefono.Checked = False
ChkVendedor.Checked = False
ChkEstadoSis.Checked = False
ChkFechaIng.Checked = False
ChkUsuario.Checked = False
ChkNombreCorto.Checked = False
ChkVendedor.Checked = False
ChkNoExt.Checked = False
ChkNoInt.Checked = False
ChkColonia.Checked = False
ChkCiudad.Checked = False
ChkEstado.Checked = False
ChkPais.Checked = False
ChkCP.Checked = False
ChkContacto.Checked = False
ChkMail.Checked = False
ChkRecepcionFacturas.Checked = False
ChkRetIVA.Checked = False
ChkRetISR.Checked = False
ChkPlazoCobranza.Checked = False
ChkLimiteCredito.Checked = False
ChkCalle.Checked = False
ChkCelular.Checked = False
ChkCorreoCotizacion.Checked = False
ChkOtroTelefono.Checked = False
ChkPermiteCredito.Checked = False
chkFechaLimiteCredito.Checked = False
Dim Personalizaciones As String() = strBasePersonalizacion.Split("|"c)
For Each personalizacion As String In Personalizaciones
Select Case personalizacion
Case "Codigo"
ChkCodigo.Checked = True
Exit Select
Case "Nombre"
ChkNombre.Checked = True
Exit Select
Case "RFC"
ChkRFC.Checked = True
Exit Select
Case "Sucursal"
ChkSucursal.Checked = True
Exit Select
Case "Telefono"
ChkTelefono.Checked = True
Exit Select
Case "Vendedor"
ChkVendedor.Checked = True
Exit Select
Case "EstadoSis"
ChkEstadoSis.Checked = True
Exit Select
Case "FechaIng"
ChkFechaIng.Checked = True
Exit Select
Case "Usuario"
ChkUsuario.Checked = True
Exit Select
Case "NombreCorto"
ChkNombreCorto.Checked = True
Exit Select
Case "NoExt"
ChkNoExt.Checked = True
Exit Select
Case "NoInt"
ChkNoInt.Checked = True
Exit Select
Case "Colonia"
ChkColonia.Checked = True
Exit Select
Case "Ciudad"
ChkCiudad.Checked = True
Exit Select
Case "Estado"
ChkEstado.Checked = True
Exit Select
Case "Pais"
ChkPais.Checked = True
Exit Select
Case "CP"
ChkCP.Checked = True
Exit Select
Case "Contacto"
ChkContacto.Checked = True
Exit Select
Case "Mail"
ChkMail.Checked = True
Exit Select
Case "RecepcionFacturas"
ChkRecepcionFacturas.Checked = True
Exit Select
Case "RetIVA"
ChkRetIVA.Checked = True
Exit Select
Case "RetISR"
ChkRetISR.Checked = True
Exit Select
Case "PlazoCobranza"
ChkPlazoCobranza.Checked = True
Exit Select
Case "LimiteCredito"
ChkLimiteCredito.Checked = True
Exit Select
'Case "CIE"
' ChkCIE.Checked = True
' Exit Select
Case "Calle"
ChkCalle.Checked = True
Exit Select
Case "Celular"
ChkCelular.Checked = True
Exit Select
Case "CorreoCotizacion"
ChkCorreoCotizacion.Checked = True
Exit Select
Case "OtroTelefono"
ChkOtroTelefono.Checked = True
Exit Select
Case "PermiteCredito"
ChkPermiteCredito.Checked = True
Exit Select
Case "FechaLimiteCredito"
chkFechaLimiteCredito.Checked = True
Exit Select
Case Else
Exit Select
End Select
Next
Personaliza()
Else
PersonalizaDefault()
End If
UPPersonalizar.Update()
End Sub
Private Sub PersonalizaDefault()
End Sub
Private Sub Personaliza()
GvDatos.Columns(0).Visible = ChkCodigo.Checked
GvDatos.Columns(1).Visible = ChkNombre.Checked
GvDatos.Columns(2).Visible = ChkRFC.Checked
GvDatos.Columns(3).Visible = ChkSucursal.Checked
GvDatos.Columns(4).Visible = ChkTelefono.Checked
GvDatos.Columns(5).Visible = ChkVendedor.Checked
GvDatos.Columns(6).Visible = ChkEstadoSis.Checked
GvDatos.Columns(7).Visible = ChkFechaIng.Checked
GvDatos.Columns(8).Visible = ChkUsuario.Checked
GvDatos.Columns(9).Visible = ChkNombreCorto.Checked
' GvDatos.Columns(10).Visible = ChkVendedor.Checked
GvDatos.Columns(10).Visible = ChkNoExt.Checked
GvDatos.Columns(11).Visible = ChkNoInt.Checked
GvDatos.Columns(12).Visible = ChkColonia.Checked
GvDatos.Columns(13).Visible = ChkCiudad.Checked
GvDatos.Columns(14).Visible = ChkEstado.Checked
GvDatos.Columns(15).Visible = ChkPais.Checked
GvDatos.Columns(16).Visible = ChkCP.Checked
GvDatos.Columns(17).Visible = ChkContacto.Checked
GvDatos.Columns(18).Visible = ChkMail.Checked
GvDatos.Columns(19).Visible = ChkRecepcionFacturas.Checked
GvDatos.Columns(20).Visible = ChkRetIVA.Checked
GvDatos.Columns(21).Visible = ChkRetISR.Checked
GvDatos.Columns(22).Visible = ChkPlazoCobranza.Checked
GvDatos.Columns(23).Visible = ChkLimiteCredito.Checked
'GvDatos.Columns(24).Visible = ChkCIE.Checked
GvDatos.Columns(24).Visible = ChkCalle.Checked
GvDatos.Columns(25).Visible = ChkCelular.Checked
GvDatos.Columns(26).Visible = ChkCorreoCotizacion.Checked
GvDatos.Columns(27).Visible = ChkOtroTelefono.Checked
GvDatos.Columns(28).Visible = ChkPermiteCredito.Checked
GvDatos.Columns(29).Visible = chkFechaLimiteCredito.Checked
CargaDatos()
UPDatos.Update()
End Sub
#End Region
End Class

View File

@@ -431,7 +431,7 @@ Partial Class Ventas_PVCobranza
Try
'FACTURAR LA REMISION PARA HACER EL PAGO
If UsuarioActual.CveEmpresa = 193 AndAlso VentaActual.TipoDocto = "Rem" Then
If UsuarioActual.CveEmpresa = 189 AndAlso VentaActual.TipoDocto = "Rem" Then
respFactura = GenerarFactura(VentaActual, ObjVentas2, ObjClientes)
If respFactura Is Nothing Then

View File

@@ -5073,7 +5073,7 @@ Partial Class Ventas
'End If
'si utiliza cortes, y cajas, no permitir cancelar de días anteriores
If UsuarioActual.CveRol <> 1 AndAlso UsuarioActual.Empresa.Funcionalidad(109) = "1" AndAlso DbRowVenta("Fecha").ToString.ToDate.ToShortDateString.ToDate < Now.ToShortDateString.ToDate Then
LbCancelarDocumento.Visible = False
LbCancelarDocumento.Visible = UsuarioActual.TienePermisoProceso(378)
End If
End If
@@ -8766,7 +8766,7 @@ Partial Class Ventas
GvPS.Rows(e.NewEditIndex).FCTextBox("TxtPrecio").Enabled = False
If DdlTipoComprobante.SelectedValue = "Cot" Or RBLTipoVenta.SelectedValue.ToEntero = 1 Then
If DdlTipoComprobante.SelectedValue = "Cot" Or RBLTipoVenta.SelectedValue.ToEntero = 2 Then
GvPS.Rows(e.NewEditIndex).FCTextBox("TxtPrecio").Enabled = True
End If
@@ -17681,7 +17681,7 @@ Partial Class Ventas
If EsVentaMedica Then
TxtPrecio.Enabled = False
If UsuarioActual.CveUsuario = 3986 Or RBLTipoVenta.SelectedValue.ToEntero = 1 Then
If UsuarioActual.CveUsuario = 3986 Or RBLTipoVenta.SelectedValue.ToEntero = 2 Then
TxtPrecio.Enabled = True
End If
@@ -23479,7 +23479,7 @@ Partial Class Ventas
' DdlCuentaTarjetaDebito.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0} AND (CveTipoCuenta <> 1 OR TieneTerminal = 1)", If(DdlMoneda.SelectedValue.ToEntero() <= 0, 1, DdlMoneda.SelectedValue.ToEntero())))
'End If
If UsuarioActual.Empresa.Funcionalidad(109) = "1" OrElse UsuarioActual.CveEmpresa = 195 Then
If UsuarioActual.Empresa.Funcionalidad(109) = "1" OrElse UsuarioActual.CveEmpresa.Contiene(195, 197) Then
DdlCuentaTransferencia.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta = 1", If(DdlMoneda.SelectedValue.ToEntero() <= 0, 1, DdlMoneda.SelectedValue.ToEntero())))
Else
DdlCuentaTransferencia.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta <> 1", If(DdlMoneda.SelectedValue.ToEntero() <= 0, 1, DdlMoneda.SelectedValue.ToEntero())))