Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 2e2873a4

Von Werner Hahn vor etwa 1 Jahr hinzugefügt

FIX: 'Buchen auf' in EK/VK Rechnungen richtig vorbelegen

Behebt #363

Unterschiede anzeigen:

bin/mozilla/ir.pl
38 38
use SL::IR;
39 39
use SL::IS;
40 40
use SL::DB::BankTransactionAccTrans;
41
use SL::DB::Chart;
41 42
use SL::DB::Default;
42 43
use SL::DB::Department;
43 44
use SL::DB::Project;
......
206 207

  
207 208
  $form->{paidaccounts} = 1 unless (exists $form->{paidaccounts});
208 209

  
210
  foreach my $ref (@{ $form->{AP_links}{AP} } ) {
211
    if ( $ref->{chart_id} == $::instance_conf->get_ap_chart_id ) {
212
      $form->{AP_1} = "$ref->{accno}--$ref->{description}";
213
    }
214
  }
209 215
  $form->{AP} = $form->{AP_1} unless $form->{id};
216
  my ($chart_accno)      = split /--/, $form->{AP};
217
  $form->{AP_chart_id} = $form->{id} ? SL::DB::Manager::Chart->find_by( accno => $chart_accno)->id : $::instance_conf->get_ap_chart_id ;
210 218

  
211 219
  $form->{locked} =
212 220
    ($form->datetonum($form->{invdate}, \%myconfig) <=
......
916 924
    }
917 925
  }
918 926

  
919
  ($form->{AP})      = split /--/, $form->{AP};
927
  $form->{AP}      = SL::DB::Manager::Chart->find_by( id => $form->{AP_chart_id} )->accno;
920 928
  ($form->{AP_paid}) = split /--/, $form->{AP_paid};
921 929
  if (IR->post_payment(\%myconfig, \%$form)){
922 930
    if (!exists $form->{addition} && $form->{id} ne "") {
......
1022 1030
    }
1023 1031
  }
1024 1032

  
1025
  ($form->{AP})      = split /--/, $form->{AP};
1033
  $form->{AP}      = SL::DB::Manager::Chart->find_by( id => $form->{AP_chart_id} )->accno;
1026 1034
  ($form->{AP_paid}) = split /--/, $form->{AP_paid};
1027 1035
  $form->{storno}  ||= 0;
1028 1036

  
bin/mozilla/is.pl
48 48

  
49 49
use SL::DB::BankTransactionAccTrans;
50 50
use SL::DB::Default;
51
use SL::DB::Chart;
51 52
use SL::DB::Customer;
52 53
use SL::DB::Department;
53 54
use SL::DB::Invoice;
......
262 263

  
263 264
  $form->{paidaccounts} = 1 unless (exists $form->{paidaccounts});
264 265

  
266
  foreach my $ref (@{ $form->{AR_links}{AR} } ) {
267
    if ( $ref->{chart_id} == $::instance_conf->get_ar_chart_id ) {
268
      $form->{AR_1} = "$ref->{accno}--$ref->{description}";
269
    }
270
  }
265 271
  $form->{AR} = $form->{AR_1} unless $form->{id};
272
  my ($chart_accno)      = split /--/, $form->{AR};
273
  $form->{AR_chart_id} = $form->{id} ? SL::DB::Manager::Chart->find_by( accno => $chart_accno)->id : $::instance_conf->get_ar_chart_id ;
266 274

  
267 275
  $form->{locked} = ($form->datetonum($form->{invdate},  \%myconfig)
268 276
                  <= $form->datetonum($form->{closedto}, \%myconfig));
......
694 702
  ), @custom_hiddens,
695 703
  map { $_.'_rate', $_.'_description', $_.'_taxnumber', $_.'_tax_id' } split / /, $form->{taxaccounts}];
696 704

  
697
  $::request->{layout}->use_javascript(map { "${_}.js" } qw(kivi.Draft kivi.File kivi.SalesPurchase kivi.Part kivi.CustomerVendor kivi.Validator ckeditor/ckeditor ckeditor/adapters/jquery kivi.io client_js));
705
  $::request->{layout}->use_javascript(map { "${_}.js" } qw(kivi.Draft kivi.File kivi.SalesPurchase kivi.Part kivi.CustomerVendor kivi.Validator ckeditor/ckeditor ckeditor/adapters/jquery kivi.io client_js autocomplete_chart));
698 706

  
699 707
  $TMPL_VAR{payment_terms_obj} = get_payment_terms_for_invoice();
700 708
  $form->{duedate}             = $TMPL_VAR{payment_terms_obj}->calc_date(reference_date => $form->{invdate}, due_date => $form->{duedate})->to_kivitendo if $TMPL_VAR{payment_terms_obj};
......
1046 1054
    }
1047 1055
  }
1048 1056

  
1049
  ($form->{AR})      = split /--/, $form->{AR};
1057
  #($form->{AR})      = split /--/, $form->{AR};
1058
  $form->{AR}      = SL::DB::Manager::Chart->find_by( id => $form->{AR_chart_id} )->accno;
1050 1059
  ($form->{AR_paid}) = split /--/, $form->{AR_paid};
1051 1060
  relink_accounts();
1052 1061
  if ( IS->post_payment(\%myconfig, \%$form) ) {
......
1146 1155
    }
1147 1156
  }
1148 1157

  
1149
  ($form->{AR})        = split /--/, $form->{AR};
1158
  #($form->{AR})        = split /--/, $form->{AR};
1159
  $form->{AR}      = SL::DB::Manager::Chart->find_by( id => $form->{AR_chart_id} )->accno;
1150 1160
  ($form->{AR_paid})   = split /--/, $form->{AR_paid};
1151 1161
  $form->{storno}    ||= 0;
1152 1162

  
templates/design40_webpages/ir/form_header.html
105 105
    [% END %]
106 106
    <tr>
107 107
      <th>[% 'Record in' | $T8 %]</th>
108
      <td>
109
      <select name="AP" class="wi-wide strict">
110
        [% selectAP %]
111
      </select>
112
      <input type="hidden" name="selectAP" value="[% selectAP %]">
113
      </td>
108
      <td>[% P.chart.picker("AP_chart_id", AP_chart_id, class="wi-wide", type="AP") %]</td>
114 109
    </tr>
115 110
    <tr>
116 111
      <th>[% 'Steuersatz' | $T8 %]</th>
templates/design40_webpages/is/form_header.html
144 144
    [% END %]
145 145
    <tr>
146 146
      <th>[% 'Record in' | $T8 %]</th>
147
      <td>
148
        <select name="AR" class="wi-wide">[% selectAR %]</select>
149
        <input type="hidden" name="selectAR" value="[% selectAR | html %]">
150
      </td>
147
      <td>[% P.chart.picker("AR_chart_id", AR_chart_id, class="wi-wide", type="AR") %]</td>
151 148
    </tr>
152 149
    [% IF currencies %]
153 150
      <tr>
templates/webpages/ir/form_header.html
97 97
[%- END %]
98 98
        <tr>
99 99
          <th align="right" nowrap>[% 'Record in' | $T8 %]</th>
100
          <td colspan="3"><select name="AP" style="width:250px;">[% selectAP %]</select></td>
101
          <input type="hidden" name="selectAP" value="[% selectAP %]">
100
          <td colspan="3">[% P.chart.picker("AP_chart_id", AP_chart_id, style="width:250px;", type="AP") %]</td>
102 101
        </tr>
103 102
        <tr>
104 103
          <th align="right">[% 'Steuersatz' | $T8 %]</th>
templates/webpages/is/form_header.html
143 143
        <tr>
144 144
          <th align="right" nowrap>[% 'Record in' | $T8 %]</th>
145 145
          <td colspan="3">
146
            <select name="AR" style="width:250px;">[% selectAR %]</select>
147
            <input type="hidden" name="selectAR" value="[% selectAR | html %]">
146
            [% P.chart.picker("AR_chart_id", AR_chart_id, style="width:259px;", type="AR") %]
148 147
          </td>
149 148
        </tr>
150 149
        <tr>

Auch abrufbar als: Unified diff