Merge branch '12.0' of git@github.com:Dolibarr/dolibarr.git into 13.0
Conflicts: htdocs/accountancy/class/accountancyexport.class.php htdocs/accountancy/tpl/export_journal.tpl.php htdocs/projet/tasks/time.php
This commit is contained in:
commit
d822421e10
@ -5,7 +5,7 @@
|
||||
* Copyright (C) 2015 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
* Copyright (C) 2016 Pierre-Henry Favre <phf@atm-consulting.fr>
|
||||
* Copyright (C) 2016-2020 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2016-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2013-2017 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2017 Elarifr. Ari Elbaz <github@accedinfo.com>
|
||||
* Copyright (C) 2017-2019 Frédéric France <frederic.france@netlogic.fr>
|
||||
@ -466,33 +466,43 @@ class AccountancyExport
|
||||
}
|
||||
|
||||
/**
|
||||
* Export format : CIEL
|
||||
* Export format : CIEL (Format XIMPORT)
|
||||
* Format since 2003 compatible CIEL version > 2002 / Sage50
|
||||
* Last review for this format : 2021/07/28 Alexandre Spangaro (aspangaro@open-dsi.fr)
|
||||
*
|
||||
* Help : https://sage50c.online-help.sage.fr/aide-technique/
|
||||
* In sage software | Use menu : "Exchange" > "Importing entries..."
|
||||
*
|
||||
* If you want to force filename to "XIMPORT.TXT" for automatically import file present in a directory :
|
||||
* use constant ACCOUNTING_EXPORT_XIMPORT_FORCE_FILENAME
|
||||
*
|
||||
* @param array $TData data
|
||||
* @return void
|
||||
*/
|
||||
public function exportCiel(&$TData)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$end_line = "\r\n";
|
||||
|
||||
$i = 1;
|
||||
$date_ecriture = dol_print_date(dol_now(), $conf->global->ACCOUNTING_EXPORT_DATE); // format must be yyyymmdd
|
||||
|
||||
foreach ($TData as $data) {
|
||||
$code_compta = $data->numero_compte;
|
||||
if (!empty($data->subledger_account))
|
||||
$code_compta = $data->subledger_account;
|
||||
$code_compta = length_accountg($data->numero_compte);
|
||||
if (!empty($data->subledger_account)) {
|
||||
$code_compta = length_accounta($data->subledger_account);
|
||||
}
|
||||
|
||||
$date_document = dol_print_date($data->doc_date, '%Y%m%d');
|
||||
$date_echeance = dol_print_date($data->date_lim_reglement, '%Y%m%d');
|
||||
|
||||
$Tab = array();
|
||||
$Tab['num_ecriture'] = str_pad($i, 5);
|
||||
$Tab['num_ecriture'] = str_pad($data->piece_num, 5);
|
||||
$Tab['code_journal'] = str_pad($data->code_journal, 2);
|
||||
$Tab['date_ecriture'] = $date_ecriture;
|
||||
$Tab['date_ope'] = dol_print_date($data->doc_date, $conf->global->ACCOUNTING_EXPORT_DATE);
|
||||
$Tab['num_piece'] = str_pad(self::trunc($data->piece_num, 12), 12);
|
||||
$Tab['date_ecriture'] = str_pad($date_document, 8, ' ', STR_PAD_LEFT);
|
||||
$Tab['date_echeance'] = str_pad($date_echeance, 8, ' ', STR_PAD_LEFT);
|
||||
$Tab['num_piece'] = str_pad(self::trunc($data->doc_ref, 12), 12);
|
||||
$Tab['num_compte'] = str_pad(self::trunc($code_compta, 11), 11);
|
||||
$Tab['libelle_ecriture'] = str_pad(self::trunc(dol_string_unaccent($data->doc_ref).dol_string_unaccent($data->label_operation), 25), 25);
|
||||
$Tab['montant'] = str_pad(abs($data->debit - $data->credit), 13, ' ', STR_PAD_LEFT);
|
||||
$Tab['montant'] = str_pad(price2fec(abs($data->debit - $data->credit)), 13, ' ', STR_PAD_LEFT);
|
||||
$Tab['type_montant'] = str_pad($data->sens, 1);
|
||||
$Tab['vide'] = str_repeat(' ', 18);
|
||||
$Tab['intitule_compte'] = str_pad(self::trunc(dol_string_unaccent($data->label_operation), 34), 34);
|
||||
|
||||
@ -16,6 +16,8 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// $formatexportset ùust be defined
|
||||
|
||||
// Protection to avoid direct call of template
|
||||
if (empty($conf) || !is_object($conf))
|
||||
{
|
||||
@ -58,6 +60,8 @@ if ($accountancyexport->getFormatCode($formatexportset) == $accountancyexport::$
|
||||
$endaccountingperiod = dol_print_date(dol_get_last_day($tmparray['year'], $tmparray['mon']), 'dayxcard');
|
||||
|
||||
$completefilename = $siren."FEC".$endaccountingperiod.".txt";
|
||||
} elseif ($accountancyexport->getFormatCode($formatexportset) == $accountancyexport::$EXPORT_TYPE_CIEL && $type_export == "general_ledger" && !empty($conf->global->ACCOUNTING_EXPORT_XIMPORT_FORCE_FILENAME)) {
|
||||
$completefilename = "XIMPORT.TXT";
|
||||
} else {
|
||||
$completefilename = ($code ? $code."_" : "").($prefix ? $prefix."_" : "").$filename.($nodateexport ? "" : $date_export).".".$format;
|
||||
}
|
||||
|
||||
@ -5116,7 +5116,8 @@ if ($action == 'create')
|
||||
// Reopen a standard paid invoice
|
||||
if ((($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT)
|
||||
|| ($object->type == Facture::TYPE_CREDIT_NOTE && empty($discount->id))
|
||||
|| ($object->type == Facture::TYPE_DEPOSIT && empty($discount->id)))
|
||||
|| ($object->type == Facture::TYPE_DEPOSIT && empty($discount->id))
|
||||
|| ($object->type == Facture::TYPE_SITUATION && empty($discount->id)))
|
||||
&& ($object->statut == Facture::STATUS_CLOSED || $object->statut == Facture::STATUS_ABANDONED || ($object->statut == 1 && $object->paye == 1)) // Condition ($object->statut == 1 && $object->paye == 1) should not happened but can be found due to corrupted data
|
||||
&& ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || $usercanreopen)) // A paid invoice (partially or completely)
|
||||
{
|
||||
|
||||
@ -1132,7 +1132,7 @@ class Form
|
||||
// mode 1
|
||||
$urloption = 'htmlname='.urlencode($htmlname).'&outjson=1&filter='.urlencode($filter).($showtype ? '&showtype='.urlencode($showtype) : '');
|
||||
$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
|
||||
$out .= '<style type="text/css">.ui-autocomplete { z-index: 250; }</style>';
|
||||
$out .= '<style type="text/css">.ui-autocomplete { z-index: 1003; }</style>';
|
||||
if (empty($hidelabel)) print $langs->trans("RefOrLabel").' : ';
|
||||
elseif ($hidelabel > 1) {
|
||||
$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
|
||||
@ -6163,7 +6163,7 @@ class Form
|
||||
$urloption = 'htmlname='.$htmlname.'&outjson=1&objectdesc='.$objectdesc.'&filter='.urlencode($objecttmp->filter);
|
||||
// Activate the auto complete using ajax call.
|
||||
$out .= ajax_autocompleter($preselectedvalue, $htmlname, $urlforajaxcall, $urloption, $conf->global->$confkeyforautocompletemode, 0, array());
|
||||
$out .= '<style type="text/css">.ui-autocomplete { z-index: 250; }</style>';
|
||||
$out .= '<style type="text/css">.ui-autocomplete { z-index: 1003; }</style>';
|
||||
if ($placeholder) $placeholder = ' placeholder="'.$placeholder.'"';
|
||||
$out .= '<input type="text" class="'.$morecss.'"'.($disabled ? ' disabled="disabled"' : '').' name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' />';
|
||||
} else {
|
||||
|
||||
@ -2369,7 +2369,7 @@ function convertBackOfficeMediasLinksToPublicLinks($notetoshow)
|
||||
* Function to format a value into a defined format for French administration (no thousand separator & decimal separator force to ',' with two decimals)
|
||||
* Function used into accountancy FEC export
|
||||
*
|
||||
* @param float $amount Amount to format
|
||||
* @param float $amount Amount to format
|
||||
* @return string Chain with formatted upright
|
||||
* @see price2num() Format a numeric into a price for FEC files
|
||||
*/
|
||||
|
||||
@ -333,7 +333,7 @@ Modelcsv_normal=Classic export
|
||||
Modelcsv_CEGID=Export for CEGID Expert Comptabilité
|
||||
Modelcsv_COALA=Export for Sage Coala
|
||||
Modelcsv_bob50=Export for Sage BOB 50
|
||||
Modelcsv_ciel=Export for Sage Ciel Compta or Compta Evolution
|
||||
Modelcsv_ciel=Export for Sage50, Ciel Compta or Compta Evo. (Format XIMPORT)
|
||||
Modelcsv_quadratus=Export for Quadratus QuadraCompta
|
||||
Modelcsv_ebp=Export for EBP
|
||||
Modelcsv_cogilog=Export for Cogilog
|
||||
|
||||
@ -1306,12 +1306,12 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
|
||||
$tasktmp->label = $task_time->label;
|
||||
print $tasktmp->getNomUrl(1, 'withproject', 'time');
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
}
|
||||
} else {
|
||||
print '<input type="hidden" name="taskid" value="'.$id.'">';
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
}
|
||||
} elseif ($action !== 'createtime') {
|
||||
print '<input type="hidden" name="taskid" value="'.$id.'">';
|
||||
}
|
||||
|
||||
// Task label
|
||||
if (!empty($arrayfields['t.task_label']['checked']))
|
||||
|
||||
@ -457,7 +457,7 @@ if (empty($reshook)) {
|
||||
}
|
||||
|
||||
// Set parent company
|
||||
if ($action == 'set_thirdparty' && $user->rights->societe->creer) {
|
||||
if ($action == 'set_thirdparty' && $user->rights->ticket->write) {
|
||||
if ($object->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')) >= 0) {
|
||||
$result = $object->setCustomer(GETPOST('editcustomer', 'int'));
|
||||
$url = 'card.php?action=view&track_id='.GETPOST('track_id', 'alpha');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user