Merge branch 'develop' of git+ssh://git@github.com/Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
e5f55db2c1
@ -32,6 +32,7 @@ For users:
|
||||
- New: Add box for last expired services.
|
||||
- New: Reduce seriously size of packages.
|
||||
- New: Can define country code for import.
|
||||
- New: When invoice was generated from order, order date is visible on PDF, after order ref.
|
||||
- Fix: Can use POS module with several concurrent users.
|
||||
|
||||
For developers:
|
||||
|
||||
@ -2959,7 +2959,7 @@ else
|
||||
$somethingshown=$object->showLinkedObjectBlock();
|
||||
|
||||
// Link for paypal payment
|
||||
if ($conf->paypal->enabled)
|
||||
if ($conf->paypal->enabled && $object->statut != 0)
|
||||
{
|
||||
include_once(DOL_DOCUMENT_ROOT.'/paypal/lib/paypal.lib.php');
|
||||
print showPaypalPaymentUrl('invoice',$object->ref);
|
||||
|
||||
@ -581,8 +581,7 @@ class Menubase
|
||||
//$objm = $this->db->fetch_object($resql);
|
||||
$menu = $this->db->fetch_array($resql);
|
||||
|
||||
// Define $chaine
|
||||
$chaine="";
|
||||
// Define $title
|
||||
$title = $langs->trans($menu['titre']);
|
||||
if ($title == $menu['titre']) // Translation not found
|
||||
{
|
||||
@ -594,17 +593,13 @@ class Menubase
|
||||
if (preg_match("/\//",$menu['titre'])) // To manage translation when title is string1/string2
|
||||
{
|
||||
$tab_titre = explode("/",$menu['titre']);
|
||||
$chaine = $langs->trans($tab_titre[0])."/".$langs->trans($tab_titre[1]);
|
||||
$title = $langs->trans($tab_titre[0])."/".$langs->trans($tab_titre[1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$chaine = $langs->trans($menu['titre']);
|
||||
$title = $langs->trans($menu['titre']);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$chaine = $title;
|
||||
}
|
||||
|
||||
// Define $right
|
||||
$perms = true;
|
||||
@ -620,30 +615,9 @@ class Menubase
|
||||
{
|
||||
$enabled = verifCond($menu['enabled']);
|
||||
if ($conf->use_javascript_ajax && $conf->global->MAIN_MENU_USE_JQUERY_ACCORDION && preg_match('/^\$leftmenu/',$menu['enabled'])) $enabled=1;
|
||||
//print "verifCond chaine=".$chaine." rowid=".$menu['rowid']." ".$menu['enabled'].":".$enabled."<br>\n";
|
||||
//print "verifCond title=".$title." rowid=".$menu['rowid']." ".$menu['enabled'].":".$enabled."<br>\n";
|
||||
}
|
||||
|
||||
/*
|
||||
// 0=rowid, 1=fk_menu, 2=url, 3=text, 4=perms, 5=target, 8=mainmenu
|
||||
$tabMenu[$b][0] = $menu['rowid'];
|
||||
$tabMenu[$b][1] = $menu['fk_menu'];
|
||||
$tabMenu[$b][2] = $menu['url'];
|
||||
if (! preg_match("/^(http:\/\/|https:\/\/)/i",$tabMenu[$b][2]))
|
||||
{
|
||||
if (preg_match('/\?/',$tabMenu[$b][2])) $tabMenu[$b][2].='&idmenu='.$menu['rowid'];
|
||||
else $tabMenu[$b][2].='?idmenu='.$menu['rowid'];
|
||||
}
|
||||
$tabMenu[$b][3] = $chaine;
|
||||
$tabMenu[$b][5] = $menu['target'];
|
||||
$tabMenu[$b][6] = $menu['leftmenu'];
|
||||
if (! isset($tabMenu[$b][4])) $tabMenu[$b][4] = $perms;
|
||||
else $tabMenu[$b][4] = ($tabMenu[$b][4] && $perms);
|
||||
if (! isset($tabMenu[$b][7])) $tabMenu[$b][7] = $enabled;
|
||||
else $tabMenu[$b][7] = ($tabMenu[$b][7] && $enabled);
|
||||
$tabMenu[$b][8] = $menu['mainmenu'];
|
||||
$tabMenu[$b][9] = $menu['type'];
|
||||
$tabMenu[$b][10] = $menu['langs'];
|
||||
*/
|
||||
// We complete tabMenu
|
||||
$tabMenu[$b]['rowid'] = $menu['rowid'];
|
||||
$tabMenu[$b]['fk_menu'] = $menu['fk_menu'];
|
||||
@ -653,7 +627,7 @@ class Menubase
|
||||
if (preg_match('/\?/',$tabMenu[$b]['url'])) $tabMenu[$b]['url'].='&idmenu='.$menu['rowid'];
|
||||
else $tabMenu[$b]['url'].='?idmenu='.$menu['rowid'];
|
||||
}
|
||||
$tabMenu[$b]['titre'] = $chaine;
|
||||
$tabMenu[$b]['titre'] = $title;
|
||||
$tabMenu[$b]['target'] = $menu['target'];
|
||||
$tabMenu[$b]['leftmenu'] = $menu['leftmenu'];
|
||||
if (! isset($tabMenu[$b]['perms'])) $tabMenu[$b]['perms'] = $perms;
|
||||
|
||||
@ -1044,16 +1044,16 @@ class pdf_crabe extends ModelePDFFactures
|
||||
if ($object->type == 2) $title=$outputlangs->transnoentities("InvoiceAvoir");
|
||||
if ($object->type == 3) $title=$outputlangs->transnoentities("InvoiceDeposit");
|
||||
if ($object->type == 4) $title=$outputlangs->transnoentities("InvoiceProFormat");
|
||||
$pdf->MultiCell(100, 4, $title, '', 'R');
|
||||
$pdf->MultiCell(100, 3, $title, '', 'R');
|
||||
|
||||
$pdf->SetFont('','B', $default_font_size + 2);
|
||||
$pdf->SetFont('','B', $default_font_size);
|
||||
|
||||
$posy+=6;
|
||||
$posy+=5;
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("Ref")." : " . $outputlangs->convToOutputCharset($object->ref), '', 'R');
|
||||
|
||||
$posy+=2;
|
||||
$posy+=1;
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
|
||||
$objectidnext=$object->getIdReplacingInvoice('validated');
|
||||
@ -1109,6 +1109,8 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("CustomerCode")." : " . $outputlangs->transnoentities($object->client->code_client), '', 'R');
|
||||
}
|
||||
|
||||
$posy+=2;
|
||||
|
||||
// Add list of linked orders and proposals
|
||||
// TODO mutualiser
|
||||
$object->fetchObjectLinked();
|
||||
@ -1121,10 +1123,13 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$num=count($objects);
|
||||
for ($i=0;$i<$num;$i++)
|
||||
{
|
||||
$posy+=4;
|
||||
$posy+=3;
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
$pdf->SetFont('','', $default_font_size - 2);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("RefProposal")." : ".$outputlangs->transnoentities($objects[$i]->ref), '', 'R');
|
||||
$posy+=3;
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("DatePropal")." : ".dol_print_date($objects[$i]->date,'day','',$outputlangs), '', 'R');
|
||||
}
|
||||
}
|
||||
else if ($objecttype == 'commande')
|
||||
@ -1133,12 +1138,15 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$num=count($objects);
|
||||
for ($i=0;$i<$num;$i++)
|
||||
{
|
||||
$posy+=4;
|
||||
$posy+=3;
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
$pdf->SetFont('','', $default_font_size - 2);
|
||||
$text=$objects[$i]->ref;
|
||||
if ($objects[$i]->ref_client) $text.=' ('.$objects[$i]->ref_client.')';
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("RefOrder")." : ".$outputlangs->transnoentities($text), '', 'R');
|
||||
$posy+=3;
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("OrderDate")." : ".dol_print_date($objects[$i]->date,'day','',$outputlangs), '', 'R');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -913,7 +913,7 @@ class pdf_oursin extends ModelePDFFactures
|
||||
* ref facture
|
||||
*/
|
||||
$posy=78;
|
||||
$pdf->SetFont('','B', $default_font_size + 3);
|
||||
$pdf->SetFont('','B', $default_font_size + 2);
|
||||
$pdf->SetXY($this->marges['g'],$posy-5);
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$title=$outputlangs->transnoentities("Invoice");
|
||||
@ -922,12 +922,11 @@ class pdf_oursin extends ModelePDFFactures
|
||||
if ($object->type == 3) $title=$outputlangs->transnoentities("InvoiceDeposit");
|
||||
if ($object->type == 4) $title=$outputlangs->transnoentities("InvoiceProForma");
|
||||
$pdf->MultiCell(100, 10, $title.' '.$outputlangs->transnoentities("Of").' '.dol_print_date($object->date,"day",false,$outputlangs,true), '', 'L');
|
||||
$pdf->SetFont('','B', $default_font_size + 1);
|
||||
$pdf->SetFont('','B', $default_font_size);
|
||||
$pdf->SetXY($this->marges['g'],$posy);
|
||||
$pdf->SetTextColor(22,137,210);
|
||||
$pdf->MultiCell(100, 10, $outputlangs->transnoentities("RefBill")." : " . $outputlangs->transnoentities($object->ref), '', 'L');
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$posy+=4;
|
||||
|
||||
$objectidnext=$object->getIdReplacingInvoice('validated');
|
||||
if ($object->type == 0 && $objectidnext)
|
||||
@ -961,22 +960,26 @@ class pdf_oursin extends ModelePDFFactures
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("CorrectionInvoice").' : '.$outputlangs->convToOutputCharset($objectreplaced->ref), '', 'L');
|
||||
}
|
||||
|
||||
$posy+=1;
|
||||
|
||||
if ($object->type != 2)
|
||||
{
|
||||
$posy+=5;
|
||||
$posy+=3;
|
||||
$pdf->SetXY($this->marges['g'],$posy);
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
$pdf->SetFont('','', $default_font_size - 2);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("DateEcheance")." : " . dol_print_date($object->date_lim_reglement,"day",false,$outputlangs,true), '', 'L');
|
||||
}
|
||||
|
||||
if ($object->client->code_client)
|
||||
{
|
||||
$posy+=4;
|
||||
$posy+=3;
|
||||
$pdf->SetXY($this->marges['g'],$posy);
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
$pdf->SetFont('','', $default_font_size - 2);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("CustomerCode")." : " . $outputlangs->transnoentities($object->client->code_client), '', 'L');
|
||||
}
|
||||
|
||||
$posy+=1;
|
||||
|
||||
// Add list of linked orders and proposals
|
||||
// TODO mutualiser
|
||||
$object->fetchObjectLinked();
|
||||
@ -989,10 +992,13 @@ class pdf_oursin extends ModelePDFFactures
|
||||
$num=count($objects);
|
||||
for ($i=0;$i<$num;$i++)
|
||||
{
|
||||
$posy+=4;
|
||||
$posy+=3;
|
||||
$pdf->SetXY($this->marges['g'],$posy);
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
$pdf->MultiCell(60, 3, $outputlangs->transnoentities("RefProposal")." : ".$outputlangs->transnoentities($objects[$i]->ref));
|
||||
$pdf->SetFont('','', $default_font_size - 2);
|
||||
$pdf->MultiCell(60, 3, $outputlangs->transnoentities("RefProposal")." : ".$outputlangs->transnoentities($objects[$i]->ref), '', 'L');
|
||||
$posy+=3;
|
||||
$pdf->SetXY($this->marges['g'],$posy);
|
||||
$pdf->MultiCell(60, 3, $outputlangs->transnoentities("DatePropal")." : ".dol_print_date($objects[$i]->date,'day','',$outputlangs), '', 'L');
|
||||
}
|
||||
}
|
||||
else if ($objecttype == 'commande')
|
||||
@ -1000,12 +1006,15 @@ class pdf_oursin extends ModelePDFFactures
|
||||
$num=count($objects);
|
||||
for ($i=0;$i<$num;$i++)
|
||||
{
|
||||
$posy+=4;
|
||||
$posy+=3;
|
||||
$pdf->SetXY($this->marges['g'],$posy);
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
$pdf->SetFont('','', $default_font_size - 2);
|
||||
$text=$objects[$i]->ref;
|
||||
if ($objects[$i]->ref_client) $text.=' ('.$objects[$i]->ref_client.')';
|
||||
$pdf->MultiCell(60, 3, $outputlangs->transnoentities("RefOrder")." : ".$outputlangs->transnoentities($text));
|
||||
$pdf->MultiCell(60, 3, $outputlangs->transnoentities("RefOrder")." : ".$outputlangs->transnoentities($text), '', 'L');
|
||||
$posy+=3;
|
||||
$pdf->SetXY($this->marges['g'],$posy);
|
||||
$pdf->MultiCell(60, 3, $outputlangs->transnoentities("OrderDate")." : ".dol_print_date($objects[$i]->date,'day','',$outputlangs), '', 'L');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -221,16 +221,16 @@ abstract class ActionsCardCommon
|
||||
{
|
||||
if ($this->object->particulier)
|
||||
{
|
||||
dol_syslog("This thirdparty is a personal people",LOG_DEBUG);
|
||||
dol_syslog(get_class($this)."::doActions This thirdparty is a personal people",LOG_DEBUG);
|
||||
$contact=new Contact($this->db);
|
||||
|
||||
$contact->civilite_id = $this->object->civilite_id;
|
||||
$contact->name = $this->object->name_bis;
|
||||
$contact->firstname = $this->object->firstname;
|
||||
$contact->address = $this->object->address;
|
||||
$contact->cp = $this->object->cp;
|
||||
$contact->ville = $this->object->ville;
|
||||
$contact->fk_pays = $this->object->fk_pays;
|
||||
$contact->zip = $this->object->zip;
|
||||
$contact->town = $this->object->town;
|
||||
$contact->country_id = $this->object->country_id;
|
||||
$contact->socid = $this->object->id; // fk_soc
|
||||
$contact->status = 1;
|
||||
$contact->email = $this->object->email;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user