FIX: #10221 Html codes in accounting export

This commit is contained in:
Alexandre SPANGARO
2018-12-29 23:20:30 +01:00
parent 3af418349a
commit cbcf097ec1

View File

@@ -1152,28 +1152,28 @@ function getSourceDocRef($val, $typerecord)
// WE MUST HAVE SAME REF FOR ALL LINES WE WILL RECORD INTO THE BOOKKEEPING
$ref = $val['ref'];
if ($ref == '(SupplierInvoicePayment)' || $ref == '(SupplierInvoicePaymentBack)') {
$ref = $langs->trans('Supplier');
$ref = $langs->transnoentitiesnoconv('Supplier');
}
if ($ref == '(CustomerInvoicePayment)' || $ref == '(CustomerInvoicePaymentBack)') {
$ref = $langs->trans('Customer');
$ref = $langs->transnoentitiesnoconv('Customer');
}
if ($ref == '(SocialContributionPayment)') {
$ref = $langs->trans('SocialContribution');
$ref = $langs->transnoentitiesnoconv('SocialContribution');
}
if ($ref == '(DonationPayment)') {
$ref = $langs->trans('Donation');
$ref = $langs->transnoentitiesnoconv('Donation');
}
if ($ref == '(SubscriptionPayment)') {
$ref = $langs->trans('Subscription');
$ref = $langs->transnoentitiesnoconv('Subscription');
}
if ($ref == '(ExpenseReportPayment)') {
$ref = $langs->trans('Employee');
$ref = $langs->transnoentitiesnoconv('Employee');
}
if ($ref == '(LoanPayment)') {
$ref = $langs->trans('Loan');
$ref = $langs->transnoentitiesnoconv('Loan');
}
if ($ref == '(payment_salary)') {
$ref = $langs->trans('Employee');
$ref = $langs->transnoentitiesnoconv('Employee');
}
$sqlmid = '';
@@ -1182,63 +1182,63 @@ function getSourceDocRef($val, $typerecord)
$sqlmid = 'SELECT payfac.fk_facture as id, f.facnumber as ref';
$sqlmid .= " FROM ".MAIN_DB_PREFIX."paiement_facture as payfac, ".MAIN_DB_PREFIX."facture as f";
$sqlmid .= " WHERE payfac.fk_facture = f.rowid AND payfac.fk_paiement=" . $val["paymentid"];
$ref = $langs->trans("Invoice");
$ref = $langs->transnoentitiesnoconv("Invoice");
}
elseif ($typerecord == 'payment_supplier')
{
$sqlmid = 'SELECT payfac.fk_facturefourn as id, f.ref';
$sqlmid .= " FROM " . MAIN_DB_PREFIX . "paiementfourn_facturefourn as payfac, ".MAIN_DB_PREFIX."facture_fourn as f";
$sqlmid .= " WHERE payfac.fk_facturefourn = f.rowid AND payfac.fk_paiementfourn=" . $val["paymentsupplierid"];
$ref = $langs->trans("SupplierInvoice");
$ref = $langs->transnoentitiesnoconv("SupplierInvoice");
}
elseif ($typerecord == 'payment_expensereport')
{
$sqlmid = 'SELECT e.rowid as id, e.ref';
$sqlmid .= " FROM " . MAIN_DB_PREFIX . "payment_expensereport as pe, " . MAIN_DB_PREFIX . "expensereport as e";
$sqlmid .= " WHERE pe.rowid=" . $val["paymentexpensereport"]." AND pe.fk_expensereport = e.rowid";
$ref = $langs->trans("ExpenseReport");
$ref = $langs->transnoentitiesnoconv("ExpenseReport");
}
elseif ($typerecord == 'payment_salary')
{
$sqlmid = 'SELECT s.rowid as ref';
$sqlmid .= " FROM " . MAIN_DB_PREFIX . "payment_salary as s";
$sqlmid .= " WHERE s.rowid=" . $val["paymentsalid"];
$ref = $langs->trans("SalaryPayment");
$ref = $langs->transnoentitiesnoconv("SalaryPayment");
}
elseif ($typerecord == 'sc')
{
$sqlmid = 'SELECT sc.rowid as ref';
$sqlmid .= " FROM " . MAIN_DB_PREFIX . "paiementcharge as sc";
$sqlmid .= " WHERE sc.rowid=" . $val["paymentscid"];
$ref = $langs->trans("SocialContribution");
$ref = $langs->transnoentitiesnoconv("SocialContribution");
}
elseif ($typerecord == 'payment_vat')
{
$sqlmid = 'SELECT v.rowid as ref';
$sqlmid .= " FROM " . MAIN_DB_PREFIX . "tva as v";
$sqlmid .= " WHERE v.rowid=" . $val["paymentvatid"];
$ref = $langs->trans("PaymentVat");
$ref = $langs->transnoentitiesnoconv("PaymentVat");
}
elseif ($typerecord == 'payment_donation')
{
$sqlmid = 'SELECT payd.fk_donation as ref';
$sqlmid .= " FROM " . MAIN_DB_PREFIX . "payment_donation as payd";
$sqlmid .= " WHERE payd.fk_donation=" . $val["paymentdonationid"];
$ref = $langs->trans("Donation");
$ref = $langs->transnoentitiesnoconv("Donation");
}
elseif ($typerecord == 'payment_loan')
{
$sqlmid = 'SELECT l.rowid as ref';
$sqlmid .= " FROM " . MAIN_DB_PREFIX . "payment_loan as l";
$sqlmid .= " WHERE l.rowid=" . $val["paymentloanid"];
$ref = $langs->trans("LoanPayment");
$ref = $langs->transnoentitiesnoconv("LoanPayment");
}
elseif ($typerecord == 'payment_various')
{
$sqlmid = 'SELECT v.rowid as ref';
$sqlmid .= " FROM " . MAIN_DB_PREFIX . "payment_various as v";
$sqlmid .= " WHERE v.rowid=" . $val["paymentvariousid"];
$ref = $langs->trans("VariousPayment");
$ref = $langs->transnoentitiesnoconv("VariousPayment");
}
// Add warning
if (empty($sqlmid))
@@ -1260,6 +1260,6 @@ function getSourceDocRef($val, $typerecord)
else dol_print_error($db);
}
$ref = dol_trunc($langs->trans("BankId").' '.$val['fk_bank'].' - '.$ref, 295); // 295 + 3 dots (...) is < than max size of 300
$ref = dol_trunc($langs->transnoentitiesnoconv("BankId").' '.$val['fk_bank'].' - '.$ref, 295); // 295 + 3 dots (...) is < than max size of 300
return $ref;
}