Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 4cef82ae

Von Bernd Bleßmann vor etwa 2 Jahren hinzugefügt

  • ID 4cef82ae0b71cabe9fccc1f3f16de0a9572fb56f
  • Vorgänger 6f01c56f
  • Nachfolger 8a0c3bd1

Lieferschein-Controller: js: benannte Parameter für save und show_print_options

Unterschiede anzeigen:

SL/Controller/DeliveryOrder.pm
1803 1803
      combobox => [
1804 1804
        action => [
1805 1805
          t8('Save'),
1806
          call     => [ 'kivi.DeliveryOrder.save', 'save', $::instance_conf->get_order_warn_duplicate_parts,
1807
                                                           $::instance_conf->get_order_warn_no_deliverydate,
1806
          call     => [ 'kivi.DeliveryOrder.save', { action             => 'save',
1807
                                                     warn_on_duplicates => $::instance_conf->get_order_warn_duplicate_parts,
1808
                                                     warn_on_reqdate    => $::instance_conf->get_order_warn_no_deliverydate },
1808 1809
          ],
1809 1810
          disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.') : undef,
1810 1811
        ],
1811 1812
        action => [
1812 1813
          t8('Save as new'),
1813
          call     => [ 'kivi.DeliveryOrder.save', 'save_as_new', $::instance_conf->get_order_warn_duplicate_parts ],
1814
          call     => [ 'kivi.DeliveryOrder.save', { action             => 'save_as_new',
1815
                                                     warn_on_duplicates => $::instance_conf->get_order_warn_duplicate_parts },
1816
          ],
1814 1817
          disabled => !$may_edit_create                        ? t8('You do not have the permissions to access this function.')
1815 1818
                    : $self->type eq 'supplier_delivery_order' ? t8('Need a workflow for Supplier Delivery Order')
1816 1819
                    : !$self->order->id                        ? t8('This object has not been saved yet.')
......
1848 1851
        ],
1849 1852
        action => [
1850 1853
          t8('Save and Delivery Order'),
1851
          call     => [ 'kivi.DeliveryOrder.save', 'save_and_delivery_order', $::instance_conf->get_order_warn_duplicate_parts,
1852
                                                                              $::instance_conf->get_order_warn_no_deliverydate,
1854
          call     => [ 'kivi.DeliveryOrder.save', { action             => 'save_and_delivery_order',
1855
                                                     warn_on_duplicates => $::instance_conf->get_order_warn_duplicate_parts,
1856
                                                     warn_on_reqdate    => $::instance_conf->get_order_warn_no_deliverydate },
1853 1857
          ],
1854 1858
          only_if  => $self->type_data->show_menu("save_and_delivery_order"),
1855 1859
          disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.') : undef,
1856 1860
        ],
1857 1861
        action => [
1858 1862
          t8('Save and Invoice'),
1859
          call     => [ 'kivi.DeliveryOrder.save', 'save_and_invoice', $::instance_conf->get_order_warn_duplicate_parts ],
1863
          call     => [ 'kivi.DeliveryOrder.save', { action             => 'save_and_invoice',
1864
                                                     warn_on_duplicates => $::instance_conf->get_order_warn_duplicate_parts },
1865
          ],
1860 1866
          only_if  => $self->type_data->show_menu("save_and_invoice"),
1861 1867
          disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.') : undef,
1862 1868
        ],
1863 1869
        action => [
1864 1870
          t8('Save and AP Transaction'),
1865
          call     => [ 'kivi.DeliveryOrder.save', 'save_and_ap_transaction', $::instance_conf->get_order_warn_duplicate_parts ],
1871
          call     => [ 'kivi.DeliveryOrder.save', { action             => 'save_and_ap_transaction',
1872
                                                     warn_on_duplicates => $::instance_conf->get_order_warn_duplicate_parts },
1873
          ],
1866 1874
          only_if  => $self->type_data->show_menu("save_and_ap_transaction"),
1867 1875
          disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.') : undef,
1868 1876
        ],
......
1875 1883
        ],
1876 1884
        action => [
1877 1885
          t8('Save and preview PDF'),
1878
           call    => [ 'kivi.DeliveryOrder.save', 'preview_pdf', $::instance_conf->get_order_warn_duplicate_parts,
1879
                                                                  $::instance_conf->get_order_warn_no_deliverydate,
1886
           call    => [ 'kivi.DeliveryOrder.save', { action             => 'preview_pdf',
1887
                                                     warn_on_duplicates => $::instance_conf->get_order_warn_duplicate_parts,
1888
                                                     warn_on_reqdate    => $::instance_conf->get_order_warn_no_deliverydate },
1880 1889
          ],
1881 1890
          disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.') : undef,
1882 1891
        ],
1883 1892
        action => [
1884 1893
          t8('Save and print'),
1885
          call     => [ 'kivi.DeliveryOrder.show_print_options', $::instance_conf->get_order_warn_duplicate_parts,
1886
                                                                 $::instance_conf->get_order_warn_no_deliverydate,
1894
          call     => [ 'kivi.DeliveryOrder.show_print_options', { warn_on_duplicates => $::instance_conf->get_order_warn_duplicate_parts,
1895
                                                                   warn_on_reqdate    => $::instance_conf->get_order_warn_no_deliverydate },
1887 1896
          ],
1888 1897
          disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.') : undef,
1889 1898
        ],
1890 1899
        action => [
1891 1900
          t8('Save and E-mail'),
1892 1901
          id       => 'save_and_email_action',
1893
          call     => [ 'kivi.DeliveryOrder.save', 'save_and_show_email_dialog', $::instance_conf->get_order_warn_duplicate_parts,
1894
                                                                                 $::instance_conf->get_order_warn_no_deliverydate,
1902
          call     => [ 'kivi.DeliveryOrder.save', { action             => 'save_and_show_email_dialog',
1903
                                                     warn_on_duplicates => $::instance_conf->get_order_warn_duplicate_parts,
1904
                                                     warn_on_reqdate    => $::instance_conf->get_order_warn_no_deliverydate },
1895 1905
          ],
1896 1906
          disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.')
1897 1907
                    : !$self->order->id ? t8('This object has not been saved yet.')
......
1923 1933
        action => [
1924 1934
          t8('Transfer out'),
1925 1935
          id       => 'transfer_out_action',
1926
          call     => [ 'kivi.DeliveryOrder.save', 'transfer_stock' ],
1936
          call     => [ 'kivi.DeliveryOrder.save', { action => 'transfer_stock' } ],
1927 1937
          disabled => !$may_edit_create       ? t8('You do not have the permissions to access this function.')
1928 1938
                    : !$self->order->id       ? t8('This object has not been saved yet.')
1929 1939
                    : $self->order->delivered ? t8('The parts for this order have already been transferred')
......
1934 1944
        action => [
1935 1945
          t8('Transfer in'),
1936 1946
          id       => 'transfer_in_action',
1937
          call     => [ 'kivi.DeliveryOrder.save', 'transfer_stock' ],
1947
          call     => [ 'kivi.DeliveryOrder.save', { action => 'transfer_stock' } ],
1938 1948
          disabled => !$may_edit_create       ? t8('You do not have the permissions to access this function.')
1939 1949
                    : !$self->order->id       ? t8('This object has not been saved yet.')
1940 1950
                    : $self->order->delivered ? t8('The parts for this order have already been transferred')
js/kivi.DeliveryOrder.js
45 45
    }
46 46
  };
47 47

  
48
  ns.save = function(action, warn_on_duplicates, warn_on_reqdate) {
48
  ns.save = function(params) {
49 49
    if (!ns.check_cv()) return;
50

  
51
    const action             = params.action;
52
    const warn_on_duplicates = params.warn_on_duplicates;
53
    const warn_on_reqdate    = params.warn_on_reqdate;
54

  
50 55
    if (warn_on_duplicates && !ns.check_duplicate_parts()) return;
51 56
    if (warn_on_reqdate    && !ns.check_valid_reqdate())   return;
52 57

  
......
63 68
    $.post("controller.pl", data, kivi.eval_json_result);
64 69
  };
65 70

  
66
  ns.show_print_options = function(warn_on_duplicates, warn_on_reqdate) {
71
  ns.show_print_options = function(params) {
67 72
    if (!ns.check_cv()) return;
73

  
74
    const warn_on_duplicates = params.warn_on_duplicates;
75
    const warn_on_reqdate    = params.warn_on_reqdate;
76

  
68 77
    if (warn_on_duplicates && !ns.check_duplicate_parts(kivi.t8("Do you really want to print?"))) return;
69 78
    if (warn_on_reqdate    && !ns.check_valid_reqdate())   return;
70 79

  

Auch abrufbar als: Unified diff