--GDiaz. pago con devolucion en cobranza
This commit is contained in:
@@ -843,51 +843,51 @@ Namespace Modelos
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
'SI ES REFACTURACION
|
'SI ES REFACTURACION
|
||||||
Dim ObjNC As List(Of Object) = Nothing
|
'Dim ObjNC As List(Of Object) = Nothing
|
||||||
If ErrorList.Count = 0 Then
|
'If ErrorList.Count = 0 Then
|
||||||
If NuevaFactura = 1 AndAlso FacturaDevolucion IsNot Nothing Then
|
' If NuevaFactura = 1 AndAlso FacturaDevolucion IsNot Nothing Then
|
||||||
|
|
||||||
ObjNC = GeneraNC(ObjVentas, ObjConta, ObjInventario, ObjContr, FacturaDevolucion, ObjBancos, ObjEventos)
|
' ObjNC = GeneraNC(ObjVentas, ObjConta, ObjInventario, ObjContr, FacturaDevolucion, ObjBancos, ObjEventos)
|
||||||
|
|
||||||
If ObjNC Is Nothing Then
|
' If ObjNC Is Nothing Then
|
||||||
ErrorList.Add("No se pudo Cancelar la Factura")
|
' ErrorList.Add("No se pudo Cancelar la Factura")
|
||||||
End If
|
' End If
|
||||||
|
|
||||||
'Esquema viejo, evitamos que aparezca por surtir
|
' 'Esquema viejo, evitamos que aparezca por surtir
|
||||||
If ErrorList.Count = 0 Then
|
' If ErrorList.Count = 0 Then
|
||||||
If Not ObjInventario.ActualizarEsDevolucionVenta(CveVenta, 2) Then
|
' If Not ObjInventario.ActualizarEsDevolucionVenta(CveVenta, 2) Then
|
||||||
ErrorList.Add("No se pudo Cancelar el movimiento de almacen de la Factura")
|
' ErrorList.Add("No se pudo Cancelar el movimiento de almacen de la Factura")
|
||||||
End If
|
' End If
|
||||||
End If
|
' End If
|
||||||
|
|
||||||
End If
|
' End If
|
||||||
End If
|
'End If
|
||||||
|
|
||||||
'SI ES amortizacion 3.3
|
'SI ES amortizacion 3.3
|
||||||
Dim Obj2 As New List(Of Object)
|
'Dim Obj2 As New List(Of Object)
|
||||||
|
|
||||||
If ErrorList.Count = 0 Then
|
'If ErrorList.Count = 0 Then
|
||||||
' cambiar la condicion para saber si hay seleccionado
|
' ' cambiar la condicion para saber si hay seleccionado
|
||||||
If TieneAnticipo AndAlso Me.CveTipoAmortizacionAnticipo = 2 Then
|
' If TieneAnticipo AndAlso Me.CveTipoAmortizacionAnticipo = 2 Then
|
||||||
|
|
||||||
If TieneAnticipo Then
|
' If TieneAnticipo Then
|
||||||
Try
|
' Try
|
||||||
'DESCOMENTAR
|
' 'DESCOMENTAR
|
||||||
If RegistrarNCAmortizacion(ObjVentas, ObjConta, ObjInventario, ObjContr, FacturaDevolucion, ObjBancos, Nothing, Nothing) Then
|
' If RegistrarNCAmortizacion(ObjVentas, ObjConta, ObjInventario, ObjContr, FacturaDevolucion, ObjBancos, Nothing, Nothing) Then
|
||||||
Obj2.Add(FacturaDevolucion)
|
' Obj2.Add(FacturaDevolucion)
|
||||||
End If
|
' End If
|
||||||
Catch ex As Exception
|
' Catch ex As Exception
|
||||||
ErrorList.Add("No se pudo generarse la nota de crédito de amortización")
|
' ErrorList.Add("No se pudo generarse la nota de crédito de amortización")
|
||||||
End Try
|
' End Try
|
||||||
|
|
||||||
|
|
||||||
End If
|
' End If
|
||||||
|
|
||||||
If Obj2 Is Nothing AndAlso Obj2.Count = 0 Then
|
' If Obj2 Is Nothing AndAlso Obj2.Count = 0 Then
|
||||||
ErrorList.Add("No se pudo generarse la nota de crédito de amortización")
|
' ErrorList.Add("No se pudo generarse la nota de crédito de amortización")
|
||||||
End If
|
' End If
|
||||||
End If
|
' End If
|
||||||
End If
|
'End If
|
||||||
|
|
||||||
'MARCA PARA NO SURTIR VENTA DE COTNRATO DE CONSIGNACION DE VENTA | [IPP] : PARCHE
|
'MARCA PARA NO SURTIR VENTA DE COTNRATO DE CONSIGNACION DE VENTA | [IPP] : PARCHE
|
||||||
If ErrorList.Count = 0 Then
|
If ErrorList.Count = 0 Then
|
||||||
@@ -1059,15 +1059,15 @@ Namespace Modelos
|
|||||||
SeTimbro = ObjTimbrado.TimbrarFactura(UsuarioActual, Me, CvePACEspecial:=CvePAC)
|
SeTimbro = ObjTimbrado.TimbrarFactura(UsuarioActual, Me, CvePACEspecial:=CvePAC)
|
||||||
|
|
||||||
'NOTA DE CREDITO - REFACTURADA - CASO ESPECIAL, TIMBRADO E IMPRESION
|
'NOTA DE CREDITO - REFACTURADA - CASO ESPECIAL, TIMBRADO E IMPRESION
|
||||||
If Not IsNothing(Obj2) AndAlso Obj2.Count > 0 Then
|
'If Not IsNothing(Obj2) AndAlso Obj2.Count > 0 Then
|
||||||
Dim ofa As Modelos.Factura = CType(Obj2(0), Modelos.Factura)
|
' Dim ofa As Modelos.Factura = CType(Obj2(0), Modelos.Factura)
|
||||||
'asigna el foliofiscal del ingreso que se acaba de timbrar, cuando es amortización de anticipo con NC
|
' 'asigna el foliofiscal del ingreso que se acaba de timbrar, cuando es amortización de anticipo con NC
|
||||||
If TieneAnticipo AndAlso CveTipoAmortizacionAnticipo = 2 Then
|
' If TieneAnticipo AndAlso CveTipoAmortizacionAnticipo = 2 Then
|
||||||
ofa.Timbre.CFDIRelacionados.UUID.Clear()
|
' ofa.Timbre.CFDIRelacionados.UUID.Clear()
|
||||||
ofa.Timbre.CFDIRelacionados.UUID.Add(ObjTimbrado.UUID)
|
' ofa.Timbre.CFDIRelacionados.UUID.Add(ObjTimbrado.UUID)
|
||||||
End If
|
' End If
|
||||||
ObjTimbrado.TimbrarFactura(UsuarioActual, ofa)
|
' ObjTimbrado.TimbrarFactura(UsuarioActual, ofa)
|
||||||
End If
|
'End If
|
||||||
|
|
||||||
If SeTimbro AndAlso Me.TipoDocto.Contiene("Ing") Then
|
If SeTimbro AndAlso Me.TipoDocto.Contiene("Ing") Then
|
||||||
EstatusSMS = EnviarSMSTimbrado(ObjEventos)
|
EstatusSMS = EnviarSMSTimbrado(ObjEventos)
|
||||||
@@ -1080,12 +1080,12 @@ Namespace Modelos
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
'NOTA DE CREDITO DE REFACTURACION
|
'NOTA DE CREDITO DE REFACTURACION
|
||||||
If RefacturacionGeneroNC Then
|
'If RefacturacionGeneroNC Then
|
||||||
If Not IsNothing(ObjNC) AndAlso ObjNC.Count > 0 Then
|
' If Not IsNothing(ObjNC) AndAlso ObjNC.Count > 0 Then
|
||||||
Dim ofa As Modelos.Factura = CType(ObjNC(0), Modelos.Factura)
|
' Dim ofa As Modelos.Factura = CType(ObjNC(0), Modelos.Factura)
|
||||||
SeTimbroNC = ObjTimbrado.TimbrarFactura(UsuarioActual, ofa)
|
' SeTimbroNC = ObjTimbrado.TimbrarFactura(UsuarioActual, ofa)
|
||||||
End If
|
' End If
|
||||||
End If
|
'End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
@@ -1162,9 +1162,9 @@ Namespace Modelos
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
'ERROR DE NO TIMBRADO NC
|
'ERROR DE NO TIMBRADO NC
|
||||||
If Not IsNothing(ObjNC) AndAlso ObjNC.Count > 0 AndAlso Not SeTimbroNC Then
|
'If Not IsNothing(ObjNC) AndAlso ObjNC.Count > 0 AndAlso Not SeTimbroNC Then
|
||||||
MensajeAlert.AppendFormat("<br/>La NC <b>#{0}</b> no se pudo timbrar.</b> Por favor intentelo de nuevo a traves del boton Emitir.", CType(ObjNC(0), Modelos.Factura).SerieFolio)
|
' MensajeAlert.AppendFormat("<br/>La NC <b>#{0}</b> no se pudo timbrar.</b> Por favor intentelo de nuevo a traves del boton Emitir.", CType(ObjNC(0), Modelos.Factura).SerieFolio)
|
||||||
End If
|
'End If
|
||||||
|
|
||||||
'NOTIFICACION DE SMS
|
'NOTIFICACION DE SMS
|
||||||
Select Case EstatusSMS
|
Select Case EstatusSMS
|
||||||
@@ -1198,9 +1198,9 @@ Namespace Modelos
|
|||||||
MensajeAlert.AppendFormat("<br/><br/><b><a target='_blank' class='Texto' href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"">Movimiento de Almacén</a></b><br/>", Me.Inv_CveMovimiento)
|
MensajeAlert.AppendFormat("<br/><br/><b><a target='_blank' class='Texto' href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"">Movimiento de Almacén</a></b><br/>", Me.Inv_CveMovimiento)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If TieneAnticipo AndAlso CveTipoAmortizacionAnticipo = 2 Then
|
'If TieneAnticipo AndAlso CveTipoAmortizacionAnticipo = 2 Then
|
||||||
MensajeAlert.AppendFormat("<br/><br/><b> Se generó una Nota de crédito Folio: {0} amortizando el anticipo </b><br/>", FacturaDevolucion.Folio)
|
' MensajeAlert.AppendFormat("<br/><br/><b> Se generó una Nota de crédito Folio: {0} amortizando el anticipo </b><br/>", FacturaDevolucion.Folio)
|
||||||
End If
|
'End If
|
||||||
|
|
||||||
If SeTimbro AndAlso CveFacturacionAcarreo > 0 Then
|
If SeTimbro AndAlso CveFacturacionAcarreo > 0 Then
|
||||||
MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" target=""_blank"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF</a></li></ul><br/>", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1", CveVenta)))
|
MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" target=""_blank"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF</a></li></ul><br/>", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1", CveVenta)))
|
||||||
@@ -1905,110 +1905,110 @@ Namespace Modelos
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
#Region " GUARDAR - VENTA, PREPOLIZAS, INV, NC , ESTIMACIONES, AC, NOTA DE CRÉDITO "
|
#Region " GUARDAR - VENTA, PREPOLIZAS, INV, NC , ESTIMACIONES, AC, NOTA DE CRÉDITO "
|
||||||
Private Function RegistrarNCAmortizacion(ObjVentas As ClsVentas, ObjConta As ClsContabilidad, ObjInventario As ClsInventarios, ObjContr As ClsContratos, ByVal factura As Modelos.Factura, ObjBancos As ClsBancos, TmpDTconceptos As DataTable, ByRef ObjEventos As ClsOIEventos) As Boolean
|
'Private Function RegistrarNCAmortizacion(ObjVentas As ClsVentas, ObjConta As ClsContabilidad, ObjInventario As ClsInventarios, ObjContr As ClsContratos, ByVal factura As Modelos.Factura, ObjBancos As ClsBancos, TmpDTconceptos As DataTable, ByRef ObjEventos As ClsOIEventos) As Boolean
|
||||||
Dim ProcesoCorrecto As Boolean = True
|
' Dim ProcesoCorrecto As Boolean = True
|
||||||
|
|
||||||
'Generamos el nuevo folio
|
' 'Generamos el nuevo folio
|
||||||
Dim ObjFolios As New ClsGralFolios(ObjVentas.IniciaTransacSQL())
|
' Dim ObjFolios As New ClsGralFolios(ObjVentas.IniciaTransacSQL())
|
||||||
|
|
||||||
If ObjFolios.GetFolios(factura.TipoDocto, UsuarioActual.CveEmpresa) Then
|
' If ObjFolios.GetFolios(factura.TipoDocto, UsuarioActual.CveEmpresa) Then
|
||||||
Dim DT As DataTable = ObjFolios.DtResultados.FiltraParametros(String.Format(" CveSubProyecto = {0} And Estado = 'Activo'", Me.CveSubProyecto))
|
' Dim DT As DataTable = ObjFolios.DtResultados.FiltraParametros(String.Format(" CveSubProyecto = {0} And Estado = 'Activo'", Me.CveSubProyecto))
|
||||||
If DT.Rows.Count > 0 Then
|
' If DT.Rows.Count > 0 Then
|
||||||
factura.Folio = DT.Rows(0)("FActual").ToString.ToEntero
|
' factura.Folio = DT.Rows(0)("FActual").ToString.ToEntero
|
||||||
Else
|
' Else
|
||||||
ProcesoCorrecto = False
|
' ProcesoCorrecto = False
|
||||||
End If
|
' End If
|
||||||
DT.Dispose()
|
' DT.Dispose()
|
||||||
End If
|
' End If
|
||||||
|
|
||||||
'** genero los datos de la NC
|
' '** genero los datos de la NC
|
||||||
Dim tmpcon As DataTable = DtDetalle.Clone
|
' Dim tmpcon As DataTable = DtDetalle.Clone
|
||||||
tmpcon.Clear()
|
' tmpcon.Clear()
|
||||||
|
|
||||||
Dim drpss As DataRow = ClsPaginas.GlobalDTPS(UsuarioActual.CveEmpresa, SATClavePS:="84111506").FiltroPrimero("SATClavePS = '84111506'")
|
' Dim drpss As DataRow = ClsPaginas.GlobalDTPS(UsuarioActual.CveEmpresa, SATClavePS:="84111506").FiltroPrimero("SATClavePS = '84111506'")
|
||||||
|
|
||||||
If drpss IsNot Nothing Then
|
' If drpss IsNot Nothing Then
|
||||||
Dim ii As Integer = 1
|
' Dim ii As Integer = 1
|
||||||
Dim CveVentaP As Integer = 0
|
' Dim CveVentaP As Integer = 0
|
||||||
For Each gvrt As DataRow In DtAnticipos.Rows
|
' For Each gvrt As DataRow In DtAnticipos.Rows
|
||||||
Dim CveSub As Integer = DtDetalle.FiltroPrimeroValor("CveSubProyecto").ToEntero
|
' Dim CveSub As Integer = DtDetalle.FiltroPrimeroValor("CveSubProyecto").ToEntero
|
||||||
Dim dr As DataRow = tmpcon.NewRow
|
' Dim dr As DataRow = tmpcon.NewRow
|
||||||
Dim Cantidad As Decimal = 1
|
' Dim Cantidad As Decimal = 1
|
||||||
Dim PU As Decimal = gvrt("Importe").ToString().ToDecimal()
|
' Dim PU As Decimal = gvrt("Importe").ToString().ToDecimal()
|
||||||
Dim TotalCalculableImpuestos As Decimal = (Cantidad * (PU))
|
' Dim TotalCalculableImpuestos As Decimal = (Cantidad * (PU))
|
||||||
dr("CvePS") = drpss("CvePS")
|
' dr("CvePS") = drpss("CvePS")
|
||||||
dr("PS") = drpss("PS")
|
' dr("PS") = drpss("PS")
|
||||||
dr("OBS") = drpss("PS")
|
' dr("OBS") = drpss("PS")
|
||||||
dr("PU") = PU
|
' dr("PU") = PU
|
||||||
dr("Cantidad") = Cantidad
|
' dr("Cantidad") = Cantidad
|
||||||
dr("CveUM") = drpss("CveUnidadMedida")
|
' dr("CveUM") = drpss("CveUnidadMedida")
|
||||||
dr("SATClaveProdServ") = "84111506"
|
' dr("SATClaveProdServ") = "84111506"
|
||||||
dr("SATClaveUM") = "ACT"
|
' dr("SATClaveUM") = "ACT"
|
||||||
dr("Consec") = ii
|
' dr("Consec") = ii
|
||||||
|
|
||||||
If drpss("IVA").ToString = "-1" Then
|
' If drpss("IVA").ToString = "-1" Then
|
||||||
dr("PorcentajeIVA") = SubProyectoPorcentajeIVA
|
' dr("PorcentajeIVA") = SubProyectoPorcentajeIVA
|
||||||
Else
|
' Else
|
||||||
dr("PorcentajeIVA") = drpss("IVA")
|
' dr("PorcentajeIVA") = drpss("IVA")
|
||||||
End If
|
' End If
|
||||||
|
|
||||||
dr("IVA") = dr("PorcentajeIVA")
|
' dr("IVA") = dr("PorcentajeIVA")
|
||||||
dr("ImporteIVA") = Math.Round(dr("PorcentajeIVA").ToString.ToDecimal * TotalCalculableImpuestos, 2)
|
' dr("ImporteIVA") = Math.Round(dr("PorcentajeIVA").ToString.ToDecimal * TotalCalculableImpuestos, 2)
|
||||||
|
|
||||||
dr("ImporteRetIVA") = Math.Round(Me.Cliente.RetIVA * TotalCalculableImpuestos, 2)
|
' dr("ImporteRetIVA") = Math.Round(Me.Cliente.RetIVA * TotalCalculableImpuestos, 2)
|
||||||
dr("ImporteRetISR") = Math.Round(Me.Cliente.RetIVA * TotalCalculableImpuestos, 2)
|
' dr("ImporteRetISR") = Math.Round(Me.Cliente.RetIVA * TotalCalculableImpuestos, 2)
|
||||||
dr("PorcentajeRetIVA") = Me.Cliente.RetIVA
|
' dr("PorcentajeRetIVA") = Me.Cliente.RetIVA
|
||||||
dr("PorcentajeRetISR") = Me.Cliente.RetISR
|
' dr("PorcentajeRetISR") = Me.Cliente.RetISR
|
||||||
dr("PorcentajeIEPS") = 0 ' DrPS("IEPSPorcentaje")
|
' dr("PorcentajeIEPS") = 0 ' DrPS("IEPSPorcentaje")
|
||||||
dr("ImporteIEPS") = 0 'Math.Round(DrPS("IEPSPorcentaje").ToString.ToDecimal * TotalCalculableImpuestos, NumeroDecimales)
|
' dr("ImporteIEPS") = 0 'Math.Round(DrPS("IEPSPorcentaje").ToString.ToDecimal * TotalCalculableImpuestos, NumeroDecimales)
|
||||||
dr("IEPS") = dr("ImporteIEPS")
|
' dr("IEPS") = dr("ImporteIEPS")
|
||||||
dr("Descuento") = Math.Round(0, 2)
|
' dr("Descuento") = Math.Round(0, 2)
|
||||||
dr("TipoDescuento") = TipoDescuento
|
' dr("TipoDescuento") = TipoDescuento
|
||||||
dr("Total") = (Cantidad * PU)
|
' dr("Total") = (Cantidad * PU)
|
||||||
dr("CveClasificacion") = drpss("CveClasificacion")
|
' dr("CveClasificacion") = drpss("CveClasificacion")
|
||||||
dr("CveSubProyecto") = CveSub
|
' dr("CveSubProyecto") = CveSub
|
||||||
dr("TotalImporte") = Math.Round(Cantidad * PU, 2)
|
' dr("TotalImporte") = Math.Round(Cantidad * PU, 2)
|
||||||
CveVentaP = gvrt("CveVenta").ToString().ToEntero()
|
' CveVentaP = gvrt("CveVenta").ToString().ToEntero()
|
||||||
tmpcon.Rows.Add(dr)
|
' tmpcon.Rows.Add(dr)
|
||||||
ii += 1
|
' ii += 1
|
||||||
|
|
||||||
Next
|
' Next
|
||||||
|
|
||||||
'**** impuestos locales
|
' '**** impuestos locales
|
||||||
|
|
||||||
|
|
||||||
factura.DtDetalle = tmpcon
|
' factura.DtDetalle = tmpcon
|
||||||
Dim TotalSubTotal As Decimal = tmpcon.SUM("TotalImporte")
|
' Dim TotalSubTotal As Decimal = tmpcon.SUM("TotalImporte")
|
||||||
Dim TotalDescuentos As Decimal = tmpcon.SUM("Descuento")
|
' Dim TotalDescuentos As FunctionDecimal = tmpcon.SUM("Descuento")
|
||||||
|
|
||||||
Dim TotalIVA As Decimal = tmpcon.SUM("ImporteIVA")
|
' Dim TotalIVA As Decimal = tmpcon.SUM("ImporteIVA")
|
||||||
Dim TotalIEPS As Decimal = tmpcon.SUM("ImporteIEPS")
|
' Dim TotalIEPS As Decimal = tmpcon.SUM("ImporteIEPS")
|
||||||
Dim TotalRetIVA As Decimal = tmpcon.SUM("ImporteRetIVA")
|
' Dim TotalRetIVA As Decimal = tmpcon.SUM("ImporteRetIVA")
|
||||||
Dim TotalRetISR As Decimal = tmpcon.SUM("ImporteRetISR")
|
' Dim TotalRetISR As Decimal = tmpcon.SUM("ImporteRetISR")
|
||||||
Dim Total As Decimal = 0
|
' Dim Total As Decimal = 0
|
||||||
Dim TotalImpuestosLocales As Decimal = 0
|
' Dim TotalImpuestosLocales As Decimal = 0
|
||||||
Total = (TotalSubTotal - TotalDescuentos + TotalIVA + TotalIEPS - TotalRetIVA - TotalRetISR - TotalImpuestosLocales)
|
' Total = (TotalSubTotal - TotalDescuentos + TotalIVA + TotalIEPS - TotalRetIVA - TotalRetISR - TotalImpuestosLocales)
|
||||||
|
|
||||||
factura.SubTotal = TotalSubTotal
|
' factura.SubTotal = TotalSubTotal
|
||||||
factura.Descuento = 0
|
' factura.Descuento = 0
|
||||||
factura.IVA = TotalIVA
|
' factura.IVA = TotalIVA
|
||||||
factura.IEPS = TotalIEPS
|
' factura.IEPS = TotalIEPS
|
||||||
factura.RetIVA = TotalRetIVA
|
' factura.RetIVA = TotalRetIVA
|
||||||
factura.RetISR = TotalRetISR
|
' factura.RetISR = TotalRetISR
|
||||||
factura.Total = Total
|
' factura.Total = Total
|
||||||
factura.CveVentaPadre = CveVentaP
|
' factura.CveVentaPadre = CveVentaP
|
||||||
|
|
||||||
'Registramos la venta
|
' 'Registramos la venta
|
||||||
GuardarVenta(factura, ObjVentas, ObjConta, ObjInventario, ObjContr, tmpcon, -1, ObjBancos)
|
' GuardarVenta(factura, ObjVentas, ObjConta, ObjInventario, ObjContr, tmpcon, -1, ObjBancos)
|
||||||
|
|
||||||
''Timbramos
|
' ''Timbramos
|
||||||
Else
|
' Else
|
||||||
ErrorList.Add("No se encontró un producto para generar la nota de crédito")
|
' ErrorList.Add("No se encontró un producto para generar la nota de crédito")
|
||||||
End If
|
' End If
|
||||||
|
|
||||||
|
|
||||||
Return ProcesoCorrecto
|
' Return ProcesoCorrecto
|
||||||
End Function
|
'End
|
||||||
Private Sub EnviarNotificacionAvance(NumeroContrato As String, DescripcionContrato As String, ContratoTipo As String, Cliente As String, CorreoVendedor As String, Optional MontoMaximo As Double = 0)
|
Private Sub EnviarNotificacionAvance(NumeroContrato As String, DescripcionContrato As String, ContratoTipo As String, Cliente As String, CorreoVendedor As String, Optional MontoMaximo As Double = 0)
|
||||||
|
|
||||||
Dim ObjMail As New ClsSisMail()
|
Dim ObjMail As New ClsSisMail()
|
||||||
@@ -3892,8 +3892,8 @@ Namespace Modelos
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
If ObjFactura.DtAnticipos IsNot Nothing Then
|
If ObjFactura.DtAnticiposAplicados IsNot Nothing Then
|
||||||
For Each row2 As DataRow In ObjFactura.DtAnticipos.Rows
|
For Each row2 As DataRow In ObjFactura.DtAnticiposAplicados.Rows
|
||||||
|
|
||||||
If row2("CveConceptoContable").ToString().ToEntero = 12 Then
|
If row2("CveConceptoContable").ToString().ToEntero = 12 Then
|
||||||
importeMovimiento = row2("Importe").ToString().ToDecimal()
|
importeMovimiento = row2("Importe").ToString().ToDecimal()
|
||||||
@@ -3915,6 +3915,32 @@ Namespace Modelos
|
|||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
'SI ES PAGO CON DEVOLUCION
|
||||||
|
If ObjFactura.CveTipoAmortizacionAnticipo = 4 Then
|
||||||
|
If row2("CveConceptoContable").ToString().ToEntero = 277 Then
|
||||||
|
|
||||||
|
importeMovimiento = row2("Importe").ToString().ToDecimal()
|
||||||
|
importeMX = importeMovimiento * tipoCambio
|
||||||
|
sumaAmorticaciones += importeMovimiento
|
||||||
|
|
||||||
|
If importeMovimiento <> 0 Then
|
||||||
|
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, importeMovimiento * tipoCambio, 150, Referencia, Concepto, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveVentaAmortizacion:=-1, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveClasificacion:=ObjFactura.DtDetalle.MAX("CveClasificacion").ToEntero(), CveSubProyecto:=ObjFactura.CveSubProyecto, Contabilizable:=Contabilizable) Then
|
||||||
|
ErrorPrepoliza = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
If ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento * -1, importeMX * -1, 277, Referencia, Concepto, CveVenta:=row2("CveVenta").ToString().ToEntero(), CveVentaAmortizacion:=-1, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), Contabilizable:=False, CveSubProyecto:=CveSubProyectoContabilizar) Then
|
||||||
|
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, Not TipoMovimiento, importeMovimiento * -1, importeMX * -1, 278, Referencia, Concepto, CveVenta:=row2("CveVenta").ToString().ToEntero(), CveVentaAmortizacion:=-1, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), Contabilizable:=False, CveSubProyecto:=CveSubProyectoContabilizar) Then
|
||||||
|
ErrorPrepoliza = True
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
ErrorPrepoliza = True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
Next
|
Next
|
||||||
End If
|
End If
|
||||||
If sumaAmorticaciones <> 0 Then
|
If sumaAmorticaciones <> 0 Then
|
||||||
@@ -4207,6 +4233,42 @@ Namespace Modelos
|
|||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
'APLICA PAGO SI SELECCIONA IxC
|
||||||
|
If Not ErrorPrepoliza AndAlso ValorMultiplicador = 1 AndAlso ObjFactura.CveTipoAmortizacionAnticipo = 4 Then
|
||||||
|
|
||||||
|
Dim VentaActual As New ClsPaginas.Venta(ObjFactura, UsuarioActual)
|
||||||
|
|
||||||
|
For Each row2 As DataRow In DtAnticiposAplicados.Rows
|
||||||
|
|
||||||
|
If row2("CveConceptoContable").ToString().ToEntero() = 66 Then
|
||||||
|
|
||||||
|
importeMovimiento = row2("Importe").ToString().ToDecimal
|
||||||
|
|
||||||
|
If importeMovimiento <> 0 Then
|
||||||
|
|
||||||
|
Dim Pago As New ClsPaginas.VentaPago
|
||||||
|
Pago.Fecha = Now
|
||||||
|
Pago.FechaDocumentoRelacionado = row2("Fecha").ToString().ToDateTime()
|
||||||
|
Pago.ImportePagoVenta = importeMovimiento
|
||||||
|
Pago.ImportePago = importeMovimiento
|
||||||
|
Pago.CveIE = row2("CveIE").ToString().ToEntero()
|
||||||
|
Pago.CveMonedaPago = row2("CveMoneda").ToString().ToEntero()
|
||||||
|
Pago.TCPago = row2("TipoCambioPago").ToString().ToDecimal()
|
||||||
|
Pago.AplicaTraslado = False
|
||||||
|
Pago.Referencia = row2("Folio").ToString()
|
||||||
|
Pago.CveVentaAmortizacion = -1
|
||||||
|
Pago.TipoPago = "I"
|
||||||
|
Pago.CveClientePago = ObjFactura.CveCliente
|
||||||
|
|
||||||
|
ErrorPrepoliza = ClsPaginas.AplicaPrePolizaPagoVenta(VentaActual, Pago, ObjFactura.CvePrePoliza, ObjConta, AplicarConceptoAplicacion:=True)
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
If ObjFactura.RemisionesLista.Count = 0 AndAlso (DtRemisionesRelacionadas IsNot Nothing AndAlso DtRemisionesRelacionadas.Rows.Count > 0) Then
|
If ObjFactura.RemisionesLista.Count = 0 AndAlso (DtRemisionesRelacionadas IsNot Nothing AndAlso DtRemisionesRelacionadas.Rows.Count > 0) Then
|
||||||
For Each Row As DataRow In DtRemisionesRelacionadas.Rows
|
For Each Row As DataRow In DtRemisionesRelacionadas.Rows
|
||||||
ObjFactura.RemisionesLista.Add(Row("CveVenta").ToString().ToEntero())
|
ObjFactura.RemisionesLista.Add(Row("CveVenta").ToString().ToEntero())
|
||||||
|
|||||||
@@ -529,6 +529,14 @@ Partial Class Ventas_PVCobranza
|
|||||||
'REALIZAR EL PAGO EN LA FACTURA
|
'REALIZAR EL PAGO EN LA FACTURA
|
||||||
If respFactura IsNot Nothing AndAlso Not respFactura.TieneError Then
|
If respFactura IsNot Nothing AndAlso Not respFactura.TieneError Then
|
||||||
CveVenta = respFactura.CveVenta
|
CveVenta = respFactura.CveVenta
|
||||||
|
|
||||||
|
If HdnTipoAmortizacion.Value = "4" Then
|
||||||
|
If respFactura.Factura.DtAnticiposAplicados IsNot Nothing Then
|
||||||
|
PagoAplicado += respFactura.Factura.DtAnticiposAplicados.SUM("Importe")
|
||||||
|
SaldoPendiente = SaldoPendiente - PagoAplicado
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -793,6 +801,40 @@ Partial Class Ventas_PVCobranza
|
|||||||
|
|
||||||
ObjFactura.PreparaTimbre()
|
ObjFactura.PreparaTimbre()
|
||||||
|
|
||||||
|
If HdnTipoAmortizacion.Value = "4" Then
|
||||||
|
Dim DtAnticipos As New DataTable()
|
||||||
|
DtAnticipos.Columns.Add("CveVenta", GetType(Integer))
|
||||||
|
DtAnticipos.Columns.Add("Importe", GetType(Decimal))
|
||||||
|
DtAnticipos.Columns.Add("CveConceptoContable", GetType(Integer))
|
||||||
|
DtAnticipos.Columns.Add("CveIE", GetType(Integer))
|
||||||
|
DtAnticipos.Columns.Add("FolioFiscal", GetType(String))
|
||||||
|
DtAnticipos.Columns.Add("Descuentos", GetType(Decimal))
|
||||||
|
DtAnticipos.Columns.Add("TotalAnticipo", GetType(Decimal))
|
||||||
|
DtAnticipos.Columns.Add("SubTotalAnticipo", GetType(Decimal))
|
||||||
|
DtAnticipos.Columns.Add("CveMoneda", GetType(Decimal))
|
||||||
|
|
||||||
|
For Each GvRow As GridViewRow In GVAnticipos.Rows
|
||||||
|
If GvRow.FCCheckBox("Chk" & GvRow.RowIndex) IsNot Nothing AndAlso GvRow.FCCheckBox("Chk" & GvRow.RowIndex).Checked Then
|
||||||
|
Dim CveVenta = GvRow.DataKey("CveVenta").ToEntero()
|
||||||
|
Dim Importe = GvRow.FCTextBox(String.Format("TxtAnticipo{0}", GvRow.RowIndex)).Text.ToDecimal()
|
||||||
|
Dim CveConceptoContable = GvRow.DataKey("CveConceptoContable").ToEntero()
|
||||||
|
Dim CveIE = GvRow.DataKey("CveIE").ToEntero()
|
||||||
|
|
||||||
|
Dim FolioFiscal = GvRow.DataKey("FolioFiscal")
|
||||||
|
Dim Descuentos As Decimal = GvRow.DataKey("Descuentos").ToDecimal()
|
||||||
|
Dim TotalAnticipo As Decimal = GvRow.DataKey("TotalAnticipo").ToDecimal()
|
||||||
|
Dim SubTotalAnticipo As Decimal = GvRow.DataKey("SubTotalAnticipo").ToDecimal()
|
||||||
|
Dim CveMoneda As Integer = GvRow.DataKey("CveMoneda").ToEntero()
|
||||||
|
|
||||||
|
DtAnticipos.Rows.Add(CveVenta, Importe, CveConceptoContable, CveIE, FolioFiscal, Descuentos, TotalAnticipo, SubTotalAnticipo, CveMoneda)
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
|
||||||
|
ObjFactura.EsNCAmortizacion = True
|
||||||
|
ObjFactura.CveTipoAmortizacionAnticipo = 4
|
||||||
|
ObjFactura.DtAnticiposAplicados = DtAnticipos
|
||||||
|
End If
|
||||||
|
|
||||||
Dim SbAlert As New StringBuilder()
|
Dim SbAlert As New StringBuilder()
|
||||||
|
|
||||||
Try
|
Try
|
||||||
@@ -1424,10 +1466,10 @@ Partial Class Ventas_PVCobranza
|
|||||||
Dim CveVenta As Integer = HdnCveVenta.Value.ToEntero()
|
Dim CveVenta As Integer = HdnCveVenta.Value.ToEntero()
|
||||||
|
|
||||||
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
|
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
|
||||||
'If DdlTipoAmortizacionAnticipo.Items.FindByValue("4") Is Nothing Then
|
If DdlTipoAmortizacionAnticipo.Items.FindByValue("4") Is Nothing Then
|
||||||
' DdlTipoAmortizacionAnticipo.Items.Insert(1, New ListItem("Pago con devolución", "4"))
|
DdlTipoAmortizacionAnticipo.Items.Insert(1, New ListItem("Pago con devolución", "4"))
|
||||||
'End If
|
End If
|
||||||
'DdlTipoAmortizacionAnticipo.SelectedValueExist("4")
|
DdlTipoAmortizacionAnticipo.SelectedValueExist("4")
|
||||||
|
|
||||||
DdlTipoRelacionAnticipo.SelectedValueExist("-1")
|
DdlTipoRelacionAnticipo.SelectedValueExist("-1")
|
||||||
|
|
||||||
@@ -1701,7 +1743,7 @@ Partial Class Ventas_PVCobranza
|
|||||||
ListaAnticiposAplicados.Clear()
|
ListaAnticiposAplicados.Clear()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'cuando es PAGO CON DEVOLUCION
|
|
||||||
Dim SbObs As New StringBuilder
|
Dim SbObs As New StringBuilder
|
||||||
For Each gvr As GridViewRow In GVAnticipos.Rows
|
For Each gvr As GridViewRow In GVAnticipos.Rows
|
||||||
If gvr.FCCheckBox("Chk" & gvr.RowIndex) IsNot Nothing AndAlso gvr.FCCheckBox("Chk" & gvr.RowIndex).Checked Then
|
If gvr.FCCheckBox("Chk" & gvr.RowIndex) IsNot Nothing AndAlso gvr.FCCheckBox("Chk" & gvr.RowIndex).Checked Then
|
||||||
|
|||||||
Reference in New Issue
Block a user