use SL::SessionFile::Random;
use SL::PriceSource;
use SL::Webdav;
+use SL::File;
use SL::DB::Order;
use SL::DB::Default;
$self->js->flash('error', t8('Storing PDF to webdav folder failed: #1', $@));
}
}
-
+ if ($self->order->ordnumber && $::instance_conf->get_doc_storage) {
+ SL::File->store( object_id => $self->order->id,
+ object_type => $self->type,
+ mime_type => 'application/pdf',
+ source => 'created',
+ file_type => 'document',
+ file_name => $pdf_filename,
+ file_contents => $pdf);
+ }
$self->js->render;
}
$self->{all_projects} = SL::DB::Manager::Project->get_all(where => [ or => [ id => $self->order->globalproject_id,
active => 1 ] ],
sort_by => 'projectnumber');
- $self->{all_payment_terms} = SL::DB::Manager::PaymentTerm->get_all_sorted();
+ $self->{all_payment_terms} = SL::DB::Manager::PaymentTerm->get_all_sorted(where => [ or => [ id => $self->order->payment_id,
+ obsolete => 0 ] ]);
+
$self->{all_delivery_terms} = SL::DB::Manager::DeliveryTerm->get_all_sorted();
$self->{current_employee_id} = SL::DB::Manager::Employee->current->id;
} } @all_objects;
}
- $::request->{layout}->use_javascript("${_}.js") for qw(kivi.SalesPurchase kivi.Order ckeditor/ckeditor ckeditor/adapters/jquery);
+ $::request->{layout}->use_javascript("${_}.js") for qw(kivi.SalesPurchase kivi.Order kivi.File ckeditor/ckeditor ckeditor/adapters/jquery);
}
sub _create_pdf {
=item * price sources: little symbols showing better price / better discount
+=item * select units in input row?
+
=item * custom shipto address
=item * periodic invoices
=item * display weights
-=item * force project if enabled in client config
-
=item * history
=item * mtime check
+=item * optional client/user behaviour
+
+(transactions has to be set - department has to be set -
+ force project if enabled in client config - transport cost reminder)
+
=back
=head1 KNOWN BUGS AND CAVEATS
=back
+=head1 To discuss / Nice to have
+
+=over 4
+
+=item *
+
+How to expand/collapse second row. Now it can be done clicking the icon or
+<shift>-up/down.
+
+=item *
+
+Possibility to change longdescription in input row?
+
+=item *
+
+Possibility to select PriceSources in input row?
+
+=item *
+
+This controller uses a (changed) copy of the template for the PriceSource
+dialog. Maybe there could be used one code source.
+
+=item *
+
+Rounding-differences between this controller (PriceTaxCalculator) and the old
+form. This is not only a problem here, but also in all parts using the PTC.
+There exists a ticket and a patch. This patch should be testet.
+
+=item *
+
+An indicator, if the actual inputs are saved (like in an
+editor or on text processing application).
+
+=item *
+
+A warning when leaving the page without saveing unchanged inputs.
+
+=back
+
=head1 AUTHOR
Bernd Bleßmann E<lt>bernd@kivitendo-premium.deE<gt>