Skip to content

Commit

Permalink
Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into d…
Browse files Browse the repository at this point in the history
…evelop
  • Loading branch information
eldy committed May 1, 2014
2 parents b56f59b + fc9c491 commit 21716a0
Show file tree
Hide file tree
Showing 37 changed files with 858 additions and 234 deletions.
8 changes: 5 additions & 3 deletions ChangeLog
Expand Up @@ -49,9 +49,11 @@ For users:
- New: Extrafields can be used as substitution key %EXTRA_XXX% into emails texts for members.
- Fix: Project Task numbering customs rule works.
- Fix: Add actions events not implemented.
- Fix: Price min of composition is not supplier price min by quantity
- Fix: [ bug #1356 ] Bank accountancy number is limited to 8 numbers
- New: Add categories translation
- Fix: Price min of composition is not supplier price min by quantity.
- Fix: [ bug #1356 ] Bank accountancy number is limited to 8 numbers.
- New: Add categories translation.
- New: Enable option "clone target emailing".
- New: Improved tax module: Add specific page for salaries payment

TODO
- New: Predefined product and free product use same form.
Expand Down
14 changes: 6 additions & 8 deletions htdocs/comm/fiche.php
@@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
Expand Down Expand Up @@ -187,9 +187,6 @@
dol_print_error($db,$object->error);
}

/*
* Affichage onglets
*/

$head = societe_prepare_head($object);

Expand Down Expand Up @@ -397,7 +394,6 @@
print '</tr>';
}


// Multiprice level
if (! empty($conf->global->PRODUIT_MULTIPRICES))
{
Expand All @@ -410,7 +406,11 @@
print '<a href="'.DOL_URL_ROOT.'/comm/multiprix.php?id='.$object->id.'">'.img_edit($langs->trans("Modify")).'</a>';
}
print '</td></tr></table>';
print '</td><td colspan="3">'.$object->price_level."</td>";
print '</td><td colspan="3">';
print $object->price_level;
$keyforlabel='PRODUIT_MULTIPRICES_LABEL'.$object->price_level;
if (! empty($conf->global->$keyforlabel)) print ' - '.$langs->trans($conf->global->$keyforlabel);
print "</td>";
print '</tr>';
}

Expand Down Expand Up @@ -887,11 +887,9 @@
}

print '</div>';
print "<br>\n";

if (! empty($conf->global->MAIN_REPEATCONTACTONEACHTAB))
{
print '<br>';
// List of contacts
show_contacts($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?socid='.$object->id);
}
Expand Down
51 changes: 49 additions & 2 deletions htdocs/comm/mailing/class/mailing.class.php
Expand Up @@ -305,8 +305,55 @@ function createFromClone($fromid,$option1,$option2)

if (! $error)
{


//Clone target
if (!empty($option2)) {

require_once DOL_DOCUMENT_ROOT .'/core/modules/mailings/modules_mailings.php';

$mailing_target = new MailingTargets($this->db);

$target_array=array();

$sql = "SELECT fk_contact, ";
$sql.=" lastname, ";
$sql.=" firstname,";
$sql.=" email,";
$sql.=" other,";
$sql.=" source_url,";
$sql.=" source_id ,";
$sql.=" source_type ";
$sql.= " FROM ".MAIN_DB_PREFIX."mailing_cibles ";
$sql.= " WHERE fk_mailing = ".$fromid;

dol_syslog(get_class($this)."::createFromClone sql=".$sql);
$result=$this->db->query($sql);
if ($result)
{
if ($this->db->num_rows($result))
{
while ($obj = $this->db->fetch_object($result)) {

$target_array[]=array('fk_contact'=>$obj->fk_contact,
'lastname'=>$obj->lastname,
'firstname'=>$obj->firstname,
'email'=>$obj->email,
'other'=>$obj->other,
'source_url'=>$obj->source_url,
'source_id'=>$obj->source_id,
'source_type'=>$obj->source_type);
}

}
}
else
{
$this->error=$this->db->lasterror();
dol_syslog("Mailing::createFromClone ".$this->error, LOG_ERR);
return -1;
}

$mailing_target->add_to_target($object->id, $target_array);
}

}

Expand Down
2 changes: 1 addition & 1 deletion htdocs/comm/mailing/fiche.php
Expand Up @@ -822,7 +822,7 @@
$formquestion=array(
'text' => $langs->trans("ConfirmClone"),
array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneContent"), 'value' => 1),
array('type' => 'checkbox', 'name' => 'clone_receivers', 'label' => $langs->trans("CloneReceivers").' ('.$langs->trans("FeatureNotYetAvailable").')', 'value' => 0, 'disabled' => true)
array('type' => 'checkbox', 'name' => 'clone_receivers', 'label' => $langs->trans("CloneReceivers"), 'value' => 0)
);
// Paiement incomplet. On demande si motif = escompte ou autre
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id,$langs->trans('CloneEMailing'),$langs->trans('ConfirmCloneEMailing',$object->ref),'confirm_clone',$formquestion,'yes',2,240);
Expand Down
14 changes: 8 additions & 6 deletions htdocs/compta/bank/account.php
Expand Up @@ -43,6 +43,7 @@
$langs->load("banks");
$langs->load("categories");
$langs->load("bills");
$langs->load("companies");

$id = (GETPOST('id','int') ? GETPOST('id','int') : GETPOST('account','int'));
$ref = GETPOST('ref','alpha');
Expand Down Expand Up @@ -464,10 +465,11 @@
if ($mode_search && ! empty($conf->tax->enabled))
{
// VAT
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_url as bu2 ON bu2.fk_bank = b.rowid AND bu2.type='payment_vat'";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_url as bu2 ON bu2.fk_bank = b.rowid AND bu2.type='payment_vat'";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."tva as t ON bu2.url_id = t.rowid";
// Salary payment
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_url as bu3 ON bu3.fk_bank = b.rowid AND bu3.type='payment_salary'";

// Salary payment
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_url as bu3 ON bu3.fk_bank = b.rowid AND bu3.type='payment_salary'";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."payment_salary as sal ON bu3.url_id = sal.rowid";
}
if ($mode_search && ! empty($conf->adherent->enabled))
Expand Down Expand Up @@ -586,7 +588,7 @@
$paymentvatstatic->ref=$links[$key]['url_id'];
print ' '.$paymentvatstatic->getNomUrl(2);
}
elseif ($links[$key]['type']=='payment_salary')
elseif ($links[$key]['type']=='payment_salary')
{
$paymentsalstatic->id=$links[$key]['url_id'];
$paymentsalstatic->ref=$links[$key]['url_id'];
Expand Down Expand Up @@ -627,7 +629,7 @@
{

}
elseif ($links[$key]['type']=='user')
elseif ($links[$key]['type']=='user')
{

}
Expand Down Expand Up @@ -669,7 +671,7 @@
$societestatic->nom=$links[$key]['label'];
print $societestatic->getNomUrl(1,'',16);
}
else if ($links[$key]['type']=='user')
else if ($links[$key]['type']=='user')
{
$userstatic->id=$links[$key]['url_id'];
$userstatic->lastname=$links[$key]['label'];
Expand Down
3 changes: 2 additions & 1 deletion htdocs/compta/bank/search.php
Expand Up @@ -34,6 +34,7 @@

$langs->load("banks");
$langs->load("categories");
$langs->load("companies");

// Security check
if ($user->societe_id) $socid=$user->societe_id;
Expand Down Expand Up @@ -251,7 +252,7 @@
print '<td align="center" class="nowrap">'.dol_print_date($db->jdate($objp->dv),"day")."</td>\n";

// Payment type
print "<td align=\"center\">";
print '<td class="nowrap">';
$labeltype=($langs->trans("PaymentTypeShort".$objp->fk_type)!="PaymentTypeShort".$objp->fk_type)?$langs->trans("PaymentTypeShort".$objp->fk_type):$langs->getLabelFromKey($db,$objp->fk_type,'c_paiement','code','libelle');
if ($labeltype == 'SOLD') print '&nbsp;'; //$langs->trans("InitialBankBalance");
else print $labeltype;
Expand Down
1 change: 1 addition & 0 deletions htdocs/compta/bank/treso.php
Expand Up @@ -34,6 +34,7 @@
$langs->load("banks");
$langs->load("categories");
$langs->load("bills");
$langs->load("companies");

// Security check
if (isset($_GET["account"]) || isset($_GET["ref"]))
Expand Down
34 changes: 34 additions & 0 deletions htdocs/compta/paiement/cheque/class/remisecheque.class.php
Expand Up @@ -725,6 +725,40 @@ function set_date($user, $date)
}
}

/**
* Set the number of bordereau
*
* @param User $user Object user
* @param timestamp $number number of bordereau
* @return int <0 if KO, >0 if OK
*/
function set_number($user, $number)
{
if ($user->rights->banque->cheque)
{
$sql = "UPDATE ".MAIN_DB_PREFIX."bordereau_cheque";
$sql.= " SET number = '".$number."'" ;
$sql.= " WHERE rowid = ".$this->id;

dol_syslog("RemiseCheque::set_number sql=$sql",LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
$this->date_bordereau = $date;
return 1;
}
else
{
$this->error=$this->db->error();
dol_syslog("RemiseCheque::set_number ".$this->error,LOG_ERR);
return -1;
}
}
else
{
return -2;
}
}

/**
* Renvoie nom clicable (avec eventuellement le picto)
Expand Down
45 changes: 41 additions & 4 deletions htdocs/compta/paiement/cheque/fiche.php
Expand Up @@ -112,6 +112,25 @@
}
}

if ($action == 'setref' && $user->rights->banque->cheque)
{
$result = $object->fetch(GETPOST('id','int'));
if ($result > 0)
{
$number=GETPOST('number');

$result=$object->set_number($user,$number);
if ($result < 0)
{
$mesg='<div class="error">'.$object->error.'</div>';
}
}
else
{
$mesg='<div class="error">'.$object->error.'</div>';
}
}

if ($action == 'create' && $_POST["accountid"] > 0 && $user->rights->banque->cheque)
{
if (is_array($_POST['toRemise']))
Expand Down Expand Up @@ -481,12 +500,30 @@
$accountstatic->label=$object->account_label;

print '<table class="border" width="100%">';
print '<tr><td width="20%">'.$langs->trans('Ref').'</td><td colspan="2" >';
print '<tr><td width=20%>';

print $form->showrefnav($object,'ref',$linkback, 1, 'number');
print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('Ref');
print '</td>';
if ($action != 'editref') print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editref&amp;id='.$object->id.'">'.img_edit($langs->trans('SetRef'),1).'</a></td>';
print '</tr></table>';
print '</td><td colspan="2">';
if ($action == 'editref')
{
print '<form name="setdate" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="setref">';
print '<input type="text" name="number" value="'.$object->number.'">';
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
print '</form>';
}
else
{
print $form->showrefnav($object,'ref',$linkback, 1, 'number');
}

print "</td>";
print "</tr>\n";
print '</td>';
print '</tr>';

print '<tr><td>';

Expand Down

0 comments on commit 21716a0

Please sign in to comment.