Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 96e475c1

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

  • ID 96e475c10b5654ab5acaf9d57f1f7815a4367f5d
  • Vorgänger 54a3c953
  • Nachfolger 47e46527

actionbar: ir

Unterschiede anzeigen:

bin/mozilla/ir.pl
298 298

  
299 299
  $::request->{layout}->use_javascript(map { "${_}.js" } qw(kivi.Draft kivi.File  kivi.SalesPurchase kivi.Part ckeditor/ckeditor ckeditor/adapters/jquery kivi.io autocomplete_customer autocomplete_project client_js));
300 300

  
301
  my $show_delete = $::instance_conf->get_ir_changeable == 2 ? $form->current_date(\%myconfig) eq $form->{gldate}
302
                  : $::instance_conf->get_ir_changeable == 1;
303

  
304
  for my $bar ($::request->layout->get('actionbar')) {
305
    $bar->add_actions([ t8('Update'),
306
      submit => [ '#form', { action_update         => 1 } ],
307
    ]);
308
    $bar->add_actions("combobox");
309
    $bar->actions->[-1]->add_actions([ t8('Post'),
310
      submit => [ '#form', { action_post           => 1 } ],
311
      disabled => (!$::form->{id} && $::form->{locked}) || ($::form->{id} && !$show_delete),
312
    ]);
313
    $bar->actions->[-1]->add_actions([ t8('Post Payment'),
314
      submit => [ '#form', { action_post_payment    => 1 } ],
315
      disabled => !$::form->{id},
316
    ]);
317
    $bar->actions->[-1]->add_actions([ t8('mark as paid'),
318
      submit => [ '#form', { action_mark_as_paid    => 1 } ],
319
      confirm => t8('This will remove the invoice from showing as unpaid even if the unpaid amount does not match the amount. Proceed?'),
320
      disabled => !$::form->{id},
321
    ]) if $::instance_conf->get_ir_show_mark_as_paid;
322

  
323
    $bar->add_actions("combobox");
324
    $bar->actions->[-1]->add_actions([ t8('Storno'),
325
      submit => [ '#form', { action_storno         => 1 } ],
326
      confirm => t8('Do you really want to cancel this invoice?'),
327
      disabled => !$::form->{id} || !$show_delete,
328
    ]);
329
    $bar->actions->[-1]->add_actions([ t8('Delete'),
330
      submit => [ '#form', { action_delete         => 1 } ],
331
      confirm => t8('Do you really want to delete this object?'),
332
      disabled => !$::form->{id} || !$show_delete,
333
    ]);
334
    $bar->add_actions('separator');
335
    $bar->add_actions('combobox');
336
    $bar->actions->[-1]->add_actions([ t8('more'),
337
      disabled => 1,
338
    ]);
339
    $bar->actions->[-1]->add_actions([ t8('History'),
340
      call     => [ 'set_history_window', $::form->{id} * 1, 'id', 'glid' ],
341
      disabled => !$::form->{id},
342
    ]);
343
    $bar->actions->[-1]->add_actions([ t8('Follow-Up'),
344
      call     => [ 'follow_up_window' ],
345
      disabled => !$::form->{id},
346
    ]);
347
    $bar->actions->[-1]->add_actions([ t8('Drafts'),
348
      call     => [ 'kivi.Draft.popup', 'ir', 'invoice', $::form->{draft_id}, $::form->{draft_description} ],
349
      disabled => $::form->{id},
350
    ]);
351
  }
352

  
301 353
  $form->header();
302 354

  
303 355
  print $form->parse_html_template("ir/form_header", \%TMPL_VAR);
templates/webpages/ir/form_footer.html
117 117

  
118 118
<p>[% print_options %]</p>
119 119

  
120
  [% IF id %]
121

  
122
    <input class="submit" type="submit" accesskey="u" name="action" id="update_button" value="[% 'Update' | $T8 %]">
123
[% IF  show_storno %]
124
    [% L.submit_tag("action", LxERP.t8("Storno"), confirm=LxERP.t8('Do you really want to cancel this invoice?')) %]
125
[% END %]
126
    <input class="submit" type="submit" name="action" value="[% 'Post Payment' | $T8 %]">
127
    <input class="submit" type="submit" name="action" value="[% 'Use As New' | $T8 %]">
128

  
129
[% IF show_delete %]
130
    <input class="submit" type="submit" name="action" value="[% 'Delete' | $T8 %]">
131
    <input class="submit" type="submit" name="action" value="[% 'Post' | $T8 %]">
132
[% END %]
133

  
134
    <input type="button" class="submit" onclick="follow_up_window()" value="[% 'Follow-Up' | $T8 %]">
135

  
136
 [% ELSE # no id %]
137
      <input class="submit" type="submit" name="action" id="update_button" value="[% 'Update' | $T8 %]">
138
   [% UNLESS locked %]
139
      <input class="submit" type="submit" name="action" value="[% 'Post' | $T8 %]">
140
   [%- END %]
141
      [% L.button_tag('kivi.Draft.popup("ir", "invoice", "' _ draft_id _ '", "' _ draft_description _ '")', LxERP.t8('Drafts')) %]
142
 [% END # id %]
143

  
144
  [% IF id %]
145
      [%#- button for saving history %]
146
      <input type="button" class="submit" onclick="set_history_window([% id | html %], 'glid');" name="history" id="history" value="[% 'history' | $T8 %]">
147

  
148
      [% IF INSTANCE_CONF.get_ir_show_mark_as_paid %]
149
        [% L.submit_tag("action", LxERP.t8('mark as paid'), confirm=LxERP.t8('This will remove the invoice from showing as unpaid even if the unpaid amount does not match the amount. Proceed?')) %]
150
      [% END %]
151
  [% END %]
152

  
153 120
<input type="hidden" name="rowcount" value="[% rowcount %]">
154 121
<input type="hidden" name="callback" value="[% callback %]">
155 122
[% P.hidden_tag('draft_id', draft_id) %]
templates/webpages/ir/form_header.html
9 9
<script type="text/javascript" src="js/calculate_qty.js"></script>
10 10
<script type="text/javascript" src="js/follow_up.js"></script>
11 11

  
12
<form method="post" name="invoice" action="[% script %]">
12
<form id='form' method="post" name="invoice" action="[% script %]">
13 13

  
14 14
<p>[% saved_message %]</p>
15 15

  

Auch abrufbar als: Unified diff