diff --git a/.travis.yml b/.travis.yml index 7cfc506c609..2bda2e81053 100644 --- a/.travis.yml +++ b/.travis.yml @@ -85,9 +85,6 @@ before_install: if [ "$TRAVIS_PHP_VERSION" = '7.1' ]; then sudo apt install unzip apache2 php7.1 php7.1-cli php7.1-curl php7.1-mysql php7.1-pgsql php7.1-gd php7.1-imap php7.1-intl php7.1-ldap php7.1-xml php7.1-mbstring php7.1-xml php7.1-zip libapache2-mod-php7.1 fi - if [ "$TRAVIS_PHP_VERSION" = '7.1' ]; then - sudo apt install unzip apache2 php7.1 php7.1-cli php7.1-curl php7.1-mysql php7.1-pgsql php7.1-gd php7.1-imap php7.1-intl php7.1-ldap php7.1-xml php7.1-mbstring php7.1-xml php7.1-zip libapache2-mod-php7.1 - fi if [ "$TRAVIS_PHP_VERSION" = '8.1' ]; then sudo apt install unzip apache2 php8.1 php8.1-cli php8.1-curl php8.1-mysql php8.1-pgsql php8.1-gd php8.1-imap php8.1-intl php8.1-ldap php8.1-xml php8.1-mbstring php8.1-xml php8.1-zip libapache2-mod-php8.1 fi diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index ec83f271881..a1af5aa5897 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1757,9 +1757,12 @@ class Commande extends CommonOrder $this->line_order(true, 'DESC'); } elseif ($ranktouse > 0 && $ranktouse <= count($this->lines)) { // Update all rank of all other lines starting from the same $ranktouse - $linecount = count($this->lines); - for ($ii = $ranktouse; $ii <= $linecount; $ii++) { - $this->updateRangOfLine($this->lines[$ii - 1]->id, $ii + 1); + foreach ($this->lines as $tmpline) { + if ($tmpline->rang >= $ranktouse) { + if (!empty($tmpline->id)) { + $this->updateRangOfLine($tmpline->id, $tmpline->rang + 1); + } + } } } diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index b642a1a3c49..cb4a3bf0637 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -196,6 +196,7 @@ class Facture extends CommonInvoice * @var int id of source invoice if replacement invoice or credit note */ public $fk_facture_source; + public $linked_objects = array(); /** @@ -1305,6 +1306,7 @@ class Facture extends CommonInvoice $object->fk_user_author = $user->id; $object->fk_user_valid = null; $object->fk_facture_source = 0; + $object->fk_fac_rec_source = 0; $object->date_creation = ''; $object->date_modification = ''; $object->date_validation = '';