Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -758,11 +758,12 @@ Public Class ClsAcumuladores
|
|||||||
End Try
|
End Try
|
||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
Public Function GetGarantiasPolizaVirtual(CveVenta As Integer) As Boolean
|
Public Function GetGarantiasPolizaVirtual(CveVenta As Integer, CveEmpresa As Integer) As Boolean
|
||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
SqlDataAdapter("PA_Acum_GarantiasPolizaVirtualGet")
|
SqlDataAdapter("PA_Acum_GarantiasPolizaVirtualGet")
|
||||||
With SqlAdapter.SelectCommand.Parameters
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
|
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
|
||||||
|
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||||
End With
|
End With
|
||||||
Try
|
Try
|
||||||
SqlAdapter.Fill(Data)
|
SqlAdapter.Fill(Data)
|
||||||
|
|||||||
@@ -5778,6 +5778,8 @@ Public Class ClsContabilidad
|
|||||||
ValorPolizaDescuadre = SqlAdapter.SelectCommand.Parameters("@Valor").Value.ToString.ToEntero
|
ValorPolizaDescuadre = SqlAdapter.SelectCommand.Parameters("@Valor").Value.ToString.ToEntero
|
||||||
MensajePolizaDescuadre = SqlAdapter.SelectCommand.Parameters("@MsgSalida").Value.ToString
|
MensajePolizaDescuadre = SqlAdapter.SelectCommand.Parameters("@MsgSalida").Value.ToString
|
||||||
ValorDiferencia = SqlAdapter.SelectCommand.Parameters("@Diferencia").Value.ToString
|
ValorDiferencia = SqlAdapter.SelectCommand.Parameters("@Diferencia").Value.ToString
|
||||||
|
Dim MsgPrePoliza As String = SqlAdapter.SelectCommand.Parameters("@MsgPrePolizaSalida").Value.ToString
|
||||||
|
If MsgPrePoliza <> "" Then MsgPrePoliza.GuardaLogAD("LogPrePoliza")
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
OnError("Ocurrió un error al validar la PrePoliza.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
OnError("Ocurrió un error al validar la PrePoliza.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
End Try
|
End Try
|
||||||
|
|||||||
@@ -1267,7 +1267,13 @@ Public Class ClsOC
|
|||||||
_CveOrdenCompraDetalle = SqlAdapter.SelectCommand.Parameters("@vCveOrdenCompraDetalle").Value.ToString.ToEntero
|
_CveOrdenCompraDetalle = SqlAdapter.SelectCommand.Parameters("@vCveOrdenCompraDetalle").Value.ToString.ToEntero
|
||||||
Retorno = True
|
Retorno = True
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
OnError("Ocurrió un error al agregar el detalle de OrdenCompras.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
|
||||||
|
If ex.Message.Contains("CK_OC_OrdenesCompraDetalle_RetIVA_Total") Then
|
||||||
|
OnError("La retención de iva no coincide con su total", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||||
|
Else
|
||||||
|
OnError("Ocurrió un error al agregar el detalle de OrdenCompras.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||||
|
End If
|
||||||
|
|
||||||
End Try
|
End Try
|
||||||
|
|
||||||
Return Retorno
|
Return Retorno
|
||||||
|
|||||||
@@ -99,6 +99,7 @@ Public Class ClsProductosServicios
|
|||||||
Public Property ClaveImpuestoUnidadMedida As String
|
Public Property ClaveImpuestoUnidadMedida As String
|
||||||
Public Property ClaveCategoriaToxicidad As String
|
Public Property ClaveCategoriaToxicidad As String
|
||||||
|
|
||||||
|
Public Property EsOutSourcing As Boolean
|
||||||
|
|
||||||
Public ReadOnly Property DtResultados() As DataTable
|
Public ReadOnly Property DtResultados() As DataTable
|
||||||
Get
|
Get
|
||||||
@@ -290,7 +291,7 @@ Public Class ClsProductosServicios
|
|||||||
ClaveImpuestoEmpaque = Data.Rows(0)("ClaveImpuestoEmpaque").ToString
|
ClaveImpuestoEmpaque = Data.Rows(0)("ClaveImpuestoEmpaque").ToString
|
||||||
ClaveImpuestoUnidadMedida = Data.Rows(0)("ClaveImpuestoUM").ToString
|
ClaveImpuestoUnidadMedida = Data.Rows(0)("ClaveImpuestoUM").ToString
|
||||||
ClaveCategoriaToxicidad = Data.Rows(0)("ClaveCategoriaToxicidad").ToString
|
ClaveCategoriaToxicidad = Data.Rows(0)("ClaveCategoriaToxicidad").ToString
|
||||||
|
EsOutSourcing = Data.Rows(0)("EsOutSourcing").ToString = "True"
|
||||||
End If
|
End If
|
||||||
Retorno = True
|
Retorno = True
|
||||||
Catch ex As SqlException
|
Catch ex As SqlException
|
||||||
@@ -388,7 +389,7 @@ Public Class ClsProductosServicios
|
|||||||
Optional CveMoneda As Integer = 1, Optional RetISR As Double = 0, Optional PrecioMinimo As Decimal = Nothing, Optional CveTipoFactor As Integer = 1,
|
Optional CveMoneda As Integer = 1, Optional RetISR As Double = 0, Optional PrecioMinimo As Decimal = Nothing, Optional CveTipoFactor As Integer = 1,
|
||||||
Optional CveFraccionArancelaria As Integer = -1, Optional CveClasificacionDetalle As Integer = -1, Optional CveTamaño As Integer = -1,
|
Optional CveFraccionArancelaria As Integer = -1, Optional CveClasificacionDetalle As Integer = -1, Optional CveTamaño As Integer = -1,
|
||||||
Optional CveModelo As Integer = -1, Optional CveMedida As Integer = -1, Optional CveRinTamaño As Integer = -1, Optional ClaveImpuestoEmpaque As String = "", Optional ClaveImpuestoUM As String = "",
|
Optional CveModelo As Integer = -1, Optional CveMedida As Integer = -1, Optional CveRinTamaño As Integer = -1, Optional ClaveImpuestoEmpaque As String = "", Optional ClaveImpuestoUM As String = "",
|
||||||
Optional ClaveCategoriaToxicidad As String = "", Optional ClaveImpuestoTipoProducto As String = "", Optional Litraje As Double = -1) As Integer
|
Optional ClaveCategoriaToxicidad As String = "", Optional ClaveImpuestoTipoProducto As String = "", Optional Litraje As Double = -1, Optional EsOutSourcing As Boolean = False) As Integer
|
||||||
Dim Retorno As Integer = -1
|
Dim Retorno As Integer = -1
|
||||||
|
|
||||||
DataAdapter("PA_ProductosServiciosAdd")
|
DataAdapter("PA_ProductosServiciosAdd")
|
||||||
@@ -461,7 +462,7 @@ Public Class ClsProductosServicios
|
|||||||
.Add("@ClaveImpuestoUM", SqlDbType.VarChar).Value = ClaveImpuestoUM
|
.Add("@ClaveImpuestoUM", SqlDbType.VarChar).Value = ClaveImpuestoUM
|
||||||
.Add("@ClaveCategoriaToxicidad", SqlDbType.VarChar).Value = ClaveCategoriaToxicidad
|
.Add("@ClaveCategoriaToxicidad", SqlDbType.VarChar).Value = ClaveCategoriaToxicidad
|
||||||
.Add("@Litraje", SqlDbType.Float).Value = Litraje
|
.Add("@Litraje", SqlDbType.Float).Value = Litraje
|
||||||
|
.Add("@EsOutSourcing", SqlDbType.Bit).Value = EsOutSourcing
|
||||||
End With
|
End With
|
||||||
|
|
||||||
Try
|
Try
|
||||||
@@ -607,7 +608,7 @@ Public Class ClsProductosServicios
|
|||||||
Optional CveMoneda As Integer = 1, Optional RetISR As Double = 0, Optional PrecioMinimo As Decimal = Nothing, Optional CveTipoFactor As Integer = 1,
|
Optional CveMoneda As Integer = 1, Optional RetISR As Double = 0, Optional PrecioMinimo As Decimal = Nothing, Optional CveTipoFactor As Integer = 1,
|
||||||
Optional CveFraccionArancelaria As Integer = -1, Optional CveUsuarioModifico As Integer = -1,
|
Optional CveFraccionArancelaria As Integer = -1, Optional CveUsuarioModifico As Integer = -1,
|
||||||
Optional CveClasificacionDetalle As Integer = -1, Optional CveTamaño As Integer = -1, Optional CveModelo As Integer = -1, Optional CveMedida As Integer = -1, Optional CveRinTamaño As Integer = -1, Optional ClaveImpuestoEmpaque As String = "", Optional ClaveImpuestoUM As String = "",
|
Optional CveClasificacionDetalle As Integer = -1, Optional CveTamaño As Integer = -1, Optional CveModelo As Integer = -1, Optional CveMedida As Integer = -1, Optional CveRinTamaño As Integer = -1, Optional ClaveImpuestoEmpaque As String = "", Optional ClaveImpuestoUM As String = "",
|
||||||
Optional ClaveCategoriaToxicidad As String = "", Optional ClaveImpuestoTipoProducto As String = "", Optional Litraje As Double = -1) As Boolean
|
Optional ClaveCategoriaToxicidad As String = "", Optional ClaveImpuestoTipoProducto As String = "", Optional Litraje As Double = -1, Optional EsOutSourcing As Boolean = False) As Boolean
|
||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
|
|
||||||
DataAdapter("PA_ProductosServiciosUpdate")
|
DataAdapter("PA_ProductosServiciosUpdate")
|
||||||
@@ -681,7 +682,7 @@ Public Class ClsProductosServicios
|
|||||||
.Add("@ClaveImpuestoUM", SqlDbType.VarChar).Value = ClaveImpuestoUM
|
.Add("@ClaveImpuestoUM", SqlDbType.VarChar).Value = ClaveImpuestoUM
|
||||||
.Add("@ClaveCategoriaToxicidad", SqlDbType.VarChar).Value = ClaveCategoriaToxicidad
|
.Add("@ClaveCategoriaToxicidad", SqlDbType.VarChar).Value = ClaveCategoriaToxicidad
|
||||||
.Add("@Litraje", SqlDbType.Float).Value = Litraje
|
.Add("@Litraje", SqlDbType.Float).Value = Litraje
|
||||||
|
.Add("@EsOutSourcing", SqlDbType.Bit).Value = EsOutSourcing
|
||||||
End With
|
End With
|
||||||
|
|
||||||
Try
|
Try
|
||||||
|
|||||||
@@ -65,17 +65,18 @@
|
|||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
<asp:GridView ID="GvCompras" Width="99%" runat="server" AutoGenerateColumns="False"
|
<asp:GridView ID="GvCompras" Width="99%" runat="server" AutoGenerateColumns="False"
|
||||||
DataKeyNames="CveCompra,CveProveedor,Fluctuacion,SerieFolio"
|
DataKeyNames="CveCompra,CveProveedor,Fluctuacion,SerieFolio,FluctuacionTotal,GananciaPerdida"
|
||||||
EmptyDataText="No se Encontraron compras pendientes de pagar." ToolTip="Listado de Compras"
|
EmptyDataText="No se Encontraron compras pendientes de pagar." ToolTip="Listado de Compras"
|
||||||
CssClass="table table-hover table-striped ScrollAD mysmallbtn" GridLines="None">
|
CssClass="table table-hover table-striped ScrollAD mysmallbtn" GridLines="None">
|
||||||
<Columns>
|
<Columns>
|
||||||
<asp:HyperLinkField HeaderText="Proveedor" DataTextField="NombreComercial" Target="_blank" ItemStyle-HorizontalAlign="Left" DataNavigateUrlFormatString="/Compras/Proveedores.aspx?CveProveedor={0}" DataNavigateUrlFields="CveProveedor" />
|
<asp:HyperLinkField HeaderText="Proveedor" DataTextField="NombreComercial" Target="_blank" ItemStyle-HorizontalAlign="Left" DataNavigateUrlFormatString="/Compras/Proveedores.aspx?CveProveedor={0}" DataNavigateUrlFields="CveProveedor" />
|
||||||
<asp:BoundField HeaderText="# Facturas" DataField="SerieFolio" ItemStyle-HorizontalAlign="Left" />
|
<asp:BoundField HeaderText="# Facturas" DataField="SerieFolio" ItemStyle-HorizontalAlign="Left" />
|
||||||
<asp:BoundField HeaderText="Saldo USD" DataField="Saldo" DataFormatString="{0:N2}" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Right" />
|
<asp:BoundField HeaderText="Saldo USD" DataField="Saldo" DataFormatString="{0:N2}" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Right" />
|
||||||
<asp:BoundField HeaderText="Fluctuación Pesos" DataField="Fluctuacion" DataFormatString="{0:N2}" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Right" />
|
<asp:BoundField HeaderText="Fluctuación Pesos" DataField="FluctuacionTotal" DataFormatString="{0:N2}" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Right" />
|
||||||
|
<asp:BoundField HeaderText="Perdida o Ganancia" DataField="GananciaPerdida" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Left" />
|
||||||
</Columns>
|
</Columns>
|
||||||
</asp:GridView>
|
</asp:GridView>
|
||||||
<asp:Label ID="LblTotalCompras" runat="server" Text=""></asp:Label>
|
<%--<asp:Label ID="LblTotalCompras" runat="server" Text=""></asp:Label>--%>
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</ajax:TabPanel>
|
</ajax:TabPanel>
|
||||||
<ajax:TabPanel runat="server" ID="TabVentas" HeaderText="Ventas">
|
<ajax:TabPanel runat="server" ID="TabVentas" HeaderText="Ventas">
|
||||||
|
|||||||
@@ -7,7 +7,14 @@ Partial Class Bancos_FluctuacionCambiaria
|
|||||||
Inherits ClsPaginas
|
Inherits ClsPaginas
|
||||||
|
|
||||||
#Region "PROPIEDADES"
|
#Region "PROPIEDADES"
|
||||||
|
Private Property LblTotal() As String
|
||||||
|
Get
|
||||||
|
Return ViewState("Total").ToString
|
||||||
|
End Get
|
||||||
|
Set(value As String)
|
||||||
|
ViewState("Total") = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||||
@@ -60,16 +67,20 @@ Partial Class Bancos_FluctuacionCambiaria
|
|||||||
|
|
||||||
Private Sub CargaDatosCompra()
|
Private Sub CargaDatosCompra()
|
||||||
Dim ObjBancos As New ClsBancos
|
Dim ObjBancos As New ClsBancos
|
||||||
LblTotalCompras.Text = "0.00"
|
'LblTotalCompras.Text = "0.00"
|
||||||
If ObjBancos.GetFluctuaciones(TxtFecha.Text.ToDate, 1, UsuarioActual.CveEmpresa) Then
|
If ObjBancos.GetFluctuaciones(TxtFecha.Text.ToDate, 1, UsuarioActual.CveEmpresa) Then
|
||||||
GvCompras.DataSource = ObjBancos.DtResultados
|
GvCompras.DataSource = ObjBancos.DtResultados
|
||||||
LblTotalCompras.Text = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero
|
'LblTotalCompras.Text = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero
|
||||||
|
LblTotal = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero
|
||||||
Else
|
Else
|
||||||
GvCompras.DataSource = Nothing
|
GvCompras.DataSource = Nothing
|
||||||
Alert("Ocurrio un error al cargar las compras", TipoMensaje.MsgAdvertencia)
|
Alert("Ocurrio un error al cargar las compras", TipoMensaje.MsgAdvertencia)
|
||||||
End If
|
End If
|
||||||
ObjBancos.Dispose()
|
ObjBancos.Dispose()
|
||||||
GvCompras.DataBind()
|
GvCompras.DataBind()
|
||||||
|
If GvCompras.Rows.Count > 0 Then
|
||||||
|
GvCompras.Rows(GvCompras.Rows.Count - 1).CssClass = "SubTotales2"
|
||||||
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub CargaDatosVentas()
|
Private Sub CargaDatosVentas()
|
||||||
@@ -201,7 +212,7 @@ Partial Class Bancos_FluctuacionCambiaria
|
|||||||
Dim TC As Decimal = 2 ' se pone 2, para que cumpla con el check constrains de complementarias
|
Dim TC As Decimal = 2 ' se pone 2, para que cumpla con el check constrains de complementarias
|
||||||
|
|
||||||
|
|
||||||
Total = LblTotalCompras.Text.ToDecimal
|
Total = LblTotal.ToDecimal
|
||||||
If Total > 0 Then
|
If Total > 0 Then
|
||||||
CveConceptoContable = 64
|
CveConceptoContable = 64
|
||||||
CveCuenta = CveCuentaGanancia
|
CveCuenta = CveCuentaGanancia
|
||||||
|
|||||||
@@ -907,8 +907,10 @@
|
|||||||
<td runat="server" id="tdT5" visible="false">
|
<td runat="server" id="tdT5" visible="false">
|
||||||
<asp:Label Text="" ID="LbIVAOriginal" runat="server" />
|
<asp:Label Text="" ID="LbIVAOriginal" runat="server" />
|
||||||
</td>
|
</td>
|
||||||
<td runat="server" id="tdIVA6" visible="false">
|
<td runat="server" id="tdIVA6" visible="false" class="label label-sm label-success" style="color:white!important" >
|
||||||
<asp:LinkButton runat="server" ID="LnkActivaIva6" Text="" ToolTip="Ret IVA Servicios" OnClick="LnkActivaIva6_Click"><i class="fa fa-usd" aria-hidden="true"></i></asp:LinkButton>
|
|
||||||
|
<asp:LinkButton runat="server" ID="LnkActivaIva6" Text="" ToolTip="Ret IVA Servicios" OnClick="LnkActivaIva6_Click" style="color:white!important" >Deglose 6%</asp:LinkButton>
|
||||||
|
<%--<asp:LinkButton runat="server" ID="LnkActivaIva6" Text="" ToolTip="Ret IVA Servicios" OnClick="LnkActivaIva6_Click"><i class="fa fa-usd" aria-hidden="true"></i></asp:LinkButton>--%>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<%--<td align="left" runat="server" id="TdIVA" visible="false">
|
<%--<td align="left" runat="server" id="TdIVA" visible="false">
|
||||||
|
|||||||
@@ -1025,10 +1025,17 @@ Partial Class Compras_Compras
|
|||||||
Set(value As Double)
|
Set(value As Double)
|
||||||
ViewState("SubTotal2Original") = value
|
ViewState("SubTotal2Original") = value
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Private Property IVAOriginal As Double
|
Private Property IVAOriginal As Double
|
||||||
Get
|
Get
|
||||||
Return ViewState("IVAOriginal").ToString.ToDouble
|
|
||||||
|
If ViewState("IVAOriginal") Is Nothing Then
|
||||||
|
Return 0
|
||||||
|
Else
|
||||||
|
Return ViewState("IVAOriginal").ToString.ToDouble
|
||||||
|
End If
|
||||||
|
|
||||||
End Get
|
End Get
|
||||||
Set(value As Double)
|
Set(value As Double)
|
||||||
ViewState("IVAOriginal") = value
|
ViewState("IVAOriginal") = value
|
||||||
@@ -2087,8 +2094,12 @@ Partial Class Compras_Compras
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
DdlRetIVAConcepto.Items.Add(New ListItem("Arrendamiento", "4"))
|
DdlRetIVAConcepto.Items.Add(New ListItem("Arrendamiento", "4"))
|
||||||
DdlRetIVAConcepto.Items.Add(New ListItem("Ret IVA Servicios", "5"))
|
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(577).ToEntero = 1 Then
|
||||||
|
DdlRetIVAConcepto.Items.Add(New ListItem("Ret IVA Servicios", "5"))
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
@@ -2237,15 +2248,15 @@ Partial Class Compras_Compras
|
|||||||
|
|
||||||
If UsuarioActual.Empresa.Funcionalidad(577).ToString = "1" Then
|
If UsuarioActual.Empresa.Funcionalidad(577).ToString = "1" Then
|
||||||
|
|
||||||
'If UsuarioActual.CveRol = 1 Then
|
|
||||||
' Alert("Ok funcionalidad 577")
|
|
||||||
'End If
|
|
||||||
|
|
||||||
|
|
||||||
If RetencionIVA = 0 And IVAOriginal > 0 Then
|
If RetencionIVA = 0 And IVAOriginal > 0 Then
|
||||||
For Each dRow As DataRow In TmpDT.Rows
|
For Each dRow As DataRow In TmpDT.Rows
|
||||||
If dRow("CveTipoPS").ToString.ToEntero = 1 Then
|
If dRow("CveTipoPS").ToString.ToEntero = 1 Then
|
||||||
tdIVA6.Visible = True
|
|
||||||
|
'comentado para reubicar el boton
|
||||||
|
'tdIVA6.Visible = True
|
||||||
|
|
||||||
|
|
||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
@@ -17024,8 +17035,9 @@ Partial Class Compras_Compras
|
|||||||
|
|
||||||
If RetencionIVA = 0 And IVAOriginal > 0 Then
|
If RetencionIVA = 0 And IVAOriginal > 0 Then
|
||||||
For Each dRow As DataRow In TmpDT.Rows
|
For Each dRow As DataRow In TmpDT.Rows
|
||||||
If dRow("CveTipoPS").ToString.ToEntero = 1 Then
|
If dRow("CveTipoPS").ToString.ToEntero = 1 Then
|
||||||
tdIVA6.Visible = True
|
'Comnetado para reubicar el boton
|
||||||
|
'tdIVA6.Visible = True
|
||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
@@ -19305,7 +19317,7 @@ Partial Class Compras_Compras
|
|||||||
|
|
||||||
DdlRetIVAConcepto.SelectedValueExist("5")
|
DdlRetIVAConcepto.SelectedValueExist("5")
|
||||||
|
|
||||||
LblRetIVA.Text = "0.06%"
|
LblRetIVA.Text = "6.0%"
|
||||||
|
|
||||||
RetencionIVA = TmpDT.SUMD("RetIVA")
|
RetencionIVA = TmpDT.SUMD("RetIVA")
|
||||||
TxtRetIVA.Text = RetencionIVA.ToString("###,###,###.00")
|
TxtRetIVA.Text = RetencionIVA.ToString("###,###,###.00")
|
||||||
|
|||||||
@@ -434,7 +434,7 @@ Partial Class Compras_ReembolsosComprobaciones
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
Dim FolioIENew = ObjIE.GetNextFolio(If(CveCajaChica > 0, CveCajaChica, CvePersonal), 8).ToString
|
Dim FolioIENew = ObjIE.GetNextFolio(If(CveCajaChica > 0, CveCajaChica, CvePersonal), 8).ToString
|
||||||
CveIECajaChica = ObjIE.AddBancos_IE(CveCajaChica, 8, TxtFechaDocumento.Text.Trim.ToDate, FolioIENew, String.Format("Transferencia Cta: {0}", DdlCajaChica.SelectedItem), TxtImporteVinculado.Text.ToDecimal, CveMoneda, 0, TxtObservaciones.Text.Trim, "", False, False, -1, CvePrePolizaIERegistrado, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FueConciliado:=If(ChkReembolsarSinBancos.Checked Or CveCajaChica > 0, True, False))
|
CveIECajaChica = ObjIE.AddBancos_IE(CveCajaChica, 8, If(ChkReembolsarSinBancos.Checked, TxtFechaPrePoliza.Text.ToDate, TxtFechaDocumento.Text.Trim.ToDate), FolioIENew, String.Format("Transferencia Cta: {0}", DdlCajaChica.SelectedItem), TxtImporteVinculado.Text.ToDecimal, CveMoneda, 0, TxtObservaciones.Text.Trim, "", False, False, -1, CvePrePolizaIERegistrado, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FueConciliado:=If(ChkReembolsarSinBancos.Checked Or CveCajaChica > 0, True, False))
|
||||||
'AGREGO PREPOLIZA IE BANCOS
|
'AGREGO PREPOLIZA IE BANCOS
|
||||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaIERegistrado, True, TxtImporteVinculado.Text.ToDecimal, String.Format("Transferencia Cta: {0}", DdlCajaChica.SelectedItem), 30, TxtObservaciones.Text, TxtFechaDocumento.Text.ToDate, IdCuentaBancaria, -1, CveIE:=CveIECajaChica, ImporteME:=If(tipoCambio = 1, 0, TxtImporteVinculado.Text.ToDecimal), ImporteMX:=TxtImporteVinculado.Text.ToDecimal * tipoCambio) Then
|
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaIERegistrado, True, TxtImporteVinculado.Text.ToDecimal, String.Format("Transferencia Cta: {0}", DdlCajaChica.SelectedItem), 30, TxtObservaciones.Text, TxtFechaDocumento.Text.ToDate, IdCuentaBancaria, -1, CveIE:=CveIECajaChica, ImporteME:=If(tipoCambio = 1, 0, TxtImporteVinculado.Text.ToDecimal), ImporteMX:=TxtImporteVinculado.Text.ToDecimal * tipoCambio) Then
|
||||||
MsgError = "Error al registrar detalle de concepto bancario"
|
MsgError = "Error al registrar detalle de concepto bancario"
|
||||||
|
|||||||
@@ -2815,6 +2815,9 @@ Partial Class Compras_eFacturas
|
|||||||
CveProveedor = gvRow.DataKey("CveProveedor").ToEntero
|
CveProveedor = gvRow.DataKey("CveProveedor").ToEntero
|
||||||
Dim ObjCompras As New ClsCompras
|
Dim ObjCompras As New ClsCompras
|
||||||
|
|
||||||
|
|
||||||
|
Dim TieneRegistros As Boolean = False
|
||||||
|
|
||||||
If ObjCompras.GetCompararComplementoPago(gvRow.DataKey("CveProveedor").ToEntero, Monto, nodePagos2.InnerXml.Replace("pago10:", ""), UsuarioActual.CveEmpresa) Then
|
If ObjCompras.GetCompararComplementoPago(gvRow.DataKey("CveProveedor").ToEntero, Monto, nodePagos2.InnerXml.Replace("pago10:", ""), UsuarioActual.CveEmpresa) Then
|
||||||
GvVincularPago.DataSource = ObjCompras.DtResultados
|
GvVincularPago.DataSource = ObjCompras.DtResultados
|
||||||
|
|
||||||
@@ -2822,7 +2825,7 @@ Partial Class Compras_eFacturas
|
|||||||
SerieFolioIE = ObjCompras.DtResultados.Rows(0)("SerieFolio").ToString
|
SerieFolioIE = ObjCompras.DtResultados.Rows(0)("SerieFolio").ToString
|
||||||
DivVincularPagoManualmente.Visible = False
|
DivVincularPagoManualmente.Visible = False
|
||||||
BtnVincularPago.Visible = True
|
BtnVincularPago.Visible = True
|
||||||
|
TieneRegistros = True
|
||||||
Else
|
Else
|
||||||
DivVincularPagoManualmente.Visible = True
|
DivVincularPagoManualmente.Visible = True
|
||||||
BtnVincularPago.Visible = False
|
BtnVincularPago.Visible = False
|
||||||
@@ -2835,6 +2838,7 @@ Partial Class Compras_eFacturas
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
For Each drow As DataRow In ObjCompras.DtResultados.FiltraParametros("CveIE > 0 AND FechaDocumento IS NOT NULL", "", {"FechaDocumento"}).Rows
|
For Each drow As DataRow In ObjCompras.DtResultados.FiltraParametros("CveIE > 0 AND FechaDocumento IS NOT NULL", "", {"FechaDocumento"}).Rows
|
||||||
|
|
||||||
Dim FechaDocumento As Date = drow("FechaDocumento").ToString.ToDate
|
Dim FechaDocumento As Date = drow("FechaDocumento").ToString.ToDate
|
||||||
@@ -2873,12 +2877,18 @@ Partial Class Compras_eFacturas
|
|||||||
TextoDiferenciaImporte = $"<b> - IE ${ImporteIES.FormatoNumero}</b> <div style='color:red'><strong>Diferencia { DiferenciaImportes.FormatoNumero() }</strong></div>"
|
TextoDiferenciaImporte = $"<b> - IE ${ImporteIES.FormatoNumero}</b> <div style='color:red'><strong>Diferencia { DiferenciaImportes.FormatoNumero() }</strong></div>"
|
||||||
BtnVincularPago.Visible = False
|
BtnVincularPago.Visible = False
|
||||||
MSGComplemento = MSGComplemento & $" Existe una diferencia mayor a $5.00 ({Math.Abs(DiferenciaImportes)})"
|
MSGComplemento = MSGComplemento & $" Existe una diferencia mayor a $5.00 ({Math.Abs(DiferenciaImportes)})"
|
||||||
|
|
||||||
|
If TieneRegistros AndAlso UsuarioActual.TienePermisoProceso(286) Then
|
||||||
|
DivVincularPagoManualmente.Visible = True
|
||||||
|
End If
|
||||||
|
|
||||||
Else
|
Else
|
||||||
'BtnVincularPago.Visible = True
|
'BtnVincularPago.Visible = True
|
||||||
'TextoDiferenciaImporte = ""
|
'TextoDiferenciaImporte = ""
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
LblSerieFolioPago.Text = $"{SeriePago}-{FolioPago}"
|
LblSerieFolioPago.Text = $"{SeriePago}-{FolioPago}"
|
||||||
LblImportePago.Text = Monto.ToString("###,###,###.00") 'ImportePago.FormatoNumero
|
LblImportePago.Text = Monto.ToString("###,###,###.00") 'ImportePago.FormatoNumero
|
||||||
LblPagosCantidad.Text = PagosCantidad.ToString
|
LblPagosCantidad.Text = PagosCantidad.ToString
|
||||||
@@ -2893,7 +2903,7 @@ Partial Class Compras_eFacturas
|
|||||||
Else
|
Else
|
||||||
LblMensajeComlementoError.Text = ""
|
LblMensajeComlementoError.Text = ""
|
||||||
DVMensajecomplementoError.Visible = False
|
DVMensajecomplementoError.Visible = False
|
||||||
|
DivVincularPagoManualmente.Visible = False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -462,6 +462,13 @@
|
|||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
<ItemStyle HorizontalAlign="Left" Width="300px" />
|
<ItemStyle HorizontalAlign="Left" Width="300px" />
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
|
<asp:TemplateField Visible="false">
|
||||||
|
<HeaderTemplate>TC</HeaderTemplate>
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:Literal ID="LtlTC" runat="server" Text='<%# String.Format("{0}-${1}", Eval("TC"), Eval("ImporteME", "{0:N2}")) %>'></asp:Literal><br />
|
||||||
|
</ItemTemplate>
|
||||||
|
<ItemStyle HorizontalAlign="Left" Width="300px" />
|
||||||
|
</asp:TemplateField>
|
||||||
<asp:TemplateField>
|
<asp:TemplateField>
|
||||||
<HeaderTemplate>Cargo</HeaderTemplate>
|
<HeaderTemplate>Cargo</HeaderTemplate>
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
|
|||||||
@@ -396,6 +396,10 @@ Partial Class ContabilidadC_RegPrePoliza
|
|||||||
GvPrePoliza.DataSource = DtMovimientos
|
GvPrePoliza.DataSource = DtMovimientos
|
||||||
GvPrePoliza.DataBind()
|
GvPrePoliza.DataBind()
|
||||||
|
|
||||||
|
If UsuarioActual.CveRol = 1 AndAlso DtMovimientos.COUNT("TC", "TC > 1") > 0 Then
|
||||||
|
GvPrePoliza.Columns(7).Visible = True
|
||||||
|
End If
|
||||||
|
|
||||||
If DtMovimientos.FiltraParametros("CveConceptoContable IN (2,17)").Rows.Count > 0 Then
|
If DtMovimientos.FiltraParametros("CveConceptoContable IN (2,17)").Rows.Count > 0 Then
|
||||||
LnkComplementoPago.Visible = True
|
LnkComplementoPago.Visible = True
|
||||||
End If
|
End If
|
||||||
|
|||||||
@@ -1334,7 +1334,7 @@
|
|||||||
<Width>8.01986in</Width>
|
<Width>8.01986in</Width>
|
||||||
<Page>
|
<Page>
|
||||||
<PageHeader>
|
<PageHeader>
|
||||||
<Height>0.81597in</Height>
|
<Height>1.14931in</Height>
|
||||||
<PrintOnFirstPage>true</PrintOnFirstPage>
|
<PrintOnFirstPage>true</PrintOnFirstPage>
|
||||||
<PrintOnLastPage>true</PrintOnLastPage>
|
<PrintOnLastPage>true</PrintOnLastPage>
|
||||||
<ReportItems>
|
<ReportItems>
|
||||||
@@ -1444,23 +1444,32 @@
|
|||||||
<Paragraphs>
|
<Paragraphs>
|
||||||
<Paragraph>
|
<Paragraph>
|
||||||
<TextRuns>
|
<TextRuns>
|
||||||
|
<TextRun>
|
||||||
|
<Value>Cuenta: </Value>
|
||||||
|
<Style>
|
||||||
|
<FontFamily>Verdana</FontFamily>
|
||||||
|
<FontSize>8pt</FontSize>
|
||||||
|
<FontWeight>Bold</FontWeight>
|
||||||
|
</Style>
|
||||||
|
</TextRun>
|
||||||
<TextRun>
|
<TextRun>
|
||||||
<Value>=Parameters!Cuenta.Value</Value>
|
<Value>=Parameters!Cuenta.Value</Value>
|
||||||
<Style>
|
<Style>
|
||||||
<FontSize>11pt</FontSize>
|
<FontFamily>Verdana</FontFamily>
|
||||||
|
<FontSize>8pt</FontSize>
|
||||||
|
<FontWeight>Bold</FontWeight>
|
||||||
</Style>
|
</Style>
|
||||||
</TextRun>
|
</TextRun>
|
||||||
</TextRuns>
|
</TextRuns>
|
||||||
<Style>
|
<Style>
|
||||||
<TextAlign>Center</TextAlign>
|
<TextAlign>Left</TextAlign>
|
||||||
</Style>
|
</Style>
|
||||||
</Paragraph>
|
</Paragraph>
|
||||||
</Paragraphs>
|
</Paragraphs>
|
||||||
<rd:DefaultName>Cuenta</rd:DefaultName>
|
<rd:DefaultName>Cuenta</rd:DefaultName>
|
||||||
<Top>0.47708in</Top>
|
<Top>0.84375in</Top>
|
||||||
<Left>1.82615in</Left>
|
|
||||||
<Height>0.25in</Height>
|
<Height>0.25in</Height>
|
||||||
<Width>4.42313in</Width>
|
<Width>5.42127in</Width>
|
||||||
<ZIndex>3</ZIndex>
|
<ZIndex>3</ZIndex>
|
||||||
<Style>
|
<Style>
|
||||||
<Border>
|
<Border>
|
||||||
|
|||||||
@@ -625,10 +625,10 @@ Partial Class Inventarios_RecepcionEntrega
|
|||||||
Dim Filtro As String '= If(ObjInventario.DtResultados.Rows(0)("TipoDocto").ToString.Contiene({"Ing", "Dev", "Ped"}), "CveConcepto = 3", "CveConcepto = 9")
|
Dim Filtro As String '= If(ObjInventario.DtResultados.Rows(0)("TipoDocto").ToString.Contiene({"Ing", "Dev", "Ped"}), "CveConcepto = 3", "CveConcepto = 9")
|
||||||
Select Case ObjInventario.DtResultados.Rows(0)("TipoDocto").ToString
|
Select Case ObjInventario.DtResultados.Rows(0)("TipoDocto").ToString
|
||||||
Case "Ing", "Ped"
|
Case "Ing", "Ped"
|
||||||
Filtro = "CveConcepto = 3"
|
Filtro = "CveConcepto IN (3,40)"
|
||||||
Case "Dev"
|
Case "Dev"
|
||||||
'cuand es devolucionventa=1, es cancelación de la devolución
|
'cuand es devolucionventa=1, es cancelación de la devolución
|
||||||
If EsDevolucionVenta = 1 Then Filtro = "CveConcepto = 18" Else Filtro = "CveConcepto = 3"
|
If EsDevolucionVenta = 1 Then Filtro = "CveConcepto = 18" Else Filtro = "CveConcepto IN (3,40)"
|
||||||
Case Else
|
Case Else
|
||||||
Filtro = "CveConcepto = 9"
|
Filtro = "CveConcepto = 9"
|
||||||
End Select
|
End Select
|
||||||
@@ -1640,7 +1640,7 @@ Partial Class Inventarios_RecepcionEntrega
|
|||||||
Dim CantidadSaldo As Decimal = 0
|
Dim CantidadSaldo As Decimal = 0
|
||||||
|
|
||||||
|
|
||||||
If CveVendedor > 0 AndAlso (UsuarioActual.Empresa.Funcionalidad(146) = "1" Or CveCliente > 0) AndAlso TipoDocto <> "Ped" Then 'no debe considerar cuando es pedido de contrato
|
If CveVendedor > 0 AndAlso (UsuarioActual.Empresa.Funcionalidad(146) = "1" Or CveCliente > 0) Then 'no debe considerar cuando es pedido de contrato
|
||||||
If TipoMovimiento = 1 Then ' SI ES DEVOLUCION NO APLICA APARTADO
|
If TipoMovimiento = 1 Then ' SI ES DEVOLUCION NO APLICA APARTADO
|
||||||
' SALIDA POR TRASPASO DE LOS ALMACENES DE APARTADO
|
' SALIDA POR TRASPASO DE LOS ALMACENES DE APARTADO
|
||||||
For Each Dr As DataRow In DtDatos.Rows
|
For Each Dr As DataRow In DtDatos.Rows
|
||||||
|
|||||||
@@ -945,10 +945,12 @@ Partial Class Inventarios_ResguardoMaterial
|
|||||||
Dim Fecha As DateTime = TxtFechaVigencia.Text.Trim().ToDateTime()
|
Dim Fecha As DateTime = TxtFechaVigencia.Text.Trim().ToDateTime()
|
||||||
Dim FechaI As DateTime = Fecha
|
Dim FechaI As DateTime = Fecha
|
||||||
Dim FechaF As DateTime = Fecha.AddHours(22)
|
Dim FechaF As DateTime = Fecha.AddHours(22)
|
||||||
|
If Fecha > MinFecha Then
|
||||||
TieneError = Not ObjEventos.AddEventoAgenda(CveAgendaTipo, Asunto, Descripcion, Prioridad, FechaI, FechaF, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa,
|
TieneError = Not ObjEventos.AddEventoAgenda(CveAgendaTipo, Asunto, Descripcion, Prioridad, FechaI, FechaF, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa,
|
||||||
RecurrenciaTipo:=RecurrenciaTipo, Frecuencia:=Frecuencia, DiasSemana:=DiasSemana, Dia:=Dias, Mes:=Mes, RecurrenciaFin:=RecurrenciaFin, CveTipoEvento:=CveTipoEvento, Importe:=Importe)
|
RecurrenciaTipo:=RecurrenciaTipo, Frecuencia:=Frecuencia, DiasSemana:=DiasSemana, Dia:=Dias, Mes:=Mes, RecurrenciaFin:=RecurrenciaFin, CveTipoEvento:=CveTipoEvento, Importe:=Importe)
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
Return Not TieneError
|
Return Not TieneError
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|||||||
@@ -2240,7 +2240,7 @@ Partial Class OC
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
'Valida que tenga proveedore
|
'Valida que tenga proveedore
|
||||||
If (EsNuevo = True AndAlso TipoOC.ToUpper = "OC"4) AndAlso DdlProveedores.SelectedValue.ToEntero() <= 0 Then
|
If (EsNuevo = True AndAlso TipoOC.ToUpper = "OC") AndAlso DdlProveedores.SelectedValue.ToEntero() <= 0 Then
|
||||||
Alert("Debe seleccionar un proveedor.", TipoMensaje.MsgAdvertencia)
|
Alert("Debe seleccionar un proveedor.", TipoMensaje.MsgAdvertencia)
|
||||||
TieneError = True
|
TieneError = True
|
||||||
End If
|
End If
|
||||||
@@ -6980,21 +6980,23 @@ Partial Class OC
|
|||||||
TxtRetIVA.Text = TxtRetIVA.Text.FormatoNumero
|
TxtRetIVA.Text = TxtRetIVA.Text.FormatoNumero
|
||||||
HdnRetIVA.Value = TxtRetIVA.Text
|
HdnRetIVA.Value = TxtRetIVA.Text
|
||||||
|
|
||||||
Dim Porcentaje = TxtRetIVA.Text.ToDecimal / DtDetalle.SUM("Total")
|
Dim Porcentaje As Decimal = TxtRetIVA.Text.ToDecimal / DtDetalle.SUM("Total")
|
||||||
Dim LastDr As DataRow = Nothing
|
Dim LastDr As DataRow = Nothing
|
||||||
For Each Dr As DataRow In DtDetalle.Rows
|
For Each Dr As DataRow In DtDetalle.Rows
|
||||||
Dr("RetIVA") = (Math.Truncate((Dr("Total").ToString.ToDecimal * Porcentaje) * 100)) / 100
|
'Dr("RetIVA") = (Math.Truncate((Dr("Total").ToString.ToDecimal * Porcentaje) * 100)) / 100
|
||||||
|
Dr("RetIVA") = Math.Round((Dr("Total").ToString.ToDecimal * Porcentaje), 2)
|
||||||
|
'Dr("RetIVA") = Math.Round((Dr("Cantidad").ToString.ToDecimal * Dr("Importe").ToString.ToDecimal * Porcentaje), 2)
|
||||||
Dr("RetIVAPorcentaje") = Porcentaje
|
Dr("RetIVAPorcentaje") = Porcentaje
|
||||||
' Tipo Dato '0' es Cuando es Nuevo, '1' para editar y '2' viene de la BD
|
' Tipo Dato '0' es Cuando es Nuevo, '1' para editar y '2' viene de la BD
|
||||||
Dr("TipoDato") = If(Dr("TipoDato").ToString.ToEntero = 0, 0, 1)
|
Dr("TipoDato") = If(Dr("TipoDato").ToString.ToEntero = 0, 0, 1)
|
||||||
LastDr = Dr
|
LastDr = Dr
|
||||||
Next
|
Next
|
||||||
If Not IsNothing(LastDr) Then
|
'If Not IsNothing(LastDr) Then
|
||||||
Dim Fdes As Decimal = TxtRetIVA.Text.ToDecimal - DtDetalle.SUM("RetIVA").ToString.ToDecimal
|
' Dim Fdes As Decimal = TxtRetIVA.Text.ToDecimal - DtDetalle.SUM("RetIVA").ToString.ToDecimal
|
||||||
If Fdes > 0 Then
|
' If Fdes > 0 Then
|
||||||
LastDr("RetIVA") = LastDr("RetIVA").ToString.ToDecimal + Fdes
|
' LastDr("RetIVA") = LastDr("RetIVA").ToString.ToDecimal + Fdes
|
||||||
End If
|
' End If
|
||||||
End If
|
'End If
|
||||||
|
|
||||||
'Alert(String.Format("Descuento:{0}", DtDetalle.SUM("Descuento")))
|
'Alert(String.Format("Descuento:{0}", DtDetalle.SUM("Descuento")))
|
||||||
|
|
||||||
|
|||||||
@@ -838,20 +838,20 @@
|
|||||||
</div>
|
</div>
|
||||||
<div id="DivRetenciones" runat="server">
|
<div id="DivRetenciones" runat="server">
|
||||||
<div id="DivTipoRetenciones" runat="server" visible="false" class="form-group form-md-line-input input-iconright">
|
<div id="DivTipoRetenciones" runat="server" visible="false" class="form-group form-md-line-input input-iconright">
|
||||||
<asp:DropDownList ID="DdlTipoRetencion" CssClass="form-control select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="MetodoPago" DataValueField="CveMetodoPago" ValidationGroup="GrpGuardar">
|
<asp:DropDownList ID="DdlTipoRetencion" AutoPostBack="true" OnSelectedIndexChanged="DdlTipoRetencion_SelectedIndexChanged" CssClass="form-control select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true">
|
||||||
<asp:ListItem Selected="True" Text="Sin Retención" Value="0"></asp:ListItem>
|
<asp:ListItem Selected="True" Text="Sin Retención" Value="0"></asp:ListItem>
|
||||||
<asp:ListItem Text="Arrendamiento" Value="1"></asp:ListItem>
|
<asp:ListItem Text="Arrendamiento" Value="1"></asp:ListItem>
|
||||||
<asp:ListItem Text="Servicios Profesionales" Value="2"></asp:ListItem>
|
<asp:ListItem Text="Servicios Profesionales" Value="2"></asp:ListItem>
|
||||||
<asp:ListItem Text="Fletes" Value="3"></asp:ListItem>
|
<asp:ListItem Text="Fletes" Value="3"></asp:ListItem>
|
||||||
<asp:ListItem Text="Servicios" Value="4"></asp:ListItem>
|
<asp:ListItem Text="Servicios" Value="4"></asp:ListItem>
|
||||||
</asp:DropDownList>
|
</asp:DropDownList>
|
||||||
<label for="<%= DdlTipoRetencion.ClientID.ToString()%>">Tipo de Retención:</label>
|
<label for="<%= DdlTipoRetencion.ClientID.ToString()%>">Tipo de Retención de IVA:</label>
|
||||||
<asp:RequiredFieldValidator ID="RFVTipoRetencion" runat="server" ControlToValidate="DdlTipoRetencion" CssClass="help-block" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo de Retención''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
<asp:RequiredFieldValidator ID="RFVTipoRetencion" runat="server" ControlToValidate="DdlTipoRetencion" CssClass="help-block" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo de Retención''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||||
<i></i>
|
<i></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<div class="form-group form-md-line-input input-iconright">
|
<div id="DivRetIVA" runat="server" class="form-group form-md-line-input input-iconright">
|
||||||
<asp:TextBox ID="TxtRetIVA" CssClass="form-control" runat="server" MaxLength="9" Text="0"></asp:TextBox>
|
<asp:TextBox ID="TxtRetIVA" CssClass="form-control" runat="server" MaxLength="9" Text="0"></asp:TextBox>
|
||||||
<asp:RequiredFieldValidator ID="RFVRetIVA" class="help-block errorimput" runat="server" ControlToValidate="TxtRetIVA" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Retención de IVA''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
<asp:RequiredFieldValidator ID="RFVRetIVA" class="help-block errorimput" runat="server" ControlToValidate="TxtRetIVA" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Retención de IVA''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||||
<asp:CompareValidator ID="CVRetIVA" class="help-block errorimput" runat="server" ControlToValidate="TxtRetIVA" ErrorMessage="El campo <b>''Retención de IVA''</b> no tiene el formato correcto, por favor corrija e intente de nuevo (Solo formato numérico)." Operator="DataTypeCheck" Type="Double" ValidationGroup="GrpGuardar"></asp:CompareValidator>
|
<asp:CompareValidator ID="CVRetIVA" class="help-block errorimput" runat="server" ControlToValidate="TxtRetIVA" ErrorMessage="El campo <b>''Retención de IVA''</b> no tiene el formato correcto, por favor corrija e intente de nuevo (Solo formato numérico)." Operator="DataTypeCheck" Type="Double" ValidationGroup="GrpGuardar"></asp:CompareValidator>
|
||||||
|
|||||||
@@ -717,9 +717,13 @@ Partial Class Clientes
|
|||||||
If UsuarioActual.TienePermisoProceso(180) Then
|
If UsuarioActual.TienePermisoProceso(180) Then
|
||||||
ChkEstado.Enabled = True
|
ChkEstado.Enabled = True
|
||||||
End If
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(579) = "1" Then
|
||||||
|
DivTipoRetenciones.Visible = True
|
||||||
|
DivRetIVA.Visible = False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
If Request("CveCliente") IsNot Nothing AndAlso IsNumeric(Request("CveCliente")) AndAlso Request("CveCliente").ToEntero > 0 Then
|
If Request("CveCliente") IsNot Nothing AndAlso IsNumeric(Request("CveCliente")) AndAlso Request("CveCliente").ToEntero > 0 Then
|
||||||
'If UsuarioActual.CveEmpresa = 2 AndAlso UsuarioActual.CveUsuario = 77 AndAlso Not Request("CveCliente").Contiene("10450", "10460", "10458") Then
|
'If UsuarioActual.CveEmpresa = 2 AndAlso UsuarioActual.CveUsuario = 77 AndAlso Not Request("CveCliente").Contiene("10450", "10460", "10458") Then
|
||||||
' BtnGuardar.Enabled = False : BtnEliminar.Enabled = False : LbAgregarSucursal.Enabled = False : LbEnviarActivacionPortal.Enabled = False
|
' BtnGuardar.Enabled = False : BtnEliminar.Enabled = False : LbAgregarSucursal.Enabled = False : LbEnviarActivacionPortal.Enabled = False
|
||||||
@@ -820,10 +824,6 @@ Partial Class Clientes
|
|||||||
UpFiscalContable.Update()
|
UpFiscalContable.Update()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If UsuarioActual.Empresa.Funcionalidad(579) = "1" Then
|
|
||||||
DivTipoRetenciones.Visible = True
|
|
||||||
End If
|
|
||||||
|
|
||||||
If Request("CveEmpresaCRM") IsNot Nothing AndAlso IsNumeric(Request("CveEmpresaCRM")) AndAlso Request("CveEmpresaCRM").ToEntero > 0 Then
|
If Request("CveEmpresaCRM") IsNot Nothing AndAlso IsNumeric(Request("CveEmpresaCRM")) AndAlso Request("CveEmpresaCRM").ToEntero > 0 Then
|
||||||
ViewState("CveEmpresaCRM") = Request("CveEmpresaCRM")
|
ViewState("CveEmpresaCRM") = Request("CveEmpresaCRM")
|
||||||
CargaDatosCRM()
|
CargaDatosCRM()
|
||||||
@@ -1380,6 +1380,7 @@ Partial Class Clientes
|
|||||||
TxtCC.Text = ObjClientes.NotificarA
|
TxtCC.Text = ObjClientes.NotificarA
|
||||||
ChkMail.Checked = ObjClientes.EnviarFactura
|
ChkMail.Checked = ObjClientes.EnviarFactura
|
||||||
DdlTipoRetencion.SelectedValueExist(ObjClientes.DtResultados(0)("CveTipoRetencion").ToString)
|
DdlTipoRetencion.SelectedValueExist(ObjClientes.DtResultados(0)("CveTipoRetencion").ToString)
|
||||||
|
DdlTipoRetencion_SelectedIndexChanged(DdlTipoRetencion, EventArgs.Empty)
|
||||||
TxtRetIVA.Text = ObjClientes.RetIVA.ToString
|
TxtRetIVA.Text = ObjClientes.RetIVA.ToString
|
||||||
TxtRetISR.Text = ObjClientes.RetISR.ToString
|
TxtRetISR.Text = ObjClientes.RetISR.ToString
|
||||||
ChkRetIVAFletesAcarreos.Checked = ObjClientes.RetieneIVAFletes
|
ChkRetIVAFletesAcarreos.Checked = ObjClientes.RetieneIVAFletes
|
||||||
@@ -9941,5 +9942,23 @@ Partial Class Clientes
|
|||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
#End Region
|
#End Region
|
||||||
|
Protected Sub DdlTipoRetencion_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(579) = "1" Then
|
||||||
|
TxtRetIVA.Text = "0"
|
||||||
|
DivRetIVA.Visible = False
|
||||||
|
|
||||||
|
If DdlTipoRetencion.SelectedValue.Contiene("1", "2") Then
|
||||||
|
TxtRetIVA.Text = "10"
|
||||||
|
DivRetIVA.Visible = True
|
||||||
|
ElseIf DdlTipoRetencion.SelectedValue.Contiene("3") Then
|
||||||
|
TxtRetIVA.Text = "4"
|
||||||
|
DivRetIVA.Visible = True
|
||||||
|
ElseIf DdlTipoRetencion.SelectedValue.Contiene("4") Then
|
||||||
|
TxtRetIVA.Text = "6"
|
||||||
|
DivRetIVA.Visible = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
End Class
|
End Class
|
||||||
|
|
||||||
|
|||||||
@@ -568,7 +568,10 @@
|
|||||||
<label for="<%= DdlIEPSPorcentaje.ClientID.ToString()%>">IEPS Porcentaje:</label>
|
<label for="<%= DdlIEPSPorcentaje.ClientID.ToString()%>">IEPS Porcentaje:</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group form-md-line-input input-iconright">
|
||||||
|
<label>Es OutSourcing </label>
|
||||||
|
<asp:CheckBox ID="ChkEsOutSourcing" CssClass="make-switchsd" data-size="small" runat="server" Checked="False" />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -866,7 +866,7 @@ Partial Class ProductosyServicios
|
|||||||
CargaCaracteristicas()
|
CargaCaracteristicas()
|
||||||
|
|
||||||
LnkUnificar.Visible = True
|
LnkUnificar.Visible = True
|
||||||
|
ChkEsOutSourcing.Checked = ObjProductosServicios.EsOutSourcing
|
||||||
Else
|
Else
|
||||||
Alert("El Producto o Servicio Solicitado no existe, por favor revise su búsqueda.", TipoMensaje.MsgAdvertencia)
|
Alert("El Producto o Servicio Solicitado no existe, por favor revise su búsqueda.", TipoMensaje.MsgAdvertencia)
|
||||||
RegistraScript("$('#C_Tab_TabPaquetes_tab').css('display' , 'none')")
|
RegistraScript("$('#C_Tab_TabPaquetes_tab').css('display' , 'none')")
|
||||||
@@ -1163,7 +1163,7 @@ Partial Class ProductosyServicios
|
|||||||
CveClasificacionDetalle:=DdlTipoPSDes.SelectedValue.ToEntero, CveTamaño:=DdlTamanio.SelectedValue.ToEntero,
|
CveClasificacionDetalle:=DdlTipoPSDes.SelectedValue.ToEntero, CveTamaño:=DdlTamanio.SelectedValue.ToEntero,
|
||||||
CveModelo:=DdlModelo.SelectedValue.ToEntero(), CveMedida:=DdlMedida.SelectedValue.ToEntero(), CveRinTamaño:=DdlRin.SelectedValue.ToEntero(),
|
CveModelo:=DdlModelo.SelectedValue.ToEntero(), CveMedida:=DdlMedida.SelectedValue.ToEntero(), CveRinTamaño:=DdlRin.SelectedValue.ToEntero(),
|
||||||
ClaveImpuestoEmpaque:=DdlImpEmpaque.SelectedValue.ToString, ClaveImpuestoUM:=DdlImpUM.SelectedValue.ToString, ClaveCategoriaToxicidad:=DdlCategoriaToxicidad.SelectedValue.ToString,
|
ClaveImpuestoEmpaque:=DdlImpEmpaque.SelectedValue.ToString, ClaveImpuestoUM:=DdlImpUM.SelectedValue.ToString, ClaveCategoriaToxicidad:=DdlCategoriaToxicidad.SelectedValue.ToString,
|
||||||
ClaveImpuestoTipoProducto:=DdlImpTipoProducto.SelectedValue.ToString) > 0 Then
|
ClaveImpuestoTipoProducto:=DdlImpTipoProducto.SelectedValue.ToString, EsOutSourcing:=ChkEsOutSourcing.Checked) > 0 Then
|
||||||
ViewState("CvePS") = ObjProductosServicios.CvePS
|
ViewState("CvePS") = ObjProductosServicios.CvePS
|
||||||
For Each GVR As GridViewRow In GvImpuestosLocales.Rows
|
For Each GVR As GridViewRow In GvImpuestosLocales.Rows
|
||||||
If GVR.FCCheckBox("ChkDeduccion").Checked Then
|
If GVR.FCCheckBox("ChkDeduccion").Checked Then
|
||||||
@@ -1208,7 +1208,7 @@ Partial Class ProductosyServicios
|
|||||||
CveUsuarioModifico:=UsuarioActual.CveUsuario, CveClasificacionDetalle:=DdlTipoPSDes.SelectedValue.ToEntero, CveTamaño:=DdlTamanio.SelectedValue.ToEntero,
|
CveUsuarioModifico:=UsuarioActual.CveUsuario, CveClasificacionDetalle:=DdlTipoPSDes.SelectedValue.ToEntero, CveTamaño:=DdlTamanio.SelectedValue.ToEntero,
|
||||||
CveModelo:=DdlModelo.SelectedValue.ToEntero(), CveMedida:=DdlMedida.SelectedValue.ToEntero(), CveRinTamaño:=DdlRin.SelectedValue.ToEntero(),
|
CveModelo:=DdlModelo.SelectedValue.ToEntero(), CveMedida:=DdlMedida.SelectedValue.ToEntero(), CveRinTamaño:=DdlRin.SelectedValue.ToEntero(),
|
||||||
ClaveImpuestoEmpaque:=DdlImpEmpaque.SelectedValue.ToString, ClaveImpuestoUM:=DdlImpUM.SelectedValue.ToString, ClaveCategoriaToxicidad:=DdlCategoriaToxicidad.SelectedValue.ToString,
|
ClaveImpuestoEmpaque:=DdlImpEmpaque.SelectedValue.ToString, ClaveImpuestoUM:=DdlImpUM.SelectedValue.ToString, ClaveCategoriaToxicidad:=DdlCategoriaToxicidad.SelectedValue.ToString,
|
||||||
ClaveImpuestoTipoProducto:=DdlImpTipoProducto.SelectedValue.ToString) Then
|
ClaveImpuestoTipoProducto:=DdlImpTipoProducto.SelectedValue.ToString, EsOutSourcing:=ChkEsOutSourcing.Checked) Then
|
||||||
|
|
||||||
If Not ObjProductosServicios.LimpiaImpuestosLocales(CvePS) Then
|
If Not ObjProductosServicios.LimpiaImpuestosLocales(CvePS) Then
|
||||||
TieneError = True
|
TieneError = True
|
||||||
|
|||||||
7033
Ventas/Ventas.aspx
7033
Ventas/Ventas.aspx
File diff suppressed because it is too large
Load Diff
@@ -4294,6 +4294,8 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
CargaCodigoUnico()
|
||||||
|
|
||||||
UpPS.Update()
|
UpPS.Update()
|
||||||
UpContado.Update()
|
UpContado.Update()
|
||||||
UpEstatus.Update()
|
UpEstatus.Update()
|
||||||
@@ -4699,6 +4701,7 @@ Partial Class Ventas
|
|||||||
LblTelefono.Text = ObjCliente.Telefono
|
LblTelefono.Text = ObjCliente.Telefono
|
||||||
LblRetIVA.Text = ObjCliente.RetIVA.ToString.FormatoNumero(5)
|
LblRetIVA.Text = ObjCliente.RetIVA.ToString.FormatoNumero(5)
|
||||||
LblRetISR.Text = ObjCliente.RetISR.ToString.FormatoNumero(5)
|
LblRetISR.Text = ObjCliente.RetISR.ToString.FormatoNumero(5)
|
||||||
|
If UsuarioActual.Empresa.MostrarRetISR AndAlso ObjCliente.RetISR > 0 Then TrRetISR.Style.Add("display", "none")
|
||||||
ViewState("ClienteRetIVA") = ObjCliente.RetIVA / 100
|
ViewState("ClienteRetIVA") = ObjCliente.RetIVA / 100
|
||||||
ViewState("ClienteRetISR") = ObjCliente.RetISR / 100
|
ViewState("ClienteRetISR") = ObjCliente.RetISR / 100
|
||||||
|
|
||||||
@@ -5015,6 +5018,8 @@ Partial Class Ventas
|
|||||||
|
|
||||||
TrVistaPrevia.Visible = True
|
TrVistaPrevia.Visible = True
|
||||||
|
|
||||||
|
TxtFechaPago.Text = If(DdlTipoComprobante.SelectedValue = "Rem", Now.AddDays(PlazoCobranzaRemision), Now.AddDays(PlazoCobranza)).ToShortDateString
|
||||||
|
|
||||||
If Not (ModalidadEdicion AndAlso DdlTipoComprobante.SelectedValue = "Rem") Then
|
If Not (ModalidadEdicion AndAlso DdlTipoComprobante.SelectedValue = "Rem") Then
|
||||||
CargaRestriccionesCreditoCliente(True, Me.CveVenta)
|
CargaRestriccionesCreditoCliente(True, Me.CveVenta)
|
||||||
End If
|
End If
|
||||||
@@ -5928,11 +5933,12 @@ Partial Class Ventas
|
|||||||
|
|
||||||
Dim ClienteRetIVA = Me.ClienteRetIVA
|
Dim ClienteRetIVA = Me.ClienteRetIVA
|
||||||
If UsuarioActual.Empresa.Funcionalidad(579) = "1" Then
|
If UsuarioActual.Empresa.Funcionalidad(579) = "1" Then
|
||||||
|
ClienteRetIVA = 0.0D
|
||||||
If DdlTipoRetencion.SelectedValue.Contiene("1", "2") Then
|
If DdlTipoRetencion.SelectedValue.Contiene("1", "2") Then
|
||||||
ClienteRetIVA = 0.1D
|
ClienteRetIVA = 0.1D
|
||||||
ElseIf DdlTipoRetencion.SelectedValue.Contiene("3") Then
|
ElseIf DdlTipoRetencion.SelectedValue.Contiene("3") Then
|
||||||
ClienteRetIVA = 0.04D
|
ClienteRetIVA = 0.04D
|
||||||
ElseIf DdlTipoRetencion.SelectedValue.Contiene("4") Then
|
ElseIf DdlTipoRetencion.SelectedValue.Contiene("4") AndAlso CBool(TmpDT.Rows(e.RowIndex)("EsOutSourcing").ToString()) Then
|
||||||
ClienteRetIVA = 0.06D
|
ClienteRetIVA = 0.06D
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -10307,7 +10313,7 @@ Partial Class Ventas
|
|||||||
'Nota cuando es Nota de crédiot, debe de tomar el devoluciones y rebajas
|
'Nota cuando es Nota de crédiot, debe de tomar el devoluciones y rebajas
|
||||||
If ObjFactura.TipoDocto.Contiene("Egs", "Dev") Then
|
If ObjFactura.TipoDocto.Contiene("Egs", "Dev") Then
|
||||||
Dim CampoCuenta As String = "IdCuentaGasto"
|
Dim CampoCuenta As String = "IdCuentaGasto"
|
||||||
If UsuarioActual.CveEmpresa.Contiene(80, 72, 146) Then CampoCuenta = "IdCuentaDescuento"
|
'If UsuarioActual.CveEmpresa.Contiene(80, 72, 146) Then CampoCuenta = "IdCuentaDescuento"
|
||||||
IdCtaContable = GlobalDTClasificaciones(ObjFactura.CveEmpresa).FiltroPrimeroValor(CampoCuenta, String.Format("CveClasificacion = {0}", Row2("CveClasificacion"))).ToEntero
|
IdCtaContable = GlobalDTClasificaciones(ObjFactura.CveEmpresa).FiltroPrimeroValor(CampoCuenta, String.Format("CveClasificacion = {0}", Row2("CveClasificacion"))).ToEntero
|
||||||
Else
|
Else
|
||||||
IdCtaContable = GlobalDTClasificaciones(ObjFactura.CveEmpresa).FiltroPrimeroValor("IdCuentaIngresos", String.Format("CveClasificacion = {0}", Row2("CveClasificacion"))).ToEntero
|
IdCtaContable = GlobalDTClasificaciones(ObjFactura.CveEmpresa).FiltroPrimeroValor("IdCuentaIngresos", String.Format("CveClasificacion = {0}", Row2("CveClasificacion"))).ToEntero
|
||||||
@@ -14247,11 +14253,12 @@ Partial Class Ventas
|
|||||||
|
|
||||||
Dim ClienteRetIVA = Me.ClienteRetIVA
|
Dim ClienteRetIVA = Me.ClienteRetIVA
|
||||||
If UsuarioActual.Empresa.Funcionalidad(579) = "1" Then
|
If UsuarioActual.Empresa.Funcionalidad(579) = "1" Then
|
||||||
|
ClienteRetIVA = 0.0D
|
||||||
If DdlTipoRetencion.SelectedValue.Contiene("1", "2") Then
|
If DdlTipoRetencion.SelectedValue.Contiene("1", "2") Then
|
||||||
ClienteRetIVA = 0.1D
|
ClienteRetIVA = 0.1D
|
||||||
ElseIf DdlTipoRetencion.SelectedValue.Contiene("3") Then
|
ElseIf DdlTipoRetencion.SelectedValue.Contiene("3") Then
|
||||||
ClienteRetIVA = 0.04D
|
ClienteRetIVA = 0.04D
|
||||||
ElseIf DdlTipoRetencion.SelectedValue.Contiene("4") AndAlso DrPS("CveTipoPS").ToString().ToEntero() = 1 Then
|
ElseIf DdlTipoRetencion.SelectedValue.Contiene("4") AndAlso CBool(DrPS("EsOutSourcing").ToString()) Then
|
||||||
ClienteRetIVA = 0.06D
|
ClienteRetIVA = 0.06D
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -14502,6 +14509,8 @@ Partial Class Ventas
|
|||||||
TmpDT.Columns.Add("CveTamaño", GetType(Integer))
|
TmpDT.Columns.Add("CveTamaño", GetType(Integer))
|
||||||
TmpDT.Columns.Add("CveConcepto", GetType(Integer))
|
TmpDT.Columns.Add("CveConcepto", GetType(Integer))
|
||||||
|
|
||||||
|
TmpDT.Columns.Add("EsOutSourcing", GetType(Boolean))
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub CreaDTmpC()
|
Private Sub CreaDTmpC()
|
||||||
DTmpC = New DataTable
|
DTmpC = New DataTable
|
||||||
@@ -16362,181 +16371,186 @@ Partial Class Ventas
|
|||||||
Private Sub BtnEditarRemision_Click(sender As Object, e As EventArgs) Handles BtnEditarRemision.Click
|
Private Sub BtnEditarRemision_Click(sender As Object, e As EventArgs) Handles BtnEditarRemision.Click
|
||||||
Dim OcurrioError As Boolean = False
|
Dim OcurrioError As Boolean = False
|
||||||
Dim ObjVentas As New ClsVentas
|
Dim ObjVentas As New ClsVentas
|
||||||
|
ObjVentas.IniciaTransacSQL()
|
||||||
|
|
||||||
Dim ObjConta As New ClsContabilidad(ObjVentas.IniciaTransacSQL())
|
Dim ObjConta As New ClsContabilidad(ObjVentas.IniciaTransacSQL())
|
||||||
Dim ObjBancos As New ClsBancos(ObjVentas.IniciaTransacSQL())
|
Dim ObjBancos As New ClsBancos(ObjVentas.IniciaTransacSQL())
|
||||||
Dim ObjCGame As New ClsCGame(ObjVentas.IniciaTransacSQL())
|
Dim ObjCGame As New ClsCGame(ObjVentas.IniciaTransacSQL())
|
||||||
Dim ObjAC As ClsContPAQi = Nothing
|
Dim ObjAC As ClsContPAQi = Nothing
|
||||||
|
|
||||||
Dim Moneda As Integer = DdlMoneda.SelectedValue.ToEntero
|
Dim Moneda As Integer = DdlMoneda.SelectedValue.ToEntero
|
||||||
Dim TipoCambio As Double = TxtTipoCambio.Text.ToDouble
|
Dim TipoCambio As Double = TxtTipoCambio.Text.ToDouble
|
||||||
EditoRemision = True
|
EditoRemision = True
|
||||||
'Dim SubTotal, Descuento, IVA, RetIVA, RetISR, IEPS, Total As Decimal
|
Try
|
||||||
ObjVentas.IniciaTransacSQL()
|
'CONVERTIR REMISION - TIPO MONEDA -DOLARES A PESOS
|
||||||
|
If DdlMoneda.SelectedValue.ToEntero <> 2 AndAlso ChkConvertirDolares.Checked Then
|
||||||
|
|
||||||
|
For Each Row As DataRow In TmpDT.Rows
|
||||||
|
Row("PU") = Math.Round(Row("PU").ToString.ToDecimal / TxtTipoCambioDlls.Text.Trim.ToDecimal, 6)
|
||||||
|
Row("Total") = Math.Round(Row("Cantidad").ToString.ToDecimal * Row("PU").ToString.ToDecimal, NumeroDecimales)
|
||||||
|
Row("TotalImporte") = Math.Round(Row("Cantidad").ToString.ToDecimal * Row("PU").ToString.ToDecimal, NumeroDecimales)
|
||||||
|
Row("Descuento") = Math.Round(Row("Descuento").ToString.ToDecimal / TxtTipoCambioDlls.Text.Trim.ToDecimal, NumeroDecimales)
|
||||||
|
Row("ImporteIEPS") = Math.Round(Row("ImporteIEPS").ToString.ToDecimal / TxtTipoCambioDlls.Text.Trim.ToDecimal, NumeroDecimales)
|
||||||
|
Row("ImporteIVA") = Math.Round(Row("ImporteIVA").ToString.ToDecimal / TxtTipoCambioDlls.Text.Trim.ToDecimal, NumeroDecimales)
|
||||||
|
Row("ImporteRetIVA") = Math.Round(Row("ImporteRetIVA").ToString.ToDecimal / TxtTipoCambioDlls.Text.Trim.ToDecimal, NumeroDecimales)
|
||||||
|
Row("ImporteRetISR") = Math.Round(Row("ImporteRetISR").ToString.ToDecimal / TxtTipoCambioDlls.Text.Trim.ToDecimal, NumeroDecimales)
|
||||||
|
Next
|
||||||
|
|
||||||
'CONVERTIR REMISION - TIPO MONEDA -DOLARES A PESOS
|
Dim ImpuestosLocales As Double = 0
|
||||||
If DdlMoneda.SelectedValue.ToEntero <> 2 AndAlso ChkConvertirDolares.Checked Then
|
For Each gvr As GridViewRow In GvImpuestosLocales2.Rows
|
||||||
|
If gvr.RowType = DataControlRowType.DataRow Then
|
||||||
For Each Row As DataRow In TmpDT.Rows
|
gvr.FCTextBox("TxtImpuestoLocalPS").Text = (gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDouble / TxtTipoCambioDlls.Text.Trim.ToDecimal).FormatoNumero
|
||||||
Row("PU") = Math.Round(Row("PU").ToString.ToDecimal / TxtTipoCambioDlls.Text.Trim.ToDecimal, 6)
|
ImpuestosLocales += Math.Round(gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDouble / TxtTipoCambioDlls.Text.Trim.ToDecimal, NumeroDecimales)
|
||||||
Row("Total") = Math.Round(Row("Cantidad").ToString.ToDecimal * Row("PU").ToString.ToDecimal, NumeroDecimales)
|
|
||||||
Row("TotalImporte") = Math.Round(Row("Cantidad").ToString.ToDecimal * Row("PU").ToString.ToDecimal, NumeroDecimales)
|
|
||||||
Row("Descuento") = Math.Round(Row("Descuento").ToString.ToDecimal / TxtTipoCambioDlls.Text.Trim.ToDecimal, NumeroDecimales)
|
|
||||||
Row("ImporteIEPS") = Math.Round(Row("ImporteIEPS").ToString.ToDecimal / TxtTipoCambioDlls.Text.Trim.ToDecimal, NumeroDecimales)
|
|
||||||
Row("ImporteIVA") = Math.Round(Row("ImporteIVA").ToString.ToDecimal / TxtTipoCambioDlls.Text.Trim.ToDecimal, NumeroDecimales)
|
|
||||||
Row("ImporteRetIVA") = Math.Round(Row("ImporteRetIVA").ToString.ToDecimal / TxtTipoCambioDlls.Text.Trim.ToDecimal, NumeroDecimales)
|
|
||||||
Row("ImporteRetISR") = Math.Round(Row("ImporteRetISR").ToString.ToDecimal / TxtTipoCambioDlls.Text.Trim.ToDecimal, NumeroDecimales)
|
|
||||||
Next
|
|
||||||
|
|
||||||
Dim ImpuestosLocales As Double = 0
|
|
||||||
For Each gvr As GridViewRow In GvImpuestosLocales2.Rows
|
|
||||||
If gvr.RowType = DataControlRowType.DataRow Then
|
|
||||||
gvr.FCTextBox("TxtImpuestoLocalPS").Text = (gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDouble / TxtTipoCambioDlls.Text.Trim.ToDecimal).FormatoNumero
|
|
||||||
ImpuestosLocales += Math.Round(gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDouble / TxtTipoCambioDlls.Text.Trim.ToDecimal, NumeroDecimales)
|
|
||||||
End If
|
|
||||||
Next
|
|
||||||
|
|
||||||
TxtSubTotal.Text = TmpDT.SUM("Total").ToDecimal.FormatoNumero
|
|
||||||
LblDescuentos.Text = TmpDT.SUM("Descuento").ToDecimal.FormatoNumero
|
|
||||||
LblAmortizacion.Text = Math.Round(LblAmortizacion.Text.Trim.ToDecimal / TxtTipoCambioDlls.Text.Trim.ToDecimal, NumeroDecimales).FormatoNumero
|
|
||||||
TxtIVA.Text = TmpDT.SUM("ImporteIVA").ToDecimal.FormatoNumero
|
|
||||||
TxtRetIVA.Text = TmpDT.SUM("ImporteRetIVA").ToDecimal.FormatoNumero
|
|
||||||
TxtRetISR.Text = TmpDT.SUM("ImporteRetISR").ToDecimal.FormatoNumero
|
|
||||||
TxtIEPS.Text = TmpDT.SUM("ImporteIEPS").ToDecimal.FormatoNumero
|
|
||||||
TxtTotal.Text = (TxtSubTotal.Text.ToDecimal - LblDescuentos.Text.ToDecimal - LblAmortizacion.Text.ToDecimal + TxtIVA.Text.ToDecimal + TxtIEPS.Text.ToDecimal - TxtRetIVA.Text.ToDecimal - TxtRetISR.Text.ToDecimal - ImpuestosLocales).ToDecimal.FormatoNumero
|
|
||||||
|
|
||||||
TipoCambio = TxtTipoCambioDlls.Text.Trim.ToDecimal
|
|
||||||
Moneda = 2
|
|
||||||
End If
|
|
||||||
|
|
||||||
'CONVERTIR REMISION - TIPO MONEDA -PESO A DOLARES
|
|
||||||
If DdlMoneda.SelectedValue.ToEntero <> 1 AndAlso ChkConvertirDoctoPesos.Checked Then
|
|
||||||
Dim Importe As Decimal
|
|
||||||
Dim TCC As Decimal = TxtTipoCambio.Text.Trim.ToDecimal
|
|
||||||
For Each Row As DataRow In TmpDT.Rows
|
|
||||||
Row("PU") = Math.Round(Row("PU").ToString.ToDecimal * TCC, 6)
|
|
||||||
Row("Total") = Math.Round(Row("Cantidad").ToString.ToDecimal * Row("PU").ToString.ToDecimal, NumeroDecimales)
|
|
||||||
Row("TotalImporte") = Math.Round(Row("Cantidad").ToString.ToDecimal * Row("PU").ToString.ToDecimal, NumeroDecimales)
|
|
||||||
Row("Descuento") = Math.Round(Row("Descuento").ToString.ToDecimal * TCC, NumeroDecimales)
|
|
||||||
Importe = Row("Total").ToString.ToDecimal - Row("Descuento").ToString.ToDecimal
|
|
||||||
Row("ImporteIEPS") = Math.Round(Importe * Row("PorcentajeIEPS").ToString.ToDecimal, NumeroDecimales)
|
|
||||||
Row("ImporteIVA") = Math.Round(Importe * Row("PorcentajeIVA").ToString.ToDecimal, NumeroDecimales)
|
|
||||||
Row("ImporteRetIVA") = Math.Round(Importe * Row("PorcentajeRetIVA").ToString.ToDecimal, NumeroDecimales)
|
|
||||||
Row("ImporteRetISR") = Math.Round(Importe * Row("PorcentajeRetISR").ToString.ToDecimal, NumeroDecimales)
|
|
||||||
Next
|
|
||||||
|
|
||||||
Dim ImpuestosLocales As Double = 0
|
|
||||||
For Each gvr As GridViewRow In GvImpuestosLocales2.Rows
|
|
||||||
If gvr.RowType = DataControlRowType.DataRow Then
|
|
||||||
gvr.FCTextBox("TxtImpuestoLocalPS").Text = (gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDouble * TxtTipoCambio.Text.Trim.ToDecimal).FormatoNumero
|
|
||||||
ImpuestosLocales += Math.Round(gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDouble * TxtTipoCambio.Text.Trim.ToDecimal, NumeroDecimales)
|
|
||||||
End If
|
|
||||||
Next
|
|
||||||
|
|
||||||
TxtSubTotal.Text = TmpDT.SUM("Total").ToDecimal.FormatoNumero
|
|
||||||
LblDescuentos.Text = TmpDT.SUM("Descuento").ToDecimal.FormatoNumero
|
|
||||||
LblAmortizacion.Text = Math.Round(LblAmortizacion.Text.Trim.ToDecimal * TxtTipoCambio.Text.Trim.ToDecimal, NumeroDecimales).FormatoNumero
|
|
||||||
TxtIVA.Text = TmpDT.SUM("ImporteIVA").ToDecimal.FormatoNumero
|
|
||||||
TxtRetIVA.Text = TmpDT.SUM("ImporteRetIVA").ToDecimal.FormatoNumero
|
|
||||||
TxtRetISR.Text = TmpDT.SUM("ImporteRetISR").ToDecimal.FormatoNumero
|
|
||||||
TxtIEPS.Text = TmpDT.SUM("ImporteIEPS").ToDecimal.FormatoNumero
|
|
||||||
TxtTotal.Text = (TxtSubTotal.Text.ToDecimal - LblDescuentos.Text.ToDecimal - LblAmortizacion.Text.ToDecimal + TxtIVA.Text.ToDecimal + TxtIEPS.Text.ToDecimal - TxtRetIVA.Text.ToDecimal - TxtRetISR.Text.ToDecimal - ImpuestosLocales).ToDecimal.FormatoNumero
|
|
||||||
|
|
||||||
|
|
||||||
TipoCambio = 1
|
|
||||||
Moneda = 1
|
|
||||||
End If
|
|
||||||
|
|
||||||
'Actualizo los parametros de la venta
|
|
||||||
If Not ObjVentas.UpdateVentas(TxtSubTotal.Text.ToDecimal, LblDescuentos.Text.ToDecimal, TxtIVA.Text.ToDecimal, TxtIEPS.Text.ToDecimal, TxtTotal.Text.ToDecimal, Moneda, TipoCambio, TxtFecha.Text.Trim.ToDate, TxtObsFact.Text.Trim,
|
|
||||||
UsuarioActual.CveEmpresa, CveVenta, 0, 0,
|
|
||||||
Vigencia:=TxtFechaVencimientoCotizacion.Text.Trim.ToDate, CondicionesPago:=If(RBLPago.SelectedValue = "2", 0, 1),
|
|
||||||
PedidoContrato:=TxtPedidoContrato.Text, AtencionA:=TxtAtencionA.Text.Trim, CveMetodoPago33:=DdlMetodoPago33.SelectedValue.ToEntero,
|
|
||||||
CveFormaPago33:=DdlFormaPago33.SelectedValue.ToEntero, TipoDocto:="Rem", CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal,
|
|
||||||
OrdenCompra:=TxtOrdenCompra.Text, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, Kilometraje:=TxtKilometraje.Text.ToDouble) Then
|
|
||||||
OcurrioError = True
|
|
||||||
End If
|
|
||||||
|
|
||||||
'Cargo de nueva cuenta el detalle de Ventas (Conceptos)
|
|
||||||
If Not OcurrioError Then
|
|
||||||
Dim index As Integer = 0
|
|
||||||
For Each Row As DataRow In TmpDT.Rows
|
|
||||||
Dim CveVentaDetalle As Integer = Row("CveVentaDetalle").ToString.ToEntero()
|
|
||||||
If CveVentaDetalle > 0 Then
|
|
||||||
If Not ObjVentas.UpdateVentaDetalleRemision(Row("CveVentaDetalle").ToString.ToEntero, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDecimal, Row("PU").ToString.ToDecimal(), Row("ImporteIEPS").ToString.ToDecimal(), Row("Obs").ToString, UsuarioActual.CveUsuario) Then
|
|
||||||
OcurrioError = True
|
|
||||||
Exit For
|
|
||||||
End If
|
End If
|
||||||
Else
|
Next
|
||||||
If Not ObjVentas.AddVentaDetalle(CveVenta, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("CveUM").ToString.ToEntero,
|
|
||||||
Row("PU").ToString.ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), Row("ImporteIVA").ToString.ToDouble, Math.Round((Row("Total").ToString.ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)) * (1 + Row("PorcentajeIVA").ToString.ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)))), 6),
|
TxtSubTotal.Text = TmpDT.SUM("Total").ToDecimal.FormatoNumero
|
||||||
Row("Obs").ToString, Row("Descuento").ToString.ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), Row("TipoDescuento").ToString.ToEntero, Row("CveSubProyecto").ToString.ToEntero, Row("CvePresupuestoIngreso").ToString.ToEntero, PorcentajeIVA:=Row("PorcentajeIVA").ToString.ToDecimal, IEPS:=Row("ImporteIEPS").ToString.ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), PorcentajeIEPS:=Row("PorcentajeIEPS").ToString.ToDouble, TiempoEntrega:=Row("TiempoEntrega").ToString,
|
LblDescuentos.Text = TmpDT.SUM("Descuento").ToDecimal.FormatoNumero
|
||||||
CveVentaDetallePadre:=Row("CveVentaDetalle").ToString.ToEntero, CveContratoDetalle:=Row("CveContratoDetalle").ToString.ToEntero, CvePromocionDetalle:=If(DtPromociones IsNot Nothing, DtPromociones.FiltroPrimeroValor("CvePromocionDetalle", $"CvePS={Row("CvePS").ToString}").ToEntero, -1),
|
LblAmortizacion.Text = Math.Round(LblAmortizacion.Text.Trim.ToDecimal / TxtTipoCambioDlls.Text.Trim.ToDecimal, NumeroDecimales).FormatoNumero
|
||||||
ImporteRetIVA:=Row("ImporteRetIVA").ToString.ToDouble, ImporteRetISR:=Row("ImporteRetISR").ToString.ToDouble, PorcentajeRetIVA:=Row("PorcentajeRetIVA").ToString.ToDouble, PorcentajeRetISR:=Row("PorcentajeRetISR").ToString.ToDouble, CuentaPredial:=Row("CuentaPredial").ToString) Then
|
TxtIVA.Text = TmpDT.SUM("ImporteIVA").ToDecimal.FormatoNumero
|
||||||
OcurrioError = True
|
TxtRetIVA.Text = TmpDT.SUM("ImporteRetIVA").ToDecimal.FormatoNumero
|
||||||
Exit For
|
TxtRetISR.Text = TmpDT.SUM("ImporteRetISR").ToDecimal.FormatoNumero
|
||||||
|
TxtIEPS.Text = TmpDT.SUM("ImporteIEPS").ToDecimal.FormatoNumero
|
||||||
|
TxtTotal.Text = (TxtSubTotal.Text.ToDecimal - LblDescuentos.Text.ToDecimal - LblAmortizacion.Text.ToDecimal + TxtIVA.Text.ToDecimal + TxtIEPS.Text.ToDecimal - TxtRetIVA.Text.ToDecimal - TxtRetISR.Text.ToDecimal - ImpuestosLocales).ToDecimal.FormatoNumero
|
||||||
|
|
||||||
|
TipoCambio = TxtTipoCambioDlls.Text.Trim.ToDecimal
|
||||||
|
Moneda = 2
|
||||||
|
End If
|
||||||
|
|
||||||
|
'CONVERTIR REMISION - TIPO MONEDA -PESO A DOLARES
|
||||||
|
If DdlMoneda.SelectedValue.ToEntero <> 1 AndAlso ChkConvertirDoctoPesos.Checked Then
|
||||||
|
Dim Importe As Decimal
|
||||||
|
Dim TCC As Decimal = TxtTipoCambio.Text.Trim.ToDecimal
|
||||||
|
For Each Row As DataRow In TmpDT.Rows
|
||||||
|
Row("PU") = Math.Round(Row("PU").ToString.ToDecimal * TCC, 6)
|
||||||
|
Row("Total") = Math.Round(Row("Cantidad").ToString.ToDecimal * Row("PU").ToString.ToDecimal, NumeroDecimales)
|
||||||
|
Row("TotalImporte") = Math.Round(Row("Cantidad").ToString.ToDecimal * Row("PU").ToString.ToDecimal, NumeroDecimales)
|
||||||
|
Row("Descuento") = Math.Round(Row("Descuento").ToString.ToDecimal * TCC, NumeroDecimales)
|
||||||
|
Importe = Row("Total").ToString.ToDecimal - Row("Descuento").ToString.ToDecimal
|
||||||
|
Row("ImporteIEPS") = Math.Round(Importe * Row("PorcentajeIEPS").ToString.ToDecimal, NumeroDecimales)
|
||||||
|
Row("ImporteIVA") = Math.Round(Importe * Row("PorcentajeIVA").ToString.ToDecimal, NumeroDecimales)
|
||||||
|
Row("ImporteRetIVA") = Math.Round(Importe * Row("PorcentajeRetIVA").ToString.ToDecimal, NumeroDecimales)
|
||||||
|
Row("ImporteRetISR") = Math.Round(Importe * Row("PorcentajeRetISR").ToString.ToDecimal, NumeroDecimales)
|
||||||
|
Next
|
||||||
|
|
||||||
|
Dim ImpuestosLocales As Double = 0
|
||||||
|
For Each gvr As GridViewRow In GvImpuestosLocales2.Rows
|
||||||
|
If gvr.RowType = DataControlRowType.DataRow Then
|
||||||
|
gvr.FCTextBox("TxtImpuestoLocalPS").Text = (gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDouble * TxtTipoCambio.Text.Trim.ToDecimal).FormatoNumero
|
||||||
|
ImpuestosLocales += Math.Round(gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDouble * TxtTipoCambio.Text.Trim.ToDecimal, NumeroDecimales)
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
|
||||||
|
TxtSubTotal.Text = TmpDT.SUM("Total").ToDecimal.FormatoNumero
|
||||||
|
LblDescuentos.Text = TmpDT.SUM("Descuento").ToDecimal.FormatoNumero
|
||||||
|
LblAmortizacion.Text = Math.Round(LblAmortizacion.Text.Trim.ToDecimal * TxtTipoCambio.Text.Trim.ToDecimal, NumeroDecimales).FormatoNumero
|
||||||
|
TxtIVA.Text = TmpDT.SUM("ImporteIVA").ToDecimal.FormatoNumero
|
||||||
|
TxtRetIVA.Text = TmpDT.SUM("ImporteRetIVA").ToDecimal.FormatoNumero
|
||||||
|
TxtRetISR.Text = TmpDT.SUM("ImporteRetISR").ToDecimal.FormatoNumero
|
||||||
|
TxtIEPS.Text = TmpDT.SUM("ImporteIEPS").ToDecimal.FormatoNumero
|
||||||
|
TxtTotal.Text = (TxtSubTotal.Text.ToDecimal - LblDescuentos.Text.ToDecimal - LblAmortizacion.Text.ToDecimal + TxtIVA.Text.ToDecimal + TxtIEPS.Text.ToDecimal - TxtRetIVA.Text.ToDecimal - TxtRetISR.Text.ToDecimal - ImpuestosLocales).ToDecimal.FormatoNumero
|
||||||
|
|
||||||
|
|
||||||
|
TipoCambio = 1
|
||||||
|
Moneda = 1
|
||||||
|
End If
|
||||||
|
|
||||||
|
'Actualizo los parametros de la venta
|
||||||
|
If Not ObjVentas.UpdateVentas(TxtSubTotal.Text.ToDecimal, LblDescuentos.Text.ToDecimal, TxtIVA.Text.ToDecimal, TxtIEPS.Text.ToDecimal, TxtTotal.Text.ToDecimal, Moneda, TipoCambio, TxtFecha.Text.Trim.ToDate, TxtObsFact.Text.Trim,
|
||||||
|
UsuarioActual.CveEmpresa, CveVenta, 0, 0,
|
||||||
|
Vigencia:=TxtFechaVencimientoCotizacion.Text.Trim.ToDate, CondicionesPago:=If(RBLPago.SelectedValue = "2", 0, 1),
|
||||||
|
PedidoContrato:=TxtPedidoContrato.Text, AtencionA:=TxtAtencionA.Text.Trim, CveMetodoPago33:=DdlMetodoPago33.SelectedValue.ToEntero,
|
||||||
|
CveFormaPago33:=DdlFormaPago33.SelectedValue.ToEntero, TipoDocto:="Rem", CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal,
|
||||||
|
OrdenCompra:=TxtOrdenCompra.Text, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, Kilometraje:=TxtKilometraje.Text.ToDouble) Then
|
||||||
|
OcurrioError = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
'Cargo de nueva cuenta el detalle de Ventas (Conceptos)
|
||||||
|
If Not OcurrioError Then
|
||||||
|
Dim index As Integer = 0
|
||||||
|
For Each Row As DataRow In TmpDT.Rows
|
||||||
|
Dim CveVentaDetalle As Integer = Row("CveVentaDetalle").ToString.ToEntero()
|
||||||
|
If CveVentaDetalle > 0 Then
|
||||||
|
If Not ObjVentas.UpdateVentaDetalleRemision(Row("CveVentaDetalle").ToString.ToEntero, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDecimal, Row("PU").ToString.ToDecimal(), Row("ImporteIEPS").ToString.ToDecimal(), Row("Obs").ToString, UsuarioActual.CveUsuario) Then
|
||||||
|
OcurrioError = True
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
Else
|
Else
|
||||||
TmpDT.Rows(index)("CveVentaDetalle") = ObjVentas.CveVentaDetalle
|
If Not ObjVentas.AddVentaDetalle(CveVenta, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("CveUM").ToString.ToEntero,
|
||||||
|
Row("PU").ToString.ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), Row("ImporteIVA").ToString.ToDouble, Math.Round((Row("Total").ToString.ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)) * (1 + Row("PorcentajeIVA").ToString.ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)))), 6),
|
||||||
|
Row("Obs").ToString, Row("Descuento").ToString.ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), Row("TipoDescuento").ToString.ToEntero, Row("CveSubProyecto").ToString.ToEntero, Row("CvePresupuestoIngreso").ToString.ToEntero, PorcentajeIVA:=Row("PorcentajeIVA").ToString.ToDecimal, IEPS:=Row("ImporteIEPS").ToString.ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), PorcentajeIEPS:=Row("PorcentajeIEPS").ToString.ToDouble, TiempoEntrega:=Row("TiempoEntrega").ToString,
|
||||||
|
CveVentaDetallePadre:=Row("CveVentaDetalle").ToString.ToEntero, CveContratoDetalle:=Row("CveContratoDetalle").ToString.ToEntero, CvePromocionDetalle:=If(DtPromociones IsNot Nothing, DtPromociones.FiltroPrimeroValor("CvePromocionDetalle", $"CvePS={Row("CvePS").ToString}").ToEntero, -1),
|
||||||
|
ImporteRetIVA:=Row("ImporteRetIVA").ToString.ToDouble, ImporteRetISR:=Row("ImporteRetISR").ToString.ToDouble, PorcentajeRetIVA:=Row("PorcentajeRetIVA").ToString.ToDouble, PorcentajeRetISR:=Row("PorcentajeRetISR").ToString.ToDouble, CuentaPredial:=Row("CuentaPredial").ToString) Then
|
||||||
|
OcurrioError = True
|
||||||
|
Exit For
|
||||||
|
Else
|
||||||
|
TmpDT.Rows(index)("CveVentaDetalle") = ObjVentas.CveVentaDetalle
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
index = index + 1
|
||||||
index = index + 1
|
Next
|
||||||
Next
|
End If
|
||||||
End If
|
|
||||||
|
|
||||||
'ELIMINA LOS DETALLES
|
'ELIMINA LOS DETALLES
|
||||||
If Not OcurrioError Then
|
If Not OcurrioError Then
|
||||||
Dim DtEliminados As New DataTable
|
Dim DtEliminados As New DataTable
|
||||||
If ObjVentas.GetVentaDetalle(CveVenta) Then
|
If ObjVentas.GetVentaDetalle(CveVenta) Then
|
||||||
DtEliminados = ObjVentas.DtResultados.FiltraParametros("", "", {"CveVentaDetalle"})
|
DtEliminados = ObjVentas.DtResultados.FiltraParametros("", "", {"CveVentaDetalle"})
|
||||||
For Each Dr1 As DataRow In DtEliminados.Rows
|
For Each Dr1 As DataRow In DtEliminados.Rows
|
||||||
If TmpDT.FiltraParametros($"CveVentaDetalle = {Dr1("CveVentaDetalle")}").Rows.Count = 0 Then
|
If TmpDT.FiltraParametros($"CveVentaDetalle = {Dr1("CveVentaDetalle")}").Rows.Count = 0 Then
|
||||||
If Not ObjVentas.RemoveVentasDetalle(CveVenta, Dr1("CveVentaDetalle").ToString.ToEntero) Then
|
If Not ObjVentas.RemoveVentasDetalle(CveVenta, Dr1("CveVentaDetalle").ToString.ToEntero) Then
|
||||||
|
OcurrioError = True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
Else
|
||||||
|
OcurrioError = True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
'OcurrioError = ProcesoPrepolizas(ObjConta, ObjFactura, -1, TmpDT, ObjAC, 1, ObjBancos, ObjVentas)
|
||||||
|
|
||||||
|
'Actualizo impuestos locales
|
||||||
|
If Not OcurrioError Then
|
||||||
|
For Each gvr As GridViewRow In GvImpuestosLocales2.Rows
|
||||||
|
If gvr.RowType = DataControlRowType.DataRow Then
|
||||||
|
If Not ObjVentas.UpdateVentaImpuestoLocales(CveVenta, gvr.DataKey("CveImpuestoLocal").ToString.ToEntero, gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDecimal) Then
|
||||||
OcurrioError = True
|
OcurrioError = True
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
Else
|
|
||||||
OcurrioError = True
|
|
||||||
End If
|
End If
|
||||||
End If
|
|
||||||
|
|
||||||
'OcurrioError = ProcesoPrepolizas(ObjConta, ObjFactura, -1, TmpDT, ObjAC, 1, ObjBancos, ObjVentas)
|
'Orden Produccion'
|
||||||
|
If Not OcurrioError Then
|
||||||
'Actualizo impuestos locales
|
If UsuarioActual.CveEmpresa.Contiene(126) Then
|
||||||
If Not OcurrioError Then
|
If CveVenta > 0 And DdlOrdenProduccion.SelectedValue.ToEntero > 0 Then
|
||||||
For Each gvr As GridViewRow In GvImpuestosLocales2.Rows
|
If Not ObjCGame.UpdateOrdenProduccionVenta(DdlOrdenProduccion.SelectedValue.ToEntero(), CveVenta) Then
|
||||||
If gvr.RowType = DataControlRowType.DataRow Then
|
OcurrioError = True
|
||||||
If Not ObjVentas.UpdateVentaImpuestoLocales(CveVenta, gvr.DataKey("CveImpuestoLocal").ToString.ToEntero, gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDecimal) Then
|
End If
|
||||||
OcurrioError = True
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
Next
|
|
||||||
End If
|
|
||||||
|
|
||||||
'Orden Produccion'
|
|
||||||
If Not OcurrioError Then
|
|
||||||
If UsuarioActual.CveEmpresa.Contiene(126) Then
|
|
||||||
If CveVenta > 0 And DdlOrdenProduccion.SelectedValue.ToEntero > 0 Then
|
|
||||||
If Not ObjCGame.UpdateOrdenProduccionVenta(DdlOrdenProduccion.SelectedValue.ToEntero(), CveVenta) Then
|
|
||||||
OcurrioError = True
|
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
|
||||||
|
|
||||||
If ObjConta.ValidacionPrePolizaCuadre(-1, 2, CveVenta) Then
|
If ObjConta.ValidacionPrePolizaCuadre(-1, 2, CveVenta) Then
|
||||||
If ObjConta.ValorPolizaDescuadre > 0 Then
|
If ObjConta.ValorPolizaDescuadre > 0 Then
|
||||||
If ObjConta.ValorPolizaDescuadre = 2 Then
|
If ObjConta.ValorPolizaDescuadre = 2 Then
|
||||||
|
OcurrioError = True
|
||||||
|
Alert(ObjConta.MensajePolizaDescuadre, TipoMensaje.MsgError)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Not OcurrioError Then
|
||||||
|
If RegeneracionPolizas(ObjVentas, ObjAC, ObjConta, ObjBancos) Then
|
||||||
OcurrioError = True
|
OcurrioError = True
|
||||||
Alert(ObjConta.MensajePolizaDescuadre, TipoMensaje.MsgError)
|
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
|
||||||
|
|
||||||
If Not OcurrioError Then
|
Catch ex As Exception
|
||||||
If RegeneracionPolizas(ObjVentas, ObjAC) Then
|
OcurrioError = True
|
||||||
OcurrioError = True
|
OnError("Ocurrió un error al actualizar la remisión", ex)
|
||||||
End If
|
End Try
|
||||||
End If
|
|
||||||
|
|
||||||
If OcurrioError Then
|
If OcurrioError Then
|
||||||
ObjVentas.RollBack()
|
ObjVentas.RollBack()
|
||||||
@@ -17342,19 +17356,22 @@ Partial Class Ventas
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub BtnAgregarCliente_Click(sender As Object, e As EventArgs) Handles BtnAgregarCliente.Click
|
Private Sub BtnAgregarCliente_Click(sender As Object, e As EventArgs) Handles BtnAgregarCliente.Click
|
||||||
Dim CvePreioLista As Integer = -1
|
Dim CvePrecioLista As Integer = -1
|
||||||
If DdlSubProyectoDatos.SelectedValue.ToEntero > 0 Then
|
If DdlSubProyectoDatos.SelectedValue.ToEntero > 0 Then
|
||||||
Dim Dr As DataRow = GlobalDTSubProyectos(-1, DdlSubProyectoDatos.SelectedValue.ToEntero, UsuarioActual.CveEmpresa).Rows(0)
|
Dim Dr As DataRow = GlobalDTSubProyectos(-1, DdlSubProyectoDatos.SelectedValue.ToEntero, UsuarioActual.CveEmpresa).Rows(0)
|
||||||
If Dr IsNot Nothing Then
|
If Dr IsNot Nothing Then
|
||||||
If Dr("CvePrecioLista").ToString.ToEntero > 0 Then
|
If Dr("CvePrecioLista").ToString.ToEntero > 0 Then
|
||||||
CvePreioLista = Dr("CvePrecioLista").ToString.ToEntero
|
CvePrecioLista = Dr("CvePrecioLista").ToString.ToEntero
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim ObjCliente As New ClsClientes
|
Dim ObjCliente As New ClsClientes
|
||||||
|
|
||||||
If ObjCliente.AgregarClienteNoFrecuente(TxtNombreCliente.Text.Trim, TxtDireccionCliente.Text.Trim, TxtNumExtCliente.Text.Trim, TxtNumIntCliente.Text.Trim, TxtColoniaCliente.Text.Trim, TxtLocalidadCliente.Text.Trim, TxtCiudadCliente.Text.Trim, TxtEstadoCliente.Text.Trim, TxtPaisCliente.Text.Trim, TxtRFCCliente.Text.Trim, TxtCPCliente.Text.Trim, TxtTelefonoCliente.Text.Trim, TxtCorreoCliente.Text.Trim, DdlSubProyectoDatos.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, "", CvePreioLista) Then
|
If ObjCliente.AgregarClienteNoFrecuente(TxtNombreCliente.Text.Trim, TxtDireccionCliente.Text.Trim, TxtNumExtCliente.Text.Trim, TxtNumIntCliente.Text.Trim,
|
||||||
|
TxtColoniaCliente.Text.Trim, TxtLocalidadCliente.Text.Trim, TxtCiudadCliente.Text.Trim, TxtEstadoCliente.Text.Trim,
|
||||||
|
TxtPaisCliente.Text.Trim, TxtRFCCliente.Text.Trim, TxtCPCliente.Text.Trim, TxtTelefonoCliente.Text.Trim, TxtCorreoCliente.Text.Trim,
|
||||||
|
DdlSubProyectoDatos.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, "", -1, -1, CvePrecioLista:=CvePrecioLista) Then
|
||||||
If ObjCliente.DtResultados.Rows.Count > 0 Then
|
If ObjCliente.DtResultados.Rows.Count > 0 Then
|
||||||
RegistraScript("hideDivEC();")
|
RegistraScript("hideDivEC();")
|
||||||
ViewState("CveCliente") = ObjCliente.DtResultados(0)("CveCliente").ToString.ToEntero
|
ViewState("CveCliente") = ObjCliente.DtResultados(0)("CveCliente").ToString.ToEntero
|
||||||
@@ -17446,34 +17463,26 @@ Partial Class Ventas
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
Private Function RegeneracionPolizas(ByRef ObjVentas As ClsVentas, ByRef ObjAC As ClsContPAQi) As Boolean
|
Private Function RegeneracionPolizas(ByRef ObjVentas As ClsVentas, ByRef ObjAC As ClsContPAQi, ByRef ObjConta As ClsContabilidad, ObjBancos As ClsBancos) As Boolean
|
||||||
Dim ObjConta As New ClsContabilidad(ObjVentas.IniciaTransacSQL())
|
|
||||||
Dim ObjBancos As New ClsBancos(ObjVentas.IniciaTransacSQL())
|
|
||||||
|
|
||||||
Dim CvePlantillaPoliza As Integer
|
|
||||||
|
|
||||||
Dim ErrorCancelar As Boolean = False
|
Dim ErrorCancelar As Boolean = False
|
||||||
Dim Mensaje As String = ""
|
Dim Mensaje As String = ""
|
||||||
|
|
||||||
CreaObjetosVenta()
|
CreaObjetosVenta()
|
||||||
|
|
||||||
If UsuarioActual.Empresa.UsaAC Then
|
If UsuarioActual.Empresa.UsaAC Then
|
||||||
ObjAC = New ClsContPAQi(UsuarioActual.Empresa) : ObjAC.IniciaTransacSQL()
|
ObjAC = New ClsContPAQi(UsuarioActual.Empresa) : ObjAC.IniciaTransacSQL()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If ObjFactura.TipoDocto.Contiene("Egs", "Dev") Then
|
'REMOVEMOS LOS CONCEPTOS DE LA PREPOLIZA
|
||||||
CvePlantillaPoliza = 7
|
ErrorCancelar = Not ObjConta.RemovePrePolizasDetalle(CvePrePoliza, -1, CveVenta, 2)
|
||||||
ElseIf ObjFactura.TipoDocto.Contiene("Ing", "Rem", "Ant") Then
|
|
||||||
CvePlantillaPoliza = 4
|
|
||||||
Else
|
|
||||||
CvePlantillaPoliza = 4
|
|
||||||
End If
|
|
||||||
|
|
||||||
'Removemos los conceptos de la prepoliza
|
|
||||||
ObjConta.RemovePrePolizasDetalle(CvePrePoliza, -1, CveVenta, 2)
|
|
||||||
|
|
||||||
ObjFactura.CveVenta = CveVenta
|
ObjFactura.CveVenta = CveVenta
|
||||||
ObjFactura.CvePrePoliza = CvePrePoliza
|
ObjFactura.CvePrePoliza = CvePrePoliza
|
||||||
ErrorCancelar = ProcesoPrepolizas(ObjConta, ObjFactura, -1, TmpDT, ObjAC, 1, ObjBancos, ObjVentas)
|
|
||||||
|
'VUELVE A GENERAR LAS PREPOLIZAS
|
||||||
|
If Not ErrorCancelar Then ErrorCancelar = ProcesoPrepolizas(ObjConta, ObjFactura, -1, TmpDT, ObjAC, 1, ObjBancos, ObjVentas)
|
||||||
|
|
||||||
If Not ErrorCancelar Then ErrorCancelar = GuardarVentaImpuestosLocales(ObjVentas, ObjConta, ObjFactura, 1)
|
If Not ErrorCancelar Then ErrorCancelar = GuardarVentaImpuestosLocales(ObjVentas, ObjConta, ObjFactura, 1)
|
||||||
|
|
||||||
Return ErrorCancelar
|
Return ErrorCancelar
|
||||||
@@ -23901,54 +23910,61 @@ Partial Class Ventas
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
#Region "P O L I Z A - V I R T U A L"
|
#Region "P O L I Z A - V I R T U A L"
|
||||||
Protected Sub GeneraPolizaVentaWS(ObjFactura As Modelos.Factura)
|
Private Sub CargaCodigoUnico()
|
||||||
Dim DtUsados As DataTable = Nothing
|
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso DdlTipoComprobante.SelectedValue = "Rem" Then
|
||||||
Dim ObjAcum As New ClsAcumuladores
|
Dim ObjAcum As New ClsAcumuladores
|
||||||
If ObjAcum.GetGarantiasPolizaVirtual(ObjFactura.CveVenta) Then
|
If ObjAcum.GetGarantiasPolizaVirtual(Me.CveVenta, UsuarioActual.CveEmpresa) AndAlso ObjAcum.DtResultados.Rows.Count > 0 Then
|
||||||
DtUsados = ObjAcum.DtResultados.Copy()
|
GvCodigosUnicos.DataSource = ObjAcum.DtResultados
|
||||||
|
DivCodigosUnicos.Visible = True
|
||||||
|
End If
|
||||||
|
ObjAcum.Dispose()
|
||||||
|
GvCodigosUnicos.DataBind()
|
||||||
End If
|
End If
|
||||||
ObjAcum.Dispose()
|
End Sub
|
||||||
|
Protected Sub GeneraPolizaVentaWS(ObjFactura As Modelos.Factura)
|
||||||
Try
|
Try
|
||||||
For Each Row As DataRow In DtUsados.Rows
|
For Each Row As GridViewRow In GvCodigosUnicos.Rows
|
||||||
Dim obj As New Modelos.MPolizaVentaWS
|
If Row.RowType = DataControlRowType.DataRow Then
|
||||||
'DATOS DEL CLIENTE
|
Dim obj As New Modelos.MPolizaVentaWS
|
||||||
obj.customer_name = ObjFactura.Cliente.Nombre
|
'DATOS DEL CLIENTE
|
||||||
obj.customer_last_name1 = ""
|
obj.customer_name = ObjFactura.Cliente.Nombre
|
||||||
obj.customer_last_name2 = ""
|
obj.customer_last_name1 = ""
|
||||||
obj.customer_birthday = Nothing
|
obj.customer_last_name2 = ""
|
||||||
obj.customer_phone = ObjFactura.Cliente.Telefono
|
obj.customer_birthday = Nothing
|
||||||
obj.customer_email = ObjFactura.Cliente.Mail
|
obj.customer_phone = ObjFactura.Cliente.Telefono
|
||||||
obj.customer_gender = "03" 'OTRO GENERO
|
obj.customer_email = ObjFactura.Cliente.Mail
|
||||||
obj.customer_advertising = False
|
obj.customer_gender = "03" 'OTRO GENERO
|
||||||
obj.customer_car_brand = "00"
|
obj.customer_advertising = False
|
||||||
obj.customer_car_model = "00"
|
obj.customer_car_brand = "00"
|
||||||
obj.customer_car_year = ObjFactura.Fecha.Year
|
obj.customer_car_model = "00"
|
||||||
|
obj.customer_car_year = ObjFactura.Fecha.Year
|
||||||
|
|
||||||
'DATOS DE VENTA
|
'DATOS DE VENTA
|
||||||
obj.sale_date = ObjFactura.Fecha
|
obj.sale_date = ObjFactura.Fecha
|
||||||
obj.sale_paidby = "01"
|
obj.sale_paidby = "01"
|
||||||
obj.sale_type = "01" 'PISO
|
obj.sale_type = "01" 'PISO
|
||||||
obj.sale_type_service = "02" 'COMERCIAL
|
obj.sale_type_service = "02" 'COMERCIAL
|
||||||
obj.sale_total = ObjFactura.Total
|
obj.sale_total = ObjFactura.Total
|
||||||
obj.sale_discount = ObjFactura.Descuento
|
obj.sale_discount = ObjFactura.Descuento
|
||||||
obj.sale_id = String.Format("{0}{1}{2}", ObjFactura.Serie, ObjFactura.Folio, ObjFactura.CveVenta)
|
obj.sale_id = String.Format("{0}{1}{2}", ObjFactura.Serie, ObjFactura.Folio, ObjFactura.CveVenta)
|
||||||
|
|
||||||
'DATOS DEL PRODUCTO
|
'DATOS DEL PRODUCTO
|
||||||
obj.product_code = Row("IdProductoPolizaVirtual").ToString()
|
obj.product_code = Row.DataKey("IdProductoPolizaVirtual").ToString()
|
||||||
obj.product_unique_code = Row("SerieLote").ToString() 'se indique el código único de la batería. (SERIE LOTE)
|
obj.product_unique_code = Row.FCTextBox("TxtCodigoUnico").Text 'se indique el código único de la batería. (SERIE LOTE)
|
||||||
obj.product_sale_type = "01 " 'VENTA
|
obj.product_sale_type = "01 " 'VENTA
|
||||||
|
|
||||||
Dim FechaUsado As DateTime = Row("FechaAjuste").ToString().ToDateTime()
|
Dim FechaUsado As DateTime = Row.DataKey("FechaAjuste").ToString().ToDateTime()
|
||||||
|
|
||||||
'DATOS DE USADO
|
'DATOS DE USADO
|
||||||
obj.used_product = True
|
obj.used_product = True
|
||||||
obj.used_brand = Row("IdModelo").ToString() 'MARCAR DEL USADO
|
obj.used_brand = Row.DataKey("IdModelo").ToString() 'MARCAR DEL USADO
|
||||||
obj.used_bci = Row("CveBCIUsado").ToString() 'VALOR DEL BCI
|
obj.used_bci = Row.DataKey("IdBCI").ToString() 'VALOR DEL BCI
|
||||||
obj.used_month = FechaUsado.Month
|
obj.used_month = FechaUsado.Month
|
||||||
obj.used_year = FechaUsado.Year
|
obj.used_year = FechaUsado.Year
|
||||||
obj.used_sale_date = FechaUsado
|
obj.used_sale_date = FechaUsado
|
||||||
|
|
||||||
EnviarPolizaVentaWS(obj)
|
EnviarPolizaVentaWS(obj)
|
||||||
|
End If
|
||||||
Next
|
Next
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
OnError("Ocurrió un error al generar la poliza virtual", ex)
|
OnError("Ocurrió un error al generar la poliza virtual", ex)
|
||||||
@@ -24034,12 +24050,12 @@ Partial Class Ventas
|
|||||||
If UsuarioActual.Empresa.Funcionalidad(579) = "1" Then
|
If UsuarioActual.Empresa.Funcionalidad(579) = "1" Then
|
||||||
If TmpDT IsNot Nothing AndAlso TmpDT.Rows.Count > 0 Then
|
If TmpDT IsNot Nothing AndAlso TmpDT.Rows.Count > 0 Then
|
||||||
For Each RowServicio As DataRow In TmpDT.Rows
|
For Each RowServicio As DataRow In TmpDT.Rows
|
||||||
Dim ClienteRetIVA = Me.ClienteRetIVA
|
Dim ClienteRetIVA = 0.0D
|
||||||
If DdlTipoRetencion.SelectedValue.Contiene("1", "2") Then
|
If DdlTipoRetencion.SelectedValue.Contiene("1", "2") Then
|
||||||
ClienteRetIVA = 0.1D
|
ClienteRetIVA = 0.1D
|
||||||
ElseIf DdlTipoRetencion.SelectedValue.Contiene("3") Then
|
ElseIf DdlTipoRetencion.SelectedValue.Contiene("3") Then
|
||||||
ClienteRetIVA = 0.04D
|
ClienteRetIVA = 0.04D
|
||||||
ElseIf DdlTipoRetencion.SelectedValue.Contiene("4") AndAlso RowServicio("CveTipoPS").ToString().ToEntero() = 1 Then
|
ElseIf DdlTipoRetencion.SelectedValue.Contiene("4") AndAlso CBool(RowServicio("EsOutSourcing").ToString()) Then
|
||||||
ClienteRetIVA = 0.06D
|
ClienteRetIVA = 0.06D
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user