$error++;
                 }
                 $ii++;
             }
         } else {
             $mesgs[] = $object->error;
             $error++;
         }
     }
 }
 // End of object creation, we show it
 if ($id > 0 && !$error) {
     foreach ($orders_id as $fk_supplier_order) {
         $supplier_order = new CommandeFournisseur($db);
         if ($supplier_order->fetch($fk_supplier_order) > 0 && $supplier_order->statut == 5) {
             if ($supplier_order->classifyBilled() < 0) {
                 $db->rollback();
                 $action = 'create';
                 $_GET["origin"] = $_POST["origin"];
                 $_GET["originid"] = $_POST["originid"];
                 $mesgs[] = '<div class="error">' . $object->error . '</div>';
                 $error++;
                 break;
             }
         }
     }
     if (!$error) {
         $db->commit();
         header('Location: ' . DOL_URL_ROOT . '/fourn/facture/card.php?facid=' . $id);
         exit;
     }