Revision 8e99e751
Von Werner Hahn vor etwa 6 Jahren hinzugefügt
SL/Controller/CustomerVendor.pm | ||
---|---|---|
28 | 28 |
use SL::DB::History; |
29 | 29 |
use SL::DB::Currency; |
30 | 30 |
use SL::DB::Invoice; |
31 |
use SL::DB::PurchaseInvoice; |
|
32 |
use SL::DB::Order; |
|
31 | 33 |
|
32 | 34 |
use Data::Dumper; |
33 | 35 |
|
... | ... | |
945 | 947 |
], |
946 | 948 |
with_objects => ['follow_up'], |
947 | 949 |
); |
948 |
|
|
949 |
$self->{open_items} = SL::DB::Manager::Invoice->get_all_count( |
|
950 |
query => [ |
|
951 |
customer_id => $self->{cv}->id, |
|
952 |
paid => {lt_sql => 'amount'}, |
|
953 |
], |
|
954 |
); |
|
955 |
|
|
950 |
|
|
951 |
if ( $self->is_vendor()) { |
|
952 |
$self->{open_items} = SL::DB::Manager::PurchaseInvoice->get_all_count( |
|
953 |
query => [ |
|
954 |
vendor_id => $self->{cv}->id, |
|
955 |
paid => {lt_sql => 'amount'}, |
|
956 |
], |
|
957 |
); |
|
958 |
} else { |
|
959 |
$self->{open_items} = SL::DB::Manager::Invoice->get_all_count( |
|
960 |
query => [ |
|
961 |
customer_id => $self->{cv}->id, |
|
962 |
paid => {lt_sql => 'amount'}, |
|
963 |
], |
|
964 |
); |
|
965 |
} |
|
966 |
|
|
967 |
if ( $self->is_vendor() ) { |
|
968 |
$self->{open_orders} = SL::DB::Manager::Order->get_all_count( |
|
969 |
query => [ |
|
970 |
vendor_id => $self->{cv}->id, |
|
971 |
closed => 'F', |
|
972 |
], |
|
973 |
); |
|
974 |
} else { |
|
975 |
$self->{open_orders} = SL::DB::Manager::Order->get_all_count( |
|
976 |
query => [ |
|
977 |
customer_id => $self->{cv}->id, |
|
978 |
closed => 'F', |
|
979 |
], |
|
980 |
); |
|
981 |
} |
|
956 | 982 |
$self->{template_args} ||= {}; |
957 | 983 |
|
958 | 984 |
$::request->{layout}->add_javascripts('kivi.CustomerVendor.js'); |
Auch abrufbar als: Unified diff
Kundenstatistik: offene Rechnungen, offene Aufträge, Angebote, Aufträge,
Kunden und Lieferanten
Kunden Angebote, Aufträge, Rechnungen
Lieferanten Preisanfragen, Lieferantenaufträge, Rechnungen