Regular line item (charges)
198095
public static boolean isCharge(final InvoiceItem invoiceItem) {
        return InvoiceItemType.TAX.equals(invoiceItem.getInvoiceItemType()) ||
               InvoiceItemType.EXTERNAL_CHARGE.equals(invoiceItem.getInvoiceItemType()) ||
               InvoiceItemType.FIXED.equals(invoiceItem.getInvoiceItemType()) ||
               InvoiceItemType.USAGE.equals(invoiceItem.getInvoiceItemType()) ||
               InvoiceItemType.RECURRING.equals(invoiceItem.getInvoiceItemType());
    }
463821
function ItemsItem() {
    /**
     * The id value
     * @member
     */
    this.id = null;
    /**
     * The sku value
     * @member
     */
    this.sku = null;
    /**
     * The title value
     * @member
     */
    this.title = null;
    /**
     * The quantity value
     * @member
     */
    this.quantity = null;
    /**
     * The price value
     * @member
     */
    this.price = null;
    /**
     * The formattedPrice value
     * @member
     */
    this.formattedPrice = null;
    /**
     * The currency value
     * @member
     */
    this.currency = null;
    /**
     * The productLink value
     * @member
     */
    this.productLink = null;
    /**
     * The weight value
     * @member
     */
    this.weight = null;
    /**
     * The formattedWeight value
     * @member
     */
    this.formattedWeight = null;
    /**
     * The media of value
     * @member
     * @type { Media }
     */
    this.media = Object.create(Media.prototype);

}
944112
function item() {
      global $order, $db;

      $this->code = 'item';
      $this->title = MODULE_SHIPPING_ITEM_TEXT_TITLE;
      $this->description = MODULE_SHIPPING_ITEM_TEXT_DESCRIPTION;
      $this->sort_order = MODULE_SHIPPING_ITEM_SORT_ORDER;
      $this->icon = '';
      $this->tax_class = MODULE_SHIPPING_ITEM_TAX_CLASS;
      $this->tax_basis = MODULE_SHIPPING_ITEM_TAX_BASIS;

      // disable only when entire cart is free shipping
      if (zen_get_shipping_enabled($this->code)) {
        $this->enabled = ((MODULE_SHIPPING_ITEM_STATUS == 'True') ? true : false);
      }

      if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_ITEM_ZONE > 0) ) {
        $check_flag = false;
        $check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_ITEM_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
        while (!$check->EOF) {
          if ($check->fields['zone_id'] < 1) {
            $check_flag = true;
            break;
          } elseif ($check->fields['zone_id'] == $order->delivery['zone_id']) {
            $check_flag = true;
            break;
          }
		  $check->MoveNext();
        }

        if ($check_flag == false) {
          $this->enabled = false;
        }
      }
    }
1105139
def items(self):
        ''' 
        '''
        if type(self.transaction['items']['item']) == list:
            return self.transaction['items']['item']
        else:
            return [self.transaction['items']['item'],]
1059407
static String chargeAdjunctText(final int charge, final int unpaired) {
        StringBuilder sb = new StringBuilder();

        if (unpaired == 1) {
            if (charge != 0) {
                sb.append('(').append(BULLET).append(')');
            } else {
                sb.append(BULLET);
            }
        } else if (unpaired > 1) {
            if (charge != 0) {
                sb.append('(').append(unpaired).append(BULLET).append(')');
            } else {
                sb.append(unpaired).append(BULLET);
            }
        }

        final char sign = charge < 0 ? MINUS : PLUS;
        final int coefficient = Math.abs(charge);

        if (coefficient > 1) sb.append(coefficient);
        if (coefficient > 0) sb.append(sign);

        return sb.toString();
    }
27096
def wrap(self, value):
        ''' 
        '''
        self.validate_wrap(value)
        return self.item_type.wrap(value)
1226616
def status_charge():
    '''
    
    '''
    data = status()
    if 'BCHARGE' in data:
        charge = data['BCHARGE'].split()
        if charge[1].lower() == 'percent':
            return float(charge[0])

    return {'Error': 'Load not available.'}
1368571
function normalListItem(ctx, value, position) {
  var offsets = ctx.offset
  var line = position.line
  var max
  var bullet
  var rest
  var lines
  var trimmedLines
  var index
  var length

  // Remove the list-item’s bullet.
  value = value.replace(bulletExpression, replacer)

  lines = value.split(lineFeed)

  trimmedLines = removeIndent(value, getIndent(max).indent).split(lineFeed)

  // We replaced the initial bullet with something else above, which was used
  // to trick `removeIndentation` into removing some more characters when
  // possible.  However, that could result in the initial line to be stripped
  // more than it should be.
  trimmedLines[0] = rest

  offsets[line] = (offsets[line] || 0) + bullet.length
  line++

  index = 0
  length = lines.length

  while (++index < length) {
    offsets[line] =
      (offsets[line] || 0) + lines[index].length - trimmedLines[index].length
    line++
  }

  return trimmedLines.join(lineFeed)

  function replacer($0, $1, $2, $3, $4) {
    bullet = $1 + $2 + $3
    rest = $4

    // Make sure that the first nine numbered list items can indent with an
    // extra space.  That is, when the bullet did not receive an extra final
    // space.
    if (Number($2) < 10 && bullet.length % 2 === 1) {
      $2 = space + $2
    }

    max = $1 + repeat(space, $2.length) + $3

    return max + rest
  }
}
1350082
public function getLineItemTotal()
    {
        $amount = 0;

        foreach ($this->getLineItems() as $lineItem)
        {
            $amount += ($lineItem->getPrice()*$lineItem->getQuantity());
        }

        return $amount;
    }
1068837
def getTotal(self):
        
        total = 0
        for lineitem in self.supplyorder_lineitems:
            total += Decimal(lineitem['Quantity']) * \
                     Decimal(lineitem['Price']) *  \
                     ((Decimal(lineitem['VAT']) /100) + 1)
        return total
900440
def line_amount
      total = quantity * unit_amount
      total = total * (1 - (discount_rate / BigDecimal(100))) if discount_rate
      total
    end
983184
function Payment() {
    /**
     * The total value
     * @member
     */
    this.total = null;
    /**
     * The subtotal value
     * @member
     */
    this.subtotal = null;
    /**
     * The formattedTotal value
     * @member
     */
    this.formattedTotal = null;
    /**
     * The formattedSubtotal value
     * @member
     */
    this.formattedSubtotal = null;
    /**
     * The currency value
     * @member
     */
    this.currency = null;
    /**
     * The coupon of value
     * @member
     * @type { Coupon }
     */
    this.coupon = Object.create(Coupon.prototype);
    /**
     * The tax of value
     * @member
     * @type { Tax }
     */
    this.tax = Object.create(Tax.prototype);
    /**
     * The shipping of value
     * @member
     * @type { Shipping }
     */
    this.shipping = Object.create(Shipping.prototype);

}
1154230
def list_line(self, line):
        
        
        if len(line) == 0:
            return
        
        self.stream.write(str(line[0]))
        
        for item in line[1:]:
            self.stream.write("\t")
            self.stream.write(str(item))
        
        self.stream.write("\n")
1130024
def allowance(self, filename):
        """"""
        for line in self.rulelines:
            if line.applies_to(filename):
                return line.allowance
        return True
476925
def post(self, amount, other_account, description, self_memo="", other_memo="", datetime=None):
        

        #Note: debits are always positive, credits are always negative.  They should be negated before displaying
        #(expense and liability?) accounts
        tx = self._new_transaction()

        if datetime:
            tx.t_stamp = datetime
        #else now()

        tx.description = description
        tx.save()

        a1 = self._make_ae(self._DEBIT_IN_DB() * amount, self_memo, tx)
        a1.save()
        a2 = other_account._make_ae(-self._DEBIT_IN_DB() * amount, other_memo, tx)
        a2.save()

        return (a1, a2)
385232
def lmean (inlist):
    
    sum = 0
    for item in inlist:
        sum = sum + item
    return sum/float(len(inlist))
137093
def line_items
      if line_items_downloaded?
        @line_items

      # There is an credit_note_is so we can assume this record was loaded from Xero.
      # attempt to download the line_item records.
      elsif credit_note_id =~ GUID_REGEX
        raise NoGatewayError unless @gateway

        response = @gateway.get_credit_note(credit_note_id)
        raise CreditNoteNotFoundError, "CreditNote with ID #{credit_note_id} not found in Xero." unless response.success? && response.credit_note.is_a?(XeroGateway::CreditNote)

        @line_items = response.credit_note.line_items
        @line_items_downloaded = true

        @line_items

      # Otherwise, this is a new credit_note, so return the line_items reference.
      else
        @line_items
      end
    end