Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into develop

Conflicts:
	htdocs/public/paybox/newpayment.php
	htdocs/public/payment/newpayment.php
	htdocs/public/paypal/newpayment.php
	htdocs/public/stripe/newpayment.php
This commit is contained in:
Laurent Destailleur 2018-01-31 20:25:24 +01:00
commit 7f9d6a5458
75 changed files with 1142 additions and 504 deletions

View File

@ -276,6 +276,12 @@ Following changes may create regressions for some external modules, but were nec
and add 'td.' to the beginning of the dragHandle match string.
* IE8 and earlier and Firefox 12 and earlier (< 2012) are no more supported.
* If you use the external module "multicompany", you must also upgrade the module. Multicompany module for
Dolibarr v7 is required because with Dolibarr v7, payment modes and payment conditions are management as data
that are dedicated to each company. If you keep your old version of multicompany module, mode and
condition of payments will appears empty in all companies that are not the first one. By upgrading the
multicompany module to a version that support Dolibarr v7, everything should work as expected.
***** ChangeLog for 6.0.5 compared to 6.0.4 *****
FIX: security vulnerability reported by ADLab of Venustech

View File

@ -99,7 +99,7 @@ $form = new Form($db);
if (! in_array($action, array('export_file', 'delmouv', 'delmouvconfirm')) && ! isset($_POST['begin']) && ! isset($_GET['begin']) && ! isset($_POST['formfilteraction']) && GETPOST('page','int') == '' && ! GETPOST('noreset','int'))
{
$query = "SELECT date_start, date_end from ".MAIN_DB_PREFIX."accounting_fiscalyear ";
$query.= " where date_start < '".$this->idate(dol_now())."' and date_end > '".$this->idate(dol_now())."' limit 1";
$query.= " where date_start < '".$db->idate(dol_now())."' and date_end > '".$db->idate(dol_now())."' limit 1";
$res = $db->query($query);
if ($res->num_rows > 0) {
$fiscalYear = $db->fetch_object($res);

View File

@ -148,10 +148,10 @@ if ($object->id > 0)
//print '</div>';
$morehtmlcenter = '';
$createbutton = '';
if (! empty($conf->agenda->enabled))
{
$morehtmlcenter.='<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&backtopage=1&origin=member&originid='.$id.'">'.$langs->trans("AddAction").'</a>';
$createbutton.='<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&backtopage=1&origin=member&originid='.$id.'">'.$langs->trans("AddAction").'</a>';
}
if (! empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read) ))
@ -162,7 +162,7 @@ if ($object->id > 0)
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
print_barre_liste($langs->trans("ActionsOnMember"), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, $morehtmlcenter, 0, -1, '', '', '', '', 0, 1, 1);
print_barre_liste($langs->trans("ActionsOnMember"), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', '', $createbutton, '', 0, 1, 1);
// List of all actions
$filters=array();

View File

@ -453,24 +453,36 @@ if (is_array($blocks))
if (empty($search_showonlyerrors) || ! $checkresult[$block->id])
{
print '<tr class="oddeven">';
// ID
print '<td>'.$block->id.'</td>';
// Date
print '<td>'.dol_print_date($block->date_creation,'dayhour').'</td>';
// User
print '<td>';
//print $block->getUser()
print $block->user_fullname;
print '</td>';
// Action
print '<td>'.$langs->trans('log'.$block->action).'</td>';
// Ref
print '<td class="nowrap">'.$block->ref_object.'</td>';
// Link to source object
print '<td>'.$object_link.'</td>';
// Amount
print '<td align="right">'.price($block->amounts).'</td>';
// Details link
print '<td align="center"><a href="#" data-blockid="'.$block->id.'" rel="show-info">'.img_info($langs->trans('ShowDetails')).'</a></td>';
// Fingerprint
print '<td>';
print $form->textwithpicto(dol_trunc($block->signature, '12'), $block->signature, 1, 'help', '', 0, 2, 'fingerprint');
print '</td>';

View File

@ -149,11 +149,10 @@ class BlockedLog
if ($conf->adherent->enabled) $this->trackedevents['MEMBER_SUBSCRIPTION_MODIFY']='logMEMBER_SUBSCRIPTION_MODIFY';
if ($conf->adherent->enabled) $this->trackedevents['MEMBER_SUBSCRIPTION_DELETE']='logMEMBER_SUBSCRIPTION_DELETE';
/*
$trackedevents['PAYMENT_VARIOUS_CREATE']='BlockedLogVariousPaymentCreate';
$trackedevents['PAYMENT_VARIOUS_MODIFY']='BlockedLogVariousPaymentModify';
$trackedevents['PAYMENT_VARIOUS_DELETE']='BlockedLogVariousPaymentDelete';
*/
if ($conf->banque->enabled) $this->trackedevents['PAYMENT_VARIOUS_CREATE']='logPAYMENT_VARIOUS_CREATE';
if ($conf->banque->enabled) $this->trackedevents['PAYMENT_VARIOUS_MODIFY']='logPAYMENT_VARIOUS_MODIFY';
if ($conf->banque->enabled) $this->trackedevents['PAYMENT_VARIOUS_DELETE']='logPAYMENT_VARIOUS_DELETE';
}
/**
@ -218,6 +217,17 @@ class BlockedLog
$this->error++;
}
}
else if($this->element === 'payment_various') {
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/paymentvarious.class.php';
$object = new PaymentVarious($this->db);
if ($object->fetch($this->fk_object)>0) {
return $object->getNomUrl(1);
}
else{
$this->error++;
}
}
else if($this->element === 'don' || $this->element === 'donation') {
require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php';
@ -299,7 +309,7 @@ class BlockedLog
{
$this->date_object = $object->datev;
}
elseif ($object->element == 'payment_donation')
elseif ($object->element == 'payment_donation' || $object->element == 'payment_various')
{
$this->date_object = $object->datepaid?$object->datepaid:$object->datep;
}
@ -401,21 +411,26 @@ class BlockedLog
if (! empty($object->newref)) $this->object_data->ref = $object->newref;
}
elseif ($this->element == 'payment' || $this->element == 'payment_supplier' || $this->element == 'payment_donation')
elseif ($this->element == 'payment' || $this->element == 'payment_supplier' || $this->element == 'payment_donation' || $this->element == 'payment_various')
{
$datepayment = $object->datepaye?$object->datepaye:($object->datepaid?$object->datepaid:$object->datep);
$paymenttypeid = $object->paiementid?$object->paiementid:$object->paymenttype;
$paymenttypeid = $object->paiementid?$object->paiementid:($object->paymenttype?$object->paymenttype:$object->type_payment);
$this->object_data->ref = $object->ref;
$this->object_data->date = $datepayment;
$this->object_data->type_code = dol_getIdFromCode($this->db, $paymenttypeid, 'c_paiement', 'id', 'code');
$this->object_data->payment_num = $object->num_paiement;
$this->object_data->payment_num = ($object->num_paiement?$object->num_paiement:$object->num_payment);
//$this->object_data->fk_account = $object->fk_account;
$this->object_data->note = $object->note;
//var_dump($this->object_data);exit;
$totalamount=0;
if (! is_array($object->amounts) && $object->amount)
{
$object->amounts=array($object->id => $object->amount);
}
$paymentpartnumber=0;
foreach($object->amounts as $objid => $amount)
{
@ -439,26 +454,41 @@ class BlockedLog
include_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php';
$tmpobject = new Don($this->db);
}
elseif ($this->element == 'payment_various')
{
include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/paymentvarious.class.php';
$tmpobject = new PaymentVarious($this->db);
}
if (! is_object($tmpobject))
{
continue;
}
$result = $tmpobject->fetch($objid);
if ($result <= 0)
{
$this->error = $tmpobject->error;
$this->errors = $tmpobject->errors;
dol_syslog("Failed to fetch object with id ".$objid, LOG_ERR);
return -1;
}
$paymentpart = new stdClass();
$paymentpart->amount = $amount;
if ($this->element != 'payment_donation')
if (! in_array($this->element, array('payment_donation', 'payment_various')))
{
$result = $tmpobject->fetch_thirdparty();
if ($result <= 0)
if ($result == 0)
{
$this->error='Failed to fetch thirdparty for object with id '.$tmpobject->id;
$this->errors[] = $this->error;
dol_syslog("Failed to fetch thirdparty for object with id ".$tmpobject->id, LOG_ERR);
return -1;
}
elseif ($result < 0)
{
$this->error = $tmpobject->error;
$this->errors = $tmpobject->errors;
@ -481,21 +511,25 @@ class BlockedLog
if ($this->element == 'payment_donation') $paymentpart->donation = new stdClass();
else $paymentpart->invoice = new stdClass();
foreach($tmpobject as $key=>$value)
if ($this->element != 'payment_various')
{
if (in_array($key, array('fields'))) continue; // Discard some properties
if (! in_array($key, array(
'ref','facnumber','ref_client','ref_supplier','date','datef','type','total_ht','total_tva','total_ttc','localtax1','localtax2','revenuestamp','datepointoftax','note_public'
))) continue; // Discard if not into a dedicated list
if (!is_object($value))
foreach($tmpobject as $key=>$value)
{
if ($this->element == 'payment_donation') $paymentpart->donation->{$key} = $value;
else $paymentpart->invoice->{$key} = $value;
if (in_array($key, array('fields'))) continue; // Discard some properties
if (! in_array($key, array(
'ref','facnumber','ref_client','ref_supplier','date','datef','type','total_ht','total_tva','total_ttc','localtax1','localtax2','revenuestamp','datepointoftax','note_public'
))) continue; // Discard if not into a dedicated list
if (!is_object($value))
{
if ($this->element == 'payment_donation') $paymentpart->donation->{$key} = $value;
elseif ($this->element == 'payment_various') $paymentpart->various->{$key} = $value;
else $paymentpart->invoice->{$key} = $value;
}
}
}
$paymentpartnumber++;
$this->object_data->payment_part[$paymentpartnumber] = $paymentpart;
$paymentpartnumber++; // first payment will be 1
$this->object_data->payment_part[$paymentpartnumber] = $paymentpart;
}
}
$this->object_data->amount = $totalamount;

View File

@ -825,7 +825,7 @@ class Categorie extends CommonObject
$sql = "SELECT c.fk_" . $this->MAP_CAT_FK[$type];
$sql .= " FROM " . MAIN_DB_PREFIX . "categorie_" . $this->MAP_CAT_TABLE[$type] . " as c";
$sql .= ", " . MAIN_DB_PREFIX . $this->MAP_OBJ_TABLE[$type] . " as o";
$sql .= " WHERE o.entity IN (" . getEntity( $obj->element, 1).")";
$sql .= " WHERE o.entity IN (" . getEntity( $obj->element).")";
$sql.= " AND c.fk_categorie = ".$this->id;
$sql .= " AND c.fk_" . $this->MAP_CAT_FK[$type] . " = o.rowid";
@ -1066,7 +1066,7 @@ class Categorie extends CommonObject
if (! empty($conf->global->MAIN_MULTILANGS)) $sql.= ", t.label as label_trans, t.description as description_trans";
$sql.= " FROM ".MAIN_DB_PREFIX."categorie as c";
if (! empty($conf->global->MAIN_MULTILANGS)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_lang as t ON t.fk_category=c.rowid AND t.lang='".$current_lang."'";
$sql .= " WHERE c.entity IN (" . getEntity( 'category', 1 ) . ")";
$sql .= " WHERE c.entity IN (" . getEntity( 'category') . ")";
$sql .= " AND c.type = " . $type;
dol_syslog(get_class($this)."::get_full_arbo get category list", LOG_DEBUG);
@ -1481,7 +1481,7 @@ class Categorie extends CommonObject
$sql = "SELECT ct.fk_categorie, c.label, c.rowid";
$sql .= " FROM " . MAIN_DB_PREFIX . "categorie_" . $this->MAP_CAT_TABLE[$type] . " as ct, " . MAIN_DB_PREFIX . "categorie as c";
$sql .= " WHERE ct.fk_categorie = c.rowid AND ct.fk_" . $this->MAP_CAT_FK[$type] . " = " . (int) $id . " AND c.type = " . $this->MAP_ID[$type];
$sql .= " AND c.entity IN (" . getEntity( 'category', 1 ) . ")";
$sql .= " AND c.entity IN (" . getEntity( 'category') . ")";
$res = $this->db->query($sql);
if ($res)
@ -1542,7 +1542,7 @@ class Categorie extends CommonObject
// Generation requete recherche
$sql = "SELECT rowid FROM " . MAIN_DB_PREFIX . "categorie";
$sql .= " WHERE type = " . $this->MAP_ID[$type];
$sql .= " AND entity IN (" . getEntity( 'category', 1 ) . ")";
$sql .= " AND entity IN (" . getEntity( 'category') . ")";
if ($nom)
{
if (! $exact)

View File

@ -1245,7 +1245,7 @@ if ($object->id > 0)
print '</div>';
if (! empty($conf->global->MAIN_REPEATCONTACTONEACHTAB))
if (! empty($conf->global->MAIN_DUPLICATE_CONTACTS_TAB_ON_CUSTOMER_CARD))
{
// List of contacts
show_contacts($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?socid='.$object->id);

View File

@ -470,7 +470,7 @@ if (! empty($conf->societe->enabled) && $user->rights->societe->lire)
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE s.client IN (1, 2, 3)";
$sql.= " AND s.entity IN (".getEntity($companystatic->element, 1).")";
$sql.= " AND s.entity IN (".getEntity($companystatic->element).")";
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
if ($socid) $sql.= " AND s.rowid = $socid";
$sql .= " ORDER BY s.tms DESC";
@ -534,7 +534,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->societe->lire)
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE s.fournisseur = 1";
$sql.= " AND s.entity IN (".getEntity($companystatic->element, 1).")";
$sql.= " AND s.entity IN (".getEntity($companystatic->element).")";
if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
if ($socid) $sql.= " AND s.rowid = ".$socid;
$sql.= " ORDER BY s.datec DESC";

View File

@ -156,6 +156,7 @@ if (empty($reshook))
$sql = "SELECT mc.rowid, mc.fk_mailing, mc.lastname, mc.firstname, mc.email, mc.other, mc.source_url, mc.source_id, mc.source_type, mc.tag";
$sql .= " FROM ".MAIN_DB_PREFIX."mailing_cibles as mc";
$sql .= " WHERE mc.statut < 1 AND mc.fk_mailing = ".$object->id;
$sql .= " ORDER BY mc.statut DESC"; // first status 0, then status -1
dol_syslog("card.php: select targets", LOG_DEBUG);
$resql=$db->query($sql);
@ -840,7 +841,7 @@ else
if (! empty($conf->global->MAILING_SMTP_SETUP_EMAILS_FOR_QUESTIONS)) setEventMessages($langs->trans("MailSendSetupIs3", $conf->global->MAILING_SMTP_SETUP_EMAILS_FOR_QUESTIONS), null, 'warnings');
$_GET["action"]='';
}
else if ($conf->global->MAILING_LIMIT_SENDBYWEB == '-1')
else if ($conf->global->MAILING_LIMIT_SENDBYWEB < 0)
{
if (! empty($conf->global->MAILING_LIMIT_WARNING_PHPMAIL) && $sendingmode == 'mail') setEventMessages($langs->transnoentitiesnoconv($conf->global->MAILING_LIMIT_WARNING_PHPMAIL), null, 'warnings');
if (! empty($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL) && $sendingmode != 'mail') setEventMessages($langs->transnoentitiesnoconv($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL), null, 'warnings');
@ -875,7 +876,16 @@ else
$linkback = '<a href="'.DOL_URL_ROOT.'/comm/mailing/list.php">'.$langs->trans("BackToList").'</a>';
$morehtmlright='';
if ($object->statut == 2) $morehtmlright.=' ('.$object->countNbOfTargets('alreadysent').'/'.$object->nbemail.') ';
$nbtry = $nbok = 0;
if ($object->statut == 2 || $object->statut == 3)
{
$nbtry = $object->countNbOfTargets('alreadysent');
$nbko = $object->countNbOfTargets('alreadysentko');
$morehtmlright.=' ('.$nbtry.'/'.$object->nbemail;
if ($nbko) $morehtmlright.=' - '.$nbko.' '.$langs->trans("Error");
$morehtmlright.=') &nbsp; ';
}
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '', '', 0, '', $morehtmlright);
@ -903,11 +913,11 @@ else
print '<tr><td>';
print $langs->trans("TotalNbOfDistinctRecipients");
print '</td><td colspan="3">';
$nbemail = ($object->nbemail?$object->nbemail:img_warning('').' <font class="warning">'.$langs->trans("NoTargetYet").'</font>');
if ($object->statut != 3 && is_numeric($nbemail))
$nbemail = ($object->nbemail?$object->nbemail:0);
if (is_numeric($nbemail))
{
$text='';
if (! empty($conf->global->MAILING_LIMIT_SENDBYWEB) && $conf->global->MAILING_LIMIT_SENDBYWEB < $nbemail)
if ((! empty($conf->global->MAILING_LIMIT_SENDBYWEB) && $conf->global->MAILING_LIMIT_SENDBYWEB < $nbemail) && ($object->statut == 1 || ($object->statut == 2 && $nbtry < $nbemail)))
{
if ($conf->global->MAILING_LIMIT_SENDBYWEB > 0)
{
@ -915,9 +925,10 @@ else
}
else
{
$text.=$langs->trans('NotEnoughPermissions');
$text.=$langs->trans('SendingFromWebInterfaceIsNotAllowed');
}
}
if (empty($nbemail)) $nbemail.=' '.img_warning('').' <font class="warning">'.$langs->trans("NoTargetYet").'</font>';
if ($text)
{
print $form->textwithpicto($nbemail,$text,1,'warning');
@ -1008,7 +1019,11 @@ else
if (($object->statut == 1 || $object->statut == 2) && $object->nbemail > 0 && $user->rights->mailing->valider)
{
if ($conf->global->MAILING_LIMIT_SENDBYWEB < 0 || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! $user->rights->mailing->mailing_advance->send))
if ($conf->global->MAILING_LIMIT_SENDBYWEB < 0)
{
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->transnoentitiesnoconv("SendingFromWebInterfaceIsNotAllowed")).'">'.$langs->trans("SendMailing").'</a>';
}
else if (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! $user->rights->mailing->mailing_advance->send)
{
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->transnoentitiesnoconv("NotEnoughPermissions")).'">'.$langs->trans("SendMailing").'</a>';
}
@ -1183,15 +1198,30 @@ else
print '<tr><td>';
print $langs->trans("TotalNbOfDistinctRecipients");
print '</td><td colspan="3">';
$nbemail = ($object->nbemail?$object->nbemail:img_warning('').' <font class="warning">'.$langs->trans("NoTargetYet").'</font>');
if (!empty($conf->global->MAILING_LIMIT_SENDBYWEB) && is_numeric($nbemail) && $conf->global->MAILING_LIMIT_SENDBYWEB < $nbemail)
$nbemail = ($object->nbemail?$object->nbemail:0);
if (is_numeric($nbemail))
{
$text=$langs->trans('LimitSendingEmailing',$conf->global->MAILING_LIMIT_SENDBYWEB);
print $form->textwithpicto($nbemail,$text,1,'warning');
}
else
{
print $nbemail;
$text='';
if ((! empty($conf->global->MAILING_LIMIT_SENDBYWEB) && $conf->global->MAILING_LIMIT_SENDBYWEB < $nbemail) && ($object->statut == 1 || $object->statut == 2))
{
if ($conf->global->MAILING_LIMIT_SENDBYWEB > 0)
{
$text.=$langs->trans('LimitSendingEmailing',$conf->global->MAILING_LIMIT_SENDBYWEB);
}
else
{
$text.=$langs->trans('SendingFromWebInterfaceIsNotAllowed');
}
}
if (empty($nbemail)) $nbemail.=' '.img_warning('').' <font class="warning">'.$langs->trans("NoTargetYet").'</font>';
if ($text)
{
print $form->textwithpicto($nbemail,$text,1,'warning');
}
else
{
print $nbemail;
}
}
print '</td></tr>';

View File

@ -171,6 +171,7 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x',
/*
* View
*/
llxHeader('',$langs->trans("Mailing"),'EN:Module_EMailing|FR:Module_Mailing|ES:M&oacute;dulo_Mailing');
$form = new Form($db);
@ -185,7 +186,16 @@ if ($object->fetch($id) >= 0)
$linkback = '<a href="'.DOL_URL_ROOT.'/comm/mailing/list.php">'.$langs->trans("BackToList").'</a>';
$morehtmlright='';
if ($object->statut == 2) $morehtmlright.=' ('.$object->countNbOfTargets('alreadysent').'/'.$object->nbemail.') ';
$nbtry = $nbok = 0;
if ($object->statut == 2 || $object->statut == 3)
{
$nbtry = $object->countNbOfTargets('alreadysent');
$nbko = $object->countNbOfTargets('alreadysentko');
$morehtmlright.=' ('.$nbtry.'/'.$object->nbemail;
if ($nbko) $morehtmlright.=' - '.$nbko.' '.$langs->trans("Error");
$morehtmlright.=') &nbsp; ';
}
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '', '', 0, '', $morehtmlright);
@ -206,15 +216,30 @@ if ($object->fetch($id) >= 0)
print '<tr><td>';
print $langs->trans("TotalNbOfDistinctRecipients");
print '</td><td colspan="3">';
$nbemail = ($object->nbemail?$object->nbemail:'0');
if (!empty($conf->global->MAILING_LIMIT_SENDBYWEB) && ($conf->global->MAILING_LIMIT_SENDBYWEB < $nbemail) && ($object->statut == 1 || $object->statut == 2))
$nbemail = ($object->nbemail?$object->nbemail:0);
if (is_numeric($nbemail))
{
$text=$langs->trans('LimitSendingEmailing',$conf->global->MAILING_LIMIT_SENDBYWEB);
print $form->textwithpicto($nbemail,$text,1,'warning');
}
else
{
print $nbemail;
$text='';
if ((! empty($conf->global->MAILING_LIMIT_SENDBYWEB) && $conf->global->MAILING_LIMIT_SENDBYWEB < $nbemail) && ($object->statut == 1 || ($object->statut == 2 && $nbtry < $nbemail)))
{
if ($conf->global->MAILING_LIMIT_SENDBYWEB > 0)
{
$text.=$langs->trans('LimitSendingEmailing',$conf->global->MAILING_LIMIT_SENDBYWEB);
}
else
{
$text.=$langs->trans('SendingFromWebInterfaceIsNotAllowed');
}
}
if (empty($nbemail)) $nbemail.=' '.img_warning('').' <font class="warning">'.$langs->trans("NoTargetYet").'</font>';
if ($text)
{
print $form->textwithpicto($nbemail,$text,1,'warning');
}
else
{
print $nbemail;
}
}
print '</td></tr>';
@ -411,6 +436,8 @@ if ($object->fetch($id) >= 0)
$num = $db->num_rows($resql);
$param = "&amp;id=".$object->id;
//if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit);
if ($search_lastname) $param.= "&amp;search_lastname=".urlencode($search_lastname);
if ($search_firstname) $param.= "&amp;search_firstname=".urlencode($search_firstname);
if ($search_email) $param.= "&amp;search_email=".urlencode($search_email);
@ -552,7 +579,7 @@ if ($object->fetch($id) >= 0)
}
print '</td>';
// Statut pour l'email destinataire (Attentioon != statut du mailing)
// Status of recipient sending email (Warning != status of emailing)
if ($obj->statut == 0)
{
print '<td align="center">&nbsp;</td>';
@ -563,18 +590,22 @@ if ($object->fetch($id) >= 0)
{
print '<td align="center">'.$obj->date_envoi.'</td>';
print '<td align="right" class="nowrap">';
print $object::libStatutDest($obj->statut,2,$obj->error_text);
print $object::libStatutDest($obj->statut, 2, $obj->error_text);
print '</td>';
}
// Search Icon
print '<td align="right">';
if ($obj->statut == 0)
if ($obj->statut == 0) // Not sent yet
{
if ($user->rights->mailing->creer && $allowaddtarget) {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=delete&rowid='.$obj->rowid.$param.'">'.img_delete($langs->trans("RemoveRecipient"));
print '<a href="'.$_SERVER['PHP_SELF'].'?action=delete&rowid='.$obj->rowid.$param.'">'.img_delete($langs->trans("RemoveRecipient")).'</a>';
}
}
/*if ($obj->statut == -1) // Sent with error
{
print '<a href="'.$_SERVER['PHP_SELF'].'?action=retry&rowid='.$obj->rowid.$param.'">'.$langs->trans("Retry").'</a>';
}*/
print '</td>';
print '</tr>';

View File

@ -34,7 +34,7 @@ class Mailing extends CommonObject
public $element='mailing';
public $table_element='mailing';
public $picto='email';
var $titre;
var $sujet;
var $body;
@ -43,7 +43,7 @@ class Mailing extends CommonObject
var $bgimage;
var $statut; // Status 0=Draft, 1=Validated, 2=Sent partially, 3=Sent completely
var $email_from;
var $email_replyto;
var $email_errorsto;
@ -431,7 +431,7 @@ class Mailing extends CommonObject
return -1;
}
}
/**
* Delete targets emailing
*
@ -481,11 +481,11 @@ class Mailing extends CommonObject
}
}
/**
* Count number of target with status
*
* @param string $mode Mode ('alreadysent' = Sent success or error)
* @param string $mode Mode ('alreadysent' = Sent success or error, 'alreadysentok' = Sent success, 'alreadysentko' = Sent error)
* @return int Nb of target with status
*/
function countNbOfTargets($mode)
@ -493,12 +493,14 @@ class Mailing extends CommonObject
$sql = "SELECT COUNT(rowid) as nb FROM ".MAIN_DB_PREFIX."mailing_cibles";
$sql.= " WHERE fk_mailing = ".$this->id;
if ($mode == 'alreadysent') $sql.= " AND statut <> 0";
else
elseif ($mode == 'alreadysentok') $sql.= " AND statut > 0";
elseif ($mode == 'alreadysentko') $sql.= " AND statut = -1";
else
{
$this->error='BadValueForParameterMode';
return -2;
}
$resql=$this->db->query($sql);
if ($resql)
{
@ -512,10 +514,10 @@ class Mailing extends CommonObject
}
return 0;
}
/**
* Retourne le libelle du statut d'un mailing (brouillon, validee, ...
* Return label of status of emailing (draft, validated, ...)
*
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long
* @return string Label

View File

@ -76,7 +76,7 @@ $sql.= ", ".MAIN_DB_PREFIX."c_stcomm as st ";
if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE s.fk_stcomm = st.id";
$sql.= " AND s.client IN (2, 3)";
$sql.= " AND s.entity IN (".getEntity($companystatic->element, 1).")";
$sql.= " AND s.entity IN (".getEntity($companystatic->element).")";
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
$sql.= " GROUP BY st.id";
$sql.= " ORDER BY st.id";
@ -96,7 +96,7 @@ if ($resql)
while ($i < $num)
{
$obj = $db->fetch_object($resql);
print '<tr class="oddeven"><td>';
print '<a href="prospects.php?page=0&amp;stcomm='.$obj->id.'">';
print img_action($langs->trans("Show"),$obj->id).' ';
@ -140,7 +140,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire)
while ($i < $num)
{
$obj = $db->fetch_object($resql);
print '<tr class="oddeven"><td>';
print '<a href="'.DOL_URL_ROOT.'/comm/propal/card.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowPropal"),"propal").' '.$obj->ref.'</a>';
print '</td><td align="right">';
@ -150,7 +150,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire)
$total += $obj->price;
}
if ($total>0) {
print '<tr class="liste_total"><td>'.$langs->trans("Total")."</td><td align=\"right\">".price($total)."</td></tr>";
}
print "</table><br>";
@ -205,7 +205,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire)
while ($i < $num)
{
$obj = $db->fetch_object($resql);
print '<tr class="oddeven"><td>';
print '<a href="../propal.php?id='.$obj->propalid.'">';
print img_object($langs->trans("ShowPropal"),"propal").' '.$obj->ref.'</a></td>';
@ -243,7 +243,7 @@ $sql = "SELECT s.nom as name, s.rowid as socid, s.client, s.canvas";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE s.fk_stcomm = 1";
$sql.= " AND s.entity IN (".getEntity($companystatic->element, 1).")";
$sql.= " AND s.entity IN (".getEntity($companystatic->element).")";
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
$sql.= " ORDER BY s.tms ASC";
$sql.= $db->plimit(15, 0);
@ -263,7 +263,7 @@ if ($resql)
while ($i < $num)
{
$obj = $db->fetch_object($resql);
print '<tr class="oddeven"><td width="12%">';
$companystatic->id=$obj->socid;
$companystatic->name=$obj->name;

View File

@ -424,14 +424,6 @@ class Orders extends DolibarrApi
if ($this->commande->availability($this->commande->availability_id) < 0)
throw new RestException(400, 'Error while updating availability');
}
// update bank account
if(!empty($this->commande->fk_account))
{
if($this->commande->setBankAccount($this->commande->fk_account) == 0)
{
throw new RestException(400,$this->commande->error);
}
}
if ($this->commande->update(DolibarrApiAccess::$user) > 0)
{

View File

@ -3036,6 +3036,8 @@ class Commande extends CommonOrder
*/
function update(User $user, $notrigger=0)
{
global $conf;
$error=0;
// Clean parameters
@ -3069,6 +3071,7 @@ class Commande extends CommonOrder
$sql.= " fk_projet=".(isset($this->fk_project)?$this->fk_project:"null").",";
$sql.= " fk_cond_reglement=".(isset($this->cond_reglement_id)?$this->cond_reglement_id:"null").",";
$sql.= " fk_mode_reglement=".(isset($this->mode_reglement_id)?$this->mode_reglement_id:"null").",";
$sql.= " fk_account=".($this->fk_account>0?$this->fk_account:"null").",";
$sql.= " note_private=".(isset($this->note_private)?"'".$this->db->escape($this->note_private)."'":"null").",";
$sql.= " note_public=".(isset($this->note_public)?"'".$this->db->escape($this->note_public)."'":"null").",";
$sql.= " model_pdf=".(isset($this->modelpdf)?"'".$this->db->escape($this->modelpdf)."'":"null").",";

View File

@ -34,6 +34,8 @@ class PaymentVarious extends CommonObject
public $table_element='payment_various'; //!< Name of table without prefix where object is stored
public $picto = 'bill';
var $id;
var $ref;
var $tms;
var $datep;
var $datev;
@ -87,8 +89,7 @@ class PaymentVarious extends CommonObject
// Update request
$sql = "UPDATE ".MAIN_DB_PREFIX."payment_various SET";
$sql.= " tms='".$this->db->idate($this->tms)."',";
if ($this->tms) $sql.= " tms='".$this->db->idate($this->tms)."',";
$sql.= " datep='".$this->db->idate($this->datep)."',";
$sql.= " datev='".$this->db->idate($this->datev)."',";
$sql.= " sens=".$this->sens.",";
@ -102,7 +103,6 @@ class PaymentVarious extends CommonObject
$sql.= " fk_bank=".($this->fk_bank > 0 ? $this->fk_bank:"null").",";
$sql.= " fk_user_author=".$this->fk_user_author.",";
$sql.= " fk_user_modif=".$this->fk_user_modif;
$sql.= " WHERE rowid=".$this->id;
dol_syslog(get_class($this)."::update", LOG_DEBUG);
@ -146,7 +146,6 @@ class PaymentVarious extends CommonObject
global $langs;
$sql = "SELECT";
$sql.= " v.rowid,";
$sql.= " v.tms,";
$sql.= " v.datep,";
$sql.= " v.datev,";
@ -164,7 +163,6 @@ class PaymentVarious extends CommonObject
$sql.= " b.fk_account,";
$sql.= " b.fk_type,";
$sql.= " b.rappro";
$sql.= " FROM ".MAIN_DB_PREFIX."payment_various as v";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON v.fk_bank = b.rowid";
$sql.= " WHERE v.rowid = ".$id;
@ -184,7 +182,7 @@ class PaymentVarious extends CommonObject
$this->datev = $this->db->jdate($obj->datev);
$this->sens = $obj->sens;
$this->amount = $obj->amount;
$this->type_payement = $obj->fk_typepayment;
$this->type_payment = $obj->fk_typepayment;
$this->num_payment = $obj->num_payment;
$this->label = $obj->label;
$this->note = $obj->note;
@ -350,6 +348,7 @@ class PaymentVarious extends CommonObject
if ($result)
{
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."payment_various");
$this->ref = $this->id;
if ($this->id > 0)
{

View File

@ -49,7 +49,7 @@ $sens=GETPOST("sens","int");
$amount=GETPOST("amount");
$paymenttype=GETPOST("paymenttype");
$accountancy_code=GETPOST("accountancy_code","int");
$projectid = (GETPOST('projectid') ? GETPOST('projectid', 'int') : 0);
$projectid = (GETPOST('projectid','int') ? GETPOST('projectid', 'int') : GETPOST('fk_project','int'));
// Security check
$socid = GETPOST("socid","int");
@ -96,22 +96,23 @@ if (empty($reshook))
{
$error=0;
$datep=dol_mktime(12,0,0, GETPOST("datepmonth"), GETPOST("datepday"), GETPOST("datepyear"));
$datev=dol_mktime(12,0,0, GETPOST("datevmonth"), GETPOST("datevday"), GETPOST("datevyear"));
$datep=dol_mktime(12,0,0, GETPOST("datepmonth",'int'), GETPOST("datepday",'int'), GETPOST("datepyear",'int'));
$datev=dol_mktime(12,0,0, GETPOST("datevmonth",'int'), GETPOST("datevday",'int'), GETPOST("datevyear",'int'));
if (empty($datev)) $datev=$datep;
$object->accountid=GETPOST("accountid") > 0 ? GETPOST("accountid","int") : 0;
$object->ref=''; // TODO
$object->accountid=GETPOST("accountid",'int') > 0 ? GETPOST("accountid","int") : 0;
$object->datev=$datev;
$object->datep=$datep;
$object->amount=price2num(GETPOST("amount"));
$object->label=GETPOST("label");
$object->note=GETPOST("note");
$object->type_payment=GETPOST("paymenttype") > 0 ? GETPOST("paymenttype", "int") : 0;
$object->num_payment=GETPOST("num_payment");
$object->amount=price2num(GETPOST("amount",'alpha'));
$object->label=GETPOST("label",'none');
$object->note=GETPOST("note",'none');
$object->type_payment=GETPOST("paymenttype",'int') > 0 ? GETPOST("paymenttype", "int") : 0;
$object->num_payment=GETPOST("num_payment",'alpha');
$object->fk_user_author=$user->id;
$object->accountancy_code=GETPOST("accountancy_code") > 0 ? GETPOST("accountancy_code","int") : "";
$object->sens=GETPOST('sens');
$object->fk_project= GETPOST('fk_project');
$object->fk_project= GETPOST('fk_project','int');
if (empty($datep) || empty($datev))
{
@ -411,7 +412,7 @@ if ($id)
print '<table class="border" width="100%">';
// Label
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$object->label.'</td></tr>';
print '<tr><td class="titlefield">'.$langs->trans("Label").'</td><td>'.$object->label.'</td></tr>';
// Payment date
print "<tr>";

View File

@ -108,21 +108,19 @@ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.row
$sql.= " WHERE v.entity IN (".getEntity('payment_various').")";
// Search criteria
if ($search_ref) $sql.=" AND v.rowid=".$search_ref;
if ($search_label) $sql.=natural_search(array('v.label'), $search_label);
if ($search_amount_deb) $sql.=natural_search("v.amount", $search_amount_deb, 1);
if ($search_amount_cred) $sql.=natural_search("v.amount", $search_amount_cred, 1);
if ($search_account > 0) $sql.=" AND b.fk_account=".$search_account;
if ($search_date) $sql.=" AND v.datep=".$search_date;
if ($search_accountancy_code) $sql.=" AND v.accountancy_code=".$search_accountancy_code;
if ($search_ref) $sql.=" AND v.rowid=".$search_ref;
if ($search_label) $sql.=natural_search(array('v.label'), $search_label);
if ($search_amount_deb) $sql.=natural_search("v.amount", $search_amount_deb, 1);
if ($search_amount_cred) $sql.=natural_search("v.amount", $search_amount_cred, 1);
if ($search_account > 0) $sql.=" AND b.fk_account=".$search_account;
if ($search_date) $sql.=" AND v.datep=".$search_date;
if ($search_accountancy_code > 0) $sql.=" AND v.accountancy_code=".$search_accountancy_code;
if ($typeid > 0) $sql .= " AND v.fk_typepayment=".$typeid;
if ($filtre) {
$filtre=str_replace(":","=",$filtre);
$sql .= " AND ".$filtre;
}
if ($typeid) {
$sql .= " AND v.fk_typepayment=".$typeid;
}
$sql.= $db->order($sortfield,$sortorder);
$totalnboflines=0;
@ -142,10 +140,18 @@ if ($result)
$var=true;
$param='';
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($typeid) $param.='&amp;typeid='.$typeid;
if ($optioncss != '') $param.='&amp;optioncss='.$optioncss;
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit);
if ($search_ref) $param.='&search_ref='.urlencode($search_ref);
if ($search_label) $param.='&search_label='.urlencode($search_label);
if ($typeid > 0) $param.='&typeid='.urlencode($typeid);
if ($search_amount_deb) $param.='&search_amount_deb='.urlencode($search_amount_deb);
if ($search_amount_cred) $param.='&search_amount_cred='.urlencode($search_amount_cred);
if ($search_account > 0) $param.='&search_amount='.urlencode($search_account);
//if ($search_date) $param.='&search_date='.$search_date;
if ($search_accountancy_code > 0) $param.='&search_accountancy_code='.urlencode($search_accountancy_code);
if ($optioncss != '') $param.='&amp;optioncss='.urlencode($optioncss);
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
@ -162,18 +168,6 @@ if ($result)
print '<div class="div-table-responsive">';
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
print '<tr class="liste_titre">';
print_liste_field_titre("Ref",$_SERVER["PHP_SELF"],"v.rowid","",$param,"",$sortfield,$sortorder);
print_liste_field_titre("Label",$_SERVER["PHP_SELF"],"v.label","",$param,'align="left"',$sortfield,$sortorder);
print_liste_field_titre("DatePayment",$_SERVER["PHP_SELF"],"v.datep","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre("PaymentMode",$_SERVER["PHP_SELF"],"type","",$param,'align="left"',$sortfield,$sortorder);
if (! empty($conf->banque->enabled)) print_liste_field_titre("BankAccount",$_SERVER["PHP_SELF"],"ba.label","",$param,"",$sortfield,$sortorder);
if (! empty($conf->accounting->enabled)) print_liste_field_titre("AccountAccounting",$_SERVER["PHP_SELF"],"v.accountancy_code","",$param,'align="left"',$sortfield,$sortorder);
print_liste_field_titre("Debit",$_SERVER["PHP_SELF"],"v.amount","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre("Credit",$_SERVER["PHP_SELF"],"v.amount","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch ');
print "</tr>\n";
print '<tr class="liste_titre">';
// Ref
@ -227,6 +221,20 @@ if ($result)
print "</tr>\n";
print '<tr class="liste_titre">';
print_liste_field_titre("Ref",$_SERVER["PHP_SELF"],"v.rowid","",$param,"",$sortfield,$sortorder);
print_liste_field_titre("Label",$_SERVER["PHP_SELF"],"v.label","",$param,'align="left"',$sortfield,$sortorder);
print_liste_field_titre("DatePayment",$_SERVER["PHP_SELF"],"v.datep","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre("PaymentMode",$_SERVER["PHP_SELF"],"type","",$param,'align="left"',$sortfield,$sortorder);
if (! empty($conf->banque->enabled)) print_liste_field_titre("BankAccount",$_SERVER["PHP_SELF"],"ba.label","",$param,"",$sortfield,$sortorder);
if (! empty($conf->accounting->enabled)) print_liste_field_titre("AccountAccounting",$_SERVER["PHP_SELF"],"v.accountancy_code","",$param,'align="left"',$sortfield,$sortorder);
print_liste_field_titre("Debit",$_SERVER["PHP_SELF"],"v.amount","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre("Credit",$_SERVER["PHP_SELF"],"v.amount","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch ');
print "</tr>\n";
$totalarray=array();
while ($i < min($num,$limit))
{

View File

@ -1570,7 +1570,7 @@ if (empty($reshook))
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), null, 'errors');
$error ++;
}
if ($prod_entry_mode == 'free' && empty($idprod) && (! ($price_ht >= 0) || $price_ht == '') && $price_ht_devise == '') // Unit price can be 0 but not ''
if ($prod_entry_mode == 'free' && empty($idprod) && (($price_ht < 0 && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES)) || $price_ht == '') && $price_ht_devise == '') // Unit price can be 0 but not ''
{
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors');
$error ++;
@ -3047,10 +3047,10 @@ else if ($id > 0 || ! empty($ref))
}
}
// Confirmation de la validation
// Confirmation of validation
if ($action == 'valid')
{
// on verifie si l'objet est en numerotation provisoire
// we check object has a draft number
$objectref = substr($object->ref, 1, 4);
if ($objectref == 'PROV') {
$savdate = $object->date;

View File

@ -652,23 +652,42 @@ class Tva extends CommonObject
*
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
* @param string $option link option
* @param int $notooltip 1=Disable tooltip
* @return string Chaine with URL
*/
function getNomUrl($withpicto=0,$option='')
function getNomUrl($withpicto=0, $option='', $notooltip=0)
{
global $langs;
$result='';
$label=$langs->trans("ShowVatPayment").': '.$this->ref;
$link = '<a href="'.DOL_URL_ROOT.'/compta/tva/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$linkend='</a>';
$url = DOL_URL_ROOT.'/compta/tva/card.php?id='.$this->id;
$linkclose='';
if (empty($notooltip))
{
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
{
$label=$langs->trans("ShowMyObject");
$linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"';
}
$linkclose.=' title="'.dol_escape_htmltag($label, 1).'"';
$linkclose.=' class="classfortooltip'.($morecss?' '.$morecss:'').'"';
}
else $linkclose = ($morecss?' class="'.$morecss.'"':'');
$linkstart = '<a href="'.$url.'"';
$linkstart.=$linkclose.'>';
$linkend ='</a>';
$picto='payment';
if ($withpicto) $result.=($link.img_object($label, $picto, 'class="classfortooltip"').$linkend);
if ($withpicto && $withpicto != 2) $result.=' ';
if ($withpicto != 2) $result.=$link.$this->ref.$linkend;
$result .= $linkstart;
if ($withpicto) $result.=img_object(($notooltip?'':$label), ($this->picto?$this->picto:'generic'), ($notooltip?(($withpicto != 2) ? 'class="paddingright"' : ''):'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip?0:1);
if ($withpicto != 2) $result.= $this->ref;
$result .= $linkend;
return $result;
}

View File

@ -217,8 +217,11 @@ if ($result)
$tva_static->id=$obj->rowid;
$tva_static->ref=$obj->rowid;
// Ref
print "<td>".$tva_static->getNomUrl(1)."</td>\n";
print "<td>".dol_trunc($obj->label,40)."</td>\n";
// Label
print "<td>".dol_trunc($obj->label,40)."</td>\n";
print '<td align="center">'.dol_print_date($db->jdate($obj->dv),'day')."</td>\n";
print '<td align="center">'.dol_print_date($db->jdate($obj->dp),'day')."</td>\n";
// Type

View File

@ -42,6 +42,27 @@ class Contact extends CommonObject
public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
public $picto = 'contact';
// BEGIN MODULEBUILDER PROPERTIES
/**
* @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
*/
public $fields=array(
'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'index'=>1, 'position'=>1, 'comment'=>'Id'),
'lastname' =>array('type'=>'varchar(128)', 'label'=>'Name', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1),
'firstname' =>array('type'=>'varchar(128)', 'label'=>'Firstname', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>11, 'searchall'=>1),
'entity' =>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'default'=>1, 'notnull'=>1, 'index'=>1, 'position'=>20),
'note_public' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>60),
'note_private' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>61),
'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>500),
'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>501),
//'date_valid' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'position'=>502),
'fk_user_creat' =>array('type'=>'integer', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>510),
'fk_user_modif' =>array('type'=>'integer', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>511),
//'fk_user_valid' =>array('type'=>'integer', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>512),
'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'index'=>1, 'position'=>1000),
);
public $civility_id; // In fact we store civility_code
public $civility_code;
public $address;
@ -96,9 +117,15 @@ class Contact extends CommonObject
public $user_id;
public $user_login;
// END MODULEBUILDER PROPERTIES
public $oldcopy; // To contains a clone of this when we need to save old properties of object
/**
* Constructor
*
@ -131,7 +158,7 @@ class Contact extends CommonObject
$sql.= " WHERE sp.fk_soc = s.rowid AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
$clause = "AND";
}
$sql.= ' '.$clause.' sp.entity IN ('.getEntity($this->element, 1).')';
$sql.= ' '.$clause.' sp.entity IN ('.getEntity($this->element).')';
$sql.= " AND (sp.priv='0' OR (sp.priv='1' AND sp.fk_user_creat=".$user->id."))";
if ($user->societe_id > 0) $sql.=" AND sp.fk_soc = ".$user->societe_id;

View File

@ -33,14 +33,14 @@ if (GETPOST('formfilteraction') == 'listafterchangingselectedfields')
$tabparam=array();
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
if (GETPOST("selectedfields")) $tabparam["MAIN_SELECTEDFIELDS_".$varpage]=GETPOST("selectedfields");
else $tabparam["MAIN_SELECTEDFIELDS_".$varpage]='';
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
$result=dol_set_user_param($db, $conf, $user, $tabparam);
//$action='list';
//var_dump($tabparam);exit;
}

View File

@ -84,7 +84,7 @@ class box_produits extends ModeleBoxes
{
$sql = "SELECT p.rowid, p.label, p.ref, p.price, p.price_base_type, p.price_ttc, p.fk_product_type, p.tms, p.tosell, p.tobuy, p.fk_price_expression, p.entity";
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
$sql.= ' WHERE p.entity IN ('.getEntity($productstatic->element, 1).')';
$sql.= ' WHERE p.entity IN ('.getEntity($productstatic->element).')';
if (empty($user->rights->produit->lire)) $sql.=' AND p.fk_product_type != 0';
if (empty($user->rights->service->lire)) $sql.=' AND p.fk_product_type != 1';
// Add where from hooks

View File

@ -88,7 +88,7 @@ class box_produits_alerte_stock extends ModeleBoxes
$sql.= " SUM(".$db->ifsql("s.reel IS NULL","0","s.reel").") as total_stock";
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as s on p.rowid = s.fk_product";
$sql.= ' WHERE p.entity IN ('.getEntity($productstatic->element, 1).')';
$sql.= ' WHERE p.entity IN ('.getEntity($productstatic->element).')';
$sql.= " AND p.tosell = 1 AND p.seuil_stock_alerte > 0";
if (empty($user->rights->produit->lire)) $sql.=' AND p.fk_product_type != 0';
if (empty($user->rights->service->lire)) $sql.=' AND p.fk_product_type != 1';

View File

@ -5849,7 +5849,7 @@ abstract class CommonObject
* @param int $dest_id New thirdparty id (the thirdparty that will received element of the other)
* @param string[] $tables Tables that need to be changed
* @param int $ignoreerrors Ignore errors. Return true even if errors. We need this when replacement can fails like for categories (categorie of old thirdparty may already exists on new one)
* @return bool
* @return bool True if success, False if error
*/
public static function commonReplaceThirdparty(DoliDB $db, $origin_id, $dest_id, array $tables, $ignoreerrors=0)
{

View File

@ -259,9 +259,6 @@ class Conf
// Load translation object with current language
if (empty($this->global->MAIN_LANG_DEFAULT)) $this->global->MAIN_LANG_DEFAULT="en_US";
//if (! isset($this->global->MAIN_REPEATCONTACTONEACHTAB)) $this->global->MAIN_REPEATCONTACTONEACHTAB=1;
//if (! isset($this->global->MAIN_REPEATADDRESSONEACHTAB)) $this->global->MAIN_REPEATADDRESSONEACHTAB=1;
$rootfordata = DOL_DATA_ROOT;
$rootforuser = DOL_DATA_ROOT;
// If multicompany module is enabled, we redefine the root of data

View File

@ -309,7 +309,7 @@ class ExtraFields
if (! empty($attrname) && preg_match("/^\w[a-zA-Z0-9-_]*$/",$attrname) && ! is_numeric($attrname))
{
if(is_array($param) && count($param) > 0)
if (is_array($param) && count($param) > 0)
{
$params = serialize($param);
}
@ -627,10 +627,17 @@ class ExtraFields
{
$this->db->begin();
if (is_array($param))
if (is_array($param) && count($param) > 0)
{
if (count($param) > 0) $param = $this->db->escape(serialize($param));
else $param='';
$params = serialize($param);
}
elseif (strlen($param) > 0)
{
$params = trim($param);
}
else
{
$params='';
}
$sql_del = "DELETE FROM ".MAIN_DB_PREFIX."extrafields";
@ -674,7 +681,7 @@ class ExtraFields
$sql.= " ".($langfile?"'".$this->db->escape($langfile)."'":"null").",";
$sql.= " ".$pos.",";
$sql.= " '".$this->db->escape($alwayseditable)."',";
$sql.= " '".$this->db->escape($param)."',";
$sql.= " '".$this->db->escape($params)."',";
$sql.= " ".$list.", ";
$sql.= " ".(($default!='')?"'".$this->db->escape($default)."'":"null").",";
$sql.= " ".($computed?"'".$this->db->escape($computed)."'":"null").",";
@ -1344,28 +1351,48 @@ class ExtraFields
/**
* Return HTML string to put an output field into a page
*
* @param string $key Key of attribute
* @param string $value Value to show
* @param string $moreparam To add more parameters on html input tag (only checkbox use html input for output rendering)
* @return string Formated value
* @param string $key Key of attribute
* @param string $value Value to show
* @param string $moreparam To add more parameters on html input tag (only checkbox use html input for output rendering)
* @param string $extrafieldsobjectkey If defined, use the new method to get extrafields data
* @return string Formated value
*/
function showOutputField($key,$value,$moreparam='')
function showOutputField($key, $value, $moreparam='', $extrafieldsobjectkey='')
{
global $conf,$langs;
$elementtype=$this->attribute_elementtype[$key]; // seems not used
$label=$this->attribute_label[$key];
$type=$this->attribute_type[$key];
$size=$this->attribute_size[$key];
$default=$this->attribute_default[$key];
$computed=$this->attribute_computed[$key];
$unique=$this->attribute_unique[$key];
$required=$this->attribute_required[$key];
$param=$this->attribute_param[$key];
$perms=$this->attribute_perms[$key];
$langfile=$this->attribute_langfile[$key];
$list=$this->attribute_list[$key];
$hidden=(($list == 0) ? 1 : 0); // If zero, we are sure it is hidden, otherwise we show. If it depends on mode (view/create/edit form or list, this must be filtered by caller)
if (! empty($extrafieldsobjectkey))
{
$elementtype=$this->attributes[$extrafieldsobjectkey]['elementtype'][$key]; // seems not used
$label=$this->attributes[$extrafieldsobjectkey]['label'][$key];
$type=$this->attributes[$extrafieldsobjectkey]['type'][$key];
$size=$this->attributes[$extrafieldsobjectkey]['size'][$key];
$default=$this->attributes[$extrafieldsobjectkey]['default'][$key];
$computed=$this->attributes[$extrafieldsobjectkey]['computed'][$key];
$unique=$this->attributes[$extrafieldsobjectkey]['unique'][$key];
$required=$this->attributes[$extrafieldsobjectkey]['required'][$key];
$param=$this->attributes[$extrafieldsobjectkey]['param'][$key];
$perms=$this->attributes[$extrafieldsobjectkey]['perms'][$key];
$langfile=$this->attributes[$extrafieldsobjectkey]['langfile'][$key];
$list=$this->attributes[$extrafieldsobjectkey]['list'][$key];
$hidden=(($list == 0) ? 1 : 0); // If zero, we are sure it is hidden, otherwise we show. If it depends on mode (view/create/edit form or list, this must be filtered by caller)
}
else
{
$elementtype=$this->attribute_elementtype[$key]; // seems not used
$label=$this->attribute_label[$key];
$type=$this->attribute_type[$key];
$size=$this->attribute_size[$key];
$default=$this->attribute_default[$key];
$computed=$this->attribute_computed[$key];
$unique=$this->attribute_unique[$key];
$required=$this->attribute_required[$key];
$param=$this->attribute_param[$key];
$perms=$this->attribute_perms[$key];
$langfile=$this->attribute_langfile[$key];
$list=$this->attribute_list[$key];
$hidden=(($list == 0) ? 1 : 0); // If zero, we are sure it is hidden, otherwise we show. If it depends on mode (view/create/edit form or list, this must be filtered by caller)
}
if ($hidden) return ''; // This is a protection. If field is hidden, we should just not call this method.
@ -1593,6 +1620,7 @@ class ExtraFields
elseif ($type == 'link')
{
$out='';
// only if something to display (perf)
if ($value)
{
@ -1641,14 +1669,16 @@ class ExtraFields
/**
* Return tag to describe alignement to use for this extrafield
*
* @param string $key Key of attribute
* @return string Formated value
* @param string $key Key of attribute
* @param string $extrafieldsobjectkey If defined, use the new method to get extrafields data
* @return string Formated value
*/
function getAlignFlag($key)
function getAlignFlag($key, $extrafieldsobjectkey='')
{
global $conf,$langs;
$type=$this->attribute_type[$key];
if (! empty($extrafieldsobjectkey)) $type=$this->attributes[$extrafieldsobjectkey]['type'][$key];
else $type=$this->attribute_type[$key];
$align='';

View File

@ -5275,7 +5275,7 @@ class Form
$confkeyforautocompletemode=strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
$fieldstoshow='t.ref';
if (! empty($objecttmp->fields))
if (! empty($objecttmp->fields)) // For object that declare it, it is better to use declared fields ( like societe, contact, ...)
{
$tmpfieldstoshow='';
foreach($objecttmp->fields as $key => $val)

View File

@ -993,7 +993,7 @@ class FormMail extends Form
$sql = "SELECT label, topic, joinfiles, content, content_lines, lang";
$sql.= " FROM ".MAIN_DB_PREFIX.'c_email_templates';
$sql.= " WHERE (type_template='".$db->escape($type_template)."' OR type_template='all')";
$sql.= " AND entity IN (".getEntity('c_email_templates', 0).")";
$sql.= " AND entity IN (".getEntity('c_email_templates').")";
$sql.= " AND (private = 0 OR fk_user = ".$user->id.")"; // Get all public or private owned
if ($active >= 0) $sql.=" AND active = ".$active;
if (is_object($outputlangs)) $sql.= " AND (lang = '".$outputlangs->defaultlang."' OR lang IS NULL OR lang = '')";
@ -1065,7 +1065,7 @@ class FormMail extends Form
$sql = "SELECT label, topic, content, lang";
$sql.= " FROM ".MAIN_DB_PREFIX.'c_email_templates';
$sql.= " WHERE type_template='".$this->db->escape($type_template)."'";
$sql.= " AND entity IN (".getEntity('c_email_templates', 0).")";
$sql.= " AND entity IN (".getEntity('c_email_templates').")";
$sql.= " AND (fk_user is NULL or fk_user = 0 or fk_user = ".$user->id.")";
if (is_object($outputlangs)) $sql.= " AND (lang = '".$outputlangs->defaultlang."' OR lang IS NULL OR lang = '')";
$sql.= $this->db->order("lang,label","ASC");
@ -1102,7 +1102,7 @@ class FormMail extends Form
$sql = "SELECT rowid, label, topic, content, content_lines, lang, fk_user, private, position";
$sql.= " FROM ".MAIN_DB_PREFIX.'c_email_templates';
$sql.= " WHERE type_template IN ('".$this->db->escape($type_template)."', 'all')";
$sql.= " AND entity IN (".getEntity('c_email_templates', 1).")";
$sql.= " AND entity IN (".getEntity('c_email_templates').")";
$sql.= " AND (private = 0 OR fk_user = ".$user->id.")"; // See all public templates or templates I own.
if ($active >= 0) $sql.=" AND active = ".$active;
//if (is_object($outputlangs)) $sql.= " AND (lang = '".$outputlangs->defaultlang."' OR lang IS NULL OR lang = '')"; // Return all languages

View File

@ -47,7 +47,7 @@ class FormProjets
* Output a combo list with projects qualified for a third party / user
*
* @param int $socid Id third party (-1=all, 0=only projects not linked to a third party, id=projects not linked or linked to third party id)
* @param int $selected Id project preselected
* @param string $selected Id project preselected ('' or id of project)
* @param string $htmlname Name of HTML field
* @param int $maxlength Maximum length of label
* @param int $option_only Return only html options lines without the select tag

View File

@ -640,7 +640,6 @@ function isInEEC($object)
function show_projects($conf, $langs, $db, $object, $backtopage='', $nocreatelink=0, $morehtmlright='')
{
global $user;
global $bc;
$i = -1 ;
@ -768,10 +767,10 @@ function show_projects($conf, $langs, $db, $object, $backtopage='', $nocreatelin
*/
function show_contacts($conf,$langs,$db,$object,$backtopage='')
{
global $user,$conf;
global $bc;
global $user,$conf,$extrafields,$hookmanager;
global $contextpage;
$form= new Form($db);
$form = new Form($db);
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
@ -782,24 +781,67 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
$search_addressphone = GETPOST("search_addressphone",'alpha');
if (! $sortorder) $sortorder="ASC";
if (! $sortfield) $sortfield="p.lastname";
if (! $sortfield) $sortfield="t.lastname";
if (! empty($conf->clicktodial->enabled))
{
$user->fetch_clicktodial(); // lecture des infos de clicktodial du user
}
$contactstatic = new Contact($db);
$extralabels=$extrafields->fetch_name_optionals_label($contactstatic->table_element);
$contactstatic->fields=array(
'name' =>array('type'=>'varchar(128)', 'label'=>'Name', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1),
'poste' =>array('type'=>'varchar(128)', 'label'=>'PostOfFunction', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>20),
'address' =>array('type'=>'varchar(128)', 'label'=>'Address', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>30),
'statut' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'default'=>0, 'index'=>1, 'position'=>40, 'arrayofkeyval'=>array(0=>$contactstatic->LibStatut(0,1), 1=>$contactstatic->LibStatut(1,1))),
);
// Definition of fields for list
$arrayfields=array(
't.rowid'=>array('label'=>"TechnicalID", 'checked'=>($conf->global->MAIN_SHOW_TECHNICAL_ID?1:0), 'enabled'=>($conf->global->MAIN_SHOW_TECHNICAL_ID?1:0), 'position'=>1),
't.name'=>array('label'=>"Name", 'checked'=>1, 'position'=>10),
't.poste'=>array('label'=>"PostOrFunction", 'checked'=>1, 'position'=>20),
't.address'=>array('label'=>(empty($conf->dol_optimize_smallscreen) ? $langs->trans("Address").' / '.$langs->trans("Phone").' / '.$langs->trans("Email") : $langs->trans("Address")), 'checked'=>1, 'position'=>30),
't.statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>40, 'align'=>'center'),
);
// Extra fields
if (is_array($extrafields->attributes[$contactstatic->table_element]['label']) && count($extrafields->attributes[$contactstatic->table_element]['label']))
{
foreach($extrafields->attributes[$contactstatic->table_element]['label'] as $key => $val)
{
if (! empty($extrafields->attributes[$contactstatic->table_element]['list'][$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attributes[$contactstatic->table_element]['label'][$key], 'checked'=>(($extrafields->attributes[$contactstatic->table_element]['list'][$key]<0)?0:1), 'position'=>$extrafields->attributes[$contactstatic->table_element]['pos'][$key], 'enabled'=>(abs($extrafields->attributes[$contactstatic->table_element]['list'][$key])!=3 && $extrafields->attributes[$contactstatic->table_element]['perms'][$key]));
}
}
// Initialize array of search criterias
$search=array();
foreach($contactstatic->fields as $key => $val)
{
if (GETPOST('search_'.$key,'alpha')) $search[$key]=GETPOST('search_'.$key,'alpha');
}
// Purge search criteria
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
{
$search_status = '';
$search_name = '';
$search_addressphone = '';
$search_array_options=array();
foreach($contactstatic->fields as $key => $val)
{
$search[$key]='';
}
$toselect='';
}
$i=-1;
$contactstatic = new Contact($db);
if (! empty($conf->clicktodial->enabled))
{
$user->fetch_clicktodial(); // lecture des infos de clicktodial
}
$contactstatic->fields = dol_sort_array($contactstatic->fields, 'position');
$arrayfields = dol_sort_array($arrayfields, 'position');
$buttoncreate='';
if ($user->rights->societe->contact->creer)
@ -815,25 +857,30 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
print load_fiche_titre($title, $buttoncreate,'');
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'" name="formfilter">';
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
print '<input type="hidden" name="socid" value="'.$object->id.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="page" value="'.$page.'">';
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
//if ($massactionbutton) $selectedfields.=$form->showCheckAddButtons('checkforselect', 1);
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
print "\n".'<table class="noborder" width="100%">'."\n";
print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
print "\n".'<table class="tagtable liste">'."\n";
$param="socid=".$object->id;
if ($search_status != '') $param.='&amp;search_status='.$search_status;
if ($search_name != '') $param.='&amp;search_name='.urlencode($search_name);
$sql = "SELECT p.rowid, p.lastname, p.firstname, p.fk_pays as country_id, p.civility, p.poste, p.phone as phone_pro, p.phone_mobile, p.phone_perso, p.fax, p.email, p.skype, p.statut, p.photo,";
$sql .= " p.civility as civility_id, p.address, p.zip, p.town";
$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as p";
$sql .= " WHERE p.fk_soc = ".$object->id;
if ($search_status!='' && $search_status != '-1') $sql .= " AND p.statut = ".$db->escape($search_status);
if ($search_name) $sql .= " AND (p.lastname LIKE '%".$db->escape($search_name)."%' OR p.firstname LIKE '%".$db->escape($search_name)."%')";
$sql = "SELECT t.rowid, t.lastname, t.firstname, t.fk_pays as country_id, t.civility, t.poste, t.phone as phone_pro, t.phone_mobile, t.phone_perso, t.fax, t.email, t.skype, t.statut, t.photo,";
$sql .= " t.civility as civility_id, t.address, t.zip, t.town";
$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as t";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople_extrafields as ef on (t.rowid = ef.fk_object)";
$sql .= " WHERE t.fk_soc = ".$object->id;
if ($search_status!='' && $search_status != '-1') $sql .= " AND t.statut = ".$db->escape($search_status);
if ($search_name) $sql .= " AND (t.lastname LIKE '%".$db->escape($search_name)."%' OR t.firstname LIKE '%".$db->escape($search_name)."%')";
$sql.= " ORDER BY $sortfield $sortorder";
dol_syslog('core/lib/company.lib.php :: show_contacts', LOG_DEBUG);
@ -842,59 +889,63 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
$num = $db->num_rows($result);
$colspan=9;
print '<tr class="liste_titre">';
// Photo - Name
print '<td class="liste_titre">';
print '<input type="text" class="flat minwidth75" name="search_name" value="'.dol_escape_htmltag($search_name).'">';
print '</td>';
// Position
print '<td class="liste_titre">';
print '</td>';
// Address - Phone - Email
print '<td class="liste_titre"></td>';
// Status
print '<td class="liste_titre maxwidthonsmartphone" align="center">';
print $form->selectarray('search_status', array('-1'=>'','0'=>$contactstatic->LibStatut(0,1),'1'=>$contactstatic->LibStatut(1,1)),$search_status);
print '</td>';
// Add to agenda
if (! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create)
{
$colspan++;
print '<td class="liste_titre"></td>';
}
// Action
print '<td class="liste_titre" align="right">';
$searchpicto=$form->showFilterButtons();
print $searchpicto;
print '</td>';
print "</tr>";
$titlefieldaddress=$langs->trans("Address").' / '.$langs->trans("Phone").' / '.$langs->trans("Email");
if (! empty($conf->dol_optimize_smallscreen)) $titlefieldaddress=$langs->trans("Address");
// Fields title search
// --------------------------------------------------------------------
print '<tr class="liste_titre">';
print_liste_field_titre("Name",$_SERVER["PHP_SELF"],"p.lastname","",$param,'',$sortfield,$sortorder);
print_liste_field_titre("Poste",$_SERVER["PHP_SELF"],"p.poste","",$param,'',$sortfield,$sortorder);
print_liste_field_titre($titlefieldaddress,$_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder);
print_liste_field_titre("Status",$_SERVER["PHP_SELF"],"p.statut","",$param,'align="center"',$sortfield,$sortorder);
// Add to agenda
if (! empty($conf->agenda->enabled) && ! empty($user->rights->agenda->myactions->create)) print_liste_field_titre('');
// Edit
print_liste_field_titre('');
print "</tr>\n";
foreach($contactstatic->fields as $key => $val)
{
$align='';
if (in_array($val['type'], array('date','datetime','timestamp'))) $align.=($align?' ':'').'center';
if (in_array($val['type'], array('timestamp'))) $align.=($align?' ':'').'nowrap';
if ($key == 'status' || $key == 'statut') $align.=($align?' ':'').'center';
if (! empty($arrayfields['t.'.$key]['checked']))
{
print '<td class="liste_titre'.($align?' '.$align:'').'">';
if (in_array($key, array('lastname','name'))) print '<input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag($search[$key]).'">';
elseif (in_array($key, array('statut'))) print $form->selectarray('search_status', array('-1'=>'','0'=>$contactstatic->LibStatut(0,1),'1'=>$contactstatic->LibStatut(1,1)),$search_status);
print '</td>';
}
}
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
// Fields from hook
$parameters=array('arrayfields'=>$arrayfields);
$reshook=$hookmanager->executeHooks('printFieldListOption', $parameters, $contactstatic); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Action column
print '<td class="liste_titre" align="right">';
$searchpicto=$form->showFilterButtons();
print $searchpicto;
print '</td>';
print '</tr>'."\n";
// Fields title label
// --------------------------------------------------------------------
print '<tr class="liste_titre">';
foreach($contactstatic->fields as $key => $val)
{
$align='';
if (in_array($val['type'], array('date','datetime','timestamp'))) $align.=($align?' ':'').'center';
if (in_array($val['type'], array('timestamp'))) $align.=($align?' ':'').'nowrap';
if ($key == 'status' || $key == 'statut') $align.=($align?' ':'').'center';
if (! empty($arrayfields['t.'.$key]['checked'])) print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($align?'class="'.$align.'"':''), $sortfield, $sortorder, $align.' ')."\n";
}
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
// Hook fields
$parameters=array('arrayfields'=>$arrayfields);
$reshook=$hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"],'','','','align="center"',$sortfield,$sortorder,'maxwidthsearch ')."\n";
print '</tr>'."\n";
$i = -1;
if ($num || (GETPOST('button_search') || GETPOST('button_search.x') || GETPOST('button_search_x')))
{
$i=0;
$i = 0;
while ($i < $num)
{
@ -923,46 +974,81 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
$contactstatic->country_code = $country_code;
$contactstatic->setGenderFromCivility();
$contactstatic->fetch_optionals();
if (is_array($contactstatic->array_options))
{
foreach($contactstatic->array_options as $key => $val)
{
$obj->$key = $val;
}
}
print '<tr class="oddeven">';
// ID
if (! empty($arrayfields['t.rowid']['checked']))
{
print '<td>';
print $contactstatic->id;
print '</td>';
}
// Photo - Name
print '<td>';
print $form->showphoto('contact',$contactstatic,0,0,0,'photorefnoborder valignmiddle marginrightonly','small',1,0,1);
print $contactstatic->getNomUrl(0,'',0,'&backtopage='.urlencode($backtopage));
print '</td>';
if (! empty($arrayfields['t.name']['checked']))
{
print '<td>';
print $form->showphoto('contact',$contactstatic,0,0,0,'photorefnoborder valignmiddle marginrightonly','small',1,0,1);
print $contactstatic->getNomUrl(0,'',0,'&backtopage='.urlencode($backtopage));
print '</td>';
}
// Job position
print '<td>';
if ($obj->poste) print $obj->poste;
print '</td>';
if (! empty($arrayfields['t.poste']['checked']))
{
print '<td>';
if ($obj->poste) print $obj->poste;
print '</td>';
}
// Address - Phone - Email
print '<td>';
print $contactstatic->getBannerAddress('contact', $object);
print '</td>';
if (! empty($arrayfields['t.address']['checked']))
{
print '<td>';
print $contactstatic->getBannerAddress('contact', $object);
print '</td>';
}
// Status
print '<td align="center">'.$contactstatic->getLibStatut(5).'</td>';
if (! empty($arrayfields['t.statut']['checked']))
{
print '<td align="center">'.$contactstatic->getLibStatut(5).'</td>';
}
// Add to agenda
// Extra fields
$extrafieldsobjectkey='socpeople';
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
// Actions
print '<td align="right">';
// Add to agenda
if (! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create)
{
print '<td align="center">';
print '<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&actioncode=&contactid='.$obj->rowid.'&socid='.$object->id.'&backtopage='.urlencode($backtopage).'">';
print img_object($langs->trans("Event"),"action");
print '</a></td>';
print '</a> &nbsp; ';
}
// Edit
if ($user->rights->societe->contact->creer)
{
print '<td align="right">';
print '<a href="'.DOL_URL_ROOT.'/contact/card.php?action=edit&amp;id='.$obj->rowid.'&amp;backtopage='.urlencode($backtopage).'">';
print img_edit();
print '</a></td>';
print '</a>';
}
else print '<td>&nbsp;</td>';
print '</td>';
print "</tr>\n";
$i++;
@ -970,9 +1056,9 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
}
else
{
print '<tr class="oddeven">';
print '<td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("None").'</td>';
print "</tr>\n";
$colspan=1;
foreach($arrayfields as $key => $val) { if (! empty($val['checked'])) $colspan++; }
print '<tr><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
}
print "\n</table>\n";
print '</div>';
@ -995,7 +1081,6 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
function show_addresses($conf,$langs,$db,$object,$backtopage='')
{
global $user;
global $bc;
require_once DOL_DOCUMENT_ROOT.'/societe/class/address.class.php';
@ -1087,7 +1172,7 @@ function show_addresses($conf,$langs,$db,$object,$backtopage='')
*/
function show_actions_todo($conf,$langs,$db,$filterobj,$objcon='',$noprint=0,$actioncode='')
{
global $bc,$user,$conf;
global $user,$conf;
$out = show_actions_done($conf,$langs,$db,$filterobj,$objcon,1,$actioncode, 'todo');
@ -1114,7 +1199,7 @@ function show_actions_todo($conf,$langs,$db,$filterobj,$objcon='',$noprint=0,$ac
*/
function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=0, $actioncode='', $donetodo='done', $filters=array(), $sortfield='a.datep,a.id', $sortorder='DESC')
{
global $bc,$user,$conf;
global $user,$conf;
global $form;
global $param;
@ -1142,14 +1227,14 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
if (is_object($filterobj) && get_class($filterobj) == 'Adherent') $sql.= ", m.lastname, m.firstname";
if (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur') $sql.= ", o.ref";
if (is_object($filterobj) && get_class($filterobj) == 'Product') $sql.= ", o.ref";
$sql.= " FROM ".MAIN_DB_PREFIX."user as u, ".MAIN_DB_PREFIX."actioncomm as a";
$sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on u.rowid = a.fk_user_action";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_actioncomm as c ON a.fk_action = c.id";
if (is_object($filterobj) && get_class($filterobj) == 'Societe') $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid";
if (is_object($filterobj) && get_class($filterobj) == 'Adherent') $sql.= ", ".MAIN_DB_PREFIX."adherent as m";
if (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur') $sql.= ", ".MAIN_DB_PREFIX."commande_fournisseur as o";
if (is_object($filterobj) && get_class($filterobj) == 'Product') $sql.= ", ".MAIN_DB_PREFIX."product as o";
$sql.= " WHERE u.rowid = a.fk_user_action";
$sql.= " AND a.entity IN (".getEntity('agenda').")";
$sql.= " WHERE a.entity IN (".getEntity('agenda').")";
if (is_object($filterobj) && get_class($filterobj) == 'Societe' && $filterobj->id) $sql.= " AND a.fk_soc = ".$filterobj->id;
if (is_object($filterobj) && get_class($filterobj) == 'Project' && $filterobj->id) $sql.= " AND a.fk_project = ".$filterobj->id;
if (is_object($filterobj) && get_class($filterobj) == 'Adherent')
@ -1192,7 +1277,6 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
if ($donetodo == 'done') $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep <= '".$db->idate($now)."'))";
if (is_array($filters) && $filters['search_agenda_label']) $sql.= natural_search('a.label', $filters['search_agenda_label']);
$sql.= $db->order($sortfield, $sortorder);
dol_syslog("company.lib::show_actions_done", LOG_DEBUG);
$resql=$db->query($sql);
if ($resql)
@ -1298,7 +1382,6 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
}
}
if (! empty($conf->agenda->enabled) || (! empty($conf->mailing->enabled) && ! empty($objcon->email)))
{
$delay_warning=$conf->global->MAIN_DELAY_ACTIONS_TODO*24*60*60;
@ -1385,7 +1468,6 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
foreach ($histo as $key=>$value)
{
$actionstatic->fetch($histo[$key]['id']); // TODO Do we need this, we already have a lot of data of line into $histo
$out.='<tr class="oddeven">';
@ -1407,8 +1489,11 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
//$userstatic->id=$histo[$key]['userid'];
//$userstatic->login=$histo[$key]['login'];
//$out.=$userstatic->getLoginUrl(1);
$userstatic->fetch($histo[$key]['userid']);
$out.=$userstatic->getNomUrl(-1);
if ($histo[$key]['userid'] > 0)
{
$userstatic->fetch($histo[$key]['userid']);
$out.=$userstatic->getNomUrl(-1);
}
$out.='</td>';
// Type
@ -1560,7 +1645,6 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
function show_subsidiaries($conf,$langs,$db,$object)
{
global $user;
global $bc;
$i=-1;

View File

@ -111,7 +111,7 @@ function getDoliDBInstance($type, $host, $user, $pass, $name, $port)
* 'commande', 'commande_fournisseur', 'expedition', 'intervention', 'survey',
* 'contract', 'tax', 'expensereport', 'holiday', 'multicurrency', 'project',
* 'email_template', 'event', 'donation'
* 'c_paiement', ...
* 'c_paiement', 'c_payment_term', ...
* @param int $shared 0=Return id of current entity only,
* 1=Return id of current entity + shared entities (default)
* @param int $forceentity Entity id

View File

@ -995,7 +995,12 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m
else dol_print_error($db);
// Check if we must force counter to maskoffset
if (empty($counter) || preg_match('/[^0-9]/i',$counter)) $counter=$maskoffset;
if (empty($counter)) $counter=$maskoffset;
else if (preg_match('/[^0-9]/i',$counter))
{
$counter=0;
dol_syslog("Error, the last counter found is '".$counter."' so is not a numeric value. We will restart to 1.", LOG_ERR);
}
else if ($counter < $maskoffset && empty($conf->global->MAIN_NUMBERING_OFFSET_ONLY_FOR_FIRST)) $counter=$maskoffset;
if ($mode == 'last') // We found value for counter = last counter value. Now need to get corresponding ref of invoice.

View File

@ -686,7 +686,7 @@ class pdf_crabe extends ModelePDFFactures
$posy=$this->_tableau_tot($pdf, $object, $deja_regle, $bottomlasttab, $outputlangs);
// Affiche zone versements
if ($deja_regle || $amount_credit_notes_included || $amount_deposits_included)
if (($deja_regle || $amount_credit_notes_included || $amount_deposits_included) && empty($conf->global->INVOICE_NO_PAYMENT_DETAILS))
{
$posy=$this->_tableau_versements($pdf, $object, $posy, $outputlangs);
}
@ -1294,7 +1294,7 @@ class pdf_crabe extends ModelePDFFactures
$resteapayer = price2num($total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 'MT');
if ($object->paye) $resteapayer=0;
if ($deja_regle > 0 || $creditnoteamount > 0 || $depositsamount > 0)
if (($deja_regle > 0 || $creditnoteamount > 0 || $depositsamount > 0) && empty($conf->global->INVOICE_NO_PAYMENT_DETAILS))
{
// Already paid + Deposits
$index++;

View File

@ -8,32 +8,69 @@ if (empty($conf) || ! is_object($conf))
}
// Loop to show all columns of extrafields from $obj, $extrafields and $db
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
if (! empty($extrafieldsobjectkey)) // New method: $extrafieldsobject can be 'societe', 'socpeople', ...
{
foreach($extrafields->attribute_label as $key => $val)
if (is_array($extrafields->attributes[$extrafieldsobjectkey]['label']) && count($extrafields->attributes[$extrafieldsobjectkey]['label']))
{
if (! empty($arrayfields["ef.".$key]['checked']))
foreach($extrafields->attributes[$extrafieldsobjectkey]['label'] as $key => $val)
{
$align=$extrafields->getAlignFlag($key);
print '<td';
if ($align) print ' align="'.$align.'"';
print '>';
$tmpkey='options_'.$key;
if (in_array($extrafields->attribute_type[$key], array('date', 'datetime', 'timestamp')))
if (! empty($arrayfields["ef.".$key]['checked']))
{
$value = $db->jdate($obj->$tmpkey);
$align=$extrafields->getAlignFlag($key, $extrafieldsobjectkey);
print '<td';
if ($align) print ' align="'.$align.'"';
print '>';
$tmpkey='options_'.$key;
if (in_array($extrafields->attributes[$extrafieldsobjectkey]['type'][$key], array('date', 'datetime', 'timestamp')))
{
$value = $db->jdate($obj->$tmpkey);
}
else
{
$value = $obj->$tmpkey;
}
print $extrafields->showOutputField($key, $value, '', $extrafieldsobjectkey);
print '</td>';
if (! $i) $totalarray['nbfield']++;
if (! empty($val['isameasure']))
{
if (! $i) $totalarray['pos'][$totalarray['nbfield']]='ef.'.$tmpkey;
$totalarray['val']['ef.'.$tmpkey] += $obj->$tmpkey;
}
}
else
}
}
}
else // Old method
{
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
{
foreach($extrafields->attribute_label as $key => $val)
{
if (! empty($arrayfields["ef.".$key]['checked']))
{
$value = $obj->$tmpkey;
}
print $extrafields->showOutputField($key, $value, '');
print '</td>';
if (! $i) $totalarray['nbfield']++;
if (! empty($val['isameasure']))
{
if (! $i) $totalarray['pos'][$totalarray['nbfield']]='ef.'.$tmpkey;
$totalarray['val']['ef.'.$tmpkey] += $obj->$tmpkey;
$align=$extrafields->getAlignFlag($key);
print '<td';
if ($align) print ' align="'.$align.'"';
print '>';
$tmpkey='options_'.$key;
if (in_array($extrafields->attribute_type[$key], array('date', 'datetime', 'timestamp')))
{
$value = $db->jdate($obj->$tmpkey);
}
else
{
$value = $obj->$tmpkey;
}
print $extrafields->showOutputField($key, $value, '');
print '</td>';
if (! $i) $totalarray['nbfield']++;
if (! empty($val['isameasure']))
{
if (! $i) $totalarray['pos'][$totalarray['nbfield']]='ef.'.$tmpkey;
$totalarray['val']['ef.'.$tmpkey] += $obj->$tmpkey;
}
}
}
}

View File

@ -51,7 +51,7 @@ class InterfaceActionsBlockedLog extends DolibarrTriggers
if (empty($conf->blockedlog->enabled)) return 0; // Module not active, we do nothing
// Test if event/record is qualified
$listofqualifiedelement = array('facture', 'don', 'payment', 'payment_donation', 'subscription');
$listofqualifiedelement = array('facture', 'don', 'payment', 'payment_donation', 'subscription','payment_various');
if (! in_array($object->element, $listofqualifiedelement)) return 1;
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
@ -120,9 +120,10 @@ class InterfaceActionsBlockedLog extends DolibarrTriggers
$res = $b->create($user);
if ($res<0)
if ($res < 0)
{
setEventMessages($b->error, $b->errors, 'errors');
$this->error = $b->error;
$this->errors = $b->errors;
return -1;
}
else

View File

@ -128,7 +128,7 @@ class Fichinter extends CommonObject
$sql.= " WHERE sc.fk_user = " .$user->id;
$clause = "AND";
}
$sql.= " ".$clause." fi.entity IN (".getEntity($this->element, 1).")";
$sql.= " ".$clause." fi.entity IN (".getEntity($this->element).")";
$resql=$this->db->query($sql);
if ($resql)

View File

@ -779,7 +779,7 @@ if ($object->id > 0)
print '</div>';
if (! empty($conf->global->MAIN_REPEATCONTACTONEACHTAB))
if (! empty($conf->global->MAIN_DUPLICATE_CONTACTS_TAB_ON_MAIN_CARD))
{
print '<br>';
// List of contacts

View File

@ -415,7 +415,7 @@ ExtrafieldParamHelpcheckbox=List of values must be lines with format key,value (
ExtrafieldParamHelpradio=List of values must be lines with format key,value (where key can't be '0')<br><br> for example : <br>1,value1<br>2,value2<br>3,value3<br>...
ExtrafieldParamHelpsellist=List of values comes from a table<br>Syntax : table_name:label_field:id_field::filter<br>Example : c_typent:libelle:id::filter<br><br>- idfilter is necessarly a primary int key<br>- filter can be a simple test (eg active=1) to display only active value<br>You can also use $ID$ in filter witch is the current id of current object<br>To do a SELECT in filter use $SEL$<br>if you want to filter on extrafields use syntax extra.fieldcode=... (where field code is the code of extrafield)<br><br>In order to have the list depending on another complementary attribute list:<br>c_typent:libelle:id:options_<i>parent_list_code</i>|parent_column:filter <br><br>In order to have the list depending on another list:<br>c_typent:libelle:id:<i>parent_list_code</i>|parent_column:filter
ExtrafieldParamHelpchkbxlst=List of values comes from a table<br>Syntax : table_name:label_field:id_field::filter<br>Example : c_typent:libelle:id::filter<br><br>filter can be a simple test (eg active=1) to display only active value<br>You can also use $ID$ in filter witch is the current id of current object<br>To do a SELECT in filter use $SEL$<br>if you want to filter on extrafields use syntax extra.fieldcode=... (where field code is the code of extrafield)<br><br>In order to have the list depending on another complementary attribute list :<br>c_typent:libelle:id:options_<i>parent_list_code</i>|parent_column:filter <br><br>In order to have the list depending on another list:<br>c_typent:libelle:id:<i>parent_list_code</i>|parent_column:filter
ExtrafieldParamHelplink=Parameters must be ObjectName:Classpath<br>Syntax : ObjectName:Classpath<br>Example : Societe:societe/class/societe.class.php
ExtrafieldParamHelplink=Parameters must be ObjectName:Classpath<br>Syntax : ObjectName:Classpath<br>Examples :<br>Societe:societe/class/societe.class.php<br>Contact:contact/class/contact.class.php
LibraryToBuildPDF=Library used for PDF generation
WarningUsingFPDF=Warning: Your <b>conf.php</b> contains directive <b>dolibarr_pdf_force_fpdf=1</b>. This means you use the FPDF library to generate PDF files. This library is old and does not support a lot of features (Unicode, image transparency, cyrillic, arab and asiatic languages, ...), so you may experience errors during PDF generation.<br>To solve this and have a full support of PDF generation, please download <a href="http://www.tcpdf.org/" target="_blank">TCPDF library</a>, then comment or remove the line <b>$dolibarr_pdf_force_fpdf=1</b>, and add instead <b>$dolibarr_lib_TCPDF_PATH='path_to_TCPDF_dir'</b>
LocalTaxDesc=Some countries apply 2 or 3 taxes on each invoice line. If this is the case, choose type for second and third tax and its rate. Possible type are:<br>1 : local tax apply on products and services without vat (localtax is calculated on amount without tax)<br>2 : local tax apply on products and services including vat (localtax is calculated on amount + main tax)<br>3 : local tax apply on products without vat (localtax is calculated on amount without tax)<br>4 : local tax apply on products including vat (localtax is calculated on amount + main vat)<br>5 : local tax apply on services without vat (localtax is calculated on amount without tax)<br>6 : local tax apply on services including vat (localtax is calculated on amount + tax)

View File

@ -14,6 +14,9 @@ OkCheckFingerprintValidityButChainIsKo=Archived log seems valid compared to prev
AddedByAuthority=Stored into remote authority
NotAddedByAuthorityYet=Not yet stored into remote authority
ShowDetails=Show stored details
logPAYMENT_VARIOUS_CREATE=Payment (not assigned to invoice) created
logPAYMENT_VARIOUS_MODIFY=Payment (not assigned to invoice) modified
logPAYMENT_VARIOUS_DELETE=Payment (not assigned to invoice) logical deletion
logPAYMENT_ADD_TO_BANK=Payment added to bank
logPAYMENT_CUSTOMER_CREATE=Customer payment created
logPAYMENT_CUSTOMER_DELETE=Customer payment logical deletion
@ -41,7 +44,7 @@ DownloadLogCSV=Export archived logs (CSV)
logDOC_PREVIEW=Preview of a validated document in order to print or download
logDOC_DOWNLOAD=Download of a validated document in order to print or send
DataOfArchivedEvent=Full datas of archived event
ImpossibleToReloadObject=Object (type %s, id %s) removed (see 'Full data' link for unerasable saved data)
ImpossibleToReloadObject=Original object (type %s, id %s) not linked (see 'Full datas' column to get unalterable saved data)
BlockedLogAreRequiredByYourCountryLegislation=Unalterable Logs module may be required by the legislation of your country. Disabling this module may render any future transactions invalid with respect to the law and the use of legal software as they can not be validated by a tax audit.
BlockedLogActivatedBecauseRequiredByYourCountryLegislation=Unalterable Logs module was activated because of the legislation of your country. Disabling this module may render any future transactions invalid with respect to the law and the use of legal software as they can not be validated by a tax audit.
BlockedLogDisableNotAllowedForCountry=List of countries where usage of this module is mandatory (just to prevent to disable the module by error, if your country is in this list, disable of module is not possible without editing this list first. Note also that enabling/disabling this module will keep a track into the unalterable log).

View File

@ -87,6 +87,7 @@ MailingModuleDescEmailsFromFile=Emails from file
MailingModuleDescEmailsFromUser=Emails input by user
MailingModuleDescDolibarrUsers=Users with Emails
MailingModuleDescThirdPartiesByCategories=Third parties (by categories)
SendingFromWebInterfaceIsNotAllowed=Sending from web interface is not allowed.
# Libelle des modules de liste de destinataires mailing
LineInFile=Line %s in file

View File

@ -25,8 +25,8 @@ Chartofaccounts=Plan contable
CurrentDedicatedAccountingAccount=Cuenta contable dedicada
AssignDedicatedAccountingAccount=Nueva cuenta a asignar
InvoiceLabel=Etiqueta factura
OverviewOfAmountOfLinesNotBound=Ver la cantidad de líneas no ligadas a cuentas contables
OverviewOfAmountOfLinesBound=Ver la cantidad de líneas ligadas a cuentas contables
OverviewOfAmountOfLinesNotBound=Ver la cantidad de líneas no vinculadas a una cuenta contable
OverviewOfAmountOfLinesBound=Ver la cantidad de líneas vinculadas a una cuenta contable
OtherInfo=Otra información
DeleteCptCategory=Eliminar la cuenta contable del grupo
ConfirmDeleteCptCategory=¿Está seguro de querer eliminar esta cuenta contable del grupo de cuentas contables?
@ -158,7 +158,7 @@ NumPiece=Apunte
TransactionNumShort=Núm. transacción
AccountingCategory=Grupos personalizados
GroupByAccountAccounting=Agrupar por cuenta contable
AccountingAccountGroupsDesc=You can define here some groups of accounting account. They will be used for personalized accounting reports.
AccountingAccountGroupsDesc=Puedes definir aquí algunos grupos de cuentas contables. Se usarán para informes de contabilidad personalizados.
ByAccounts=Por cuentas
ByPredefinedAccountGroups=Por grupos predefinidos
ByPersonalizedAccountGroups=Por grupos personalizados
@ -173,7 +173,7 @@ DelBookKeeping=Eliminar los registros del Libro Mayor
FinanceJournal=Diario financiero
ExpenseReportsJournal=Diario informe de gastos
DescFinanceJournal=El diario financiero incluye todos los tipos de pagos por cuenta bancaria
DescJournalOnlyBindedVisible=Esta es una vista de registros que están vinculados a una cuenta contable y pueden ser registrados en el Libro Mayor.
DescJournalOnlyBindedVisible=Esta es una vista del registro vinculado a una cuenta contable y que se puede registrar en el Libro Mayor.
VATAccountNotDefined=Cuenta contable para IVA no definida
ThirdpartyAccountNotDefined=Cuenta contable de tercero no definida
ProductAccountNotDefined=Cuenta contable de producto no definida
@ -191,7 +191,7 @@ DescThirdPartyReport=Consulte aquí el listado de clientes y proveedores y sus c
ListAccounts=Listado de cuentas contables
UnknownAccountForThirdparty=Cuenta contable de tercero desconocida, usaremos %s
UnknownAccountForThirdpartyBlocking=Cuenta contable de tercero desconocida. Error de bloqueo
UnknownAccountForThirdpartyAndWaitingAccountNotDefinedBlocking=Unknown third party account and waiting account not defined. Blocking error
UnknownAccountForThirdpartyAndWaitingAccountNotDefinedBlocking=Cuenta del terceros desconocida y cuenta de espera no definida. Error de bloqueo
Pcgtype=Grupo de cuenta
Pcgsubtype=Subgrupo de cuenta
@ -224,6 +224,8 @@ GeneralLedgerSomeRecordWasNotRecorded=Algunas de las operaciones que no podrán
NoNewRecordSaved=No hay más registros para el diario
ListOfProductsWithoutAccountingAccount=Listado de productos sin cuentas contables
ChangeBinding=Cambiar la unión
Accounted=Contabilizada en el Libro Mayor
NotYetAccounted=Aún no contabilizada en el Libro Mayor
## Admin
ApplyMassCategories=Aplicar categorías en masa

View File

@ -260,18 +260,18 @@ FontSize=Tamaño de fuente
Content=Contenido
NoticePeriod=Plazo de aviso
NewByMonth=Nuevo por mes
Emails=Emails
EMailsSetup=Configuración emails
Emails=E-Mails
EMailsSetup=Configuración e-mails
EMailsDesc=Esta página le permite sobrescribir sus parámetros de PHP para el envío de correos electrónicos. En la mayoría de los casos, en el sistema operativo Unix/Linux, su configuración de PHP es correcta y estos parámetros son inútiles.
EmailSenderProfiles=Perfiles de remitentes de e-mails
MAIN_MAIL_SMTP_PORT=Puerto del servidor SMTP (Por defecto en php.ini: <b>%s</b>)
MAIN_MAIL_SMTP_SERVER=Nombre host o ip del servidor SMTP (Por defecto en php.ini: <b>%s</b>)
MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike=Puerto del servidor SMTP (No definido en PHP en sistemas de tipo Unix)
MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike=Nombre servidor o ip del servidor SMTP (No definido en PHP en sistemas de tipo Unix)
MAIN_MAIL_EMAIL_FROM=Correo electrónico del remitente para correos electrónicos automáticos (por defecto en php.ini: <b>%s</b>)
MAIN_MAIL_ERRORS_TO=Correo electrónico del remitente utilizado para los correos electrónicos de error enviados
MAIN_MAIL_EMAIL_FROM=E-mail del remitente para e-mails automáticos (por defecto en php.ini: <b>%s</b>)
MAIN_MAIL_ERRORS_TO=E-mail del remitente utilizado para los e-mails de error enviados
MAIN_MAIL_AUTOCOPY_TO= Enviar automáticamente copia oculta de los e-mails enviados a
MAIN_DISABLE_ALL_MAILS=Deshabilitar todos los envíos de correos electrónicos (para propósitos de prueba o demostraciones)
MAIN_DISABLE_ALL_MAILS=Deshabilitar todos los envíos de e-mail (para propósitos de prueba o demostraciones)
MAIN_MAIL_SENDMODE=Método de envío de e-mails
MAIN_MAIL_SMTPS_ID=ID de autentificación SMTP si se requiere autenticación SMTP
MAIN_MAIL_SMTPS_PW=Contraseña autentificación SMTP si se requiere autentificación SMTP
@ -410,11 +410,11 @@ ExtrafieldCheckBoxFromList=Casilla de selección de tabla
ExtrafieldLink=Objeto adjuntado
ComputedFormula=Campo combinado
ComputedFormulaDesc=Puede introducir aquí una fórmula utilizando otras propiedades de objeto o cualquier código PHP para obtener un valor calculado dinámico. Puede utilizar cualquier fórmula compatible con PHP, incluido el operador de condición "?" y los objetos globales siguientes: <strong>$db, $conf, $langs, $mysoc, $user, $object</strong>.<br><strong>ATENCIÓN</strong>: Sólo algunas propiedades de $object pueden estar disponibles. Si necesita propiedades no cargadas, solo busque el objeto en su fórmula como en el segundo ejemplo. <br>Usando un campo computado significa que no puede ingresar ningún valor de la interfaz. Además, si hay un error de sintaxis, la fórmula puede devolver nada. <br><br>Ejemplo de fórmula: <br>$object->id < 10 ? round($object->id / 2, 2) : ($object->id + 2 * $user->id) * (int) substr($mysoc->zip, 1, 2)<br><br> Ejemlo de recarga de objeto<br> (($reloadedobj = new Societe($db)) && ($reloadedobj->fetch($obj->id ? $obj->id : ($obj->rowid ? $obj->rowid : $object->id)) > 0)) ? $reloadedobj->array_options['options_extrafieldkey'] * $reloadedobj->capital / 5 : '-1'<br><br>Otro ejemplo de fórmula para forzar la carga del objeto y su objeto principal: <br>(($reloadedobj = new Task($db)) && ($reloadedobj->fetch($object->id) > 0) && ($secondloadedobj = new Project($db)) && ($secondloadedobj->fetch($reloadedobj->fk_project) > 0)) ? $secondloadedobj->ref : 'Parent project not found'
ExtrafieldParamHelpselect=El listado de parámetros tiene que ser key,valor<br><br> por ejemplo: <br>1,value1<br>2,value2<br>3,value3<br>...<br><br>Para tener una lista en funcion de atributos complementarios de lista:<br>1,value1|options_<i>parent_list_code</i>:parent_key<br>2,value2|options_<i>parent_list_code</i>:parent_key <br><br>Para tener la lista en función de otra:<br>1,value1|<i>parent_list_code</i>:parent_key<br>2,value2|<i>parent_list_code</i>:parent_key
ExtrafieldParamHelpselect=El listado de parámetros tiene que ser key,valor<br><br> por ejemplo: <br>1,value1<br>2,value2<br>3,value3<br>...<br><br>Para tener una lista en funcion de campos adicionales de lista:<br>1,value1|options_<i>parent_list_code</i>:parent_key<br>2,value2|options_<i>parent_list_code</i>:parent_key <br><br>Para tener la lista en función de otra:<br>1,value1|<i>parent_list_code</i>:parent_key<br>2,value2|<i>parent_list_code</i>:parent_key
ExtrafieldParamHelpcheckbox=El listado de parámetros tiene que ser key,valor<br><br> por ejemplo: <br>1,value1<br>2,value2<br>3,value3<br>...
ExtrafieldParamHelpradio=El listado de parámetros tiene que ser key,valor (donde key no puede ser 0)<br><br> por ejemplo: <br>1,value1<br>2,value2<br>3,value3<br>...
ExtrafieldParamHelpsellist=Lista de parámetros proviene de una tabla <br> Sintaxis: nombre_tabla: etiqueta_field: id_field :: filtro <br> Ejemplo: c_typent: libelle: id :: filtro <br> <br> filtro puede ser una prueba simple (por ejemplo, activa = 1) Para mostrar sólo el valor activo <br> También puede utilizar $ ID $ en el filtro witch es el actual id del objeto actual <br> Para hacer un SELECT en el filtro de uso $ SEL $ <br> si desea filtrar en extrafields utilizar la sintaxis Extra.fieldcode = ... (donde código de campo es el código de extrafield) <br> <br> Para que la lista dependa de otra lista de atributos complementarios: <br> c_typent: libelle: id: options_ <i> parent_list_code </i> | parent_column: filter <br> <br> Para que la lista dependa de otra lista: <br> c_typent: libelle: id: <i> parent_list_code </i> | parent_column: filter
ExtrafieldParamHelpchkbxlst=Lista de parámetros proviene de una tabla <br> Sintaxis: nombre_tabla: etiqueta_field: id_field :: filtro <br> Ejemplo: c_typent: libelle: id :: filtro <br> <br> filtro puede ser una prueba simple (por ejemplo, activa = 1) Para mostrar sólo el valor activo <br> También puede utilizar $ ID $ en el filtro witch es el id actual del objeto actual <br> Para hacer un SELECT en el filtro de uso $ SEL $ <br> si desea filtrar en extrafields utilizar la sintaxis Extra.fieldcode = ... (donde código de campo es el código de extrafield) <br> <br> Para que la lista dependa de otra lista de atributos complementarios: <br> c_typent: libelle: id: options_ <i> parent_list_code </i> | parent_column: filter <br> <br> Para que la lista dependa de otra lista: <br> c_typent: libelle: id: <i> parent_list_code </i> | parent_column: filter
ExtrafieldParamHelpsellist=Lista de parámetros proviene de una tabla <br> Sintaxis: nombre_tabla: etiqueta_field: id_field :: filtro <br> Ejemplo: c_typent: libelle: id :: filtro <br> <br> filtro puede ser una prueba simple (por ejemplo, activa = 1) Para mostrar sólo el valor activo <br> También puede utilizar $ ID $ en el filtro witch es el actual id del objeto actual <br> Para hacer un SELECT en el filtro de uso $ SEL $ <br> si desea filtrar en campos adicionales utilizar la sintaxis Extra.fieldcode = ... (donde código de campo es el código de campo adicional) <br> <br> Para que la lista dependa de otra lista de campos adicionales: <br> c_typent: libelle: id: options_ <i> parent_list_code </i> | parent_column: filter <br> <br> Para que la lista dependa de otra lista: <br> c_typent: libelle: id: <i> parent_list_code </i> | parent_column: filter
ExtrafieldParamHelpchkbxlst=Lista de parámetros proviene de una tabla <br> Sintaxis: nombre_tabla: etiqueta_field: id_field :: filtro <br> Ejemplo: c_typent: libelle: id :: filtro <br> <br> filtro puede ser una prueba simple (por ejemplo, activa = 1) Para mostrar sólo el valor activo <br> También puede utilizar $ ID $ en el filtro witch es el id actual del objeto actual <br> Para hacer un SELECT en el filtro de uso $ SEL $ <br> si desea filtrar en campos adicionales utilizar la sintaxis Extra.fieldcode = ... (donde código de campo es el código de campo adicional) <br> <br> Para que la lista dependa de otra lista de campos adicionales: <br> c_typent: libelle: id: options_ <i> parent_list_code </i> | parent_column: filter <br> <br> Para que la lista dependa de otra lista: <br> c_typent: libelle: id: <i> parent_list_code </i> | parent_column: filter
ExtrafieldParamHelplink=Los parámetros deben ser ObjectName: Classpath<br>Sintaxis: ObjectName:Classpath<br>Ejemplo: Societe:societe/class/societe.class.php
LibraryToBuildPDF=Libreria usada en la generación de los PDF
WarningUsingFPDF=Atención: Su archivo <b>conf.php</b> contiene la directiva <b>dolibarr_pdf_force_fpdf=1</b>. Esto hace que se use la librería FPDF para generar sus archivos PDF. Esta librería es antigua y no cubre algunas funcionalidades (Unicode, transparencia de imágenes, idiomas cirílicos, árabes o asiáticos, etc.), por lo que puede tener problemas en la generación de los PDF.<br>Para resolverlo, y disponer de un soporte completo de PDF, puede descargar la <a href="http://www.tcpdf.org/" target="_blank">librería TCPDF</a> , y a continuación comentar o eliminar la línea <b>$dolibarr_pdf_force_fpdf=1</b>, y añadir en su lugar <b>$dolibarr_lib_TCPDF_PATH='ruta_a_TCPDF'</b>
@ -551,6 +551,8 @@ Module520Desc=Gestión de créditos
Module600Name=Notificaciones
Module600Desc=Enviar notificaciones por e-mail (desencadenados por algunos eventos) a los usuarios (configuración definida para cada usuario), los contactos de terceros (configuración definida en cada tercero) o e-mails fijos
Module600Long=Tenga en cuenta que este módulo está dedicado a enviar mensajes de e-mail en tiempo real cuando se produce un evento. Si está buscando una función para enviar recordatorios por e-mail de los eventos de su agenda, vaya a la configuración del módulo Agenda.
Module610Name=Variantes de productos
Module610Desc=Permite la creación de variantes de productos en función de los atributos (color, tamaño, ...)
Module700Name=Donaciones
Module700Desc=Gestión de donaciones
Module770Name=Informes de gastos
@ -598,7 +600,7 @@ Module10000Name=Sitios web
Module10000Desc=Cree sitios web públicos con un editor WYSIWYG. Configure el servidor web (Apache, Nginx,...) para que apunte al directorio dedicado para tenerlo en línea en Internet.
Module20000Name=Gestión de días libres retribuidos
Module20000Desc=Gestión de los días libres retribuidos de los empleados
Module39000Name=Lotes de producto
Module39000Name=Lotes de productos
Module39000Desc=Gestión de lotes o series, fechas de caducidad y venta de los productos
Module50000Name=PayBox
Module50000Desc=Módulo para ofrecer pagos online aceptando pagos con tarjeta de Débito/Crédito via PayBox. Esto puede ser usado para permitir a tus clientes realizar pagos libres o pagos en un objeto de Dolibarr en particular (factura, pedido...)
@ -824,12 +826,12 @@ Permission1232=Crear facturas de proveedores
Permission1233=Validar facturas de proveedores
Permission1234=Eliminar facturas de proveedores
Permission1235=Enviar facturas de proveedores por correo
Permission1236=Exportar facturas de proveedores, atributos y pagos
Permission1236=Exportar facturas de proveedores, campos adicionales y pagos
Permission1237=Exportar pedidos de proveedores junto con sus detalles
Permission1251=Lanzar las importaciones en masa a la base de datos (carga de datos)
Permission1321=Exportar facturas a clientes, atributos y cobros
Permission1321=Exportar facturas a clientes, campos adicionales y cobros
Permission1322=Reabrir una factura pagada
Permission1421=Exportar pedidos de clientes y atributos
Permission1421=Exportar pedidos de clientes y campos adicionales
Permission20001=Leer peticiones días retribuidos (suyos y subordinados)
Permission20002=Cear/modificar sus días retribuidos
Permission20003=Eliminar peticiones de días retribuidos
@ -890,7 +892,7 @@ DictionaryStaff=Empleados
DictionaryAvailability=Tiempos de entrega
DictionaryOrderMethods=Métodos de pedido
DictionarySource=Orígenes de presupuestos/pedidos
DictionaryAccountancyCategory=Personalized groups for reports
DictionaryAccountancyCategory=Grupos personalizados para imformes
DictionaryAccountancysystem=Modelos de planes contables
DictionaryAccountancyJournal=Diarios contables
DictionaryEMailTemplates=Plantillas E-Mails
@ -1108,23 +1110,23 @@ MAIN_PROXY_HOST=Nombre/Dirección del servidor proxy
MAIN_PROXY_PORT=Puerto del servidor proxy
MAIN_PROXY_USER=Login del servidor proxy
MAIN_PROXY_PASS=Contraseña del servidor proxy
DefineHereComplementaryAttributes=Defina aquí la lista de atributos adicionales, no disponibles por defecto, y que desea gestionar para %s.
ExtraFields=Atributos adicionales
ExtraFieldsLines=Atributos adicionales (líneas)
ExtraFieldsLinesRec=Atributos complementarios (plantillas de líneas de facturas)
ExtraFieldsSupplierOrdersLines=Atributos complementarios (líneas de pedido)
ExtraFieldsSupplierInvoicesLines=Atributos complementarios (líneas de factura)
ExtraFieldsThirdParties=Atributos adicionales (terceros)
ExtraFieldsContacts=Atributos adicionales (contactos/direcciones)
ExtraFieldsMember=Atributos adicionales (miembros)
ExtraFieldsMemberType=Atributos adicionales (tipos de miembros)
ExtraFieldsCustomerInvoices=Atributos adicionales (facturas a clientes)
ExtraFieldsCustomerInvoicesRec=Atributos complementarios (plantillas de facturas)
ExtraFieldsSupplierOrders=Atributos adicionales (pedidos a proveedores)
ExtraFieldsSupplierInvoices=Atributos adicionales (facturas)
ExtraFieldsProject=Atributos adicionales (proyectos)
ExtraFieldsProjectTask=Atributos adicionales (tareas)
ExtraFieldHasWrongValue=El atributo %s tiene un valor no válido
DefineHereComplementaryAttributes=Defina aquí la lista de campos adicionales, no disponibles por defecto, y que desea gestionar para %s.
ExtraFields=Campos adicionales
ExtraFieldsLines=Campos adicionales (líneas)
ExtraFieldsLinesRec=Campos adicionales (plantillas de líneas de facturas)
ExtraFieldsSupplierOrdersLines=Campos adicionales (líneas de pedido)
ExtraFieldsSupplierInvoicesLines=Campos adicionales (líneas de factura)
ExtraFieldsThirdParties=Campos adicionales (terceros)
ExtraFieldsContacts=Campos adicionales (contactos/direcciones)
ExtraFieldsMember=Campos adicionales (miembros)
ExtraFieldsMemberType=Campos adicionales (tipos de miembros)
ExtraFieldsCustomerInvoices=Campos adicionales (facturas a clientes)
ExtraFieldsCustomerInvoicesRec=Campos adicionales (plantillas de facturas)
ExtraFieldsSupplierOrders=Campos adicionales (pedidos a proveedores)
ExtraFieldsSupplierInvoices=Campos adicionales (facturas)
ExtraFieldsProject=Campos adicionales (proyectos)
ExtraFieldsProjectTask=Campos adicionales (tareas)
ExtraFieldHasWrongValue=El campo %s tiene un valor no válido
AlphaNumOnlyLowerCharsAndNoSpace=sólo alfanuméricos y minúsculas sin espacio
SendmailOptionNotComplete=Atención, en algunos sistemas Linux, con este método de envio, para poder enviar mails en su nombre, la configuración de sendmail debe contener la opción <b>-ba</b> (parámetro <b>mail.force_extra_parameters</b> en el archivo <b>php.ini</b>). Si algunos de sus destinatarios no reciben sus mensajes, pruebe a modificar este parámetro PHP con <b>mail.force_extra_parameters=-ba</b>.
PathToDocuments=Rutas de acceso a documentos
@ -1303,17 +1305,17 @@ LDAPContactDnExample=DN completo (ej: ou=contacts,dc=example,dc=com)
LDAPMemberDn=DN de los miembros
LDAPMemberDnExample=DN completo (ex: ou=members,dc=society,dc=com)
LDAPMemberObjectClassList=Lista de objectClass
LDAPMemberObjectClassListExample=Lista de ObjectClass que definen los atributos de un registro (ej: top,inetOrgPerson o top,user for active directory)
LDAPMemberObjectClassListExample=Lista de ObjectClass que definen los atributos de un registro (ej: top,inetOrgPerson o top,user para active directory)
LDAPMemberTypeDn=Tipos DN de miembros de Dolibar
LDAPMemberTypepDnExample=DN completo (por ejemplo, ou=memberstypes, dc=example, dc=com)
LDAPMemberTypeObjectClassList=Lista de objectClass
LDAPMemberTypeObjectClassListExample=Lista de ObjectClass que definen los atributos de un registro (ej: top,groupOfUniqueNames)
LDAPUserObjectClassList=Lista de objectClass
LDAPUserObjectClassListExample=Lista de ObjectClass que definen los atributos de un registro (ej: top,inetOrgPerson o top,user for active directory)
LDAPUserObjectClassListExample=Lista de ObjectClass que definen los atributos de un registro (ej: top,inetOrgPerson o top,user para active directory)
LDAPGroupObjectClassList=Lista de objectClass
LDAPGroupObjectClassListExample=Lista de ObjectClass que definen los atributos de un registro (ej: top,groupOfUniqueNames)
LDAPContactObjectClassList=Lista de objectClass
LDAPContactObjectClassListExample=Lista de objectClass que definen los atributos de un registro (ej: top,inetOrgPerson o top,user for active directory)
LDAPContactObjectClassListExample=Lista de objectClass que definen los atributos de un registro (ej: top,inetOrgPerson o top,user para active directory)
LDAPTestConnect=Probar la conexión LDAP
LDAPTestSynchroContact=Probar la sincronización de contactos
LDAPTestSynchroUser=Probar la sincronización de usuarios
@ -1728,21 +1730,21 @@ SeeSubstitutionVars=Vea * nota para un listado de posibles variables de sustituc
SeeChangeLog=Ver archivo ChangeLog (solo inglés)
AllPublishers=Todos los editores
UnknownPublishers=Editores desconocidos
AddRemoveTabs=Añadir o eliminar pestañas
AddDataTables=Añadir tablas de objetos
AddDictionaries=Añadir diccionarios
AddData=Agregar objetos o datos de diccionarios
AddBoxes=Añadir paneles
AddSheduledJobs=Añadir tareas programadas
AddHooks=Añadir hooks
AddTriggers=Añadir triggers
AddMenus=Añadir menús
AddPermissions=Añadir permisos
AddExportProfiles=Añadir perfiles de exportación
AddImportProfiles=Añadir perfiles de importación
AddOtherPagesOrServices=Añadir otras páginas o servicios
AddModels=Añadir modelos de documentos o numeración
AddSubstitutions=Añadir substituciones de claves
AddRemoveTabs=Añade o elimina pestañas
AddDataTables=Añade tablas de objetos
AddDictionaries=Añade diccionarios
AddData=Añade objetos o datos de diccionarios
AddBoxes=Añade paneles
AddSheduledJobs=Añade tareas programadas
AddHooks=Añade hooks
AddTriggers=Añade triggers
AddMenus=Añade menús
AddPermissions=Añade permisos
AddExportProfiles=Añade perfiles de exportación
AddImportProfiles=Añade perfiles de importación
AddOtherPagesOrServices=Añade otras páginas o servicios
AddModels=Añade modelos de documentos o numeración
AddSubstitutions=Añade substituciones de claves
DetectionNotPossible=No es posible la detección
UrlToGetKeyToUseAPIs=Url para conseguir token para usar la API (una vez recibido el token se guarda en la tabla de usuarios de la base de datos y se debe proporcionar en cada llamada API)
ListOfAvailableAPIs=Listado de APIs disponibles

View File

@ -178,7 +178,7 @@ ConfirmCancelBillQuestion=¿Porqué quiere clasificar esta factura como 'abandon
ConfirmClassifyPaidPartially=¿Está seguro de querer cambiar el estado de la factura <b>%s</b> a pagado?
ConfirmClassifyPaidPartiallyQuestion=Esta factura no ha sido pagado completamente. ¿Cual es la razón para cerrar esta factura?
ConfirmClassifyPaidPartiallyReasonAvoir=El resto a pagar <b>(%s %s)</b> es un descuento otorgado por pronto pago. Regularizaré el IVA con un abono.
ConfirmClassifyPaidPartiallyReasonDiscount=Remaining unpaid <b>(%s %s)</b> is a discount granted because payment was made before term.
ConfirmClassifyPaidPartiallyReasonDiscount=El resto a pagar <b>(%s%s)</b> es un descuento otorgado por pronto pago.
ConfirmClassifyPaidPartiallyReasonDiscountNoVat=El resto a pagar <b>(%s %s)</b> es un descuento otorgado por pronto pago. Acepto perder el IVA en este descuento.
ConfirmClassifyPaidPartiallyReasonDiscountVat=El resto a pagar <b>(%s %s)</b> es un descuento otorgado por pronto pago. Recuperaré el IVA sin usar un abono.
ConfirmClassifyPaidPartiallyReasonBadCustomer=Cliente moroso

View File

@ -78,7 +78,7 @@ CatCusLinks=Enlaces entre clientes/clientes potenciales y etiquetas/categorías
CatProdLinks=Enlaces entre productos/servicios y etiquetas/categorías
CatProJectLinks=Enlaces entre proyectos y etiquetas/categorías
DeleteFromCat=Eliminar de la etiqueta/categoría
ExtraFieldsCategories=Atributos complementarios
ExtraFieldsCategories=Campos adicionales
CategoriesSetup=Configuración de etiquetas/categorías
CategorieRecursiv=Enlazar con la etiqueta/categoría automáticamente
CategorieRecursivHelp=Si está activado, el producto se enlazará a la categoría padre si lo añadimos a una subcategoría

View File

@ -374,9 +374,9 @@ ContactNotLinkedToCompany=Contacto no vinculado a un tercero
DolibarrLogin=Login usuario
NoDolibarrAccess=Sin acceso de usuario
ExportDataset_company_1=Terceros (Empresas / asociaciones / particulares) y propiedades
ExportDataset_company_2=Contactos de terceros y atributos
ExportDataset_company_2=Contactos de terceros y campos adicionales
ImportDataset_company_1=Terceros (Empresas / asociaciones / particulares) y propiedades
ImportDataset_company_2=Contactos/Direcciones (de terceros o no) y atributos
ImportDataset_company_2=Contactos/Direcciones (de terceros o no) y campos adicionales
ImportDataset_company_3=Cuentas bancarias
ImportDataset_company_4=Terceros/Comerciales (Afecta a los usuarios comerciales de terceros)
PriceLevel=Nivel de precios

View File

@ -24,7 +24,7 @@ PaymentsNotLinkedToInvoice=Pagos vinculados a ninguna factura, por lo que ningu
PaymentsNotLinkedToUser=Pagos no vinculados a un usuario
Profit=Beneficio
AccountingResult=Resultado contable
BalanceBefore=Balance (before)
BalanceBefore=Balance (antes)
Balance=Saldo
Debit=Debe
Credit=Haber

View File

@ -31,4 +31,4 @@ DONATION_ART200=Mostrar artículo 200 del CGI si se está interesado
DONATION_ART238=Mostrar artículo 238 del CGI si se está interesado
DONATION_ART885=Mostrar artículo 885 del CGI si se está interesado
DonationPayment=Pago de donación
DonationValidated=Donation %s validated
DonationValidated=Donación %s validada

View File

@ -35,7 +35,7 @@ Language_es_PA=Español (Panamá)
Language_es_PY=Español (Paraguay)
Language_es_PE=Español (Perú)
Language_es_PR=Español (Puerto Rico)
Language_es_UY=Spanish (Uruguay)
Language_es_UY=Español (Uruguay)
Language_es_VE=Español (Venezuela)
Language_et_EE=Estonio
Language_eu_ES=Vasco

View File

@ -722,8 +722,8 @@ After=Después
IPAddress=Dirección IP
Frequency=Frecuencia
IM=Mensajería instantánea
NewAttribute=Nuevo atributo
AttributeCode=Código atributo
NewAttribute=Nuevo campo
AttributeCode=Código
URLPhoto=Url de la foto/logo
SetLinkToAnotherThirdParty=Vincular a otro tercero
LinkTo=Enlazar a
@ -885,7 +885,7 @@ Select2NotFound=No se han encontrado registros
Select2Enter=Introducir
Select2MoreCharacter=o más caracteres
Select2MoreCharacters=o más caracteres
Select2MoreCharactersMore=<strong>Sintaxis de búsqueda:</strong><br /><kbd><strong> |</strong></kbd><kbd> OR</kbd> (a|b)<br /><kbd><strong>*</strong></kbd><kbd> Cualquier caracter</kbd> (a*b)<br /><kbd><strong>^</strong></kbd><kbd>Empezar con</kbd> (^ab)<br /><kbd><strong>$</strong></kbd><kbd>Terminar con</kbd> (ab$)<br />
Select2MoreCharactersMore=<strong>Sintaxis de búsqueda:</strong><br><kbd><strong> |</strong></kbd><kbd> O</kbd> (a|b)<br><kbd><strong>*</strong></kbd><kbd> Cualquier carácter</kbd> (a*b)<br><kbd><strong>^</strong></kbd><kbd> Empieza con</kbd> (^ab)<br><kbd><strong>$</strong></kbd><kbd> Termina con</kbd> (ab$)<br>
Select2LoadingMoreResults=Cargando más resultados...
Select2SearchInProgress=Búsqueda en progreso...
SearchIntoThirdparties=Terceros
@ -912,5 +912,5 @@ CommentPage=Espacio de comentarios
CommentAdded=Comentario añadido
CommentDeleted=Comentario borrado
Everybody=Proyecto compartido
PayedBy=Payed by
PayedTo=Payed to
PayedBy=Pagado por
PayedTo=Pagado a

View File

@ -43,6 +43,8 @@ PathToModulePackage=Ruta al zip del módulo/aplicación
PathToModuleDocumentation=Ruta a la documentación del módulo/aplicación
SpaceOrSpecialCharAreNotAllowed=Espacios o caracteres especiales no son permitidos.
FileNotYetGenerated=Fichero todavía no generado
RegenerateClassAndSql=Borrar y regenerar archivos de clase y sql
RegenerateMissingFiles=Generar archivos no encontrados
SpecificationFile=Fichero con las reglas de negocio
LanguageFile=Archivo para el idioma
ConfirmDeleteProperty=¿Estás seguro que quieres eliminar la propiedad <strong>%s</strong>? Esto cambiará código en la clase PHP pero también eliminará la columna de la definición de la tabla del objeto.

View File

@ -7,7 +7,7 @@ multicurrency_syncronize_error=Error sincronización: %s
MULTICURRENCY_USE_RATE_ON_DOCUMENT_DATE=Usar fecha del documento para encontrar la tasa de la divisa, en lugar de usar la última tasa conocida
multicurrency_useOriginTx=Cuando un objeto se crea desde otro, mantenga la conversión original del objeto de origen (de lo contrario, utilice la tasa de conversión más reciente conocida)
CurrencyLayerAccount=CurrencyLayer API
CurrencyLayerAccount_help_to_synchronize=Debe crear una cuenta en su sitio web para utilizar esta función. <br />Obtenga su <b>clave API</b><br />Si utiliza una cuenta gratuita, no puede cambiar la <b>divisa origen</b> (USD por defecto)<br />. Pero si su divisa principal no es USD, puede usar la <b>divisa origen alternativa</b> para forzar su divisa principal. <br /><br />Está limitado a 1000 sincronizaciones por mes
CurrencyLayerAccount_help_to_synchronize=Debe crear una cuenta en su sitio web para usar esta funcionalidad<br>Obtenga su <b>Clave API</b><br>Si usa una cuenta gratuita no puede cambiar la <b>moneda origen</b> (por defecto USD)<br>Pero si su moneda principal no es USD puede usar la <b>moneda origen alternativa</b> para forzar su moneda principal<br><br>Estará limitado a 1000 sincronizaciones por mes
multicurrency_appId=Clave API
multicurrency_appCurrencySource=Divisa origen
multicurrency_alternateCurrencySource=Divisa origen alternativa

View File

@ -162,9 +162,9 @@ SizeUnitinch=pulgada
SizeUnitfoot=pie
SizeUnitpoint=punto
BugTracker=Incidencias
SendNewPasswordDesc=Este formulario le permite solicitar una nueva contraseña. Se le enviará a su dirección de e-mail.<br>El cambio se hará efectivo una vez que haga clic en el enlace de confirmación en el e-mail.<br />Compruebe su bandeja de entrada.
SendNewPasswordDesc=Este formulario le permite obtener una nueva contraseña. Le será enviada a su e-mail.<br>El cambio será efectivo una vez haga clic en el enlace de confirmación del e-mail.<br>Revise su e-mail.
BackToLoginPage=Volver a la página de conexión
AuthenticationDoesNotAllowSendNewPassword=El modo de autenticación es <b>%s</b>. <br>En este modo, Dolibarr no conoce ni cambia su contraseña.<br /> Póngase en contacto con el administrador del sistema si desea cambiar su contraseña.
AuthenticationDoesNotAllowSendNewPassword=El modo de autentificación de Dolibarr está configurado como "<b>%s</b>".<br>En este modo Dolibarr no puede conocer ni modificar su contraseña<br>Contacte con su administrador para conocer las modalidades de cambio.
EnableGDLibraryDesc=Instale o active la libreria GD en su PHP para poder usar esta opción
ProfIdShortDesc=<b>Prof Id %s</b> es una información dependiente del país del tercero.<br>Por ejemplo, para el país <b>%s</b>, és el código <b>%s</b>.
DolibarrDemo=Demo de Dolibarr ERP/CRM

View File

@ -49,4 +49,6 @@ DirectPrintingJobsDesc=Esta página lista los trabajos encontrados en las impres
GoogleAuthNotConfigured=Configuración de Google OAuth no realizada. Habilite el módulo de OAuth y establezca un Google ID / Secreto.
GoogleAuthConfigured=Las credenciales OAuth de Google se encuentran en la configuración del módulo OAuth.
PrintingDriverDescprintgcp=Configuración variables del driver de impresión Google Cloud Print.
PrintingDriverDescprintipp=Configuración variables para el driver de impresión Cups.
PrintTestDescprintgcp=Listado de impresoras para Google Cloud Print.
PrintTestDescprintipp=Listado de Impresoras para Cups.

View File

@ -239,7 +239,7 @@ MinimumRecommendedPrice=El precio mínimo recomendado es: %s
PriceExpressionEditor=Editor de expresión de precios
PriceExpressionSelected=Expresión de precios seleccionada
PriceExpressionEditorHelp1="price = 2 + 2" o "2 + 2" para configurar un precio. Use ; para separar expresiones
PriceExpressionEditorHelp2=Puede acceder a los atributos adicionales con variables como <b>#extrafield_myextrafieldkey#</b> y variables globales con <b>#global_mycode#</b>
PriceExpressionEditorHelp2=Puede acceder a los campos adicionales con variables como <b>#extrafield_myextrafieldkey#</b> y variables globales con <b>#global_mycode#</b>
PriceExpressionEditorHelp3=En productos y servicios, y precios de proveedor están disponibles las siguientes variables<br><b>#tva_tx# #localtax1_tx# #localtax2_tx# #weight# #length# #surface# #price_min#</b>
PriceExpressionEditorHelp4=Solamente en los precios de productos y servicios: <b>#supplier_min_price#</b><br>In supplier prices only: <b>#supplier_quantity# and #supplier_tva_tx#</b>
PriceExpressionEditorHelp5=Valores globales disponibles:

View File

@ -63,7 +63,7 @@ CreateDolibarrThirdParty=Crear un tercero
LoginAccountDisableInDolibarr=La cuenta está desactivada en Dolibarr
UsePersonalValue=Utilizar valores personalizados
InternalUser=Usuario interno
ExportDataset_user_1=Usuarios Dolibarr y atributos
ExportDataset_user_1=Usuarios Dolibarr y campos adicionales
DomainUser=Usuario de dominio
Reactivate=Reactivar
CreateInternalUserDesc=Este formulario le permite crear un usuario interno para su empresa/asociación. Para crear un usuario externo (cliente, proveedor, etc), use el botón "Crear una cuenta de usuario" desde una ficha de un contacto del tercero.

View File

@ -41,7 +41,7 @@ VirtualHostUrlNotDefined=URL del Host Virtual servido por un servidor externo no
NoPageYet=No hay páginas todavía
SyntaxHelp=Ayuda en la sintaxis del código
YouCanEditHtmlSourceckeditor=Puede editar código fuente HTML utilizando el botón "Origen" en el editor.
YouCanEditHtmlSource=Puede editar el código fuente HTML usando el botón "Origen" en el editor. También puede incluir código PHP en esta fuente mediante etiquetas <strong> &lt;?php ?&gt;</strong>. Las siguientes variables globales están disponibles: $conf, $langs, $db, $mysoc, $user, $website. <br> <br> También puede incluir contenido de otra Página/Contenedor con la siguiente sintaxis: <strong> &lt;?php dolIncludeHtmlContent ($websitekey. '/contentaliastoinclude.php'); ?&gt;</strong> <br> <br> Para incluir un vínculo para descargar un archivo almacenado en el directorio de documentos/medios, utilice la sintaxis: <br><strong> &lt;a href="/document.php?modulepart=medias&file=filename.ext"</strong>.
YouCanEditHtmlSource=<br><span class="fa fa-bug"></span> Puede incluir código PHP en este fuente usando los tags <strong>&lt;?php ?&gt;</strong>. Dispone de estas variables globales: $conf, $langs, $db, $mysoc, $user, $website.<br><br><span class="fa fa-bug"></span> También puede incluir contenido de otra Página/Contenedor con la siguiente sintaxis:<br><strong>&lt;?php includeContainer('alias_of_container_to_include'); ?&gt;</strong><br><br><span class="fa fa-download"></span> Para incluir un <strong>enlace para descargar</strong> un archivo guardado en el directorio <strong>documents</strong>, use el wrapper <strong>document.php</strong> :<br>Por ejemplo, para un archivo de documents/ecm (es necesario estar logueado), la sintaxis:<br><strong>&lt;a href="/document.php?modulepart=ecm&file=[relative_dir/]filename.ext"&gt;</strong><br>Para un archivo de into documents/medias (directorio abierto para acceso público), la sintaxis es:<br><strong>&lt;a href="/document.php?modulepart=medias&file=[relative_dir/]filename.ext"&gt;</strong><br>Para un archivo compartido mediante un enlace compartido (acceso abierto utilizando la clave hash para compartir del archivo), la sintaxis es:<br><strong>&lt;a href="/document.php?hashp=publicsharekeyoffile"&gt;</strong><br><br><span class="fa fa-picture-o"></span> Para incluir una <strong>imagen</strong> guardada en el directorio <strong>documents</strong> , use el wrapper <strong>viewimage.php</strong> :<br>Ejemplo para una imagen de documents/medias (acceso abierto), la sintaxis es:<br><strong>&lt;a href="/viewimage.php?modulepart=medias&amp;file=[relative_dir/]filename.ext"&gt;</strong><br>
ClonePage=Clonar página/contenedor
CloneSite=Clonar sitio
SiteAdded=Sitio web agregado

View File

@ -26,7 +26,7 @@ LastWithdrawalReceipt=Las %s últimas domiciliaciones
MakeWithdrawRequest=Realizar una petición de domiciliación
WithdrawRequestsDone=%s domiciliaciones registradas
ThirdPartyBankCode=Código banco del tercero
NoInvoiceCouldBeWithdrawed=No se ha domiciliado ninguna factura. Asegúrese de que las facturas son de empresas con los datos de cuentas bancarias correctos.
NoInvoiceCouldBeWithdrawed=No se ha podido realizar la petición de domiciliación de ninguna factura. Compruebe que los terceros de las facturas relacionadas tienen una cuenta IBAN válida y dicho IBAN tiene un RUM con modo <strong>%s</strong>.
ClassCredited=Clasificar como "Abonada"
ClassCreditedConfirm=¿Está seguro de querer clasificar esta domiciliación como abonada en su cuenta bancaria?
TransData=Fecha envío

View File

@ -175,7 +175,7 @@ if (! empty($conf->mymodule->enabled) && $user->rights->mymodule->read)
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE s.client IN (1, 2, 3)";
$sql.= " AND s.entity IN (".getEntity($companystatic->element, 1).")";
$sql.= " AND s.entity IN (".getEntity($companystatic->element).")";
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
if ($socid) $sql.= " AND s.rowid = $socid";
$sql .= " ORDER BY s.tms DESC";

View File

@ -26,7 +26,7 @@
*
* Note that you can add following constant to change behaviour of page
* MEMBER_NEWFORM_AMOUNT Default amount for auto-subscribe form
* MEMBER_NEWFORM_EDITAMOUNT Amount can be edited
* MEMBER_NEWFORM_EDITAMOUNT 0 or 1 = Amount can be edited
* MEMBER_NEWFORM_PAYONLINE Suggest payment with paypal, paybox or stripe
* MEMBER_NEWFORM_DOLIBARRTURNOVER Show field turnover (specific for dolibarr foundation)
* MEMBER_URL_REDIRECT_SUBSCRIPTION Url to redirect once subscribe submitted

View File

@ -155,7 +155,7 @@ if (! empty($conf->global->PAYMENT_SECURITY_TOKEN))
if (GETPOST('action','aZ09') == 'dopayment')
{
$PRICE=price2num(GETPOST("newamount"),'MT');
$PRICE=price2num(GETPOST("newamount",'alpha'),'MT');
$email=GETPOST("email");
$origfulltag=GETPOST("fulltag",'alpha');
@ -275,7 +275,7 @@ print $text;
// Output payment summary form
print '<tr><td align="center">';
print '<table with="100%" id="tablepublicpayment">';
print '<tr class="liste_total"><td align="left" colspan="2">'.$langs->trans("ThisIsInformationOnPayment").' :</td></tr>'."\n";
print '<tr><td align="left" colspan="2">'.$langs->trans("ThisIsInformationOnPayment").' :</td></tr>'."\n";
$found=false;
$error=0;
@ -305,7 +305,7 @@ if (! GETPOST("source") && $valid)
if (empty($amount) || ! is_numeric($amount))
{
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">';
print '<input class="flat" size=8 type="text" name="newamount" value="'.GETPOST("newamount","int").'">';
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price(price2num(GETPOST("newamount","alpha"),'MT')).'">';
}
else {
print '<b>'.price($amount).'</b>';
@ -392,7 +392,7 @@ if (GETPOST("source") == 'order' && $valid)
if (empty($amount) || ! is_numeric($amount))
{
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">';
print '<input class="flat" size=8 type="text" name="newamount" value="'.GETPOST("newamount","int").'">';
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price(price2num(GETPOST("newamount","alpha"),'MT')).'">';
}
else {
print '<b>'.price($amount).'</b>';
@ -480,7 +480,7 @@ if (GETPOST("source") == 'invoice' && $valid)
if (empty($amount) || ! is_numeric($amount))
{
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">';
print '<input class="flat" size=8 type="text" name="newamount" value="'.GETPOST("newamount","int").'">';
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price(price2num(GETPOST("newamount","alpha"),'MT')).'">';
}
else {
print '<b>'.price($amount).'</b>';
@ -656,7 +656,7 @@ if (GETPOST("source") == 'contractline' && $valid)
if (empty($amount) || ! is_numeric($amount))
{
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">';
print '<input class="flat" size=8 type="text" name="newamount" value="'.GETPOST("newamount","int").'">';
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price(price2num(GETPOST("newamount","alpha"),'MT')).'">';
}
else {
print '<b>'.price($amount).'</b>';
@ -754,7 +754,7 @@ if (GETPOST("source") == 'membersubscription' && $valid)
print '</td><td class="CTableRow'.($var?'1':'2').'">'.price($member->last_subscription_amount);
print '</td></tr>'."\n";
if (empty($amount) && ! GETPOST('newamount')) $_GET['newamount']=$member->last_subscription_amount;
if (empty($amount) && ! GETPOST('newamount','alpha')) $_GET['newamount']=$member->last_subscription_amount;
}
// Amount
@ -762,12 +762,31 @@ if (GETPOST("source") == 'membersubscription' && $valid)
print '<tr class="CTableRow'.($var?'1':'2').'"><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("Amount");
if (empty($amount)) print ' ('.$langs->trans("ToComplete").')';
print '</td><td class="CTableRow'.($var?'1':'2').'">';
$valtoshow='';
if (empty($amount) || ! is_numeric($amount))
{
$valtoshow=GETPOST("newamount",'int');
$valtoshow=price2num(GETPOST("newamount",'alpha'),'MT');
// force default subscription amount to value defined into constant...
if (empty($valtoshow))
{
if (! empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT)) {
if (! empty($conf->global->MEMBER_NEWFORM_AMOUNT)) {
$valtoshow = $conf->global->MEMBER_NEWFORM_AMOUNT;
}
}
else {
if (! empty($conf->global->MEMBER_NEWFORM_AMOUNT)) {
$amount = $conf->global->MEMBER_NEWFORM_AMOUNT;
}
}
}
}
if (empty($amount) || ! is_numeric($amount))
{
//$valtoshow=price2num(GETPOST("newamount",'alpha'),'MT');
if (! empty($conf->global->MEMBER_MIN_AMOUNT) && $valtoshow) $valtoshow=max($conf->global->MEMBER_MIN_AMOUNT,$valtoshow);
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">';
print '<input class="flat" class="maxwidth75" type="text" name="newamount" value="'.price($valtoshow).'">';
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price($valtoshow).'">';
}
else {
$valtoshow=$amount;

View File

@ -126,6 +126,7 @@ $result=$interface->run_triggers('PAYBOX_PAYMENT_OK',$object,$user,$langs,$conf)
if ($result < 0) { $error++; $errors=$interface->errors; }
// Fin appel triggers
$tmptag=dolExplodeIntoArray($fulltag,'.','=');
// Send an email
if (! empty($conf->global->ONLINE_PAYMENT_SENDEMAIL))
@ -152,7 +153,6 @@ if (! empty($conf->global->ONLINE_PAYMENT_SENDEMAIL))
$urlback=$_SERVER["REQUEST_URI"];
$topic='['.$appli.'] '.$langs->transnoentitiesnoconv("NewOnlinePaymentReceived");
$tmptag=dolExplodeIntoArray($fulltag,'.','=');
$content="";
if (! empty($tmptag['MEM']))
{

View File

@ -268,7 +268,7 @@ if ($action == 'dopayment')
{
if ($paymentmethod == 'paypal')
{
$PAYPAL_API_PRICE=price2num(GETPOST("newamount"),'MT');
$PAYPAL_API_PRICE=price2num(GETPOST("newamount",'alpha'),'MT');
$PAYPAL_PAYMENT_TYPE='Sale';
$origfulltag=GETPOST("fulltag",'alpha');
@ -366,7 +366,7 @@ if ($action == 'dopayment')
if ($paymentmethod == 'stripe')
{
if (GETPOST('newamount')) $amount = GETPOST('newamount');
if (GETPOST('newamount','alpha')) $amount = price2num(GETPOST('newamount','alpha'),'MT');
else
{
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Amount")), null, 'errors');
@ -647,7 +647,7 @@ if (! $source)
if (empty($amount) || ! is_numeric($amount))
{
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">';
print '<input class="flat" size=8 type="text" name="newamount" value="'.GETPOST("newamount","int").'">';
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price(price2num(GETPOST("newamount","alpha"),'MT')).'">';
}
else {
print '<b>'.price($amount).'</b>';
@ -738,7 +738,7 @@ if ($source == 'order')
if (empty($amount) || ! is_numeric($amount))
{
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">';
print '<input class="flat" size=8 type="text" name="newamount" value="'.GETPOST("newamount","int").'">';
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price(price2num(GETPOST("newamount","alpha"),'MT')).'">';
}
else {
print '<b>'.price($amount).'</b>';
@ -858,7 +858,7 @@ if ($source == 'invoice')
if (empty($amount) || ! is_numeric($amount))
{
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">';
print '<input class="flat" size=8 type="text" name="newamount" value="'.GETPOST("newamount","int").'">';
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price(price2num(GETPOST("newamount","alpha"), 'MT')).'">';
}
else {
print '<b>'.price($amount).'</b>';
@ -1079,7 +1079,7 @@ if ($source == 'contractline')
if (empty($amount) || ! is_numeric($amount))
{
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">';
print '<input class="flat" size=8 type="text" name="newamount" value="'.GETPOST("newamount","int").'">';
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price(price2num(GETPOST("newamount","alpha"),'MT')).'">';
}
else {
print '<b>'.price($amount).'</b>';
@ -1202,7 +1202,7 @@ if ($source == 'membersubscription')
print '</td><td class="CTableRow'.($var?'1':'2').'">'.price($member->last_subscription_amount);
print '</td></tr>'."\n";
if (empty($amount) && ! GETPOST('newamount')) $_GET['newamount']=$member->last_subscription_amount;
if (empty($amount) && ! GETPOST('newamount','alpha')) $_GET['newamount']=$member->last_subscription_amount;
}
// Amount
@ -1215,27 +1215,31 @@ if ($source == 'membersubscription')
if (empty($conf->global->MEMBER_NEWFORM_AMOUNT)) print ')';
}
print '</td><td class="CTableRow'.($var?'1':'2').'">';
$valtoshow='';
if (empty($amount) || ! is_numeric($amount))
{
$valtoshow=GETPOST("newamount",'int');
$valtoshow=price2num(GETPOST("newamount",'alpha'),'MT');
// force default subscription amount to value defined into constant...
if (! empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT)) {
if (! empty($conf->global->MEMBER_NEWFORM_AMOUNT)) {
$valtoshow = $conf->global->MEMBER_NEWFORM_AMOUNT;
if (empty($valtoshow))
{
if (! empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT)) {
if (! empty($conf->global->MEMBER_NEWFORM_AMOUNT)) {
$valtoshow = $conf->global->MEMBER_NEWFORM_AMOUNT;
}
}
}
else {
if (! empty($conf->global->MEMBER_NEWFORM_AMOUNT)) {
$amount = $conf->global->MEMBER_NEWFORM_AMOUNT;
else {
if (! empty($conf->global->MEMBER_NEWFORM_AMOUNT)) {
$amount = $conf->global->MEMBER_NEWFORM_AMOUNT;
}
}
}
}
if (empty($amount) || ! is_numeric($amount))
{
//$valtoshow=GETPOST("newamount",'int');
//$valtoshow=price2num(GETPOST("newamount",'alpha'),'MT');
if (! empty($conf->global->MEMBER_MIN_AMOUNT) && $valtoshow) $valtoshow=max($conf->global->MEMBER_MIN_AMOUNT,$valtoshow);
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">';
print '<input class="flat" class="maxwidth75" type="text" name="newamount" value="'.price($valtoshow).'">';
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price($valtoshow).'">';
}
else {
$valtoshow=$amount;

View File

@ -188,7 +188,7 @@ if (! empty($conf->paypal->enabled))
if ($PAYPALTOKEN)
{
// Get on url call
$onlinetoken = $PAYPALTOKEN;
$onlinetoken = $PAYPALTOKEN;
$fulltag = $FULLTAG;
$payerID = $PAYPALPAYERID;
// Set by newpayment.php
@ -291,6 +291,8 @@ if ($ispaymentok)
$sendemail = '';
if (! empty($conf->global->ONLINE_PAYMENT_SENDEMAIL)) $sendemail=$conf->global->ONLINE_PAYMENT_SENDEMAIL;
$tmptag=dolExplodeIntoArray($fulltag,'.','=');
// Send an email
if ($sendemail)
{
@ -316,7 +318,6 @@ if ($ispaymentok)
$urlback=$_SERVER["REQUEST_URI"];
$topic='['.$appli.'] '.$langs->transnoentitiesnoconv("NewOnlinePaymentReceived");
$tmptag=dolExplodeIntoArray($fulltag,'.','=');
$content="";
if (! empty($tmptag['MEM']))
{
@ -388,6 +389,8 @@ else
if ($paymentmethod == 'paybox' && ! empty($conf->global->PAYBOX_PAYONLINE_SENDEMAIL)) $sendemail=$conf->global->PAYBOX_PAYONLINE_SENDEMAIL;
if ($paymentmethod == 'stripe' && ! empty($conf->global->STRIPE_PAYONLINE_SENDEMAIL)) $sendemail=$conf->global->STRIPE_PAYONLINE_SENDEMAIL;
$tmptag=dolExplodeIntoArray($fulltag,'.','=');
// Send an email
if ($sendemail)
{

View File

@ -192,7 +192,7 @@ if (! empty($conf->global->PAYPAL_SECURITY_TOKEN))
if (GETPOST('action','aZ09') == 'dopayment')
{
$PAYPAL_API_PRICE=price2num(GETPOST("newamount"),'MT');
$PAYPAL_API_PRICE=price2num(GETPOST("newamount",'alpha'),'MT');
$PAYPAL_PAYMENT_TYPE='Sale';
$origfulltag=GETPOST("fulltag",'alpha');
@ -361,7 +361,7 @@ print $text;
// Output payment summary form
print '<tr><td align="center">';
print '<table with="100%" id="tablepublicpayment">';
print '<tr class="liste_total"><td align="left" colspan="2">'.$langs->trans("ThisIsInformationOnPayment").' :</td></tr>'."\n";
print '<tr><td align="left" colspan="2">'.$langs->trans("ThisIsInformationOnPayment").' :</td></tr>'."\n";
$found=false;
$error=0;
@ -375,21 +375,19 @@ if (! GETPOST("source"))
$fulltag=$tag;
// Creditor
print '<tr class="CTableRow'.($var?'1':'2').'"><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("Creditor");
print '</td><td class="CTableRow'.($var?'1':'2').'"><b>'.$creditor.'</b>';
print '<input type="hidden" name="creditor" value="'.$creditor.'">';
print '</td></tr>'."\n";
// Amount
print '<tr class="CTableRow'.($var?'1':'2').'"><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("Amount");
if (empty($amount)) print ' ('.$langs->trans("ToComplete").')';
print '</td><td class="CTableRow'.($var?'1':'2').'">';
if (empty($amount) || ! is_numeric($amount))
{
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">';
print '<input class="flat" size=8 type="text" name="newamount" value="'.GETPOST("newamount","int").'">';
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price(price2num(GETPOST("newamount","alpha"),'MT')).'">';
}
else {
print '<b>'.price($amount).'</b>';
@ -402,7 +400,6 @@ if (! GETPOST("source"))
print '</td></tr>'."\n";
// Tag
print '<tr class="CTableRow'.($var?'1':'2').'"><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("PaymentCode");
print '</td><td class="CTableRow'.($var?'1':'2').'"><b style="word-break: break-all;">'.$fulltag.'</b>';
print '<input type="hidden" name="tag" value="'.$tag.'">';
@ -475,7 +472,7 @@ if (GETPOST("source") == 'order')
if (empty($amount) || ! is_numeric($amount))
{
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">';
print '<input class="flat" size=8 type="text" name="newamount" value="'.GETPOST("newamount","int").'">';
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price(price2num(GETPOST("newamount","alpha"),'MT')).'">';
}
else {
print '<b>'.price($amount).'</b>';
@ -585,7 +582,7 @@ if (GETPOST("source") == 'invoice')
if (empty($amount) || ! is_numeric($amount))
{
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">';
print '<input class="flat" size=8 type="text" name="newamount" value="'.GETPOST("newamount","int").'">';
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price(price2num(GETPOST("newamount","alpha"),'MT')).'">';
}
else {
print '<b>'.price($amount).'</b>';
@ -783,7 +780,7 @@ if (GETPOST("source") == 'contractline')
if (empty($amount) || ! is_numeric($amount))
{
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">';
print '<input class="flat" size=8 type="text" name="newamount" value="'.GETPOST("newamount","int").'">';
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price(price2num(GETPOST("newamount","alpha"),'MT')).'">';
}
else {
print '<b>'.price($amount).'</b>';
@ -902,7 +899,7 @@ if (GETPOST("source") == 'membersubscription')
print '</td><td class="CTableRow'.($var?'1':'2').'">'.price($member->last_subscription_amount);
print '</td></tr>'."\n";
if (empty($amount) && ! GETPOST('newamount')) $_GET['newamount']=$member->last_subscription_amount;
if (empty($amount) && ! GETPOST('newamount','alpha')) $_GET['newamount']=$member->last_subscription_amount;
}
// Amount
@ -915,12 +912,31 @@ if (GETPOST("source") == 'membersubscription')
print ')';
}
print '</td><td class="CTableRow'.($var?'1':'2').'">';
$valtoshow='';
if (empty($amount) || ! is_numeric($amount))
{
$valtoshow=GETPOST("newamount",'int');
$valtoshow=price2num(GETPOST("newamount",'alpha'),'MT');
// force default subscription amount to value defined into constant...
if (empty($valtoshow))
{
if (! empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT)) {
if (! empty($conf->global->MEMBER_NEWFORM_AMOUNT)) {
$valtoshow = $conf->global->MEMBER_NEWFORM_AMOUNT;
}
}
else {
if (! empty($conf->global->MEMBER_NEWFORM_AMOUNT)) {
$amount = $conf->global->MEMBER_NEWFORM_AMOUNT;
}
}
}
}
if (empty($amount) || ! is_numeric($amount))
{
//$valtoshow=price2num(GETPOST("newamount",'alpha'),'MT');
if (! empty($conf->global->MEMBER_MIN_AMOUNT) && $valtoshow) $valtoshow=max($conf->global->MEMBER_MIN_AMOUNT,$valtoshow);
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">';
print '<input class="flat" class="maxwidth75" type="text" name="newamount" value="'.$valtoshow.'">';
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price($valtoshow).'">';
}
else {
$valtoshow=$amount;

View File

@ -181,6 +181,8 @@ if ($PAYPALTOKEN)
if ($result < 0) { $error++; $errors=$interface->errors; }
// Fin appel triggers
$tmptag=dolExplodeIntoArray($fulltag,'.','=');
// Send an email
if (! empty($conf->global->ONLINE_PAYMENT_SENDEMAIL))
{
@ -206,7 +208,6 @@ if ($PAYPALTOKEN)
$urlback=$_SERVER["REQUEST_URI"];
$topic='['.$appli.'] '.$langs->transnoentitiesnoconv("NewOnlinePaymentReceived");
$tmptag=dolExplodeIntoArray($fulltag,'.','=');
$content="";
if (! empty($tmptag['MEM']))
{
@ -265,6 +266,8 @@ if ($PAYPALTOKEN)
if ($mysoc->email) echo "\nPlease, send a screenshot of this page to ".$mysoc->email."<br>\n";
$tmptag=dolExplodeIntoArray($fulltag,'.','=');
// Send an email
if (! empty($conf->global->ONLINE_PAYMENT_SENDEMAIL))
{

View File

@ -202,7 +202,7 @@ else if (! empty($conf->global->ONLINE_PAYMENT_CREDITOR)) $creditor=$conf->globa
if ($action == 'dopayment') // We click on button Create payment
{
if (GETPOST('newamount')) $amount = GETPOST('newamount');
if (GETPOST('newamount','alpha')) $amount = price2num(GETPOST('newamount','alpha'),'MT');
else
{
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Amount")), null, 'errors');
@ -429,7 +429,7 @@ print $text;
// Output payment summary form
print '<tr><td align="center">';
print '<table with="100%" id="tablepublicpayment">';
print '<tr class="liste_total"><td align="left" colspan="2">'.$langs->trans("ThisIsInformationOnPayment").' :</td></tr>'."\n";
print '<tr><td align="left" colspan="2">'.$langs->trans("ThisIsInformationOnPayment").' :</td></tr>'."\n";
$found=false;
$error=0;
@ -455,7 +455,7 @@ if (! GETPOST("source"))
if (empty($amount) || ! is_numeric($amount))
{
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">';
print '<input class="flat" size=8 type="text" name="newamount" value="'.GETPOST("newamount","int").'">';
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price(price2num(GETPOST("newamount","alpha"),'MT')).'">';
}
else {
print '<b>'.price($amount).'</b>';
@ -541,7 +541,7 @@ if (GETPOST("source") == 'order')
if (empty($amount) || ! is_numeric($amount))
{
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">';
print '<input class="flat" size=8 type="text" name="newamount" value="'.GETPOST("newamount","int").'">';
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price(price2num(GETPOST("newamount","alpha"),'MT')).'">';
}
else {
print '<b>'.price($amount).'</b>';
@ -652,7 +652,7 @@ if (GETPOST("source") == 'invoice')
if (empty($amount) || ! is_numeric($amount))
{
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">';
print '<input class="flat" size=8 type="text" name="newamount" value="'.GETPOST("newamount","int").'">';
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price(price2num(GETPOST("newamount","alpha"),'MT')).'">';
}
else {
print '<b>'.price($amount).'</b>';
@ -852,7 +852,7 @@ if (GETPOST("source") == 'contractline')
if (empty($amount) || ! is_numeric($amount))
{
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">';
print '<input class="flat" size=8 type="text" name="newamount" value="'.GETPOST("newamount","int").'">';
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price(price2num(GETPOST("newamount","alpha"),'MT')).'">';
}
else {
print '<b>'.price($amount).'</b>';
@ -971,7 +971,7 @@ if (GETPOST("source") == 'membersubscription')
print '</td><td class="CTableRow'.($var?'1':'2').'">'.price($member->last_subscription_amount);
print '</td></tr>'."\n";
if (empty($amount) && ! GETPOST('newamount')) $_GET['newamount']=$member->last_subscription_amount;
if (empty($amount) && ! GETPOST('newamount','alpha')) $_GET['newamount']=$member->last_subscription_amount;
}
// Amount
@ -984,12 +984,31 @@ if (GETPOST("source") == 'membersubscription')
print ')';
}
print '</td><td class="CTableRow'.($var?'1':'2').'">';
$valtoshow='';
if (empty($amount) || ! is_numeric($amount))
{
$valtoshow=GETPOST("newamount",'int');
$valtoshow=price2num(GETPOST("newamount",'alpha'),'MT');
// force default subscription amount to value defined into constant...
if (empty($valtoshow))
{
if (! empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT)) {
if (! empty($conf->global->MEMBER_NEWFORM_AMOUNT)) {
$valtoshow = $conf->global->MEMBER_NEWFORM_AMOUNT;
}
}
else {
if (! empty($conf->global->MEMBER_NEWFORM_AMOUNT)) {
$amount = $conf->global->MEMBER_NEWFORM_AMOUNT;
}
}
}
}
if (empty($amount) || ! is_numeric($amount))
{
//$valtoshow=price2num(GETPOST("newamount",'alpha'),'MT');
if (! empty($conf->global->MEMBER_MIN_AMOUNT) && $valtoshow) $valtoshow=max($conf->global->MEMBER_MIN_AMOUNT,$valtoshow);
print '<input type="hidden" name="amount" value="'.GETPOST("amount",'int').'">';
print '<input class="flat" class="maxwidth75" type="text" name="newamount" value="'.price($valtoshow).'">';
print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price($valtoshow).'">';
}
else {
$valtoshow=$amount;

View File

@ -127,6 +127,8 @@ if ($ispaymentok)
$sendemail = '';
if (! empty($conf->global->ONLINE_PAYMENT_SENDEMAIL)) $sendemail=$conf->global->ONLINE_PAYMENT_SENDEMAIL;
$tmptag=dolExplodeIntoArray($fulltag,'.','=');
// Send an email
if ($sendemail)
{
@ -152,7 +154,6 @@ if ($ispaymentok)
$urlback=$_SERVER["REQUEST_URI"];
$topic='['.$appli.'] '.$langs->transnoentitiesnoconv("NewOnlinePaymentReceived");
$tmptag=dolExplodeIntoArray($fulltag,'.','=');
$content="";
if (! empty($tmptag['MEM']))
{

View File

@ -119,7 +119,7 @@ if (empty($reshook))
{
$object->fetch($socid);
$errors = 0;
$error = 0;
$soc_origin_id = GETPOST('soc_origin', 'int');
$soc_origin = new Societe($db);
@ -131,13 +131,13 @@ if (empty($reshook))
}
else
{
if (!$errors && $soc_origin->fetch($soc_origin_id) < 1)
if (!$error && $soc_origin->fetch($soc_origin_id) < 1)
{
setEventMessages($langs->trans('ErrorRecordNotFound'), null, 'errors');
$errors++;
$error++;
}
if (!$errors)
if (!$error)
{
// TODO Move the merge function into class of object.
@ -184,48 +184,67 @@ if (empty($reshook))
$suppcats = $static_cat->containing($soc_origin->id, 'supplier', 'id');
$object->setCategories($suppcats, 'supplier');
// If thirdparty has a new code that is same than origin, we clean origin code to avoid duplicate key from database unique keys.
if ($soc_origin->code_client == $object->code_client
|| $soc_origin->code_fournisseur == $object->code_fournisseur
|| $soc_origin->barcode == $object->barcode)
{
dol_syslog("We clean customer and supplier code so we will be able to make the update of target");
$soc_origin->code_client = '';
$soc_origin->code_fournisseur = '';
$soc_origin->barcode = '';
$soc_origin->update($soc_origin->id, $user, 0, 1, 1, 'merge');
}
// Update
$object->update($object->id, $user, 0);
$object->update($object->id, $user, 0, 1, 1, 'merge');
if ($result < 0)
{
$error++;
}
// Move links
$objects = array(
'Adherent' => '/adherents/class/adherent.class.php',
'Societe' => '/societe/class/societe.class.php',
'Categorie' => '/categories/class/categorie.class.php',
'ActionComm' => '/comm/action/class/actioncomm.class.php',
'Propal' => '/comm/propal/class/propal.class.php',
'Commande' => '/commande/class/commande.class.php',
'Facture' => '/compta/facture/class/facture.class.php',
'FactureRec' => '/compta/facture/class/facture-rec.class.php',
'LignePrelevement' => '/compta/prelevement/class/ligneprelevement.class.php',
'Contact' => '/contact/class/contact.class.php',
'Contrat' => '/contrat/class/contrat.class.php',
'Expedition' => '/expedition/class/expedition.class.php',
'Fichinter' => '/fichinter/class/fichinter.class.php',
'CommandeFournisseur' => '/fourn/class/fournisseur.commande.class.php',
'FactureFournisseur' => '/fourn/class/fournisseur.facture.class.php',
'SupplierProposal' => '/supplier_proposal/class/supplier_proposal.class.php',
'ProductFournisseur' => '/fourn/class/fournisseur.product.class.php',
'Livraison' => '/livraison/class/livraison.class.php',
'Product' => '/product/class/product.class.php',
'Project' => '/projet/class/project.class.php',
'User' => '/user/class/user.class.php',
);
//First, all core objects must update their tables
foreach ($objects as $object_name => $object_file)
if (! $error)
{
require_once DOL_DOCUMENT_ROOT.$object_file;
$objects = array(
'Adherent' => '/adherents/class/adherent.class.php',
'Societe' => '/societe/class/societe.class.php',
'Categorie' => '/categories/class/categorie.class.php',
'ActionComm' => '/comm/action/class/actioncomm.class.php',
'Propal' => '/comm/propal/class/propal.class.php',
'Commande' => '/commande/class/commande.class.php',
'Facture' => '/compta/facture/class/facture.class.php',
'FactureRec' => '/compta/facture/class/facture-rec.class.php',
'LignePrelevement' => '/compta/prelevement/class/ligneprelevement.class.php',
'Contact' => '/contact/class/contact.class.php',
'Contrat' => '/contrat/class/contrat.class.php',
'Expedition' => '/expedition/class/expedition.class.php',
'Fichinter' => '/fichinter/class/fichinter.class.php',
'CommandeFournisseur' => '/fourn/class/fournisseur.commande.class.php',
'FactureFournisseur' => '/fourn/class/fournisseur.facture.class.php',
'SupplierProposal' => '/supplier_proposal/class/supplier_proposal.class.php',
'ProductFournisseur' => '/fourn/class/fournisseur.product.class.php',
'Livraison' => '/livraison/class/livraison.class.php',
'Product' => '/product/class/product.class.php',
'Project' => '/projet/class/project.class.php',
'User' => '/user/class/user.class.php',
);
if (!$errors && !$object_name::replaceThirdparty($db, $soc_origin->id, $object->id))
//First, all core objects must update their tables
foreach ($objects as $object_name => $object_file)
{
$errors++;
setEventMessages($db->lasterror(), null, 'errors');
require_once DOL_DOCUMENT_ROOT.$object_file;
if (!$error && !$object_name::replaceThirdparty($db, $soc_origin->id, $object->id))
{
$error++;
setEventMessages($db->lasterror(), null, 'errors');
}
}
}
//External modules should update their ones too
if (!$errors)
// External modules should update their ones too
if (! $error)
{
$reshook = $hookmanager->executeHooks('replaceThirdparty', array(
'soc_origin' => $soc_origin->id,
@ -235,7 +254,7 @@ if (empty($reshook))
if ($reshook < 0)
{
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
$errors++;
$error++;
}
}
@ -254,16 +273,16 @@ if (empty($reshook))
// End call triggers
}
if (!$errors)
if (!$error)
{
//We finally remove the old thirdparty
if ($soc_origin->delete($soc_origin->id, $user) < 1)
{
$errors++;
$error++;
}
}
if (!$errors)
if (!$error)
{
setEventMessages($langs->trans('ThirdpartiesMergeSuccess'), null, 'mesgs');
$db->commit();

View File

@ -243,6 +243,218 @@ class Thirdparties extends DolibarrApi
return false;
}
/**
* Merge a thirdparty into another one.
*
* Merge content (properties, notes) and objects (like invoices, events, orders, proposals, ...) of a thirdparty into a target thirdparty,
* then delete the merged thirdparty.
* If a property has a defined value both in thirdparty to delete and thirdparty to keep, the value into the thirdparty to
* delete will be ignored, the value of target thirdparty will remain, except for notes (content is concatenated).
*
* @param int $id ID of thirdparty to keep (the target thirdparty)
* @param int $idtodelete ID of thirdparty to remove (the thirdparty to delete), once data has been merged into the target thirdparty.
* @return int
*
* @url PUT {id}/merge/{idtodelete}
*/
function merge($id, $idtodelete)
{
global $db, $hookmanager;
if ($id == $idtodelete)
{
throw new RestException(400, 'Try to merge a thirdparty into itself');
}
if(! DolibarrApiAccess::$user->rights->societe->creer) {
throw new RestException(401);
}
$result = $this->company->fetch($id); // include the fetch of extra fields
if( ! $result ) {
throw new RestException(404, 'Thirdparty not found');
}
if( ! DolibarrApi::_checkAccessToResource('societe',$this->company->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
$this->companytoremove = new Societe($db);
$result = $this->companytoremove->fetch($idtodelete); // include the fetch of extra fields
if( ! $result ) {
throw new RestException(404, 'Thirdparty not found');
}
if( ! DolibarrApi::_checkAccessToResource('societe',$this->companytoremove->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
$soc_origin = $this->companytoremove;
$object = $this->company;
$user = DolibarrApiAccess::$user;
// Call same code than into action 'confirm_merge'
$db->begin();
// Recopy some data
$object->client = $object->client | $soc_origin->client;
$object->fournisseur = $object->fournisseur | $soc_origin->fournisseur;
$listofproperties=array(
'address', 'zip', 'town', 'state_id', 'country_id', 'phone', 'phone_pro', 'fax', 'email', 'skype', 'url', 'barcode',
'idprof1', 'idprof2', 'idprof3', 'idprof4', 'idprof5', 'idprof6',
'tva_intra', 'effectif_id', 'forme_juridique', 'remise_percent', 'mode_reglement_supplier_id', 'cond_reglement_supplier_id', 'name_bis',
'stcomm_id', 'outstanding_limit', 'price_level', 'parent', 'default_lang', 'ref', 'ref_ext', 'import_key', 'fk_incoterms', 'fk_multicurrency',
'code_client', 'code_fournisseur', 'code_compta', 'code_compta_fournisseur',
'model_pdf', 'fk_projet'
);
foreach ($listofproperties as $property)
{
if (empty($object->$property)) $object->$property = $soc_origin->$property;
}
// Concat some data
$listofproperties=array(
'note_public', 'note_private'
);
foreach ($listofproperties as $property)
{
$object->$property = dol_concatdesc($object->$property, $soc_origin->$property);
}
// Merge extrafields
if (is_array($soc_origin->array_options))
{
foreach ($soc_origin->array_options as $key => $val)
{
if (empty($object->array_options[$key])) $object->array_options[$key] = $val;
}
}
// Merge categories
$static_cat = new Categorie($db);
$custcats = $static_cat->containing($soc_origin->id, 'customer', 'id');
$object->setCategories($custcats, 'customer');
$suppcats = $static_cat->containing($soc_origin->id, 'supplier', 'id');
$object->setCategories($suppcats, 'supplier');
// If thirdparty has a new code that is same than origin, we clean origin code to avoid duplicate key from database unique keys.
if ($soc_origin->code_client == $object->code_client
|| $soc_origin->code_fournisseur == $object->code_fournisseur
|| $soc_origin->barcode == $object->barcode)
{
dol_syslog("We clean customer and supplier code so we will be able to make the update of target");
$soc_origin->code_client = '';
$soc_origin->code_fournisseur = '';
$soc_origin->barcode = '';
$soc_origin->update($soc_origin->id, $user, 0, 1, 1, 'merge');
}
// Update
$result = $object->update($object->id, $user, 0, 1, 1, 'merge');
if ($result < 0)
{
$error++;
}
// Move links
if (! $error)
{
$objects = array(
'Adherent' => '/adherents/class/adherent.class.php',
'Societe' => '/societe/class/societe.class.php',
'Categorie' => '/categories/class/categorie.class.php',
'ActionComm' => '/comm/action/class/actioncomm.class.php',
'Propal' => '/comm/propal/class/propal.class.php',
'Commande' => '/commande/class/commande.class.php',
'Facture' => '/compta/facture/class/facture.class.php',
'FactureRec' => '/compta/facture/class/facture-rec.class.php',
'LignePrelevement' => '/compta/prelevement/class/ligneprelevement.class.php',
'Contact' => '/contact/class/contact.class.php',
'Contrat' => '/contrat/class/contrat.class.php',
'Expedition' => '/expedition/class/expedition.class.php',
'Fichinter' => '/fichinter/class/fichinter.class.php',
'CommandeFournisseur' => '/fourn/class/fournisseur.commande.class.php',
'FactureFournisseur' => '/fourn/class/fournisseur.facture.class.php',
'SupplierProposal' => '/supplier_proposal/class/supplier_proposal.class.php',
'ProductFournisseur' => '/fourn/class/fournisseur.product.class.php',
'Livraison' => '/livraison/class/livraison.class.php',
'Product' => '/product/class/product.class.php',
'Project' => '/projet/class/project.class.php',
'User' => '/user/class/user.class.php',
);
//First, all core objects must update their tables
foreach ($objects as $object_name => $object_file)
{
require_once DOL_DOCUMENT_ROOT.$object_file;
if (!$errors && !$object_name::replaceThirdparty($db, $soc_origin->id, $object->id))
{
$errors++;
//setEventMessages($db->lasterror(), null, 'errors');
}
}
}
// External modules should update their ones too
if (!$errors)
{
$reshook = $hookmanager->executeHooks('replaceThirdparty', array(
'soc_origin' => $soc_origin->id,
'soc_dest' => $object->id
), $soc_dest, $action);
if ($reshook < 0)
{
//setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
$errors++;
}
}
if (! $error)
{
$object->context=array('merge'=>1, 'mergefromid'=>$soc_origin->id);
// Call trigger
$result=$object->call_trigger('COMPANY_MODIFY',$user);
if ($result < 0)
{
//setEventMessages($object->error, $object->errors, 'errors');
$error++;
}
// End call triggers
}
if (! $error)
{
//We finally remove the old thirdparty
if ($soc_origin->delete($soc_origin->id, $user) < 1)
{
$errors++;
}
}
// End of merge
if ($error)
{
$db->rollback();
throw new RestException(500, 'Error failed to merged thirdparty '.$this->companytoremove->id.' into '.$id.'. Enable and read log file for more information.');
}
else
{
$db->commit();
}
return $this->get($id);
}
/**
* Delete thirdparty
*

View File

@ -65,7 +65,7 @@ class Client extends Societe
$clause = "AND";
}
$sql.= " ".$clause." s.client IN (1,2,3)";
$sql.= ' AND s.entity IN ('.getEntity($this->element, 1).')';
$sql.= ' AND s.entity IN ('.getEntity($this->element).')';
$sql.= " GROUP BY s.client";
$resql=$this->db->query($sql);

View File

@ -738,7 +738,7 @@ class Societe extends CommonObject
* @param int $call_trigger 0=no, 1=yes
* @param int $allowmodcodeclient Inclut modif code client et code compta
* @param int $allowmodcodefournisseur Inclut modif code fournisseur et code compta fournisseur
* @param string $action 'add' or 'update'
* @param string $action 'add' or 'update' or 'merge'
* @param int $nosyncmember Do not synchronize info of linked member
* @return int <0 if KO, >=0 if OK
*/
@ -867,7 +867,12 @@ class Societe extends CommonObject
// Check name is required and codes are ok or unique.
// If error, this->errors[] is filled
$result = 0;
if ($action != 'add') $result = $this->verify(); // We don't check when update called during a create because verify was already done
if ($action != 'add' && $action != 'merge')
{
// We don't check when update called during a create because verify was already done.
// For a merge, we suppose source data is clean and a customer code of a deleted thirdparty must be accepted into a target thirdparty with empty code without duplicate error
$result = $this->verify();
}
if ($result >= 0)
{
@ -1148,7 +1153,7 @@ class Societe extends CommonObject
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON s.fk_departement = d.rowid';
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_typent as te ON s.fk_typent = te.id';
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_incoterms as i ON s.fk_incoterms = i.rowid';
$sql .= ' WHERE s.entity IN ('.getEntity($this->element, 1).')';
$sql .= ' WHERE s.entity IN ('.getEntity($this->element).')';
if ($rowid) $sql .= ' AND s.rowid = '.$rowid;
if ($ref) $sql .= " AND s.nom = '".$this->db->escape($ref)."'";
if ($ref_ext) $sql .= " AND s.ref_ext = '".$this->db->escape($ref_ext)."'";
@ -3767,16 +3772,22 @@ class Societe extends CommonObject
* Function used to replace a thirdparty id with another one.
* It must be used within a transaction to avoid trouble
*
* @param DoliDB $db Database handler
* @param int $origin_id Old thirdparty id
* @param int $dest_id New thirdparty id
* @return bool
* @param DoliDB $db Database handler
* @param int $origin_id Old thirdparty id (will be removed)
* @param int $dest_id New thirdparty id
* @return bool True if success, False if error
*/
public static function replaceThirdparty(DoliDB $db, $origin_id, $dest_id)
{
if ($origin_id == $id)
{
dol_syslog('Error: Try to merge a thirdparty into itself');
return false;
}
/**
* Thirdparty commercials cannot be the same in both thirdparties so we look for them and remove some
* Because this function is meant to be executed within a transaction, we won't take care of it.
* Thirdparty commercials cannot be the same in both thirdparties so we look for them and remove some to avoid duplicate.
* Because this function is meant to be executed within a transaction, we won't take care of begin/commit.
*/
$sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.'societe_commerciaux ';
$sql .= ' WHERE fk_soc = '.(int) $dest_id.' AND fk_user IN ( ';

View File

@ -44,11 +44,7 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
if (! empty($conf->adherent->enabled)) require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
$langs->load("companies");
$langs->load("commercial");
$langs->load("bills");
$langs->load("banks");
$langs->load("users");
$langs->loadLangs(array("companies","commercial","bills","banks","users"));
if (! empty($conf->categorie->enabled)) $langs->load("categories");
if (! empty($conf->incoterm->enabled)) $langs->load("incoterm");
if (! empty($conf->notification->enabled)) $langs->load("mails");
@ -115,6 +111,9 @@ if (empty($reshook))
exit;
}
}
// Selection of new fields
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
}
@ -169,8 +168,6 @@ else
if ($action != 'presend')
{
print '<div class="fichecenter">';
// Contacts list
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
{
@ -182,10 +179,6 @@ else
{
$result=show_addresses($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?socid='.$object->id);
}
print '</div>';
}
}

View File

@ -62,7 +62,7 @@ if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/'
$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
llxHeader('',$title,$help_url);
if ($id > 0)
if ($object->id > 0)
{
/*
* Affichage onglets
@ -120,6 +120,11 @@ if ($id > 0)
dol_fiche_end();
}
else
{
$langs->load("errors");
print $langs->trans("ErrorRecordNotFound");
}
llxFooter();
$db->close();

View File

@ -357,7 +357,7 @@ input.buttonpayment {
background: none;
padding-left: 30px;
text-align: <?php echo $left; ?>;
border: 2px solid #ccc;
border: 1px solid #ddd;
background-color: #eee;
white-space: normal;
}