';
print '
';
-
print '
';
// Categories
@@ -703,8 +704,7 @@ else
print '| '.dol_htmlentitiesbr($object->comment).' | ';
print '
';
-
-
+
if ($object->type == Account::TYPE_SAVINGS || $object->type == Account::TYPE_CURRENT)
{
print '
';
diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php
index 74badc6daae..58e47a29ec8 100644
--- a/htdocs/core/actions_massactions.inc.php
+++ b/htdocs/core/actions_massactions.inc.php
@@ -406,60 +406,105 @@ if (! $error && $massaction == "builddoc" && $permtoread && ! GETPOST('button_se
$outputlangs->setDefaultLang($newlang);
}
- // Create empty PDF
- $pdf=pdf_getInstance();
- if (class_exists('TCPDF'))
- {
- $pdf->setPrintHeader(false);
- $pdf->setPrintFooter(false);
+ if(!empty($conf->global->USE_PDFTK_FOR_PDF_CONCAT)) {
+ // Create output dir if not exists
+ dol_mkdir($diroutputmassaction);
+
+ // Defined name of merged file
+ $filename=strtolower(dol_sanitizeFileName($langs->transnoentities($objectlabel)));
+ $filename=preg_replace('/\s/','_',$filename);
+
+ // Save merged file
+ if ($filter=='paye:0')
+ {
+ if ($option=='late') $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid"))).'_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Late")));
+ else $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid")));
+ }
+ if ($year) $filename.='_'.$year;
+ if ($month) $filename.='_'.$month;
+
+ if (count($files)>0)
+ {
+
+ $now=dol_now();
+ $file=$diroutputmassaction.'/'.$filename.'_'.dol_print_date($now,'dayhourlog').'.pdf';
+
+ $input_files = '';
+ foreach($files as $f) {
+ $input_files.=' '.escapeshellarg($f);
+ }
+
+ $cmd = 'pdftk '.$input_files.' cat output '.escapeshellarg($file);
+ exec($cmd);
+
+ if (! empty($conf->global->MAIN_UMASK))
+ @chmod($file, octdec($conf->global->MAIN_UMASK));
+
+ $langs->load("exports");
+ setEventMessages($langs->trans('FileSuccessfullyBuilt',$filename.'_'.dol_print_date($now,'dayhourlog')), null, 'mesgs');
+ }
+ else
+ {
+ setEventMessages($langs->trans('NoPDFAvailableForDocGenAmongChecked'), null, 'errors');
+ }
+
}
- $pdf->SetFont(pdf_getPDFFont($outputlangs));
+ else {
+ // Create empty PDF
+ $pdf=pdf_getInstance();
+ if (class_exists('TCPDF'))
+ {
+ $pdf->setPrintHeader(false);
+ $pdf->setPrintFooter(false);
+ }
+ $pdf->SetFont(pdf_getPDFFont($outputlangs));
- if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false);
+ if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false);
- // Add all others
- foreach($files as $file)
- {
- // Charge un document PDF depuis un fichier.
- $pagecount = $pdf->setSourceFile($file);
- for ($i = 1; $i <= $pagecount; $i++)
- {
- $tplidx = $pdf->importPage($i);
- $s = $pdf->getTemplatesize($tplidx);
- $pdf->AddPage($s['h'] > $s['w'] ? 'P' : 'L');
- $pdf->useTemplate($tplidx);
- }
- }
+ // Add all others
+ foreach($files as $file)
+ {
+ // Charge un document PDF depuis un fichier.
+ $pagecount = $pdf->setSourceFile($file);
+ for ($i = 1; $i <= $pagecount; $i++)
+ {
+ $tplidx = $pdf->importPage($i);
+ $s = $pdf->getTemplatesize($tplidx);
+ $pdf->AddPage($s['h'] > $s['w'] ? 'P' : 'L');
+ $pdf->useTemplate($tplidx);
+ }
+ }
- // Create output dir if not exists
- dol_mkdir($diroutputmassaction);
+ // Create output dir if not exists
+ dol_mkdir($diroutputmassaction);
- // Defined name of merged file
- $filename=strtolower(dol_sanitizeFileName($langs->transnoentities($objectlabel)));
- $filename=preg_replace('/\s/','_',$filename);
-
- // Save merged file
- if ($filter=='paye:0')
- {
- if ($option=='late') $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid"))).'_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Late")));
- else $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid")));
- }
- if ($year) $filename.='_'.$year;
- if ($month) $filename.='_'.$month;
- if ($pagecount)
- {
- $now=dol_now();
- $file=$diroutputmassaction.'/'.$filename.'_'.dol_print_date($now,'dayhourlog').'.pdf';
- $pdf->Output($file,'F');
- if (! empty($conf->global->MAIN_UMASK))
- @chmod($file, octdec($conf->global->MAIN_UMASK));
+ // Defined name of merged file
+ $filename=strtolower(dol_sanitizeFileName($langs->transnoentities($objectlabel)));
+ $filename=preg_replace('/\s/','_',$filename);
+
+ // Save merged file
+ if ($filter=='paye:0')
+ {
+ if ($option=='late') $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid"))).'_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Late")));
+ else $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid")));
+ }
+ if ($year) $filename.='_'.$year;
+ if ($month) $filename.='_'.$month;
+ if ($pagecount)
+ {
+ $now=dol_now();
+ $file=$diroutputmassaction.'/'.$filename.'_'.dol_print_date($now,'dayhourlog').'.pdf';
+ $pdf->Output($file,'F');
+ if (! empty($conf->global->MAIN_UMASK))
+ @chmod($file, octdec($conf->global->MAIN_UMASK));
- $langs->load("exports");
- setEventMessages($langs->trans('FileSuccessfullyBuilt',$filename.'_'.dol_print_date($now,'dayhourlog')), null, 'mesgs');
- }
- else
- {
- setEventMessages($langs->trans('NoPDFAvailableForDocGenAmongChecked'), null, 'errors');
+ $langs->load("exports");
+ setEventMessages($langs->trans('FileSuccessfullyBuilt',$filename.'_'.dol_print_date($now,'dayhourlog')), null, 'mesgs');
+ }
+ else
+ {
+ setEventMessages($langs->trans('NoPDFAvailableForDocGenAmongChecked'), null, 'errors');
+ }
}
}
diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php
index 42daafe9c2d..1798eb19059 100644
--- a/htdocs/fourn/class/fournisseur.facture.class.php
+++ b/htdocs/fourn/class/fournisseur.facture.class.php
@@ -128,7 +128,9 @@ class FactureFournisseur extends CommonInvoice
public $multicurrency_total_ht;
public $multicurrency_total_tva;
public $multicurrency_total_ttc;
-
+ //! id of source invoice if replacement invoice or credit note
+ public $fk_facture_source;
+
/**
* Standard invoice
*/
@@ -263,6 +265,7 @@ class FactureFournisseur extends CommonInvoice
$sql.= ", fk_multicurrency";
$sql.= ", multicurrency_code";
$sql.= ", multicurrency_tx";
+ $sql.= ", fk_facture_source";
$sql.= ")";
$sql.= " VALUES (";
$sql.= "'(PROV)'";
@@ -286,6 +289,7 @@ class FactureFournisseur extends CommonInvoice
$sql.= ", ".(int) $this->fk_multicurrency;
$sql.= ", '".$this->db->escape($this->multicurrency_code)."'";
$sql.= ", ".(double) $this->multicurrency_tx;
+ $sql.= ", ".(isset($this->fk_facture_source)?$this->fk_facture_source:"NULL");
$sql.= ")";
dol_syslog(get_class($this)."::create", LOG_DEBUG);
diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang
index bd1e41c5464..f9162c5ca21 100644
--- a/htdocs/langs/en_US/accountancy.lang
+++ b/htdocs/langs/en_US/accountancy.lang
@@ -59,6 +59,7 @@ ChangeAndLoad=Change and load
Addanaccount=Add an accounting account
AccountAccounting=Accounting account
AccountAccountingShort=Account
+ShowAccoutingAccount=Show accounting account
AccountAccountingSuggest=Accounting account suggested
MenuDefaultAccounts=Default accounts
MenuVatAccounts=Vat accounts