Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 995ea08d

Von Sven Schöling vor fast 3 Jahren hinzugefügt

  • ID 995ea08d955a6200513ec86366271975949e44e7
  • Vorgänger 5c797879
  • Nachfolger 330c2119

DeliveryOrder: price_source feature entfernt

Unterschiede anzeigen:

js/kivi.DeliveryOrder.js
516 516
    $.post("controller.pl", data, kivi.eval_json_result);
517 517
  };
518 518

  
519
  ns.update_price_source = function(item_id, source, descr, price_str, price_editable) {
520
    var row        = $('#item_' + item_id).parents("tbody").first();
521
    var source_elt = $(row).find('[name="order.orderitems[].active_price_source"]');
522
    var button_elt = $(row).find('[name="price_chooser_button"]');
523

  
524
    button_elt.val(button_elt.val().replace(/.*\|/, descr + " |"));
525
    source_elt.val(source);
526

  
527
    var editable_div_elt     = $(row).find('[name="editable_price"]');
528
    var not_editable_div_elt = $(row).find('[name="not_editable_price"]');
529
    if (price_editable == 1 && source === '') {
530
      // editable
531
      $(editable_div_elt).show();
532
      $(not_editable_div_elt).hide();
533
      $(editable_div_elt).find(':input').prop("disabled", false);
534
      $(not_editable_div_elt).find(':input').prop("disabled", true);
535
    } else {
536
      // not editable
537
      $(editable_div_elt).hide();
538
      $(not_editable_div_elt).show();
539
      $(editable_div_elt).find(':input').prop("disabled", true);
540
      $(not_editable_div_elt).find(':input').prop("disabled", false);
541
    }
542

  
543
    if (price_str) {
544
      var price_elt = $(row).find('[name="order.orderitems[].sellprice_as_number"]');
545
      var html_elt  = $(row).find('[name="sellprice_text"]');
546
      price_elt.val(price_str);
547
      html_elt.html(price_str);
548
    }
549

  
550
    kivi.io.close_dialog();
551
  };
552

  
553
  ns.update_discount_source = function(item_id, source, descr, discount_str, price_editable) {
554
    var row        = $('#item_' + item_id).parents("tbody").first();
555
    var source_elt = $(row).find('[name="order.orderitems[].active_discount_source"]');
556
    var button_elt = $(row).find('[name="price_chooser_button"]');
557

  
558
    button_elt.val(button_elt.val().replace(/\|.*/, "| " + descr));
559
    source_elt.val(source);
560

  
561
    var editable_div_elt     = $(row).find('[name="editable_discount"]');
562
    var not_editable_div_elt = $(row).find('[name="not_editable_discount"]');
563
    if (price_editable == 1 && source === '') {
564
      // editable
565
      $(editable_div_elt).show();
566
      $(not_editable_div_elt).hide();
567
      $(editable_div_elt).find(':input').prop("disabled", false);
568
      $(not_editable_div_elt).find(':input').prop("disabled", true);
569
    } else {
570
      // not editable
571
      $(editable_div_elt).hide();
572
      $(not_editable_div_elt).show();
573
      $(editable_div_elt).find(':input').prop("disabled", true);
574
      $(not_editable_div_elt).find(':input').prop("disabled", false);
575
    }
576

  
577
    if (discount_str) {
578
      var discount_elt = $(row).find('[name="order.orderitems[].discount_as_percent"]');
579
      var html_elt     = $(row).find('[name="discount_text"]');
580
      discount_elt.val(discount_str);
581
      html_elt.html(discount_str);
582
    }
583

  
584
    kivi.io.close_dialog();
585
  };
586

  
587 519
  ns.show_vc_details_dialog = function() {
588 520
    if (!ns.check_cv()) return;
589 521
    var vc;

Auch abrufbar als: Unified diff