($path, $number) = ("einkaufslieferscheine", $form->{donumber});
} elsif ($form->{type} eq "credit_note") {
($path, $number) = ("gutschriften", $form->{invnumber});
+ } elsif ($form->{type} eq "letter") {
+ ($path, $number) = ("briefe", $form->{letternumber} );
} elsif ($form->{vc} eq "customer") {
($path, $number) = ("rechnungen", $form->{invnumber});
} elsif ($form->{vc} eq "vendor") {
# checks
foreach my $item (qw(tmpdir tmpfile type)){
next if $form->{$item};
- $::lxdebug->message(LXDebug::WARN(), 'Missing parameter');
+ $::lxdebug->message(LXDebug::WARN(), 'Missing parameter:' . $item);
$::form->error($::locale->text("Missing parameter for WebDAV file copy"));
}
if (! $webdav_folder){
$::lxdebug->leave_sub();
+ $::lxdebug->message(LXDebug::WARN(), 'Cannot check correct WebDAV folder');
$::form->error($::locale->text("Cannot check correct WebDAV folder"));
return undef;
}
# maybe the path does not exist (automatic printing), see #2446
if (!-d $complete_path) {
- # we need a chdir and restore old dir
+ # we need a chdir and restore old dir
my $current_dir = POSIX::getcwd();
chdir("$form->{cwd}");
mkdir_with_parents($webdav_folder);
$numberfld = $form->{type} =~ /^sales/ ? 'sdonumber' : 'pdonumber';
$form->{label} = $form->{formname} eq 'pick_list' ? $locale->text('Pick List') : $locale->text('Delivery Order');
}
+ if ($form->{type} =~ /letter/) {
+ undef $due;
+ undef $inv;
+ $form->{label} = $locale->text('Letter');
+ }
$form->{TEMPLATE_DRIVER_OPTIONS} = { };
if (any { $form->{type} eq $_ } qw(sales_quotation sales_order sales_delivery_order invoice request_quotation purchase_order purchase_delivery_order)) {
DO->order_details(\%myconfig, \%$form);
} elsif ($order) {
OE->order_details(\%myconfig, \%$form);
+ } elsif ($form->{type} eq 'letter') {
+ # right now, no details are needed
+ # but i do not want to break the bad default (invoice)
} else {
IS->invoice_details(\%myconfig, \%$form, $locale);
}
use SL::DB::Default;
use SL::Helper::CreatePDF;
use SL::Helper::Flash;
+use SL::Common;
+use Cwd;
require "bin/mozilla/reportgenerator.pl";
require "bin/mozilla/io.pl";
require "bin/mozilla/arap.pl";
die( t8('Please create/copy a template named letter.tex in your client template dir') ) unless (-e $tex_templates);
$pdf_file_name = SL::Helper::CreatePDF->create_pdf(%create_params);
+
+ # set some form defaults for printing webdav copy variables
+ $form->{tmpfile} = $pdf_file_name;
+ $form->{tmpdir} = 'users';
+ $form->{type} = 'letter';
+ $form->{cwd} = getcwd();
if ( $::form->{media} eq 'email') {
my $mail = Mailer->new;
my $signature = $::myconfig{signature};
$mail->{message} .= "\n-- \n$signature";
$mail->{message} =~ s/\r//g;
+ # copy_file_to_webdav was already done via io.pl -> edit_e_mail
my $err = $mail->send;
-# TODO
-# $self
-# ->js
-# ->flash($err?'error':'info',
-# $err?t8('A mail error occurred: #1', $err):
-# t8('The document have been sent to \'#1\'.', $mail->{to}))
-# ->render($self);
+ # TODO
+ # $self
+ # ->js
+ # ->flash($err?'error':'info',
+ # $err?t8('A mail error occurred: #1', $err):
+ # t8('The document have been sent to \'#1\'.', $mail->{to}))
+ # ->render($self);
return $err?0:1;
}
$::locale->with_raw_io(\*STDOUT, sub { print while <$file> });
$file->close;
+ Common::copy_file_to_webdav_folder($form) if $::instance_conf->get_webdav_documents;
unlink $pdf_file_name;
return 1;
}
binmode $out;
print $out scalar(read_file($pdf_file_name));
close $out;
+ Common::copy_file_to_webdav_folder($form) if $::instance_conf->get_webdav_documents;
flash_later('info', t8('The documents have been sent to the printer \'#1\'.', $printer->printer_description));
my $callback = build_std_url('letter.pl', 'action=edit', 'id=' . $letter->{id}, 'printer_id');
$letter->check_number;
$letter->save;
+ $form->{formname} = "letter";
$letter->export_to($::form);
$::form->{id} = $letter->{id};
# Veränderungen von kivitendo #
###############################
+2015-0x-xx - Release 3.2.2-unstable
+
+
+Kleinere neue Features und Detailverbesserungen:
+
+- Briefe werden auch im WebDAV archiviert. Ferner bessere Fehlerbehandlung und
+ E-Mail-Funktion aktiviert.
+
+
2015-04-10 - Release 3.2.1
Dies ist ein Unstable Bugfix-Release für die 3.2. D.h. es wurden ein paar
<input type="hidden" name="action" value="dispatcher">
<input class="submit" type="submit" name="action_update" id="update_button" value="[% 'Update' | $T8 %]">
-<input class="submit" type="submit" name="action_print" value="[% 'Print' | $T8 %]">
-<input class="submit" type="submit" name="action_e_mail" value="[% 'E-mail' | $T8 %]">
+
+[%- IF letter.letternumber %]
+ <input class="submit" type="submit" name="action_print" value="[% 'Print' | $T8 %]">
+ <input class="submit" type="submit" name="action_e_mail" value="[% 'E-mail' | $T8 %]">
+[% END %]
+
<input class="submit" type="submit" name="action_save" value="[% 'Save' | $T8 %]">
<input class="submit" type="submit" name="action_save_letter_draft" value="[% 'Save Draft' | $T8 %]">