use SL::Helper::Flash;
use SL::Locale::String;
use SL::Controller::Helper::GetModels;
+use SL::Controller::Helper::ReportGenerator;
+use SL::Controller::Helper::ParseFilter;
use SL::DB::Customer;
use SL::DB::Vendor;
use SL::DB::FollowUpLink;
use SL::DB::History;
use SL::DB::Currency;
+use SL::DB::Invoice;
+
+use Data::Dumper;
use Rose::Object::MakeMethods::Generic (
'scalar --get_set_init' => [ qw(customer_models vendor_models) ],
my $name = $::form->escape($self->{cv}->name, 1);
my $db = $self->is_vendor() ? 'vendor' : 'customer';
+ my $action = 'add';
+
+ if ($::instance_conf->get_feature_experimental && 'oe.pl' eq $script) {
+ $script = 'controller.pl';
+ $action = 'Order/' . $action;
+ }
my $url = $self->url_for(
controller => $script,
- action => 'add',
+ action => $action,
vc => $db,
$db .'_id' => $self->{cv}->id,
$db => $name,
print $::form->redirect_header($url);
}
-
sub action_get_delivery {
my ($self) = @_;
}
sub action_test_page {
- $::request->{layout}->add_javascripts('autocomplete_customer.js');
$_[0]->render('customer_vendor/test_page');
}
],
with_objects => ['follow_up'],
);
-
+
+ $self->{open_items} = SL::DB::Manager::Invoice->get_all_count(
+ query => [
+ customer_id => $self->{cv}->id,
+ paid => {lt_sql => 'amount'},
+ ],
+ );
+
$self->{template_args} ||= {};
- $::request->{layout}->add_javascripts('autocomplete_customer.js');
$::request->{layout}->add_javascripts('kivi.CustomerVendor.js');
$::request->{layout}->add_javascripts('kivi.File.js');