diff --git a/LedgerSMB.pm b/LedgerSMB.pm index 30c3b2b826..9a38149db6 100755 --- a/LedgerSMB.pm +++ b/LedgerSMB.pm @@ -276,7 +276,7 @@ sub escape { my $regex = qr/([^a-zA-Z0-9_.-])/; $str =~ s/$regex/sprintf("%%%02x", ord($1))/ge; - $str; + return $str; } sub is_blank { @@ -471,7 +471,7 @@ sub format_amount { sub parse_amount { my $self = shift @_; my %args = @_; - my $myconfig = $args{user}; + my $myconfig = $args{user} || $self->{_user}; my $amount = $args{amount}; if ( $amount eq '' or ! defined $amount) { @@ -809,6 +809,18 @@ sub remove_cgi_globals { } } } + +sub take_top_level { + my ($self) = @_; + my $return_hash = {}; + for my $key (keys %$self){ + if (!ref($self->{$key}) && $key !~ /^\./){ + $return_hash->{$key} = $self->{$key} + } + } + return $return_hash; +} + 1; diff --git a/LedgerSMB/Batch.pm b/LedgerSMB/Batch.pm index 67bc0ad908..a09031cd56 100644 --- a/LedgerSMB/Batch.pm +++ b/LedgerSMB/Batch.pm @@ -31,13 +31,21 @@ sub get_search_results { sub post { my ($self) = @_; ($self->{post_return_ref}) = $self->exec_method(funcname => 'batch_post'); + $self->{dbh}->commit; return $self->{post_return_ref}; } sub delete { my ($self) = @_; ($self->{delete_ref}) = $self->exec_method(funcname => 'batch_delete'); + $self->{dbh}->commit; return $self->{delete_ref}; } +sub list_vouchers { + my ($self) = @_; + @{$self->{vouchers}} = $self->exec_method(funcname => 'voucher_list'); + return @{$self->{vouchers}}; +} + 1; diff --git a/LedgerSMB/DBObject/Company.pm b/LedgerSMB/DBObject/Company.pm index 13b9ff6528..0e56567b7c 100644 --- a/LedgerSMB/DBObject/Company.pm +++ b/LedgerSMB/DBObject/Company.pm @@ -14,8 +14,10 @@ sub set_entity_class { sub save { my $self = shift @_; $self->set_entity_class(); + $self->{threshold} = $self->parse_amount(amount => $self->{threshold}); my ($ref) = $self->exec_method(funcname => 'entity_credit_save'); $self->{entity_id} = $ref->{entity_credit_save}; + $self->{threshold} = $self->format_amount(amount => $self->{threshold}); $self->{dbh}->commit; } @@ -88,6 +90,7 @@ sub get { $self->set_entity_class(); my ($ref) = $self->exec_method(funcname => 'entity__retrieve_credit'); $self->merge($ref); + $self->{threshold} = $self->format_amount(amount => $self->{threshold}); $self->{name} = $self->{legal_name}; diff --git a/README.sql-ledger b/README.sql-ledger index c29d8410f2..1c68f0ca64 100644 --- a/README.sql-ledger +++ b/README.sql-ledger @@ -12,4 +12,5 @@ a working LedgerSMB installation. The database will be updated on first login. -You will also want to migrate your configuration by running the SL2LS.pl script included in this directory. +You will also want to migrate your configuration by running the SL2LS.pl script +included in this directory. diff --git a/TODO b/TODO index f6c2e01734..f5253e85fa 100644 --- a/TODO +++ b/TODO @@ -3,12 +3,6 @@ For 1.3: 1) Refactor admin.pl. Merge user management with main UI and create separate dataset management interface. (in progress, Chris) -2) Add real security enforcement (in progress, Chris, part of admin reworking) +2) Setup wizard. -3) Refactor contact management code - -4) Setup wizard. - -Additional prerequisites include: -1) Refactoring HR code. (In progress, Chris) diff --git a/UI/Contact/contact.html b/UI/Contact/contact.html index 3a8d27b334..311660b83f 100644 --- a/UI/Contact/contact.html +++ b/UI/Contact/contact.html @@ -151,6 +151,11 @@ name = "entity_id" value = entity_id } ?> + +