-
This commit is contained in:
@@ -4007,7 +4007,7 @@ Partial Class Inventarios_EntradasSalidas
|
||||
|
||||
#Region "CAMBIO INVENTARIO FISICO"
|
||||
Protected Sub LnkCambioInventarioFisico_Click(sender As Object, e As EventArgs)
|
||||
RegistraScript(String.Format("$('#{0}').modal();", "DivModalCambioFisico"))
|
||||
RegistraScript("$('#DivModalCambioFisico').modal({backdrop: 'static', keyboard: false});")
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkCambioVigencia_Click(sender As Object, e As EventArgs)
|
||||
@@ -4438,8 +4438,20 @@ Partial Class Inventarios_EntradasSalidas
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim ObjInventario As New ClsInventarios
|
||||
Dim ObjConta As New ClsContabilidad(ObjInventario.IniciaTransacSQL())
|
||||
Dim CveAlmacen As Integer = DdlAlmacenInventarioFisico.SelectedValue.ToEntero
|
||||
Dim CveModalidad As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=CveAlmacen).FiltroPrimeroValor("CveModalidad").ToEntero()
|
||||
Dim EsContabilizable As Boolean = (CveModalidad = 1)
|
||||
|
||||
If CveAlmacen <= 0 Then
|
||||
Alert("Debe seleccionar un almacen", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim ErrorMovInv As Boolean = False
|
||||
Dim Mensaje As String = ""
|
||||
Dim ValorEntrada As Decimal = 0
|
||||
Dim ValorSalida As Decimal = 0
|
||||
Dim ImporteConcepto As Decimal = 0
|
||||
|
||||
Dim CveMovimientoEntrada As Integer = -1
|
||||
Dim FolioEntrada As Integer = -1
|
||||
@@ -4447,25 +4459,20 @@ Partial Class Inventarios_EntradasSalidas
|
||||
Dim CveMovimientoSalida As Integer = -1
|
||||
Dim FolioSalida As Integer = -1
|
||||
|
||||
Dim ErrorMovInv As Boolean = False
|
||||
Dim Mensaje As String = ""
|
||||
Dim ValorEntrada As Decimal = 0
|
||||
Dim ValorSalida As Decimal = 0
|
||||
Dim ImporteConcepto As Decimal = 0
|
||||
Dim tConcepto As String = TxtIFDescripcion.Text.Trim
|
||||
Dim Fecha As Date = (TxtFechaInvFisico.Text.ToDate.ToString("yyyy/MM/dd ") & NowADS().ToShortTimeString).ToDate
|
||||
Dim tCveSubProyectoEntrada As Integer = -1
|
||||
Dim tCveSubProyectoSalida As Integer = -1
|
||||
Dim TipoMovto As Boolean = False
|
||||
|
||||
|
||||
Dim ObjInventario As New ClsInventarios
|
||||
Dim ObjConta As New ClsContabilidad(ObjInventario.IniciaTransacSQL())
|
||||
Try
|
||||
|
||||
Dim Prorratear As Boolean = If(UsuarioActual.CveEmpresa = 172 AndAlso DtMovimientosSalidaInvFisico.Rows.Count > 0 AndAlso DtMovimientosEntradaInvFisico.Rows.Count > 0, True, False)
|
||||
Dim ProPU As Decimal = 0
|
||||
|
||||
|
||||
Dim CveAlmacen As Integer = DdlAlmacenInventarioFisico.SelectedValue.ToEntero
|
||||
Dim CveModalidad As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=CveAlmacen).FiltroPrimeroValor("CveModalidad").ToEntero()
|
||||
Dim EsContabilizable As Boolean = (CveModalidad = 1)
|
||||
|
||||
'MOVIMIENTO DE ENTRADA
|
||||
If DtMovimientosEntradaInvFisico.Rows.Count > 0 Then
|
||||
'FolioEntrada = ObjInventario.GetFolioSiguiente(32, UsuarioActual.CveEmpresa)
|
||||
@@ -4487,13 +4494,12 @@ Partial Class Inventarios_EntradasSalidas
|
||||
|
||||
'VALIDA, sino hay registrado ningun movimiento, que no siga
|
||||
If (CveMovimientoEntrada <= 0 AndAlso CveMovimientoSalida <= 0) Or CvePrePoliza <= 0 Then
|
||||
ErrorMovInv = True
|
||||
Alert("Ocurrió un error al realizar los registros. Por favor verifique y vuelva a intentar", TipoMensaje.MsgError)
|
||||
RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")
|
||||
ObjInventario.RollBack() 'deshace lo insertado.
|
||||
ObjInventario.Dispose() 'elimino la instancia
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If Not ErrorMovInv Then
|
||||
'VALIDA EXISTENCIAS SALIDA E INSERTA DETALLES
|
||||
For Each Dr As DataRow In DtMovimientosSalidaInvFisico.Rows
|
||||
If ObjInventario.GetExistenciasPS(Dr("CvePS").ToString.ToEntero, Dr("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacenInventarioFisico.SelectedValue.ToEntero, PendientePorSurtir:=1) >= Dr("Cantidad").ToString.ToDouble Then
|
||||
@@ -4512,7 +4518,7 @@ Partial Class Inventarios_EntradasSalidas
|
||||
End If
|
||||
Next
|
||||
|
||||
If Prorratear Then
|
||||
If Not ErrorMovInv AndAlso Prorratear Then
|
||||
If Not ErrorMovInv AndAlso CveMovimientoSalida > 0 Then
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
|
||||
|
||||
@@ -4655,7 +4661,12 @@ Partial Class Inventarios_EntradasSalidas
|
||||
|
||||
If RetornoVirtual IsNot Nothing Then ErrorMovInv = RetornoVirtual.TieneError
|
||||
End If
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al generar el movimiento", ex)
|
||||
ErrorMovInv = True
|
||||
End Try
|
||||
|
||||
If Not ErrorMovInv Then
|
||||
ObjInventario.Commit() ' aplica los movimientos insertados
|
||||
@@ -4695,12 +4706,13 @@ Partial Class Inventarios_EntradasSalidas
|
||||
If GvSalidasCambioVigencia.Rows.Count = 0 Then
|
||||
Alert("No hay ningun registro para generar el movimiento. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgError)
|
||||
RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")
|
||||
RegistraScript(String.Format("$('#{0}').modal();", "DivModalCambioFisico"))
|
||||
RegistraScript(String.Format("$('#{0}').modal({backdrop: 'static', keyboard: false});", "DivModalCambioFisico"))
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim ObjInventario As New ClsInventarios
|
||||
Dim ObjConta As New ClsContabilidad(ObjInventario.IniciaTransacSQL())
|
||||
|
||||
Dim CveMovimientoEntrada As Integer = -1
|
||||
Dim CveMovimientoSalida As Integer = -1
|
||||
Dim ErrorMovInv As Boolean = False
|
||||
@@ -4709,7 +4721,7 @@ Partial Class Inventarios_EntradasSalidas
|
||||
Dim ValorSalida As Decimal = 0
|
||||
Dim ImporteConcepto As Decimal = 0
|
||||
Dim tConcepto As String = TxtObsCambioVigencia.Text.Trim
|
||||
Dim Fecha As Date = TxtFechaCambio.Text.ToDate.ToString("yyyy/MM/dd").ToDate
|
||||
Dim Fecha As Date = TxtFechaCambio.Text.ToDate.ToString("yyyy/MM/dd").ToDate()
|
||||
Dim tCveSubProyecto As Integer = -1
|
||||
Dim TipoMovto As Boolean = False
|
||||
|
||||
@@ -5478,12 +5490,12 @@ Partial Class Inventarios_EntradasSalidas
|
||||
'VERIFICA SI TIENE ALMACEN VIRTUAL
|
||||
If CveAlmacenVirtual > 0 Then
|
||||
If ObjInventario.GetMovimientosDetalleVirtual(CveMovimiento, UsuarioActual.CveEmpresa) Then
|
||||
DtPSVirtual = ObjInventario.DtResultados
|
||||
End If
|
||||
DtPSVirtual = ObjInventario.DtResultados.Copy()
|
||||
|
||||
If DtPSVirtual IsNot Nothing AndAlso DtPSVirtual.Rows.Count > 0 Then
|
||||
|
||||
CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirtual, If(tOrigen > 0, 36, 37), 1, TxtFecha.Text.Replace(",", "").ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, CveMovimientoRelacionado:=CveMovimiento, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="ES/GV")
|
||||
If CveMovimientoVirtual > 0 Then
|
||||
FolioVirtual = ObjInventario.Folio
|
||||
|
||||
For Each RowUsado As DataRow In DtPSVirtual.Rows
|
||||
@@ -5497,8 +5509,13 @@ Partial Class Inventarios_EntradasSalidas
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
Else
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
If Not ErrorMovInv AndAlso CveMovimientoVirtual > 0 Then
|
||||
If Not ErrorMovInv Then
|
||||
Dim dttCosto As DataTable = Nothing
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoVirtual, UsuarioActual.CveEmpresa) Then
|
||||
|
||||
@@ -1283,7 +1283,7 @@ Partial Class PV
|
||||
End If
|
||||
DdlTipoDefecto.Width = New Unit(260%)
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(163) = "1" Then
|
||||
If UsuarioActual.Empresa.Funcionalidad(163) = "1" OrElse UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
|
||||
TrDescripcionVenta.Visible = True
|
||||
If CveVenta <= 0 Then
|
||||
TxtDescripcionVenta.Enabled = True
|
||||
@@ -1517,7 +1517,7 @@ Partial Class PV
|
||||
HdnFolioFiscalNC.Value = DbRowVenta("FolioFiscalPadre").ToString
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(163) = "1" Then
|
||||
If UsuarioActual.Empresa.Funcionalidad(163) = "1" OrElse UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
|
||||
TrDescripcionVenta.Visible = True
|
||||
TxtDescripcionVenta.Text = DbRowVenta("DescripcionVenta").ToString()
|
||||
End If
|
||||
|
||||
@@ -378,9 +378,9 @@
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkSolicitarCredito" Visible="false" runat="server"><i class="fa fa-plus"></i>Solicitar autorización de crédito</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<%-- <li>
|
||||
<asp:LinkButton ID="LnkCancelarSoloCFDI" Visible="false" runat="server" data-toggle="confirmation" data-popout="true" data-original-title="¿Seguro que desea cancelar el CFDI?" data-btn-ok-label="si" OnClick="LnkCancelarSoloCFDI_Click"><i class="fa fa-plus"></i>Cancelar solo CFDI</asp:LinkButton>
|
||||
</li>
|
||||
</li>--%>
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:AsyncPostBackTrigger ControlID="LnkImprimir" EventName="Click" />
|
||||
|
||||
@@ -12031,6 +12031,8 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
ObjFactura.DtMercancias = DtMercancias
|
||||
|
||||
ObjFactura.DtImpuestosLocales = TmpDTImpuestos
|
||||
End Sub
|
||||
|
||||
Private Sub CreaObjetosVentaDevolucion()
|
||||
@@ -13693,16 +13695,6 @@ Partial Class Ventas
|
||||
If Me.CveContratoTipo <> 33 Then
|
||||
GuardarVentaEstimaciones(ObjContr, factura)
|
||||
End If
|
||||
If ErrorList.Count = 0 Then
|
||||
'armonizaccionContable
|
||||
'GuardarVentaAC(ObjVentas, factura, Msgok)
|
||||
If ErrorList.Count = 0 Then
|
||||
'Impuestos Locales
|
||||
If GuardarVentaImpuestosLocales(ObjVentas, ObjConta, factura) Then
|
||||
ErrorList.Add("Ocurrio un error al Guardar Impuestos Locales")
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
@@ -14914,6 +14906,14 @@ Partial Class Ventas
|
||||
End If
|
||||
End If
|
||||
|
||||
'Impuestos Locales
|
||||
If Not ErrorPrepoliza Then
|
||||
If GuardarVentaImpuestosLocales(ObjVentas, ObjConta, ObjFactura, ValorMultiplicador:=ValorMultiplicador) Then
|
||||
ErrorPrepoliza = True
|
||||
ErrorList.Add("Ocurrio un error al Guardar Impuestos Locales")
|
||||
End If
|
||||
End If
|
||||
|
||||
If ObjConta.ValidacionesPrePoliza(ObjFactura.CvePrePoliza, UsuarioActual, Opcion:=2, AutoConta:=AutoConta) Then
|
||||
If ObjConta.ValorPolizaDescuadre > 0 Then
|
||||
If ObjConta.ValorPolizaDescuadre = 2 Then
|
||||
@@ -15293,14 +15293,14 @@ Partial Class Ventas
|
||||
Private Function GuardarVentaImpuestosLocales(ObjVentas As ClsVentas, ObjConta As ClsContabilidad, Factura As Modelos.Factura, Optional ValorMultiplicador As Integer = 1) As Boolean
|
||||
Dim ErrorPrepoliza As Boolean = False
|
||||
|
||||
If TmpDTImpuestos IsNot Nothing AndAlso Factura.CvePrePoliza > 0 AndAlso Not DdlTipoComprobante.SelectedValue.Contiene("Cot", "Rem") Then
|
||||
If Factura.DtImpuestosLocales IsNot Nothing AndAlso Factura.CvePrePoliza > 0 AndAlso Not Factura.TipoDocto.Contiene("Cot", "Rem") Then
|
||||
|
||||
Dim Importe As Decimal
|
||||
Dim Concepto As String
|
||||
Dim tipoCambio As Decimal
|
||||
Dim CveSubProyectoContabilizar As Integer = DdlSubProyectoDatos.SelectedValue.ToEntero()
|
||||
|
||||
For Each RowIL As DataRow In TmpDTImpuestos.Rows
|
||||
For Each RowIL As DataRow In Factura.DtImpuestosLocales.Rows
|
||||
If RowIL("TipoImpuesto").ToString().ToEntero() > 0 Then
|
||||
|
||||
Importe = RowIL("Importe").ToString().ToDecimal * ValorMultiplicador
|
||||
@@ -35740,32 +35740,32 @@ Partial Class Ventas
|
||||
|
||||
#End Region
|
||||
|
||||
Protected Sub LnkCancelarSoloCFDI_Click(sender As Object, e As EventArgs)
|
||||
If CveVenta > 0 Then
|
||||
Dim RowVenta As DataRow = Nothing
|
||||
'Protected Sub LnkCancelarSoloCFDI_Click(sender As Object, e As EventArgs)
|
||||
' If CveVenta > 0 Then
|
||||
' Dim RowVenta As DataRow = Nothing
|
||||
|
||||
Using ObjVentas As New ClsVentas
|
||||
If (ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa)) Then
|
||||
RowVenta = ObjVentas.DtResultados.Copy().Rows(0)
|
||||
End If
|
||||
End Using
|
||||
' Using ObjVentas As New ClsVentas
|
||||
' If (ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa)) Then
|
||||
' RowVenta = ObjVentas.DtResultados.Copy().Rows(0)
|
||||
' End If
|
||||
' End Using
|
||||
|
||||
If RowVenta IsNot Nothing Then
|
||||
Dim FolioFiscal As String = RowVenta("FolioFiscal").ToString().Trim()
|
||||
Dim Total As Decimal = RowVenta("Total").ToString().ToDecimal()
|
||||
Dim RFCReceptor As String = RowVenta("RFCReceptor").ToString()
|
||||
Dim ObjTimbrado As New Timbrado
|
||||
Dim resp = ObjTimbrado.CFDICancelar(UsuarioActual.Empresa, FolioFiscal, Total, RFCReceptor, UsuarioActual.Empresa.RFC, CvePACCancelacion:=4, ValidaFactura:=False, CveSATMotivoCancelacion:=2)
|
||||
If resp IsNot Nothing Then
|
||||
Alert(resp.Estado)
|
||||
End If
|
||||
' If RowVenta IsNot Nothing Then
|
||||
' Dim FolioFiscal As String = RowVenta("FolioFiscal").ToString().Trim()
|
||||
' Dim Total As Decimal = RowVenta("Total").ToString().ToDecimal()
|
||||
' Dim RFCReceptor As String = RowVenta("RFCReceptor").ToString()
|
||||
' Dim ObjTimbrado As New Timbrado
|
||||
' Dim resp = ObjTimbrado.CFDICancelar(UsuarioActual.Empresa, FolioFiscal, Total, RFCReceptor, UsuarioActual.Empresa.RFC, CvePACCancelacion:=4, ValidaFactura:=False, CveSATMotivoCancelacion:=2)
|
||||
' If resp IsNot Nothing Then
|
||||
' Alert(resp.Estado)
|
||||
' End If
|
||||
|
||||
End If
|
||||
End If
|
||||
' End If
|
||||
' End If
|
||||
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
'End Sub
|
||||
End Class
|
||||
|
||||
|
||||
Reference in New Issue
Block a user