def build_items
      @pdf.move_down(23 + @push_items_table + @push_down)

      items_params = determine_items_structure
      items = build_items_data(items_params)
      headers = build_items_header(items_params)

      styles = {
        headers: headers,
        row_colors: ['F5F5F5', nil],
        width: x(540, 2),
        align: {
          0 => :left,
          1 => :right,
          2 => :right,
          3 => :right,
          4 => :right,
          5 => :right,
          6 => :right,
          7 => :right,
          8 => :right
        },
        font_size: 10
      }

      @pdf.table(items, styles) unless items.empty?
    end
def build_items
      @pdf.move_down(23 + @push_items_table + @push_down)

      items_params = determine_items_structure
      items = build_items_data(items_params)
      headers = build_items_header(items_params)

      styles = {
        headers: headers,
        row_colors: ['F5F5F5', nil],
        width: x(540, 2),
        align: {
          0 => :left,
          1 => :right,
          2 => :right,
          3 => :right,
          4 => :right,
          5 => :right,
          6 => :right,
          7 => :right,
          8 => :right
        },
        font_size: 10
      }

      @pdf.table(items, styles) unless items.empty?
    end
Build the following table for document items:

   =================================================================
   |Item |  Quantity|  Unit|  Price per item|  Tax|  Total per item|
   |-----|----------|------|----------------|-----|----------------|
   |x    |         2|    hr|              $2|   $1|              $4|
   =================================================================

 variable (2nd position), tax2 and tax3 (after tax) fields can be added
 as well if necessary. variable does not come with any default label.
 If a specific column miss data, it's omittted.

 Using sublabels one can change the table to look as:

   =================================================================
   |Item |  Quantity|  Unit|  Price per item|  Tax|  Total per item|
   |it.  |      nom.|   un.|            ppi.|   t.|            tpi.|
   |-----|----------|------|----------------|-----|----------------|
   |x    |         2|    hr|              $2|   $1|              $4|
   =================================================================