Merge remote-tracking branch 'origin/3.5' into develop

Conflicts:
	build/debian/changelog
	build/doxygen/dolibarr-doxygen.doxyfile
	build/exe/doliwamp/doliwamp.iss
	build/perl/virtualmin/dolibarr.pl
	build/rpm/dolibarr_fedora.spec
	build/rpm/dolibarr_generic.spec
	build/rpm/dolibarr_mandriva.spec
	build/rpm/dolibarr_opensuse.spec
	htdocs/compta/facture.php
	htdocs/core/modules/import/import_csv.modules.php
	htdocs/filefunc.inc.php
This commit is contained in:
Laurent Destailleur 2014-03-19 22:29:18 +01:00
commit f9c1b590d0
46 changed files with 411 additions and 117 deletions

View File

@ -114,6 +114,7 @@ Fix: [ bug #1240 ] traduction.
Fix: [ bug #1238 ] When creating accompte with a %, free product are used for calculation. Fix: [ bug #1238 ] When creating accompte with a %, free product are used for calculation.
Fix: [ bug #1280 ] service with not end of date was tagged as expired. Fix: [ bug #1280 ] service with not end of date was tagged as expired.
Fix: [ bug #1295 ] Error when creating an agenda extrafield with a number as reference Fix: [ bug #1295 ] Error when creating an agenda extrafield with a number as reference
New: Added es_CL language
***** ChangeLog for 3.5 compared to 3.4.* ***** ***** ChangeLog for 3.5 compared to 3.4.* *****
For users: For users:

View File

@ -5,6 +5,13 @@ dolibarr (3.6.0-1) unstable; urgency=low
-- Laurent Destailleur (eldy) <eldy@users.sourceforge.net> Sat, 8 Feb 2014 12:00:00 +0100 -- Laurent Destailleur (eldy) <eldy@users.sourceforge.net> Sat, 8 Feb 2014 12:00:00 +0100
dolibarr (3.5.2-3) unstable; urgency=low
[ Laurent Destailleur (eldy) ]
* New upstream release.
-- Laurent Destailleur (eldy) <eldy@users.sourceforge.net> Fri, 14 March 2014 12:00:00 +0100
dolibarr (3.5.1-3) unstable; urgency=low dolibarr (3.5.1-3) unstable; urgency=low
[ Laurent Destailleur (eldy) ] [ Laurent Destailleur (eldy) ]

View File

@ -30,7 +30,7 @@ return "Regis Houssin";
# script_dolibarr_versions() # script_dolibarr_versions()
sub script_dolibarr_versions sub script_dolibarr_versions
{ {
return ( "3.6.0", "3.5.1", "3.5.0", "3.4.1", "3.4.0", "3.3.3", "3.3.2", "3.3.1", "3.3.0", "3.2.1", "3.1.1" ); return ( "3.6.0", "3.5.2", "3.5.1", "3.5.0", "3.4.1", "3.4.0", "3.3.3", "3.3.2", "3.3.1", "3.3.0", "3.2.1", "3.1.1" );
} }
sub script_dolibarr_category sub script_dolibarr_category

View File

@ -334,5 +334,11 @@ fi
* Fri Feb 7 2014 Laurent Destailleur 3.6.0-0.2.b * Fri Feb 7 2014 Laurent Destailleur 3.6.0-0.2.b
- Upstream release - Upstream release
* Fri Feb 14 2014 Laurent Destailleur 3.5.2-0.3
- Upstream release
* Fri Feb 7 2014 Laurent Destailleur 3.5.1-0.3
- Upstream release
* Mon Dec 30 2013 Laurent Destailleur 3.5.0-0.3 * Mon Dec 30 2013 Laurent Destailleur 3.5.0-0.3
- Initial version (#723326) - Initial version (#723326)

View File

@ -562,5 +562,11 @@ fi
* Mon Feb 7 2014 Laurent Destailleur 3.6.0-0.2.b * Mon Feb 7 2014 Laurent Destailleur 3.6.0-0.2.b
- Upstream release - Upstream release
* Fri Feb 14 2014 Laurent Destailleur 3.5.2-0.3
- Upstream release
* Fri Feb 7 2014 Laurent Destailleur 3.5.1-0.3
- Upstream release
* Mon Dec 30 2013 Laurent Destailleur 3.5.0-0.3 * Mon Dec 30 2013 Laurent Destailleur 3.5.0-0.3
- Initial version (#723326) - Initial version (#723326)

View File

@ -339,5 +339,11 @@ fi
* Mon Feb 7 2014 Laurent Destailleur 3.6.0-0.2.b * Mon Feb 7 2014 Laurent Destailleur 3.6.0-0.2.b
- Upstream release - Upstream release
* Fri Feb 14 2014 Laurent Destailleur 3.5.2-0.3
- Upstream release
* Fri Feb 7 2014 Laurent Destailleur 3.5.1-0.3
- Upstream release
* Mon Dec 30 2013 Laurent Destailleur 3.5.0-0.3 * Mon Dec 30 2013 Laurent Destailleur 3.5.0-0.3
- Initial version (#723326) - Initial version (#723326)

View File

@ -349,5 +349,11 @@ fi
* Mon Feb 7 2014 Laurent Destailleur 3.6.0-0.2.b * Mon Feb 7 2014 Laurent Destailleur 3.6.0-0.2.b
- Upstream release - Upstream release
* Fri Feb 14 2014 Laurent Destailleur 3.5.2-0.3
- Upstream release
* Fri Feb 7 2014 Laurent Destailleur 3.5.1-0.3
- Upstream release
* Mon Dec 30 2013 Laurent Destailleur 3.5.0-0.3 * Mon Dec 30 2013 Laurent Destailleur 3.5.0-0.3
- Initial version (#723326) - Initial version (#723326)

View File

@ -484,14 +484,15 @@ else if ($action == 'confirm_canceled' && $confirm == 'yes') {
} }
// Convertir en reduc // Convertir en reduc
else if ($action == 'confirm_converttoreduc' && $confirm == 'yes' && $user->rights->facture->creer) { else if ($action == 'confirm_converttoreduc' && $confirm == 'yes' && $user->rights->facture->creer)
{
$db->begin(); $db->begin();
$object->fetch($id); $object->fetch($id);
$object->fetch_thirdparty(); $object->fetch_thirdparty();
$object->fetch_lines(); $object->fetch_lines();
if (! $object->paye) // protection against multiple submit if (empty($object->paye)) // protection against multiple submit
{ {
// Boucle sur chaque taux de tva // Boucle sur chaque taux de tva
$i = 0; $i = 0;
@ -509,8 +510,7 @@ else if ($action == 'confirm_converttoreduc' && $confirm == 'yes' && $user->righ
elseif ($object->type == Facture::TYPE_DEPOSIT) elseif ($object->type == Facture::TYPE_DEPOSIT)
$discount->description = '(DEPOSIT)'; $discount->description = '(DEPOSIT)';
else { else {
$this->error = "CantConvertToReducAnInvoiceOfThisType"; setEventMessage($langs->trans('CantConvertToReducAnInvoiceOfThisType'),'errors');
return - 1;
} }
$discount->tva_tx = abs($object->total_ttc); $discount->tva_tx = abs($object->total_ttc);
$discount->fk_soc = $object->socid; $discount->fk_soc = $object->socid;
@ -524,24 +524,31 @@ else if ($action == 'confirm_converttoreduc' && $confirm == 'yes' && $user->righ
$discount->tva_tx = abs($tva_tx); $discount->tva_tx = abs($tva_tx);
$result = $discount->create($user); $result = $discount->create($user);
if ($result < 0) { if ($result < 0)
$error ++; {
$error++;
break; break;
} }
} }
if (! $error) { if (empty($error))
{
// Classe facture // Classe facture
$result = $object->set_paid($user); $result = $object->set_paid($user);
if ($result > 0) { if ($result >= 0)
// $mesgs[]='OK'.$discount->id; {
//$mesgs[]='OK'.$discount->id;
$db->commit(); $db->commit();
} else { }
$mesgs [] = '<div class="error">' . $object->error . '</div>'; else
{
setEventMessage($object->error,'errors');
$db->rollback(); $db->rollback();
} }
} else { }
$mesgs [] = '<div class="error">' . $discount->error . '</div>'; else
{
setEventMessage($discount->error,'errors');
$db->rollback(); $db->rollback();
} }
} }
@ -644,14 +651,14 @@ else if ($action == 'add' && $user->rights->facture->creer) {
$id = $object->create($user); $id = $object->create($user);
if(GETPOST('invoiceAvoirWithLines', 'int')==1 && $id>0) { if(GETPOST('invoiceAvoirWithLines', 'int')==1 && $id>0) {
$facture_source = new Facture($db); // fetch origin object $facture_source = new Facture($db); // fetch origin object
if($facture_source->fetch($object->fk_facture_source)>0) { if($facture_source->fetch($object->fk_facture_source)>0) {
foreach($facture_source->lines as $line) { foreach($facture_source->lines as $line) {
$line->fk_facture = $object->id; $line->fk_facture = $object->id;
$line->subprice =-$line->subprice; // invert price for object $line->subprice =-$line->subprice; // invert price for object
$line->pa_ht = -$line->pa_ht; $line->pa_ht = -$line->pa_ht;
$line->total_ht=-$line->total_ht; $line->total_ht=-$line->total_ht;
@ -659,33 +666,33 @@ else if ($action == 'add' && $user->rights->facture->creer) {
$line->total_ttc=-$line->total_ttc; $line->total_ttc=-$line->total_ttc;
$line->total_localtax1=-$line->total_localtax1; $line->total_localtax1=-$line->total_localtax1;
$line->total_localtax2=-$line->total_localtax2; $line->total_localtax2=-$line->total_localtax2;
$line->insert(); $line->insert();
$object->lines[] = $line; // insert new line in current object $object->lines[] = $line; // insert new line in current object
} }
$object->update_price(1); $object->update_price(1);
} }
} }
if(GETPOST('invoiceAvoirWithPaymentRestAmount', 'int')==1 && $id>0) { if(GETPOST('invoiceAvoirWithPaymentRestAmount', 'int')==1 && $id>0) {
$facture_source = new Facture($db); // fetch origin object if not previously defined $facture_source = new Facture($db); // fetch origin object if not previously defined
if($facture_source->fetch($object->fk_facture_source)>0) { if($facture_source->fetch($object->fk_facture_source)>0) {
$totalpaye = $facture_source->getSommePaiement(); $totalpaye = $facture_source->getSommePaiement();
$totalcreditnotes = $facture_source->getSumCreditNotesUsed(); $totalcreditnotes = $facture_source->getSumCreditNotesUsed();
$totaldeposits = $facture_source->getSumDepositsUsed(); $totaldeposits = $facture_source->getSumDepositsUsed();
$remain_to_pay = abs($facture_source->total_ttc - $totalpaye - $totalcreditnotes - $totaldeposits); $remain_to_pay = abs($facture_source->total_ttc - $totalpaye - $totalcreditnotes - $totaldeposits);
$object->addline($langs->trans('invoiceAvoirLineWithPaymentRestAmount'),$remain_to_pay,1,0,0,0,0,0,'','','TTC'); $object->addline($langs->trans('invoiceAvoirLineWithPaymentRestAmount'),$remain_to_pay,1,0,0,0,0,0,'','','TTC');
} }
} }
// Add predefined lines // Add predefined lines
/* /*
TODO delete TODO delete
for($i = 1; $i <= $NBLINES; $i ++) { for($i = 1; $i <= $NBLINES; $i ++) {
if ($_POST ['idprod' . $i]) { if ($_POST ['idprod' . $i]) {
$product = new Product($db); $product = new Product($db);
@ -2070,10 +2077,10 @@ if ($action == 'create')
$text .= '</select>'; $text .= '</select>';
$desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceAvoirDesc"), 1); $desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceAvoirDesc"), 1);
print $desc; print $desc;
print '&nbsp;&nbsp;&nbsp; <input type="checkbox" name="invoiceAvoirWithLines" id="invoiceAvoirWithLines" value="1" onclick="if($(this).is(\':checked\') ) { $(\'#radio_creditnote\').attr(\'checked\',\'checked\'); $(\'#invoiceAvoirWithPaymentRestAmount\').removeAttr(\'checked\'); }" '.(GETPOST('invoiceAvoirWithLines','int')>0 ? 'checked="checked"':'').' /> <label for="invoiceAvoirWithLines">'.$langs->trans('invoiceAvoirWithLines')."</label>"; print '&nbsp;&nbsp;&nbsp; <input type="checkbox" name="invoiceAvoirWithLines" id="invoiceAvoirWithLines" value="1" onclick="if($(this).is(\':checked\') ) { $(\'#radio_creditnote\').attr(\'checked\',\'checked\'); $(\'#invoiceAvoirWithPaymentRestAmount\').removeAttr(\'checked\'); }" '.(GETPOST('invoiceAvoirWithLines','int')>0 ? 'checked="checked"':'').' /> <label for="invoiceAvoirWithLines">'.$langs->trans('invoiceAvoirWithLines')."</label>";
print '<br />&nbsp;&nbsp;&nbsp; <input type="checkbox" name="invoiceAvoirWithPaymentRestAmount" id="invoiceAvoirWithPaymentRestAmount" value="1" onclick="if($(this).is(\':checked\') ) { $(\'#radio_creditnote\').attr(\'checked\',\'checked\'); $(\'#invoiceAvoirWithLines\').removeAttr(\'checked\'); }" '.(GETPOST('invoiceAvoirWithPaymentRestAmount','int')>0 ? 'checked="checked"':'').' /> <label for="invoiceAvoirWithPaymentRestAmount">'.$langs->trans('invoiceAvoirWithPaymentRestAmount')."</label>"; print '<br />&nbsp;&nbsp;&nbsp; <input type="checkbox" name="invoiceAvoirWithPaymentRestAmount" id="invoiceAvoirWithPaymentRestAmount" value="1" onclick="if($(this).is(\':checked\') ) { $(\'#radio_creditnote\').attr(\'checked\',\'checked\'); $(\'#invoiceAvoirWithLines\').removeAttr(\'checked\'); }" '.(GETPOST('invoiceAvoirWithPaymentRestAmount','int')>0 ? 'checked="checked"':'').' /> <label for="invoiceAvoirWithPaymentRestAmount">'.$langs->trans('invoiceAvoirWithPaymentRestAmount')."</label>";
print '</td></tr>' . "\n"; print '</td></tr>' . "\n";
} }
@ -3340,7 +3347,7 @@ if ($action == 'create')
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER ["PHP_SELF"] . '?facid=' . $object->id . '&amp;action=converttoreduc">' . $langs->trans('ConvertToReduc') . '</a></div>'; print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER ["PHP_SELF"] . '?facid=' . $object->id . '&amp;action=converttoreduc">' . $langs->trans('ConvertToReduc') . '</a></div>';
} }
// For deposit invoice // For deposit invoice
if ($object->type == Facture::TYPE_DEPOSIT && $object->statut == 1 && $resteapayer == 0 && $user->rights->facture->creer) { if ($object->type == Facture::TYPE_DEPOSIT && $object->statut == 2 && $resteapayer == 0 && $user->rights->facture->creer && empty($discount->id)) {
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER ["PHP_SELF"] . '?facid=' . $object->id . '&amp;action=converttoreduc">' . $langs->trans('ConvertToReduc') . '</a></div>'; print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER ["PHP_SELF"] . '?facid=' . $object->id . '&amp;action=converttoreduc">' . $langs->trans('ConvertToReduc') . '</a></div>';
} }
} }

View File

@ -1472,7 +1472,8 @@ class Facture extends CommonInvoice
} }
/** /**
* Tag la facture comme paye completement (close_code non renseigne) ou partiellement (close_code renseigne) + appel trigger BILL_PAYED * Tag la facture comme paye completement (si close_code non renseigne) => this->fk_statut=2, this->paye=1
* ou partiellement (si close_code renseigne) + appel trigger BILL_PAYED => this->fk_statut=2, this->paye stay 0
* *
* @param User $user Objet utilisateur qui modifie * @param User $user Objet utilisateur qui modifie
* @param string $close_code Code renseigne si on classe a payee completement alors que paiement incomplet (cas escompte par exemple) * @param string $close_code Code renseigne si on classe a payee completement alors que paiement incomplet (cas escompte par exemple)
@ -1496,6 +1497,7 @@ class Facture extends CommonInvoice
if ($close_note) $sql.= ", close_note='".$this->db->escape($close_note)."'"; if ($close_note) $sql.= ", close_note='".$this->db->escape($close_note)."'";
$sql.= ' WHERE rowid = '.$this->id; $sql.= ' WHERE rowid = '.$this->id;
dol_syslog(get_class($this)."::set_paid sql=".$sql, LOG_DEBUG);
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) if ($resql)
{ {
@ -1511,8 +1513,7 @@ class Facture extends CommonInvoice
else else
{ {
$error++; $error++;
$this->error=$this->db->error(); $this->error=$this->db->lasterror();
dol_print_error($this->db);
} }
if (! $error) if (! $error)
@ -2075,7 +2076,7 @@ class Facture extends CommonInvoice
$product=new Product($this->db); $product=new Product($this->db);
$result=$product->fetch($fk_product); $result=$product->fetch($fk_product);
$product_type=$product->type; $product_type=$product->type;
if($conf->global->STOCK_MUST_BE_ENOUGH_FOR_INVOICE && $product_type == 0 && $product->stock_reel < $qty) { if($conf->global->STOCK_MUST_BE_ENOUGH_FOR_INVOICE && $product_type == 0 && $product->stock_reel < $qty) {
$this->error=$langs->trans('ErrorStockIsNotEnough'); $this->error=$langs->trans('ErrorStockIsNotEnough');
$this->db->rollback(); $this->db->rollback();

View File

@ -764,8 +764,9 @@ class FormFile
if (empty($relativepath)) if (empty($relativepath))
{ {
$relativepath=(! empty($object->ref)?dol_sanitizeFileName($object->ref):'').'/'; $relativepath=(! empty($object->ref)?dol_sanitizeFileName($object->ref):'').'/';
if ($object->element == 'invoice_supplier') $relativepath=get_exdir($object->id,2).$relativepath; if ($object->element == 'invoice_supplier') $relativepath=get_exdir($object->id,2).$relativepath; // TODO Call using a defined value for $relativepath
if ($object->element == 'member') $relativepath=get_exdir($object->id,2).$relativepath; if ($object->element == 'member') $relativepath=get_exdir($object->id,2).$relativepath; // TODO Call using a defined value for $relativepath
if ($object->element == 'project_task') $relativepath='Call_not_supported_._Call_function_using_a_defined_relative_path_.';
} }
$var=!$var; $var=!$var;
@ -1052,9 +1053,10 @@ class FormFile
* @param int $permtodelete Deletion is allowed * @param int $permtodelete Deletion is allowed
* @param string $action Action * @param string $action Action
* @param string $selected ??? * @param string $selected ???
* @param string $param More param to add into URL
* @return int Number of links * @return int Number of links
*/ */
public function listOfLinks($object, $permtodelete=1, $action=null, $selected=null) public function listOfLinks($object, $permtodelete=1, $action=null, $selected=null, $param='')
{ {
global $user, $conf, $langs, $user; global $user, $conf, $langs, $user;
global $bc; global $bc;
@ -1071,17 +1073,17 @@ class FormFile
$sortfield = null; $sortfield = null;
} }
$res = $link->fetchAll($links, $object->element, $object->id, $sortfield, $sortorder); $res = $link->fetchAll($links, $object->element, $object->id, $sortfield, $sortorder);
$param = (isset($object->id)?'&id=' . $object->id : ''); $param .= (isset($object->id)?'&id=' . $object->id : '');
// Show list of associated links // Show list of associated links
print_titre($langs->trans("LinkedFiles")); print_titre($langs->trans("LinkedFiles"));
print '<form action="' . $_SERVER['PHP_SELF'] . '" method="POST">'; print '<form action="' . $_SERVER['PHP_SELF'] . ($param?'?'.$param:'') . '" method="POST">';
print '<table width="100%" class="liste">'; print '<table width="100%" class="liste">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print_liste_field_titre( print_liste_field_titre(
$langs->trans("Documents2"), $langs->trans("Links"),
$_SERVER['PHP_SELF'], $_SERVER['PHP_SELF'],
"name", "name",
"", "",
@ -1135,34 +1137,34 @@ class FormFile
print '<input type="hidden" name="action" value="confirm_updateline">'; print '<input type="hidden" name="action" value="confirm_updateline">';
print $langs->trans('Link') . ': <input type="text" name="link" size="50" value="' . $link->url . '">'; print $langs->trans('Link') . ': <input type="text" name="link" size="50" value="' . $link->url . '">';
print '</td>'; print '</td>';
print '<td align="right">'; print '<td>';
print $langs->trans('Label') . ': <input type="text" name="label" value="' . $link->label . '">'; print $langs->trans('Label') . ': <input type="text" name="label" value="' . $link->label . '">';
print '</td>'; print '</td>';
print '<td align="center">' . dol_print_date(dol_now(), "dayhour", "tzuser") . '</td>'; print '<td align="center">' . dol_print_date(dol_now(), "dayhour", "tzuser") . '</td>';
print '<td align="right"></td>'; print '<td align="right"></td>';
print '<td align="right" colspan="2"><input type="submit" name="save" class="button" value="' . $langs->trans('Save') . '">'; print '<td align="right" colspan="2">';
print '<input type="submit" name="cancel" class="button" value="' . $langs->trans('Cancel') . '">'; print '<input type="submit" name="save" class="button" value="' . dol_escape_htmltag($langs->trans('Save')) . '">';
print '<input type="submit" name="cancel" class="button" value="' . dol_escape_htmltag($langs->trans('Cancel')) . '">';
print '</td>'; print '</td>';
} }
else { else
{
print '<td>'; print '<td>';
print '<a data-ajax="false" href="'. $link->url . '" target="_blank">'; print '<a data-ajax="false" href="' . $link->url . '" target="_blank">';
print $link->label; print $link->label;
print '</a>'; print '</a>';
print "</td>\n"; print '</td>'."\n";
print '<td align="right"></td>'; print '<td align="right"></td>';
print '<td align="center">' . dol_print_date($link->datea, "dayhour", "tzuser") . '</td>'; print '<td align="center">' . dol_print_date($link->datea, "dayhour", "tzuser") . '</td>';
print '<td align="center"></td>'; print '<td align="center"></td>';
print '<td align="right" colspan="2">'; print '<td align="right" colspan="2">';
print '<a href="' . $_SERVER['PHP_SELF'] . '?action=update&linkid=' . $link->id print '<a href="' . $_SERVER['PHP_SELF'] . '?action=update&linkid=' . $link->id . $param . '" class="editfilelink" >' . img_edit() . '</a>'; // id= is included into $param
. '&id=' . $object->id . '" class="editfilelink" >' . img_edit().'</a>';
if ($permtodelete) { if ($permtodelete) {
print ' &nbsp; <a href="'. $_SERVER['PHP_SELF'] .'?action=delete&linkid=' . $link->id print ' &nbsp; <a href="'. $_SERVER['PHP_SELF'] .'?action=delete&linkid=' . $link->id . $param . '" class="deletefilelink">' . img_delete() . '</a>'; // id= is included into $param
. '&id=' . $object->id . '" class="deletefilelink" >' . img_delete() . '</a>';
} else { } else {
print '&nbsp;'; print '&nbsp;';
} }
print "</td>"; print '</td>';
} }
print "</tr>\n"; print "</tr>\n";
} }

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr> * Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
@ -109,7 +109,7 @@ class pdf_einstein extends ModelePDFCommandes
$this->posxdiscount=162; $this->posxdiscount=162;
$this->postotalht=174; $this->postotalht=174;
if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxtva=$this->posxup; if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxtva=$this->posxup;
$this->posxpicture=$this->posxtva - 16; // width of images $this->posxpicture=$this->posxtva - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH)?16:$conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH); // width of images
if ($this->page_largeur < 210) // To work with US executive format if ($this->page_largeur < 210) // To work with US executive format
{ {
$this->posxpicture-=20; $this->posxpicture-=20;
@ -153,7 +153,7 @@ class pdf_einstein extends ModelePDFCommandes
$outputlangs->load("products"); $outputlangs->load("products");
$outputlangs->load("orders"); $outputlangs->load("orders");
$outputlangs->load("deliveries"); $outputlangs->load("deliveries");
if ($conf->commande->dir_output) if ($conf->commande->dir_output)
{ {
$object->fetch_thirdparty(); $object->fetch_thirdparty();
@ -228,6 +228,15 @@ class pdf_einstein extends ModelePDFCommandes
$this->atleastonediscount++; $this->atleastonediscount++;
} }
} }
if (empty($this->atleastonediscount))
{
$this->posxpicture+=($this->postotalht - $this->posxdiscount);
$this->posxtva+=($this->postotalht - $this->posxdiscount);
$this->posxup+=($this->postotalht - $this->posxdiscount);
$this->posxqty+=($this->postotalht - $this->posxdiscount);
$this->posxdiscount+=($this->postotalht - $this->posxdiscount);
//$this->postotalht;
}
// New page // New page
$pdf->AddPage(); $pdf->AddPage();
@ -316,7 +325,7 @@ class pdf_einstein extends ModelePDFCommandes
$pdf->AddPage('','',true); $pdf->AddPage('','',true);
if (! empty($tplidx)) $pdf->useTemplate($tplidx); if (! empty($tplidx)) $pdf->useTemplate($tplidx);
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
$pdf->setPage($pagenb+1); $pdf->setPage($pageposafter+1);
} }
} }
else else
@ -412,6 +421,7 @@ class pdf_einstein extends ModelePDFCommandes
// Add line // Add line
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1)) if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1))
{ {
$pdf->setPage($pageposafter);
$pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210))); $pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210)));
//$pdf->SetDrawColor(190,190,200); //$pdf->SetDrawColor(190,190,200);
$pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1); $pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1);
@ -601,7 +611,7 @@ class pdf_einstein extends ModelePDFCommandes
$pdf->SetFont('','B', $default_font_size - 2); $pdf->SetFont('','B', $default_font_size - 2);
$text=$outputlangs->transnoentities("DeliveryDate").':'; $text=$outputlangs->transnoentities("DeliveryDate").':';
$pdf->MultiCell(80, 3, $text, 0, 'L', 0); $pdf->MultiCell(80, 3, $text, 0, 'L', 0);
$pdf->SetFont('','', $default_font_size - 2); $pdf->SetFont('','', $default_font_size - 2);
$pdf->SetXY($posxval, $posy); $pdf->SetXY($posxval, $posy);
$text=dol_print_date($object->date_livraison,'day','',$outputlangs); $text=dol_print_date($object->date_livraison,'day','',$outputlangs);

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr> * Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
@ -109,7 +109,7 @@ class pdf_proforma extends ModelePDFCommandes
$this->posxdiscount=162; $this->posxdiscount=162;
$this->postotalht=174; $this->postotalht=174;
if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxtva=$this->posxup; if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxtva=$this->posxup;
$this->posxpicture=$this->posxtva - 16; // width of images $this->posxpicture=$this->posxtva - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH)?16:$conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH); // width of images
if ($this->page_largeur < 210) // To work with US executive format if ($this->page_largeur < 210) // To work with US executive format
{ {
$this->posxpicture-=20; $this->posxpicture-=20;
@ -227,6 +227,15 @@ class pdf_proforma extends ModelePDFCommandes
$this->atleastonediscount++; $this->atleastonediscount++;
} }
} }
if (empty($this->atleastonediscount))
{
$this->posxpicture+=($this->postotalht - $this->posxdiscount);
$this->posxtva+=($this->postotalht - $this->posxdiscount);
$this->posxup+=($this->postotalht - $this->posxdiscount);
$this->posxqty+=($this->postotalht - $this->posxdiscount);
$this->posxdiscount+=($this->postotalht - $this->posxdiscount);
//$this->postotalht;
}
// New page // New page
$pdf->AddPage(); $pdf->AddPage();
@ -315,7 +324,7 @@ class pdf_proforma extends ModelePDFCommandes
$pdf->AddPage('','',true); $pdf->AddPage('','',true);
if (! empty($tplidx)) $pdf->useTemplate($tplidx); if (! empty($tplidx)) $pdf->useTemplate($tplidx);
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
$pdf->setPage($pagenb+1); $pdf->setPage($pageposafter+1);
} }
} }
else else
@ -411,6 +420,7 @@ class pdf_proforma extends ModelePDFCommandes
// Add line // Add line
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1)) if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1))
{ {
$pdf->setPage($pageposafter);
$pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210))); $pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210)));
//$pdf->SetDrawColor(190,190,200); //$pdf->SetDrawColor(190,190,200);
$pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1); $pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1);

View File

@ -116,15 +116,24 @@ class pdf_strato extends ModelePDFContract
$outputlangs->load("dict"); $outputlangs->load("dict");
$outputlangs->load("companies"); $outputlangs->load("companies");
$outputlangs->load("contracts"); $outputlangs->load("contracts");
$outputlangs->load("interventions");
if ($conf->contrat->dir_output) if ($conf->contrat->dir_output)
{ {
$object->fetch_thirdparty(); $object->fetch_thirdparty();
$objectref = dol_sanitizeFileName($object->ref); // Definition of $dir and $file
$dir = $conf->contrat->dir_output; if ($object->specimen)
if (! preg_match('/specimen/i',$objectref)) $dir.= "/" . $objectref; {
$file = $dir . "/" . $objectref . ".pdf"; $dir = $conf->contrat->dir_output;
$file = $dir . "/SPECIMEN.pdf";
}
else
{
$objectref = dol_sanitizeFileName($object->ref);
$dir = $conf->contrat->dir_output . "/" . $objectref;
$file = $dir . "/" . $objectref . ".pdf";
}
if (! file_exists($dir)) if (! file_exists($dir))
{ {

View File

@ -267,6 +267,7 @@ class pdf_merou extends ModelePdfExpedition
// Add line // Add line
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1)) if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1))
{ {
$pdf->setPage($pageposafter);
$pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210))); $pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210)));
//$pdf->SetDrawColor(190,190,200); //$pdf->SetDrawColor(190,190,200);
$pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1); $pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1);
@ -474,7 +475,7 @@ class pdf_merou extends ModelePdfExpedition
else else
{ {
$text=$this->emetteur->name; $text=$this->emetteur->name;
$pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($text), 0, 'L'); $pdf->MultiCell(70, 3, $outputlangs->convToOutputCharset($text), 0, 'L');
} }
//*********************Entete**************************** //*********************Entete****************************

View File

@ -240,7 +240,7 @@ class pdf_rouget extends ModelePdfExpedition
$pageposbefore=$pdf->getPage(); $pageposbefore=$pdf->getPage();
// Description de la ligne produit // Description de la ligne produit
pdf_writelinedesc($pdf,$object,$i,$outputlangs,150,3,$this->posxdesc,$curY,0,1); pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxqtyordered-10,3,$this->posxdesc,$curY,0,1);
$nexY = $pdf->GetY(); $nexY = $pdf->GetY();
$pageposafter=$pdf->getPage(); $pageposafter=$pdf->getPage();
@ -264,6 +264,7 @@ class pdf_rouget extends ModelePdfExpedition
// Add line // Add line
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1)) if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1))
{ {
$pdf->setPage($pageposafter);
$pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210))); $pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210)));
//$pdf->SetDrawColor(190,190,200); //$pdf->SetDrawColor(190,190,200);
$pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1); $pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1);

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr> * Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
@ -109,7 +109,7 @@ class pdf_crabe extends ModelePDFFactures
$this->posxdiscount=162; $this->posxdiscount=162;
$this->postotalht=174; $this->postotalht=174;
if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxtva=$this->posxup; if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxtva=$this->posxup;
$this->posxpicture=$this->posxtva - 16; // width of images $this->posxpicture=$this->posxtva - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH)?16:$conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH); // width of images
if ($this->page_largeur < 210) // To work with US executive format if ($this->page_largeur < 210) // To work with US executive format
{ {
$this->posxpicture-=20; $this->posxpicture-=20;
@ -228,6 +228,15 @@ class pdf_crabe extends ModelePDFFactures
$this->atleastonediscount++; $this->atleastonediscount++;
} }
} }
if (empty($this->atleastonediscount))
{
$this->posxpicture+=($this->postotalht - $this->posxdiscount);
$this->posxtva+=($this->postotalht - $this->posxdiscount);
$this->posxup+=($this->postotalht - $this->posxdiscount);
$this->posxqty+=($this->postotalht - $this->posxdiscount);
$this->posxdiscount+=($this->postotalht - $this->posxdiscount);
//$this->postotalht;
}
// New page // New page
$pdf->AddPage(); $pdf->AddPage();
@ -318,7 +327,7 @@ class pdf_crabe extends ModelePDFFactures
$pdf->AddPage('','',true); $pdf->AddPage('','',true);
if (! empty($tplidx)) $pdf->useTemplate($tplidx); if (! empty($tplidx)) $pdf->useTemplate($tplidx);
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
$pdf->setPage($pagenb+1); $pdf->setPage($pageposafter+1);
} }
} }
else else
@ -413,6 +422,7 @@ class pdf_crabe extends ModelePDFFactures
// Add line // Add line
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1)) if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1))
{ {
$pdf->setPage($pageposafter);
$pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210))); $pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210)));
//$pdf->SetDrawColor(190,190,200); //$pdf->SetDrawColor(190,190,200);
$pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1); $pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1);

View File

@ -250,7 +250,7 @@ class ImportCsv extends ModeleImports
/** /**
* Return array of next record in input file. * Return array of next record in input file.
* *
* @return Array Array of field values. Data are UTF8 encoded. [fieldpos] => (['val']=>val, ['type']=>-1=null,0=blank,1=string) * @return Array Array of field values. Data are UTF8 encoded. [fieldpos] => (['val']=>val, ['type']=>-1=null,0=blank,1=not empty string)
*/ */
function import_read_record() function import_read_record()
{ {
@ -403,7 +403,7 @@ class ImportCsv extends ModeleImports
{ {
// Set $newval with value to insert and set $listvalues with sql request part for insert // Set $newval with value to insert and set $listvalues with sql request part for insert
$newval=''; $newval='';
if ($arrayrecord[($key-1)]['type'] > 0) $newval=$arrayrecord[($key-1)]['val']; // If type of field is not null or '' but string if ($arrayrecord[($key-1)]['type'] > 0) $newval=$arrayrecord[($key-1)]['val']; // If type of field into input file is not empty string (so defined into input file), we get value
// Make some tests on $newval // Make some tests on $newval
@ -463,37 +463,41 @@ class ImportCsv extends ModeleImports
} }
elseif ($objimport->array_import_convertvalue[0][$val]['rule']=='getcustomercodeifnull') elseif ($objimport->array_import_convertvalue[0][$val]['rule']=='getcustomercodeifnull')
{ {
if (empty($newval) || $newval=='auto') if (empty($newval) || strtolower($newval) == 'auto')
{ {
$this->thirpartyobject->get_codeclient(0,0); $this->thirpartyobject->get_codeclient(0,0);
$newval=$this->thirpartyobject->code_client; $newval=$this->thirpartyobject->code_client;
if (empty($newval)) $arrayrecord[($key-1)]['type']=-1; // If we get empty value, we will use "null"
//print 'code_client='.$newval; //print 'code_client='.$newval;
} }
} }
elseif ($objimport->array_import_convertvalue[0][$val]['rule']=='getsuppliercodeifnull') elseif ($objimport->array_import_convertvalue[0][$val]['rule']=='getsuppliercodeifnull')
{ {
if (empty($newval) || $newval=='auto') if (empty($newval) || strtolower($newval) == 'auto')
{ {
$newval=$this->thirpartyobject->get_codefournisseur(0,1); $newval=$this->thirpartyobject->get_codefournisseur(0,1);
$newval=$this->thirpartyobject->code_fournisseur; $newval=$this->thirpartyobject->code_fournisseur;
if (empty($newval)) $arrayrecord[($key-1)]['type']=-1; // If we get empty value, we will use "null"
//print 'code_fournisseur='.$newval; //print 'code_fournisseur='.$newval;
} }
} }
elseif ($objimport->array_import_convertvalue[0][$val]['rule']=='getcustomeraccountancycodeifnull') elseif ($objimport->array_import_convertvalue[0][$val]['rule']=='getcustomeraccountancycodeifnull')
{ {
if (empty($newval) || $newval=='auto') if (empty($newval) || strtolower($newval) == 'auto')
{ {
$this->thirpartyobject->get_codecompta('customer'); $this->thirpartyobject->get_codecompta('customer');
$newval=$this->thirpartyobject->code_compta; $newval=$this->thirpartyobject->code_compta;
if (empty($newval)) $arrayrecord[($key-1)]['type']=-1; // If we get empty value, we will use "null"
//print 'code_compta='.$newval; //print 'code_compta='.$newval;
} }
} }
elseif ($objimport->array_import_convertvalue[0][$val]['rule']=='getsupplieraccountancycodeifnull') elseif ($objimport->array_import_convertvalue[0][$val]['rule']=='getsupplieraccountancycodeifnull')
{ {
if (empty($newval) || $newval=='auto') if (empty($newval) || strtolower($newval) == 'auto')
{ {
$this->thirpartyobject->get_codecompta('supplier'); $this->thirpartyobject->get_codecompta('supplier');
$newval=$this->thirpartyobject->code_compta_fournisseur; $newval=$this->thirpartyobject->code_compta_fournisseur;
if (empty($newval)) $arrayrecord[($key-1)]['type']=-1; // If we get empty value, we will use "null"
//print 'code_compta_fournisseur='.$newval; //print 'code_compta_fournisseur='.$newval;
} }
} }
@ -560,6 +564,7 @@ class ImportCsv extends ModeleImports
if ($listfields) { $listfields.=', '; $listvalues.=', '; } if ($listfields) { $listfields.=', '; $listvalues.=', '; }
$listfields.=$fieldname; $listfields.=$fieldname;
// Note: arrayrecord (and 'type') is filled with ->import_read_record called by import.php page before calling import_insert
if (empty($newval) && $arrayrecord[($key-1)]['type'] < 0) $listvalues.=($newval=='0'?$newval:"null"); if (empty($newval) && $arrayrecord[($key-1)]['type'] < 0) $listvalues.=($newval=='0'?$newval:"null");
elseif (empty($newval) && $arrayrecord[($key-1)]['type'] == 0) $listvalues.="''"; elseif (empty($newval) && $arrayrecord[($key-1)]['type'] == 0) $listvalues.="''";
else $listvalues.="'".$this->db->escape($newval)."'"; else $listvalues.="'".$this->db->escape($newval)."'";
@ -664,4 +669,5 @@ function cleansep($value)
return str_replace(array(',',';'),'/',$value); return str_replace(array(',',';'),'/',$value);
}; };
?>
?>

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be> * Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be>
* Copyright (C) 2008 Chiptronik * Copyright (C) 2008 Chiptronik
@ -223,15 +223,24 @@ class pdf_typhon extends ModelePDFDeliveryOrder
$pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
/* /*
// Positionne $this->atleastonediscount si on a au moins une remise // Positionne $this->atleastonediscount si on a au moins une remise
for ($i = 0 ; $i < $nblines ; $i++) for ($i = 0 ; $i < $nblines ; $i++)
{ {
if ($object->lines[$i]->remise_percent) if ($object->lines[$i]->remise_percent)
{ {
$this->atleastonediscount++; $this->atleastonediscount++;
} }
} }
*/ if (empty($this->atleastonediscount))
{
$this->posxpicture+=($this->postotalht - $this->posxdiscount);
$this->posxtva+=($this->postotalht - $this->posxdiscount);
$this->posxup+=($this->postotalht - $this->posxdiscount);
$this->posxqty+=($this->postotalht - $this->posxdiscount);
$this->posxdiscount+=($this->postotalht - $this->posxdiscount);
//$this->postotalht;
}
*/
// New page // New page
$pdf->AddPage(); $pdf->AddPage();
@ -307,7 +316,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
$pdf->AddPage('','',true); $pdf->AddPage('','',true);
if (! empty($tplidx)) $pdf->useTemplate($tplidx); if (! empty($tplidx)) $pdf->useTemplate($tplidx);
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
$pdf->setPage($pagenb+1); $pdf->setPage($pageposafter+1);
} }
} }
else else
@ -370,6 +379,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
// Add line // Add line
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblines - 1)) if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblines - 1))
{ {
$pdf->setPage($pageposafter);
$pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210))); $pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210)));
//$pdf->SetDrawColor(190,190,200); //$pdf->SetDrawColor(190,190,200);
$pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1); $pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1);

View File

@ -222,12 +222,15 @@ class pdf_baleine extends ModelePDFProjects
$pdf->MultiCell(20, 3, $dateend, 0, 'L'); $pdf->MultiCell(20, 3, $dateend, 0, 'L');
$pageposafter=$pdf->getPage();
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut $pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
$nexY = $pdf->GetY(); $nexY = $pdf->GetY();
// Add line // Add line
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1)) if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1))
{ {
$pdf->setPage($pageposafter);
$pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210))); $pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210)));
//$pdf->SetDrawColor(190,190,200); //$pdf->SetDrawColor(190,190,200);
$pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1); $pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1);

View File

@ -254,6 +254,15 @@ class pdf_azur extends ModelePDFPropales
$this->atleastonediscount++; $this->atleastonediscount++;
} }
} }
if (empty($this->atleastonediscount))
{
$this->posxpicture+=($this->postotalht - $this->posxdiscount);
$this->posxtva+=($this->postotalht - $this->posxdiscount);
$this->posxup+=($this->postotalht - $this->posxdiscount);
$this->posxqty+=($this->postotalht - $this->posxdiscount);
$this->posxdiscount+=($this->postotalht - $this->posxdiscount);
//$this->postotalht;
}
// New page // New page
$pdf->AddPage(); $pdf->AddPage();
@ -332,7 +341,7 @@ class pdf_azur extends ModelePDFPropales
$pdf->AddPage('','',true); $pdf->AddPage('','',true);
if (! empty($tplidx)) $pdf->useTemplate($tplidx); if (! empty($tplidx)) $pdf->useTemplate($tplidx);
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
$pdf->setPage($pagenb+1); $pdf->setPage($pageposbefore+1);
$curY = $tab_top_newpage; $curY = $tab_top_newpage;
$showpricebeforepagebreak=0; $showpricebeforepagebreak=0;
@ -370,7 +379,7 @@ class pdf_azur extends ModelePDFPropales
$pdf->AddPage('','',true); $pdf->AddPage('','',true);
if (! empty($tplidx)) $pdf->useTemplate($tplidx); if (! empty($tplidx)) $pdf->useTemplate($tplidx);
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
$pdf->setPage($pagenb+1); $pdf->setPage($pageposafter+1);
} }
} }
else else
@ -387,6 +396,7 @@ class pdf_azur extends ModelePDFPropales
$nexY = $pdf->GetY(); $nexY = $pdf->GetY();
$pageposafter=$pdf->getPage(); $pageposafter=$pdf->getPage();
$pdf->setPage($pageposbefore); $pdf->setPage($pageposbefore);
$pdf->setTopMargin($this->marge_haute); $pdf->setTopMargin($this->marge_haute);
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
@ -468,6 +478,7 @@ class pdf_azur extends ModelePDFPropales
// Add line // Add line
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1)) if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1))
{ {
$pdf->setPage($pageposafter);
$pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210))); $pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210)));
//$pdf->SetDrawColor(190,190,200); //$pdf->SetDrawColor(190,190,200);
$pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1); $pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1);

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es> /* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010-2012 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2010-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -58,7 +58,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
* Constructor * Constructor
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @param Societe $object Supplier invoice * @param Object $object Supplier invoice
*/ */
function __construct($db,$object) function __construct($db,$object)
{ {
@ -105,7 +105,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
$this->posxdiscount=162; $this->posxdiscount=162;
$this->postotalht=174; $this->postotalht=174;
//if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxtva=$this->posxup; //if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxtva=$this->posxup;
$this->posxpicture=$this->posxtva - 16; // width of images $this->posxpicture=$this->posxtva - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH)?16:$conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH); // width of images
if ($this->page_largeur < 210) // To work with US executive format if ($this->page_largeur < 210) // To work with US executive format
{ {
$this->posxpicture-=20; $this->posxpicture-=20;
@ -227,6 +227,15 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
$this->atleastonediscount++; $this->atleastonediscount++;
} }
} }
if (empty($this->atleastonediscount))
{
$this->posxpicture+=($this->postotalht - $this->posxdiscount);
$this->posxtva+=($this->postotalht - $this->posxdiscount);
$this->posxup+=($this->postotalht - $this->posxdiscount);
$this->posxqty+=($this->postotalht - $this->posxdiscount);
$this->posxdiscount+=($this->postotalht - $this->posxdiscount);
//$this->postotalht;
}
// New page // New page
$pdf->AddPage(); $pdf->AddPage();
@ -281,7 +290,39 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
// Description of product line // Description of product line
$curX = $this->posxdesc-1; $curX = $this->posxdesc-1;
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,3,$curX,$curY,$hideref,$hidedesc,1); $showpricebeforepagebreak=1;
$pdf->startTransaction();
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,3,$curX,$curY,$hideref,$hidedesc,1);
$pageposafter=$pdf->getPage();
if ($pageposafter > $pageposbefore) // There is a pagebreak
{
$pdf->rollbackTransaction(true);
$pageposafter=$pageposbefore;
//print $pageposafter.'-'.$pageposbefore;exit;
$pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it.
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,4,$curX,$curY,$hideref,$hidedesc);
$posyafter=$pdf->GetY();
if ($posyafter > ($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))) // There is no space left for total+free text
{
if ($i == ($nblignes-1)) // No more lines, and no space left to show total, so we create a new page
{
$pdf->AddPage('','',true);
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
$pdf->setPage($pageposafter+1);
}
}
else
{
// We found a page break
$showpricebeforepagebreak=0;
}
}
else // No pagebreak
{
$pdf->commitTransaction();
}
$nexY = $pdf->GetY(); $nexY = $pdf->GetY();
$pageposafter=$pdf->getPage(); $pageposafter=$pdf->getPage();
@ -290,7 +331,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
// We suppose that a too long description is moved completely on next page // We suppose that a too long description is moved completely on next page
if ($pageposafter > $pageposbefore) { if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) {
$pdf->setPage($pageposafter); $curY = $tab_top_newpage; $pdf->setPage($pageposafter); $curY = $tab_top_newpage;
} }
@ -301,7 +342,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
{ {
$vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails); $vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY($this->posxtva, $curY); $pdf->SetXY($this->posxtva, $curY);
$pdf->MultiCell($this->posxup-$this->posxtva-0.8, 3, $vat_rate, 0, 'R'); $pdf->MultiCell($this->posxup-$this->posxtva-1, 3, $vat_rate, 0, 'R');
} }
// Unit price before discount // Unit price before discount
@ -322,7 +363,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
// Total HT line // Total HT line
$total_excl_tax = pdf_getlinetotalexcltax($object, $i, $outputlangs); $total_excl_tax = pdf_getlinetotalexcltax($object, $i, $outputlangs);
$pdf->SetXY($this->postotalht, $curY); $pdf->SetXY($this->postotalht, $curY);
$pdf->MultiCell(26, 3, $total_excl_tax, 0, 'R', 0); $pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->postotalht, 3, $total_excl_tax, 0, 'R', 0);
// Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva // Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva
$tvaligne=$object->lines[$i]->total_tva; $tvaligne=$object->lines[$i]->total_tva;
@ -344,6 +385,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
// Add line // Add line
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1)) if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1))
{ {
$pdf->setPage($pageposafter);
$pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210))); $pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210)));
//$pdf->SetDrawColor(190,190,200); //$pdf->SetDrawColor(190,190,200);
$pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1); $pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1);
@ -368,6 +410,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
$pagenb++; $pagenb++;
$pdf->setPage($pagenb); $pdf->setPage($pagenb);
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
} }
if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak) if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak)
{ {
@ -384,6 +427,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
$pdf->AddPage(); $pdf->AddPage();
if (! empty($tplidx)) $pdf->useTemplate($tplidx); if (! empty($tplidx)) $pdf->useTemplate($tplidx);
$pagenb++; $pagenb++;
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
} }
} }

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be> * Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be>
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
@ -110,7 +110,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$this->posxdiscount=162; $this->posxdiscount=162;
$this->postotalht=174; $this->postotalht=174;
//if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxtva=$this->posxup; //if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxtva=$this->posxup;
$this->posxpicture=$this->posxtva - 16; // width of images $this->posxpicture=$this->posxtva - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH)?16:$conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH); // width of images
if ($this->page_largeur < 210) // To work with US executive format if ($this->page_largeur < 210) // To work with US executive format
{ {
$this->posxpicture-=20; $this->posxpicture-=20;
@ -235,6 +235,15 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$this->atleastonediscount++; $this->atleastonediscount++;
} }
} }
if (empty($this->atleastonediscount))
{
$this->posxpicture+=($this->postotalht - $this->posxdiscount);
$this->posxtva+=($this->postotalht - $this->posxdiscount);
$this->posxup+=($this->postotalht - $this->posxdiscount);
$this->posxqty+=($this->postotalht - $this->posxdiscount);
$this->posxdiscount+=($this->postotalht - $this->posxdiscount);
//$this->postotalht;
}
// New page // New page
$pdf->AddPage(); $pdf->AddPage();
@ -309,7 +318,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$pdf->AddPage('','',true); $pdf->AddPage('','',true);
if (! empty($tplidx)) $pdf->useTemplate($tplidx); if (! empty($tplidx)) $pdf->useTemplate($tplidx);
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
$pdf->setPage($pagenb+1); $pdf->setPage($pageposafter+1);
} }
} }
else else
@ -403,6 +412,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
// Add line // Add line
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1)) if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1))
{ {
$pdf->setPage($pageposafter);
$pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210))); $pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210)));
//$pdf->SetDrawColor(190,190,200); //$pdf->SetDrawColor(190,190,200);
$pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1); $pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1);

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr> /* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2013 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2013-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -18,16 +18,17 @@
*/ */
$langs->load("link"); $langs->load("link");
if (empty($relativepathwithnofile)) $relativepathwithnofile='';
/* /*
* Confirm suppression * Confirm form to delete
*/ */
if ($action == 'delete') if ($action == 'delete')
{ {
$langs->load("companies"); // Need for string DeleteFile+ConfirmDeleteFiles $langs->load("companies"); // Need for string DeleteFile+ConfirmDeleteFiles
$ret = $form->form_confirm( $ret = $form->form_confirm(
$_SERVER["PHP_SELF"] . '?id=' . $object->id . '&urlfile=' . urlencode(GETPOST("urlfile")) . '&linkid=' . GETPOST('linkid', 'int'), $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&urlfile=' . urlencode(GETPOST("urlfile")) . '&linkid=' . GETPOST('linkid', 'int') . (empty($param)?'':$param),
$langs->trans('DeleteFile'), $langs->trans('DeleteFile'),
$langs->trans('ConfirmDeleteFile'), $langs->trans('ConfirmDeleteFile'),
'confirm_deletefile', 'confirm_deletefile',
@ -58,11 +59,11 @@ $formfile->list_of_documents(
$modulepart, $modulepart,
$param, $param,
0, 0,
'', $relativepathwithnofile, // relative path with no file. For example "moduledir/0/1"
$permission $permission
); );
print "<br>"; print "<br>";
//List of links //List of links
$formfile->listOfLinks($object, $permission, $action, GETPOST('linkid', 'int')); $formfile->listOfLinks($object, $permission, $action, GETPOST('linkid', 'int'), $param);
print "<br>"; print "<br>";

View File

@ -74,7 +74,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes')
setEventMessage($langs->trans("ErrorFailedToDeleteLink", $link->label), 'errors'); setEventMessage($langs->trans("ErrorFailedToDeleteLink", $link->label), 'errors');
} }
} }
header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id); header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id.($withproject?'&withproject=1':''));
exit; exit;
} }
} }

View File

@ -212,8 +212,9 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer)
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), 'errors'); setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), 'errors');
$error++; $error++;
} }
if (! GETPOST('addline_predefined') && (! GETPOST('pu') || GETPOST('pu')=='')) // Unit price can be 0 but not '' if (! GETPOST('addline_predefined') && ( GETPOST('pu')==='')) // Unit price can be 0 but not ''
{ {
setEventMessage($langs->trans($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('UnitPrice'))), 'errors'); setEventMessage($langs->trans($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('UnitPrice'))), 'errors');
$error++; $error++;
} }
@ -232,7 +233,7 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer)
// Ecrase $pu par celui du produit // Ecrase $pu par celui du produit
// Ecrase $desc par celui du produit // Ecrase $desc par celui du produit
// Ecrase $txtva par celui du produit // Ecrase $txtva par celui du produit
if (GETPOST('addline_predefined') || GETPOST('idprodfournprice')) // With combolist idprodfournprice is > 0 or -1. With autocomplete, idprodfournprice is > 0 or '' if ((GETPOST('addline_predefined') || GETPOST('idprodfournprice')) && ( GETPOST('pu')!=='')) // With combolist idprodfournprice is > 0 or -1. With autocomplete, idprodfournprice is > 0 or ''
{ {
$idprod=0; $idprod=0;
$productsupplier = new ProductFournisseur($db); $productsupplier = new ProductFournisseur($db);
@ -292,7 +293,7 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer)
setEventMessage($langs->trans("ErrorQtyTooLowForThisSupplier"), 'errors'); setEventMessage($langs->trans("ErrorQtyTooLowForThisSupplier"), 'errors');
} }
} }
else else if( GETPOST('pu')!=='' || GETPOST('amountttc')!=='' )
{ {
$type=$_POST["type"]; $type=$_POST["type"];
$desc=$_POST['dp_desc']; $desc=$_POST['dp_desc'];
@ -319,7 +320,7 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer)
$ttc = price2num($_POST['amountttc']); $ttc = price2num($_POST['amountttc']);
$ht = $ttc / (1 + ($tauxtva / 100)); $ht = $ttc / (1 + ($tauxtva / 100));
$price_base_type = 'HT'; $price_base_type = 'HT';
$result=$object->addline($desc, $ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, 0, 0, '', $remise_percent, $price_base_type, $ttc, $type); $result=$object->addline($desc, $ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, 0, 0, '', $remise_percent, $price_base_type, $ttc, $type);
} }
} }
} }

View File

@ -1043,7 +1043,7 @@ else
$idGroupValid = $cp->getConfCP('userGroup'); $idGroupValid = $cp->getConfCP('userGroup');
$validator = new UserGroup($db,$idGroupValid); $validator = new UserGroup($db,$idGroupValid);
$valideur = $validator->listUsersForGroup(); $valideur = $validator->listUsersForGroup('',1);
print '<td>'; print '<td>';
$form->select_users($cp->fk_validator,"valideur",1,"",0,$valideur,''); $form->select_users($cp->fk_validator,"valideur",1,"",0,$valideur,'');

View File

@ -20,6 +20,7 @@ Language_en_US=English (United States)
Language_en_ZA=English (South Africa) Language_en_ZA=English (South Africa)
Language_es_ES=Spanish Language_es_ES=Spanish
Language_es_AR=Spanish (Argentina) Language_es_AR=Spanish (Argentina)
Language_es_CL=Spanish (Chile)
Language_es_HN=Spanish (Honduras) Language_es_HN=Spanish (Honduras)
Language_es_MX=Spanish (Mexico) Language_es_MX=Spanish (Mexico)
Language_es_PY=Spanish (Paraguay) Language_es_PY=Spanish (Paraguay)

View File

@ -0,0 +1,23 @@
Module20Name=Cotizaciones
Module20Desc=Gestión de cotizaciones/propuestas comerciales
Permission21=Consultar cotizaciones
Permission22=Crear/modificar cotizaciones
Permission24=Validar cotizaciones
Permission25=Enviar las cotizaciones
Permission26=Cerrar cotizaciones
Permission27=Eliminar cotizaciones
Permission28=Exportar las cotizaciones
DictionnarySource=Orígenes de cotizaciones/pedidos
VATIsUsedDesc=El tipo de IVA propuesto por defecto en las creaciones de cotizaciones, facturas, pedidos, etc. Responde a la siguiente regla:<br>Si el vendedor no está sujeto a IVA, IVA por defecto=0. Final de regla.<br>Si el país del vendedor= país del comprador entonces IVA por defecto=IVA del producto vendido. Final de regla.<br>Si vendedor y comprador residen en la Comunidad Europea y el bien vendido= nuevo medio de transportes (auto, barco, avión), IVA por defecto=0 (el IVA debe ser pagado por comprador a la hacienda pública de su país y no al vendedor). Final de regla<br>Si vendedor y comprador residen en la Comunidad Europea y comprador= particular o empresa sin NIF intracomunitario entonces IVA por defecto=IVA del producto vendido. Final de regla.<br>Si vendedor y comprador residen en la Comunidad Europea y comprador= empresa con NIF intracomunitario entonces IVA por defecto=0. Final de regla.<br>Si no, IVA propuesto por defecto=0. Final de regla.<br>
VATIsNotUsedDesc=El tipo de IVA propuesto por defecto es 0. Este es el caso de asociaciones, particulares o algunas pequeñas sociedades.
VATIsUsedExampleFR=En Francia, se trata de las sociedades u organismos que eligen un régimen fiscal general (General simplificado o General normal), régimen en el cual se declara el IVA.
Delays_MAIN_DELAY_PROPALS_TO_CLOSE=Tolerancia de retraso antes de la alerta (en días) sobre cotizaciones a cerrar
Delays_MAIN_DELAY_PROPALS_TO_BILL=Tolerancia de retraso antes de la alerta (en días) sobre cotizaciones no facturadas
WebCalAddEventOnStatusPropal=Añadir evento en el calendario en el cambio de estado de las cotizaciones
PropalSetup=Configuración del módulo Cotizaciones
ProposalsNumberingModules=Módulos de numeración de cotizaciones
ProposalsPDFModules=Modelos de documentos de cotizaciones
HideTreadedPropal=Ocultar las cotizaciones procesados del listado
FreeLegalTextOnProposal=Texto libre en cotizaciones
WatermarkOnDraftProposal=Marca de agua en cotizaciones borrador (en caso de estar vacío)
FCKeditorForProductDetails=Creación/edición WYSIWIG de las líneas de detalle de los productos (en pedidos, cotizaciones, facturas, etc.)

View File

@ -0,0 +1,2 @@
PropalValidatedInDolibarr=Cotización %s validada
ProposalSentByEMail=Cotización %s enviada por e-mail

View File

@ -0,0 +1 @@
RelatedCommercialProposals=Cotizaciones asociadas

View File

@ -0,0 +1,5 @@
BoxLastProposals=Últimas cotizaciones
BoxTitleLastPropals=Las %s últimas cotizaciones registradas
NoRecordedProposals=Sin cotizaciones registradas
BoxProposalsPerMonth=Cotizaciones por mes
ForProposals=Cotizaciones

View File

@ -0,0 +1,4 @@
SendPropalRef=Envío de la cotización %s
ActionAC_PROP=Envío cotización por correo
DraftPropals=Cotizaciones borrador
SearchPropal=Buscar una cotización

View File

@ -0,0 +1,2 @@
ContactForProposals=Contacto de cotizaciones
NoContactForAnyProposal=Este contacto no es contacto de ninguna cotización

View File

@ -0,0 +1 @@
ProposalStats=Estadísticas de cotizaciones

View File

@ -0,0 +1,2 @@
DocsProposals=Documentos cotizaciones
ECMDocsByProposals=Documentos asociados a cotizaciones

View File

@ -0,0 +1 @@
MigrationProposal=Migración de datos de cotizaciones

View File

@ -0,0 +1 @@
CommercialProposalsShort=Cotizaciones

View File

@ -0,0 +1 @@
TurnoverOrBudget=Volumen de ventas (empresa) o Cotización (asociación o colectivo)

View File

@ -0,0 +1 @@
OrderSource0=Cotización

View File

@ -0,0 +1,9 @@
Notify_PROPAL_VALIDATE=Validación cotización cliente
Notify_PROPAL_SENTBYMAIL=Envío cotización por e-mail
PredefinedMailContentSendProposal=Buenos días, __CONTACTCIVNAME__ \n\n Nos ponemos en contacto con usted para facilitarle la cotización __PROPREF__\n\n Ante cualquier duda, consúltenos y será atendido a la mayor brevedad posible.\n\n __PERSONALIZED__Cordialmente\n\n__SIGNATURE__
NumberOfProposals=Número de cotizaciones en los últimos 12 meses
NumberOfUnitsProposals=Número de unidades en las cotizaciones en los últimos 12 meses
EMailTextProposalValidated=La cotización %s que le concierne ha sido validado.
PropalClosedSignedInDolibarr=Cotización %s firmada en Dolibarr
PropalClosedRefusedInDolibarr=Cotización %s rechazada en Dolibarr
PropalValidatedInDolibarr=Cotización %s validada en Dolibarr

View File

@ -0,0 +1,3 @@
AddToMyProposals=Añadir a mis cotizaciones
AddToOtherProposals=Añadir a otras cotizaciones
NoteNotVisibleOnBill=Nota (no visible en las facturas, cotizaciones, etc.)

View File

@ -0,0 +1 @@
ListProposalsAssociatedProject=Listado de cotizaciones asociadas al proyecto

View File

@ -0,0 +1,62 @@
Proposals=Cotizaciones
Proposal=Cotización
ProposalShort=Cotización
ProposalsDraft=Cotizaciones borrador
ProposalDraft=Cotización borrador
ProposalsOpened=Cotizaciones abiertas
Prop=Cotizaciones
CommercialProposal=Cotización
CommercialProposals=Cotizaciones
ProposalCard=Ficha cotización
NewProp=Nueva cotización
NewProposal=Nueva cotización
NewPropal=Nueva cotización
DeletePop=Eliminar cotización
ValidateProp=Validar cotización
AddProp=Crear cotización
ConfirmDeleteProp=¿Está seguro de querer eliminar esta cotización?
ConfirmValidateProp=¿Está seguro de querer validar esta cotización bajo la referencia <b>%s</b> ?
LastClosedProposals=Las %s últimas cotizaciones cerradas
LastModifiedProposals=Las %s últimas cotizaciones modificadas
AllPropals=Todas las cotizacioness
LastProposals=Últimas cotizaciones
SearchAProposal=Buscar una cotización
ProposalsStatistics=Estadísticas de cotizaciones
NumberOfUnitsProposals=Número de unidades en las cotizaciones en los últimos 12 meses
NbOfProposals=Número cotizaciones
ShowPropal=Ver cotización
PropalStatusValidated=Validado (cotización abierta)
PropalStatusOpened=Validado (cotización abierta)
PropalsToClose=Cotizaciones a cerrar
PropalsToBill=Cotizaciones firmadas a facturar
ListOfProposals=Listado de cotizaciones
ActionsOnPropal=Eventos sobre la cotización
NoOpenedPropals=Sin cotizaciones abiertos
NoOtherOpenedPropals=Ninguna otra cotización abierta
RefProposal=Ref. cotización
SendPropalByMail=Enviar cotización por e-mail
AssociatedDocuments=Documentos asociados a la cotizacion
DatePropal=Fecha cotización
ErrorPropalNotFound=Presupuesto %s inexistente
Estimate=Cotización:
EstimateShort=Cotización
OtherPropals=Otras cotizaciones
AddToDraftProposals=Añadir a cotización borrador
NoDraftProposals=Sin cotizaciones borrador
CopyPropalFrom=Crear cotización por copia de una existente
CreateEmptyPropal=Crear cotización vacía
UseCustomerContactAsPropalRecipientIfExist=Utilizar dirección contacto de seguimiento de cliente definido en vez de la dirección del tercero como destinatario de las cotizaciones
ClonePropal=Clonar cotización
ConfirmClonePropal=¿Está seguro de querer clonar la cotización <b>%s</b>?
ConfirmReOpenProp=¿Está seguro de querer reabrir la cotización <b>%s</b> ?
ProposalsAndProposalsLines=Cotizaciones a clientes y líneas de cotizaciones
ProposalLine=Línea de cotización
##### Types de contacts #####
TypeContact_propal_internal_SALESREPFOLL=Comercial seguimiento cotización
TypeContact_propal_external_BILLING=Contacto cliente de facturación cotización
TypeContact_propal_external_CUSTOMER=Contacto cliente seguimiento cotización
# Document models
DocModelAzurDescription=Modelo de cotización completa (logo...)
DocModelJauneDescription=Modelo de cotización Jaune
DefaultModelPropalToBill=Modelo por defecto al cerrar una cotización (a facturar)
DefaultModelPropalClosed=Modelo por defecto al cerrar una cotización (no facturado)

View File

@ -0,0 +1,3 @@
descWORKFLOW_PROPAL_AUTOCREATE_ORDER=Crear un pedido de cliente automáticamente a la firma de una cotización
descWORKFLOW_PROPAL_AUTOCREATE_INVOICE=Crear una factura a cliente automáticamente a la firma de una cotización
descWORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL=Clasificar como facturada la cotización cuando el pedido de cliente relacionado se clasifique como pagado

View File

@ -144,9 +144,8 @@ if ($object->id > 0)
print "</table>\n"; print "</table>\n";
print "</div>\n"; print "</div>\n";
$modulepart = 'projet'; $modulepart = 'project';
$permission = ($userWrite > 0); $permission = ($userWrite > 0);
$param = '&id=' . $object->id;
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php'; include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
} }

View File

@ -110,6 +110,7 @@ if ($id > 0 || ! empty($ref))
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php'; include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php';
/* /*
* View * View
*/ */
@ -229,9 +230,11 @@ if ($object->id > 0)
print '<br>'; print '<br>';
$modulepart = 'projet'; $param='';
if ($withproject) $param .= '&withproject=1';
$modulepart = 'project_task';
$permission = $user->rights->projet->creer; $permission = $user->rights->projet->creer;
$param = '&id=' . $object->id; $relativepathwithnofile=dol_sanitizeFileName($projectstatic->ref).'/'.dol_sanitizeFileName($object->ref).'/';
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php'; include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
} }
else else