Fixing style errors.

This commit is contained in:
stickler-ci 2022-02-14 03:31:30 +00:00
parent d5e521c87b
commit dd5be840aa

View File

@ -394,12 +394,12 @@ class AccountingJournal extends CommonObject
case 1: // Various Journal case 1: // Various Journal
$data = $this->getAssetData($user, $type, $date_start, $date_end, $in_bookkeeping); $data = $this->getAssetData($user, $type, $date_start, $date_end, $in_bookkeeping);
break; break;
// case 2: // Sells Journal // case 2: // Sells Journal
// case 3: // Purchases Journal // case 3: // Purchases Journal
// case 4: // Bank Journal // case 4: // Bank Journal
// case 5: // Expense reports Journal // case 5: // Expense reports Journal
// case 8: // Inventory Journal // case 8: // Inventory Journal
// case 9: // hasnew Journal // case 9: // hasnew Journal
} }
} }
@ -519,8 +519,8 @@ class AccountingJournal extends CommonObject
$journal_data = array(); $journal_data = array();
foreach ($pre_data['elements'] as $pre_data_id => $pre_data_info) { foreach ($pre_data['elements'] as $pre_data_id => $pre_data_info) {
$element_static->id = $pre_data_id; $element_static->id = $pre_data_id;
$element_static->ref = (string)$pre_data_info["ref"]; $element_static->ref = (string) $pre_data_info["ref"];
$element_static->label = (string)$pre_data_info["label"]; $element_static->label = (string) $pre_data_info["label"];
$element_static->acquisition_value_ht = $pre_data_info["acquisition_value_ht"]; $element_static->acquisition_value_ht = $pre_data_info["acquisition_value_ht"];
$element_link = $element_static->getNomUrl(1, 'with_label'); $element_link = $element_static->getNomUrl(1, 'with_label');
@ -655,7 +655,7 @@ class AccountingJournal extends CommonObject
$lines[0][$accountancy_code_depreciation_asset] = -$last_cumulative_amount_ht; $lines[0][$accountancy_code_depreciation_asset] = -$last_cumulative_amount_ht;
$lines[0][$accountancy_code_asset] = $element_static->acquisition_value_ht; $lines[0][$accountancy_code_asset] = $element_static->acquisition_value_ht;
$disposal_amount_vat = $disposal_subject_to_vat ? (double)price2num($disposal_amount * $disposal_vat / 100, 'MT') : 0; $disposal_amount_vat = $disposal_subject_to_vat ? (double) price2num($disposal_amount * $disposal_vat / 100, 'MT') : 0;
$lines[1][$accountancy_code_receivable_on_assignment] = -($disposal_amount + $disposal_amount_vat); $lines[1][$accountancy_code_receivable_on_assignment] = -($disposal_amount + $disposal_amount_vat);
if ($disposal_subject_to_vat) $lines[1][$accountancy_code_vat_collected] = $disposal_amount_vat; if ($disposal_subject_to_vat) $lines[1][$accountancy_code_vat_collected] = $disposal_amount_vat;
$lines[1][$accountancy_code_proceeds_from_sales] = $disposal_amount; $lines[1][$accountancy_code_proceeds_from_sales] = $disposal_amount;
@ -739,39 +739,39 @@ class AccountingJournal extends CommonObject
* @param User $user User who write in the bookkeeping * @param User $user User who write in the bookkeeping
* @param array $journal_data Journal data to write in the bookkeeping * @param array $journal_data Journal data to write in the bookkeeping
* $journal_data = array( * $journal_data = array(
* id_element => array( * id_element => array(
* 'ref' => 'ref', * 'ref' => 'ref',
* 'error' => '', * 'error' => '',
* 'blocks' => array( * 'blocks' => array(
* pos_block => array( * pos_block => array(
* num_line => array( * num_line => array(
* 'doc_date' => '', * 'doc_date' => '',
* 'date_lim_reglement' => '', * 'date_lim_reglement' => '',
* 'doc_ref' => '', * 'doc_ref' => '',
* 'date_creation' => '', * 'date_creation' => '',
* 'doc_type' => '', * 'doc_type' => '',
* 'fk_doc' => '', * 'fk_doc' => '',
* 'fk_docdet' => '', * 'fk_docdet' => '',
* 'thirdparty_code' => '', * 'thirdparty_code' => '',
* 'subledger_account' => '', * 'subledger_account' => '',
* 'subledger_label' => '', * 'subledger_label' => '',
* 'numero_compte' => '', * 'numero_compte' => '',
* 'label_compte' => '', * 'label_compte' => '',
* 'label_operation' => '', * 'label_operation' => '',
* 'montant' => '', * 'montant' => '',
* 'sens' => '', * 'sens' => '',
* 'debit' => '', * 'debit' => '',
* 'credit' => '', * 'credit' => '',
* 'code_journal' => '', * 'code_journal' => '',
* 'journal_label' => '', * 'journal_label' => '',
* 'piece_num' => '', * 'piece_num' => '',
* 'import_key' => '', * 'import_key' => '',
* 'fk_user_author' => '', * 'fk_user_author' => '',
* 'entity' => '', * 'entity' => '',
* ), * ),
* ), * ),
* ), * ),
* ), * ),
* ); * );
* @param int $max_nb_errors Nb error authorized before stop the process * @param int $max_nb_errors Nb error authorized before stop the process
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
@ -857,19 +857,19 @@ class AccountingJournal extends CommonObject
$this->errors[] = $bookkeeping->errorsToString(); $this->errors[] = $bookkeeping->errorsToString();
} }
} }
// //
// if (!$error_for_line && !empty($conf->asset->enabled) && $this->nature == 1 && $bookkeeping->fk_doc > 0) { // if (!$error_for_line && !empty($conf->asset->enabled) && $this->nature == 1 && $bookkeeping->fk_doc > 0) {
// // Set last cumulative depreciation // // Set last cumulative depreciation
// require_once DOL_DOCUMENT_ROOT . '/asset/class/asset.class.php'; // require_once DOL_DOCUMENT_ROOT . '/asset/class/asset.class.php';
// $asset = new Asset($this->db); // $asset = new Asset($this->db);
// $result = $asset->setLastCumulativeDepreciation($bookkeeping->fk_doc); // $result = $asset->setLastCumulativeDepreciation($bookkeeping->fk_doc);
// if ($result < 0) { // if ($result < 0) {
// $error++; // $error++;
// $error_for_line++; // $error_for_line++;
// $journal_data[$element_id]['error'] = 'other'; // $journal_data[$element_id]['error'] = 'other';
// $this->errors[] = $asset->errorsToString(); // $this->errors[] = $asset->errorsToString();
// } // }
// } // }
} }
if ($error_for_line) { if ($error_for_line) {
@ -908,16 +908,16 @@ class AccountingJournal extends CommonObject
* *
* @param array $journal_data Journal data to write in the bookkeeping * @param array $journal_data Journal data to write in the bookkeeping
* $journal_data = array( * $journal_data = array(
* id_element => array( * id_element => array(
* 'continue' => false, * 'continue' => false,
* 'blocks' => array( * 'blocks' => array(
* pos_block => array( * pos_block => array(
* num_line => array( * num_line => array(
* data to write in the CSV line * data to write in the CSV line
* ), * ),
* ), * ),
* ), * ),
* ), * ),
* ); * );
* @param int $search_date_end Search date end * @param int $search_date_end Search date end
* @param string $sep CSV separator * @param string $sep CSV separator
@ -1002,7 +1002,8 @@ class AccountingJournal extends CommonObject
* @param string $account Accounting account number * @param string $account Accounting account number
* @return array Accounting account infos * @return array Accounting account infos
*/ */
function getAccountingAccountInfos($account) { function getAccountingAccountInfos($account)
{
if (!isset(self::$accounting_account_cached[$account])) { if (!isset(self::$accounting_account_cached[$account])) {
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php'; require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';