Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
2600b28638
@ -69,7 +69,23 @@ if ($action == 'setmod')
|
|||||||
dolibarr_set_const($db, "PAYMENT_ADDON",$value,'chaine',0,'',$conf->entity);
|
dolibarr_set_const($db, "PAYMENT_ADDON",$value,'chaine',0,'',$conf->entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($action == 'set_FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS')
|
||||||
|
{
|
||||||
|
$freetext = GETPOST('FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS'); // No alpha here, we want exact string
|
||||||
|
|
||||||
|
$res = dolibarr_set_const($db, "FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS",$freetext,'chaine',0,'',$conf->entity);
|
||||||
|
|
||||||
|
if (! $res > 0) $error++;
|
||||||
|
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
@ -215,6 +231,33 @@ foreach ($dirmodels as $reldir)
|
|||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
|
print "<br />";
|
||||||
|
|
||||||
|
print load_fiche_titre($langs->trans("OtherOptions"),'','');
|
||||||
|
|
||||||
|
print '<table class="noborder" width="100%">';
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
print '<td>'.$langs->trans("Parameter").'</td>';
|
||||||
|
print '<td align="center" width="60">'.$langs->trans("Value").'</td>';
|
||||||
|
print '<td width="80"> </td>';
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
|
// Allow payments on different thirdparties bills but same parent company
|
||||||
|
$var=! $var;
|
||||||
|
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||||
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'" />';
|
||||||
|
print '<input type="hidden" name="action" value="set_FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS" />';
|
||||||
|
print '<tr '.$bc[$var].'><td>';
|
||||||
|
print $langs->trans("PaymentOnDifferentThirdBills");
|
||||||
|
print '</td><td width="60" align="center">';
|
||||||
|
print $form->selectyesno("FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS",$conf->global->FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS,1);
|
||||||
|
print '</td><td align="right">';
|
||||||
|
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'" />';
|
||||||
|
print "</td></tr>\n";
|
||||||
|
print '</form>';
|
||||||
|
|
||||||
|
print '</table>';
|
||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -33,6 +33,7 @@ require '../main.inc.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||||
|
|
||||||
$langs->load('companies');
|
$langs->load('companies');
|
||||||
$langs->load('bills');
|
$langs->load('bills');
|
||||||
@ -518,11 +519,21 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
|||||||
* List of unpaid invoices
|
* List of unpaid invoices
|
||||||
*/
|
*/
|
||||||
$sql = 'SELECT f.rowid as facid, f.facnumber, f.total_ttc, f.multicurrency_total_ttc, f.type, ';
|
$sql = 'SELECT f.rowid as facid, f.facnumber, f.total_ttc, f.multicurrency_total_ttc, f.type, ';
|
||||||
$sql.= ' f.datef as df';
|
$sql.= ' f.datef as df, f.fk_soc as socid';
|
||||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'facture as f';
|
$sql.= ' FROM '.MAIN_DB_PREFIX.'facture as f';
|
||||||
$sql.= ' WHERE f.entity = '.$conf->entity;
|
|
||||||
$sql.= ' AND f.fk_soc = '.$facture->socid;
|
if(!empty($conf->global->FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS)) {
|
||||||
$sql.= ' AND f.paye = 0';
|
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON (f.fk_soc = s.rowid)';
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql.= ' WHERE f.entity = '.$conf->entity;
|
||||||
|
$sql.= ' AND (f.fk_soc = '.$facture->socid;
|
||||||
|
|
||||||
|
if(!empty($conf->global->FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS)) {
|
||||||
|
$sql.= ' OR f.fk_soc IN (SELECT rowid FROM '.MAIN_DB_PREFIX.'societe WHERE parent = '.$facture->thirdparty->parent.')';
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql.= ') AND f.paye = 0';
|
||||||
$sql.= ' AND f.fk_statut = 1'; // Statut=0 => not validated, Statut=2 => canceled
|
$sql.= ' AND f.fk_statut = 1'; // Statut=0 => not validated, Statut=2 => canceled
|
||||||
if ($facture->type != 2)
|
if ($facture->type != 2)
|
||||||
{
|
{
|
||||||
@ -583,6 +594,9 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
|||||||
$objp = $db->fetch_object($resql);
|
$objp = $db->fetch_object($resql);
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
|
|
||||||
|
$soc = new Societe($db);
|
||||||
|
$soc->fetch($objp->socid);
|
||||||
|
|
||||||
$invoice=new Facture($db);
|
$invoice=new Facture($db);
|
||||||
$invoice->fetch($objp->facid);
|
$invoice->fetch($objp->facid);
|
||||||
$paiement = $invoice->getSommePaiement();
|
$paiement = $invoice->getSommePaiement();
|
||||||
@ -605,6 +619,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
|||||||
|
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $invoice->getNomUrl(1,'');
|
print $invoice->getNomUrl(1,'');
|
||||||
|
if($objp->socid != $facture->thirdparty->id) print ' - '.$soc->getNomUrl(1).' ';
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
|
|
||||||
// Date
|
// Date
|
||||||
|
|||||||
@ -2451,19 +2451,19 @@ abstract class CommonObject
|
|||||||
{
|
{
|
||||||
if ($justsource)
|
if ($justsource)
|
||||||
{
|
{
|
||||||
$sql.= "fk_source = '".$sourceid."' AND sourcetype = '".$sourcetype."'";
|
$sql.= "fk_source = ".$sourceid." AND sourcetype = '".$sourcetype."'";
|
||||||
if ($withtargettype) $sql.= " AND targettype = '".$targettype."'";
|
if ($withtargettype) $sql.= " AND targettype = '".$targettype."'";
|
||||||
}
|
}
|
||||||
else if ($justtarget)
|
else if ($justtarget)
|
||||||
{
|
{
|
||||||
$sql.= "fk_target = '".$targetid."' AND targettype = '".$targettype."'";
|
$sql.= "fk_target = ".$targetid." AND targettype = '".$targettype."'";
|
||||||
if ($withsourcetype) $sql.= " AND sourcetype = '".$sourcetype."'";
|
if ($withsourcetype) $sql.= " AND sourcetype = '".$sourcetype."'";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$sql.= "(fk_source = '".$sourceid."' AND sourcetype = '".$sourcetype."')";
|
$sql.= "(fk_source = ".$sourceid." AND sourcetype = '".$sourcetype."')";
|
||||||
$sql.= " ".$clause." (fk_target = '".$targetid."' AND targettype = '".$targettype."')";
|
$sql.= " ".$clause." (fk_target = ".$targetid." AND targettype = '".$targettype."')";
|
||||||
}
|
}
|
||||||
$sql .= ' ORDER BY sourcetype';
|
$sql .= ' ORDER BY sourcetype';
|
||||||
//print $sql;
|
//print $sql;
|
||||||
|
|||||||
@ -312,6 +312,7 @@ LatestRelatedBill=Latest related invoice
|
|||||||
WarningBillExist=Warning, one or more invoice already exist
|
WarningBillExist=Warning, one or more invoice already exist
|
||||||
MergingPDFTool=Merging PDF tool
|
MergingPDFTool=Merging PDF tool
|
||||||
AmountPaymentDistributedOnInvoice=Payment amount distributed on invoice
|
AmountPaymentDistributedOnInvoice=Payment amount distributed on invoice
|
||||||
|
PaymentOnDifferentThirdBills=Allow payments on different thirdparties bills but same parent company
|
||||||
PaymentNote=Payment note
|
PaymentNote=Payment note
|
||||||
ListOfPreviousSituationInvoices=List of previous situation invoices
|
ListOfPreviousSituationInvoices=List of previous situation invoices
|
||||||
ListOfNextSituationInvoices=List of next situation invoices
|
ListOfNextSituationInvoices=List of next situation invoices
|
||||||
|
|||||||
@ -784,11 +784,8 @@ class UserGroup extends CommonObject
|
|||||||
{
|
{
|
||||||
$muser=new User($this->db);
|
$muser=new User($this->db);
|
||||||
$muser->fetch($val->id);
|
$muser->fetch($val->id);
|
||||||
if ($conf->global->LDAP_KEY_USERS == 'cn') $ldapuserid=$muser->getFullName($langs);
|
$info2 = $muser->_load_ldap_info();
|
||||||
elseif ($conf->global->LDAP_KEY_USERS == 'sn') $ldapuserid=$muser->lastname;
|
$valueofldapfield[] = $muser->_load_ldap_dn($info2);
|
||||||
elseif ($conf->global->LDAP_KEY_USERS == 'uid') $ldapuserid=$muser->login;
|
|
||||||
|
|
||||||
$valueofldapfield[] = $conf->global->LDAP_KEY_USERS.'='.$ldapuserid.','.$conf->global->LDAP_USER_DN;
|
|
||||||
}
|
}
|
||||||
$info[$conf->global->LDAP_GROUP_FIELD_GROUPMEMBERS] = (!empty($valueofldapfield)?$valueofldapfield:'');
|
$info[$conf->global->LDAP_GROUP_FIELD_GROUPMEMBERS] = (!empty($valueofldapfield)?$valueofldapfield:'');
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user