Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 3d4d1eee

Von Thomas Heck vor mehr als 11 Jahren hinzugefügt

  • ID 3d4d1eee53465ad4cc4895944e27b1b056f816e7
  • Vorgänger d1de191b
  • Nachfolger 19294a1e

CustomerVendor: Vertreter gefixt/implementiert

Unterschiede anzeigen:

SL/Controller/CustomerVendor.pm
681 681
sub _pre_render {
682 682
  my ($self) = @_;
683 683

  
684
  $self->{template_args}->{conf_vertreter} = $::instance_conf->get_vertreter();
685

  
684 686
  my $dbh = $::form->get_standard_dbh();
685 687

  
686 688
  my $query;
......
723 725

  
724 726
  $self->{all_taxzones} = SL::DB::Manager::TaxZone->get_all();
725 727

  
726
  #Employee:
727
  #TODO: ALL_SALESMAN
728
  #TODO: ALL_SALESMAN_CUSTOMERS
728
  if ( $::instance_conf->get_vertreter() ) {
729
    $query =
730
      'SELECT id
731
       FROM business
732
       WHERE salesman';
733
    my $business_ids = [
734
      map(
735
        { $_->{id} }
736
        selectall_hashref_query($::form, $dbh, $query)
737
      )
738
    ];
739

  
740
    if ( $business_ids->[0] ) {
741
      $self->{all_salesman_customers} = SL::DB::Manager::Customer->get_all(query => [business_id => $business_ids]);
742
    } else {
743
      $self->{all_salesman_customers} = [];
744
    }
745
  } else {
746
    $self->{all_salesmen} = SL::DB::Manager::Employee->get_all(query => [ or => [ id => $self->{cv}->salesman_id,  deleted => 0 ] ]);
747
  }
729 748

  
730 749
  $self->{all_payment_terms} = SL::DB::Manager::PaymentTerm->get_all();
731 750

  
......
749 768
  $self->{shiptos} = $self->{cv}->shipto;
750 769
  $self->{shiptos} ||= [];
751 770

  
752
  $self->{template_args} = {};
771
  $self->{template_args} ||= {};
753 772

  
754 773
  $::request->{layout}->add_javascripts('autocomplete_customer.js');
755 774
}
templates/webpages/customer_vendor/tabs/billing.html
8 8

  
9 9
    <tr height="5"></tr>
10 10

  
11
    [% IF ( conf_vertreter ) %]<!-- == $::lx_office_conf{features}->{vertreter}; -->
11
    [% IF ( conf_vertreter ) %]
12 12
      <tr>
13 13
        <th align="right">
14 14
          [% IF SELF.is_vendor() %]
......
29 29
        </th>
30 30

  
31 31
        <td>
32
          <!-- TODO: ALL_SALESMAN_CUSTOMERS -->
33
          [% L.select_tag('cv.salesman_id', SELF.all_employees, value_key = 'id', title_key = 'safe_name', with_empty = 1) %]
32
          [% L.select_tag('cv.salesman_id', SELF.all_salesman_customers, default = SELF.cv.salesman_id, value_key = 'id', title_key = 'name', with_empty = 1) %]
34 33
        </td>
35 34
      </tr>
36 35

  
......
343 342
        <th align="right">[% 'Salesman' | $T8 %]</th>
344 343

  
345 344
        <td>
346
          <!-- TODO: ALL_SALESMAN -->
347
          [% L.select_tag('cv.salesman_id', SELF.all_employees, default = salesman_id, value_key = 'id', title_key = 'safe_name', with_empty = 1) %]
345
          [% L.select_tag('cv.salesman_id', SELF.all_salesmen, default = SELF.cv.salesman_id, value_key = 'id', title_key = 'safe_name', with_empty = 1) %]
348 346
        </td>
347
      [%- END %]
349 348

  
350
        <td>[% 'taxincluded checked' | $T8 %]</td>
349
      <td>[% 'taxincluded checked' | $T8 %]</td>
350

  
351
      <td>
352
        [% L.select_tag('cv.taxincluded_checked', [[undef, LxERP.t8('use user config')], ['1', LxERP.t8('Yes')], ['0', LxERP.t8('No')]], default = SELF.cv.taxincluded_checked) %]
353
      </td>
351 354

  
352
        <td>
353
          [% L.select_tag('cv.taxincluded_checked', [[undef, LxERP.t8('use user config')], ['1', LxERP.t8('Yes')], ['0', LxERP.t8('No')]], default = SELF.cv.taxincluded_checked) %]
354
        </td>
355
      [%- END %]
356 355
    </tr>
357 356
  </table>
358 357

  

Auch abrufbar als: Unified diff