Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 99f8e356

Von Werner Hahn vor etwa 1 Monat hinzugefügt

  • ID 99f8e3568925c8fe95b2b4b4add4a6e80fb9b477
  • Vorgänger 61dd13f4
  • Nachfolger f6dca01c

S:C:DeliveryOrder: Methode zum Schließen "Als geschlossen markieren"

behebt #702
behebt #694

Unterschiede anzeigen:

SL/Controller/DeliveryOrder.pm
271 271
  $self->action_save();
272 272
}
273 273

  
274
# close a already saved order (potentially already delivered)
275
sub action_close_order {
276
  my ($self) = @_;
277

  
278
  $self->order->update_attributes(
279
    closed => 1
280
  );
281

  
282
  $self->js
283
    ->flash("info", t8("The record has been closed."))
284
    ->run('kivi.ActionBar.setDisabled', '#save_action',
285
          t8('This record has already been closed.'))
286
    ->run('kivi.ActionBar.setDisabled', '#save_and_close',
287
          t8('This record has already been closed.'))
288
    ->run('kivi.ActionBar.setDisabled', '#close_order',
289
          t8('This record has already been closed.'))
290
    ->html('#data-status-line', delivery_order_status_line($self->order))
291
    ->render
292
}
293

  
274 294
# print the order
275 295
#
276 296
# This is called if "print" is pressed in the print dialog.
......
1946 1966
              warn_on_duplicates => $::instance_conf->get_order_warn_duplicate_parts,
1947 1967
              warn_on_reqdate    => $::instance_conf->get_order_warn_no_deliverydate,
1948 1968
            }],
1949
          disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.')
1969
          disabled => !$may_edit_create       ? t8('You do not have the permissions to access this function.')
1950 1970
                    : $self->order->delivered ? t8('This record has already been delivered.')
1951
                    :                        undef,
1971
                    : $self->order->closed    ? t8('This record has already been closed.')
1972
                    :                           undef,
1952 1973
        ],
1953 1974
        action => [
1954 1975
          t8('Save and Close'),
......
1961 1982
                { name => 'back_to_caller', value => 1 },
1962 1983
              ],
1963 1984
            }],
1964
          disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.')
1985
          disabled => !$may_edit_create       ? t8('You do not have the permissions to access this function.')
1965 1986
                    : $self->order->delivered ? t8('This record has already been delivered.')
1987
                    : $self->order->closed    ? t8('This record has already been closed.')
1988
                    :                           undef,
1989
        ],
1990
        action => [
1991
          t8('Mark as closed'),
1992
          id       => 'close_order',
1993
          call     => [ 'kivi.DeliveryOrder.close_order' ],
1994
          confirm  => t8('This will remove the delivery order from showing as open even if contents are not delivered. Proceed?'),
1995
          disabled => !$may_edit_create    ? t8('You do not have the permissions to access this function.')
1996
                    : !$self->order->id    ? t8('This object has not been saved yet.')
1997
                    : $self->order->closed ? t8('This record has already been closed.')
1966 1998
                    :                        undef,
1967 1999
        ],
1968 2000
        action => [
js/kivi.DeliveryOrder.js
79 79
    $.post("controller.pl", data, kivi.eval_json_result);
80 80
  };
81 81

  
82
  ns.close_order = function() {
83
    let data = [];
84
    let id = $("#id").val();
85

  
86
    if (!id) {
87
      alert(kivi.t8('This object has not been saved yet.'));
88
      return;
89
    }
90

  
91
    data.push({ name: 'id', value: id });
92
    data.push({ name: 'action', value: 'DeliveryOrder/close_order' });
93
    $.post("controller.pl", data, kivi.eval_json_result);
94
  }
95

  
82 96
  ns.show_print_options = function(params) {
83 97
    if (!ns.check_cv()) return;
84 98

  
js/locale/de.js
185 185
"There are still transfers not matching the qty of the delivery order. Stock operations can not be changed later. Do you really want to proceed?":"Einige der Lagerbewegungen sind nicht vollständig und Lagerbewegungen können nachträglich nicht mehr verändert werden. Möchten Sie wirklich fortfahren?",
186 186
"There is one or more sections for which no part has been assigned yet; therefore creating the new record is not possible yet.":"Es gibt einen oder mehrere Abschnitte ohne Artikelzuweisung; daher kann der neue Beleg noch nicht erstellt werden.",
187 187
"This field must not be empty.":"Dieses Feld darf nicht leer sein.",
188
"This object has not been saved yet.":"Das Objekt wurde noch nicht gespeichert.",
188 189
"This sales order has an active configuration for periodic invoices. If you save then all subsequently created invoices will contain those changes as well, but not those that have already been created. Do you want to continue?":"Dieser Auftrag besitzt eine aktive Konfiguration für wiederkehrende Rechnungen. Wenn Sie jetzt speichern, so werden alle zukünftig hieraus erzeugten Rechnungen die Änderungen enthalten, nicht aber die bereits erzeugten Rechnungen. Möchten Sie speichern?",
189 190
"This vendor has already a booking with this invoice number, do you really want to add the same invoice number again?":"Es gibt für diesen Lieferant schon einen Beleg mit dieser Rechnungsnummer. Möchten Sie wirklich eine weitere Buchung mit derselben Rechnungsnummer hinzufügen?",
190 191
"Thu":"Do",
js/locale/en.js
185 185
"There are still transfers not matching the qty of the delivery order. Stock operations can not be changed later. Do you really want to proceed?":"",
186 186
"There is one or more sections for which no part has been assigned yet; therefore creating the new record is not possible yet.":"",
187 187
"This field must not be empty.":"",
188
"This object has not been saved yet.":"",
188 189
"This sales order has an active configuration for periodic invoices. If you save then all subsequently created invoices will contain those changes as well, but not those that have already been created. Do you want to continue?":"",
189 190
"This vendor has already a booking with this invoice number, do you really want to add the same invoice number again?":"",
190 191
"Thu":"",
locale/de/all
4247 4247
  'The reclamation reason has been deleted.' => 'Der Reklamationsgrund wurde gelöscht.',
4248 4248
  'The reclamation reason has been saved.' => 'Der Reklamationsgrund wurde gespeichert.',
4249 4249
  'The reclamation reason is in use and cannot be deleted.' => 'Der Reklamationsgrund ist in Benutzung und kann nicht gelöscht werden.',
4250
  'The record has been closed.' => 'Dieser Beleg wurde geschlossen.',
4250 4251
  'The record template \'#1\' has been loaded.' => 'Die Belegvorlage »#1« wurde geladen.',
4251 4252
  'The record template \'#1\' has been saved.' => 'Die Belegvorlage »#1« wurde gespeichert.',
4252 4253
  'The report doesn\'t contain entries.' => 'Der Bericht enthält keine Einträge.',
locale/en/all
4245 4245
  'The reclamation reason has been deleted.' => '',
4246 4246
  'The reclamation reason has been saved.' => '',
4247 4247
  'The reclamation reason is in use and cannot be deleted.' => '',
4248
  'The record has been closed.' => '',
4248 4249
  'The record template \'#1\' has been loaded.' => '',
4249 4250
  'The record template \'#1\' has been saved.' => '',
4250 4251
  'The report doesn\'t contain entries.' => '',

Auch abrufbar als: Unified diff