- cambio de literal a label, cargo y abono. error en numeros negaivos, se perdía el dato al editar

This commit is contained in:
2023-11-01 17:33:43 -07:00
parent 999c52583d
commit 0f01fa9eb1
2 changed files with 20 additions and 20 deletions

View File

@@ -507,7 +507,7 @@
<HeaderTemplate>Cargo</HeaderTemplate>
<ItemTemplate>
<div style="text-align: right">
<asp:Literal ID="TxtCargo" runat="server" Text='<%# If(Eval("TipoMovto").ToString = "False", Eval("ImporteMN", "{0:N2}"), "") %>'></asp:Literal><br />
<asp:Label ID="TxtCargo" runat="server" Text='<%# If(Eval("TipoMovto").ToString = "False", Eval("ImporteMN", "{0:N2}"), "") %>'></asp:Label><br />
</div>
<%-- <asp:CompareValidator ID="CVCargo" runat="server" ControlToValidate="TxtCargo" Display="None" ErrorMessage="El campo <b>''Cargo''</b> no tiene el formato correcto, por favor corrija e intente de nuevo (Solo formato numérico)." Operator="DataTypeCheck" Type="Currency" ValidationGroup="GrpGuardar"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCCCargo" runat="server" HighlightCssClass="vco" TargetControlID="CVCargo" Width="300px"></ajax:ValidatorCalloutExtender>--%>
@@ -517,7 +517,7 @@
<HeaderTemplate>Abono</HeaderTemplate>
<ItemTemplate>
<div style="text-align: right">
<asp:Literal ID="TxtAbono" runat="server" Text='<%# If(Eval("TipoMovto").ToString = "True", Eval("ImporteMN", "{0:N2}"), "") %>'></asp:Literal><br />
<asp:Label ID="TxtAbono" runat="server" Text='<%# If(Eval("TipoMovto").ToString = "True", Eval("ImporteMN", "{0:N2}"), "") %>'></asp:Label><br />
</div>
<%-- <asp:CompareValidator ID="CVAbono" runat="server" ControlToValidate="TxtAbono" Display="None" ErrorMessage="El campo <b>''Abono''</b> no tiene el formato correcto, por favor corrija e intente de nuevo (Solo formato numérico)." Operator="DataTypeCheck" Type="Currency" ValidationGroup="GrpGuardar"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCCAbono" runat="server" HighlightCssClass="vco" TargetControlID="CVAbono" Width="300px"></ajax:ValidatorCalloutExtender>--%>

View File

@@ -551,23 +551,23 @@ Partial Class ContabilidadC_RegPrePolizaS
TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDecimal + e.Row.DBCampo("Cargo").ToDecimal).ToString.FormatoNumero
TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDecimal + e.Row.DBCampo("Abono").ToDecimal).ToString.FormatoNumero
If e.Row.DBCampo("Cargo").ToDouble < 0 AndAlso e.Row.FCLiteral("TxtCargo") IsNot Nothing Then e.Row.FCLiteral("TxtCargo").Text = String.Format("<span style='color:red;'>{0}</span>", e.Row.DBCampo("Cargo").FormatoNumero())
If e.Row.DBCampo("Abono").ToDouble < 0 AndAlso e.Row.FCLiteral("TxtAbono") IsNot Nothing Then e.Row.FCLiteral("TxtAbono").Text = String.Format("<span style='color:red;'>{0}</span>", e.Row.DBCampo("Abono").FormatoNumero())
If e.Row.DBCampo("Cargo").ToDouble < 0 AndAlso e.Row.FCLabel("TxtCargo") IsNot Nothing Then e.Row.FCLabel("TxtCargo").ForeColor = Drawing.Color.Red 'e.Row.FCLabel("TxtCargo").Text = String.Format("<span style='color:red;'>{0}</span>", e.Row.DBCampo("Cargo").FormatoNumero())
If e.Row.DBCampo("Abono").ToDouble < 0 AndAlso e.Row.FCLabel("TxtAbono") IsNot Nothing Then e.Row.FCLabel("TxtAbono").ForeColor = Drawing.Color.Red '.Text = String.Format("<span style='color:red;'>{0}</span>", e.Row.DBCampo("Abono").FormatoNumero())
Dim CveConceptoContable As Integer = e.Row.DataKey("CveConceptoContable").ToEntero
If CveConceptoContable.Contiene(1, 2, 12, 91, 13, 38, 207, 203, 39, 61, 62, 63, 4, 278, 291, 292, 293, 294, 272, 150, 251, 301) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Ventas/Ventas.aspx?CveVenta={0}", e.Row.DataKey("CveVenta"))
If CveConceptoContable.Contiene(5, 6, 17, 18, 14, 19, 25, 26, 60, 205, 225, 234, 235, 240, 305, 306, 307, 308, 309, 310, 311, 312, 201, 206, 323, 324, 341, 342, 343, 344, 304, 272, 259, 287, 288) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Compras/Compras.aspx?CveCompra={0}", e.Row.DataKey("CveCompra"))
If CveConceptoContable.Contiene(68) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}", e.Row.DBCampo("CveMovimientoAlmacen"))
If CveConceptoContable.Contiene(30, 204, 66, 92, 202, 10, 21, 48, 56, 338, 339, 340, 345, 346, 347) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Bancos/IE.aspx?CveIE={0}", e.Row.DBCampo("CveIE"))
If CveConceptoContable.Contiene(1, 2, 12, 91, 13, 38, 207, 203, 39, 61, 62, 63, 4, 278, 291, 292, 293, 294, 272, 150, 251, 301) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Ventas/Ventas.aspx?CveVenta={0}", e.Row.DataKey("CveVenta"))
If CveConceptoContable.Contiene(5, 6, 17, 18, 14, 19, 25, 26, 60, 205, 225, 234, 235, 240, 305, 306, 307, 308, 309, 310, 311, 312, 201, 206, 323, 324, 341, 342, 343, 344, 304, 272, 259, 287, 288) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Compras/Compras.aspx?CveCompra={0}", e.Row.DataKey("CveCompra"))
If CveConceptoContable.Contiene(68) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}", e.Row.DBCampo("CveMovimientoAlmacen"))
If CveConceptoContable.Contiene(30, 204, 66, 92, 202, 10, 21, 48, 56, 338, 339, 340, 345, 346, 347) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Bancos/IE.aspx?CveIE={0}", e.Row.DBCampo("CveIE"))
If e.Row.DBCampo("Modificado") = "True" Then
e.Row.FCCheckBox("chkModificado").Checked = True
End If
End If
If e.Row.DBCampo("Modificado") = "True" Then
e.Row.FCCheckBox("chkModificado").Checked = True
End If
End If
If e.Row.RowType = DataControlRowType.Header Then
If e.Row.RowType = DataControlRowType.Header Then
'e.Row.FCDropDownList("DdlSubProyectoFiltro").DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa)
'e.Row.FCDropDownList("DdlSubProyectoFiltro").DataBind()
'e.Row.FCDropDownList("DdlSubProyectoFiltro").Items.Insert(0, New ListItem("Todos", "-1"))
@@ -1149,7 +1149,7 @@ Partial Class ContabilidadC_RegPrePolizaS
If row.FCCheckBox("chkModificado").Checked Then
contador = contador + 1
Dim ImporteIE As Decimal = If(row.FCLiteral("TxtCargo").Text.ToDecimal <> 0, row.FCLiteral("TxtCargo").Text.ToDecimal, row.FCLiteral("TxtAbono").Text.ToDecimal)
Dim ImporteIE As Decimal = If(row.FCLabel("TxtCargo").Text.ToDecimal <> 0, row.FCLabel("TxtCargo").Text.ToDecimal, row.FCLabel("TxtAbono").Text.ToDecimal)
If row.DataKey("CveConceptoContable").ToEntero = 30 AndAlso ImporteIE > 0 AndAlso row.DataKey("CveIE").ToDecimal <= 0 Then
Dim ObjIE As New ClsBancos(ObjContabilidad.IniciaTransacSQL)
@@ -1193,9 +1193,9 @@ Partial Class ContabilidadC_RegPrePolizaS
End If
End If
If Not ObjContabilidad.AddPrePolizasDetalle(CvePrePoliza, If(row.FCLiteral("TxtCargo").Text.ToDecimal <> 0, False, True),
If(row.FCLiteral("TxtCargo").Text.ToDecimal <> 0, row.FCLiteral("TxtCargo").Text.ToDecimal, row.FCLiteral("TxtAbono").Text.ToDecimal),
If(row.FCLiteral("TxtCargo").Text.ToDecimal <> 0, row.FCLiteral("TxtCargo").Text.ToDecimal, row.FCLiteral("TxtAbono").Text.ToDecimal),
If Not ObjContabilidad.AddPrePolizasDetalle(CvePrePoliza, If(row.FCLabel("TxtCargo").Text.ToDecimal <> 0, False, True),
If(row.FCLabel("TxtCargo").Text.ToDecimal <> 0, row.FCLabel("TxtCargo").Text.ToDecimal, row.FCLabel("TxtAbono").Text.ToDecimal),
If(row.FCLabel("TxtCargo").Text.ToDecimal <> 0, row.FCLabel("TxtCargo").Text.ToDecimal, row.FCLabel("TxtAbono").Text.ToDecimal),
row.DataKey("CveConceptoContable").ToEntero, row.DataKey("Referencia").ToString, row.FCLiteral("TxtConcepto").Text,
CveSubProyecto:=row.DataKey("CveSubProyecto").ToEntero,
CveTipoGasto:=If(DdlTipoGasto.Visible, row.DataKey("CveTipoGasto").ToEntero, row.DataKey("CveTipoGasto").ToEntero),
@@ -1279,11 +1279,11 @@ Partial Class ContabilidadC_RegPrePolizaS
Dim CveSubProyecto As Integer = GvPrePoliza.Rows(IndiceGrid).DataKey("CveSubProyecto").ToString.ToEntero
Dim CveTipoGasto As Integer = GvPrePoliza.Rows(IndiceGrid).DataKey("CveTipoGasto").ToString.ToEntero
Dim CveCuenta As Integer = GvPrePoliza.Rows(IndiceGrid).DataKey("CveCuenta").ToString.ToEntero
Dim Cargo As Decimal = GvPrePoliza.Rows(IndiceGrid).FCLiteral("TxtCargo").Text.ToDecimal
Dim Abono As Decimal = GvPrePoliza.Rows(IndiceGrid).FCLiteral("TxtAbono").Text.ToDecimal
Dim Cargo As Decimal = GvPrePoliza.Rows(IndiceGrid).FCLabel("TxtCargo").Text.ToDecimal
Dim Abono As Decimal = GvPrePoliza.Rows(IndiceGrid).FCLabel("TxtAbono").Text.ToDecimal
Dim PorcentajeImpuesto As Decimal = GvPrePoliza.Rows(IndiceGrid).DataKey("PorcentajeImpuesto").ToDecimal
Dim CveClasificacion As Integer = GvPrePoliza.Rows(IndiceGrid).DataKey("CveClasificacion").ToEntero
Dim MonedaExtr As Decimal = GvPrePoliza.Rows(IndiceGrid).FCLiteral("TxtCargo").Text.ToDecimal
'Dim MonedaExtr As Decimal = GvPrePoliza.Rows(IndiceGrid).FCLiteral("TxtCargo").Text.ToDecimal
'CargaConceptosContablesE()
'CargaModalConceptoCuentas()