From e142cf7d27b16c1cab36fa28d4fca6e81e3ed816 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 11 Jul 2013 17:49:11 +0200 Subject: [PATCH] =?utf8?q?Pflichtenhefte:=20L=C3=B6schen=20von=20Auftr?= =?utf8?q?=C3=A4gen/Angeboten?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Controller/RequirementSpecOrder.pm | 14 ++++++++++++++ js/requirement_spec.js | 6 ++++++ locale/de/all | 2 ++ 3 files changed, 22 insertions(+) diff --git a/SL/Controller/RequirementSpecOrder.pm b/SL/Controller/RequirementSpecOrder.pm index 6dfab604b..e444a7cc9 100644 --- a/SL/Controller/RequirementSpecOrder.pm +++ b/SL/Controller/RequirementSpecOrder.pm @@ -154,6 +154,20 @@ sub action_save_assignment { ->render($self); } +sub action_delete { + my ($self) = @_; + + my $order = $self->rs_order->order; + + $order->delete; + $self->init_requirement_spec; + + my $html = $self->render('requirement_spec_order/list', { output => 0 }); + $self->js->html('#' . TAB_ID(), $html) + ->flash('info', $order->quotation ? t8('Sales quotation #1 has been deleted.', $order->quonumber) : t8('Sales order #1 has been deleted.', $order->ordnumber)) + ->render($self); +} + sub action_cancel { my ($self) = @_; diff --git a/js/requirement_spec.js b/js/requirement_spec.js index 6ea5329ca..160240df4 100644 --- a/js/requirement_spec.js +++ b/js/requirement_spec.js @@ -344,6 +344,12 @@ ns.standard_quotation_order_ajax_call = function(key, opt) { return true; }; +ns.ask_delete_quotation_order = function(key, opt) { + if (confirm(kivi.t8("Are you sure?"))) + ns.standard_quotation_order_ajax_call(key, opt); + return true; +}; + ns.disable_edit_quotation_order_commands = function(key, opt) { return ns.find_quotation_order_id(opt.$trigger) == undefined; }; diff --git a/locale/de/all b/locale/de/all index af60767a2..71e9ba0ee 100755 --- a/locale/de/all +++ b/locale/de/all @@ -1955,11 +1955,13 @@ $self->{texts} = { 'Sales margin %' => 'Marge prozentual', 'Sales net amount' => 'VK-Betrag', 'Sales order #1 has been created.' => 'Kundenauftrag #1 wurde angelegt.', + 'Sales order #1 has been deleted.' => 'Kundenauftrag #1 wurde gelöscht.', 'Sales order #1 has been updated.' => 'Kundenauftrag #1 wurde aktualisiert.', 'Sales price' => 'VK-Preis', 'Sales price total' => 'VK-Betrag', 'Sales quotation' => 'Angebot', 'Sales quotation #1 has been created.' => 'Angebot #1 wurde angelegt.', + 'Sales quotation #1 has been deleted.' => 'Angebot #1 wurde gelöscht.', 'Sales quotation #1 has been updated.' => 'Angebot #1 wurde aktualisiert.', 'Salesman' => 'Verkäufer/in', 'Salesman (database ID)' => 'Verkäufer (Datenbank-ID)', -- 2.20.1