Merge branch 'master' of http://jperez@adsistemasof.sytes.net:8383/SIG.git
This commit is contained in:
@@ -6230,7 +6230,7 @@ Public Class ClsContabilidad
|
||||
.Add("@Opcion", SqlDbType.Int).Value = Opcion
|
||||
.Add("@Valor", SqlDbType.Int).Direction = ParameterDirection.Output
|
||||
.Add("@MsgSalida", SqlDbType.VarChar, 100).Direction = ParameterDirection.Output
|
||||
.Add("@MsgPrePolizaSalida", SqlDbType.VarChar, 800).Direction = ParameterDirection.Output
|
||||
.Add("@MsgPrePolizaSalida", SqlDbType.VarChar, 8000).Direction = ParameterDirection.Output
|
||||
.Add("@Diferencia", SqlDbType.Float).Direction = ParameterDirection.Output
|
||||
End With
|
||||
|
||||
@@ -6366,8 +6366,10 @@ Public Class ClsContabilidad
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
Public Function UpdatePeriodosBloqueo(CveEmpresa As Integer, Ejercicio As Integer, Mes1 As Integer, Mes2 As Integer, Mes3 As Integer, Mes4 As Integer, Mes5 As Integer, Mes6 As Integer, Mes7 As Integer, Mes8 As Integer, Mes9 As Integer, Mes10 As Integer, Mes11 As Integer, Mes12 As Integer, CveUsuario As Integer) As Boolean
|
||||
Dim Retorno = False
|
||||
Public Function UpdatePeriodosBloqueo(CveEmpresa As Integer, Ejercicio As Integer, Mes1 As Boolean, Mes2 As Boolean, Mes3 As Boolean, Mes4 As Boolean, Mes5 As Boolean,
|
||||
Mes6 As Boolean, Mes7 As Boolean, Mes8 As Boolean, Mes9 As Boolean, Mes10 As Boolean, Mes11 As Boolean, Mes12 As Boolean,
|
||||
CveUsuario As Integer) As String
|
||||
Dim Retorno = ""
|
||||
|
||||
DataAdapter("PA_Conta_EmpresasBloqueoMesesUpdate")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
@@ -6386,16 +6388,19 @@ Public Class ClsContabilidad
|
||||
.Add("@Mes11", SqlDbType.Bit).Value = Mes11
|
||||
.Add("@Mes12", SqlDbType.Bit).Value = Mes12
|
||||
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||
.Add("@MensajeError", SqlDbType.VarChar, 500).Direction = ParameterDirection.Output
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Retorno = SqlAdapter.SelectCommand.Parameters("@MensajeError").Value.ToString
|
||||
Catch ex As Exception
|
||||
Me.OnError("Ocurrió un error al actualizar el Periodo de Bloqueo.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
Retorno = ""
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
|
||||
End Function
|
||||
Public Function RemovePeriodosBloqueo(CveEmpresa As Integer, Ejercicio As Integer) As Boolean
|
||||
Dim Retorno = False
|
||||
|
||||
@@ -1241,7 +1241,7 @@ Public Class ClsInventarios
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function GetMovimientosDetalleVirtual(CveMovimiento As Integer, CveEmpresa As Integer, Optional CveCompra As Integer = -1) As Boolean
|
||||
Public Function GetMovimientosDetalleVirtual(CveMovimiento As Integer, CveEmpresa As Integer, Optional CveCompra As Integer = -1, Optional CveMovimientoRelacionado As Integer = -1) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Inv_MovimientosDetalleVirtualGet")
|
||||
|
||||
@@ -1249,6 +1249,7 @@ Public Class ClsInventarios
|
||||
.Add("@CveMovimiento", SqlDbType.Int).Value = CveMovimiento
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
.Add("@CveCompra", SqlDbType.Int).Value = CveCompra
|
||||
.Add("@CveMovimientoRelacionado", SqlDbType.Int).Value = CveMovimientoRelacionado
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
|
||||
@@ -5266,7 +5266,7 @@ Public Class ClsPaginas
|
||||
|
||||
End If
|
||||
sw.Stop()
|
||||
If sw.Elapsed.TotalSeconds > 1 Then
|
||||
If sw.Elapsed.TotalSeconds > 5 Then
|
||||
GuardaLog($"Reporte:{RutaReporte} | Tiempo Renderizado Milisegundos: {sw.ElapsedMilliseconds},Total Segundos: {sw.Elapsed.TotalSeconds} ")
|
||||
End If
|
||||
|
||||
|
||||
@@ -1263,8 +1263,8 @@ Public Class Timbrado
|
||||
ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.Pais,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.CP)
|
||||
'RECEPTOR
|
||||
cfdi.agregarComercioExterior11Receptor(ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.NumRegIdTrib)
|
||||
cfdi.agregarComercioExterior11DomicilioReceptor(ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.Calle,
|
||||
cfdi.agregarComercioExterior11Receptor(ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.NumRegIdTrib,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.Calle,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.NumeroExterior,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.NumeroInterior,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.Colonia,
|
||||
|
||||
@@ -2090,54 +2090,82 @@ Partial Class Bancos_PopIEVentas
|
||||
IdCtaContable = UsuarioActual.Empresa.IdCuentaGananciaCambiaria
|
||||
CveCuenta = UsuarioActual.Empresa.CveCuentaGananciaCambiaria
|
||||
|
||||
Dim TCImpuestos As Decimal = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta)
|
||||
TimpocambioGeneral = TCImpuestos
|
||||
Dim tImporteVenta, tImportePago, Diferencia As Decimal
|
||||
ImporteMovimiento = 0
|
||||
|
||||
Dim Diferencia As Decimal = ((MovimientoPagar.Total * PorcentajePago) * tipoCambioVentaValuacion) - ((MovimientoPagar.Total * PorcentajePago) * tipoCambioPago) 'Añadimos la diferencia de perdida en la venta
|
||||
Diferencia -= ((MovimientoPagar.IVA * PorcentajePago) * tipoCambioVenta) - ((MovimientoPagar.IVA * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el IVA
|
||||
Diferencia += ((MovimientoPagar.RetIVA * PorcentajePago) * tipoCambioVenta) - ((MovimientoPagar.RetIVA * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el RetIVA
|
||||
Diferencia += ((MovimientoPagar.RetISR * PorcentajePago) * tipoCambioVenta) - ((MovimientoPagar.RetISR * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el RetISR
|
||||
Diferencia -= ((MovimientoPagar.IEPS * PorcentajePago) * tipoCambioVenta) - ((MovimientoPagar.IEPS * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el IEPS
|
||||
Diferencia = Math.Round(Diferencia, 2)
|
||||
If CveMonedaVenta = 1 And CveMoneda = 2 Then
|
||||
'factura pesos, pago en dolares
|
||||
tImporteVenta = ((MovimientoPagar.Total * PorcentajePago) * tipoCambioVenta).RoundSQL
|
||||
tImportePago = ((MovimientoPagar.Total * PorcentajePago) * tipoCambioVenta / tipoCambioPago).RoundSQL
|
||||
ElseIf CveMonedaVenta = 2 And CveMoneda = 2 Then
|
||||
'factura dolares, pago en dolares
|
||||
tImporteVenta = ((MovimientoPagar.Total * PorcentajePago) * tipoCambioVenta).RoundSQL
|
||||
tImportePago = ((MovimientoPagar.Total * PorcentajePago) * tipoCambioPago).RoundSQL
|
||||
ElseIf CveMonedaVenta = 2 And CveMoneda = 1 Then
|
||||
'factura dolares, pago en pesos
|
||||
tImporteVenta = ((MovimientoPagar.Total * PorcentajePago) * tipoCambioVenta).RoundSQL
|
||||
tImportePago = ((MovimientoPagar.Total * PorcentajePago) * tipoCambioPago).RoundSQL
|
||||
End If
|
||||
|
||||
If tImporteVenta <> tImportePago Then
|
||||
If tImporteVenta < tImportePago Then
|
||||
CveConcepto = 64
|
||||
Else
|
||||
CveConcepto = 65
|
||||
End If
|
||||
Diferencia = Math.Abs(tImporteVenta - tImportePago)
|
||||
End If
|
||||
|
||||
' si tiene funcionalidad para que tome el TC de pago, que solo afecta a los impuestos
|
||||
If FuncionalidadFluctuacionImpuestos Then
|
||||
Dim TCImpuestos As Decimal = tipoCambioPago
|
||||
TimpocambioGeneral = TCImpuestos
|
||||
|
||||
Diferencia -= ((MovimientoPagar.IVA * PorcentajePago) * tipoCambioVenta) - ((MovimientoPagar.IVA * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el IVA
|
||||
Diferencia += ((MovimientoPagar.RetIVA * PorcentajePago) * tipoCambioVenta) - ((MovimientoPagar.RetIVA * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el RetIVA
|
||||
Diferencia += ((MovimientoPagar.RetISR * PorcentajePago) * tipoCambioVenta) - ((MovimientoPagar.RetISR * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el RetISR
|
||||
Diferencia -= ((MovimientoPagar.IEPS * PorcentajePago) * tipoCambioVenta) - ((MovimientoPagar.IEPS * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el IEPS
|
||||
Diferencia = Math.Round(Diferencia, 2)
|
||||
End If
|
||||
|
||||
|
||||
'' se considera, las diferencias, y no el tipo de cambio, por el caso de las fluctuaciones
|
||||
|
||||
'' si tiene funcionalidad de flucturación con ivas, tomar tipocambioventa
|
||||
If Diferencia < 0 AndAlso CveMonedaVenta = 2 Then
|
||||
ImporteMovimiento = Math.Abs(Diferencia)
|
||||
ImporteMX = ImporteMovimiento
|
||||
End If
|
||||
'If Diferencia < 0 AndAlso CveMonedaVenta = 2 Then
|
||||
' ImporteMovimiento = Math.Abs(Diferencia)
|
||||
' ImporteMX = ImporteMovimiento
|
||||
'End If
|
||||
Else
|
||||
ImporteMovimiento = 0
|
||||
End If
|
||||
CveSubProyectoContabilizar = CveSubProyectoVenta
|
||||
|
||||
Case 65 'Perdida
|
||||
If CveMoneda <> 1 OrElse CveMonedaVenta <> 1 Then
|
||||
IdCtaContable = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria
|
||||
CveCuenta = UsuarioActual.Empresa.CveCuentaPerdidaCambiaria
|
||||
'Case 65 'Perdida
|
||||
' If CveMoneda <> 1 OrElse CveMonedaVenta <> 1 Then
|
||||
' IdCtaContable = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria
|
||||
' CveCuenta = UsuarioActual.Empresa.CveCuentaPerdidaCambiaria
|
||||
|
||||
Dim TCImpuestos As Decimal = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta)
|
||||
TimpocambioGeneral = TCImpuestos
|
||||
' Dim TCImpuestos As Decimal = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta)
|
||||
' TimpocambioGeneral = TCImpuestos
|
||||
|
||||
|
||||
Dim Diferencia As Decimal = ((MovimientoPagar.Total * PorcentajePago) * tipoCambioVentaValuacion) - ((MovimientoPagar.Total * PorcentajePago) * tipoCambioPago) 'Añadimos la diferencia de perdida en la venta
|
||||
Diferencia -= ((MovimientoPagar.IVA * PorcentajePago) * tipoCambioVenta) - ((MovimientoPagar.IVA * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el IVA
|
||||
Diferencia += ((MovimientoPagar.RetIVA * PorcentajePago) * tipoCambioVenta) - ((MovimientoPagar.RetIVA * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el RetIVA
|
||||
Diferencia += ((MovimientoPagar.RetISR * PorcentajePago) * tipoCambioVenta) - ((MovimientoPagar.RetISR * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el RetISR
|
||||
Diferencia -= ((MovimientoPagar.IEPS * PorcentajePago) * tipoCambioVenta) - ((MovimientoPagar.IEPS * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el IEPS
|
||||
Diferencia = Math.Round(Diferencia, 2)
|
||||
' Dim Diferencia As Decimal = ((MovimientoPagar.Total * PorcentajePago) * tipoCambioVentaValuacion) - ((MovimientoPagar.Total * PorcentajePago) * tipoCambioPago) 'Añadimos la diferencia de perdida en la venta
|
||||
' Diferencia -= ((MovimientoPagar.IVA * PorcentajePago) * tipoCambioVenta) - ((MovimientoPagar.IVA * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el IVA
|
||||
' Diferencia += ((MovimientoPagar.RetIVA * PorcentajePago) * tipoCambioVenta) - ((MovimientoPagar.RetIVA * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el RetIVA
|
||||
' Diferencia += ((MovimientoPagar.RetISR * PorcentajePago) * tipoCambioVenta) - ((MovimientoPagar.RetISR * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el RetISR
|
||||
' Diferencia -= ((MovimientoPagar.IEPS * PorcentajePago) * tipoCambioVenta) - ((MovimientoPagar.IEPS * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el IEPS
|
||||
' Diferencia = Math.Round(Diferencia, 2)
|
||||
|
||||
'si la diferencia es negativa es pérdida, si es positiva es ganancia
|
||||
If Diferencia > 0 AndAlso CveMonedaVenta = 2 Then
|
||||
ImporteMovimiento = Math.Abs(Diferencia)
|
||||
ImporteMX = ImporteMovimiento
|
||||
End If
|
||||
Else
|
||||
ImporteMovimiento = 0
|
||||
End If
|
||||
CveSubProyectoContabilizar = CveSubProyectoVenta
|
||||
' 'si la diferencia es negativa es pérdida, si es positiva es ganancia
|
||||
' If Diferencia > 0 AndAlso CveMonedaVenta = 2 Then
|
||||
' ImporteMovimiento = Math.Abs(Diferencia)
|
||||
' ImporteMX = ImporteMovimiento
|
||||
' End If
|
||||
' Else
|
||||
' ImporteMovimiento = 0
|
||||
' End If
|
||||
' CveSubProyectoContabilizar = CveSubProyectoVenta
|
||||
|
||||
Case 30
|
||||
If RBLContado.SelectedValue = "1" Then
|
||||
|
||||
BIN
Bin/RVCFDI33.dll
BIN
Bin/RVCFDI33.dll
Binary file not shown.
@@ -22,6 +22,10 @@
|
||||
<asp:LinkButton ID="LnkImprimirExcel" OnClick="LnkImprimirExcel_Click" runat="server"><i class="fa fa-file-excel-o"></i><span style="padding-left:5px;">Excel</span></asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:PostBackTrigger ControlID="LnkImprimir"/>
|
||||
<asp:PostBackTrigger ControlID="LnkImprimirExcel"/>
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
||||
|
||||
@@ -22,6 +22,10 @@
|
||||
<asp:LinkButton ID="LnkImprimirExcel" OnClick="LnkImprimirExcel_Click" runat="server"><i class="fa fa-file-excel-o"></i><span style="padding-left:5px;">Excel</span></asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:PostBackTrigger ControlID="LnkImprimir"/>
|
||||
<asp:PostBackTrigger ControlID="LnkImprimirExcel"/>
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
||||
|
||||
@@ -225,6 +225,6 @@ public partial class CRM_CatProbabilidadAcercamiento : ClsPaginas
|
||||
param.Add(new ReportParameter("UsuarioImprimio", UsuarioActual.Nombre));
|
||||
param.Add(new ReportParameter("FechaImpresion", DateTime.Today.ToString()));
|
||||
|
||||
ImprimirPDF("Empresas/Grales/Formatos/RepCatProbabilidadAcercamiento", TmpDT, param, "Report Cat Etapas Proceso", formato);
|
||||
ImprimirPDF("Empresas/Grales/Formatos/RepCatProbabilidadAcercamiento.rdlc", TmpDT, param, "Report Cat Etapas Proceso", formato);
|
||||
}
|
||||
}
|
||||
@@ -22,6 +22,10 @@
|
||||
<asp:LinkButton ID="LnkImprimirExcel" OnClick="LnkImprimirExcel_Click" runat="server"><i class="fa fa-file-excel-o"></i><span style="padding-left:5px;">Excel</span></asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:PostBackTrigger ControlID="LnkImprimir"/>
|
||||
<asp:PostBackTrigger ControlID="LnkImprimirExcel"/>
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
||||
|
||||
@@ -194,7 +194,7 @@ public partial class CRM_CatTipoProceso : ClsPaginas
|
||||
Imprimir("EXCEL");
|
||||
}
|
||||
|
||||
private void Imprimir(string formato)
|
||||
public void Imprimir(string formato)
|
||||
{
|
||||
System.IO.FileInfo Image = new System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta));
|
||||
string logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa);
|
||||
|
||||
@@ -4335,7 +4335,7 @@ Partial Class Compras_Compras
|
||||
Try
|
||||
Dim FolioFijo As Integer = 0
|
||||
'cheque
|
||||
If DdlTipoTransaccion.SelectedValue = "1" Then FolioFijo = TxtFolio.Text.ToEntero
|
||||
If DdlTipoTransaccion.SelectedValue = "1" AndAlso UsuarioActual.CveEmpresa <> 119 Then FolioFijo = TxtFolio.Text.ToEntero
|
||||
|
||||
CvePrePoliza = ObjConta.AddPrePolizas("Compras/Registrar", If(EsContado And CvePlantillaPrePoliza = 1, 2, CvePlantillaPrePoliza), ImporteCompra, TxtTotal.Text.ToDouble, DdlMoneda.SelectedValue.ToEntero, TxtFecha.Text.ToDate, ConceptoPoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo:=FolioFijo, ReglaFolioPoliza:=ObjCompras.ObtenerReglaFolio(DdlTipoTransaccion.SelectedValue, DdlTipoTransaccionCaja.SelectedValue, UsuarioActual.CveEmpresa), CveTipoPoliza:=ObjConta.ObtenerTipoPoliza(DdlTipoTransaccion.SelectedValue, DdlTipoTransaccionCaja.SelectedValue, UsuarioActual.CveEmpresa))
|
||||
|
||||
@@ -4471,6 +4471,8 @@ Partial Class Compras_Compras
|
||||
'End If
|
||||
|
||||
End If
|
||||
'si el registro es manual, toma el mismo dato
|
||||
If CveFactura <= 0 Then TotalOriginal = TxtTotal.Text.ToDecimal
|
||||
|
||||
'Compra
|
||||
If ObjCompras.AddCompra(DdlTipoComprobante.SelectedValue, TxtDescripcion.Text.Trim, TxtSerie.Text.Trim, TxtFolio.Text.Trim, TxtFolioSecundario.Text.Trim, CveProveedor, TxtSubTotal.Text.ToDouble, TxtDescuento.Text.ToDouble,
|
||||
@@ -6305,7 +6307,7 @@ Partial Class Compras_Compras
|
||||
Case 6 'Compra
|
||||
|
||||
Dim AgregaMercanciaInventario As Boolean = UsuarioActual.CveEmpresa.Contiene(1, 72, 80, 119, 140, 141) AndAlso UsuarioActual.Empresa.UsaInventarios AndAlso Not UsuarioActual.Empresa.Funcionalidad(126) = "1"
|
||||
Dim RegistraConcepto225 As Boolean = UsuarioActual.Empresa.UsaInventarios AndAlso DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV") AndAlso Not UsuarioActual.Empresa.Funcionalidad(126) = "1"
|
||||
Dim RegistraConcepto225 As Boolean = UsuarioActual.Empresa.UsaInventarios AndAlso DdlTipoComprobante.SelectedValue.Contiene("DEV") AndAlso Not UsuarioActual.Empresa.Funcionalidad(126) = "1"
|
||||
|
||||
If RBLPago.SelectedValue.ToEntero = 4 Then
|
||||
Exit Select 'Es credito el concepto 6 se agrega en CASE 17
|
||||
@@ -6643,18 +6645,22 @@ Partial Class Compras_Compras
|
||||
importeMN = importeMovimiento * tipoCambioActual * Multiplicador '[IPP] EL 6 DEBE SER POSITIVO 27/AGOSTO/2018
|
||||
|
||||
'CLASIFICACION
|
||||
If Row2("CveClasificacion").ToString.ToEntero > 0 Then
|
||||
If Row2("CveClasificacion").ToString.ToEntero > 0 AndAlso DdlTipoComprobante.SelectedValue = "FAC" Then
|
||||
|
||||
If ObjConta.GetRetCuenta(6, Row2("CveClasificacion").ToString.ToEntero, CveSubProyecto:=Row2("CveSubProyecto").ToString.ToEntero) Then
|
||||
If ObjConta.DtResultados.Rows.Count > 0 AndAlso ObjConta.DtResultados.Rows(0)("IdCuentaGasto").ToString.ToEntero > 0 Then
|
||||
IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaGasto").ToString.ToEntero
|
||||
CveCuenta = ObjConta.DtResultados.Rows(0)("IdCuentaGastoSIG").ToString.ToEntero
|
||||
' CveCuenta = ObjConta.DtResultados.Rows(0)("IdCuentaGastoSIG").ToString.ToEntero
|
||||
Else
|
||||
IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaGasto", String.Format("CveClasificacion = {0}", Row2("CveClasificacion"))).ToString.ToEntero
|
||||
CveCuenta = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", String.Format("CveClasificacion = {0}", Row2("CveClasificacion"))).ToString.ToEntero
|
||||
' CveCuenta = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", String.Format("CveClasificacion = {0}", Row2("CveClasificacion"))).ToString.ToEntero
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
'SEGMENTO DE NEGOCIO
|
||||
Dim IdSegmentoNegocio As Integer = -1
|
||||
Dim drT As DataRow = GlobalDTSubProyectos(-1, CveSubProyecto:=Row2("CveSubProyecto").ToString.ToEntero).FiltroPrimero(String.Format("CveSubProyecto = {0} ", Row2("CveSubProyecto").ToString.ToEntero))
|
||||
@@ -6684,6 +6690,11 @@ Partial Class Compras_Compras
|
||||
If DdlMoneda.SelectedValue = "2" Then
|
||||
tidctacon = ViewState("CtaProveedorAnticiposExtranjera").ToString.ToEntero
|
||||
End If
|
||||
|
||||
ElseIf DdlTipoComprobante.SelectedValue = "NC" Then
|
||||
tcvecon = 259
|
||||
tidctacon = UsuarioActual.Empresa.Funcionalidad(405).ToEntero
|
||||
|
||||
End If
|
||||
|
||||
Dim usacomplementariaProveedor As Boolean = False
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
|
||||
|
||||
Partial Class Contabilidad_CatPeriodosBloqueo
|
||||
Inherits ClsPaginas
|
||||
|
||||
@@ -129,8 +128,8 @@ Partial Class Contabilidad_CatPeriodosBloqueo
|
||||
Alert("Ocurrió un error al guardar el Periodo de Bloqueo", TipoMensaje.MsgError)
|
||||
End If
|
||||
Else
|
||||
|
||||
If ObjConta.UpdatePeriodosBloqueo(UsuarioActual.CveEmpresa, TxtEjercicio.Text, ChkM1.Checked, ChkM2.Checked, ChkM3.Checked, ChkM4.Checked, ChkM5.Checked, ChkM6.Checked, ChkM7.Checked, ChkM8.Checked, ChkM9.Checked, ChkM10.Checked, ChkM11.Checked, ChkM12.Checked, UsuarioActual.CveUsuario) Then
|
||||
Dim AplicarBloqueso As String = ObjConta.UpdatePeriodosBloqueo(UsuarioActual.CveEmpresa, TxtEjercicio.Text, ChkM1.Checked, ChkM2.Checked, ChkM3.Checked, ChkM4.Checked, ChkM5.Checked, ChkM6.Checked, ChkM7.Checked, ChkM8.Checked, ChkM9.Checked, ChkM10.Checked, ChkM11.Checked, ChkM12.Checked, UsuarioActual.CveUsuario)
|
||||
If AplicarBloqueso.Length = 0 Then
|
||||
|
||||
CargadatosGvPeriodosBloqueo()
|
||||
UpModalPeriodosBloqueo.Update()
|
||||
@@ -140,7 +139,8 @@ Partial Class Contabilidad_CatPeriodosBloqueo
|
||||
UpGral.Update()
|
||||
Alert("Bloqueo Actualizado Correctamente", TipoMensaje.MsgInformacion)
|
||||
Else
|
||||
Alert("Ocurrió un error al Actualizar el Periodo de Bloqueo", TipoMensaje.MsgError)
|
||||
Dim mensajeAlerta As String = AplicarBloqueso.Replace(";", Environment.NewLine)
|
||||
Alert("Ocurrió un error al Actualizar el Periodo de Bloqueo " & Environment.NewLine & mensajeAlerta, TipoMensaje.MsgError)
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
@@ -412,6 +412,10 @@ public partial class Contabilidad_ContabilizacionVentas : ClsPaginas
|
||||
|
||||
if (ObjMov.PrePolizaSimplificacion(CvePrePoliza, UsuarioActual.CveEmpresa))
|
||||
{
|
||||
if (ObjMov.ValidacionPrePolizaCuadre(CvePrePoliza,5))// por default manda la opcion 5, para ajustar a fluctuacion
|
||||
{
|
||||
|
||||
}
|
||||
Alert("Se ha simplificado la poliza correctamente", ModExtensiones.TipoMensaje.MsgInformacion);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -158,6 +158,15 @@ Partial Class ContabilidadC_RegPrePoliza
|
||||
ViewState("IndiceGrid") = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property IdPoliza As Integer
|
||||
Get
|
||||
Return CType(ViewState("IdPoliza"), Integer)
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("IdPoliza") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
@@ -174,6 +183,7 @@ Partial Class ContabilidadC_RegPrePoliza
|
||||
Observaciones = "-1"
|
||||
Beneficiario = "-1"
|
||||
Actualizar = False
|
||||
IdPoliza = -1
|
||||
|
||||
If IfNull(Request("Tipo"), "").ToString = "NOMPROV" Then
|
||||
DivTipoGasto.Visible = True
|
||||
@@ -388,9 +398,15 @@ Partial Class ContabilidadC_RegPrePoliza
|
||||
LnkComplementoPago.Visible = True
|
||||
End If
|
||||
|
||||
IdPoliza = dr("IdPoliza").ToString.ToEntero
|
||||
If dr("IdPoliza").ToString.ToEntero > 0 Then
|
||||
HplContabilizada.NavigateUrl = String.Format("RegPoliza.aspx?IdPoliza={0}", dr("IdPoliza"))
|
||||
divContabilziada.Visible = True
|
||||
BtnEliminar.Visible = False
|
||||
If UsuarioActual.CveUsuario = 100 Then
|
||||
BtnContabilizar.Visible = True
|
||||
BtnContabilizar.Text = "Actualizar Poliza"
|
||||
End If
|
||||
ElseIf TxtTotalCargos.Text.ToDouble = TxtTotalAbonos.Text.ToDouble Then
|
||||
'sino está contabilizada, se activa el botón
|
||||
BtnContabilizar.Visible = True
|
||||
@@ -1622,7 +1638,11 @@ Partial Class ContabilidadC_RegPrePoliza
|
||||
|
||||
Dim ObjConta As New ClsContabilidad
|
||||
|
||||
If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then
|
||||
If IdPoliza > 0 Then 'si está bloqueada, lo desbloqueaprimero
|
||||
ObjConta.UpdatePrePolizasDetalleBloquear(CvePrePoliza, False)
|
||||
End If
|
||||
|
||||
If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, pIDPoliza:=If(IdPoliza > 0, IdPoliza, -1), Concepto:=TxtConcepto.Text, Fecha:=TxtFechaDocumento.Text.ToDateTime) Then
|
||||
Alert(String.Format("Prepóliza contabilizada. <br/><br/>Folio:<a Class=""Texto"" target='_blank' href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">Ver Póliza</a>", ObjConta.ContaIdPoliza), ModExtensiones.TipoMensaje.MsgInformacion)
|
||||
Else
|
||||
|
||||
|
||||
1181
Empresas/140/Formatos/RepUsadosEntradas.rdlc
Normal file
1181
Empresas/140/Formatos/RepUsadosEntradas.rdlc
Normal file
File diff suppressed because it is too large
Load Diff
@@ -464,7 +464,7 @@ Partial Class Inventarios_RecepcionEntrega
|
||||
|
||||
GVPendientes.DataBind()
|
||||
UpPendientes.Update()
|
||||
DtPendientes.Dispose()
|
||||
If DtPendientes IsNot Nothing Then DtPendientes.Dispose()
|
||||
|
||||
End Sub
|
||||
Protected Sub GVPendientes_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GVPendientes.RowDataBound
|
||||
@@ -632,10 +632,7 @@ Partial Class Inventarios_RecepcionEntrega
|
||||
DdlAlmacen.SelectedValueExist(CveAlmacenTraspasoOrigen)
|
||||
End If
|
||||
|
||||
DtDatos.Columns.Add("AplicaSeccion", GetType(Boolean))
|
||||
DtDatos.Columns.Add("AplicaSerie", GetType(Boolean))
|
||||
DtDatos.Columns.Add("AplicaLote", GetType(Boolean))
|
||||
DtDatos.Columns.Add("AplicaCaducidad", GetType(Boolean))
|
||||
|
||||
If Not DtDatos.Columns.Contains("Lote") Then
|
||||
DtDatos.Columns.Add("Lote", GetType(String))
|
||||
End If
|
||||
@@ -1749,7 +1746,7 @@ Partial Class Inventarios_RecepcionEntrega
|
||||
For Each Dr As DataRow In DtDatos.Rows
|
||||
If Dr("CantidadGV").ToString.ToDecimal > 0 Then
|
||||
|
||||
If CBool(Dr("AplicaSeccion")) Then
|
||||
If CBool(Dr("AplicaSerieLote")) Then
|
||||
|
||||
DtDetalle = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", Dr("Consec")))
|
||||
For Each Dr1 As DataRow In DtDetalle.Rows
|
||||
@@ -1882,7 +1879,12 @@ Partial Class Inventarios_RecepcionEntrega
|
||||
|
||||
CantidadPendiente = If(Dr1("ExistenciaFinal").ToString.ToDecimal > CantidadSaldo, CantidadSaldo, Dr1("ExistenciaFinal").ToString.ToDecimal)
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, CantidadPendiente.ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, 0, -1, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("Caducidad").ToString.ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1"), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString.ToEntero, -1)) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, CantidadPendiente.ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, 0, -1,
|
||||
SerieLote:=Dr("SerieLote").ToString,
|
||||
CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero,
|
||||
FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("Caducidad").ToString.ToDate, MinFecha),
|
||||
Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1"),
|
||||
CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString.ToEntero, -1)) Then
|
||||
ErrorMovInv = True
|
||||
TextoError = "Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar."
|
||||
Exit For
|
||||
@@ -1894,7 +1896,8 @@ Partial Class Inventarios_RecepcionEntrega
|
||||
Next
|
||||
|
||||
If ErrorMovInv Then Exit For
|
||||
|
||||
Else
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
@@ -1038,7 +1038,7 @@ Partial Class Inventarios_RecepcionUsados
|
||||
|
||||
Dim GenerarRNC As Boolean = False
|
||||
'SI ES DISTRIBUIDOR Y NO VIENE DE REMISION, GENERA UNA REMISION DE NOTA DE CREDITO
|
||||
If EsDistribuidor AndAlso Me.CveRemisionRecibida <= 0 Then
|
||||
If Me.CveRemisionRecibida <= 0 Then 'EsDistribuidor AndAlso , comentado, 2020.04.21 RMF
|
||||
GenerarRNC = True
|
||||
Dim CveCliente As Integer = DdlClientes.SelectedValue.ToEntero()
|
||||
Dim CveSubProyecto = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen={DdlAlmacen.SelectedValue}").ToEntero
|
||||
@@ -1162,7 +1162,7 @@ Partial Class Inventarios_RecepcionUsados
|
||||
If Not ErrorMovInv Then
|
||||
|
||||
|
||||
Msg.AppendFormat("<br/>El Movimiento se registro con el Folio: <b>{0}</b>", ObjInventario.Folio)
|
||||
Msg.AppendFormat("<br/>El Movimiento se registro con el Folio: <b><a href='Inventarios/EntradasSalidas.aspx?CveMovimiento={1}'>{0}</a></b>", ObjInventario.Folio, CveMovimiento)
|
||||
Msg.AppendFormat("<br/><br/> <a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir Movimiento</a> ", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimiento)))
|
||||
|
||||
If IDPoliza > 0 Then Msg = Msg.AppendFormat("<br/><br/> <a class=""Texto"" target='_blank' href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">Ver Póliza</a>", IDPoliza)
|
||||
|
||||
@@ -370,10 +370,10 @@
|
||||
<th width="25px">#</th>
|
||||
<th width="100px">Cantidad</th>
|
||||
<th width="90px">Unidad</th>
|
||||
<th width="500px">Clasificación
|
||||
<th width="500px">Clasificación
|
||||
|
||||
<br />
|
||||
Producto
|
||||
Producto
|
||||
</th>
|
||||
<th width="100px">Observaciones</th>
|
||||
<th style="width: 88px" runat="server" id="ThSerieLote" visible="false">Serie - Lote </th>
|
||||
@@ -499,27 +499,27 @@
|
||||
</div>
|
||||
<div class="titlefiltros caption ">
|
||||
<ul class="list-inline" style="font-size: 12px;">
|
||||
<li>Almacén Recibe:
|
||||
<li>Almacén Recibe:
|
||||
|
||||
<asp:DropDownList ID="DdlAlmacenRecepcion" runat="server" DataTextField="Almacen" DataValueField="CveAlmacen" CssClass="form-control input-sm select2me" Style="width: 150px !important;" ValidationGroup="GrpCargaTransitorios"></asp:DropDownList>
|
||||
<%--<asp:RequiredFieldValidator ID="RFVAlmacenRecepcion" runat="server" ControlToValidate="DdlAlmacenRecepcion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Almacen Recibe''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpCargaTransitorios"></asp:RequiredFieldValidator>--%>
|
||||
<%--<ajax:ValidatorCalloutExtender ID="VCEAlmacenRecepcion" runat="server" HighlightCssClass="vco" TargetControlID="RFVAlmacenRecepcion" Width="350px"></ajax:ValidatorCalloutExtender>--%>
|
||||
<%--<ajax:ValidatorCalloutExtender ID="VCEAlmacenRecepcion" runat="server" HighlightCssClass="vco" TargetControlID="RFVAlmacenRecepcion" Width="350px"></ajax:ValidatorCalloutExtender>--%>
|
||||
</li>
|
||||
<li>Almacén Transitorio:
|
||||
<li>Almacén Transitorio:
|
||||
|
||||
<asp:DropDownList ID="DdlAlmacenTransitorioRecepcion" runat="server" DataTextField="Almacen" DataValueField="CveAlmacen" CssClass="form-control input-sm select2me" Style="width: 150px !important;" ValidationGroup="GrpCargaTransitorios"></asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVAlmacenTransitorioRecepcion" runat="server" ControlToValidate="DdlAlmacenTransitorioRecepcion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Almacen Transitorio''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpCargaTransitorios"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEAlmacenTransitorioRecepcion" runat="server" HighlightCssClass="vco" TargetControlID="RFVAlmacenTransitorioRecepcion" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</li>
|
||||
<li>Folio:
|
||||
<li>Folio:
|
||||
|
||||
<asp:TextBox ID="TxtFolioRecepcion" runat="server" Width="70px"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="SoloNumeros2" runat="server" TargetControlID="TxtFolioRecepcion" FilterType="Numbers" />
|
||||
</li>
|
||||
<%--<li>Transportista/Responsable:
|
||||
<asp:DropDownList ID="DdlResponsableRecepcion" runat="server" DataTextField="Nombre" DataValueField="CveUsuario" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 200px !important;"></asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVResponsableRecepcion" runat="server" ControlToValidate="DdlResponsableRecepcion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Almacen Transitorio''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpCargaTransitorios"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEResponsableRecepcion" runat="server" HighlightCssClass="vco" TargetControlID="RFVResponsableRecepcion" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<%--<li>Transportista/Responsable:
|
||||
<asp:DropDownList ID="DdlResponsableRecepcion" runat="server" DataTextField="Nombre" DataValueField="CveUsuario" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 200px !important;"></asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVResponsableRecepcion" runat="server" ControlToValidate="DdlResponsableRecepcion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Almacen Transitorio''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpCargaTransitorios"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEResponsableRecepcion" runat="server" HighlightCssClass="vco" TargetControlID="RFVResponsableRecepcion" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</li>--%>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -587,7 +587,7 @@
|
||||
<div style="text-align: center;" class="col-sm-12">
|
||||
<asp:UpdatePanel runat="server">
|
||||
<ContentTemplate>
|
||||
<asp:Button ID="BtnRecibir" runat="server" Text="Recibir Traspaso" OnClick="BtnRecibir_Click" class="btn btn-primary" ValidationGroup="GrpRecibir" />
|
||||
<asp:Button ID="BtnRecibir" runat="server" Text="Recibir Traspaso" OnClick="BtnRecibir_Click" class="btn btn-primary" ValidationGroup="GrpRecibir" />
|
||||
|
||||
<asp:Button ID="BtnCancelarTraspaso" runat="server" Text="Cancelar Traspaso" OnClick="BtnCancelarTraspaso_Click" class="btn btn-danger" Visible="false" ValidationGroup="GrpRecibir" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea cancelar el traspaso?" data-btn-ok-label="si" />
|
||||
</ContentTemplate>
|
||||
@@ -634,8 +634,8 @@
|
||||
<asp:GridView ID="GvDatosRecepcion" DataKeyNames="CveMovimiento,CveUM,CvePS,PS,CveAF,CodigoBarras,CveAlmacen,CveAlmacenDestino,AplicaSerieLote,CveMovimientoDetalle,PU,CveAlmacenSalida,CveMovimientoSalida,SerieLote,Lote,Batch,Cantidad, GastoIndirectoSalida, Importe,Codigo" runat="server" AutoGenerateColumns="False" EmptyDataText="No hay movimientos pendientes" ToolTip="Listado de Movimientos" CssClass="table table-hover Widthall" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center">
|
||||
<%--<HeaderTemplate>
|
||||
<input type="checkbox" id="ChkAll" onclick="CheckAll();" />
|
||||
<%--<HeaderTemplate>
|
||||
<input type="checkbox" id="ChkAll" onclick="CheckAll();" />
|
||||
</HeaderTemplate>--%>
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox ID="Chk" Checked="true" runat="server"></asp:CheckBox>
|
||||
@@ -699,18 +699,18 @@
|
||||
<div class="row">
|
||||
<div class="col-xs-4">
|
||||
Con copia para:<br />
|
||||
(Separar con: ;)
|
||||
(Separar con: ;)
|
||||
|
||||
</div>
|
||||
<div class="col-xs-8">
|
||||
<asp:TextBox ID="TxtCC" runat="server" TextMode="MultiLine" Columns="3" Rows="3" CssClass="form-control"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
<%--<div class="row">
|
||||
<div class="col-xs-4">Texto Adicional:</div>
|
||||
<div class="col-xs-8">
|
||||
<asp:TextBox ID="TxtAdicional" runat="server" TextMode="MultiLine" Columns="3" Rows="3" CssClass="form-control"></asp:TextBox>
|
||||
</div>
|
||||
<%--<div class="row">
|
||||
<div class="col-xs-4">Texto Adicional:</div>
|
||||
<div class="col-xs-8">
|
||||
<asp:TextBox ID="TxtAdicional" runat="server" TextMode="MultiLine" Columns="3" Rows="3" CssClass="form-control"></asp:TextBox>
|
||||
</div>
|
||||
</div>--%>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
@@ -876,87 +876,87 @@
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
|
||||
<script type="text/javascript" language="javascript">
|
||||
|
||||
<script type="text/javascript" language="javascript">
|
||||
|
||||
function ValidaCantidad(input, valorInicial) {
|
||||
var ValorActual = input.value;
|
||||
if (ValorActual > valorInicial) {
|
||||
//alert("El valor no puede ser mayor a la cantidad inicial: " + valorInicial);
|
||||
var ValorActual = input.value;
|
||||
if (ValorActual > valorInicial) {
|
||||
//alert("El valor no puede ser mayor a la cantidad inicial: " + valorInicial);
|
||||
input.value = valorInicial;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function ImprimirTraslado(clave) {
|
||||
$get('BtnImprimirTraspaso').click();
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function Focus() {
|
||||
$('#TxtCodigoPS').focus()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function Focus1() {
|
||||
$('#TxtCodigoPSRecepcion').focus()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function Focus2() {
|
||||
$('#TxtSeriePSRecepcion').focus()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function playsonidito(NomArchivo) {
|
||||
var URL = /Sonidos/ + NomArchivo
|
||||
var snd = new Audio(URL);
|
||||
snd.play();
|
||||
var URL = /Sonidos/ + NomArchivo
|
||||
var snd = new Audio(URL);
|
||||
snd.play();
|
||||
snd.currentTime = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//EXISTENCIAS ALMACEN
|
||||
$('.DdlPS').on("select2:open", function (e) { $('.select2-container.select2-container--default .select2-dropdown .select2anothertable').remove(); });
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//EXISTENCIAS ALMACEN
|
||||
$('.DdlPS').on("select2:open", function (e) { $('.select2-container.select2-container--default .select2-dropdown .select2anothertable').remove(); });
|
||||
$("body").on("mouseenter", ".select2-container.select2-container--default.select2-container--open .select2-dropdown li", function (event) {
|
||||
var $this = $(this);
|
||||
var ind = $this.index();
|
||||
$(".select2-container.select2-container--default.select2-container--open .select2-dropdown .select2anothertable tr.active").removeClass('active');
|
||||
$(".select2-container.select2-container--default.select2-container--open .select2-dropdown .select2anothertable tr:nth-child(" + (ind + 2) + ")").addClass('active');
|
||||
//log($this);
|
||||
});
|
||||
var $this = $(this);
|
||||
var ind = $this.index();
|
||||
$(".select2-container.select2-container--default.select2-container--open .select2-dropdown .select2anothertable tr.active").removeClass('active');
|
||||
$(".select2-container.select2-container--default.select2-container--open .select2-dropdown .select2anothertable tr:nth-child(" + (ind + 2) + ")").addClass('active');
|
||||
//log($this);
|
||||
});
|
||||
var scrollfuncion = function () {
|
||||
var stop = this.scrollTop;
|
||||
var stop = this.scrollTop;
|
||||
$(".select2-container.select2-container--default.select2-container--open .select2-dropdown .select2anothertable").scrollTop(stop);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function CargaExistenciaAlmacenes(data, params) {
|
||||
var div = $('<div class="select2anothertable"></div>');
|
||||
$('.select2-container.select2-container--default.select2-container--open .select2-dropdown .select2anothertable').remove();
|
||||
$('.select2-container.select2-container--default.select2-container--open .select2-dropdown').prepend(div);
|
||||
var table = $('<table></table>'); div.append(table);
|
||||
var tbody = $('<tbody></tbody>'); table.append(tbody);
|
||||
$(".select2-container--default .select2-results>.select2-results__options").off("scroll", scrollfuncion);
|
||||
$(".select2-container--default .select2-results>.select2-results__options").scroll(scrollfuncion);
|
||||
var indexd = 0;
|
||||
var div = $('<div class="select2anothertable"></div>');
|
||||
$('.select2-container.select2-container--default.select2-container--open .select2-dropdown .select2anothertable').remove();
|
||||
$('.select2-container.select2-container--default.select2-container--open .select2-dropdown').prepend(div);
|
||||
var table = $('<table></table>'); div.append(table);
|
||||
var tbody = $('<tbody></tbody>'); table.append(tbody);
|
||||
$(".select2-container--default .select2-results>.select2-results__options").off("scroll", scrollfuncion);
|
||||
$(".select2-container--default .select2-results>.select2-results__options").scroll(scrollfuncion);
|
||||
var indexd = 0;
|
||||
data.forEach(function (item) {
|
||||
if (indexd == 0) {
|
||||
var tr = $('<tr></tr>'); tbody.append(tr);
|
||||
var td;
|
||||
var tr = $('<tr></tr>'); tbody.append(tr);
|
||||
var td;
|
||||
for (var key in item) {
|
||||
if (!(key == "text" || key == "id")) { td = $('<td style="font-weight:bold;">' + key + '</td>'); tr.append(td); }
|
||||
}
|
||||
}
|
||||
var tr = $('<tr></tr>'); tbody.append(tr);
|
||||
|
||||
var td;
|
||||
}
|
||||
var tr = $('<tr></tr>'); tbody.append(tr);
|
||||
|
||||
var td;
|
||||
for (var key in item) {
|
||||
if (!(key == "text" || key == "id")) { td = $('<td ' + ((item[key] > 0) ? 'style = "font-weight:bold;"' : '') + '>' + item[key] + '</td>'); tr.append(td); }
|
||||
}
|
||||
}
|
||||
indexd += 1;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
</asp:Content>
|
||||
|
||||
@@ -369,7 +369,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
|
||||
'Llena Almacen Destino, todos los almacenes destino,
|
||||
|
||||
DdlAlmacenDestino.DataSource = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros("CveTipoAlmacen NOT IN (3,4,9,10,11) AND Estatus = 'Activo'")
|
||||
DdlAlmacenDestino.DataSource = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros("CveTipoAlmacen NOT IN (3,4,9,10,11,24) AND Estatus = 'Activo'")
|
||||
'DdlAlmacenDestino.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen <> 4")
|
||||
DdlAlmacenDestino.DataBind()
|
||||
DdlAlmacenDestino.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
@@ -380,7 +380,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
DdlAlmacenTransitorio.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
|
||||
'Llena Almacen Recepcion
|
||||
DdlAlmacenRecepcion.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen NOT IN (3,4,9,10,11)")
|
||||
DdlAlmacenRecepcion.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen NOT IN (3,4,9,10,11,24)")
|
||||
DdlAlmacenRecepcion.DataBind()
|
||||
DdlAlmacenRecepcion.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
@@ -440,7 +440,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
Private Sub CargaAlmacenOrigen()
|
||||
DdlAlmacenOrigen.Enabled = True
|
||||
DdlAlmacenOrigen.Items.Clear()
|
||||
DdlAlmacenOrigen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen NOT IN (3,4,9,10,11,21)")
|
||||
DdlAlmacenOrigen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen NOT IN (3,4,9,10,11,24)")
|
||||
DdlAlmacenOrigen.Items.Insert(0, New ListItem(" Seleccione ", "-1"))
|
||||
DdlAlmacenOrigen.SelectedValue = "-1"
|
||||
DdlAlmacenOrigen.DataBind()
|
||||
@@ -1517,6 +1517,8 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
Dim ErrorMovInv As Boolean = False
|
||||
Dim TextoError As String = ""
|
||||
Dim Fecha As Date = TxtFechaRecepcion.Text.ToDate
|
||||
Dim CveMovimientoVirtualEntrada As Integer = 0
|
||||
Dim FolioVirtualEntrada As Integer = 0
|
||||
|
||||
Dim ObjInventario As New ClsInventarios
|
||||
Dim ObjConta As New ClsContabilidad(ObjInventario.IniciaTransacSQL())
|
||||
@@ -1598,6 +1600,43 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
' TextoError = "Ocurrió un error al obtener los movimientos de salida"
|
||||
'End If
|
||||
|
||||
'VIRTUAL ENTRADA
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then
|
||||
Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen= {GvDatosRecepcion.Rows(0).DataKey("CveAlmacenSalida").ToEntero}").ToEntero()
|
||||
|
||||
Dim CveAlmacenVirtual As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $" CveTipoAlmacen =24 AND CveSubProyecto={CveSubProyecto}").ToEntero()
|
||||
|
||||
If CveAlmacenVirtual > 0 Then
|
||||
|
||||
CveMovimientoVirtualEntrada = ObjInventario.AddMovimiento(CveAlmacenVirtual, 36, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservacionesRecepcion.Text.Trim, CveMovimientoRelacionado:=CveMovimientoEntrada, Modulo:="TA/C2")
|
||||
FolioVirtualEntrada = ObjInventario.Folio
|
||||
Dim dtvirtual As DataTable = Nothing
|
||||
|
||||
If CveMovimientoVirtualEntrada > 0 AndAlso ObjInventario.GetMovimientosDetalleVirtual(CveMovimientoEntrada, UsuarioActual.CveEmpresa, CveMovimientoRelacionado:=CveMovimientoSalida) Then
|
||||
dtvirtual = ObjInventario.DtResultados
|
||||
For Each RowVirtual As DataRow In dtvirtual.Rows
|
||||
Dim CvePS = RowVirtual("CvePS").ToString().ToEntero()
|
||||
Dim CantidadUsado As Decimal = RowVirtual("Cantidad").ToString().ToDecimal()
|
||||
Dim PU As Decimal = RowVirtual("PUOriginal").ToString().ToDecimal()
|
||||
Dim CveUM As Integer = RowVirtual("CveUM").ToString().ToEntero()
|
||||
Dim CostoIndirecto As Decimal = RowVirtual("CostoIndirecto").ToString().ToDecimal()
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtualEntrada, CantidadUsado, CveUM, CvePS, PU, -1, CostoIndirecto:=CostoIndirecto, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
|
||||
ErrorMovInv = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
Else
|
||||
TextoError = "No se pudo registrar el movimiento virtual"
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
Else
|
||||
TextoError = "La Sucursal no tiene creado un almacen virtual"
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
End If
|
||||
|
||||
If Not ErrorMovInv Then
|
||||
Dim ImporteDecimal As Decimal = importe.ToDecimal.RoundSQL
|
||||
Dim IdCtaContable As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenTransitorioRecepcion.SelectedValue.ToEntero)).ToEntero
|
||||
@@ -1633,6 +1672,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
Dim Mensaje As StringBuilder = New StringBuilder
|
||||
Mensaje.AppendFormat("Se realizo correctamente la cancelación. <br/> Folio de Entrada: <b><a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}"" target=""_blank"">{0}</a></b>", Folio, CveMovimientoEntrada)
|
||||
Mensaje.AppendFormat("<br/><a target='_blank' href='/Compras/PopUpVerFactura.aspx?P={0}'>Imprimir Reporte</a>", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoEntrada))) 'onclick='ImprimirTraslado()'
|
||||
If CveMovimientoVirtualEntrada > 0 Then Mensaje.AppendFormat("<br/>Folio: <a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}"" target=""_blank"">{2}</a> <a target='_blank' href='/Compras/PopUpVerFactura.aspx?P={0}'>Imprimir Entrada Virtual</a>", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoVirtualEntrada)), CveMovimientoVirtualEntrada, FolioVirtualEntrada)
|
||||
|
||||
Alert(Mensaje.ToString, TipoMensaje.MsgInformacion)
|
||||
|
||||
|
||||
40
OC/OC.aspx
40
OC/OC.aspx
@@ -1,6 +1,5 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="OC.aspx.vb" EnableEventValidation="false" Inherits="OC" %>
|
||||
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="H" runat="Server">
|
||||
|
||||
<asp:UpdatePanel runat="server" ID="UpAcciones" UpdateMode="Conditional">
|
||||
@@ -42,7 +41,9 @@
|
||||
<li>
|
||||
<asp:LinkButton ID="LbVerificarExistencia" Visible="True" runat="server"><i class='fa fa-list-alt'></i> Verificar Existencias</asp:LinkButton>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkCambiarMoneda" Visible="False" runat="server"><i class='fa fa-money'></i> Cambiar Moneda</asp:LinkButton>
|
||||
</li>
|
||||
<li style="text-align: left!important" runat="server" id="LiLnkGuias" visible="true">
|
||||
<asp:LinkButton runat="server" ID="LnkAgregarGuia" CssClass="" data-toggle="tooltip" data-placement="left" OnClick="LnkAgregarGuia_Click" title="Paquetería Guías." Text="<i class='fa fa-truck'></i> Paqueteria Guías" Visible="false"></asp:LinkButton>
|
||||
</li>
|
||||
@@ -2599,6 +2600,41 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="DivCambiarMoneda" class="modal ADS fade">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UpdatePanel3" runat="server" class="modal-content rowpadding" tabindex="-1" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h4>
|
||||
<asp:Label Text="Cambiar Moneda" ID="LblCambioMonedaTitle" runat="server" />
|
||||
</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel ID="UpCambiarMonedaBody" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="row" style="width:100%">
|
||||
<label class="col-md-1" style="width:100%">Desea Cambiar el Tipo de Moneda:</label>
|
||||
</div>
|
||||
<br />
|
||||
<div class="row" runat="server" id="DivTCRow" style="width:100%">
|
||||
<label class="col-md-3">Tipo de Cambio:</label>
|
||||
<div class="col-md-3">
|
||||
<asp:TextBox ID="TxtTCCambioMoneda" runat="server" Width="100%" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<%--data-toggle="confirmation" data-btn-ok-label="Si" data-title="Está seguro que desea cancelar la orden de compra?"--%>
|
||||
<asp:Button ID="BtnCambiarMoneda" runat="server" Text="Aplicar Cambio" ClientIDMode="Static" CssClass="btn btn-success" ValidationGroup="GrpCancelarCompra" />
|
||||
<button type="button" class="btn default" data-dismiss="modal">Cancelar</button>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
<script src="/Metronic/assets/global/plugins/dropzone/dropzone.js"></script>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="JS" runat="server">
|
||||
|
||||
137
OC/OC.aspx.vb
137
OC/OC.aspx.vb
@@ -6768,6 +6768,10 @@ Partial Class OC
|
||||
GVInv.DataSource = ObjInventarios.DtResultados
|
||||
If ObjInventarios.DtResultados.Rows.Count > 0 Then
|
||||
DdlMoneda.Enabled = False
|
||||
Dim TipoEstatusTerminado As String = GlobalDTOCEstatus(UsuarioActual.CveEmpresa).FiltroPrimeroValor("TipoTermino", String.Format("CveEstatus = {0}", CboE.SelectedValue))
|
||||
If TipoEstatusTerminado = "1" Then
|
||||
LnkCambiarMoneda.Visible = True
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
GVInv.DataBind()
|
||||
@@ -6775,6 +6779,7 @@ Partial Class OC
|
||||
|
||||
ObjInventarios.Dispose()
|
||||
UpAlmacen.Update()
|
||||
UpAcciones.Update()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
@@ -7672,4 +7677,136 @@ Partial Class OC
|
||||
Protected Sub DdlMoneda_Change() Handles DdlMoneda.SelectedIndexChanged
|
||||
MonedaTexto = DdlMoneda.SelectedItem.Text
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkCambiarMoneda_Click(sender As Object, e As EventArgs) Handles LnkCambiarMoneda.Click
|
||||
RegistraScript("$('#DivCambiarMoneda').modal();")
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnCambiarMoneda_Click() Handles BtnCambiarMoneda.Click
|
||||
Dim ObjInv As New ClsInventarios
|
||||
Dim OC As New ClsOC
|
||||
Dim Err As Boolean = False
|
||||
If ObjInv.GetMovimientos(CveMovimientoAlmacenVenta, -1, -1, UsuarioActual.CveEmpresa) Then
|
||||
Dim TipoMoneda As String = ObjInv.DtResultados.FiltroPrimeroValor("CveMoneda")
|
||||
Dim ObjConta As New ClsContabilidad
|
||||
|
||||
Dim IdCtaContableOC As Integer = 0
|
||||
Dim IdCtaContableOCME As Integer = 0
|
||||
Dim IdCtaContableOCComplementaria As Integer = 0
|
||||
|
||||
If ObjConta.GetRetCuenta(176, UsuarioActual.CveEmpresa) Then
|
||||
IdCtaContableOC = ObjConta.DtResultados.FiltroPrimeroValor("IdCtaContable").ToEntero
|
||||
End If
|
||||
|
||||
If ObjConta.GetRetCuenta(228, UsuarioActual.CveEmpresa) Then
|
||||
IdCtaContableOCME = ObjConta.DtResultados.FiltroPrimeroValor("IdCtaContable").ToEntero
|
||||
End If
|
||||
|
||||
If ObjConta.GetRetCuenta(229, UsuarioActual.CveEmpresa) Then
|
||||
IdCtaContableOCComplementaria = ObjConta.DtResultados.FiltroPrimeroValor("IdCtaContable").ToEntero
|
||||
End If
|
||||
|
||||
Dim LugarEntrega = If(txtLugarEntrega.Text.Trim = "", "-1", txtLugarEntrega.Text.Trim)
|
||||
LugarEntrega = If(DivLugarEntrega1.Visible, LugarEntrega, If(TxtLugarEntregaDirecta.Visible, TxtLugarEntregaDirecta.Text.Trim, ""))
|
||||
|
||||
Dim CveProveedorContacto As Integer = -1
|
||||
|
||||
Dim CveProveedor As Integer = -1
|
||||
If Not ChkCotizacion.Checked OrElse (UsuarioActual.Empresa.Funcionalidad(565) = "1" AndAlso CveConfianzaProveedor > 0) Then
|
||||
CveProveedor = DdlProveedores.SelectedValue.ToEntero
|
||||
CveProveedorContacto = IIf(DdlProveedorContacto.SelectedValue.ToEntero = 0, "-1", DdlProveedorContacto.SelectedValue).ToString.ToEntero
|
||||
End If
|
||||
|
||||
Dim IVA = If(TxtIVA.Visible, TxtIVA.Text.ToDecimal, LblIVA.Text.ToDecimal)
|
||||
|
||||
Dim Promocion = TxtPromocion.Text.Trim
|
||||
|
||||
Dim TCDecimal As Decimal = TxtTCCambioMoneda.Text.ToDecimal
|
||||
Dim TCDouble As Double = TxtTCCambioMoneda.Text.ToDouble
|
||||
|
||||
If TipoMoneda = "2" Then
|
||||
Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("OC/OC-(OCAlmacen)", 74, 0.0D, 0.0D, 1, Now, DdlProveedores.SelectedText, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
If CvePrePoliza > 0 Then
|
||||
Dim PrimerImporte As Integer = (0 - LblSubTotal.Text.ToDecimal)
|
||||
Dim SegundoImporte As Integer = (0 - LblSubTotal.Text.ToDecimal)
|
||||
|
||||
If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, PrimerImporte, lblFolio.Text, 228, lblFolio.Text, Now, IdCtaContableOCME, -1, CveProveedor:=DdlProveedores.SelectedText, CveMovimientoAlmacen:=CveMovimientoAlmacenVenta, CveOC:=CveOrdenCompra) Then
|
||||
If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, SegundoImporte, lblFolio.Text, 229, lblFolio.Text, Now, IdCtaContableOCComplementaria, -1, CveProveedor:=DdlProveedores.SelectedText, CveMovimientoAlmacen:=CveMovimientoAlmacenVenta, CveOC:=CveOrdenCompra) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, PrimerImporte + SegundoImporte, lblFolio.Text, 176, lblFolio.Text, Now, IdCtaContableOC, -1, CveProveedor:=DdlProveedores.SelectedText, CveMovimientoAlmacen:=CveMovimientoAlmacenVenta, CveOC:=CveOrdenCompra) Then
|
||||
Err = True
|
||||
Else
|
||||
If Not OC.UpdateOrdenCompra(-1, TxtDescrip.Text, TxtJustificacion.Text, DdlPrioridad.SelectedValue.ToEntero, ChkCotizacion.Checked, If(TxtFechaEstimadaEntrega.Text.Trim = "", "-1", TxtFechaEstimadaEntrega.Text.Trim),
|
||||
LugarEntrega, 1, CveProveedor, CveOrdenCompra, UsuarioActual.CveUsuario, Ddlcliente.txtValue.Value.ToEntero, DdlVendedor.SelectedValue.ToEntero, txtobsprioridad.Text, IVA:=(IVA * TCDecimal), RetIVA:=(TxtRetIVA.Text.ToDecimal * TCDecimal),
|
||||
RetISR:=(TxtRetISR.Text.ToDecimal * TCDecimal), FolioAdicional:=TxtFolioAdicional.Text, EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1), CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1),
|
||||
Guia:=TxtGuia.Text.Trim, IEPS:=TxtIEPS.Text.ToDecimal, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero, Promocion:=Promocion, pCveProveedorSucursal:=DdlProveedorSucursal.SelectedValue.ToEntero, CveProveedorContacto:=CveProveedorContacto,
|
||||
PorcentajeIVA:=Math.Round(DdlIVA.SelectedValue.ToDouble - 1, 2)) Then
|
||||
Err = True
|
||||
Else
|
||||
For Each dr As DataRow In DtDetalle.FiltraParametros("TipoDato IN (1)").Rows
|
||||
If OC.UpdateOrdenCompraDetalle(dr("Cantidad").ToString.ToDouble, dr("CveUnidadMedida").ToString.ToEntero, dr("CvePS").ToString.ToEntero, (dr("Importe").ToString.ToDouble * TCDouble), dr("CveSubProyecto").ToString.ToEntero,
|
||||
dr("CveActivoFijo").ToString.ToEntero, dr("Observacion").ToString, UsuarioActual.CveUsuario, dr("CveOrdenCompraDetalle").ToString.ToEntero, If(TipoOC = "REQ", -1, dr("CvePresupuestoEgreso").ToString.ToEntero),
|
||||
(dr("Descuento").ToString.ToDouble * TCDouble), IEPSPS:=(dr("IEPSPS").ToString.ToDouble * TCDouble), IEPSPSIVA:=(dr("IEPSPSIVA").ToString.ToDouble * TCDouble), IVA:=(dr("IVA").ToString.ToDouble * TCDouble),
|
||||
RetIVA:=(dr("RetIVA").ToString.ToDouble * TCDouble), RetISR:=(dr("RetISR").ToString.ToDouble * TCDouble), Total:=(dr("Total").ToString.ToDouble * TCDouble), CveContratoDetalle:=dr("CveContratoDetalle").ToString.ToEntero,
|
||||
IVAPorcentaje:=dr("IVAPorcentaje").ToString.ToDouble, RetIVAPorcentaje:=dr("RetIVAPorcentaje").ToString.ToDouble, RetISRPorcentaje:=dr("RetISRPorcentaje").ToString.ToDouble, IEPSPSPorcentaje:=dr("IEPSPSPorcentaje").ToString.ToDouble,
|
||||
IEPSPSIVAPorcentaje:=dr("IEPSPSIVAPorcentaje").ToString.ToDouble) <= 0 Then
|
||||
Err = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
Err = True
|
||||
End If
|
||||
Else
|
||||
Err = True
|
||||
End If
|
||||
End If
|
||||
ElseIf TipoMoneda = "1" Then
|
||||
Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("OC/OC-(OCAlmacen)", 74, 0.0D, 0.0D, 1, Now, DdlProveedores.SelectedText, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
If CvePrePoliza > 0 Then
|
||||
Dim PrimerImporte As Decimal = Decimal.Round(((LblSubTotal.Text.ToDecimal) / TxtTCCambioMoneda.Text.ToDecimal), 2, MidpointRounding.AwayFromZero)
|
||||
Dim SegundoImporte As Decimal = LblSubTotal.Text.ToDecimal
|
||||
If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, PrimerImporte, lblFolio.Text, 228, lblFolio.Text, Now, IdCtaContableOCME, -1, CveProveedor:=DdlProveedores.SelectedText, CveMovimientoAlmacen:=CveMovimientoAlmacenVenta, CveOC:=CveOrdenCompra) Then
|
||||
If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, SegundoImporte, lblFolio.Text, 229, lblFolio.Text, Now, IdCtaContableOCComplementaria, -1, CveProveedor:=DdlProveedores.SelectedText, CveMovimientoAlmacen:=CveMovimientoAlmacenVenta, CveOC:=CveOrdenCompra) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, (0 - (PrimerImporte + SegundoImporte)), lblFolio.Text, 176, lblFolio.Text, Now, IdCtaContableOC, -1, CveProveedor:=DdlProveedores.SelectedText, CveMovimientoAlmacen:=CveMovimientoAlmacenVenta, CveOC:=CveOrdenCompra) Then
|
||||
Err = True
|
||||
Else
|
||||
If Not OC.UpdateOrdenCompra(-1, TxtDescrip.Text, TxtJustificacion.Text, DdlPrioridad.SelectedValue.ToEntero, ChkCotizacion.Checked, If(TxtFechaEstimadaEntrega.Text.Trim = "", "-1", TxtFechaEstimadaEntrega.Text.Trim),
|
||||
LugarEntrega, 2, CveProveedor, CveOrdenCompra, UsuarioActual.CveUsuario, Ddlcliente.txtValue.Value.ToEntero, DdlVendedor.SelectedValue.ToEntero, txtobsprioridad.Text, IVA:=(IVA / TCDecimal),
|
||||
RetIVA:=(TxtRetIVA.Text.ToDecimal / TCDecimal), RetISR:=(TxtRetISR.Text.ToDecimal / TCDecimal), FolioAdicional:=TxtFolioAdicional.Text, EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1), CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1),
|
||||
Guia:=TxtGuia.Text.Trim, IEPS:=TxtIEPS.Text.ToDecimal, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero, Promocion:=Promocion, pCveProveedorSucursal:=DdlProveedorSucursal.SelectedValue.ToEntero, CveProveedorContacto:=CveProveedorContacto,
|
||||
PorcentajeIVA:=Math.Round(DdlIVA.SelectedValue.ToDouble - 1, 2)) Then
|
||||
Err = True
|
||||
Else
|
||||
For Each dr As DataRow In DtDetalle.FiltraParametros("TipoDato IN (1)").Rows
|
||||
If OC.UpdateOrdenCompraDetalle(dr("Cantidad").ToString.ToDouble, dr("CveUnidadMedida").ToString.ToEntero, dr("CvePS").ToString.ToEntero, (dr("Importe").ToString.ToDouble / TCDouble), dr("CveSubProyecto").ToString.ToEntero,
|
||||
dr("CveActivoFijo").ToString.ToEntero, dr("Observacion").ToString, UsuarioActual.CveUsuario, dr("CveOrdenCompraDetalle").ToString.ToEntero, If(TipoOC = "REQ", -1, dr("CvePresupuestoEgreso").ToString.ToEntero),
|
||||
(dr("Descuento").ToString.ToDouble / TCDouble), IEPSPS:=(dr("IEPSPS").ToString.ToDouble / TCDouble), IEPSPSIVA:=(dr("IEPSPSIVA").ToString.ToDouble / TCDouble), IVA:=(dr("IVA").ToString.ToDouble / TCDouble),
|
||||
RetIVA:=(dr("RetIVA").ToString.ToDouble / TCDouble), RetISR:=(dr("RetISR").ToString.ToDouble / TCDouble), Total:=(dr("Total").ToString.ToDouble / TCDouble), CveContratoDetalle:=dr("CveContratoDetalle").ToString.ToEntero,
|
||||
IVAPorcentaje:=dr("IVAPorcentaje").ToString.ToDouble, RetIVAPorcentaje:=dr("RetIVAPorcentaje").ToString.ToDouble, RetISRPorcentaje:=dr("RetISRPorcentaje").ToString.ToDouble, IEPSPSPorcentaje:=dr("IEPSPSPorcentaje").ToString.ToDouble,
|
||||
IEPSPSIVAPorcentaje:=dr("IEPSPSIVAPorcentaje").ToString.ToDouble) <= 0 Then
|
||||
Err = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
Err = True
|
||||
End If
|
||||
Else
|
||||
Err = True
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
ObjConta.Dispose()
|
||||
End If
|
||||
ObjInv.Dispose()
|
||||
If Err Then
|
||||
Alert("Sucedió un error con el cambio en la moneda", TipoMensaje.MsgError)
|
||||
Else
|
||||
Alert("Moneda actualizada con exito")
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
@@ -261,7 +261,7 @@
|
||||
<asp:UpdatePanel ID="UPVentas" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvCxC" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Cuentas por Cobrar Pendientes"
|
||||
DataKeyNames="TipoDocto,CveVenta,CveCliente,SerieFolio,Original,SubTotal,IVA,IEPS,RetIVA,RetISR,Num3,CveSubProyecto,CveMoneda,Saldo,TipoCambio, RFC,UUID,Fecha,PorcentajeIVA,DescuentoProntoPago"
|
||||
DataKeyNames="TipoDocto,CveVenta,CveCliente,SerieFolio,Original,SubTotal,IVA,IEPS,RetIVA,RetISR,Num3,CveSubProyecto,CveMoneda,Saldo,TipoCambio, RFC,UUID,Fecha,PorcentajeIVA,DescuentoProntoPago,CveTipoRetencion"
|
||||
CssClass="table table-striped table-advance table-hover Widthall" Style="text-align: center;" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
|
||||
@@ -800,7 +800,7 @@ Partial Class Ventas_ClientesAbonar
|
||||
'inserto las ventas que voy a pagar
|
||||
For Each gvr As GridViewRow In GvCxC.Rows
|
||||
If gvr.FCCheckBox("Chk").Checked Then
|
||||
Dim ObjFactura As Modelos.Factura
|
||||
Dim ObjFactura As Modelos.Factura = Nothing
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
ObjFactura = New Modelos.Factura(UsuarioActual, gvr.DataKey("CveVenta").ToEntero(), UsuarioActual.CveEmpresa)
|
||||
@@ -905,7 +905,7 @@ Partial Class Ventas_ClientesAbonar
|
||||
|
||||
Case 8 'Ret IVA x Trasladar
|
||||
If EsAnticipoEspecial Then Exit Select
|
||||
If ObjFactura IsNot Nothing AndAlso ObjFactura.CveTipoRetencion = 4 Then
|
||||
If gvr.DataKey("CveTipoRetencion").ToEntero = 4 Then
|
||||
Exit Select
|
||||
End If
|
||||
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
|
||||
@@ -954,7 +954,7 @@ Partial Class Ventas_ClientesAbonar
|
||||
|
||||
Case 313 'Ret Iva Servicios
|
||||
If EsAnticipoEspecial Then Exit Select
|
||||
If ObjFactura IsNot Nothing AndAlso ObjFactura.CveTipoRetencion = 4 Then
|
||||
If gvr.DataKey("CveTipoRetencion").ToEntero = 4 Then
|
||||
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
|
||||
ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago
|
||||
importeMX = ImporteMovimiento
|
||||
@@ -1069,7 +1069,7 @@ Partial Class Ventas_ClientesAbonar
|
||||
If tipoCambioVenta > 1 Then ConceptoMovimiento += $" TC:{tipoCambioVenta} ${ImporteMovimiento.FormatoNumero(2)}"
|
||||
Case 62 'Ret IVA Trasladado
|
||||
If EsAnticipoEspecial Then Exit Select
|
||||
If ObjFactura IsNot Nothing AndAlso ObjFactura.CveTipoRetencion = 4 Then
|
||||
If gvr.DataKey("CveTipoRetencion").ToEntero = 4 Then
|
||||
Exit Select
|
||||
End If
|
||||
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
|
||||
@@ -1119,7 +1119,7 @@ Partial Class Ventas_ClientesAbonar
|
||||
|
||||
Case 314 'Ret Iva Servicios Traslado
|
||||
If EsAnticipoEspecial Then Exit Select
|
||||
If ObjFactura IsNot Nothing AndAlso ObjFactura.CveTipoRetencion = 4 Then
|
||||
If gvr.DataKey("CveTipoRetencion").ToEntero = 4 Then
|
||||
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
|
||||
ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago
|
||||
importeMX = ImporteMovimiento
|
||||
@@ -1282,26 +1282,73 @@ Partial Class Ventas_ClientesAbonar
|
||||
CveCuenta = UsuarioActual.Empresa.CveCuentaIEPSTrasladado
|
||||
Case 64 'Ganancia
|
||||
If CveMoneda <> 1 OrElse gvr.DataKey("CveMoneda").ToEntero <> 1 Then
|
||||
IdCtaContable = UsuarioActual.Empresa.IdCuentaGananciaCambiaria
|
||||
CveCuenta = UsuarioActual.Empresa.CveCuentaGananciaCambiaria
|
||||
|
||||
Dim CveMonedaVenta As Integer = gvr.DataKey("CveMoneda").ToEntero
|
||||
Dim tImporteVenta, tImportePago As Decimal
|
||||
Dim Diferencia As Decimal = 0
|
||||
ImporteMovimiento = 0
|
||||
|
||||
tipoCambioVentaDiferenciaCambiaria = If(gvr.DataKey("Fecha").ToDate < FechaUltimaFluctuacion, TipoCambioFluctuacion, gvr.DataKey("TipoCambio").ToDecimal)
|
||||
Dim TCImpuestos As Decimal = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta)
|
||||
|
||||
|
||||
Dim Diferencia As Decimal = ((gvr.FCTextBox("TxtAbonar").Text.ToDecimal) * tipoCambioVentaValuacion) - ((gvr.FCTextBox("TxtAbonar").Text.ToDecimal) * tipoCambioPago) 'Añadimos la diferencia de perdida en la venta
|
||||
Diferencia -= ((gvr.DataKey("IVA").ToDecimal * PorcentajePago) * tipoCambioVenta) - ((gvr.DataKey("IVA").ToDecimal * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el IVA
|
||||
Diferencia += ((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * tipoCambioVenta) - ((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el RetIVA
|
||||
Diferencia += ((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * tipoCambioVenta) - ((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el RetISR
|
||||
Diferencia -= ((gvr.DataKey("IEPS").ToDecimal * PorcentajePago) * tipoCambioVenta) - ((gvr.DataKey("IEPS").ToDecimal * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el IEPS
|
||||
Diferencia = Math.Round(Diferencia, 2)
|
||||
|
||||
If CveMonedaVenta = 1 And CveMoneda <> 1 Then
|
||||
'factura pesos, pago en dolares
|
||||
tImporteVenta = ((gvr.FCTextBox("TxtAbonar").Text.ToDecimal) * tipoCambioVentaValuacion).RoundSQL
|
||||
tImportePago = (((gvr.FCTextBox("TxtAbonar").Text.ToDecimal) * tipoCambioVenta / tipoCambioPago).RoundSQL * tipoCambioPago).RoundSQL
|
||||
ElseIf CveMonedaVenta <> 1 And CveMoneda <> 1 Then
|
||||
'factura dolares, pago en dolares
|
||||
tImporteVenta = ((gvr.FCTextBox("TxtAbonar").Text.ToDecimal) * tipoCambioVentaValuacion).RoundSQL
|
||||
tImportePago = ((gvr.FCTextBox("TxtAbonar").Text.ToDecimal) * tipoCambioPago).RoundSQL
|
||||
ElseIf CveMonedaVenta <> 1 And CveMoneda = 1 Then
|
||||
'factura dolares, pago en pesos
|
||||
tImporteVenta = ((gvr.FCTextBox("TxtAbonar").Text.ToDecimal) * tipoCambioVentaValuacion).RoundSQL
|
||||
tImportePago = ((gvr.FCTextBox("TxtAbonar").Text.ToDecimal) * tipoCambioPago).RoundSQL
|
||||
End If
|
||||
|
||||
If tImporteVenta <> tImportePago Then
|
||||
If tImporteVenta < tImportePago Then
|
||||
ConceptoContable = 64
|
||||
IdCtaContable = UsuarioActual.Empresa.IdCuentaGananciaCambiaria
|
||||
TipoMovimiento = True
|
||||
'CveCuenta = UsuarioActual.Empresa.CveCuentaGananciaCambiaria
|
||||
Else
|
||||
ConceptoContable = 65
|
||||
IdCtaContable = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria
|
||||
TipoMovimiento = False
|
||||
' CveCuenta = UsuarioActual.Empresa.CveCuentaPerdidaCambiaria
|
||||
End If
|
||||
Diferencia = tImporteVenta - tImportePago
|
||||
End If
|
||||
|
||||
' si tiene funcionalidad para que tome el TC de pago, que solo afecta a los impuestos
|
||||
If FuncionalidadFluctuacionImpuestos Then
|
||||
Dim TCImpuestos As Decimal = tipoCambioPago
|
||||
|
||||
Diferencia -= ((gvr.DataKey("IVA").ToDecimal * PorcentajePago) * tipoCambioVenta) - ((gvr.DataKey("IVA").ToDecimal * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el IVA
|
||||
Diferencia += ((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * tipoCambioVenta) - ((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el RetIVA
|
||||
Diferencia += ((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * tipoCambioVenta) - ((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el RetISR
|
||||
Diferencia -= ((gvr.DataKey("IEPS").ToDecimal * PorcentajePago) * tipoCambioVenta) - ((gvr.DataKey("IEPS").ToDecimal * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el IEPS
|
||||
Diferencia = Math.Round(Diferencia, 2)
|
||||
End If
|
||||
|
||||
ImporteMovimiento = Math.Abs(Diferencia)
|
||||
importeMX = ImporteMovimiento
|
||||
|
||||
'Dim Diferencia As Decimal = ((gvr.FCTextBox("TxtAbonar").Text.ToDecimal) * tipoCambioVentaValuacion) - ((gvr.FCTextBox("TxtAbonar").Text.ToDecimal) * tipoCambioPago) 'Añadimos la diferencia de perdida en la venta
|
||||
'Diferencia -= ((gvr.DataKey("IVA").ToDecimal * PorcentajePago) * tipoCambioVenta) - ((gvr.DataKey("IVA").ToDecimal * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el IVA
|
||||
'Diferencia += ((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * tipoCambioVenta) - ((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el RetIVA
|
||||
'Diferencia += ((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * tipoCambioVenta) - ((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el RetISR
|
||||
'Diferencia -= ((gvr.DataKey("IEPS").ToDecimal * PorcentajePago) * tipoCambioVenta) - ((gvr.DataKey("IEPS").ToDecimal * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el IEPS
|
||||
'Diferencia = Math.Round(Diferencia, 2)
|
||||
|
||||
'' se considera, las diferencias, y no el tipo de cambio, por el caso de las fluctuaciones
|
||||
|
||||
'' si tiene funcionalidad de flucturación con ivas, tomar tipocambioventa
|
||||
If Diferencia < 0 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
|
||||
ImporteMovimiento = Math.Abs(Diferencia)
|
||||
importeMX = ImporteMovimiento
|
||||
End If
|
||||
'If Diferencia < 0 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
|
||||
' ImporteMovimiento = Math.Abs(Diferencia)
|
||||
' importeMX = ImporteMovimiento
|
||||
'End If
|
||||
|
||||
'' si tiene funcionalidad de flucturación con ivas, tomar tipocambioventa
|
||||
'If tipoCambioPago > tipoCambioVentaDiferenciaCambiaria AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
|
||||
@@ -1318,47 +1365,47 @@ Partial Class Ventas_ClientesAbonar
|
||||
ImporteMovimiento = 0
|
||||
End If
|
||||
|
||||
Case 65 'Perdida
|
||||
If CveMoneda <> 1 OrElse gvr.DataKey("CveMoneda").ToEntero <> 1 Then
|
||||
IdCtaContable = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria
|
||||
CveCuenta = UsuarioActual.Empresa.CveCuentaPerdidaCambiaria
|
||||
tipoCambioVentaDiferenciaCambiaria = If(gvr.DataKey("Fecha").ToDate < FechaUltimaFluctuacion, TipoCambioFluctuacion, gvr.DataKey("TipoCambio").ToDecimal)
|
||||
Dim TCImpuestos As Decimal = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta)
|
||||
'Case 65 'Perdida
|
||||
' If CveMoneda <> 1 OrElse gvr.DataKey("CveMoneda").ToEntero <> 1 Then
|
||||
' IdCtaContable = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria
|
||||
' CveCuenta = UsuarioActual.Empresa.CveCuentaPerdidaCambiaria
|
||||
' tipoCambioVentaDiferenciaCambiaria = If(gvr.DataKey("Fecha").ToDate < FechaUltimaFluctuacion, TipoCambioFluctuacion, gvr.DataKey("TipoCambio").ToDecimal)
|
||||
' Dim TCImpuestos As Decimal = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta)
|
||||
|
||||
Dim Diferencia As Decimal = ((gvr.FCTextBox("TxtAbonar").Text.ToDecimal) * tipoCambioVentaValuacion) - ((gvr.FCTextBox("TxtAbonar").Text.ToDecimal) * tipoCambioPago) 'Añadimos la diferencia de perdida en la venta
|
||||
Diferencia -= ((gvr.DataKey("IVA").ToDecimal * PorcentajePago) * tipoCambioVenta) - ((gvr.DataKey("IVA").ToDecimal * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el IVA
|
||||
Diferencia += ((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * tipoCambioVenta) - ((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el RetIVA
|
||||
Diferencia += ((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * tipoCambioVenta) - ((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el RetISR
|
||||
Diferencia -= ((gvr.DataKey("IEPS").ToDecimal * PorcentajePago) * tipoCambioVenta) - ((gvr.DataKey("IEPS").ToDecimal * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el IEPS
|
||||
Diferencia = Math.Round(Diferencia, 2)
|
||||
'si la diferencia es negativa es pérdida, si es positiva es ganancia
|
||||
If Diferencia > 0 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
|
||||
ImporteMovimiento = Math.Abs(Diferencia)
|
||||
importeMX = ImporteMovimiento
|
||||
End If
|
||||
' Dim Diferencia As Decimal = ((gvr.FCTextBox("TxtAbonar").Text.ToDecimal) * tipoCambioVentaValuacion) - ((gvr.FCTextBox("TxtAbonar").Text.ToDecimal) * tipoCambioPago) 'Añadimos la diferencia de perdida en la venta
|
||||
' Diferencia -= ((gvr.DataKey("IVA").ToDecimal * PorcentajePago) * tipoCambioVenta) - ((gvr.DataKey("IVA").ToDecimal * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el IVA
|
||||
' Diferencia += ((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * tipoCambioVenta) - ((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el RetIVA
|
||||
' Diferencia += ((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * tipoCambioVenta) - ((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el RetISR
|
||||
' Diferencia -= ((gvr.DataKey("IEPS").ToDecimal * PorcentajePago) * tipoCambioVenta) - ((gvr.DataKey("IEPS").ToDecimal * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el IEPS
|
||||
' Diferencia = Math.Round(Diferencia, 2)
|
||||
' 'si la diferencia es negativa es pérdida, si es positiva es ganancia
|
||||
' If Diferencia > 0 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
|
||||
' ImporteMovimiento = Math.Abs(Diferencia)
|
||||
' importeMX = ImporteMovimiento
|
||||
' End If
|
||||
|
||||
'' si tiene funcionalidad de flucturación con ivas, tomar tipocambioventa
|
||||
'If tipoCambioPago < tipoCambioVentaDiferenciaCambiaria AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
|
||||
' ImporteMovimiento = (gvr.FCTextBox("TxtAbonar").Text.ToDecimal * tipoCambioVentaDiferenciaCambiaria) - (gvr.FCTextBox("TxtAbonar").Text.ToDecimal * tipoCambioPago) 'Añadimos la diferencia de perdida en la venta
|
||||
' ImporteMovimiento -= ((gvr.DataKey("IVA").ToDecimal * PorcentajePago) * tipoCambioVentaDiferenciaCambiaria) - ((gvr.DataKey("IVA").ToDecimal * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el IVA
|
||||
' ImporteMovimiento += ((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * tipoCambioVentaDiferenciaCambiaria) - ((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * TCImpuestos)
|
||||
' ImporteMovimiento += ((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * tipoCambioVentaDiferenciaCambiaria) - ((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el RetISR
|
||||
' ImporteMovimiento -= ((gvr.DataKey("IEPS").ToDecimal * PorcentajePago) * tipoCambioVentaDiferenciaCambiaria) - ((gvr.DataKey("IEPS").ToDecimal * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el IEPS
|
||||
' ImporteMovimiento = Math.Abs(Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero))
|
||||
' importeMX = ImporteMovimiento
|
||||
' 'ElseIf tipoCambioPago > tipoCambioVenta AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
|
||||
' ' ImporteMovimiento = gvr.FCTextBox("TxtAbonar").Text.ToDecimal - (Math.Abs(Math.Round(gvr.FCTextBox("TxtAbonar").Text.ToDecimal / tipoCambioPago, 2)) * tipoCambioPago)
|
||||
' ' 'ImporteMovimiento -= Math.Abs(Math.Round(((gvr.DataKey("IVA").ToDecimal * PorcentajePago) * TCImpuestos) - ((gvr.DataKey("IVA").ToDecimal * PorcentajePago) * tipoCambioVenta))) 'Añadimos la diferencia de ganancia en el IVA
|
||||
' ' 'ImporteMovimiento += Math.Abs(Math.Round(((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * TCImpuestos) - ((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * tipoCambioVenta))) 'Añadimos la diferencia de ganancia en el RetIVA
|
||||
' ' 'ImporteMovimiento += Math.Abs(Math.Round(((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * TCImpuestos) - ((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * tipoCambioVenta))) 'Añadimos la diferencia de ganancia en el RetISR
|
||||
' ' 'ImporteMovimiento -= Math.Abs(Math.Round(((gvr.DataKey("IEPS").ToDecimal * PorcentajePago) * TCImpuestos) - ((gvr.DataKey("IEPS").ToDecimal * PorcentajePago) * tipoCambioVenta))) 'Añadimos la diferencia de ganancia en el IEPS
|
||||
' ' ImporteMovimiento = ImporteMovimiento
|
||||
' ' importeMX = ImporteMovimiento
|
||||
'End If
|
||||
CveSubProyectoContabilizar = CveSubProyecto
|
||||
Else
|
||||
ImporteMovimiento = 0
|
||||
End If
|
||||
' '' si tiene funcionalidad de flucturación con ivas, tomar tipocambioventa
|
||||
' 'If tipoCambioPago < tipoCambioVentaDiferenciaCambiaria AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
|
||||
' ' ImporteMovimiento = (gvr.FCTextBox("TxtAbonar").Text.ToDecimal * tipoCambioVentaDiferenciaCambiaria) - (gvr.FCTextBox("TxtAbonar").Text.ToDecimal * tipoCambioPago) 'Añadimos la diferencia de perdida en la venta
|
||||
' ' ImporteMovimiento -= ((gvr.DataKey("IVA").ToDecimal * PorcentajePago) * tipoCambioVentaDiferenciaCambiaria) - ((gvr.DataKey("IVA").ToDecimal * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el IVA
|
||||
' ' ImporteMovimiento += ((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * tipoCambioVentaDiferenciaCambiaria) - ((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * TCImpuestos)
|
||||
' ' ImporteMovimiento += ((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * tipoCambioVentaDiferenciaCambiaria) - ((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el RetISR
|
||||
' ' ImporteMovimiento -= ((gvr.DataKey("IEPS").ToDecimal * PorcentajePago) * tipoCambioVentaDiferenciaCambiaria) - ((gvr.DataKey("IEPS").ToDecimal * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el IEPS
|
||||
' ' ImporteMovimiento = Math.Abs(Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero))
|
||||
' ' importeMX = ImporteMovimiento
|
||||
' ' 'ElseIf tipoCambioPago > tipoCambioVenta AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
|
||||
' ' ' ImporteMovimiento = gvr.FCTextBox("TxtAbonar").Text.ToDecimal - (Math.Abs(Math.Round(gvr.FCTextBox("TxtAbonar").Text.ToDecimal / tipoCambioPago, 2)) * tipoCambioPago)
|
||||
' ' ' 'ImporteMovimiento -= Math.Abs(Math.Round(((gvr.DataKey("IVA").ToDecimal * PorcentajePago) * TCImpuestos) - ((gvr.DataKey("IVA").ToDecimal * PorcentajePago) * tipoCambioVenta))) 'Añadimos la diferencia de ganancia en el IVA
|
||||
' ' ' 'ImporteMovimiento += Math.Abs(Math.Round(((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * TCImpuestos) - ((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * tipoCambioVenta))) 'Añadimos la diferencia de ganancia en el RetIVA
|
||||
' ' ' 'ImporteMovimiento += Math.Abs(Math.Round(((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * TCImpuestos) - ((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * tipoCambioVenta))) 'Añadimos la diferencia de ganancia en el RetISR
|
||||
' ' ' 'ImporteMovimiento -= Math.Abs(Math.Round(((gvr.DataKey("IEPS").ToDecimal * PorcentajePago) * TCImpuestos) - ((gvr.DataKey("IEPS").ToDecimal * PorcentajePago) * tipoCambioVenta))) 'Añadimos la diferencia de ganancia en el IEPS
|
||||
' ' ' ImporteMovimiento = ImporteMovimiento
|
||||
' ' ' importeMX = ImporteMovimiento
|
||||
' 'End If
|
||||
' CveSubProyectoContabilizar = CveSubProyecto
|
||||
' Else
|
||||
' ImporteMovimiento = 0
|
||||
' End If
|
||||
|
||||
Case 78 'Otros Ingresos
|
||||
If ChkAjusteOI.Checked Then
|
||||
@@ -1494,7 +1541,7 @@ Partial Class Ventas_ClientesAbonar
|
||||
MsgError = "No se pudo insertar la póliza"
|
||||
End If
|
||||
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, If(CveMoneda = 1 AndAlso TxtTC.Visible, TxtImporte.Text.ToDecimal / TxtTC.Text.ToDecimal, TxtImporte.Text.ToDecimal), TxtObservaciones.Text, 204, TxtObservaciones.Text + If(CveMoneda = 2, $" TC:{tipoCambioPago}", ""), TxtFechaDocumento.Text, IdCuentaBancariaComplementaria, -1, CveIE, -1, -1, -1, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=If(CveMoneda = 2, (TxtImporte.Text.Trim.ToDecimal * tipoCambioPago) - TxtImporte.Text.Trim.ToDecimal, TxtImporte.Text.Trim.ToDecimal), ImporteME:=If(CveMoneda = 2, TxtImporte.Text.Trim.ToDecimal, 0), CveCuenta:=CveCuentaBancariaComplementaria, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago) Then
|
||||
If MsgError = "" AndAlso Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, If(CveMoneda = 1 AndAlso TxtTC.Visible, TxtImporte.Text.ToDecimal / TxtTC.Text.ToDecimal, TxtImporte.Text.ToDecimal), TxtObservaciones.Text, 204, TxtObservaciones.Text + If(CveMoneda = 2, $" TC:{tipoCambioPago}", ""), TxtFechaDocumento.Text, IdCuentaBancariaComplementaria, -1, CveIE, -1, -1, -1, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=If(CveMoneda = 2, (TxtImporte.Text.Trim.ToDecimal * tipoCambioPago) - TxtImporte.Text.Trim.ToDecimal, TxtImporte.Text.Trim.ToDecimal), ImporteME:=If(CveMoneda = 2, TxtImporte.Text.Trim.ToDecimal, 0), CveCuenta:=CveCuentaBancariaComplementaria, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago) Then
|
||||
MsgError = "No se pudo insertar la póliza"
|
||||
End If
|
||||
Else
|
||||
|
||||
@@ -5803,8 +5803,13 @@ Partial Class Ventas
|
||||
If UsuarioActual.CveEmpresa = 119 Then
|
||||
e.Row.FCTextBox("TxtCantidad").Enabled = False
|
||||
End If
|
||||
'e.Row.FCDropDownList("DdlClasificacion").Enabled = False
|
||||
'e.Row.FCDropDownLost("DdlPS").Enabled = False
|
||||
|
||||
'cuando ya tiene una salida, no se puede cambiar el producto
|
||||
If e.Row.DBCampo("CantidadInventario").ToDouble > 0 Then
|
||||
e.Row.FCDropDownList("DdlClasificacion").Enabled = False
|
||||
e.Row.FCDropDownLost("DdlPS").Enabled = False
|
||||
e.Row.FCDropDownLost("DdlPS").ddlWS.Attributes.Add("disabled", "disabled")
|
||||
End If
|
||||
|
||||
e.Row.FCTextBox("TxtTiempoEntrega").Enabled = False
|
||||
e.Row.FCDropDownList("DdlProyecto").Enabled = False
|
||||
@@ -5949,6 +5954,7 @@ Partial Class Ventas
|
||||
|
||||
If Not UsuarioActual.TienePermisoProceso(169) Then ' NO VALIDA EXISTENCIAS NI COSTO - PERMISO PARA NO VALIDAR
|
||||
Dim CvePS As Integer = DatarowPS("CvePS").ToString.ToEntero
|
||||
Dim CveUM As Integer = DatarowPS("CveUM").ToString.ToEntero
|
||||
Dim CveTipoPS As Integer = DatarowPS("CveTipoPS").ToString.ToEntero
|
||||
|
||||
CantidadInventario = GvPS.Rows(e.RowIndex).DataKey("CantidadInventario").ToString.ToDecimal
|
||||
@@ -5963,7 +5969,7 @@ Partial Class Ventas
|
||||
Dim ObjInventarios As New ClsInventarios
|
||||
Dim Existencia As Decimal
|
||||
If ValidaExistencia Then
|
||||
Existencia = ObjInventarios.GetExistenciasPS(CvePS, -1, UsuarioActual.CveEmpresa, -1, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeAdelantado:=1, PendientePorSurtir:=1, RestringirAlmacenes:=1, ExcluyeApartados:=-1)
|
||||
Existencia = ObjInventarios.GetExistenciasPS(CvePS, CveUM, UsuarioActual.CveEmpresa, -1, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeAdelantado:=1, PendientePorSurtir:=1, RestringirAlmacenes:=1, ExcluyeApartados:=-1)
|
||||
End If
|
||||
|
||||
Dim Costo As Decimal = ObjInventarios.GetCostoPS(CvePS, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, DdlSubProyectoDatos.SelectedValue.ToEntero, CveTipoAlmacen:=1)
|
||||
@@ -10936,7 +10942,7 @@ Partial Class Ventas
|
||||
'REFACTURACION CON PAGOS, DEBE CANCELAR SALDOS DEL DOCUMENTO ANTERIOR Y TRASPASAR PAGOS AL NUEVO
|
||||
If ModalidadRefacturacion = 2 AndAlso ObjFactura.TipoDocto.Contiene("Ing", "Ant") AndAlso ObjFactura.NuevaFactura = 1 Then
|
||||
If Not ObjConta.TraspasarSaldosPrePolizasRefacturacion(ObjFacturaNC.CveVenta, ObjFactura.CveVenta, ObjFactura.CvePrePoliza, CvePlantilaPoliza, UsuarioActual.CveEmpresa) Then
|
||||
ErrorList.Add("Ocurrió un error al agregar la bitacora de Póliza Virtual.")
|
||||
ErrorList.Add("Ocurrió un error al traspasos saldos en refacturación")
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -11077,7 +11083,7 @@ Partial Class Ventas
|
||||
CveConceptoAlmacen = 18
|
||||
End If
|
||||
|
||||
Dim CveAlmacen = ddlAlmacen.SelectedValue.ToEntero
|
||||
Dim CveAlmacen = ddlAlmacen.SelectedValue.ToEnteroca
|
||||
Dim CveMovimientoInventario As Integer = ObjInventario.AddMovimiento(CveAlmacen, CveConceptoAlmacen, factura.CveMoneda, factura.Fecha, -1, factura.CveUsuario, factura.CveEmpresa, -1, factura.CveVenta, -1, -1, Modulo:="Vta/E1")
|
||||
|
||||
If CveMovimientoInventario <= 0 Then
|
||||
@@ -11249,7 +11255,6 @@ Partial Class Ventas
|
||||
|
||||
If factura.TipoDocto.Contiene("Ing", "Egs", "OP", "Com") Then
|
||||
|
||||
'Dim ObjAC As New ClsContPAQi(UsuarioActual.Empresa) : ObjAC.IniciaTransacSQL()
|
||||
Dim IDPoliza As Modelos.RetornoPolizaConta = GenerarPolizaAC(ObjAC, factura)
|
||||
|
||||
If IDPoliza.IdPoliza > 0 Then
|
||||
@@ -24895,6 +24900,7 @@ Partial Class Ventas
|
||||
Next
|
||||
|
||||
TxtImportesRemisionesNC.Text = TotalRemNCAplicado.FormatoNumero
|
||||
TxtNCImporte.Text = TotalRemNCAplicado.FormatoNumero
|
||||
|
||||
UpModalRemisionesNC.Update()
|
||||
UpAplicarNC.Update()
|
||||
|
||||
Reference in New Issue
Block a user