Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into develop
Conflicts: htdocs/accountancy/bookkeeping/balance.php htdocs/contrat/list.php htdocs/don/class/api_donations.class.php htdocs/societe/class/societe.class.php
This commit is contained in:
commit
a09db63c7b
@ -183,11 +183,11 @@ if ($action == 'export_csv') {
|
||||
}
|
||||
|
||||
foreach ($object->lines as $line) {
|
||||
print length_accountg($line->numero_compte).$sep;
|
||||
print $object->get_compte_desc($line->numero_compte).$sep;
|
||||
print price($line->debit).$sep;
|
||||
print price($line->credit).$sep;
|
||||
print price($line->debit - $line->credit).$sep;
|
||||
print '"'.length_accountg($line->numero_compte).'"'.$sep;
|
||||
print '"'.$object->get_compte_desc($line->numero_compte).'"'.$sep;
|
||||
print '"'.price($line->debit).'"'.$sep;
|
||||
print '"'.price($line->credit).'"'.$sep;
|
||||
print '"'.price($line->debit - $line->credit).'"'.$sep;
|
||||
print "\n";
|
||||
}
|
||||
|
||||
|
||||
@ -188,7 +188,7 @@ if ($action == 'delete') {
|
||||
$form = new Form($db);
|
||||
$formadmin = new FormAdmin($db);
|
||||
|
||||
$wikihelp = 'EN:Setup Translation|FR:Paramétrage traduction|ES:Configuración';
|
||||
$wikihelp = 'EN:Setup_Translation|FR:Paramétrage_Traduction|ES:Configuración_Traducción';
|
||||
llxHeader('', $langs->trans("Setup"), $wikihelp);
|
||||
|
||||
$param = '&mode='.urlencode($mode);
|
||||
|
||||
@ -68,6 +68,8 @@ $modulesdir = dolGetModulesDirs('/mailings');
|
||||
$object = new Mailing($db);
|
||||
$result = $object->fetch($id);
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('ciblescard', 'globalcard'));
|
||||
|
||||
// Security check
|
||||
if (!$user->rights->mailing->lire || (empty($conf->global->EXTERNAL_USERS_ARE_AUTHORIZED) && $user->socid > 0)) {
|
||||
@ -438,6 +440,10 @@ if ($object->fetch($id) >= 0) {
|
||||
}
|
||||
} // End foreach dir
|
||||
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
print '</div>';
|
||||
|
||||
print '<br><br>';
|
||||
|
||||
@ -289,6 +289,12 @@ if (!empty($search_ref_customer)) {
|
||||
if (!empty($search_ref_supplier)) {
|
||||
$sql .= natural_search(array('c.ref_supplier'), $search_ref_supplier);
|
||||
}
|
||||
if ($search_zip) {
|
||||
$sql .= natural_search(array('s.zip'), $search_zip);
|
||||
}
|
||||
if ($search_town) {
|
||||
$sql .= natural_search(array('s.town'), $search_town);
|
||||
}
|
||||
if ($search_sale > 0) {
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$search_sale;
|
||||
}
|
||||
|
||||
@ -16,9 +16,9 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
use Luracast\Restler\RestException;
|
||||
use Luracast\Restler\RestException;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php';
|
||||
|
||||
/**
|
||||
* API class for donations
|
||||
@ -33,7 +33,7 @@ class Donations extends DolibarrApi
|
||||
* @var array $FIELDS Mandatory fields, checked when create and update object
|
||||
*/
|
||||
public static $FIELDS = array(
|
||||
'socid'
|
||||
'amount'
|
||||
);
|
||||
|
||||
/**
|
||||
@ -199,7 +199,7 @@ class Donations extends DolibarrApi
|
||||
}*/
|
||||
|
||||
if ($this->don->create(DolibarrApiAccess::$user) < 0) {
|
||||
throw new RestException(500, "Error creating order", array_merge(array($this->don->error), $this->don->errors));
|
||||
throw new RestException(500, "Error creating donation", array_merge(array($this->don->error), $this->don->errors));
|
||||
}
|
||||
|
||||
return $this->don->id;
|
||||
@ -311,7 +311,7 @@ class Donations extends DolibarrApi
|
||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
$result = $this->don->valid(DolibarrApiAccess::$user, $idwarehouse, $notrigger);
|
||||
$result = $this->don->valid_promesse($id, DolibarrApiAccess::$user->id, $notrigger);
|
||||
if ($result == 0) {
|
||||
throw new RestException(304, 'Error nothing done. May be object is already validated');
|
||||
}
|
||||
@ -364,7 +364,7 @@ class Donations extends DolibarrApi
|
||||
private function _validate($data)
|
||||
{
|
||||
$don = array();
|
||||
foreach (Orders::$FIELDS as $field) {
|
||||
foreach (Donations::$FIELDS as $field) {
|
||||
if (!isset($data[$field])) {
|
||||
throw new RestException(400, $field." field missing");
|
||||
}
|
||||
|
||||
@ -380,7 +380,7 @@ class Don extends CommonObject
|
||||
$sql .= ", phone";
|
||||
$sql .= ", phone_mobile";
|
||||
$sql .= ") VALUES (";
|
||||
$sql .= "'".$this->db->idate($now)."'";
|
||||
$sql .= "'".$this->db->idate($this->date ? $this->date : $now)."'";
|
||||
$sql .= ", ".$conf->entity;
|
||||
$sql .= ", ".price2num($this->amount);
|
||||
$sql .= ", ".($this->modepaymentid ? $this->modepaymentid : "null");
|
||||
|
||||
@ -1256,6 +1256,8 @@ if (empty($reshook)) {
|
||||
$tva_tx = get_default_tva($soc, $mysoc, $lines[$i]->fk_product, $product_fourn_price_id);
|
||||
}
|
||||
|
||||
$object->special_code = $lines[$i]->special_code;
|
||||
|
||||
$result = $object->addline(
|
||||
$desc,
|
||||
$lines[$i]->subprice,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user