[set page_banner]Report Columns[/set] [set fm_class]Ledger[/set] [set help_name]report_col[/set] [set page_title]Report Columns[/set] [set icon_name]admin/icon_stats.gif[/set] @_FM_STD_HEAD_@ [seti sqlSentence] BEGIN TRANSACTION; [perl] my $trans; my $action = $Values->{"mv_action"}; my $col_id; if ($action eq "Update") { $col_id = $Values->{"select_col"}; $trans .= "UPDATE gl_reportcolhead SET description = '[value description]' WHERE col_id = $col_id;\n"; $trans .= "DELETE FROM gl_reportcol WHERE col_id = $col_id;"; } elsif ($action eq "Delete") { $trans .= "DELETE FROM gl_reportcolhead WHERE col_id = [value select_col];"; return $trans; } else { $trans .= "INSERT INTO gl_reportcolhead (description) VALUES ('[value description]');\n"; $col_id = "currval('gl_reportcolsequence')"; } my $ref = $Scratch->{cols}; my ($ar, $nul, $names) = @$ref; my $linenr = 0; for my $col (@$ar) { my ($type,$header,$fromperiod,$toperiod,$fsign1,$fromline,$fsign2,$toline) = @$col; $linenr++; if ($type == 1) { $trans .= "INSERT INTO gl_reportcol (col_id,linenr,coltext,coltype,fromperiod,toperiod) VALUES ($col_id,$linenr,'$header',$type,$fromperiod,$toperiod);\n"; } else { $fsign2 ||= 0; $trans .= "INSERT INTO gl_reportcol (col_id,linenr,coltext,coltype,fsign1,fromline,fsign2,toline) VALUES ($col_id,$linenr,'$header',$type,$fsign1,$fromline,$fsign2,$toline);\n"; }; }; undef $Values->{select_col}; $trans; [/perl] COMMIT; [/seti] [if value mv_action eq Update] [set returnpage]freemoney/reportcolList[/set] [set leadtext]The column has been updated.[/set] [elsif value mv_action eq Delete] [set returnpage]freemoney/reportcolList[/set] [set leadtext]The column has been deleted:[/set] [/elsif] [else] [set returnpage]freemoney/reportcolList[/set] [set leadtext]The column has been added.[/set] [/else] [/if] [value name=mv_action set=""] [try][sql interpolate=1][scratch sqlSentence][/sql][/try]
[L][scratch leadtext][/L]

[catch] [L]There was an error. Please check your data.[/L]

[/catch] [L]BACK[/L] @_FM_STD_FOOTER_@