

def invoice_total(rows, shipping_yen):
    subtotal = 0
    for row in rows:
        if row.get('status') == 'active':
            subtotal += row['unit_yen'] * row['quantity'] * (100 - row['discount_percent']) // 100
    total = subtotal + shipping_yen
    return total + total * 10 // 100