Diff for web-apps/finance-manager/modules/Source.pm between version 1.4 and 1.5
| version 1.4, 2004/04/09 09:17:44 |
version 1.5, 2004/04/13 06:41:10 |
|
|
| # 09/02/2004 - created |
# 09/02/2004 - created |
| # |
# |
| |
|
| # $Platon: web-apps/finance-manager/modules/Source.pm,v 1.3 2004/04/04 17:44:16 rajo Exp $ |
# $Platon: web-apps/finance-manager/modules/Source.pm,v 1.4 2004/04/09 09:17:44 rajo Exp $ |
| |
|
| package Source; |
package Source; |
| |
|
| Line 73 sub _prepare_sql($$;) |
|
| Line 73 sub _prepare_sql($$;) |
|
| low_money, medium_money, high_money |
low_money, medium_money, high_money |
| FROM Source |
FROM Source |
| WHERE sourceid = ? |
WHERE sourceid = ? |
| ") or croak "Can't get list of sources: " . $dbh::errstr; |
") or croak "Can't get source: " . $dbh::errstr; |
| $self->{get_source}->bind_param(1, 0, SQL_INTEGER); |
$self->{get_source}->bind_param(1, 0, SQL_INTEGER); |
| |
|
| $self->{new_source} = $dbh->prepare(" /* new_source " . __FILE__ . ":" . __LINE__ . " */ |
$self->{new_source} = $dbh->prepare(" /* new_source " . __FILE__ . ":" . __LINE__ . " */ |
| Line 102 sub _prepare_sql($$;) |
|
| Line 102 sub _prepare_sql($$;) |
|
| |
|
| $self->{log_source_op} = $dbh->prepare(" /* log_source_op " . __FILE__ . ":" . __LINE__ . " */ |
$self->{log_source_op} = $dbh->prepare(" /* log_source_op " . __FILE__ . ":" . __LINE__ . " */ |
| INSERT INTO SourceLog |
INSERT INTO SourceLog |
| (created, changed, last_transaction, |
(action_type, |
| action_type, |
created, changed, last_transaction, |
| sourceid, active, |
sourceid, active, |
| start_money, stop_money, money, |
start_money, stop_money, money, |
| low_money, medium_money, high_money, |
low_money, medium_money, high_money, |
| name, description, note) |
name, description, note) |
| VALUES |
VALUES |
| (NOW(), NOW(), NOW(), |
(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) /* 15x otaznik */ |
| ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) /* 12x otaznik */ |
|
| ") or croak "Can't create Source log entry: " . $dbh::errstr; |
") or croak "Can't create Source log entry: " . $dbh::errstr; |
| |
|
| } # }}} _prepare_sql |
} # }}} _prepare_sql |
|
|
| my ($self) = @_; |
my ($self) = @_; |
| |
|
| $self->{get_all_sources}->execute(); |
$self->{get_all_sources}->execute(); |
| |
|
| return $self->{get_all_sources}->fetchall_arrayref({}); |
return $self->{get_all_sources}->fetchall_arrayref({}); |
| |
|
| } # }}} list |
} # }}} list |
| Line 175 sub new_source($;) |
|
| Line 174 sub new_source($;) |
|
| my $sourceid = $dbh->{'mysql_insertid'}; |
my $sourceid = $dbh->{'mysql_insertid'}; |
| $self->{log_source_op}->execute( |
$self->{log_source_op}->execute( |
| "added", |
"added", |
| |
undef, undef, undef, |
| $sourceid, $data->{active}, |
$sourceid, $data->{active}, |
| $data->{start_money}, $data->{stop_money}, $data->{money}, |
$data->{start_money}, $data->{stop_money}, $data->{money}, |
| $data->{low_money}, $data->{medium_money}, $data->{high_money}, |
$data->{low_money}, $data->{medium_money}, $data->{high_money}, |
| Line 216 sub update_source($;) |
|
| Line 216 sub update_source($;) |
|
| |
|
| $self->{log_source_op}->execute( |
$self->{log_source_op}->execute( |
| "changed_from", |
"changed_from", |
| |
$db_data->{created}, $db_data->{changed}, $db_data->{last_transaction}, |
| $db_data->{sourceid}, $db_data->{active}, |
$db_data->{sourceid}, $db_data->{active}, |
| $db_data->{start_money}, $db_data->{stop_money}, $db_data->{money}, |
$db_data->{start_money}, $db_data->{stop_money}, $db_data->{money}, |
| $db_data->{low_money}, $db_data->{medium_money}, $db_data->{high_money}, |
$db_data->{low_money}, $db_data->{medium_money}, $db_data->{high_money}, |
| Line 240 sub update_source($;) |
|
| Line 241 sub update_source($;) |
|
| |
|
| $self->{log_source_op}->execute( |
$self->{log_source_op}->execute( |
| "changed_to", |
"changed_to", |
| |
$db_data->{created}, $db_data->{changed}, $db_data->{last_transaction}, |
| $data->{sourceid}, $data->{active}, |
$data->{sourceid}, $data->{active}, |
| $data->{start_money}, $data->{stop_money}, $data->{money}, |
$data->{start_money}, $data->{stop_money}, $data->{money}, |
| $data->{low_money}, $data->{medium_money}, $data->{high_money}, |
$data->{low_money}, $data->{medium_money}, $data->{high_money}, |
Platon Group <platon@platon.org> http://platon.org/
|
|