mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Maxi debug of v6
This commit is contained in:
parent
a0295821ba
commit
1820649175
|
|
@ -45,10 +45,13 @@ $langs->load("compta");
|
|||
$langs->load("banks");
|
||||
$langs->load("loans");
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
// None
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
|
|
@ -73,35 +76,31 @@ print "<br>\n";
|
|||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescJournalSetup", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("AccountingJournals").'</strong>');
|
||||
print "<br>\n";
|
||||
print "<br>\n";
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChartModel", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("Pcg_version").'</strong>');
|
||||
print "<br>\n";
|
||||
print "<br>\n";
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChart", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("Chartofaccounts").'</strong>');
|
||||
print "<br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
print "<br>\n";
|
||||
print $langs->trans("AccountancyAreaDescActionOnceBis");
|
||||
print "<br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescMisc", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>')."<br>\n";
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescMisc", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>')."\n";
|
||||
print "<br>\n";
|
||||
$step++;
|
||||
$textlink = '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup").'-'.$langs->transnoentitiesnoconv("MenuVatAccounts").'</strong>';
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescVat", $step, $textlink);
|
||||
print "<br>\n";
|
||||
print "<br>\n";
|
||||
if (! empty($conf->tax->enabled))
|
||||
{
|
||||
$textlink = '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup").'-'.$langs->transnoentitiesnoconv("MenuTaxAccounts").'</strong>';
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescContrib", $step, $textlink);
|
||||
print "<br>\n";
|
||||
print "<br>\n";
|
||||
}
|
||||
/*if (! empty($conf->salaries->enabled))
|
||||
{
|
||||
|
|
@ -116,7 +115,6 @@ if (! empty($conf->expensereport->enabled)) // TODO Move this in the default ac
|
|||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescExpenseReport", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuExpenseReportAccounts").'</strong>');
|
||||
print "<br>\n";
|
||||
print "<br>\n";
|
||||
}
|
||||
/*
|
||||
if (! empty($conf->loan->enabled))
|
||||
|
|
@ -124,26 +122,22 @@ if (! empty($conf->loan->enabled))
|
|||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescLoan", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuSpecialExpenses").'-'.$langs->transnoentitiesnoconv("Loans").'</strong> '.$langs->transnoentitiesnoconv("or").' <strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
||||
print "<br>\n";
|
||||
print "<br>\n";
|
||||
}
|
||||
if (! empty($conf->don->enabled))
|
||||
{
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescDonation", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDonationAccounts").'</strong>');
|
||||
print "<br>\n";
|
||||
print "<br>\n";
|
||||
}*/
|
||||
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescProd", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("ProductsBinding").'</strong>');
|
||||
print "<br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
$step++;
|
||||
$textlink='<strong>'.$langs->transnoentitiesnoconv("MenuBankCash").'</strong>';
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBank", $step, $textlink);
|
||||
print "<br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
|
||||
print "<br>\n";
|
||||
|
|
@ -155,19 +149,19 @@ $step = 0;
|
|||
$langs->loadLangs(array('bills', 'trips'));
|
||||
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("BillsCustomers"), '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("CustomersVentilation").'</strong>')."<br>\n";
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("BillsCustomers"), '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("CustomersVentilation").'</strong>')."\n";
|
||||
print "<br>\n";
|
||||
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("BillsSuppliers"), '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("SuppliersVentilation").'</strong>')."<br>\n";
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("BillsSuppliers"), '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("SuppliersVentilation").'</strong>')."\n";
|
||||
print "<br>\n";
|
||||
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("ExpenseReports"), '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("ExpenseReportsVentilation").'</strong>')."<br>\n";
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("ExpenseReports"), '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("ExpenseReportsVentilation").'</strong>')."\n";
|
||||
print "<br>\n";
|
||||
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescWriteRecords", chr(64+$step), $langs->transnoentitiesnoconv("Journalization"), $langs->transnoentitiesnoconv("WriteBookKeeping"))."<br>\n";
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescWriteRecords", chr(64+$step), $langs->transnoentitiesnoconv("Journalization"), $langs->transnoentitiesnoconv("WriteBookKeeping"))."\n";
|
||||
print "<br>\n";
|
||||
|
||||
$step++;
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ if ($id > 0)
|
|||
// Define variables to know what current user can do on properties of user linked to edited member
|
||||
if ($object->user_id)
|
||||
{
|
||||
// $ User is the user who edits, $ object->user_id is the id of the related user in the edited member
|
||||
// $ User is the user who edits, $ object->user_id is the id of the related user in the edited member
|
||||
$caneditfielduser=((($user->id == $object->user_id) && $user->rights->user->self->creer)
|
||||
|| (($user->id != $object->user_id) && $user->rights->user->user->creer));
|
||||
$caneditpassworduser=((($user->id == $object->user_id) && $user->rights->user->self->password)
|
||||
|
|
@ -213,7 +213,7 @@ if (empty($reshook))
|
|||
{
|
||||
if ($result > 0)
|
||||
{
|
||||
// User creation
|
||||
// User creation
|
||||
$company = new Societe($db);
|
||||
$result=$company->create_from_member($object,GETPOST('companyname'));
|
||||
|
||||
|
|
@ -714,7 +714,7 @@ if (empty($reshook))
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Actions to build doc
|
||||
$upload_dir = $conf->adherent->dir_output;
|
||||
$permissioncreate=$user->rights->adherent->creer;
|
||||
|
|
@ -834,7 +834,7 @@ else
|
|||
print '<input size="30" maxsize="32" type="text" name="password" value="'.$generated_password.'">';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
// Type
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("MemberType").'</td><td>';
|
||||
$listetype=$adht->liste_array();
|
||||
|
|
@ -948,20 +948,6 @@ else
|
|||
print $object->showOptionals($extrafields,'edit');
|
||||
}
|
||||
|
||||
/*
|
||||
// Third party Dolibarr
|
||||
if (! empty($conf->societe->enabled))
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("LinkedToDolibarrThirdParty").'</td><td class="valeur">';
|
||||
print $form->select_company($object->fk_soc,'socid','',1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Login Dolibarr
|
||||
print '<tr><td>'.$langs->trans("LinkedToDolibarrUser").'</td><td class="valeur">';
|
||||
print $form->select_dolusers($object->user_id, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
|
||||
print '</td></tr>';
|
||||
*/
|
||||
print '<tbody>';
|
||||
print "</table>\n";
|
||||
|
||||
|
|
@ -1061,12 +1047,12 @@ else
|
|||
print '<table class="border" width="100%">';
|
||||
|
||||
// Ref
|
||||
print '<tr><td class="titlefieldcreate">'.$langs->trans("Ref").'</td><td class="valeur" colspan="2">'.$object->id.'</td></tr>';
|
||||
print '<tr><td class="titlefieldcreate">'.$langs->trans("Ref").'</td><td class="valeur">'.$object->id.'</td></tr>';
|
||||
|
||||
// Login
|
||||
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
|
||||
{
|
||||
print '<tr><td><span class="fieldrequired">'.$langs->trans("Login").' / '.$langs->trans("Id").'</span></td><td colspan="2"><input type="text" name="login" class="maxwidth200" value="'.(isset($_POST["login"])?GETPOST("login",'alpha',2):$object->login).'"></td></tr>';
|
||||
print '<tr><td><span class="fieldrequired">'.$langs->trans("Login").' / '.$langs->trans("Id").'</span></td><td><input type="text" name="login" class="maxwidth200" value="'.(isset($_POST["login"])?GETPOST("login",'alpha',2):$object->login).'"></td></tr>';
|
||||
}
|
||||
|
||||
// Password
|
||||
|
|
@ -1095,7 +1081,7 @@ else
|
|||
print "</td></tr>";
|
||||
|
||||
// Company
|
||||
print '<tr><td id="tdcompany">'.$langs->trans("Company").'</td><td><input type="text" name="societe" size="40" value="'.(isset($_POST["societe"])?GETPOST("societe",'',2):$object->societe).'"></td></tr>';
|
||||
print '<tr><td id="tdcompany">'.$langs->trans("Company").'</td><td><input type="text" name="societe" class="minwidth100" value="'.(isset($_POST["societe"])?GETPOST("societe",'',2):$object->societe).'"></td></tr>';
|
||||
|
||||
// Civility
|
||||
print '<tr><td>'.$langs->trans("UserTitle").'</td><td>';
|
||||
|
|
@ -1104,11 +1090,11 @@ else
|
|||
print '</tr>';
|
||||
|
||||
// Lastname
|
||||
print '<tr><td id="tdlastname">'.$langs->trans("Lastname").'</td><td><input type="text" name="lastname" size="40" value="'.(isset($_POST["lastname"])?GETPOST("lastname",'',2):$object->lastname).'"></td>';
|
||||
print '<tr><td id="tdlastname">'.$langs->trans("Lastname").'</td><td><input type="text" name="lastname" class="minwidth100" value="'.(isset($_POST["lastname"])?GETPOST("lastname",'',2):$object->lastname).'"></td>';
|
||||
print '</tr>';
|
||||
|
||||
// Firstname
|
||||
print '<tr><td id="tdfirstname">'.$langs->trans("Firstname").'</td><td><input type="text" name="firstname" size="40" value="'.(isset($_POST["firstname"])?GETPOST("firstname",'',3):$object->firstname).'"></td>';
|
||||
print '<tr><td id="tdfirstname">'.$langs->trans("Firstname").'</td><td><input type="text" name="firstname" class="minwidth100" value="'.(isset($_POST["firstname"])?GETPOST("firstname",'',3):$object->firstname).'"></td>';
|
||||
print '</tr>';
|
||||
|
||||
// Photo
|
||||
|
|
@ -1131,7 +1117,7 @@ else
|
|||
|
||||
// Address
|
||||
print '<tr><td>'.$langs->trans("Address").'</td><td>';
|
||||
print '<textarea name="address" wrap="soft" class="quatrevingtpercent" rows="2">'.(isset($_POST["address"])?GETPOST("address",'',2):$object->address).'</textarea>';
|
||||
print '<textarea name="address" wrap="soft" class="quatrevingtpercent" rows="'.ROWS_2.'">'.(isset($_POST["address"])?GETPOST("address",'',2):$object->address).'</textarea>';
|
||||
print '</td></tr>';
|
||||
|
||||
// Zip / Town
|
||||
|
|
@ -1143,7 +1129,7 @@ else
|
|||
|
||||
// Country
|
||||
//$object->country_id=$object->country_id?$object->country_id:$mysoc->country_id; // In edit mode we don't force to company country if not defined
|
||||
print '<tr><td width="25%">'.$langs->trans('Country').'</td><td>';
|
||||
print '<tr><td>'.$langs->trans('Country').'</td><td>';
|
||||
print $form->select_country(isset($_POST["country_id"])?$_POST["country_id"]:$object->country_id,'country_id');
|
||||
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
|
||||
print '</td></tr>';
|
||||
|
|
@ -1168,7 +1154,7 @@ else
|
|||
// Skype
|
||||
if (! empty($conf->skype->enabled))
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("Skype").'</td><td><input type="text" name="skype" size="40" value="'.(isset($_POST["skype"])?GETPOST("skype"):$object->skype).'"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Skype").'</td><td><input type="text" name="skype" class="minwidth100" value="'.(isset($_POST["skype"])?GETPOST("skype"):$object->skype).'"></td></tr>';
|
||||
}
|
||||
|
||||
// Birthday
|
||||
|
|
@ -1185,7 +1171,7 @@ else
|
|||
if (! empty( $conf->categorie->enabled ) && !empty( $user->rights->categorie->lire ))
|
||||
{
|
||||
print '<tr><td>' . fieldLabel('Categories', 'memcats') . '</td>';
|
||||
print '<td colspan="2">';
|
||||
print '<td>';
|
||||
$cate_arbo = $form->select_all_categories(Categorie::TYPE_MEMBER, null, null, null, null, 1);
|
||||
$c = new Categorie($db);
|
||||
$cats = $c->containing($object->id, Categorie::TYPE_MEMBER);
|
||||
|
|
@ -1197,7 +1183,7 @@ else
|
|||
}
|
||||
|
||||
// Other attributes
|
||||
$parameters=array("colspan"=>2);
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook) && ! empty($extrafields->attribute_label))
|
||||
{
|
||||
|
|
@ -1416,12 +1402,12 @@ else
|
|||
if (! empty($conf->societe->enabled)) $rowspan++;
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/list.php">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
|
||||
dol_banner_tab($object, 'rowid', $linkback);
|
||||
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="fichehalfleft">';
|
||||
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
|
|
@ -1463,15 +1449,15 @@ else
|
|||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
||||
print '</div>';
|
||||
print '<div class="fichehalfright"><div class="ficheaddleft">';
|
||||
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border tableforfield" width="100%">';
|
||||
|
||||
|
||||
// Birthday
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Birthday").'</td><td class="valeur">'.dol_print_date($object->birth,'day').'</td></tr>';
|
||||
|
||||
|
|
@ -1487,13 +1473,8 @@ else
|
|||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Other attributes
|
||||
$parameters=array('colspan'=>2);
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook) && ! empty($extrafields->attribute_label))
|
||||
{
|
||||
print $object->showOptionals($extrafields, 'view', $parameters);
|
||||
}
|
||||
// Other attributes
|
||||
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
|
||||
|
||||
// Date end subscription
|
||||
print '<tr><td>'.$langs->trans("SubscriptionEndDate").'</td><td class="valeur">';
|
||||
|
|
@ -1518,7 +1499,7 @@ else
|
|||
}
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
// Third party Dolibarr
|
||||
if (! empty($conf->societe->enabled))
|
||||
{
|
||||
|
|
@ -1595,12 +1576,12 @@ else
|
|||
print '<div style="clear:both"></div>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Hotbar
|
||||
*/
|
||||
|
||||
|
||||
print '<div class="tabsAction">';
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
|
||||
|
|
@ -1616,7 +1597,7 @@ else
|
|||
{
|
||||
print '<div class="inline-block divButAction"><font class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Modify").'</font></div>';
|
||||
}
|
||||
|
||||
|
||||
// Validate
|
||||
if ($object->statut == -1)
|
||||
{
|
||||
|
|
@ -1629,7 +1610,7 @@ else
|
|||
print '<div class="inline-block divButAction"><font class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Validate").'</font></div>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Reactivate
|
||||
if ($object->statut == 0)
|
||||
{
|
||||
|
|
@ -1642,7 +1623,7 @@ else
|
|||
print '<div class="inline-block divButAction"><font class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Reenable")."</font></div>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Send card by email
|
||||
if ($user->rights->adherent->creer)
|
||||
{
|
||||
|
|
@ -1660,7 +1641,7 @@ else
|
|||
{
|
||||
print '<div class="inline-block divButAction"><font class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("SendCardByMail")."</font></div>";
|
||||
}
|
||||
|
||||
|
||||
// Terminate
|
||||
if ($object->statut >= 1)
|
||||
{
|
||||
|
|
@ -1673,7 +1654,7 @@ else
|
|||
print '<div class="inline-block divButAction"><font class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Resiliate")."</font></div>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Create third party
|
||||
if (! empty($conf->societe->enabled) && ! $object->fk_soc)
|
||||
{
|
||||
|
|
@ -1687,7 +1668,7 @@ else
|
|||
print '<div class="inline-block divButAction"><font class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("CreateDolibarrThirdParty")."</font></div>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Create user
|
||||
if (! $user->societe_id && ! $object->user_id)
|
||||
{
|
||||
|
|
@ -1701,7 +1682,7 @@ else
|
|||
print '<div class="inline-block divButAction"><font class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("CreateDolibarrLogin")."</font></div>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Delete
|
||||
if ($user->rights->adherent->supprimer)
|
||||
{
|
||||
|
|
@ -1711,12 +1692,12 @@ else
|
|||
{
|
||||
print '<div class="inline-block divButAction"><font class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Delete")."</font></div>";
|
||||
}
|
||||
|
||||
|
||||
// Action SPIP
|
||||
if (! empty($conf->mailmanspip->enabled) && ! empty($conf->global->ADHERENT_USE_SPIP))
|
||||
{
|
||||
$isinspip = $mailmanspip->is_in_spip($object);
|
||||
|
||||
|
||||
if ($isinspip == 1)
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?rowid='.$object->id.'&action=del_spip">'.$langs->trans("DeleteIntoSpip")."</a></div>\n";
|
||||
|
|
@ -1726,7 +1707,7 @@ else
|
|||
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?rowid='.$object->id.'&action=add_spip">'.$langs->trans("AddIntoSpip")."</a></div>\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
print '</div>';
|
||||
|
|
@ -1736,11 +1717,11 @@ else
|
|||
print '<br><br><font class="error">'.$langs->trans('SPIPConnectionFailed').': '.$mailmanspip->error.'</font>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
print '<div class="fichecenter"><div class="fichehalfleft">';
|
||||
print '<a name="builddoc"></a>'; // ancre
|
||||
|
||||
|
||||
// Documents generes
|
||||
$filename = dol_sanitizeFileName($object->ref);
|
||||
//$filename = 'tmp_cards.php';
|
||||
|
|
@ -1752,15 +1733,15 @@ else
|
|||
|
||||
print $formfile->showdocuments('member', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $object->default_lang, '', $object);
|
||||
$somethingshown = $formfile->numoffiles;
|
||||
|
||||
|
||||
// Show links to link elements
|
||||
//$linktoelem = $form->showLinkToObjectBlock($object, null, array('subscription'));
|
||||
//$somethingshown = $form->showLinkedObjectBlock($object, '');
|
||||
|
||||
|
||||
// Show links to link elements
|
||||
/*$linktoelem = $form->showLinkToObjectBlock($object,array('order'));
|
||||
if ($linktoelem) print ($somethingshown?'':'<br>').$linktoelem;
|
||||
|
||||
|
||||
// Link for paypal payment
|
||||
/*
|
||||
if (! empty($conf->paypal->enabled) && $object->statut != 0) {
|
||||
|
|
@ -1769,15 +1750,15 @@ else
|
|||
}
|
||||
*/
|
||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||
|
||||
|
||||
// List of actions on element
|
||||
/* Already in tab Agenda/Events
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
|
||||
$formactions = new FormActions($db);
|
||||
$somethingshown = $formactions->showactions($object, 'member', $socid);
|
||||
*/
|
||||
print '</div></div></div>';
|
||||
|
||||
print '</div></div></div>';
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -389,7 +389,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
|||
{
|
||||
$invoice->linked_objects = array_merge($invoice->linked_objects, $_POST['other_linked_objects']);
|
||||
}
|
||||
|
||||
|
||||
$result=$invoice->create($user);
|
||||
if ($result <= 0)
|
||||
{
|
||||
|
|
@ -581,12 +581,12 @@ if ($rowid > 0)
|
|||
dol_fiche_head($head, 'subscription', $langs->trans("Member"), -1, 'user');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/list.php">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
|
||||
dol_banner_tab($object, 'rowid', $linkback);
|
||||
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="fichehalfleft">';
|
||||
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
|
|
@ -624,13 +624,13 @@ if ($rowid > 0)
|
|||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
||||
print '</div>';
|
||||
print '<div class="fichehalfright"><div class="ficheaddleft">';
|
||||
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border tableforfield" width="100%">';
|
||||
|
||||
|
||||
// Birthday
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Birthday").'</td><td class="valeur">'.dol_print_date($object->birth,'day').'</td></tr>';
|
||||
|
||||
|
|
@ -646,13 +646,9 @@ if ($rowid > 0)
|
|||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Other attributes
|
||||
$parameters=array('colspan'=>2);
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook) && ! empty($extrafields->attribute_label))
|
||||
{
|
||||
print $object->showOptionals($extrafields, 'view', $parameters);
|
||||
}
|
||||
// Other attributes
|
||||
$cols=2;
|
||||
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
|
||||
|
||||
// Date end subscription
|
||||
print '<tr><td>'.$langs->trans("SubscriptionEndDate").'</td><td class="valeur">';
|
||||
|
|
@ -677,7 +673,7 @@ if ($rowid > 0)
|
|||
}
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
// Third party Dolibarr
|
||||
if (! empty($conf->societe->enabled))
|
||||
{
|
||||
|
|
@ -752,7 +748,7 @@ if ($rowid > 0)
|
|||
|
||||
print "</div></div></div>\n";
|
||||
print '<div style="clear:both"></div>';
|
||||
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print '</form>';
|
||||
|
|
|
|||
|
|
@ -336,14 +336,8 @@ if ($rowid > 0)
|
|||
print '<tr><td class="tdtop">'.$langs->trans("WelcomeEMail").'</td><td>';
|
||||
print nl2br($object->mail_valid)."</td></tr>";
|
||||
|
||||
// Other attributes
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$act,$action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook) && ! empty($extrafields->attribute_label))
|
||||
{
|
||||
// View extrafields
|
||||
print $object->showOptionals($extrafields);
|
||||
}
|
||||
// Other attributes
|
||||
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
|
@ -674,6 +668,10 @@ if ($rowid > 0)
|
|||
// Other attributes
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$act,$action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook) && ! empty($extrafields->attribute_label))
|
||||
{
|
||||
print $object->showOptionals($extrafields,'edit');
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
|
|
|||
|
|
@ -569,8 +569,8 @@ if ($id == 10)
|
|||
|
||||
if (GETPOST('button_removefilter') || GETPOST('button_removefilter.x') || GETPOST('button_removefilter_x'))
|
||||
{
|
||||
$search_country_id = '';
|
||||
$search_code = '';
|
||||
$search_country_id = '';
|
||||
$search_code = '';
|
||||
}
|
||||
|
||||
// Actions add or modify an entry into a dictionary
|
||||
|
|
@ -660,11 +660,11 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
|||
if ($_POST["accountancy_code"] <= 0) $_POST["accountancy_code"]=''; // If empty, we force to null
|
||||
if ($_POST["accountancy_code_sell"] <= 0) $_POST["accountancy_code_sell"]=''; // If empty, we force to null
|
||||
if ($_POST["accountancy_code_buy"] <= 0) $_POST["accountancy_code_buy"]=''; // If empty, we force to null
|
||||
if ($id == 10 && isset($_POST["code"])) // Spaces are not allowed into code
|
||||
if ($id == 10 && isset($_POST["code"])) // Spaces are not allowed into code
|
||||
{
|
||||
$_POST["code"]=preg_replace('/\s/','',$_POST["code"]);
|
||||
}
|
||||
|
||||
|
||||
// Si verif ok et action add, on ajoute la ligne
|
||||
if ($ok && GETPOST('actionadd'))
|
||||
{
|
||||
|
|
@ -945,7 +945,7 @@ if ($id)
|
|||
if (! preg_match('/ WHERE /',$sql)) $sql.= " WHERE 1 = 1";
|
||||
if ($search_country_id > 0) $sql.= " AND c.rowid = ".$search_country_id;
|
||||
if ($search_code != '') $sql.= natural_search("code", $search_code);
|
||||
|
||||
|
||||
if ($sortfield)
|
||||
{
|
||||
// If sort order is "country", we use country_code instead
|
||||
|
|
@ -972,16 +972,16 @@ if ($id)
|
|||
print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$id.'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="from" value="'.dol_escape_htmltag(GETPOST('from','alpha')).'">';
|
||||
|
||||
|
||||
// Form to add a new line
|
||||
if ($tabname[$id])
|
||||
{
|
||||
$alabelisused=0;
|
||||
|
||||
|
||||
$fieldlist=explode(',',$tabfield[$id]);
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
|
||||
// Line for title
|
||||
print '<tr class="liste_titre">';
|
||||
foreach ($fieldlist as $field => $value)
|
||||
|
|
@ -1012,9 +1012,9 @@ if ($id)
|
|||
if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label')
|
||||
{
|
||||
if ($id != 25) $valuetoshow=$form->textwithtooltip($langs->trans("Label"), $langs->trans("LabelUsedByDefault"),2,1,img_help(1,''));
|
||||
else $valuetoshow=$langs->trans("Label");
|
||||
else $valuetoshow=$langs->trans("Label");
|
||||
}
|
||||
if ($fieldlist[$field]=='libelle_facture') {
|
||||
if ($fieldlist[$field]=='libelle_facture') {
|
||||
$valuetoshow=$form->textwithtooltip($langs->trans("LabelOnDocuments"), $langs->trans("LabelUsedByDefault"),2,1,img_help(1,''));
|
||||
}
|
||||
if ($fieldlist[$field]=='country') {
|
||||
|
|
@ -1055,7 +1055,7 @@ if ($id)
|
|||
if ($fieldlist[$field]=='affect') { $valuetoshow=$langs->trans("WithCounter"); }
|
||||
if ($fieldlist[$field]=='delay') { $valuetoshow=$langs->trans("NoticePeriod"); }
|
||||
if ($fieldlist[$field]=='newbymonth') { $valuetoshow=$langs->trans("NewByMonth"); }
|
||||
|
||||
|
||||
if ($id == 2) // Special cas for state page
|
||||
{
|
||||
if ($fieldlist[$field]=='region_id') { $valuetoshow=' '; $showfield=1; }
|
||||
|
|
@ -1120,7 +1120,7 @@ if ($id)
|
|||
if ($id == 4) $colspan++;
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
||||
/*if (! empty($alabelisused) && $id != 25) // If there is one label among fields, we show legend of *
|
||||
{
|
||||
print '* '.$langs->trans("LabelUsedByDefault").'.<br>';
|
||||
|
|
@ -1130,11 +1130,11 @@ if ($id)
|
|||
print '</form>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
|
||||
print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$id.'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="from" value="'.dol_escape_htmltag(GETPOST('from','alpha')).'">';
|
||||
|
||||
|
||||
// List of available record in database
|
||||
dol_syslog("htdocs/admin/dict", LOG_DEBUG);
|
||||
$resql=$db->query($sql);
|
||||
|
|
@ -1150,29 +1150,29 @@ if ($id)
|
|||
}
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
|
||||
// Title line with search boxes
|
||||
print '<tr class="liste_titre_filter">';
|
||||
$filterfound=0;
|
||||
foreach ($fieldlist as $field => $value)
|
||||
{
|
||||
$showfield=1; // By defaut
|
||||
|
||||
|
||||
if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='country_id') { $showfield=0; }
|
||||
|
||||
|
||||
if ($showfield)
|
||||
{
|
||||
if ($value == 'country')
|
||||
{
|
||||
print '<td class="liste_titre">';
|
||||
print $form->select_country($search_country_id, 'search_country_id', '', 28, 'maxwidth200 maxwidthonsmartphone');
|
||||
print $form->select_country($search_country_id, 'search_country_id', '', 28, 'maxwidth150 maxwidthonsmartphone');
|
||||
print '</td>';
|
||||
$filterfound++;
|
||||
}
|
||||
elseif ($value == 'code')
|
||||
{
|
||||
print '<td class="liste_titre">';
|
||||
print '<input type="text" name="search_code" value="'.dol_escape_htmltag($search_code).'">';
|
||||
print '<input type="text" class="maxwidth100" name="search_code" value="'.dol_escape_htmltag($search_code).'">';
|
||||
print '</td>';
|
||||
$filterfound++;
|
||||
}
|
||||
|
|
@ -1193,7 +1193,7 @@ if ($id)
|
|||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
// Title of lines
|
||||
print '<tr class="liste_titre">';
|
||||
foreach ($fieldlist as $field => $value)
|
||||
|
|
@ -1235,7 +1235,7 @@ if ($id)
|
|||
//else $valuetoshow=$langs->trans("Label");
|
||||
$valuetoshow=$langs->trans("Label");
|
||||
}
|
||||
if ($fieldlist[$field]=='libelle_facture') {
|
||||
if ($fieldlist[$field]=='libelle_facture') {
|
||||
//$valuetoshow=$form->textwithtooltip($langs->trans("LabelOnDocuments"), $langs->trans("LabelUsedByDefault"),2,1,img_help(1,''));
|
||||
$valuetoshow=$langs->trans("LabelOnDocuments");
|
||||
}
|
||||
|
|
@ -1368,7 +1368,7 @@ if ($id)
|
|||
if ($value == 'private')
|
||||
{
|
||||
$valuetoshow = yn($elementList[$valuetoshow]);
|
||||
}
|
||||
}
|
||||
else if ($fieldlist[$field]=='libelle_facture') {
|
||||
$langs->load("bills");
|
||||
$key=$langs->trans("PaymentCondition".strtoupper($obj->code));
|
||||
|
|
@ -1516,7 +1516,7 @@ if ($id)
|
|||
if ($obj->code == 'RECEP') $canbemodified=1;
|
||||
if ($tabname[$id] == MAIN_DB_PREFIX."c_actioncomm") $canbemodified=1;
|
||||
|
||||
// Url
|
||||
// Url
|
||||
$rowidcol=$tabrowid[$id];
|
||||
// If rowidcol not defined
|
||||
if (empty($rowidcol) || in_array($id, array(6,7,8,13,17,19,27))) $rowidcol='rowid';
|
||||
|
|
@ -1565,7 +1565,7 @@ if ($id)
|
|||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
print '</table>';
|
||||
}
|
||||
else {
|
||||
|
|
@ -1598,12 +1598,12 @@ else
|
|||
{
|
||||
if ($showemptyline)
|
||||
{
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td width="30%"> </td><td> </td><td> </td></tr>';
|
||||
$showemptyline=0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
$value=$tabname[$i];
|
||||
print '<tr class="oddeven"><td width="50%">';
|
||||
if (! empty($tabcond[$i]))
|
||||
|
|
@ -1764,7 +1764,7 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='')
|
|||
print '<td>';
|
||||
$transfound=0;
|
||||
// Special case for labels
|
||||
if ($tabname == MAIN_DB_PREFIX.'c_payment_term')
|
||||
if ($tabname == MAIN_DB_PREFIX.'c_payment_term')
|
||||
{
|
||||
$langs->load("bills");
|
||||
$transkey="PaymentCondition".strtoupper($obj->code);
|
||||
|
|
|
|||
|
|
@ -173,6 +173,7 @@ print '<tr><td>'.$langs->trans("In").'</td><td>';
|
|||
print $form->select_all_categories($type,$object->fk_parent,'parent',64,$object->id);
|
||||
print '</td></tr>';
|
||||
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook) && ! empty($extrafields->attribute_label))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -235,11 +235,8 @@ print $langs->trans("Color").'</td><td>';
|
|||
print $formother->showColor($object->color);
|
||||
print '</td></tr>';
|
||||
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook) && ! empty($extrafields->attribute_label))
|
||||
{
|
||||
print $object->showOptionals($extrafields);
|
||||
}
|
||||
// Other attributes
|
||||
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
|
@ -290,7 +287,7 @@ else
|
|||
if (count($cats) > 0)
|
||||
{
|
||||
foreach ($cats as $cat)
|
||||
{
|
||||
{
|
||||
print "\t".'<tr class="oddeven">'."\n";
|
||||
print "\t\t".'<td class="nowrap">';
|
||||
print "<a href='viewcat.php?id=".$cat->id."&type=".$type."'>".$cat->label."</a>";
|
||||
|
|
@ -359,7 +356,7 @@ if ($object->type == Categorie::TYPE_PRODUCT)
|
|||
if (count($prods) > 0)
|
||||
{
|
||||
foreach ($prods as $prod)
|
||||
{
|
||||
{
|
||||
print "\t".'<tr class="oddeven">'."\n";
|
||||
print '<td class="nowrap" valign="top">';
|
||||
print $prod->getNomUrl(1);
|
||||
|
|
@ -408,7 +405,7 @@ if ($object->type == Categorie::TYPE_SUPPLIER)
|
|||
if (count($socs) > 0)
|
||||
{
|
||||
foreach ($socs as $soc)
|
||||
{
|
||||
{
|
||||
print "\t".'<tr class="oddeven">'."\n";
|
||||
print '<td class="nowrap" valign="top">';
|
||||
print $soc->getNomUrl(1);
|
||||
|
|
@ -462,7 +459,7 @@ if($object->type == Categorie::TYPE_CUSTOMER)
|
|||
if ($user->societe_id > 0 && $soc->id != $user->societe_id) continue; // External user always see only themself
|
||||
|
||||
$i++;
|
||||
|
||||
|
||||
print "\t".'<tr class="oddeven">'."\n";
|
||||
print '<td class="nowrap" valign="top">';
|
||||
print $soc->getNomUrl(1);
|
||||
|
|
@ -513,7 +510,7 @@ if ($object->type == Categorie::TYPE_MEMBER)
|
|||
if (count($prods) > 0)
|
||||
{
|
||||
foreach ($prods as $key => $member)
|
||||
{
|
||||
{
|
||||
print "\t".'<tr class="oddeven">'."\n";
|
||||
print '<td class="nowrap" valign="top">';
|
||||
$member->ref=$member->login;
|
||||
|
|
@ -567,7 +564,7 @@ if($object->type == Categorie::TYPE_CONTACT)
|
|||
foreach ($contacts as $key => $contact)
|
||||
{
|
||||
$i++;
|
||||
|
||||
|
||||
print "\t".'<tr class="oddeven">'."\n";
|
||||
print '<td class="nowrap" valign="top">';
|
||||
print $contact->getNomUrl(1,'category');
|
||||
|
|
@ -619,7 +616,7 @@ if ($object->type == Categorie::TYPE_ACCOUNT)
|
|||
if (count($accounts) > 0)
|
||||
{
|
||||
foreach ($accounts as $key => $account)
|
||||
{
|
||||
{
|
||||
print "\t".'<tr class="oddeven">'."\n";
|
||||
print '<td class="nowrap" valign="top">';
|
||||
print $account->getNomUrl(1,0);
|
||||
|
|
@ -672,7 +669,7 @@ if ($object->type == Categorie::TYPE_PROJECT)
|
|||
if (count($projects) > 0)
|
||||
{
|
||||
foreach ($projects as $key => $project)
|
||||
{
|
||||
{
|
||||
print "\t".'<tr class="oddeven">'."\n";
|
||||
print '<td class="nowrap" valign="top">';
|
||||
print $project->getNomUrl(1,0);
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ if (GETPOST('removedassigned') || GETPOST('removedassigned') == '0')
|
|||
$donotclearsession=1;
|
||||
if ($action == 'add') $action = 'create';
|
||||
if ($action == 'update') $action = 'edit';
|
||||
|
||||
|
||||
$listUserAssignedUpdated = true;
|
||||
}
|
||||
|
||||
|
|
@ -734,7 +734,7 @@ if ($action == 'create')
|
|||
print '<div class="assignedtouser">';
|
||||
print $form->select_dolusers_forevent(($action=='create'?'add':'update'), 'assignedtouser', 1, '', 0, '', '', 0, 0, 0, 'AND u.statut != 0');
|
||||
print '</div>';
|
||||
if (in_array($user->id,array_keys($listofuserid)))
|
||||
if (in_array($user->id,array_keys($listofuserid)))
|
||||
{
|
||||
print '<div class="myavailability">';
|
||||
print $langs->trans("MyAvailability").': <input id="transparency" type="checkbox" name="transparency"'.(((! isset($_GET['transparency']) && ! isset($_POST['transparency'])) || GETPOST('transparency'))?' checked':'').'> '.$langs->trans("Busy");
|
||||
|
|
@ -752,8 +752,8 @@ if ($action == 'create')
|
|||
|
||||
print '</table>';
|
||||
print '<br><br>';
|
||||
|
||||
|
||||
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Related company
|
||||
|
|
@ -830,12 +830,9 @@ if ($action == 'create')
|
|||
$doleditor->Create();
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
// Other attributes
|
||||
$parameters=array('id'=>$object->id);
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
|
||||
|
||||
if (empty($reshook) && ! empty($extrafields->attribute_label))
|
||||
{
|
||||
print $object->showOptionals($extrafields,'edit');
|
||||
|
|
@ -863,11 +860,11 @@ if ($id > 0)
|
|||
$result3=$object->fetch_contact();
|
||||
$result4=$object->fetch_userassigned();
|
||||
$result5=$object->fetch_optionals($id,$extralabels);
|
||||
|
||||
if ($listUserAssignedUpdated || $donotclearsession)
|
||||
|
||||
if ($listUserAssignedUpdated || $donotclearsession)
|
||||
{
|
||||
$percentage=in_array(GETPOST('status'),array(-1,100))?GETPOST('status'):(in_array(GETPOST('complete'),array(-1,100))?GETPOST('complete'):GETPOST("percentage")); // If status is -1 or 100, percentage is not defined and we must use status
|
||||
|
||||
|
||||
$datep=dol_mktime($fulldayevent?'00':$aphour, $fulldayevent?'00':$apmin, 0, $_POST["apmonth"], $_POST["apday"], $_POST["apyear"]);
|
||||
$datef=dol_mktime($fulldayevent?'23':$p2hour, $fulldayevent?'59':$p2min, $fulldayevent?'59':'0', $_POST["p2month"], $_POST["p2day"], $_POST["p2year"]);
|
||||
|
||||
|
|
@ -884,7 +881,7 @@ if ($id > 0)
|
|||
//$object->societe->id = $_POST["socid"]; // deprecated
|
||||
//$object->contact->id = $_POST["contactid"]; // deprecated
|
||||
$object->fk_project = GETPOST("projectid",'int');
|
||||
|
||||
|
||||
$object->note = GETPOST("note");
|
||||
}
|
||||
|
||||
|
|
@ -1076,11 +1073,11 @@ if ($id > 0)
|
|||
$listofuserid=json_decode($_SESSION['assignedtouser'], true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
print '<div class="assignedtouser">';
|
||||
print $form->select_dolusers_forevent(($action=='create'?'add':'update'), 'assignedtouser', 1, '', 0, '', '', 0, 0, 0, 'AND u.statut != 0');
|
||||
print '</div>';
|
||||
if (in_array($user->id,array_keys($listofuserid)))
|
||||
if (in_array($user->id,array_keys($listofuserid)))
|
||||
{
|
||||
print '<div class="myavailability">';
|
||||
print $langs->trans("MyAvailability").': <input id="transparency" type="checkbox" name="transparency"'.($listofuserid[$user->id]['transparency']?' checked':'').'>'.$langs->trans("Busy");
|
||||
|
|
@ -1098,10 +1095,10 @@ if ($id > 0)
|
|||
|
||||
print '</table>';
|
||||
|
||||
|
||||
|
||||
print '<br><br>';
|
||||
|
||||
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
if ($conf->societe->enabled)
|
||||
|
|
@ -1165,7 +1162,7 @@ if ($id > 0)
|
|||
print '</td></tr>';
|
||||
|
||||
// Other attributes
|
||||
$parameters=array('id'=>$object->id);
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook) && ! empty($extrafields->attribute_label))
|
||||
{
|
||||
|
|
@ -1212,8 +1209,8 @@ if ($id > 0)
|
|||
$out.=img_picto($langs->trans("ViewDay"),'object_calendarday','class="hideonsmartphone pictoactionview"');
|
||||
$out.='<a href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_day&year='.dol_print_date($object->datep,'%Y').'&month='.dol_print_date($object->datep,'%m').'&day='.dol_print_date($object->datep,'%d').'">'.$langs->trans("ViewDay").'</a>';
|
||||
$linkback.=$out;
|
||||
|
||||
|
||||
|
||||
|
||||
$morehtmlref='<div class="refidno">';
|
||||
// Thirdparty
|
||||
//$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
|
||||
|
|
@ -1253,14 +1250,14 @@ if ($id > 0)
|
|||
}
|
||||
}
|
||||
$morehtmlref.='</div>';
|
||||
|
||||
|
||||
|
||||
|
||||
dol_banner_tab($object, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', $morehtmlref);
|
||||
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
|
||||
// Affichage fiche action en mode visu
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
|
|
@ -1324,7 +1321,7 @@ if ($id > 0)
|
|||
print '<div class="assignedtouser">';
|
||||
print $form->select_dolusers_forevent('view', 'assignedtouser', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
|
||||
print '</div>';
|
||||
if ($object->datep != $object->datef && in_array($user->id,array_keys($listofuserid)))
|
||||
if ($object->datep != $object->datef && in_array($user->id,array_keys($listofuserid)))
|
||||
{
|
||||
print '<div class="myavailability">';
|
||||
print $langs->trans("MyAvailability").': '.(($object->userassigned[$user->id]['transparency'] > 0)?$langs->trans("Busy"):$langs->trans("Available")); // We show nothing if event is assigned to nobody
|
||||
|
|
@ -1364,7 +1361,7 @@ if ($id > 0)
|
|||
}
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
// Related contact
|
||||
print '<tr><td>'.$langs->trans("ActionOnContact").'</td>';
|
||||
print '<td colspan="3">';
|
||||
|
|
@ -1385,7 +1382,7 @@ if ($id > 0)
|
|||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
// Priority
|
||||
print '<tr><td class="nowrap" class="titlefield">'.$langs->trans("Priority").'</td><td colspan="3">';
|
||||
print ($object->priority?$object->priority:'');
|
||||
|
|
@ -1409,38 +1406,13 @@ if ($id > 0)
|
|||
print '</td></tr>';
|
||||
|
||||
// Other attributes
|
||||
$parameters=array('colspan'=>' colspan="3"', 'colspanvalue'=>'3', 'id'=>$object->id);
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
$cols=3;
|
||||
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
|
||||
|
||||
print '</table>';
|
||||
|
||||
//Extra field
|
||||
if (empty($reshook) && ! empty($extrafields->attribute_label))
|
||||
{
|
||||
print '<br><br>';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border" width="100%">';
|
||||
foreach($extrafields->attribute_label as $key=>$label)
|
||||
{
|
||||
if (isset($_POST["options_" . $key])) {
|
||||
if (is_array($_POST["options_" . $key])) {
|
||||
// $_POST["options"] is an array but following code expects a comma separated string
|
||||
$value = implode(",", $_POST["options_" . $key]);
|
||||
} else {
|
||||
$value = $_POST["options_" . $key];
|
||||
}
|
||||
} else {
|
||||
$value = $object->array_options["options_" . $key];
|
||||
}
|
||||
print '<tr><td class="titlefield">'.$label.'</td><td>';
|
||||
print $extrafields->showOutputField($key,$value);
|
||||
print "</td></tr>\n";
|
||||
}
|
||||
print '</table>';
|
||||
}
|
||||
|
||||
print '</div>';
|
||||
|
||||
|
||||
dol_fiche_end();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ if (empty($reshook))
|
|||
$result=$object->setBankAccount(GETPOST('fk_account','int'));
|
||||
if ($result < 0) setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
|
||||
|
||||
// customer preferred shipping method
|
||||
if ($action == 'setshippingmethod' && $user->rights->societe->creer)
|
||||
{
|
||||
|
|
@ -207,9 +207,9 @@ if ($id > 0)
|
|||
dol_fiche_head($head, 'customer', $langs->trans("ThirdParty"), -1, 'company');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/societe/list.php">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
|
||||
dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom');
|
||||
|
||||
|
||||
print '<div class="fichecenter"><div class="fichehalfleft">';
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
|
@ -376,11 +376,11 @@ if ($id > 0)
|
|||
$limit_field_type = (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE)) ? 'numeric' : 'amount';
|
||||
print $form->editfieldval("OutstandingBill",'outstanding_limit',$object->outstanding_limit,$object,$user->rights->societe->creer,$limit_field_type,($object->outstanding_limit != '' ? price($object->outstanding_limit) : ''));
|
||||
//if (empty($object->outstanding_limit)) print $langs->trans("NoLimit");
|
||||
|
||||
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
|
||||
// Multiprice level
|
||||
if (! empty($conf->global->PRODUIT_MULTIPRICES))
|
||||
{
|
||||
|
|
@ -432,13 +432,8 @@ if ($id > 0)
|
|||
}
|
||||
|
||||
// Other attributes
|
||||
$parameters=array('socid'=>$object->id, 'colspan' => ' colspan="3"', 'colspanvalue' => '3');
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
if (empty($reshook) && ! empty($extrafields->attribute_label))
|
||||
{
|
||||
print $object->showOptionals($extrafields);
|
||||
}
|
||||
$parameters=array('socid'=>$object->id);
|
||||
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
|
||||
|
||||
// Sales representative
|
||||
include DOL_DOCUMENT_ROOT.'/societe/tpl/linesalesrepresentative.tpl.php';
|
||||
|
|
@ -471,10 +466,10 @@ if ($id > 0)
|
|||
if ($object->client == 2 || $object->client == 3)
|
||||
{
|
||||
print '<br>';
|
||||
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
|
||||
// Level of prospect
|
||||
print '<tr><td class="titlefield nowrap">';
|
||||
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
|
||||
|
|
@ -508,12 +503,12 @@ if ($id > 0)
|
|||
print '</div></td></tr>';
|
||||
print "</table>";
|
||||
}
|
||||
|
||||
|
||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||
|
||||
|
||||
$boxstat = '';
|
||||
|
||||
|
||||
// Nbre max d'elements des petites listes
|
||||
$MAXLIST=$conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
|
||||
|
||||
|
|
@ -521,7 +516,7 @@ if ($id > 0)
|
|||
$boxstat.='<div class="box">';
|
||||
$boxstat.='<table summary="'.dol_escape_htmltag($langs->trans("DolibarrStateBoard")).'" class="noborder boxtable boxtablenobottom" width="100%">';
|
||||
$boxstat.='<tr class="impair"><td colspan="2" class="tdboxstats nohover">';
|
||||
|
||||
|
||||
if ($conf->propal->enabled)
|
||||
{
|
||||
// Box proposals
|
||||
|
|
@ -557,14 +552,14 @@ if ($id > 0)
|
|||
$boxstat.='</div>';
|
||||
if ($link) $boxstat.='</a>';
|
||||
}
|
||||
|
||||
|
||||
if ($conf->facture->enabled)
|
||||
{
|
||||
$tmp = $object->getOutstandingBills();
|
||||
$outstandingOpened=$tmp['opened'];
|
||||
$outstandingTotal=$tmp['total_ht'];
|
||||
$outstandingTotalIncTax=$tmp['total_ttc'];
|
||||
|
||||
|
||||
$text=$langs->trans("OverAllInvoices");
|
||||
$link='';
|
||||
$icon='bill';
|
||||
|
|
@ -574,7 +569,7 @@ if ($id > 0)
|
|||
$boxstat.='<span class="boxstatsindicator">'.price($outstandingTotal, 1, $langs, 1, -1, -1, $conf->currency).'</span>';
|
||||
$boxstat.='</div>';
|
||||
if ($link) $boxstat.='</a>';
|
||||
|
||||
|
||||
// Box outstanding bill
|
||||
$warn = '';
|
||||
if ($object->outstanding_limit != '' && $object->outstanding_limit < $outstandingOpened)
|
||||
|
|
@ -591,13 +586,13 @@ if ($id > 0)
|
|||
$boxstat.='</div>';
|
||||
if ($link) $boxstat.='</a>';
|
||||
}
|
||||
|
||||
|
||||
$boxstat.='</td></tr>';
|
||||
$boxstat.='</table>';
|
||||
$boxstat.='</div>';
|
||||
|
||||
|
||||
print $boxstat;
|
||||
|
||||
|
||||
$now=dol_now();
|
||||
|
||||
/*
|
||||
|
|
@ -639,7 +634,7 @@ if ($id > 0)
|
|||
while ($i < $num && $i < $MAXLIST)
|
||||
{
|
||||
$objp = $db->fetch_object($resql);
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="nowrap">';
|
||||
$propal_static->id = $objp->propalid;
|
||||
|
|
@ -723,7 +718,7 @@ if ($id > 0)
|
|||
while ($i < $num && $i < $MAXLIST)
|
||||
{
|
||||
$objp = $db->fetch_object($resql);
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="nowrap">';
|
||||
$commande_static->id = $objp->cid;
|
||||
|
|
@ -849,7 +844,7 @@ if ($id > 0)
|
|||
$contrat=new Contrat($db);
|
||||
|
||||
$objp = $db->fetch_object($resql);
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="nowrap">';
|
||||
$contrat->id=$objp->id;
|
||||
|
|
@ -905,7 +900,7 @@ if ($id > 0)
|
|||
print '<td width="20px" align="right"><a href="'.DOL_URL_ROOT.'/fichinter/stats/index.php?socid='.$object->id.'">'.img_picto($langs->trans("Statistics"),'stats').'</a></td>';
|
||||
print '</tr></table></td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
}
|
||||
$i = 0;
|
||||
while ($i < $num && $i < $MAXLIST)
|
||||
|
|
@ -921,7 +916,7 @@ if ($id > 0)
|
|||
print '<td align="right" style="min-width: 60px">'.convertSecondToTime($objp->duration).'</td>'."\n";
|
||||
print '<td align="right" class="nowrap" style="min-width: 60px">'.$fichinter_static->getLibStatut(5).'</td>'."\n";
|
||||
print '</tr>';
|
||||
|
||||
|
||||
$i++;
|
||||
}
|
||||
$db->free($resql);
|
||||
|
|
@ -977,7 +972,7 @@ if ($id > 0)
|
|||
while ($i < $num && $i < $MAXLIST)
|
||||
{
|
||||
$objp = $db->fetch_object($resql);
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="nowrap">';
|
||||
$facturestatic->id = $objp->facid;
|
||||
|
|
@ -1006,7 +1001,7 @@ if ($id > 0)
|
|||
print price($objp->total_ttc);
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
|
||||
print '<td align="right" class="nowrap" style="min-width: 60px">'.($facturestatic->LibStatut($objp->paye,$objp->statut,5,$objp->am)).'</td>';
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
|
|
@ -1042,31 +1037,31 @@ if ($id > 0)
|
|||
{
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused" title="'.dol_escape_js($langs->trans("ThirdPartyIsClosed")).'" href="#">'.$langs->trans("ThirdPartyIsClosed").'</a></div>';
|
||||
}
|
||||
|
||||
|
||||
if (! empty($conf->propal->enabled) && $user->rights->propal->creer && $object->status==1)
|
||||
{
|
||||
$langs->load("propal");
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/comm/propal/card.php?socid='.$object->id.'&action=create">'.$langs->trans("AddProp").'</a></div>';
|
||||
}
|
||||
|
||||
|
||||
if (! empty($conf->commande->enabled) && $user->rights->commande->creer && $object->status==1)
|
||||
{
|
||||
$langs->load("orders");
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/commande/card.php?socid='.$object->id.'&action=create">'.$langs->trans("AddOrder").'</a></div>';
|
||||
}
|
||||
|
||||
|
||||
if ($user->rights->contrat->creer && $object->status==1)
|
||||
{
|
||||
$langs->load("contracts");
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/contrat/card.php?socid='.$object->id.'&action=create">'.$langs->trans("AddContract").'</a></div>';
|
||||
}
|
||||
|
||||
|
||||
if (! empty($conf->ficheinter->enabled) && $user->rights->ficheinter->creer && $object->status==1)
|
||||
{
|
||||
$langs->load("fichinter");
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/fichinter/card.php?socid='.$object->id.'&action=create">'.$langs->trans("AddIntervention").'</a></div>';
|
||||
}
|
||||
|
||||
|
||||
// Add invoice
|
||||
if ($user->societe_id == 0)
|
||||
{
|
||||
|
|
@ -1075,7 +1070,7 @@ if ($id > 0)
|
|||
$langs->load("trips");
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/compta/deplacement/card.php?socid='.$object->id.'&action=create">'.$langs->trans("AddTrip").'</a></div>';
|
||||
}
|
||||
|
||||
|
||||
if (! empty($conf->facture->enabled) && $object->status==1)
|
||||
{
|
||||
if (empty($user->rights->facture->creer))
|
||||
|
|
@ -1086,7 +1081,7 @@ if ($id > 0)
|
|||
{
|
||||
$langs->load("bills");
|
||||
$langs->load("orders");
|
||||
|
||||
|
||||
if (! empty($conf->commande->enabled))
|
||||
{
|
||||
if ($object->client != 0 && $object->client != 2)
|
||||
|
|
@ -1099,11 +1094,11 @@ if ($id > 0)
|
|||
|
||||
if ($object->client != 0 && $object->client != 2) print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture/card.php?action=create&socid='.$object->id.'">'.$langs->trans("AddBill").'</a></div>';
|
||||
else print '<div class="inline-block divButAction"><a class="butActionRefused" title="'.dol_escape_js($langs->trans("ThirdPartyMustBeEditAsCustomer")).'" href="#">'.$langs->trans("AddBill").'</a></div>';
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Add action
|
||||
if (! empty($conf->agenda->enabled) && ! empty($conf->global->MAIN_REPEATTASKONEACHTAB) && $object->status==1)
|
||||
{
|
||||
|
|
@ -1117,7 +1112,7 @@ if ($id > 0)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
print '</div>';
|
||||
|
||||
if (! empty($conf->global->MAIN_REPEATCONTACTONEACHTAB))
|
||||
|
|
|
|||
|
|
@ -767,16 +767,15 @@ if ($object->fetch($id) >= 0) {
|
|||
} else {
|
||||
$std_soc = new Societe($db);
|
||||
$action_search = 'query';
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php';
|
||||
$hookmanager = new HookManager($db);
|
||||
$hookmanager->initHooks(array (
|
||||
'thirdpartycard'
|
||||
));
|
||||
$hookmanager->initHooks(array ('thirdpartycard'));
|
||||
|
||||
$parameters=array();
|
||||
if (! empty($advTarget->id)) {
|
||||
$parameters = array (
|
||||
'array_query' => $advTarget->filtervalue
|
||||
);
|
||||
$parameters = array('array_query' => $advTarget->filtervalue);
|
||||
}
|
||||
// Module extrafield feature
|
||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $std_soc, $action_search);
|
||||
|
|
|
|||
|
|
@ -231,10 +231,10 @@ if (empty($reshook))
|
|||
|
||||
if (empty($conf->global->PAYPAL_SECURITY_TOKEN_UNIQUE)) $substitutionarray['__SECUREKEYPAYPAL_ORDER__']=dol_hash($conf->global->PAYPAL_SECURITY_TOKEN, 2);
|
||||
else $substitutionarray['__SECUREKEYPAYPAL_ORDER__']=dol_hash($conf->global->PAYPAL_SECURITY_TOKEN . 'order' . $obj->source_id, 2);
|
||||
|
||||
|
||||
if (empty($conf->global->PAYPAL_SECURITY_TOKEN_UNIQUE)) $substitutionarray['__SECUREKEYPAYPAL_INVOICE__']=dol_hash($conf->global->PAYPAL_SECURITY_TOKEN, 2);
|
||||
else $substitutionarray['__SECUREKEYPAYPAL_INVOICE__']=dol_hash($conf->global->PAYPAL_SECURITY_TOKEN . 'invoice' . $obj->source_id, 2);
|
||||
|
||||
|
||||
if (empty($conf->global->PAYPAL_SECURITY_TOKEN_UNIQUE)) $substitutionarray['__SECUREKEYPAYPAL_CONTRACTLINE__']=dol_hash($conf->global->PAYPAL_SECURITY_TOKEN, 2);
|
||||
else $substitutionarray['__SECUREKEYPAYPAL_CONTRACTLINE__']=dol_hash($conf->global->PAYPAL_SECURITY_TOKEN . 'contractline' . $obj->source_id, 2);
|
||||
}
|
||||
|
|
@ -700,11 +700,11 @@ if ($action == 'create')
|
|||
}
|
||||
$htmltext.='</i>';
|
||||
|
||||
|
||||
|
||||
$availablelink=$form->textwithpicto($langs->trans("AvailableVariables"), $htmltext, 1, 'help', '', 0, 2, 'availvar');
|
||||
//print '<a href="javascript:document_preview(\''.DOL_URL_ROOT.'/admin/modulehelp.php?id='.$objMod->numero.'\',\'text/html\',\''.dol_escape_js($langs->trans("Module")).'\')">'.img_picto($langs->trans("ClickToShowDescription"), $imginfo).'</a>';
|
||||
|
||||
|
||||
|
||||
|
||||
// Print mail form
|
||||
print load_fiche_titre($langs->trans("NewMailing"), $availablelink, 'title_generic');
|
||||
|
||||
|
|
@ -733,14 +733,14 @@ if ($action == 'create')
|
|||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
||||
print '<div style="padding-top: 10px">';
|
||||
// Editeur wysiwyg
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor=new DolEditor('body',$_POST['body'],'',600,'dolibarr_mailings','',true,true,$conf->global->FCKEDITOR_ENABLE_MAILING,20,'90%');
|
||||
$doleditor->Create();
|
||||
print '</div>';
|
||||
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("CreateMailing").'"></div>';
|
||||
|
|
@ -809,7 +809,7 @@ else
|
|||
{
|
||||
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');
|
||||
|
||||
|
||||
// The feature is forbidden from GUI, we show just message to use from command line.
|
||||
setEventMessages($langs->trans("MailingNeedCommand"), null, 'warnings');
|
||||
setEventMessages('<textarea cols="60" rows="'.ROWS_1.'" wrap="soft">php ./scripts/emailings/mailing-send.php '.$object->id.'</textarea>', null, 'warnings');
|
||||
|
|
@ -823,7 +823,7 @@ else
|
|||
{
|
||||
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');
|
||||
|
||||
|
||||
$text='';
|
||||
if ($conf->global->MAILING_LIMIT_SENDBYCLI >= 0)
|
||||
{
|
||||
|
|
@ -841,12 +841,12 @@ else
|
|||
|
||||
$morehtmlright='';
|
||||
if ($object->statut == 2) $morehtmlright.=' ('.$object->countNbOfTargets('alreadysent').'/'.$object->nbemail.') ';
|
||||
|
||||
|
||||
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '', '', 0, '', $morehtmlright);
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Description
|
||||
|
|
@ -863,7 +863,7 @@ else
|
|||
print '<tr><td>'.$form->editfieldkey("MailErrorsTo",'email_errorsto',$object->email_errorsto,$object,$user->rights->mailing->creer && $object->statut < 3,'string').'</td><td colspan="3">';
|
||||
print $form->editfieldval("MailErrorsTo",'email_errorsto',$object->email_errorsto,$object,$user->rights->mailing->creer && $object->statut < 3,'string');
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
// Nb of distinct emails
|
||||
print '<tr><td>';
|
||||
print $langs->trans("TotalNbOfDistinctRecipients");
|
||||
|
|
@ -895,20 +895,15 @@ else
|
|||
print '</td></tr>';
|
||||
|
||||
// Other attributes
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook) && ! empty($extrafields->attribute_label))
|
||||
{
|
||||
print $object->showOptionals($extrafields);
|
||||
}
|
||||
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
|
||||
|
||||
print '</table>';
|
||||
|
||||
print "</div>";
|
||||
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
|
||||
// Clone confirmation
|
||||
if ($action == 'clone')
|
||||
{
|
||||
|
|
@ -1053,12 +1048,12 @@ else
|
|||
$htmltext.=$key.' = '.$langs->trans($val).'<br>';
|
||||
}
|
||||
$htmltext.='</i>';
|
||||
|
||||
|
||||
// Print mail content
|
||||
print load_fiche_titre($langs->trans("EMail"), $form->textwithpicto($langs->trans("AvailableVariables"), $htmltext, 1, 'help', '', 0, 2, 'emailsubstitionhelp'), 'title_generic');
|
||||
|
||||
|
||||
dol_fiche_head('', '', '', -1);
|
||||
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Subject
|
||||
|
|
@ -1086,9 +1081,9 @@ else
|
|||
/*print '<tr><td width="15%">'.$langs->trans("BackgroundColorByDefault").'</td><td colspan="3">';
|
||||
print $htmlother->selectColor($object->bgcolor,'bgcolor','edit_mailing',0);
|
||||
print '</td></tr>';*/
|
||||
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
||||
// Message
|
||||
print '<div style="padding-top: 10px" bgcolor="'.($object->bgcolor?(preg_match('/^#/',$object->bgcolor)?'':'#').$object->bgcolor:'white').'">';
|
||||
if (empty($object->bgcolor) || strtolower($object->bgcolor) == 'ffffff')
|
||||
|
|
@ -1103,23 +1098,23 @@ else
|
|||
print '</div>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Mailing en mode edition
|
||||
*/
|
||||
|
||||
|
||||
dol_fiche_head($head, 'card', $langs->trans("Mailing"), -1, 'email');
|
||||
|
||||
|
||||
$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.') ';
|
||||
|
||||
|
||||
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '', '', 0, '', $morehtmlright);
|
||||
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
|
|
@ -1131,7 +1126,7 @@ else
|
|||
print $form->showrefnav($object,'id', $linkback);
|
||||
print '</td></tr>';
|
||||
*/
|
||||
|
||||
|
||||
// Topic
|
||||
print '<tr><td class="titlefield">'.$langs->trans("MailTitle").'</td><td colspan="3">'.$object->titre.'</td></tr>';
|
||||
// From
|
||||
|
|
@ -1171,24 +1166,24 @@ else
|
|||
|
||||
|
||||
print "<br>\n";
|
||||
|
||||
|
||||
print '<form name="edit_mailing" action="card.php" method="post" enctype="multipart/form-data">'."\n";
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
print '<input type="hidden" name="id" value="'.$object->id.'">';
|
||||
|
||||
|
||||
$htmltext = '<i>'.$langs->trans("FollowingConstantsWillBeSubstituted").':<br>';
|
||||
foreach($object->substitutionarray as $key => $val)
|
||||
{
|
||||
$htmltext.=$key.' = '.$langs->trans($val).'<br>';
|
||||
}
|
||||
$htmltext.='</i>';
|
||||
|
||||
|
||||
// Print mail content
|
||||
print load_fiche_titre($langs->trans("EMail"), $form->textwithpicto($langs->trans("AvailableVariables"), $htmltext, 1, 'help', '', 0, 2, 'emailsubstitionhelp'), 'title_generic');
|
||||
|
||||
dol_fiche_head();
|
||||
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Subject
|
||||
|
|
@ -1237,9 +1232,9 @@ else
|
|||
print '<tr><td>'.$langs->trans("BackgroundColorByDefault").'</td><td colspan="3">';
|
||||
print $htmlother->selectColor($object->bgcolor,'bgcolor','edit_mailing',0);
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
||||
// Message
|
||||
print '<div style="padding-top: 10px">';
|
||||
// Editeur wysiwyg
|
||||
|
|
|
|||
|
|
@ -499,7 +499,7 @@ if (empty($reshook))
|
|||
|
||||
$tva_tx = $lines[$i]->tva_tx;
|
||||
if (! empty($lines[$i]->vat_src_code) && ! preg_match('/\(/', $tva_tx)) $tva_tx .= ' ('.$lines[$i]->vat_src_code.')';
|
||||
|
||||
|
||||
$result = $object->addline($desc, $lines[$i]->subprice, $lines[$i]->qty, $tva_tx, $lines[$i]->localtax1_tx, $lines[$i]->localtax2_tx, $lines[$i]->fk_product, $lines[$i]->remise_percent, 'HT', 0, $lines[$i]->info_bits, $product_type, $lines[$i]->rang, $lines[$i]->special_code, $fk_parent_line, $lines[$i]->fk_fournprice, $lines[$i]->pa_ht, $label, $date_start, $date_end, $array_options, $lines[$i]->fk_unit);
|
||||
|
||||
if ($result > 0) {
|
||||
|
|
@ -755,7 +755,7 @@ if (empty($reshook))
|
|||
$db->begin();
|
||||
|
||||
// $tva_tx can be 'x.x (XXX)'
|
||||
|
||||
|
||||
// Ecrase $pu par celui du produit
|
||||
// Ecrase $desc par celui du produit
|
||||
// Ecrase $tva_tx par celui du produit
|
||||
|
|
@ -770,7 +770,7 @@ if (empty($reshook))
|
|||
$tva_tx = get_default_tva($mysoc, $object->thirdparty, $prod->id);
|
||||
$tva_npr = get_default_npr($mysoc, $object->thirdparty, $prod->id);
|
||||
if (empty($tva_tx)) $tva_npr=0;
|
||||
|
||||
|
||||
$pu_ht = $prod->price;
|
||||
$pu_ttc = $prod->price_ttc;
|
||||
$price_min = $prod->price_min;
|
||||
|
|
@ -811,7 +811,7 @@ if (empty($reshook))
|
|||
|
||||
$tmpvat = price2num(preg_replace('/\s*\(.*\)/', '', $tva_tx));
|
||||
$tmpprodvat = price2num(preg_replace('/\s*\(.*\)/', '', $prod->tva_tx));
|
||||
|
||||
|
||||
// if price ht is forced (ie: calculated by margin rate and cost price). TODO Why this ?
|
||||
if (! empty($price_ht)) {
|
||||
$pu_ht = price2num($price_ht, 'MU');
|
||||
|
|
@ -1170,27 +1170,12 @@ if (empty($reshook))
|
|||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute'));
|
||||
if ($ret < 0) $error++;
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
// Actions on extra fields (by external module or standard code)
|
||||
// TODO le hook fait double emploi avec le trigger !!
|
||||
$hookmanager->initHooks(array('propaldao'));
|
||||
$parameters = array('id' => $object->id);
|
||||
$reshook = $hookmanager->executeHooks('insertExtraFields', $parameters, $object, $action); // Note that $action and $object may have been
|
||||
// modified by
|
||||
// some hooks
|
||||
if (empty($reshook)) {
|
||||
$result = $object->insertExtraFields();
|
||||
if ($result < 0) {
|
||||
$error ++;
|
||||
}
|
||||
} else if ($reshook < 0)
|
||||
$error ++;
|
||||
$result = $object->insertExtraFields();
|
||||
if ($result < 0) $error++;
|
||||
}
|
||||
|
||||
if ($error)
|
||||
$action = 'edit_extras';
|
||||
if ($error) $action = 'edit_extras';
|
||||
}
|
||||
|
||||
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->propal->creer)
|
||||
|
|
@ -1325,7 +1310,7 @@ if ($action == 'create')
|
|||
// Replicate extrafields
|
||||
$objectsrc->fetch_optionals($originid);
|
||||
$object->array_options = $objectsrc->array_options;
|
||||
|
||||
|
||||
if (!empty($conf->multicurrency->enabled))
|
||||
{
|
||||
if (!empty($objectsrc->multicurrency_code)) $currency_code = $objectsrc->multicurrency_code;
|
||||
|
|
@ -1355,10 +1340,10 @@ if ($action == 'create')
|
|||
print '<table class="border" width="100%">';
|
||||
|
||||
// Reference
|
||||
print '<tr><td class="titlefieldcreate fieldrequired">' . $langs->trans('Ref') . '</td><td colspan="2">' . $langs->trans("Draft") . '</td></tr>';
|
||||
print '<tr><td class="titlefieldcreate fieldrequired">' . $langs->trans('Ref') . '</td><td>' . $langs->trans("Draft") . '</td></tr>';
|
||||
|
||||
// Ref customer
|
||||
print '<tr><td>' . $langs->trans('RefCustomer') . '</td><td colspan="2">';
|
||||
print '<tr><td>' . $langs->trans('RefCustomer') . '</td><td>';
|
||||
print '<input type="text" name="ref_client" value="'.GETPOST('ref_client').'"></td>';
|
||||
print '</tr>';
|
||||
|
||||
|
|
@ -1366,7 +1351,7 @@ if ($action == 'create')
|
|||
print '<tr>';
|
||||
print '<td class="fieldrequired">' . $langs->trans('Customer') . '</td>';
|
||||
if ($socid > 0) {
|
||||
print '<td colspan="2">';
|
||||
print '<td>';
|
||||
print $soc->getNomUrl(1);
|
||||
print '<input type="hidden" name="socid" value="' . $soc->id . '">';
|
||||
print '</td>';
|
||||
|
|
@ -1374,7 +1359,7 @@ if ($action == 'create')
|
|||
$shipping_method_id = $soc->shipping_method_id;
|
||||
}
|
||||
} else {
|
||||
print '<td colspan="2">';
|
||||
print '<td>';
|
||||
print $form->select_company('', 'socid', '(s.client = 1 OR s.client = 2 OR s.client = 3) AND status=1', 'SelectThirdParty');
|
||||
// reload page to retrieve customer informations
|
||||
if (!empty($conf->global->RELOAD_PAGE_ON_CUSTOMER_CHANGE))
|
||||
|
|
@ -1396,7 +1381,7 @@ if ($action == 'create')
|
|||
// Contacts (ask contact only if thirdparty already defined). TODO do this also into order and invoice.
|
||||
if ($socid > 0)
|
||||
{
|
||||
print "<tr><td>" . $langs->trans("DefaultContact") . '</td><td colspan="2">';
|
||||
print "<tr><td>" . $langs->trans("DefaultContact") . '</td><td>';
|
||||
$form->select_contacts($soc->id, $contactid, 'contactid', 1, $srccontactslist);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
|
@ -1404,7 +1389,7 @@ if ($action == 'create')
|
|||
if ($socid > 0)
|
||||
{
|
||||
// Ligne info remises tiers
|
||||
print '<tr><td>' . $langs->trans('Discounts') . '</td><td colspan="2">';
|
||||
print '<tr><td>' . $langs->trans('Discounts') . '</td><td>';
|
||||
if ($soc->remise_percent)
|
||||
print $langs->trans("CompanyHasRelativeDiscount", $soc->remise_percent);
|
||||
else
|
||||
|
|
@ -1420,26 +1405,26 @@ if ($action == 'create')
|
|||
}
|
||||
|
||||
// Date
|
||||
print '<tr><td class="fieldrequired">' . $langs->trans('Date') . '</td><td colspan="2">';
|
||||
print '<tr><td class="fieldrequired">' . $langs->trans('Date') . '</td><td>';
|
||||
$form->select_date('', '', '', '', '', "addprop", 1, 1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Validaty duration
|
||||
print '<tr><td class="fieldrequired">' . $langs->trans("ValidityDuration") . '</td><td colspan="2"><input name="duree_validite" size="5" value="' . $conf->global->PROPALE_VALIDITY_DURATION . '"> ' . $langs->trans("days") . '</td></tr>';
|
||||
print '<tr><td class="fieldrequired">' . $langs->trans("ValidityDuration") . '</td><td><input name="duree_validite" size="5" value="' . $conf->global->PROPALE_VALIDITY_DURATION . '"> ' . $langs->trans("days") . '</td></tr>';
|
||||
|
||||
// Terms of payment
|
||||
print '<tr><td class="nowrap fieldrequired">' . $langs->trans('PaymentConditionsShort') . '</td><td colspan="2">';
|
||||
print '<tr><td class="nowrap fieldrequired">' . $langs->trans('PaymentConditionsShort') . '</td><td>';
|
||||
$form->select_conditions_paiements($soc->cond_reglement_id, 'cond_reglement_id');
|
||||
print '</td></tr>';
|
||||
|
||||
// Mode of payment
|
||||
print '<tr><td>' . $langs->trans('PaymentMode') . '</td><td colspan="2">';
|
||||
print '<tr><td>' . $langs->trans('PaymentMode') . '</td><td>';
|
||||
$form->select_types_paiements($soc->mode_reglement_id, 'mode_reglement_id');
|
||||
print '</td></tr>';
|
||||
|
||||
// Bank Account
|
||||
if (! empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL) && ! empty($conf->banque->enabled)) {
|
||||
print '<tr><td>' . $langs->trans('BankAccount') . '</td><td colspan="2">';
|
||||
print '<tr><td>' . $langs->trans('BankAccount') . '</td><td>';
|
||||
$form->select_comptes($fk_account, 'fk_account', 0, '', 1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
|
@ -1450,20 +1435,20 @@ if ($action == 'create')
|
|||
print '</td></tr>';
|
||||
|
||||
// Delivery delay
|
||||
print '<tr class="fielddeliverydelay"><td>' . $langs->trans('AvailabilityPeriod') . '</td><td colspan="2">';
|
||||
print '<tr class="fielddeliverydelay"><td>' . $langs->trans('AvailabilityPeriod') . '</td><td>';
|
||||
$form->selectAvailabilityDelay('', 'availability_id', '', 1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Shipping Method
|
||||
if (! empty($conf->expedition->enabled)) {
|
||||
print '<tr><td>' . $langs->trans('SendingMethod') . '</td><td colspan="2">';
|
||||
print '<tr><td>' . $langs->trans('SendingMethod') . '</td><td>';
|
||||
print $form->selectShippingMethod($shipping_method_id, 'shipping_method_id', '', 1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Delivery date (or manufacturing)
|
||||
print '<tr><td>' . $langs->trans("DeliveryDate") . '</td>';
|
||||
print '<td colspan="2">';
|
||||
print '<td>';
|
||||
if ($conf->global->DATE_LIVRAISON_WEEK_DELAY != "") {
|
||||
$tmpdte = time() + ((7 * $conf->global->DATE_LIVRAISON_WEEK_DELAY) * 24 * 60 * 60);
|
||||
$syear = date("Y", $tmpdte);
|
||||
|
|
@ -1483,7 +1468,7 @@ if ($action == 'create')
|
|||
|
||||
$langs->load("projects");
|
||||
print '<tr>';
|
||||
print '<td>' . $langs->trans("Project") . '</td><td colspan="2">';
|
||||
print '<td>' . $langs->trans("Project") . '</td><td>';
|
||||
$numprojet = $formproject->select_projects($soc->id, $projectid, 'projectid', 0);
|
||||
print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid=' . $soc->id . '&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$soc->id).'">' . $langs->trans("AddProject") . '</a>';
|
||||
print '</td>';
|
||||
|
|
@ -1495,7 +1480,7 @@ if ($action == 'create')
|
|||
{
|
||||
print '<tr>';
|
||||
print '<td><label for="incoterm_id">'.$form->textwithpicto($langs->trans("IncotermLabel"), $soc->libelle_incoterms, 1).'</label></td>';
|
||||
print '<td colspan="3" class="maxwidthonsmartphone">';
|
||||
print '<td class="maxwidthonsmartphone">';
|
||||
print $form->select_incoterms((!empty($soc->fk_incoterms) ? $soc->fk_incoterms : ''), (!empty($soc->location_incoterms)?$soc->location_incoterms:''));
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
|
@ -1503,7 +1488,7 @@ if ($action == 'create')
|
|||
// Template to use by default
|
||||
print '<tr>';
|
||||
print '<td>' . $langs->trans("DefaultModel") . '</td>';
|
||||
print '<td colspan="2">';
|
||||
print '<td>';
|
||||
$liste = ModelePDFPropales::liste_modeles($db);
|
||||
print $form->selectarray('model', $liste, ($conf->global->PROPALE_ADDON_PDF_ODT_DEFAULT ? $conf->global->PROPALE_ADDON_PDF_ODT_DEFAULT : $conf->global->PROPALE_ADDON_PDF));
|
||||
print "</td></tr>";
|
||||
|
|
@ -1513,7 +1498,7 @@ if ($action == 'create')
|
|||
{
|
||||
print '<tr>';
|
||||
print '<td>'.fieldLabel('Currency','multicurrency_code').'</td>';
|
||||
print '<td colspan="3" class="maxwidthonsmartphone">';
|
||||
print '<td class="maxwidthonsmartphone">';
|
||||
print $form->selectMultiCurrency($currency_code, 'multicurrency_code', 0);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
|
@ -1521,7 +1506,7 @@ if ($action == 'create')
|
|||
// Public note
|
||||
print '<tr>';
|
||||
print '<td class="tdtop">' . $langs->trans('NotePublic') . '</td>';
|
||||
print '<td valign="top" colspan="2">';
|
||||
print '<td valign="top">';
|
||||
$note_public = $object->getDefaultCreateValueFor('note_public', (is_object($objectsrc)?$objectsrc->note_public:null));
|
||||
$doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
|
||||
print $doleditor->Create(1);
|
||||
|
|
@ -1531,7 +1516,7 @@ if ($action == 'create')
|
|||
{
|
||||
print '<tr>';
|
||||
print '<td class="tdtop">' . $langs->trans('NotePrivate') . '</td>';
|
||||
print '<td valign="top" colspan="2">';
|
||||
print '<td valign="top">';
|
||||
$note_private = $object->getDefaultCreateValueFor('note_private', ((! empty($origin) && ! empty($originid) && is_object($objectsrc))?$objectsrc->note_private:null));
|
||||
$doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
|
||||
print $doleditor->Create(1);
|
||||
|
|
@ -1540,10 +1525,8 @@ if ($action == 'create')
|
|||
}
|
||||
|
||||
// Other attributes
|
||||
$parameters = array('colspan' => ' colspan="3"');
|
||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified
|
||||
// by
|
||||
// hook
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook) && ! empty($extrafields->attribute_label)) {
|
||||
print $object->showOptionals($extrafields, 'edit');
|
||||
}
|
||||
|
|
@ -1578,19 +1561,19 @@ if ($action == 'create')
|
|||
elseif ($newclassname == 'Fichinter')
|
||||
$newclassname = 'Intervention';
|
||||
|
||||
print '<tr><td>' . $langs->trans($newclassname) . '</td><td colspan="2">' . $objectsrc->getNomUrl(1) . '</td></tr>';
|
||||
print '<tr><td>' . $langs->trans('TotalHT') . '</td><td colspan="2">' . price($objectsrc->total_ht, 0, $langs, 1, -1, -1, $conf->currency) . '</td></tr>';
|
||||
print '<tr><td>' . $langs->trans('TotalVAT') . '</td><td colspan="2">' . price($objectsrc->total_tva, 0, $langs, 1, -1, -1, $conf->currency) . "</td></tr>";
|
||||
print '<tr><td>' . $langs->trans($newclassname) . '</td><td>' . $objectsrc->getNomUrl(1) . '</td></tr>';
|
||||
print '<tr><td>' . $langs->trans('TotalHT') . '</td><td>' . price($objectsrc->total_ht, 0, $langs, 1, -1, -1, $conf->currency) . '</td></tr>';
|
||||
print '<tr><td>' . $langs->trans('TotalVAT') . '</td><td>' . price($objectsrc->total_tva, 0, $langs, 1, -1, -1, $conf->currency) . "</td></tr>";
|
||||
if ($mysoc->localtax1_assuj == "1" || $objectsrc->total_localtax1 != 0 ) // Localtax1
|
||||
{
|
||||
print '<tr><td>' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td><td colspan="2">' . price($objectsrc->total_localtax1, 0, $langs, 1, -1, -1, $conf->currency) . "</td></tr>";
|
||||
print '<tr><td>' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td><td>' . price($objectsrc->total_localtax1, 0, $langs, 1, -1, -1, $conf->currency) . "</td></tr>";
|
||||
}
|
||||
|
||||
if ($mysoc->localtax2_assuj == "1" || $objectsrc->total_localtax2 != 0) // Localtax2
|
||||
{
|
||||
print '<tr><td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td><td colspan="2">' . price($objectsrc->total_localtax2, 0, $langs, 1, -1, -1, $conf->currency) . "</td></tr>";
|
||||
print '<tr><td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td><td>' . price($objectsrc->total_localtax2, 0, $langs, 1, -1, -1, $conf->currency) . "</td></tr>";
|
||||
}
|
||||
print '<tr><td>' . $langs->trans('TotalTTC') . '</td><td colspan="2">' . price($objectsrc->total_ttc, 0, $langs, 1, -1, -1, $conf->currency) . "</td></tr>";
|
||||
print '<tr><td>' . $langs->trans('TotalTTC') . '</td><td>' . price($objectsrc->total_ttc, 0, $langs, 1, -1, -1, $conf->currency) . "</td></tr>";
|
||||
}
|
||||
|
||||
print "</table>\n";
|
||||
|
|
@ -2036,43 +2019,6 @@ if ($action == 'create')
|
|||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Project
|
||||
/*
|
||||
if (! empty($conf->projet->enabled))
|
||||
{
|
||||
$langs->load("projects");
|
||||
print '<tr><td>';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
print $langs->trans('Project') . '</td>';
|
||||
if ($user->rights->propal->creer)
|
||||
{
|
||||
if ($action != 'classify')
|
||||
print '<td align="right"><a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="5">';
|
||||
if ($action == 'classify') {
|
||||
$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1);
|
||||
} else {
|
||||
$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0);
|
||||
}
|
||||
print '</td></tr>';
|
||||
} else {
|
||||
print '</td></tr></table>';
|
||||
if (! empty($object->fk_project)) {
|
||||
print '<td colspan="3">';
|
||||
$proj = new Project($db);
|
||||
$proj->fetch($object->fk_project);
|
||||
print '<a href="'.DOL_URL_ROOT.'/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">';
|
||||
print $proj->ref;
|
||||
print '</a>';
|
||||
print '</td>';
|
||||
} else {
|
||||
print '<td colspan="3"> </td>';
|
||||
}
|
||||
}
|
||||
print '</tr>';
|
||||
}*/
|
||||
|
||||
if ($soc->outstanding_limit)
|
||||
{
|
||||
// Outstanding Bill
|
||||
|
|
@ -2129,7 +2075,6 @@ if ($action == 'create')
|
|||
}
|
||||
|
||||
// Other attributes
|
||||
$cols = 2;
|
||||
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
|
||||
|
||||
print '</table>';
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ if (! empty($conf->projet->enabled)) {
|
|||
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
|
||||
}
|
||||
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
|
||||
|
||||
if (!empty($conf->variants->enabled)) {
|
||||
|
|
@ -116,7 +116,7 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
|
|||
|
||||
if (empty($reshook))
|
||||
{
|
||||
if ($cancel)
|
||||
if ($cancel)
|
||||
{
|
||||
if ($action != 'addlink' && $action != 'updateline')
|
||||
{
|
||||
|
|
@ -130,7 +130,7 @@ if (empty($reshook))
|
|||
}
|
||||
$action='';
|
||||
}
|
||||
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once
|
||||
|
|
@ -379,7 +379,7 @@ if (empty($reshook))
|
|||
|
||||
$tva_tx = $lines[$i]->tva_tx;
|
||||
if (! empty($lines[$i]->vat_src_code) && ! preg_match('/\(/', $tva_tx)) $tva_tx .= ' ('.$lines[$i]->vat_src_code.')';
|
||||
|
||||
|
||||
$result = $object->addline($desc, $lines[$i]->subprice, $lines[$i]->qty, $tva_tx, $lines[$i]->localtax1_tx, $lines[$i]->localtax2_tx, $lines[$i]->fk_product, $lines[$i]->remise_percent, $lines[$i]->info_bits, $lines[$i]->fk_remise_except, 'HT', 0, $date_start, $date_end, $product_type, $lines[$i]->rang, $lines[$i]->special_code, $fk_parent_line, $lines[$i]->fk_fournprice, $lines[$i]->pa_ht, $label, $array_options, $lines[$i]->fk_unit, $object->origin, $lines[$i]->rowid);
|
||||
|
||||
if ($result < 0) {
|
||||
|
|
@ -779,7 +779,7 @@ if (empty($reshook))
|
|||
|
||||
$tmpvat = price2num(preg_replace('/\s*\(.*\)/', '', $tva_tx));
|
||||
$tmpprodvat = price2num(preg_replace('/\s*\(.*\)/', '', $prod->tva_tx));
|
||||
|
||||
|
||||
// if price ht is forced (ie: calculated by margin rate and cost price). TODO Why this ?
|
||||
if (! empty($price_ht)) {
|
||||
$pu_ht = price2num($price_ht, 'MU');
|
||||
|
|
@ -1457,10 +1457,10 @@ if ($action == 'create' && $user->rights->commande->creer)
|
|||
print '<table class="border" width="100%">';
|
||||
|
||||
// Reference
|
||||
print '<tr><td class="titlefieldcreate fieldrequired">' . $langs->trans('Ref') . '</td><td colspan="2">' . $langs->trans("Draft") . '</td></tr>';
|
||||
print '<tr><td class="titlefieldcreate fieldrequired">' . $langs->trans('Ref') . '</td><td>' . $langs->trans("Draft") . '</td></tr>';
|
||||
|
||||
// Reference client
|
||||
print '<tr><td>' . $langs->trans('RefCustomer') . '</td><td colspan="2">';
|
||||
print '<tr><td>' . $langs->trans('RefCustomer') . '</td><td>';
|
||||
if (!empty($conf->global->MAIN_USE_PROPAL_REFCLIENT_FOR_ORDER) && ! empty($origin) && ! empty($originid))
|
||||
print '<input type="text" name="ref_client" value="'.$ref_client.'"></td>';
|
||||
else
|
||||
|
|
@ -1471,12 +1471,12 @@ if ($action == 'create' && $user->rights->commande->creer)
|
|||
print '<tr>';
|
||||
print '<td class="fieldrequired">' . $langs->trans('Customer') . '</td>';
|
||||
if ($socid > 0) {
|
||||
print '<td colspan="2">';
|
||||
print '<td>';
|
||||
print $soc->getNomUrl(1);
|
||||
print '<input type="hidden" name="socid" value="' . $soc->id . '">';
|
||||
print '</td>';
|
||||
} else {
|
||||
print '<td colspan="2">';
|
||||
print '<td>';
|
||||
print $form->select_company('', 'socid', 's.client = 1 OR s.client = 3', 'SelectThirdParty');
|
||||
// reload page to retrieve customer informations
|
||||
if (!empty($conf->global->RELOAD_PAGE_ON_CUSTOMER_CHANGE))
|
||||
|
|
@ -1497,12 +1497,12 @@ if ($action == 'create' && $user->rights->commande->creer)
|
|||
|
||||
// Contact of order
|
||||
if ($socid > 0) {
|
||||
print "<tr><td>" . $langs->trans("DefaultContact") . '</td><td colspan="2">';
|
||||
print "<tr><td>" . $langs->trans("DefaultContact") . '</td><td>';
|
||||
$form->select_contacts($soc->id, $setcontact, 'contactid', 1, $srccontactslist);
|
||||
print '</td></tr>';
|
||||
|
||||
// Ligne info remises tiers
|
||||
print '<tr><td>' . $langs->trans('Discounts') . '</td><td colspan="2">';
|
||||
print '<tr><td>' . $langs->trans('Discounts') . '</td><td>';
|
||||
if ($soc->remise_percent)
|
||||
print $langs->trans("CompanyHasRelativeDiscount", $soc->remise_percent);
|
||||
else
|
||||
|
|
@ -1517,12 +1517,12 @@ if ($action == 'create' && $user->rights->commande->creer)
|
|||
print '</td></tr>';
|
||||
}
|
||||
// Date
|
||||
print '<tr><td class="fieldrequired">' . $langs->trans('Date') . '</td><td colspan="2">';
|
||||
print '<tr><td class="fieldrequired">' . $langs->trans('Date') . '</td><td>';
|
||||
$form->select_date('', 're', '', '', '', "crea_commande", 1, 1); // Always autofill date with current date
|
||||
print '</td></tr>';
|
||||
|
||||
// Delivery date planed
|
||||
print "<tr><td>".$langs->trans("DateDeliveryPlanned").'</td><td colspan="2">';
|
||||
print "<tr><td>".$langs->trans("DateDeliveryPlanned").'</td><td>';
|
||||
if (empty($datedelivery))
|
||||
{
|
||||
if (! empty($conf->global->DATE_LIVRAISON_WEEK_DELAY)) $datedelivery = time() + ((7*$conf->global->DATE_LIVRAISON_WEEK_DELAY) * 24 * 60 * 60);
|
||||
|
|
@ -1532,31 +1532,31 @@ if ($action == 'create' && $user->rights->commande->creer)
|
|||
print "</td></tr>";
|
||||
|
||||
// Conditions de reglement
|
||||
print '<tr><td class="nowrap">' . $langs->trans('PaymentConditionsShort') . '</td><td colspan="2">';
|
||||
print '<tr><td class="nowrap">' . $langs->trans('PaymentConditionsShort') . '</td><td>';
|
||||
$form->select_conditions_paiements($cond_reglement_id, 'cond_reglement_id', - 1, 1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Mode de reglement
|
||||
print '<tr><td>' . $langs->trans('PaymentMode') . '</td><td colspan="2">';
|
||||
print '<tr><td>' . $langs->trans('PaymentMode') . '</td><td>';
|
||||
$form->select_types_paiements($mode_reglement_id, 'mode_reglement_id');
|
||||
print '</td></tr>';
|
||||
|
||||
// Bank Account
|
||||
if (! empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_ORDER) && ! empty($conf->banque->enabled))
|
||||
{
|
||||
print '<tr><td>' . $langs->trans('BankAccount') . '</td><td colspan="2">';
|
||||
print '<tr><td>' . $langs->trans('BankAccount') . '</td><td>';
|
||||
$form->select_comptes($fk_account, 'fk_account', 0, '', 1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Delivery delay
|
||||
print '<tr class="fielddeliverydelay"><td>' . $langs->trans('AvailabilityPeriod') . '</td><td colspan="2">';
|
||||
print '<tr class="fielddeliverydelay"><td>' . $langs->trans('AvailabilityPeriod') . '</td><td>';
|
||||
$form->selectAvailabilityDelay($availability_id, 'availability_id', '', 1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Shipping Method
|
||||
if (! empty($conf->expedition->enabled)) {
|
||||
print '<tr><td>' . $langs->trans('SendingMethod') . '</td><td colspan="2">';
|
||||
print '<tr><td>' . $langs->trans('SendingMethod') . '</td><td>';
|
||||
print $form->selectShippingMethod($shipping_method_id, 'shipping_method_id', '', 1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
|
@ -1565,13 +1565,13 @@ if ($action == 'create' && $user->rights->commande->creer)
|
|||
if (! empty($conf->expedition->enabled) && ! empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
|
||||
$formproduct=new FormProduct($db);
|
||||
print '<tr><td>' . $langs->trans('Warehouse') . '</td><td colspan="2">';
|
||||
print '<tr><td>' . $langs->trans('Warehouse') . '</td><td>';
|
||||
print $formproduct->selectWarehouses($warehouse_id, 'warehouse_id', '', 1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// What trigger creation
|
||||
print '<tr><td>' . $langs->trans('Source') . '</td><td colspan="2">';
|
||||
print '<tr><td>' . $langs->trans('Source') . '</td><td>';
|
||||
$form->selectInputReason($demand_reason_id, 'demand_reason_id', '', 1);
|
||||
print '</td></tr>';
|
||||
|
||||
|
|
@ -1582,7 +1582,7 @@ if ($action == 'create' && $user->rights->commande->creer)
|
|||
{
|
||||
$langs->load("projects");
|
||||
print '<tr>';
|
||||
print '<td>' . $langs->trans("Project") . '</td><td colspan="2">';
|
||||
print '<td>' . $langs->trans("Project") . '</td><td>';
|
||||
$numprojet = $formproject->select_projects($soc->id, $projectid, 'projectid', 0);
|
||||
print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid=' . $soc->id . '&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$soc->id).'">' . $langs->trans("AddProject") . '</a>';
|
||||
print '</td>';
|
||||
|
|
@ -1594,7 +1594,7 @@ if ($action == 'create' && $user->rights->commande->creer)
|
|||
{
|
||||
print '<tr>';
|
||||
print '<td><label for="incoterm_id">'.$form->textwithpicto($langs->trans("IncotermLabel"), $objectsrc->libelle_incoterms, 1).'</label></td>';
|
||||
print '<td colspan="3" class="maxwidthonsmartphone">';
|
||||
print '<td class="maxwidthonsmartphone">';
|
||||
$incoterm_id = GETPOST('incoterm_id');
|
||||
$incoterm_location = GETPOST('location_incoterms');
|
||||
if (empty($incoterm_id))
|
||||
|
|
@ -1607,16 +1607,15 @@ if ($action == 'create' && $user->rights->commande->creer)
|
|||
}
|
||||
|
||||
// Other attributes
|
||||
$parameters = array('objectsrc' => $objectsrc, 'colspan' => ' colspan="3"', 'socid'=>$socid);
|
||||
$parameters = array('objectsrc' => $objectsrc, 'socid'=>$socid);
|
||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by
|
||||
// hook
|
||||
if (empty($reshook) && ! empty($extrafields->attribute_label)) {
|
||||
print $object->showOptionals($extrafields, 'edit');
|
||||
}
|
||||
|
||||
// Template to use by default
|
||||
print '<tr><td>' . $langs->trans('DefaultModel') . '</td>';
|
||||
print '<td colspan="2">';
|
||||
print '<td>';
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/modules/commande/modules_commande.php';
|
||||
$liste = ModelePDFCommandes::liste_modeles($db);
|
||||
print $form->selectarray('model', $liste, $conf->global->COMMANDE_ADDON_PDF);
|
||||
|
|
@ -1627,7 +1626,7 @@ if ($action == 'create' && $user->rights->commande->creer)
|
|||
{
|
||||
print '<tr>';
|
||||
print '<td>'.fieldLabel('Currency','multicurrency_code').'</td>';
|
||||
print '<td colspan="3" class="maxwidthonsmartphone">';
|
||||
print '<td class="maxwidthonsmartphone">';
|
||||
print $form->selectMultiCurrency($currency_code, 'multicurrency_code');
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
|
@ -1635,7 +1634,7 @@ if ($action == 'create' && $user->rights->commande->creer)
|
|||
// Note public
|
||||
print '<tr>';
|
||||
print '<td class="tdtop">' . $langs->trans('NotePublic') . '</td>';
|
||||
print '<td colspan="2">';
|
||||
print '<td>';
|
||||
|
||||
$doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
|
||||
print $doleditor->Create(1);
|
||||
|
|
@ -1646,7 +1645,7 @@ if ($action == 'create' && $user->rights->commande->creer)
|
|||
if (empty($user->societe_id)) {
|
||||
print '<tr>';
|
||||
print '<td class="tdtop">' . $langs->trans('NotePrivate') . '</td>';
|
||||
print '<td colspan="2">';
|
||||
print '<td>';
|
||||
|
||||
$doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
|
||||
print $doleditor->Create(1);
|
||||
|
|
@ -1689,26 +1688,26 @@ if ($action == 'create' && $user->rights->commande->creer)
|
|||
$newclassname = $classname;
|
||||
}
|
||||
|
||||
print '<tr><td>' . $langs->trans($newclassname) . '</td><td colspan="2">' . $objectsrc->getNomUrl(1) . '</td></tr>';
|
||||
print '<tr><td>' . $langs->trans('TotalHT') . '</td><td colspan="2">' . price($objectsrc->total_ht) . '</td></tr>';
|
||||
print '<tr><td>' . $langs->trans('TotalVAT') . '</td><td colspan="2">' . price($objectsrc->total_tva) . "</td></tr>";
|
||||
print '<tr><td>' . $langs->trans($newclassname) . '</td><td>' . $objectsrc->getNomUrl(1) . '</td></tr>';
|
||||
print '<tr><td>' . $langs->trans('TotalHT') . '</td><td>' . price($objectsrc->total_ht) . '</td></tr>';
|
||||
print '<tr><td>' . $langs->trans('TotalVAT') . '</td><td>' . price($objectsrc->total_tva) . "</td></tr>";
|
||||
if ($mysoc->localtax1_assuj == "1" || $objectsrc->total_localtax1 != 0) // Localtax1 RE
|
||||
{
|
||||
print '<tr><td>' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td><td colspan="2">' . price($objectsrc->total_localtax1) . "</td></tr>";
|
||||
print '<tr><td>' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td><td>' . price($objectsrc->total_localtax1) . "</td></tr>";
|
||||
}
|
||||
|
||||
if ($mysoc->localtax2_assuj == "1" || $objectsrc->total_localtax2 != 0) // Localtax2 IRPF
|
||||
{
|
||||
print '<tr><td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td><td colspan="2">' . price($objectsrc->total_localtax2) . "</td></tr>";
|
||||
print '<tr><td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td><td>' . price($objectsrc->total_localtax2) . "</td></tr>";
|
||||
}
|
||||
|
||||
print '<tr><td>' . $langs->trans('TotalTTC') . '</td><td colspan="2">' . price($objectsrc->total_ttc) . "</td></tr>";
|
||||
print '<tr><td>' . $langs->trans('TotalTTC') . '</td><td>' . price($objectsrc->total_ttc) . "</td></tr>";
|
||||
|
||||
if (!empty($conf->multicurrency->enabled))
|
||||
{
|
||||
print '<tr><td>' . $langs->trans('MulticurrencyTotalHT') . '</td><td colspan="2">' . price($objectsrc->multicurrency_total_ht) . '</td></tr>';
|
||||
print '<tr><td>' . $langs->trans('MulticurrencyTotalVAT') . '</td><td colspan="2">' . price($objectsrc->multicurrency_total_tva) . "</td></tr>";
|
||||
print '<tr><td>' . $langs->trans('MulticurrencyTotalTTC') . '</td><td colspan="2">' . price($objectsrc->multicurrency_total_ttc) . "</td></tr>";
|
||||
print '<tr><td>' . $langs->trans('MulticurrencyTotalHT') . '</td><td>' . price($objectsrc->multicurrency_total_ht) . '</td></tr>';
|
||||
print '<tr><td>' . $langs->trans('MulticurrencyTotalVAT') . '</td><td>' . price($objectsrc->multicurrency_total_tva) . "</td></tr>";
|
||||
print '<tr><td>' . $langs->trans('MulticurrencyTotalTTC') . '</td><td>' . price($objectsrc->multicurrency_total_ttc) . "</td></tr>";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2240,7 +2239,7 @@ if ($action == 'create' && $user->rights->commande->creer)
|
|||
}
|
||||
print '</td></tr>';
|
||||
*/
|
||||
|
||||
|
||||
$tmparray=$object->getTotalWeightVolume();
|
||||
$totalWeight=$tmparray['weight'];
|
||||
$totalVolume=$tmparray['volume'];
|
||||
|
|
@ -2269,7 +2268,7 @@ if ($action == 'create' && $user->rights->commande->creer)
|
|||
else print ' ';
|
||||
print '</td></tr></table>';
|
||||
print '</td>';
|
||||
print '<td colspan="3">';
|
||||
print '<td>';
|
||||
if ($action != 'editincoterm')
|
||||
{
|
||||
print $form->textwithpicto($object->display_incoterms(), $object->libelle_incoterms, 1);
|
||||
|
|
@ -2291,7 +2290,7 @@ if ($action == 'create' && $user->rights->commande->creer)
|
|||
if ($action != 'editbankaccount' && $user->rights->commande->creer)
|
||||
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'),1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="3">';
|
||||
print '</td><td>';
|
||||
if ($action == 'editbankaccount') {
|
||||
$form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'fk_account', 1);
|
||||
} else {
|
||||
|
|
@ -2302,7 +2301,6 @@ if ($action == 'create' && $user->rights->commande->creer)
|
|||
}
|
||||
|
||||
// Other attributes
|
||||
$cols = 2;
|
||||
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
|
||||
|
||||
print '</table>';
|
||||
|
|
@ -2320,18 +2318,18 @@ if ($action == 'create' && $user->rights->commande->creer)
|
|||
print '<tr><td class="titlefieldmiddle">' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . '</td>';
|
||||
print '<td class="nowrap">' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
// Multicurrency Amount VAT
|
||||
print '<tr><td>' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . '</td>';
|
||||
print '<td class="nowrap">' . price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
// Multicurrency Amount TTC
|
||||
print '<tr><td>' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . '</td>';
|
||||
print '<td class="nowrap">' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
|
||||
// Total HT
|
||||
print '<tr><td class="titlefieldmiddle">' . $langs->trans('AmountHT') . '</td>';
|
||||
print '<td>' . price($object->total_ht, 1, '', 1, - 1, - 1, $conf->currency) . '</td>';
|
||||
|
|
|
|||
|
|
@ -411,17 +411,17 @@ if ($action == 'create' && !$error)
|
|||
print '<table class="border" width="100%">';
|
||||
|
||||
// Ref
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans('Ref').'</td><td colspan="2">'.$langs->trans('Draft').'</td></tr>';
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans('Ref').'</td><td>'.$langs->trans('Draft').'</td></tr>';
|
||||
|
||||
// Third party
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans('Customer').'</td><td colspan="2">';
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans('Customer').'</td><td>';
|
||||
print $soc->getNomUrl(1);
|
||||
print '<input type="hidden" name="socid" value="'.$soc->id.'">';
|
||||
print '</td>';
|
||||
print '</tr>'."\n";
|
||||
|
||||
// Type
|
||||
print '<tr><td class="tdtop fieldrequired">'.$langs->trans('Type').'</td><td colspan="2">';
|
||||
print '<tr><td class="tdtop fieldrequired">'.$langs->trans('Type').'</td><td>';
|
||||
print '<table class="nobordernopadding">'."\n";
|
||||
|
||||
// Standard invoice
|
||||
|
|
@ -434,15 +434,15 @@ if ($action == 'create' && !$error)
|
|||
print '</table>';
|
||||
|
||||
// Date invoice
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans('Date').'</td><td colspan="2">';
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans('Date').'</td><td>';
|
||||
$html->select_date('','','','','',"add",1,1);
|
||||
print '</td></tr>';
|
||||
// Payment term
|
||||
print '<tr><td class="nowrap">'.$langs->trans('PaymentConditionsShort').'</td><td colspan="2">';
|
||||
print '<tr><td class="nowrap">'.$langs->trans('PaymentConditionsShort').'</td><td>';
|
||||
$html->select_conditions_paiements(isset($_POST['cond_reglement_id'])?$_POST['cond_reglement_id']:$cond_reglement_id,'cond_reglement_id');
|
||||
print '</td></tr>';
|
||||
// Payment mode
|
||||
print '<tr><td>'.$langs->trans('PaymentMode').'</td><td colspan="2">';
|
||||
print '<tr><td>'.$langs->trans('PaymentMode').'</td><td>';
|
||||
$html->select_types_paiements(isset($_POST['mode_reglement_id'])?$_POST['mode_reglement_id']:$mode_reglement_id,'mode_reglement_id');
|
||||
print '</td></tr>';
|
||||
// Project
|
||||
|
|
@ -451,7 +451,7 @@ if ($action == 'create' && !$error)
|
|||
$formproject=new FormProjets($db);
|
||||
|
||||
$langs->load('projects');
|
||||
print '<tr><td>'.$langs->trans('Project').'</td><td colspan="2">';
|
||||
print '<tr><td>'.$langs->trans('Project').'</td><td>';
|
||||
$formproject->select_projects($soc->id, $projectid, 'projectid');
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
|
@ -469,9 +469,8 @@ if ($action == 'create' && !$error)
|
|||
}
|
||||
|
||||
// Other attributes
|
||||
$parameters=array('objectsrc' => $objectsrc, 'idsrc' => $listoforders, 'colspan' => ' colspan="3"');
|
||||
$parameters=array('objectsrc' => $objectsrc, 'idsrc' => $listoforders);
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
|
||||
if (empty($reshook) && ! empty($extrafields->attribute_label))
|
||||
{
|
||||
$object=new Facture($db);
|
||||
|
|
@ -489,8 +488,8 @@ if ($action == 'create' && !$error)
|
|||
// Public note
|
||||
print '<tr>';
|
||||
print '<td class="border" valign="top">'.$langs->trans('NotePublic').'</td>';
|
||||
print '<td valign="top" colspan="2">';
|
||||
print '<textarea name="note_public" wrap="soft" cols="70" rows="'.ROWS_3.'">';
|
||||
print '<td valign="top">';
|
||||
print '<textarea name="note_public" class="quatrevingtpercent" rows="'.ROWS_3.'">';
|
||||
|
||||
print $langs->trans("Orders").": ".implode(', ', $listoforders);
|
||||
|
||||
|
|
@ -500,8 +499,8 @@ if ($action == 'create' && !$error)
|
|||
{
|
||||
print '<tr>';
|
||||
print '<td class="border" valign="top">'.$langs->trans('NotePrivate').'</td>';
|
||||
print '<td valign="top" colspan="2">';
|
||||
print '<textarea name="note" wrap="soft" cols="70" rows="'.ROWS_3.'">';
|
||||
print '<td valign="top">';
|
||||
print '<textarea name="note" class="quatrevingtpercent" rows="'.ROWS_3.'">';
|
||||
|
||||
print '</textarea></td></tr>';
|
||||
}
|
||||
|
|
@ -622,7 +621,7 @@ if (($action != 'create' && $action != 'add') || ($action == 'create' && $error)
|
|||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat" type="text" size="10" name="sref_client" value="'.$sref_client.'">';
|
||||
print '</td>';
|
||||
|
||||
|
||||
//DATE ORDER
|
||||
print '<td class="liste_titre" align="center">';
|
||||
print $period;
|
||||
|
|
@ -637,7 +636,7 @@ if (($action != 'create' && $action != 'add') || ($action == 'create' && $error)
|
|||
print '<td align="right" class="liste_titre">';
|
||||
print '<input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||
print '</td>';
|
||||
|
||||
|
||||
//ALL/NONE
|
||||
print '<td align="center" class="liste_titre">';
|
||||
if ($conf->use_javascript_ajax) print '<a href="#" id="checkall">'.$langs->trans("All").'</a> / <a href="#" id="checknone">'.$langs->trans("None").'</a>';
|
||||
|
|
@ -653,7 +652,7 @@ if (($action != 'create' && $action != 'add') || ($action == 'create' && $error)
|
|||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object($resql);
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="nowrap">';
|
||||
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ if ($action == 'add')
|
|||
$error=0;
|
||||
|
||||
$db->begin();
|
||||
|
||||
|
||||
// Create account
|
||||
$object = new Account($db);
|
||||
|
||||
|
|
@ -116,7 +116,7 @@ if ($action == 'add')
|
|||
$object->comment = trim(GETPOST("account_comment"));
|
||||
|
||||
$object->fk_user_author = $user->id;
|
||||
|
||||
|
||||
if ($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED && empty($object->account_number))
|
||||
{
|
||||
setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired",$langs->transnoentitiesnoconv("AccountancyCode")), null, 'errors');
|
||||
|
|
@ -149,7 +149,7 @@ if ($action == 'add')
|
|||
$object->setCategories($categories);
|
||||
|
||||
$_GET["id"]=$id; // Force chargement page en mode visu
|
||||
|
||||
|
||||
$action='';
|
||||
}
|
||||
else {
|
||||
|
|
@ -159,7 +159,7 @@ if ($action == 'add')
|
|||
$action='create'; // Force chargement page en mode creation
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$db->commit();
|
||||
|
|
@ -324,21 +324,21 @@ if ($action == 'create')
|
|||
|
||||
// Ref
|
||||
print '<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans("Ref").'</td>';
|
||||
print '<td colspan="3"><input size="8" type="text" class="flat" name="ref" value="'.(GETPOST("ref")?GETPOST("ref",'alpha'):$object->ref).'" maxlength="12"></td></tr>';
|
||||
print '<td><input size="8" type="text" class="flat" name="ref" value="'.(GETPOST("ref")?GETPOST("ref",'alpha'):$object->ref).'" maxlength="12"></td></tr>';
|
||||
|
||||
// Label
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("LabelBankCashAccount").'</td>';
|
||||
print '<td colspan="3"><input size="30" type="text" class="flat" name="label" value="'.GETPOST("label", 'alpha').'"></td></tr>';
|
||||
print '<td><input size="30" type="text" class="flat" name="label" value="'.GETPOST("label", 'alpha').'"></td></tr>';
|
||||
|
||||
// Type
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("AccountType").'</td>';
|
||||
print '<td colspan="3">';
|
||||
print '<td>';
|
||||
$formbank->selectTypeOfBankAccount(isset($_POST["type"])?$_POST["type"]: Account::TYPE_CURRENT,"type");
|
||||
print '</td></tr>';
|
||||
|
||||
// Currency
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Currency").'</td>';
|
||||
print '<td colspan="3">';
|
||||
print '<td>';
|
||||
$selectedcode=$object->currency_code;
|
||||
if (! $selectedcode) $selectedcode=$conf->currency;
|
||||
print $form->selectCurrency((isset($_POST["account_currency_code"])?$_POST["account_currency_code"]:$selectedcode), 'account_currency_code');
|
||||
|
|
@ -348,7 +348,7 @@ if ($action == 'create')
|
|||
|
||||
// Status
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Status").'</td>';
|
||||
print '<td colspan="3">';
|
||||
print '<td>';
|
||||
print $form->selectarray("clos", $object->status,(isset($_POST["clos"])?$_POST["clos"]:$object->clos));
|
||||
print '</td></tr>';
|
||||
|
||||
|
|
@ -362,13 +362,13 @@ if ($action == 'create')
|
|||
$object->country_code = getCountry($selectedcode, 2); // Force country code on account to have following field on bank fields matching country rules
|
||||
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("BankAccountCountry").'</td>';
|
||||
print '<td colspan="3">';
|
||||
print '<td>';
|
||||
print $form->select_country($selectedcode,'account_country_id');
|
||||
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
|
||||
print '</td></tr>';
|
||||
|
||||
// State
|
||||
print '<tr><td>'.$langs->trans('State').'</td><td colspan="3">';
|
||||
print '<tr><td>'.$langs->trans('State').'</td><td>';
|
||||
if ($selectedcode)
|
||||
{
|
||||
$formcompany->select_departement(isset($_POST["account_state_id"])?$_POST["account_state_id"]:'',$selectedcode,'account_state_id');
|
||||
|
|
@ -381,12 +381,12 @@ if ($action == 'create')
|
|||
|
||||
// Web
|
||||
print '<tr><td>'.$langs->trans("Web").'</td>';
|
||||
print '<td colspan="3"><input class="minwidth300" type="text" class="flat" name="url" value="'.GETPOST("url").'"></td></tr>';
|
||||
print '<td><input class="minwidth300" type="text" class="flat" name="url" value="'.GETPOST("url").'"></td></tr>';
|
||||
|
||||
// Tags-Categories
|
||||
if ($conf->categorie->enabled)
|
||||
if ($conf->categorie->enabled)
|
||||
{
|
||||
print '<tr><td class="tdtop">'.$langs->trans("Categories").'</td><td colspan="3">';
|
||||
print '<tr><td class="tdtop">'.$langs->trans("Categories").'</td><td>';
|
||||
$cate_arbo = $form->select_all_categories(Categorie::TYPE_ACCOUNT, '', 'parent', 64, 0, 1);
|
||||
$c = new Categorie($db);
|
||||
$cats = $c->containing($object->id,Categorie::TYPE_ACCOUNT);
|
||||
|
|
@ -399,7 +399,7 @@ if ($action == 'create')
|
|||
|
||||
// Comment
|
||||
print '<tr><td class="tdtop">'.$langs->trans("Comment").'</td>';
|
||||
print '<td colspan="3">';
|
||||
print '<td>';
|
||||
// Editor wysiwyg
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor=new DolEditor('account_comment',(GETPOST("account_comment")?GETPOST("account_comment"):$object->comment),'',90,'dolibarr_notes','',false,true,$conf->global->FCKEDITOR_ENABLE_SOCIETE,ROWS_4,'90%');
|
||||
|
|
@ -407,7 +407,7 @@ if ($action == 'create')
|
|||
print '</td></tr>';
|
||||
|
||||
// Other attributes
|
||||
$parameters=array('colspan' => 3);
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook) && ! empty($extrafields->attribute_label))
|
||||
{
|
||||
|
|
@ -422,18 +422,18 @@ if ($action == 'create')
|
|||
|
||||
// Sold
|
||||
print '<tr><td class="titlefieldcreate">'.$langs->trans("InitialBankBalance").'</td>';
|
||||
print '<td colspan="3"><input size="12" type="text" class="flat" name="solde" value="'.(GETPOST("solde")?GETPOST("solde"):price2num($object->solde)).'"></td></tr>';
|
||||
print '<td><input size="12" type="text" class="flat" name="solde" value="'.(GETPOST("solde")?GETPOST("solde"):price2num($object->solde)).'"></td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Date").'</td>';
|
||||
print '<td colspan="3">';
|
||||
print '<td>';
|
||||
$form->select_date('', 're', 0, 0, 0, 'formsoc');
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("BalanceMinimalAllowed").'</td>';
|
||||
print '<td colspan="3"><input size="12" type="text" class="flat" name="account_min_allowed" value="'.(GETPOST("account_min_allowed")?GETPOST("account_min_allowed"):$object->min_allowed).'"></td></tr>';
|
||||
print '<td><input size="12" type="text" class="flat" name="account_min_allowed" value="'.(GETPOST("account_min_allowed")?GETPOST("account_min_allowed"):$object->min_allowed).'"></td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("BalanceMinimalDesired").'</td>';
|
||||
print '<td colspan="3"><input size="12" type="text" class="flat" name="account_min_desired" value="'.(GETPOST("account_min_desired")?GETPOST("account_min_desired"):$object->min_desired).'"></td></tr>';
|
||||
print '<td><input size="12" type="text" class="flat" name="account_min_desired" value="'.(GETPOST("account_min_desired")?GETPOST("account_min_desired"):$object->min_desired).'"></td></tr>';
|
||||
|
||||
print '</table>';
|
||||
print '<br>';
|
||||
|
|
@ -444,7 +444,7 @@ if ($action == 'create')
|
|||
|
||||
// If bank account
|
||||
print '<tr><td class="titlefieldcreate">'.$langs->trans("BankName").'</td>';
|
||||
print '<td colspan="3"><input size="30" type="text" class="flat" name="bank" value="'.(GETPOST('bank')?GETPOST('bank','alpha'):$object->bank).'"></td>';
|
||||
print '<td><input size="30" type="text" class="flat" name="bank" value="'.(GETPOST('bank')?GETPOST('bank','alpha'):$object->bank).'"></td>';
|
||||
print '</tr>';
|
||||
|
||||
// Show fields of bank account
|
||||
|
|
@ -477,21 +477,21 @@ if ($action == 'create')
|
|||
|
||||
// IBAN
|
||||
print '<tr><td>'.$langs->trans($ibankey).'</td>';
|
||||
print '<td colspan="3"><input size="34" maxlength="34" type="text" class="flat" name="iban" value="'.(GETPOST('iban')?GETPOST('iban','alpha'):$object->iban).'"></td></tr>';
|
||||
print '<td><input size="34" maxlength="34" type="text" class="flat" name="iban" value="'.(GETPOST('iban')?GETPOST('iban','alpha'):$object->iban).'"></td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans($bickey).'</td>';
|
||||
print '<td colspan="3"><input size="11" maxlength="11" type="text" class="flat" name="bic" value="'.(GETPOST('bic')?GETPOST('bic','alpha'):$object->bic).'"></td></tr>';
|
||||
print '<td><input size="11" maxlength="11" type="text" class="flat" name="bic" value="'.(GETPOST('bic')?GETPOST('bic','alpha'):$object->bic).'"></td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("BankAccountDomiciliation").'</td><td colspan="3">';
|
||||
print '<tr><td>'.$langs->trans("BankAccountDomiciliation").'</td><td>';
|
||||
print "<textarea class=\"flat\" name=\"domiciliation\" rows=\"2\" cols=\"40\">";
|
||||
print (GETPOST('domiciliation')?GETPOST('domiciliation'):$object->domiciliation);
|
||||
print "</textarea></td></tr>";
|
||||
|
||||
print '<tr><td>'.$langs->trans("BankAccountOwner").'</td>';
|
||||
print '<td colspan="3"><input size="30" type="text" class="flat" name="proprio" value="'.(GETPOST('proprio')?GETPOST('proprio','alpha'):$object->proprio).'">';
|
||||
print '<td><input size="30" type="text" class="flat" name="proprio" value="'.(GETPOST('proprio')?GETPOST('proprio','alpha'):$object->proprio).'">';
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td class="tdtop">'.$langs->trans("BankAccountOwnerAddress").'</td><td colspan="3">';
|
||||
print '<tr><td class="tdtop">'.$langs->trans("BankAccountOwnerAddress").'</td><td>';
|
||||
print "<textarea class=\"flat\" name=\"owner_address\" rows=\"2\" cols=\"40\">";
|
||||
print (GETPOST('owner_address')?GETPOST('owner_address','alpha'):$object->owner_address);
|
||||
print "</textarea></td></tr>";
|
||||
|
|
@ -503,8 +503,8 @@ if ($action == 'create')
|
|||
print '<table class="border" width="100%">';
|
||||
// Accountancy code
|
||||
$fieldrequired='';
|
||||
if (! empty($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED)) $fieldrequired='fieldrequired ';
|
||||
|
||||
if (! empty($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED)) $fieldrequired='fieldrequired ';
|
||||
|
||||
if (! empty($conf->accounting->enabled))
|
||||
{
|
||||
print '<tr><td class="'.$fieldrequired.'titlefieldcreate">'.$langs->trans("AccountancyCode").'</td>';
|
||||
|
|
@ -515,7 +515,7 @@ if ($action == 'create')
|
|||
else
|
||||
{
|
||||
print '<tr><td class="'.$fieldrequired.'titlefieldcreate">'.$langs->trans("AccountancyCode").'</td>';
|
||||
print '<td colspan="3"><input type="text" name="account_number" value="'.(GETPOST("account_number")?GETPOST('account_number', 'alpha'):$object->account_number).'"></td></tr>';
|
||||
print '<td><input type="text" name="account_number" value="'.(GETPOST("account_number")?GETPOST('account_number', 'alpha'):$object->account_number).'"></td></tr>';
|
||||
}
|
||||
|
||||
// Accountancy journal
|
||||
|
|
@ -565,10 +565,10 @@ else
|
|||
|
||||
// Onglets
|
||||
$head=bank_prepare_head($object);
|
||||
dol_fiche_head($head, 'bankname', $langs->trans("FinancialAccount"),0,'account');
|
||||
dol_fiche_head($head, 'bankname', $langs->trans("FinancialAccount"), -1, 'account');
|
||||
|
||||
$formconfirm = '';
|
||||
|
||||
|
||||
// Confirmation to delete
|
||||
if ($action == 'delete')
|
||||
{
|
||||
|
|
@ -578,24 +578,24 @@ else
|
|||
|
||||
// Print form confirm
|
||||
print $formconfirm;
|
||||
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/bank/index.php">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
|
||||
$morehtmlref='';
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
||||
|
||||
|
||||
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="fichehalfleft">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
|
||||
// Ref
|
||||
/*
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td>';
|
||||
print '<td colspan="3">';
|
||||
print '<td>';
|
||||
print $form->showrefnav($object, 'ref', $linkback, 1, 'ref');
|
||||
print '</td></tr>';*/
|
||||
|
||||
|
|
@ -662,25 +662,25 @@ else
|
|||
print $object->account_number;
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
// Accountancy journal
|
||||
if (! empty($conf->accounting->enabled))
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("AccountancyJournal").'</td>';
|
||||
print '<td>';
|
||||
|
||||
|
||||
$accountingjournal = new AccountingJournal($db);
|
||||
$accountingjournal->fetch($object->fk_accountancy_journal);
|
||||
|
||||
print $accountingjournal->getNomUrl(0,1,1,'',1);
|
||||
|
||||
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
// Other attributes
|
||||
$cols = 2;
|
||||
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
|
||||
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
|
|
@ -689,7 +689,7 @@ else
|
|||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
|
||||
// Categories
|
||||
if ($conf->categorie->enabled) {
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Categories").'</td><td>';
|
||||
|
|
@ -705,9 +705,9 @@ else
|
|||
if ($object->type == Account::TYPE_SAVINGS || $object->type == Account::TYPE_CURRENT)
|
||||
{
|
||||
print '<br>';
|
||||
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("BankName").'</td>';
|
||||
|
|
@ -726,7 +726,7 @@ else
|
|||
}
|
||||
|
||||
print '<tr><td>'.$langs->trans($val).'</td>';
|
||||
print '<td colspan="3">'.$content.'</td>';
|
||||
print '<td>'.$content.'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
|
|
@ -776,7 +776,7 @@ else
|
|||
print '</div>';
|
||||
|
||||
print '<div class="clearboth"></div>';
|
||||
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
/*
|
||||
|
|
@ -839,7 +839,7 @@ else
|
|||
dol_fiche_head('');
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Ref
|
||||
|
|
@ -921,7 +921,7 @@ else
|
|||
print '</td></tr>';
|
||||
|
||||
// Tags-Categories
|
||||
if ($conf->categorie->enabled)
|
||||
if ($conf->categorie->enabled)
|
||||
{
|
||||
print '<tr><td class="tdtop">'.$langs->trans("Categories").'</td><td>';
|
||||
$cate_arbo = $form->select_all_categories(Categorie::TYPE_ACCOUNT, '', 'parent', 64, 0, 1);
|
||||
|
|
@ -944,12 +944,13 @@ else
|
|||
print '</td></tr>';
|
||||
|
||||
// Other attributes
|
||||
$parameters=array('colspan' => 3);
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook) && ! empty($extrafields->attribute_label))
|
||||
{
|
||||
print $object->showOptionals($extrafields,'edit');
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '<br>';
|
||||
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ if ($action == 'add' && empty($cancel))
|
|||
$datep=dol_mktime(12,0,0, GETPOST("datepmonth"), GETPOST("datepday"), GETPOST("datepyear"));
|
||||
$datev=dol_mktime(12,0,0, GETPOST("datevmonth"), GETPOST("datevday"), GETPOST("datevyear"));
|
||||
if (empty($datev)) $datev=$datep;
|
||||
|
||||
|
||||
$object->accountid=GETPOST("accountid") > 0 ? GETPOST("accountid","int") : 0;
|
||||
$object->datev=$datev;
|
||||
$object->datep=$datep;
|
||||
|
|
@ -207,7 +207,7 @@ if ($action == 'create')
|
|||
print load_fiche_titre($langs->trans("NewVariousPayment"),'', 'title_accountancy.png');
|
||||
|
||||
dol_fiche_head('', '');
|
||||
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Date payment
|
||||
|
|
@ -274,7 +274,7 @@ if ($action == 'create')
|
|||
print $formaccounting->select_account($accountancy_code, 'accountancy_code', 1, null, 1, 1, '');
|
||||
print '</td></tr>';
|
||||
}
|
||||
else // For external software
|
||||
else // For external software
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("AccountAccounting").'</td>';
|
||||
print '<td class="maxwidthonsmartphone"><input class="minwidth100" name="accountancy_code" value="'.$accountancy_code.'">';
|
||||
|
|
@ -282,7 +282,7 @@ if ($action == 'create')
|
|||
}
|
||||
|
||||
// Other attributes
|
||||
$parameters=array('colspan' => ' colspan="1"');
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
|
||||
print '</table>';
|
||||
|
|
@ -315,7 +315,7 @@ if ($id)
|
|||
print '<table class="border" width="100%">';
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/bank/various_payment/index.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
|
||||
print "<tr>";
|
||||
print '<td class="titlefield">'.$langs->trans("Ref").'</td><td>';
|
||||
print $form->showrefnav($object, 'id', $linkback, 1, 'rowid', 'ref', '');
|
||||
|
|
@ -372,14 +372,14 @@ if ($id)
|
|||
}
|
||||
|
||||
// Other attributes
|
||||
$parameters=array('colspan' => ' colspan="1"');
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
$parameters=array('socid'=>$object->id);
|
||||
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
|
||||
|
||||
print '</table>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Action buttons
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -251,7 +251,7 @@ if ($action == 'create')
|
|||
print '<table class="border" width="100%">';
|
||||
|
||||
print "<tr>";
|
||||
print '<td width="25%" class="fieldrequired">'.$langs->trans("Type").'</td><td>';
|
||||
print '<td class="fieldrequired">'.$langs->trans("Type").'</td><td>';
|
||||
$form->select_type_fees(GETPOST('type','int'),'type',1);
|
||||
print '</td></tr>';
|
||||
|
||||
|
|
@ -277,7 +277,7 @@ if ($action == 'create')
|
|||
// Public note
|
||||
print '<tr>';
|
||||
print '<td class="tdtop">'.$langs->trans('NotePublic').'</td>';
|
||||
print '<td valign="top" colspan="2">';
|
||||
print '<td>';
|
||||
|
||||
$doleditor = new DolEditor('note_public', GETPOST('note_public', 'alpha'), '', 200, 'dolibarr_notes', 'In', false, true, true, ROWS_8,'90%');
|
||||
print $doleditor->Create(1);
|
||||
|
|
@ -289,7 +289,7 @@ if ($action == 'create')
|
|||
{
|
||||
print '<tr>';
|
||||
print '<td class="tdtop">'.$langs->trans('NotePrivate').'</td>';
|
||||
print '<td valign="top" colspan="2">';
|
||||
print '<td>';
|
||||
|
||||
$doleditor = new DolEditor('note_private', GETPOST('note_private', 'alpha'), '', 200, 'dolibarr_notes', 'In', false, true, true, ROWS_8, '90%');
|
||||
print $doleditor->Create(1);
|
||||
|
|
@ -298,7 +298,7 @@ if ($action == 'create')
|
|||
}
|
||||
|
||||
// Other attributes
|
||||
$parameters=array('colspan' => ' colspan="2"');
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
|
||||
print '</table>';
|
||||
|
|
@ -340,7 +340,7 @@ else if ($id)
|
|||
|
||||
// Ref
|
||||
print "<tr>";
|
||||
print '<td width="20%">'.$langs->trans("Ref").'</td><td>';
|
||||
print '<td class="titlefield">'.$langs->trans("Ref").'</td><td>';
|
||||
print $object->ref;
|
||||
print '</td></tr>';
|
||||
|
||||
|
|
@ -374,7 +374,7 @@ else if ($id)
|
|||
|
||||
// Public note
|
||||
print '<tr><td class="tdtop">'.$langs->trans("NotePublic").'</td>';
|
||||
print '<td valign="top" colspan="3">';
|
||||
print '<td>';
|
||||
|
||||
$doleditor = new DolEditor('note_public', $object->note_public, '', 200, 'dolibarr_notes', 'In', false, true, true, ROWS_8, '90%');
|
||||
print $doleditor->Create(1);
|
||||
|
|
@ -385,7 +385,7 @@ else if ($id)
|
|||
if (empty($user->societe_id))
|
||||
{
|
||||
print '<tr><td class="tdtop">'.$langs->trans("NotePrivate").'</td>';
|
||||
print '<td valign="top" colspan="3">';
|
||||
print '<td>';
|
||||
|
||||
$doleditor = new DolEditor('note_private', $object->note_private, '', 200, 'dolibarr_notes', 'In', false, true, true, ROWS_8, '90%');
|
||||
print $doleditor->Create(1);
|
||||
|
|
@ -394,7 +394,7 @@ else if ($id)
|
|||
}
|
||||
|
||||
// Other attributes
|
||||
$parameters=array('colspan' => ' colspan="3"');
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
|
||||
print '</table>';
|
||||
|
|
@ -412,7 +412,7 @@ else if ($id)
|
|||
else
|
||||
{
|
||||
/*
|
||||
* Confirm delete trip
|
||||
* Confirm delete trip
|
||||
*/
|
||||
if ($action == 'delete')
|
||||
{
|
||||
|
|
@ -501,9 +501,9 @@ else if ($id)
|
|||
// Statut
|
||||
print '<tr><td>'.$langs->trans("Status").'</td><td>'.$object->getLibStatut(4).'</td></tr>';
|
||||
|
||||
// Other attributes
|
||||
$parameters=array('colspan' => ' colspan="3"', 'showblocbydefault' => 1);
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
// Other attributes
|
||||
$parameters=array('socid'=>$object->id);
|
||||
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
|
||||
|
||||
print "</table><br>";
|
||||
|
||||
|
|
|
|||
|
|
@ -615,7 +615,7 @@ if (empty($reshook))
|
|||
$db->begin();
|
||||
|
||||
$amount_ht = $amount_tva = $amount_ttc = array();
|
||||
|
||||
|
||||
// Loop on each vat rate
|
||||
$i = 0;
|
||||
foreach ($object->lines as $line)
|
||||
|
|
@ -644,19 +644,19 @@ if (empty($reshook))
|
|||
$discount->fk_facture_source = $object->id;
|
||||
|
||||
$error = 0;
|
||||
|
||||
if ($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT || $object->type == Facture::TYPE_SITUATION)
|
||||
|
||||
if ($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT || $object->type == Facture::TYPE_SITUATION)
|
||||
{
|
||||
// If we're on a standard invoice, we have to get excess received to create a discount in TTC without VAT
|
||||
|
||||
|
||||
$sql = 'SELECT SUM(pf.amount) as total_paiements
|
||||
FROM llx_c_paiement as c, llx_paiement_facture as pf, llx_paiement as p
|
||||
WHERE pf.fk_facture = '.$object->id.' AND p.fk_paiement = c.id AND pf.fk_paiement = p.rowid ORDER BY p.datep, p.tms';
|
||||
|
||||
|
||||
$resql = $db->query($sql);
|
||||
$res = $db->fetch_object($resql);
|
||||
$total_paiements = $res->total_paiements;
|
||||
|
||||
|
||||
$discount->amount_ht = $discount->amount_ttc = $total_paiements - $object->total_ttc;
|
||||
$discount->amount_tva = 0;
|
||||
$discount->tva_tx = 0;
|
||||
|
|
@ -666,7 +666,7 @@ if (empty($reshook))
|
|||
{
|
||||
$error++;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
if ($object->type == Facture::TYPE_CREDIT_NOTE || $object->type == Facture::TYPE_DEPOSIT)
|
||||
{
|
||||
|
|
@ -676,7 +676,7 @@ if (empty($reshook))
|
|||
$discount->amount_tva = abs($amount_tva[$tva_tx]);
|
||||
$discount->amount_ttc = abs($amount_ttc[$tva_tx]);
|
||||
$discount->tva_tx = abs($tva_tx);
|
||||
|
||||
|
||||
$result = $discount->create($user);
|
||||
if ($result < 0)
|
||||
{
|
||||
|
|
@ -684,7 +684,7 @@ if (empty($reshook))
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (empty($error))
|
||||
|
|
@ -1027,7 +1027,7 @@ if (empty($reshook))
|
|||
}
|
||||
|
||||
$id = $object->create($user); // This include class to add_object_linked() and add add_contact()
|
||||
|
||||
|
||||
if ($id > 0)
|
||||
{
|
||||
dol_include_once('/' . $element . '/class/' . $subelement . '.class.php');
|
||||
|
|
@ -1049,13 +1049,13 @@ if (empty($reshook))
|
|||
{
|
||||
if ($typeamount == 'amount') $amount = $valuedeposit;
|
||||
else $amount = $srcobject->total_ttc * ($valuedeposit / 100);
|
||||
|
||||
|
||||
$TTotalByTva = array();
|
||||
foreach ($srcobject->lines as &$line)
|
||||
{
|
||||
$TTotalByTva[$line->tva_tx] += $line->total_ttc ;
|
||||
}
|
||||
|
||||
|
||||
$amount_to_diff = 0;
|
||||
foreach ($TTotalByTva as $tva => &$total)
|
||||
{
|
||||
|
|
@ -1099,10 +1099,10 @@ if (empty($reshook))
|
|||
$error ++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$amount_ttc_diff = $amountdeposit[0];
|
||||
}
|
||||
|
||||
|
||||
foreach ($amountdeposit as $tva => $amount)
|
||||
{
|
||||
$result = $object->addline(
|
||||
|
|
@ -1116,7 +1116,7 @@ if (empty($reshook))
|
|||
0, // remise_percent
|
||||
0, // date_start
|
||||
0, // date_end
|
||||
0,
|
||||
0,
|
||||
$lines[$i]->info_bits, // info_bits
|
||||
0,
|
||||
'HT',
|
||||
|
|
@ -1132,16 +1132,16 @@ if (empty($reshook))
|
|||
$langs->trans('Deposit')
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
$diff = $object->total_ttc - $amount_ttc_diff;
|
||||
|
||||
|
||||
if (!empty($conf->global->MAIN_DEPOSIT_MULTI_TVA) && $diff != 0)
|
||||
{
|
||||
$object->fetch_lines();
|
||||
$subprice_diff = $object->lines[0]->subprice - $diff / (1 + $object->lines[0]->tva_tx / 100);
|
||||
$object->updateline($object->lines[0]->id, $object->lines[0]->desc, $subprice_diff, $object->lines[0]->qty, $object->lines[0]->remise_percent, $object->lines[0]->date_start, $object->lines[0]->date_end, $object->lines[0]->tva_tx, 0, 0, 'HT', $object->lines[0]->info_bits, $object->lines[0]->product_type, 0, 0, 0, $object->lines[0]->pa_ht, $object->lines[0]->label, 0, array(), 100);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1219,7 +1219,7 @@ if (empty($reshook))
|
|||
|
||||
$tva_tx = $lines[$i]->tva_tx;
|
||||
if (! empty($lines[$i]->vat_src_code) && ! preg_match('/\(/', $tva_tx)) $tva_tx .= ' ('.$lines[$i]->vat_src_code.')';
|
||||
|
||||
|
||||
// View third's localtaxes for NOW and do not use value from origin.
|
||||
// TODO Is this really what we want ? Yes if source if template invoice but what if proposal or order ?
|
||||
$localtax1_tx = get_localtax($tva_tx, 1, $object->thirdparty);
|
||||
|
|
@ -1556,7 +1556,7 @@ if (empty($reshook))
|
|||
|
||||
$tmpvat = price2num(preg_replace('/\s*\(.*\)/', '', $tva_tx));
|
||||
$tmpprodvat = price2num(preg_replace('/\s*\(.*\)/', '', $prod->tva_tx));
|
||||
|
||||
|
||||
// if price ht was forced (ie: from gui when calculated by margin rate and cost price). TODO Why this ?
|
||||
if (! empty($price_ht))
|
||||
{
|
||||
|
|
@ -2123,11 +2123,11 @@ if ($action == 'create')
|
|||
|
||||
if (!empty($conf->multicurrency->enabled) && !empty($soc->multicurrency_code)) $currency_code = $soc->multicurrency_code;
|
||||
}
|
||||
|
||||
|
||||
if (!empty($soc->id)) $absolute_discount = $soc->getAvailableDiscounts();
|
||||
$note_public = $object->getDefaultCreateValueFor('note_public', (is_object($objectsrc)?$objectsrc->note_public:null));
|
||||
$note_private = $object->getDefaultCreateValueFor('note_private', ((! empty($origin) && ! empty($originid) && is_object($objectsrc))?$objectsrc->note_private:null));
|
||||
|
||||
|
||||
if (! empty($conf->use_javascript_ajax))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
|
||||
|
|
@ -2331,7 +2331,7 @@ if ($action == 'create')
|
|||
if ((empty($origin)) || ((($origin == 'propal') || ($origin == 'commande')) && (! empty($originid))))
|
||||
{
|
||||
// Deposit
|
||||
if (empty($conf->global->INVOICE_DISABLE_DEPOSIT))
|
||||
if (empty($conf->global->INVOICE_DISABLE_DEPOSIT))
|
||||
{
|
||||
print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">';
|
||||
$tmp='<input type="radio" id="radio_deposit" name="type" value="3"' . (GETPOST('type') == 3 ? ' checked' : '') . '> ';
|
||||
|
|
@ -2342,7 +2342,7 @@ if ($action == 'create')
|
|||
});
|
||||
});
|
||||
</script>';
|
||||
|
||||
|
||||
$desc = $form->textwithpicto($tmp.$langs->trans("InvoiceDeposit"), $langs->transnoentities("InvoiceDepositDesc"), 1, 'help', '', 0, 3);
|
||||
print '<table class="nobordernopadding"><tr><td>';
|
||||
print $desc;
|
||||
|
|
@ -2356,7 +2356,7 @@ if ($action == 'create')
|
|||
print '<td class="nowrap" style="padding-left: 5px">' . $langs->trans('Value') . ':<input type="text" id="valuedeposit" name="valuedeposit" size="3" value="' . GETPOST('valuedeposit', 'int') . '"/>';
|
||||
}
|
||||
print '</td></tr></table>';
|
||||
|
||||
|
||||
print '</div></div>';
|
||||
}
|
||||
}
|
||||
|
|
@ -2388,7 +2388,7 @@ if ($action == 'create')
|
|||
}
|
||||
|
||||
// Replacement
|
||||
if (empty($conf->global->INVOICE_DISABLE_REPLACEMENT))
|
||||
if (empty($conf->global->INVOICE_DISABLE_REPLACEMENT))
|
||||
{
|
||||
print '<!-- replacement line -->';
|
||||
print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">';
|
||||
|
|
@ -2435,7 +2435,7 @@ if ($action == 'create')
|
|||
if ($socid > 0)
|
||||
{
|
||||
// Credit note
|
||||
if (empty($conf->global->INVOICE_DISABLE_CREDIT_NOTE))
|
||||
if (empty($conf->global->INVOICE_DISABLE_CREDIT_NOTE))
|
||||
{
|
||||
print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">';
|
||||
$tmp='<input type="radio" id="radio_creditnote" name="type" value="2"' . (GETPOST('type') == 2 ? ' checked' : '');
|
||||
|
|
@ -2471,12 +2471,12 @@ if ($action == 'create')
|
|||
$text .= '</select>';
|
||||
$desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceAvoirDesc"), 1, 'help', '', 0, 3);
|
||||
print $desc;
|
||||
|
||||
|
||||
print '<div id="credit_note_options" class="clearboth">';
|
||||
print ' <input data-role="none" type="checkbox" name="invoiceAvoirWithLines" id="invoiceAvoirWithLines" value="1" onclick="if($(this).is(\':checked\') ) { $(\'#radio_creditnote\').prop(\'checked\', true); $(\'#invoiceAvoirWithPaymentRestAmount\').removeAttr(\'checked\'); }" '.(GETPOST('invoiceAvoirWithLines','int')>0 ? 'checked':'').' /> <label for="invoiceAvoirWithLines">'.$langs->trans('invoiceAvoirWithLines')."</label>";
|
||||
print '<br> <input data-role="none" type="checkbox" name="invoiceAvoirWithPaymentRestAmount" id="invoiceAvoirWithPaymentRestAmount" value="1" onclick="if($(this).is(\':checked\') ) { $(\'#radio_creditnote\').prop(\'checked\', true); $(\'#invoiceAvoirWithLines\').removeAttr(\'checked\'); }" '.(GETPOST('invoiceAvoirWithPaymentRestAmount','int')>0 ? 'checked':'').' /> <label for="invoiceAvoirWithPaymentRestAmount">'.$langs->trans('invoiceAvoirWithPaymentRestAmount')."</label>";
|
||||
print '</div>';
|
||||
|
||||
|
||||
print '</div></div>';
|
||||
}
|
||||
}
|
||||
|
|
@ -2492,7 +2492,7 @@ if ($action == 'create')
|
|||
print '</div></div>' . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Template invoice
|
||||
print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">';
|
||||
$tmp='<input type="radio" name="type" id="radio_template" value="0" disabled> ';
|
||||
|
|
@ -2589,9 +2589,8 @@ if ($action == 'create')
|
|||
}
|
||||
|
||||
// Other attributes
|
||||
$parameters = array('objectsrc' => $objectsrc,'colspan' => ' colspan="3"');
|
||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by
|
||||
// hook
|
||||
$parameters = array('objectsrc' => $objectsrc,'colspan' => ' colspan="2"', 'cols'=>2);
|
||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook) && ! empty($extrafields->attribute_label)) {
|
||||
print $object->showOptionals($extrafields, 'edit');
|
||||
}
|
||||
|
|
@ -2731,7 +2730,7 @@ if ($action == 'create')
|
|||
{
|
||||
print '<tr><td>' . $langs->trans('MulticurrencyTotalHT') . '</td><td colspan="2">' . price($objectsrc->multicurrency_total_ht) . '</td></tr>';
|
||||
print '<tr><td>' . $langs->trans('MulticurrencyTotalVAT') . '</td><td colspan="2">' . price($objectsrc->multicurrency_total_tva) . "</td></tr>";
|
||||
print '<tr><td>' . $langs->trans('MulticurrencyTotalTTC') . '</td><td colspan="2">' . price($objectsrc->multicurrency_total_ttc) . "</td></tr>";
|
||||
print '<tr><td>' . $langs->trans('MulticurrencyTotalTTC') . '</td><td colspan="2">' . price($objectsrc->multicurrency_total_ttc) . "</td></tr>";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -3488,21 +3487,21 @@ else if ($id > 0 || ! empty($ref))
|
|||
print '<div class="fichehalfright">';
|
||||
print '<div class="ficheaddleft">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
|
||||
if (!empty($conf->multicurrency->enabled) && ($object->multicurrency_code != $conf->currency))
|
||||
{
|
||||
// Multicurrency Amount HT
|
||||
print '<tr><td class="titlefieldmiddle">' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . '</td>';
|
||||
print '<td class="nowrap amountcard">' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
// Multicurrency Amount VAT
|
||||
print '<tr><td>' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . '</td>';
|
||||
print '<td class="nowrap amountcard">' . price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
// Multicurrency Amount TTC
|
||||
print '<tr><td>' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . '</td>';
|
||||
print '<td class="nowrap amountcard">' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>';
|
||||
|
|
@ -3584,12 +3583,12 @@ else if ($id > 0 || ! empty($ref))
|
|||
$nbrows += 5;
|
||||
if (! empty($conf->incoterm->enabled))
|
||||
$nbrows += 1;
|
||||
|
||||
if ($object->type == Facture::TYPE_SITUATION && ! empty($conf->global->INVOICE_USE_SITUATION))
|
||||
|
||||
if ($object->type == Facture::TYPE_SITUATION && ! empty($conf->global->INVOICE_USE_SITUATION))
|
||||
{
|
||||
if (count($object->tab_previous_situation_invoice) > 0 || count($object->tab_next_situation_invoice) > 0)
|
||||
print '<table class="nobordernopadding paymenttable" width="100%">';
|
||||
|
||||
|
||||
if (count($object->tab_previous_situation_invoice) > 0) {
|
||||
// List of previous invoices
|
||||
print '<tr class="liste_titre">';
|
||||
|
|
@ -3601,7 +3600,7 @@ else if ($id > 0 || ! empty($ref))
|
|||
print '<td align="right">' . $langs->trans('AmountTTC') . '</td>';
|
||||
print '<td width="18"> </td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
$total_prev_ht = $total_prev_ttc = 0;
|
||||
foreach ($object->tab_previous_situation_invoice as $prev_invoice) {
|
||||
$totalpaye = $prev_invoice->getSommePaiement();
|
||||
|
|
@ -3616,9 +3615,9 @@ else if ($id > 0 || ! empty($ref))
|
|||
print '<td align="right">' . price($prev_invoice->total_ttc) . '</td>';
|
||||
print '<td align="right">' . $prev_invoice->getLibStatut(3, $totalpaye) . '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td colspan="2" align="right"></td>';
|
||||
print '<td align="right"><b>' . price($total_prev_ht) . '</b></td>';
|
||||
|
|
@ -3626,7 +3625,7 @@ else if ($id > 0 || ! empty($ref))
|
|||
print '<td width="18"> </td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
|
||||
if (count($object->tab_next_situation_invoice) > 0) {
|
||||
// List of next invoices
|
||||
print '<tr class="liste_titre">';
|
||||
|
|
@ -3637,9 +3636,9 @@ else if ($id > 0 || ! empty($ref))
|
|||
print '<td align="right">' . $langs->trans('AmountTTC') . '</td>';
|
||||
print '<td width="18"> </td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
$total_next_ht = $total_next_ttc = 0;
|
||||
|
||||
|
||||
foreach ($object->tab_next_situation_invoice as $next_invoice) {
|
||||
$totalpaye = $next_invoice->getSommePaiement();
|
||||
$total_next_ht += $next_invoice->total_ht;
|
||||
|
|
@ -3652,9 +3651,9 @@ else if ($id > 0 || ! empty($ref))
|
|||
print '<td align="right">' . price($next_invoice->total_ttc) . '</td>';
|
||||
print '<td align="right">' . $next_invoice->getLibStatut(3, $totalpaye) . '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td colspan="2" align="right"></td>';
|
||||
if (! empty($conf->banque->enabled)) print '<td align="right"></td>';
|
||||
|
|
@ -3664,7 +3663,7 @@ else if ($id > 0 || ! empty($ref))
|
|||
print '<td width="18"> </td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
|
||||
if (count($object->tab_previous_situation_invoice) > 0 || count($object->tab_next_situation_invoice) > 0)
|
||||
print '</table>';
|
||||
}
|
||||
|
|
@ -3741,7 +3740,7 @@ else if ($id > 0 || ! empty($ref))
|
|||
print '</tr>';
|
||||
$i ++;
|
||||
}
|
||||
}
|
||||
}
|
||||
/*else {
|
||||
print '<tr class="oddeven"><td colspan="' . $nbcols . '" class="opacitymedium">' . $langs->trans("None") . '</td><td></td><td></td></tr>';
|
||||
}*/
|
||||
|
|
@ -3837,7 +3836,7 @@ else if ($id > 0 || ! empty($ref))
|
|||
|
||||
// Billed
|
||||
print '<tr><td colspan="' . $nbcols . '" align="right">' . $langs->trans("Billed") . ' :</td><td align="right">' . price($object->total_ttc) . '</td><td> </td></tr>';
|
||||
|
||||
|
||||
// Remainder to pay
|
||||
print '<tr><td colspan="' . $nbcols . '" align="right">';
|
||||
if ($resteapayeraffiche >= 0)
|
||||
|
|
@ -3847,11 +3846,11 @@ else if ($id > 0 || ! empty($ref))
|
|||
print ' :</td>';
|
||||
print '<td align="right"'.($resteapayeraffiche?' class="amountremaintopay"':(' class="'.$cssforamountpaymentcomplete.'"')).'>' . price($resteapayeraffiche) . '</td>';
|
||||
print '<td class="nowrap"> </td></tr>';
|
||||
}
|
||||
}
|
||||
else // Credit note
|
||||
{
|
||||
$cssforamountpaymentcomplete='';
|
||||
|
||||
|
||||
// Total already paid back
|
||||
print '<tr><td colspan="' . $nbcols . '" align="right">';
|
||||
print $langs->trans('AlreadyPaidBack');
|
||||
|
|
@ -3909,14 +3908,14 @@ else if ($id > 0 || ! empty($ref))
|
|||
{
|
||||
if ($object->situation_cycle_ref && $object->statut == 0) {
|
||||
print '<div class="div-table-responsive">';
|
||||
|
||||
|
||||
print '<form name="updatealllines" id="updatealllines" action="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '#updatealllines" method="POST">';
|
||||
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '" />';
|
||||
print '<input type="hidden" name="action" value="updatealllines" />';
|
||||
print '<input type="hidden" name="id" value="' . $object->id . '" />';
|
||||
|
||||
|
||||
print '<table id="tablelines_all_progress" class="noborder noshadow" width="100%">';
|
||||
|
||||
|
||||
print '<tr class="liste_titre nodrag nodrop">';
|
||||
|
||||
if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) {
|
||||
|
|
@ -3954,11 +3953,11 @@ else if ($id > 0 || ! empty($ref))
|
|||
print '<td align="right" class="nowrap"><input type="text" size="1" value="" name="all_progress">%</td>';
|
||||
print '<td colspan="4" align="right"><input class="button" type="submit" name="all_percent" value="Modifier" /></td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
||||
print '</form>';
|
||||
|
||||
|
||||
print '</div>';
|
||||
}
|
||||
}
|
||||
|
|
@ -3969,14 +3968,14 @@ else if ($id > 0 || ! empty($ref))
|
|||
<input type="hidden" name="mode" value="">
|
||||
<input type="hidden" name="id" value="' . $object->id . '">
|
||||
';
|
||||
|
||||
|
||||
if (! empty($conf->use_javascript_ajax) && $object->statut == 0) {
|
||||
include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php';
|
||||
}
|
||||
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table id="tablelines" class="noborder noshadow" width="100%">';
|
||||
|
||||
|
||||
// Show object lines
|
||||
if (! empty($object->lines))
|
||||
$ret = $object->printObjectLines($action, $mysoc, $soc, $lineid, 1);
|
||||
|
|
@ -4037,10 +4036,10 @@ else if ($id > 0 || ! empty($ref))
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$discount = new DiscountAbsolute($db);
|
||||
$result = $discount->fetch(0, $object->id);
|
||||
|
||||
|
||||
// Reopen a standard paid invoice
|
||||
if ((($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT)
|
||||
|| ($object->type == Facture::TYPE_CREDIT_NOTE && empty($discount->id))
|
||||
|
|
@ -4097,7 +4096,7 @@ else if ($id > 0 || ! empty($ref))
|
|||
//print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("AmountMustBePositive")).'">'.$langs->trans("MakeWithdrawRequest").'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Create payment
|
||||
if ($object->type != Facture::TYPE_CREDIT_NOTE && $object->statut == 1 && $object->paye == 0 && $user->rights->facture->paiement) {
|
||||
if ($objectidnext) {
|
||||
|
|
@ -4253,7 +4252,7 @@ else if ($id > 0 || ! empty($ref))
|
|||
// Show links to link elements
|
||||
$linktoelem = $form->showLinkToObjectBlock($object, null, array('invoice'));
|
||||
$somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
|
||||
|
||||
|
||||
// Link for paypal payment
|
||||
if (! empty($conf->paypal->enabled) && $object->statut != 0) {
|
||||
include_once DOL_DOCUMENT_ROOT . '/paypal/lib/paypal.lib.php';
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ if ($id)
|
|||
if ($action == 'create')
|
||||
{
|
||||
print load_fiche_titre($langs->transcountry($lttype==2?"newLT2Payment":"newLT1Payment",$mysoc->country_code));
|
||||
|
||||
|
||||
print '<form name="add" action="'.$_SERVER["PHP_SELF"].'" name="formlocaltax" method="post">'."\n";
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="localTaxType" value="'.$lttype.'">';
|
||||
|
|
@ -193,14 +193,14 @@ if ($action == 'create')
|
|||
$form->select_types_paiements(GETPOST("paiementtype"), "paiementtype");
|
||||
print "</td>\n";
|
||||
print "</tr>";
|
||||
|
||||
|
||||
// Number
|
||||
print '<tr><td>'.$langs->trans('Numero');
|
||||
print ' <em>('.$langs->trans("ChequeOrTransferNumber").')</em>';
|
||||
print '<td><input name="num_payment" type="text" value="'.GETPOST("num_payment").'"></td></tr>'."\n";
|
||||
}
|
||||
// Other attributes
|
||||
$parameters=array('colspan' => ' colspan="1"');
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
|
||||
print '</table>';
|
||||
|
|
@ -237,20 +237,20 @@ if ($id)
|
|||
print '<table class="border" width="100%">';
|
||||
|
||||
print "<tr>";
|
||||
print '<td width="25%">'.$langs->trans("Ref").'</td><td colspan="3">';
|
||||
print '<td width="25%">'.$langs->trans("Ref").'</td><td>';
|
||||
print $vatpayment->ref;
|
||||
print '</td></tr>';
|
||||
|
||||
print "<tr>";
|
||||
print '<td>'.$langs->trans("DatePayment").'</td><td colspan="3">';
|
||||
print '<td>'.$langs->trans("DatePayment").'</td><td>';
|
||||
print dol_print_date($vatpayment->datep,'day');
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("DateValue").'</td><td colspan="3">';
|
||||
print '<tr><td>'.$langs->trans("DateValue").'</td><td>';
|
||||
print dol_print_date($vatpayment->datev,'day');
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Amount").'</td><td colspan="3">'.price($vatpayment->amount).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Amount").'</td><td>'.price($vatpayment->amount).'</td></tr>';
|
||||
|
||||
if (! empty($conf->banque->enabled))
|
||||
{
|
||||
|
|
@ -261,7 +261,7 @@ if ($id)
|
|||
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans('BankTransactionLine').'</td>';
|
||||
print '<td colspan="3">';
|
||||
print '<td>';
|
||||
print $bankline->getNomUrl(1,0,'showall');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
|
@ -269,13 +269,13 @@ if ($id)
|
|||
}
|
||||
|
||||
// Other attributes
|
||||
$parameters=array('colspan' => ' colspan="3"');
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$vatpayment,$action); // Note that $action and $object may have been modified by hook
|
||||
|
||||
|
||||
print '</table>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Boutons d'actions
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
|
|
@ -107,33 +107,32 @@ if ($result)
|
|||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||
|
||||
|
||||
print_barre_liste($langs->trans("WithdrawalsReceipts"), $page, $_SERVER["PHP_SELF"], $urladd, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_generic', 0, '', '', $limit);
|
||||
|
||||
$moreforfilter='';
|
||||
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="search_ref" value="'. $db->escape($search_ref).'"></td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre" align="right">';
|
||||
$searchpicto=$form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("WithdrawalsReceipts"),$_SERVER["PHP_SELF"],"p.ref",'','','class="liste_titre"');
|
||||
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"p.datec","","",'class="liste_titre" align="center"');
|
||||
print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"","","",'align="center"');
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="search_ref" value="'. $db->escape($search_ref).'"></td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre" align="right">';
|
||||
$searchpicto=$form->showFilterAndCheckAddButtons(0);
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
while ($i < min($num,$limit))
|
||||
{
|
||||
$obj = $db->fetch_object($result);
|
||||
$obj = $db->fetch_object($result);
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
|
||||
|
|
@ -151,9 +150,9 @@ if ($result)
|
|||
}
|
||||
print "</table>";
|
||||
print '</div>';
|
||||
|
||||
|
||||
print '</form>';
|
||||
|
||||
|
||||
$db->free($result);
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -94,9 +94,7 @@ llxHeader('', $langs->trans("NewStandingOrder"));
|
|||
if (prelevement_check_config() < 0)
|
||||
{
|
||||
$langs->load("errors");
|
||||
print '<div class="error">';
|
||||
print $langs->trans("ErrorModuleSetupNotComplete");
|
||||
print '</div>';
|
||||
setEventMessages($langs->trans("ErrorModuleSetupNotComplete"), null, 'errors');
|
||||
}
|
||||
|
||||
/*$h=0;
|
||||
|
|
@ -148,7 +146,7 @@ if ($nb)
|
|||
}
|
||||
else
|
||||
{
|
||||
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->transnoentitiesnoconv("NoInvoiceToWithdraw")).'">'.$langs->trans("CreateAll")."</a>\n";
|
||||
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->transnoentitiesnoconv("NoInvoiceToWithdraw", $langs->transnoentitiesnoconv("StandingOrders"))).'">'.$langs->trans("CreateAll")."</a>\n";
|
||||
}
|
||||
|
||||
print "</div>\n";
|
||||
|
|
@ -194,7 +192,7 @@ if ($resql)
|
|||
while ($i < $num && $i < 20)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>';
|
||||
$invoicestatic->id=$obj->rowid;
|
||||
|
|
@ -268,7 +266,7 @@ if ($result)
|
|||
while ($i < min($num,$limit))
|
||||
{
|
||||
$obj = $db->fetch_object($result);
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ if ($resql)
|
|||
$invoicestatic->type=$obj->type;
|
||||
$alreadypayed=$invoicestatic->getSommePaiement();
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $invoicestatic->getNomUrl(1,'withdraw');
|
||||
print '</td>';
|
||||
|
|
@ -157,7 +157,7 @@ if ($resql)
|
|||
}
|
||||
else
|
||||
{
|
||||
print '<tr '.$bc[false].'><td colspan="2" class="opacitymedium">'.$langs->trans("NoInvoiceToWithdraw").'</td></tr>';
|
||||
print '<tr class="oddeven"><td colspan="5" class="opacitymedium">'.$langs->trans("NoInvoiceToWithdraw", $langs->transnoentitiesnoconv("StandingOrders")).'</td></tr>';
|
||||
}
|
||||
print "</table><br>";
|
||||
}
|
||||
|
|
@ -197,7 +197,7 @@ if ($result)
|
|||
while ($i < min($num,$limit))
|
||||
{
|
||||
$obj = $db->fetch_object($result);
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
|
|
|
|||
|
|
@ -130,10 +130,24 @@ if ($result)
|
|||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="GET">';
|
||||
|
||||
$moreforfilter='';
|
||||
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" name="search_line" value="'. dol_escape_htmltag($search_line).'" size="6"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" name="search_bon" value="'. dol_escape_htmltag($search_bon).'" size="6"></td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" name="search_company" value="'. dol_escape_htmltag($search_company).'" size="6"></td>';
|
||||
print '<td class="liste_titre" align="center"><input type="text" class="flat" name="search_code" value="'. dol_escape_htmltag($search_code).'" size="6"></td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre" align="right">';
|
||||
$searchpicto=$form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Line"),$_SERVER["PHP_SELF"]);
|
||||
print_liste_field_titre($langs->trans("WithdrawalsReceipts"),$_SERVER["PHP_SELF"],"p.ref");
|
||||
|
|
@ -144,24 +158,10 @@ if ($result)
|
|||
print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"pl.amount","","",'align="right"');
|
||||
print_liste_field_titre('');
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" name="search_line" value="'. dol_escape_htmltag($search_line).'" size="6"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" name="search_bon" value="'. dol_escape_htmltag($search_bon).'" size="6"></td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" name="search_company" value="'. dol_escape_htmltag($search_company).'" size="6"></td>';
|
||||
print '<td class="liste_titre" align="center"><input type="text" class="flat" name="search_code" value="'. dol_escape_htmltag($search_code).'" size="6"></td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre" align="right">';
|
||||
$searchpicto=$form->showFilterAndCheckAddButtons(0);
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
while ($i < min($num,$limit))
|
||||
{
|
||||
$obj = $db->fetch_object($result);
|
||||
$obj = $db->fetch_object($result);
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
|
||||
|
|
@ -199,9 +199,9 @@ if ($result)
|
|||
}
|
||||
print "</table>";
|
||||
print '</div>';
|
||||
|
||||
|
||||
print '</form>';
|
||||
|
||||
|
||||
$db->free($result);
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/* Copyright (C) 2011-2017 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
* Copyright (C) 2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2015 Charlie BENKE <charlie@patas-monkey.com>
|
||||
* Copyright (C) 2015 Charlie BENKE <charlie@patas-monkey.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -72,7 +72,7 @@ if ($action == 'add' && $_POST["cancel"] <> $langs->trans("Cancel"))
|
|||
$datesp=dol_mktime(12,0,0, $_POST["datespmonth"], $_POST["datespday"], $_POST["datespyear"]);
|
||||
$dateep=dol_mktime(12,0,0, $_POST["dateepmonth"], $_POST["dateepday"], $_POST["dateepyear"]);
|
||||
if (empty($datev)) $datev=$datep;
|
||||
|
||||
|
||||
$object->accountid=GETPOST("accountid") > 0 ? GETPOST("accountid","int") : 0;
|
||||
$object->fk_user=GETPOST("fk_user") > 0 ? GETPOST("fk_user","int") : 0;
|
||||
$object->datev=$datev;
|
||||
|
|
@ -116,7 +116,7 @@ if ($action == 'add' && $_POST["cancel"] <> $langs->trans("Cancel"))
|
|||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("BankAccount")), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$db->begin();
|
||||
|
|
@ -229,7 +229,7 @@ if ($action == 'create')
|
|||
print load_fiche_titre($langs->trans("NewSalaryPayment"),'', 'title_accountancy.png');
|
||||
|
||||
dol_fiche_head('', '');
|
||||
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Date payment
|
||||
|
|
@ -300,7 +300,7 @@ if ($action == 'create')
|
|||
}
|
||||
|
||||
// Other attributes
|
||||
$parameters=array('colspan' => ' colspan="1"');
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
|
||||
print '</table>';
|
||||
|
|
@ -351,24 +351,24 @@ if ($id)
|
|||
print '<tr><td class="titlefield">'.$langs->trans("Label").'</td><td>'.$object->label.'</td></tr>';
|
||||
|
||||
print "<tr>";
|
||||
print '<td>'.$langs->trans("DateStartPeriod").'</td><td colspan="3">';
|
||||
print '<td>'.$langs->trans("DateStartPeriod").'</td><td>';
|
||||
print dol_print_date($object->datesp,'day');
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("DateEndPeriod").'</td><td colspan="3">';
|
||||
print '<tr><td>'.$langs->trans("DateEndPeriod").'</td><td>';
|
||||
print dol_print_date($object->dateep,'day');
|
||||
print '</td></tr>';
|
||||
|
||||
print "<tr>";
|
||||
print '<td>'.$langs->trans("DatePayment").'</td><td colspan="3">';
|
||||
print '<td>'.$langs->trans("DatePayment").'</td><td>';
|
||||
print dol_print_date($object->datep,'day');
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("DateValue").'</td><td colspan="3">';
|
||||
print '<tr><td>'.$langs->trans("DateValue").'</td><td>';
|
||||
print dol_print_date($object->datev,'day');
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Amount").'</td><td colspan="3">'.price($object->amount,0,$outputlangs,1,-1,-1,$conf->currency).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Amount").'</td><td>'.price($object->amount,0,$outputlangs,1,-1,-1,$conf->currency).'</td></tr>';
|
||||
|
||||
if (! empty($conf->banque->enabled))
|
||||
{
|
||||
|
|
@ -379,7 +379,7 @@ if ($id)
|
|||
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans('BankTransactionLine').'</td>';
|
||||
print '<td colspan="3">';
|
||||
print '<td>';
|
||||
print $bankline->getNomUrl(1,0,'showall');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
|
@ -387,7 +387,7 @@ if ($id)
|
|||
}
|
||||
|
||||
// Other attributes
|
||||
$parameters=array('colspan' => ' colspan="3"');
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
|
||||
print '</table>';
|
||||
|
|
@ -396,7 +396,7 @@ if ($id)
|
|||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Action buttons
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ if ($action == 'setdatev' && $user->rights->tax->charges->creer)
|
|||
$object->datev=dol_mktime(12,0,0,$_POST['datevmonth'],$_POST['datevday'],$_POST['datevyear']);
|
||||
$result=$object->update($user);
|
||||
if ($result < 0) dol_print_error($db,$object->error);
|
||||
|
||||
|
||||
$action='';
|
||||
}
|
||||
|
||||
|
|
@ -81,7 +81,7 @@ if ($action == 'add' && $_POST["cancel"] <> $langs->trans("Cancel"))
|
|||
$object->num_payment=GETPOST("num_payment");
|
||||
$object->datev=$datev;
|
||||
$object->datep=$datep;
|
||||
|
||||
|
||||
$amount = price2num(GETPOST("amount"));
|
||||
if ($refund == 1) {
|
||||
$amount= -$amount;
|
||||
|
|
@ -89,7 +89,7 @@ if ($action == 'add' && $_POST["cancel"] <> $langs->trans("Cancel"))
|
|||
$object->amount= $amount;
|
||||
$object->label=GETPOST("label");
|
||||
$object->note=GETPOST("note");
|
||||
|
||||
|
||||
if (empty($object->datev))
|
||||
{
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateValue")), null, 'errors');
|
||||
|
|
@ -207,11 +207,11 @@ if ($action == 'create')
|
|||
print '$(document).ready(function () {
|
||||
$("#radiopayment").click(function() {
|
||||
$("#label").val($(this).data("label"));
|
||||
|
||||
|
||||
});
|
||||
$("#radiorefund").click(function() {
|
||||
$("#label").val($(this).data("label"));
|
||||
|
||||
|
||||
});
|
||||
});';
|
||||
print '</script>'."\n";
|
||||
|
|
@ -282,7 +282,7 @@ if ($action == 'create')
|
|||
print '<td><input name="num_payment" type="text" value="'.GETPOST("num_payment").'"></td></tr>'."\n";
|
||||
|
||||
// Other attributes
|
||||
$parameters=array('colspan' => ' colspan="1"');
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
|
||||
print '</table>';
|
||||
|
|
@ -349,7 +349,8 @@ if ($id)
|
|||
}
|
||||
|
||||
// Other attributes
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions','',$object,$action); // Note that $action and $object may have been modified by hook
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
|
|
|||
|
|
@ -316,7 +316,7 @@ if (empty($reshook))
|
|||
$object->photo = dol_sanitizeFileName($_FILES['photo']['name']);
|
||||
|
||||
// Create thumbs
|
||||
$object->addThumbs($newfile);
|
||||
$object->addThumbs($newfile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -664,7 +664,7 @@ else
|
|||
}
|
||||
|
||||
// Other attributes
|
||||
$parameters=array('colspan' => ' colspan="3"');
|
||||
$parameters=array('colspan' => ' colspan="3"','cols'=>3);
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook) && ! empty($extrafields->attribute_label))
|
||||
{
|
||||
|
|
@ -674,7 +674,7 @@ else
|
|||
print "</table><br>";
|
||||
|
||||
print '<hr style="margin-bottom: 20px">';
|
||||
|
||||
|
||||
// Add personnal information
|
||||
print load_fiche_titre('<div class="comboperso">'.$langs->trans("PersonalInformations").'</div>','','');
|
||||
|
||||
|
|
@ -787,7 +787,7 @@ else
|
|||
print $object->ref;
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
// Lastname
|
||||
print '<tr><td class="titlefieldcreate fieldrequired"><label for="lastname">'.$langs->trans("Lastname").' / '.$langs->trans("Label").'</label></td>';
|
||||
print '<td colspan="3"><input name="lastname" id="lastname" type="text" class="minwidth200" maxlength="80" value="'.(isset($_POST["lastname"])?GETPOST("lastname"):$object->lastname).'" autofocus="autofocus"></td>';
|
||||
|
|
@ -932,7 +932,7 @@ else
|
|||
}
|
||||
|
||||
// Other attributes
|
||||
$parameters=array('colspan' => ' colspan="3"');
|
||||
$parameters=array('colspan' => ' colspan="3"', 'cols'=>3);
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook) && ! empty($extrafields->attribute_label))
|
||||
{
|
||||
|
|
@ -1054,7 +1054,7 @@ else
|
|||
}
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/contact/list.php">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
|
||||
$morehtmlref='<div class="refidno">';
|
||||
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
|
||||
{
|
||||
|
|
@ -1064,14 +1064,14 @@ else
|
|||
if ($objsoc->id > 0) $morehtmlref.=$objsoc->getNomUrl(1);
|
||||
else $morehtmlref.=$langs->trans("ContactNotLinkedToCompany");
|
||||
}
|
||||
$morehtmlref.='</div>';
|
||||
|
||||
$morehtmlref.='</div>';
|
||||
|
||||
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref);
|
||||
|
||||
|
||||
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="fichehalfleft">';
|
||||
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border tableforfield" width="100%">';
|
||||
|
||||
|
|
@ -1102,26 +1102,14 @@ else
|
|||
print $object->LibPubPriv($object->priv);
|
||||
print '</td></tr>';
|
||||
|
||||
// Note Public
|
||||
/*
|
||||
print '<tr><td class="tdtop">'.$langs->trans("NotePublic").'</td><td>';
|
||||
print nl2br($object->note_public);
|
||||
print '</td></tr>';
|
||||
|
||||
// Note Private
|
||||
print '<tr><td class="tdtop">'.$langs->trans("NotePrivate").'</td><td>';
|
||||
print nl2br($object->note_private);
|
||||
print '</td></tr>';
|
||||
*/
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
||||
print '</div>';
|
||||
print '<div class="fichehalfright"><div class="ficheaddleft">';
|
||||
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border tableforfield" width="100%">';
|
||||
|
||||
|
||||
// Categories
|
||||
if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire)) {
|
||||
print '<tr><td class="titlefield">' . $langs->trans("Categories") . '</td>';
|
||||
|
|
@ -1130,14 +1118,10 @@ else
|
|||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Other attributes
|
||||
$parameters=array('socid'=>$socid, 'colspan' => ' colspan="3"');
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
if (empty($reshook) && ! empty($extrafields->attribute_label))
|
||||
{
|
||||
print $object->showOptionals($extrafields);
|
||||
}
|
||||
// Other attributes
|
||||
$cols = 3;
|
||||
$parameyers=array('socid'=>$socid);
|
||||
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
|
||||
|
||||
$object->load_ref_elements();
|
||||
|
||||
|
|
@ -1193,10 +1177,10 @@ else
|
|||
print '</td></tr>';
|
||||
|
||||
print "</table>";
|
||||
|
||||
|
||||
print '</div></div></div>';
|
||||
print '<div style="clear:both"></div>';
|
||||
|
||||
|
||||
print dol_fiche_end();
|
||||
|
||||
// Barre d'actions
|
||||
|
|
|
|||
|
|
@ -104,13 +104,13 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
|
|||
if (empty($reshook))
|
||||
{
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once
|
||||
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once
|
||||
|
||||
|
||||
if ($action == 'confirm_active' && $confirm == 'yes' && $user->rights->contrat->activer)
|
||||
{
|
||||
$result = $object->active_line($user, GETPOST('ligne'), GETPOST('date'), GETPOST('dateend'), GETPOST('comment'));
|
||||
|
||||
|
||||
if ($result > 0)
|
||||
{
|
||||
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
|
||||
|
|
@ -136,13 +136,13 @@ if (empty($reshook))
|
|||
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Si ajout champ produit predefini
|
||||
if (GETPOST('mode')=='predefined')
|
||||
{
|
||||
|
|
@ -157,7 +157,7 @@ if (empty($reshook))
|
|||
$date_end=dol_mktime(GETPOST('date_endhour'), GETPOST('date_endmin'), 0, GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Si ajout champ produit libre
|
||||
if (GETPOST('mode')=='libre')
|
||||
{
|
||||
|
|
@ -172,7 +172,7 @@ if (empty($reshook))
|
|||
$date_end_sl=dol_mktime(GETPOST('date_end_slhour'), GETPOST('date_end_slmin'), 0, GETPOST('date_end_slmonth'), GETPOST('date_end_slday'), GETPOST('date_end_slyear'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Param dates
|
||||
$date_contrat='';
|
||||
$date_start_update='';
|
||||
|
|
@ -199,7 +199,7 @@ if (empty($reshook))
|
|||
{
|
||||
$datecontrat = dol_mktime(GETPOST('rehour'), GETPOST('remin'), 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear'));
|
||||
}
|
||||
|
||||
|
||||
// Add contract
|
||||
if ($action == 'add' && $user->rights->contrat->creer)
|
||||
{
|
||||
|
|
@ -210,29 +210,29 @@ if (empty($reshook))
|
|||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors');
|
||||
$action='create';
|
||||
}
|
||||
|
||||
|
||||
if ($socid<1)
|
||||
{
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ThirdParty")), null, 'errors');
|
||||
$action='create';
|
||||
$error++;
|
||||
}
|
||||
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
|
||||
if ($ret < 0) {
|
||||
$error ++;
|
||||
$action = 'create';
|
||||
}
|
||||
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$object->socid = $socid;
|
||||
$object->date_contrat = $datecontrat;
|
||||
|
||||
|
||||
$object->commercial_suivi_id = GETPOST('commercial_suivi_id','int');
|
||||
$object->commercial_signature_id = GETPOST('commercial_signature_id','int');
|
||||
|
||||
|
||||
$object->note_private = GETPOST('note_private','alpha');
|
||||
$object->note_public = GETPOST('note_public','alpha');
|
||||
$object->fk_project = GETPOST('projectid','int');
|
||||
|
|
@ -251,33 +251,33 @@ if (empty($reshook))
|
|||
$element = $regs[1];
|
||||
$subelement = $regs[2];
|
||||
}
|
||||
|
||||
|
||||
// For compatibility
|
||||
if ($element == 'order') { $element = $subelement = 'commande'; }
|
||||
if ($element == 'propal') { $element = 'comm/propal'; $subelement = 'propal'; }
|
||||
|
||||
|
||||
$object->origin = $origin;
|
||||
$object->origin_id = $originid;
|
||||
|
||||
|
||||
// Possibility to add external linked objects with hooks
|
||||
$object->linked_objects[$object->origin] = $object->origin_id;
|
||||
if (is_array($_POST['other_linked_objects']) && ! empty($_POST['other_linked_objects']))
|
||||
{
|
||||
$object->linked_objects = array_merge($object->linked_objects, $_POST['other_linked_objects']);
|
||||
}
|
||||
|
||||
|
||||
$id = $object->create($user);
|
||||
if ($id < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
|
||||
|
||||
if ($id > 0)
|
||||
{
|
||||
dol_include_once('/'.$element.'/class/'.$subelement.'.class.php');
|
||||
|
||||
|
||||
$classname = ucfirst($subelement);
|
||||
$srcobject = new $classname($db);
|
||||
|
||||
|
||||
dol_syslog("Try to find source object origin=".$object->origin." originid=".$object->origin_id." to add lines");
|
||||
$result=$srcobject->fetch($object->origin_id);
|
||||
if ($result > 0)
|
||||
|
|
@ -289,27 +289,27 @@ if (empty($reshook))
|
|||
$srcobject->fetch_lines();
|
||||
$lines = $srcobject->lines;
|
||||
}
|
||||
|
||||
|
||||
$fk_parent_line=0;
|
||||
$num=count($lines);
|
||||
|
||||
|
||||
for ($i=0;$i<$num;$i++)
|
||||
{
|
||||
$product_type=($lines[$i]->product_type?$lines[$i]->product_type:0);
|
||||
|
||||
|
||||
if ($product_type == 1 || (! empty($conf->global->CONTRACT_SUPPORT_PRODUCTS) && in_array($product_type, array(0,1)))) { // TODO Exclude also deee
|
||||
// service prédéfini
|
||||
if ($lines[$i]->fk_product > 0)
|
||||
{
|
||||
$product_static = new Product($db);
|
||||
|
||||
|
||||
// Define output language
|
||||
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE))
|
||||
{
|
||||
$prod = new Product($db);
|
||||
$prod->id=$lines[$i]->fk_product;
|
||||
$prod->getMultiLangs();
|
||||
|
||||
|
||||
$outputlangs = $langs;
|
||||
$newlang='';
|
||||
if (empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id');
|
||||
|
|
@ -319,14 +319,14 @@ if (empty($reshook))
|
|||
$outputlangs = new Translate("",$conf);
|
||||
$outputlangs->setDefaultLang($newlang);
|
||||
}
|
||||
|
||||
|
||||
$label = (! empty($prod->multilangs[$outputlangs->defaultlang]["libelle"])) ? $prod->multilangs[$outputlangs->defaultlang]["libelle"] : $lines[$i]->product_label;
|
||||
}
|
||||
else
|
||||
{
|
||||
$label = $lines[$i]->product_label;
|
||||
}
|
||||
|
||||
|
||||
$desc .= ($lines[$i]->desc && $lines[$i]->desc!=$lines[$i]->libelle)?dol_htmlentitiesbr($lines[$i]->desc):'';
|
||||
}
|
||||
else {
|
||||
|
|
@ -338,7 +338,7 @@ if (empty($reshook))
|
|||
// View third's localtaxes for now
|
||||
$localtax1_tx = get_localtax($txtva, 1, $object->thirdparty);
|
||||
$localtax2_tx = get_localtax($txtva, 2, $object->thirdparty);
|
||||
|
||||
|
||||
$result = $object->addline(
|
||||
$desc,
|
||||
$lines[$i]->subprice,
|
||||
|
|
@ -358,7 +358,7 @@ if (empty($reshook))
|
|||
array(),
|
||||
$lines[$i]->fk_unit
|
||||
);
|
||||
|
||||
|
||||
if ($result < 0)
|
||||
{
|
||||
$error++;
|
||||
|
|
@ -372,13 +372,13 @@ if (empty($reshook))
|
|||
setEventMessages($srcobject->error, $srcobject->errors, 'errors');
|
||||
$error++;
|
||||
}
|
||||
|
||||
|
||||
// Hooks
|
||||
$parameters = array('objFrom' => $srcobject);
|
||||
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action); // Note that $action and $object may have been
|
||||
// modified by hook
|
||||
if ($reshook < 0)
|
||||
$error++;
|
||||
$error++;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -401,12 +401,12 @@ if (empty($reshook))
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
else if ($action == 'classin' && $user->rights->contrat->creer)
|
||||
{
|
||||
$object->setProject(GETPOST('projectid'));
|
||||
}
|
||||
|
||||
|
||||
// Add a new line
|
||||
else if ($action == 'addline' && $user->rights->contrat->creer)
|
||||
{
|
||||
|
|
@ -425,10 +425,10 @@ if (empty($reshook))
|
|||
$idprod=GETPOST('idprod', 'int');
|
||||
$tva_tx = '';
|
||||
}
|
||||
|
||||
|
||||
$qty = GETPOST('qty'.$predef);
|
||||
$remise_percent = GETPOST('remise_percent'.$predef);
|
||||
|
||||
|
||||
if ($qty == '')
|
||||
{
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Qty")), null, 'errors');
|
||||
|
|
@ -439,7 +439,7 @@ if (empty($reshook))
|
|||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Description")), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
|
||||
|
||||
// Extrafields
|
||||
$extrafieldsline = new ExtraFields($db);
|
||||
$extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line);
|
||||
|
|
@ -458,7 +458,7 @@ if (empty($reshook))
|
|||
$date_start=dol_mktime(GETPOST('date_start'.$predef.'hour'), GETPOST('date_start'.$predef.'min'), GETPOST('date_start'.$predef.'sec'), GETPOST('date_start'.$predef.'month'), GETPOST('date_start'.$predef.'day'), GETPOST('date_start'.$predef.'year'));
|
||||
$date_end=dol_mktime(GETPOST('date_end'.$predef.'hour'), GETPOST('date_end'.$predef.'min'), GETPOST('date_end'.$predef.'sec'), GETPOST('date_end'.$predef.'month'), GETPOST('date_end'.$predef.'day'), GETPOST('date_end'.$predef.'year'));
|
||||
$price_base_type = (GETPOST('price_base_type', 'alpha')?GETPOST('price_base_type', 'alpha'):'HT');
|
||||
|
||||
|
||||
// Ecrase $pu par celui du produit
|
||||
// Ecrase $desc par celui du produit
|
||||
// Ecrase $tva_tx par celui du produit
|
||||
|
|
@ -467,17 +467,17 @@ if (empty($reshook))
|
|||
{
|
||||
$prod = new Product($db);
|
||||
$prod->fetch($idprod);
|
||||
|
||||
|
||||
// Update if prices fields are defined
|
||||
$tva_tx = get_default_tva($mysoc,$object->thirdparty,$prod->id);
|
||||
$tva_npr = get_default_npr($mysoc,$object->thirdparty,$prod->id);
|
||||
if (empty($tva_tx)) $tva_npr=0;
|
||||
|
||||
|
||||
$pu_ht = $prod->price;
|
||||
$pu_ttc = $prod->price_ttc;
|
||||
$price_min = $prod->price_min;
|
||||
$price_base_type = $prod->price_base_type;
|
||||
|
||||
|
||||
// On defini prix unitaire
|
||||
if ($conf->global->PRODUIT_MULTIPRICES && $object->thirdparty->price_level)
|
||||
{
|
||||
|
|
@ -489,11 +489,11 @@ if (empty($reshook))
|
|||
elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT . '/product/class/productcustomerprice.class.php';
|
||||
|
||||
|
||||
$prodcustprice = new Productcustomerprice($db);
|
||||
|
||||
|
||||
$filter = array('t.fk_product' => $prod->id,'t.fk_soc' => $object->thirdparty->id);
|
||||
|
||||
|
||||
$result = $prodcustprice->fetch_all('', '', 0, 0, $filter);
|
||||
if ($result) {
|
||||
if (count($prodcustprice->lines) > 0) {
|
||||
|
|
@ -504,10 +504,10 @@ if (empty($reshook))
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$tmpvat = price2num(preg_replace('/\s*\(.*\)/', '', $tva_tx));
|
||||
$tmpprodvat = price2num(preg_replace('/\s*\(.*\)/', '', $prod->tva_tx));
|
||||
|
||||
|
||||
// On reevalue prix selon taux tva car taux tva transaction peut etre different
|
||||
// de ceux du produit par defaut (par exemple si pays different entre vendeur et acheteur).
|
||||
if ($tmpvat != $tmpprodvat)
|
||||
|
|
@ -521,7 +521,7 @@ if (empty($reshook))
|
|||
$pu_ttc = price2num($pu_ht * (1 + ($tmpvat/100)), 'MU');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$desc=$prod->description;
|
||||
$desc=dol_concatdesc($desc,$product_desc);
|
||||
$fk_unit = $prod->fk_unit;
|
||||
|
|
@ -535,20 +535,20 @@ if (empty($reshook))
|
|||
$desc=$product_desc;
|
||||
$fk_unit= GETPOST('units', 'alpha');
|
||||
}
|
||||
|
||||
|
||||
$localtax1_tx=get_localtax($tva_tx,1,$object->thirdparty,$mysoc,$tva_npr);
|
||||
$localtax2_tx=get_localtax($tva_tx,2,$object->thirdparty,$mysoc,$tva_npr);
|
||||
|
||||
|
||||
// ajout prix achat
|
||||
$fk_fournprice = $_POST['fournprice'];
|
||||
if ( ! empty($_POST['buying_price']) )
|
||||
$pa_ht = $_POST['buying_price'];
|
||||
else
|
||||
$pa_ht = null;
|
||||
|
||||
|
||||
$info_bits=0;
|
||||
if ($tva_npr) $info_bits |= 0x01;
|
||||
|
||||
|
||||
if($price_min && (price2num($pu_ht)*(1-price2num($remise_percent)/100) < price2num($price_min)))
|
||||
{
|
||||
$object->error = $langs->trans("CantBeLessThanMinPrice",price(price2num($price_min,'MU'),0,$langs,0,0,-1,$conf->currency));
|
||||
|
|
@ -577,7 +577,7 @@ if (empty($reshook))
|
|||
$fk_unit
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
if ($result > 0)
|
||||
{
|
||||
// Define output language
|
||||
|
|
@ -591,14 +591,14 @@ if (empty($reshook))
|
|||
$outputlangs = new Translate("", $conf);
|
||||
$outputlangs->setDefaultLang($newlang);
|
||||
}
|
||||
|
||||
|
||||
$ret = $object->fetch($id); // Reload to get new records
|
||||
|
||||
|
||||
$object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
}
|
||||
|
||||
|
||||
unset($_POST ['prod_entry_mode']);
|
||||
|
||||
|
||||
unset($_POST['qty']);
|
||||
unset($_POST['type']);
|
||||
unset($_POST['remise_percent']);
|
||||
|
|
@ -615,7 +615,7 @@ if (empty($reshook))
|
|||
unset($_POST ['np_markRate']);
|
||||
unset($_POST['dp_desc']);
|
||||
unset($_POST['idprod']);
|
||||
|
||||
|
||||
unset($_POST['date_starthour']);
|
||||
unset($_POST['date_startmin']);
|
||||
unset($_POST['date_startsec']);
|
||||
|
|
@ -635,30 +635,30 @@ if (empty($reshook))
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
else if ($action == 'updateline' && $user->rights->contrat->creer && ! GETPOST('cancel'))
|
||||
{
|
||||
$objectline = new ContratLigne($db);
|
||||
if ($objectline->fetch(GETPOST('elrowid')))
|
||||
{
|
||||
$db->begin();
|
||||
|
||||
|
||||
if ($date_start_real_update == '') $date_start_real_update=$objectline->date_ouverture;
|
||||
if ($date_end_real_update == '') $date_end_real_update=$objectline->date_cloture;
|
||||
|
||||
|
||||
$vat_rate = GETPOST('eltva_tx');
|
||||
// Define info_bits
|
||||
$info_bits = 0;
|
||||
if (preg_match('/\*/', $vat_rate))
|
||||
$info_bits |= 0x01;
|
||||
|
||||
|
||||
// Define vat_rate
|
||||
$vat_rate = str_replace('*', '', $vat_rate);
|
||||
$localtax1_tx=get_localtax($vat_rate, 1, $object->thirdparty, $mysoc);
|
||||
$localtax2_tx=get_localtax($vat_rate, 2, $object->thirdparty, $mysoc);
|
||||
|
||||
|
||||
$txtva = $vat_rate;
|
||||
|
||||
|
||||
// Clean vat code
|
||||
$vat_src_code='';
|
||||
if (preg_match('/\((.*)\)/', $txtva, $reg))
|
||||
|
|
@ -666,16 +666,16 @@ if (empty($reshook))
|
|||
$vat_src_code = $reg[1];
|
||||
$txtva = preg_replace('/\s*\(.*\)/', '', $txtva); // Remove code into vatrate.
|
||||
}
|
||||
|
||||
|
||||
// ajout prix d'achat
|
||||
$fk_fournprice = $_POST['fournprice'];
|
||||
if ( ! empty($_POST['buying_price']) )
|
||||
$pa_ht = $_POST['buying_price'];
|
||||
else
|
||||
$pa_ht = null;
|
||||
|
||||
|
||||
$fk_unit = GETPOST('unit', 'alpha');
|
||||
|
||||
|
||||
$objectline->description=GETPOST('product_desc');
|
||||
$objectline->price_ht=GETPOST('elprice');
|
||||
$objectline->subprice=GETPOST('elprice');
|
||||
|
|
@ -692,21 +692,21 @@ if (empty($reshook))
|
|||
$objectline->fk_user_cloture=$user->id;
|
||||
$objectline->fk_fournprice=$fk_fournprice;
|
||||
$objectline->pa_ht=$pa_ht;
|
||||
|
||||
|
||||
if ($fk_unit > 0) {
|
||||
$objectline->fk_unit = GETPOST('unit');
|
||||
} else {
|
||||
$objectline->fk_unit = null;
|
||||
}
|
||||
|
||||
|
||||
// Extrafields
|
||||
$extrafieldsline = new ExtraFields($db);
|
||||
$extralabelsline = $extrafieldsline->fetch_name_optionals_label($objectline->table_element);
|
||||
$array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline, $predef);
|
||||
$objectline->array_options=$array_options;
|
||||
|
||||
|
||||
// TODO verifier price_min si fk_product et multiprix
|
||||
|
||||
|
||||
$result=$objectline->update($user);
|
||||
if ($result > 0)
|
||||
{
|
||||
|
|
@ -723,11 +723,11 @@ if (empty($reshook))
|
|||
setEventMessages($objectline->error, $objectline->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->contrat->creer)
|
||||
{
|
||||
$result = $object->deleteline(GETPOST('lineid'),$user);
|
||||
|
||||
|
||||
if ($result >= 0)
|
||||
{
|
||||
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
|
||||
|
|
@ -738,23 +738,23 @@ if (empty($reshook))
|
|||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->contrat->creer)
|
||||
{
|
||||
$result = $object->validate($user);
|
||||
}
|
||||
|
||||
|
||||
else if ($action == 'reopen' && $user->rights->contrat->creer)
|
||||
{
|
||||
$result = $object->reopen($user);
|
||||
}
|
||||
|
||||
|
||||
// Close all lines
|
||||
else if ($action == 'confirm_close' && $confirm == 'yes' && $user->rights->contrat->creer)
|
||||
{
|
||||
$object->cloture($user);
|
||||
}
|
||||
|
||||
|
||||
else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->contrat->supprimer)
|
||||
{
|
||||
$result=$object->delete($user);
|
||||
|
|
@ -768,7 +768,7 @@ if (empty($reshook))
|
|||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
else if ($action == 'confirm_move' && $confirm == 'yes' && $user->rights->contrat->creer)
|
||||
{
|
||||
if (GETPOST('newcid') > 0)
|
||||
|
|
@ -791,39 +791,39 @@ if (empty($reshook))
|
|||
{
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("RefNewContract")), null, 'errors');
|
||||
}
|
||||
}
|
||||
else if ($action == 'update_extras')
|
||||
}
|
||||
else if ($action == 'update_extras')
|
||||
{
|
||||
// Fill array 'array_options' with data from update form
|
||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute'));
|
||||
if ($ret < 0)
|
||||
$error ++;
|
||||
|
||||
|
||||
if (! $error) {
|
||||
|
||||
|
||||
$result = $object->insertExtraFields();
|
||||
if ($result < 0) {
|
||||
$error ++;
|
||||
}
|
||||
} else if ($reshook < 0)
|
||||
$error ++;
|
||||
|
||||
|
||||
if ($error) {
|
||||
$action = 'edit_extras';
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
elseif ($action=='setref_supplier')
|
||||
}
|
||||
elseif ($action=='setref_supplier')
|
||||
{
|
||||
$cancelbutton = GETPOST('cancel');
|
||||
if (!$cancelbutton) {
|
||||
|
||||
|
||||
$result = $object->fetch($id);
|
||||
if ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
|
||||
|
||||
$result = $object->setValueFrom('ref_supplier', GETPOST('ref_supplier','alpha'), '', null, 'text', '', $user, 'CONTRACT_MODIFY');
|
||||
if ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
|
|
@ -838,17 +838,17 @@ if (empty($reshook))
|
|||
exit;
|
||||
}
|
||||
}
|
||||
elseif ($action=='setref_customer')
|
||||
elseif ($action=='setref_customer')
|
||||
{
|
||||
$cancelbutton = GETPOST('cancel');
|
||||
|
||||
|
||||
if (!$cancelbutton)
|
||||
{
|
||||
$result = $object->fetch($id);
|
||||
if ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
|
||||
|
||||
$result = $object->setValueFrom('ref_customer', GETPOST('ref_customer','alpha'), '', null, 'text', '', $user, 'CONTRACT_MODIFY');
|
||||
if ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
|
|
@ -863,16 +863,16 @@ if (empty($reshook))
|
|||
exit;
|
||||
}
|
||||
}
|
||||
elseif ($action=='setref')
|
||||
elseif ($action=='setref')
|
||||
{
|
||||
$cancelbutton = GETPOST('cancel');
|
||||
|
||||
|
||||
if (!$cancelbutton) {
|
||||
$result = $object->fetch($id);
|
||||
if ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
|
||||
|
||||
$result = $object->setValueFrom('ref', GETPOST('ref','alpha'), '', null, 'text', '', $user, 'CONTRACT_MODIFY');
|
||||
if ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
|
|
@ -886,11 +886,11 @@ if (empty($reshook))
|
|||
header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $id);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
elseif ($action=='setdate_contrat')
|
||||
}
|
||||
elseif ($action=='setdate_contrat')
|
||||
{
|
||||
$cancelbutton = GETPOST('cancel');
|
||||
|
||||
|
||||
if (!$cancelbutton) {
|
||||
$result = $object->fetch($id);
|
||||
if ($result < 0) {
|
||||
|
|
@ -911,13 +911,13 @@ if (empty($reshook))
|
|||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Generation doc (depuis lien ou depuis cartouche doc)
|
||||
else if ($action == 'builddoc' && $user->rights->contrat->creer) {
|
||||
if (GETPOST('model')) {
|
||||
$object->setDocModel($user, GETPOST('model'));
|
||||
}
|
||||
|
||||
|
||||
// Define output language
|
||||
$outputlangs = $langs;
|
||||
if (! empty($conf->global->MAIN_MULTILANGS)) {
|
||||
|
|
@ -933,12 +933,12 @@ if (empty($reshook))
|
|||
$action='';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Remove file in doc form
|
||||
else if ($action == 'remove_file' && $user->rights->contrat->creer) {
|
||||
if ($object->id > 0) {
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
|
||||
|
||||
|
||||
$langs->load("other");
|
||||
$upload_dir = $conf->contrat->dir_output;
|
||||
$file = $upload_dir . '/' . GETPOST('file');
|
||||
|
|
@ -965,7 +965,7 @@ if (empty($reshook))
|
|||
{
|
||||
$contactid = (GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid'));
|
||||
$result = $object->add_contact($contactid, GETPOST('type'), GETPOST('source'));
|
||||
|
||||
|
||||
if ($result >= 0)
|
||||
{
|
||||
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
|
||||
|
|
@ -984,18 +984,18 @@ if (empty($reshook))
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// bascule du statut d'un contact
|
||||
else if ($action == 'swapstatut')
|
||||
{
|
||||
$result=$object->swapContactStatus(GETPOST('ligne'));
|
||||
}
|
||||
|
||||
|
||||
// Efface un contact
|
||||
else if ($action == 'deletecontact')
|
||||
{
|
||||
$result = $object->delete_contact(GETPOST('lineid'));
|
||||
|
||||
|
||||
if ($result >= 0)
|
||||
{
|
||||
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
|
||||
|
|
@ -1040,7 +1040,7 @@ llxHeader('',$langs->trans("Contract"),"");
|
|||
$form = new Form($db);
|
||||
$formfile = new FormFile($db);
|
||||
if (! empty($conf->projet->enabled)) $formproject = new FormProjets($db);
|
||||
|
||||
|
||||
$objectlignestatic=new ContratLigne($db);
|
||||
|
||||
// Load object modContract
|
||||
|
|
@ -1209,7 +1209,7 @@ if ($action == 'create')
|
|||
}
|
||||
|
||||
// Other attributes
|
||||
$parameters=array('objectsrc' => $objectsrc,'colspan' => ' colspan="3"');
|
||||
$parameters=array('objectsrc' => $objectsrc,'colspan' => ' colspan="3"', 'cols'=>3);
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
|
||||
// Other attributes
|
||||
|
|
@ -1333,7 +1333,7 @@ else
|
|||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/contrat/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
|
||||
|
||||
$morehtmlref='';
|
||||
if (! empty($modCodeContract->code_auto)) {
|
||||
$morehtmlref.=$object->ref;
|
||||
|
|
@ -1341,7 +1341,7 @@ else
|
|||
$morehtmlref.=$form->editfieldkey("",'ref',$object->ref,$object,$user->rights->contrat->creer,'string','',0,3);
|
||||
$morehtmlref.=$form->editfieldval("",'ref',$object->ref,$object,$user->rights->contrat->creer,'string','',0,2);
|
||||
}
|
||||
|
||||
|
||||
$morehtmlref.='<div class="refidno">';
|
||||
// Ref customer
|
||||
$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->rights->contrat->creer, 'string', '', 0, 1);
|
||||
|
|
@ -1392,10 +1392,10 @@ else
|
|||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
|
||||
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
|
||||
// Ligne info remises tiers
|
||||
print '<tr><td class="titlefield">'.$langs->trans('Discount').'</td><td colspan="3">';
|
||||
if ($object->thirdparty->remise_percent) print $langs->trans("CompanyHasRelativeDiscount",$object->thirdparty->remise_percent);
|
||||
|
|
@ -1423,7 +1423,7 @@ else
|
|||
print "</table>";
|
||||
|
||||
print '</div>';
|
||||
|
||||
|
||||
if (! empty($object->brouillon) && $user->rights->contrat->creer)
|
||||
{
|
||||
print '</form>';
|
||||
|
|
@ -1615,7 +1615,7 @@ else
|
|||
{
|
||||
print dol_print_date($db->jdate($objp->date_debut));
|
||||
// Warning si date prevu passee et pas en service
|
||||
if ($objp->statut == 0 && $db->jdate($objp->date_debut) < ($now - $conf->contrat->services->inactifs->warning_delay)) {
|
||||
if ($objp->statut == 0 && $db->jdate($objp->date_debut) < ($now - $conf->contrat->services->inactifs->warning_delay)) {
|
||||
$warning_delay=$conf->contrat->services->inactifs->warning_delay / 3600 / 24;
|
||||
$textlate = $langs->trans("Late").' = '.$langs->trans("DateReference").' > '.$langs->trans("DateToday").' '.(ceil($warning_delay) >= 0 ? '+' : '').ceil($warning_delay).' '.$langs->trans("days");
|
||||
print " ".img_warning($textlate);
|
||||
|
|
@ -1627,7 +1627,7 @@ else
|
|||
if ($objp->date_fin)
|
||||
{
|
||||
print dol_print_date($db->jdate($objp->date_fin));
|
||||
if ($objp->statut == 4 && $db->jdate($objp->date_fin) < ($now - $conf->contrat->services->expires->warning_delay)) {
|
||||
if ($objp->statut == 4 && $db->jdate($objp->date_fin) < ($now - $conf->contrat->services->expires->warning_delay)) {
|
||||
$warning_delay=$conf->contrat->services->expires->warning_delay / 3600 / 24;
|
||||
$textlate = $langs->trans("Late").' = '.$langs->trans("DateReference").' > '.$langs->trans("DateToday").' '.(ceil($warning_delay) >= 0 ? '+' : '').ceil($warning_delay).' '.$langs->trans("days");
|
||||
print " ".img_warning($textlate);
|
||||
|
|
@ -1814,13 +1814,13 @@ else
|
|||
$tmpaction='activateline';
|
||||
$tmpactionpicto='play';
|
||||
$tmpactiontext=$langs->trans("Activate");
|
||||
if ($objp->statut == 4)
|
||||
if ($objp->statut == 4)
|
||||
{
|
||||
$tmpaction='unactivateline';
|
||||
$tmpactionpicto='playstop';
|
||||
$tmpactiontext=$langs->trans("Unactivate");
|
||||
}
|
||||
if (($tmpaction=='activateline' && $user->rights->contrat->activer) || ($tmpaction=='unactivateline' && $user->rights->contrat->desactiver))
|
||||
if (($tmpaction=='activateline' && $user->rights->contrat->activer) || ($tmpaction=='unactivateline' && $user->rights->contrat->desactiver))
|
||||
{
|
||||
print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&ligne=' . $object->lines[$cursorline - 1]->id . '&action=' . $tmpaction . '">';
|
||||
print img_picto($tmpactiontext, $tmpactionpicto);
|
||||
|
|
@ -1962,7 +1962,7 @@ else
|
|||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '</form>';
|
||||
|
|
@ -1997,7 +1997,7 @@ else
|
|||
$var = true;
|
||||
|
||||
$forcetoshowtitlelines=1;
|
||||
|
||||
|
||||
// Add free products/services
|
||||
$object->formAddObjectLine(1, $mysoc, $soc);
|
||||
|
||||
|
|
@ -2037,7 +2037,7 @@ else
|
|||
if ($user->rights->contrat->creer) print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=reopen">'.$langs->trans("Modify").'</a></div>';
|
||||
else print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("Modify").'</a></div>';
|
||||
}
|
||||
|
||||
|
||||
if (! empty($conf->facture->enabled) && $object->statut > 0 && $object->nbofservicesclosed < $nbofservices)
|
||||
{
|
||||
$langs->load("bills");
|
||||
|
|
@ -2051,7 +2051,7 @@ else
|
|||
if ($user->rights->commande->creer) print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/commande/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->thirdparty->id.'">'.$langs->trans("CreateOrder").'</a></div>';
|
||||
else print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("CreateOrder").'</a></div>';
|
||||
}
|
||||
|
||||
|
||||
// Clone
|
||||
if ($user->rights->contrat->creer) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&socid=' . $object->socid . '&action=clone&object=' . $object->element . '">' . $langs->trans("ToClone") . '</a></div>';
|
||||
|
|
@ -2083,16 +2083,16 @@ else
|
|||
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
|
||||
// Select mail models is same action as presend
|
||||
if (GETPOST('modelselected')) {
|
||||
$action = 'presend';
|
||||
}
|
||||
|
||||
|
||||
if ($action != 'presend')
|
||||
{
|
||||
print '<div class="fichecenter"><div class="fichehalfleft">';
|
||||
|
||||
|
||||
/*
|
||||
* Documents generes
|
||||
*/
|
||||
|
|
@ -2101,25 +2101,25 @@ else
|
|||
$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
|
||||
$genallowed = $user->rights->contrat->creer;
|
||||
$delallowed = $user->rights->contrat->supprimer;
|
||||
|
||||
|
||||
$var = true;
|
||||
|
||||
|
||||
print $formfile->showdocuments('contract', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', 0, '', $soc->default_lang);
|
||||
|
||||
|
||||
|
||||
|
||||
// Show links to link elements
|
||||
$linktoelem = $form->showLinkToObjectBlock($object, null, array('contrat'));
|
||||
$somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
|
||||
|
||||
|
||||
|
||||
|
||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||
|
||||
|
||||
// List of actions on element
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
|
||||
$formactions = new FormActions($db);
|
||||
$somethingshown = $formactions->showactions($object, 'contract', $socid);
|
||||
|
||||
|
||||
|
||||
print '</div></div></div>';
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -89,13 +89,13 @@ abstract class CommonObject
|
|||
* @var Object To store a cloned copy of object before to edit it and keep track of old properties
|
||||
*/
|
||||
public $oldcopy;
|
||||
|
||||
|
||||
/**
|
||||
* @var string Column name of the ref field.
|
||||
*/
|
||||
protected $table_ref_field = '';
|
||||
|
||||
|
||||
|
||||
|
||||
// Following vars are used by some objects only. We keep this property here in CommonObject to be able to provide common method using them.
|
||||
|
||||
|
|
@ -330,10 +330,10 @@ abstract class CommonObject
|
|||
public $firstname;
|
||||
public $civility_id;
|
||||
|
||||
|
||||
|
||||
// No constructor as it is an abstract class
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Check an object id/ref exists
|
||||
* If you don't need/want to instantiate object and just need to know if object exists, use this method instead of fetch
|
||||
|
|
@ -398,7 +398,7 @@ abstract class CommonObject
|
|||
$lastname=$this->lastname;
|
||||
$firstname=$this->firstname;
|
||||
if (empty($lastname)) $lastname=(isset($this->lastname)?$this->lastname:(isset($this->name)?$this->name:(isset($this->nom)?$this->nom:(isset($this->societe)?$this->societe:(isset($this->company)?$this->company:'')))));
|
||||
|
||||
|
||||
$ret='';
|
||||
if ($option && $this->civility_id)
|
||||
{
|
||||
|
|
@ -597,11 +597,11 @@ abstract class CommonObject
|
|||
dol_syslog("CODE_NOT_VALID_FOR_THIS_ELEMENT");
|
||||
return -3;
|
||||
}
|
||||
|
||||
|
||||
$datecreate = dol_now();
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
|
||||
// Insertion dans la base
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."element_contact";
|
||||
$sql.= " (element_id, fk_socpeople, datecreate, statut, fk_c_type_contact) ";
|
||||
|
|
@ -1238,19 +1238,19 @@ abstract class CommonObject
|
|||
function setValueFrom($field, $value, $table='', $id=null, $format='', $id_field='', $fuser=null, $trigkey='')
|
||||
{
|
||||
global $user,$langs,$conf;
|
||||
|
||||
|
||||
if (empty($table)) $table=$this->table_element;
|
||||
if (empty($id)) $id=$this->id;
|
||||
if (empty($format)) $format='text';
|
||||
if (empty($id_field)) $id_field='rowid';
|
||||
|
||||
$error=0;
|
||||
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
// Special case
|
||||
if ($table == 'product' && $field == 'note_private') $field='note';
|
||||
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX.$table." SET ";
|
||||
if ($format == 'text') $sql.= $field." = '".$this->db->escape($value)."'";
|
||||
else if ($format == 'int') $sql.= $field." = ".$this->db->escape($value);
|
||||
|
|
@ -1396,13 +1396,13 @@ abstract class CommonObject
|
|||
}
|
||||
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element;
|
||||
if ($this->table_element == 'actioncomm')
|
||||
if ($this->table_element == 'actioncomm')
|
||||
{
|
||||
if ($projectid) $sql.= ' SET fk_project = '.$projectid;
|
||||
else $sql.= ' SET fk_project = NULL';
|
||||
$sql.= ' WHERE id = '.$this->id;
|
||||
$sql.= ' WHERE id = '.$this->id;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
if ($projectid) $sql.= ' SET fk_projet = '.$projectid;
|
||||
else $sql.= ' SET fk_projet = NULL';
|
||||
|
|
@ -1535,7 +1535,7 @@ abstract class CommonObject
|
|||
if($mode == 1) {
|
||||
$line->subprice = 0;
|
||||
}
|
||||
|
||||
|
||||
switch ($this->element) {
|
||||
case 'propal':
|
||||
$this->updateline($line->id, $line->subprice, $line->qty, $line->remise_percent, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, $line->desc, 'HT', $line->info_bits, $line->special_code, $line->fk_parent_line, $line->skip_update_total, $line->fk_fournprice, $line->pa_ht, $line->label, $line->product_type, $line->date_start, $line->date_end, $line->array_options, $line->fk_unit, $line->multicurrency_subprice);
|
||||
|
|
@ -1626,7 +1626,7 @@ abstract class CommonObject
|
|||
/**
|
||||
* Define delivery address
|
||||
* @deprecated
|
||||
*
|
||||
*
|
||||
* @param int $id Address id
|
||||
* @return int <0 si ko, >0 si ok
|
||||
*/
|
||||
|
|
@ -1950,7 +1950,7 @@ abstract class CommonObject
|
|||
{
|
||||
$fieldposition = 'rang';
|
||||
if ($this->table_element_line == 'ecm_files') $fieldposition = 'position';
|
||||
|
||||
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element_line.' SET '.$fieldposition.' = '.$rang;
|
||||
$sql.= ' WHERE rowid = '.$rowid;
|
||||
|
||||
|
|
@ -2163,7 +2163,7 @@ abstract class CommonObject
|
|||
function update_note($note,$suffix='')
|
||||
{
|
||||
global $user;
|
||||
|
||||
|
||||
if (! $this->table_element)
|
||||
{
|
||||
dol_syslog(get_class($this)."::update_note was called on objet with property table_element not defined", LOG_ERR);
|
||||
|
|
@ -2177,7 +2177,7 @@ abstract class CommonObject
|
|||
// Special cas
|
||||
//var_dump($this->table_element);exit;
|
||||
if ($this->table_element == 'product') $suffix='';
|
||||
|
||||
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element;
|
||||
$sql.= " SET note".$suffix." = ".(!empty($note)?("'".$this->db->escape($note)."'"):"NULL");
|
||||
$sql.= " ,".(in_array($this->table_element, array('actioncomm', 'adherent', 'advtargetemailing', 'cronjob', 'establishment'))?"fk_user_mod":"fk_user_modif")." = ".$user->id;
|
||||
|
|
@ -2188,7 +2188,7 @@ abstract class CommonObject
|
|||
{
|
||||
if ($suffix == '_public') $this->note_public = $note;
|
||||
else if ($suffix == '_private') $this->note_private = $note;
|
||||
else
|
||||
else
|
||||
{
|
||||
$this->note = $note; // deprecated
|
||||
$this->note_private = $note;
|
||||
|
|
@ -2437,7 +2437,7 @@ abstract class CommonObject
|
|||
// Special case
|
||||
if ($origin == 'order') $origin='commande';
|
||||
if ($origin == 'invoice') $origin='facture';
|
||||
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."element_element (";
|
||||
|
|
@ -2470,10 +2470,10 @@ abstract class CommonObject
|
|||
* Fetch array of objects linked to current object. Links are loaded into this->linkedObjects array and this->linkedObjectsIds
|
||||
* Possible usage for parameters:
|
||||
* - all parameters empty -> we look all link to current object (current object can be source or target)
|
||||
* - source id+type -> will get target list linked to source
|
||||
* - target id+type -> will get source list linked to target
|
||||
* - source id+type + target type -> will get target list of the type
|
||||
* - target id+type + target source -> will get source list of the type
|
||||
* - source id+type -> will get target list linked to source
|
||||
* - target id+type -> will get source list linked to target
|
||||
* - source id+type + target type -> will get target list of the type
|
||||
* - target id+type + target source -> will get source list of the type
|
||||
*
|
||||
* @param int $sourceid Object source id (if not defined, id of object)
|
||||
* @param string $sourcetype Object source type (if not defined, element name of object)
|
||||
|
|
@ -2791,7 +2791,7 @@ abstract class CommonObject
|
|||
global $user,$langs,$conf;
|
||||
|
||||
$savElementId=$elementId; // To be used later to know if we were using the method using the id of this or not.
|
||||
|
||||
|
||||
$elementId = (!empty($elementId)?$elementId:$this->id);
|
||||
$elementTable = (!empty($elementType)?$elementType:$this->table_element);
|
||||
|
||||
|
|
@ -2821,7 +2821,7 @@ abstract class CommonObject
|
|||
if ($this->element == 'fichinter' && $status == 3) $trigkey='FICHINTER_CLASSIFY_DONE';
|
||||
if ($this->element == 'fichinter' && $status == 2) $trigkey='FICHINTER_CLASSIFY_BILLED';
|
||||
if ($this->element == 'fichinter' && $status == 1) $trigkey='FICHINTER_CLASSIFY_UNBILLED';
|
||||
|
||||
|
||||
if ($trigkey)
|
||||
{
|
||||
// Appel des triggers
|
||||
|
|
@ -2837,7 +2837,7 @@ abstract class CommonObject
|
|||
if (! $error)
|
||||
{
|
||||
$this->db->commit();
|
||||
|
||||
|
||||
if (empty($savElementId)) // If the element we update was $this (so $elementId is null)
|
||||
{
|
||||
$this->statut = $status;
|
||||
|
|
@ -2932,7 +2932,7 @@ abstract class CommonObject
|
|||
function isObjectUsed($id=0)
|
||||
{
|
||||
if (empty($id)) $id=$this->id;
|
||||
|
||||
|
||||
// Check parameters
|
||||
if (! isset($this->childtables) || ! is_array($this->childtables) || count($this->childtables) == 0)
|
||||
{
|
||||
|
|
@ -3049,12 +3049,12 @@ abstract class CommonObject
|
|||
|
||||
foreach ($this->lines as $line)
|
||||
{
|
||||
if (isset($line->qty_asked))
|
||||
if (isset($line->qty_asked))
|
||||
{
|
||||
if (empty($totalOrdered)) $totalOrdered=0; // Avoid warning because $totalOrdered is ''
|
||||
$totalOrdered+=$line->qty_asked; // defined for shipment only
|
||||
}
|
||||
if (isset($line->qty_shipped))
|
||||
if (isset($line->qty_shipped))
|
||||
{
|
||||
if (empty($totalToShip)) $totalToShip=0; // Avoid warning because $totalToShip is ''
|
||||
$totalToShip+=$line->qty_shipped; // defined for shipment only
|
||||
|
|
@ -3082,7 +3082,7 @@ abstract class CommonObject
|
|||
|
||||
if (empty($totalWeight)) $totalWeight=0; // Avoid warning because $totalWeight is ''
|
||||
if (empty($totalVolume)) $totalVolume=0; // Avoid warning because $totalVolume is ''
|
||||
|
||||
|
||||
//var_dump($line->volume_units);
|
||||
if ($weight_units < 50) // >50 means a standard unit (power of 10 of official unit), > 50 means an exotic unit (like inch)
|
||||
{
|
||||
|
|
@ -3318,54 +3318,54 @@ abstract class CommonObject
|
|||
if (! empty($conf->margin->enabled) && ! empty($this->element) && in_array($this->element,array('facture','propal','commande'))) $usemargins=1;
|
||||
|
||||
$num = count($this->lines);
|
||||
|
||||
|
||||
//Line extrafield
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
$extrafieldsline = new ExtraFields($this->db);
|
||||
$extralabelslines=$extrafieldsline->fetch_name_optionals_label($this->table_element_line);
|
||||
|
||||
|
||||
$parameters = array('num'=>$num,'i'=>$i,'dateSelector'=>$dateSelector,'seller'=>$seller,'buyer'=>$buyer,'selected'=>$selected, 'extrafieldsline'=>$extrafieldsline);
|
||||
$reshook = $hookmanager->executeHooks('printObjectLineTitle', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if (empty($reshook))
|
||||
{
|
||||
print '<tr class="liste_titre nodrag nodrop">';
|
||||
|
||||
|
||||
if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) print '<td class="linecolnum" align="center" width="5"> </td>';
|
||||
|
||||
|
||||
// Description
|
||||
print '<td class="linecoldescription">'.$langs->trans('Description').'</td>';
|
||||
|
||||
|
||||
if ($this->element == 'supplier_proposal')
|
||||
{
|
||||
print '<td class="linerefsupplier" align="right"><span id="title_fourn_ref">'.$langs->trans("SupplierProposalRefFourn").'</span></td>';
|
||||
}
|
||||
|
||||
|
||||
// VAT
|
||||
print '<td class="linecolvat" align="right" width="80">'.$langs->trans('VAT').'</td>';
|
||||
|
||||
|
||||
// Price HT
|
||||
print '<td class="linecoluht" align="right" width="80">'.$langs->trans('PriceUHT').'</td>';
|
||||
|
||||
|
||||
// Multicurrency
|
||||
if (!empty($conf->multicurrency->enabled)) print '<td class="linecoluht_currency" align="right" width="80">'.$langs->trans('PriceUHTCurrency', $this->multicurrency_code).'</td>';
|
||||
|
||||
|
||||
if ($inputalsopricewithtax) print '<td align="right" width="80">'.$langs->trans('PriceUTTC').'</td>';
|
||||
|
||||
|
||||
// Qty
|
||||
print '<td class="linecolqty" align="right">'.$langs->trans('Qty').'</td>';
|
||||
|
||||
|
||||
if($conf->global->PRODUCT_USE_UNITS)
|
||||
{
|
||||
print '<td class="linecoluseunit" align="left">'.$langs->trans('Unit').'</td>';
|
||||
}
|
||||
|
||||
|
||||
// Reduction short
|
||||
print '<td class="linecoldiscount" align="right">'.$langs->trans('ReductionShort').'</td>';
|
||||
|
||||
|
||||
if ($this->situation_cycle_ref) {
|
||||
print '<td class="linecolcycleref" align="right">' . $langs->trans('Progress') . '</td>';
|
||||
}
|
||||
|
||||
|
||||
if ($usemargins && ! empty($conf->margin->enabled) && empty($user->societe_id))
|
||||
{
|
||||
if (!empty($user->rights->margins->creer))
|
||||
|
|
@ -3373,32 +3373,32 @@ abstract class CommonObject
|
|||
if ($conf->global->MARGIN_TYPE == "1")
|
||||
print '<td class="linecolmargin1 margininfos" align="right" width="80">'.$langs->trans('BuyingPrice').'</td>';
|
||||
else
|
||||
print '<td class="linecolmargin1 margininfos" align="right" width="80">'.$langs->trans('CostPrice').'</td>';
|
||||
print '<td class="linecolmargin1 margininfos" align="right" width="80">'.$langs->trans('CostPrice').'</td>';
|
||||
}
|
||||
|
||||
|
||||
if (! empty($conf->global->DISPLAY_MARGIN_RATES) && $user->rights->margins->liretous)
|
||||
print '<td class="linecolmargin2 margininfos" align="right" width="50">'.$langs->trans('MarginRate').'</td>';
|
||||
if (! empty($conf->global->DISPLAY_MARK_RATES) && $user->rights->margins->liretous)
|
||||
print '<td class="linecolmargin2 margininfos" align="right" width="50">'.$langs->trans('MarkRate').'</td>';
|
||||
}
|
||||
|
||||
|
||||
// Total HT
|
||||
print '<td class="linecolht" align="right">'.$langs->trans('TotalHTShort').'</td>';
|
||||
|
||||
|
||||
// Multicurrency
|
||||
if (!empty($conf->multicurrency->enabled)) print '<td class="linecoltotalht_currency" align="right">'.$langs->trans('TotalHTShortCurrency', $this->multicurrency_code).'</td>';
|
||||
|
||||
|
||||
if ($outputalsopricetotalwithtax) print '<td align="right" width="80">'.$langs->trans('TotalTTCShort').'</td>';
|
||||
|
||||
|
||||
print '<td class="linecoledit"></td>'; // No width to allow autodim
|
||||
|
||||
|
||||
print '<td class="linecoldelete" width="10"></td>';
|
||||
|
||||
|
||||
print '<td class="linecolmove" width="10"></td>';
|
||||
|
||||
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
|
||||
$var = true;
|
||||
$i = 0;
|
||||
|
||||
|
|
@ -3407,7 +3407,7 @@ abstract class CommonObject
|
|||
//Line extrafield
|
||||
$line->fetch_optionals($line->id,$extralabelslines);
|
||||
|
||||
|
||||
|
||||
|
||||
//if (is_object($hookmanager) && (($line->product_type == 9 && ! empty($line->special_code)) || ! empty($line->fk_parent_line)))
|
||||
if (is_object($hookmanager)) // Old code is commented on preceding line.
|
||||
|
|
@ -3588,7 +3588,7 @@ abstract class CommonObject
|
|||
|
||||
foreach ($this->lines as $line)
|
||||
{
|
||||
|
||||
|
||||
|
||||
if (is_object($hookmanager) && (($line->product_type == 9 && ! empty($line->special_code)) || ! empty($line->fk_parent_line)))
|
||||
{
|
||||
|
|
@ -3868,7 +3868,7 @@ abstract class CommonObject
|
|||
$modele=$tmp[0];
|
||||
$srctemplatepath=$tmp[1];
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Search template files
|
||||
$file=''; $classname=''; $filefound=0;
|
||||
|
|
@ -3897,7 +3897,7 @@ abstract class CommonObject
|
|||
if ($filefound)
|
||||
{
|
||||
global $db; // Required to solve a conception default in commonstickergenerator.class.php making an include of code using $db
|
||||
|
||||
|
||||
require_once $file;
|
||||
|
||||
$obj = new $classname($this->db);
|
||||
|
|
@ -3956,7 +3956,7 @@ abstract class CommonObject
|
|||
// output format that does not support UTF8.
|
||||
$sav_charset_output=$outputlangs->charset_output;
|
||||
|
||||
if (in_array(get_class($this), array('Adherent')))
|
||||
if (in_array(get_class($this), array('Adherent')))
|
||||
{
|
||||
$arrayofrecords = array(); // The write_file of templates of adherent class need this
|
||||
$resultwritefile = $obj->write_file($this, $outputlangs, $srctemplatepath, 'member', 1, $moreparams);
|
||||
|
|
@ -4104,25 +4104,36 @@ abstract class CommonObject
|
|||
* Function to get extra fields of a member into $this->array_options
|
||||
* This method is in most cases called by method fetch of objects but you can call it separately.
|
||||
*
|
||||
* @param int $rowid Id of line
|
||||
* @param array $optionsArray Array resulting of call of extrafields->fetch_name_optionals_label()
|
||||
* @param int $rowid Id of line. Use the id of object if not defined. Deprecated. Function must be called without parameters.
|
||||
* @param array $optionsArray Array resulting of call of extrafields->fetch_name_optionals_label(). Deprecated. Function must be called without parameters.
|
||||
* @return int <0 if error, 0 if no optionals to find nor found, 1 if a line is found and optional loaded
|
||||
*/
|
||||
function fetch_optionals($rowid=null,$optionsArray=null)
|
||||
{
|
||||
if (empty($rowid)) $rowid=$this->id;
|
||||
|
||||
//To avoid SQL errors. Probably not the better solution though
|
||||
// To avoid SQL errors. Probably not the better solution though
|
||||
if (!$this->table_element) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (! is_array($optionsArray))
|
||||
{
|
||||
// optionsArray not already loaded, so we load it
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
$extrafields = new ExtraFields($this->db);
|
||||
$optionsArray = $extrafields->fetch_name_optionals_label($this->table_element);
|
||||
// $extrafields is not a known object, we initialize it. Best practice is to have $extrafields defined into card.php or list.php page.
|
||||
// TODO Use of existing extrafield is not yet ready (must mutualize code that use extrafields in form first)
|
||||
// global $extrafields;
|
||||
//if (! is_object($extrafields))
|
||||
//{
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
$extrafields = new ExtraFields($this->db);
|
||||
//}
|
||||
|
||||
// Load array of extrafields for elementype = $this->table_element
|
||||
if (empty($extrafields->attributes[$this->table_element]['loaded']))
|
||||
{
|
||||
$extrafields->fetch_name_optionals_label($this->table_element);
|
||||
}
|
||||
$optionsArray = $extrafields->attributes[$this->table_element]['label'];
|
||||
}
|
||||
|
||||
// Request to get complementary values
|
||||
|
|
@ -4131,12 +4142,15 @@ abstract class CommonObject
|
|||
$sql = "SELECT rowid";
|
||||
foreach ($optionsArray as $name => $label)
|
||||
{
|
||||
$sql.= ", ".$name;
|
||||
if (empty($extrafields->attributes[$this->table_element]['type'][$name]) || $extrafields->attributes[$this->table_element]['type'][$name] != 'separate')
|
||||
{
|
||||
$sql.= ", ".$name;
|
||||
}
|
||||
}
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element."_extrafields";
|
||||
$sql.= " WHERE fk_object = ".$rowid;
|
||||
|
||||
dol_syslog(get_class($this)."::fetch_optionals", LOG_DEBUG);
|
||||
dol_syslog(get_class($this)."::fetch_optionals get extrafields data for ".$this->table_element, LOG_DEBUG);
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
|
|
@ -4217,7 +4231,7 @@ abstract class CommonObject
|
|||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
$extrafields = new ExtraFields($this->db);
|
||||
$target_extrafields=$extrafields->fetch_name_optionals_label($this->table_element);
|
||||
|
||||
|
||||
//Eliminate copied source object extra_fields that do not exist in target object
|
||||
$new_array_options=array();
|
||||
foreach ($this->array_options as $key => $value) {
|
||||
|
|
@ -4266,7 +4280,7 @@ abstract class CommonObject
|
|||
{
|
||||
if (is_numeric($value)) $res=$object->fetch($value);
|
||||
else $res=$object->fetch('',$value);
|
||||
|
||||
|
||||
if ($res > 0) $this->array_options[$key]=$object->id;
|
||||
else
|
||||
{
|
||||
|
|
@ -4678,7 +4692,7 @@ abstract class CommonObject
|
|||
}
|
||||
return $buyPrice;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function test if type is date
|
||||
*
|
||||
|
|
@ -4690,7 +4704,7 @@ abstract class CommonObject
|
|||
if(isset($info['type']) && $info['type']=='date') return true;
|
||||
else return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function test if type is array
|
||||
*
|
||||
|
|
@ -4706,7 +4720,7 @@ abstract class CommonObject
|
|||
}
|
||||
else return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function test if type is null
|
||||
*
|
||||
|
|
@ -4722,7 +4736,7 @@ abstract class CommonObject
|
|||
}
|
||||
else return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function test if type is integer
|
||||
*
|
||||
|
|
@ -4738,7 +4752,7 @@ abstract class CommonObject
|
|||
}
|
||||
else return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function test if type is float
|
||||
*
|
||||
|
|
@ -4754,7 +4768,7 @@ abstract class CommonObject
|
|||
}
|
||||
else return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function test if type is text
|
||||
*
|
||||
|
|
@ -4770,7 +4784,7 @@ abstract class CommonObject
|
|||
}
|
||||
else return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function test if is indexed
|
||||
*
|
||||
|
|
@ -4786,7 +4800,7 @@ abstract class CommonObject
|
|||
}
|
||||
else return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function to prepare the values to insert
|
||||
*
|
||||
|
|
@ -4829,7 +4843,7 @@ abstract class CommonObject
|
|||
$query[$field] = $this->{$field};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
|
|
@ -4843,30 +4857,30 @@ abstract class CommonObject
|
|||
*/
|
||||
public function createCommon(User $user, $notrigger = false)
|
||||
{
|
||||
|
||||
|
||||
$fields = array_merge(array('datec'=>$this->db->idate(dol_now())), $this->set_save_query());
|
||||
|
||||
|
||||
foreach ($fields as $k => $v) {
|
||||
|
||||
|
||||
$keys[] = $k;
|
||||
$values[] = $this->quote($v);
|
||||
|
||||
|
||||
}
|
||||
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.$this->table_element.'
|
||||
( '.implode( ",", $keys ).' )
|
||||
VALUES ( '.implode( ",", $values ).' ) ';
|
||||
$res = $this->db->query( $sql );
|
||||
if($res===false) {
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// TODO Add triggers
|
||||
|
||||
|
||||
return true;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function to load data into current object this
|
||||
*
|
||||
|
|
@ -4905,10 +4919,10 @@ abstract class CommonObject
|
|||
{
|
||||
$this->{$field} = $obj->{$field};
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function to concat keys of fields
|
||||
*
|
||||
|
|
@ -4919,7 +4933,7 @@ abstract class CommonObject
|
|||
$keys = array_keys($this->fields);
|
||||
return implode(',', $keys);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load object in memory from the database
|
||||
*
|
||||
|
|
@ -4930,12 +4944,12 @@ abstract class CommonObject
|
|||
*/
|
||||
public function fetchCommon($id, $ref = null)
|
||||
{
|
||||
|
||||
|
||||
if (empty($id) && empty($ref)) return false;
|
||||
|
||||
|
||||
$sql = 'SELECT '.$this->get_field_list().', datec, tms';
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX.$this->table_element;
|
||||
|
||||
|
||||
if(!empty($id)) $sql.= ' WHERE rowid = '.$id;
|
||||
else $sql.= ' WHERE ref = \''.$this->quote($ref).'\'';
|
||||
|
||||
|
|
@ -4946,10 +4960,10 @@ abstract class CommonObject
|
|||
{
|
||||
$this->id = $id;
|
||||
$this->set_vars_by_db($obj);
|
||||
|
||||
|
||||
$this->datec = $this->db->idate($obj->datec);
|
||||
$this->tms = $this->db->idate($obj->tms);
|
||||
|
||||
|
||||
return $this->id;
|
||||
}
|
||||
else
|
||||
|
|
@ -4978,9 +4992,9 @@ abstract class CommonObject
|
|||
public function updateCommon(User $user, $notrigger = false)
|
||||
{
|
||||
$fields = $this->set_save_query();
|
||||
|
||||
|
||||
foreach ($fields as $k => $v) {
|
||||
|
||||
|
||||
if (is_array($key)){
|
||||
$i=array_search($k, $key);
|
||||
if ( $i !== false) {
|
||||
|
|
@ -4993,22 +5007,22 @@ abstract class CommonObject
|
|||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$tmp[] = $k.'='.$this->quote($v);
|
||||
}
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element.' SET '.implode( ',', $tmp ).' WHERE rowid='.$this->id ;
|
||||
$res = $this->db->query( $sql );
|
||||
|
||||
|
||||
if($res===false) {
|
||||
//error
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// TODO Add triggers
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Delete object in database
|
||||
*
|
||||
|
|
@ -5020,14 +5034,14 @@ abstract class CommonObject
|
|||
public function deleteCommon(User $user, $notrigger = false)
|
||||
{
|
||||
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.' WHERE rowid='.$this->id;
|
||||
|
||||
|
||||
$res = $this->db->query( $sql );
|
||||
if($res===false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// TODO Add triggers
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -5038,12 +5052,12 @@ abstract class CommonObject
|
|||
* @return string|int
|
||||
*/
|
||||
protected function quote($value) {
|
||||
|
||||
|
||||
if(is_null($value)) return 'NULL';
|
||||
else if(is_numeric($value)) return $value;
|
||||
else return "'".$this->db->escape( $value )."'";
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -69,6 +69,9 @@ class ExtraFields
|
|||
// Array to store if extra field is hidden
|
||||
var $attribute_hidden; // warning, do not rely on this. If your module need a hidden data, it must use its own table.
|
||||
|
||||
// New array to store extrafields definition
|
||||
var $attributes;
|
||||
|
||||
var $error;
|
||||
var $errno;
|
||||
|
||||
|
|
@ -640,26 +643,29 @@ class ExtraFields
|
|||
|
||||
|
||||
/**
|
||||
* Load array this->attribute_xxx like attribute_label, attribute_type, ...
|
||||
* Load array this->attributes, or old this->attribute_xxx like attribute_label, attribute_type, ...
|
||||
*
|
||||
* @param string $elementtype Type of element ('adherent', 'commande', 'thirdparty', 'facture', 'propal', 'product', ...)
|
||||
* @param boolean $forceload Force load of extra fields whatever is option MAIN_EXTRAFIELDS_DISABLED
|
||||
* @return array Array of attributes for all extra fields
|
||||
* @param string $elementtype Type of element ('adherent', 'commande', 'thirdparty', 'facture', 'propal', 'product', ...).
|
||||
* @param boolean $forceload Force load of extra fields whatever is option MAIN_EXTRAFIELDS_DISABLED. Deprecated. Should not be required.
|
||||
* @return array Array of attributes keys+label for all extra fields.
|
||||
*/
|
||||
function fetch_name_optionals_label($elementtype,$forceload=false)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
if ( empty($elementtype) ) return array();
|
||||
if (empty($elementtype) ) return array();
|
||||
|
||||
if ($elementtype == 'thirdparty') $elementtype='societe';
|
||||
if ($elementtype == 'contact') $elementtype='socpeople';
|
||||
|
||||
$array_name_label=array();
|
||||
|
||||
// For avoid conflicts with external modules
|
||||
// To avoid conflicts with external modules. TODO Remove this.
|
||||
if (!$forceload && !empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) return $array_name_label;
|
||||
|
||||
// We should not have several time this log. If we have, there is some optimization to do by calling a simple $object->fetch_optionals() that include cache management.
|
||||
dol_syslog("fetch_name_optionals_label elementtype=".$elementtype);
|
||||
|
||||
$sql = "SELECT rowid,name,label,type,size,elementtype,fieldunique,fieldrequired,param,pos,alwayseditable,perms,list,ishidden,fielddefault,fieldcomputed";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."extrafields";
|
||||
$sql.= " WHERE entity IN (0,".$conf->entity.")";
|
||||
|
|
@ -673,12 +679,13 @@ class ExtraFields
|
|||
{
|
||||
while ($tab = $this->db->fetch_object($resql))
|
||||
{
|
||||
// we can add this attribute to adherent object
|
||||
// We can add this attribute to object. TODO Remove this and return $this->attributes[$elementtype]['label']
|
||||
if ($tab->type != 'separate')
|
||||
{
|
||||
$array_name_label[$tab->name]=$tab->label;
|
||||
}
|
||||
|
||||
// Old usage
|
||||
$this->attribute_type[$tab->name]=$tab->type;
|
||||
$this->attribute_label[$tab->name]=$tab->label;
|
||||
$this->attribute_size[$tab->name]=$tab->size;
|
||||
|
|
@ -693,8 +700,25 @@ class ExtraFields
|
|||
$this->attribute_perms[$tab->name]=$tab->perms;
|
||||
$this->attribute_list[$tab->name]=$tab->list;
|
||||
$this->attribute_hidden[$tab->name]=$tab->ishidden;
|
||||
|
||||
// New usage
|
||||
$this->attributes[$tab->elementtype]['type'][$tab->name]=$tab->type;
|
||||
$this->attributes[$tab->elementtype]['label'][$tab->name]=$tab->label;
|
||||
$this->attributes[$tab->elementtype]['size'][$tab->name]=$tab->size;
|
||||
$this->attributes[$tab->elementtype]['elementtype'][$tab->name]=$tab->elementtype;
|
||||
$this->attributes[$tab->elementtype]['default'][$tab->name]=$tab->fielddefault;
|
||||
$this->attributes[$tab->elementtype]['computed'][$tab->name]=$tab->fieldcomputed;
|
||||
$this->attributes[$tab->elementtype]['unique'][$tab->name]=$tab->fieldunique;
|
||||
$this->attributes[$tab->elementtype]['required'][$tab->name]=$tab->fieldrequired;
|
||||
$this->attributes[$tab->elementtype]['param'][$tab->name]=($tab->param ? unserialize($tab->param) : '');
|
||||
$this->attributes[$tab->elementtype]['pos'][$tab->name]=$tab->pos;
|
||||
$this->attributes[$tab->elementtype]['alwayseditable'][$tab->name]=$tab->alwayseditable;
|
||||
$this->attributes[$tab->elementtype]['perms'][$tab->name]=$tab->perms;
|
||||
$this->attributes[$tab->elementtype]['list'][$tab->name]=$tab->list;
|
||||
$this->attributes[$tab->elementtype]['ishidden'][$tab->name]=$tab->ishidden;
|
||||
}
|
||||
}
|
||||
if ($elementtype) $this->attributes[$elementtype]['loaded']=1;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -17,22 +17,28 @@
|
|||
*
|
||||
* Need to have following variables defined:
|
||||
* $object (invoice, order, ...)
|
||||
* $action
|
||||
* $conf
|
||||
* $langs
|
||||
*
|
||||
* $parameters
|
||||
* $cols
|
||||
*/
|
||||
?>
|
||||
<!-- BEGIN PHP TEMPLATE admin_extrafields_view.tpl.php -->
|
||||
<!-- BEGIN PHP TEMPLATE extrafields_view.tpl.php -->
|
||||
<?php
|
||||
|
||||
//$res = $object->fetch_optionals($object->id, $extralabels);
|
||||
$parameters = array('colspan' => ' colspan="'.$cols.'"', 'cols' => $cols, 'socid' => $object->fk_soc);
|
||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action);
|
||||
if (! is_array($parameters)) $parameters = array();
|
||||
if (! empty($cols)) $parameters['colspan'] = ' colspan="'.$cols.'"';
|
||||
if (! empty($cols)) $parameters['cols'] = $cols;
|
||||
if (! empty($object->fk_soc)) $parameters['socid'] = $object->fk_soc;
|
||||
|
||||
if (empty($reshook) && ! empty($extrafields->attribute_label))
|
||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action);
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
|
||||
if (empty($reshook) && ! empty($extrafields->attributes[$object->table_element]['label']))
|
||||
{
|
||||
foreach ($extrafields->attribute_label as $key => $label)
|
||||
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $label)
|
||||
{
|
||||
if ($action == 'edit_extras')
|
||||
{
|
||||
|
|
@ -42,54 +48,63 @@ if (empty($reshook) && ! empty($extrafields->attribute_label))
|
|||
{
|
||||
$value = $object->array_options["options_" . $key];
|
||||
}
|
||||
if ($extrafields->attribute_type[$key] == 'separate')
|
||||
if ($extrafields->attributes[$object->table_element]['type'][$key] == 'separate')
|
||||
{
|
||||
print $extrafields->showSeparator($key);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!empty($extrafields->attribute_hidden[$key])) print '<tr class="hideobject"><td>';
|
||||
if (! empty($extrafields->attributes[$object->table_element]['ishidden'][$key])) print '<tr class="hideobject"><td>';
|
||||
else print '<tr><td>';
|
||||
print '<table width="100%" class="nobordernopadding">';
|
||||
print '<tr>';
|
||||
print '<td';
|
||||
//var_dump($action);exit;
|
||||
if ((! empty($action) && ($action == 'create' || $action == 'edit')) && ! empty($extrafields->attribute_required[$key])) print ' class="fieldrequired"';
|
||||
if ((! empty($action) && ($action == 'create' || $action == 'edit')) && ! empty($extrafields->attributes[$object->table_element]['required'][$key])) print ' class="fieldrequired"';
|
||||
print '>' . $langs->trans($label) . '</td>';
|
||||
|
||||
//TODO Improve element and rights detection
|
||||
//var_dump($user->rights);
|
||||
$permok=false;
|
||||
|
||||
$keyforperm=$object->element;
|
||||
if ($object->element == 'fichinter') $keyforperm='ficheinter';
|
||||
if (isset($user->rights->$keyforperm)) $permok=$user->rights->$keyforperm->creer||$user->rights->$keyforperm->create||$user->rights->$keyforperm->write;
|
||||
if ($object->element=='order_supplier') $permok=$user->rights->fournisseur->commande->creer;
|
||||
|
||||
if ($object->element=='order_supplier') $permok=$user->rights->fournisseur->commande->creer;
|
||||
if ($object->element=='invoice_supplier') $permok=$user->rights->fournisseur->facture->creer;
|
||||
if ($object->element=='shipping') $permok=$user->rights->expedition->creer;
|
||||
if ($object->element=='delivery') $permok=$user->rights->expedition->livraison->creer;
|
||||
if ($object->element=='productlot') $permok=$user->rights->stock->creer;
|
||||
|
||||
if (($object->statut == 0 || $extrafields->attribute_alwayseditable[$key])
|
||||
&& $permok && ($action != 'edit_extras' || GETPOST('attribute') != $key))
|
||||
print '<td align="right"><a href="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=edit_extras&attribute=' . $key . '">' . img_edit().'</a></td>';
|
||||
if ($object->element=='shipping') $permok=$user->rights->expedition->creer;
|
||||
if ($object->element=='delivery') $permok=$user->rights->expedition->livraison->creer;
|
||||
if ($object->element=='productlot') $permok=$user->rights->stock->creer;
|
||||
|
||||
if (($object->statut == 0 || ! empty($extrafields->attributes[$object->table_element]['alwayseditable'][$key]))
|
||||
&& $permok && ($action != 'edit_extras' || GETPOST('attribute') != $key)
|
||||
&& empty($extrafields->attributes[$object->table_element]['computed'][$key]))
|
||||
{
|
||||
$fieldid='id';
|
||||
if ($object->table_element == 'societe') $fieldid='socid';
|
||||
print '<td align="right"><a href="' . $_SERVER['PHP_SELF'] . '?'.$fieldid.'=' . $object->id . '&action=edit_extras&attribute=' . $key . '">' . img_edit().'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
$html_id = !empty($object->id) ? $object->element.'_extras_'.$key.'_'.$object->id : '';
|
||||
print '<td id="'.$html_id.'" class="'.$object->element.'_extras_'.$key.'" colspan="'.$cols.'">';
|
||||
|
||||
// Convert date into timestamp format
|
||||
if (in_array($extrafields->attribute_type[$key], array('date','datetime'))) {
|
||||
if (in_array($extrafields->attributes[$object->table_element]['type'][$key], array('date','datetime'))) {
|
||||
$value = isset($_POST["options_" . $key]) ? dol_mktime($_POST["options_" . $key . "hour"], $_POST["options_" . $key . "min"], 0, $_POST["options_" . $key . "month"], $_POST["options_" . $key . "day"], $_POST["options_" . $key . "year"]) : $db->jdate($object->array_options['options_' . $key]);
|
||||
}
|
||||
|
||||
//TODO Improve element and rights detection
|
||||
if ($action == 'edit_extras' && $permok && GETPOST('attribute') == $key)
|
||||
{
|
||||
print '<form enctype="multipart/form-data" action="' . $_SERVER["PHP_SELF"] . '" method="post" name="formextra">';
|
||||
$fieldid='id';
|
||||
if ($object->table_element == 'societe') $fieldid='socid';
|
||||
|
||||
print '<form enctype="multipart/form-data" action="' . $_SERVER["PHP_SELF"] . '" method="post" name="formextra">';
|
||||
print '<input type="hidden" name="action" value="update_extras">';
|
||||
print '<input type="hidden" name="attribute" value="' . $key . '">';
|
||||
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
||||
print '<input type="hidden" name="id" value="' . $object->id . '">';
|
||||
print '<input type="hidden" name="'.$fieldid.'" value="' . $object->id . '">';
|
||||
|
||||
print $extrafields->showInputField($key, $value,'','','',0,$object->id);
|
||||
|
||||
|
|
@ -102,8 +117,41 @@ if (empty($reshook) && ! empty($extrafields->attribute_label))
|
|||
print $extrafields->showOutputField($key, $value);
|
||||
}
|
||||
print '</td></tr>' . "\n";
|
||||
|
||||
print "\n";
|
||||
// Add code to manage list depending on others
|
||||
if (! empty($conf->use_javascript_ajax))
|
||||
print '
|
||||
<script type="text/javascript">
|
||||
jQuery(document).ready(function() {
|
||||
function showOptions(child_list, parent_list)
|
||||
{
|
||||
var val = $("select[name=\"options_"+parent_list+"\"]").val();
|
||||
var parentVal = parent_list + ":" + val;
|
||||
if(val > 0) {
|
||||
$("select[name=\""+child_list+"\"] option[parent]").hide();
|
||||
$("select[name=\""+child_list+"\"] option[parent=\""+parentVal+"\"]").show();
|
||||
} else {
|
||||
$("select[name=\""+child_list+"\"] option").show();
|
||||
}
|
||||
}
|
||||
function setListDependencies() {
|
||||
jQuery("select option[parent]").parent().each(function() {
|
||||
var child_list = $(this).attr("name");
|
||||
var parent = $(this).find("option[parent]:first").attr("parent");
|
||||
var infos = parent.split(":");
|
||||
var parent_list = infos[0];
|
||||
$("select[name=\""+parent_list+"\"]").change(function() {
|
||||
showOptions(child_list, parent_list);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
setListDependencies();
|
||||
});
|
||||
</script>'."\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
<!-- END PHP TEMPLATE admin_extrafields_view.tpl.php -->
|
||||
<!-- END PHP TEMPLATE extrafields_view.tpl.php -->
|
||||
|
|
@ -50,7 +50,7 @@ $cancel=GETPOST('cancel');
|
|||
$amount=GETPOST('amount');
|
||||
$donation_date=dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear'));
|
||||
$projectid = (GETPOST('projectid') ? GETPOST('projectid', 'int') : 0);
|
||||
|
||||
|
||||
$object = new Don($db);
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
|
|
@ -336,7 +336,7 @@ if ($action == 'create')
|
|||
print '</tr>';
|
||||
|
||||
// Country
|
||||
print '<tr><td><label for="selectcountry_id">'.$langs->trans('Country').'</label></td><td colspan="3" class="maxwidthonsmartphone">';
|
||||
print '<tr><td><label for="selectcountry_id">'.$langs->trans('Country').'</label></td><td class="maxwidthonsmartphone">';
|
||||
print $form->select_country(GETPOST('country_id')!=''?GETPOST('country_id'):$object->country_id);
|
||||
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
|
||||
print '</td></tr>';
|
||||
|
|
@ -346,7 +346,7 @@ if ($action == 'create')
|
|||
// Public note
|
||||
print '<tr>';
|
||||
print '<td class="border" valign="top">' . $langs->trans('NotePublic') . '</td>';
|
||||
print '<td valign="top" colspan="2">';
|
||||
print '<td>';
|
||||
|
||||
$doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
|
||||
print $doleditor->Create(1);
|
||||
|
|
@ -356,7 +356,7 @@ if ($action == 'create')
|
|||
if (empty($user->societe_id)) {
|
||||
print '<tr>';
|
||||
print '<td class="border" valign="top">' . $langs->trans('NotePrivate') . '</td>';
|
||||
print '<td valign="top" colspan="2">';
|
||||
print '<td>';
|
||||
|
||||
$doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
|
||||
print $doleditor->Create(1);
|
||||
|
|
@ -371,7 +371,7 @@ if ($action == 'create')
|
|||
}
|
||||
|
||||
// Other attributes
|
||||
$parameters=array('colspan' => 3);
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook) && ! empty($extrafields->attribute_label))
|
||||
{
|
||||
|
|
@ -442,7 +442,7 @@ if (! empty($id) && $action == 'edit')
|
|||
}
|
||||
else
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("Amount").'</td><td colspan="2">';
|
||||
print '<tr><td>'.$langs->trans("Amount").'</td><td>';
|
||||
print price($object->amount,0,$langs,0,0,-1,$conf->currency);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
|
@ -467,7 +467,7 @@ if (! empty($id) && $action == 'edit')
|
|||
print '</tr>';
|
||||
|
||||
// Country
|
||||
print '<tr><td class="titlefieldcreate">'.$langs->trans('Country').'</td><td colspan="3">';
|
||||
print '<tr><td class="titlefieldcreate">'.$langs->trans('Country').'</td><td>';
|
||||
print $form->select_country((!empty($object->country_id)?$object->country_id:$mysoc->country_code),'country_id');
|
||||
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
|
||||
print '</td></tr>';
|
||||
|
|
@ -496,7 +496,7 @@ if (! empty($id) && $action == 'edit')
|
|||
}
|
||||
|
||||
// Other attributes
|
||||
$parameters=array('colspan' => ' colspan="2"');
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook) && ! empty($extrafields->attribute_label))
|
||||
{
|
||||
|
|
@ -544,9 +544,9 @@ if (! empty($id) && $action != 'edit')
|
|||
|
||||
// Print form confirm
|
||||
print $formconfirm;
|
||||
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/don/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
|
||||
$morehtmlref='<div class="refidno">';
|
||||
// Project
|
||||
if (! empty($conf->projet->enabled))
|
||||
|
|
@ -581,8 +581,8 @@ if (! empty($id) && $action != 'edit')
|
|||
}
|
||||
}
|
||||
$morehtmlref.='</div>';
|
||||
|
||||
|
||||
|
||||
|
||||
dol_banner_tab($object, 'rowid', $linkback, 1, 'rowid', 'ref', $morehtmlref);
|
||||
|
||||
|
||||
|
|
@ -620,7 +620,7 @@ if (! empty($id) && $action != 'edit')
|
|||
// Zip / Town
|
||||
print '<tr><td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td>';
|
||||
print $object->zip.($object->zip && $object->town?' / ':'').$object->town.'</td></tr>';
|
||||
|
||||
|
||||
// Country
|
||||
print '<tr><td>'.$langs->trans('Country').'</td><td>';
|
||||
if (! empty($object->country_code))
|
||||
|
|
@ -634,18 +634,18 @@ if (! empty($id) && $action != 'edit')
|
|||
print $object->country_olddata;
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
// EMail
|
||||
print "<tr>".'<td>'.$langs->trans("EMail").'</td><td>'.dol_print_email($object->email).'</td></tr>';
|
||||
*/
|
||||
|
||||
|
||||
// Payment mode
|
||||
print "<tr><td>".$langs->trans("PaymentMode")."</td><td>";
|
||||
$form->form_modes_reglement(null, $object->modepaymentid,'none');
|
||||
print "</td></tr>\n";
|
||||
|
||||
|
||||
//print "<tr>".'<td>'.$langs->trans("Status").'</td><td>'.$object->getLibStatut(4).'</td></tr>';
|
||||
|
||||
|
||||
// Project
|
||||
/*
|
||||
if (! empty($conf->projet->enabled))
|
||||
|
|
@ -660,7 +660,7 @@ if (! empty($id) && $action != 'edit')
|
|||
print '</td>';
|
||||
print '</tr>';
|
||||
}*/
|
||||
|
||||
|
||||
// Other attributes
|
||||
$cols = 2;
|
||||
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
|
||||
|
|
@ -702,7 +702,7 @@ if (! empty($id) && $action != 'edit')
|
|||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object($resql);
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print '<a href="'.DOL_URL_ROOT.'/don/payment/card.php?id='.$objp->rowid.'">'.img_object($langs->trans("Payment"),"payment").' '.$objp->rowid.'</a></td>';
|
||||
print '<td>'.dol_print_date($db->jdate($objp->dp),'day')."</td>\n";
|
||||
|
|
|
|||
|
|
@ -115,12 +115,12 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
|
|||
|
||||
if (empty($reshook))
|
||||
{
|
||||
if ($cancel)
|
||||
{
|
||||
$action = '';
|
||||
if ($cancel)
|
||||
{
|
||||
$action = '';
|
||||
$object->fetch($id); // show shipment also after canceling modification
|
||||
}
|
||||
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once
|
||||
|
||||
// Set incoterm
|
||||
|
|
@ -129,13 +129,13 @@ if (empty($reshook))
|
|||
$object->fetch($id);
|
||||
$result = $object->reOpen();
|
||||
}
|
||||
|
||||
|
||||
// Set incoterm
|
||||
if ($action == 'set_incoterms' && !empty($conf->incoterm->enabled))
|
||||
{
|
||||
$result = $object->setIncoterms(GETPOST('incoterm_id', 'int'), GETPOST('location_incoterms', 'alpha'));
|
||||
}
|
||||
|
||||
|
||||
if ($action == 'setref_customer')
|
||||
{
|
||||
$result = $object->fetch($id);
|
||||
|
|
@ -152,14 +152,14 @@ if (empty($reshook))
|
|||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($action == 'update_extras')
|
||||
{
|
||||
// Fill array 'array_options' with data from update form
|
||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute'));
|
||||
if ($ret < 0) $error++;
|
||||
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
// Actions on extra fields (by external module or standard code)
|
||||
|
|
@ -175,11 +175,11 @@ if (empty($reshook))
|
|||
} else if ($reshook < 0)
|
||||
$error++;
|
||||
}
|
||||
|
||||
|
||||
if ($error)
|
||||
$action = 'edit_extras';
|
||||
}
|
||||
|
||||
|
||||
// Create shipment
|
||||
if ($action == 'add' && $user->rights->expedition->creer)
|
||||
{
|
||||
|
|
@ -251,18 +251,18 @@ if (empty($reshook))
|
|||
$sub_qty[$j]['q']=GETPOST($qty,'int'); // the qty we want to move for this stock record
|
||||
$sub_qty[$j]['id_batch']=GETPOST($batch,'int'); // the id into llx_product_batch of stock record to move
|
||||
$subtotalqty+=$sub_qty[$j]['q'];
|
||||
|
||||
|
||||
//var_dump($qty);var_dump($batch);var_dump($sub_qty[$j]['q']);var_dump($sub_qty[$j]['id_batch']);
|
||||
|
||||
|
||||
$j++;
|
||||
$batch="batchl".$i."_".$j;
|
||||
$qty = "qtyl".$i.'_'.$j;
|
||||
}
|
||||
|
||||
|
||||
$batch_line[$i]['detail']=$sub_qty; // array of details
|
||||
$batch_line[$i]['qty']=$subtotalqty;
|
||||
$batch_line[$i]['ix_l']=GETPOST($idl,'int');
|
||||
|
||||
|
||||
$totalqty+=$subtotalqty;
|
||||
}
|
||||
else
|
||||
|
|
@ -289,11 +289,11 @@ if (empty($reshook))
|
|||
$stockLine[$i][$j]['ix_l']=GETPOST($idl,'int');
|
||||
|
||||
$totalqty+=GETPOST($qty,'int');
|
||||
|
||||
|
||||
$j++;
|
||||
$stockLocation="ent1".$i."_".$j;
|
||||
$qty = "qtyl".$i.'_'.$j;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -301,7 +301,7 @@ if (empty($reshook))
|
|||
//shipment line for product with no batch management and no multiple stock location
|
||||
if (GETPOST($qty,'int') > 0) $totalqty+=GETPOST($qty,'int');
|
||||
}
|
||||
|
||||
|
||||
// Extrafields
|
||||
$extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line);
|
||||
$array_options[$i] = $extrafieldsline->getOptionalsFromPost($extralabelsline, $i);
|
||||
|
|
@ -312,9 +312,9 @@ if (empty($reshook))
|
|||
unset($_POST["options_" . $key]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
//var_dump($batch_line[2]);
|
||||
|
||||
if ($totalqty > 0) // There is at least one thing to ship
|
||||
|
|
@ -324,7 +324,7 @@ if (empty($reshook))
|
|||
{
|
||||
$qty = "qtyl".$i;
|
||||
if (! isset($batch_line[$i]))
|
||||
{
|
||||
{
|
||||
// not batch mode
|
||||
if (isset($stockLine[$i]))
|
||||
{
|
||||
|
|
@ -352,7 +352,7 @@ if (empty($reshook))
|
|||
$entrepot_id = is_numeric(GETPOST($ent,'int'))?GETPOST($ent,'int'):GETPOST('entrepot_id','int');
|
||||
if ($entrepot_id < 0) $entrepot_id='';
|
||||
if (! ($objectsrc->lines[$i]->fk_product > 0)) $entrepot_id = 0;
|
||||
|
||||
|
||||
$ret=$object->addline($entrepot_id, GETPOST($idl,'int'), GETPOST($qty,'int'), $array_options[$i]);
|
||||
if ($ret < 0)
|
||||
{
|
||||
|
|
@ -363,7 +363,7 @@ if (empty($reshook))
|
|||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
// batch mode
|
||||
if ($batch_line[$i]['qty']>0)
|
||||
{
|
||||
|
|
@ -375,11 +375,11 @@ if (empty($reshook))
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
|
||||
if ($ret < 0) $error++;
|
||||
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$ret=$object->create($user); // This create shipment (like Odoo picking) and line of shipments. Stock movement will when validating shipment.
|
||||
|
|
@ -433,9 +433,9 @@ if (empty($reshook))
|
|||
)
|
||||
{
|
||||
$object->fetch_thirdparty();
|
||||
|
||||
|
||||
$result = $object->valid($user);
|
||||
|
||||
|
||||
if ($result < 0)
|
||||
{
|
||||
$langs->load("errors");
|
||||
|
|
@ -627,7 +627,7 @@ if ($action == 'create2')
|
|||
$action=''; $id=''; $ref='';
|
||||
}
|
||||
|
||||
// Mode creation.
|
||||
// Mode creation.
|
||||
if ($action == 'create')
|
||||
{
|
||||
$expe = new Expedition($db);
|
||||
|
|
@ -740,7 +740,7 @@ if ($action == 'create')
|
|||
// Weight
|
||||
print '<tr><td>';
|
||||
print $langs->trans("Weight");
|
||||
print '</td><td><input name="weight" size="4" value="'.GETPOST('weight','int').'"> ';
|
||||
print '</td><td colspan="3"><input name="weight" size="4" value="'.GETPOST('weight','int').'"> ';
|
||||
$text=$formproduct->select_measuring_units("weight_units","weight",GETPOST('weight_units','int'));
|
||||
$htmltext=$langs->trans("KeepEmptyForAutoCalculation");
|
||||
print $form->textwithpicto($text, $htmltext);
|
||||
|
|
@ -770,15 +770,15 @@ if ($action == 'create')
|
|||
print '<td colspan="3">';
|
||||
print '<input name="tracking_number" size="20" value="'.GETPOST('tracking_number','alpha').'">';
|
||||
print "</td></tr>\n";
|
||||
|
||||
|
||||
// Other attributes
|
||||
$parameters = array('objectsrc' => $objectsrc, 'colspan' => ' colspan="3"', 'socid'=>$socid);
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$expe,$action); // Note that $action and $object may have been modified by hook
|
||||
|
||||
|
||||
if (empty($reshook) && ! empty($extrafields->attribute_label)) {
|
||||
print $expe->showOptionals($extrafields, 'edit');
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Incoterms
|
||||
if (!empty($conf->incoterm->enabled))
|
||||
|
|
@ -800,12 +800,12 @@ if ($action == 'create')
|
|||
print $form->selectarray('model', $liste, $conf->global->EXPEDITION_ADDON_PDF);
|
||||
print "</td></tr>\n";
|
||||
}
|
||||
|
||||
|
||||
print "</table>";
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
|
||||
// Shipment lines
|
||||
|
||||
$numAsked = count($object->lines);
|
||||
|
|
@ -833,14 +833,14 @@ if ($action == 'create')
|
|||
|
||||
|
||||
print '<br>';
|
||||
|
||||
|
||||
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
|
||||
// Load shipments already done for same order
|
||||
$object->loadExpeditions();
|
||||
|
||||
|
||||
if ($numAsked)
|
||||
{
|
||||
print '<tr class="liste_titre">';
|
||||
|
|
@ -848,7 +848,7 @@ if ($action == 'create')
|
|||
print '<td align="center">'.$langs->trans("QtyOrdered").'</td>';
|
||||
print '<td align="center">'.$langs->trans("QtyShipped").'</td>';
|
||||
print '<td align="center">'.$langs->trans("QtyToShip");
|
||||
if (empty($conf->productbatch->enabled))
|
||||
if (empty($conf->productbatch->enabled))
|
||||
{
|
||||
print ' <br>(<a href="#" id="autofill">'.$langs->trans("Fill").'</a>';
|
||||
print ' / <a href="#" id="autoreset">'.$langs->trans("Reset").'</a>)';
|
||||
|
|
@ -875,7 +875,7 @@ if ($action == 'create')
|
|||
$product = new Product($db);
|
||||
|
||||
$line = $object->lines[$indiceAsked];
|
||||
|
||||
|
||||
|
||||
// Show product and description
|
||||
$type=$line->product_type?$line->product_type:$line->fk_product_type;
|
||||
|
|
@ -885,7 +885,7 @@ if ($action == 'create')
|
|||
if (! empty($line->date_end)) $type=1;
|
||||
|
||||
print '<tr class="oddeven">'."\n";
|
||||
|
||||
|
||||
// Product label
|
||||
if ($line->fk_product > 0) // If predefined product
|
||||
{
|
||||
|
|
@ -913,7 +913,7 @@ if ($action == 'create')
|
|||
{
|
||||
print ($line->desc && $line->desc!=$line->product_label)?'<br>'.dol_htmlentitiesbr($line->desc):'';
|
||||
}
|
||||
|
||||
|
||||
print '</td>';
|
||||
}
|
||||
else
|
||||
|
|
@ -958,7 +958,7 @@ if ($action == 'create')
|
|||
$quantityToBeDelivered = $quantityAsked - $quantityDelivered;
|
||||
}
|
||||
$warehouse_id = GETPOST('entrepot_id','int');
|
||||
|
||||
|
||||
$warehouseObject = null;
|
||||
if ($warehouse_id > 0 || ! ($line->fk_product > 0) || empty($conf->stock->enabled)) // If warehouse was already selected or if product is not a predefined, we go into this part with no multiwarehouse selection
|
||||
{
|
||||
|
|
@ -1040,10 +1040,10 @@ if ($action == 'create')
|
|||
{
|
||||
// Product need lot
|
||||
print '<td></td><td></td></tr>'; // end line and start a new one for lot/serial
|
||||
|
||||
|
||||
$staticwarehouse=new Entrepot($db);
|
||||
if ($warehouse_id > 0) $staticwarehouse->fetch($warehouse_id);
|
||||
|
||||
|
||||
$subj=0;
|
||||
// Define nb of lines suggested for this order line
|
||||
$nbofsuggested=0;
|
||||
|
|
@ -1066,11 +1066,11 @@ if ($action == 'create')
|
|||
print '<td colspan="3" ></td><td align="center">';
|
||||
print '<input name="qtyl'.$indiceAsked.'_'.$subj.'" id="qtyl'.$indiceAsked.'_'.$subj.'" type="text" size="4" value="'.$deliverableQty.'">';
|
||||
print '</td>';
|
||||
|
||||
|
||||
print '<td align="left">';
|
||||
|
||||
|
||||
print $staticwarehouse->getNomUrl(0).' / ';
|
||||
|
||||
|
||||
print '<!-- Show details of lot -->';
|
||||
print '<input name="batchl'.$indiceAsked.'_'.$subj.'" type="hidden" value="'.$dbatch->id.'">';
|
||||
print $langs->trans("DetailBatchFormat", $dbatch->batch, dol_print_date($dbatch->eatby,"day"), dol_print_date($dbatch->sellby,"day"), $dbatch->qty);
|
||||
|
|
@ -1089,28 +1089,28 @@ if ($action == 'create')
|
|||
print '<tr class="oddeven"><td colspan="3"></td><td align="center">';
|
||||
print '<input name="qtyl'.$indiceAsked.'_'.$subj.'" id="qtyl'.$indiceAsked.'_'.$subj.'" type="text" size="4" value="0" disabled="disabled"> ';
|
||||
print '</td>';
|
||||
|
||||
|
||||
print '<td align="left">';
|
||||
print img_warning().' '.$langs->trans("NoProductToShipFoundIntoStock", $staticwarehouse->libelle);
|
||||
print '</td></tr>';
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
// ship from multiple locations
|
||||
if (empty($conf->productbatch->enabled) || ! $product->hasbatch())
|
||||
{
|
||||
print '<td></td><td></td></tr>'; // end line and start a new one for each warehouse
|
||||
print '<!-- Case warehouse not already known and product does not need lot -->';
|
||||
|
||||
|
||||
print '<input name="idl'.$indiceAsked.'" type="hidden" value="'.$line->id.'">';
|
||||
$subj=0;
|
||||
// Define nb of lines suggested for this order line
|
||||
$nbofsuggested=0;
|
||||
foreach ($product->stock_warehouse as $warehouse_id=>$stock_warehouse)
|
||||
{
|
||||
if ($stock_warehouse->real > 0)
|
||||
if ($stock_warehouse->real > 0)
|
||||
{
|
||||
$nbofsuggested++;
|
||||
}
|
||||
|
|
@ -1119,7 +1119,7 @@ if ($action == 'create')
|
|||
foreach ($product->stock_warehouse as $warehouse_id=>$stock_warehouse) // $stock_warehouse is product_stock
|
||||
{
|
||||
$tmpwarehouseObject->fetch($warehouse_id);
|
||||
if ($stock_warehouse->real > 0)
|
||||
if ($stock_warehouse->real > 0)
|
||||
{
|
||||
$stock = + $stock_warehouse->real; // Convert it to number
|
||||
$deliverableQty = min($quantityToBeDelivered,$stock);
|
||||
|
|
@ -1134,7 +1134,7 @@ if ($action == 'create')
|
|||
}
|
||||
else print $langs->trans("NA");
|
||||
print '</td>';
|
||||
|
||||
|
||||
// Stock
|
||||
if (! empty($conf->stock->enabled))
|
||||
{
|
||||
|
|
@ -1142,10 +1142,10 @@ if ($action == 'create')
|
|||
if ($line->product_type == 0 || ! empty($conf->global->STOCK_SUPPORTS_SERVICES))
|
||||
{
|
||||
print $tmpwarehouseObject->getNomUrl(0).' ';
|
||||
|
||||
|
||||
print '<!-- Show details of stock -->';
|
||||
print '('.$stock.')';
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1193,7 +1193,7 @@ if ($action == 'create')
|
|||
|
||||
$subj=0;
|
||||
print '<input name="idl'.$indiceAsked.'" type="hidden" value="'.$line->id.'">';
|
||||
|
||||
|
||||
$tmpwarehouseObject=new Entrepot($db);
|
||||
$productlotObject=new Productlot($db);
|
||||
// Define nb of lines suggested for this order line
|
||||
|
|
@ -1207,7 +1207,7 @@ if ($action == 'create')
|
|||
}
|
||||
}
|
||||
}
|
||||
foreach ($product->stock_warehouse as $warehouse_id=>$stock_warehouse)
|
||||
foreach ($product->stock_warehouse as $warehouse_id=>$stock_warehouse)
|
||||
{
|
||||
$tmpwarehouseObject->fetch($warehouse_id);
|
||||
if (($stock_warehouse->real > 0) && (count($stock_warehouse->detail_batch))) {
|
||||
|
|
@ -1219,11 +1219,11 @@ if ($action == 'create')
|
|||
print '<!-- subj='.$subj.'/'.$nbofsuggested.' --><tr '.((($subj + 1) == $nbofsuggested)?$bc[$var]:'').'><td colspan="3"></td><td align="center">';
|
||||
print '<input name="qtyl'.$indiceAsked.'_'.$subj.'" id="qtyl'.$indiceAsked.'_'.$subj.'" type="text" size="4" value="'.$deliverableQty.'">';
|
||||
print '</td>';
|
||||
|
||||
|
||||
print '<td align="left">';
|
||||
|
||||
|
||||
print $tmpwarehouseObject->getNomUrl(0).' / ';
|
||||
|
||||
|
||||
print '<!-- Show details of lot -->';
|
||||
print '<input name="batchl'.$indiceAsked.'_'.$subj.'" type="hidden" value="'.$dbatch->id.'">';
|
||||
//print $langs->trans("DetailBatchFormat", $dbatch->batch, dol_print_date($dbatch->eatby,"day"), dol_print_date($dbatch->sellby,"day"), $dbatch->qty);
|
||||
|
|
@ -1242,7 +1242,7 @@ if ($action == 'create')
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
if ($subj == 0) // Line not shown yet, we show it
|
||||
{
|
||||
|
|
@ -1262,12 +1262,12 @@ if ($action == 'create')
|
|||
print $langs->trans("NA");
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
|
||||
print '<td align="left">';
|
||||
if ($line->product_type == 0 || ! empty($conf->global->STOCK_SUPPORTS_SERVICES))
|
||||
{
|
||||
$warehouse_selected_id = GETPOST('entrepot_id','int');
|
||||
if ($warehouse_selected_id > 0)
|
||||
$warehouse_selected_id = GETPOST('entrepot_id','int');
|
||||
if ($warehouse_selected_id > 0)
|
||||
{
|
||||
$warehouseObject=new Entrepot($db);
|
||||
$warehouseObject->fetch($warehouse_selected_id);
|
||||
|
|
@ -1287,10 +1287,10 @@ if ($action == 'create')
|
|||
print '</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//Display lines extrafields
|
||||
if (is_array($extralabelslines) && count($extralabelslines)>0)
|
||||
if (is_array($extralabelslines) && count($extralabelslines)>0)
|
||||
{
|
||||
$colspan=5;
|
||||
$line = new ExpeditionLigne($db);
|
||||
|
|
@ -1340,14 +1340,14 @@ else if ($id || $ref)
|
|||
|
||||
$soc = new Societe($db);
|
||||
$soc->fetch($object->socid);
|
||||
|
||||
|
||||
$res = $object->fetch_optionals($object->id, $extralabels);
|
||||
|
||||
$head=shipping_prepare_head($object);
|
||||
dol_fiche_head($head, 'shipping', $langs->trans("Shipment"), 0, 'sending');
|
||||
|
||||
$formconfirm='';
|
||||
|
||||
|
||||
// Confirm deleteion
|
||||
if ($action == 'delete')
|
||||
{
|
||||
|
|
@ -1393,18 +1393,18 @@ else if ($id || $ref)
|
|||
if (empty($reshook)) $formconfirm.=$hookmanager->resPrint;
|
||||
elseif ($reshook > 0) $formconfirm=$hookmanager->resPrint;
|
||||
}
|
||||
|
||||
|
||||
// Print form confirm
|
||||
print $formconfirm;
|
||||
|
||||
|
||||
|
||||
|
||||
// Calculate totalWeight and totalVolume for all products
|
||||
// by adding weight and volume of each product line.
|
||||
$tmparray=$object->getTotalWeightVolume();
|
||||
$totalWeight=$tmparray['weight'];
|
||||
$totalVolume=$tmparray['volume'];
|
||||
|
||||
|
||||
|
||||
|
||||
if ($typeobject == 'commande' && $object->$typeobject->id && ! empty($conf->commande->enabled))
|
||||
{
|
||||
$objectsrc=new Commande($db);
|
||||
|
|
@ -1459,15 +1459,15 @@ else if ($id || $ref)
|
|||
}
|
||||
}
|
||||
$morehtmlref.='</div>';
|
||||
|
||||
|
||||
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
||||
|
||||
|
||||
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="fichehalfleft">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Linked documents
|
||||
|
|
@ -1550,7 +1550,7 @@ else if ($id || $ref)
|
|||
if (!empty($object->trueWeight)) print ' ('.$langs->trans("SumOfProductWeights").': ';
|
||||
//print $totalWeight.' '.measuring_units_string(0,"weight");
|
||||
print showDimensionInBestUnit($totalWeight, 0, "weight", $langs, isset($conf->global->MAIN_WEIGHT_DEFAULT_ROUND)?$conf->global->MAIN_WEIGHT_DEFAULT_ROUND:-1, isset($conf->global->MAIN_WEIGHT_DEFAULT_UNIT)?$conf->global->MAIN_WEIGHT_DEFAULT_UNIT:'no');
|
||||
//if (empty($object->trueWeight)) print ' ('.$langs->trans("Calculated").')';
|
||||
//if (empty($object->trueWeight)) print ' ('.$langs->trans("Calculated").')';
|
||||
if (!empty($object->trueWeight)) print ')';
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
|
@ -1597,7 +1597,7 @@ else if ($id || $ref)
|
|||
print '<td colspan="3">';
|
||||
$calculatedVolume=0;
|
||||
$volumeUnit=0;
|
||||
if ($object->trueWidth && $object->trueHeight && $object->trueDepth)
|
||||
if ($object->trueWidth && $object->trueHeight && $object->trueDepth)
|
||||
{
|
||||
$calculatedVolume=($object->trueWidth * $object->trueHeight * $object->trueDepth);
|
||||
$volumeUnit=$object->size_units * 3;
|
||||
|
|
@ -1605,7 +1605,7 @@ else if ($id || $ref)
|
|||
// If sending volume not defined we use sum of products
|
||||
if ($calculatedVolume > 0)
|
||||
{
|
||||
if ($volumeUnit < 50)
|
||||
if ($volumeUnit < 50)
|
||||
{
|
||||
//print $calculatedVolume.' '.measuring_units_string($volumeUnit,"volume");
|
||||
print showDimensionInBestUnit($calculatedVolume, $volumeUnit, "volume", $langs, isset($conf->global->MAIN_VOLUME_DEFAULT_ROUND)?$conf->global->MAIN_VOLUME_DEFAULT_ROUND:-1, isset($conf->global->MAIN_VOLUME_DEFAULT_UNIT)?$conf->global->MAIN_VOLUME_DEFAULT_UNIT:'no');
|
||||
|
|
@ -1626,14 +1626,14 @@ else if ($id || $ref)
|
|||
// Other attributes
|
||||
$cols = 2;
|
||||
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
|
||||
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
||||
print '</div>';
|
||||
print '<div class="fichehalfright">';
|
||||
print '<div class="ficheaddleft">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
// Sending method
|
||||
|
|
@ -1667,7 +1667,7 @@ else if ($id || $ref)
|
|||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
// Tracking Number
|
||||
print '<tr><td class="titlefield">'.$form->editfieldkey("TrackingNumber",'trackingnumber',$object->tracking_number,$object,$user->rights->expedition->creer).'</td><td colspan="3">';
|
||||
print $form->editfieldval("TrackingNumber",'trackingnumber',$object->tracking_url,$object,$user->rights->expedition->creer,'string',$object->tracking_number);
|
||||
|
|
@ -1697,19 +1697,19 @@ else if ($id || $ref)
|
|||
}
|
||||
|
||||
print "</table>";
|
||||
|
||||
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
|
||||
|
||||
print '<div class="clearboth"></div>';
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Lines of products
|
||||
*/
|
||||
print '<br>';
|
||||
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
|
|
@ -1732,7 +1732,7 @@ else if ($id || $ref)
|
|||
{
|
||||
print '<td align="center">'.$langs->trans("QtyInOtherShipments").'</td>';
|
||||
}
|
||||
|
||||
|
||||
print '<td align="center">'.$langs->trans("CalculatedWeight").'</td>';
|
||||
print '<td align="center">'.$langs->trans("CalculatedVolume").'</td>';
|
||||
//print '<td align="center">'.$langs->trans("Size").'</td>';
|
||||
|
|
@ -1793,7 +1793,7 @@ else if ($id || $ref)
|
|||
{
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
|
||||
|
||||
while($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
|
@ -1900,7 +1900,7 @@ else if ($id || $ref)
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// Weight
|
||||
|
|
@ -1960,7 +1960,7 @@ else if ($id || $ref)
|
|||
}
|
||||
print $form->textwithtooltip(img_picto('', 'object_barcode').' '.$langs->trans("DetailBatchNumber"),$detail);
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
print $langs->trans("NA");
|
||||
}
|
||||
|
|
@ -1970,7 +1970,7 @@ else if ($id || $ref)
|
|||
}
|
||||
}
|
||||
print "</tr>";
|
||||
|
||||
|
||||
// Display lines extrafields
|
||||
if (is_array($extralabelslines) && count($extralabelslines)>0) {
|
||||
$colspan= empty($conf->productbatch->enabled) ? 5 : 6;
|
||||
|
|
@ -1981,11 +1981,11 @@ else if ($id || $ref)
|
|||
print '</tr>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
// TODO Show also lines ordered but not delivered
|
||||
|
||||
|
||||
print "</table>\n";
|
||||
print '</div>';
|
||||
}
|
||||
|
|
@ -1996,7 +1996,7 @@ else if ($id || $ref)
|
|||
|
||||
$object->fetchObjectLinked($object->id,$object->element);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Boutons actions
|
||||
*/
|
||||
|
|
@ -2023,14 +2023,14 @@ else if ($id || $ref)
|
|||
print '<a class="butActionRefused" href="#" title="'.$langs->trans("NotAllowed").'">'.$langs->trans("Validate").'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// TODO add alternative status
|
||||
// 0=draft, 1=validated, 2=billed, we miss a status "delivered" (only available on order)
|
||||
if ($object->statut == 2 && $object->billed && $user->rights->expedition->creer)
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=reopen">'.$langs->trans("ReOpen").'</a>';
|
||||
}
|
||||
|
||||
|
||||
// Send
|
||||
if ($object->statut > 0)
|
||||
{
|
||||
|
|
@ -2040,7 +2040,7 @@ else if ($id || $ref)
|
|||
}
|
||||
else print '<a class="butActionRefused" href="#">'.$langs->trans('SendByMail').'</a>';
|
||||
}
|
||||
|
||||
|
||||
// Create bill and Close shipment
|
||||
if (! empty($conf->facture->enabled) && $object->statut > 0)
|
||||
{
|
||||
|
|
@ -2049,7 +2049,7 @@ else if ($id || $ref)
|
|||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("CreateBill").'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// This is just to generate a delivery receipt
|
||||
//var_dump($object->linkedObjectsIds['delivery']);
|
||||
if ($conf->livraison_bon->enabled && ($object->statut == 1 || $object->statut == 2) && $user->rights->expedition->livraison->creer && count($object->linkedObjectsIds['delivery']) == 0)
|
||||
|
|
@ -2071,14 +2071,14 @@ else if ($id || $ref)
|
|||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action='.$paramaction.'">'.$langs->trans($label).'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($user->rights->expedition->supprimer)
|
||||
{
|
||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete">'.$langs->trans("Delete").'</a>';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
|
|
@ -2086,11 +2086,11 @@ else if ($id || $ref)
|
|||
/*
|
||||
* Documents generated
|
||||
*/
|
||||
|
||||
|
||||
if ($action != 'presend')
|
||||
{
|
||||
print '<div class="fichecenter"><div class="fichehalfleft">';
|
||||
|
||||
|
||||
$objectref = dol_sanitizeFileName($object->ref);
|
||||
$filedir = $conf->expedition->dir_output . "/sending/" .$objectref;
|
||||
|
||||
|
|
@ -2101,12 +2101,12 @@ else if ($id || $ref)
|
|||
|
||||
print $formfile->showdocuments('expedition',$objectref,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'','','',$soc->default_lang);
|
||||
|
||||
|
||||
|
||||
// Show links to link elements
|
||||
//$linktoelem = $form->showLinkToObjectBlock($object, null, array('order'));
|
||||
$somethingshown = $form->showLinkedObjectBlock($object, '');
|
||||
|
||||
|
||||
|
||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||
|
||||
// List of actions on element
|
||||
|
|
@ -2117,11 +2117,11 @@ else if ($id || $ref)
|
|||
print '</div></div></div>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Action presend
|
||||
*/
|
||||
|
||||
|
||||
//Select mail models is same action as presend
|
||||
if (GETPOST('modelselected')) {
|
||||
$action = 'presend';
|
||||
|
|
@ -2182,7 +2182,7 @@ else if ($id || $ref)
|
|||
{
|
||||
include DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
$formmail->frommail=dolAddEmailTrackId($formmail->frommail, 'shi'.$object->id);
|
||||
}
|
||||
}
|
||||
$formmail->withfrom=1;
|
||||
$liste=array();
|
||||
foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key=>$value) $liste[$key]=$value;
|
||||
|
|
@ -2215,7 +2215,7 @@ else if ($id || $ref)
|
|||
{
|
||||
$contactarr=$objectsrc->liste_contact(-1,'external');
|
||||
}
|
||||
|
||||
|
||||
if (is_array($contactarr) && count($contactarr)>0) {
|
||||
foreach($contactarr as $contact) {
|
||||
|
||||
|
|
|
|||
|
|
@ -133,9 +133,9 @@ if ($object->id > 0)
|
|||
dol_fiche_head($head, 'supplier', $langs->trans("ThirdParty"), -1, 'company');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/societe/list.php">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
|
||||
dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom');
|
||||
|
||||
|
||||
print '<div class="fichecenter"><div class="fichehalfleft">';
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
|
@ -243,12 +243,7 @@ if ($object->id > 0)
|
|||
|
||||
// Other attributes
|
||||
$parameters=array('socid'=>$object->id, 'colspan' => ' colspan="3"', 'colspanvalue' => '3');
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
if (empty($reshook) && ! empty($extrafields->attribute_label))
|
||||
{
|
||||
print $object->showOptionals($extrafields);
|
||||
}
|
||||
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
|
||||
|
||||
// Module Adherent
|
||||
if (! empty($conf->adherent->enabled))
|
||||
|
|
@ -278,15 +273,15 @@ if ($object->id > 0)
|
|||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||
|
||||
$boxstat = '';
|
||||
|
||||
|
||||
// Nbre max d'elements des petites listes
|
||||
$MAXLIST=$conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
|
||||
|
||||
|
||||
// Lien recap
|
||||
$boxstat.='<div class="box">';
|
||||
$boxstat.='<table summary="'.dol_escape_htmltag($langs->trans("DolibarrStateBoard")).'" class="noborder boxtable boxtablenobottom" width="100%">';
|
||||
$boxstat.='<tr class="impair"><td colspan="2" class="tdboxstats nohover">';
|
||||
|
||||
|
||||
if ($conf->supplier_proposal->enabled)
|
||||
{
|
||||
// Box proposals
|
||||
|
|
@ -304,7 +299,7 @@ if ($object->id > 0)
|
|||
$boxstat.='</div>';
|
||||
if ($link) $boxstat.='</a>';
|
||||
}
|
||||
|
||||
|
||||
if ($conf->fournisseur->enabled)
|
||||
{
|
||||
// Box proposals
|
||||
|
|
@ -322,14 +317,14 @@ if ($object->id > 0)
|
|||
$boxstat.='</div>';
|
||||
if ($link) $boxstat.='</a>';
|
||||
}
|
||||
|
||||
|
||||
if ($conf->fournisseur->enabled)
|
||||
{
|
||||
$tmp = $object->getOutstandingBills('supplier');
|
||||
$outstandingOpened=$tmp['opened'];
|
||||
$outstandingTotal=$tmp['total_ht'];
|
||||
$outstandingTotalIncTax=$tmp['total_ttc'];
|
||||
|
||||
|
||||
$text=$langs->trans("OverAllInvoices");
|
||||
$link='';
|
||||
$icon='bill';
|
||||
|
|
@ -339,7 +334,7 @@ if ($object->id > 0)
|
|||
$boxstat.='<span class="boxstatsindicator">'.price($outstandingTotal, 1, $langs, 1, -1, -1, $conf->currency).'</span>';
|
||||
$boxstat.='</div>';
|
||||
if ($link) $boxstat.='</a>';
|
||||
|
||||
|
||||
// Box outstanding bill
|
||||
$text=$langs->trans("CurrentOutstandingBill");
|
||||
$link=DOL_URL_ROOT.'/fourn/recap-fourn.php?socid='.$object->id;
|
||||
|
|
@ -351,14 +346,14 @@ if ($object->id > 0)
|
|||
$boxstat.='</div>';
|
||||
if ($link) $boxstat.='</a>';
|
||||
}
|
||||
|
||||
|
||||
$boxstat.='</td></tr>';
|
||||
$boxstat.='</table>';
|
||||
$boxstat.='</div>';
|
||||
|
||||
|
||||
print $boxstat;
|
||||
|
||||
|
||||
|
||||
|
||||
$var=true;
|
||||
|
||||
$MAXLIST=$conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
|
||||
|
|
@ -395,10 +390,10 @@ if ($object->id > 0)
|
|||
$sql.= ' AND pfp.fk_soc = '.$object->id;
|
||||
$sql .= $db->order('pfp.tms', 'desc');
|
||||
$sql.= $db->plimit($MAXLIST);
|
||||
|
||||
|
||||
$query = $db->query($sql);
|
||||
if (! $query) dol_print_error($db);
|
||||
|
||||
|
||||
$return = array();
|
||||
|
||||
if ($db->num_rows($query)) {
|
||||
|
|
@ -407,7 +402,7 @@ if ($object->id > 0)
|
|||
|
||||
while ($objp = $db->fetch_object($query)) {
|
||||
|
||||
|
||||
|
||||
|
||||
$productstatic->id = $objp->rowid;
|
||||
$productstatic->ref = $objp->ref;
|
||||
|
|
@ -445,12 +440,12 @@ if ($object->id > 0)
|
|||
print '</table>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Last supplier proposal
|
||||
*/
|
||||
$proposalstatic = new SupplierProposal($db);
|
||||
|
||||
|
||||
if ($user->rights->supplier_proposal->lire)
|
||||
{
|
||||
$sql = "SELECT p.rowid, p.ref, p.date_valid as dc, p.fk_statut, p.total_ht, p.tva as total_tva, p.total as total_ttc";
|
||||
|
|
@ -459,17 +454,17 @@ if ($object->id > 0)
|
|||
$sql.= " AND p.entity =".$conf->entity;
|
||||
$sql.= " ORDER BY p.date_valid DESC";
|
||||
$sql.= " ".$db->plimit($MAXLIST);
|
||||
|
||||
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$i = 0 ;
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
|
||||
if ($num > 0)
|
||||
{
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="3">';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>'.$langs->trans("LastSupplierProposals",($num<$MAXLIST?"":$MAXLIST)).'</td>';
|
||||
|
|
@ -478,13 +473,13 @@ if ($object->id > 0)
|
|||
print '</tr></table>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
$var = True;
|
||||
while ($i < $num && $i <= $MAXLIST)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="nowrap">';
|
||||
$proposalstatic->id = $obj->rowid;
|
||||
|
|
@ -509,14 +504,14 @@ if ($object->id > 0)
|
|||
$i++;
|
||||
}
|
||||
$db->free($resql);
|
||||
|
||||
|
||||
if ($num >0) print "</table>";
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Last supplier orders
|
||||
|
|
@ -558,7 +553,7 @@ if ($object->id > 0)
|
|||
$object_count = $db->fetch_object($resql);
|
||||
$num = $object_count->total;
|
||||
}
|
||||
|
||||
|
||||
$sql = "SELECT p.rowid,p.ref, p.date_commande as dc, p.fk_statut, p.total_ht, p.tva as total_tva, p.total_ttc";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as p ";
|
||||
$sql.= " WHERE p.fk_soc =".$object->id;
|
||||
|
|
@ -587,7 +582,7 @@ if ($object->id > 0)
|
|||
while ($i < $num && $i < $MAXLIST)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="nowrap">';
|
||||
|
|
@ -660,7 +655,7 @@ if ($object->id > 0)
|
|||
while ($i < min($num,$MAXLIST))
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>';
|
||||
print '<a href="facture/card.php?facid='.$obj->rowid.'">';
|
||||
|
|
@ -712,7 +707,7 @@ if ($object->id > 0)
|
|||
{
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused" title="'.dol_escape_js($langs->trans("ThirdPartyIsClosed")).'" href="#">'.$langs->trans("ThirdPartyIsClosed").'</a></div>';
|
||||
}
|
||||
|
||||
|
||||
if ($conf->supplier_proposal->enabled && $user->rights->supplier_proposal->creer && $object->status==1)
|
||||
{
|
||||
$langs->load("supplier_proposal");
|
||||
|
|
@ -750,9 +745,9 @@ if ($object->id > 0)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
print '</div>';
|
||||
|
||||
|
||||
|
||||
if (! empty($conf->global->MAIN_REPEATCONTACTONEACHTAB))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -279,7 +279,7 @@ if (empty($reshook))
|
|||
if ($action == 'addline' && $user->rights->fournisseur->commande->creer)
|
||||
{
|
||||
$db->begin();
|
||||
|
||||
|
||||
$langs->load('errors');
|
||||
$error = 0;
|
||||
|
||||
|
|
@ -469,7 +469,7 @@ if (empty($reshook))
|
|||
if (! $error && $result > 0)
|
||||
{
|
||||
$db->commit();
|
||||
|
||||
|
||||
$ret=$object->fetch($object->id); // Reload to get new records
|
||||
|
||||
// Define output language
|
||||
|
|
@ -526,7 +526,7 @@ if (empty($reshook))
|
|||
$db->rollback();
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
|
||||
|
||||
$action = '';
|
||||
}
|
||||
|
||||
|
|
@ -1617,7 +1617,7 @@ elseif (! empty($object->id))
|
|||
|
||||
$res=$object->fetch_optionals($object->id,$extralabels);
|
||||
|
||||
|
||||
|
||||
$head = ordersupplier_prepare_head($object);
|
||||
|
||||
$title=$langs->trans("SupplierOrder");
|
||||
|
|
@ -1754,11 +1754,11 @@ elseif (! empty($object->id))
|
|||
// Print form confirm
|
||||
print $formconfirm;
|
||||
|
||||
|
||||
|
||||
// Supplier order card
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/fourn/commande/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
|
||||
$morehtmlref='<div class="refidno">';
|
||||
// Ref supplier
|
||||
$morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', 0, 1);
|
||||
|
|
@ -1798,15 +1798,15 @@ elseif (! empty($object->id))
|
|||
}
|
||||
}
|
||||
$morehtmlref.='</div>';
|
||||
|
||||
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
||||
|
||||
|
||||
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
||||
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="fichehalfleft">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Date
|
||||
|
|
@ -1995,16 +1995,15 @@ elseif (! empty($object->id))
|
|||
}
|
||||
|
||||
// Other attributes
|
||||
$cols = 2;
|
||||
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
||||
print '</div>';
|
||||
print '<div class="fichehalfright">';
|
||||
print '<div class="ficheaddleft">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
if (!empty($conf->multicurrency->enabled))
|
||||
|
|
@ -2013,18 +2012,18 @@ elseif (! empty($object->id))
|
|||
print '<tr><td class="titlefieldmiddle">' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . '</td>';
|
||||
print '<td class="nowrap">' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
// Multicurrency Amount VAT
|
||||
print '<tr><td>' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . '</td>';
|
||||
print '<td class="nowrap">' . price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
// Multicurrency Amount TTC
|
||||
print '<tr><td>' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . '</td>';
|
||||
print '<td class="nowrap">' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
|
||||
// Total
|
||||
print '<tr><td class="titlefieldmiddle">'.$langs->trans("AmountHT").'</td>';
|
||||
print '<td>'.price($object->total_ht,'',$langs,1,-1,-1,$conf->currency).'</td>';
|
||||
|
|
@ -2053,19 +2052,19 @@ elseif (! empty($object->id))
|
|||
print '</tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
||||
// Margin Infos
|
||||
/*if (! empty($conf->margin->enabled)) {
|
||||
$formmargin->displayMarginInfos($object);
|
||||
}*/
|
||||
|
||||
|
||||
|
||||
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
|
||||
|
||||
print '<div class="clearboth"></div><br>';
|
||||
|
||||
|
||||
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
|
||||
{
|
||||
$blocname = 'contacts';
|
||||
|
|
|
|||
|
|
@ -76,9 +76,9 @@ $extrafields = new ExtraFields($db);
|
|||
// fetch optionals attributes and labels
|
||||
$extralabels=$extrafields->fetch_name_optionals_label('facture_fourn');
|
||||
|
||||
if ($action == 'create')
|
||||
if ($action == 'create')
|
||||
{
|
||||
if (! is_array($selected))
|
||||
if (! is_array($selected))
|
||||
{
|
||||
$error++;
|
||||
setEventMessages($langs->trans('Error_OrderNotChecked'), null, 'errors');
|
||||
|
|
@ -246,10 +246,10 @@ if (($action == 'create' || $action == 'add') && ! $error) {
|
|||
|
||||
// End of object creation, we show it
|
||||
if ($id > 0 && ! $error) {
|
||||
|
||||
|
||||
foreach($orders_id as $fk_supplier_order) {
|
||||
$supplier_order = new CommandeFournisseur($db);
|
||||
if ($supplier_order->fetch($fk_supplier_order)>0 && $supplier_order->statut == 5)
|
||||
if ($supplier_order->fetch($fk_supplier_order)>0 && $supplier_order->statut == 5)
|
||||
{
|
||||
if ($supplier_order->classifyBilled($user) < 0)
|
||||
{
|
||||
|
|
@ -258,20 +258,20 @@ if (($action == 'create' || $action == 'add') && ! $error) {
|
|||
$_GET["origin"] = $_POST["origin"];
|
||||
$_GET["originid"] = $_POST["originid"];
|
||||
$mesgs[] = '<div class="error">' . $object->error . '</div>';
|
||||
|
||||
|
||||
$error++;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(!$error) {
|
||||
$db->commit();
|
||||
header('Location: ' . DOL_URL_ROOT . '/fourn/facture/card.php?facid=' . $id);
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
$db->rollback();
|
||||
$action = 'create';
|
||||
|
|
@ -366,7 +366,8 @@ if ($action == 'create' && !$error) {
|
|||
$parameters = array (
|
||||
'objectsrc' => $objectsrc,
|
||||
'idsrc' => $listoforders,
|
||||
'colspan' => ' colspan="3"'
|
||||
'colspan' => ' colspan="2"',
|
||||
'cols'=>2
|
||||
);
|
||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
|
||||
|
|
@ -494,7 +495,7 @@ if (($action != 'create' && $action != 'add') && !$error) {
|
|||
$companystatic->nom = $soc->nom;
|
||||
print '<h3>' . $companystatic->getNomUrl(1, 'customer') . '</h3>';
|
||||
}
|
||||
|
||||
|
||||
print '<form name="orders2invoice" method="GET" action="orderstoinvoice.php">';
|
||||
print '<input type="hidden" name="socid" value="' . $socid . '">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
|
@ -517,7 +518,7 @@ if (($action != 'create' && $action != 'add') && !$error) {
|
|||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat" type="text" size="10" name="sref_client" value="' . $sref_client . '">';
|
||||
print '</td>';
|
||||
|
||||
|
||||
// DATE ORDER
|
||||
print '<td class="liste_titre" align="center">';
|
||||
print $period;
|
||||
|
|
@ -606,9 +607,9 @@ if (($action != 'create' && $action != 'add') && !$error) {
|
|||
print '<input type="submit" class="butAction" value="' . $langs->trans("GenerateBill") . '">';
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
|
||||
|
||||
print '</form>';
|
||||
|
||||
|
||||
$db->free($resql);
|
||||
} else {
|
||||
print dol_print_error($db);
|
||||
|
|
|
|||
|
|
@ -206,7 +206,7 @@ if (empty($reshook))
|
|||
}
|
||||
$model=$object->modelpdf;
|
||||
$ret = $object->fetch($id); // Reload to get new records
|
||||
|
||||
|
||||
$result=$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
if ($result < 0) dol_print_error($db,$result);
|
||||
}
|
||||
|
|
@ -1198,7 +1198,7 @@ if (empty($reshook))
|
|||
$upload_dir = $conf->fournisseur->facture->dir_output;
|
||||
$permissioncreate = $user->rights->fournisseur->facture->creer;
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
|
||||
|
||||
|
||||
// Make calculation according to calculationrule
|
||||
if ($action == 'calculate')
|
||||
{
|
||||
|
|
@ -1674,7 +1674,7 @@ if ($action == 'create')
|
|||
if ($socid > 0)
|
||||
{
|
||||
// Discounts for third party
|
||||
print '<tr><td>' . $langs->trans('Discounts') . '</td><td colspan="2">';
|
||||
print '<tr><td>' . $langs->trans('Discounts') . '</td><td>';
|
||||
if ($soc->remise_percent)
|
||||
print $langs->trans("CompanyHasRelativeDiscount", '<a href="' . DOL_URL_ROOT . '/comm/remise.php?id=' . $soc->id . '&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?socid=' . $soc->id . '&action=' . $action . '&origin=' . GETPOST('origin') . '&originid=' . GETPOST('originid')) . '">' . $soc->remise_percent . '</a>');
|
||||
else
|
||||
|
|
@ -1705,17 +1705,17 @@ if ($action == 'create')
|
|||
print '</td></tr>';
|
||||
|
||||
// Payment term
|
||||
print '<tr><td class="nowrap">'.$langs->trans('PaymentConditionsShort').'</td><td colspan="2">';
|
||||
print '<tr><td class="nowrap">'.$langs->trans('PaymentConditionsShort').'</td><td>';
|
||||
$form->select_conditions_paiements(isset($_POST['cond_reglement_id'])?$_POST['cond_reglement_id']:$cond_reglement_id, 'cond_reglement_id');
|
||||
print '</td></tr>';
|
||||
|
||||
// Payment mode
|
||||
print '<tr><td>'.$langs->trans('PaymentMode').'</td><td colspan="2">';
|
||||
print '<tr><td>'.$langs->trans('PaymentMode').'</td><td>';
|
||||
$form->select_types_paiements(isset($_POST['mode_reglement_id'])?$_POST['mode_reglement_id']:$mode_reglement_id, 'mode_reglement_id', 'DBIT');
|
||||
print '</td></tr>';
|
||||
|
||||
// Bank Account
|
||||
print '<tr><td>'.$langs->trans('BankAccount').'</td><td colspan="2">';
|
||||
print '<tr><td>'.$langs->trans('BankAccount').'</td><td>';
|
||||
$form->select_comptes($fk_account, 'fk_account', 0, '', 1);
|
||||
print '</td></tr>';
|
||||
|
||||
|
|
@ -1724,7 +1724,7 @@ if ($action == 'create')
|
|||
{
|
||||
print '<tr>';
|
||||
print '<td>'.fieldLabel('Currency','multicurrency_code').'</td>';
|
||||
print '<td colspan="2" class="maxwidthonsmartphone">';
|
||||
print '<td class="maxwidthonsmartphone">';
|
||||
print $form->selectMultiCurrency($currency_code, 'multicurrency_code');
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
|
@ -1735,7 +1735,7 @@ if ($action == 'create')
|
|||
$formproject = new FormProjets($db);
|
||||
|
||||
$langs->load('projects');
|
||||
print '<tr><td>' . $langs->trans('Project') . '</td><td colspan="2">';
|
||||
print '<tr><td>' . $langs->trans('Project') . '</td><td>';
|
||||
$formproject->select_projects((empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS)?$societe->id:-1), $projectid, 'projectid', 0, 0, 1, 1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
|
@ -1790,7 +1790,7 @@ if ($action == 'create')
|
|||
$langs->load('orders');
|
||||
$txt=$langs->trans("SupplierOrder");
|
||||
}
|
||||
print '<tr><td>'.$txt.'</td><td colspan="2">'.$objectsrc->getNomUrl(1);
|
||||
print '<tr><td>'.$txt.'</td><td>'.$objectsrc->getNomUrl(1);
|
||||
// We check if Origin document (id and type is known) has already at least one invoice attached to it
|
||||
$objectsrc->fetchObjectLinked($originid,$origin,'','invoice_supplier');
|
||||
$cntinvoice=count($objectsrc->linkedObjects['invoice_supplier']);
|
||||
|
|
@ -1800,29 +1800,29 @@ if ($action == 'create')
|
|||
echo ' ('.$langs->trans('LatestRelatedBill').end($objectsrc->linkedObjects['invoice_supplier'])->getNomUrl(1).')';
|
||||
}
|
||||
echo '</td></tr>';
|
||||
print '<tr><td>'.$langs->trans('TotalHT').'</td><td colspan="2">'.price($objectsrc->total_ht).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans('TotalVAT').'</td><td colspan="2">'.price($objectsrc->total_tva)."</td></tr>";
|
||||
print '<tr><td>'.$langs->trans('TotalHT').'</td><td>'.price($objectsrc->total_ht).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans('TotalVAT').'</td><td>'.price($objectsrc->total_tva)."</td></tr>";
|
||||
if ($mysoc->localtax1_assuj=="1" || $object->total_localtax1 != 0) //Localtax1
|
||||
{
|
||||
print '<tr><td>'.$langs->transcountry("AmountLT1",$mysoc->country_code).'</td><td colspan="2">'.price($objectsrc->total_localtax1)."</td></tr>";
|
||||
print '<tr><td>'.$langs->transcountry("AmountLT1",$mysoc->country_code).'</td><td>'.price($objectsrc->total_localtax1)."</td></tr>";
|
||||
}
|
||||
|
||||
if ($mysoc->localtax2_assuj=="1" || $object->total_localtax2 != 0) //Localtax2
|
||||
{
|
||||
print '<tr><td>'.$langs->transcountry("AmountLT2",$mysoc->country_code).'</td><td colspan="2">'.price($objectsrc->total_localtax2)."</td></tr>";
|
||||
print '<tr><td>'.$langs->transcountry("AmountLT2",$mysoc->country_code).'</td><td>'.price($objectsrc->total_localtax2)."</td></tr>";
|
||||
}
|
||||
print '<tr><td>'.$langs->trans('TotalTTC').'</td><td colspan="2">'.price($objectsrc->total_ttc)."</td></tr>";
|
||||
print '<tr><td>'.$langs->trans('TotalTTC').'</td><td>'.price($objectsrc->total_ttc)."</td></tr>";
|
||||
|
||||
if (!empty($conf->multicurrency->enabled))
|
||||
{
|
||||
print '<tr><td>' . $langs->trans('MulticurrencyTotalHT') . '</td><td colspan="2">' . price($objectsrc->multicurrency_total_ht) . '</td></tr>';
|
||||
print '<tr><td>' . $langs->trans('MulticurrencyTotalVAT') . '</td><td colspan="2">' . price($objectsrc->multicurrency_total_tva) . "</td></tr>";
|
||||
print '<tr><td>' . $langs->trans('MulticurrencyTotalTTC') . '</td><td colspan="2">' . price($objectsrc->multicurrency_total_ttc) . "</td></tr>";
|
||||
print '<tr><td>' . $langs->trans('MulticurrencyTotalHT') . '</td><td>' . price($objectsrc->multicurrency_total_ht) . '</td></tr>';
|
||||
print '<tr><td>' . $langs->trans('MulticurrencyTotalVAT') . '</td><td>' . price($objectsrc->multicurrency_total_tva) . "</td></tr>";
|
||||
print '<tr><td>' . $langs->trans('MulticurrencyTotalTTC') . '</td><td>' . price($objectsrc->multicurrency_total_ttc) . "</td></tr>";
|
||||
}
|
||||
}
|
||||
|
||||
// Other options
|
||||
$parameters=array('colspan' => ' colspan="6"');
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
|
||||
// Bouton "Create Draft"
|
||||
|
|
@ -2347,7 +2347,7 @@ else
|
|||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object($result);
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
$paymentstatic->id=$objp->rowid;
|
||||
$paymentstatic->datepaye=$db->jdate($objp->dp);
|
||||
|
|
|
|||
|
|
@ -31,8 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
|||
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
|
||||
|
||||
$langs->load("products");
|
||||
$langs->load("suppliers");
|
||||
$langs->loadLangs(array("products","suppliers"));
|
||||
|
||||
if (!$user->rights->produit->lire && !$user->rights->service->lire) accessforbidden();
|
||||
|
||||
|
|
@ -42,40 +41,66 @@ $snom = GETPOST('snom');
|
|||
$type = GETPOST('type');
|
||||
$optioncss = GETPOST('optioncss','alpha');
|
||||
|
||||
$sortfield = GETPOST('sortfield');
|
||||
$sortorder = GETPOST('sortorder');
|
||||
$page = GETPOST('page');
|
||||
if ($page < 0) {
|
||||
$page = 0 ;
|
||||
}
|
||||
// Load variable for pagination
|
||||
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit;
|
||||
$sortfield = GETPOST('sortfield','alpha');
|
||||
$sortorder = GETPOST('sortorder','alpha');
|
||||
$page = GETPOST('page','int');
|
||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||
$offset = $limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
if (! $sortfield) $sortfield="p.ref"; // Set here default search field
|
||||
if (! $sortorder) $sortorder="ASC";
|
||||
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$offset = $limit * $page ;
|
||||
$fourn_id = GETPOST('fourn_id', 'intcomma');
|
||||
$catid = GETPOST('catid', 'intcomma');
|
||||
|
||||
if (! $sortfield) $sortfield = 'p.ref';
|
||||
if (! $sortorder) $sortorder = 'DESC';
|
||||
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
|
||||
$hookmanager->initHooks(array('supplierpricelist'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
if (GETPOST('button_removefilter'))
|
||||
{
|
||||
$sref = '';
|
||||
$sRefSupplier = '';
|
||||
$snom = '';
|
||||
}
|
||||
|
||||
$fourn_id = GETPOST('fourn_id', 'int');
|
||||
|
||||
if (isset($_REQUEST['catid']))
|
||||
{
|
||||
$catid = $_REQUEST['catid'];
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Mode Liste
|
||||
*
|
||||
*/
|
||||
* ACTIONS
|
||||
*
|
||||
* Put here all code to do according to value of "action" parameter
|
||||
*/
|
||||
|
||||
if (GETPOST('cancel')) { $action='list'; $massaction=''; }
|
||||
if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
|
||||
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
|
||||
if (empty($reshook))
|
||||
{
|
||||
// Selection of new fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
||||
|
||||
// Purge search criteria
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") ||GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
|
||||
{
|
||||
$sref = '';
|
||||
$sRefSupplier = '';
|
||||
$snom = '';
|
||||
$search_field1='';
|
||||
$search_field2='';
|
||||
$search_date_creation='';
|
||||
$search_date_update='';
|
||||
$toselect='';
|
||||
$search_array_options=array();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$form = new Form($db);
|
||||
$productstatic = new Product($db);
|
||||
$companystatic = new Societe($db);
|
||||
|
||||
|
|
@ -87,6 +112,17 @@ if ($fourn_id)
|
|||
$supplier->fetch($fourn_id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
$arrayofmassactions = array(
|
||||
'presend'=>$langs->trans("SendByMail"),
|
||||
'builddoc'=>$langs->trans("PDFMerge"),
|
||||
);
|
||||
if ($user->rights->mymodule->supprimer) $arrayofmassactions['delete']=$langs->trans("Delete");
|
||||
if ($massaction == 'presend') $arrayofmassactions=array();
|
||||
$massactionbutton=$form->selectMassAction('', $arrayofmassactions);
|
||||
|
||||
|
||||
$sql = "SELECT p.rowid, p.label, p.ref, p.fk_product_type, p.entity,";
|
||||
$sql.= " ppf.fk_soc, ppf.ref_fourn, ppf.price as price, ppf.quantity as qty, ppf.unitprice,";
|
||||
$sql.= " s.rowid as socid, s.nom as name";
|
||||
|
|
@ -155,7 +191,7 @@ if ($resql)
|
|||
print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords);
|
||||
|
||||
|
||||
if (isset($catid))
|
||||
if (! empty($catid))
|
||||
{
|
||||
print "<div id='ways'>";
|
||||
$c = new Categorie($db);
|
||||
|
|
@ -175,17 +211,6 @@ if ($resql)
|
|||
|
||||
print '<table class="liste" width="100%">';
|
||||
|
||||
// Lignes des titres
|
||||
print "<tr class=\"liste_titre\">";
|
||||
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"], "p.ref",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("RefSupplierShort"),$_SERVER["PHP_SELF"], "ppf.ref_fourn",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"], "p.label",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Supplier"),$_SERVER["PHP_SELF"], "ppf.fk_soc",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("BuyingPrice"),$_SERVER["PHP_SELF"], "ppf.price",$param,"",'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("QtyMin"),$_SERVER["PHP_SELF"], "ppf.quantity",$param,"",'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("UnitPrice"),$_SERVER["PHP_SELF"], "ppf.unitprice",$param,"",'align="right"',$sortfield,$sortorder);
|
||||
print "</tr>\n";
|
||||
|
||||
// Lignes des champs de filtre
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre">';
|
||||
|
|
@ -197,19 +222,34 @@ if ($resql)
|
|||
print '<td class="liste_titre">';
|
||||
print '<input class="flat" type="text" name="snom" value="'.$snom.'">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre" colspan="4" align="right">';
|
||||
print '<input type="image" class="liste_titre" value="button_search" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||
print ' ';
|
||||
print '<input type="image" class="liste_titre" value="button_removefilter" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
||||
print '<td></td>';
|
||||
print '<td></td>';
|
||||
print '<td></td>';
|
||||
print '<td></td>';
|
||||
print '<td class="liste_titre" align="right">';
|
||||
$searchpicto=$form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Lignes des titres
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"], "p.ref",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("RefSupplierShort"),$_SERVER["PHP_SELF"], "ppf.ref_fourn",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"], "p.label",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Supplier"),$_SERVER["PHP_SELF"], "ppf.fk_soc",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("BuyingPrice"),$_SERVER["PHP_SELF"], "ppf.price",$param,"",'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("QtyMin"),$_SERVER["PHP_SELF"], "ppf.quantity",$param,"",'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("UnitPrice"),$_SERVER["PHP_SELF"], "ppf.unitprice",$param,"",'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre('',$_SERVER["PHP_SELF"]);
|
||||
print "</tr>\n";
|
||||
|
||||
$oldid = '';
|
||||
$var=True;
|
||||
while ($i < min($num,$limit))
|
||||
{
|
||||
$objp = $db->fetch_object($resql);
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
print '<td>';
|
||||
|
|
@ -236,6 +276,8 @@ if ($resql)
|
|||
|
||||
print '<td align="right">'.(isset($objp->unitprice) ? price($objp->unitprice) : '').'</td>';
|
||||
|
||||
print '<td align="right"></td>';
|
||||
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -390,7 +390,7 @@ ExtrafieldCheckBox=Checkboxes
|
|||
ExtrafieldCheckBoxFromList=Checkboxes from table
|
||||
ExtrafieldLink=Link to an object
|
||||
ComputedFormula=Computed field
|
||||
ComputedFormulaDesc=You can enter here a formula using other properties of object or any PHP coding to get a dynamic computed value. You can use any PHP compatible formulas including the "?" condition operator, and following global object: <strong>$db, $conf, $langs, $mysoc, $user, $object</strong>.<br><strong>WARNING</strong>: Only some properties of $object may be available. If you need a properties not loaded, just fetch yourself the object into your formula like in the second example.<br>Using a computed field means you can't enter yourself any value from interface. Also, if there is a syntax error, the formula may return nothing.<br><br>Example of formula:<br>$object->id < 10 ? round($object->id / 2, 2) : ($object->array_options['options_extrafieldkey'] + 2 * $user->id) * (int) substr($mysoc->zip, 1, 2)<br><br>Example to reload object<br>(($reloadedobj = new Societe($db)) && ($reloadedobj->fetch($obj->id ? $obj->id : ($obj->rowid ? $obj->rowid : $object->id)) > 0)) ? round($reloadedobj->capital / 5) : '-1'<br><br>Other example of formula to force load of object and its parent object:<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'
|
||||
ComputedFormulaDesc=You can enter here a formula using other properties of object or any PHP coding to get a dynamic computed value. You can use any PHP compatible formulas including the "?" condition operator, and following global object: <strong>$db, $conf, $langs, $mysoc, $user, $object</strong>.<br><strong>WARNING</strong>: Only some properties of $object may be available. If you need a properties not loaded, just fetch yourself the object into your formula like in the second example.<br>Using a computed field means you can't enter yourself any value from interface. Also, if there is a syntax error, the formula may return nothing.<br><br>Example of formula:<br>$object->id < 10 ? round($object->id / 2, 2) : ($object->id + 2 * $user->id) * (int) substr($mysoc->zip, 1, 2)<br><br>Example to reload object<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>Other example of formula to force load of object and its parent object:<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=Parameters list have to be like key,value<br><br> for example : <br>1,value1<br>2,value2<br>3,value3<br>...<br><br>In order to have the list depending on another complementary attribute list :<br>1,value1|options_<i>parent_list_code</i>:parent_key<br>2,value2|options_<i>parent_list_code</i>:parent_key <br><br>In order to have the list depending on another list :<br>1,value1|<i>parent_list_code</i>:parent_key<br>2,value2|<i>parent_list_code</i>:parent_key
|
||||
ExtrafieldParamHelpcheckbox=Parameters list have to be like key,value<br><br> for example : <br>1,value1<br>2,value2<br>3,value3<br>...
|
||||
ExtrafieldParamHelpradio=Parameters list have to be like key,value<br><br> for example : <br>1,value1<br>2,value2<br>3,value3<br>...
|
||||
|
|
|
|||
|
|
@ -726,7 +726,7 @@ ViewPrivateNote=View notes
|
|||
XMoreLines=%s line(s) hidden
|
||||
PublicUrl=Public URL
|
||||
AddBox=Add box
|
||||
SelectElementAndClickRefresh=Select an element and click Refresh
|
||||
SelectElementAndClick=Select an element and click %s
|
||||
PrintFile=Print File %s
|
||||
ShowTransaction=Show entry on bank account
|
||||
GoIntoSetupToChangeLogo=Go into Home - Setup - Company to change logo or go into Home - Setup - Display to hide.
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ NbOfInvoiceToWithdrawWithInfo=Nb. of customer invoice with direct debit payment
|
|||
InvoiceWaitingWithdraw=Invoice waiting for direct debit
|
||||
AmountToWithdraw=Amount to withdraw
|
||||
WithdrawsRefused=Direct debit refused
|
||||
NoInvoiceToWithdraw=No customer invoice in payment mode "withdraw" is waiting. Go on 'Withdraw' tab on invoice card to make a request.
|
||||
NoInvoiceToWithdraw=No customer invoice with open 'Direct debit requests' is waiting. Go on tab '%s' on invoice card to make a request.
|
||||
ResponsibleUser=Responsible user
|
||||
WithdrawalsSetup=Direct debit payment setup
|
||||
WithdrawStatistics=Direct debit payment statistics
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ class MyModuleObject extends CommonObject
|
|||
* @var array Array with all fields and their property
|
||||
*/
|
||||
public $fields;
|
||||
|
||||
|
||||
/**
|
||||
* @var mixed Sample property 1
|
||||
*/
|
||||
|
|
@ -62,11 +62,11 @@ class MyModuleObject extends CommonObject
|
|||
* @var mixed Sample property 2
|
||||
*/
|
||||
public $prop2;
|
||||
|
||||
|
||||
//...
|
||||
|
||||
|
||||
protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
|
||||
|
||||
|
||||
public $table_element_line = 'mymoduleobjectdet';
|
||||
public $class_element_line = 'MyModuleObjectline';
|
||||
public $fk_element = 'fk_mymoduleobject';
|
||||
|
|
@ -75,9 +75,9 @@ class MyModuleObject extends CommonObject
|
|||
* @var MyModuleObjectLine[] Lines
|
||||
*/
|
||||
public $lines = array();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
|
|
@ -163,10 +163,9 @@ class MyModuleObject extends CommonObject
|
|||
/**
|
||||
* Load object in memory from the database
|
||||
*
|
||||
* @param int $id Id object
|
||||
* @param string $ref Ref
|
||||
*
|
||||
* @return int <0 if KO, 0 if not found, >0 if OK
|
||||
* @param int $id Id object
|
||||
* @param string $ref Ref
|
||||
* @return int <0 if KO, 0 if not found, >0 if OK
|
||||
*/
|
||||
public function fetch($id, $ref = null)
|
||||
{
|
||||
|
|
@ -199,20 +198,13 @@ class MyModuleObject extends CommonObject
|
|||
$this->prop2 = $obj->field2;
|
||||
//...
|
||||
}
|
||||
|
||||
// Retrieve all extrafields for invoice
|
||||
// fetch optionals attributes and labels
|
||||
/*
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
$extrafields=new ExtraFields($this->db);
|
||||
$extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true);
|
||||
$this->fetch_optionals($this->id,$extralabels);
|
||||
*/
|
||||
|
||||
// $this->fetch_lines();
|
||||
|
||||
|
||||
$this->db->free($resql);
|
||||
|
||||
$this->fetch_optionals();
|
||||
|
||||
// $this->fetch_lines();
|
||||
|
||||
if ($numrows) {
|
||||
return 1;
|
||||
} else {
|
||||
|
|
@ -221,7 +213,6 @@ class MyModuleObject extends CommonObject
|
|||
} else {
|
||||
$this->errors[] = 'Error ' . $this->db->lasterror();
|
||||
dol_syslog(__METHOD__ . ' ' . implode(',', $this->errors), LOG_ERR);
|
||||
|
||||
return - 1;
|
||||
}
|
||||
}
|
||||
|
|
@ -306,7 +297,7 @@ class MyModuleObject extends CommonObject
|
|||
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||
|
||||
$error = 0;
|
||||
|
||||
|
||||
// Clean parameters
|
||||
if (isset($this->prop1)) {
|
||||
$this->prop1 = trim($this->prop1);
|
||||
|
|
@ -386,7 +377,7 @@ class MyModuleObject extends CommonObject
|
|||
}
|
||||
|
||||
// If you need to delete child tables to, you can insert them here
|
||||
|
||||
|
||||
if (!$error) {
|
||||
$sql = 'DELETE FROM ' . MAIN_DB_PREFIX . $this->table_element;
|
||||
$sql .= ' WHERE rowid=' . $this->id;
|
||||
|
|
@ -475,7 +466,7 @@ class MyModuleObject extends CommonObject
|
|||
global $menumanager;
|
||||
|
||||
if (! empty($conf->dol_no_mouse_hover)) $notooltip=1; // Force disable tooltips
|
||||
|
||||
|
||||
$result = '';
|
||||
$companylink = '';
|
||||
|
||||
|
|
@ -484,7 +475,7 @@ class MyModuleObject extends CommonObject
|
|||
$label.= '<b>' . $langs->trans('Ref') . ':</b> ' . $this->ref;
|
||||
|
||||
$url = DOL_URL_ROOT.'/mymodule/'.$this->table_name.'_card.php?id='.$this->id;
|
||||
|
||||
|
||||
$linkclose='';
|
||||
if (empty($notooltip))
|
||||
{
|
||||
|
|
@ -497,7 +488,7 @@ class MyModuleObject extends CommonObject
|
|||
$linkclose.=' class="classfortooltip'.($morecss?' '.$morecss:'').'"';
|
||||
}
|
||||
else $linkclose = ($morecss?' class="'.$morecss.'"':'');
|
||||
|
||||
|
||||
$linkstart = '<a href="'.$url.'"';
|
||||
$linkstart.=$linkclose.'>';
|
||||
$linkend='</a>';
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ class modMyModule extends DolibarrModules
|
|||
$this->descriptionlong = "MyModuleDescription (Long)";
|
||||
$this->editor_name = 'Editor name';
|
||||
$this->editor_url = 'https://www.example.com';
|
||||
|
||||
|
||||
// Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'
|
||||
$this->version = '1.0';
|
||||
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
|
||||
|
|
@ -151,7 +151,7 @@ class modMyModule extends DolibarrModules
|
|||
$conf->mymodule=new stdClass();
|
||||
$conf->mymodule->enabled=0;
|
||||
}
|
||||
|
||||
|
||||
// Dictionaries
|
||||
$this->dictionaries=array();
|
||||
/* Example:
|
||||
|
|
@ -169,8 +169,9 @@ class modMyModule extends DolibarrModules
|
|||
);
|
||||
*/
|
||||
|
||||
|
||||
// Boxes
|
||||
// Add here list of php file(s) stored in core/boxes that contains class to show a box.
|
||||
// Add here list of php file(s) stored in core/boxes that contains class to show a widget.
|
||||
$this->boxes = array(); // List of boxes
|
||||
// Example:
|
||||
//$this->boxes=array(
|
||||
|
|
@ -179,24 +180,38 @@ class modMyModule extends DolibarrModules
|
|||
// 2=>array('file'=>'myboxc.php@mymodule','note'=>'')
|
||||
//);
|
||||
|
||||
|
||||
// Cronjobs
|
||||
$this->cronjobs = array(); // List of cron jobs entries to add
|
||||
// Example: $this->cronjobs=array(0=>array('label'=>'My label', 'jobtype'=>'method', 'class'=>'/dir/class/file.class.php', 'objectname'=>'MyClass', 'method'=>'myMethod', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>2, 'unitfrequency'=>3600, 'test'=>true),
|
||||
// 1=>array('label'=>'My label', 'jobtype'=>'command', 'command'=>'', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>1, 'unitfrequency'=>3600*24, 'test'=>true)
|
||||
// );
|
||||
|
||||
|
||||
// Permissions
|
||||
$this->rights = array(); // Permission array used by this module
|
||||
$r=0;
|
||||
|
||||
// Add here list of permission defined by an id, a label, a boolean and two constant strings.
|
||||
// Example:
|
||||
// $this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used)
|
||||
// $this->rights[$r][1] = 'Permision label'; // Permission label
|
||||
// $this->rights[$r][3] = 1; // Permission by default for new user (0/1)
|
||||
// $this->rights[$r][4] = 'level1'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
|
||||
// $this->rights[$r][5] = 'level2'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
|
||||
// $r++;
|
||||
$r=0;
|
||||
$this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used)
|
||||
$this->rights[$r][1] = 'Read objects of My Module'; // Permission label
|
||||
$this->rights[$r][3] = 1; // Permission by default for new user (0/1)
|
||||
$this->rights[$r][4] = 'read'; // In php code, permission will be checked by test if ($user->rights->mymodule->level1->level2)
|
||||
$this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->mymodule->level1->level2)
|
||||
|
||||
$r++;
|
||||
$this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used)
|
||||
$this->rights[$r][1] = 'Create/Update objects of My Module'; // Permission label
|
||||
$this->rights[$r][3] = 1; // Permission by default for new user (0/1)
|
||||
$this->rights[$r][4] = 'create'; // In php code, permission will be checked by test if ($user->rights->mymodule->level1->level2)
|
||||
$this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->mymodule->level1->level2)
|
||||
|
||||
$r++;
|
||||
$this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used)
|
||||
$this->rights[$r][1] = 'Delete objects of My Module'; // Permission label
|
||||
$this->rights[$r][3] = 1; // Permission by default for new user (0/1)
|
||||
$this->rights[$r][4] = 'delete'; // In php code, permission will be checked by test if ($user->rights->mymodule->level1->level2)
|
||||
$this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->mymodule->level1->level2)
|
||||
|
||||
|
||||
// Main menu entries
|
||||
$this->menu = array(); // List of menus to add
|
||||
|
|
|
|||
|
|
@ -96,18 +96,18 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
|
|||
|
||||
if (empty($reshook))
|
||||
{
|
||||
if ($cancel)
|
||||
if ($cancel)
|
||||
{
|
||||
if ($action != 'addlink')
|
||||
{
|
||||
$urltogo=$backtopage?$backtopage:dol_buildpath('/mymodule/list.php',1);
|
||||
header("Location: ".$urltogo);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
if ($id > 0 || ! empty($ref)) $ret = $object->fetch($id,$ref);
|
||||
$action='';
|
||||
}
|
||||
|
||||
|
||||
// Action to add record
|
||||
if ($action == 'add' && ! empty($user->rights->mymodule->create))
|
||||
{
|
||||
|
|
@ -268,19 +268,19 @@ if ($action == 'create')
|
|||
if (($id || $ref) && $action == 'edit')
|
||||
{
|
||||
print load_fiche_titre($langs->trans("MyModule"));
|
||||
|
||||
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||
print '<input type="hidden" name="id" value="'.$object->id.'">';
|
||||
|
||||
|
||||
dol_fiche_head();
|
||||
|
||||
print '<table class="border centpercent">'."\n";
|
||||
// print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td><td><input class="flat" type="text" size="36" name="label" value="'.$label.'"></td></tr>';
|
||||
// LIST_OF_TD_LABEL_FIELDS_EDIT
|
||||
print '</table>';
|
||||
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print '<div class="center"><input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
|
||||
|
|
@ -299,14 +299,14 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
|
||||
$head = mymodule_prepare_head($object);
|
||||
dol_fiche_head($head, 'order', $langs->trans("CustomerOrder"), -1, 'order');
|
||||
|
||||
|
||||
$formconfirm = '';
|
||||
|
||||
|
||||
// Confirmation to delete
|
||||
if ($action == 'delete') {
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteOrder'), $langs->trans('ConfirmDeleteOrder'), 'confirm_delete', '', 0, 1);
|
||||
}
|
||||
|
||||
|
||||
// Confirmation of action xxxx
|
||||
if ($action == 'xxx')
|
||||
{
|
||||
|
|
@ -317,28 +317,28 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
// array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1),
|
||||
// array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1),
|
||||
// array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockDecrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1)));
|
||||
}*/
|
||||
}*/
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('XXX'), $text, 'confirm_xxx', $formquestion, 0, 1, 220);
|
||||
}
|
||||
|
||||
|
||||
if (! $formconfirm) {
|
||||
$parameters = array('lineid' => $lineid);
|
||||
$reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook)) $formconfirm.=$hookmanager->resPrint;
|
||||
elseif ($reshook > 0) $formconfirm=$hookmanager->resPrint;
|
||||
}
|
||||
|
||||
|
||||
// Print form confirm
|
||||
print $formconfirm;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Object card
|
||||
// ------------------------------------------------------------
|
||||
|
||||
|
||||
$linkback = '<a href="' . DOL_URL_ROOT . '/mymodule/list.php' . (! empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
|
||||
|
||||
|
||||
|
||||
|
||||
$morehtmlref='<div class="refidno">';
|
||||
/*
|
||||
// Ref bis
|
||||
|
|
@ -382,11 +382,11 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
}
|
||||
*/
|
||||
$morehtmlref.='</div>';
|
||||
|
||||
|
||||
|
||||
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
||||
|
||||
|
||||
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="fichehalfleft">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
|
@ -396,7 +396,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
|
||||
|
||||
// Other attributes
|
||||
$cols = 2;
|
||||
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
|
||||
|
||||
print '</table>';
|
||||
|
|
@ -405,16 +404,16 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
print '<div class="ficheaddleft">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
|
||||
|
||||
print '<div class="clearboth"></div><br>';
|
||||
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
|
|
@ -424,14 +423,14 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('addMoreActionsButtons',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
|
||||
|
||||
if (empty($reshook))
|
||||
{
|
||||
if ($user->rights->mymodule->write)
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit">'.$langs->trans("Modify").'</a></div>'."\n";
|
||||
}
|
||||
|
||||
|
||||
if ($user->rights->mymodule->delete)
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete">'.$langs->trans('Delete').'</a></div>'."\n";
|
||||
|
|
@ -440,12 +439,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
print '</div>'."\n";
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Select mail models is same action as presend
|
||||
if (GETPOST('modelselected')) {
|
||||
$action = 'presend';
|
||||
}
|
||||
|
||||
|
||||
if ($action != 'presend')
|
||||
{
|
||||
print '<div class="fichecenter"><div class="fichehalfleft">';
|
||||
|
|
@ -458,23 +457,23 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
$genallowed = $user->rights->mymodule->creer;
|
||||
$delallowed = $user->rights->mymodule->supprimer;
|
||||
print $formfile->showdocuments('mymodule', $comref, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang);
|
||||
|
||||
|
||||
|
||||
|
||||
// Show links to link elements
|
||||
$linktoelem = $form->showLinkToObjectBlock($object, null, array('order'));
|
||||
$somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
|
||||
|
||||
|
||||
|
||||
|
||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||
|
||||
|
||||
// List of actions on element
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
|
||||
$formactions = new FormActions($db);
|
||||
$somethingshown = $formactions->showactions($object, 'order', $socid);
|
||||
|
||||
|
||||
print '</div></div></div>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Action presend
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
|
||||
//if (! defined("NOLOGIN")) define("NOLOGIN",'1'); // If this page is public (can be called outside logged session)
|
||||
|
||||
// Change this following line to use the correct relative path (../, ../../, etc)
|
||||
// Change this following lines to use the correct relative path (../, ../../, etc)
|
||||
$res=0;
|
||||
if (! $res && file_exists("../main.inc.php")) $res=@include '../main.inc.php'; // to work if your module directory is into dolibarr root htdocs directory
|
||||
if (! $res && file_exists("../../main.inc.php")) $res=@include '../../main.inc.php'; // to work if your module directory is into a subdir of root htdocs directory
|
||||
|
|
@ -49,8 +49,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
|||
dol_include_once('/mymodule/class/myobject.class.php');
|
||||
|
||||
// Load traductions files requiredby by page
|
||||
$langs->load("mymodule");
|
||||
$langs->load("other");
|
||||
$langs->loadLangs(array("mymodule","other"));
|
||||
|
||||
$action=GETPOST('action','alpha');
|
||||
$massaction=GETPOST('massaction','alpha');
|
||||
|
|
@ -89,14 +88,14 @@ if ($user->societe_id > 0)
|
|||
}
|
||||
|
||||
// Initialize technical object to manage context to save list fields
|
||||
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'mymodulelist';
|
||||
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'myobjectlist';
|
||||
|
||||
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
|
||||
$hookmanager->initHooks(array('mymodulelist'));
|
||||
$hookmanager->initHooks(array('myobjectlist'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('mymodule');
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('myobject');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
|
||||
|
||||
// List of fields to search into when doing a "search in all"
|
||||
|
|
@ -227,7 +226,7 @@ foreach ($search_array_options as $key => $val)
|
|||
$typ=$extrafields->attribute_type[$tmpkey];
|
||||
$mode=0;
|
||||
if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric
|
||||
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
|
||||
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
|
||||
{
|
||||
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
|
||||
}
|
||||
|
|
@ -244,7 +243,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
|||
{
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
}
|
||||
}
|
||||
|
||||
$sql.= $db->plimit($limit+1, $offset);
|
||||
|
||||
|
|
@ -263,7 +262,7 @@ if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) &&
|
|||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
$id = $obj->rowid;
|
||||
header("Location: ".DOL_URL_ROOT.'/skeleton/card.php?id='.$id);
|
||||
header("Location: ".DOL_URL_ROOT.'/mymodule/myobject_card.php?id='.$id);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
|
@ -283,13 +282,13 @@ foreach ($search_array_options as $key => $val)
|
|||
$crit=$val;
|
||||
$tmpkey=preg_replace('/search_options_/','',$key);
|
||||
if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val);
|
||||
}
|
||||
}
|
||||
|
||||
$arrayofmassactions = array(
|
||||
'presend'=>$langs->trans("SendByMail"),
|
||||
'builddoc'=>$langs->trans("PDFMerge"),
|
||||
);
|
||||
if ($user->rights->mymodule->supprimer) $arrayofmassactions['delete']=$langs->trans("Delete");
|
||||
if ($user->rights->mymodule->delete) $arrayofmassactions['delete']=$langs->trans("Delete");
|
||||
if ($massaction == 'presend') $arrayofmassactions=array();
|
||||
$massactionbutton=$form->selectMassAction('', $arrayofmassactions);
|
||||
|
||||
|
|
@ -330,38 +329,11 @@ if (! empty($moreforfilter))
|
|||
|
||||
$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">';
|
||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||
|
||||
// Fields title
|
||||
print '<tr class="liste_titre">';
|
||||
// LIST_OF_TD_TITLE_FIELDS
|
||||
//if (! empty($arrayfields['t.field1']['checked'])) print_liste_field_titre($arrayfields['t.field1']['label'],$_SERVER['PHP_SELF'],'t.field1','',$param,'',$sortfield,$sortorder);
|
||||
//if (! empty($arrayfields['t.field2']['checked'])) print_liste_field_titre($arrayfields['t.field2']['label'],$_SERVER['PHP_SELF'],'t.field2','',$param,'',$sortfield,$sortorder);
|
||||
// Extra fields
|
||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||
{
|
||||
foreach($extrafields->attribute_label as $key => $val)
|
||||
{
|
||||
if (! empty($arrayfields["ef.".$key]['checked']))
|
||||
{
|
||||
$align=$extrafields->getAlignFlag($key);
|
||||
$sortonfield = "ef.".$key;
|
||||
if (! empty($extrafields->attribute_computed[$key])) $sortonfield='';
|
||||
print_liste_field_titre($langs->trans($extralabels[$key]),$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Hook fields
|
||||
$parameters=array('arrayfields'=>$arrayfields);
|
||||
$reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
if (! empty($arrayfields['t.datec']['checked'])) print_liste_field_titre($arrayfields['t.datec']['label'],$_SERVER["PHP_SELF"],"t.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['t.tms']['checked'])) print_liste_field_titre($arrayfields['t.tms']['label'],$_SERVER["PHP_SELF"],"t.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
|
||||
//if (! empty($arrayfields['t.status']['checked'])) print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"t.status","",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch ');
|
||||
print '</tr>'."\n";
|
||||
|
||||
// Fields title search
|
||||
print '<tr class="liste_titre">';
|
||||
|
|
@ -371,22 +343,22 @@ print '<tr class="liste_titre">';
|
|||
// Extra fields
|
||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||
{
|
||||
foreach($extrafields->attribute_label as $key => $val)
|
||||
foreach($extrafields->attribute_label as $key => $val)
|
||||
{
|
||||
if (! empty($arrayfields["ef.".$key]['checked']))
|
||||
{
|
||||
$align=$extrafields->getAlignFlag($key);
|
||||
$typeofextrafield=$extrafields->attribute_type[$key];
|
||||
print '<td class="liste_titre'.($align?' '.$align:'').'">';
|
||||
if (in_array($typeofextrafield, array('varchar', 'int', 'double', 'select')) && empty($extrafields->attribute_computed[$key]))
|
||||
{
|
||||
$crit=$val;
|
||||
$tmpkey=preg_replace('/search_options_/','',$key);
|
||||
$searchclass='';
|
||||
if (in_array($typeofextrafield, array('varchar', 'select'))) $searchclass='searchstring';
|
||||
if (in_array($typeofextrafield, array('int', 'double'))) $searchclass='searchnum';
|
||||
print '<input class="flat'.($searchclass?' '.$searchclass:'').'" size="4" type="text" name="search_options_'.$tmpkey.'" value="'.dol_escape_htmltag($search_array_options['search_options_'.$tmpkey]).'">';
|
||||
}
|
||||
if (in_array($typeofextrafield, array('varchar', 'int', 'double', 'select')) && empty($extrafields->attribute_computed[$key]))
|
||||
{
|
||||
$crit=$val;
|
||||
$tmpkey=preg_replace('/search_options_/','',$key);
|
||||
$searchclass='';
|
||||
if (in_array($typeofextrafield, array('varchar', 'select'))) $searchclass='searchstring';
|
||||
if (in_array($typeofextrafield, array('int', 'double'))) $searchclass='searchnum';
|
||||
print '<input class="flat'.($searchclass?' '.$searchclass:'').'" size="4" type="text" name="search_options_'.$tmpkey.'" value="'.dol_escape_htmltag($search_array_options['search_options_'.$tmpkey]).'">';
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
}
|
||||
|
|
@ -408,19 +380,48 @@ if (! empty($arrayfields['t.tms']['checked']))
|
|||
print '</td>';
|
||||
}
|
||||
/*if (! empty($arrayfields['u.statut']['checked']))
|
||||
{
|
||||
// Status
|
||||
print '<td class="liste_titre" align="center">';
|
||||
print $form->selectarray('search_statut', array('-1'=>'','0'=>$langs->trans('Disabled'),'1'=>$langs->trans('Enabled')),$search_statut);
|
||||
print '</td>';
|
||||
}*/
|
||||
{
|
||||
// Status
|
||||
print '<td class="liste_titre" align="center">';
|
||||
print $form->selectarray('search_statut', array('-1'=>'','0'=>$langs->trans('Disabled'),'1'=>$langs->trans('Enabled')),$search_statut);
|
||||
print '</td>';
|
||||
}*/
|
||||
// Action column
|
||||
print '<td class="liste_titre" align="right">';
|
||||
$searchpicto=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1);
|
||||
$searchpicto=$form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
print '</tr>'."\n";
|
||||
|
||||
|
||||
// Fields title
|
||||
print '<tr class="liste_titre">';
|
||||
// LIST_OF_TD_TITLE_FIELDS
|
||||
//if (! empty($arrayfields['t.field1']['checked'])) print_liste_field_titre($arrayfields['t.field1']['label'],$_SERVER['PHP_SELF'],'t.field1','',$param,'',$sortfield,$sortorder);
|
||||
//if (! empty($arrayfields['t.field2']['checked'])) print_liste_field_titre($arrayfields['t.field2']['label'],$_SERVER['PHP_SELF'],'t.field2','',$param,'',$sortfield,$sortorder);
|
||||
// Extra fields
|
||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||
{
|
||||
foreach($extrafields->attribute_label as $key => $val)
|
||||
{
|
||||
if (! empty($arrayfields["ef.".$key]['checked']))
|
||||
{
|
||||
$align=$extrafields->getAlignFlag($key);
|
||||
$sortonfield = "ef.".$key;
|
||||
if (! empty($extrafields->attribute_computed[$key])) $sortonfield='';
|
||||
print_liste_field_titre($langs->trans($extralabels[$key]),$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Hook fields
|
||||
$parameters=array('arrayfields'=>$arrayfields);
|
||||
$reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
if (! empty($arrayfields['t.datec']['checked'])) print_liste_field_titre($arrayfields['t.datec']['label'],$_SERVER["PHP_SELF"],"t.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['t.tms']['checked'])) print_liste_field_titre($arrayfields['t.tms']['label'],$_SERVER["PHP_SELF"],"t.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
|
||||
//if (! empty($arrayfields['t.status']['checked'])) print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"t.status","",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch ');
|
||||
print '</tr>'."\n";
|
||||
|
||||
|
||||
// Detect if we need a fetch on each output line
|
||||
$needToFetchEachLine=0;
|
||||
|
|
@ -441,12 +442,12 @@ while ($i < min($num, $limit))
|
|||
print '<tr class="oddeven">';
|
||||
// LIST_OF_TD_FIELDS_LIST
|
||||
/*
|
||||
if (! empty($arrayfields['t.field1']['checked']))
|
||||
if (! empty($arrayfields['t.field1']['checked']))
|
||||
{
|
||||
print '<td>'.$obj->field1.'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
if (! empty($arrayfields['t.field2']['checked']))
|
||||
if (! empty($arrayfields['t.field2']['checked']))
|
||||
{
|
||||
print '<td>'.$obj->field2.'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
|
|
@ -454,9 +455,9 @@ while ($i < min($num, $limit))
|
|||
// Extra fields
|
||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||
{
|
||||
foreach($extrafields->attribute_label as $key => $val)
|
||||
foreach($extrafields->attribute_label as $key => $val)
|
||||
{
|
||||
if (! empty($arrayfields["ef.".$key]['checked']))
|
||||
if (! empty($arrayfields["ef.".$key]['checked']))
|
||||
{
|
||||
print '<td';
|
||||
$align=$extrafields->getAlignFlag($key);
|
||||
|
|
|
|||
|
|
@ -145,9 +145,9 @@ if (empty($reshook))
|
|||
$upload_dir = $conf->produit->dir_output;
|
||||
$permissioncreate = $user->rights->produit->creer;
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
|
||||
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
|
||||
|
||||
|
||||
// Barcode type
|
||||
if ($action == 'setfk_barcode_type' && $createbarcode)
|
||||
{
|
||||
|
|
@ -203,7 +203,7 @@ if (empty($reshook))
|
|||
$action = "create";
|
||||
$error++;
|
||||
}
|
||||
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$units = GETPOST('units', 'int');
|
||||
|
|
@ -630,7 +630,7 @@ if (empty($reshook))
|
|||
|
||||
$tmpvat = price2num(preg_replace('/\s*\(.*\)/', '', $tva_tx));
|
||||
$tmpprodvat = price2num(preg_replace('/\s*\(.*\)/', '', $prod->tva_tx));
|
||||
|
||||
|
||||
// On reevalue prix selon taux tva car taux tva transaction peut etre different
|
||||
// de ceux du produit par defaut (par exemple si pays different entre vendeur et acheteur).
|
||||
if ($tmpvat != $tmpprodvat) {
|
||||
|
|
@ -640,7 +640,7 @@ if (empty($reshook))
|
|||
$pu_ttc = price2num($pu_ht * (1 + ($tmpvat / 100)), 'MU');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (GETPOST('propalid') > 0) {
|
||||
// Define cost price for margin calculation
|
||||
$buyprice=0;
|
||||
|
|
@ -653,7 +653,7 @@ if (empty($reshook))
|
|||
{
|
||||
$buyprice = $result;
|
||||
}
|
||||
|
||||
|
||||
$result = $propal->addline(
|
||||
$desc,
|
||||
$pu_ht,
|
||||
|
|
@ -696,7 +696,7 @@ if (empty($reshook))
|
|||
{
|
||||
$buyprice = $result;
|
||||
}
|
||||
|
||||
|
||||
$result = $commande->addline(
|
||||
$desc,
|
||||
$pu_ht,
|
||||
|
|
@ -882,7 +882,7 @@ else
|
|||
dol_fiche_head('');
|
||||
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
|
||||
print '<tr>';
|
||||
$tmpcode='';
|
||||
if (! empty($modCodeProduct->code_auto)) $tmpcode=$modCodeProduct->getNextValue($object,$type);
|
||||
|
|
@ -1045,7 +1045,7 @@ else
|
|||
}
|
||||
|
||||
// Other attributes
|
||||
$parameters=array('colspan' => 3);
|
||||
$parameters=array('cols' => 3);
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook) && ! empty($extrafields->attribute_label))
|
||||
{
|
||||
|
|
@ -1056,14 +1056,14 @@ else
|
|||
//if (! empty($conf->global->MAIN_DISABLE_NOTES_TAB)) available in create mode
|
||||
//{
|
||||
print '<tr><td class="tdtop">'.$langs->trans("NoteNotVisibleOnBill").'</td><td colspan="3">';
|
||||
|
||||
|
||||
// We use dolibarr_details as type of DolEditor here, because we must not accept images as description is included into PDF and not accepted by TCPDF.
|
||||
$doleditor = new DolEditor('note_private', GETPOST('note_private'), '', 140, 'dolibarr_details', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_8, '90%');
|
||||
$doleditor->Create();
|
||||
|
||||
|
||||
print "</td></tr>";
|
||||
//}
|
||||
|
||||
|
||||
if($conf->categorie->enabled) {
|
||||
// Categories
|
||||
print '<tr><td>'.$langs->trans("Categories").'</td><td colspan="3">';
|
||||
|
|
@ -1123,7 +1123,7 @@ else
|
|||
print $formaccounting->select_account(GETPOST('accountancy_code_buy'), 'accountancy_code_buy', 1, null, 1, 1, '');
|
||||
print '</td></tr>';
|
||||
}
|
||||
else // For external software
|
||||
else // For external software
|
||||
{
|
||||
// Accountancy_code_sell
|
||||
print '<tr><td class="titlefieldcreate">'.$langs->trans("ProductAccountancySellCode").'</td>';
|
||||
|
|
@ -1364,7 +1364,7 @@ else
|
|||
}
|
||||
|
||||
// Other attributes
|
||||
$parameters=array('colspan' => ' colspan="2"');
|
||||
$parameters=array('colspan' => ' colspan="3"', 'cols'=>3);
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook) && ! empty($extrafields->attribute_label))
|
||||
{
|
||||
|
|
@ -1372,7 +1372,7 @@ else
|
|||
}
|
||||
|
||||
// Tags-Categories
|
||||
if ($conf->categorie->enabled)
|
||||
if ($conf->categorie->enabled)
|
||||
{
|
||||
print '<tr><td class="tdtop">'.$langs->trans("Categories").'</td><td colspan="3">';
|
||||
$cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, '', 'parent', 64, 0, 1);
|
||||
|
|
@ -1389,13 +1389,13 @@ else
|
|||
if (! empty($conf->global->MAIN_DISABLE_NOTES_TAB))
|
||||
{
|
||||
print '<tr><td class="tdtop">'.$langs->trans("NoteNotVisibleOnBill").'</td><td colspan="3">';
|
||||
|
||||
|
||||
$doleditor = new DolEditor('note_private', $object->note_private, '', 140, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_4, '90%');
|
||||
$doleditor->Create();
|
||||
|
||||
|
||||
print "</td></tr>";
|
||||
}
|
||||
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '<br>';
|
||||
|
|
@ -1416,7 +1416,7 @@ else
|
|||
print $formaccounting->select_account($object->accountancy_code_buy, 'accountancy_code_buy', 1, '', 1, 1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
else // For external software
|
||||
else // For external software
|
||||
{
|
||||
// Accountancy_code_sell
|
||||
print '<tr><td class="titlefield">'.$langs->trans("ProductAccountancySellCode").'</td>';
|
||||
|
|
@ -1449,21 +1449,21 @@ else
|
|||
$head=product_prepare_head($object);
|
||||
$titre=$langs->trans("CardProduct".$object->type);
|
||||
$picto=($object->type== Product::TYPE_SERVICE?'service':'product');
|
||||
|
||||
|
||||
dol_fiche_head($head, 'card', $titre, -1, $picto);
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php?type='.$object->type.'">'.$langs->trans("BackToList").'</a>';
|
||||
$object->next_prev_filter=" fk_product_type = ".$object->type;
|
||||
|
||||
dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref');
|
||||
|
||||
|
||||
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="fichehalfleft">';
|
||||
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border tableforfield" width="100%">';
|
||||
|
||||
|
||||
// Type
|
||||
if (! empty($conf->produit->enabled) && ! empty($conf->service->enabled))
|
||||
{
|
||||
|
|
@ -1577,7 +1577,7 @@ else
|
|||
}
|
||||
print '</td></tr>';
|
||||
*/
|
||||
|
||||
|
||||
// Batch number management (to batch)
|
||||
if (! empty($conf->productbatch->enabled)) {
|
||||
print '<tr><td>'.$langs->trans("ManageLotSerial").'</td><td colspan="2">';
|
||||
|
|
@ -1616,10 +1616,10 @@ else
|
|||
print '</table>';
|
||||
print '</div>';
|
||||
print '<div class="fichehalfright"><div class="ficheaddleft">';
|
||||
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border tableforfield" width="100%">';
|
||||
|
||||
|
||||
// Nature
|
||||
if($object->type!= Product::TYPE_SERVICE)
|
||||
{
|
||||
|
|
@ -1727,11 +1727,7 @@ else
|
|||
|
||||
// Other attributes
|
||||
$parameters=array('colspan' => ' colspan="'.(2+(($showphoto||$showbarcode)?1:0)).'"');
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook) && ! empty($extrafields->attribute_label))
|
||||
{
|
||||
print $object->showOptionals($extrafields);
|
||||
}
|
||||
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
|
||||
|
||||
// Categories
|
||||
if($conf->categorie->enabled) {
|
||||
|
|
@ -1747,13 +1743,13 @@ else
|
|||
print '<tr><td class="tdtop">'.$langs->trans("NotePrivate").'</td><td colspan="'.(2+(($showphoto||$showbarcode)?1:0)).'">'.(dol_textishtml($object->note_private)?$object->note_private:dol_nl2br($object->note_private,1,true)).'</td></tr>'."\n";
|
||||
print '<!-- End show Note --> '."\n";
|
||||
}
|
||||
|
||||
|
||||
print "</table>\n";
|
||||
print '</div>';
|
||||
|
||||
|
||||
print '</div></div>';
|
||||
print '<div style="clear:both"></div>';
|
||||
|
||||
|
||||
dol_fiche_end();
|
||||
}
|
||||
|
||||
|
|
@ -1814,16 +1810,16 @@ if (($action == 'clone' && (empty($conf->use_javascript_ajax) || ! empty($conf->
|
|||
if ($action != 'create' && $action != 'edit')
|
||||
{
|
||||
print "\n".'<div class="tabsAction">'."\n";
|
||||
|
||||
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('addMoreActionsButtons',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook))
|
||||
{
|
||||
if (($object->type == Product::TYPE_PRODUCT && $user->rights->produit->creer ) ||
|
||||
if (($object->type == Product::TYPE_PRODUCT && $user->rights->produit->creer ) ||
|
||||
($object->type == Product::TYPE_SERVICE && $user->rights->service->creer))
|
||||
{
|
||||
if (! isset($object->no_button_edit) || $object->no_button_edit <> 1) print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&id='.$object->id.'">'.$langs->trans("Modify").'</a></div>';
|
||||
|
||||
|
||||
if (! isset($object->no_button_copy) || $object->no_button_copy <> 1)
|
||||
{
|
||||
if (! empty($conf->use_javascript_ajax) && empty($conf->dol_use_jmobile))
|
||||
|
|
@ -1837,7 +1833,7 @@ if ($action != 'create' && $action != 'edit')
|
|||
}
|
||||
}
|
||||
$object_is_used = $object->isObjectUsed($object->id);
|
||||
|
||||
|
||||
if (($object->type == Product::TYPE_PRODUCT && $user->rights->produit->supprimer)
|
||||
|| ($object->type == Product::TYPE_SERVICE && $user->rights->service->supprimer))
|
||||
{
|
||||
|
|
@ -1862,7 +1858,7 @@ if ($action != 'create' && $action != 'edit')
|
|||
print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("Delete").'</a></div>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
print "\n</div>\n";
|
||||
}
|
||||
|
||||
|
|
@ -1957,7 +1953,7 @@ if (! empty($conf->global->PRODUCT_ADD_FORM_ADD_TO) && $object->id && ($action =
|
|||
print '<input type="hidden" name="action" value="addin">';
|
||||
|
||||
print load_fiche_titre($langs->trans("AddToDraft"),'','');
|
||||
|
||||
|
||||
dol_fiche_head('');
|
||||
|
||||
$html .= '<tr><td class="nowrap">'.$langs->trans("Quantity").' ';
|
||||
|
|
@ -1969,7 +1965,7 @@ if (! empty($conf->global->PRODUCT_ADD_FORM_ADD_TO) && $object->id && ($action =
|
|||
print '<table width="100%" class="border">';
|
||||
print $html;
|
||||
print '</table>';
|
||||
|
||||
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Add").'">';
|
||||
print '</div>';
|
||||
|
|
@ -2000,7 +1996,7 @@ if ($action != 'create' && $action != 'edit' && $action != 'delete')
|
|||
|
||||
print $formfile->showdocuments($modulepart,$object->ref,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,28,0,'',0,'',$object->default_lang, '', $object);
|
||||
$somethingshown=$formfile->numoffiles;
|
||||
|
||||
|
||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||
|
||||
print '</div></div></div>';
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ if ($id > 0 || ! empty($ref))
|
|||
|
||||
if (! empty($conf->product->enabled)) $upload_dir = $conf->product->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 0, $object, 'product').dol_sanitizeFileName($object->ref);
|
||||
elseif (! empty($conf->service->enabled)) $upload_dir = $conf->service->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 0, $object, 'product').dol_sanitizeFileName($object->ref);
|
||||
|
||||
|
||||
if (! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) // For backward compatiblity, we scan also old dirs
|
||||
{
|
||||
if (! empty($conf->product->enabled)) $upload_dirold = $conf->product->multidir_output[$object->entity].'/'.substr(substr("000".$object->id, -2),1,1).'/'.substr(substr("000".$object->id, -2),0,1).'/'.$object->id."/photos";
|
||||
|
|
@ -188,12 +188,13 @@ if ($object->id)
|
|||
$head=product_prepare_head($object);
|
||||
$titre=$langs->trans("CardProduct".$object->type);
|
||||
$picto=($object->type== Product::TYPE_SERVICE?'service':'product');
|
||||
|
||||
|
||||
dol_fiche_head($head, 'documents', $titre, -1, $picto);
|
||||
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
|
||||
|
||||
// Construit liste des fichiers
|
||||
$filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview.*\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
|
||||
|
||||
|
|
@ -213,9 +214,9 @@ if ($object->id)
|
|||
$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php">'.$langs->trans("BackToList").'</a>';
|
||||
$object->next_prev_filter=" fk_product_type = ".$object->type;
|
||||
dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref');
|
||||
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border tableforfield" width="100%">';
|
||||
|
||||
|
|
@ -225,14 +226,14 @@ if ($object->id)
|
|||
|
||||
print '</div>';
|
||||
print '<div style="clear:both"></div>';
|
||||
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
$permission = (($object->type == Product::TYPE_PRODUCT && $user->rights->produit->creer) || ($object->type == Product::TYPE_SERVICE && $user->rights->service->creer));
|
||||
$param = '&id=' . $object->id;
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
|
||||
|
||||
|
||||
|
||||
// Merge propal PDF document PDF files
|
||||
if (!empty($conf->global->PRODUIT_PDF_MERGE_PROPAL))
|
||||
{
|
||||
|
|
@ -308,17 +309,17 @@ if ($object->id)
|
|||
$checked = '';
|
||||
$filename = $filetoadd['name'];
|
||||
|
||||
if ($conf->global->MAIN_MULTILANGS)
|
||||
if ($conf->global->MAIN_MULTILANGS)
|
||||
{
|
||||
if (array_key_exists($filetoadd['name'] . '_' . $delauft_lang, $filetomerge->lines))
|
||||
if (array_key_exists($filetoadd['name'] . '_' . $delauft_lang, $filetomerge->lines))
|
||||
{
|
||||
$filename = $filetoadd['name'] . ' - ' . $langs->trans('Language_' . $delauft_lang);
|
||||
$checked = ' checked ';
|
||||
}
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
if (array_key_exists($filetoadd['name'], $filetomerge->lines))
|
||||
if (array_key_exists($filetoadd['name'], $filetomerge->lines))
|
||||
{
|
||||
$checked = ' checked ';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -111,10 +111,10 @@ $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action);
|
|||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
|
||||
if ($action == 'addlimitstockwarehouse') {
|
||||
|
||||
|
||||
$seuil_stock_alerte = GETPOST('seuil_stock_alerte');
|
||||
$desiredstock = GETPOST('desiredstock');
|
||||
|
||||
|
||||
$maj_ok = true;
|
||||
if($seuil_stock_alerte == '') {
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("StockLimit")), null, 'errors');
|
||||
|
|
@ -124,44 +124,44 @@ if ($action == 'addlimitstockwarehouse') {
|
|||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DesiredStock")), null, 'errors');
|
||||
$maj_ok = false;
|
||||
}
|
||||
|
||||
|
||||
if($maj_ok) {
|
||||
|
||||
|
||||
$pse = new ProductStockEntrepot($db);
|
||||
if($pse->fetch('', GETPOST('id'), GETPOST('fk_entrepot')) > 0) {
|
||||
|
||||
|
||||
// Update
|
||||
$pse->seuil_stock_alerte = $seuil_stock_alerte;
|
||||
$pse->desiredstock = $desiredstock;
|
||||
if($pse->update($user) > 0) setEventMessage($langs->trans('ProductStockWarehouseUpdated'));
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
// Create
|
||||
$pse->fk_entrepot = GETPOST('fk_entrepot');
|
||||
$pse->fk_product = GETPOST('id');
|
||||
$pse->seuil_stock_alerte = GETPOST('seuil_stock_alerte');
|
||||
$pse->desiredstock = GETPOST('desiredstock');
|
||||
if($pse->create($user) > 0) setEventMessage($langs->trans('ProductStockWarehouseCreated'));
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
header("Location: ".$_SERVER["PHP_SELF"]."?id=".GETPOST('id'));
|
||||
exit;
|
||||
|
||||
|
||||
}
|
||||
|
||||
if($action == 'delete_productstockwarehouse')
|
||||
{
|
||||
|
||||
|
||||
$pse = new ProductStockEntrepot($db);
|
||||
$pse->fetch(GETPOST('fk_productstockwarehouse'));
|
||||
if($pse->delete($user) > 0) setEventMessage($langs->trans('ProductStockWarehouseDeleted'));
|
||||
|
||||
|
||||
$action = '';
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Set stock limit
|
||||
|
|
@ -233,7 +233,7 @@ if ($action == "correct_stock" && ! $cancel)
|
|||
$origin_element = 'project';
|
||||
$origin_id = GETPOST('projectid', 'int');
|
||||
}
|
||||
|
||||
|
||||
if (empty($object)) {
|
||||
$object = new Product($db);
|
||||
$result=$object->fetch($id);
|
||||
|
|
@ -317,7 +317,7 @@ if ($action == "transfert_stock" && ! $cancel)
|
|||
{
|
||||
$object = new Product($db);
|
||||
$result=$object->fetch($id);
|
||||
|
||||
|
||||
if ($object->hasbatch() && ! $batchnumber)
|
||||
{
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("batch_number")), null, 'errors');
|
||||
|
|
@ -325,7 +325,7 @@ if ($action == "transfert_stock" && ! $cancel)
|
|||
$action='transfert';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
if ($id)
|
||||
|
|
@ -341,7 +341,7 @@ if ($action == "transfert_stock" && ! $cancel)
|
|||
$pricesrc=0;
|
||||
if (isset($object->pmp)) $pricesrc=$object->pmp;
|
||||
$pricedest=$pricesrc;
|
||||
|
||||
|
||||
if ($object->hasbatch())
|
||||
{
|
||||
$pdluo = new Productbatch($db);
|
||||
|
|
@ -514,7 +514,7 @@ if ($id > 0 || $ref)
|
|||
{
|
||||
$object = new Product($db);
|
||||
$result = $object->fetch($id,$ref);
|
||||
|
||||
|
||||
$object->load_stock();
|
||||
|
||||
$title = $langs->trans('ProductServiceCard');
|
||||
|
|
@ -538,21 +538,21 @@ if ($id > 0 || $ref)
|
|||
$head=product_prepare_head($object);
|
||||
$titre=$langs->trans("CardProduct".$object->type);
|
||||
$picto=($object->type==Product::TYPE_SERVICE?'service':'product');
|
||||
|
||||
|
||||
dol_fiche_head($head, 'stock', $titre, -1, $picto);
|
||||
|
||||
dol_htmloutput_events();
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
|
||||
dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref');
|
||||
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border tableforfield" width="100%">';
|
||||
|
||||
if ($conf->productbatch->enabled)
|
||||
|
||||
if ($conf->productbatch->enabled)
|
||||
{
|
||||
print '<tr><td class="titlefield">'.$langs->trans("ManageLotSerial").'</td><td>';
|
||||
print $object->getLibStatut(0,2);
|
||||
|
|
@ -614,11 +614,11 @@ if ($id > 0 || $ref)
|
|||
print '<tr><td>'.$form->editfieldkey("StockLimit",'seuil_stock_alerte',$object->seuil_stock_alerte,$object,$user->rights->produit->creer).'</td><td colspan="2">';
|
||||
print $form->editfieldval("StockLimit",'seuil_stock_alerte',$object->seuil_stock_alerte,$object,$user->rights->produit->creer,'string');
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
// Hook formObject
|
||||
$parameters=array('colspan' => 3);
|
||||
$parameters=array('cols'=>2);
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
|
||||
|
||||
// Desired stock
|
||||
print '<tr><td>'.$form->editfieldkey($form->textwithpicto($langs->trans("DesiredStock"), $langs->trans("DesiredStockDesc"), 1),'desiredstock',$object->desiredstock,$object,$user->rights->produit->creer);
|
||||
print '</td><td colspan="2">';
|
||||
|
|
@ -643,7 +643,7 @@ if ($id > 0 || $ref)
|
|||
print '</tr>';
|
||||
|
||||
$stocktheo = price2num($object->stock_theorique, 'MS');
|
||||
|
||||
|
||||
$found=0;
|
||||
$helpondiff='<strong>'.$langs->trans("StockDiffPhysicTeoric").':</strong><br>';
|
||||
// Number of customer orders running
|
||||
|
|
@ -655,7 +655,7 @@ if ($id > 0 || $ref)
|
|||
if ($result < 0) dol_print_error($db,$object->error);
|
||||
$helpondiff.=' ('.$langs->trans("ProductQtyInDraft").': '.$object->stats_commande['qty'].')';
|
||||
}
|
||||
|
||||
|
||||
// Number of product from customer order already sent (partial shipping)
|
||||
if (! empty($conf->expedition->enabled))
|
||||
{
|
||||
|
|
@ -663,7 +663,7 @@ if ($id > 0 || $ref)
|
|||
$result=$object->load_stats_sending(0,'2');
|
||||
$helpondiff.=$langs->trans("ProductQtyInShipmentAlreadySent").': '.$object->stats_expedition['qty'];
|
||||
}
|
||||
|
||||
|
||||
// Number of supplier order running
|
||||
if (! empty($conf->fournisseur->enabled))
|
||||
{
|
||||
|
|
@ -674,14 +674,14 @@ if ($id > 0 || $ref)
|
|||
if ($result < 0) dol_print_error($db,$object->error);
|
||||
$helpondiff.=' ('.$langs->trans("ProductQtyInDraftOrWaitingApproved").': '.$object->stats_commande_fournisseur['qty'].')';
|
||||
}
|
||||
|
||||
|
||||
// Number of product from supplier order already received (partial receipt)
|
||||
if (! empty($conf->fournisseur->enabled))
|
||||
{
|
||||
if ($found) $helpondiff.='<br>'; else $found=1;
|
||||
$helpondiff.=$langs->trans("ProductQtyInSuppliersShipmentAlreadyRecevied").': '.$object->stats_reception['qty'];
|
||||
}
|
||||
|
||||
|
||||
// Calculating a theorical value
|
||||
print '<tr><td>';
|
||||
print $form->textwithpicto($langs->trans("VirtualStock"), $langs->trans("VirtualStockDesc"));
|
||||
|
|
@ -723,7 +723,7 @@ if ($id > 0 || $ref)
|
|||
|
||||
print '</div>';
|
||||
print '<div style="clear:both"></div>';
|
||||
|
||||
|
||||
dol_fiche_end();
|
||||
}
|
||||
|
||||
|
|
@ -762,18 +762,18 @@ if (empty($reshook))
|
|||
if (empty($action) && $object->id)
|
||||
{
|
||||
print "<div class=\"tabsAction\">\n";
|
||||
|
||||
|
||||
if ($user->rights->stock->mouvement->creer)
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=correction">'.$langs->trans("StockCorrection").'</a>';
|
||||
}
|
||||
|
||||
|
||||
//if (($user->rights->stock->mouvement->creer) && ! $object->hasbatch())
|
||||
if ($user->rights->stock->mouvement->creer)
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=transfert">'.$langs->trans("StockTransfer").'</a>';
|
||||
}
|
||||
|
||||
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
|
|
@ -897,7 +897,7 @@ if ($resql)
|
|||
}
|
||||
}
|
||||
$i++;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
else dol_print_error($db);
|
||||
|
|
@ -929,25 +929,25 @@ if (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE))
|
|||
print '<br><br>';
|
||||
print_titre($langs->trans('AddNewProductStockWarehouse'));
|
||||
//print '<br />';
|
||||
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="action" value="addlimitstockwarehouse">';
|
||||
print '<input type="hidden" name="id" value="'.GETPOST('id').'">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
|
||||
print '<tr class="liste_titre"><td width="40%" colspan="4">'.$formproduct->selectWarehouses('', 'fk_entrepot').'</td>';
|
||||
print '<td align="right"><input name="seuil_stock_alerte" type="text" placeholder="'.$langs->trans("StockLimit").'" /></td>';
|
||||
print '<td align="right"><input name="desiredstock" type="text" placeholder="'.$langs->trans("DesiredStock").'" /></td>';
|
||||
print '<td align="right"><input type="submit" value="'.$langs->trans('Save').'" class="button" /></td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
$pse = new ProductStockEntrepot($db);
|
||||
$lines = $pse->fetchAll(GETPOST('id'));
|
||||
|
||||
if (!empty($lines))
|
||||
|
||||
if (!empty($lines))
|
||||
{
|
||||
$var=false;
|
||||
foreach($lines as $line)
|
||||
foreach($lines as $line)
|
||||
{
|
||||
$ent = new Entrepot($db);
|
||||
$ent->fetch($line['fk_entrepot']);
|
||||
|
|
@ -956,12 +956,12 @@ if (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE))
|
|||
print '<td align="right">'.$line['desiredstock'].'</td>';
|
||||
print '<td align="right"><a href="?id='.GETPOST('id').'&fk_productstockwarehouse='.$line['id'].'&action=delete_productstockwarehouse">'.img_delete().'</a></td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
print "</table>";
|
||||
|
||||
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ class Project extends CommonObject
|
|||
public $fk_element = 'fk_projet';
|
||||
protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
|
||||
public $picto = 'projectpub';
|
||||
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
|
|
@ -102,7 +102,7 @@ class Project extends CommonObject
|
|||
* @var Task[]
|
||||
*/
|
||||
public $lines;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
|
|
@ -146,7 +146,7 @@ class Project extends CommonObject
|
|||
dol_syslog(get_class($this)."::create error -1 ref null", LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "INSERT INTO " . MAIN_DB_PREFIX . "projet (";
|
||||
|
|
@ -261,7 +261,7 @@ class Project extends CommonObject
|
|||
dol_syslog(get_class($this)."::update error -3 " . $this->error, LOG_ERR);
|
||||
return -3;
|
||||
}
|
||||
|
||||
|
||||
if (dol_strlen(trim($this->ref)) > 0)
|
||||
{
|
||||
$this->db->begin();
|
||||
|
|
@ -392,7 +392,9 @@ class Project extends CommonObject
|
|||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
if ($this->db->num_rows($resql))
|
||||
$num_rows = $this->db->num_rows($resql);
|
||||
|
||||
if ($num_rows)
|
||||
{
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
|
||||
|
|
@ -423,12 +425,16 @@ class Project extends CommonObject
|
|||
|
||||
$this->db->free($resql);
|
||||
|
||||
// Retreive all extrafield for thirdparty
|
||||
$this->fetch_optionals();
|
||||
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
$this->db->free($resql);
|
||||
|
||||
if ($num_rows) return 1;
|
||||
else return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -745,7 +751,7 @@ class Project extends CommonObject
|
|||
$this->error=$langs->trans("ErrorFieldFormat",$langs->transnoentities("Label")).'. '.$langs->trans('RemoveString',$langs->transnoentitiesnoconv("CopyOf"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "UPDATE " . MAIN_DB_PREFIX . "projet";
|
||||
|
|
@ -764,7 +770,7 @@ class Project extends CommonObject
|
|||
if ($result < 0) { $error++; }
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
$this->statut=1;
|
||||
|
|
@ -847,7 +853,7 @@ class Project extends CommonObject
|
|||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -936,9 +942,9 @@ class Project extends CommonObject
|
|||
global $conf, $langs, $user;
|
||||
|
||||
if (! empty($conf->dol_no_mouse_hover)) $notooltip=1; // Force disable tooltips
|
||||
|
||||
|
||||
$result = '';
|
||||
|
||||
|
||||
$label='';
|
||||
if ($option != 'nolink') $label = '<u>' . $langs->trans("ShowProject") . '</u>';
|
||||
$label .= ($label?'<br>':'').'<b>' . $langs->trans('Ref') . ': </b>' . $this->ref; // The space must be after the : to not being explode when showing the title in img_picto
|
||||
|
|
@ -965,11 +971,11 @@ class Project extends CommonObject
|
|||
$url = DOL_URL_ROOT . '/projet/card.php?id=' . $this->id;
|
||||
}
|
||||
// Add param to save lastsearch_values or not
|
||||
$add_save_lastsearch_values=($save_lastsearch_value == 1 ? 1 : 0);
|
||||
$add_save_lastsearch_values=($save_lastsearch_value == 1 ? 1 : 0);
|
||||
if ($save_lastsearch_value == -1 && preg_match('/list\.php/',$_SERVER["PHP_SELF"])) $add_save_lastsearch_values=1;
|
||||
if ($add_save_lastsearch_values) $url.='&save_lastsearch_values=1';
|
||||
}
|
||||
|
||||
|
||||
$linkclose='';
|
||||
if (empty($notooltip) && $user->rights->propal->lire)
|
||||
{
|
||||
|
|
@ -988,7 +994,7 @@ class Project extends CommonObject
|
|||
$linkstart = '<a href="'.$url.'"';
|
||||
$linkstart.=$linkclose.'>';
|
||||
$linkend='</a>';
|
||||
|
||||
|
||||
if ($withpicto) $result.=($linkstart . img_object(($notooltip?'':$label), $picto, ($notooltip?'':'class="classfortooltip"'), 0, 0, $notooltip?0:1) . $linkend);
|
||||
if ($withpicto && $withpicto != 2) $result.=' ';
|
||||
if ($withpicto != 2) $result.=$linkstart . $this->ref . $linkend . (($addlabel && $this->title) ? $sep . dol_trunc($this->title, ($addlabel > 1 ? $addlabel : 0)) : '');
|
||||
|
|
@ -1150,7 +1156,7 @@ class Project extends CommonObject
|
|||
{
|
||||
// No filter. Use this if user has permission to see all project
|
||||
}
|
||||
|
||||
|
||||
$sql.= $filter;
|
||||
//print $sql;
|
||||
|
||||
|
|
@ -1760,7 +1766,7 @@ class Project extends CommonObject
|
|||
$sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
|
||||
$sql.= " WHERE";
|
||||
$sql.= " p.entity IN (".getEntity('projet', 1).")";
|
||||
if (! $user->rights->projet->all->lire)
|
||||
if (! $user->rights->projet->all->lire)
|
||||
{
|
||||
$projectsListId = $this->getProjectsAuthorizedForUser($user,0,1);
|
||||
$sql .= "AND p.rowid IN (".$projectsListId.")";
|
||||
|
|
@ -1800,7 +1806,7 @@ class Project extends CommonObject
|
|||
$now = dol_now();
|
||||
|
||||
return ($this->datee ? $this->datee : $this->date_end) < ($now - $conf->projet->warning_delay);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -1911,10 +1917,10 @@ class Project extends CommonObject
|
|||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Create an array of tasks of current project
|
||||
*
|
||||
*
|
||||
* @param User $user Object user we want project allowed to
|
||||
* @return int >0 if OK, <0 if KO
|
||||
*/
|
||||
|
|
@ -1925,6 +1931,6 @@ class Project extends CommonObject
|
|||
|
||||
$this->lines = $taskstatic->getTasksArray(0, $user, $this->id, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -250,6 +250,9 @@ class Task extends CommonObject
|
|||
$this->note_private = $obj->note_private;
|
||||
$this->note_public = $obj->note_public;
|
||||
$this->rang = $obj->rang;
|
||||
|
||||
// Retreive all extrafield for thirdparty
|
||||
$this->fetch_optionals();
|
||||
}
|
||||
|
||||
$this->db->free($resql);
|
||||
|
|
|
|||
|
|
@ -511,13 +511,10 @@ if ($id > 0 || ! empty($ref))
|
|||
print nl2br($object->description);
|
||||
print '</td></tr>';
|
||||
|
||||
// Other options
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook) && ! empty($extrafields->attribute_label))
|
||||
{
|
||||
print $object->showOptionals($extrafields);
|
||||
}
|
||||
// Other attributes
|
||||
$cols = 3;
|
||||
$parameyers=array('socid'=>$socid);
|
||||
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@ if (! $action)
|
|||
print '</tr>';
|
||||
|
||||
// Other attributes
|
||||
$parameters=array('objectsrc' => $objectsrc, 'colspan' => ' colspan="3"');
|
||||
$parameters=array('objectsrc' => $objectsrc);
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook) && ! empty($extrafields->attribute_label))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -201,7 +201,7 @@ if ( $object->fetch($id) > 0 )
|
|||
print '</td></tr>';
|
||||
|
||||
// Other attributes
|
||||
$parameters=array('objectsrc' => $objectsrc, 'colspan' => ' colspan="3"');
|
||||
$parameters=array('objectsrc' => $objectsrc);
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook) && ! empty($extrafields->attribute_label))
|
||||
{
|
||||
|
|
@ -224,7 +224,7 @@ if ( $object->fetch($id) > 0 )
|
|||
dol_fiche_head($head, 'resource', $langs->trans("ResourceSingular"), -1, 'resource');
|
||||
|
||||
$formconfirm = '';
|
||||
|
||||
|
||||
// Confirm deleting resource line
|
||||
if ($action == 'delete')
|
||||
{
|
||||
|
|
@ -233,21 +233,21 @@ if ( $object->fetch($id) > 0 )
|
|||
|
||||
// Print form confirm
|
||||
print $formconfirm;
|
||||
|
||||
|
||||
|
||||
|
||||
$linkback = '<a href="' . DOL_URL_ROOT . '/resource/list.php' . (! empty($socid) ? '?id=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
|
||||
|
||||
|
||||
|
||||
|
||||
$morehtmlref='<div class="refidno">';
|
||||
$morehtmlref.='</div>';
|
||||
|
||||
|
||||
|
||||
|
||||
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref);
|
||||
|
||||
|
||||
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
|
||||
/*---------------------------------------
|
||||
* View object
|
||||
*/
|
||||
|
|
@ -269,21 +269,16 @@ if ( $object->fetch($id) > 0 )
|
|||
print '</td>';
|
||||
|
||||
// Other attributes
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook) && ! empty($extrafields->attribute_label))
|
||||
{
|
||||
print $object->showOptionals($extrafields);
|
||||
}
|
||||
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
|
||||
|
||||
print '</tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
||||
print '</div>';
|
||||
|
||||
|
||||
print '<div class="clearboth"></div><br>';
|
||||
|
||||
|
||||
dol_fiche_end();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ if (empty($reshook))
|
|||
if (!$errors)
|
||||
{
|
||||
// TODO Move the merge function into class of object.
|
||||
|
||||
|
||||
$db->begin();
|
||||
|
||||
// Recopy some data
|
||||
|
|
@ -157,16 +157,16 @@ if (empty($reshook))
|
|||
{
|
||||
if (empty($object->$property)) $object->$property = $soc_origin->$property;
|
||||
}
|
||||
|
||||
|
||||
// Concat some data
|
||||
$listofproperties=array(
|
||||
'note_public', 'note_private'
|
||||
'note_public', 'note_private'
|
||||
);
|
||||
foreach ($listofproperties as $property)
|
||||
{
|
||||
$object->$property = dol_concatdesc($object->$property, $soc_origin->$property);
|
||||
}
|
||||
|
||||
|
||||
// Merge extrafields
|
||||
foreach ($soc_origin->array_options as $key => $val)
|
||||
{
|
||||
|
|
@ -175,8 +175,8 @@ if (empty($reshook))
|
|||
|
||||
// TODO Merge categories
|
||||
$object->update($object->id, $user);
|
||||
|
||||
// Move links
|
||||
|
||||
// Move links
|
||||
$objects = array(
|
||||
'Adherent' => '/adherents/class/adherent.class.php',
|
||||
'Societe' => '/societe/class/societe.class.php',
|
||||
|
|
@ -280,6 +280,21 @@ if (empty($reshook))
|
|||
$res=$object->setValueFrom('localtax2_value', $value, '', null, 'text', '', $user, 'COMPANY_MODIFY');
|
||||
}
|
||||
|
||||
if ($action == 'update_extras') {
|
||||
$object->fetch($socid);
|
||||
|
||||
// Fill array 'array_options' with data from update form
|
||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute'));
|
||||
if ($ret < 0) $error++;
|
||||
if (! $error)
|
||||
{
|
||||
$result = $object->insertExtraFields();
|
||||
if ($result < 0) $error++;
|
||||
}
|
||||
if ($error) $action = 'edit_extras';
|
||||
}
|
||||
|
||||
// Add new or update third party
|
||||
if ((! GETPOST('getcustomercode') && ! GETPOST('getsuppliercode'))
|
||||
&& ($action == 'add' || $action == 'update') && $user->rights->societe->creer)
|
||||
|
|
@ -487,7 +502,7 @@ if (empty($reshook))
|
|||
if (empty($object->fournisseur)) $object->code_fournisseur='';
|
||||
|
||||
$result = $object->create($user);
|
||||
|
||||
|
||||
if ($result >= 0)
|
||||
{
|
||||
if ($object->particulier)
|
||||
|
|
@ -557,7 +572,7 @@ if (empty($reshook))
|
|||
$object->code_fournisseur = null;
|
||||
$object->code_client = null;
|
||||
}
|
||||
|
||||
|
||||
$error=$object->error; $errors=$object->errors;
|
||||
}
|
||||
|
||||
|
|
@ -851,7 +866,7 @@ else
|
|||
$object->particulier = $private;
|
||||
$object->prefix_comm = GETPOST('prefix_comm');
|
||||
$object->client = GETPOST('client')?GETPOST('client'):$object->client;
|
||||
|
||||
|
||||
if(empty($duplicate_code_error)) {
|
||||
$object->code_client = GETPOST('code_client', 'alpha');
|
||||
$object->fournisseur = GETPOST('fournisseur')?GETPOST('fournisseur'):$object->fournisseur;
|
||||
|
|
@ -859,7 +874,7 @@ else
|
|||
else {
|
||||
setEventMessages($langs->trans('NewCustomerSupplierCodeProposed'),'', 'warnings');
|
||||
}
|
||||
|
||||
|
||||
$object->code_fournisseur = GETPOST('code_fournisseur', 'alpha');
|
||||
$object->address = GETPOST('address', 'alpha');
|
||||
$object->zip = GETPOST('zipcode', 'alpha');
|
||||
|
|
@ -1135,7 +1150,7 @@ else
|
|||
print '<td colspan="3"><input type="text" name="email" id="email" value="'.$object->email.'"></td></tr>';
|
||||
print '<tr><td>'.fieldLabel('Web','url').'</td>';
|
||||
print '<td colspan="3"><input type="text" name="url" id="url" value="'.$object->url.'"></td></tr>';
|
||||
|
||||
|
||||
// Skype
|
||||
if (! empty($conf->skype->enabled))
|
||||
{
|
||||
|
|
@ -1215,7 +1230,7 @@ else
|
|||
print '</td><td>'.$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code).'</td><td>';
|
||||
print $form->selectyesno('localtax2assuj_value',(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2)?$conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2:0),1);
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
}
|
||||
elseif($mysoc->localtax1_assuj=="1")
|
||||
{
|
||||
|
|
@ -1229,7 +1244,7 @@ else
|
|||
print $form->selectyesno('localtax2assuj_value',(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2)?$conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2:0),1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
// Type - Size
|
||||
print '<tr><td>'.fieldLabel('ThirdPartyType','typent_id').'</td><td class="maxwidthonsmartphone">'."\n";
|
||||
$sortparam=(empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?'ASC':$conf->global->SOCIETE_SORT_ON_TYPEENT); // NONE means we keep sort of original array, so we sort on position. ASC, means next function will sort on label.
|
||||
|
|
@ -1544,7 +1559,7 @@ else
|
|||
|
||||
dol_fiche_head($head, 'card', $langs->trans("ThirdParty"), 0, 'company');
|
||||
|
||||
print '<div class="fichecenter2">';
|
||||
print '<div class="fichecenter2">';
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Ref/ID
|
||||
|
|
@ -1750,7 +1765,7 @@ else
|
|||
$formcompany->select_localtax(1,$object->localtax1_value, "lt1");
|
||||
print '</span>';
|
||||
}
|
||||
|
||||
|
||||
print '</td><td>'.fieldLabel($langs->transcountry("LocalTax2IsUsed",$mysoc->country_code),'localtax2assuj_value').'</td><td>';
|
||||
print $form->selectyesno('localtax2assuj_value',$object->localtax2_assuj,1);
|
||||
if (! isOnlyOneLocalTax(2))
|
||||
|
|
@ -1760,7 +1775,7 @@ else
|
|||
print '</span>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
}
|
||||
elseif($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj!="1")
|
||||
{
|
||||
|
|
@ -1773,7 +1788,7 @@ else
|
|||
print '</span>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
}
|
||||
elseif($mysoc->localtax2_assuj=="1" && $mysoc->localtax1_assuj!="1")
|
||||
{
|
||||
|
|
@ -1787,7 +1802,7 @@ else
|
|||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
// VAT Code
|
||||
print '<tr><td>'.fieldLabel('VATIntra','intra_vat').'</td>';
|
||||
print '<td colspan="3">';
|
||||
|
|
@ -1935,7 +1950,7 @@ else
|
|||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print '<div align="center">';
|
||||
|
|
@ -1952,7 +1967,7 @@ else
|
|||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
|
||||
if (!empty($object->id)) $res=$object->fetch_optionals($object->id,$extralabels);
|
||||
//if ($res < 0) { dol_print_error($db); exit; }
|
||||
|
||||
|
|
@ -2091,7 +2106,7 @@ else
|
|||
print '</td></tr><tr><td>'.$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code).'</td><td>';
|
||||
print yn($object->localtax2_assuj);
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
if($object->localtax1_assuj=="1" && (! isOnlyOneLocalTax(1)))
|
||||
{
|
||||
print '<form method="post" action="'.$_SERVER['PHP_SELF'].'?socid='.$object->id.'">';
|
||||
|
|
@ -2145,7 +2160,7 @@ else
|
|||
print '<td>'.$object->localtax1_value.'</td>';
|
||||
}
|
||||
print '</tr></form>';
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
elseif($mysoc->localtax2_assuj=="1" && $mysoc->localtax1_assuj!="1")
|
||||
|
|
@ -2155,7 +2170,7 @@ else
|
|||
print '</td></tr>';
|
||||
if($object->localtax2_assuj=="1" && (! isOnlyOneLocalTax(2)))
|
||||
{
|
||||
|
||||
|
||||
print '<form method="post" action="'.$_SERVER['PHP_SELF'].'?socid='.$object->id.'">';
|
||||
print '<input type="hidden" name="action" value="set_localtax2">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
|
|
@ -2168,7 +2183,7 @@ else
|
|||
print '<td>'.$object->localtax2_value.'</td>';
|
||||
}
|
||||
print '</tr></form>';
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
/*
|
||||
|
|
@ -2179,7 +2194,7 @@ else
|
|||
print '</td><tr>';
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
// VAT Code
|
||||
print '<tr>';
|
||||
print '<td class="nowrap">'.$langs->trans('VATIntra').'</td><td>';
|
||||
|
|
@ -2308,14 +2323,9 @@ else
|
|||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Other attributes
|
||||
$parameters=array('socid'=>$socid, 'colspan' => ' colspan="3"', 'colspanvalue' => '3');
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
if (empty($reshook) && ! empty($extrafields->attribute_label))
|
||||
{
|
||||
print $object->showOptionals($extrafields);
|
||||
}
|
||||
// Other attributes
|
||||
$parameters=array('socid'=>$socid, 'colspan' => ' colspan="3"', 'colspanvalue' => '3');
|
||||
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
|
||||
|
||||
// Parent company
|
||||
if (empty($conf->global->SOCIETE_DISABLE_PARENTCOMPANY))
|
||||
|
|
@ -2574,10 +2584,10 @@ else
|
|||
|
||||
// Subsidiaries list
|
||||
if (empty($conf->global->SOCIETE_DISABLE_SUBSIDIARIES))
|
||||
{
|
||||
{
|
||||
$result=show_subsidiaries($conf,$langs,$db,$object);
|
||||
}
|
||||
|
||||
|
||||
// Contacts list
|
||||
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1062,7 +1062,6 @@ class Societe extends CommonObject
|
|||
else if ($idprof6) $sql .= " WHERE s.idprof6 = '".$this->db->escape($idprof6)."' AND s.entity IN (".getEntity($this->element, 1).")";
|
||||
|
||||
$resql=$this->db->query($sql);
|
||||
dol_syslog(get_class($this)."::fetch ".$sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num=$this->db->num_rows($resql);
|
||||
|
|
@ -1196,11 +1195,7 @@ class Societe extends CommonObject
|
|||
$result = 1;
|
||||
|
||||
// Retreive all extrafield for thirdparty
|
||||
// fetch optionals attributes and labels
|
||||
require_once(DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php');
|
||||
$extrafields=new ExtraFields($this->db);
|
||||
$extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true);
|
||||
$this->fetch_optionals($this->id,$extralabels);
|
||||
$this->fetch_optionals();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1843,16 +1838,16 @@ class Societe extends CommonObject
|
|||
&& ($conf->global->SOCIETE_ADD_REF_IN_LIST == 1
|
||||
|| $conf->global->SOCIETE_ADD_REF_IN_LIST == 2
|
||||
)
|
||||
)
|
||||
)
|
||||
$code = $this->code_client . ' - ';
|
||||
|
||||
if (($this->fournisseur) && (! empty ( $this->code_fournisseur ))
|
||||
&& ($conf->global->SOCIETE_ADD_REF_IN_LIST == 1
|
||||
|| $conf->global->SOCIETE_ADD_REF_IN_LIST == 3
|
||||
)
|
||||
)
|
||||
)
|
||||
$code .= $this->code_fournisseur . ' - ';
|
||||
|
||||
|
||||
if ($conf->global->SOCIETE_ADD_REF_IN_LIST == 1)
|
||||
$name =$code.' '.$name;
|
||||
else
|
||||
|
|
@ -1870,7 +1865,7 @@ class Societe extends CommonObject
|
|||
$label.= Form::showphoto('societe', $this, 80, 0, 0, 'photowithmargin', 'mini');
|
||||
$label.= '</div><div style="clear: both;"></div>';
|
||||
}
|
||||
|
||||
|
||||
$label.= '<div class="centpercent">';
|
||||
|
||||
if ($option == 'customer' || $option == 'compta' || $option == 'category' || $option == 'category_supplier')
|
||||
|
|
@ -1903,7 +1898,7 @@ class Societe extends CommonObject
|
|||
$label.= '<u>' . $langs->trans("ShowMargin") . '</u>';
|
||||
$linkstart = '<a href="'.DOL_URL_ROOT.'/margin/tabs/thirdpartyMargins.php?socid='.$this->id.'&type=1';
|
||||
}
|
||||
|
||||
|
||||
// By default
|
||||
if (empty($linkstart))
|
||||
{
|
||||
|
|
@ -1924,13 +1919,13 @@ class Societe extends CommonObject
|
|||
$label.= '<br><b>' . $langs->trans('CustomerAccountancyCode') . ':</b> '. $this->code_compta_client;
|
||||
if (! empty($conf->accounting->enabled) && $this->fournisseur)
|
||||
$label.= '<br><b>' . $langs->trans('SupplierAccountancyCode') . ':</b> '. $this->code_compta_fournisseur;
|
||||
|
||||
|
||||
$label.= '</div>';
|
||||
|
||||
// Add type of canvas
|
||||
$linkstart.=(!empty($this->canvas)?'&canvas='.$this->canvas:'');
|
||||
// Add param to save lastsearch_values or not
|
||||
$add_save_lastsearch_values=($save_lastsearch_value == 1 ? 1 : 0);
|
||||
$add_save_lastsearch_values=($save_lastsearch_value == 1 ? 1 : 0);
|
||||
if ($save_lastsearch_value == -1 && preg_match('/list\.php/',$_SERVER["PHP_SELF"])) $add_save_lastsearch_values=1;
|
||||
if ($add_save_lastsearch_values) $linkstart.='&save_lastsearch_values=1';
|
||||
$linkstart.='"';
|
||||
|
|
@ -1965,7 +1960,7 @@ class Societe extends CommonObject
|
|||
$linkstart='';
|
||||
$linkend='';
|
||||
}
|
||||
|
||||
|
||||
if ($withpicto) $result.=($linkstart.img_object(($notooltip?'':$label), 'company', ($notooltip?'':'class="classfortooltip valigntextbottom"'), 0, 0, $notooltip?0:1).$linkend);
|
||||
if ($withpicto && $withpicto != 2) $result.=' ';
|
||||
if ($withpicto != 2) $result.=$linkstart.($maxlen?dol_trunc($name,$maxlen):$name).$linkend;
|
||||
|
|
@ -3352,7 +3347,7 @@ class Societe extends CommonObject
|
|||
{
|
||||
$table='propal';
|
||||
if ($mode == 'supplier') $table = 'supplier_proposal';
|
||||
|
||||
|
||||
$sql = "SELECT rowid, total_ht, total as total_ttc, fk_statut FROM ".MAIN_DB_PREFIX.$table." as f";
|
||||
$sql .= " WHERE fk_soc = ". $this->id;
|
||||
|
||||
|
|
@ -3376,7 +3371,7 @@ class Societe extends CommonObject
|
|||
else
|
||||
return array();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return amount of order not paid and total
|
||||
*
|
||||
|
|
@ -3387,7 +3382,7 @@ class Societe extends CommonObject
|
|||
{
|
||||
$table='commande';
|
||||
if ($mode == 'supplier') $table = 'commande_fournisseur';
|
||||
|
||||
|
||||
$sql = "SELECT rowid, total_ht, total_ttc, fk_statut FROM ".MAIN_DB_PREFIX.$table." as f";
|
||||
$sql .= " WHERE fk_soc = ". $this->id;
|
||||
|
||||
|
|
@ -3411,7 +3406,7 @@ class Societe extends CommonObject
|
|||
else
|
||||
return array();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return amount of bill not paid and total
|
||||
*
|
||||
|
|
@ -3422,7 +3417,7 @@ class Societe extends CommonObject
|
|||
{
|
||||
$table='facture';
|
||||
if ($mode == 'supplier') $table = 'facture_fourn';
|
||||
|
||||
|
||||
/* Accurate value of remain to pay is to sum remaintopay for each invoice
|
||||
$paiement = $invoice->getSommePaiement();
|
||||
$creditnotes=$invoice->getSumCreditNotesUsed();
|
||||
|
|
@ -3455,7 +3450,7 @@ class Societe extends CommonObject
|
|||
$tmpobject->id=$obj->rowid;
|
||||
if ($obj->fk_statut != 0 // Not a draft
|
||||
&& ! ($obj->fk_statut == 3 && $obj->close_code == 'replaced') // Not a replaced invoice
|
||||
)
|
||||
)
|
||||
{
|
||||
$outstandingTotal+= $obj->total_ht;
|
||||
$outstandingTotalIncTax+= $obj->total_ttc;
|
||||
|
|
@ -3474,12 +3469,12 @@ class Societe extends CommonObject
|
|||
}
|
||||
return array('opened'=>$outstandingOpened, 'total_ht'=>$outstandingTotal, 'total_ttc'=>$outstandingTotalIncTax);
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
return array();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return amount of bill not paid
|
||||
*
|
||||
|
|
@ -3502,7 +3497,7 @@ class Societe extends CommonObject
|
|||
//$sql .= " AND (fk_statut <> 3 OR close_code <> 'abandon')"; // Not abandonned for undefined reason
|
||||
$sql .= " AND fk_statut <> 3"; // Not abandonned
|
||||
$sql .= " AND fk_statut <> 2"; // Not clasified as paid
|
||||
|
||||
|
||||
dol_syslog("get_OutstandingBill", LOG_DEBUG);
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
|
|
@ -3522,7 +3517,7 @@ class Societe extends CommonObject
|
|||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return label of status customer is prospect/customer
|
||||
*
|
||||
|
|
@ -3592,9 +3587,9 @@ class Societe extends CommonObject
|
|||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$modelpath = "core/modules/societe/doc/";
|
||||
|
||||
|
||||
$result=$this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams);
|
||||
}
|
||||
|
||||
|
|
@ -3615,7 +3610,7 @@ class Societe extends CommonObject
|
|||
public function setCategories($categories, $type)
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
|
||||
|
||||
|
||||
// Decode type
|
||||
if ($type == 'customer') {
|
||||
$type_id = Categorie::TYPE_CUSTOMER;
|
||||
|
|
|
|||
|
|
@ -115,9 +115,9 @@ if (! empty($socid))
|
|||
dol_fiche_head($head, 'salesrepresentative', $langs->trans("ThirdParty"), -1, 'company');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/societe/list.php">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
|
||||
dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom');
|
||||
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
|
@ -167,17 +167,14 @@ if (! empty($socid))
|
|||
$i = 0;
|
||||
|
||||
$tmpuser = new User($db);
|
||||
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
$parameters=array('socid'=>$object->id);
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$obj,$action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook)) {
|
||||
|
||||
null; // actions in normal case
|
||||
}
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
|
||||
$tmpuser->id = $obj->rowid;
|
||||
$tmpuser->firstname = $obj->firstname;
|
||||
|
|
@ -188,7 +185,7 @@ if (! empty($socid))
|
|||
$tmpuser->societe_id = $obj->fk_soc;
|
||||
$tmpuser->photo = $obj->photo;
|
||||
print $tmpuser->getNomUrl(-1);
|
||||
|
||||
|
||||
/*print '<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$obj->rowid.'">';
|
||||
print img_object($langs->trans("ShowUser"),"user").' ';
|
||||
print dolGetFirstLastname($obj->firstname, $obj->lastname)."\n";
|
||||
|
|
@ -216,7 +213,7 @@ if (! empty($socid))
|
|||
|
||||
print '</table>';
|
||||
print "</div>\n";
|
||||
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
|
|
@ -263,11 +260,11 @@ if (! empty($socid))
|
|||
|
||||
$var=True;
|
||||
$tmpuser=new User($db);
|
||||
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
|
||||
print "<tr ".$bc[$var]."><td>";
|
||||
$tmpuser->id=$obj->rowid;
|
||||
$tmpuser->firstname=$obj->firstname;
|
||||
|
|
|
|||
|
|
@ -359,16 +359,7 @@ if ($sql_select)
|
|||
print_barre_liste($langs->trans('ProductsIntoElements').' '.$typeElementString.' '.$button, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num, $totalnboflines, '', 0, '', '', $limit);
|
||||
|
||||
print '<table class="liste" width="100%">'."\n";
|
||||
// Titles with sort buttons
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans('Ref'),$_SERVER['PHP_SELF'],'doc_number','',$param,'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('Date'),$_SERVER['PHP_SELF'],'dateprint','',$param,'align="center" width="150"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('Status'),$_SERVER['PHP_SELF'],'fk_statut','',$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('Product'),$_SERVER['PHP_SELF'],'','',$param,'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('Quantity'),$_SERVER['PHP_SELF'],'prod_qty','',$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('TotalHT'),$_SERVER['PHP_SELF'],'total_ht','',$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('UnitPrice'),$_SERVER['PHP_SELF'],'','',$param,'align="right"',$sortfield,$sortorder);
|
||||
print "</tr>\n";
|
||||
|
||||
// Filters
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre" align="left">';
|
||||
|
|
@ -393,6 +384,18 @@ if ($sql_select)
|
|||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Titles with sort buttons
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans('Ref'),$_SERVER['PHP_SELF'],'doc_number','',$param,'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('Date'),$_SERVER['PHP_SELF'],'dateprint','',$param,'align="center" width="150"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('Status'),$_SERVER['PHP_SELF'],'fk_statut','',$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('Product'),$_SERVER['PHP_SELF'],'','',$param,'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('Quantity'),$_SERVER['PHP_SELF'],'prod_qty','',$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('TotalHT'),$_SERVER['PHP_SELF'],'total_ht','',$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('UnitPrice'),$_SERVER['PHP_SELF'],'','',$param,'align="right"',$sortfield,$sortorder);
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
$i = 0;
|
||||
while (($objp = $db->fetch_object($resql)) && $i < min($num, $limit))
|
||||
{
|
||||
|
|
@ -407,7 +410,7 @@ if ($sql_select)
|
|||
|
||||
if (is_object($documentstaticline)) $documentstaticline->statut=$objp->status;
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="nobordernopadding nowrap" width="100">';
|
||||
print $documentstatic->getNomUrl(1);
|
||||
|
|
@ -609,7 +612,7 @@ else if (empty($type_element) || $type_element == -1)
|
|||
print_liste_field_titre($langs->trans('Quantity'),$_SERVER['PHP_SELF'],'prod_qty','',$param,'align="right"',$sortfield,$sortorder);
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr '.$bc[0].'><td class="opacitymedium" colspan="5">'.$langs->trans("SelectElementAndClickRefresh").'</td></tr>';
|
||||
print '<tr '.$bc[0].'><td class="opacitymedium" colspan="5">'.$langs->trans("SelectElementAndClick", $langs->transnoentitiesnoconv("Search")).'</td></tr>';
|
||||
|
||||
print "</table>";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -505,7 +505,7 @@ if (empty($reshook))
|
|||
}
|
||||
|
||||
// Add a product line
|
||||
if ($action == 'addline' && $user->rights->supplier_proposal->creer)
|
||||
if ($action == 'addline' && $user->rights->supplier_proposal->creer)
|
||||
{
|
||||
$langs->load('errors');
|
||||
$error = 0;
|
||||
|
|
@ -515,7 +515,7 @@ if (empty($reshook))
|
|||
$product_desc=(GETPOST('dp_desc')?GETPOST('dp_desc'):'');
|
||||
$date_start=dol_mktime(GETPOST('date_start'.$predef.'hour'), GETPOST('date_start'.$predef.'min'), GETPOST('date_start' . $predef . 'sec'), GETPOST('date_start'.$predef.'month'), GETPOST('date_start'.$predef.'day'), GETPOST('date_start'.$predef.'year'));
|
||||
$date_end=dol_mktime(GETPOST('date_end'.$predef.'hour'), GETPOST('date_end'.$predef.'min'), GETPOST('date_end' . $predef . 'sec'), GETPOST('date_end'.$predef.'month'), GETPOST('date_end'.$predef.'day'), GETPOST('date_end'.$predef.'year'));
|
||||
|
||||
|
||||
if (GETPOST('prod_entry_mode') == 'free')
|
||||
{
|
||||
$idprod=0;
|
||||
|
|
@ -572,7 +572,7 @@ if (empty($reshook))
|
|||
if ((GETPOST('prod_entry_mode') != 'free') && empty($error)) // With combolist mode idprodfournprice is > 0 or -1. With autocomplete, idprodfournprice is > 0 or ''
|
||||
{
|
||||
$productsupplier = new ProductFournisseur($db);
|
||||
|
||||
|
||||
if (empty($conf->global->SUPPLIER_PROPOSAL_WITH_NOPRICEDEFINED))
|
||||
{
|
||||
$idprod=0;
|
||||
|
|
@ -592,7 +592,7 @@ if (empty($reshook))
|
|||
$idprod=$productsupplier->get_buyprice(GETPOST('idprodfournprice'), -1); // We force qty to -1 to be sure to find if a supplier price exist
|
||||
$res=$productsupplier->fetch($idprod);
|
||||
}
|
||||
|
||||
|
||||
if ($idprod > 0)
|
||||
{
|
||||
$pu_ht = $productsupplier->fourn_pu;
|
||||
|
|
@ -601,7 +601,7 @@ if (empty($reshook))
|
|||
$label = $productsupplier->label;
|
||||
$desc = $productsupplier->description;
|
||||
if (trim($product_desc) != trim($desc)) $desc = dol_concatdesc($desc, $product_desc);
|
||||
|
||||
|
||||
$tva_tx = get_default_tva($object->thirdparty, $mysoc, $productsupplier->id, GETPOST('idprodfournprice'));
|
||||
$tva_npr = get_default_npr($object->thirdparty, $mysoc, $productsupplier->id, GETPOST('idprodfournprice'));
|
||||
if (empty($tva_tx)) $tva_npr=0;
|
||||
|
|
@ -659,13 +659,13 @@ if (empty($reshook))
|
|||
$type = GETPOST('type');
|
||||
|
||||
$fk_unit= GETPOST('units', 'alpha');
|
||||
|
||||
|
||||
$tva_tx = price2num($tva_tx); // When vat is text input field
|
||||
|
||||
|
||||
// Local Taxes
|
||||
$localtax1_tx= get_localtax($tva_tx, 1, $mysoc, $object->thirdparty);
|
||||
$localtax2_tx= get_localtax($tva_tx, 2, $mysoc, $object->thirdparty);
|
||||
|
||||
|
||||
if (GETPOST('price_ht')!=='')
|
||||
{
|
||||
$price_base_type = 'HT';
|
||||
|
|
@ -678,13 +678,13 @@ if (empty($reshook))
|
|||
$ht = $ttc / (1 + ($tva_tx / 100));
|
||||
$price_base_type = 'HT';
|
||||
}
|
||||
|
||||
|
||||
$result = $object->addline($desc, $ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, $idprod, $remise_percent, $price_base_type, $ttc, $info_bits, $type, - 1, 0, GETPOST('fk_parent_line'), $fournprice, $buyingprice, $label, $array_options, $ref_fourn, $fk_unit);
|
||||
//$result = $object->addline($desc, $ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, 0, 0, '', $remise_percent, $price_base_type, $ttc, $type,'','', $date_start, $date_end, $array_options, $fk_unit);
|
||||
}
|
||||
|
||||
|
||||
if (! $error && $result > 0)
|
||||
if (! $error && $result > 0)
|
||||
{
|
||||
$db->commit();
|
||||
|
||||
|
|
@ -701,7 +701,7 @@ if (empty($reshook))
|
|||
}
|
||||
$model=$object->modelpdf;
|
||||
$ret = $object->fetch($id); // Reload to get new records
|
||||
|
||||
|
||||
$result=$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
if ($result < 0) dol_print_error($db,$result);
|
||||
}
|
||||
|
|
@ -711,7 +711,7 @@ if (empty($reshook))
|
|||
unset($_POST['qty']);
|
||||
unset($_POST['type']);
|
||||
unset($_POST['remise_percent']);
|
||||
unset($_POST['pu']);
|
||||
unset($_POST['pu']);
|
||||
unset($_POST['price_ht']);
|
||||
unset($_POST['multicurrency_price_ht']);
|
||||
unset($_POST['price_ttc']);
|
||||
|
|
@ -742,8 +742,8 @@ if (empty($reshook))
|
|||
unset($_POST['date_endday']);
|
||||
unset($_POST['date_endmonth']);
|
||||
unset($_POST['date_endyear']);
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
|
||||
|
|
@ -959,27 +959,13 @@ if (empty($reshook))
|
|||
// Fill array 'array_options' with data from update form
|
||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute'));
|
||||
if ($ret < 0)
|
||||
$error ++;
|
||||
|
||||
if (! $error) {
|
||||
// Actions on extra fields (by external module or standard code)
|
||||
$hookmanager->initHooks(array('supplier_proposaldao'));
|
||||
$parameters = array('id' => $object->id);
|
||||
$reshook = $hookmanager->executeHooks('insertExtraFields', $parameters, $object, $action); // Note that $action and $object may have been
|
||||
// modified by
|
||||
// some hooks
|
||||
if (empty($reshook)) {
|
||||
$result = $object->insertExtraFields();
|
||||
if ($result < 0) {
|
||||
$error ++;
|
||||
}
|
||||
} else if ($reshook < 0)
|
||||
$error ++;
|
||||
if ($ret < 0) $error++;
|
||||
if (! $error)
|
||||
{
|
||||
$result = $object->insertExtraFields();
|
||||
if ($result < 0) $error++;
|
||||
}
|
||||
|
||||
if ($error)
|
||||
$action = 'edit_extras';
|
||||
if ($error) $action = 'edit_extras';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1163,9 +1149,7 @@ if ($action == 'create')
|
|||
|
||||
// Other attributes
|
||||
$parameters = array('colspan' => ' colspan="3"');
|
||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified
|
||||
// by
|
||||
// hook
|
||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook) && ! empty($extrafields->attribute_label)) {
|
||||
print $object->showOptionals($extrafields, 'edit');
|
||||
}
|
||||
|
|
@ -1367,11 +1351,11 @@ if ($action == 'create')
|
|||
// Print form confirm
|
||||
print $formconfirm;
|
||||
|
||||
|
||||
|
||||
// Supplier proposal card
|
||||
$linkback = '<a href="' . DOL_URL_ROOT . '/supplier_proposal/list.php' . (! empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
|
||||
|
||||
|
||||
|
||||
|
||||
$morehtmlref='<div class="refidno">';
|
||||
// Ref supplier
|
||||
//$morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', 0, 1);
|
||||
|
|
@ -1411,15 +1395,15 @@ if ($action == 'create')
|
|||
}
|
||||
}
|
||||
$morehtmlref.='</div>';
|
||||
|
||||
|
||||
|
||||
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
||||
|
||||
|
||||
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="fichehalfleft">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Payment term
|
||||
|
|
@ -1563,14 +1547,14 @@ if ($action == 'create')
|
|||
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
||||
print '</div>';
|
||||
print '<div class="fichehalfright">';
|
||||
print '<div class="ficheaddleft">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
|
||||
if (!empty($conf->multicurrency->enabled) && ($object->multicurrency_code != $conf->currency))
|
||||
{
|
||||
// Multicurrency Amount HT
|
||||
|
|
@ -1588,7 +1572,7 @@ if ($action == 'create')
|
|||
print '<td>' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
|
||||
// Amount HT
|
||||
print '<tr><td class="titlefieldmiddle">' . $langs->trans('AmountHT') . '</td>';
|
||||
print '<td>' . price($object->total_ht, '', $langs, 0, - 1, - 1, $conf->currency) . '</td>';
|
||||
|
|
@ -1619,18 +1603,18 @@ if ($action == 'create')
|
|||
print '</tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
||||
// Margin Infos
|
||||
/*if (! empty($conf->margin->enabled)) {
|
||||
$formmargin->displayMarginInfos($object);
|
||||
}*/
|
||||
}*/
|
||||
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
|
||||
|
||||
print '<div class="clearboth"></div><br>';
|
||||
|
||||
|
||||
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) {
|
||||
$blocname = 'contacts';
|
||||
$title = $langs->trans('ContactsAddresses');
|
||||
|
|
@ -1667,7 +1651,7 @@ if ($action == 'create')
|
|||
// Add free products/services form
|
||||
global $forceall, $senderissupplier, $dateSelector;
|
||||
$forceall=1; $senderissupplier=2; $dateSelector=0; // $senderissupplier=2 is same than 1 but disable test on minimum qty.
|
||||
|
||||
|
||||
if (! empty($object->lines))
|
||||
$ret = $object->printObjectLines($action, $soc, $mysoc, $lineid, 1);
|
||||
|
||||
|
|
@ -1810,12 +1794,12 @@ if ($action == 'create')
|
|||
|
||||
print $formfile->showdocuments('supplier_proposal', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', 0, '', $soc->default_lang);
|
||||
|
||||
|
||||
|
||||
// Show links to link elements
|
||||
$linktoelem = $form->showLinkToObjectBlock($object, null, array('supplier_proposal'));
|
||||
$somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
|
||||
|
||||
|
||||
|
||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||
|
||||
// List of actions on element
|
||||
|
|
|
|||
|
|
@ -265,7 +265,7 @@ input.select2-input {
|
|||
border-bottom: solid 1px rgba(0,0,0,.2) !important; /* required to avoid to lose bottom line when focus is lost on select2. */
|
||||
}
|
||||
|
||||
.liste_titre input[name=monthvalid], .liste_titre input[name=search_smonth], .liste_titre input[name=search_emonth], .liste_titre input[name=smonth], .liste_titre input[name=month], .liste_titre input[name=month_lim] {
|
||||
.liste_titre input[name=monthvalid], .liste_titre input[name=search_smonth], .liste_titre input[name=search_emonth], .liste_titre input[name=smonth], .liste_titre input[name=month], .liste_titre select[name=month], .liste_titre input[name=month_lim] {
|
||||
margin-right: 4px;
|
||||
}
|
||||
input[type=submit] {
|
||||
|
|
@ -691,7 +691,7 @@ div.fiche>form>div.div-table-responsive, div.fiche>form>div.div-table-responsive
|
|||
overflow-x: auto;
|
||||
}
|
||||
div.fiche>form>div.div-table-responsive {
|
||||
min-height: 390px;
|
||||
min-height: 392px;
|
||||
}
|
||||
|
||||
.flexcontainer {
|
||||
|
|
|
|||
|
|
@ -692,7 +692,7 @@ div.fiche>form>div.div-table-responsive, div.fiche>form>div.div-table-responsive
|
|||
overflow-x: auto;
|
||||
}
|
||||
div.fiche>form>div.div-table-responsive {
|
||||
min-height: 390px;
|
||||
min-height: 392px;
|
||||
}
|
||||
|
||||
.flexcontainer {
|
||||
|
|
|
|||
|
|
@ -300,7 +300,7 @@ if (empty($reshook)) {
|
|||
}
|
||||
}
|
||||
|
||||
if ($action == 'update' && ! $cancel)
|
||||
if ($action == 'update' && ! $cancel)
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
|
||||
|
|
@ -319,7 +319,7 @@ if (empty($reshook)) {
|
|||
$error ++;
|
||||
}
|
||||
|
||||
if (!$error)
|
||||
if (!$error)
|
||||
{
|
||||
$object->fetch($id);
|
||||
|
||||
|
|
@ -456,7 +456,7 @@ if (empty($reshook)) {
|
|||
setEventMessages($langs->trans("ErrorFailedToSaveFile"), null, 'errors');
|
||||
} else {
|
||||
// Create thumbs
|
||||
$object->addThumbs($newfile);
|
||||
$object->addThumbs($newfile);
|
||||
}
|
||||
} else {
|
||||
$error ++;
|
||||
|
|
@ -465,7 +465,7 @@ if (empty($reshook)) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (! $error && ! count($object->errors))
|
||||
{
|
||||
// Then we add the associated categories
|
||||
|
|
@ -476,7 +476,7 @@ if (empty($reshook)) {
|
|||
if (!$error && !count($object->errors)) {
|
||||
setEventMessages($langs->trans("UserModified"), null, 'mesgs');
|
||||
$db->commit();
|
||||
|
||||
|
||||
$login = $_SESSION["dol_login"];
|
||||
if ($login && $login == $object->oldcopy->login && $object->oldcopy->login != $object->login) // Current user has changed its login
|
||||
{
|
||||
|
|
@ -495,11 +495,11 @@ if (empty($reshook)) {
|
|||
if ($caneditpassword) // Case we can edit only password
|
||||
{
|
||||
dol_syslog("Not allowed to change fields, only password");
|
||||
|
||||
|
||||
$object->fetch($id);
|
||||
|
||||
|
||||
$object->oldcopy = clone $object;
|
||||
|
||||
|
||||
$ret = $object->setPassword($user, GETPOST("password"));
|
||||
if ($ret < 0)
|
||||
{
|
||||
|
|
@ -591,14 +591,14 @@ if (empty($reshook)) {
|
|||
setEventMessages($ldap->error, $ldap->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Actions to send emails
|
||||
$trigger_name='USER_SENTBYMAIL';
|
||||
$paramname='id'; // Name of param key to open the card
|
||||
$mode='emailfromuser';
|
||||
$trackid='use'.$object->id;
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
|
||||
|
||||
|
||||
// Actions to build doc
|
||||
$upload_dir = $conf->user->dir_output;
|
||||
$permissioncreate=$user->rights->user->user->creer;
|
||||
|
|
@ -1027,9 +1027,9 @@ if (($action == 'create') || ($action == 'adduserldap'))
|
|||
print '<input size="30" type="text" name="accountancy_code" value="'.GETPOST('accountancy_code').'">';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
// TODO Move this into tab RH (HierarchicalResponsible must be on both tab)
|
||||
|
||||
|
||||
// Hierarchy
|
||||
print '<tr><td>'.$langs->trans("HierarchicalResponsible").'</td>';
|
||||
print '<td>';
|
||||
|
|
@ -1076,7 +1076,7 @@ if (($action == 'create') || ($action == 'adduserldap'))
|
|||
print '<input size="8" type="text" name="weeklyhours" value="'.GETPOST('weeklyhours').'">';
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
// Date employment
|
||||
print '<tr><td>'.$langs->trans("DateEmployment").'</td>';
|
||||
print '<td>';
|
||||
|
|
@ -1092,9 +1092,9 @@ if (($action == 'create') || ($action == 'adduserldap'))
|
|||
print $formother->selectColor(GETPOST('color')?GETPOST('color'):$object->color, 'color', null, 1, '', 'hideifnotset');
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
// Categories
|
||||
if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
|
||||
if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
|
||||
{
|
||||
print '<tr><td>' . fieldLabel('Categories', 'usercats') . '</td><td colspan="3">';
|
||||
$cate_arbo = $form->select_all_categories('user', null, 'parent', null, null, 1);
|
||||
|
|
@ -1110,7 +1110,7 @@ if (($action == 'create') || ($action == 'adduserldap'))
|
|||
{
|
||||
print $object->showOptionals($extrafields,'edit');
|
||||
}
|
||||
|
||||
|
||||
// Note
|
||||
print '<tr><td class="tdtop">';
|
||||
print $langs->trans("Note");
|
||||
|
|
@ -1127,7 +1127,7 @@ if (($action == 'create') || ($action == 'adduserldap'))
|
|||
$doleditor=new DolEditor('signature',GETPOST('signature'),'',138,'dolibarr_mailings','In',true,true,empty($conf->global->FCKEDITOR_ENABLE_USERSIGN)?0:1,ROWS_4,'90%');
|
||||
print $doleditor->Create(1);
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
print "</table>\n";
|
||||
|
||||
dol_fiche_end();
|
||||
|
|
@ -1153,7 +1153,7 @@ else
|
|||
$object->fetch($id, '', '', 1);
|
||||
if ($res < 0) { dol_print_error($db,$object->error); exit; }
|
||||
$res=$object->fetch_optionals($object->id,$extralabels);
|
||||
|
||||
|
||||
// Check if user has rights
|
||||
$object->getrights();
|
||||
if(empty($object->nb_rights)) setEventMessages($langs->trans('UserHasNoPermissions'), null, 'warnings');
|
||||
|
|
@ -1387,7 +1387,7 @@ else
|
|||
print '<tr><td>'.$langs->trans("AccountancyCode").'</td>';
|
||||
print '<td>'.$object->accountancy_code.'</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
// TODO Move this into tab RH, visible when salarie or RH is visible (HierarchicalResponsible must be on both tab)
|
||||
|
||||
// Hierarchy
|
||||
|
|
@ -1468,7 +1468,7 @@ else
|
|||
}
|
||||
|
||||
// Categories
|
||||
if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
|
||||
if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
|
||||
{
|
||||
print '<tr><td>' . $langs->trans( "Categories" ) . '</td>';
|
||||
print '<td colspan="3">';
|
||||
|
|
@ -1495,30 +1495,25 @@ else
|
|||
print "</td></tr>\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (isset($conf->file->main_authentication) && preg_match('/openid/',$conf->file->main_authentication) && ! empty($conf->global->MAIN_OPENIDURL_PERUSER))
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("OpenIDURL").'</td>';
|
||||
print '<td>'.$object->openid.'</td>';
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
|
||||
print '<tr><td class="titlefield">'.$langs->trans("LastConnexion").'</td>';
|
||||
print '<td>'.dol_print_date($object->datelastlogin,"dayhour").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
print '<tr><td>'.$langs->trans("PreviousConnexion").'</td>';
|
||||
print '<td>'.dol_print_date($object->datepreviouslogin,"dayhour").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
// Other attributes
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook) && ! empty($extrafields->attribute_label))
|
||||
{
|
||||
print $object->showOptionals($extrafields);
|
||||
}
|
||||
|
||||
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
|
||||
|
||||
// Company / Contact
|
||||
if (! empty($conf->societe->enabled))
|
||||
{
|
||||
|
|
@ -1598,7 +1593,7 @@ else
|
|||
$langs->load("mails");
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NoEMail")).'">'.$langs->trans('SendMail').'</a></div>';
|
||||
}
|
||||
|
||||
|
||||
if ($caneditfield && (empty($conf->multicompany->enabled) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->multicompany->transverse_mode && $conf->entity == 1)))
|
||||
{
|
||||
if (! empty($conf->global->MAIN_ONLY_LOGIN_ALLOWED))
|
||||
|
|
@ -1680,36 +1675,36 @@ else
|
|||
/*
|
||||
* Affiche formulaire mail
|
||||
*/
|
||||
|
||||
|
||||
// By default if $action=='presend'
|
||||
$titreform='SendMail';
|
||||
$topicmail='';
|
||||
$action='send';
|
||||
$modelmail='user';
|
||||
|
||||
|
||||
print '<div id="presend"></div>';
|
||||
print load_fiche_titre($langs->trans($titreform));
|
||||
|
||||
|
||||
dol_fiche_head();
|
||||
|
||||
|
||||
// Define output language
|
||||
$outputlangs = $langs;
|
||||
$newlang = '';
|
||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id']))
|
||||
$newlang = $_REQUEST['lang_id'];
|
||||
|
||||
|
||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang))
|
||||
$newlang = $object->default_lang;
|
||||
|
||||
|
||||
// Cree l'objet formulaire mail
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
||||
$formmail = new FormMail($db);
|
||||
$formmail->param['langsmodels']=(empty($newlang)?$langs->defaultlang:$newlang);
|
||||
$formmail->fromtype = (GETPOST('fromtype')?GETPOST('fromtype'):(!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE)?$conf->global->MAIN_MAIL_DEFAULT_FROMTYPE:'user'));
|
||||
|
||||
|
||||
if($formmail->fromtype === 'user'){
|
||||
$formmail->fromid = $user->id;
|
||||
|
||||
|
||||
}
|
||||
$formmail->trackid='thi'.$object->id;
|
||||
if (! empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 2)) // If bit 2 is set
|
||||
|
|
@ -1733,40 +1728,40 @@ else
|
|||
$formmail->substit['__FIRSTNAME__']=$object->firstname;
|
||||
$formmail->substit['__SIGNATURE__']=$user->signature;
|
||||
$formmail->substit['__PERSONALIZED__']='';
|
||||
|
||||
|
||||
//Find the good contact adress
|
||||
/*
|
||||
$custcontact='';
|
||||
$contactarr=array();
|
||||
$contactarr=$object->liste_contact(-1,'external');
|
||||
|
||||
|
||||
if (is_array($contactarr) && count($contactarr)>0)
|
||||
{
|
||||
foreach($contactarr as $contact)
|
||||
{
|
||||
if ($contact['libelle']==$langs->trans('TypeContact_facture_external_BILLING')) {
|
||||
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
|
||||
|
||||
|
||||
$contactstatic=new Contact($db);
|
||||
$contactstatic->fetch($contact['id']);
|
||||
$custcontact=$contactstatic->getFullName($langs,1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!empty($custcontact)) {
|
||||
$formmail->substit['__CONTACTCIVNAME__']=$custcontact;
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
|
||||
|
||||
// Tableau des parametres complementaires du post
|
||||
$formmail->param['action']=$action;
|
||||
$formmail->param['models']=$modelmail;
|
||||
$formmail->param['models_id']=GETPOST('modelmailselected','int');
|
||||
$formmail->param['socid']=$object->id;
|
||||
$formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id;
|
||||
|
||||
|
||||
// Init list of files
|
||||
if (GETPOST("mode")=='init')
|
||||
{
|
||||
|
|
@ -1774,7 +1769,7 @@ else
|
|||
$formmail->add_attached_files($file,basename($file),dol_mimetype($file));
|
||||
}
|
||||
print $formmail->get_form();
|
||||
|
||||
|
||||
dol_fiche_end();
|
||||
}
|
||||
|
||||
|
|
@ -1783,17 +1778,17 @@ else
|
|||
/*
|
||||
* List of groups of user
|
||||
*/
|
||||
|
||||
|
||||
if ($canreadgroup)
|
||||
{
|
||||
print load_fiche_titre($langs->trans("ListOfGroupsForUser"),'','');
|
||||
|
||||
|
||||
// On selectionne les groupes auquel fait parti le user
|
||||
$exclude = array();
|
||||
|
||||
|
||||
$usergroup=new UserGroup($db);
|
||||
$groupslist = $usergroup->listGroupsForUser($object->id);
|
||||
|
||||
|
||||
if (! empty($groupslist))
|
||||
{
|
||||
if (! (! empty($conf->multicompany->enabled) && ! empty($conf->multicompany->transverse_mode)))
|
||||
|
|
@ -1804,14 +1799,14 @@ else
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($caneditgroup)
|
||||
{
|
||||
print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$id.'" method="POST">'."\n";
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'" />';
|
||||
print '<input type="hidden" name="action" value="addgroup" />';
|
||||
}
|
||||
|
||||
|
||||
print '<table class="noborder" width="100%">'."\n";
|
||||
print '<tr class="liste_titre"><th class="liste_titre" width="25%">'.$langs->trans("Groups").'</th>'."\n";
|
||||
if(! empty($conf->multicompany->enabled) && !empty($conf->multicompany->transverse_mode) && $conf->entity == 1 && $user->admin && ! $user->entity)
|
||||
|
|
@ -1843,7 +1838,7 @@ else
|
|||
print '<input type="submit" class="button" value="'.$langs->trans("Add").'" />';
|
||||
}
|
||||
print '</th></tr>'."\n";
|
||||
|
||||
|
||||
/*
|
||||
* Groups assigned to user
|
||||
*/
|
||||
|
|
@ -1851,8 +1846,8 @@ else
|
|||
{
|
||||
foreach($groupslist as $group)
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>';
|
||||
if ($caneditgroup)
|
||||
|
|
@ -1899,9 +1894,9 @@ else
|
|||
{
|
||||
print '<tr '.$bc[false].'><td colspan="3" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
print "</table>";
|
||||
|
||||
|
||||
if ($caneditgroup)
|
||||
{
|
||||
print '</form>';
|
||||
|
|
@ -1910,7 +1905,7 @@ else
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Fiche en mode edition
|
||||
*/
|
||||
|
|
@ -2030,7 +2025,7 @@ else
|
|||
print "</td></tr>\n";
|
||||
|
||||
// API key
|
||||
if(! empty($conf->api->enabled) && $user->admin)
|
||||
if(! empty($conf->api->enabled) && $user->admin)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("ApiKey").'</td>';
|
||||
print '<td>';
|
||||
|
|
@ -2280,9 +2275,9 @@ else
|
|||
print '</td>';
|
||||
print "</tr>";
|
||||
}
|
||||
|
||||
|
||||
// TODO Move this into tab RH (HierarchicalResponsible must be on both tab)
|
||||
|
||||
|
||||
// Hierarchy
|
||||
print '<tr><td>'.$langs->trans("HierarchicalResponsible").'</td>';
|
||||
print '<td>';
|
||||
|
|
@ -2355,7 +2350,7 @@ else
|
|||
print $formother->selectColor(GETPOST('color')?GETPOST('color'):$object->color, 'color', null, 1, '', 'hideifnotset');
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
// Photo
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans("Photo").'</td>';
|
||||
|
|
@ -2363,9 +2358,9 @@ else
|
|||
print $form->showphoto('userphoto',$object,60,0,$caneditfield,'photowithmargin','small');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
// Categories
|
||||
if (!empty( $conf->categorie->enabled ) && !empty( $user->rights->categorie->lire ))
|
||||
if (!empty( $conf->categorie->enabled ) && !empty( $user->rights->categorie->lire ))
|
||||
{
|
||||
print '<tr><td>' . fieldLabel( 'Categories', 'usercats' ) . '</td>';
|
||||
print '<td>';
|
||||
|
|
@ -2470,7 +2465,7 @@ else
|
|||
print dol_htmlentitiesbr($object->signature);
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
print '</table>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
|
@ -2495,27 +2490,27 @@ else
|
|||
$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
|
||||
$genallowed = $user->rights->user->user->creer;
|
||||
$delallowed = $user->rights->user->user->supprimer;
|
||||
|
||||
|
||||
$somethingshown = $formfile->show_documents('user', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', 0, '', $soc->default_lang);
|
||||
|
||||
|
||||
// Show links to link elements
|
||||
$linktoelem = $form->showLinkToObjectBlock($object, null, null);
|
||||
$somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
|
||||
|
||||
|
||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||
|
||||
|
||||
// List of actions on element
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
|
||||
$formactions = new FormActions($db);
|
||||
$somethingshown = $formactions->showactions($object, 'user', $socid);
|
||||
|
||||
|
||||
|
||||
|
||||
print '</div></div></div>';
|
||||
}
|
||||
|
||||
|
||||
if (! empty($conf->ldap->enabled) && ! empty($object->ldap_sid)) $ldap->close();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (! empty($conf->api->enabled) && ! empty($conf->use_javascript_ajax))
|
||||
|
|
|
|||
|
|
@ -210,7 +210,7 @@ if ($action == 'update')
|
|||
setEventMessages($langs->trans('ErrorForbidden'), null, 'mesgs');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Actions to build doc
|
||||
$upload_dir = $conf->usergroup->dir_output;
|
||||
$permissioncreate=$user->rights->user->user->creer;
|
||||
|
|
@ -317,10 +317,10 @@ else
|
|||
dol_fiche_head($head, 'group', $title, -1, 'group');
|
||||
|
||||
dol_banner_tab($object,'id','',$user->rights->user->user->lire || $user->admin);
|
||||
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Name
|
||||
|
|
@ -348,15 +348,11 @@ else
|
|||
|
||||
// Other attributes
|
||||
$parameters=array('colspan' => ' colspan="2"');
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook) && ! empty($extrafields->attribute_label))
|
||||
{
|
||||
print $object->showOptionals($extrafields);
|
||||
}
|
||||
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
|
||||
|
||||
print "</table>\n";
|
||||
print '</div>';
|
||||
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
|
|
@ -448,7 +444,7 @@ else
|
|||
{
|
||||
foreach($object->members as $useringroup)
|
||||
{
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>';
|
||||
|
|
@ -497,7 +493,7 @@ else
|
|||
}
|
||||
print "</table>";
|
||||
print "<br>";
|
||||
|
||||
|
||||
/*
|
||||
* Documents generes
|
||||
*/
|
||||
|
|
@ -506,21 +502,21 @@ else
|
|||
$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
|
||||
$genallowed = $user->rights->user->user->creer;
|
||||
$delallowed = $user->rights->user->user->supprimer;
|
||||
|
||||
|
||||
$somethingshown = $formfile->show_documents('usergroup', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', 0, '', $soc->default_lang);
|
||||
|
||||
|
||||
// Show links to link elements
|
||||
$linktoelem = $form->showLinkToObjectBlock($object, null, null);
|
||||
$somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
|
||||
|
||||
|
||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||
|
||||
|
||||
// List of actions on element
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
|
||||
$formactions = new FormActions($db);
|
||||
$somethingshown = $formactions->showactions($object, 'usergroup', $socid);
|
||||
|
||||
|
||||
|
||||
|
||||
print '</div></div></div>';
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user