-- pedimento en emisión
This commit is contained in:
@@ -6083,6 +6083,26 @@ Public Class ClsInventarios
|
|||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Public Function UpdateVentasDetalleNumeroPedimento(CveVenta As Integer, CveVentaDetalle As Integer, NumeroPedimento As String) As Boolean
|
||||||
|
Dim Retorno As Boolean = False
|
||||||
|
DataAdapter("PA_Vta_VentasDetalleNumeroPedimentoUpdate")
|
||||||
|
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
|
||||||
|
.Add("@CveVentaDetalle", SqlDbType.Int).Value = CveVentaDetalle
|
||||||
|
.Add("@NumeroPedimento", SqlDbType.VarChar).Value = NumeroPedimento
|
||||||
|
End With
|
||||||
|
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
Retorno = True
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al actualizar el pedimento.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
|
|
||||||
#Region " IDisposable Support "
|
#Region " IDisposable Support "
|
||||||
' IDisposable
|
' IDisposable
|
||||||
Protected Overridable Sub Dispose(ByVal disposing As Boolean)
|
Protected Overridable Sub Dispose(ByVal disposing As Boolean)
|
||||||
|
|||||||
@@ -1476,11 +1476,14 @@ Public Class ClsVentas
|
|||||||
SqlAdapter.Fill(Data)
|
SqlAdapter.Fill(Data)
|
||||||
Retorno = True
|
Retorno = True
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
OnError("Ocurrió un error al actualizar el documento.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
OnError("Ocurrió un error al eliminar el detalle de la venta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
End Try
|
End Try
|
||||||
|
|
||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region "V E N T A - P R E S U P U E S T O"
|
#Region "V E N T A - P R E S U P U E S T O"
|
||||||
|
|||||||
@@ -2519,21 +2519,12 @@ Partial Class Ventas
|
|||||||
TrObsAlmacen.Visible = False
|
TrObsAlmacen.Visible = False
|
||||||
TrTxtObsAlmacen.Visible = False
|
TrTxtObsAlmacen.Visible = False
|
||||||
TrPedido.Visible = False
|
TrPedido.Visible = False
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TrOC.Visible = False
|
TrOC.Visible = False
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
DdlTipoComprobante.SelectedValue = "Op"
|
DdlTipoComprobante.SelectedValue = "Op"
|
||||||
Else
|
Else
|
||||||
Opcion = "Ing"
|
Opcion = "Ing"
|
||||||
DdlTipoComprobante.SelectedValue = "Ing"
|
DdlTipoComprobante.SelectedValue = "Ing"
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
'DdlTipoComprobante.Attributes.Add("onChange", "ActivaReferencia(this)")
|
'DdlTipoComprobante.Attributes.Add("onChange", "ActivaReferencia(this)")
|
||||||
TxtFecha.Text = Now.ToShortDateString()
|
TxtFecha.Text = Now.ToShortDateString()
|
||||||
TxtFechaEjecucion.Text = Now.ToShortDateString
|
TxtFechaEjecucion.Text = Now.ToShortDateString
|
||||||
@@ -10192,7 +10183,7 @@ Partial Class Ventas
|
|||||||
NCGenerada.Timbre.CFDIRelacionados.UUID.Add(FolioFiscalFactura)
|
NCGenerada.Timbre.CFDIRelacionados.UUID.Add(FolioFiscalFactura)
|
||||||
|
|
||||||
Dim ObjTimbradoNC As New Timbrado
|
Dim ObjTimbradoNC As New Timbrado
|
||||||
Dim TimbroNC = ObjTimbradoNC.TimbrarFactura(UsuarioActual, NCGenerada)
|
Dim TimbroNC As Boolean = ObjTimbradoNC.TimbrarFactura(UsuarioActual, NCGenerada)
|
||||||
|
|
||||||
If Not TimbroNC Then
|
If Not TimbroNC Then
|
||||||
Alert(ObjTimbradoNC.MensajeErrorCFDI, TipoMensaje.MsgError)
|
Alert(ObjTimbradoNC.MensajeErrorCFDI, TipoMensaje.MsgError)
|
||||||
@@ -12493,18 +12484,18 @@ Partial Class Ventas
|
|||||||
'detalles
|
'detalles
|
||||||
Dim tPS As String
|
Dim tPS As String
|
||||||
If UsuarioActual.CveEmpresa = 119 Then
|
If UsuarioActual.CveEmpresa = 119 Then
|
||||||
Dim ObjPed As New ClsInventarios
|
'Dim ObjPed As New ClsInventarios
|
||||||
If ObjPed.GetVentasPedimento(CveVenta, UsuarioActual.CveEmpresa) Then
|
'If ObjPed.GetVentasPedimento(CveVenta, UsuarioActual.CveEmpresa) Then
|
||||||
Dim dttped As DataTable = ObjPed.DtResultados
|
' Dim dttped As DataTable = ObjPed.DtResultados
|
||||||
If Not Obj.DtDetalle.Columns.Contains("NumeroPedimento") Then
|
' If Not Obj.DtDetalle.Columns.Contains("NumeroPedimento") Then
|
||||||
Obj.DtDetalle.Columns.Add("NumeroPedimento", Type.GetType("System.String"))
|
' Obj.DtDetalle.Columns.Add("NumeroPedimento", Type.GetType("System.String"))
|
||||||
End If
|
' End If
|
||||||
For Each drt As DataRow In Obj.DtDetalle.Rows
|
' For Each drt As DataRow In Obj.DtDetalle.Rows
|
||||||
Dim Pedimento As String = dttped.FiltroPrimeroValor("Pedimento", $"CveVentaDetalle = {drt("CveVentaDetalle")}")
|
' Dim Pedimento As String = dttped.FiltroPrimeroValor("Pedimento", $"CveVentaDetalle = {drt("CveVentaDetalle")}")
|
||||||
drt("NumeroPedimento") = Pedimento
|
' drt("NumeroPedimento") = Pedimento
|
||||||
Next
|
' Next
|
||||||
End If
|
'End If
|
||||||
ObjPed.Dispose()
|
'ObjPed.Dispose()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
For Each drr As DataRow In Obj.DtDetalle.Rows
|
For Each drr As DataRow In Obj.DtDetalle.Rows
|
||||||
@@ -15106,8 +15097,19 @@ Partial Class Ventas
|
|||||||
OcurrioError = True
|
OcurrioError = True
|
||||||
ErrorList.Add("Ocurrió un error al guardar movimiento de almacen.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
|
ErrorList.Add("Ocurrió un error al guardar movimiento de almacen.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
|
||||||
End If
|
End If
|
||||||
'End If
|
|
||||||
|
|
||||||
|
'E119, verifica si la salida está con ps de importación para que se guarde el pedimento
|
||||||
|
If UsuarioActual.CveEmpresa = 119 AndAlso factura.TipoDocto.Contiene("Ing") Then
|
||||||
|
|
||||||
|
'If ObjInventario.GetVentasPedimento(CveVenta, UsuarioActual.CveEmpresa) Then
|
||||||
|
' Dim dttped As DataTable = ObjInventario.DtResultados
|
||||||
|
|
||||||
|
' For Each drt As DataRow In dttped.FiltraParametros("NumeroPedimento <> ''").Rows
|
||||||
|
|
||||||
|
' ObjVentas.UpdateVentasDetalleNumeroPedimento(factura.CveVenta, drt("CveVentaDetalle").ToString.ToEntero, drt("NumeroPedimento").ToString)
|
||||||
|
' Next
|
||||||
|
'End If
|
||||||
|
End If
|
||||||
Else
|
Else
|
||||||
OcurrioError = True
|
OcurrioError = True
|
||||||
ErrorList.Add("Ocurrió un error al consultar los movimientos de almacen.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
|
ErrorList.Add("Ocurrió un error al consultar los movimientos de almacen.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
|
||||||
@@ -15118,7 +15120,7 @@ Partial Class Ventas
|
|||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'DEBE GENERAR MOVIMIENTO SI SE FACTURAON PRODUCTOS, O NO SE REALIZA UNA REFACTURACION
|
'DEBE GENERAR MOVIMIENTO SI SE FACTURARON PRODUCTOS, O NO SE REALIZA UNA REFACTURACION
|
||||||
Dim DebeGenerarMovimiento As Boolean = TmpDT.COUNT("CvePS", "CveTipoPS = 2") > 0 AndAlso (NuevaFactura <> 1)
|
Dim DebeGenerarMovimiento As Boolean = TmpDT.COUNT("CvePS", "CveTipoPS = 2") > 0 AndAlso (NuevaFactura <> 1)
|
||||||
'VERIFICA QUE SE REALIZO EL MOVIMIENTO DE ALMACEN
|
'VERIFICA QUE SE REALIZO EL MOVIMIENTO DE ALMACEN
|
||||||
If Not OcurrioError AndAlso DebeGenerarMovimiento AndAlso UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso UsuarioActual.Empresa.Funcionalidad(567) = "1" AndAlso factura.TipoDocto.Contiene("Ing", "Rem") Then
|
If Not OcurrioError AndAlso DebeGenerarMovimiento AndAlso UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso UsuarioActual.Empresa.Funcionalidad(567) = "1" AndAlso factura.TipoDocto.Contiene("Ing", "Rem") Then
|
||||||
@@ -20319,6 +20321,16 @@ Partial Class Ventas
|
|||||||
OcurrioError = True
|
OcurrioError = True
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If Not OcurrioError AndAlso UsuarioActual.CveEmpresa = 119 Then
|
||||||
|
If ObjInventario.GetVentasPedimento(CveVenta, UsuarioActual.CveEmpresa) Then
|
||||||
|
Dim dttped As DataTable = ObjInventario.DtResultados
|
||||||
|
|
||||||
|
For Each drt As DataRow In dttped.FiltraParametros("Pedimento <> ''").Rows
|
||||||
|
ObjInventario.UpdateVentasDetalleNumeroPedimento(CveVenta, drt("CveVentaDetalle").ToString.ToEntero, drt("Pedimento").ToString)
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
End If
|
||||||
Else
|
Else
|
||||||
OcurrioError = True
|
OcurrioError = True
|
||||||
End If
|
End If
|
||||||
@@ -32393,7 +32405,7 @@ Partial Class Ventas
|
|||||||
If GvRow.FCCheckBox("ChkAplicar").Checked AndAlso GvRow.DataKey("CveVenta").ToEntero() = Dr("CveVenta").ToString().ToEntero() Then
|
If GvRow.FCCheckBox("ChkAplicar").Checked AndAlso GvRow.DataKey("CveVenta").ToEntero() = Dr("CveVenta").ToString().ToEntero() Then
|
||||||
|
|
||||||
Dim Cantidad As Decimal = GvRow.FCTextBox("TxtCantidadRNC").Text.ToDecimal()
|
Dim Cantidad As Decimal = GvRow.FCTextBox("TxtCantidadRNC").Text.ToDecimal()
|
||||||
Dim PU = GvRow.DataKey("PU").ToDecimal()
|
Dim PU As Decimal = GvRow.DataKey("PU").ToDecimal()
|
||||||
Dim PorcentajeIVA As Decimal = GvRow.DataKey("PorcentajeIVA").ToDecimal()
|
Dim PorcentajeIVA As Decimal = GvRow.DataKey("PorcentajeIVA").ToDecimal()
|
||||||
|
|
||||||
Dim TotalCalculableImpuestos As Decimal = (Cantidad * PU)
|
Dim TotalCalculableImpuestos As Decimal = (Cantidad * PU)
|
||||||
@@ -32459,7 +32471,7 @@ Partial Class Ventas
|
|||||||
|
|
||||||
'SI TIENE ALGUN AJUSTE O GARANTIA
|
'SI TIENE ALGUN AJUSTE O GARANTIA
|
||||||
If ListaRemisionesNC.Any(Function(RNC) RNC.Num2 = 1) Then
|
If ListaRemisionesNC.Any(Function(RNC) RNC.Num2 = 1) Then
|
||||||
For Each RNC In ListaRemisionesNC.Where(Function(x) x.Num2 = 1)
|
For Each RNC As Modelos.Factura In ListaRemisionesNC.Where(Function(x) x.Num2 = 1)
|
||||||
Dim Salir As Boolean = False
|
Dim Salir As Boolean = False
|
||||||
|
|
||||||
Using ObjAcum As New ClsAcumuladores
|
Using ObjAcum As New ClsAcumuladores
|
||||||
@@ -32522,8 +32534,6 @@ Partial Class Ventas
|
|||||||
Dim TotalRNCDetalle As Decimal = (TotalCalculableImpuestos + ImporteIVA)
|
Dim TotalRNCDetalle As Decimal = (TotalCalculableImpuestos + ImporteIVA)
|
||||||
|
|
||||||
TotalRNC += TotalRNCDetalle
|
TotalRNC += TotalRNCDetalle
|
||||||
|
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
@@ -32668,7 +32678,6 @@ Partial Class Ventas
|
|||||||
|
|
||||||
TmpDTRNCDetalleSelecciondas.Rows.Add(row.ItemArray)
|
TmpDTRNCDetalleSelecciondas.Rows.Add(row.ItemArray)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Next
|
Next
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|||||||
Reference in New Issue
Block a user