<html>
    <head>
      <base href="https://bugs.documentfoundation.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_UNCONFIRMED "
   title="UNCONFIRMED - Meaning of last VDB function argument ("Type") inverted in help tip, LO help and variable name"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=113768">113768</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Meaning of last VDB function argument ("Type") inverted in help tip, LO help and variable name
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>LibreOffice
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>Inherited From OOo
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>UNCONFIRMED
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Calc
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>libreoffice-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>klasse@partyheld.de
          </td>
        </tr></table>
      <p>
        <div>
        <pre>According to the requirement in [1] (ODF 1.2), the meaning of the last argument
of Calc's VDB function is:
<span class="quote">> noSwitch is an optional argument that you include if you do not want VDB to
> switch to straight-line depreciation for the remaining useful life.
> Normally, declining-balance switches to such a straight-line calculation
> when it is greater than the declining-balance calculation.</span >

<span class="quote">> If noSwitch is FALSE() or omitted, VDB automatically switches to straight-
> line depreciation when that is greater than declining-balance depreciation.
> If noSwitch is TRUE(), VDB never switches to straight-line depreciation.</span >


Current situation:
------------------
That last argument currently has the following description in LO:

I) In the help tip on entering the VDB function in a cell in Calc (with cursor
on the last function argument):
<span class="quote">> Do not alter. Type = 1 denotes switch to linear depreciation, type = 0 do
> not switch.</span >

II) In LO help ([2])
<span class="quote">> Type = 1 means a switch to linear depreciation. In Type = 0 no switch is
> made.</span >

III) In LO code:
- bType variable name in [4]
- nType variable name in [5]

The issue is that in the above cases I and II, the description of the argument
is the opposite to the requirement. Although the logic seems to be implemented
correctly in the code with respect to the values 0 (false) and 1 (true).


Proposal:
---------
For the cases I (help tip) and II (LO help) above:
- Correct the tip and the help content according to the requirement. (I.e.,
invert the meaning of the content.)
- Change the name of the argument from "Type" to "No_switch", as, e.g., in MS
Office (see [2]). Which is close to name in the requirement.

For the case III above, as alignment:
- Rename the variables to bNoSwitch and nNoSwitch respectively


References:
-----------
[1]
<a href="http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part2.html#__RefHeading__1018330_715980110">http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part2.html#__RefHeading__1018330_715980110</a>
[2]
<a href="https://support.office.com/en-us/article/VDB-function-dde4e207-f3fa-488d-91d2-66d55e861d73">https://support.office.com/en-us/article/VDB-function-dde4e207-f3fa-488d-91d2-66d55e861d73</a>
[3] <a href="https://help.libreoffice.org/Calc/Financial_Functions_Part_Three#VDB">https://help.libreoffice.org/Calc/Financial_Functions_Part_Three#VDB</a>

[4]
<a href="https://gerrit.libreoffice.org/gitweb?p=core.git;a=blob;f=sc/source/core/tool/interpr2.cxx;h=d4c27a4d0fd5ccf73a1f81b46a0155b1135dd17e;hb=HEAD#l1798">https://gerrit.libreoffice.org/gitweb?p=core.git;a=blob;f=sc/source/core/tool/interpr2.cxx;h=d4c27a4d0fd5ccf73a1f81b46a0155b1135dd17e;hb=HEAD#l1798</a>
[5]
<a href="https://gerrit.libreoffice.org/gitweb?p=core.git;a=blob;f=sc/source/core/opencl/opinlinefun_finacial.cxx;h=38eb41db02db218f56b13630670b29c59c40567b;hb=HEAD#l1535">https://gerrit.libreoffice.org/gitweb?p=core.git;a=blob;f=sc/source/core/opencl/opinlinefun_finacial.cxx;h=38eb41db02db218f56b13630670b29c59c40567b;hb=HEAD#l1535</a>


Correctness of the implemented logic tested on:
-----------------------------------------------
Version: 5.3.7.2
Build ID: 1:5.3.7~rc2-0ubuntu0.17.04.1~lo0
CPU Threads: 4; OS Version: Linux 4.10; UI Render: default; VCL: gtk3; Layout
Engine: new; 
Locale: de-DE (en_US.UTF-8); Calc: group

Version 5.3.6.1 Portable on Win10 64-bit

And compared to MS Excel 2016</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>