diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php index 61c0b855c75..b39d2da5001 100644 --- a/htdocs/compta/accounting-files.php +++ b/htdocs/compta/accounting-files.php @@ -182,7 +182,7 @@ if (($action == 'searchfiles' || $action == 'dl')) { $sql .= " AND t.entity IN (".($entity == 1 ? '0,1' : $entity).')'; $sql .= " AND t.fk_statut <> ".Don::STATUS_DRAFT; } - // Paiements of salaries + // Payments of salaries if (GETPOST('selectpaymentsofsalaries')) { if (!empty($sql)) $sql .= " UNION ALL"; $sql .= " SELECT t.rowid as id, t.entity, t.label as ref, 1 as paid, amount as total_ht, amount as total_ttc, 0 as total_vat, '".$db->escape($conf->currency)."' as currency, t.fk_user as fk_soc, t.datep as date, t.dateep as date_due, 'SalaryPayment' as item, CONCAT(CONCAT(u.lastname, ' '), u.firstname) as thirdparty_name, '' as thirdparty_code, c.code as country_code, '' as vatnum, ".PAY_DEBIT." as sens"; @@ -203,7 +203,7 @@ if (($action == 'searchfiles' || $action == 'dl')) { // Various payments if (GETPOST('selectvariouspayment')) { if (!empty($sql)) $sql .= " UNION ALL"; - $sql .= " SELECT t.rowid as id, t.entity, t.label as ref, 1 as paid, t.amount as total_ht, t.amount as total_ttc, 0 as total_vat, '".$db->escape($conf->currency)."' as currency, 0 as fk_soc, t.datep as date, t.datep as date_due, 'VariousPayment' as item, '' as thirdparty_name, '' as thirdparty_code, '' as country_code, '' as vatnum, sens"; + $sql .= " SELECT t.rowid as id, t.entity, t.ref, 1 as paid, t.amount as total_ht, t.amount as total_ttc, 0 as total_vat, '".$db->escape($conf->currency)."' as currency, 0 as fk_soc, t.datep as date, t.datep as date_due, 'VariousPayment' as item, '' as thirdparty_name, '' as thirdparty_code, '' as country_code, '' as vatnum, sens"; $sql .= " FROM ".MAIN_DB_PREFIX."payment_various as t"; $sql .= " WHERE datep between ".$wheretail; $sql .= " AND t.entity IN (".($entity == 1 ? '0,1' : $entity).')'; @@ -606,13 +606,14 @@ if (!empty($date_start) && !empty($date_stop)) print_liste_field_titre($arrayfields['ref']['label'], $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'nowraponall '); print ''.$langs->trans("Document").''; print ''.$langs->trans("Paid").''; - print ''.$langs->trans("TotalHT").''; - print ''.$langs->trans("TotalTTC").''; - print ''.$langs->trans("TotalVAT").''; + print ''.$langs->trans("TotalHT").($conf->multicurrency->enabled ? ' ('.$conf->currency.')' : '').''; + print ''.$langs->trans("TotalTTC").($conf->multicurrency->enabled ? ' ('.$conf->currency.')' : '').''; + print ''.$langs->trans("TotalVAT").($conf->multicurrency->enabled ? ' ('.$conf->currency.')' : '').''; print ''.$langs->trans("ThirdParty").''; print ''.$langs->trans("Code").''; print ''.$langs->trans("Country").''; print ''.$langs->trans("VATIntra").''; + if ($conf->multicurrency->enabled) print ''.$langs->trans("Currency").''; print ''; if ($result) { @@ -620,7 +621,11 @@ if (!empty($date_start) && !empty($date_stop)) if (empty($TData)) { - print ''.$langs->trans("NoItem").''; + print ''.$langs->trans("NoItem").''; + if (! empty($conf->multicurrency->enabled)) { + print ''; + } + print ''; } else { // Sort array by date ASC to calculate balance @@ -647,7 +652,7 @@ if (!empty($date_start) && !empty($date_stop)) print dol_print_date($data['date'], 'day'); print "\n"; - // Date + // Date due print ''; print dol_print_date($data['date_due'], 'day'); print "\n"; @@ -658,10 +663,18 @@ if (!empty($date_start) && !empty($date_stop)) if ($data['item'] == 'Invoice') { $invoice->id = $data['id']; $invoice->ref = $data['ref']; + $invoice->total_ht = $data['amount_ht']; + $invoice->total_ttc = $data['amount_ttc']; + $invoice->total_tva = $data['amount_vat']; + $invoice->multicurrency_code = $data['currency']; print $invoice->getNomUrl(1, '', 0, 0, '', 0, 0, 0); } elseif ($data['item'] == 'SupplierInvoice') { $supplier_invoice->id = $data['id']; $supplier_invoice->ref = $data['ref']; + $supplier_invoice->total_ht = $data['amount_ht']; + $supplier_invoice->total_ttc = $data['amount_ttc']; + $supplier_invoice->total_tva = $data['amount_vat']; + $supplier_invoice->multicurrency_code = $data['currency']; print $supplier_invoice->getNomUrl(1, '', 0, 0, '', 0, 0, 0); } elseif ($data['item'] == 'ExpenseReport') { $expensereport->id = $data['id']; @@ -712,7 +725,7 @@ if (!empty($date_start) && !empty($date_stop)) // Total VAT print ''.price($data['sens'] ? $data['amount_vat'] : -$data['amount_vat'])."\n"; - print ''.$data['thirdparty_name']."\n"; + print ''.$data['thirdparty_name']."\n"; print ''.$data['thirdparty_code']."\n"; @@ -730,6 +743,10 @@ if (!empty($date_start) && !empty($date_stop)) $totalVAT_debit -= $data['amount_vat']; } + if (! empty($conf->multicurrency->enabled)) { + print ''.$data['currency']."\n"; + } + print "\n"; } @@ -740,6 +757,9 @@ if (!empty($date_start) && !empty($date_stop)) print ''.price(price2num($totalIT_credit, 'MT')).''; print ''.price(price2num($totalVAT_credit, 'MT')).''; print ''; + if (! empty($conf->multicurrency->enabled)) { + print ''; + } print "\n"; // Total debits print ''; @@ -748,6 +768,9 @@ if (!empty($date_start) && !empty($date_stop)) print ''.price(price2num($totalIT_debit, 'MT')).''; print ''.price(price2num($totalVAT_debit, 'MT')).''; print ''; + if (! empty($conf->multicurrency->enabled)) { + print ''; + } print "\n"; // Balance print ''; @@ -756,6 +779,9 @@ if (!empty($date_start) && !empty($date_stop)) print ''.price(price2num($totalIT_credit + $totalIT_debit, 'MT')).''; print ''.price(price2num($totalVAT_credit + $totalVAT_debit, 'MT')).''; print ''; + if (! empty($conf->multicurrency->enabled)) { + print ''; + } print "\n"; } } diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 0c0e32a2055..289eaf2d05b 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -2286,7 +2286,7 @@ class FactureFournisseur extends CommonInvoice if ($this->type == self::TYPE_CREDIT_NOTE) $picto .= 'a'; // Credit note if ($this->type == self::TYPE_DEPOSIT) $picto .= 'd'; // Deposit invoice - $label = ''.$langs->trans("SupplierInvoice").''; + $label = img_picto('', $this->picto).' '.$langs->trans("SupplierInvoice").''; if ($this->type == self::TYPE_REPLACEMENT) $label = ''.$langs->transnoentitiesnoconv("InvoiceReplace").''; elseif ($this->type == self::TYPE_CREDIT_NOTE) $label = ''.$langs->transnoentitiesnoconv("CreditNote").''; elseif ($this->type == self::TYPE_DEPOSIT) $label = ''.$langs->transnoentitiesnoconv("Deposit").''; @@ -2301,7 +2301,7 @@ class FactureFournisseur extends CommonInvoice if (!empty($this->total_ht)) $label .= '
'.$langs->trans('AmountHT').': '.price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency); if (!empty($this->total_tva)) - $label .= '
'.$langs->trans('VAT').': '.price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency); + $label .= '
'.$langs->trans('AmountVAT').': '.price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency); if (!empty($this->total_ttc)) $label .= '
'.$langs->trans('AmountTTC').': '.price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency); if ($moretitle) $label .= ' - '.$moretitle;