-- mejoras en TC

This commit is contained in:
2022-05-11 20:09:17 -07:00
parent d5d4f762f6
commit fa3955be63
2 changed files with 141 additions and 62 deletions

View File

@@ -475,7 +475,7 @@
<div class="portlet-body nomarginleftright form-horizontal form-row-sepe formnombottom "> <div class="portlet-body nomarginleftright form-horizontal form-row-sepe formnombottom ">
<asp:GridView ID="GvPrePoliza" runat="server" AutoGenerateColumns="False" CssClass="table table-striped table-advance table-hover mysmallbtn GvPrePoliza" GridLines="None" <asp:GridView ID="GvPrePoliza" runat="server" AutoGenerateColumns="False" CssClass="table table-striped table-advance table-hover mysmallbtn GvPrePoliza" GridLines="None"
DataKeyNames="CvePrePolizaDetalle,IdMov, CveConceptoContable, IdCtaContable, CveSubProyecto, CveTipoGasto,Referencia,CveVenta,CveCompra, CveProveedor, CveCliente, CvePersonal, CveCuenta, PorcentajeImpuesto,TipoMovto,EsComplementaria,Concepto,CveClasificacion,ContadoCuenta,ContadoTipoTransaccion,ContadoNumeroFolio,ContadoBeneficiario,ContadoObservaciones,ContadoImporte,TC,EsComplementaria" Width="100%" > DataKeyNames="CvePrePolizaDetalle,IdMov, CveConceptoContable, IdCtaContable, CveSubProyecto, CveTipoGasto,Referencia,CveVenta,CveCompra, CveProveedor, CveCliente, CvePersonal, CveCuenta, PorcentajeImpuesto,TipoMovto,EsComplementaria,Concepto,CveClasificacion,ContadoCuenta,ContadoTipoTransaccion,ContadoNumeroFolio,ContadoBeneficiario,ContadoObservaciones,ContadoImporte,TC" Width="100%" >
<Columns> <Columns>
<asp:TemplateField> <asp:TemplateField>
<HeaderTemplate>Movimiento</HeaderTemplate> <HeaderTemplate>Movimiento</HeaderTemplate>
@@ -796,7 +796,7 @@
<div class="row" runat="server" id="DvModalconceptoVenta" visible="false"> <div class="row" runat="server" id="DvModalconceptoVenta" visible="false">
<div class="col-xs-2" style="text-align: left">Venta:</div> <div class="col-xs-2" style="text-align: left">Venta:</div>
<div class="col-xs-4" style="text-align: left"> <div class="col-xs-4" style="text-align: left">
<asp:DropDownList ID="DdlVentasE" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" DataTextField="Folio" DataValueField="CveVenta" Width="405px"></asp:DropDownList> <asp:DropDownList ID="DdlVentasE" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" DataTextField="Folio" DataValueField="CveVenta" Width="405px" AutoPostBack="true" OnSelectedIndexChanged="DdlVentasE_SelectedIndexChanged"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlVentasE" InitialValue="-1" runat="server" ControlToValidate="DdlVentasE" Display="None" ErrorMessage="El campo <b>''Venta''</b> es requerido por la aplicación, por favor ingrese uno." ValidationGroup="GrpMocalConceptoGuardar"></asp:RequiredFieldValidator> <asp:RequiredFieldValidator ID="RfvDdlVentasE" InitialValue="-1" runat="server" ControlToValidate="DdlVentasE" Display="None" ErrorMessage="El campo <b>''Venta''</b> es requerido por la aplicación, por favor ingrese uno." ValidationGroup="GrpMocalConceptoGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="CeRfvDdlVentasE" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlVentasE" Width="350px"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="CeRfvDdlVentasE" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlVentasE" Width="350px"></ajax:ValidatorCalloutExtender>
<i></i> <i></i>
@@ -837,9 +837,7 @@
TC: TC:
</div> </div>
<div class="col-xs-3"> <div class="col-xs-3">
<asp:TextBox ID="TxtTipoCambio" runat="server" CssClass=" form-control input-sm" Style="text-align: right"></asp:TextBox><br /> <asp:TextBox ID="TxtTipoCambio" runat="server" CssClass=" form-control input-sm" Style="text-align: right"></asp:TextBox>
<asp:CompareValidator ID="RfvTxtModalConceptoTipoCambio" runat="server" ControlToValidate="TxtTipoCambio" Display="None" ErrorMessage="El campo <b>''Tipo de Cambio''</b> no tiene el formato correcto, por favor corrija e intente de nuevo (Solo formato numérico)." Operator="DataTypeCheck" Type="Currency" ValidationGroup="GrpMocalConceptoGuardar"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VceRfvTxtModalConceptoTipoCambio" runat="server" HighlightCssClass="vco" TargetControlID="RfvTxtModalConceptoTipoCambio" Width="300px"></ajax:ValidatorCalloutExtender>
</div> </div>
</div> </div>
@@ -903,9 +901,11 @@
<div class="col-xs-2" style="text-align: left"> <div class="col-xs-2" style="text-align: left">
Mon Extrajera: Mon Extrajera:
</div> </div>
<div class="col-xs-3"> <div class="col-xs-2">
<asp:TextBox ID="TxtME" runat="server" CssClass=" form-control input-sm" Style="text-align: right"></asp:TextBox><br /> <asp:TextBox ID="TxtME" runat="server" CssClass=" form-control input-sm" Style="text-align: right"></asp:TextBox>
</div>
<div class="col-xs-8">
Importe en dólares, en Cargo/Abono, su proporcional
</div> </div>
</div> </div>
<div class="row"> <div class="row">
@@ -926,9 +926,6 @@
<ajax:ValidatorCalloutExtender ID="VCCAbono" runat="server" HighlightCssClass="vco" TargetControlID="CVAbono" Width="300px"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="VCCAbono" runat="server" HighlightCssClass="vco" TargetControlID="CVAbono" Width="300px"></ajax:ValidatorCalloutExtender>
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-6" runat="server" id="DvMoldalConceptoSeccion2" visible="false"> <div class="col-md-6" runat="server" id="DvMoldalConceptoSeccion2" visible="false">
@@ -990,8 +987,18 @@
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<asp:Button ID="BtnAceptar" runat="server" class="btn btn-success" Text="Aceptar" ValidationGroup="GrpMocalConceptoGuardar" /> <div class="row">
<button id="BtnCancelar" runat="server" type="button" class="btn default" data-dismiss="modal">Cancelar</button> <div class="col-md-8">
<asp:Button ID="BtnAceptar" runat="server" class="btn btn-success" Text="Aceptar" ValidationGroup="GrpMocalConceptoGuardar" />
<button id="BtnCancelar" runat="server" type="button" class="btn default" data-dismiss="modal">Cancelar</button>
</div>
<div class="col-md-4">
<asp:CheckBox ID="ChkSeguir" runat="server" Checked="true" />
<label for="<%= ChkSeguir.ClientID.ToString()%>">Seguir Registrando:</label>
</div>
</div>
</div> </div>
</ContentTemplate> </ContentTemplate>

View File

@@ -59,15 +59,15 @@ Partial Class ContabilidadC_RegPrePolizaS
End Get End Get
End Property End Property
'PARA CREAR IE Public Property DrConceptoContable As DataRow
Private Property CveConcepto As Integer
Get Get
Return ViewState("CveConcepto").ToString.ToEntero Return CType(ViewState("ArregloMovs"), DataRow)
End Get End Get
Set(value As Integer) Set(value As DataRow)
ViewState("CveConcepto") = value ViewState("ArregloMovs") = value
End Set End Set
End Property End Property
Private Property CveTipoTransaccion As Integer Private Property CveTipoTransaccion As Integer
Get Get
Return ViewState("CveTipoTransaccion").ToString.ToEntero Return ViewState("CveTipoTransaccion").ToString.ToEntero
@@ -244,7 +244,7 @@ Partial Class ContabilidadC_RegPrePolizaS
CveMoneda = 1 CveMoneda = 1
ViewState("CvePrePoliza") = 0 ViewState("CvePrePoliza") = 0
ViewState("CvePeriodo") = "0" ViewState("CvePeriodo") = "0"
CveConcepto = -1
CveTipoTransaccion = -1 CveTipoTransaccion = -1
CveCuenta = -1 CveCuenta = -1
Folio = "-1" Folio = "-1"
@@ -370,7 +370,6 @@ Partial Class ContabilidadC_RegPrePolizaS
.Add("ImporteMN", Type.GetType("System.Decimal")) .Add("ImporteMN", Type.GetType("System.Decimal"))
.Add("ImporteME", Type.GetType("System.Decimal")) .Add("ImporteME", Type.GetType("System.Decimal"))
.Add("EsComodin", Type.GetType("System.Int32")) .Add("EsComodin", Type.GetType("System.Int32"))
.Add("CveConcepto", Type.GetType("System.Int32"))
.Add("CveSubProyecto", Type.GetType("System.Int32")) .Add("CveSubProyecto", Type.GetType("System.Int32"))
.Add("Descripcion", Type.GetType("System.String")) .Add("Descripcion", Type.GetType("System.String"))
.Add("CveProveedor", Type.GetType("System.Int32")) .Add("CveProveedor", Type.GetType("System.Int32"))
@@ -402,7 +401,6 @@ Partial Class ContabilidadC_RegPrePolizaS
.Add("EsComplementaria", Type.GetType("System.Boolean")) .Add("EsComplementaria", Type.GetType("System.Boolean"))
.Add("TC", Type.GetType("System.Decimal")) .Add("TC", Type.GetType("System.Decimal"))
End With End With
@@ -901,11 +899,11 @@ Partial Class ContabilidadC_RegPrePolizaS
dr("CodigoCuenta") = drt("Codigo").ToString & "<br>" & drt("Nombre").ToString dr("CodigoCuenta") = drt("Codigo").ToString & "<br>" & drt("Nombre").ToString
dr("Cuenta") = Cuenta 'TxtCuentaContable.Text dr("Cuenta") = Cuenta 'TxtCuentaContable.Text
dr("Referencia") = If(drt("CveConcepto").ToString.Contiene("29", "130"), drt("Personal"), drt("RazonSocial")) dr("Referencia") = If(drt("CveConceptoContable").ToString.Contiene("29", "130"), drt("Personal"), drt("RazonSocial"))
dr("Concepto") = TxtConcepto.Text dr("Concepto") = TxtConcepto.Text
dr("TipoMovto") = If(drt("TipoMovto").ToString = "False", 0, 1) dr("TipoMovto") = If(drt("TipoMovto").ToString = "False", 0, 1)
dr("EsComodin") = EsComodin dr("EsComodin") = EsComodin
dr("CveConcepto") = drt("CveConcepto") dr("CveConceptoContable") = drt("CveConceptoContable")
dr("CveSubProyecto") = drt("CveSubProyectoNegativo") dr("CveSubProyecto") = drt("CveSubProyectoNegativo")
dr("Cargo") = TxtCargo.Text.ToDouble dr("Cargo") = TxtCargo.Text.ToDouble
dr("Abono") = TxtAbono.Text.ToDouble dr("Abono") = TxtAbono.Text.ToDouble
@@ -978,11 +976,11 @@ Partial Class ContabilidadC_RegPrePolizaS
'Agregamos la opcion para vincular los movimientos bancarios 'Agregamos la opcion para vincular los movimientos bancarios
If e.Row.DataKey("CveConcepto").ToEntero.Contiene(41) Then If e.Row.DataKey("CveConceptoContable").ToEntero.Contiene(41) Then
Dim ObjMovimientos As New ClsMovimientos Dim ObjMovimientos As New ClsMovimientos
Dim DdlSaldos As DropDownList = e.Row.FCDropDownList("DdlSaldos") Dim DdlSaldos As DropDownList = e.Row.FCDropDownList("DdlSaldos")
Select Case e.Row.DataKey("CveConcepto").ToEntero Select Case e.Row.DataKey("CveConceptoContable").ToEntero
'Acreedores 'Acreedores
Case 41 Case 41
@@ -998,7 +996,7 @@ Partial Class ContabilidadC_RegPrePolizaS
ObjMovimientos.Dispose() ObjMovimientos.Dispose()
End If End If
If e.Row.DataKey("CveConcepto").ToEntero.Contiene(30) Then If e.Row.DataKey("CveConceptoContable").ToEntero.Contiene(30) Then
e.Row.FCLinkButton("ImgBancos").Visible = True e.Row.FCLinkButton("ImgBancos").Visible = True
If e.Row.DataKey("ContadoTipoTransaccion").ToEntero > 0 And e.Row.DataKey("ContadoCuenta").ToEntero > 0 And e.Row.DataKey("ContadoNumeroFolio").ToString.Length > 0 And If e.Row.DataKey("ContadoTipoTransaccion").ToEntero > 0 And e.Row.DataKey("ContadoCuenta").ToEntero > 0 And e.Row.DataKey("ContadoNumeroFolio").ToString.Length > 0 And
@@ -1032,8 +1030,6 @@ Partial Class ContabilidadC_RegPrePolizaS
End If End If
'validaciones 'validaciones
If Not (TotalCargos = TotalAbonos AndAlso (GvPrePoliza.Rows.Count > 0 Or GvMov.Rows.Count > 0)) AndAlso UsuarioActual.CveRol <> 1 Then If Not (TotalCargos = TotalAbonos AndAlso (GvPrePoliza.Rows.Count > 0 Or GvMov.Rows.Count > 0)) AndAlso UsuarioActual.CveRol <> 1 Then
Alert($"La suma de los movimientos no son iguales ({TotalCargos}-{TotalAbonos})", TipoMensaje.MsgAdvertencia) Alert($"La suma de los movimientos no son iguales ({TotalCargos}-{TotalAbonos})", TipoMensaje.MsgAdvertencia)
Exit Sub Exit Sub
@@ -1049,9 +1045,7 @@ Partial Class ContabilidadC_RegPrePolizaS
Exit Sub Exit Sub
End If End If
End If End If
Next Next
End If End If
'terminan validaciones 'terminan validaciones
@@ -1073,6 +1067,7 @@ Partial Class ContabilidadC_RegPrePolizaS
Dim TmpCargo As Decimal = 0D Dim TmpCargo As Decimal = 0D
Dim TmpAbono As Decimal = 0D Dim TmpAbono As Decimal = 0D
Dim DifCargoAbono As Decimal = 0D Dim DifCargoAbono As Decimal = 0D
Dim TipoGrid As Integer = 0 ' 0 - GvMov, 1 - GvPrePoliza
Try Try
@@ -1090,40 +1085,54 @@ Partial Class ContabilidadC_RegPrePolizaS
FolioPoliza = ObjMov.FolioPoliza FolioPoliza = ObjMov.FolioPoliza
Dim Gv As GridView = GvMov
If DdlPlantilla.SelectedValue = "53" Then
Gv = GvPrePoliza
TipoGrid = 1
End If
'inserto las compras que voy a pagarDdlSaldos 'inserto las compras que voy a pagarDdlSaldos
For Each gvr As GridViewRow In GvMov.Rows For Each gvr As GridViewRow In Gv.Rows
'If gvr.DataKey("IDCuenta").ToEntero > 0 Then 'If gvr.DataKey("IDCuenta").ToEntero > 0 Then
' IdCtaContable = gvr.DataKey("IDCuenta") ' IdCtaContable = gvr.DataKey("IDCuenta")
'End If 'End If
'Registra movimieno bancario 'Registra movimieno bancario
If gvr.DataKey("CveConcepto").ToEntero = 30 AndAlso gvr.DataKey("ContadoImporte").ToString.ToDecimal <> 0 Then If gvr.DataKey("CveConceptoContable").ToEntero = 30 AndAlso gvr.DataKey("ContadoImporte").ToDecimal <> 0 Then
CveIE = ObjIE.AddBancos_IE(gvr.DataKey("ContadoCuenta").ToEntero, gvr.DataKey("ContadoTipoTransaccion").ToEntero, TxtFechaDocumento.Text, gvr.DataKey("ContadoNumeroFolio").ToString, CveIE = ObjIE.AddBancos_IE(gvr.DataKey("ContadoCuenta").ToEntero, gvr.DataKey("ContadoTipoTransaccion").ToEntero, TxtFechaDocumento.Text, gvr.DataKey("ContadoNumeroFolio"),
gvr.DataKey("ContadoBeneficiario").ToString, gvr.DataKey("ContadoImporte").ToString.ToDecimal, CveMoneda, 0, gvr.DataKey("ContadoObservaciones").ToString, "", gvr.DataKey("ContadoBeneficiario"), gvr.DataKey("ContadoImporte").ToDecimal, CveMoneda, 0, gvr.DataKey("ContadoObservaciones"), "",
False, False, 0, CvePrePolizaInsertada, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) False, False, 0, CvePrePolizaInsertada, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If CveIE < 0 Then If CveIE < 0 Then
MsgError = "No se pudo registrar movimiento bancario" MsgError = "No se pudo registrar movimiento bancario"
Exit For Exit For
End If End If
'If ObjIE.GetBancosIE(CveIE, -1, -1, "-1", -1, "-1", "-1", -1, -1, -1, -1, -1, MinFecha, MaxFecha, MinFecha, MaxFecha, MinFecha, MaxFecha, -1, -1, UsuarioActual.CveEmpresa) Then
' FolioIE = ObjIE.Folio
'End If
End If End If
ImporteME = 0 ImporteME = 0
TipoCambio = 1 TipoCambio = 1
If gvr.DataKey("TipoMovto") = "True" Then If gvr.DataKey("TipoMovto") = "True" Then
Importe = gvr.FCTextBox("TxtAbono").Text.ToDouble If TipoGrid = "0" Then 'gvprep
TmpAbono = TmpAbono + Importe Importe = gvr.FCTextBox("TxtAbono").Text.ToDouble
TipoMovto = True TmpAbono = TmpAbono + Importe
TipoMovto = True
If gvr.DataKey("EsComplementaria") = "True" Then If gvr.DataKey("EsComplementaria") = "True" Then
ImporteME = gvr.FCTextBox("TxtAbonoME").Text.ToDecimal ImporteME = gvr.FCTextBox("TxtAbonoME").Text.ToDecimal
TipoCambio = gvr.FCTextBox("TipoCambio").Text.ToDecimal TipoCambio = gvr.FCTextBox("TipoCambio").Text.ToDecimal
End If
Else
Importe = gvr.DataKey("Abono").ToDecimal
TmpAbono = TmpAbono + Importe
TipoMovto = True
If gvr.DataKey("EsComplementaria") = "True" Then
ImporteME = gvr.DataKey("MonedaExtranjera").ToDecimal
TipoCambio = gvr.DataKey("TipoCambio").ToDecimal
End If
End If End If
Else Else
Importe = gvr.FCTextBox("TxtCargo").Text.ToDouble Importe = gvr.FCTextBox("TxtCargo").Text.ToDouble
@@ -1137,9 +1146,9 @@ Partial Class ContabilidadC_RegPrePolizaS
End If End If
If Not gvr.DataKey("CveConcepto").Contiene("30", "10") Then ' 30-bancos, 10-anticipos proveedores If Not gvr.DataKey("CveConceptoContable").Contiene("30", "10") Then ' 30-bancos, 10-anticipos proveedores
If gvr.DataKey("CveConcepto").ToEntero = 41 Then If gvr.DataKey("CveConceptoContable").ToEntero = 41 Then
CveIE = gvr.FCDropDownList("DdlSaldos").SelectedValue.ToEntero CveIE = gvr.FCDropDownList("DdlSaldos").SelectedValue.ToEntero
Else Else
CveIE = -1 CveIE = -1
@@ -1158,7 +1167,7 @@ Partial Class ContabilidadC_RegPrePolizaS
' tCveCuenta = gvr.DataKey("CveCuenta").ToEntero ' tCveCuenta = gvr.DataKey("CveCuenta").ToEntero
'End If 'End If
If ObjMov.AddPrePolizasDetalle(CvePrePolizaInsertada, TipoMovto, Importe, gvr.FCLiteral("LtlReferencia").Text, gvr.DataKey("CveConcepto").ToEntero, gvr.FCTextBox("TxtConcepto").Text, If ObjMov.AddPrePolizasDetalle(CvePrePolizaInsertada, TipoMovto, Importe, gvr.FCLiteral("LtlReferencia").Text, gvr.DataKey("CveConceptoContable").ToEntero, gvr.FCTextBox("TxtConcepto").Text,
TxtFechaDocumento.Text.ToDate, IdCtaContable, -1, CveSubProyecto:=gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero, CveIE:=CveIE, TxtFechaDocumento.Text.ToDate, IdCtaContable, -1, CveSubProyecto:=gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero, CveIE:=CveIE,
CveProveedor:=gvr.DataKey("CveProveedor").ToEntero, CveCompra:=gvr.DataKey("CveCompra").ToEntero, CveProveedor:=gvr.DataKey("CveProveedor").ToEntero, CveCompra:=gvr.DataKey("CveCompra").ToEntero,
CvePersonal:=gvr.DataKey("CvePersonal").ToEntero, CveClasificacion:=gvr.DataKey("CveClasificacion").ToEntero, CvePersonal:=gvr.DataKey("CvePersonal").ToEntero, CveClasificacion:=gvr.DataKey("CveClasificacion").ToEntero,
@@ -1172,7 +1181,7 @@ Partial Class ContabilidadC_RegPrePolizaS
Exit For Exit For
End If End If
End If End If
If CveIE > 0 AndAlso gvr.DataKey("CveConcepto").ToEntero = 30 Then If CveIE > 0 AndAlso gvr.DataKey("CveConceptoContable").ToEntero = 30 Then
MensajeAlert.AppendFormat("<br/><br/>Folio Bancario: <b><a href = ""/Bancos/IE.aspx?CveIE={0}"" class=""Texto"" target=""_blank"" >{1}</a></b>", CveIE, FolioIE) MensajeAlert.AppendFormat("<br/><br/>Folio Bancario: <b><a href = ""/Bancos/IE.aspx?CveIE={0}"" class=""Texto"" target=""_blank"" >{1}</a></b>", CveIE, FolioIE)
End If End If
@@ -1428,8 +1437,6 @@ Partial Class ContabilidadC_RegPrePolizaS
End Sub End Sub
Private Sub DdlConceptosContablesE_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlConceptosContablesE.SelectedIndexChanged Private Sub DdlConceptosContablesE_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlConceptosContablesE.SelectedIndexChanged
'Aquii hay que consultar el concepto y determinar que es lo que se vba aplicar 'Aquii hay que consultar el concepto y determinar que es lo que se vba aplicar
@@ -1440,6 +1447,7 @@ Partial Class ContabilidadC_RegPrePolizaS
If CveConceptoContableInsertar > 0 Then If CveConceptoContableInsertar > 0 Then
DT_Concepto = GlobalDTContaConceptosContables(CveConceptoContableInsertar) DT_Concepto = GlobalDTContaConceptosContables(CveConceptoContableInsertar)
DrConceptoContable = GlobalDTContaConceptosContables(CveConceptoContableInsertar).FiltroPrimero("")
Dim AplicaActivoFijo As Boolean = False Dim AplicaActivoFijo As Boolean = False
Dim AplicaAlmacen As Boolean = False Dim AplicaAlmacen As Boolean = False
@@ -1455,6 +1463,7 @@ Partial Class ContabilidadC_RegPrePolizaS
Dim AplicaTC As Boolean = False 'ok Dim AplicaTC As Boolean = False 'ok
Dim AplicaVenta As Boolean = False Dim AplicaVenta As Boolean = False
Dim AplicaComplementaria As Boolean = False 'ok Dim AplicaComplementaria As Boolean = False 'ok
Dim AplicaME As Boolean = False 'ok
AplicaActivoFijo = Boolean.Parse(DT_Concepto.Rows(0)("AplicaActivoFijo").ToString) AplicaActivoFijo = Boolean.Parse(DT_Concepto.Rows(0)("AplicaActivoFijo").ToString)
AplicaAlmacen = Boolean.Parse(DT_Concepto.Rows(0)("AplicaAlmacen").ToString) AplicaAlmacen = Boolean.Parse(DT_Concepto.Rows(0)("AplicaAlmacen").ToString)
@@ -1472,6 +1481,7 @@ Partial Class ContabilidadC_RegPrePolizaS
AplicaTC = Boolean.Parse(DT_Concepto.Rows(0)("AplicaTC").ToString) AplicaTC = Boolean.Parse(DT_Concepto.Rows(0)("AplicaTC").ToString)
AplicaVenta = Boolean.Parse(DT_Concepto.Rows(0)("AplicaVenta").ToString) AplicaVenta = Boolean.Parse(DT_Concepto.Rows(0)("AplicaVenta").ToString)
AplicaComplementaria = Boolean.Parse(DT_Concepto.Rows(0)("EsComplementaria").ToString) AplicaComplementaria = Boolean.Parse(DT_Concepto.Rows(0)("EsComplementaria").ToString)
'AplicaME = Boolean.Parse(DT_Concepto.Rows(0)("EsMonedaExtranjera").ToString)
If AplicaImpuesto Then If AplicaImpuesto Then
@@ -1549,11 +1559,31 @@ Partial Class ContabilidadC_RegPrePolizaS
Else Else
DivMonedaExtranjera.Visible = False DivMonedaExtranjera.Visible = False
End If End If
CargaCuentaConcepto(CveConceptoContableInsertar)
End If End If
UpModalConcepto.Update() UpModalConcepto.Update()
End Sub End Sub
Private Sub CargaCuentaConcepto(CveConcepto As Integer)
Dim ObjConta As New ClsContabilidad
If ObjConta.GetCuentasAsignacionesSistema(UsuarioActual.CveEmpresa, -1, 1, CveConcepto) Then
Dim dr As DataRow = ObjConta.DtResultados.FiltroPrimero("")
If dr IsNot Nothing Then
DdlCuentaContableE.SelectedValueExist(dr("CveCuenta"))
Else
If ObjConta.GetCuentasGlobales(UsuarioActual.CveEmpresa, CveConcepto) Then
Dim drY As DataRow = ObjConta.DtResultados.FiltroPrimero("")
If drY IsNot Nothing Then
DdlCuentaContableE.SelectedValueExist(drY("CveCuenta"))
End If
End If
End If
End If
ObjConta.Dispose()
End Sub
Private Sub CargaProveedoresE() Private Sub CargaProveedoresE()
DdlProveedoresE.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa) DdlProveedoresE.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa)
DdlProveedoresE.DataBind() DdlProveedoresE.DataBind()
@@ -1592,7 +1622,7 @@ Partial Class ContabilidadC_RegPrePolizaS
If CveMoneda = 2 Then If CveMoneda = 2 Then
DdlVentasE.DataSource = ObjVentas.DtResultados.FiltraParametros("CveMoneda = 2") DdlVentasE.DataSource = ObjVentas.DtResultados.FiltraParametros("CveMoneda = 2")
Else Else
DdlVentasE.DataSource = ObjVentas.DtResultados '.FiltraParametros("Saldo > 0") DdlVentasE.DataSource = ObjVentas.DtResultados.FiltraParametros("CveMoneda = 1")
End If End If
DdlVentasE.DataBind() DdlVentasE.DataBind()
@@ -1619,18 +1649,52 @@ Partial Class ContabilidadC_RegPrePolizaS
CargaComprasE(DdlProveedoresE.SelectedValue.ToEntero) CargaComprasE(DdlProveedoresE.SelectedValue.ToEntero)
End Sub End Sub
Private Sub DdlClientesE_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlClientesE.selectedindexchange Private Sub DdlClientesE_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlClientesE.selectedindexchange
Dim tCveMoneda As Integer = 1
CargaVentasE(DdlClientesE.SelectedValue.ToEntero, IIf(DdlConceptosContablesE.SelectedValue.Contiene("291", "292"), 2, -1)) If DrConceptoContable IsNot Nothing Then
Dim AplicaME = Boolean.Parse(DrConceptoContable("EsMonedaExtranjera").ToString)
If AplicaME Then
tCveMoneda = 2
End If
End If
CargaVentasE(DdlClientesE.SelectedValue.ToEntero, tCveMoneda)
End Sub End Sub
Private Function CargaValidacionesConcepto() As Boolean
Dim Retorno As Boolean = true
If DrConceptoContable IsNot Nothing Then
Dim AplicaComplementaria = Boolean.Parse(DrConceptoContable("EsComplementaria").ToString)
If AplicaComplementaria Then
Dim Importe As Decimal = IIf(TxtCargoE.Text.ToDecimal <> 0, TxtCargoE.Text.ToDecimal, TxtAbonoE.Text.ToDecimal)
'valida Mon Extranjera por el TC - Mon Extranjera
Dim dif As Decimal = ((TxtME.Text.ToDecimal * TxtTipoCambio.Text.ToDecimal) - TxtME.Text.ToDecimal).RoundSQL - Importe
If dif <> 0 Then
Alert("El importe moneda extranjera no coinciden con el TC ")
Retorno = False
Else
Retorno = True
End If
End If
End If
Return Retorno
End Function
Protected Sub BtnAceptar_Click(sender As Object, e As EventArgs) Handles BtnAceptar.Click Protected Sub BtnAceptar_Click(sender As Object, e As EventArgs) Handles BtnAceptar.Click
'asdasdasd 'asdasdasd
If Not CargaValidacionesConcepto() Then
Exit Sub
End If
ChkSeguir.Visible = False
If IndiceGrid = -1 Then If IndiceGrid = -1 Then
ChkSeguir.Visible = True
If DtMovimientos Is Nothing Then CreaDT() If DtMovimientos Is Nothing Then CreaDT()
Dim IdCtaContable As Integer = CargaCuentasContpaq(DdlCuentaContableE.SelectedValue.ToEntero) Dim IdCtaContable As Integer = CargaCuentasContpaq(DdlCuentaContableE.SelectedValue.ToEntero)
@@ -1675,7 +1739,7 @@ Partial Class ContabilidadC_RegPrePolizaS
TxtTotalAbonos.Text = DtMovimientos.SUMD("Abono").ToString.FormatoNumero TxtTotalAbonos.Text = DtMovimientos.SUMD("Abono").ToString.FormatoNumero
UpTotalCargo.Update() UpTotalCargo.Update()
UpTotalAbono.Update() UpTotalAbono.Update()
RegistraScript("$('#DivEditConcepto').modal('hide')", "hidemodal") If Not ChkSeguir.Checked Then RegistraScript("$('#DivEditConcepto').modal('hide')", "hidemodal")
Else Else
Dim CvePrePolizaDetalle As Integer = GvPrePoliza.DataKeys(IndiceGrid).Value.ToString.ToEntero Dim CvePrePolizaDetalle As Integer = GvPrePoliza.DataKeys(IndiceGrid).Value.ToString.ToEntero
@@ -1797,7 +1861,7 @@ Partial Class ContabilidadC_RegPrePolizaS
dr("Concepto") = TxtConcepto.Text dr("Concepto") = TxtConcepto.Text
dr("TipoMovto") = If(Math.Abs(TxtCargo.Text.ToDouble) > 0, False, True) dr("TipoMovto") = If(Math.Abs(TxtCargo.Text.ToDouble) > 0, False, True)
dr("EsComodin") = 0 dr("EsComodin") = 0
dr("CveConcepto") = DdlConceptosContables.SelectedValue dr("CveConceptoContable") = DdlConceptosContables.SelectedValue
dr("Cargo") = TxtCargo.Text.ToDouble dr("Cargo") = TxtCargo.Text.ToDouble
dr("Abono") = TxtAbono.Text.ToDouble dr("Abono") = TxtAbono.Text.ToDouble
dr("Descripcion") = TxtDescripcion.Text dr("Descripcion") = TxtDescripcion.Text
@@ -1869,7 +1933,6 @@ Partial Class ContabilidadC_RegPrePolizaS
dr("Concepto") = TxtConcepto.Text dr("Concepto") = TxtConcepto.Text
dr("TipoMovto") = If(Math.Abs(TxtCargo.Text.ToDouble) > 0, False, True) dr("TipoMovto") = If(Math.Abs(TxtCargo.Text.ToDouble) > 0, False, True)
dr("EsComodin") = 0 dr("EsComodin") = 0
dr("CveConcepto") = DdlConceptosContables.SelectedValue
dr("CveConceptoContable") = DdlConceptosContables.SelectedValue dr("CveConceptoContable") = DdlConceptosContables.SelectedValue
dr("ConceptoContable") = DdlConceptosContables.SelectedItem.Text dr("ConceptoContable") = DdlConceptosContables.SelectedItem.Text
dr("Cargo") = TxtCargo.Text.ToDouble dr("Cargo") = TxtCargo.Text.ToDouble
@@ -2074,7 +2137,7 @@ Partial Class ContabilidadC_RegPrePolizaS
TxtConcepto.Text = DrM("Concepto") TxtConcepto.Text = DrM("Concepto")
' (Math.Abs(TxtCargo.Text.ToDouble) > 0, 0, 1) = dr("TipoMovto") ' (Math.Abs(TxtCargo.Text.ToDouble) > 0, 0, 1) = dr("TipoMovto")
DrM("EsComodin") = 0 DrM("EsComodin") = 0
DdlConceptosContables.SelectedValueExist(DrM("CveConcepto").ToString) DdlConceptosContables.SelectedValueExist(DrM("CveConceptoContable").ToString)
TxtCargo.Text = DrM("Cargo").ToString TxtCargo.Text = DrM("Cargo").ToString
TxtAbono.Text = DrM("Abono").ToString TxtAbono.Text = DrM("Abono").ToString
TxtDescripcion.Text = DrM("Descripcion").ToString TxtDescripcion.Text = DrM("Descripcion").ToString
@@ -2203,7 +2266,7 @@ Partial Class ContabilidadC_RegPrePolizaS
.SubProyecto = row.Item("SubProyecto"), .SubProyecto = row.Item("SubProyecto"),
.Folio = "", .Folio = "",
.TipoTransferencia = "", .TipoTransferencia = "",
.CveConceptoContable = row.Item("CveConcepto"), .CveConceptoContable = row.Item("CveConceptoContable"),
.CveSubProyecto = IIf(row.Item("CveSubProyecto").ToString.ToEntero > 0, row.Item("CveSubProyecto"), -1), .CveSubProyecto = IIf(row.Item("CveSubProyecto").ToString.ToEntero > 0, row.Item("CveSubProyecto"), -1),
.IdCtaContable = IIf(row.Item("IdCtaContable").ToString.ToEntero > 0, row.Item("IdCtaContable"), -1), .IdCtaContable = IIf(row.Item("IdCtaContable").ToString.ToEntero > 0, row.Item("IdCtaContable"), -1),
.CveCuenta = row.Item("CveCuenta") .CveCuenta = row.Item("CveCuenta")
@@ -2432,7 +2495,6 @@ Partial Class ContabilidadC_RegPrePolizaS
dr("Concepto") = Row("Concepto").ToString dr("Concepto") = Row("Concepto").ToString
dr("TipoMovto") = TipoMovto dr("TipoMovto") = TipoMovto
dr("EsComodin") = 0 dr("EsComodin") = 0
dr("CveConcepto") = CveConceptoContable
dr("CveConceptoContable") = CveConceptoContable dr("CveConceptoContable") = CveConceptoContable
dr("ConceptoContable") = Row("ConceptoAdministrativo").ToString dr("ConceptoContable") = Row("ConceptoAdministrativo").ToString
dr("Cargo") = Row("Cargo").ToString.ToDecimal.RoundSQL dr("Cargo") = Row("Cargo").ToString.ToDecimal.RoundSQL
@@ -3060,8 +3122,6 @@ Partial Class ContabilidadC_RegPrePolizaS
UpPoliza.Update() UpPoliza.Update()
UpGuardar.Update() UpGuardar.Update()
End Sub End Sub
Private Sub LnkFolioManual_Click(sender As Object, e As EventArgs) Handles LnkFolioManual.Click Private Sub LnkFolioManual_Click(sender As Object, e As EventArgs) Handles LnkFolioManual.Click
@@ -3071,5 +3131,17 @@ Partial Class ContabilidadC_RegPrePolizaS
UpPoliza.Update() UpPoliza.Update()
End Sub End Sub
Protected Sub DdlVentasE_SelectedIndexChanged(sender As Object, e As EventArgs)
Dim Venta As New ClsVentas
If Venta.GetVenta(DdlVentasE.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
Dim dr As DataRow = Venta.DtResultados.FiltroPrimero("")
If dr IsNot Nothing Then
TxtTipoCambio.Text = dr("TipoCambioValuacion")
End If
End If
Venta.Dispose()
End Sub
End Class End Class