-
-
-
- |
- . $locale->text("Previous transnumber text")
- . " $form->{previous_id} "
- . $locale->text("Previous transdate text")
- . " $form->{previous_gldate}"
- . qq| |
-
-
- | . $locale->text('Reference') . qq| |
- |
-
-
-
- | . $locale->text('Date') . qq| |
- $button1
-
-
- |
- |;
- if ($form->{id}) {
- print qq|
-
- | . $locale->text('Belegnummer') . qq| |
- |
-
-
- |
- |;
- }
- print qq|
- $department|;
- if ($form->{id}) {
- print qq|
-
- | . $locale->text('Description') . qq| |
- $description |
-
-
- |
-
-
- |
- |;
- } else {
- print qq|
-
- | . $locale->text('Description') . qq| |
- $description |
-
-
- |
- |;
- }
+sub setup_gl_search_action_bar {
+ my %params = @_;
- print qq|
-
- |
-
- | . $locale->text('Show details') . qq| |
- |
- |;
-
- print qq|
-
-
-
-
- |
- . $locale->text('Account') . qq| |
- | . $locale->text('Chart balance') . qq| |
- |
- . $locale->text('Debit') . qq| |
- |
- . $locale->text('Credit') . qq| |
- |
- . $locale->text('Tax') . qq| |
- |
- . $locale->text('Taxkey') . qq| | |;
-
- if ($form->{show_details}) {
- print qq|
- | . $locale->text('Source') . qq| |
- | . $locale->text('Memo') . qq| |
- | . $locale->text('Project Number') . qq| |
-|;
+ for my $bar ($::request->layout->get('actionbar')) {
+ $bar->add(
+ action => [
+ t8('Search'),
+ submit => [ '#form', { action => 'continue', nextsub => 'generate_report' } ],
+ accesskey => 'enter',
+ ],
+ );
}
-
- print qq|
-
-
-$jsscript
-|;
- $main::lxdebug->leave_sub();
-
}
-sub form_footer {
- $main::lxdebug->enter_sub();
-
- $main::auth->assert('general_ledger');
-
- my $form = $main::form;
- my %myconfig = %main::myconfig;
- my $locale = $main::locale;
- my $cgi = $::request->{cgi};
-
- my $follow_ups_block;
- if ($form->{id}) {
- my $follow_ups = FU->follow_ups('trans_id' => $form->{id});
-
- if (@{ $follow_ups} ) {
- my $num_due = sum map { $_->{due} * 1 } @{ $follow_ups };
- $follow_ups_block = qq|| . $locale->text("There are #1 unfinished follow-ups of which #2 are due.", scalar @{ $follow_ups }, $num_due) . qq| |;
- }
+sub setup_gl_transactions_action_bar {
+ my %params = @_;
+
+ for my $bar ($::request->layout->get('actionbar')) {
+ $bar->add(
+ combobox => [
+ action => [ $::locale->text('Create new') ],
+ action => [
+ $::locale->text('GL Transaction'),
+ submit => [ '#create_new_form', { action => 'gl_transaction' } ],
+ ],
+ action => [
+ $::locale->text('AR Transaction'),
+ submit => [ '#create_new_form', { action => 'ar_transaction' } ],
+ ],
+ action => [
+ $::locale->text('AP Transaction'),
+ submit => [ '#create_new_form', { action => 'ap_transaction' } ],
+ ],
+ action => [
+ $::locale->text('Sales Invoice'),
+ submit => [ '#create_new_form', { action => 'sales_invoice' } ],
+ ],
+ action => [
+ $::locale->text('Vendor Invoice'),
+ submit => [ '#create_new_form', { action => 'vendor_invoice' } ],
+ ],
+ ], # end of combobox "Create new"
+ );
}
+}
- my ($dec) = ($form->{totaldebit} =~ /\.(\d+)/);
- $dec = length $dec;
- my $decimalplaces = ($dec > 2) ? $dec : 2;
- my $radieren = ($form->current_date(\%myconfig) eq $form->{gldate}) ? 1 : 0;
-
- map {
- $form->{$_} = $form->format_amount(\%myconfig, $form->{$_}, 2, " ")
- } qw(totaldebit totalcredit);
-
- print qq|
-
- $form->{totaldebit} |
- $form->{totalcredit} |
- |
-
-
- |
-
-
+sub form_header {
+ $::lxdebug->enter_sub;
+ $::auth->assert('gl_transactions');
-
+ my ($init) = @_;
-$follow_ups_block
+ $::request->layout->add_javascripts("autocomplete_chart.js", "kivi.File.js", "kivi.GL.js", "kivi.RecordTemplate.js");
-
-|;
+ my @old_project_ids = grep { $_ } map{ $::form->{"project_id_$_"} } 1..$::form->{rowcount};
- my $transdate = $form->datetonum($form->{transdate}, \%myconfig);
- my $closedto = $form->datetonum($form->{closedto}, \%myconfig);
+ $::form->get_lists("projects" => { "key" => "ALL_PROJECTS",
+ "all" => 0,
+ "old_id" => \@old_project_ids },
- if ($form->{id}) {
+ "charts" => { "key" => "ALL_CHARTS",
+ "transdate" => $::form->{transdate} });
- if (!$form->{storno}) {
- print qq||;
- }
+ # we cannot book on charttype header
+ @{ $::form->{ALL_CHARTS} } = grep { $_->{charttype} ne 'H' } @{ $::form->{ALL_CHARTS} };
+ $::form->{ALL_DEPARTMENTS} = SL::DB::Manager::Department->get_all_sorted;
- # Löschen und Ãndern von Buchungen nicht mehr möglich (GoB) nur am selben Tag möglich
- if (!$form->{locked} && $radieren) {
- print qq|
-
- |;
- }
+ my $title = $::form->{title};
+ $::form->{title} = $::locale->text("$title General Ledger Transaction");
+ # $locale->text('Add General Ledger Transaction')
+ # $locale->text('Edit General Ledger Transaction')
- print qq|
-
- |;
+ map { $::form->{$_} =~ s/\"/"/g }
+ qw(chart taxchart);
+ if ($init) {
+ $::request->{layout}->focus("#reference");
+ $::form->{taxincluded} = "1";
} else {
- if ($form->{draft_id}) {
- my $remove_draft_checked = $form->{remove_draft} ? 'checked' : '';
- print qq|\n|
- . qq| |
- . qq| \n|
- . qq| \n|;
- }
-
- print qq|
-
- |
- . NTI($cgi->submit('-name' => 'action', '-value' => $locale->text('Save draft'), '-class' => 'submit'))
- . $cgi->hidden('-name' => 'draft_id', '-default' => [$form->{draft_id}])
- . $cgi->hidden('-name' => 'draft_description', '-default' => [$form->{draft_description}]);
+ $::request->{layout}->focus("#accno_id_$::form->{rowcount}_name");
}
- print "
-
-
-
- |