Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 59d0eec3

Von Sven Schöling vor etwa 8 Jahren hinzugefügt

  • ID 59d0eec32ad4697c075f8742c874a885728a3f9a
  • Vorgänger 29666b19
  • Nachfolger acfaa946

neue Presenter Infrastruktur

Testweise implementiert für Invoice/PurchaseInvoice/GLTransaction

Unterschiede anzeigen:

SL/DB/PurchaseInvoice.pm
use SL::DB::Helper::Payment qw(:ALL);
use SL::Locale::String qw(t8);
use Rose::DB::Object::Helpers qw(has_loaded_related forget_related);
use SL::Presenter::PurchaseInvoice;
# The calculator hasn't been adjusted for purchase invoices yet.
# use SL::DB::Helper::PriceTaxCalculator;
......
goto &vendor;
}
sub abbreviation {
my $self = shift;
return t8('AP Transaction (abbreviation)') if !$self->invoice && !$self->storno;
return t8('AP Transaction (abbreviation)') . '(' . t8('Storno (one letter abbreviation)') . ')' if !$self->invoice && $self->storno;
return t8('Invoice (one letter abbreviation)'). '(' . t8('Storno (one letter abbreviation)') . ')' if $self->storno;
return t8('Invoice (one letter abbreviation)');
};
sub oneline_summary {
my $self = shift;
return sprintf("%s: %s %s %s (%s)", $self->abbreviation, $self->invnumber, $self->vendor->name,
$::form->format_amount(\%::myconfig, $self->amount,2), $self->transdate->to_kivitendo);
}
sub url_link {
return ($_[0]->invoice ? "ir" : "ap") . '.pl?action=edit&type=invoice&id=' . $_[0]->id;
}
sub link {
my ($self) = @_;
return SL::Presenter->get->invoice($self, display => 'inline');
}
sub invoice_type {
my ($self) = @_;
......
return 'purchase_invoice';
}
sub displayable_type {
my ($self) = @_;
return t8('AP Transaction') if $self->invoice_type eq 'ap_transaction';
return t8('Purchase Invoice');
}
sub displayable_name {
join ' ', grep $_, map $_[0]->$_, qw(displayable_type record_number);
};
sub create_ap_row {
my ($self, %params) = @_;
# needs chart as param
......
return $acc_trans;
};
sub abbreviation { $_[0]->presenter->abbreviation }
sub displayable_type { $_[0]->presenter->type }
sub displayable_name { $_[0]->presenter->id }
sub link { $_[0]->presenter->link_tag }
sub oneline_summary { $_[0]->presenter->gist }
sub url_link { $_[0]->presenter->url }
sub mark_as_paid {
my ($self) = @_;

Auch abrufbar als: Unified diff