Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 70d63c04

Von Sven Schöling vor mehr als 7 Jahren hinzugefügt

  • ID 70d63c049b073f55f9cfb4176926db326f1952ae
  • Vorgänger 3879b1fa
  • Nachfolger 1ba38eaf

is: actionbar implementiert.

Änderungen:
- post_and_[print/mail] sind wie geplant raus.
- zurück ist raus
- confirm bei mark as paid eingefügt
- show_delete als Bedingung für post sieht falsch aus

Unterschiede anzeigen:

bin/mozilla/is.pl
359 359
  $TMPL_VAR{payment_terms_obj} = get_payment_terms_for_invoice();
360 360
  $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};
361 361

  
362
  my @req_trans_desc = qw(kivi.SalesPurchase.check_transaction_description) x!!$::instance_conf->get_require_transaction_description_ps;
363
  my $show_delete = ($::instance_conf->get_is_changeable == 2 && $form->current_date(\%myconfig) eq $form->{gldate})
364
                  || $::instance_conf->get_is_changeable == 1;
365

  
366
  for my $bar ($::request->layout->get('actionbar')) {
367
    $bar->add_actions([ t8('Update'),
368
      submit => [ '#form', { action_update         => 1 } ],
369
      disabled => !$::form->{id} && $::form->{locked},
370
    ]);
371
    $bar->add_actions("combobox");
372
    $bar->actions->[-1]->add_actions([ t8('Post'),
373
      submit => [ '#form', { action_post           => 1 } ],
374
      checks => [ @req_trans_desc ],
375
      disabled => (!$::form->{id} && $::form->{locked}) || !$show_delete || $::form->{storno},
376
    ]);
377
    $bar->actions->[-1]->add_actions([ t8('Post Payment'),
378
      submit => [ '#form', { action_post_payment    => 1 } ],
379
      checks => [ @req_trans_desc ],
380
      disabled => !$::form->{id},
381
    ]);
382
    $bar->actions->[-1]->add_actions([ t8('mark as paid'),
383
      submit => [ '#form', { action_mark_as_paid    => 1 } ],
384
      confirm => t8('This will remove the invoice from showing as unpaid even if the unpaid amount does not match the amount. Proceed?'),
385
      disabled => !$::form->{id},
386
    ]) if $::instance_conf->get_is_show_mark_as_paid;
387

  
388
    $bar->add_actions("combobox");
389
    $bar->actions->[-1]->add_actions([ t8('Storno'),
390
      submit => [ '#form', { action_storno         => 1 } ],
391
      confirm => t8('Do you really want to cancel this invoice?'),
392
      checks => [ @req_trans_desc ],
393
      disabled => !$::form->{id},
394
    ]);
395
    $bar->actions->[-1]->add_actions([ t8('Delete'),
396
      submit => [ '#form', { action_delete         => 1 } ],
397
      confirm => t8('Do you really want to delete this object?'),
398
      checks => [ @req_trans_desc ],
399
      disabled => !$::form->{id},
400
    ]);
401
    $bar->add_actions('separator');
402

  
403
    $bar->add_actions('combobox');
404
    $bar->actions->[-1]->add_actions([ t8('Workflow'),
405
      disabled => 1,
406
    ]);
407
    $bar->actions->[-1]->add_actions([ t8('Use As New'),
408
      submit => [ '#form', { action_use_as_new    => 1 } ],
409
      disabled => !$::form->{id},
410
    ]);
411
    $bar->actions->[-1]->add_actions([ t8('Credit Note'),
412
      submit => [ '#form', { action_credit_note    => 1 } ],
413
      checks => [ @req_trans_desc ],
414
      disabled => !$::form->{id} || $form->{type} eq "credit_note",
415
    ]);
416
    $bar->actions->[-1]->add_actions([ t8('Sales Order'),
417
      submit => [ '#form', { action_sales_order   => 1 } ],
418
      disabled => !$::form->{id},
419
    ]);
420

  
421
    $bar->add_actions('combobox');
422
    $bar->actions->[-1]->add_actions([ t8('Export'),
423
      disabled => 1,
424
    ]);
425
    $bar->actions->[-1]->add_actions([ ($::form->{id} ? t8('Print') : t8('Preview')),
426
      submit => [ '#form', { action_print          => 1 } ],
427
      checks => [ @req_trans_desc ],
428
      disabled => !$::form->{id} && $::form->{locked},
429
    ]);
430
    $bar->actions->[-1]->add_actions([ t8('E Mail'),
431
      submit => [ '#form', { action_print          => 1 } ],
432
      checks => [ @req_trans_desc ],
433
      disabled => !$::form->{id},
434
    ]);
435
    $bar->add_actions('combobox');
436
    $bar->actions->[-1]->add_actions([ t8('more'),
437
      disabled => 1,
438
    ]);
439
    $bar->actions->[-1]->add_actions([ t8('History'),
440
      call     => [ 'set_history_window', $::form->{id} * 1, 'id' ],
441
      disabled => !$::form->{id},
442
    ]);
443
    $bar->actions->[-1]->add_actions([ t8('Follow-Up'),
444
      call     => [ 'follow_up_window' ],
445
      disabled => !$::form->{id},
446
    ]);
447
    $bar->actions->[-1]->add_actions([ t8('Drafts'),
448
      call     => [ 'kivi.Draft.popup', 'is', 'invoice', $::form->{draft_id}, $::form->{draft_description} ],
449
      disabled => $::form->{id} || $::form->{locked},
450
    ]);
451

  
452
  }
453

  
362 454
  $form->header();
363 455

  
364 456
  print $form->parse_html_template("is/form_header", \%TMPL_VAR);
templates/webpages/is/form_footer.html
148 148

  
149 149
<p>[% print_options %]</p>
150 150

  
151
<div id='form_action_bar'>
152
  <input type="hidden" id="action" name="action" value="dispatcher">
153

  
154
  [% IF id %]
155
    <input class="submit" type="submit" accesskey="u" name="action_update" id="update_button" value="[% 'Update' | $T8 %]">
156
    <input class="submit" type="submit" name="action_ship_to" value="[% 'Ship to' | $T8 %]">
157
    <input class="submit" type="submit" name="action_print" id="action_print" value="[% 'Print' | $T8 %]" data-require-transaction-description="[% INSTANCE_CONF.get_require_transaction_description_ps %]">
158
    <input class="submit" type="submit" name="action_e_mail" value="[% 'E-mail' | $T8 %]" data-require-transaction-description="[% INSTANCE_CONF.get_require_transaction_description_ps %]">
159
[% IF  show_storno %]
160
    [% L.submit_tag("action_storno", LxERP.t8("Storno"), "data-require-transaction-description"=INSTANCE_CONF.get_require_transaction_description_ps, confirm=LxERP.t8('Do you really want to cancel this invoice?')) %]
161
[% END %]
162
    <input class="submit" type="submit" name="action_post_payment" value="[% 'Post Payment' | $T8 %]">
163
    <input class="submit" type="submit" name="action_use_as_new" value="[% 'Use As New' | $T8 %]">
164

  
165
[% IF id && !is_type_credit_note %]
166
    <input class="submit" type="submit" name="action_credit_note" value="[% 'Credit Note' | $T8 %]" data-require-transaction-description="[% INSTANCE_CONF.get_require_transaction_description_ps %]">
167
[% END %]
168
[% IF show_delete && (!storno || storno_id) %]
169
    [% L.submit_tag("action_delete", LxERP.t8("Delete"), confirm=LxERP.t8('Do you really want to delete this invoice?')) %]
170
[% END %]
171
[% IF show_delete && !storno %]
172
    <input class="submit" type="submit" name="action_post" value="[% 'Post' | $T8 %]" data-require-transaction-description="[% INSTANCE_CONF.get_require_transaction_description_ps %]">
173
[% END %]
174
    <input class="submit" type="submit" name="action_order" value="[% 'Order' | $T8 %]">
175
    <input type="button" class="submit" onclick="follow_up_window()" value="[% 'Follow-Up' | $T8 %]">
176

  
177
 [% ELSE # no id %]
178
   [% UNLESS locked %]
179
      <input class="submit" type="submit" name="action_update" id="update_button" value="[% 'Update' | $T8 %]">
180
      <input class="submit" type="submit" name="action_ship_to" value="[% 'Ship to' | $T8 %]">
181
      <input class="submit" type="submit" name="action_preview" value="[% 'Preview' | $T8 %]" data-require-transaction-description="[% INSTANCE_CONF.get_require_transaction_description_ps %]">
182
      <input class="submit" type="submit" name="action_post_and_e_mail" value="[% 'Post and E-mail' | $T8 %]" data-require-transaction-description="[% INSTANCE_CONF.get_require_transaction_description_ps %]">
183
      <input class="submit" type="submit" name="action_print_and_post" value="[% 'Print and Post' | $T8 %]" data-require-transaction-description="[% INSTANCE_CONF.get_require_transaction_description_ps %]">
184
      <input class="submit" type="submit" name="action_post" value="[% 'Post' | $T8 %]" data-require-transaction-description="[% INSTANCE_CONF.get_require_transaction_description_ps %]">
185
      [% L.button_tag('kivi.Draft.popup("is", "invoice", "' _ draft_id _ '", "' _ draft_description _ '")', LxERP.t8('Drafts')) %]
186
   [%- END %]
187
 [% END # id %]
188

  
189
  [% IF id %]
190
      [%#- button for saving history %]
191
      <input type="button" class="submit" onclick="set_history_window([% id | html %], 'glid');" name="history" id="history" value="[% 'history' | $T8 %]">
192
      [% IF INSTANCE_CONF.get_is_show_mark_as_paid %]
193
        [% L.submit_tag("action_mark_as_paid", 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?')) %]
194
      [% END %]
195
  [% END %]
196

  
197
  [% IF callback %]
198
    <a href="[% callback %]">[% 'back' | $T8  %]</a>
199
  [% END %]
200
</div>
201

  
202 151
<input type="hidden" name="rowcount" value="[% rowcount %]">
203 152
<input type="hidden" name="callback" value="[% callback | html %]">
204 153
[% P.hidden_tag('draft_id', draft_id) %]
templates/webpages/is/form_header.html
8 8
<script type="text/javascript" src="js/calculate_qty.js"></script>
9 9
<script type="text/javascript" src="js/follow_up.js"></script>
10 10

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

  
13 13
[%- FOREACH key = HIDDENS %]
14 14
<input type="hidden" name="[% HTML.escape(key) %]" value="[% HTML.escape($key)  %]">
......
74 74
          <td>
75 75
            [% shiptos = [ [ "", LxERP.t8("No/individual shipping address") ] ] ;
76 76
               L.select_tag('shipto_id', shiptos.import(ALL_SHIPTO), default=shipto_id, value_key='shipto_id', title_key='displayable_id', style='width: 250px') %]
77
            <input class="submit" type="submit" name="action_ship_to" value="[% 'Ship to' | $T8 %]">
77 78
          </td>
78 79
        </tr>
79 80
[%- END %]

Auch abrufbar als: Unified diff