Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/3.7' into 3.7_backported
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Sep 12, 2015
2 parents b654fe5 + 0c3ebe6 commit 370b285
Show file tree
Hide file tree
Showing 69 changed files with 292 additions and 158 deletions.
34 changes: 20 additions & 14 deletions ChangeLog
Expand Up @@ -21,6 +21,12 @@ FIX: Not showing task extrafields when creating from left menu
FIX [ bug #3288 ] Tasks box is not properly drawn
FIX [ bug #3211 ] Outstading bill amount of a client showed wrong amounts
FIX [ bug #3321 ] Users with certain permissions were shown a "forbidden access" page even if they had the rights
FIX [ bug #3426 ] Unable to create an invoice from a contract with extrafields
FIX [ bug #3431 ] Invoice bank account is not respected
FIX [ bug #3432 ] Spaces should be removed from IBAN when formatting it
FIX [ bug #3358 ] Tasks box does not work with PostgreSQL
FIX [ bug #3383 ] Company name is overlapped with company direction in PDF models
FIX [ bug #3460 ] Bank account is not saved when creating a customer invoice and facing an error message

NEW: Created new ContratLigne::insert function

Expand All @@ -47,11 +53,11 @@ FIX send mail, copy sendto don't read the list of contact
FIX Properly escape untrusted data to prevent HTML injection.
FIX send mail, copy sendto don't read the list of contact

Path to save photos of products was moved in 3.7.0 to match path of other attached files. If you had loose
Path to save photos of products was moved in 3.7.0 to match path of other attached files. If you had loose
your photo on the photo tab of products, you can set the constant "PRODUCT_USE_OLD_PATH_FOR_PHOTO" to
restore old path.

WARNING:
WARNING:

Do not try to make any Dolibarr upgrade if you are running Mysql version 5.5.40.
Mysql version 5.5.40 has a very critical bug making your data beeing definitely lost.
Expand All @@ -61,7 +67,7 @@ make a Dolibarr upgrade.

***** ChangeLog for 3.7 compared to 3.6.* *****
For users:
- New: Match other auth system: Login can be done entering login or user
- New: Match other auth system: Login can be done entering login or user
email (this open the road for SSO).
- New: Agenda export by project #1967.
- New: Increase length of thirdparty to 128 chars.
Expand All @@ -82,14 +88,14 @@ For users:
- New: Can filter on status on interventions.
- New: Add help info of field type into dictionary of payment types.
- New: Add proposals into referer page of thirdparty.
- New: On contact list can set filter on both active and not active (no more exclusive select).
- New: On contact list can set filter on both active and not active (no more exclusive select).
- New: Intervention documents are now available in ECM module.
- New: Can attach supplier order to a customer order.
- New: Supervisor is now visible into user list.
- New: Supervisor is now visible into user list.
- New: Add user of creation and validation on invoice export.
- New: Add info page about browser.
- New: Enable feature developed for 3.6 we forgot to enabled: Adding prefix
on uploaded file names.
on uploaded file names.
- New: No more dependency between contract and service module.
- New: [ task #867 ] Remove ESAEB external module code from core.
- New: Can create proposal from an intervention.
Expand Down Expand Up @@ -120,16 +126,16 @@ For users:
Use accesskey on form search.
- New: Intervention documents are now available in ECM module.
- New: Add attachments on user card + in ECM module.
- New: Can add __PROJECT_REF__ and __TIHRPARTY_NAME__ into email topic or content template.
- New: Can add __PROJECT_REF__ and __TIHRPARTY_NAME__ into email topic or content template.
- New: [ task #1204 ] add Numering contrat module free (like leopard in product module).
- New: [ task #712 ] Add warning when creating invoice from proposal or order, when there is already one invoice.
- New: Enable supplier price log table.
- New: [ task #1204 ] add a supplier reference to contract.
- New: [ task #1218 ] Can drag and drop an event from calendar to change its day.
- New: Optimize size of image static resources.
- New: Add hourly and daily amount on user card. Add weekly working hours and salary on user card.
- New: Content of predefined email come firstly from table llx_c_email_template, then translation key.
- New: Add option MAIN_GENERATE_INVOICES_WITH_PICTURE to show picture
- New: Content of predefined email come firstly from table llx_c_email_template, then translation key.
- New: Add option MAIN_GENERATE_INVOICES_WITH_PICTURE to show picture
onto PDF like MAIN_GENERATE_PROPOSALS_WITH_PICTURE dir for proposals.
- New: Add more search field in list of cheque deposits.
- New: Add feature to order to invoice on supplier part.
Expand Down Expand Up @@ -231,8 +237,8 @@ Dolibarr better:
- Deprecated module "oscommerce" were removed.
- Changed the way parameters are provided to scripts sync_xxx_ldap2dolibarr.php
- Some field into database were renamed from "libelle" to "label".
- Table llx_c_pays were renamed into llx_c_country.
- Triggers *_BUILDDOC are removed. Building a doc is not a business event. For action after
- Table llx_c_pays were renamed into llx_c_country.
- Triggers *_BUILDDOC are removed. Building a doc is not a business event. For action after
creation of a pdf or odt, hook "afterPDFCreation" or "afterODTCreation" must be used instead.
- A lot of pages named fiche.php were renamed into card.php
- A lot of pages named liste.php were renamed into list.php
Expand Down Expand Up @@ -393,7 +399,7 @@ For users:
- Fix: Add actions events not implemented.
- Fix: Price min of composition is not supplier price min by quantity.
- Fix: [ bug #1356 ] Bank accountancy number is limited to 8 numbers.
- Fix: [ bug #1439 ] impossible to remove a a translation (multilanguage-feature)
- Fix: [ bug #1439 ] impossible to remove a a translation (multilanguage-feature)
- New: If multilangue is enabled, mail (from propal, invoice, etc...) message is pre-defaulted in Customer language
- Fix: [ bug #1459 ] _ADD_CONTACT and _DEL_CONTACT triggers do not intercept insertion when reported an error
- Fix: [ bug #1478 ] BILL_PAYED trigger action does not intercept failure under some circumstances
Expand Down Expand Up @@ -423,8 +429,8 @@ For developers:
- New: A module can disable a standard ECM view.
- New: Add multilang support into product webservice.
- New: Add hooks on project card page.
- New: Add call_trigger method on CommonObject class. So new trigger call within object is just :
$result = $this->call_trigger($trigger_name, $user)
- New: Add call_trigger method on CommonObject class. So new trigger call within object is just :
$result = $this->call_trigger($trigger_name, $user)

WARNING: Following change may create regression for some external modules, but was necessary to make
Dolibarr better:
Expand Down
58 changes: 46 additions & 12 deletions htdocs/accountancy/class/bookkeeping.class.php
@@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2013-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
*
* This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -225,6 +225,8 @@ function fetch_all_per_mvt($piecenum)
*/
function create($user='')
{
global $conf;

$this->piece_num = 0;

// first check if line not yet in bookkeeping
Expand Down Expand Up @@ -278,13 +280,45 @@ function create($user='')
$this->date_create = $now;
}

$sql = "INSERT INTO " . MAIN_DB_PREFIX . "accounting_bookkeeping (doc_date, ";
$sql .= "doc_type, doc_ref,fk_doc,fk_docdet,code_tiers,numero_compte,label_compte,";
$sql .= "debit,credit,montant,sens,fk_user_author,import_key,code_journal,piece_num)";
$sql .= " VALUES ('" . $this->doc_date . "','" . $this->doc_type . "','" . $this->doc_ref . "'," . $this->fk_doc . ",";
$sql .= $this->fk_docdet . ",'" . $this->code_tiers . "','" . $this->numero_compte . "','" . $this->db->escape($this->label_compte) . "',";
$sql .= $this->debit . "," . $this->credit . "," . $this->montant . ",'" . $this->sens . "'," . $user->id . ", '";
$sql .= $this->date_create . "','" . $this->code_journal . "'," . $this->piece_num . ")";
$sql = "INSERT INTO " . MAIN_DB_PREFIX . "accounting_bookkeeping (";

$sql .= "doc_date";
$sql .= ", doc_type";
$sql .= ", doc_ref";
$sql .= ", fk_doc";
$sql .= ", fk_docdet";
$sql .= ", code_tiers";
$sql .= ", numero_compte";
$sql .= ", label_compte";
$sql .= ", debit";
$sql .= ", credit";
$sql .= ", montant";
$sql .= ", sens";
$sql .= ", fk_user_author";
$sql .= ", import_key";
$sql .= ", code_journal";
$sql .= ", piece_num";

$sql .= ") VALUES (";

$sql .= "'" . $this->doc_date . "'";
$sql .= ",'" . $this->doc_type . "'";
$sql .= ",'" . $this->doc_ref . "'";
$sql .= "," . $this->fk_doc;
$sql .= "," . $this->fk_docdet;
$sql .= ",'" . $this->code_tiers . "'";
$sql .= ",'" . $this->numero_compte . "'";
$sql .= ",'" . $this->db->escape($this->label_compte) . "'";
$sql .= "," . $this->debit;
$sql .= "," . $this->credit;
$sql .= "," . $this->montant;
$sql .= ",'" . $this->sens . "'";
$sql .= ",'" . $this->fk_user_author."'";
$sql .= ",'" . $this->date_create . "'";
$sql .= ",'" . $this->code_journal . "'";
$sql .= "," . $this->piece_num;

$sql .= ")";

dol_syslog(get_class($this) . ":: create sql=" . $sql, LOG_DEBUG);
$resql = $this->db->query($sql);
Expand All @@ -296,19 +330,19 @@ function create($user='')
$result = 0;
} else {
$result = - 2;
dol_syslog("BookKeeping::Create Erreur $result lecture ID");
dol_syslog("BookKeeping::Create Error $result lecture ID");
}
} else {
$result = - 1;
dol_syslog("BookKeeping::Create Erreur $result INSERT Mysql");
dol_syslog("BookKeeping::Create Error $result INSERT Mysql");
}
} else {
$result = - 3;
dol_syslog("BookKeeping::Create Erreur $result SELECT Mysql");
dol_syslog("BookKeeping::Create Error $result SELECT Mysql");
}
} else {
$result = - 5;
dol_syslog("BookKeeping::Create Erreur $result SELECT Mysql");
dol_syslog("BookKeeping::Create Error $result SELECT Mysql");
}

return $result;
Expand Down
4 changes: 3 additions & 1 deletion htdocs/accountancy/journal/bankjournal.php
Expand Up @@ -286,6 +286,7 @@
$bookkeeping->debit = ($mt >= 0 ? $mt : 0);
$bookkeeping->credit = ($mt < 0 ? - $mt : 0);
$bookkeeping->code_journal = $conf->global->ACCOUNTING_BANK_JOURNAL;
$bookkeeping->fk_user_author = $user->id;

if ($tabtype[$key] == 'payment') {

Expand Down Expand Up @@ -336,6 +337,7 @@
$bookkeeping->debit = ($mt < 0 ? - $mt : 0);
$bookkeeping->credit = ($mt >= 0) ? $mt : 0;
$bookkeeping->code_journal = $conf->global->ACCOUNTING_BANK_JOURNAL;
$bookkeeping->fk_user_author = $user->id;

if ($tabtype[$key] == 'sc') {
$bookkeeping->code_tiers = '';
Expand Down Expand Up @@ -400,7 +402,7 @@
}

if (empty($error)) {
setEventMessage($langs->trans('Success'), 'mesgs');
setEventMessage($langs->trans("GeneralLedgerIsWritten"),'mesgs');
}
}
// Export
Expand Down
26 changes: 23 additions & 3 deletions htdocs/accountancy/journal/purchasesjournal.php
Expand Up @@ -157,6 +157,7 @@
// Bookkeeping Write
if ($action == 'writebookkeeping') {
$now = dol_now();
$error = 0;

foreach ( $tabfac as $key => $val ) {
foreach ( $tabttc[$key] as $k => $mt ) {
Expand All @@ -177,8 +178,13 @@
$bookkeeping->debit = ($mt <= 0) ? $mt : 0;
$bookkeeping->credit = ($mt > 0) ? $mt : 0;
$bookkeeping->code_journal = $conf->global->ACCOUNTING_PURCHASE_JOURNAL;
$bookkeeping->fk_user_author = $user->id;

$bookkeeping->create();
$result = $bookkeeping->create();
if ($result < 0) {
$error ++;
setEventMessage($object->errors, 'errors');
}
}

// Product / Service
Expand All @@ -202,8 +208,13 @@
$bookkeeping->debit = ($mt > 0) ? $mt : 0;
$bookkeeping->credit = ($mt <= 0) ? $mt : 0;
$bookkeeping->code_journal = $conf->global->ACCOUNTING_PURCHASE_JOURNAL;
$bookkeeping->fk_user_author = $user->id;

$bookkeeping->create();
$result = $bookkeeping->create();
if ($result < 0) {
$error ++;
setEventMessage($object->errors, 'errors');
}
}
}
}
Expand All @@ -228,11 +239,20 @@
$bookkeeping->debit = ($mt > 0) ? $mt : 0;
$bookkeeping->credit = ($mt <= 0) ? $mt : 0;
$bookkeeping->code_journal = $conf->global->ACCOUNTING_PURCHASE_JOURNAL;
$bookkeeping->fk_user_author = $user->id;

$bookkeeping->create();
$result = $bookkeeping->create();
if ($result < 0) {
$error ++;
setEventMessage($object->errors, 'errors');
}
}
}
}

if (empty($error)) {
setEventMessage($langs->trans("GeneralLedgerIsWritten"),'mesgs');
}
}


Expand Down
26 changes: 23 additions & 3 deletions htdocs/accountancy/journal/sellsjournal.php
Expand Up @@ -170,6 +170,7 @@
// Bookkeeping Write
if ($action == 'writebookkeeping') {
$now = dol_now();
$error = 0;

foreach ( $tabfac as $key => $val ) {
foreach ( $tabttc[$key] as $k => $mt ) {
Expand All @@ -188,8 +189,13 @@
$bookkeeping->debit = ($mt >= 0) ? $mt : 0;
$bookkeeping->credit = ($mt < 0) ? $mt : 0;
$bookkeeping->code_journal = $conf->global->ACCOUNTING_SELL_JOURNAL;
$bookkeeping->fk_user_author = $user->id;

$bookkeeping->create();
$result = $bookkeeping->create();
if ($result < 0) {
$error ++;
setEventMessage($object->errors, 'errors');
}
}

// Product / Service
Expand All @@ -213,8 +219,13 @@
$bookkeeping->debit = ($mt < 0) ? $mt : 0;
$bookkeeping->credit = ($mt >= 0) ? $mt : 0;
$bookkeeping->code_journal = $conf->global->ACCOUNTING_SELL_JOURNAL;
$bookkeeping->fk_user_author = $user->id;

$bookkeeping->create();
$result = $bookkeeping->create();
if ($result < 0) {
$error ++;
setEventMessage($object->errors, 'errors');
}
}
}
}
Expand All @@ -238,11 +249,20 @@
$bookkeeping->debit = ($mt < 0) ? $mt : 0;
$bookkeeping->credit = ($mt >= 0) ? $mt : 0;
$bookkeeping->code_journal = $conf->global->ACCOUNTING_SELL_JOURNAL;
$bookkeeping->fk_user_author = $user->id;

$bookkeeping->create();
$result = $bookkeeping->create();
if ($result < 0) {
$error ++;
setEventMessage($object->errors, 'errors');
}
}
}
}

if (empty($error)) {
setEventMessage($langs->trans("GeneralLedgerIsWritten"),'mesgs');
}
}
// Export
if ($action == 'export_csv') {
Expand Down
2 changes: 1 addition & 1 deletion htdocs/commande/orderstoinvoice.php
Expand Up @@ -505,7 +505,7 @@


//Mode liste
if (($action != 'create' && $action != 'add') || !$error)
if (($action != 'create' && $action != 'add') && !$error)
{
llxHeader();
?>
Expand Down
4 changes: 4 additions & 0 deletions htdocs/compta/facture.php
Expand Up @@ -2121,6 +2121,10 @@
print '</td></tr>';

// Bank Account
if (isset($_POST['fk_account'])) {
$fk_account = $_POST['fk_account'];
}

print '<tr><td>' . $langs->trans('BankAccount') . '</td><td colspan="2">';
$form->select_comptes($fk_account, 'fk_account', 0, '', 1);
print '</td></tr>';
Expand Down
13 changes: 7 additions & 6 deletions htdocs/compta/facture/class/facture.class.php
Expand Up @@ -2572,15 +2572,16 @@ function getNextNumRef($soc,$mode='next')
$numref = "";
$numref = $obj->getNextValue($soc,$this,$mode);

if ($numref != "")
{
return $numref;
}
else
{
/**
* $numref can be empty in case we ask for the last value because if there is no invoice created with the
* set up mask.
*/
if ($mode != 'last' && !$numref) {
dol_print_error($db,"Facture::getNextNumRef ".$obj->error);
return "";
}

return $numref;
}
else
{
Expand Down

0 comments on commit 370b285

Please sign in to comment.