Merge
This commit is contained in:
commit
bf1f60b31e
@ -114,7 +114,6 @@ if ($action == 'confirm_create_thirdparty' && $confirm == 'yes' && $user->rights
|
|||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
$errmsg=$langs->trans($company->error);
|
|
||||||
setEventMessages($company->error, $company->errors, 'errors');
|
setEventMessages($company->error, $company->errors, 'errors');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -124,7 +123,7 @@ if ($action == 'confirm_create_thirdparty' && $confirm == 'yes' && $user->rights
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$errmsg=$object->error;
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -212,7 +211,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
|||||||
{
|
{
|
||||||
$paymentdate=dol_mktime(0, 0, 0, $_POST["paymentmonth"], $_POST["paymentday"], $_POST["paymentyear"]);
|
$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"];
|
$label=$_POST["label"];
|
||||||
|
|
||||||
// Payment informations
|
// Payment informations
|
||||||
@ -230,6 +229,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
|||||||
$error++;
|
$error++;
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
$errmsg=$langs->trans("ErrorBadDateFormat",$langs->transnoentitiesnoconv("DateSubscription"));
|
$errmsg=$langs->trans("ErrorBadDateFormat",$langs->transnoentitiesnoconv("DateSubscription"));
|
||||||
|
setEventMessages($errmsg, null, 'errors');
|
||||||
$action='addsubscription';
|
$action='addsubscription';
|
||||||
}
|
}
|
||||||
if (GETPOST('end') && ! $datesubend)
|
if (GETPOST('end') && ! $datesubend)
|
||||||
@ -237,6 +237,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
|||||||
$error++;
|
$error++;
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
$errmsg=$langs->trans("ErrorBadDateFormat",$langs->transnoentitiesnoconv("DateEndSubscription"));
|
$errmsg=$langs->trans("ErrorBadDateFormat",$langs->transnoentitiesnoconv("DateEndSubscription"));
|
||||||
|
setEventMessages($errmsg, null, 'errors');
|
||||||
$action='addsubscription';
|
$action='addsubscription';
|
||||||
}
|
}
|
||||||
if (! $datesubend)
|
if (! $datesubend)
|
||||||
@ -247,16 +248,20 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
|||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
$errmsg=$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DatePayment"));
|
$errmsg=$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DatePayment"));
|
||||||
|
setEventMessages($errmsg, null, 'errors');
|
||||||
$action='addsubscription';
|
$action='addsubscription';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$amount = price2num(GETPOST("subscription",'alpha'));
|
||||||
|
|
||||||
// Check if a payment is mandatory or not
|
// Check if a payment is mandatory or not
|
||||||
if (! $error && $adht->subscription) // Member type need subscriptions
|
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
|
// If field is '' or not a numeric value
|
||||||
$errmsg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Amount"));
|
$errmsg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Amount"));
|
||||||
|
setEventMessages($errmsg, null, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
$action='addsubscription';
|
$action='addsubscription';
|
||||||
}
|
}
|
||||||
@ -274,7 +279,11 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
|||||||
{
|
{
|
||||||
if ($_POST["accountid"]) $errmsg=$langs->trans("ErrorDoNotProvideAccountsIfNullAmount");
|
if ($_POST["accountid"]) $errmsg=$langs->trans("ErrorDoNotProvideAccountsIfNullAmount");
|
||||||
}
|
}
|
||||||
if ($errmsg) $action='addsubscription';
|
if ($errmsg)
|
||||||
|
{
|
||||||
|
setEventMessages($errmsg, null, 'errors');
|
||||||
|
$action='addsubscription';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -320,6 +329,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
|||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
$errmsg=$db->lasterror();
|
$errmsg=$db->lasterror();
|
||||||
|
setEventMessages($errmsg, null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -327,14 +337,16 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
|||||||
$error++;
|
$error++;
|
||||||
$errmsg=$acct->error;
|
$errmsg=$acct->error;
|
||||||
$errmsgs=$acct->errors;
|
$errmsgs=$acct->errors;
|
||||||
}
|
setEventMessages($errmsg, $errmsgs, 'errors');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
$errmsg=$acct->error;
|
$errmsg=$acct->error;
|
||||||
$errmsgs=$acct->errors;
|
$errmsgs=$acct->errors;
|
||||||
}
|
setEventMessages($errmsg, $errmsgs, 'errors');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If option choosed, we create invoice
|
// If option choosed, we create invoice
|
||||||
@ -352,6 +364,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
|||||||
{
|
{
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
$errmsg=$langs->trans("ErrorMemberNotLinkedToAThirpartyLinkOrCreateFirst");
|
$errmsg=$langs->trans("ErrorMemberNotLinkedToAThirpartyLinkOrCreateFirst");
|
||||||
|
setEventMessages($errmsg, null, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -362,6 +375,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
|||||||
{
|
{
|
||||||
$errmsg=$customer->error;
|
$errmsg=$customer->error;
|
||||||
$errmsgs=$acct->errors;
|
$errmsgs=$acct->errors;
|
||||||
|
setEventMessages($errmsg, $errmsgs, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -379,6 +393,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
|||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
$errmsg='ErrorNoPaymentTermRECEPFound';
|
$errmsg='ErrorNoPaymentTermRECEPFound';
|
||||||
|
setEventMessages($errmsg, null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$invoice->socid=$object->fk_soc;
|
$invoice->socid=$object->fk_soc;
|
||||||
@ -396,6 +411,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
|||||||
{
|
{
|
||||||
$errmsg=$invoice->error;
|
$errmsg=$invoice->error;
|
||||||
$errmsgs=$invoice->errors;
|
$errmsgs=$invoice->errors;
|
||||||
|
setEventMessages($errmsg, $errmsgs, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -416,6 +432,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
|||||||
if ($result <= 0)
|
if ($result <= 0)
|
||||||
{
|
{
|
||||||
$errmsg=$invoice->error;
|
$errmsg=$invoice->error;
|
||||||
|
setEventMessages($errmsg, null, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -428,6 +445,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
|||||||
{
|
{
|
||||||
$errmsg=$invoice->error;
|
$errmsg=$invoice->error;
|
||||||
$errmsgs=$invoice->errors;
|
$errmsgs=$invoice->errors;
|
||||||
|
setEventMessages($errmsg, $errmsgs, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -455,6 +473,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
|||||||
{
|
{
|
||||||
$errmsg=$paiement->error;
|
$errmsg=$paiement->error;
|
||||||
$errmsgs=$paiement->errors;
|
$errmsgs=$paiement->errors;
|
||||||
|
setEventMessages($errmsg, $errmsgs, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -536,6 +555,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
|||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
$errmsg=$object->error;
|
$errmsg=$object->error;
|
||||||
|
setEventMessages($errmsg, null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -169,12 +169,12 @@ class Productcustomerprice extends CommonObject
|
|||||||
$sql .= " " . (empty($this->price_min_ttc) ? '0' : "'" . $this->price_min_ttc . "'") . ",";
|
$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 .= " " . (! 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 .= " ".($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 .= " " . (! isset($this->recuperableonly) ? 'NULL' : "'" . $this->recuperableonly . "'") . ",";
|
||||||
$sql .= " " . (empty($this->localtax1_type) ? "'0'" : "'" . $this->localtax1_type . "'") . ",";
|
$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 .= " " . (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 .= " " . $user->id . ",";
|
||||||
$sql .= " " . (! isset($this->import_key) ? 'NULL' : "'" . $this->db->escape($this->import_key) . "'") . "";
|
$sql .= " " . (! isset($this->import_key) ? 'NULL' : "'" . $this->db->escape($this->import_key) . "'") . "";
|
||||||
$sql .= ")";
|
$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_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 .= " 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 .= " 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 .= " recuperableonly=" . (isset($this->recuperableonly) ? $this->recuperableonly : "null") . ",";
|
||||||
$sql .= " localtax1_tx=" . (isset($this->localtax1_tx) ? $this->localtax1_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) ? $this->localtax2_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 .= " localtax1_type=" . (! empty($this->localtax1_type) ? "'".$this->localtax1_type."'": "'0'") . ",";
|
||||||
$sql .= " localtax2_type=" . (! empty($this->localtax2_type) ? "'".$this->localtax2_type."'": "'0'") . ",";
|
$sql .= " localtax2_type=" . (! empty($this->localtax2_type) ? "'".$this->localtax2_type."'": "'0'") . ",";
|
||||||
$sql .= " fk_user=" . $user->id . ",";
|
$sql .= " fk_user=" . $user->id . ",";
|
||||||
|
|||||||
@ -168,12 +168,17 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Merge extrafields
|
// 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
|
// TODO Merge categories
|
||||||
|
|
||||||
|
|
||||||
$object->update($object->id, $user);
|
$object->update($object->id, $user);
|
||||||
|
|
||||||
// Move links
|
// Move links
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user