This commit is contained in:
2020-01-15 12:19:32 -07:00
24 changed files with 4511 additions and 3949 deletions

View File

@@ -758,11 +758,12 @@ Public Class ClsAcumuladores
End Try End Try
Return Retorno Return Retorno
End Function End Function
Public Function GetGarantiasPolizaVirtual(CveVenta As Integer) As Boolean Public Function GetGarantiasPolizaVirtual(CveVenta As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
SqlDataAdapter("PA_Acum_GarantiasPolizaVirtualGet") SqlDataAdapter("PA_Acum_GarantiasPolizaVirtualGet")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta .Add("@CveVenta", SqlDbType.Int).Value = CveVenta
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With End With
Try Try
SqlAdapter.Fill(Data) SqlAdapter.Fill(Data)

View File

@@ -1554,7 +1554,9 @@ Public Class ClsClientes
Return Retorno Return Retorno
End Function End Function
Public Function AgregarClienteNoFrecuente(Nombre As String, Direccion As String, NoExt As String, NoInt As String, Colonia As String, Localidad As String, Ciudad As String, Estado As String, Pais As String, RFC As String, CP As String, Telefono As String, Mail As String, CveSubProyecto As Integer, CveUsuario As Integer, CveEmpresa As Integer, NumCuentaPago As String, Optional CvePrecioLista As Integer = -1) As Boolean Public Function AgregarClienteNoFrecuente(Nombre As String, Direccion As String, NoExt As String, NoInt As String, Colonia As String, Localidad As String, Ciudad As String, Estado As String,
Pais As String, RFC As String, CP As String, Telefono As String, Mail As String, CveSubProyecto As Integer, CveUsuario As Integer, CveEmpresa As Integer,
NumCuentaPago As String, CveMetodoPago33 As Integer, CveFormaPago33 As Integer, Optional CvePrecioLista As Integer = -1) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_ClientesNoFrecuenteAdd") DataAdapter("PA_ClientesNoFrecuenteAdd")
@@ -1575,6 +1577,8 @@ Public Class ClsClientes
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveMetodoPago33", SqlDbType.Int).Value = CveMetodoPago33
.Add("@CveFormaPago33", SqlDbType.Int).Value = CveFormaPago33
.Add("@NumCuentaPago", SqlDbType.VarChar).Value = NumCuentaPago .Add("@NumCuentaPago", SqlDbType.VarChar).Value = NumCuentaPago
.Add("@CvePrecioLista", SqlDbType.Int).Value = CvePrecioLista .Add("@CvePrecioLista", SqlDbType.Int).Value = CvePrecioLista

View File

@@ -1267,6 +1267,11 @@ Public Class ClsOC
_CveOrdenCompraDetalle = SqlAdapter.SelectCommand.Parameters("@vCveOrdenCompraDetalle").Value.ToString.ToEntero _CveOrdenCompraDetalle = SqlAdapter.SelectCommand.Parameters("@vCveOrdenCompraDetalle").Value.ToString.ToEntero
Retorno = True Retorno = True
Catch ex As Exception Catch ex As Exception
If ex.Message.Contains("CK_OC_OrdenesCompraDetalle_RetIVA_Total") Then
Alert("La retención de iva no coincide con su total", TipoMensaje.MsgAdvertencia)
End If
OnError("Ocurrió un error al agregar el detalle de OrdenCompras.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) OnError("Ocurrió un error al agregar el detalle de OrdenCompras.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try End Try

View File

@@ -2677,6 +2677,45 @@ Public Class ClsVentas
Return OnError Return OnError
End Function End Function
Public Function GetFacturasCanceladasPendientesWS(RFC As String, CveEmpresa As Integer, Optional showalert As Boolean = True) As Boolean
Dim retorno As Boolean = False
Try
Dim objServicio As Cancelacion.CancelacionSoapClient = New Cancelacion.CancelacionSoapClient()
Dim resp As Cancelacion.StructCancel = objServicio.ObtienePendientes(RFC, "UserTest", "1234567890")
If resp.Estado = 0 Then
Dim XmlPendientes As String = System.Text.Encoding.UTF8.GetString(Convert.FromBase64String(resp.Xml))
Dim theReader As IO.StringReader = New IO.StringReader(XmlPendientes)
Dim theDataSet As DataSet = New DataSet()
theDataSet.ReadXml(theReader)
If theDataSet.Tables(0).Rows(0)("Uuid").ToString() <> "null" Then
Dim sb = New StringBuilder()
For Each item As DataRow In theDataSet.Tables(0).Rows
sb.AppendFormat("{0};", item("Uuid").ToString())
Next
If GetFacturasCanceladasPendientes(sb.ToString(), CveEmpresa) Then
retorno = True
End If
Else
If showalert Then
Alert("No se encontraron cancelaciones pendientes", ModExtensiones.TipoMensaje.MsgError)
End If
End If
Else
Alert("Error al obtener cancelaciones pendientes: " & resp.Descripcion, ModExtensiones.TipoMensaje.MsgError)
End If
Catch ex As Exception
retorno = False
Me.OnError("Error al obtener cancelaciones pendientes: ", ex, "")
End Try
Return retorno
End Function
Public Function UpdateVentaFacturas(CveFactura As Integer, CveVenta As Integer, CveEmpresa As Integer) As Boolean Public Function UpdateVentaFacturas(CveFactura As Integer, CveVenta As Integer, CveEmpresa As Integer) As Boolean
Dim OnError As Boolean = False Dim OnError As Boolean = False

View File

@@ -368,7 +368,7 @@ Namespace Modelos
End If End If
Timbre = New CFDITimbre Timbre = New CFDITimbre
End Sub End Sub
Public Sub New(UsuarioActual As Usuario, CveVenta As Integer, CveEmpresa As Integer, Optional DirectorioServidor As String = "") Public Sub New(UsuarioActual As Usuario, CveVenta As Integer, CveEmpresa As Integer, Optional DirectorioServidor As String = "", Optional EsCancelacion As Boolean = False)
Me.UsuarioActual = UsuarioActual Me.UsuarioActual = UsuarioActual
Me.CveVenta = CveVenta Me.CveVenta = CveVenta
Me.CveEmpresa = CveEmpresa Me.CveEmpresa = CveEmpresa
@@ -393,7 +393,7 @@ Namespace Modelos
Me.DtDetalle = ObjVentas.DtResultados.Copy() Me.DtDetalle = ObjVentas.DtResultados.Copy()
End If End If
ObjVentas.Dispose() ObjVentas.Dispose()
IniciaValoresVentas() IniciaValoresVentas(EsCancelacion)
If String.IsNullOrEmpty(DirectorioServidor) Then If String.IsNullOrEmpty(DirectorioServidor) Then
DirectorioServidor = HttpContext.Current.Server.MapPath("/") DirectorioServidor = HttpContext.Current.Server.MapPath("/")
End If End If
@@ -446,7 +446,7 @@ Namespace Modelos
Me.IEPS = 0 Me.IEPS = 0
Me.CveAlmacenTraspasoOrigen = 0 Me.CveAlmacenTraspasoOrigen = 0
End Sub End Sub
Private Sub IniciaValoresVentas() Private Sub IniciaValoresVentas(Optional EsCancelacion As Boolean = False)
If CveVenta > 0 AndAlso CveEmpresa > 0 Then If CveVenta > 0 AndAlso CveEmpresa > 0 Then
Me.DtAnticipos = New DataTable() Me.DtAnticipos = New DataTable()
Me.DtAntNCVinculadas = New DataTable() Me.DtAntNCVinculadas = New DataTable()
@@ -492,6 +492,10 @@ Namespace Modelos
Me.DtNCVinculadas = ObjVentas.DtResultados.Copy() Me.DtNCVinculadas = ObjVentas.DtResultados.Copy()
End If End If
If TipoDocto.Contiene("Ant") AndAlso EsCancelacion Then
EsNCAmortizacion = True
End If
If ObjVentas.GetVentasAntNC(-1, CveVenta, AplicaAmortizacion:=EsNCAmortizacion) Then If ObjVentas.GetVentasAntNC(-1, CveVenta, AplicaAmortizacion:=EsNCAmortizacion) Then
Me.DtAnticipos = ObjVentas.DtResultados.Copy() Me.DtAnticipos = ObjVentas.DtResultados.Copy()
End If End If
@@ -2333,7 +2337,7 @@ Namespace Modelos
Exit Select Exit Select
End If End If
If ObjFactura.TipoDocto.Contiene("Ing", "Egs") AndAlso ValorMultiplicador = -1 Then If ObjFactura.TipoDocto.Contiene("Ing", "Egs", "Ant") AndAlso ValorMultiplicador = -1 Then
For Each row2 As DataRow In ObjFactura.DtAnticipos.Rows For Each row2 As DataRow In ObjFactura.DtAnticipos.Rows
If row2("CveConceptoContable").ToString().ToEntero = 11 Then If row2("CveConceptoContable").ToString().ToEntero = 11 Then
importeMovimiento = row2("Importe").ToString().ToDecimal * ValorMultiplicador '- ((row2.FCTextBox("TxtAnticipo" & row2.RowIndex).Text.ToDecimal / row2.DataKey("TotalAnticipo").ToDecimal) * row2.DataKey("IVAAnticipo").ToDecimal) importeMovimiento = row2("Importe").ToString().ToDecimal * ValorMultiplicador '- ((row2.FCTextBox("TxtAnticipo" & row2.RowIndex).Text.ToDecimal / row2.DataKey("TotalAnticipo").ToDecimal) * row2.DataKey("IVAAnticipo").ToDecimal)
@@ -2344,7 +2348,10 @@ Namespace Modelos
CveSubProyectoContabilizar = CveSubProyectoVenta CveSubProyectoContabilizar = CveSubProyectoVenta
If importeMovimiento <> 0 Then If importeMovimiento <> 0 Then
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=row2("CveVenta").ToString().ToEntero, CveVentaAmortizacion:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=importeMovimiento * tipoCambio, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=SeContabiliza) Then If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1,
CveVenta:=ObjFactura.CveVenta, CveVentaAmortizacion:=row2("CveVenta").ToString().ToEntero, CveCliente:=ObjFactura.CveCliente,
CveIE:=CveIEAnticipo, ImporteMX:=importeMovimiento * tipoCambio, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveCuenta:=CveCuenta,
CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=SeContabiliza) Then
ErrorPrepoliza = True ErrorPrepoliza = True
Exit For Exit For
Else Else

View File

@@ -81,6 +81,14 @@ Partial Class Bancos_RepProgramarRecursos
ViewState("UsuarioProgramo") = value ViewState("UsuarioProgramo") = value
End Set End Set
End Property End Property
Private Property CveProveedor As Integer
Get
Return ViewState("CveProveedor").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("CveProveedor") = value
End Set
End Property
#End Region #End Region
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
@@ -91,7 +99,6 @@ Partial Class Bancos_RepProgramarRecursos
Orden = "" Orden = ""
Opcion = "-1" Opcion = "-1"
HdnEmp.Value = UsuarioActual.CveEmpresa.ToString HdnEmp.Value = UsuarioActual.CveEmpresa.ToString
If (UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1") Then If (UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1") Then
DdlProveedores.setEsWebService(True) DdlProveedores.setEsWebService(True)
DdlProveedores.Attributes.Add("data-metodo", "getproveedores") DdlProveedores.Attributes.Add("data-metodo", "getproveedores")
@@ -303,7 +310,7 @@ Partial Class Bancos_RepProgramarRecursos
End Sub End Sub
Private Sub CargaDatos() Private Sub CargaDatos()
CveProveedor = DdlProveedores.SelectedValue.ToEntero
Dim CveUsuarioProgramo As Integer = DdlUsuarioProgramo.SelectedValue.ToEntero 'UsuarioActual.CveUsuario Dim CveUsuarioProgramo As Integer = DdlUsuarioProgramo.SelectedValue.ToEntero 'UsuarioActual.CveUsuario
If Not ChkProgramadas.Checked Then CveUsuarioProgramo = -1 If Not ChkProgramadas.Checked Then CveUsuarioProgramo = -1
If ChkProgramadas.Checked And DdlUsuarioProgramo.SelectedValue.ToEntero = -1 Then CveUsuarioProgramo = -2 If ChkProgramadas.Checked And DdlUsuarioProgramo.SelectedValue.ToEntero = -1 Then CveUsuarioProgramo = -2
@@ -803,7 +810,8 @@ Partial Class Bancos_RepProgramarRecursos
End Sub End Sub
Private Sub Imprimir(Optional Formato As String = "PDF") Private Sub Imprimir(Optional Formato As String = "PDF")
Dim Proveedor = If(DdlProveedores.SelectedValue = "-1", "", $"&emsp;<b>Proveedor:</b>&nbsp;{DdlProveedores.SelectedText}")
Dim Proveedor = If(CveProveedor = -1, "", $"&emsp;<b>Proveedor:</b>&nbsp;{GlobalDTCompProveedores(UsuarioActual.CveEmpresa).FiltraParametros($"CveProveedor = {CveProveedor}").Rows(0)("RazonSocial").ToString}")
Dim Clasificacion = If(DdlProveedoresClasificaciones.SelectedValue = "-1", "", $"&emsp;<b>Clasificación:</b>&nbsp;{DdlProveedoresClasificaciones.SelectedItem.Text}") Dim Clasificacion = If(DdlProveedoresClasificaciones.SelectedValue = "-1", "", $"&emsp;<b>Clasificación:</b>&nbsp;{DdlProveedoresClasificaciones.SelectedItem.Text}")
Dim AplicaNC = If(DdlAplicaNC.SelectedValue = "-1", "", $"&emsp;<b>Aplica NC:</b>&nbsp;{DdlAplicaNC.SelectedItem.Text}") Dim AplicaNC = If(DdlAplicaNC.SelectedValue = "-1", "", $"&emsp;<b>Aplica NC:</b>&nbsp;{DdlAplicaNC.SelectedItem.Text}")
Dim TipoProv = If(DdlTipoProveedor.SelectedValue = "0", "", $"&emsp;<b>Tipo Prov.:</b>&nbsp;{DdlTipoProveedor.SelectedItem.Text}") Dim TipoProv = If(DdlTipoProveedor.SelectedValue = "0", "", $"&emsp;<b>Tipo Prov.:</b>&nbsp;{DdlTipoProveedor.SelectedItem.Text}")

View File

@@ -907,8 +907,10 @@
<td runat="server" id="tdT5" visible="false"> <td runat="server" id="tdT5" visible="false">
<asp:Label Text="" ID="LbIVAOriginal" runat="server" /> <asp:Label Text="" ID="LbIVAOriginal" runat="server" />
</td> </td>
<td runat="server" id="tdIVA6" visible="false"> <td runat="server" id="tdIVA6" visible="false" class="label label-sm label-success" style="color:white!important" >
<asp:LinkButton runat="server" ID="LnkActivaIva6" Text="" ToolTip="Ret IVA Servicios" OnClick="LnkActivaIva6_Click"><i class="fa fa-usd" aria-hidden="true"></i></asp:LinkButton>
<asp:LinkButton runat="server" ID="LnkActivaIva6" Text="" ToolTip="Ret IVA Servicios" OnClick="LnkActivaIva6_Click" style="color:white!important" >Deglose 6%</asp:LinkButton>
<%--<asp:LinkButton runat="server" ID="LnkActivaIva6" Text="" ToolTip="Ret IVA Servicios" OnClick="LnkActivaIva6_Click"><i class="fa fa-usd" aria-hidden="true"></i></asp:LinkButton>--%>
</td> </td>
<%--<td align="left" runat="server" id="TdIVA" visible="false"> <%--<td align="left" runat="server" id="TdIVA" visible="false">

View File

@@ -1026,9 +1026,16 @@ Partial Class Compras_Compras
ViewState("SubTotal2Original") = value ViewState("SubTotal2Original") = value
End Set End Set
End Property End Property
Private Property IVAOriginal As Double Private Property IVAOriginal As Double
Get Get
Return ViewState("IVAOriginal").ToString.ToDouble
If ViewState("IVAOriginal") Is Nothing Then
Return 0
Else
Return ViewState("IVAOriginal").ToString.ToDouble
End If
End Get End Get
Set(value As Double) Set(value As Double)
ViewState("IVAOriginal") = value ViewState("IVAOriginal") = value
@@ -2087,7 +2094,11 @@ Partial Class Compras_Compras
End If End If
DdlRetIVAConcepto.Items.Add(New ListItem("Arrendamiento", "4")) DdlRetIVAConcepto.Items.Add(New ListItem("Arrendamiento", "4"))
DdlRetIVAConcepto.Items.Add(New ListItem("Ret IVA Servicios", "5"))
If UsuarioActual.Empresa.Funcionalidad(577).ToEntero = 1 Then
DdlRetIVAConcepto.Items.Add(New ListItem("Ret IVA Servicios", "5"))
End If
End If End If
@@ -2237,15 +2248,15 @@ Partial Class Compras_Compras
If UsuarioActual.Empresa.Funcionalidad(577).ToString = "1" Then If UsuarioActual.Empresa.Funcionalidad(577).ToString = "1" Then
'If UsuarioActual.CveRol = 1 Then
' Alert("Ok funcionalidad 577")
'End If
If RetencionIVA = 0 And IVAOriginal > 0 Then If RetencionIVA = 0 And IVAOriginal > 0 Then
For Each dRow As DataRow In TmpDT.Rows For Each dRow As DataRow In TmpDT.Rows
If dRow("CveTipoPS").ToString.ToEntero = 1 Then If dRow("CveTipoPS").ToString.ToEntero = 1 Then
tdIVA6.Visible = True
'comentado para reubicar el boton
'tdIVA6.Visible = True
Exit For Exit For
End If End If
Next Next
@@ -17025,7 +17036,8 @@ Partial Class Compras_Compras
If RetencionIVA = 0 And IVAOriginal > 0 Then If RetencionIVA = 0 And IVAOriginal > 0 Then
For Each dRow As DataRow In TmpDT.Rows For Each dRow As DataRow In TmpDT.Rows
If dRow("CveTipoPS").ToString.ToEntero = 1 Then If dRow("CveTipoPS").ToString.ToEntero = 1 Then
tdIVA6.Visible = True 'Comnetado para reubicar el boton
'tdIVA6.Visible = True
Exit For Exit For
End If End If
Next Next
@@ -19305,7 +19317,7 @@ Partial Class Compras_Compras
DdlRetIVAConcepto.SelectedValueExist("5") DdlRetIVAConcepto.SelectedValueExist("5")
LblRetIVA.Text = "0.06%" LblRetIVA.Text = "6.0%"
RetencionIVA = TmpDT.SUMD("RetIVA") RetencionIVA = TmpDT.SUMD("RetIVA")
TxtRetIVA.Text = RetencionIVA.ToString("###,###,###.00") TxtRetIVA.Text = RetencionIVA.ToString("###,###,###.00")

View File

@@ -1322,7 +1322,7 @@ Partial Class PopUpVerFactura
If CveConcepto = 33 Then ConceptoFormato = "ENTRADA MANUAL" If CveConcepto = 33 Then ConceptoFormato = "ENTRADA MANUAL"
'IMPRESION ESPECIAL SALIDA DE COMPUPROVEEDORES y VSH 'IMPRESION ESPECIAL SALIDA DE COMPUPROVEEDORES y VSH
If UsuarioActual.CveEmpresa.Contiene(72, 80, 119, 4, 145) Then If UsuarioActual.CveEmpresa.Contiene(72, 80, 119, 4, 145, 146) Then
params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa)) params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("Concepto", ConceptoFormato)) params.Add(New ReportParameter("Concepto", ConceptoFormato))
params.Add(New ReportParameter("Almacen", Almacen)) params.Add(New ReportParameter("Almacen", Almacen))
@@ -1471,7 +1471,7 @@ Partial Class PopUpVerFactura
If Archivo.Exists Then If Archivo.Exists Then
'IMPRESION ESPECIAL SALIDA DE COMPUPROVEEDORES y VSH 'IMPRESION ESPECIAL SALIDA DE COMPUPROVEEDORES y VSH
If UsuarioActual.CveEmpresa.Contiene(1, 72, 80, 119, 4, 145) Then If UsuarioActual.CveEmpresa.Contiene(1, 72, 80, 119, 4, 145, 146) Then
Dim CiudadSucursal As String = "" Dim CiudadSucursal As String = ""
Dim DomicilioSucursal As String = "" Dim DomicilioSucursal As String = ""
Dim DomicilioCliente As String = String.Format("{0} #{1}, {2}, Col. {3}, CP: {4}, {5}, {6}", DtMovimientos(0)("SucClienteDireccion").ToString, DtMovimientos(0)("SucClienteNoExt").ToString, DtMovimientos(0)("SucClienteNoInt").ToString, DtMovimientos(0)("SucClienteColonia"), DtMovimientos(0)("SucClienteCP").ToString, DtMovimientos(0)("SucClienteCiudad"), DtMovimientos(0)("SucClientePais").ToString) Dim DomicilioCliente As String = String.Format("{0} #{1}, {2}, Col. {3}, CP: {4}, {5}, {6}", DtMovimientos(0)("SucClienteDireccion").ToString, DtMovimientos(0)("SucClienteNoExt").ToString, DtMovimientos(0)("SucClienteNoInt").ToString, DtMovimientos(0)("SucClienteColonia"), DtMovimientos(0)("SucClienteCP").ToString, DtMovimientos(0)("SucClienteCiudad"), DtMovimientos(0)("SucClientePais").ToString)
@@ -1487,7 +1487,7 @@ Partial Class PopUpVerFactura
End If End If
If UsuarioActual.CveEmpresa.Contiene(72, 80) Then If UsuarioActual.CveEmpresa.Contiene(72, 80, 146) Then
params.Add(New ReportParameter("Fecha", String.Format("{0} {1}", FechaHora.ToDate.ToString("yyyy-MM-dd"), FechaHora.ToDateTime.ToString("HH:mm:ss")))) params.Add(New ReportParameter("Fecha", String.Format("{0} {1}", FechaHora.ToDate.ToString("yyyy-MM-dd"), FechaHora.ToDateTime.ToString("HH:mm:ss"))))
params.Add(New ReportParameter("SucursalCliente", DtMovimientos(0)("SucCliente").ToString)) params.Add(New ReportParameter("SucursalCliente", DtMovimientos(0)("SucCliente").ToString))

View File

@@ -2815,6 +2815,9 @@ Partial Class Compras_eFacturas
CveProveedor = gvRow.DataKey("CveProveedor").ToEntero CveProveedor = gvRow.DataKey("CveProveedor").ToEntero
Dim ObjCompras As New ClsCompras Dim ObjCompras As New ClsCompras
Dim TieneRegistros As Boolean = False
If ObjCompras.GetCompararComplementoPago(gvRow.DataKey("CveProveedor").ToEntero, Monto, nodePagos2.InnerXml.Replace("pago10:", ""), UsuarioActual.CveEmpresa) Then If ObjCompras.GetCompararComplementoPago(gvRow.DataKey("CveProveedor").ToEntero, Monto, nodePagos2.InnerXml.Replace("pago10:", ""), UsuarioActual.CveEmpresa) Then
GvVincularPago.DataSource = ObjCompras.DtResultados GvVincularPago.DataSource = ObjCompras.DtResultados
@@ -2822,7 +2825,7 @@ Partial Class Compras_eFacturas
SerieFolioIE = ObjCompras.DtResultados.Rows(0)("SerieFolio").ToString SerieFolioIE = ObjCompras.DtResultados.Rows(0)("SerieFolio").ToString
DivVincularPagoManualmente.Visible = False DivVincularPagoManualmente.Visible = False
BtnVincularPago.Visible = True BtnVincularPago.Visible = True
TieneRegistros = True
Else Else
DivVincularPagoManualmente.Visible = True DivVincularPagoManualmente.Visible = True
BtnVincularPago.Visible = False BtnVincularPago.Visible = False
@@ -2835,6 +2838,7 @@ Partial Class Compras_eFacturas
For Each drow As DataRow In ObjCompras.DtResultados.FiltraParametros("CveIE > 0 AND FechaDocumento IS NOT NULL", "", {"FechaDocumento"}).Rows For Each drow As DataRow In ObjCompras.DtResultados.FiltraParametros("CveIE > 0 AND FechaDocumento IS NOT NULL", "", {"FechaDocumento"}).Rows
Dim FechaDocumento As Date = drow("FechaDocumento").ToString.ToDate Dim FechaDocumento As Date = drow("FechaDocumento").ToString.ToDate
@@ -2873,12 +2877,18 @@ Partial Class Compras_eFacturas
TextoDiferenciaImporte = $"<b>&nbsp;&nbsp;-&nbsp;&nbsp; IE ${ImporteIES.FormatoNumero}</b> <div style='color:red'><strong>Diferencia { DiferenciaImportes.FormatoNumero() }</strong></div>" TextoDiferenciaImporte = $"<b>&nbsp;&nbsp;-&nbsp;&nbsp; IE ${ImporteIES.FormatoNumero}</b> <div style='color:red'><strong>Diferencia { DiferenciaImportes.FormatoNumero() }</strong></div>"
BtnVincularPago.Visible = False BtnVincularPago.Visible = False
MSGComplemento = MSGComplemento & $" Existe una diferencia mayor a $5.00 ({Math.Abs(DiferenciaImportes)})" MSGComplemento = MSGComplemento & $" Existe una diferencia mayor a $5.00 ({Math.Abs(DiferenciaImportes)})"
If TieneRegistros AndAlso UsuarioActual.TienePermisoProceso(286) Then
DivVincularPagoManualmente.Visible = True
End If
Else Else
'BtnVincularPago.Visible = True 'BtnVincularPago.Visible = True
'TextoDiferenciaImporte = "" 'TextoDiferenciaImporte = ""
End If End If
LblSerieFolioPago.Text = $"{SeriePago}-{FolioPago}" LblSerieFolioPago.Text = $"{SeriePago}-{FolioPago}"
LblImportePago.Text = Monto.ToString("###,###,###.00") 'ImportePago.FormatoNumero LblImportePago.Text = Monto.ToString("###,###,###.00") 'ImportePago.FormatoNumero
LblPagosCantidad.Text = PagosCantidad.ToString LblPagosCantidad.Text = PagosCantidad.ToString
@@ -2893,7 +2903,7 @@ Partial Class Compras_eFacturas
Else Else
LblMensajeComlementoError.Text = "" LblMensajeComlementoError.Text = ""
DVMensajecomplementoError.Visible = False DVMensajecomplementoError.Visible = False
DivVincularPagoManualmente.Visible = False
End If End If

View File

@@ -84,6 +84,14 @@ Partial Class Conta_RepMovimientosAuxiliaresCatalogo
ViewState("TP") = value ViewState("TP") = value
End Set End Set
End Property End Property
Private Property Cuenta As String
Get
Return ViewState("Cuenta").ToString
End Get
Set(value As String)
ViewState("Cuenta") = value
End Set
End Property
#End Region #End Region
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
@@ -226,6 +234,7 @@ Partial Class Conta_RepMovimientosAuxiliaresCatalogo
Exit Sub Exit Sub
End If End If
IdCuenta = DdlCuentas.SelectedValue.ToEntero IdCuenta = DdlCuentas.SelectedValue.ToEntero
Cuenta = DdlCuentas.SelectedItem.ToString
Dim ObjConta As New ClsContabilidad Dim ObjConta As New ClsContabilidad
If ObjConta.GetMovimientosAuxiliaresCatalogo(IdCuenta, FechaInicio, FechaFin, DdlMoneda.SelectedValue.ToEntero, CveSubProyecto, UsuarioActual.CveEmpresa, TipoReporte) Then If ObjConta.GetMovimientosAuxiliaresCatalogo(IdCuenta, FechaInicio, FechaFin, DdlMoneda.SelectedValue.ToEntero, CveSubProyecto, UsuarioActual.CveEmpresa, TipoReporte) Then
DtDatos = ObjConta.DtResultados DtDatos = ObjConta.DtResultados
@@ -463,6 +472,7 @@ Partial Class Conta_RepMovimientosAuxiliaresCatalogo
params.Add(New ReportParameter("pFechaFin", FechaFin.ToString("dd/MM/yyyy"))) params.Add(New ReportParameter("pFechaFin", FechaFin.ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("pFechaInicio", FechaInicio.ToString("dd/MM/yyyy"))) params.Add(New ReportParameter("pFechaInicio", FechaInicio.ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("CveMoneda", DdlMoneda.SelectedValue)) params.Add(New ReportParameter("CveMoneda", DdlMoneda.SelectedValue))
params.Add(New ReportParameter("Cuenta", Cuenta))
ImprimirPDF("Contabilidad2/Reportes/RepMovimientosAuxiliaresCatalogo.rdlc", DtDatos, params, "MovimientosAuxiliares", Formato) ImprimirPDF("Contabilidad2/Reportes/RepMovimientosAuxiliaresCatalogo.rdlc", DtDatos, params, "MovimientosAuxiliares", Formato)
End Sub End Sub
Protected Sub DdlTipoCuentas_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlTipoCuentas.SelectedIndexChanged Protected Sub DdlTipoCuentas_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlTipoCuentas.SelectedIndexChanged

View File

@@ -1318,7 +1318,7 @@
</TablixRowHierarchy> </TablixRowHierarchy>
<KeepTogether>true</KeepTogether> <KeepTogether>true</KeepTogether>
<DataSetName>DataSet1</DataSetName> <DataSetName>DataSet1</DataSetName>
<Top>0.06346cm</Top> <Top>0.06345cm</Top>
<Height>3cm</Height> <Height>3cm</Height>
<Width>20.37044cm</Width> <Width>20.37044cm</Width>
<Style> <Style>
@@ -1334,7 +1334,7 @@
<Width>8.01986in</Width> <Width>8.01986in</Width>
<Page> <Page>
<PageHeader> <PageHeader>
<Height>0.81597in</Height> <Height>1.14931in</Height>
<PrintOnFirstPage>true</PrintOnFirstPage> <PrintOnFirstPage>true</PrintOnFirstPage>
<PrintOnLastPage>true</PrintOnLastPage> <PrintOnLastPage>true</PrintOnLastPage>
<ReportItems> <ReportItems>
@@ -1438,6 +1438,49 @@
<PaddingBottom>2pt</PaddingBottom> <PaddingBottom>2pt</PaddingBottom>
</Style> </Style>
</Textbox> </Textbox>
<Textbox Name="Cuenta">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Cuenta: </Value>
<Style>
<FontFamily>Verdana</FontFamily>
<FontSize>8pt</FontSize>
<FontWeight>Bold</FontWeight>
</Style>
</TextRun>
<TextRun>
<Value>=Parameters!Cuenta.Value</Value>
<Style>
<FontFamily>Verdana</FontFamily>
<FontSize>8pt</FontSize>
<FontWeight>Bold</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Left</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Cuenta</rd:DefaultName>
<Top>0.84375in</Top>
<Height>0.25in</Height>
<Width>5.42127in</Width>
<ZIndex>3</ZIndex>
<Style>
<Border>
<Style>None</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</ReportItems> </ReportItems>
<Style> <Style>
<Border> <Border>
@@ -1470,7 +1513,7 @@
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox3</rd:DefaultName> <rd:DefaultName>Textbox3</rd:DefaultName>
<Top>0.07023cm</Top> <Top>0.07022cm</Top>
<Left>15.87314cm</Left> <Left>15.87314cm</Left>
<Height>0.6cm</Height> <Height>0.6cm</Height>
<Width>4.4973cm</Width> <Width>4.4973cm</Width>
@@ -1611,6 +1654,12 @@
<AllowBlank>true</AllowBlank> <AllowBlank>true</AllowBlank>
<Prompt>ReportParameter1</Prompt> <Prompt>ReportParameter1</Prompt>
</ReportParameter> </ReportParameter>
<ReportParameter Name="Cuenta">
<DataType>String</DataType>
<Nullable>true</Nullable>
<AllowBlank>true</AllowBlank>
<Prompt>ReportParameter1</Prompt>
</ReportParameter>
</ReportParameters> </ReportParameters>
<Code>Dim myVal As boolean <Code>Dim myVal As boolean
Public Function SetMyVal(ByVal temp As String) As boolean Public Function SetMyVal(ByVal temp As String) As boolean

View File

@@ -1749,19 +1749,22 @@
<TablixBody> <TablixBody>
<TablixColumns> <TablixColumns>
<TablixColumn> <TablixColumn>
<Width>2.12527cm</Width> <Width>1.34132cm</Width>
</TablixColumn> </TablixColumn>
<TablixColumn> <TablixColumn>
<Width>2.02474cm</Width> <Width>1.32237cm</Width>
</TablixColumn> </TablixColumn>
<TablixColumn> <TablixColumn>
<Width>10.17786cm</Width> <Width>2.53649cm</Width>
</TablixColumn>
<TablixColumn>
<Width>8.96945cm</Width>
</TablixColumn> </TablixColumn>
<TablixColumn> <TablixColumn>
<Width>2.52862cm</Width> <Width>2.52862cm</Width>
</TablixColumn> </TablixColumn>
<TablixColumn> <TablixColumn>
<Width>3.15415cm</Width> <Width>3.27979cm</Width>
</TablixColumn> </TablixColumn>
</TablixColumns> </TablixColumns>
<TablixRows> <TablixRows>
@@ -1776,7 +1779,7 @@
<Paragraph> <Paragraph>
<TextRuns> <TextRuns>
<TextRun> <TextRun>
<Value>Cantidad</Value> <Value>Cant.</Value>
<Style> <Style>
<FontFamily>calibri</FontFamily> <FontFamily>calibri</FontFamily>
<FontSize>9pt</FontSize> <FontSize>9pt</FontSize>
@@ -1838,6 +1841,42 @@
</Textbox> </Textbox>
</CellContents> </CellContents>
</TablixCell> </TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Textbox1">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Código</Value>
<Style>
<FontFamily>calibri</FontFamily>
<FontSize>9pt</FontSize>
<Color>White</Color>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Center</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox1</rd:DefaultName>
<Style>
<Border>
<Style>Solid</Style>
</Border>
<BackgroundColor>#ff1037</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell> <TablixCell>
<CellContents> <CellContents>
<Textbox Name="Textbox79"> <Textbox Name="Textbox79">
@@ -1973,7 +2012,7 @@
<Value>=Fields!Cantidad.Value</Value> <Value>=Fields!Cantidad.Value</Value>
<Style> <Style>
<FontSize>7pt</FontSize> <FontSize>7pt</FontSize>
<Format>#,0.00;(#,0.00)</Format> <Format>#,0;(#,0)</Format>
</Style> </Style>
</TextRun> </TextRun>
</TextRuns> </TextRuns>
@@ -2041,6 +2080,48 @@
</Textbox> </Textbox>
</CellContents> </CellContents>
</TablixCell> </TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Codigo">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Fields!Codigo.Value</Value>
<Style>
<FontSize>7pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Center</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Codigo</rd:DefaultName>
<Style>
<Border>
<Style>Solid</Style>
</Border>
<TopBorder>
<Style>None</Style>
</TopBorder>
<BottomBorder>
<Style>None</Style>
</BottomBorder>
<LeftBorder>
<Style>None</Style>
</LeftBorder>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell> <TablixCell>
<CellContents> <CellContents>
<Textbox Name="PS1"> <Textbox Name="PS1">
@@ -2225,6 +2306,38 @@
</Textbox> </Textbox>
</CellContents> </CellContents>
</TablixCell> </TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Textbox5">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value />
<Style />
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox5</rd:DefaultName>
<Style>
<Border>
<Style>None</Style>
</Border>
<TopBorder>
<Style>Solid</Style>
</TopBorder>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell> <TablixCell>
<CellContents> <CellContents>
<Textbox Name="Textbox83"> <Textbox Name="Textbox83">
@@ -2336,6 +2449,7 @@
<TablixMember /> <TablixMember />
<TablixMember /> <TablixMember />
<TablixMember /> <TablixMember />
<TablixMember />
</TablixMembers> </TablixMembers>
</TablixColumnHierarchy> </TablixColumnHierarchy>
<TablixRowHierarchy> <TablixRowHierarchy>
@@ -2355,7 +2469,7 @@
<Top>5.75246cm</Top> <Top>5.75246cm</Top>
<Left>0.11468cm</Left> <Left>0.11468cm</Left>
<Height>1.07241cm</Height> <Height>1.07241cm</Height>
<Width>20.01064cm</Width> <Width>19.97804cm</Width>
<ZIndex>26</ZIndex> <ZIndex>26</ZIndex>
<Style> <Style>
<Border> <Border>

View File

@@ -1742,6 +1742,12 @@
<AllowBlank>true</AllowBlank> <AllowBlank>true</AllowBlank>
<Prompt>ReportParameter1</Prompt> <Prompt>ReportParameter1</Prompt>
</ReportParameter> </ReportParameter>
<ReportParameter Name="TipoDocumento">
<DataType>String</DataType>
<Nullable>true</Nullable>
<AllowBlank>true</AllowBlank>
<Prompt>ReportParameter1</Prompt>
</ReportParameter>
</ReportParameters> </ReportParameters>
<EmbeddedImages> <EmbeddedImages>
<EmbeddedImage Name="compuproveedores"> <EmbeddedImage Name="compuproveedores">

View File

@@ -605,62 +605,62 @@
<div class="modal-body"> <div class="modal-body">
<div align="right"> <div align="right">
<input type="text" id="TxtBusq" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusq','{0}')", GvVtaPUE.ClientID) %>" style="display: inline-block; width: 150px;" /> <input type="text" id="TxtBusq" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusq','{0}')", GvVtaPUE.ClientID) %>" style="display: inline-block; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusq','{0}')", GvVtaPUE.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a> <a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusq','{0}')", GvVtaPUE.ClientID) %>" style="margin-top: -3px; margin-left: -13px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div> </div>
<asp:GridView ID="GvVtaPUE" runat="server" AutoGenerateColumns="False" <asp:GridView ID="GvVtaPUE" runat="server" AutoGenerateColumns="False"
DataKeysNames="CveVenta" DataKeysNames="CveVenta"
EmptyDataText="No se encontraron registros" ToolTip="Listado de Temas" EmptyDataText="No se encontraron registros" ToolTip="Listado de Temas"
CssClass="table table-striped table-advance table-hover Widthall ScrollAD" CssClass="table table-striped table-advance table-hover Widthall ScrollAD"
data-sort="true" data-sort="true"
data-freezerows="1" data-freezerows="1"
GridLines="None"> GridLines="None">
<Columns> <Columns>
<asp:TemplateField HeaderText="SerieFolio"> <asp:TemplateField HeaderText="SerieFolio">
<ItemTemplate> <ItemTemplate>
&nbsp;<asp:HyperLink ID="HplNum" runat="server" CssClass="Texto" Target="_blank" NavigateUrl='<%# Eval("CveVenta", "/Ventas/Ventas.aspx?CveVenta={0}") %>' Text='<%# Eval("SerieFolio") %>'></asp:HyperLink> &nbsp;<asp:HyperLink ID="HplNum" runat="server" CssClass="Texto" Target="_blank" NavigateUrl='<%# Eval("CveVenta", "/Ventas/Ventas.aspx?CveVenta={0}") %>' Text='<%# Eval("SerieFolio") %>'></asp:HyperLink>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Fecha"> <asp:TemplateField HeaderText="Fecha">
<ItemTemplate> <ItemTemplate>
&nbsp;<asp:Literal runat="server" Text='<%# Eval("Fecha", "{0:d}")%>'></asp:Literal> &nbsp;<asp:Literal runat="server" Text='<%# Eval("Fecha", "{0:d}")%>'></asp:Literal>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Cliente"> <asp:TemplateField HeaderText="Cliente">
<ItemTemplate> <ItemTemplate>
&nbsp;<asp:Literal runat="server" Text='<%# Eval("NombreComercial")%>'></asp:Literal> &nbsp;<asp:Literal runat="server" Text='<%# Eval("NombreComercial")%>'></asp:Literal>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="SubProyecto"> <asp:TemplateField HeaderText="SubProyecto">
<ItemTemplate> <ItemTemplate>
<asp:Literal runat="server" Text='<%# Eval("SubProyecto") %>'></asp:Literal> <asp:Literal runat="server" Text='<%# Eval("SubProyecto") %>'></asp:Literal>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Total" ItemStyle-HorizontalAlign="Right"> <asp:TemplateField HeaderText="Total" ItemStyle-HorizontalAlign="Right">
<ItemTemplate> <ItemTemplate>
<asp:Literal runat="server" Text='<%# Eval("Total", "{0:N2}") %>'></asp:Literal> <asp:Literal runat="server" Text='<%# Eval("Total", "{0:N2}") %>'></asp:Literal>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField ItemStyle-Width="10px" ItemStyle-HorizontalAlign="Left"> <asp:TemplateField ItemStyle-Width="10px" ItemStyle-HorizontalAlign="Left">
<ItemTemplate> <ItemTemplate>
<asp:Literal runat="server" Text='<%# Eval("Abreviatura") %>'></asp:Literal> <asp:Literal runat="server" Text='<%# Eval("Abreviatura") %>'></asp:Literal>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Saldo" ItemStyle-HorizontalAlign="Right"> <asp:TemplateField HeaderText="Saldo" ItemStyle-HorizontalAlign="Right">
<ItemTemplate> <ItemTemplate>
<div style="margin-right: 20px"> <div style="margin-right: 20px">
<asp:Literal runat="server" Text='<%# Eval("Saldo", "{0:N2}") %>'></asp:Literal> <asp:Literal runat="server" Text='<%# Eval("Saldo", "{0:N2}") %>'></asp:Literal>
</div> </div>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
</Columns> </Columns>
</asp:GridView> </asp:GridView>
<div class="modal-footer"> <div class="modal-footer">
<asp:UpdatePanel runat="server"> <asp:UpdatePanel runat="server">
<ContentTemplate> <ContentTemplate>
@@ -674,6 +674,112 @@
</div> </div>
<div id="ModalMitoteresat" class="modal ADS fade " role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content modal-lg">
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<asp:HyperLink runat="server" NavigateUrl="/Ventas/RepConciliacionEmitidosSat.aspx?RegistroEn=4&FechaInicio=2000/01/01" CssClass="btn btn-xs btn-default" style="float:right;">Ir a Reporte</asp:HyperLink>
<h4 class="modal-title">Ventas sin registrar en SIG</h4>
</div>
<div class="modal-body">
<div style="text-align: right">
<input type="text" id="TxtBusquedaFolioSat" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaFolioSat','{0}')", GvFoliosSAT.ClientID) %>" style="display: inline-block; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaFolioSat','{0}')", GvFoliosSAT.ClientID) %>" style="margin-top: -3px; margin-left: -13px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<asp:GridView ID="GvFoliosSAT" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron factura canceladas pendientes"
DataKeyNames="FolioFiscal,RFC,Total"
CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" Style="text-align: center;" GridLines="None" Width="99%">
<Columns>
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="15%" HeaderText="Folio Fiscal">
<ItemTemplate>
<div style="white-space:nowrap "><asp:Label runat="server" Text='<%# Eval("FolioFiscal")%>'> </asp:Label></div>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="Serie Folio" DataField="SerieFolio" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField HeaderText="Proveedor" DataField="NombreProveedor" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField HeaderText="Importe" DataField="Total" DataFormatString="{0:N2}" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Fecha" DataField="Fecha" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Center" />
<%--<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="15%" HeaderText=" ">
<ItemTemplate>
<asp:LinkButton runat="server" CssClass="btn btn-circle btn-sm blue" Text="<i class='fa fa-plus'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea Agregar la factura?" data-btn-ok-label="si"></asp:LinkButton>
<asp:LinkButton runat="server" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-remove'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea cancelacar la factura ante el sat?" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>--%>
</Columns>
<RowStyle CssClass="Texto" />
<HeaderStyle CssClass="Titulos" />
</asp:GridView>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</div>
</div>
</div>
</div>
<div id="ModalMitotereCancelaPendiente" class="modal ADS fade " role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content modal-lg">
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<asp:HyperLink runat="server" NavigateUrl="/Ventas/RepCancelacionesPorAtender.aspx" CssClass="btn btn-xs btn-default" style="float:right;">Ir a Reporte</asp:HyperLink>
<h4 class="modal-title">Cancelaciones por Atender</h4>
</div>
<div class="modal-body">
<div style="text-align: right">
<input type="text" id="TxtBusquedaCancelaPendiente" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaCancelaPendiente','{0}')", gvCancelaPendiente.ClientID) %>" style="display: inline-block; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaCancelaPendiente','{0}')", gvCancelaPendiente.ClientID) %>" style="margin-top: -3px; margin-left: -13px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<asp:GridView ID="gvCancelaPendiente" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron factura canceladas pendientes"
DataKeyNames="FolioFiscal,RFC,Total"
CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" Style="text-align: center;" GridLines="None" Width="99%">
<Columns>
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="15%" HeaderText="Folio Fiscal">
<ItemTemplate>
<div style="white-space:nowrap "><asp:Label runat="server" Text='<%# Eval("FolioFiscal")%>'> </asp:Label></div>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="Serie Folio" DataField="SerieFolio" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField HeaderText="Proveedor" DataField="NombreProveedor" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField HeaderText="Importe" DataField="Total" DataFormatString="{0:N2}" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Fecha" DataField="Fecha" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Center" />
<%--<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="15%" HeaderText=" ">
<ItemTemplate>
<asp:LinkButton runat="server" CssClass="btn btn-circle btn-sm blue" Text="<i class='fa fa-plus'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea Agregar la factura?" data-btn-ok-label="si"></asp:LinkButton>
<asp:LinkButton runat="server" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-remove'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea cancelacar la factura ante el sat?" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>--%>
</Columns>
<RowStyle CssClass="Texto" />
<HeaderStyle CssClass="Titulos" />
</asp:GridView>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</div>
</div>
</div>
</div>
<div id="ModalComprasPUE" class="modal ADS fade" role="dialog"> <div id="ModalComprasPUE" class="modal ADS fade" role="dialog">
<div class="modal-dialog"> <div class="modal-dialog">
@@ -685,64 +791,64 @@
</div> </div>
<div class="modal-body"> <div class="modal-body">
<div align="right"> <div style="text-align:right">
<input type="text" id="TxtBus" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBus','{0}')", GvCompPUE.ClientID) %>" style="display: inline-block; width: 150px;" /> <input type="text" id="TxtBus" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBus','{0}')", GvCompPUE.ClientID) %>" style="display: inline-block; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBus','{0}')", GvCompPUE.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a> <a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBus','{0}')", GvCompPUE.ClientID) %>" style="margin-top: -3px; margin-left: -13px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div> </div>
<asp:GridView ID="GvCompPUE" runat="server" AutoGenerateColumns="False" <asp:GridView ID="GvCompPUE" runat="server" AutoGenerateColumns="False"
DataKeysNames="CveCompra" DataKeysNames="CveCompra"
EmptyDataText="No se encontraron registros" ToolTip="Listado de Temas" EmptyDataText="No se encontraron registros" ToolTip="Listado de Temas"
CssClass="table table-striped table-advance table-hover Widthall ScrollAD" CssClass="table table-striped table-advance table-hover Widthall ScrollAD"
data-sort="true" data-sort="true"
data-freezerows="1" data-freezerows="1"
GridLines="None"> GridLines="None">
<Columns> <Columns>
<asp:TemplateField HeaderText="SerieFolio"> <asp:TemplateField HeaderText="SerieFolio">
<ItemTemplate> <ItemTemplate>
&nbsp;<asp:HyperLink ID="HplNum" runat="server" CssClass="Texto" Target="_blank" NavigateUrl='<%# Eval("CveCompra", "/Compras/Compras.aspx?CveCompra={0}") %>' Text='<%# Eval("SerieFolio") %>'></asp:HyperLink> &nbsp;<asp:HyperLink ID="HplNum" runat="server" CssClass="Texto" Target="_blank" NavigateUrl='<%# Eval("CveCompra", "/Compras/Compras.aspx?CveCompra={0}") %>' Text='<%# Eval("SerieFolio") %>'></asp:HyperLink>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Fecha"> <asp:TemplateField HeaderText="Fecha">
<ItemTemplate> <ItemTemplate>
&nbsp;<asp:Literal runat="server" Text='<%# Eval("Fecha", "{0:d}")%>'></asp:Literal> &nbsp;<asp:Literal runat="server" Text='<%# Eval("Fecha", "{0:d}")%>'></asp:Literal>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Proveedor"> <asp:TemplateField HeaderText="Proveedor">
<ItemTemplate> <ItemTemplate>
&nbsp;<asp:Literal runat="server" Text='<%# Eval("NombreComercial")%>'></asp:Literal> &nbsp;<asp:Literal runat="server" Text='<%# Eval("NombreComercial")%>'></asp:Literal>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="SubProyecto"> <asp:TemplateField HeaderText="SubProyecto">
<ItemTemplate> <ItemTemplate>
<asp:Literal runat="server" Text='<%# Eval("SubProyecto") %>'></asp:Literal> <asp:Literal runat="server" Text='<%# Eval("SubProyecto") %>'></asp:Literal>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Total" ItemStyle-HorizontalAlign="Right"> <asp:TemplateField HeaderText="Total" ItemStyle-HorizontalAlign="Right">
<ItemTemplate> <ItemTemplate>
<asp:Literal runat="server" Text='<%# Eval("Total", "{0:N2}") %>'></asp:Literal> <asp:Literal runat="server" Text='<%# Eval("Total", "{0:N2}") %>'></asp:Literal>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField ItemStyle-Width="10px" ItemStyle-HorizontalAlign="Left"> <asp:TemplateField ItemStyle-Width="10px" ItemStyle-HorizontalAlign="Left">
<ItemTemplate> <ItemTemplate>
<asp:Literal runat="server" Text='<%# Eval("Abreviatura") %>'></asp:Literal> <asp:Literal runat="server" Text='<%# Eval("Abreviatura") %>'></asp:Literal>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Saldo" ItemStyle-HorizontalAlign="Right"> <asp:TemplateField HeaderText="Saldo" ItemStyle-HorizontalAlign="Right">
<ItemTemplate> <ItemTemplate>
<div style="margin-right: 20px"> <div style="margin-right: 20px">
<asp:Literal runat="server" Text='<%# Eval("Saldo", "{0:N2}") %>'></asp:Literal> <asp:Literal runat="server" Text='<%# Eval("Saldo", "{0:N2}") %>'></asp:Literal>
</div> </div>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
</Columns> </Columns>
</asp:GridView> </asp:GridView>
<div class="modal-footer"> <div class="modal-footer">
<asp:UpdatePanel runat="server"> <asp:UpdatePanel runat="server">
<ContentTemplate> <ContentTemplate>
@@ -767,13 +873,15 @@
</div> </div>
<div class="modal-body"> <div class="modal-body">
<div align="left"> <div class="row">
<div class="col-md-6">
# Inconsistencias: # Inconsistencias:
<asp:Label ID="LblInconsistenciasNum" runat="server" Text="0" Font-Bold="true"></asp:Label> <asp:Label ID="LblInconsistenciasNum" runat="server" Text="0" Font-Bold="true"></asp:Label>
</div> </div>
<div align="right"> <div class="col-md-6" style="text-align :right">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvIncons.ClientID) %>" style="display: inline-block; width: 150px;" /> <input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvIncons.ClientID) %>" style="display: inline-block; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvIncons.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a> <a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvIncons.ClientID) %>" style="margin-top: -3px; margin-left: -13px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
</div> </div>
<asp:GridView ID="GvIncons" runat="server" CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" GridLines="None"> <asp:GridView ID="GvIncons" runat="server" CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" GridLines="None">
</asp:GridView> </asp:GridView>
@@ -800,7 +908,15 @@
</div> </div>
<div class="modal-body"> <div class="modal-body">
# No Timbradas: <div class="row">
<div class="col-md-6"># No Timbradas:</div>
<div class="col-md-6" style="text-align :right">
<input type="text" id="TxtBusquedaCentroCosto" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaCentroCosto','{0}')", GvNoTimbradasCentroCosto.ClientID) %>" style="display: inline-block; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaCentroCosto','{0}')", GvNoTimbradasCentroCosto.ClientID) %>" style="margin-top: -3px; margin-left: -13px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
</div>
<asp:Label ID="LblNoTimbradas" runat="server" Text="0" Font-Bold="true"></asp:Label> <asp:Label ID="LblNoTimbradas" runat="server" Text="0" Font-Bold="true"></asp:Label>
<asp:GridView ID="GvNoTimbradasCentroCosto" CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" AutoGenerateColumns="false" runat="server" GridLines="None"> <asp:GridView ID="GvNoTimbradasCentroCosto" CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" AutoGenerateColumns="false" runat="server" GridLines="None">
<Columns> <Columns>
@@ -892,7 +1008,7 @@
<h4 class="modal-title" id="myModalLabel2" runat="server">Evaluaciones Pendientes</h4> <h4 class="modal-title" id="myModalLabel2" runat="server">Evaluaciones Pendientes</h4>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 5px; text-align: right" align="left"> <div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 5px; text-align: right" >
<div style="margin-right: 15px"> <div style="margin-right: 15px">
<input type="text" id="TxtBusquedaEva" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaEva','{0}')", GvEvaluaciones.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" /> <input type="text" id="TxtBusquedaEva" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaEva','{0}')", GvEvaluaciones.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvEvaluaciones.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a> <a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvEvaluaciones.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>

View File

@@ -14,8 +14,68 @@ Partial Class Inicio
Private Dias() As String = {"Domingo", "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado"} Private Dias() As String = {"Domingo", "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado"}
Public Function GetFacturasCanceladasPendientesWS(objventas As ClsVentas, RFC As String, CveEmpresa As Integer, Optional showalert As Boolean = True) As Boolean
Dim retorno As Boolean = False
Try
Dim objServicio As Cancelacion.CancelacionSoapClient = New Cancelacion.CancelacionSoapClient()
Dim resp As Cancelacion.StructCancel = objServicio.ObtienePendientes(RFC, "UserTest", "1234567890")
If resp.Estado = 0 Then
Dim XmlPendientes As String = System.Text.Encoding.UTF8.GetString(Convert.FromBase64String(resp.Xml))
Dim theReader As IO.StringReader = New IO.StringReader(XmlPendientes)
Dim theDataSet As DataSet = New DataSet()
theDataSet.ReadXml(theReader)
If theDataSet.Tables(0).Rows(0)("Uuid").ToString() <> "null" Then
Dim sb = New StringBuilder()
For Each item As DataRow In theDataSet.Tables(0).Rows
sb.AppendFormat("{0};", item("Uuid").ToString())
Next
If objventas.GetFacturasCanceladasPendientes(sb.ToString(), CveEmpresa) Then
retorno = True
End If
Else
If showalert Then
Alert("No se encontraron cancelaciones pendientes", ModExtensiones.TipoMensaje.MsgError)
End If
End If
Else
Alert("Error al obtener cancelaciones pendientes: " & resp.Descripcion, ModExtensiones.TipoMensaje.MsgError)
End If
Catch ex As Exception
retorno = False
Me.OnError("Error al obtener cancelaciones pendientes: ", ex, "")
End Try
Return retorno
End Function
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then If Not IsPostBack Then
If UsuarioActual.CveUsuario = 100 Then
Using objgral As New ClsGenerales
objgral.RepConciliacionSatDetalleGET(UsuarioActual.CveEmpresa, "I", "", "", 10)
If objgral.DtResultados.Rows.Count > 0 Then
GvFoliosSAT.DataSource = objgral.DtResultados
RegistraScript("$('#ModalMitoteresat').modal();", "mitoterosat")
End If
End Using
GvFoliosSAT.DataBind()
End If
If UsuarioActual.CveUsuario = 100 Then
Using objventas As New ClsVentas
If (GetFacturasCanceladasPendientesWS(objventas, UsuarioActual.Empresa.RFC, UsuarioActual.CveEmpresa, False)) AndAlso objventas.DtResultados.Rows.Count > 0 Then
RegistraScript("$('#ModalMitotereCancelaPendiente').modal();", "mitoterosatCanceladasPendientesWS")
End If
End Using
End If
'RESTRICCION AD 'RESTRICCION AD
If Not IsNothing(Request("ADCod")) Then If Not IsNothing(Request("ADCod")) Then
'viene el msg encriptado, para sacar el modulo 'viene el msg encriptado, para sacar el modulo

View File

@@ -655,13 +655,14 @@ function AbrirVentana(Pagina, Ancho, Alto, tmp, Titulo) {
if (!(Alto)) { Alto = '601'; } if (!(Alto)) { Alto = '601'; }
$('#ajaxidmodal #myFrame').css({ width: Ancho, height: Alto }); $('#ajaxidmodal #myFrame').css({ width: Ancho, height: Alto });
$('#ajaxidmodal ').css({ width: Ancho, height: Alto }); $('#ajaxidmodal ').css({ width: Ancho, height: Alto });
$('#ajaxidmodal #myFrame').load(function() { $("#ajax").modal();
$('#ajaxidmodal').removeClass("hidden"); $('#ajaxidmodal').removeClass("hidden");
$("#ajax").modal(); $("#ajaxidmodal #myFrame").unbind("load");
$('#ajaxidmodal #myFrame').load(function () {
Metronic.unblockUI(); Metronic.unblockUI();
}); });
$('#ajaxidmodal #myFrame').prop('src', Pagina); $('#ajaxidmodal #myFrame').prop('src', Pagina);
$("#ajax").modal(); //$("#ajax").modal();
} }
function CerrarVentana() { function CerrarVentana() {

View File

@@ -838,7 +838,7 @@
</div> </div>
<div id="DivRetenciones" runat="server"> <div id="DivRetenciones" runat="server">
<div id="DivTipoRetenciones" runat="server" visible="false" class="form-group form-md-line-input input-iconright"> <div id="DivTipoRetenciones" runat="server" visible="false" class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlTipoRetencion" AutoPostBack="true" OnSelectedIndexChanged="DdlTipoRetencion_SelectedIndexChanged" CssClass="form-control select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="MetodoPago" DataValueField="CveMetodoPago" ValidationGroup="GrpGuardar"> <asp:DropDownList ID="DdlTipoRetencion" CssClass="form-control select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="MetodoPago" DataValueField="CveMetodoPago" ValidationGroup="GrpGuardar">
<asp:ListItem Selected="True" Text="Sin Retención" Value="0"></asp:ListItem> <asp:ListItem Selected="True" Text="Sin Retención" Value="0"></asp:ListItem>
<asp:ListItem Text="Arrendamiento" Value="1"></asp:ListItem> <asp:ListItem Text="Arrendamiento" Value="1"></asp:ListItem>
<asp:ListItem Text="Servicios Profesionales" Value="2"></asp:ListItem> <asp:ListItem Text="Servicios Profesionales" Value="2"></asp:ListItem>

View File

@@ -9941,22 +9941,5 @@ Partial Class Clientes
End Sub End Sub
#End Region #End Region
Protected Sub DdlTipoRetencion_SelectedIndexChanged(sender As Object, e As EventArgs)
Select Case DdlTipoRetencion.SelectedValue
Case "1" 'Arrendamiento
TxtRetIVA.Text = "10"
TxtRetISR.Text = "10"
Case "2" 'Servicios Profesionales
TxtRetIVA.Text = "10"
TxtRetISR.Text = "10"
Case "3" 'Fletes
TxtRetIVA.Text = "4"
TxtRetISR.Text = "4"
Case "4" 'Servicios
TxtRetIVA.Text = "6"
TxtRetISR.Text = "6"
End Select
UpFiscalContable.Update()
End Sub
End Class End Class

View File

@@ -1648,10 +1648,12 @@ Partial Class PV
CveMetodoPagoCliente = ObjCliente.DtResultados.Rows(0)("CveMetodoPago").ToString.ToEntero CveMetodoPagoCliente = ObjCliente.DtResultados.Rows(0)("CveMetodoPago").ToString.ToEntero
DdlUsoCFDI.SelectedValueExist(ObjCliente.CveUsoCFDI.ToString) DdlUsoCFDI.SelectedValueExist(ObjCliente.CveUsoCFDI.ToString)
DdlMetodoPago.SelectedValueExist(ObjCliente.CveMetodoPago.ToString) DdlMetodoPago.SelectedValueExist(ObjCliente.CveMetodoPago.ToString)
DdlMetodoPago33.SelectedValueExist(ObjCliente.DtResultados.Rows(0)("CveMetodoPago33").ToString) DdlMetodoPago33.SelectedValueExist(ObjCliente.CveMetodoPago33.ToString)
'DdlMetodoPago33.SelectedValueExist(ObjCliente.DtResultados.Rows(0)("CveMetodoPago33").ToString)
DdlMetodoPago33_SelectedIndexChanged(DdlMetodoPago33, EventArgs.Empty) DdlMetodoPago33_SelectedIndexChanged(DdlMetodoPago33, EventArgs.Empty)
DdlFormaPago33.SelectedValueExist(ObjCliente.DtResultados.Rows(0)("CveFormaPago33").ToString) DdlFormaPago33.SelectedValueExist(ObjCliente.CveFormaPago33.ToString)
'DdlFormaPago33.SelectedValueExist(ObjCliente.DtResultados.Rows(0)("CveFormaPago33").ToString)
DdlUsoCFDI.SelectedValueExist(ObjCliente.DtResultados.Rows(0)("CveUsoCFDI").ToString) DdlUsoCFDI.SelectedValueExist(ObjCliente.DtResultados.Rows(0)("CveUsoCFDI").ToString)
End If End If
TxtFechaPago.Text = (Now.AddDays(ObjCliente.PlazoCobranza)).ToShortDateString TxtFechaPago.Text = (Now.AddDays(ObjCliente.PlazoCobranza)).ToShortDateString
@@ -4729,7 +4731,10 @@ Partial Class PV
Dim ObjCliente As New ClsClientes Dim ObjCliente As New ClsClientes
If ObjCliente.AgregarClienteNoFrecuente(TxtNombreCliente.Text.Trim, TxtDireccionCliente.Text.Trim, TxtNumExtCliente.Text.Trim, TxtNumIntCliente.Text.Trim, TxtColoniaCliente.Text.Trim, TxtLocalidadCliente.Text.Trim, TxtCiudadCliente.Text.Trim, TxtEstadoCliente.Text.Trim, TxtPaisCliente.Text.Trim, TxtRFCCliente.Text.Trim, TxtCPCliente.Text.Trim, TxtTelefonoCliente.Text.Trim, TxtCorreoCliente.Text.Trim, DdlSubProyectoDatos.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, "") Then If ObjCliente.AgregarClienteNoFrecuente(TxtNombreCliente.Text.Trim, TxtDireccionCliente.Text.Trim, TxtNumExtCliente.Text.Trim, TxtNumIntCliente.Text.Trim, TxtColoniaCliente.Text.Trim,
TxtLocalidadCliente.Text.Trim, TxtCiudadCliente.Text.Trim, TxtEstadoCliente.Text.Trim, TxtPaisCliente.Text.Trim, TxtRFCCliente.Text.Trim,
TxtCPCliente.Text.Trim, TxtTelefonoCliente.Text.Trim, TxtCorreoCliente.Text.Trim, DdlSubProyectoDatos.SelectedValue.ToEntero, UsuarioActual.CveUsuario,
UsuarioActual.CveEmpresa, "", DdlMetodoCliente.SelectedValue.ToEntero, DdlFormaCliente.SelectedValue.ToEntero) Then
If ObjCliente.DtResultados.Rows.Count > 0 Then If ObjCliente.DtResultados.Rows.Count > 0 Then
RegistraScript("hideDivEC();") RegistraScript("hideDivEC();")
ViewState("CveCliente") = ObjCliente.DtResultados(0)("CveCliente").ToString.ToEntero ViewState("CveCliente") = ObjCliente.DtResultados(0)("CveCliente").ToString.ToEntero

View File

@@ -27,39 +27,49 @@ public partial class Ventas_RepCancelacionesPorAtender : ClsPaginas
} }
private void CargarPendientes() private void CargarPendientes()
{ {
Cancelacion.CancelacionSoapClient objServicio = new Cancelacion.CancelacionSoapClient();
Cancelacion.StructCancel resp = objServicio.ObtienePendientes(UsuarioActual.Empresa.RFC, "UserTest", "1234567890"); //Cancelacion.CancelacionSoapClient objServicio = new Cancelacion.CancelacionSoapClient();
if (resp.Estado == 0) //Cancelacion.StructCancel resp = objServicio.ObtienePendientes(UsuarioActual.Empresa.RFC, "UserTest", "1234567890");
//if (resp.Estado == 0)
//{
// string XmlPendientes = DecodeBase64(resp.Xml);
// StringReader theReader = new StringReader(XmlPendientes);
// DataSet theDataSet = new DataSet();
// theDataSet.ReadXml(theReader);
// if (theDataSet.Tables[0].Rows[0]["Uuid"].ToString() != "null")
// {
// var sb = new StringBuilder();
// foreach (DataRow item in theDataSet.Tables[0].Rows)
// {
// sb.AppendFormat("{0};", item["Uuid"].ToString());
// }
// var ObjVentas = new ClsVentas();
// if (ObjVentas.GetFacturasCanceladasPendientes(sb.ToString(), UsuarioActual.CveEmpresa))
// {
// GvDatos.DataSource = ObjVentas.DtResultados;
// }
// ObjVentas.Dispose();
// }
// else
// {
// GvDatos.DataSource = null;
// Alert("No se encontraron cancelaciones pendientes");
// }
//}
//else
//{
// GvDatos.DataSource = null;
// Alert("Error al obtener cancelaciones pendientes: " + resp.Descripcion, ModExtensiones.TipoMensaje.MsgError);
//}
using (ClsVentas ObjVentas = new ClsVentas())
{ {
string XmlPendientes = DecodeBase64(resp.Xml); if (ObjVentas.GetFacturasCanceladasPendientesWS(UsuarioActual.Empresa.RFC, UsuarioActual.CveEmpresa))
StringReader theReader = new StringReader(XmlPendientes);
DataSet theDataSet = new DataSet();
theDataSet.ReadXml(theReader);
if (theDataSet.Tables[0].Rows[0]["Uuid"].ToString() != "null")
{ {
var sb = new StringBuilder(); GvDatos.DataSource = ObjVentas.DtResultados;
foreach (DataRow item in theDataSet.Tables[0].Rows)
{
sb.AppendFormat("{0};", item["Uuid"].ToString());
}
var ObjVentas = new ClsVentas();
if (ObjVentas.GetFacturasCanceladasPendientes(sb.ToString(), UsuarioActual.CveEmpresa))
{
GvDatos.DataSource = ObjVentas.DtResultados;
}
ObjVentas.Dispose();
}
else
{
GvDatos.DataSource = null;
Alert("No se encontraron cancelaciones pendientes");
} }
} }
else
{
GvDatos.DataSource = null;
Alert("Error al obtener cancelaciones pendientes: " + resp.Descripcion, ModExtensiones.TipoMensaje.MsgError);
}
GvDatos.DataBind(); GvDatos.DataBind();
UPDatos.Update(); UPDatos.Update();
} }
@@ -154,8 +164,7 @@ public partial class Ventas_RepCancelacionesPorAtender : ClsPaginas
{ {
try try
{ {
byte[] decbuff = Convert.FromBase64String(strXMLCodificado); return System.Text.Encoding.UTF8.GetString(Convert.FromBase64String(strXMLCodificado));
return System.Text.Encoding.UTF8.GetString(decbuff);
} }
catch catch
{ {

View File

@@ -11,10 +11,12 @@ using Extensiones;
using System.Data; using System.Data;
using System.Text; using System.Text;
using ADSistemaLibrary.SatXml; using ADSistemaLibrary.SatXml;
//using ADS_CFDI_SAT; //using ADS_CFDI_SAT;
public partial class Ventas_RepConciliacionEmitidosSat : ClsPaginas public partial class Ventas_RepConciliacionEmitidosSat : ClsPaginas
{ {
#region "Propiedades"
const string rqFechaInicio = "FechaInicio"; const string rqFechaInicio = "FechaInicio";
const string rqFechaFin = "FechaFin"; const string rqFechaFin = "FechaFin";
const string rqRegistroEn = "RegistroEn"; const string rqRegistroEn = "RegistroEn";
@@ -59,10 +61,44 @@ public partial class Ventas_RepConciliacionEmitidosSat : ClsPaginas
set { ViewState["RegistroEn"] = value; } set { ViewState["RegistroEn"] = value; }
} }
private StringBuilder strErrores; private StringBuilder strErrores;
#endregion
protected void Page_Load(object sender, EventArgs e) protected void Page_Load(object sender, EventArgs e)
{ {
if (!IsPostBack) if (!IsPostBack)
{ {
string path;
if (Request["op"] != null && Request["op"].ToString().Length > 0)
{
try
{
if (System.IO.File.Exists((path = string.Format("{0}\\{1}", UsuarioActual.Empresa.Ruta.Trim(), Extensiones.ModExtensiones.Decripta(Request["op"].ToString()).Trim()).Replace("/", "\\"))))
{
System.IO.FileInfo archivo = new System.IO.FileInfo(path);
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.ClearContent();
HttpContext.Current.Response.ContentType = "text/plain";
HttpContext.Current.Response.AppendHeader("Content-disposition", string.Format("attachment; filename={0}", archivo.Name));
HttpContext.Current.Response.AddHeader("Content-Length", archivo.Length.ToString());
HttpContext.Current.Response.TransmitFile(path);
HttpContext.Current.Response.End();
}
else
{
RegistraScript("window.close()");
}
}
catch (Exception ex)
{
Extensiones.ModExtensiones.GuardaLog(ex.ToString());
RegistraScript("window.close()");
}
}
fillrequestfields(); fillrequestfields();
DdlSubProyectoDatos.DataSource = get_GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1).FiltraParametros("EsSucursal = True "); DdlSubProyectoDatos.DataSource = get_GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1).FiltraParametros("EsSucursal = True ");
DdlSubProyectoDatos.DataBind(); DdlSubProyectoDatos.DataBind();
@@ -151,8 +187,10 @@ public partial class Ventas_RepConciliacionEmitidosSat : ClsPaginas
{ {
{ {
string ruta = string.Format("{0}\\{1}", UsuarioActual.Empresa.Ruta.Trim(), gvrow.DataKey("RutaXml").Trim()).Replace("/", "\\"); //gvrow.DataKey("RutaXml");
//Alert(ruta);
string ruta = gvrow.DataKey("RutaXml"); //return false;
strErrores = new StringBuilder(); strErrores = new StringBuilder();
XmlSatCFDI objxml = null; XmlSatCFDI objxml = null;
Modelos.Factura objfact = null; Modelos.Factura objfact = null;
@@ -743,18 +781,18 @@ public partial class Ventas_RepConciliacionEmitidosSat : ClsPaginas
if (e.Row.RowType == DataControlRowType.DataRow) if (e.Row.RowType == DataControlRowType.DataRow)
{ {
string navurl = ""; string navurl = "";
if(e.Row.DBCampo("Tipo") == "1") if (e.Row.DBCampo("Tipo") == "1")
{ {
string RutaXml = e.Row.DBCampo("RutaXml"); string RutaXml = e.Row.DBCampo("RutaXml");
if (RutaXml.IndexOf("Empresas")>0) //if (RutaXml.IndexOf("Empresas")>0)
{ //{
RutaXml = RutaXml.Substring(RutaXml.IndexOf("Empresas")); // RutaXml = RutaXml.Substring(RutaXml.IndexOf("Empresas"));
} //}
navurl =string.Format("RepConciliacionEmitidosSat.aspx?op=", e.Row.DBCampo("RutaXml")); navurl = string.Format("RepConciliacionEmitidosSat.aspx?op={0}", Extensiones.ModExtensiones.Encripta(e.Row.DataKey("RutaXml")));
} }
else else
{ {
navurl = string.Format("/Compras/PopUpVerFactura.aspx?P={0}", Extensiones.ModExtensiones.Encripta(String.Format("OP=FactVta&CVEVENTA={0}&EXT={1}&SERIEFOLIO={2}&TIPODOCTO={3}", e.Row.DBCampo("CveVenta"), "XML", e.Row.DBCampo("SerieFolio"), e.Row.DBCampo("TipoDocto")))); navurl = string.Format("/Compras/PopUpVerFactura.aspx?P={0}", Extensiones.ModExtensiones.Encripta(String.Format("OP=FactVta&CVEVENTA={0}&EXT={1}&SERIEFOLIO={2}&TIPODOCTO={3}", e.Row.DBCampo("CveVenta"), "XML", e.Row.DBCampo("SerieFolio"), e.Row.DBCampo("TipoDocto"))));
} }
e.Row.FCHyperLink("HypXml").NavigateUrl = navurl; e.Row.FCHyperLink("HypXml").NavigateUrl = navurl;
} }

File diff suppressed because it is too large Load Diff

View File

@@ -4113,6 +4113,7 @@ Partial Class Ventas
'Sección Detalle 'Sección Detalle
DdlMoneda.Enabled = False DdlMoneda.Enabled = False
DdlTipoRetencion.Enabled = False
TxtFechaEjecucion.ReadOnly = True TxtFechaEjecucion.ReadOnly = True
ImgCalendarFechaEje.Enabled = False ImgCalendarFechaEje.Enabled = False
'DdlSucursalEjecucion.Enabled = False 'DdlSucursalEjecucion.Enabled = False
@@ -4293,6 +4294,8 @@ Partial Class Ventas
End If End If
End If End If
CargaCodigoUnico()
UpPS.Update() UpPS.Update()
UpContado.Update() UpContado.Update()
UpEstatus.Update() UpEstatus.Update()
@@ -4701,6 +4704,9 @@ Partial Class Ventas
ViewState("ClienteRetIVA") = ObjCliente.RetIVA / 100 ViewState("ClienteRetIVA") = ObjCliente.RetIVA / 100
ViewState("ClienteRetISR") = ObjCliente.RetISR / 100 ViewState("ClienteRetISR") = ObjCliente.RetISR / 100
DdlTipoRetencion.SelectedValueExist(ObjCliente.DtResultados(0)("CveTipoRetencion").ToString)
DdlTipoRetencion_SelectedIndexChanged(DdlTipoRetencion, EventArgs.Empty)
ViewState("RetIVAFletes") = ObjCliente.RetieneIVAFletes ViewState("RetIVAFletes") = ObjCliente.RetieneIVAFletes
If ObjCliente.RetieneIVAFletes Then If ObjCliente.RetieneIVAFletes Then
TrRetIVA.Style.Add("display", "") TrRetIVA.Style.Add("display", "")
@@ -4739,8 +4745,6 @@ Partial Class Ventas
End If End If
ViewState("CargoUsado") = ObjCliente.CargoUsados ViewState("CargoUsado") = ObjCliente.CargoUsados
'DdlTipoRetencion.SelectedValueExist(ObjCliente.DtResultados(0)("CveTipoRetencion").ToString)
Dim dr As DataRow = Nothing Dim dr As DataRow = Nothing
dr = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("TipoSucursal = 1 And Estatus = 'Activo' AND CveEmpresa = " & UsuarioActual.CveEmpresa) dr = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("TipoSucursal = 1 And Estatus = 'Activo' AND CveEmpresa = " & UsuarioActual.CveEmpresa)
If dr IsNot Nothing Then If dr IsNot Nothing Then
@@ -5013,6 +5017,8 @@ Partial Class Ventas
TrVistaPrevia.Visible = True TrVistaPrevia.Visible = True
TxtFechaPago.Text = If(DdlTipoComprobante.SelectedValue = "Rem", Now.AddDays(PlazoCobranzaRemision), Now.AddDays(PlazoCobranza)).ToShortDateString
If Not (ModalidadEdicion AndAlso DdlTipoComprobante.SelectedValue = "Rem") Then If Not (ModalidadEdicion AndAlso DdlTipoComprobante.SelectedValue = "Rem") Then
CargaRestriccionesCreditoCliente(True, Me.CveVenta) CargaRestriccionesCreditoCliente(True, Me.CveVenta)
End If End If
@@ -5924,6 +5930,20 @@ Partial Class Ventas
Dim TotalCalculableImpuestosIVA As Decimal = 0 Dim TotalCalculableImpuestosIVA As Decimal = 0
TotalCalculableImpuestosIVA = TotalCalculableImpuestos * (1 + TmpDT.Rows(e.RowIndex)("PorcentajeIEPS").ToString.ToDecimal) TotalCalculableImpuestosIVA = TotalCalculableImpuestos * (1 + TmpDT.Rows(e.RowIndex)("PorcentajeIEPS").ToString.ToDecimal)
Dim ClienteRetIVA = Me.ClienteRetIVA
If UsuarioActual.Empresa.Funcionalidad(579) = "1" Then
If DdlTipoRetencion.SelectedValue.Contiene("1", "2") Then
ClienteRetIVA = 0.1D
ElseIf DdlTipoRetencion.SelectedValue.Contiene("3") Then
ClienteRetIVA = 0.04D
ElseIf DdlTipoRetencion.SelectedValue.Contiene("4") Then
ClienteRetIVA = 0.06D
End If
LblRetIVA.Text = (ClienteRetIVA * 100).FormatoNumero
DdlTipoRetencion.Visible = True
End If
TmpDT.Rows(e.RowIndex)("CveUM") = GvPS.Rows(e.RowIndex).FCDropDownList("DdlUnidadMedida").SelectedValue.ToEntero TmpDT.Rows(e.RowIndex)("CveUM") = GvPS.Rows(e.RowIndex).FCDropDownList("DdlUnidadMedida").SelectedValue.ToEntero
TmpDT.Rows(e.RowIndex)("UM") = GvPS.Rows(e.RowIndex).FCDropDownList("DdlUnidadMedida").SelectedItem.Text TmpDT.Rows(e.RowIndex)("UM") = GvPS.Rows(e.RowIndex).FCDropDownList("DdlUnidadMedida").SelectedItem.Text
@@ -7595,10 +7615,10 @@ Partial Class Ventas
End Function End Function
Private Sub CreaObjetosVenta(Optional VistaPrevia As Boolean = False) Private Sub CreaObjetosVenta(Optional VistaPrevia As Boolean = False, Optional EsCancelacion As Boolean = False)
If Me.CveVenta > 0 AndAlso NuevaFactura <> 1 Then If Me.CveVenta > 0 AndAlso NuevaFactura <> 1 Then
ObjFactura = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa) ObjFactura = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=EsCancelacion)
Else Else
ObjFactura = New Modelos.Factura ObjFactura = New Modelos.Factura
End If End If
@@ -14229,6 +14249,20 @@ Partial Class Ventas
Row("PorcentajeIVA") = DrPS("IVA") Row("PorcentajeIVA") = DrPS("IVA")
End If End If
Dim ClienteRetIVA = Me.ClienteRetIVA
If UsuarioActual.Empresa.Funcionalidad(579) = "1" Then
If DdlTipoRetencion.SelectedValue.Contiene("1", "2") Then
ClienteRetIVA = 0.1D
ElseIf DdlTipoRetencion.SelectedValue.Contiene("3") Then
ClienteRetIVA = 0.04D
ElseIf DdlTipoRetencion.SelectedValue.Contiene("4") AndAlso DrPS("CveTipoPS").ToString().ToEntero() = 1 Then
ClienteRetIVA = 0.06D
End If
LblRetIVA.Text = (ClienteRetIVA * 100).FormatoNumero
DdlTipoRetencion.Visible = True
End If
Row("IVA") = Row("PorcentajeIVA") Row("IVA") = Row("PorcentajeIVA")
Row("ImporteIVA") = Math.Round(Row("PorcentajeIVA").ToString.ToDecimal * TotalCalculableImpuestosIVA, NumeroDecimales) Row("ImporteIVA") = Math.Round(Row("PorcentajeIVA").ToString.ToDecimal * TotalCalculableImpuestosIVA, NumeroDecimales)
Row("ImporteRetIVA") = Math.Round(ClienteRetIVA * TotalCalculableImpuestos, NumeroDecimales) Row("ImporteRetIVA") = Math.Round(ClienteRetIVA * TotalCalculableImpuestos, NumeroDecimales)
@@ -16332,181 +16366,186 @@ Partial Class Ventas
Private Sub BtnEditarRemision_Click(sender As Object, e As EventArgs) Handles BtnEditarRemision.Click Private Sub BtnEditarRemision_Click(sender As Object, e As EventArgs) Handles BtnEditarRemision.Click
Dim OcurrioError As Boolean = False Dim OcurrioError As Boolean = False
Dim ObjVentas As New ClsVentas Dim ObjVentas As New ClsVentas
ObjVentas.IniciaTransacSQL()
Dim ObjConta As New ClsContabilidad(ObjVentas.IniciaTransacSQL()) Dim ObjConta As New ClsContabilidad(ObjVentas.IniciaTransacSQL())
Dim ObjBancos As New ClsBancos(ObjVentas.IniciaTransacSQL()) Dim ObjBancos As New ClsBancos(ObjVentas.IniciaTransacSQL())
Dim ObjCGame As New ClsCGame(ObjVentas.IniciaTransacSQL()) Dim ObjCGame As New ClsCGame(ObjVentas.IniciaTransacSQL())
Dim ObjAC As ClsContPAQi = Nothing Dim ObjAC As ClsContPAQi = Nothing
Dim Moneda As Integer = DdlMoneda.SelectedValue.ToEntero Dim Moneda As Integer = DdlMoneda.SelectedValue.ToEntero
Dim TipoCambio As Double = TxtTipoCambio.Text.ToDouble Dim TipoCambio As Double = TxtTipoCambio.Text.ToDouble
EditoRemision = True EditoRemision = True
'Dim SubTotal, Descuento, IVA, RetIVA, RetISR, IEPS, Total As Decimal Try
ObjVentas.IniciaTransacSQL() 'CONVERTIR REMISION - TIPO MONEDA -DOLARES A PESOS
If DdlMoneda.SelectedValue.ToEntero <> 2 AndAlso ChkConvertirDolares.Checked Then
For Each Row As DataRow In TmpDT.Rows
Row("PU") = Math.Round(Row("PU").ToString.ToDecimal / TxtTipoCambioDlls.Text.Trim.ToDecimal, 6)
Row("Total") = Math.Round(Row("Cantidad").ToString.ToDecimal * Row("PU").ToString.ToDecimal, NumeroDecimales)
Row("TotalImporte") = Math.Round(Row("Cantidad").ToString.ToDecimal * Row("PU").ToString.ToDecimal, NumeroDecimales)
Row("Descuento") = Math.Round(Row("Descuento").ToString.ToDecimal / TxtTipoCambioDlls.Text.Trim.ToDecimal, NumeroDecimales)
Row("ImporteIEPS") = Math.Round(Row("ImporteIEPS").ToString.ToDecimal / TxtTipoCambioDlls.Text.Trim.ToDecimal, NumeroDecimales)
Row("ImporteIVA") = Math.Round(Row("ImporteIVA").ToString.ToDecimal / TxtTipoCambioDlls.Text.Trim.ToDecimal, NumeroDecimales)
Row("ImporteRetIVA") = Math.Round(Row("ImporteRetIVA").ToString.ToDecimal / TxtTipoCambioDlls.Text.Trim.ToDecimal, NumeroDecimales)
Row("ImporteRetISR") = Math.Round(Row("ImporteRetISR").ToString.ToDecimal / TxtTipoCambioDlls.Text.Trim.ToDecimal, NumeroDecimales)
Next
'CONVERTIR REMISION - TIPO MONEDA -DOLARES A PESOS Dim ImpuestosLocales As Double = 0
If DdlMoneda.SelectedValue.ToEntero <> 2 AndAlso ChkConvertirDolares.Checked Then For Each gvr As GridViewRow In GvImpuestosLocales2.Rows
If gvr.RowType = DataControlRowType.DataRow Then
For Each Row As DataRow In TmpDT.Rows gvr.FCTextBox("TxtImpuestoLocalPS").Text = (gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDouble / TxtTipoCambioDlls.Text.Trim.ToDecimal).FormatoNumero
Row("PU") = Math.Round(Row("PU").ToString.ToDecimal / TxtTipoCambioDlls.Text.Trim.ToDecimal, 6) ImpuestosLocales += Math.Round(gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDouble / TxtTipoCambioDlls.Text.Trim.ToDecimal, NumeroDecimales)
Row("Total") = Math.Round(Row("Cantidad").ToString.ToDecimal * Row("PU").ToString.ToDecimal, NumeroDecimales)
Row("TotalImporte") = Math.Round(Row("Cantidad").ToString.ToDecimal * Row("PU").ToString.ToDecimal, NumeroDecimales)
Row("Descuento") = Math.Round(Row("Descuento").ToString.ToDecimal / TxtTipoCambioDlls.Text.Trim.ToDecimal, NumeroDecimales)
Row("ImporteIEPS") = Math.Round(Row("ImporteIEPS").ToString.ToDecimal / TxtTipoCambioDlls.Text.Trim.ToDecimal, NumeroDecimales)
Row("ImporteIVA") = Math.Round(Row("ImporteIVA").ToString.ToDecimal / TxtTipoCambioDlls.Text.Trim.ToDecimal, NumeroDecimales)
Row("ImporteRetIVA") = Math.Round(Row("ImporteRetIVA").ToString.ToDecimal / TxtTipoCambioDlls.Text.Trim.ToDecimal, NumeroDecimales)
Row("ImporteRetISR") = Math.Round(Row("ImporteRetISR").ToString.ToDecimal / TxtTipoCambioDlls.Text.Trim.ToDecimal, NumeroDecimales)
Next
Dim ImpuestosLocales As Double = 0
For Each gvr As GridViewRow In GvImpuestosLocales2.Rows
If gvr.RowType = DataControlRowType.DataRow Then
gvr.FCTextBox("TxtImpuestoLocalPS").Text = (gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDouble / TxtTipoCambioDlls.Text.Trim.ToDecimal).FormatoNumero
ImpuestosLocales += Math.Round(gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDouble / TxtTipoCambioDlls.Text.Trim.ToDecimal, NumeroDecimales)
End If
Next
TxtSubTotal.Text = TmpDT.SUM("Total").ToDecimal.FormatoNumero
LblDescuentos.Text = TmpDT.SUM("Descuento").ToDecimal.FormatoNumero
LblAmortizacion.Text = Math.Round(LblAmortizacion.Text.Trim.ToDecimal / TxtTipoCambioDlls.Text.Trim.ToDecimal, NumeroDecimales).FormatoNumero
TxtIVA.Text = TmpDT.SUM("ImporteIVA").ToDecimal.FormatoNumero
TxtRetIVA.Text = TmpDT.SUM("ImporteRetIVA").ToDecimal.FormatoNumero
TxtRetISR.Text = TmpDT.SUM("ImporteRetISR").ToDecimal.FormatoNumero
TxtIEPS.Text = TmpDT.SUM("ImporteIEPS").ToDecimal.FormatoNumero
TxtTotal.Text = (TxtSubTotal.Text.ToDecimal - LblDescuentos.Text.ToDecimal - LblAmortizacion.Text.ToDecimal + TxtIVA.Text.ToDecimal + TxtIEPS.Text.ToDecimal - TxtRetIVA.Text.ToDecimal - TxtRetISR.Text.ToDecimal - ImpuestosLocales).ToDecimal.FormatoNumero
TipoCambio = TxtTipoCambioDlls.Text.Trim.ToDecimal
Moneda = 2
End If
'CONVERTIR REMISION - TIPO MONEDA -PESO A DOLARES
If DdlMoneda.SelectedValue.ToEntero <> 1 AndAlso ChkConvertirDoctoPesos.Checked Then
Dim Importe As Decimal
Dim TCC As Decimal = TxtTipoCambio.Text.Trim.ToDecimal
For Each Row As DataRow In TmpDT.Rows
Row("PU") = Math.Round(Row("PU").ToString.ToDecimal * TCC, 6)
Row("Total") = Math.Round(Row("Cantidad").ToString.ToDecimal * Row("PU").ToString.ToDecimal, NumeroDecimales)
Row("TotalImporte") = Math.Round(Row("Cantidad").ToString.ToDecimal * Row("PU").ToString.ToDecimal, NumeroDecimales)
Row("Descuento") = Math.Round(Row("Descuento").ToString.ToDecimal * TCC, NumeroDecimales)
Importe = Row("Total").ToString.ToDecimal - Row("Descuento").ToString.ToDecimal
Row("ImporteIEPS") = Math.Round(Importe * Row("PorcentajeIEPS").ToString.ToDecimal, NumeroDecimales)
Row("ImporteIVA") = Math.Round(Importe * Row("PorcentajeIVA").ToString.ToDecimal, NumeroDecimales)
Row("ImporteRetIVA") = Math.Round(Importe * Row("PorcentajeRetIVA").ToString.ToDecimal, NumeroDecimales)
Row("ImporteRetISR") = Math.Round(Importe * Row("PorcentajeRetISR").ToString.ToDecimal, NumeroDecimales)
Next
Dim ImpuestosLocales As Double = 0
For Each gvr As GridViewRow In GvImpuestosLocales2.Rows
If gvr.RowType = DataControlRowType.DataRow Then
gvr.FCTextBox("TxtImpuestoLocalPS").Text = (gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDouble * TxtTipoCambio.Text.Trim.ToDecimal).FormatoNumero
ImpuestosLocales += Math.Round(gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDouble * TxtTipoCambio.Text.Trim.ToDecimal, NumeroDecimales)
End If
Next
TxtSubTotal.Text = TmpDT.SUM("Total").ToDecimal.FormatoNumero
LblDescuentos.Text = TmpDT.SUM("Descuento").ToDecimal.FormatoNumero
LblAmortizacion.Text = Math.Round(LblAmortizacion.Text.Trim.ToDecimal * TxtTipoCambio.Text.Trim.ToDecimal, NumeroDecimales).FormatoNumero
TxtIVA.Text = TmpDT.SUM("ImporteIVA").ToDecimal.FormatoNumero
TxtRetIVA.Text = TmpDT.SUM("ImporteRetIVA").ToDecimal.FormatoNumero
TxtRetISR.Text = TmpDT.SUM("ImporteRetISR").ToDecimal.FormatoNumero
TxtIEPS.Text = TmpDT.SUM("ImporteIEPS").ToDecimal.FormatoNumero
TxtTotal.Text = (TxtSubTotal.Text.ToDecimal - LblDescuentos.Text.ToDecimal - LblAmortizacion.Text.ToDecimal + TxtIVA.Text.ToDecimal + TxtIEPS.Text.ToDecimal - TxtRetIVA.Text.ToDecimal - TxtRetISR.Text.ToDecimal - ImpuestosLocales).ToDecimal.FormatoNumero
TipoCambio = 1
Moneda = 1
End If
'Actualizo los parametros de la venta
If Not ObjVentas.UpdateVentas(TxtSubTotal.Text.ToDecimal, LblDescuentos.Text.ToDecimal, TxtIVA.Text.ToDecimal, TxtIEPS.Text.ToDecimal, TxtTotal.Text.ToDecimal, Moneda, TipoCambio, TxtFecha.Text.Trim.ToDate, TxtObsFact.Text.Trim,
UsuarioActual.CveEmpresa, CveVenta, 0, 0,
Vigencia:=TxtFechaVencimientoCotizacion.Text.Trim.ToDate, CondicionesPago:=If(RBLPago.SelectedValue = "2", 0, 1),
PedidoContrato:=TxtPedidoContrato.Text, AtencionA:=TxtAtencionA.Text.Trim, CveMetodoPago33:=DdlMetodoPago33.SelectedValue.ToEntero,
CveFormaPago33:=DdlFormaPago33.SelectedValue.ToEntero, TipoDocto:="Rem", CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal,
OrdenCompra:=TxtOrdenCompra.Text, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, Kilometraje:=TxtKilometraje.Text.ToDouble) Then
OcurrioError = True
End If
'Cargo de nueva cuenta el detalle de Ventas (Conceptos)
If Not OcurrioError Then
Dim index As Integer = 0
For Each Row As DataRow In TmpDT.Rows
Dim CveVentaDetalle As Integer = Row("CveVentaDetalle").ToString.ToEntero()
If CveVentaDetalle > 0 Then
If Not ObjVentas.UpdateVentaDetalleRemision(Row("CveVentaDetalle").ToString.ToEntero, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDecimal, Row("PU").ToString.ToDecimal(), Row("ImporteIEPS").ToString.ToDecimal(), Row("Obs").ToString, UsuarioActual.CveUsuario) Then
OcurrioError = True
Exit For
End If End If
Else Next
If Not ObjVentas.AddVentaDetalle(CveVenta, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("CveUM").ToString.ToEntero,
Row("PU").ToString.ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), Row("ImporteIVA").ToString.ToDouble, Math.Round((Row("Total").ToString.ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)) * (1 + Row("PorcentajeIVA").ToString.ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)))), 6), TxtSubTotal.Text = TmpDT.SUM("Total").ToDecimal.FormatoNumero
Row("Obs").ToString, Row("Descuento").ToString.ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), Row("TipoDescuento").ToString.ToEntero, Row("CveSubProyecto").ToString.ToEntero, Row("CvePresupuestoIngreso").ToString.ToEntero, PorcentajeIVA:=Row("PorcentajeIVA").ToString.ToDecimal, IEPS:=Row("ImporteIEPS").ToString.ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), PorcentajeIEPS:=Row("PorcentajeIEPS").ToString.ToDouble, TiempoEntrega:=Row("TiempoEntrega").ToString, LblDescuentos.Text = TmpDT.SUM("Descuento").ToDecimal.FormatoNumero
CveVentaDetallePadre:=Row("CveVentaDetalle").ToString.ToEntero, CveContratoDetalle:=Row("CveContratoDetalle").ToString.ToEntero, CvePromocionDetalle:=If(DtPromociones IsNot Nothing, DtPromociones.FiltroPrimeroValor("CvePromocionDetalle", $"CvePS={Row("CvePS").ToString}").ToEntero, -1), LblAmortizacion.Text = Math.Round(LblAmortizacion.Text.Trim.ToDecimal / TxtTipoCambioDlls.Text.Trim.ToDecimal, NumeroDecimales).FormatoNumero
ImporteRetIVA:=Row("ImporteRetIVA").ToString.ToDouble, ImporteRetISR:=Row("ImporteRetISR").ToString.ToDouble, PorcentajeRetIVA:=Row("PorcentajeRetIVA").ToString.ToDouble, PorcentajeRetISR:=Row("PorcentajeRetISR").ToString.ToDouble, CuentaPredial:=Row("CuentaPredial").ToString) Then TxtIVA.Text = TmpDT.SUM("ImporteIVA").ToDecimal.FormatoNumero
OcurrioError = True TxtRetIVA.Text = TmpDT.SUM("ImporteRetIVA").ToDecimal.FormatoNumero
Exit For TxtRetISR.Text = TmpDT.SUM("ImporteRetISR").ToDecimal.FormatoNumero
TxtIEPS.Text = TmpDT.SUM("ImporteIEPS").ToDecimal.FormatoNumero
TxtTotal.Text = (TxtSubTotal.Text.ToDecimal - LblDescuentos.Text.ToDecimal - LblAmortizacion.Text.ToDecimal + TxtIVA.Text.ToDecimal + TxtIEPS.Text.ToDecimal - TxtRetIVA.Text.ToDecimal - TxtRetISR.Text.ToDecimal - ImpuestosLocales).ToDecimal.FormatoNumero
TipoCambio = TxtTipoCambioDlls.Text.Trim.ToDecimal
Moneda = 2
End If
'CONVERTIR REMISION - TIPO MONEDA -PESO A DOLARES
If DdlMoneda.SelectedValue.ToEntero <> 1 AndAlso ChkConvertirDoctoPesos.Checked Then
Dim Importe As Decimal
Dim TCC As Decimal = TxtTipoCambio.Text.Trim.ToDecimal
For Each Row As DataRow In TmpDT.Rows
Row("PU") = Math.Round(Row("PU").ToString.ToDecimal * TCC, 6)
Row("Total") = Math.Round(Row("Cantidad").ToString.ToDecimal * Row("PU").ToString.ToDecimal, NumeroDecimales)
Row("TotalImporte") = Math.Round(Row("Cantidad").ToString.ToDecimal * Row("PU").ToString.ToDecimal, NumeroDecimales)
Row("Descuento") = Math.Round(Row("Descuento").ToString.ToDecimal * TCC, NumeroDecimales)
Importe = Row("Total").ToString.ToDecimal - Row("Descuento").ToString.ToDecimal
Row("ImporteIEPS") = Math.Round(Importe * Row("PorcentajeIEPS").ToString.ToDecimal, NumeroDecimales)
Row("ImporteIVA") = Math.Round(Importe * Row("PorcentajeIVA").ToString.ToDecimal, NumeroDecimales)
Row("ImporteRetIVA") = Math.Round(Importe * Row("PorcentajeRetIVA").ToString.ToDecimal, NumeroDecimales)
Row("ImporteRetISR") = Math.Round(Importe * Row("PorcentajeRetISR").ToString.ToDecimal, NumeroDecimales)
Next
Dim ImpuestosLocales As Double = 0
For Each gvr As GridViewRow In GvImpuestosLocales2.Rows
If gvr.RowType = DataControlRowType.DataRow Then
gvr.FCTextBox("TxtImpuestoLocalPS").Text = (gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDouble * TxtTipoCambio.Text.Trim.ToDecimal).FormatoNumero
ImpuestosLocales += Math.Round(gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDouble * TxtTipoCambio.Text.Trim.ToDecimal, NumeroDecimales)
End If
Next
TxtSubTotal.Text = TmpDT.SUM("Total").ToDecimal.FormatoNumero
LblDescuentos.Text = TmpDT.SUM("Descuento").ToDecimal.FormatoNumero
LblAmortizacion.Text = Math.Round(LblAmortizacion.Text.Trim.ToDecimal * TxtTipoCambio.Text.Trim.ToDecimal, NumeroDecimales).FormatoNumero
TxtIVA.Text = TmpDT.SUM("ImporteIVA").ToDecimal.FormatoNumero
TxtRetIVA.Text = TmpDT.SUM("ImporteRetIVA").ToDecimal.FormatoNumero
TxtRetISR.Text = TmpDT.SUM("ImporteRetISR").ToDecimal.FormatoNumero
TxtIEPS.Text = TmpDT.SUM("ImporteIEPS").ToDecimal.FormatoNumero
TxtTotal.Text = (TxtSubTotal.Text.ToDecimal - LblDescuentos.Text.ToDecimal - LblAmortizacion.Text.ToDecimal + TxtIVA.Text.ToDecimal + TxtIEPS.Text.ToDecimal - TxtRetIVA.Text.ToDecimal - TxtRetISR.Text.ToDecimal - ImpuestosLocales).ToDecimal.FormatoNumero
TipoCambio = 1
Moneda = 1
End If
'Actualizo los parametros de la venta
If Not ObjVentas.UpdateVentas(TxtSubTotal.Text.ToDecimal, LblDescuentos.Text.ToDecimal, TxtIVA.Text.ToDecimal, TxtIEPS.Text.ToDecimal, TxtTotal.Text.ToDecimal, Moneda, TipoCambio, TxtFecha.Text.Trim.ToDate, TxtObsFact.Text.Trim,
UsuarioActual.CveEmpresa, CveVenta, 0, 0,
Vigencia:=TxtFechaVencimientoCotizacion.Text.Trim.ToDate, CondicionesPago:=If(RBLPago.SelectedValue = "2", 0, 1),
PedidoContrato:=TxtPedidoContrato.Text, AtencionA:=TxtAtencionA.Text.Trim, CveMetodoPago33:=DdlMetodoPago33.SelectedValue.ToEntero,
CveFormaPago33:=DdlFormaPago33.SelectedValue.ToEntero, TipoDocto:="Rem", CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal,
OrdenCompra:=TxtOrdenCompra.Text, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, Kilometraje:=TxtKilometraje.Text.ToDouble) Then
OcurrioError = True
End If
'Cargo de nueva cuenta el detalle de Ventas (Conceptos)
If Not OcurrioError Then
Dim index As Integer = 0
For Each Row As DataRow In TmpDT.Rows
Dim CveVentaDetalle As Integer = Row("CveVentaDetalle").ToString.ToEntero()
If CveVentaDetalle > 0 Then
If Not ObjVentas.UpdateVentaDetalleRemision(Row("CveVentaDetalle").ToString.ToEntero, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDecimal, Row("PU").ToString.ToDecimal(), Row("ImporteIEPS").ToString.ToDecimal(), Row("Obs").ToString, UsuarioActual.CveUsuario) Then
OcurrioError = True
Exit For
End If
Else Else
TmpDT.Rows(index)("CveVentaDetalle") = ObjVentas.CveVentaDetalle If Not ObjVentas.AddVentaDetalle(CveVenta, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("CveUM").ToString.ToEntero,
Row("PU").ToString.ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), Row("ImporteIVA").ToString.ToDouble, Math.Round((Row("Total").ToString.ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)) * (1 + Row("PorcentajeIVA").ToString.ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)))), 6),
Row("Obs").ToString, Row("Descuento").ToString.ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), Row("TipoDescuento").ToString.ToEntero, Row("CveSubProyecto").ToString.ToEntero, Row("CvePresupuestoIngreso").ToString.ToEntero, PorcentajeIVA:=Row("PorcentajeIVA").ToString.ToDecimal, IEPS:=Row("ImporteIEPS").ToString.ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), PorcentajeIEPS:=Row("PorcentajeIEPS").ToString.ToDouble, TiempoEntrega:=Row("TiempoEntrega").ToString,
CveVentaDetallePadre:=Row("CveVentaDetalle").ToString.ToEntero, CveContratoDetalle:=Row("CveContratoDetalle").ToString.ToEntero, CvePromocionDetalle:=If(DtPromociones IsNot Nothing, DtPromociones.FiltroPrimeroValor("CvePromocionDetalle", $"CvePS={Row("CvePS").ToString}").ToEntero, -1),
ImporteRetIVA:=Row("ImporteRetIVA").ToString.ToDouble, ImporteRetISR:=Row("ImporteRetISR").ToString.ToDouble, PorcentajeRetIVA:=Row("PorcentajeRetIVA").ToString.ToDouble, PorcentajeRetISR:=Row("PorcentajeRetISR").ToString.ToDouble, CuentaPredial:=Row("CuentaPredial").ToString) Then
OcurrioError = True
Exit For
Else
TmpDT.Rows(index)("CveVentaDetalle") = ObjVentas.CveVentaDetalle
End If
End If End If
End If index = index + 1
index = index + 1 Next
Next End If
End If
'ELIMINA LOS DETALLES 'ELIMINA LOS DETALLES
If Not OcurrioError Then If Not OcurrioError Then
Dim DtEliminados As New DataTable Dim DtEliminados As New DataTable
If ObjVentas.GetVentaDetalle(CveVenta) Then If ObjVentas.GetVentaDetalle(CveVenta) Then
DtEliminados = ObjVentas.DtResultados.FiltraParametros("", "", {"CveVentaDetalle"}) DtEliminados = ObjVentas.DtResultados.FiltraParametros("", "", {"CveVentaDetalle"})
For Each Dr1 As DataRow In DtEliminados.Rows For Each Dr1 As DataRow In DtEliminados.Rows
If TmpDT.FiltraParametros($"CveVentaDetalle = {Dr1("CveVentaDetalle")}").Rows.Count = 0 Then If TmpDT.FiltraParametros($"CveVentaDetalle = {Dr1("CveVentaDetalle")}").Rows.Count = 0 Then
If Not ObjVentas.RemoveVentasDetalle(CveVenta, Dr1("CveVentaDetalle").ToString.ToEntero) Then If Not ObjVentas.RemoveVentasDetalle(CveVenta, Dr1("CveVentaDetalle").ToString.ToEntero) Then
OcurrioError = True
End If
End If
Next
Else
OcurrioError = True
End If
End If
'OcurrioError = ProcesoPrepolizas(ObjConta, ObjFactura, -1, TmpDT, ObjAC, 1, ObjBancos, ObjVentas)
'Actualizo impuestos locales
If Not OcurrioError Then
For Each gvr As GridViewRow In GvImpuestosLocales2.Rows
If gvr.RowType = DataControlRowType.DataRow Then
If Not ObjVentas.UpdateVentaImpuestoLocales(CveVenta, gvr.DataKey("CveImpuestoLocal").ToString.ToEntero, gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDecimal) Then
OcurrioError = True OcurrioError = True
End If End If
End If End If
Next Next
Else
OcurrioError = True
End If End If
End If
'OcurrioError = ProcesoPrepolizas(ObjConta, ObjFactura, -1, TmpDT, ObjAC, 1, ObjBancos, ObjVentas) 'Orden Produccion'
If Not OcurrioError Then
'Actualizo impuestos locales If UsuarioActual.CveEmpresa.Contiene(126) Then
If Not OcurrioError Then If CveVenta > 0 And DdlOrdenProduccion.SelectedValue.ToEntero > 0 Then
For Each gvr As GridViewRow In GvImpuestosLocales2.Rows If Not ObjCGame.UpdateOrdenProduccionVenta(DdlOrdenProduccion.SelectedValue.ToEntero(), CveVenta) Then
If gvr.RowType = DataControlRowType.DataRow Then OcurrioError = True
If Not ObjVentas.UpdateVentaImpuestoLocales(CveVenta, gvr.DataKey("CveImpuestoLocal").ToString.ToEntero, gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDecimal) Then End If
OcurrioError = True
End If
End If
Next
End If
'Orden Produccion'
If Not OcurrioError Then
If UsuarioActual.CveEmpresa.Contiene(126) Then
If CveVenta > 0 And DdlOrdenProduccion.SelectedValue.ToEntero > 0 Then
If Not ObjCGame.UpdateOrdenProduccionVenta(DdlOrdenProduccion.SelectedValue.ToEntero(), CveVenta) Then
OcurrioError = True
End If End If
End If End If
End If End If
End If
If ObjConta.ValidacionPrePolizaCuadre(-1, 2, CveVenta) Then If ObjConta.ValidacionPrePolizaCuadre(-1, 2, CveVenta) Then
If ObjConta.ValorPolizaDescuadre > 0 Then If ObjConta.ValorPolizaDescuadre > 0 Then
If ObjConta.ValorPolizaDescuadre = 2 Then If ObjConta.ValorPolizaDescuadre = 2 Then
OcurrioError = True
Alert(ObjConta.MensajePolizaDescuadre, TipoMensaje.MsgError)
End If
End If
End If
If Not OcurrioError Then
If RegeneracionPolizas(ObjVentas, ObjAC, ObjConta, ObjBancos) Then
OcurrioError = True OcurrioError = True
Alert(ObjConta.MensajePolizaDescuadre, TipoMensaje.MsgError)
End If End If
End If End If
End If
If Not OcurrioError Then Catch ex As Exception
If RegeneracionPolizas(ObjVentas, ObjAC) Then OcurrioError = True
OcurrioError = True OnError("Ocurrió un error al actualizar la remisión", ex)
End If End Try
End If
If OcurrioError Then If OcurrioError Then
ObjVentas.RollBack() ObjVentas.RollBack()
@@ -17312,19 +17351,22 @@ Partial Class Ventas
End Sub End Sub
Private Sub BtnAgregarCliente_Click(sender As Object, e As EventArgs) Handles BtnAgregarCliente.Click Private Sub BtnAgregarCliente_Click(sender As Object, e As EventArgs) Handles BtnAgregarCliente.Click
Dim CvePreioLista As Integer = -1 Dim CvePrecioLista As Integer = -1
If DdlSubProyectoDatos.SelectedValue.ToEntero > 0 Then If DdlSubProyectoDatos.SelectedValue.ToEntero > 0 Then
Dim Dr As DataRow = GlobalDTSubProyectos(-1, DdlSubProyectoDatos.SelectedValue.ToEntero, UsuarioActual.CveEmpresa).Rows(0) Dim Dr As DataRow = GlobalDTSubProyectos(-1, DdlSubProyectoDatos.SelectedValue.ToEntero, UsuarioActual.CveEmpresa).Rows(0)
If Dr IsNot Nothing Then If Dr IsNot Nothing Then
If Dr("CvePrecioLista").ToString.ToEntero > 0 Then If Dr("CvePrecioLista").ToString.ToEntero > 0 Then
CvePreioLista = Dr("CvePrecioLista").ToString.ToEntero CvePrecioLista = Dr("CvePrecioLista").ToString.ToEntero
End If End If
End If End If
End If End If
Dim ObjCliente As New ClsClientes Dim ObjCliente As New ClsClientes
If ObjCliente.AgregarClienteNoFrecuente(TxtNombreCliente.Text.Trim, TxtDireccionCliente.Text.Trim, TxtNumExtCliente.Text.Trim, TxtNumIntCliente.Text.Trim, TxtColoniaCliente.Text.Trim, TxtLocalidadCliente.Text.Trim, TxtCiudadCliente.Text.Trim, TxtEstadoCliente.Text.Trim, TxtPaisCliente.Text.Trim, TxtRFCCliente.Text.Trim, TxtCPCliente.Text.Trim, TxtTelefonoCliente.Text.Trim, TxtCorreoCliente.Text.Trim, DdlSubProyectoDatos.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, "", CvePreioLista) Then If ObjCliente.AgregarClienteNoFrecuente(TxtNombreCliente.Text.Trim, TxtDireccionCliente.Text.Trim, TxtNumExtCliente.Text.Trim, TxtNumIntCliente.Text.Trim,
TxtColoniaCliente.Text.Trim, TxtLocalidadCliente.Text.Trim, TxtCiudadCliente.Text.Trim, TxtEstadoCliente.Text.Trim,
TxtPaisCliente.Text.Trim, TxtRFCCliente.Text.Trim, TxtCPCliente.Text.Trim, TxtTelefonoCliente.Text.Trim, TxtCorreoCliente.Text.Trim,
DdlSubProyectoDatos.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, "", -1, -1, CvePrecioLista:=CvePrecioLista) Then
If ObjCliente.DtResultados.Rows.Count > 0 Then If ObjCliente.DtResultados.Rows.Count > 0 Then
RegistraScript("hideDivEC();") RegistraScript("hideDivEC();")
ViewState("CveCliente") = ObjCliente.DtResultados(0)("CveCliente").ToString.ToEntero ViewState("CveCliente") = ObjCliente.DtResultados(0)("CveCliente").ToString.ToEntero
@@ -17416,34 +17458,26 @@ Partial Class Ventas
End Sub End Sub
Private Function RegeneracionPolizas(ByRef ObjVentas As ClsVentas, ByRef ObjAC As ClsContPAQi) As Boolean Private Function RegeneracionPolizas(ByRef ObjVentas As ClsVentas, ByRef ObjAC As ClsContPAQi, ByRef ObjConta As ClsContabilidad, ObjBancos As ClsBancos) As Boolean
Dim ObjConta As New ClsContabilidad(ObjVentas.IniciaTransacSQL())
Dim ObjBancos As New ClsBancos(ObjVentas.IniciaTransacSQL())
Dim CvePlantillaPoliza As Integer
Dim ErrorCancelar As Boolean = False Dim ErrorCancelar As Boolean = False
Dim Mensaje As String = "" Dim Mensaje As String = ""
CreaObjetosVenta() CreaObjetosVenta()
If UsuarioActual.Empresa.UsaAC Then If UsuarioActual.Empresa.UsaAC Then
ObjAC = New ClsContPAQi(UsuarioActual.Empresa) : ObjAC.IniciaTransacSQL() ObjAC = New ClsContPAQi(UsuarioActual.Empresa) : ObjAC.IniciaTransacSQL()
End If End If
If ObjFactura.TipoDocto.Contiene("Egs", "Dev") Then 'REMOVEMOS LOS CONCEPTOS DE LA PREPOLIZA
CvePlantillaPoliza = 7 ErrorCancelar = Not ObjConta.RemovePrePolizasDetalle(CvePrePoliza, -1, CveVenta, 2)
ElseIf ObjFactura.TipoDocto.Contiene("Ing", "Rem", "Ant") Then
CvePlantillaPoliza = 4
Else
CvePlantillaPoliza = 4
End If
'Removemos los conceptos de la prepoliza
ObjConta.RemovePrePolizasDetalle(CvePrePoliza, -1, CveVenta, 2)
ObjFactura.CveVenta = CveVenta ObjFactura.CveVenta = CveVenta
ObjFactura.CvePrePoliza = CvePrePoliza ObjFactura.CvePrePoliza = CvePrePoliza
ErrorCancelar = ProcesoPrepolizas(ObjConta, ObjFactura, -1, TmpDT, ObjAC, 1, ObjBancos, ObjVentas)
'VUELVE A GENERAR LAS PREPOLIZAS
If Not ErrorCancelar Then ErrorCancelar = ProcesoPrepolizas(ObjConta, ObjFactura, -1, TmpDT, ObjAC, 1, ObjBancos, ObjVentas)
If Not ErrorCancelar Then ErrorCancelar = GuardarVentaImpuestosLocales(ObjVentas, ObjConta, ObjFactura, 1) If Not ErrorCancelar Then ErrorCancelar = GuardarVentaImpuestosLocales(ObjVentas, ObjConta, ObjFactura, 1)
Return ErrorCancelar Return ErrorCancelar
@@ -18447,7 +18481,8 @@ Partial Class Ventas
CancelarRefacturada() CancelarRefacturada()
End If End If
CreaObjetosVenta() CreaObjetosVenta(EsCancelacion:=True)
Dim resp As Modelos.Factura.MCancelacionVentaMensaje = Nothing Dim resp As Modelos.Factura.MCancelacionVentaMensaje = Nothing
If ObjFactura IsNot Nothing AndAlso ObjFactura.CveVenta > 0 Then If ObjFactura IsNot Nothing AndAlso ObjFactura.CveVenta > 0 Then
@@ -18465,9 +18500,6 @@ Partial Class Ventas
End If End If
ObjFactura.CveAlmacenDevolucion = CveAlmacenDevolucion ObjFactura.CveAlmacenDevolucion = CveAlmacenDevolucion
If ChkDevAlm.Checked Then
ObjFactura.CveAlmacenDevolucion = CveAlmacenDevolucion
End If
resp = ObjFactura.CancelarFactura(ChkDevAlm.Checked, ListaRemisionesCancelar) resp = ObjFactura.CancelarFactura(ChkDevAlm.Checked, ListaRemisionesCancelar)
End If End If
@@ -23871,54 +23903,63 @@ Partial Class Ventas
CargaRNC() CargaRNC()
RegistraScript("$('#ModalAplicarRemisionesNC').modal({backdrop: 'static', keyboard: false });") RegistraScript("$('#ModalAplicarRemisionesNC').modal({backdrop: 'static', keyboard: false });")
End Sub End Sub
Protected Sub GeneraPolizaVentaWS(ObjFactura As Modelos.Factura)
Dim DtUsados As DataTable = Nothing #Region "P O L I Z A - V I R T U A L"
Dim ObjAcum As New ClsAcumuladores Private Sub CargaCodigoUnico()
If ObjAcum.GetGarantiasDetalle(ObjFactura.CveVenta) Then If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso DdlTipoComprobante.SelectedValue = "Rem" Then
DtUsados = ObjAcum.DtResultados.Copy() Dim ObjAcum As New ClsAcumuladores
If ObjAcum.GetGarantiasPolizaVirtual(Me.CveVenta, UsuarioActual.CveEmpresa) AndAlso ObjAcum.DtResultados.Rows.Count > 0 Then
GvCodigosUnicos.DataSource = ObjAcum.DtResultados
DivCodigosUnicos.Visible = True
End If
ObjAcum.Dispose()
GvCodigosUnicos.DataBind()
End If End If
ObjAcum.Dispose() End Sub
Protected Sub GeneraPolizaVentaWS(ObjFactura As Modelos.Factura)
Try Try
For Each Row As DataRow In DtUsados.Rows For Each Row As GridViewRow In GvCodigosUnicos.Rows
Dim obj As New Modelos.MPolizaVentaWS If Row.RowType = DataControlRowType.DataRow Then
'DATOS DEL CLIENTE Dim obj As New Modelos.MPolizaVentaWS
obj.customer_name = ObjFactura.Cliente.Nombre 'DATOS DEL CLIENTE
obj.customer_last_name1 = "" obj.customer_name = ObjFactura.Cliente.Nombre
obj.customer_last_name2 = "" obj.customer_last_name1 = ""
obj.customer_birthday = Nothing obj.customer_last_name2 = ""
obj.customer_phone = ObjFactura.Cliente.Telefono obj.customer_birthday = Nothing
obj.customer_email = ObjFactura.Cliente.Mail obj.customer_phone = ObjFactura.Cliente.Telefono
obj.customer_gender = "03" 'OTRO GENERO obj.customer_email = ObjFactura.Cliente.Mail
obj.customer_advertising = False obj.customer_gender = "03" 'OTRO GENERO
obj.customer_car_brand = "00" obj.customer_advertising = False
obj.customer_car_model = "00" obj.customer_car_brand = "00"
obj.customer_car_year = ObjFactura.Fecha.Year obj.customer_car_model = "00"
obj.customer_car_year = ObjFactura.Fecha.Year
'DATOS DE VENTA 'DATOS DE VENTA
obj.sale_date = ObjFactura.Fecha obj.sale_date = ObjFactura.Fecha
obj.sale_paidby = "01" obj.sale_paidby = "01"
obj.sale_type = "01" 'PISO obj.sale_type = "01" 'PISO
obj.sale_type_service = "02" 'COMERCIAL obj.sale_type_service = "02" 'COMERCIAL
obj.sale_total = ObjFactura.Total obj.sale_total = ObjFactura.Total
obj.sale_discount = ObjFactura.Descuento obj.sale_discount = ObjFactura.Descuento
obj.sale_id = String.Format("{0}{1}{2}", ObjFactura.Serie, ObjFactura.Folio, ObjFactura.CveVenta) obj.sale_id = String.Format("{0}{1}{2}", ObjFactura.Serie, ObjFactura.Folio, ObjFactura.CveVenta)
'DATOS DEL PRODUCTO 'DATOS DEL PRODUCTO
obj.product_code = Row("IdProductoPolizaVirtual").ToString() obj.product_code = Row.DataKey("IdProductoPolizaVirtual").ToString()
obj.product_unique_code = Row("SerieLote").ToString() 'se indique el código único de la batería. (SERIE LOTE) obj.product_unique_code = Row.FCTextBox("TxtCodigoUnico").Text 'se indique el código único de la batería. (SERIE LOTE)
obj.product_sale_type = "01 " 'VENTA obj.product_sale_type = "01 " 'VENTA
Dim FechaUsado As DateTime = Row("FechaAjuste").ToString().ToDateTime() Dim FechaUsado As DateTime = Row.DataKey("FechaAjuste").ToString().ToDateTime()
'DATOS DE USADO 'DATOS DE USADO
obj.used_product = True obj.used_product = True
obj.used_brand = Row("IdModelo").ToString() 'MARCAR DEL USADO obj.used_brand = Row.DataKey("IdModelo").ToString() 'MARCAR DEL USADO
obj.used_bci = Row("CveBCIUsado").ToString() 'VALOR DEL BCI obj.used_bci = Row.DataKey("IdBCI").ToString() 'VALOR DEL BCI
obj.used_month = FechaUsado.Month obj.used_month = FechaUsado.Month
obj.used_year = FechaUsado.Year obj.used_year = FechaUsado.Year
obj.used_sale_date = FechaUsado obj.used_sale_date = FechaUsado
EnviarPolizaVentaWS(obj) EnviarPolizaVentaWS(obj)
End If
Next Next
Catch ex As Exception Catch ex As Exception
OnError("Ocurrió un error al generar la poliza virtual", ex) OnError("Ocurrió un error al generar la poliza virtual", ex)
@@ -23998,19 +24039,39 @@ Partial Class Ventas
Return Retorno Return Retorno
End Function End Function
'Protected Sub DdlTipoRetencion_SelectedIndexChanged(sender As Object, e As EventArgs) #End Region
' Dim PorcentajeRetencion As Decimal = 0
' Select Case DdlTipoRetencion.SelectedValue
' Case "1" 'Arrendamiento
' PorcentajeRetencion = 10
' Case "2" 'Servicios Profesionales
' PorcentajeRetencion = 10
' Case "3" 'Fletes
' PorcentajeRetencion = 4
' Case "4" 'Servicios
' PorcentajeRetencion = 6
' End Select
'End Sub Protected Sub DdlTipoRetencion_SelectedIndexChanged(sender As Object, e As EventArgs)
If UsuarioActual.Empresa.Funcionalidad(579) = "1" Then
If TmpDT IsNot Nothing AndAlso TmpDT.Rows.Count > 0 Then
For Each RowServicio As DataRow In TmpDT.Rows
Dim ClienteRetIVA = Me.ClienteRetIVA
If DdlTipoRetencion.SelectedValue.Contiene("1", "2") Then
ClienteRetIVA = 0.1D
ElseIf DdlTipoRetencion.SelectedValue.Contiene("3") Then
ClienteRetIVA = 0.04D
ElseIf DdlTipoRetencion.SelectedValue.Contiene("4") AndAlso RowServicio("CveTipoPS").ToString().ToEntero() = 1 Then
ClienteRetIVA = 0.06D
End If
Dim TotalCalculableImpuestos As Decimal = (RowServicio("Cantidad").ToString().ToDecimal() * RowServicio("PU").ToString().ToDecimal()) - RowServicio("Descuento").ToString().ToDecimal()
RowServicio("ImporteRetIVA") = (TotalCalculableImpuestos * ClienteRetIVA).RoundSQL()
RowServicio("PorcentajeRetIVA") = ClienteRetIVA
Next
TxtRetIVA.Text = TmpDT.SUM("ImporteRetIVA").ToDecimal().FormatoNumero(2)
Dim PorcentajeRetIVA = (TmpDT.MAX("PorcentajeRetIVA").ToDecimal() * 100)
LblRetIVA.Text = PorcentajeRetIVA.FormatoNumero(2)
If PorcentajeRetIVA > 0 Then
DdlTipoRetencion.Visible = True
End If
GvPS.DataSource = TmpDT
GvPS.DataBind()
UpPS.Update()
End If
End If
End Sub
End Class End Class