- 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> <HeaderTemplate>Cargo</HeaderTemplate>
<ItemTemplate> <ItemTemplate>
<div style="text-align: right"> <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> </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> <%-- <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>--%> <ajax:ValidatorCalloutExtender ID="VCCCargo" runat="server" HighlightCssClass="vco" TargetControlID="CVCargo" Width="300px"></ajax:ValidatorCalloutExtender>--%>
@@ -517,7 +517,7 @@
<HeaderTemplate>Abono</HeaderTemplate> <HeaderTemplate>Abono</HeaderTemplate>
<ItemTemplate> <ItemTemplate>
<div style="text-align: right"> <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> </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> <%-- <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>--%> <ajax:ValidatorCalloutExtender ID="VCCAbono" runat="server" HighlightCssClass="vco" TargetControlID="CVAbono" Width="300px"></ajax:ValidatorCalloutExtender>--%>

View File

@@ -551,8 +551,8 @@ Partial Class ContabilidadC_RegPrePolizaS
TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDecimal + e.Row.DBCampo("Cargo").ToDecimal).ToString.FormatoNumero TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDecimal + e.Row.DBCampo("Cargo").ToDecimal).ToString.FormatoNumero
TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDecimal + e.Row.DBCampo("Abono").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("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.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("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 Dim CveConceptoContable As Integer = e.Row.DataKey("CveConceptoContable").ToEntero
@@ -1149,7 +1149,7 @@ Partial Class ContabilidadC_RegPrePolizaS
If row.FCCheckBox("chkModificado").Checked Then If row.FCCheckBox("chkModificado").Checked Then
contador = contador + 1 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 If row.DataKey("CveConceptoContable").ToEntero = 30 AndAlso ImporteIE > 0 AndAlso row.DataKey("CveIE").ToDecimal <= 0 Then
Dim ObjIE As New ClsBancos(ObjContabilidad.IniciaTransacSQL) Dim ObjIE As New ClsBancos(ObjContabilidad.IniciaTransacSQL)
@@ -1193,9 +1193,9 @@ Partial Class ContabilidadC_RegPrePolizaS
End If End If
End If End If
If Not ObjContabilidad.AddPrePolizasDetalle(CvePrePoliza, If(row.FCLiteral("TxtCargo").Text.ToDecimal <> 0, False, True), If Not ObjContabilidad.AddPrePolizasDetalle(CvePrePoliza, If(row.FCLabel("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.FCLabel("TxtCargo").Text.ToDecimal <> 0, row.FCLabel("TxtCargo").Text.ToDecimal, row.FCLabel("TxtAbono").Text.ToDecimal),
If(row.FCLiteral("TxtCargo").Text.ToDecimal <> 0, row.FCLiteral("TxtCargo").Text.ToDecimal, row.FCLiteral("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, row.DataKey("CveConceptoContable").ToEntero, row.DataKey("Referencia").ToString, row.FCLiteral("TxtConcepto").Text,
CveSubProyecto:=row.DataKey("CveSubProyecto").ToEntero, CveSubProyecto:=row.DataKey("CveSubProyecto").ToEntero,
CveTipoGasto:=If(DdlTipoGasto.Visible, row.DataKey("CveTipoGasto").ToEntero, row.DataKey("CveTipoGasto").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 CveSubProyecto As Integer = GvPrePoliza.Rows(IndiceGrid).DataKey("CveSubProyecto").ToString.ToEntero
Dim CveTipoGasto As Integer = GvPrePoliza.Rows(IndiceGrid).DataKey("CveTipoGasto").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 CveCuenta As Integer = GvPrePoliza.Rows(IndiceGrid).DataKey("CveCuenta").ToString.ToEntero
Dim Cargo As Decimal = GvPrePoliza.Rows(IndiceGrid).FCLiteral("TxtCargo").Text.ToDecimal Dim Cargo As Decimal = GvPrePoliza.Rows(IndiceGrid).FCLabel("TxtCargo").Text.ToDecimal
Dim Abono As Decimal = GvPrePoliza.Rows(IndiceGrid).FCLiteral("TxtAbono").Text.ToDecimal Dim Abono As Decimal = GvPrePoliza.Rows(IndiceGrid).FCLabel("TxtAbono").Text.ToDecimal
Dim PorcentajeImpuesto As Decimal = GvPrePoliza.Rows(IndiceGrid).DataKey("PorcentajeImpuesto").ToDecimal Dim PorcentajeImpuesto As Decimal = GvPrePoliza.Rows(IndiceGrid).DataKey("PorcentajeImpuesto").ToDecimal
Dim CveClasificacion As Integer = GvPrePoliza.Rows(IndiceGrid).DataKey("CveClasificacion").ToEntero 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() 'CargaConceptosContablesE()
'CargaModalConceptoCuentas() 'CargaModalConceptoCuentas()