Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
fa34a91873
6 changed files with 35 additions and 12 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -792,7 +792,8 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||
print '<td>'.$form->editfieldkey('PhonePerso', 'phone_perso', '', $object, 0).'</td>';
|
||||
print '<td>';
|
||||
print img_picto('', 'object_phoning', 'class="pictofixedwidth"');
|
||||
print '<input type="text" name="phone_perso" id="phone_perso" class="maxwidth200" value="'.(GETPOSTISSET('phone_perso') ? GETPOST('phone_perso', 'alpha') : $object->phone_perso).'"></td></tr>';
|
||||
print '<input type="text" name="phone_perso" id="phone_perso" class="maxwidth200" value="'.(GETPOSTISSET('phone_perso') ? GETPOST('phone_perso', 'alpha') : $object->phone_perso).'"></td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr><td>'.$form->editfieldkey('PhoneMobile', 'phone_mobile', '', $object, 0).'</td>';
|
||||
print '<td>';
|
||||
|
|
@ -1055,6 +1056,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||
print '<td>';
|
||||
print img_picto('', 'object_phoning', 'class="pictofixedwidth"');
|
||||
print '<input type="text" name="phone_pro" id="phone_pro" class="maxwidth200" maxlength="80" value="'.(GETPOSTISSET('phone_pro') ?GETPOST('phone_pro', 'alpha') : $object->phone_pro).'"></td>';
|
||||
if ($conf->browser->layout == 'phone') {
|
||||
print '</tr><tr>';
|
||||
}
|
||||
print '<td>'.$form->editfieldkey('PhonePerso', 'fax', GETPOST('phone_perso', 'alpha'), $object, 0).'</td>';
|
||||
print '<td>';
|
||||
print img_picto('', 'object_phoning', 'class="pictofixedwidth"');
|
||||
|
|
@ -1064,6 +1068,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||
print '<td>';
|
||||
print img_picto('', 'object_phoning_mobile', 'class="pictofixedwidth"');
|
||||
print '<input type="text" name="phone_mobile" id="phone_mobile" class="maxwidth200" maxlength="80" value="'.(GETPOSTISSET('phone_mobile') ?GETPOST('phone_mobile', 'alpha') : $object->phone_mobile).'"></td>';
|
||||
if ($conf->browser->layout == 'phone') {
|
||||
print '</tr><tr>';
|
||||
}
|
||||
print '<td>'.$form->editfieldkey('Fax', 'fax', GETPOST('fax', 'alpha'), $object, 0).'</td>';
|
||||
print '<td>';
|
||||
print img_picto('', 'object_phoning_fax', 'class="pictofixedwidth"');
|
||||
|
|
@ -1127,10 +1134,10 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||
// Visibility
|
||||
print '<tr><td><label for="priv">'.$langs->trans("ContactVisibility").'</label></td><td colspan="3">';
|
||||
$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 '</td></tr>';
|
||||
|
||||
//Default language
|
||||
// Default language
|
||||
if (getDolGlobalInt('MAIN_MULTILANGS')) {
|
||||
print '<tr><td>'.$form->editfieldkey('DefaultLang', 'default_lang', '', $object, 0).'</td><td colspan="3" class="maxwidthonsmartphone">'."\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 '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
|
||||
}
|
||||
print '<input type="file" class="flat" name="photo" id="photoinput">';
|
||||
print '<input type="file" class="flat maxwidth200" name="photo" id="photoinput">';
|
||||
print '</td></tr>';
|
||||
print '</table>';
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue