Compare commits

...

39 Commits

Author SHA1 Message Date
Laurent Destailleur
3e7ed752ea Add changelog 2017-08-26 11:55:30 +02:00
Laurent Destailleur
1b1d1a8d0b FIX #7156 2017-08-23 16:57:07 +02:00
Laurent Destailleur
947acfffe2 FIX #7173 2017-08-23 16:53:29 +02:00
Laurent Destailleur
6b5b10fc94 FIX #7224 2017-08-23 16:28:34 +02:00
Laurent Destailleur
52a8692a85 FIX #7226 2017-08-23 16:07:11 +02:00
Laurent Destailleur
29e656ec7e Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 5.0 2017-08-23 15:06:30 +02:00
Laurent Destailleur
4da49dfc2d FIX #7239 2017-08-23 15:02:38 +02:00
Laurent Destailleur
cabe7c696c Merge pull request #7280 from hregis/5.0_scandir
Fix: "scandir" in url is blocked in some providers
2017-08-23 12:52:32 +02:00
Regis Houssin
2492b9968a Fix: missing scandir 2017-08-23 10:21:10 +02:00
Regis Houssin
6dda2f3670 Fix: "scandir" in url is blocked in some providers 2017-08-23 10:07:00 +02:00
Laurent Destailleur
41ce4886fd Merge branch '4.0' of git@github.com:Dolibarr/dolibarr.git into 5.0 2017-08-22 11:15:30 +02:00
Laurent Destailleur
256f6e410c Merge branch '3.9' of git@github.com:Dolibarr/dolibarr.git into 4.0 2017-08-22 11:14:51 +02:00
Laurent Destailleur
d5d337c631 Merge branch '3.8' of git@github.com:Dolibarr/dolibarr.git into 3.9 2017-08-22 11:14:27 +02:00
Laurent Destailleur
71818da6a5 Merge branch '3.7' of git@github.com:Dolibarr/dolibarr.git into 3.8 2017-08-22 11:13:58 +02:00
Laurent Destailleur
c53aef9955 Merge branch '3.7' of git@github.com:Dolibarr/dolibarr.git into 3.7 2017-08-22 10:51:30 +02:00
Laurent Destailleur
a18995d3dc Merge branch '3.6' of git@github.com:Dolibarr/dolibarr.git into 3.7 2017-08-22 10:47:47 +02:00
Laurent Destailleur
5b0e6297bb Merge pull request #7272 from rycks/5.0_cron
FIX 'Error cronjob->run_job: Permission denied'
2017-08-22 10:43:29 +02:00
Laurent Destailleur
749355abc2 Update cron_run_jobs.php 2017-08-22 10:41:30 +02:00
Eric Seigne
64aed24539 remove comment 2017-08-20 09:45:11 +02:00
Eric Seigne
b77fe285dc fix 'Error cronjob->run_job: Permission denied' and add time and login used for debug helps 2017-08-20 09:39:51 +02:00
Laurent Destailleur
112a6f7b44 Fix travis 2017-08-17 23:51:35 +02:00
Laurent Destailleur
398733ff9a Fix syntax error 2017-08-17 23:44:16 +02:00
Laurent Destailleur
f2d5bcbbdd Merge pull request #7263 from simnandez/5.0
FIX: Bad tax calculation with expense report
2017-08-17 17:27:55 +02:00
Laurent Destailleur
323a6e34b5 Merge pull request #7250 from delcroip/patch-12
FIX: remove order rights on invoice page
2017-08-17 17:20:10 +02:00
Juanjo Menent
3330f040ba FIX: Bad tax calculation with expense report 2017-08-16 11:19:28 +02:00
Laurent Destailleur
dcd1a089b1 Merge pull request #7249 from delcroip/patch-11
Reconcile take page number into account
2017-08-11 17:08:40 +02:00
Laurent Destailleur
9ad2a9ac85 Merge pull request #7248 from fappels/4.0_fix_best_buy_price_calculation
FIX Best buy price calculation
2017-08-10 13:51:01 +02:00
Laurent Destailleur
2a59dbbc89 Merge pull request #7243 from altatof/fix_fourcard_hooks
FIX : supplier id was not passed to hooks
2017-08-10 13:44:43 +02:00
Laurent Destailleur
d5d92c6290 Update adherent_type.class.php 2017-08-10 12:59:01 +02:00
delcroix Patrick
e96eadb5e7 FIX: remove order rights on invoice page 2017-08-09 23:15:49 +02:00
delcroix Patrick
593d06e91e Reconcile take pqge number into account 2017-08-09 22:24:06 +02:00
fappels
ca3cdfabec FIX Best buy price calculation
Best buy price also depends on buy discount.
2017-08-09 14:15:26 +02:00
Laurent Destailleur
bfa8630feb Merge branch '4.0' of git@github.com:Dolibarr/dolibarr.git into 4.0 2017-08-07 20:07:36 +02:00
Laurent Destailleur
0bf4ac6fb3 Add missing field fk_supplier_proposal 2017-08-07 20:06:26 +02:00
Laurent Destailleur
0960473c9b More complete repair of unicode field 2017-08-07 15:51:30 +02:00
Laurent Destailleur
fd38a55f51 FIX amount overlap other amount when a pagebreak is done due to an image
at the bottom of page.
2017-08-07 15:49:54 +02:00
altatof
2be75420ca FIX : supplier id was not passed to hooks 2017-08-07 10:21:38 +02:00
Laurent Destailleur
1c157c7c3d Fix pb with mix collation. Add a way to fix this in repair. 2017-08-04 21:23:40 +02:00
Laurent Destailleur
e039f7cc22 Complete repair script 2017-08-04 16:37:24 +02:00
42 changed files with 485 additions and 287 deletions

View File

@@ -3,6 +3,36 @@ English Dolibarr ChangeLog
--------------------------------------------------------------
***** ChangeLog for 5.0.5 compared to 5.0.4 *****
FIX: #7075 : bad path for document
FIX: #7156
FIX: #7173
FIX: #7224
FIX: #7226
FIX: #7239
FIX: add supplierproposaldet without price (new product)
FIX: amount overlap other amount when a pagebreak is done due to an image at the bottom of page.
FIX: Bad tax calculation with expense report
FIX: Best buy price calculation
FIX: Buying prices must always be in positive value.
FIX: calculate correct remain to pay for planned bank transactions
FIX: delete linked element on facture rec
FIX: edit sociale was emptying label
FIX: Error when updating thirdparty not returned
FIX: holidays with postgresql like on rowid integer
FIX: id of user not saved when making a payment of expense report
FIX: invoice page list
FIX: invoice situation VAT total rounding into PDF crabe
FIX: PgSQL compatibility.
FIX: remove order rights on invoice page
FIX: status were wrong on product referent list
FIX: supplier id was not passed to hooks
FIX: Support of vat code when using price per customer
FIX: User id correction on holiday request
FIX: value of user id filled to 0 in llx_bank_url when recording an expense report.
FIX: we have to check if contact doesn't already exist on add_contact() function
FIX: We should be able to insert data with value '0' into const
***** ChangeLog for 5.0.4 compared to 5.0.3 *****
FIX: #5640 Prices of a predefined product/service were incorrect under certain circumstances
FIX: #6541 since 4.0.4 to 5.0.0 autofill zip/town not working
@@ -507,7 +537,7 @@ NEW: Disabled users are striked.
NEW: Enhance navigation of project module
NEW: fichinter lines ordered by rang AND DATE
NEW: hidden conf to use input file multiple from mail form
NEW: hidden feature: SUPPLIERORDER_WITH_NOPRICEDEFINED allow supplier order even if no supplier price defined
NEW: hidden feature: SUPPLIER_ORDER_WITH_NOPRICEDEFINED allow supplier order even if no supplier price defined
NEW: Hidden option MAIN_LANDING_PAGE to choose the first page to show after login works as a "global" option (llx_const) and as a "per user" option (llx_user_param).
NEW: Holiday is a now a RH module. All RH module provides by default visilibity on users of its hierarchy.
NEW: If error is reported during migration process, you can ignore it to avoid to be locked.

View File

@@ -127,7 +127,7 @@ class AdherentType extends CommonObject
$sql.= "note = '".$this->db->escape($this->note)."',";
$sql.= "vote = '".$this->vote."',";
$sql.= "mail_valid = '".$this->db->escape($this->mail_valid)."'";
$sql .= " WHERE rowid =".$this->id;
$sql.= " WHERE rowid =".$this->id;
$result = $this->db->query($sql);
if ($result)
@@ -245,7 +245,7 @@ class AdherentType extends CommonObject
$sql = "SELECT rowid, libelle";
$sql.= " FROM ".MAIN_DB_PREFIX."adherent_type";
$sql.= " WHERE entity = ".$conf->entity;
$sql.= " WHERE entity IN (".getEntity('adherent').")";
$resql=$this->db->query($sql);
if ($resql)

View File

@@ -113,7 +113,6 @@ if ($action == 'confirm_create_thirdparty' && $confirm == 'yes' && $user->rights
if ($result < 0)
{
$langs->load("errors");
$errmsg=$langs->trans($company->error);
setEventMessages($company->error, $company->errors, 'errors');
}
else
@@ -123,7 +122,7 @@ if ($action == 'confirm_create_thirdparty' && $confirm == 'yes' && $user->rights
}
else
{
$errmsg=$object->error;
setEventMessages($object->error, $object->errors, 'errors');
}
}
@@ -211,7 +210,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
{
$paymentdate=dol_mktime(0, 0, 0, $_POST["paymentmonth"], $_POST["paymentday"], $_POST["paymentyear"]);
}
$subscription=$_POST["subscription"]; // Amount of subscription
$subscription=price2num(GETPOST("subscription",'alpha')); // Amount of subscription
$label=$_POST["label"];
// Payment informations
@@ -229,6 +228,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
$error++;
$langs->load("errors");
$errmsg=$langs->trans("ErrorBadDateFormat",$langs->transnoentitiesnoconv("DateSubscription"));
setEventMessages($errmsg, null, 'errors');
$action='addsubscription';
}
if (GETPOST('end') && ! $datesubend)
@@ -236,6 +236,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
$error++;
$langs->load("errors");
$errmsg=$langs->trans("ErrorBadDateFormat",$langs->transnoentitiesnoconv("DateEndSubscription"));
setEventMessages($errmsg, null, 'errors');
$action='addsubscription';
}
if (! $datesubend)
@@ -246,16 +247,20 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
{
$error++;
$errmsg=$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DatePayment"));
setEventMessages($errmsg, null, 'errors');
$action='addsubscription';
}
$amount = price2num(GETPOST("subscription",'alpha'));
// Check if a payment is mandatory or not
if (! $error && $adht->subscription) // Member type need subscriptions
{
if (! is_numeric($_POST["subscription"]))
if (! is_numeric($amount))
{
// If field is '' or not a numeric value
$errmsg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Amount"));
setEventMessages($errmsg, null, 'errors');
$error++;
$action='addsubscription';
}
@@ -273,7 +278,11 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
{
if ($_POST["accountid"]) $errmsg=$langs->trans("ErrorDoNotProvideAccountsIfNullAmount");
}
if ($errmsg) $action='addsubscription';
if ($errmsg)
{
setEventMessages($errmsg, null, 'errors');
$action='addsubscription';
}
}
}
}
@@ -319,6 +328,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
{
$error++;
$errmsg=$db->lasterror();
setEventMessages($errmsg, null, 'errors');
}
}
else
@@ -326,14 +336,16 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
$error++;
$errmsg=$acct->error;
$errmsgs=$acct->errors;
}
setEventMessages($errmsg, $errmsgs, 'errors');
}
}
else
{
$error++;
$errmsg=$acct->error;
$errmsgs=$acct->errors;
}
setEventMessages($errmsg, $errmsgs, 'errors');
}
}
// If option choosed, we create invoice
@@ -351,6 +363,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
{
$langs->load("errors");
$errmsg=$langs->trans("ErrorMemberNotLinkedToAThirpartyLinkOrCreateFirst");
setEventMessages($errmsg, null, 'errors');
$error++;
}
}
@@ -361,6 +374,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
{
$errmsg=$customer->error;
$errmsgs=$acct->errors;
setEventMessages($errmsg, $errmsgs, 'errors');
$error++;
}
}
@@ -378,6 +392,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
{
$error++;
$errmsg='ErrorNoPaymentTermRECEPFound';
setEventMessages($errmsg, null, 'errors');
}
}
$invoice->socid=$object->fk_soc;
@@ -389,12 +404,13 @@ 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)
{
$errmsg=$invoice->error;
$errmsgs=$invoice->errors;
setEventMessages($errmsg, $errmsgs, 'errors');
$error++;
}
}
@@ -415,6 +431,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
if ($result <= 0)
{
$errmsg=$invoice->error;
setEventMessages($errmsg, null, 'errors');
$error++;
}
}
@@ -427,6 +444,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
{
$errmsg=$invoice->error;
$errmsgs=$invoice->errors;
setEventMessages($errmsg, $errmsgs, 'errors');
$error++;
}
}
@@ -454,6 +472,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
{
$errmsg=$paiement->error;
$errmsgs=$paiement->errors;
setEventMessages($errmsg, $errmsgs, 'errors');
$error++;
}
}
@@ -535,6 +554,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
if ($result < 0)
{
$errmsg=$object->error;
setEventMessages($errmsg, null, 'errors');
}
}
@@ -581,12 +601,12 @@ if ($rowid > 0)
dol_fiche_head($head, 'subscription', $langs->trans("Member"), 0, '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 +644,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>';
@@ -677,7 +697,7 @@ if ($rowid > 0)
}
}
print '</td></tr>';
// Third party Dolibarr
if (! empty($conf->societe->enabled))
{
@@ -752,7 +772,7 @@ if ($rowid > 0)
print "</div></div></div>\n";
print '<div style="clear:both"></div>';
dol_fiche_end();
print '</form>';

View File

@@ -40,7 +40,7 @@ $action = GETPOST('action','alpha');
$value = GETPOST('value','alpha');
$param = GETPOST('param','alpha');
$cancel = GETPOST('cancel','alpha');
$scandir = GETPOST('scandir','alpha');
$scandir = GETPOST('scan_dir','alpha');
$type = 'action';
@@ -286,7 +286,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
print '<td align="center">'."\n";
if ($conf->global->ACTION_EVENT_ADDON_PDF != "$name")
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=action">';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=action">';
print img_picto($langs->trans("Enabled"),'switch_on');
print '</a>';
}
@@ -299,7 +299,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
else
{
print '<td align="center">'."\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmodel&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=action">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmodel&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=action">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print "</td>";
}
@@ -311,7 +311,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
}
else
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=action"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=action"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
}
print '</td>';

View File

@@ -43,7 +43,7 @@ if (!$user->admin)
$action = GETPOST('action','alpha');
$value = GETPOST('value','alpha');
$label = GETPOST('label','alpha');
$scandir = GETPOST('scandir','alpha');
$scandir = GETPOST('scan_dir','alpha');
$type = 'bankaccount';
@@ -324,7 +324,7 @@ foreach ($dirmodels as $reldir)
print '</td>';
} else {
print '<td align="center">' . "\n";
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=set&value=' . $name . '&amp;scandir=' . $module->scandir . '&amp;label=' . urlencode($module->name) . '">' . img_picto($langs->trans("Disabled"), 'switch_off') . '</a>';
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=set&value=' . $name . '&amp;scan_dir=' . $module->scandir . '&amp;label=' . urlencode($module->name) . '">' . img_picto($langs->trans("Disabled"), 'switch_off') . '</a>';
print "</td>";
}
@@ -333,7 +333,7 @@ foreach ($dirmodels as $reldir)
if ($conf->global->BANKADDON_PDF == $name) {
print img_picto($langs->trans("Default"), 'on');
} else {
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=setdoc&value=' . $name . '&amp;scandir=' . $module->scandir . '&amp;label=' . urlencode($module->name) . '" alt="' . $langs->trans("Default") . '">' . img_picto($langs->trans("Disabled"), 'off') . '</a>';
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=setdoc&value=' . $name . '&amp;scan_dir=' . $module->scandir . '&amp;label=' . urlencode($module->name) . '" alt="' . $langs->trans("Default") . '">' . img_picto($langs->trans("Disabled"), 'off') . '</a>';
}
print '</td>';

View File

@@ -189,7 +189,7 @@ foreach ($dirmodels as $reldir)
}
else
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&value='.preg_replace('/\.php$/','',$file).'&scandir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&value='.preg_replace('/\.php$/','',$file).'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
}
print '</td>';

View File

@@ -45,7 +45,7 @@ if (! $user->admin) accessforbidden();
$action = GETPOST('action','alpha');
$value = GETPOST('value','alpha');
$label = GETPOST('label','alpha');
$scandir = GETPOST('scandir','alpha');
$scandir = GETPOST('scan_dir','alpha');
$type = 'order';
@@ -490,7 +490,7 @@ foreach ($dirmodels as $reldir)
else
{
print '<td align="center">'."\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print "</td>";
}
@@ -502,7 +502,7 @@ foreach ($dirmodels as $reldir)
}
else
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
}
print '</td>';

View File

@@ -36,7 +36,7 @@ if (!$user->admin) accessforbidden();
$action = GETPOST('action','alpha');
$value = GETPOST('value','alpha');
$label = GETPOST('label','alpha');
$scandir = GETPOST('scandir','alpha');
$scandir = GETPOST('scan_dir','alpha');
$type='contract';
if (empty($conf->global->CONTRACT_ADDON))
@@ -425,7 +425,7 @@ foreach ($dirmodels as $reldir)
else
{
print '<td align="center">'."\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print "</td>";
}
@@ -437,7 +437,7 @@ foreach ($dirmodels as $reldir)
}
else
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
}
print '</td>';

View File

@@ -44,7 +44,7 @@ if (! $user->admin)
$action=GETPOST('action','alpha');
$value=GETPOST('value','alpha');
$label = GETPOST('label','alpha');
$scandir = GETPOST('scandir','alpha');
$scandir = GETPOST('scan_dir','alpha');
$type='shipping';
if (empty($conf->global->EXPEDITION_ADDON_NUMBER))
@@ -291,7 +291,7 @@ foreach ($dirmodels as $reldir)
}
else
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmodel&amp;value='.$file.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmodel&amp;value='.$file.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">';
print img_picto($langs->trans("Disabled"),'switch_off');
print '</a>';
}
@@ -432,7 +432,7 @@ foreach ($dirmodels as $reldir)
else
{
print '<td align="center">'."\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print "</td>";
}
@@ -444,7 +444,7 @@ foreach ($dirmodels as $reldir)
}
else
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
}
print '</td>';
@@ -470,7 +470,7 @@ foreach ($dirmodels as $reldir)
print '<td align="center">';
if ($module->type == 'pdf')
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_object($langs->trans("Preview"),'sending').'</a>';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_object($langs->trans("Preview"),'sending').'</a>';
}
else
{

View File

@@ -43,7 +43,7 @@ if (! $user->admin) accessforbidden();
$action = GETPOST('action','alpha');
$value = GETPOST('value','alpha');
$label = GETPOST('label','alpha');
$scandir = GETPOST('scandir','alpha');
$scandir = GETPOST('scan_dir','alpha');
$type='expensereport';
@@ -423,7 +423,7 @@ foreach ($dirmodels as $reldir)
if (in_array($name, $def))
{
print "<td align=\"center\">\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">';
print img_picto($langs->trans("Enabled"),'switch_on');
print '</a>';
print "</td>";
@@ -431,7 +431,7 @@ foreach ($dirmodels as $reldir)
else
{
print "<td align=\"center\">\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print "</td>";
}
@@ -443,7 +443,7 @@ foreach ($dirmodels as $reldir)
}
else
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
}
print '</td>';

View File

@@ -43,7 +43,7 @@ if (! $user->admin) accessforbidden();
$action = GETPOST('action','alpha');
$value = GETPOST('value','alpha');
$label = GETPOST('label','alpha');
$scandir = GETPOST('scandir','alpha');
$scandir = GETPOST('scan_dir','alpha');
$type='ficheinter';
@@ -458,7 +458,7 @@ foreach ($dirmodels as $reldir)
if (in_array($name, $def))
{
print "<td align=\"center\">\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">';
print img_picto($langs->trans("Enabled"),'switch_on');
print '</a>';
print "</td>";
@@ -466,7 +466,7 @@ foreach ($dirmodels as $reldir)
else
{
print "<td align=\"center\">\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print "</td>";
}
@@ -478,7 +478,7 @@ foreach ($dirmodels as $reldir)
}
else
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
}
print '</td>';

View File

@@ -43,7 +43,7 @@ if (!$user->admin) accessforbidden();
$action = GETPOST('action','alpha');
$value = GETPOST('value','alpha');
$label = GETPOST('label','alpha');
$scandir = GETPOST('scandir','alpha');
$scandir = GETPOST('scan_dir','alpha');
$type='delivery';
/*
@@ -412,7 +412,7 @@ foreach ($dirmodels as $reldir)
if (in_array($name, $def))
{
print "<td align=\"center\">\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">';
print img_picto($langs->trans("Enabled"),'switch_on');
print '</a>';
print "</td>";
@@ -420,7 +420,7 @@ foreach ($dirmodels as $reldir)
else
{
print "<td align=\"center\">\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print "</td>";
}
@@ -432,7 +432,7 @@ foreach ($dirmodels as $reldir)
}
else
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
}
print '</td>';

View File

@@ -36,7 +36,7 @@ if (! $user->admin) accessforbidden();
$action = GETPOST('action','alpha');
$value = GETPOST('value','alpha');
$label = GETPOST('label','alpha');
$scandir = GETPOST('scandir','alpha');
$scandir = GETPOST('scan_dir','alpha');
$type='invoice';
if (empty($conf->global->PAYMENT_ADDON)) $conf->global->PAYMENT_ADDON = 'mod_payment_cicada.php';
@@ -201,7 +201,7 @@ foreach ($dirmodels as $reldir)
}
else
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&value='.preg_replace('/\.php$/','',$file).'&scandir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&value='.preg_replace('/\.php$/','',$file).'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
}
print '</td>';

View File

@@ -332,7 +332,7 @@ foreach ($dirmodels as $reldir)
else
{
print '<td align="center">'."\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print "</td>";
}
@@ -344,7 +344,7 @@ foreach ($dirmodels as $reldir)
}
else
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
}
print '</td>';

View File

@@ -42,7 +42,7 @@ if (! $user->admin) accessforbidden();
$action = GETPOST('action','alpha');
$value = GETPOST('value','alpha');
$label = GETPOST('label','alpha');
$scandir = GETPOST('scandir','alpha');
$scandir = GETPOST('scan_dir','alpha');
$type='propal';
/*
@@ -469,7 +469,7 @@ foreach ($dirmodels as $reldir)
else
{
print "<td align=\"center\">\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print "</td>";
}
@@ -481,7 +481,7 @@ foreach ($dirmodels as $reldir)
}
else
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
}
print '</td>';

View File

@@ -43,7 +43,7 @@ accessforbidden();
$type=GETPOST('type', 'alpha');
$value=GETPOST('value', 'alpha');
$action=GETPOST('action', 'alpha');
$scandir = GETPOST('scandir','alpha');
$scandir = GETPOST('scan_dir','alpha');
$specimenthirdparty=new Societe($db);
$specimenthirdparty->initAsSpecimen();
@@ -398,7 +398,7 @@ foreach ($dirmodels as $reldir)
//if ($conf->global->INVOICE_SUPPLIER_ADDON_PDF != "$name")
//{
// Even if choice is the default value, we allow to disable it: For supplier invoice, we accept to have no doc generation at all
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=invoice_supplier">';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=invoice_supplier">';
print img_picto($langs->trans("Enabled"),'switch_on');
print '</a>';
/*}
@@ -411,7 +411,7 @@ foreach ($dirmodels as $reldir)
else
{
print '<td align="center">'."\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=invoice_supplier">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=invoice_supplier">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print "</td>";
}
@@ -421,11 +421,11 @@ foreach ($dirmodels as $reldir)
{
//print img_picto($langs->trans("Default"),'on');
// Even if choice is the default value, we allow to disable it: For supplier invoice, we accept to have no doc generation at all
print '<a href="'.$_SERVER["PHP_SELF"].'?action=unsetdoc&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=invoice_supplier"" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"),'on').'</a>';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=unsetdoc&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=invoice_supplier"" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"),'on').'</a>';
}
else
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=invoice_supplier"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=invoice_supplier"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
}
print '</td>';

View File

@@ -44,7 +44,7 @@ $type=GETPOST('type', 'alpha');
$value=GETPOST('value', 'alpha');
$label = GETPOST('label','alpha');
$action=GETPOST('action', 'alpha');
$scandir = GETPOST('scandir','alpha');
$scandir = GETPOST('scan_dir','alpha');
$specimenthirdparty=new Societe($db);
$specimenthirdparty->initAsSpecimen();
@@ -420,7 +420,7 @@ foreach ($dirmodels as $reldir)
print '<td align="center">'."\n";
if ($conf->global->COMMANDE_SUPPLIER_ADDON_PDF != "$name")
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=order_supplier">';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=order_supplier">';
print img_picto($langs->trans("Enabled"),'switch_on');
print '</a>';
}
@@ -433,7 +433,7 @@ foreach ($dirmodels as $reldir)
else
{
print '<td align="center">'."\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=order_supplier">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=order_supplier">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print "</td>";
}
@@ -445,7 +445,7 @@ foreach ($dirmodels as $reldir)
}
else
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=order_supplier"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=order_supplier"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
}
print '</td>';

View File

@@ -39,7 +39,7 @@ if (! $user->admin) accessforbidden();
$action = GETPOST('action','alpha');
$value = GETPOST('value','alpha');
$label = GETPOST('label','alpha');
$scandir = GETPOST('scandir','alpha');
$scandir = GETPOST('scan_dir','alpha');
/*
@@ -172,7 +172,7 @@ foreach ($dirmodels as $reldir)
}
else
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&value='.preg_replace('/\.php$/','',$file).'&scandir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&value='.preg_replace('/\.php$/','',$file).'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
}
print '</td>';

View File

@@ -37,7 +37,7 @@ if (! $user->admin) accessforbidden();
$action = GETPOST('action','alpha');
$value = GETPOST('value','alpha');
$label = GETPOST('label','alpha');
$scandir = GETPOST('scandir','alpha');
$scandir = GETPOST('scan_dir','alpha');
$type='supplier_proposal';
/*
@@ -446,7 +446,7 @@ foreach ($dirmodels as $reldir)
else
{
print "<td align=\"center\">\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print "</td>";
}
@@ -458,7 +458,7 @@ foreach ($dirmodels as $reldir)
}
else
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
}
print '</td>';

View File

@@ -433,7 +433,7 @@ if ($id > 0 || ! empty($ref))
if ($object->canBeConciliated() > 0) {
// If not cash account and can be reconciliate
if ($user->rights->banque->consolidate) {
print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/bank/bankentries.php?action=reconcile'.$param.'">'.$langs->trans("Conciliate").'</a>';
print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/bank/bankentries.php?action=reconcile'.$param.(!empty($page)?('&page='.$page):'').'">'.$langs->trans("Conciliate").'</a>';
} else {
print '<a class="butActionRefused" title="'.$langs->trans("NotEnoughPermissions").'" href="#">'.$langs->trans("Conciliate").'</a>';
}

View File

@@ -2207,10 +2207,6 @@ class Form
unset($producttmpselect);
}
if (!empty($conf->global->SUPPLIER_ORDER_WITH_NOPRICEDEFINED))
{
print '<input type="hidden" id="idprod" name="idprod" value="0" />';
}
// mode=2 means suppliers products
$urloption=($socid > 0?'socid='.$socid.'&':'').'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished.'&alsoproductwithnosupplierprice='.$alsoproductwithnosupplierprice;
print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
@@ -2218,11 +2214,6 @@ class Form
}
else
{
if (!empty($conf->global->SUPPLIER_ORDER_WITH_NOPRICEDEFINED))
{
print '<input type="hidden" id="idprod" name="idprod" value="0" />';
print '<script type="text/javascript">$("#'.$htmlname.'").change(function() { $("#idprod").val($(this).val());});</script>';
}
print $this->select_produits_fournisseurs_list($socid,$selected,$htmlname,$filtertype,$filtre,'',-1,0,0,$alsoproductwithnosupplierprice);
}
}

View File

@@ -146,7 +146,7 @@ function run_sql($sqlfile,$silent=1,$entity='',$usesavepoint=1,$handler='',$oker
$buf = fgets($fp, 4096);
// Test if request must be ran only for particular database or version (if yes, we must remove the -- comment)
if (preg_match('/^--\sV(MYSQL|PGSQL|)([0-9\.]+)/i',$buf,$reg))
if (preg_match('/^--\sV(MYSQL|PGSQL)([^\s]*)/i',$buf,$reg))
{
$qualified=1;
@@ -159,20 +159,29 @@ function run_sql($sqlfile,$silent=1,$entity='',$usesavepoint=1,$handler='',$oker
// restrict on version
if ($qualified)
{
$versionrequest=explode('.',$reg[2]);
//print var_dump($versionrequest);
//print var_dump($versionarray);
if (! count($versionrequest) || ! count($versionarray) || versioncompare($versionrequest,$versionarray) > 0)
{
$qualified=0;
}
if (! empty($reg[2]))
{
if (is_numeric($reg[2])) // This is a version
{
$versionrequest=explode('.',$reg[2]);
//print var_dump($versionrequest);
//print var_dump($versionarray);
if (! count($versionrequest) || ! count($versionarray) || versioncompare($versionrequest,$versionarray) > 0)
{
$qualified=0;
}
}
else // This is a test on a constant. For example when we have -- VMYSQLUTF8UNICODE, we test constant $conf->global->UTF8UNICODE
{
if (empty($conf->db->dolibarr_main_db_collation) || ($reg[2] != strtoupper(preg_replace('/_/', '', $conf->db->dolibarr_main_db_collation)))) $qualified=0;
}
}
}
if ($qualified)
{
// Version qualified, delete SQL comments
$buf=preg_replace('/^--\sV(MYSQL|PGSQL|)([0-9\.]+)/i','',$buf);
$buf=preg_replace('/^--\sV(MYSQL|PGSQL)([^\s]*)/i','',$buf);
//print "Ligne $i qualifi?e par version: ".$buf.'<br>';
}
}
@@ -769,7 +778,7 @@ function activateModule($value,$withdeps=1)
}
$result=$objMod->init();
if ($result <= 0)
if ($result <= 0)
{
$ret['errors'][]=$objMod->error;
}
@@ -799,19 +808,19 @@ function activateModule($value,$withdeps=1)
break;
}
}
if ($activate)
{
$ret['nbmodules']+=$resarray['nbmodules'];
$ret['nbperms']+=$resarray['nbperms'];
}
else
else
{
$ret['errors'][] = $langs->trans('activateModuleDependNotSatisfied', $objMod->name, $objMod->depends[$i]);
}
}
}
if (isset($objMod->conflictwith) && is_array($objMod->conflictwith) && ! empty($objMod->conflictwith))
{
// Desactivation des modules qui entrent en conflit
@@ -830,12 +839,12 @@ function activateModule($value,$withdeps=1)
}
}
if (! count($ret['errors']))
if (! count($ret['errors']))
{
$ret['nbmodules']++;
$ret['nbperms']+=count($objMod->rights);
}
return $ret;
}
@@ -1307,7 +1316,7 @@ function showModulesExludedForExternal($modules)
//if (empty($conf->global->$moduleconst)) continue;
if (! in_array($modulename,$listofmodules)) continue;
//var_dump($modulename.'eee'.$langs->trans('Module'.$module->numero.'Name'));
if ($i > 0) $text.=', ';
else $text.=' ';
$i++;

View File

@@ -40,6 +40,7 @@
* Ex: array('disabled'=>
* Ex: array('show'=>
* Ex: array('update_textarea'=>
* Ex: array('option_disabled'=> id to disable and warning to show if we select a disabled value (this is possible when using autocomplete ajax)
* @return string Script
*/
function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLength=2, $autoselect=0, $ajaxoptions=array())
@@ -140,6 +141,7 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLengt
$("#'.$htmlname.'").val(ui.item.id).trigger("change"); // Select new value
// Disable an element
if (options.option_disabled) {
console.log("Make action option_disabled on #"+options.option_disabled+" with disabled="+ui.item.disabled)
if (ui.item.disabled) {
$("#" + options.option_disabled).prop("disabled", true);
if (options.error) {
@@ -148,28 +150,32 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLengt
if (options.warning) {
$.jnotify(options.warning, "warning", false); // Output with jnotify the warning message
}
} else {
} else {
$("#" + options.option_disabled).removeAttr("disabled");
}
}
if (options.disabled) {
console.log("Make action disabled on each "+options.option_disabled)
$.each(options.disabled, function(key, value) {
$("#" + value).prop("disabled", true);
});
}
if (options.show) {
console.log("Make action show on each "+options.show)
$.each(options.show, function(key, value) {
$("#" + value).show().trigger("show");
});
}
// Update an input
if (ui.item.update) {
console.log("Make action update on each ui.item.update")
// loop on each "update" fields
$.each(ui.item.update, function(key, value) {
$("#" + key).val(value).trigger("change");
});
}
if (ui.item.textarea) {
console.log("Make action textarea on each ui.item.textarea")
$.each(ui.item.textarea, function(key, value) {
if (typeof CKEDITOR == "object" && typeof CKEDITOR.instances != "undefined" && CKEDITOR.instances[key] != "undefined") {
CKEDITOR.instances[key].setData(value);
@@ -181,12 +187,12 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLengt
});
}
console.log("ajax_autocompleter new value selected, we trigger change on original component so field #search_'.$htmlname.'");
$("#search_'.$htmlname.'").trigger("change"); // We have changed value of the combo select, we must be sure to trigger all js hook binded on this event. This is required to trigger other javascript change method binded on original field by other code.
}
,delay: 500
}).data("ui-autocomplete")._renderItem = function( ul, item ) {
return $("<li>")
.data( "ui-autocomplete-item", item ) // jQuery UI > 1.10.0
.append( \'<a><span class="tag">\' + item.label + "</span></a>" )

View File

@@ -2,7 +2,7 @@
/* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2006-2007 Yannick Warnier <ywarnier@beeznest.org>
* Copyright (C) 2011 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012-2016 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012-2017 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2012-2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
@@ -583,11 +583,11 @@ function tax_by_date($type, $db, $y, $q, $date_start, $date_end, $modetax, $dire
{
$oldrowid=$assoc['rowid'];
$list[$assoc['rate']]['totalht'] += $assoc['total_ht'];
$list[$assoc['rate']]['vat'] += $assoc['total_vat'];
$list[$assoc['rate']]['localtax1'] += $assoc['total_localtax1'];
$list[$assoc['rate']]['localtax2'] += $assoc['total_localtax2'];
}
$list[$assoc['rate']]['vat'] = $assoc['total_vat'];
$list[$assoc['rate']]['dtotal_ttc'][] = $assoc['total_ttc'];
$list[$assoc['rate']]['dtype'][] = 'ExpenseReportPayment';
$list[$assoc['rate']]['datef'][] = $assoc['datef'];

View File

@@ -451,8 +451,6 @@ class pdf_azur extends ModelePDFPropales
// Description of product line
$curX = $this->posxdesc-1;
$showpricebeforepagebreak=1;
$pdf->startTransaction();
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxpicture-$curX,3,$curX,$curY,$hideref,$hidedesc);
$pageposafter=$pdf->getPage();

View File

@@ -26,7 +26,7 @@
* $langs
* $dateSelector
* $forceall (0 by default, 1 for supplier invoices/orders)
* $senderissupplier (0 by default, 1 for supplier invoices/orders)
* $senderissupplier (0 by default, 1 or 2 for supplier invoices/orders)
* $inputalsopricewithtax (0 by default, 1 to also show column with unit price including tax)
*/
@@ -52,7 +52,7 @@ if (in_array($object->element,array('propal', 'supplier_proposal','facture','fac
?>
<!-- BEGIN PHP TEMPLATE objectline_create.tpl.php -->
<?php
<?php
$nolinesbefore=(count($this->lines) == 0 || $forcetoshowtitlelines);
if ($nolinesbefore) {
?>
@@ -94,7 +94,7 @@ if ($nolinesbefore) {
<?php
}
else $colspan++;
if ($conf->global->MARGIN_TYPE == "1")
echo $langs->trans('BuyingPrice');
else
@@ -108,7 +108,7 @@ if ($nolinesbefore) {
?>
<td class="linecoledit" colspan="<?php echo $colspan; ?>">&nbsp;</td>
</tr>
<?php
<?php
}
?>
<tr class="pair nodrag nodrop nohoverpair<?php echo ($nolinesbefore || $object->element=='contrat')?'':' liste_titre_add'; ?>">
@@ -200,20 +200,22 @@ else {
}
else
{
// $senderissupplier=2 is same than 1 but disable test on minimum qty and disable autofill qty with minimum
if ($senderissupplier != 2)
{
$ajaxoptions=array(
'update' => array('qty'=>'qty','remise_percent' => 'discount','idprod' => 'idprod'), // html id tags that will be edited with which ajax json response key
'option_disabled' => 'addPredefinedProductButton', // html id to disable once select is done
'warning' => $langs->trans("NoPriceDefinedForThisSupplier") // translation of an error saved into var 'error'
'option_disabled' => 'idthatdoesnotexists', // html id to disable once select is done
'warning' => $langs->trans("NoPriceDefinedForThisSupplier") // translation of an error saved into var 'warning' (for exemple shown we select a disabled option into combo)
);
$alsoproductwithnosupplierprice=0;
}
else
else
{
$ajaxoptions = array();
$alsoproductwithnosupplierprice=1;
}
$form->select_produits_fournisseurs($object->socid, GETPOST('idprodfournprice'), 'idprodfournprice', '', '', $ajaxoptions, 1, $alsoproductwithnosupplierprice);
}
echo '</span>';
@@ -263,13 +265,13 @@ else {
<td class="nobottom linecoluht" align="right">
<input type="text" size="5" name="price_ht" id="price_ht" class="flat" value="<?php echo (isset($_POST["price_ht"])?GETPOST("price_ht",'alpha',2):''); ?>">
</td>
<?php if (!empty($conf->multicurrency->enabled)) { $colspan++;?>
<td class="nobottom linecoluht_currency" align="right">
<input type="text" size="5" name="multicurrency_price_ht" id="multicurrency_price_ht" class="flat" value="<?php echo (isset($_POST["multicurrency_price_ht"])?GETPOST("multicurrency_price_ht",'alpha',2):''); ?>">
</td>
<?php } ?>
<?php if (! empty($inputalsopricewithtax)) { ?>
<td class="nobottom linecoluttc" align="right">
<input type="text" size="5" name="price_ttc" id="price_ttc" class="flat" value="<?php echo (isset($_POST["price_ttc"])?GETPOST("price_ttc",'alpha',2):''); ?>">
@@ -306,7 +308,7 @@ else {
<?php
$coldisplay++;
}
if ($user->rights->margins->creer)
{
if (! empty($conf->global->DISPLAY_MARGIN_RATES))
@@ -561,9 +563,9 @@ jQuery(document).ready(function() {
$("#idprod, #idprodfournprice").change(function()
{
console.log("#idprod, #idprodfournprice change triggered");
setforpredef(); // TODO Keep vat combo visible and set it to first entry into list that match result of get_default_tva
jQuery('#trlinefordates').show();
<?php
@@ -584,13 +586,13 @@ jQuery(document).ready(function() {
var defaultkey = '';
var defaultprice = '';
var bestpricefound = 0;
var bestpriceid = 0; var bestpricevalue = 0;
var pmppriceid = 0; var pmppricevalue = 0;
var costpriceid = 0; var costpricevalue = 0;
/* setup of margin calculation */
var defaultbuyprice = '<?php
var defaultbuyprice = '<?php
if (isset($conf->global->MARGIN_TYPE))
{
if ($conf->global->MARGIN_TYPE == '1') print 'bestsupplierprice';
@@ -598,7 +600,7 @@ jQuery(document).ready(function() {
if ($conf->global->MARGIN_TYPE == 'costprice') print 'costprice';
} ?>';
console.log("we will set the field for margin. defaultbuyprice="+defaultbuyprice);
var i = 0;
$(data).each(function() {
if (this.id != 'pmpprice' && this.id != 'costprice')
@@ -615,7 +617,7 @@ jQuery(document).ready(function() {
//console.log("id="+this.id+"-price="+this.price);
if ('pmp' == defaultbuyprice || 'costprice' == defaultbuyprice)
{
if (this.price > 0) {
if (this.price > 0) {
defaultkey = this.id; defaultprice = this.price; pmppriceid = this.id; pmppricevalue = this.price;
//console.log("pmppricevalue="+pmppricevalue);
}
@@ -634,22 +636,22 @@ jQuery(document).ready(function() {
options += '<option value="'+this.id+'" price="'+this.price+'">'+this.label+'</option>';
});
options += '<option value="inputprice" price="'+defaultprice+'"><?php echo $langs->trans("InputPrice"); ?></option>';
console.log("finally selected defaultkey="+defaultkey+" defaultprice="+defaultprice);
$("#fournprice_predef").html(options).show();
if (defaultkey != '')
{
$("#fournprice_predef").val(defaultkey);
}
/* At loading, no product are yet selected, so we hide field of buying_price */
$("#buying_price").hide();
/* Define default price at loading */
var defaultprice = $("#fournprice_predef").find('option:selected').attr("price");
$("#buying_price").val(defaultprice);
$("#fournprice_predef").change(function() {
console.log("change on fournprice_predef");
/* Hide field buying_price according to choice into list (if 'inputprice' or not) */

View File

@@ -42,6 +42,8 @@ $typeconst=array('yesno','texte','chaine');
$action = GETPOST('action','alpha');
$value = GETPOST('value');
$label = GETPOST('label','alpha');
$scandir = GETPOST('scan_dir','alpha');
$type='donation';
@@ -397,14 +399,14 @@ if (is_resource($handle))
else
{
print "<td align=\"center\">\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Enabled"),'switch_on').'</a>';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Enabled"),'switch_on').'</a>';
print '</td>';
}
}
else
{
print "<td align=\"center\">\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print "</td>";
}
@@ -418,9 +420,9 @@ if (is_resource($handle))
else
{
print "<td align=\"center\">";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
print '</td>';
}
}
// Info
$htmltooltip = ''.$langs->trans("Name").': '.$module->name;

View File

@@ -66,7 +66,7 @@ $hookmanager->initHooks(array('suppliercard','globalcard'));
* Action
*/
$parameters=array('socid'=>$socid);
$parameters=array('id'=>$id);
$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');

View File

@@ -1157,7 +1157,7 @@ class CommandeFournisseur extends CommonOrder
// insert products details into database
for ($i=0;$i<$num;$i++)
{
$result = $this->addline( // This include test on qty if option SUPPLIERORDER_WITH_NOPRICEDEFINED is not set
$result = $this->addline( // This include test on qty if option SUPPLIER_ORDER_WITH_NOPRICEDEFINED is not set
$this->lines[$i]->desc,
$this->lines[$i]->subprice,
$this->lines[$i]->qty,
@@ -1393,7 +1393,7 @@ class CommandeFournisseur extends CommonOrder
if ($fk_product > 0)
{
if (empty($conf->global->SUPPLIERORDER_WITH_NOPRICEDEFINED))
if (empty($conf->global->SUPPLIER_ORDER_WITH_NOPRICEDEFINED))
{
// Check quantity is enough
dol_syslog(get_class($this)."::addline we check supplier prices fk_product=".$fk_product." fk_prod_fourn_price=".$fk_prod_fourn_price." qty=".$qty." fourn_ref=".$fourn_ref);
@@ -2832,8 +2832,9 @@ class CommandeFournisseur extends CommonOrder
$supplierorderdispatch = new CommandeFournisseurDispatch($this->db);
$filter=array('t.fk_commande'=>$this->id);
if (! empty($conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS)) {
$filter['t.status']=1;
$filter['t.status']=1; // Restrict to lines with status validated
}
$ret=$supplierorderdispatch->fetchAll('','',0,0,$filter);
if ($ret<0)
{
@@ -2844,20 +2845,27 @@ class CommandeFournisseur extends CommonOrder
{
if (is_array($supplierorderdispatch->lines) && count($supplierorderdispatch->lines)>0)
{
//Build array with quantity deliverd by product
$date_liv = dol_now();
// Build array with quantity deliverd by product
foreach($supplierorderdispatch->lines as $line) {
$qtydelivered[$line->fk_product]+=$line->qty;
}
foreach($this->lines as $line) {
$qtywished[$line->fk_product]+=$line->qty;
}
$date_liv = dol_now();
//Compare array
$diff_array=array_diff_assoc($qtydelivered,$qtywished);
$diff_array=array_diff_assoc($qtydelivered,$qtywished); // Warning: $diff_array is done only on common keys.
$keysinwishednotindelivered=array_diff(array_keys($qtywished),array_keys($qtydelivered)); // To check we also have same number of keys
$keysindeliverednotinwished=array_diff(array_keys($qtydelivered),array_keys($qtywished)); // To check we also have same number of keys
/*var_dump(array_keys($qtydelivered));
var_dump(array_keys($qtywished));
var_dump($diff_array);
var_dump($keysinwishednotindelivered);
var_dump($keysindeliverednotinwished);
exit;*/
if (count($diff_array)==0) //No diff => mean everythings is received
if (count($diff_array)==0 && count($keysinwishednotindelivered)==0 && count($keysindeliverednotinwished)==0) //No diff => mean everythings is received
{
if ($closeopenorder)
{

View File

@@ -588,7 +588,8 @@ class ProductFournisseur extends Product
foreach($record_array as $record)
{
$fourn_price = $record["price"];
$fourn_unitprice = $record["unitprice"];
// discount calculated buy price
$fourn_unitprice = $record["unitprice"] * (1 - $record["remise_percent"] / 100) + $record["unitcharges"] - $record["remise"];
if (!empty($conf->dynamicprices->enabled) && !empty($record["fk_supplier_price_expression"])) {
$prod_supplier = new ProductFournisseur($this->db);
$prod_supplier->product_fourn_price_id = $record["product_fourn_price_id"];
@@ -620,7 +621,7 @@ class ProductFournisseur extends Product
$this->fourn_qty = $record["quantity"];
$this->fourn_remise_percent = $record["remise_percent"];
$this->fourn_remise = $record["remise"];
$this->fourn_unitprice = $fourn_unitprice;
$this->fourn_unitprice = $record["unitprice"];
$this->fourn_charges = $record["charges"]; // deprecated
$this->fourn_unitcharges = $record["unitcharges"]; // deprecated
$this->fourn_tva_tx = $record["tva_tx"];
@@ -629,7 +630,7 @@ class ProductFournisseur extends Product
$this->delivery_time_days = $record["delivery_time_days"];
$this->fk_supplier_price_expression = $record["fk_supplier_price_expression"];
$this->id = $prodid;
$min = $this->fourn_unitprice;
$min = $fourn_unitprice;
}
}
}

View File

@@ -346,21 +346,29 @@ if (empty($reshook))
{
$productsupplier = new ProductFournisseur($db);
if (empty($conf->global->SUPPLIER_ORDER_WITH_NOPRICEDEFINED))
if (empty($conf->global->SUPPLIER_ORDER_WITH_NOPRICEDEFINED)) // TODO this test seems useless
{
$idprod=0;
if (GETPOST('idprodfournprice') == -1 || GETPOST('idprodfournprice') == '') $idprod=-99; // Same behaviour than with combolist. When not select idprodfournprice is now -99 (to avoid conflict with next action that may return -1, -2, ...)
}
if (GETPOST('idprodfournprice') > 0)
if (preg_match('/^idprod_([0-9]+)$/',GETPOST('idprodfournprice'), $reg))
{
$idprod=$reg[1];
$res=$productsupplier->fetch($idprod);
// Call to init properties of $productsupplier
// So if a supplier price already exists for another thirdparty (first one found), we use it as reference price
$productsupplier->get_buyprice(0, -1, $idprod, 'none'); // We force qty to -1 to be sure to find if a supplier price exist
}
elseif (GETPOST('idprodfournprice') > 0)
{
$idprod=$productsupplier->get_buyprice(GETPOST('idprodfournprice'), $qty); // Just to see if a price exists for the quantity. Not used to found vat.
$qtytosearch=$qty; // Just to see if a price exists for the quantity. Not used to found vat.
//$qtytosearch=-1; // We force qty to -1 to be sure to find if a supplier price exist
$idprod=$productsupplier->get_buyprice(GETPOST('idprodfournprice'), $qtytosearch);
$res=$productsupplier->fetch($idprod);
}
if ($idprod > 0)
{
$res=$productsupplier->fetch($idprod);
$label = $productsupplier->label;
$desc = $productsupplier->description;
@@ -381,8 +389,8 @@ if (empty($reshook))
$tva_tx,
$localtax1_tx,
$localtax2_tx,
$idprod,
$productsupplier->id,
GETPOST('idprodfournprice'),
$productsupplier->fourn_ref,
$remise_percent,
'HT',
@@ -2074,6 +2082,7 @@ elseif (! empty($object->id))
// Add free products/services form
global $forceall, $senderissupplier, $dateSelector;
$forceall=1; $senderissupplier=1; $dateSelector=0;
if (! empty($conf->global->SUPPLIER_ORDER_WITH_NOPRICEDEFINED)) $senderissupplier=2; // $senderissupplier=2 is same than 1 but disable test on minimum qty and disable autofill qty with minimum.
// Show object lines
$inputalsopricewithtax=0;

View File

@@ -28,6 +28,7 @@
* \ingroup commande
* \brief Page to dispatch receiving
*/
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT . '/core/modules/supplier_order/modules_commandefournisseur.php';
require_once DOL_DOCUMENT_ROOT . '/product/stock/class/entrepot.class.php';
@@ -84,17 +85,33 @@ if ($id > 0 || ! empty($ref)) {
* Actions
*/
if ($action == 'checkdispatchline' && ! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande->receptionner)) || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande_advance->check)))) {
if ($action == 'checkdispatchline' && ! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande->receptionner)) || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande_advance->check))))
{
$error=0;
$supplierorderdispatch = new CommandeFournisseurDispatch($db);
$db->begin();
$result = $supplierorderdispatch->fetch($lineid);
if (! $result)
dol_print_error($db);
$result = $supplierorderdispatch->setStatut(1);
if ($result < 0) {
{
$error++;
setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors, 'errors');
$error ++;
$action = '';
} else {
}
if (! $error)
{
$result = $supplierorderdispatch->setStatut(1);
if ($result < 0) {
setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors, 'errors');
$error++;
$action = '';
}
}
if (! $error)
{
$result = $object->calcAndSetStatusDispatch($user);
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
@@ -102,19 +119,42 @@ if ($action == 'checkdispatchline' && ! ((empty($conf->global->MAIN_USE_ADVANCED
$action = '';
}
}
if (! $error)
{
$db->commit();
}
else
{
$db->rollback();
}
}
if ($action == 'uncheckdispatchline' && ! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande->receptionner)) || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande_advance->check)))) {
if ($action == 'uncheckdispatchline' && ! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande->receptionner)) || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande_advance->check))))
{
$error=0;
$supplierorderdispatch = new CommandeFournisseurDispatch($db);
$db->begin();
$result = $supplierorderdispatch->fetch($lineid);
if (! $result)
dol_print_error($db);
$result = $supplierorderdispatch->setStatut(0);
if ($result < 0) {
{
$error++;
setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors, 'errors');
$error ++;
$action = '';
} else {
}
if (! $error)
{
$result = $supplierorderdispatch->setStatut(0);
if ($result < 0) {
setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors, 'errors');
$error ++;
$action = '';
}
}
if (! $error)
{
$result = $object->calcAndSetStatusDispatch($user);
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
@@ -122,19 +162,42 @@ if ($action == 'uncheckdispatchline' && ! ((empty($conf->global->MAIN_USE_ADVANC
$action = '';
}
}
if (! $error)
{
$db->commit();
}
else
{
$db->rollback();
}
}
if ($action == 'denydispatchline' && ! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande->receptionner)) || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande_advance->check)))) {
if ($action == 'denydispatchline' && ! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande->receptionner)) || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande_advance->check))))
{
$error=0;
$supplierorderdispatch = new CommandeFournisseurDispatch($db);
$db->begin();
$result = $supplierorderdispatch->fetch($lineid);
if (! $result)
dol_print_error($db);
$result = $supplierorderdispatch->setStatut(2);
if ($result < 0) {
{
$error++;
setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors, 'errors');
$error ++;
$action = '';
} else {
}
if (! $error)
{
$result = $supplierorderdispatch->setStatut(2);
if ($result < 0) {
setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors, 'errors');
$error ++;
$action = '';
}
}
if (! $error)
{
$result = $object->calcAndSetStatusDispatch($user);
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
@@ -142,6 +205,14 @@ if ($action == 'denydispatchline' && ! ((empty($conf->global->MAIN_USE_ADVANCED_
$action = '';
}
}
if (! $error)
{
$db->commit();
}
else
{
$db->rollback();
}
}
if ($action == 'dispatch' && $user->rights->fournisseur->commande->receptionner) {
@@ -150,10 +221,10 @@ if ($action == 'dispatch' && $user->rights->fournisseur->commande->receptionner)
$db->begin();
$pos = 0;
foreach ($_POST as $key => $value)
foreach ($_POST as $key => $value)
{
// without batch module enabled
if (preg_match('/^product_([0-9]+)_([0-9]+)$/i', $key, $reg))
if (preg_match('/^product_([0-9]+)_([0-9]+)$/i', $key, $reg))
{
$pos ++;
@@ -184,7 +255,7 @@ if ($action == 'dispatch' && $user->rights->fournisseur->commande->receptionner)
}
}
// with batch module enabled
if (preg_match('/^product_batch_([0-9]+)_([0-9]+)$/i', $key, $reg))
if (preg_match('/^product_batch_([0-9]+)_([0-9]+)$/i', $key, $reg))
{
$pos ++;
@@ -286,11 +357,11 @@ if ($id > 0 || ! empty($ref)) {
$title = $langs->trans("SupplierOrder");
dol_fiche_head($head, 'dispatch', $title, 0, 'order');
// 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, 0, 'string', '', 0, 1);
@@ -331,14 +402,14 @@ if ($id > 0 || ! empty($ref)) {
}
}
$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="underbanner clearboth"></div>';
print '<table class="border" width="100%">';
// Date
@@ -362,7 +433,7 @@ if ($id > 0 || ! empty($ref)) {
print "</table>";
print '</div>';
// if ($mesg) print $mesg;
print '<br>';
@@ -382,7 +453,7 @@ if ($id > 0 || ! empty($ref)) {
print '<form method="POST" action="dispatch.php?id=' . $object->id . '">';
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
print '<input type="hidden" name="action" value="dispatch">';
print '<div class="div-table-responsive">';
print '<table class="noborder" width="100%">';
@@ -585,10 +656,10 @@ if ($id > 0 || ! empty($ref)) {
print '</div>';
print "<br>\n";
if ($nbproduct)
if ($nbproduct)
{
$checkboxlabel=$langs->trans("CloseReceivedSupplierOrdersAutomatically", $langs->transnoentitiesnoconv($object->statuts[5]));
print '<br><div class="center">';
print $langs->trans("Comment") . ' : ';
print '<input type="text" class="minwidth400" maxlength="128" name="comment" value="';
@@ -597,7 +668,7 @@ if ($id > 0 || ! empty($ref)) {
print '" class="flat"><br>';
print '<input type="checkbox" checked="checked" name="closeopenorder"> '.$checkboxlabel;
print '<br><input type="submit" class="button" value="' . $langs->trans("DispatchVerb") . '"';
if (count($listwarehouses) <= 0)
print ' disabled';
@@ -609,7 +680,7 @@ if ($id > 0 || ! empty($ref)) {
if (! $nbproduct) {
if (empty($conf->global->SUPPLIER_ORDER_DISABLE_STOCK_DISPATCH_WHEN_TOTAL_REACHED))
print '<div class="opacitymedium">'.$langs->trans("NoPredefinedProductToDispatch").'</div>'; // No predefined line at all
else
else
print '<div class="opacitymedium">'.$langs->trans("NoMorePredefinedProductToDispatch").'</div>'; // No predefined line that remain to be dispatched.
}
@@ -618,7 +689,7 @@ if ($id > 0 || ! empty($ref)) {
dol_fiche_end();
// List of lines already dispatched
$sql = "SELECT p.ref, p.label,";
$sql .= " e.rowid as warehouse_id, e.label as entrepot,";
@@ -699,7 +770,8 @@ if ($id > 0 || ! empty($ref)) {
// Add button to check/uncheck disaptching
print '<td align="center">';
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande->receptionner)) || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande_advance->check))) {
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande->receptionner)) || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande_advance->check)))
{
if (empty($objp->status)) {
print '<a class="button buttonRefused" href="#">' . $langs->trans("Approve") . '</a>';
print '<a class="button buttonRefused" href="#">' . $langs->trans("Deny") . '</a>';

View File

@@ -201,7 +201,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);
}
@@ -269,7 +269,7 @@ if (empty($reshook))
}
// Set supplier ref
if ($action == 'setref_supplier' && $user->rights->fournisseur->commande->creer)
if ($action == 'setref_supplier' && $user->rights->fournisseur->facture->creer)
{
$object->ref_supplier = GETPOST('ref_supplier', 'alpha');
@@ -297,13 +297,13 @@ if (empty($reshook))
}
// payments conditions
if ($action == 'setconditions' && $user->rights->fournisseur->commande->creer)
if ($action == 'setconditions' && $user->rights->fournisseur->facture->creer)
{
$result=$object->setPaymentTerms(GETPOST('cond_reglement_id','int'));
}
// payment mode
else if ($action == 'setmode' && $user->rights->fournisseur->commande->creer)
else if ($action == 'setmode' && $user->rights->fournisseur->facture->creer)
{
$result = $object->setPaymentMethods(GETPOST('mode_reglement_id','int'));
}
@@ -945,21 +945,30 @@ 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 ''
{
$idprod=0;
$productsupplier=new ProductFournisseur($db);
if (GETPOST('idprodfournprice') == -1 || GETPOST('idprodfournprice') == '') $idprod=-2; // Same behaviour than with combolist. When not select idprodfournprice is now -2 (to avoid conflict with next action that may return -1)
$idprod=0;
if (GETPOST('idprodfournprice') == -1 || GETPOST('idprodfournprice') == '') $idprod=-99; // Same behaviour than with combolist. When not select idprodfournprice is now -99 (to avoid conflict with next action that may return -1, -2, ...)
if (GETPOST('idprodfournprice') > 0)
if (preg_match('/^idprod_([0-9]+)$/',GETPOST('idprodfournprice'), $reg))
{
$idprod=$reg[1];
$res=$productsupplier->fetch($idprod);
// Call to init properties of $productsupplier
// So if a supplier price already exists for another thirdparty (first one found), we use it as reference price
$productsupplier->get_buyprice(0, -1, $idprod, 'none'); // We force qty to -1 to be sure to find if a supplier price exist
}
elseif (GETPOST('idprodfournprice') > 0)
{
$idprod=$productsupplier->get_buyprice(GETPOST('idprodfournprice'), $qty); // Just to see if a price exists for the quantity. Not used to found vat.
$qtytosearch=$qty; // Just to see if a price exists for the quantity. Not used to found vat.
//$qtytosearch=-1; // We force qty to -1 to be sure to find if a supplier price exist
$idprod=$productsupplier->get_buyprice(GETPOST('idprodfournprice'), $qtytosearch);
$res=$productsupplier->fetch($idprod);
}
//Replaces $fk_unit with the product's
if ($idprod > 0)
{
$result=$productsupplier->fetch($idprod);
$label = $productsupplier->label;
$desc = $productsupplier->description;
@@ -974,10 +983,29 @@ if (empty($reshook))
$type = $productsupplier->type;
$price_base_type = 'HT';
// TODO Save the product supplier ref into database into field ref_supplier (must rename field ref into ref_supplier first)
$result=$object->addline($desc, $productsupplier->fourn_pu, $tva_tx, $localtax1_tx, $localtax2_tx, $qty, $idprod, $remise_percent, $date_start, $date_end, 0, $tva_npr, $price_base_type, $type, -1, 0, $array_options, $productsupplier->fk_unit);
// TODO Save the product supplier ref into database (like done for supplier propal and order) into field ref_supplier (must rename field ref into ref_supplier first)
$result=$object->addline(
$desc,
$productsupplier->fourn_pu,
$tva_tx,
$localtax1_tx,
$localtax2_tx,
$qty,
$idprod,
$remise_percent,
$date_start,
$date_end,
0,
$tva_npr,
$price_base_type,
$type,
-1,
0,
$array_options,
$productsupplier->fk_unit
);
}
if ($idprod == -2 || $idprod == 0)
if ($idprod == -99 || $idprod == 0)
{
// Product not selected
$error++;
@@ -1019,7 +1047,7 @@ if (empty($reshook))
}
$price_base_type = 'HT';
$pu_ht_devise = price2num($price_ht_devise, 'MU');
$result=$object->addline($product_desc, $pu_ht, $tva_tx, $localtax1_tx, $localtax2_tx, $qty, 0, $remise_percent, $date_start, $date_end, 0, $tva_npr, $price_base_type, $type, -1, 0, $array_options, $fk_unit, 0, $pu_ht_devise);
}
@@ -1518,7 +1546,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' : '') . '> ';
@@ -1548,12 +1576,12 @@ if ($action == 'create')
}
}
*/
/* Not yet supporter for supplier
if ($societe->id > 0)
{
// 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">';
@@ -1603,7 +1631,7 @@ if ($action == 'create')
if ($societe->id > 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' : '');
@@ -1639,12 +1667,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 '&nbsp;&nbsp;&nbsp; <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>&nbsp;&nbsp;&nbsp; <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>';
}
}
@@ -1989,8 +2017,8 @@ else
$morehtmlref='<div class="refidno">';
// Ref supplier
$morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', 0, 1);
$morehtmlref.=$form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', null, null, '', 1);
$morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->facture->creer, 'string', '', 0, 1);
$morehtmlref.=$form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->facture->creer, 'string', '', null, null, '', 1);
// Thirdparty
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
// Project
@@ -1998,7 +2026,7 @@ else
{
$langs->load("projects");
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
if ($user->rights->fournisseur->commande->creer)
if ($user->rights->fournisseur->facture->creer)
{
if ($action != 'classify')
$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
@@ -2029,7 +2057,7 @@ else
$object->totalpaye = $alreadypaid; // To give a chance to dol_banner_tab to use already paid amount to show correct status
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">';
@@ -2229,9 +2257,9 @@ else
// 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">';
@@ -2245,12 +2273,12 @@ else
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>' . 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 height="10">' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . '</td>';
print '<td>' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>';
@@ -2288,13 +2316,13 @@ else
print '<tr><td>'.$langs->trans('AmountTTC').'</td><td colspan="3">'.price($object->total_ttc,1,$langs,0,-1,-1,$conf->currency).'</td></tr>';
print '</table>';
/*
* List of payments
*/
$totalpaye = 0;
$sign = 1;
if ($object->type == FactureFournisseur::TYPE_CREDIT_NOTE) $sign = - 1;
@@ -2387,9 +2415,9 @@ else
{
print '<tr><td colspan="'.$nbcols.'" align="right">'.$langs->trans('AlreadyPaid').' :</td><td align="right">'.price($totalpaye).'</td><td></td></tr>';
print '<tr><td colspan="'.$nbcols.'" align="right">'.$langs->trans("Billed").' :</td><td align="right">'.price($object->total_ttc).'</td><td></td></tr>';
$resteapayer = $object->total_ttc - $totalpaye;
print '<tr><td colspan="'.$nbcols.'" align="right">'.$langs->trans('RemainderToPay').' :</td>';
print '<td align="right"'.($resteapayer?' class="amountremaintopay"':'').'>'.price($resteapayer).'</td><td></td></tr>';
}
@@ -2402,7 +2430,7 @@ else
dol_print_error($db);
}
if ($object->type != FactureFournisseur::TYPE_CREDIT_NOTE)
if ($object->type != FactureFournisseur::TYPE_CREDIT_NOTE)
{
// Total already paid
print '<tr><td colspan="' . $nbcols . '" align="right">';
@@ -2453,7 +2481,7 @@ else
dol_print_error($db);
}
*/
// Paye partiellement 'escompte'
if (($object->statut == FactureFournisseur::STATUS_CLOSED || $object->statut == FactureFournisseur::STATUS_ABANDONED) && $object->close_code == 'discount_vat') {
print '<tr><td colspan="' . $nbcols . '" align="right" class="nowrap">';
@@ -2502,7 +2530,7 @@ else
print ' :</td>';
print '<td align="right"'.($resteapayeraffiche?' class="amountremaintopay"':$cssforamountpaymentcomplete).'>' . price($resteapayeraffiche) . '</td>';
print '<td class="nowrap">&nbsp;</td></tr>';
}
}
else // Credit note
{
// Total already paid back
@@ -2534,9 +2562,9 @@ else
print '</div>';
print '</div>';
print '</div>';
print '<div class="clearboth"></div><br>';
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{
$blocname = 'contacts';

View File

@@ -34,6 +34,7 @@ ALTER TABLE llx_product_customer_price ADD COLUMN localtax1_type varchar(10) NO
ALTER TABLE llx_product_customer_price ADD COLUMN localtax2_type varchar(10) NOT NULL DEFAULT '0' after localtax2_tx;
ALTER TABLE llx_product_customer_price_log ADD COLUMN localtax1_type varchar(10) NOT NULL DEFAULT '0' after localtax1_tx;
ALTER TABLE llx_product_customer_price_log ADD COLUMN localtax2_type varchar(10) NOT NULL DEFAULT '0' after localtax2_tx;
ALTER TABLE llx_supplier_proposaldet CHANGE COLUMN fk_askpricesupplier fk_supplier_proposal integer NOT NULL;
ALTER TABLE llx_opensurvey_sondage ADD COLUMN status integer DEFAULT 1 after date_fin;

View File

@@ -13,11 +13,28 @@
-- flush privileges;
-- Requests to change character set and collation of a column
-- Request to change default pagecode + colation of database
-- ALTER DATABASE name_of_database CHARACTER SET utf8 COLLATE utf8_unicode_ci;
-- ALTER TABLE llx_accounting_account MODIFY account_number VARCHAR(20) CHARACTER SET utf8;
-- ALTER TABLE llx_accounting_account MODIFY account_number VARCHAR(20) COLLATE utf8_unicode_ci;
-- You can check with "show full columns from llx_accountingaccount";
-- Request to change default pagecode + colation of table
-- ALTER TABLE name_of_table CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
-- Request to change character set and collation of a varchar column.
-- utf8 and utf8_unicode_ci is recommended (or even better utf8mb4 and utf8mb4_unicode_ci with mysql 5.5.3+)
-- ALTER TABLE name_of_table MODIFY field VARCHAR(20) CHARACTER SET utf8;
-- ALTER TABLE name_of_table MODIFY field VARCHAR(20) COLLATE utf8_unicode_ci;
-- You can check with 'show full columns from mytablename';
-- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_account MODIFY account_number VARCHAR(20) CHARACTER SET utf8;
-- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_account MODIFY account_number VARCHAR(20) COLLATE utf8_unicode_ci;
-- VMYSQLUTF8UNICODECI ALTER TABLE llx_stock_mouvement MODIFY batch VARCHAR(30) CHARACTER SET utf8;
-- VMYSQLUTF8UNICODECI ALTER TABLE llx_stock_mouvement MODIFY batch VARCHAR(30) COLLATE utf8_unicode_ci;
-- VMYSQLUTF8UNICODECI ALTER TABLE llx_product_lot MODIFY batch VARCHAR(30) CHARACTER SET utf8;
-- VMYSQLUTF8UNICODECI ALTER TABLE llx_product_lot MODIFY batch VARCHAR(30) COLLATE utf8_unicode_ci;
-- VMYSQLUTF8UNICODECI ALTER TABLE llx_product_batchlot MODIFY batch VARCHAR(30) CHARACTER SET utf8;
-- VMYSQLUTF8UNICODECI ALTER TABLE llx_product_batch MODIFY batch VARCHAR(30) COLLATE utf8_unicode_ci;

View File

@@ -46,7 +46,7 @@ $action = GETPOST('action','alpha');
$value = GETPOST('value','alpha');
$type = GETPOST('type','alpha');
$label = GETPOST('label','alpha');
$scandir = GETPOST('scandir','alpha');
$scandir = GETPOST('scan_dir','alpha');
// Pricing Rules
$select_pricing_rules=array(
@@ -479,7 +479,7 @@ if ($resql)
if (in_array($name, $def))
{
print "<td align=\"center\">\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&type=product&scandir='.$module->scandir.'&label='.urlencode($module->name).'">';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&type=product&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">';
print img_picto($langs->trans("Enabled"),'switch_on');
print '</a>';
print "</td>";
@@ -495,7 +495,7 @@ if ($resql)
else
{
print "<td align=\"center\">\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&type=product&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&type=product&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print "</td>";
}
}

View File

@@ -169,12 +169,12 @@ class Productcustomerprice extends CommonObject
$sql .= " " . (empty($this->price_min_ttc) ? '0' : "'" . $this->price_min_ttc . "'") . ",";
$sql .= " " . (! isset($this->price_base_type) ? 'NULL' : "'" . $this->db->escape($this->price_base_type) . "'") . ",";
$sql .= " ".($this->default_vat_code ? "'".$this->db->escape($this->default_vat_code)."'" : "null").",";
$sql .= " " . (! isset($this->tva_tx) ? 'NULL' : "'" . $this->tva_tx . "'") . ",";
$sql .= " " . (! isset($this->tva_tx) ? 'NULL' : (empty($this->tva_tx)?0:$this->tva_tx)) . ",";
$sql .= " " . (! isset($this->recuperableonly) ? 'NULL' : "'" . $this->recuperableonly . "'") . ",";
$sql .= " " . (empty($this->localtax1_type) ? "'0'" : "'" . $this->localtax1_type . "'") . ",";
$sql .= " " . (! isset($this->localtax1_tx) ? 'NULL' : "'" . $this->localtax1_tx . "'") . ",";
$sql .= " " . (! isset($this->localtax1_tx) ? 'NULL' : (empty($this->localtax1_tx)?0:$this->localtax1_tx)) . ",";
$sql .= " " . (empty($this->localtax2_type) ? "'0'" : "'" . $this->localtax2_type . "'") . ",";
$sql .= " " . (! isset($this->localtax2_tx) ? 'NULL' : "'" . $this->localtax2_tx . "'") . ",";
$sql .= " " . (! isset($this->localtax2_tx) ? 'NULL' : (empty($this->localtax2_tx)?0:$this->localtax2_tx)) . ",";
$sql .= " " . $user->id . ",";
$sql .= " " . (! isset($this->import_key) ? 'NULL' : "'" . $this->db->escape($this->import_key) . "'") . "";
$sql .= ")";
@@ -656,10 +656,10 @@ class Productcustomerprice extends CommonObject
$sql .= " price_min_ttc=" . (isset($this->price_min_ttc) ? $this->price_min_ttc : "null") . ",";
$sql .= " price_base_type=" . (isset($this->price_base_type) ? "'" . $this->db->escape($this->price_base_type) . "'" : "null") . ",";
$sql .= " default_vat_code = ".($this->default_vat_code ? "'".$this->db->escape($this->default_vat_code)."'" : "null").",";
$sql .= " tva_tx=" . (isset($this->tva_tx) ? $this->tva_tx : "null") . ",";
$sql .= " tva_tx=" . (isset($this->tva_tx) ? (empty($this->tva_tx)?0:$this->tva_tx) : "null") . ",";
$sql .= " recuperableonly=" . (isset($this->recuperableonly) ? $this->recuperableonly : "null") . ",";
$sql .= " localtax1_tx=" . (isset($this->localtax1_tx) ? $this->localtax1_tx : "null") . ",";
$sql .= " localtax2_tx=" . (isset($this->localtax2_tx) ? $this->localtax2_tx : "null") . ",";
$sql .= " localtax1_tx=" . (isset($this->localtax1_tx) ? (empty($this->localtax1_tx)?0:$this->localtax1_tx) : "null") . ",";
$sql .= " localtax2_tx=" . (isset($this->localtax2_tx) ? (empty($this->localtax2_tx)?0:$this->localtax2_tx) : "null") . ",";
$sql .= " localtax1_type=" . (! empty($this->localtax1_type) ? "'".$this->localtax1_type."'": "'0'") . ",";
$sql .= " localtax2_type=" . (! empty($this->localtax2_type) ? "'".$this->localtax2_type."'": "'0'") . ",";
$sql .= " fk_user=" . $user->id . ",";

View File

@@ -43,7 +43,7 @@ if (!$user->admin) accessforbidden();
$value = GETPOST('value','alpha');
$action = GETPOST('action','alpha');
$label = GETPOST('label','alpha');
$scandir = GETPOST('scandir','alpha');
$scandir = GETPOST('scan_dir','alpha');
$type='project';
@@ -672,7 +672,7 @@ foreach ($dirmodels as $reldir)
if (in_array($name, $def))
{
print "<td align=\"center\">\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">';
print img_picto($langs->trans("Enabled"),'switch_on');
print '</a>';
print "</td>";
@@ -680,7 +680,7 @@ foreach ($dirmodels as $reldir)
else
{
print "<td align=\"center\">\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print "</td>";
}
@@ -692,7 +692,7 @@ foreach ($dirmodels as $reldir)
}
else
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
}
print '</td>';
@@ -831,7 +831,7 @@ if (empty($conf->global->PROJECT_HIDE_TASKS))
if (in_array($name, $def))
{
print "<td align=\"center\">\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=deltask&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=deltask&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">';
print img_picto($langs->trans("Enabled"),'switch_on');
print '</a>';
print "</td>";
@@ -839,7 +839,7 @@ if (empty($conf->global->PROJECT_HIDE_TASKS))
else
{
print "<td align=\"center\">\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=settask&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=settask&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print "</td>";
}
@@ -851,7 +851,7 @@ if (empty($conf->global->PROJECT_HIDE_TASKS))
}
else
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoctask&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoctask&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
}
print '</td>';

View File

@@ -134,7 +134,7 @@ if ($action == 'setModuleOptions')
if ($action == 'set')
{
$label = GETPOST('label','alpha');
$scandir = GETPOST('scandir','alpha');
$scandir = GETPOST('scan_dir','alpha');
$type='company';
$sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)";
@@ -161,7 +161,7 @@ if ($action== 'del')
if ($action == 'setdoc')
{
$label = GETPOST('label','alpha');
$scandir = GETPOST('scandir','alpha');
$scandir = GETPOST('scan_dir','alpha');
$db->begin();
@@ -547,7 +547,7 @@ foreach ($dirsociete as $dirroot)
print "<td align=\"center\">\n";
//if ($conf->global->COMPANY_ADDON_PDF != "$name")
//{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">';
print img_picto($langs->trans("Enabled"),'switch_on');
print '</a>';
//}
@@ -568,7 +568,7 @@ foreach ($dirsociete as $dirroot)
else
{
print "<td align=\"center\">\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print "</td>";
}
}

View File

@@ -140,7 +140,7 @@ if (empty($reshook))
if (!$errors)
{
// TODO Move the merge function into class of object.
$db->begin();
// Recopy some data
@@ -157,26 +157,29 @@ 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)
if (is_array($soc_origin->array_options))
{
if (empty($object->array_options[$key])) $object->array_options[$key] = $val;
foreach ($soc_origin->array_options as $key => $val)
{
if (empty($object->array_options[$key])) $object->array_options[$key] = $val;
}
}
// 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',
@@ -487,7 +490,7 @@ if (empty($reshook))
if (empty($object->fournisseur)) $object->code_fournisseur='';
$result = $object->create($user);
if ($result >= 0)
{
if ($object->particulier)
@@ -557,7 +560,7 @@ if (empty($reshook))
$object->code_fournisseur = null;
$object->code_client = null;
}
$error=$object->error; $errors=$object->errors;
}
@@ -852,7 +855,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;
@@ -860,7 +863,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');
@@ -1136,7 +1139,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))
{
@@ -1216,7 +1219,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")
{
@@ -1230,7 +1233,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.
@@ -1751,7 +1754,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))
@@ -1761,7 +1764,7 @@ else
print '</span>';
}
print '</td></tr>';
}
elseif($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj!="1")
{
@@ -1774,7 +1777,7 @@ else
print '</span>';
}
print '</td></tr>';
}
elseif($mysoc->localtax2_assuj=="1" && $mysoc->localtax1_assuj!="1")
{
@@ -1788,7 +1791,7 @@ else
}
print '</td></tr>';
}
// VAT Code
print '<tr><td>'.fieldLabel('VATIntra','intra_vat').'</td>';
print '<td colspan="3">';
@@ -2090,7 +2093,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.'">';
@@ -2144,7 +2147,7 @@ else
print '<td>'.$object->localtax1_value.'</td>';
}
print '</tr></form>';
}
}
elseif($mysoc->localtax2_assuj=="1" && $mysoc->localtax1_assuj!="1")
@@ -2154,7 +2157,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'].'">';
@@ -2167,7 +2170,7 @@ else
print '<td>'.$object->localtax2_value.'</td>';
}
print '</tr></form>';
}
}
/*
@@ -2178,7 +2181,7 @@ else
print '</td><tr>';
}
*/
// VAT Code
print '<tr>';
print '<td class="nowrap">'.$langs->trans('VATIntra').'</td><td>';
@@ -2573,10 +2576,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))
{

View File

@@ -579,7 +579,7 @@ if (empty($reshook))
{
$productsupplier = new ProductFournisseur($db);
if (empty($conf->global->SUPPLIER_PROPOSAL_WITH_NOPRICEDEFINED))
if (empty($conf->global->SUPPLIER_PROPOSAL_WITH_NOPRICEDEFINED)) // TODO this test seems useless
{
$idprod=0;
if (GETPOST('idprodfournprice') == -1 || GETPOST('idprodfournprice') == '') $idprod=-99; // Same behaviour than with combolist. When not select idprodfournprice is now -99 (to avoid conflict with next action that may return -1, -2, ...)
@@ -594,8 +594,9 @@ if (empty($reshook))
}
elseif (GETPOST('idprodfournprice') > 0)
{
//$idprod=$productsupplier->get_buyprice(GETPOST('idprodfournprice'), $qty); // Just to see if a price exists for the quantity. Not used to found vat.
$idprod=$productsupplier->get_buyprice(GETPOST('idprodfournprice'), -1); // We force qty to -1 to be sure to find if a supplier price exist
//$qtytosearch=$qty; // Just to see if a price exists for the quantity. Not used to found vat.
$qtytosearch=-1; // We force qty to -1 to be sure to find if a supplier price exist
$idprod=$productsupplier->get_buyprice(GETPOST('idprodfournprice'), $qtytosearch);
$res=$productsupplier->fetch($idprod);
}
@@ -605,7 +606,7 @@ if (empty($reshook))
$price_base_type = $productsupplier->fourn_price_base_type;
$type = $productsupplier->type;
$label = $productsupplier->label;
$desc = $productsupplier->description;
$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'));

View File

@@ -55,9 +55,9 @@ $key=$argv[1];
if (! isset($argv[2]) || ! $argv[2]) {
usage($path,$script_file);
exit(-1);
} else {
$userlogin=$argv[2];
}
}
$userlogin=$argv[2];
// Global variables
@@ -68,9 +68,11 @@ $error=0;
/*
* Main
*/
// current date
$now=dol_now();
@set_time_limit(0);
print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n";
print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." ***** userlogin=" . $userlogin . " ***** " . $now . " *****\n";
// Check security key
if ($key != $conf->global->CRON_KEY)
@@ -114,7 +116,8 @@ else
exit(-1);
}
}
$user->getrights();
if (isset($argv[3]) || $argv[3])
{
$id = $argv[3];
@@ -138,9 +141,6 @@ if ($result<0)
// TODO This sequence of code must be shared with code into cron_run_jobs.php php page.
// current date
$now=dol_now();
if(is_array($object->lines) && (count($object->lines)>0))
{
// Loop over job