diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index 881142e22ed..318fc26c662 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -816,7 +816,7 @@ class AccountancyExport /** * Export format : Quadratus (Format ASCII) * Format since 2015 compatible QuadraCOMPTA - * Last review for this format : 2023/01/28 Alexandre Spangaro (aspangaro@open-dsi.fr) + * Last review for this format : 2023/09/16 Alexandre Spangaro (aspangaro@open-dsi.fr) * * Help : https://docplayer.fr/20769649-Fichier-d-entree-ascii-dans-quadracompta.html * In QuadraCompta | Use menu : "Outils" > "Suivi des dossiers" > "Import ASCII(Compta)" @@ -839,10 +839,16 @@ class AccountancyExport foreach ($objectLines as $line) { // Clean some data $line->doc_ref = dol_string_unaccent($line->doc_ref); + + $line->label_operation = str_replace(array("\t", "\n", "\r"), " ", $line->label_operation); + $line->label_operation = str_replace(array("- ", "…", "..."), "", $line->label_operation); $line->label_operation = dol_string_unaccent($line->label_operation); + $line->numero_compte = dol_string_unaccent($line->numero_compte); $line->label_compte = dol_string_unaccent($line->label_compte); $line->subledger_account = dol_string_unaccent($line->subledger_account); + + $line->subledger_label = str_replace(array("- ", "…", "..."), "", $line->subledger_label); $line->subledger_label = dol_string_unaccent($line->subledger_label); $code_compta = $line->numero_compte; @@ -858,11 +864,11 @@ class AccountancyExport $tab['lib_compte'] = str_pad(self::trunc($line->subledger_label, 30), 30); if ($line->doc_type == 'customer_invoice') { - $tab['lib_alpha'] = strtoupper(str_pad('C'.self::trunc(dol_string_unaccent($line->subledger_label), 6), 6)); + $tab['lib_alpha'] = strtoupper(str_pad('C'.self::trunc(dol_string_unaccent($line->subledger_label), 6), 7)); $tab['filler'] = str_repeat(' ', 52); $tab['coll_compte'] = str_pad(self::trunc($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER, 8), 8); } elseif ($line->doc_type == 'supplier_invoice') { - $tab['lib_alpha'] = strtoupper(str_pad('F'.self::trunc(dol_string_unaccent($line->subledger_label), 6), 6)); + $tab['lib_alpha'] = strtoupper(str_pad('F'.self::trunc(dol_string_unaccent($line->subledger_label), 6), 7)); $tab['filler'] = str_repeat(' ', 52); $tab['coll_compte'] = str_pad(self::trunc($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER, 8), 8); } else { diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index e7dfdd4128b..b4fe96fee59 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -792,7 +792,8 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''.$form->editfieldkey('PhonePerso', 'phone_perso', '', $object, 0).''; print ''; print img_picto('', 'object_phoning', 'class="pictofixedwidth"'); - print ''; + print ''; + print ''; print ''.$form->editfieldkey('PhoneMobile', 'phone_mobile', '', $object, 0).''; print ''; @@ -1055,6 +1056,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; print img_picto('', 'object_phoning', 'class="pictofixedwidth"'); print ''; + if ($conf->browser->layout == 'phone') { + print ''; + } print ''.$form->editfieldkey('PhonePerso', 'fax', GETPOST('phone_perso', 'alpha'), $object, 0).''; print ''; print img_picto('', 'object_phoning', 'class="pictofixedwidth"'); @@ -1064,6 +1068,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; print img_picto('', 'object_phoning_mobile', 'class="pictofixedwidth"'); print ''; + if ($conf->browser->layout == 'phone') { + print ''; + } print ''.$form->editfieldkey('Fax', 'fax', GETPOST('fax', 'alpha'), $object, 0).''; print ''; print img_picto('', 'object_phoning_fax', 'class="pictofixedwidth"'); @@ -1127,10 +1134,10 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Visibility print ''; $selectarray = array('0'=>$langs->trans("ContactPublic"), '1'=>$langs->trans("ContactPrivate")); - print $form->selectarray('priv', $selectarray, $object->priv, 0); + print $form->selectarray('priv', $selectarray, $object->priv, 0, 0, 0,'', 0, 0, 0, '', 'maxwidth150'); print ''; - //Default language + // Default language if (getDolGlobalInt('MAIN_MULTILANGS')) { print ''.$form->editfieldkey('DefaultLang', 'default_lang', '', $object, 0).''."\n"; print img_picto('', 'language', 'class="pictofixedwidth"').$formadmin->select_language(GETPOST('default_lang', 'alpha') ? GETPOST('default_lang', 'alpha') : ($object->default_lang ? $object->default_lang : ''), 'default_lang', 0, 0, 1, 0, 0, 'maxwidth200onsmartphone'); @@ -1239,7 +1246,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if ($maxmin > 0) { print ''; // MAX_FILE_SIZE must precede the field type=file } - print ''; + print ''; print ''; print ''; diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 8ec4fd2c006..b71418b8645 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -1709,6 +1709,7 @@ class Contact extends CommonObject // Desactive utilisateur $sql = "UPDATE ".MAIN_DB_PREFIX."socpeople"; $sql .= " SET statut = ".((int) $this->statut); + $sql .= ", fk_user_modif = ".((int) $user->id); $sql .= " WHERE rowid = ".((int) $this->id); $result = $this->db->query($sql); diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index a684f223812..4863dcbdc09 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -397,7 +397,7 @@ class modSociete extends DolibarrModules 'c.statut'=>"Status", 's.rowid'=>"Numeric", 's.nom'=>"Text", 's.status'=>"Status", 's.code_client'=>"Text", 's.code_fournisseur'=>"Text", 's.code_compta'=>"Text", 's.code_compta_fournisseur'=>"Text", - 's.client'=>"Text", 's.fournisseur'=>"Text", + 's.client'=>"Numeric", 's.fournisseur'=>"Numeric", 's.address'=>"Text", 's.zip'=>"Text", 's.town'=>"Text", 's.phone'=>"Text", 's.email'=>"Text", 't.code'=>"List:c_stcomm:libelle:code", 'c.entity'=>'List:entity:label:rowid', diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 3b9285d7f22..09db6230674 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -4114,10 +4114,17 @@ class CommandeFournisseurLigne extends CommonOrderLine return -1; } - $sql = 'DELETE FROM '.MAIN_DB_PREFIX."commande_fournisseurdet WHERE rowid=".((int) $this->id); + $sql1 = 'UPDATE '.MAIN_DB_PREFIX."commandedet SET fk_commandefourndet = NULL WHERE rowid=".((int) $this->id); + $resql = $this->db->query($sql1); + if (!$resql) { + $this->db->rollback(); + return -1; + } + + $sql2 = 'DELETE FROM '.MAIN_DB_PREFIX."commande_fournisseurdet WHERE rowid=".((int) $this->id); dol_syslog(__METHOD__, LOG_DEBUG); - $resql = $this->db->query($sql); + $resql = $this->db->query($sql2); if ($resql) { if (!$notrigger) { // Call trigger diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 22599d9eaba..55a7e606110 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -365,6 +365,7 @@ if (empty($reshook)) { $validate_invoices = GETPOST('validate_invoices', 'int'); $TFact = array(); + /** @var FactureFournisseur[] $TFactThird */ $TFactThird = array(); $nb_bills_created = 0; @@ -383,7 +384,7 @@ if (empty($reshook)) { $objecttmp = new FactureFournisseur($db); if (!empty($createbills_onebythird) && !empty($TFactThird[$cmd->socid])) { - $objecttmp = $TFactThird[$cmd->socid]; // If option "one bill per third" is set, we use already created order. + $objecttmp = $TFactThird[$cmd->socid]; // If option "one bill per third" is set, we use already created supplier invoice. } else { // Search if the VAT reverse-charge is activated by default in supplier card to resume the information if (!empty($cmd->socid) > 0) { @@ -514,7 +515,8 @@ if (empty($reshook)) { false, $lines[$i]->array_options, $lines[$i]->fk_unit, - $objecttmp->origin_id, + // we use the id of each order, not the id of the first one stored in $objecttmp->origin_id + $lines[$i]->fk_commande, $lines[$i]->pa_ht, $lines[$i]->ref_supplier, $lines[$i]->special_code,