code: protected function buildDiscountsLines(Document\DocumentInterface $document)
      {
          $sale = $document->getSale();
  
          if (!$sale->hasAdjustments(Common\AdjustmentTypes::TYPE_DISCOUNT)) {
              return;
          }
  
          $adjustments = $sale->getAdjustments();
          foreach ($adjustments as $adjustment) {
              if ($adjustment->getType() === Common\AdjustmentTypes::TYPE_DISCOUNT) {
                  $this->buildDiscountLine($adjustment, $document);
              }
          }
      }
docs: Builds the document's discounts lines.
  
  @param Document\DocumentInterface $document