diff --git a/htdocs/admin/supplier_invoice.php b/htdocs/admin/supplier_invoice.php
index dd8210611e9..de128184d18 100644
--- a/htdocs/admin/supplier_invoice.php
+++ b/htdocs/admin/supplier_invoice.php
@@ -205,7 +205,7 @@ print "
";
$head = supplierorder_admin_prepare_head();
-dol_fiche_head($head, 'invoice', $langs->trans("Suppliers"), 0, 'company');
+dol_fiche_head($head, 'invoice', $langs->trans("Suppliers"), -1, 'company');
// Supplier invoice numbering module
diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php
index a170f7ccd37..030a507ce20 100644
--- a/htdocs/admin/supplier_order.php
+++ b/htdocs/admin/supplier_order.php
@@ -234,7 +234,7 @@ print "
";
$head = supplierorder_admin_prepare_head();
-dol_fiche_head($head, 'order', $langs->trans("Suppliers"), 0, 'company');
+dol_fiche_head($head, 'order', $langs->trans("Suppliers"), -1, 'company');
// Supplier order numbering module
diff --git a/htdocs/admin/supplier_payment.php b/htdocs/admin/supplier_payment.php
index 0f6cbff6179..adaa114b1ca 100644
--- a/htdocs/admin/supplier_payment.php
+++ b/htdocs/admin/supplier_payment.php
@@ -65,7 +65,7 @@ if ($action == 'updateMask')
}
}else if ($action == 'setmod')
{
- dolibarr_set_const($db, "SUPPLIER_PAYMENT_ADDON",$value,'chaine',0,'',$conf->entity);
+ dolibarr_set_const($db, "SUPPLIER_PAYMENT_ADDON", $value, 'chaine', 0, '', $conf->entity);
}
// define constants for models generator that need parameters
@@ -138,7 +138,7 @@ else if ($action == 'specimen')
$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
foreach($dirmodels as $reldir)
{
- $file=dol_buildpath($reldir."core/modules/supplier_payment/pdf/pdf_".$modele.".modules.php",0);
+ $file=dol_buildpath($reldir."core/modules/supplier_payment/doc/pdf_".$modele.".modules.php",0);
if (file_exists($file))
{
$filefound=1;
@@ -188,7 +188,7 @@ print load_fiche_titre($langs->trans("SupplierPaymentSetup"),$linkback,'title_se
print "
";
$head = supplierorder_admin_prepare_head();
-dol_fiche_head($head, 'supplierpayment', $langs->trans("Suppliers"), 0, 'company');
+dol_fiche_head($head, 'supplierpayment', $langs->trans("Suppliers"), -1, 'company');
/*
* Numbering module
@@ -198,12 +198,6 @@ if (empty($conf->global->SUPPLIER_PAYMENT_ADDON)) $conf->global->SUPPLIER_PAYMEN
print load_fiche_titre($langs->trans("PaymentsNumberingModule"), '', '');
-/*
- * Document templates generators
- */
-print '
';
-print load_fiche_titre($langs->trans("BillsPDFModules"),'','');
-
// Load array def with activated templates
$def = array();
$sql = "SELECT nom";
@@ -349,6 +343,12 @@ foreach ($dirmodels as $reldir)
print '';
+/*
+ * Document templates generators
+ */
+print '
';
+print load_fiche_titre($langs->trans("PaymentsPDFModules"),'','');
+
print '
';
print '| '.img_picto_common('','treemenu/branchbottom.gif').' | ';
print '';
print $langs->trans("NoCategoryYet");
diff --git a/htdocs/compta/paiement/cheque/card.php b/htdocs/compta/paiement/cheque/card.php
index 625b2be518e..eed3a79335c 100644
--- a/htdocs/compta/paiement/cheque/card.php
+++ b/htdocs/compta/paiement/cheque/card.php
@@ -334,7 +334,7 @@ else
// $head[$h][1] = $langs->trans("Info");
// $h++;
- dol_fiche_head($head, $hselected, $langs->trans("Cheques"),0,'payment');
+ dol_fiche_head($head, $hselected, $langs->trans("Cheques"), -1, 'payment');
/*
* Confirmation de la suppression du bordereau
@@ -476,8 +476,7 @@ if ($action == 'new')
print ''."\n";
print '';
- print '| '.$langs->trans("DateChequeReceived").' ';
- print " | \n";
+ print ''.$langs->trans("DateChequeReceived").' | '."\n";
print ''.$langs->trans("ChequeNumber")." | \n";
print ''.$langs->trans("CheckTransmitter")." | \n";
print ''.$langs->trans("Bank")." | \n";
@@ -487,59 +486,57 @@ if ($action == 'new')
print ''.$langs->trans("Select")." ";
if ($conf->use_javascript_ajax) print ''.$langs->trans("All").' / '.$langs->trans("None").'';
print ' | ';
-
print " \n";
- $var=true;
-
- foreach ($lines[$bid] as $lid => $value)
+ if (count($lines[$bid]))
{
-
+ foreach ($lines[$bid] as $lid => $value)
+ {
+ $account_id = $bid;
+ if (! isset($accounts[$bid]))
+ $accounts[$bid]=0;
+ $accounts[$bid] += 1;
- $account_id = $bid;
- if (! isset($accounts[$bid]))
- $accounts[$bid]=0;
- $accounts[$bid] += 1;
+ print '';
+ print '| '.dol_print_date($value["date"],'day').' | ';
+ print ''.$value["numero"]." | \n";
+ print ''.$value["emetteur"]." | \n";
+ print ''.$value["banque"]." | \n";
+ print ''.price($value["amount"], 0, $langs, 1, -1, -1, $conf->currency).' | ';
- print ' ';
- print '| '.dol_print_date($value["date"],'day').' | ';
- print ''.$value["numero"]." | \n";
- print ''.$value["emetteur"]." | \n";
- print ''.$value["banque"]." | \n";
- print ''.price($value["amount"], 0, $langs, 1, -1, -1, $conf->currency).' | ';
-
- // Link to payment
- print '';
- $paymentstatic->id=$value["paymentid"];
- $paymentstatic->ref=$value["paymentid"];
- if ($paymentstatic->id)
- {
- print $paymentstatic->getNomUrl(1);
- }
- else
- {
- print ' ';
- }
- print ' | ';
- // Link to bank transaction
- print '';
- $accountlinestatic->rowid=$value["id"];
- if ($accountlinestatic->rowid)
- {
- print $accountlinestatic->getNomUrl(1);
- }
- else
- {
- print ' ';
- }
- print ' | ';
-
- print '';
- print '';
- print ' | ' ;
- print ' ';
-
- $i++;
+ // Link to payment
+ print '';
+ $paymentstatic->id=$value["paymentid"];
+ $paymentstatic->ref=$value["paymentid"];
+ if ($paymentstatic->id)
+ {
+ print $paymentstatic->getNomUrl(1);
+ }
+ else
+ {
+ print ' ';
+ }
+ print ' | ';
+ // Link to bank transaction
+ print '';
+ $accountlinestatic->rowid=$value["id"];
+ if ($accountlinestatic->rowid)
+ {
+ print $accountlinestatic->getNomUrl(1);
+ }
+ else
+ {
+ print ' ';
+ }
+ print ' | ';
+
+ print '';
+ print '';
+ print ' | ' ;
+ print '';
+
+ $i++;
+ }
}
print " ";
print '';
@@ -686,65 +683,75 @@ else
print_liste_field_titre('');
print " | \n";
$i=1;
- $var=false;
- while ($objp = $db->fetch_object($resql))
- {
- $account_id = $objp->bid;
- if (! isset($accounts[$objp->bid]))
- $accounts[$objp->bid]=0;
- $accounts[$objp->bid] += 1;
- print '';
- print '| '.$i.' | ';
- print ''.dol_print_date($db->jdate($objp->date),'day').' | '; // Date operation
- print ''.($objp->num_chq?$objp->num_chq:' ').' | ';
- print ''.dol_trunc($objp->emetteur,24).' | ';
- print ''.dol_trunc($objp->banque,24).' | ';
- print ''.price($objp->amount).' | ';
- // Link to payment
- print '';
- $paymentstatic->id=$objp->pid;
- $paymentstatic->ref=$objp->pid;
- if ($paymentstatic->id)
- {
- print $paymentstatic->getNomUrl(1);
- }
- else
- {
- print ' ';
- }
- print ' | ';
- // Link to bank transaction
- print '';
- $accountlinestatic->rowid=$objp->rowid;
- if ($accountlinestatic->rowid)
- {
- print $accountlinestatic->getNomUrl(1);
- }
- else
- {
- print ' ';
- }
- print ' | ';
- // Action button
- print '';
- if ($object->statut == 0)
- {
- print 'id.'&action=remove&lineid='.$objp->rowid.'">'.img_delete().'';
- }
- if ($object->statut == 1 && $objp->statut != 2)
- {
- print 'id.'&action=reject_check&lineid='.$objp->rowid.'">'.img_picto($langs->trans("RejectCheck"),'disable').'';
- }
- if ($objp->statut == 2)
- {
- print ' '.img_picto($langs->trans('CheckRejected'),'statut8').'';
- }
- print ' | ';
- print ' ';
-
- $i++;
- }
+ if ($num > 0)
+ {
+ while ($objp = $db->fetch_object($resql))
+ {
+ $account_id = $objp->bid;
+ if (! isset($accounts[$objp->bid]))
+ $accounts[$objp->bid]=0;
+ $accounts[$objp->bid] += 1;
+
+ print '';
+ print '| '.$i.' | ';
+ print ''.dol_print_date($db->jdate($objp->date),'day').' | '; // Date operation
+ print ''.($objp->num_chq?$objp->num_chq:' ').' | ';
+ print ''.dol_trunc($objp->emetteur,24).' | ';
+ print ''.dol_trunc($objp->banque,24).' | ';
+ print ''.price($objp->amount).' | ';
+ // Link to payment
+ print '';
+ $paymentstatic->id=$objp->pid;
+ $paymentstatic->ref=$objp->pid;
+ if ($paymentstatic->id)
+ {
+ print $paymentstatic->getNomUrl(1);
+ }
+ else
+ {
+ print ' ';
+ }
+ print ' | ';
+ // Link to bank transaction
+ print '';
+ $accountlinestatic->rowid=$objp->rowid;
+ if ($accountlinestatic->rowid)
+ {
+ print $accountlinestatic->getNomUrl(1);
+ }
+ else
+ {
+ print ' ';
+ }
+ print ' | ';
+ // Action button
+ print '';
+ if ($object->statut == 0)
+ {
+ print 'id.'&action=remove&lineid='.$objp->rowid.'">'.img_delete().'';
+ }
+ if ($object->statut == 1 && $objp->statut != 2)
+ {
+ print 'id.'&action=reject_check&lineid='.$objp->rowid.'">'.img_picto($langs->trans("RejectCheck"),'disable').'';
+ }
+ if ($objp->statut == 2)
+ {
+ print ' '.img_picto($langs->trans('CheckRejected'),'statut8').'';
+ }
+ print ' | ';
+ print ' ';
+
+ $i++;
+ }
+ }
+ else
+ {
+ print '';
+ print $langs->trans("None");
+ print ' | ';
+ }
+
print " ";
print "";
}
diff --git a/htdocs/compta/paiement/cheque/index.php b/htdocs/compta/paiement/cheque/index.php
index 2d77cb71061..97dc3c1674f 100644
--- a/htdocs/compta/paiement/cheque/index.php
+++ b/htdocs/compta/paiement/cheque/index.php
@@ -50,8 +50,6 @@ llxHeader('',$langs->trans("ChequesArea"));
print load_fiche_titre($langs->trans("ChequesArea"));
-//print '';
-//print '';
print '';
$sql = "SELECT count(b.rowid)";
@@ -90,7 +88,6 @@ else
}
-//print ' | ';
print '';
$max=10;
@@ -98,15 +95,13 @@ $max=10;
$sql = "SELECT bc.rowid, bc.date_bordereau as db, bc.amount, bc.ref as ref";
$sql.= ", bc.statut, bc.nbcheque";
$sql.= ", ba.label, ba.rowid as bid";
-$sql.= " FROM ".MAIN_DB_PREFIX."bordereau_cheque as bc";
-$sql.= ", ".MAIN_DB_PREFIX."bank_account as ba";
+$sql.= " FROM ".MAIN_DB_PREFIX."bordereau_cheque as bc, ".MAIN_DB_PREFIX."bank_account as ba";
$sql.= " WHERE ba.rowid = bc.fk_bank_account";
$sql.= " AND bc.entity = ".$conf->entity;
$sql.= " ORDER BY bc.date_bordereau DESC, rowid DESC";
$sql.= $db->plimit($max);
$resql = $db->query($sql);
-
if ($resql)
{
print ' ';
@@ -128,9 +123,8 @@ if ($resql)
$accountstatic->id=$objp->bid;
$accountstatic->label=$objp->label;
-
- print "\n";
+ print ' '."\n";
print '| '.$checkdepositstatic->getNomUrl(1).' | ';
print ''.dol_print_date($db->jdate($objp->db),'day').' | ';
@@ -142,15 +136,15 @@ if ($resql)
print ' ';
}
print " ";
+
$db->free($resql);
}
else
{
- dol_print_error($db);
+ dol_print_error($db);
}
-//print " | \n";
print '';
llxFooter();
diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php
index 18f1e30edc7..8a85212a0ff 100644
--- a/htdocs/core/lib/files.lib.php
+++ b/htdocs/core/lib/files.lib.php
@@ -1631,12 +1631,24 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
if ($fuser->rights->ficheinter->lire) $accessallowed=1;
$original_file=$conf->ficheinter->dir_output.'/'.$original_file;
}
- // Wrapping pour les apercu commande
+ // Wrapping pour les apercu supplier proposal
+ elseif (($modulepart == 'apercusupplier_proposal' || $modulepart == 'apercusupplier_proposal') && !empty($conf->supplier_proposal->dir_output))
+ {
+ if ($fuser->rights->supplier_proposal->lire) $accessallowed=1;
+ $original_file=$conf->supplier_proposal->dir_output.'/'.$original_file;
+ }
+ // Wrapping pour les apercu supplier order
elseif (($modulepart == 'apercusupplier_order' || $modulepart == 'apercusupplier_order') && !empty($conf->fournisseur->commande->dir_output))
{
if ($fuser->rights->fournisseur->commande->lire) $accessallowed=1;
$original_file=$conf->fournisseur->commande->dir_output.'/'.$original_file;
}
+ // Wrapping pour les apercu supplier invoice
+ elseif (($modulepart == 'apercusupplier_invoice' || $modulepart == 'apercusupplier_invoice') && !empty($conf->fournisseur->facture->dir_output))
+ {
+ if ($fuser->rights->fournisseur->facture->lire) $accessallowed=1;
+ $original_file=$conf->fournisseur->facture->dir_output.'/'.$original_file;
+ }
// Wrapping pour les images des stats propales
elseif ($modulepart == 'propalstats' && !empty($conf->propal->dir_temp))
{
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index da0a33e7ef1..275bbae8c36 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -1070,6 +1070,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
if ($object->element == 'member') $modulepart='memberphoto';
if ($object->element == 'user') $modulepart='userphoto';
if ($object->element == 'product') $modulepart='product';
+
if (class_exists("Imagick"))
{
if ($object->element == 'propal') $modulepart='propal';
@@ -1077,7 +1078,9 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
if ($object->element == 'facture') $modulepart='facture';
if ($object->element == 'fichinter') $modulepart='ficheinter';
if ($object->element == 'contrat') $modulepart='contract';
- if ($object->element == 'order_supplier') $modulepart='supplier_order';
+ if ($object->element == 'supplier_proposal') $modulepart='supplier_proposal';
+ if ($object->element == 'order_supplier') $modulepart='supplier_order';
+ if ($object->element == 'invoice_supplier') $modulepart='supplier_invoice';
}
if ($object->element == 'product')
@@ -1107,14 +1110,22 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
{
$phototoshow='';
// Check if a preview file is available
- if (in_array($modulepart, array('propal', 'commande', 'facture', 'ficheinter', 'contract', 'supplier_order')) && class_exists("Imagick"))
+ if (in_array($modulepart, array('propal', 'commande', 'facture', 'ficheinter', 'contract', 'supplier_order', 'supplier_proposal', 'supplier_invoice')) && class_exists("Imagick"))
{
$objectref = dol_sanitizeFileName($object->ref);
$dir_output = $conf->$modulepart->dir_output . "/";
- $filepath = $dir_output . $objectref . "/";
+ if (in_array($modulepart, array('invoice_supplier', 'supplier_invoice')))
+ {
+ $subdir = get_exdir($object->id, 2, 0, 0, $object, $modulepart).$objectref;
+ }
+ else
+ {
+ $subdir = get_exdir($object->id, 0, 0, 0, $object, $modulepart).$objectref;
+ }
+ $filepath = $dir_output . $subdir . "/";
$file = $filepath . $objectref . ".pdf";
- $relativepath = $objectref.'/'.$objectref.'.pdf';
-
+ $relativepath = $subdir.'/'.$objectref.'.pdf';
+
// Define path to preview pdf file (preview precompiled "file.ext" are "file.ext_preview.png")
$fileimage = $file.'_preview.png'; // If PDF has 1 page
$fileimagebis = $file.'_preview-0.png'; // If PDF has more than one page
@@ -4465,7 +4476,8 @@ function yn($yesno, $case=1, $color=0)
/**
* Return a path to have a directory according to object.
- * New usage: $conf->product->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 1, $object, 'modulepart')
+ * New usage: $conf->module->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 1, $object, 'modulepart')
+ * or: $conf->module->dir_output.'/'.get_exdir(0, 0, 0, 1, $object, 'modulepart') if multidir_output not defined.
* Old usage: '015' with level 3->"0/1/5/", '015' with level 1->"5/", 'ABC-1' with level 3 ->"0/0/1/"
*
* @param string $num Id of object (deprecated, $object will be used in future)
@@ -4486,7 +4498,7 @@ function get_exdir($num, $level, $alpha, $withoutslash, $object, $modulepart)
if (! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) $arrayforoldpath[]='product';
if (! empty($level) && in_array($modulepart, $arrayforoldpath))
{
- // This part should be removed once all code is using "get_exdir" to forge path, with all parameters provided
+ // This part should be removed once all code is using "get_exdir" to forge path, with all parameters provided.
if (empty($alpha)) $num = preg_replace('/([^0-9])/i','',$num);
else $num = preg_replace('/^.*\-/i','',$num);
$num = substr("000".$num, -$level);
diff --git a/htdocs/core/modules/supplier_payment/pdf/index.html b/htdocs/core/modules/supplier_payment/doc/index.html
similarity index 100%
rename from htdocs/core/modules/supplier_payment/pdf/index.html
rename to htdocs/core/modules/supplier_payment/doc/index.html
diff --git a/htdocs/core/modules/supplier_payment/pdf/pdf_cow.modules.php b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php
similarity index 98%
rename from htdocs/core/modules/supplier_payment/pdf/pdf_cow.modules.php
rename to htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php
index edb37ddcdde..2b645e4a263 100644
--- a/htdocs/core/modules/supplier_payment/pdf/pdf_cow.modules.php
+++ b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php
@@ -36,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functionsnumtoword.lib.php';
/**
* Class to generate the supplier invoices with the canelle model
*/
-class pdf_cow extends ModelePDFSuppliersPayments
+class pdf_standard extends ModelePDFSuppliersPayments
{
var $db;
var $name;
@@ -70,8 +70,8 @@ class pdf_cow extends ModelePDFSuppliersPayments
$langs->load("bills");
$this->db = $db;
- $this->name = "cow";
- $this->description = $langs->trans('SuppliersPaymentModel');
+ $this->name = "standard";
+ $this->description = $langs->trans('DocumentModelStandardPDF');
// Dimension page pour format A4
$this->type = 'pdf';
@@ -85,10 +85,6 @@ class pdf_cow extends ModelePDFSuppliersPayments
$this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10;
$this->option_logo = 1; // Affiche logo
- $this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION
- $this->option_modereg = 1; // Affiche mode reglement
- $this->option_condreg = 1; // Affiche conditions reglement
- $this->option_codeproduitservice = 1; // Affiche code produit-service
$this->option_multilang = 1; // Dispo en plusieurs langues
$this->franchise=!$mysoc->tva_assuj;
diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php
index 04af9470e6d..f930ad87979 100644
--- a/htdocs/fourn/facture/card.php
+++ b/htdocs/fourn/facture/card.php
@@ -70,7 +70,7 @@ $projectid = GETPOST('projectid','int');
$origin = GETPOST('origin', 'alpha');
$originid = GETPOST('originid', 'int');
-//PDF
+// PDF
$hidedetails = (GETPOST('hidedetails','int') ? GETPOST('hidedetails','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0));
$hidedesc = (GETPOST('hidedesc','int') ? GETPOST('hidedesc','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0));
$hideref = (GETPOST('hideref','int') ? GETPOST('hideref','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0));
@@ -1194,32 +1194,11 @@ if (empty($reshook))
$trackid='sin'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
-
- // Build document
- if ($action == 'builddoc')
- {
- // Save modele used
- $object->fetch($id);
- $object->fetch_thirdparty();
-
- // Save last template used to generate document
- if (GETPOST('model')) $object->setDocModel($user, GETPOST('model','alpha'));
-
- $outputlangs = $langs;
- $newlang=GETPOST('lang_id','alpha');
- if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->thirdparty->default_lang;
- if (! empty($newlang))
- {
- $outputlangs = new Translate("",$conf);
- $outputlangs->setDefaultLang($newlang);
- }
- $result = $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
- if ($result < 0)
- {
- setEventMessages($object->error, $object->errors, 'errors');
- $action='';
- }
- }
+ // Actions to build doc
+ $upload_dir = $conf->fournisseur->facture->dir_output;
+ $permissioncreate = $user->rights->fournisseur->facture->creer;
+ include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
+
// Make calculation according to calculationrule
if ($action == 'calculate')
{
@@ -1234,22 +1213,6 @@ if (empty($reshook))
exit;
}
}
- // Delete file in doc form
- if ($action == 'remove_file')
- {
- require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
-
- if ($object->fetch($id))
- {
- $object->fetch_thirdparty();
- $upload_dir = $conf->fournisseur->facture->dir_output . "/";
- $file = $upload_dir . '/' . GETPOST('file');
- $ret=dol_delete_file($file,0,0,0,$object);
- if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs');
- else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors');
- }
- }
-
if ($action == 'update_extras')
{
// Fill array 'array_options' with data from add form
@@ -1924,7 +1887,7 @@ else
$head = facturefourn_prepare_head($object);
$titre=$langs->trans('SupplierInvoice');
- dol_fiche_head($head, 'card', $titre, 0, 'bill');
+ dol_fiche_head($head, 'card', $titre, -1, 'bill');
// Clone confirmation
if ($action == 'clone')
@@ -2792,8 +2755,8 @@ else
* Documents generes
*/
$ref=dol_sanitizeFileName($object->ref);
- $subdir = get_exdir($object->id,2,0,0,$object,'invoice_supplier').$ref;
- $filedir = $conf->fournisseur->facture->dir_output.'/'.get_exdir($object->id,2,0,0,$object,'invoice_supplier').$ref;
+ $subdir = get_exdir($object->id, 2, 0, 0, $object, 'invoice_supplier').$ref;
+ $filedir = $conf->fournisseur->facture->dir_output.'/'.$subdir;
$urlsource=$_SERVER['PHP_SELF'].'?id='.$object->id;
$genallowed=$user->rights->fournisseur->facture->creer;
$delallowed=$user->rights->fournisseur->facture->supprimer;
diff --git a/htdocs/fourn/facture/contact.php b/htdocs/fourn/facture/contact.php
index cafc6c1a496..0f56c5f7bae 100644
--- a/htdocs/fourn/facture/contact.php
+++ b/htdocs/fourn/facture/contact.php
@@ -138,7 +138,7 @@ if ($id > 0 || ! empty($ref))
$head = facturefourn_prepare_head($object);
- dol_fiche_head($head, 'contact', $langs->trans('SupplierInvoice'), 0, 'bill');
+ dol_fiche_head($head, 'contact', $langs->trans('SupplierInvoice'), -1, 'bill');
$linkback = '' . $langs->trans("BackToList") . '';
diff --git a/htdocs/fourn/facture/document.php b/htdocs/fourn/facture/document.php
index 2563a176346..ab56a66d8a7 100644
--- a/htdocs/fourn/facture/document.php
+++ b/htdocs/fourn/facture/document.php
@@ -89,7 +89,7 @@ llxHeader('', $title, $helpurl);
if ($object->id > 0)
{
$head = facturefourn_prepare_head($object);
- dol_fiche_head($head, 'documents', $langs->trans('SupplierInvoice'), 0, 'bill');
+ dol_fiche_head($head, 'documents', $langs->trans('SupplierInvoice'), -1, 'bill');
$totalpaye = $object->getSommePaiement();
@@ -230,6 +230,8 @@ if ($object->id > 0)
print ' ';
+ print '';
+
print '';
// Nb of files
diff --git a/htdocs/fourn/facture/info.php b/htdocs/fourn/facture/info.php
index af98c4f9b66..f5ab9164042 100644
--- a/htdocs/fourn/facture/info.php
+++ b/htdocs/fourn/facture/info.php
@@ -59,7 +59,7 @@ $alreadypaid=$object->getSommePaiement();
$head = facturefourn_prepare_head($object);
$titre=$langs->trans('SupplierInvoice');
-dol_fiche_head($head, 'info', $langs->trans('SupplierInvoice'), 0, 'bill');
+dol_fiche_head($head, 'info', $langs->trans('SupplierInvoice'), -1, 'bill');
$linkback = '' . $langs->trans("BackToList") . '';
diff --git a/htdocs/fourn/facture/note.php b/htdocs/fourn/facture/note.php
index cd009e394f6..9df425040e1 100644
--- a/htdocs/fourn/facture/note.php
+++ b/htdocs/fourn/facture/note.php
@@ -79,11 +79,9 @@ if ($object->id > 0)
$head = facturefourn_prepare_head($object);
$titre=$langs->trans('SupplierInvoice');
- dol_fiche_head($head, 'note', $titre, 0, 'bill');
+ dol_fiche_head($head, 'note', $titre, -1, 'bill');
- print '';
-
// Supplier invoice card
$linkback = ''.$langs->trans("BackToList").'';
@@ -135,7 +133,9 @@ if ($object->id > 0)
print '';
print ' ';
- // Type
+ print ' ';
+
+ // Type
print '| '.$langs->trans('Type').' | ';
print $object->getLibType();
if ($object->type == FactureFournisseur::TYPE_REPLACEMENT)
@@ -203,6 +203,7 @@ if ($object->id > 0)
print ' ';
+ print '';
$cssclass="titlefield";
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index 1356a980164..7f0596d33cd 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -1154,6 +1154,7 @@ WebCalUrlForVCalExport=An export link to %s format is available at follow
BillsSetup=Invoices module setup
BillsNumberingModule=Invoices and credit notes numbering model
BillsPDFModules=Invoice documents models
+PaymentsPDFModules=Payment documents models
CreditNote=Credit note
CreditNotes=Credit notes
ForceInvoiceDate=Force invoice date to validation date
diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php
index 0bac6dab14f..7e63dad93e9 100644
--- a/htdocs/supplier_proposal/card.php
+++ b/htdocs/supplier_proposal/card.php
@@ -1,6 +1,6 @@
- * Copyright (C) 2004-2016 Laurent Destailleur
+ * Copyright (C) 2004-2017 Laurent Destailleur
* Copyright (C) 2004 Eric Seigne
* Copyright (C) 2005 Marc Barilley / Ocebo
* Copyright (C) 2005-2012 Regis Houssin
@@ -462,13 +462,9 @@ if (empty($reshook))
}
}
+ // Action for direct print
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
-
- /*
- * Send mail
- */
-
// Actions to send emails
$actiontypecode='AC_ASKPRICE';
$trigger_name='SUPPLIER_PROPOSAL_SENTBYMAIL';
@@ -1530,6 +1526,7 @@ if ($action == 'create')
print ' | ';
}
+ /* Not for supplier proposals
if ($soc->outstanding_limit)
{
// Outstanding Bill
@@ -1540,7 +1537,7 @@ if ($action == 'create')
print price($soc->outstanding_limit, 0, '', 1, - 1, - 1, $conf->currency);
print '';
print '';
- }
+ }*/
if (! empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL) && ! empty($conf->banque->enabled))
{
diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php
index 65efb97f824..58ff9dd3ded 100644
--- a/htdocs/supplier_proposal/class/supplier_proposal.class.php
+++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php
@@ -2855,7 +2855,7 @@ class SupplierProposalLine extends CommonObjectLine
$sql.= ", ".$this->multicurrency_total_ht;
$sql.= ", ".$this->multicurrency_total_tva;
$sql.= ", ".$this->multicurrency_total_ttc;
- $sql.= ", ".$this->fk_unit;
+ $sql.= ", fk_unit=".($this->fk_unit?$this->fk_unit:'null');
$sql.= ')';
dol_syslog(get_class($this).'::insert', LOG_DEBUG);
@@ -3025,13 +3025,13 @@ class SupplierProposalLine extends CommonObjectLine
$sql.= " , fk_parent_line=".($this->fk_parent_line>0?$this->fk_parent_line:"null");
if (! empty($this->rang)) $sql.= ", rang=".$this->rang;
$sql.= " , ref_fourn=".(! empty($this->ref_fourn)?"'".$this->db->escape($this->ref_fourn)."'":"null");
-
+ $sql.= " , fk_unit=".($this->fk_unit?$this->fk_unit:'null');
+
// Multicurrency
$sql.= " , multicurrency_subprice=".price2num($this->multicurrency_subprice)."";
$sql.= " , multicurrency_total_ht=".price2num($this->multicurrency_total_ht)."";
$sql.= " , multicurrency_total_tva=".price2num($this->multicurrency_total_tva)."";
$sql.= " , multicurrency_total_ttc=".price2num($this->multicurrency_total_ttc)."";
- $sql.= " , fk_unit=".$this->fk_unit;
$sql.= " WHERE rowid = ".$this->rowid;
|