We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1828
    • 137 Posts
    I have an "invoice" template (with a bunch of TVs) and a "product" template (with 2 TVs).

    I am now just trying to set up the invoice items part of the invoice template. I have created an "InvoiceProducts" TV that enables selection of one or more product docs and outputs them as a comma delimited list of doc IDs. What I want to do is generate the invoice items summary within the invoice by feeding the output of of the InvoiceProducts TV into a ditto call (along with a suitable invoice items template).

    In other words, I want to pass a list of doc IDs to ditto in such a way that it only summarises docs in that list.

    Can anyone please help clarify the ditto call to do this?

    Thanks,
    Anton
      • 1828
      • 137 Posts
      Question answered:

      &filter=`[*InvProducts*],[+id+],1`


      Well, that was a quick resolution! cool
        • 18397
        • 3,250 Posts
        In Ditto 1.1b2 or later you can do &documents=`[*InvProducts*]`
          • 1828
          • 137 Posts
          OK, I spoke too soon. My original attempt above does not restrict ditto to the doc IDs supplied by [*InvProducts*]. Instead, it just displays all docs under the given start IDs.

          Mark: Re your suggestion: &documents=`[*InvProducts*]`

          I tried this but got a SQL error. The same thing happens when I manually enter a few comma delimited doc IDs into the "&documents=``" parameter as a test. I notice that there are no IDs being passed to the IN clause of the SQL query. I.e., it reads something like this: "WHERE sc.id IN ()".

          Any ideas?

          Thanks,
          Anton
            • 1828
            • 137 Posts
            OK; resolved this issue (in Ditto 1.1 Beta 2) as follows:

            Changed line 402 in ditto.class.inc.php from this:

            $kids = explode(',',$seedArray);


            to this:

            $kids = $seeds;


            Please feel free to merge this into the 1.1 Beta 2 thread. smiley

            Anton