ユーザーは日本語で、指定されたPython関数のバグ修正を求めている。回答はimportを含まない関数定義だけ。外部ライブラリ、入出力、ファイル操作は不要。仕様: rowsは辞書の配列。statusがactiveの行だけで、整数のunit_yenとquantityとdiscount_percentから、各行ごとに unit_yen*quantity*(100-discount_percent)//100 を計算して合算する。最後に送料shipping_yenを加え、その合計に税率10%を掛け小数点以下を切り捨てた税を加える。負数は入力されない。大きな整数でも丸め誤差を起こさない。空配列でも送料とその税を計算する。入力を変更しない。

現在の関数:
def invoice_total(rows, shipping_yen):
    subtotal = 0
    for row in rows:
        subtotal += round(row['unit_yen'] * row['quantity'] * (1-row['discount_percent']/100))
    return round(subtotal*1.1)+shipping_yen

バグ: status activeだけにする必要、整数演算 //100 を使う必要、送料加算後に税10%を切り捨てて加える必要、float丸め誤差回避、空配列でも送料と税を計算。入力を変更しない（rowsをソートや削除しない）。

修正案:
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

税率10%を掛け小数点以下を切り捨てた税を加える: total * 10 // 100 は整数で切り捨て。負数なしなので問題ない。大きな整数でも丸め誤差なし。空配列なら subtotal=0, total=shipping_yen, return shipping_yen + shipping_yen*10//100。

回答形式: importを含まない関数定義だけ。コードブロックだけ？「回答はimportを含まない関数定義だけ」なので、関数定義のみを出力する。余計な説明はしない。

最終は:
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

これで十分。
