Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision ff5279ed

Von Bernd Bleßmann vor mehr als 5 Jahren hinzugefügt

  • ID ff5279eda2b2e7fb378bfc65ea582b10a06ed604
  • Vorgänger 31bc0c47
  • Nachfolger 486d0a3b

Auftrags-Controller: Positions-Update aus Artikel-Stamm

Unterschiede anzeigen:

SL/Controller/Order.pm
1015 1015
  $self->js->render();
1016 1016
}
1017 1017

  
1018
# update description, notes and sellprice from master data
1019
sub action_update_row_from_master_data {
1020
  my ($self) = @_;
1021

  
1022
  foreach my $item_id (@{ $::form->{item_ids} }) {
1023
    my $idx  = first_index { $_ eq $item_id } @{ $::form->{orderitem_ids} };
1024
    my $item = $self->order->items_sorted->[$idx];
1025

  
1026
    $item->description($item->part->description);
1027
    $item->longdescription($item->part->notes);
1028

  
1029
    my $price_source = SL::PriceSource->new(record_item => $item, record => $self->order);
1030

  
1031
    my $price_src;
1032
    if ($item->part->is_assortment) {
1033
    # add assortment items with price 0, as the components carry the price
1034
      $price_src = $price_source->price_from_source("");
1035
      $price_src->price(0);
1036
    } else {
1037
      $price_src = $price_source->best_price
1038
                 ? $price_source->best_price
1039
                 : $price_source->price_from_source("");
1040
      $price_src->price(0) if !$price_source->best_price;
1041
    }
1042

  
1043
    $item->sellprice($price_src->price);
1044
    $item->active_price_source($price_src);
1045

  
1046
    $self->js
1047
      ->run('kivi.Order.update_sellprice', $item_id, $item->sellprice_as_number)
1048
      ->val('.row_entry:has(#item_' . $item_id . ') [name = "order.orderitems[].description"]', $item->description)
1049
      ->val('.row_entry:has(#item_' . $item_id . ') [name = "order.orderitems[].longdescription"]', $item->longdescription);
1050
  }
1051

  
1052
  $self->recalc();
1053
  $self->js_redisplay_line_values;
1054
  $self->js_redisplay_amounts_and_taxes;
1055

  
1056
  $self->js->render();
1057
}
1058

  
1018 1059
sub js_load_second_row {
1019 1060
  my ($self, $item, $item_id, $do_parse) = @_;
1020 1061

  
css/kivitendo/main.css
531 531
    max-width: 16px;
532 532
    max-height: 16px;
533 533
}
534
#update_from_master {
535
    cursor: pointer;
536
    display: block;
537
    max-width: 16px;
538
    max-height: 16px;
539
}
540
#update_from_master:hover {
541
    background: #ddd;
542
}
534 543

  
535 544
/* Bank transactions */
536 545
#bank_transactions_proposals .invoice_number_highlight a,
css/lx-office-erp/main.css
525 525
    max-width: 16px;
526 526
    max-height: 16px;
527 527
}
528
#update_from_master {
529
    cursor: pointer;
530
    display: block;
531
    max-width: 16px;
532
    max-height: 16px;
533
}
534
#update_from_master:hover {
535
    background: darkgrey;
536
}
528 537

  
529 538
/* Bank transactions */
530 539
#bank_transactions_proposals .invoice_number_highlight a,
image/rotate_cw.svg
1
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
3
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
4
<!-- Created with Inkscape (http://www.inkscape.org/) --><svg height="60.0000000" id="svg1" inkscape:version="0.38.1" sodipodi:docbase="/home/danny/flat/scalable/actions" sodipodi:docname="rotate_cw.svg" sodipodi:version="0.32" version="1.0" width="60.0000000" x="0" xmlns="http://www.w3.org/2000/svg" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:xlink="http://www.w3.org/1999/xlink" y="0">
5
  <metadata>
6
    <rdf:RDF xmlns:cc="http://web.resource.org/cc/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
7
      <cc:Work rdf:about="">
8
        <dc:title>Part of the Flat Icon Collection (Wed Aug 25 23:29:46 2004)</dc:title>
9
        <dc:description></dc:description>
10
        <dc:subject>
11
          <rdf:Bag>
12
            <rdf:li>hash</rdf:li>
13
            <rdf:li></rdf:li>
14
            <rdf:li>action</rdf:li>
15
            <rdf:li>computer</rdf:li>
16
            <rdf:li>icons</rdf:li>
17
            <rdf:li>theme</rdf:li>
18
          </rdf:Bag>
19
        </dc:subject>
20
        <dc:publisher>
21
          <cc:Agent rdf:about="http://www.openclipart.org">
22
            <dc:title>Danny Allen</dc:title>
23
          </cc:Agent>
24
        </dc:publisher>
25
        <dc:creator>
26
          <cc:Agent>
27
            <dc:title>Danny Allen</dc:title>
28
          </cc:Agent>
29
        </dc:creator>
30
        <dc:rights>
31
          <cc:Agent>
32
            <dc:title>Danny Allen</dc:title>
33
          </cc:Agent>
34
        </dc:rights>
35
        <dc:date></dc:date>
36
        <dc:format>image/svg+xml</dc:format>
37
        <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
38
        <cc:license rdf:resource="http://web.resource.org/cc/PublicDomain"/>
39
        <dc:language>en</dc:language>
40
      </cc:Work>
41
      <cc:License rdf:about="http://web.resource.org/cc/PublicDomain">
42
        <cc:permits rdf:resource="http://web.resource.org/cc/Reproduction"/>
43
        <cc:permits rdf:resource="http://web.resource.org/cc/Distribution"/>
44
        <cc:permits rdf:resource="http://web.resource.org/cc/DerivativeWorks"/>
45
      </cc:License>
46
    </rdf:RDF>
47
  </metadata>
48
  <sodipodi:namedview bordercolor="#666666" borderopacity="1.0" id="base" inkscape:cx="33.984503" inkscape:cy="18.129014" inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:window-height="685" inkscape:window-width="1016" inkscape:window-x="0" inkscape:window-y="0" inkscape:zoom="6.9465337" pagecolor="#ffffff" showguides="true" snaptoguides="true"/>
49
  <defs id="defs3"/>
50
  <path d="M 7.9315240,4.7740988 C 37.959278,18.463222 30.893925,41.646412 30.893925,41.867205 L 20.958272,41.867205 L 36.965712,55.225139 L 50.434041,41.756809 L 40.387993,41.756809 C 40.387993,41.756809 47.894929,9.6315299 7.9315240,4.7740988 z " id="path968" sodipodi:nodetypes="ccccccc" sodipodi:stroke-cmyk="(0 0 0 0.8)" style="font-size:12.000000;fill:#7f7f7f;fill-rule:evenodd;stroke:#333333;stroke-width:3.1249931;stroke-linecap:round;stroke-linejoin:round;" transform="translate(1.079675,0.000000)"/>
51
</svg>
js/kivi.Order.js
725 725
    return true;
726 726
  };
727 727

  
728
  ns.update_row_from_master_data = function(clicked) {
729
    var row = $(clicked).parents("tbody").first();
730
    var item_id_dom = $(row).find('[name="orderitem_ids[+]"]');
731

  
732
    var data = $('#order_form').serializeArray();
733
    data.push({ name: 'action', value: 'Order/update_row_from_master_data' });
734
    data.push({ name: 'item_ids[]', value: item_id_dom.val() });
735

  
736
    $.post("controller.pl", data, kivi.eval_json_result);
737
  };
738

  
739
  ns.update_all_rows_from_master_data = function() {
740
    var item_ids = $.map($('.row_entry'), function(elt) {
741
      var item_id = $(elt).find('[name="orderitem_ids[+]"]').val();
742
      return { name: 'item_ids[]', value: item_id };
743
    });
744

  
745
    if (item_ids.length == 0) {
746
      return;
747
    }
748

  
749
    var data = $('#order_form').serializeArray();
750
    data.push({ name: 'action', value: 'Order/update_row_from_master_data' });
751
    data = data.concat(item_ids);
752

  
753
    $.post("controller.pl", data, kivi.eval_json_result);
754
  };
755

  
728 756
  ns.show_calculate_qty_dialog = function(clicked) {
729 757
    var row        = $(clicked).parents("tbody").first();
730 758
    var input_id   = $(row).find('[name="order.orderitems[].qty_as_number"]').attr('id');
locale/de/all
312 312
  'Apr'                         => 'Apr',
313 313
  'April'                       => 'April',
314 314
  'Ar aging on %s'              => 'Offene Forderungen zum %s',
315
  'Are you sure to update all positions from master data?' => 'Alle Positionen aus den Stammdaten aktualisieren?',
316
  'Are you sure to update this position from master data?' => 'Diese Position aus den Stammdaten aktualisieren?',
315 317
  'Are you sure you want to delete Invoice Number' => 'Soll die Rechnung mit folgender Nummer wirklich gelöscht werden:',
316 318
  'Are you sure you want to delete this letter?' => 'Sind Sie sicher, dass Sie diesen Brief löschen wollen?',
317 319
  '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?',
......
3730 3732
  'Update Prices'               => 'Preise aktualisieren',
3731 3733
  'Update SKR04: new tax account 3804 (19%)' => 'Update SKR04: neues Steuerkonto 3804 (19%) für innergemeinschaftlichen Erwerb',
3732 3734
  'Update customer using billing address' => 'Kunde mit Shop-Rechnungsadresse überschreiben',
3735
  'Update from master data'     => 'Aktualisieren aus Stammdaten',
3733 3736
  'Update prices'               => 'Preise aktualisieren',
3734 3737
  'Update prices of existing entries' => 'Preise von vorhandenen Artikeln aktualisieren',
3735 3738
  'Update prices of existing entries / skip non-existent' => 'Preise von vorhandenen Artikel aktualisieren / Nicht vorhandene überspringen',
locale/en/all
312 312
  'Apr'                         => '',
313 313
  'April'                       => '',
314 314
  'Ar aging on %s'              => '',
315
  'Are you sure to update all positions from master data?' => '',
316
  'Are you sure to update this position from master data?' => '',
315 317
  'Are you sure you want to delete Invoice Number' => '',
316 318
  'Are you sure you want to delete this letter?' => '',
317 319
  'Are you sure you want to remove the marked entries from the queue?' => '',
......
3729 3731
  'Update Prices'               => '',
3730 3732
  'Update SKR04: new tax account 3804 (19%)' => '',
3731 3733
  'Update customer using billing address' => '',
3734
  'Update from master data'     => '',
3732 3735
  'Update prices'               => '',
3733 3736
  'Update prices of existing entries' => '',
3734 3737
  'Update prices of existing entries / skip non-existent' => '',
templates/webpages/order/tabs/_row.html
32 32
                       LxERP.t8("X"),
33 33
                       confirm=LxERP.t8("Are you sure?")) %]
34 34
    </td>
35
    <td align="center">
36
      [%- L.img_tag(src="image/rotate_cw.svg",
37
                    alt=LxERP.t8('Update from master data'),
38
                    title= LxERP.t8('Update from master data'),
39
                    onclick="if (!confirm('" _ LxERP.t8("Are you sure to update this position from master data?") _ "')) return false; kivi.Order.update_row_from_master_data(this);",
40
                    id='update_from_master') %]
41
    </td>
35 42
    <td>
36 43
      <div name="partnumber">[% HTML.escape(ITEM.part.partnumber) %]</div>
37 44
    </td>
templates/webpages/order/tabs/basic_data.html
213 213
                <th class="listheading" nowrap width="3" >[%- 'position'     | $T8 %] </th>
214 214
                <th class="listheading" style='text-align:center' nowrap width="1"><img src="image/updown.png" alt="[%- LxERP.t8('reorder item') %]"></th>
215 215
                <th class="listheading" style='text-align:center' nowrap width="1"><img src="image/close.png" alt="[%- LxERP.t8('delete item') %]"></th>
216
                <th class="listheading" style='text-align:center' nowrap width="1">
217
                  [%- L.img_tag(src="image/rotate_cw.svg",
218
                                alt=LxERP.t8('Update from master data'),
219
                                title= LxERP.t8('Update from master data'),
220
                                onclick="if (!confirm('" _ LxERP.t8("Are you sure to update all positions from master data?") _ "')) return false; kivi.Order.update_all_rows_from_master_data();",
221
                                id='update_from_master') %]
222
                </th>
216 223
                <th id="partnumber_header_id"   class="listheading" nowrap width="15"><a href='#' onClick='javascript:kivi.Order.reorder_items("partnumber")'> [%- 'Partnumber'  | $T8 %]</a></th>
217 224
                [%- IF SELF.search_cvpartnumber -%]
218 225
                <th id="cvpartnumber_header_id" class="listheading" nowrap width="15"><a href='#' onClick='javascript:kivi.Order.reorder_items("cvpartnumber")' > [%- SELF.cv == "customer" ? LxERP.t8('Customer Part Number') : LxERP.t8('Model') %]</a></th>

Auch abrufbar als: Unified diff