Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision fb692c5f

Von Moritz Bunkus vor mehr als 10 Jahren hinzugefügt

  • ID fb692c5f36d073818aec001f281a70a77dfb6977
  • Vorgänger 687a09d8
  • Nachfolger f4fe8246

Pflichtenheft-Angebot/Auftrag: Liste in Tab anzeigen

Unterschiede anzeigen:

SL/Controller/RequirementSpecOrder.pm
1
package SL::Controller::RequirementSpecOrder;
2

  
3
use strict;
4
use utf8;
5

  
6
use parent qw(SL::Controller::Base);
7

  
8
use SL::ClientJS;
9
use SL::DB::RequirementSpec;
10
use SL::DB::RequirementSpecOrder;
11
use SL::Helper::Flash;
12
use SL::Locale::String;
13

  
14
use Rose::Object::MakeMethods::Generic
15
(
16
  'scalar --get_set_init' => [ qw(requirement_spec js) ],
17
);
18

  
19
__PACKAGE__->run_before('setup');
20

  
21
#
22
# actions
23
#
24

  
25

  
26
sub action_list {
27
  my ($self) = @_;
28

  
29
  $::lxdebug->dump(0, "hmm", $self->requirement_spec->sections_sorted);
30
  $self->render('requirement_spec_order/list', { layout => 0 });
31
}
32

  
33
#
34
# filters
35
#
36

  
37
sub setup {
38
  my ($self) = @_;
39

  
40
  $::auth->assert('sales_quotation_edit');
41
  $::request->{layout}->use_stylesheet("${_}.css") for qw(jquery.contextMenu requirement_spec);
42
  $::request->{layout}->use_javascript("${_}.js") for qw(jquery.jstree jquery/jquery.contextMenu client_js requirement_spec);
43

  
44
  return 1;
45
}
46

  
47
sub init_requirement_spec {
48
  my ($self) = @_;
49
  $self->requirement_spec(SL::DB::RequirementSpec->new(id => $::form->{requirement_spec_id})->load) if $::form->{requirement_spec_id};
50
}
51

  
52
sub init_js {
53
  my ($self) = @_;
54
  $self->js(SL::ClientJS->new);
55
}
56

  
57
#
58
# helpers
59
#
60

  
61
1;
SL/DB/RequirementSpec.pm
27 27
    class          => 'SL::DB::RequirementSpec',
28 28
    column_map     => { id => 'working_copy_id' },
29 29
  },
30
  orders           => {
31
    type           => 'one to many',
32
    class          => 'SL::DB::RequirementSpecOrder',
33
    column_map     => { id => 'requirement_spec_id' },
34
  },
30 35
);
31 36

  
32 37
__PACKAGE__->meta->initialize;
......
71 76

  
72 77
sub sections { &sections_sorted; }
73 78

  
79
sub orders_sorted {
80
  my ($self, %params) = _hashify(1, @_);
81
  my $by              = $params{by} || 'itime';
82

  
83
  return [ sort { $a->$by cmp $b->$by } @{ $self->orders } ];
84
}
85

  
74 86
sub displayable_name {
75 87
  my ($self) = @_;
76 88

  
js/locale/de.js
9 9
"Copy requirement spec":"Pflichtenheft kopieren",
10 10
"Copy template":"Vorlage kopieren",
11 11
"Create PDF":"PDF erzeugen",
12
"Create new qutoation/order":"",
12 13
"Create new version":"Neue Version anlegen",
13 14
"Database Connection Test":"Test der Datenbankverbindung",
14 15
"Delete":"Löschen",
16
"Delete quotation/order":"",
15 17
"Delete requirement spec":"Pflichtenheft löschen",
16 18
"Delete template":"Vorlage löschen",
17 19
"Delete text block":"Textblock löschen",
......
19 21
"Do you really want to revert to this version?":"Wollen Sie wirklich auf diese Version zurücksetzen?",
20 22
"Do you want to set the account number \"#1\" to \"#2\" and the name \"#3\" to \"#4\"?":"Soll die Kontonummer \"#1\" zu \"#2\" und den Name \"#3\" zu \"#4\" geändert werden?",
21 23
"Edit":"Bearbeiten",
24
"Edit article/section assignments":"",
22 25
"Edit text block":"Textblock bearbeiten",
23 26
"Enter longdescription":"Langtext eingeben",
24 27
"Function block actions":"Funktionsblockaktionen",
25 28
"Map":"Karte",
29
"Orders/Quotations actions":"",
26 30
"Part picker":"Artikelauswahl",
27 31
"Paste":"Einfügen",
28 32
"Paste template":"Vorlage einfügen",
......
39 43
"The selected database is still configured for client \"#1\". If you delete the database that client will stop working until you re-configure it. Do you still want to delete the database?":"Die auswählte Datenbank ist noch für Mandant \"#1\" konfiguriert. Wenn Sie die Datenbank löschen, wird der Mandanten nicht mehr funktionieren, bis er anders konfiguriert wurde. Wollen Sie die Datenbank trotzdem löschen?",
40 44
"Time/cost estimate actions":"Aktionen für Kosten-/Zeitabschätzung",
41 45
"Toggle marker":"Markierung umschalten",
46
"Update quotation/order":"",
42 47
"Version actions":"Aktionen für Versionen"
43 48
});
js/requirement_spec.js
317 317
  return true;
318 318
};
319 319

  
320
// -------------------------------------------------------------------------
321
// --------------------------- quotations/orders ---------------------------
322
// -------------------------------------------------------------------------
323

  
324
ns.find_quotation_order_id = function(clicked_elt) {
325
  return $(clicked_elt).find('>[name=order_id]').val();
326
};
327

  
328
ns.standard_quotation_order_ajax_call = function(key, opt, other_data) {
329
  var data = {
330
    action:              "RequirementSpecOrder/" + key,
331
    requirement_spec_id: $('#requirement_spec_id').val(),
332
    id:                  ns.find_quotation_order_id(opt.$trigger)
333
  };
334

  
335
  // console.log("I would normally POST the following now:");
336
  // console.log(data);
337
  $.post("controller.pl", $.extend(data, other_data || {}), kivi.eval_json_result);
338

  
339
  return true;
340
};
341

  
342
ns.disable_edit_quotation_order_commands = function(key, opt) {
343
  return ns.find_quotation_order_id(opt.$trigger) == undefined;
344
};
345

  
346
ns.disable_create_quotation_order_commands = function(key, opt) {
347
  return !$('#quotations_and_orders_sections');
348
};
349

  
320 350
// -------------------------------------------------------------------------
321 351
// ---------------------------- general actions ----------------------------
322 352
// -------------------------------------------------------------------------
......
474 504
    }, general_actions)
475 505
  });
476 506

  
507
  $.contextMenu({
508
    selector: '.quotations-and-orders-context-menu,.quotations-and-orders-order-context-menu',
509
    items:    $.extend({
510
        heading:            { name: kivi.t8('Orders/Quotations actions'), className: 'context-menu-heading' }
511
      , edit:               { name: kivi.t8('Edit article/section assignments'), icon: "edit",   callback: ns.standard_quotation_order_ajax_call }
512
      , sep1:               "---------"
513
      , new:                { name: kivi.t8('Create new qutoation/order'),       icon: "add",    callback: ns.standard_quotation_order_ajax_call, disabled: ns.disable_create_quotation_order_commands}
514
      , update:             { name: kivi.t8('Update quotation/order'),           icon: "update", callback: ns.standard_quotation_order_ajax_call, disabled: ns.disable_edit_quotation_order_commands }
515
      , sep2:               "---------"
516
      , delete:             { name: kivi.t8('Delete quotation/order'),           icon: "delete", callback: ns.ask_delete_quotation_order,         disabled: ns.disable_edit_quotation_order_commands }
517
    }, general_actions)
518
  });
519

  
477 520
  $.contextMenu({
478 521
    selector: '#content',
479 522
    items:    general_actions
locale/de/all
243 243
  'Are you sure you want to remove the marked entries from the queue?' => 'Sind Sie sicher, dass die markierten Einträge von der Warteschlange gelöscht werden sollen?',
244 244
  'Are you sure you want to update the prices' => 'Sind Sie sicher, dass Sie die Preise aktualisieren wollen?',
245 245
  'Are you sure?'               => 'Sind Sie sicher?',
246
  'Article'                     => '',
246 247
  'Article Code'                => 'Artikelkürzel',
247 248
  'Article Code missing!'       => 'Artikelkürzel fehlt',
248 249
  'Article type (see below)'    => 'Artikeltyp (siehe unten)',
......
254 255
  'Assembly Number missing!'    => 'Erzeugnisnummer fehlt!',
255 256
  'Asset'                       => 'Aktiva/Mittelverwendung',
256 257
  'Assets'                      => 'Aktiva',
258
  'Assignment of articles to sections' => '',
257 259
  'Assistant for general ledger corrections' => 'Assistent für die Korrektur von Hauptbucheinträgen',
258 260
  'Assume Tax Consultant Data in Tax Computation?' => 'Beraterdaten in UStVA übernehmen?',
259 261
  'At least'                    => 'Mindestens',
......
588 590
  'Create new department'       => 'Neue Abteilung erfassen',
589 591
  'Create new payment term'     => 'Neue Zahlungsbedingung anlegen',
590 592
  'Create new project type'     => 'Neuen Projekttypen anlegen',
593
  'Create new qutoation/order'  => '',
591 594
  'Create new templates from master templates' => 'Neue Druckvorlagen aus Vorlagensatz erstellen',
592 595
  'Create new version'          => 'Neue Version anlegen',
593 596
  'Create one from the context menu by right-clicking on this text.' => 'Erstellen Sie einen aus dem Kontextmenü, indem Sie auf diesen Text rechtsklicken.',
......
716 719
  'Default client'              => 'Standardmandant',
717 720
  'Default currency'            => 'Standardwährung',
718 721
  'Default currency missing!'   => 'Standardwährung fehlt!',
719
  'Default hourly rate for new customers' => '',
722
  'Default hourly rate for new customers' => 'Standard-Stundensatz für neue Kunden',
720 723
  'Default output medium'       => 'Standardausgabekanal',
721 724
  'Default printer'             => 'Standarddrucker',
722 725
  'Default template format'     => 'Standardvorlagenformat',
......
730 733
  'Delete drafts'               => 'Entwürfe löschen',
731 734
  'Delete links'                => 'Verknüpfungen löschen',
732 735
  'Delete profile'              => 'Profil löschen',
736
  'Delete quotation/order'      => '',
733 737
  'Delete requirement spec'     => 'Pflichtenheft löschen',
734 738
  'Delete template'             => 'Vorlage löschen',
735 739
  'Delete text block'           => 'Textblock löschen',
......
895 899
  'Edit Vendor Invoice'         => 'Einkaufsrechnung bearbeiten',
896 900
  'Edit Warehouse'              => 'Lager bearbeiten',
897 901
  'Edit acceptance status'      => 'Abnahmestatus bearbeiten',
902
  'Edit article/section assignments' => '',
898 903
  'Edit background job'         => 'Hintergrund-Job bearbeiten',
899 904
  'Edit bank account'           => 'Bankkonto bearbeiten',
900 905
  'Edit business'               => 'Kunden-/Lieferantentyp bearbeiten',
......
1481 1486
  'No printers have been created yet.' => 'Es wurden noch keine Drucker angelegt.',
1482 1487
  'No problems were recognized.' => 'Es wurden keine Probleme gefunden.',
1483 1488
  'No project type has been created yet.' => 'Es wurden noch keine Projekttypen angelegt.',
1489
  'No quotations or orders have been created yet.' => '',
1484 1490
  'No report with id #1'        => 'Es gibt keinen Report mit der Id #1',
1485 1491
  'No requirement spec statuses has been created yet.' => 'Es wurden noch keine Pflichtenheftstatus angelegt.',
1486 1492
  'No requirement spec templates have been created yet.' => 'Es wurden noch keine Pflichtenheftvorlangen angelegt.',
......
1488 1494
  'No risks level has been created yet.' => 'Es wurden noch keine Risikograde angelegt.',
1489 1495
  'No sections created yet'     => 'Keine Abschnitte erstellt',
1490 1496
  'No sections have been created so far.' => 'Bisher wurden noch keine Abschnitte angelegt.',
1497
  'No sections have been created yet.' => '',
1491 1498
  'No shipto selected to delete' => 'Keine Lieferadresse zum Löschen ausgewählt',
1492 1499
  'No summary account'          => 'Kein Sammelkonto',
1493 1500
  'No text blocks have been created for this position.' => 'Für diese Position wurden noch keine Textblöcke angelegt.',
......
1574 1581
  'Ordered'                     => 'Von Kunden bestellt',
1575 1582
  'Orders'                      => 'Aufträge',
1576 1583
  'Orders / Delivery Orders deleteable' => 'Aufträge / Lieferscheine löschbar',
1584
  'Orders/Quotations actions'   => '',
1577 1585
  'Orientation'                 => 'Seitenformat',
1578 1586
  'Orphaned'                    => 'Nie benutzt',
1579 1587
  'Orphaned currencies'         => 'Verwaiste Währungen',
......
1807 1815
  'Quotation Number missing!'   => 'Angebotsnummer fehlt!',
1808 1816
  'Quotation deleted!'          => 'Angebot wurde gelöscht.',
1809 1817
  'Quotations'                  => 'Angebote',
1818
  'Quotations and orders'       => '',
1810 1819
  'Quote character'             => 'Anführungszeichen-Symbol',
1811 1820
  'Quote chararacter'           => 'Anführungszeichen',
1812 1821
  'Quoted'                      => 'Angeboten',
......
1827 1836
  'Reconciliation'              => 'Kontenabgleich',
1828 1837
  'Record Vendor Invoice'       => 'Einkaufsrechnung erfassen',
1829 1838
  'Record in'                   => 'Buchen auf',
1839
  'Record number'               => '',
1830 1840
  'Recorded Tax'                => 'Gespeicherte Steuern',
1831 1841
  'Recorded taxkey'             => 'Gespeicherter Steuerschlüssel',
1832 1842
  'Reference'                   => 'Referenz',
......
1875 1885
  'Requirement Spec Templates'  => 'Pflichtenheftvorlagen',
1876 1886
  'Requirement Spec Type'       => 'Pflichtenhefttyp',
1877 1887
  'Requirement Spec Types'      => 'Pflichtenhefttypen',
1888
  'Requirement Spec Version'    => '',
1878 1889
  'Requirement Specs'           => 'Pflichtenhefte',
1879 1890
  'Requirement spec actions'    => 'Pflichtenheftaktionen',
1880 1891
  'Requirement spec function block #1 with #2 sub function blocks; description: "#3"' => 'Pflichtenheft-Funktionsblock #1 mit #2 Unterfunktionsblöcken; Beschreibung: "#3"',
......
1932 1943
  'Sales margin'                => 'Marge',
1933 1944
  'Sales margin %'              => 'Marge prozentual',
1934 1945
  'Sales net amount'            => 'VK-Betrag',
1946
  'Sales order'                 => '',
1935 1947
  'Sales price'                 => 'VK-Preis',
1936 1948
  'Sales price total'           => 'VK-Betrag',
1937 1949
  'Sales quotation'             => 'Angebot',
......
2537 2549
  'Transaction'                 => 'Buchung',
2538 2550
  'Transaction %d cancelled.'   => 'Buchung %d erfolgreich storniert.',
2539 2551
  'Transaction Date missing!'   => 'Buchungsdatum fehlt!',
2552
  'Transaction Description'     => '',
2540 2553
  'Transaction ID missing.'     => 'Die Buchungs-ID fehlt.',
2541 2554
  'Transaction deleted!'        => 'Buchung gelöscht!',
2542 2555
  'Transaction description'     => 'Vorgangsbezeichnung',
......
2602 2615
  'Update prices'               => 'Preise aktualisieren',
2603 2616
  'Update prices of existing entries' => 'Preise von vorhandenen Artikeln aktualisieren',
2604 2617
  'Update properties of existing entries' => 'Eigenschaften von existierenden Einträgen aktualisieren',
2618
  'Update quotation/order'      => '',
2605 2619
  'Updated'                     => 'Erneuert am',
2606 2620
  'Updating existing entry in database' => 'Existierenden Eintrag in Datenbank aktualisieren',
2607 2621
  'Updating prices of existing entry in database' => 'Preis des Eintrags in der Datenbank wird aktualisiert',
......
2868 2882
  'new Window'                  => 'neues Fenster',
2869 2883
  'next'                        => 'vor',
2870 2884
  'no'                          => 'nein',
2885
  'no article assigned yet'     => '',
2871 2886
  'no bestbefore'               => 'keine Mindesthaltbarkeit',
2872 2887
  'no chargenumber'             => 'keine Chargennummer',
2873 2888
  'none (pricegroup)'           => 'keine',
......
2965 2980
  'vendor_list'                 => 'lieferantenliste',
2966 2981
  'warehouse_journal_list'      => 'lagerbuchungsliste',
2967 2982
  'warehouse_report_list'       => 'lagerbestandsliste',
2983
  'working copy'                => '',
2968 2984
  'wrongformat'                 => 'Falsches Format',
2969 2985
  'yearly'                      => 'jährlich',
2970 2986
  'yes'                         => 'ja',
templates/webpages/requirement_spec/show.html
13 13
  <li><a href="controller.pl?action=RequirementSpec/ajax_show_time_and_cost_estimate&id=[% HTML.url(SELF.requirement_spec.id) %]">[%- LxERP.t8("Time and cost estimate") %]</a></li>
14 14
  [%- UNLESS SELF.requirement_spec.is_template %]
15 15
   <li><a href="controller.pl?action=RequirementSpecVersion/list&requirement_spec_id=[% HTML.url(SELF.requirement_spec.id) %]">[%- LxERP.t8("Versions") %]</a></li>
16
   <li><a href="[% SELF.url_for(controller='RequirementSpecOrder', action='list', requirement_spec_id=SELF.requirement_spec.id) %]">[%- LxERP.t8("Quotations and orders") %]</a></li>
16 17
  [%- END %]
17 18
 </ul>
18 19

  
templates/webpages/requirement_spec_order/list.html
1
[%- USE HTML -%][%- USE LxERP -%][%- USE L -%][%- USE P -%]
2
<div id="quotations_and_orders" class="quotations-and-orders-context-menu">
3
 <h2>[% LxERP.t8("Assignment of articles to sections") %]</h2>
4
 [% SET sections = SELF.requirement_spec.sections_sorted %]
5
 [% IF !sections.size %]
6
 <div>
7
  [% LxERP.t8("No sections have been created yet.") %]
8
 </div>
9
 [% ELSE %]
10
 <table id="quotations_and_orders_sections" style="width: 100%">
11
  <thead>
12
   <tr class="listheading">
13
    <th>[% LxERP.t8("Number") %]</th>
14
    <th>[% LxERP.t8("Title") %]</th>
15
    <th>[% LxERP.t8("Description") %]</th>
16
    <th>[% LxERP.t8("Article") %]</th>
17
   </tr>
18
  </thead>
19

  
20
  <tbody>
21
   [% FOREACH section = sections %]
22
    <tr class="listrow">
23
     <td>[% HTML.escape(section.fb_number) %]</td>
24
     <td>[% HTML.escape(section.title) %]</td>
25
     <td>[% HTML.escape(P.truncate(section.description)) %]</td>
26
     <td>
27
      [% IF section.order_part %]
28
       [% HTML.escape(section.order_part.partnumber) %] [% HTML.escape(section.order_part.description) %]
29
      [% ELSE %]
30
       [% LxERP.t8("no article assigned yet") %]
31
      [% END %]
32
     </td>
33
    </tr>
34
   [% END %]
35
  </tbody>
36
 </table>
37
 [% END %]
38

  
39
 <h2>[% LxERP.t8("Quotations and orders") %]</h2>
40

  
41
 [% SET orders = SELF.requirement_spec.orders_sorted %]
42
 [% IF !orders.size %]
43
  <div>[% LxERP.t8("No quotations or orders have been created yet.") %]</div>
44
 [% ELSE %]
45

  
46
  <table style="width:100%">
47
   <thead>
48
    <tr class="listheading">
49
     <th>[% LxERP.t8("Type") %]</th>
50
     <th>[% LxERP.t8("Requirement Spec Version") %]</th>
51
     <th>[% LxERP.t8("Record number") %]</th>
52
     <th>[% LxERP.t8("Transaction Description") %]</th>
53
     <th>[% LxERP.t8("Date") %]</th>
54
    </tr>
55
   </thead>
56

  
57
   <tbody>
58
    [% FOREACH rs_order = orders %]
59
    <tr class="listrow quotations-and-orders-order-context-menu">
60
     [% L.hidden_tag('order_id', rs_order.id, no_id=1) %]
61
     <td>[% rs_order.order.type == 'sales_quotation' ? LxERP.t8('Sales quotation') : LxERP.t8('Sales order') %]</td>
62
     <td>
63
      [% IF rs_order.version %]
64
       [% HTML.escape(rs_order.version.version_number) %]
65
      [% ELSE %]
66
       [% LxERP.t8("working copy") %]
67
      [% END %]
68
     </td>
69
     <td>[% HTML.escape(rs_order.order.quotation ? rs_order.order.quonumber : rs_order.order.ordnumber) %]</td>
70
     <td>[% HTML.escape(rs_order.order.transaction_description) %]</td>
71
     <td>[% rs_order.itime.to_kivitendo(precision='day') %]</td>
72
    </tr>
73
    [%- END %]
74
   </tbody>
75
  </table>
76
 [% END %]
77
</div>

Auch abrufbar als: Unified diff