From d6f3a5c046396d200ef7026f5293d1561d3abc3b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 10 Mar 2016 15:01:39 +0100 Subject: [PATCH 01/12] Fix bad path --- htdocs/product/document.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/document.php b/htdocs/product/document.php index eb8530259da..6a8ee778590 100644 --- a/htdocs/product/document.php +++ b/htdocs/product/document.php @@ -70,8 +70,8 @@ if ($id > 0 || ! empty($ref)) { $result = $object->fetch($id, $ref); - if (! empty($conf->product->enabled)) $upload_dir = $conf->product->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 1, $object, 'product').dol_sanitizeFileName($object->ref); - elseif (! empty($conf->service->enabled)) $upload_dir = $conf->service->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 1, $object, 'product').dol_sanitizeFileName($object->ref); + if (! empty($conf->product->enabled)) $upload_dir = $conf->product->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 0, $object, 'product').dol_sanitizeFileName($object->ref); + elseif (! empty($conf->service->enabled)) $upload_dir = $conf->service->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 0, $object, 'product').dol_sanitizeFileName($object->ref); if (! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) // For backward compatiblity, we scan also old dirs { From a9058df75371aa2dc8dbdfa16f449c6b76171774 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 11 Mar 2016 10:47:17 +0100 Subject: [PATCH 02/12] Fix bad field in select --- htdocs/core/lib/tax.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/tax.lib.php b/htdocs/core/lib/tax.lib.php index 2387332e670..0a3c4942857 100644 --- a/htdocs/core/lib/tax.lib.php +++ b/htdocs/core/lib/tax.lib.php @@ -108,7 +108,7 @@ function vat_by_thirdparty($db, $y, $date_start, $date_end, $modetax, $direction if ($modetax == 1) { // If vat paid on due invoices (non draft) - $sql = "SELECT s.rowid as socid, s.nom as name, s.siren as tva_intra, s.tva_assuj as assuj,"; + $sql = "SELECT s.rowid as socid, s.nom as name, s.tva_intra as tva_intra, s.tva_assuj as assuj,"; $sql.= " sum(f.$total_ht) as amount, sum(f.".$total_tva.") as tva,"; $sql.= " sum(f.localtax1) as localtax1,"; $sql.= " sum(f.localtax2) as localtax2"; From f87bb1206eb42b26c64b5663cfe9a1c0faa7cbb0 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 11 Mar 2016 15:42:14 +0100 Subject: [PATCH 03/12] Fix: wrong fk_parent_line in credit note with invoiceAvoirWithLines option --- htdocs/compta/facture.php | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 9fa6f7c7938..5fab485e655 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -755,10 +755,17 @@ if (empty($reshook)) $facture_source = new Facture($db); // fetch origin object if ($facture_source->fetch($object->fk_facture_source)>0) { + $fk_parent_line = 0; foreach($facture_source->lines as $line) { + // Reset fk_parent_line for no child products and special product + if (($line->product_type != 9 && empty($line->fk_parent_line)) || $line->product_type == 9) { + $fk_parent_line = 0; + } + $line->fk_facture = $object->id; + $line->fk_parent_line = $fk_parent_line; $line->subprice =-$line->subprice; // invert price for object $line->pa_ht = -$line->pa_ht; @@ -768,9 +775,14 @@ if (empty($reshook)) $line->total_localtax1=-$line->total_localtax1; $line->total_localtax2=-$line->total_localtax2; - $line->insert(); + $result = $line->insert(); $object->lines[] = $line; // insert new line in current object + + // Defined the new fk_parent_line + if ($result > 0 && $line->product_type == 9) { + $fk_parent_line = $result; + } } $object->update_price(1); @@ -1749,7 +1761,7 @@ if (empty($reshook)) } } } - + // bascule du statut d'un contact else if ($action == 'swapstatut') { @@ -1759,13 +1771,13 @@ if (empty($reshook)) dol_print_error($db); } } - + // Efface un contact else if ($action == 'deletecontact') { $object->fetch($id); $result = $object->delete_contact($lineid); - + if ($result >= 0) { header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id); exit(); @@ -1854,7 +1866,7 @@ if ($action == 'create') if ($element == 'project') { $projectid = $originid; - + if (!$cond_reglement_id) { $cond_reglement_id = $soc->cond_reglement_id; } @@ -1867,7 +1879,7 @@ if ($action == 'create') if (!$dateinvoice) { // Do not set 0 here (0 for a date is 1970) $dateinvoice = (empty($dateinvoice)?(empty($conf->global->MAIN_AUTOFILL_DATE)?-1:''):$dateinvoice); - } + } } else { // For compatibility if ($element == 'order' || $element == 'commande') { @@ -2564,7 +2576,7 @@ else if ($id > 0 || ! empty($ref)) $qualified_for_stock_change = $object->hasProductsOrServices(1); } - if ($object->type != Facture::TYPE_DEPOSIT && ! empty($conf->global->STOCK_CALCULATE_ON_BILL) && $qualified_for_stock_change && $object->statut >= 1) + if ($object->type != Facture::TYPE_DEPOSIT && ! empty($conf->global->STOCK_CALCULATE_ON_BILL) && $qualified_for_stock_change && $object->statut >= 1) { $langs->load("stocks"); require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php'; @@ -2755,7 +2767,7 @@ else if ($id > 0 || ! empty($ref)) } // Clone confirmation - if ($action == 'clone') + if ($action == 'clone') { // Create an array for form $formquestion = array( @@ -2766,7 +2778,7 @@ else if ($id > 0 || ! empty($ref)) $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?facid=' . $object->id, $langs->trans('CloneInvoice'), $langs->trans('ConfirmCloneInvoice', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); } - if (! $formconfirm) + if (! $formconfirm) { $parameters = array('lineid' => $lineid); $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook @@ -3557,14 +3569,14 @@ else if ($id > 0 || ! empty($ref)) // modified by hook if (empty($reshook)) { // Editer une facture deja validee, sans paiement effectue et pas exporte en compta - if ($object->statut == 1) + if ($object->statut == 1) { // On verifie si les lignes de factures ont ete exportees en compta et/ou ventilees $ventilExportCompta = $object->getVentilExportCompta(); - if ($resteapayer == $object->total_ttc && empty($object->paye) && $ventilExportCompta == 0) + if ($resteapayer == $object->total_ttc && empty($object->paye) && $ventilExportCompta == 0) { - if (! $objectidnext && $object->is_last_in_cycle()) + if (! $objectidnext && $object->is_last_in_cycle()) { if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->facture->creer)) || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->facture->invoice_advance->unvalidate))) From 33c5658209c2d2f4a36223dec4f476b718e940b7 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 11 Mar 2016 17:17:06 +0100 Subject: [PATCH 04/12] fix error return --- htdocs/accountancy/journal/bankjournal.php | 19 ++-- .../accountancy/journal/purchasesjournal.php | 94 ++++++++-------- htdocs/accountancy/journal/sellsjournal.php | 102 +++++++++--------- 3 files changed, 107 insertions(+), 108 deletions(-) diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index 90d63ef05f8..e006c5600e1 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -71,7 +71,7 @@ $now = dol_now(); // Security check if ($user->societe_id > 0 && empty($id_bank_account)) accessforbidden(); - + /* * View */ @@ -148,7 +148,7 @@ if ($result) { $tabcompany[$obj->rowid] = array ( 'id' => $obj->socid, 'name' => $obj->name, - 'code_client' => $obj->code_compta + 'code_client' => $obj->code_compta ); // Controls @@ -251,7 +251,7 @@ if ($result) { $tabbq[$obj->rowid][$compta_bank] += $obj->amount; // if($obj->socid)$tabtp[$obj->rowid][$compta_soc] += $obj->amount; - + $i ++; } } else { @@ -312,14 +312,13 @@ if ($action == 'writebookkeeping') { if ($resultmid) { $objmid = $db->fetch_object($resultmid); $bookkeeping->doc_ref = $objmid->ref_supplier . ' (' . $objmid->ref . ')'; - ; } } $result = $bookkeeping->create($user); if ($result < 0) { $error ++; - setEventMessages($object->error, $object->errors, 'errors'); + setEventMessages($bookkeeping->error, $bookkeeping->errors, 'errors'); } } // Third party @@ -388,7 +387,7 @@ if ($action == 'writebookkeeping') { $bookkeeping->code_tiers = $k; $bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER; } else { - + $bookkeeping->doc_ref = $k; $bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER; } @@ -396,7 +395,7 @@ if ($action == 'writebookkeeping') { $result = $bookkeeping->create($user); if ($result < 0) { $error ++; - setEventMessages($object->error, $object->errors, 'errors'); + setEventMessages($bookkeeping->error, $bookkeeping->errors, 'errors'); } } } @@ -414,7 +413,7 @@ if ($action == 'export_csv') { $companystatic = new Client($db); // Model Cegid Expert Export - if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 2) + if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 2) { $sep = ";"; @@ -530,7 +529,7 @@ if ($action == 'export_csv') { $varlink = 'id_account=' . $id_bank_account; report_header($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array ( - 'action' => '' + 'action' => '' ), '', $varlink); print ''; @@ -572,7 +571,7 @@ if ($action == 'export_csv') { foreach ( $tabpay as $key => $val ) { $date = dol_print_date($db->jdate($val["date"]), 'day'); - + if ($val["lib"] == '(SupplierInvoicePayment)') { $reflabel = $langs->trans('SupplierInvoicePayment'); } diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php index 7d9778f72b8..fb419098771 100644 --- a/htdocs/accountancy/journal/purchasesjournal.php +++ b/htdocs/accountancy/journal/purchasesjournal.php @@ -113,13 +113,13 @@ if ($result) { // les variables $cptfour = (! empty($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER)) ? $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER : $langs->trans("CodeNotDef"); $cpttva = (! empty($conf->global->ACCOUNTING_VAT_SOLD_ACCOUNT)) ? $conf->global->ACCOUNTING_VAT_SOLD_ACCOUNT : $langs->trans("CodeNotDef"); - + $tabfac = array (); $tabht = array (); $tabtva = array (); $tabttc = array (); $tabcompany = array (); - + $i = 0; while ( $i < $num ) { $obj = $db->fetch_object($result); @@ -133,7 +133,7 @@ if ($result) { $compta_prod = (! empty($conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT)) ? $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT : $langs->trans("CodeNotDef"); } $compta_tva = (! empty($obj->account_tva) ? $obj->account_tva : $cpttva); - + $tabfac[$obj->rowid]["date"] = $obj->df; $tabfac[$obj->rowid]["ref"] = $obj->ref_supplier . ' (' . $obj->ref . ')'; $tabfac[$obj->rowid]["type"] = $obj->type; @@ -145,9 +145,9 @@ if ($result) { $tabcompany[$obj->rowid] = array ( 'id' => $obj->socid, 'name' => $obj->name, - 'code_fournisseur' => $obj->code_compta_fournisseur + 'code_fournisseur' => $obj->code_compta_fournisseur ); - + $i ++; } } else { @@ -158,11 +158,11 @@ if ($result) { if ($action == 'writebookkeeping') { $now = dol_now(); $error = 0; - + foreach ( $tabfac as $key => $val ) { foreach ( $tabttc[$key] as $k => $mt ) { // get compte id and label - + $bookkeeping = new BookKeeping($db); $bookkeeping->doc_date = $val["date"]; $bookkeeping->doc_ref = $val["ref"]; @@ -179,14 +179,14 @@ if ($action == 'writebookkeeping') { $bookkeeping->credit = ($mt > 0) ? $mt : 0; $bookkeeping->code_journal = $conf->global->ACCOUNTING_PURCHASE_JOURNAL; $bookkeeping->fk_user_author = $user->id; - + $result = $bookkeeping->create($user); if ($result < 0) { $error ++; - setEventMessages($object->error, $object->errors, 'errors'); + setEventMessages($bookkeeping->error, $bookkeeping->errors, 'errors'); } } - + // Product / Service foreach ( $tabht[$key] as $k => $mt ) { if ($mt) { @@ -209,16 +209,16 @@ if ($action == 'writebookkeeping') { $bookkeeping->credit = ($mt <= 0) ? $mt : 0; $bookkeeping->code_journal = $conf->global->ACCOUNTING_PURCHASE_JOURNAL; $bookkeeping->fk_user_author = $user->id; - + $result = $bookkeeping->create($user); if ($result < 0) { $error ++; - setEventMessages($object->error, $object->errors, 'errors'); + setEventMessages($bookkeeping->error, $bookkeeping->errors, 'errors'); } } } } - + // VAT // var_dump($tabtva); foreach ( $tabtva[$key] as $k => $mt ) { @@ -240,16 +240,16 @@ if ($action == 'writebookkeeping') { $bookkeeping->credit = ($mt <= 0) ? $mt : 0; $bookkeeping->code_journal = $conf->global->ACCOUNTING_PURCHASE_JOURNAL; $bookkeeping->fk_user_author = $user->id; - + $result = $bookkeeping->create($user); if ($result < 0) { $error ++; - setEventMessages($object->error, $object->errors, 'errors'); + setEventMessages($bookkeeping->error, $bookkeeping->errors, 'errors'); } } } } - + if (empty($error)) { setEventMessages($langs->trans("GeneralLedgerIsWritten"), null, 'mesgs'); } @@ -265,23 +265,23 @@ $companystatic = new Fournisseur($db); if ($action == 'export_csv') { $sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV; $journal = $conf->global->ACCOUNTING_PURCHASE_JOURNAL; - + include DOL_DOCUMENT_ROOT . '/accountancy/tpl/export_journal.tpl.php'; - + // Model Cegid Expert Export - if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 2) + if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 2) { $sep = ";"; - + foreach ( $tabfac as $key => $val ) { $date = dol_print_date($db->jdate($val["date"]), '%d%m%Y'); - + // Product / Service foreach ( $tabht[$key] as $k => $mt ) { $companystatic->id = $tabcompany[$key]['id']; $companystatic->name = $tabcompany[$key]['name']; $companystatic->client = $tabcompany[$key]['code_client']; - + if ($mt) { print $date . $sep; print $purchase_journal . $sep; @@ -294,7 +294,7 @@ if ($action == 'export_csv') { print "\n"; } } - + // VAT foreach ( $tabtva[$key] as $k => $mt ) { if ($mt) { @@ -309,7 +309,7 @@ if ($action == 'export_csv') { print "\n"; } } - + foreach ( $tabttc[$key] as $k => $mt ) { print $date . $sep; print $purchase_journal . $sep; @@ -326,11 +326,11 @@ if ($action == 'export_csv') { // Model Classic Export foreach ( $tabfac as $key => $val ) { $date = dol_print_date($db->jdate($val["date"]), 'day'); - + $companystatic->id = $tabcompany[$key]['id']; $companystatic->name = $tabcompany[$key]['name']; $companystatic->client = $tabcompany[$key]['code_client']; - + // Product / Service foreach ( $tabht[$key] as $k => $mt ) { $accountingaccount = new AccountingAccount($db); @@ -357,7 +357,7 @@ if ($action == 'export_csv') { print "\n"; } } - + // Third party foreach ( $tabttc[$key] as $k => $mt ) { print '"' . $date . '"' . $sep; @@ -371,11 +371,11 @@ if ($action == 'export_csv') { } } } else { - + llxHeader('', $langs->trans("PurchasesJournal")); - + $form = new Form($db); - + $nom = $langs->trans("PurchasesJournal"); $nomlink = ''; $periodlink = ''; @@ -387,16 +387,16 @@ if ($action == 'export_csv') { } else { $description .= $langs->trans("DepositsAreIncluded"); } - + $period = $form->select_date($date_start, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end, 'date_end', 0, 0, 0, '', 1, 0, 1); report_header($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array ( - 'action' => '' + 'action' => '' )); - + print ''; - + print ''; - + print ' '; - + /* * Show result array */ print '

'; - + $i = 0; print ""; print ""; @@ -425,25 +425,25 @@ if ($action == 'export_csv') { print ""; print ""; print "\n"; - + $var = true; $r = ''; - + $invoicestatic = new FactureFournisseur($db); - + foreach ( $tabfac as $key => $val ) { $invoicestatic->id = $key; $invoicestatic->ref = $val["ref"]; $invoicestatic->type = $val["type"]; $invoicestatic->description = html_entity_decode(dol_trunc($val["description"], 32)); - + $date = dol_print_date($db->jdate($val["date"]), 'day'); - + // Product / Service foreach ( $tabht[$key] as $k => $mt ) { $accountingaccount = new AccountingAccount($db); $accountingaccount->fetch(null, $k); - + if ($mt) { print ""; print ""; @@ -468,7 +468,7 @@ if ($action == 'export_csv') { } } print ""; - + // Third party foreach ( $tabttc[$key] as $k => $mt ) { print ""; @@ -483,12 +483,12 @@ if ($action == 'export_csv') { print '"; } print ""; - + $var = ! $var; } - + print "
" . $langs->trans("Account") . "" . $langs->trans("Type") . "" . $langs->trans("Debit") . "" . $langs->trans("Credit") . "
" . $date . "
" . $date . "' . ($mt >= 0 ? price($mt) : '') . "
"; - + // End of page llxFooter(); } diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index 5166d503b06..61f503f5fcb 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -119,16 +119,16 @@ if ($result) { $tabtva = array (); $tabttc = array (); $tabcompany = array (); - + $num = $db->num_rows($result); $i = 0; - + while ( $i < $num ) { $obj = $db->fetch_object($result); // les variables $cptcli = (! empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER)) ? $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER : $langs->trans("CodeNotDef"); $compta_soc = (! empty($obj->code_compta)) ? $obj->code_compta : $cptcli; - + $compta_prod = $obj->compte; if (empty($compta_prod)) { if ($obj->product_type == 0) @@ -138,7 +138,7 @@ if ($result) { } $cpttva = (! empty($conf->global->ACCOUNTING_VAT_SOLD_ACCOUNT)) ? $conf->global->ACCOUNTING_VAT_SOLD_ACCOUNT : $langs->trans("CodeNotDef"); $compta_tva = (! empty($obj->account_tva) ? $obj->account_tva : $cpttva); - + // Situation invoices handling $line = new FactureLigne($db); $line->fetch($obj->rowid); @@ -153,7 +153,7 @@ if ($result) { } else { $situation_ratio = 1; } - + // Invoice lines $tabfac[$obj->rowid]["date"] = $obj->df; $tabfac[$obj->rowid]["ref"] = $obj->facnumber; @@ -172,9 +172,9 @@ if ($result) { $tabcompany[$obj->rowid] = array ( 'id' => $obj->socid, 'name' => $obj->name, - 'code_client' => $obj->code_compta + 'code_client' => $obj->code_compta ); - + $i ++; } } else { @@ -190,7 +190,7 @@ if ($result) { if ($action == 'writebookkeeping') { $now = dol_now(); $error = 0; - + foreach ( $tabfac as $key => $val ) { foreach ( $tabttc[$key] as $k => $mt ) { $bookkeeping = new BookKeeping($db); @@ -209,14 +209,14 @@ if ($action == 'writebookkeeping') { $bookkeeping->credit = ($mt < 0) ? $mt : 0; $bookkeeping->code_journal = $conf->global->ACCOUNTING_SELL_JOURNAL; $bookkeeping->fk_user_author = $user->id; - + $result = $bookkeeping->create($user); if ($result < 0) { $error ++; - setEventMessages($object->error, $object->errors, 'errors'); + setEventMessages($bookkeeping->error, $bookkeeping->errors, 'errors'); } } - + // Product / Service foreach ( $tabht[$key] as $k => $mt ) { if ($mt) { @@ -239,16 +239,16 @@ if ($action == 'writebookkeeping') { $bookkeeping->credit = ($mt >= 0) ? $mt : 0; $bookkeeping->code_journal = $conf->global->ACCOUNTING_SELL_JOURNAL; $bookkeeping->fk_user_author = $user->id; - + $result = $bookkeeping->create($user); if ($result < 0) { $error ++; - setEventMessages($object->error, $object->errors, 'errors'); + setEventMessages($bookkeeping->error, $bookkeeping->errors, 'errors'); } } } } - + // VAT // var_dump($tabtva); foreach ( $tabtva[$key] as $k => $mt ) { @@ -269,16 +269,16 @@ if ($action == 'writebookkeeping') { $bookkeeping->credit = ($mt >= 0) ? $mt : 0; $bookkeeping->code_journal = $conf->global->ACCOUNTING_SELL_JOURNAL; $bookkeeping->fk_user_author = $user->id; - + $result = $bookkeeping->create($user); if ($result < 0) { $error ++; - setEventMessages($object->error, $object->errors, 'errors'); + setEventMessages($bookkeeping->error, $bookkeeping->errors, 'errors'); } } } } - + if (empty($error)) { setEventMessages($langs->trans("GeneralLedgerIsWritten"), null, 'mesgs'); } @@ -288,23 +288,23 @@ if ($action == 'writebookkeeping') { if ($action == 'export_csv') { $sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV; $sell_journal = $conf->global->ACCOUNTING_SELL_JOURNAL; - + include DOL_DOCUMENT_ROOT . '/accountancy/tpl/export_journal.tpl.php'; - + $companystatic = new Client($db); - + // Model Cegid Expert Export - if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 2) + if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 2) { $sep = ";"; - + foreach ( $tabfac as $key => $val ) { $companystatic->id = $tabcompany[$key]['id']; $companystatic->name = $tabcompany[$key]['name']; $companystatic->client = $tabcompany[$key]['code_client']; - + $date = dol_print_date($db->jdate($val["date"]), '%d%m%Y'); - + foreach ( $tabttc[$key] as $k => $mt ) { print $date . $sep; print $sell_journal . $sep; @@ -316,7 +316,7 @@ if ($action == 'export_csv') { print $val["ref"]; print "\n"; } - + // Product / Service foreach ( $tabht[$key] as $k => $mt ) { $accountingaccount_static = new AccountingAccount($db); @@ -332,7 +332,7 @@ if ($action == 'export_csv') { print "\n"; } } - + // TVA foreach ( $tabtva[$key] as $k => $mt ) { if ($mt) { @@ -354,9 +354,9 @@ if ($action == 'export_csv') { $companystatic->id = $tabcompany[$key]['id']; $companystatic->name = $tabcompany[$key]['name']; $companystatic->client = $tabcompany[$key]['code_client']; - + $date = dol_print_date($db->jdate($val["date"]), 'day'); - + foreach ( $tabttc[$key] as $k => $mt ) { print '"' . $date . '"' . $sep; print '"' . $val["ref"] . '"' . $sep; @@ -366,12 +366,12 @@ if ($action == 'export_csv') { print '"' . ($mt < 0 ? price(- $mt) : '') . '"'; print "\n"; } - + // Product / Service foreach ( $tabht[$key] as $k => $mt ) { $accountingaccount = new AccountingAccount($db); $accountingaccount->fetch(null, $k); - + if ($mt) { print '"' . $date . '"' . $sep; print '"' . $val["ref"] . '"' . $sep; @@ -382,7 +382,7 @@ if ($action == 'export_csv') { print "\n"; } } - + // VAT foreach ( $tabtva[$key] as $k => $mt ) { if ($mt) { @@ -398,11 +398,11 @@ if ($action == 'export_csv') { } } } else { - + $form = new Form($db); - + llxHeader('', $langs->trans("SellsJournal")); - + $nom = $langs->trans("SellsJournal"); $nomlink = ''; $periodlink = ''; @@ -415,13 +415,13 @@ if ($action == 'export_csv') { $description .= $langs->trans("DepositsAreIncluded"); $period = $form->select_date($date_start, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end, 'date_end', 0, 0, 0, '', 1, 0, 1); report_header($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array ( - 'action' => '' + 'action' => '' )); - + print ''; - + print ''; - + print ' '; - + /* * Show result array */ print '

'; - + $i = 0; print ""; print ""; @@ -451,20 +451,20 @@ if ($action == 'export_csv') { print ""; print ""; print "\n"; - + $var = true; $r = ''; - + $invoicestatic = new Facture($db); $companystatic = new Client($db); - + foreach ( $tabfac as $key => $val ) { $invoicestatic->id = $key; $invoicestatic->ref = $val["ref"]; $invoicestatic->type = $val["type"]; - + $date = dol_print_date($db->jdate($val["date"]), 'day'); - + // Third party foreach ( $tabttc[$key] as $k => $mt ) { print ""; @@ -480,12 +480,12 @@ if ($action == 'export_csv') { print ""; } print ""; - + // Product / Service foreach ( $tabht[$key] as $k => $mt ) { $accountingaccount = new AccountingAccount($db); $accountingaccount->fetch(null, $k); - + if ($mt) { print ""; print ""; @@ -497,7 +497,7 @@ if ($action == 'export_csv') { print ""; } } - + // VAT foreach ( $tabtva[$key] as $k => $mt ) { if ($mt) { @@ -511,12 +511,12 @@ if ($action == 'export_csv') { print ""; } } - + $var = ! $var; } - + print "
" . $langs->trans("Debit") . "" . $langs->trans("Credit") . "
" . ($mt < 0 ? price(- $mt) : '') . "
" . $date . "
"; - + // End of page llxFooter(); } From 7953f77b073c7a3b45f2d9b5ed757cff7103e00d Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 11 Mar 2016 18:08:27 +0100 Subject: [PATCH 05/12] Fix: $fileparams is not defined --- htdocs/commande/card.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 83ad4d0ce70..83bd4d2e1ec 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1165,9 +1165,9 @@ if (empty($reshook)) - if (! $error && ! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->commande->creer) + if (! $error && ! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->commande->creer) { - if ($action == 'addcontact') + if ($action == 'addcontact') { if ($object->id > 0) { $contactid = (GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid')); @@ -1188,7 +1188,7 @@ if (empty($reshook)) } // bascule du statut d'un contact - else if ($action == 'swapstatut') + else if ($action == 'swapstatut') { if ($object->id > 0) { $result = $object->swapContactStatus(GETPOST('ligne')); @@ -1198,7 +1198,7 @@ if (empty($reshook)) } // Efface un contact - else if ($action == 'deletecontact') + else if ($action == 'deletecontact') { $result = $object->delete_contact($lineid); @@ -1241,7 +1241,7 @@ if ($action == 'create' && $user->rights->commande->creer) $projectid = 0; $remise_absolue = 0; - + if (! empty($origin) && ! empty($originid)) { // Parse element/subelement (ex: project_task) $element = $subelement = $origin; @@ -1252,7 +1252,7 @@ if ($action == 'create' && $user->rights->commande->creer) if ($element == 'project') { $projectid = $originid; - + if (!$cond_reglement_id) { $cond_reglement_id = $soc->cond_reglement_id; } @@ -1444,7 +1444,7 @@ if ($action == 'create' && $user->rights->commande->creer) print ''; // TODO How record was recorded OrderMode (llx_c_input_method) - + // Project if (! empty($conf->projet->enabled) && $socid > 0) { @@ -1542,7 +1542,7 @@ if ($action == 'create' && $user->rights->commande->creer) default: $newclassname = $classname; } - + print '' . $langs->trans($newclassname) . '' . $objectsrc->getNomUrl(1) . ''; print '' . $langs->trans('TotalHT') . '' . price($objectsrc->total_ht) . ''; print '' . $langs->trans('TotalVAT') . '' . price($objectsrc->total_tva) . ""; @@ -2021,7 +2021,7 @@ if ($action == 'create' && $user->rights->commande->creer) print ''; // TODO How record was recorded OrderMode (llx_c_input_method) - + // Project if (! empty($conf->projet->enabled)) { @@ -2377,6 +2377,7 @@ if ($action == 'create' && $user->rights->commande->creer) $ref = dol_sanitizeFileName($object->ref); include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; + $fileparams = dol_most_recent_file($conf->commande->dir_output . '/' . $ref, preg_quote($ref, '/').'[^\-]+'); $file = $fileparams['fullname']; // Define output language From 731d1cfe41c9a6d82330fb7b6f5eab299b636728 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 12 Mar 2016 12:07:11 +0100 Subject: [PATCH 06/12] Update changelog for 3.8.4 --- ChangeLog | 103 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) diff --git a/ChangeLog b/ChangeLog index 29666714337..47106e6170d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,109 @@ Upgrading to any other version or any other database system is abolutely require make a Dolibarr upgrade. +***** ChangeLog for 3.8.4 compared to 3.8.3 ***** +FIX: #3694 +FIX: #3798 #2519 Cron jobs would never be executed +FIX: #4155 Search Categories error +FIX: #4239 +FIX: #4272 Error when trying to print the page "Linked objects" of a Thirdparty +FIX: #4291 Correctly filter bank card GETPOSTs +FIX: #4291 Correctly filter external calendar GETPOSTs +FIX: #4341 +FIX: #4394 Untranslated label in list of expense reports +FIX: #4414 Supplier invoices use FAC_FORCE_DATE_VALIDATION client invoices property +FIX: #4418 +FIX: #4425 Missing "VAT" translation in supplier order popup +FIX: #4434 Weird behaviour when enabling multiprices +FIX: #4440 Wrong price is filled by Product::fetch into multiprices arrays +FIX: #4453 SEPA Direct Debit generated XML shows a trailing comma in RmtInf field +FIX: #4528 +FIX: #4556 desiredstock and seuil_stock_alerte cleared on modify product card +FIX: #4580 +FIX: #4583 Incorrect call of Categories::containing throws a DoliDB error +FIX: #4649 Wrong parameters order +FIX: #4768 +FIX: #4785 +FIX: Add a test to show bugged module with a bad declaration of dictionaries to avoid to see clean module to be breaked. +FIX: add Croatia into list of country in EEC +FIX: add missing global def for ttc column +FIX: ajax error with multicompany module +FIX: Avoid errors when batch stock is negative +FIX: bad field in select +FIX: bad path +FIX: bad transaction level due to code of situation invoices +FIX: best sql request +FIX: bookmark's user change after update if the user hasn't superadmin right +FIX: call trigger LINEBILL_SUPPLIER_CREATE +FIX: Can not disabled an opened service line in a contract +FIX: can't clone event +FIX: can't send mail to thirdparty contact if no mail defined on thirdparty card +FIX: Check stock of batch on shippment +FIX: code corrupting database +FIX: compatibility with multicompany transversal mode +FIX: compatibility with multicompany transversal mode and more security issue +FIX: Contrat card don't consider user permissions to show active/unactive service button +FIX: CVE CVE-2015-8685 +FIX: Deadlock situation. Can't edit anymore contract. FIX: List of automatic events was not visible. +FIX: disable main.inc.php hooks +FIX: do not show warning if account defined +FIX: don't see the sales representative of anothers entities +FIX: duration format +FIX: Correct problem of rights beetween tax and salaries module +FIX: Email templates not compatible with Multicompany +FIX: $fileparams is not defined +FIX: filter by socid if from customer card +FIX: for avoid conflict with "global $m" in memory.lib.php +FIX: for avoid division by 0 +FIX: hover css +FIX: If option to hide automatic ECM is on, dont show menu. +FIX: if we dont use SUPPLIER_ORDER_USE_HOUR_FOR_DELIVERY_DATE the hour is displayed on pdf +FIX: Introduce hidden option to disable feature than hangs when too much data +FIX: ISSUE #4506 : make working the PROPAL_CLONE_ON_CREATE_PAGE hidden constant +FIX: issue when bank module is disabled FIX: missing entity filter for lines of payment +FIX: list of leave request was not showing label correctly. +FIX: MAIN_THIRDPARTY_CREATION_INDIVIDUAL syntax error in name +FIX: markRate can be 100 +FIX: minor css error (pixel size must have "px"). Compatibility with old behaviour. +FIX: missing field "label" +FIX: missing signature and uniformize code between card and script +FIX: missing traduction +FIX: missing translation +FIX: missing translation key +FIX: nblignes not calculated after hook and hook can't modify this value. Usefull for modules +FIX: no database structure change is allowed into minor versions +FIX: no transaction in this place +FIX: Noway to validate a leave request for some uer even if they have permission for. +FIX: Option to disable meteo was not set correctly in edit mode +FIX: $outputlangs is not defined (dolibarr 3.7, 3.8, 3.9) +FIX: path to copyrighted files +FIX: php unit to work both with old and new setup +FIX: Purge of temp files was broken +FIX: Relative discount decimals are not saved +FIX: Removed a bugged list. Fixed another one to not count data of previous year. +FIX: retrieve correct pu_ttc (set by printObjectLine function) like in 3.7 +FIX: search product in customer product prices doesn't work +FIX: Some filters are lost when paging +FIX: sql injection #4341 +FIX: sql injection even when code is on several lines +FIX: sql request and total for time spen for current month +FIX: Sql syntax error in doc_generic_task_odt +FIX: Status filter don't work +FIX: Strict Standards: Only variables should be passed by reference +FIX: The part added with hidden option MAIN_DOC_USE_TIMING was included with a . instead of -. This make os think it is part of extension instead of file name. +FIX: The third dashboard don't consider user permissions +FIX: the view my task must show only task you are assigned to +FIX: to allow phpunit of migration process for 3.4 to 3.5 +FIX: to allow phpunit of migration process for 3.5 to 3.6 +FIX: userlocaltax +FIX: view of product image when using old path +FIX: size of image uploaded on user. +FIX: We must ue the "small" size of imge to show on card pages. +FIX: When we make a direct assignement on a task to a user, we must check he is also assigned to project (and if not assign it) +FIX: wrong fk_parent_line in credit note with invoiceAvoirWithLines option +FIX: wrong modelpdf var name +FIX: wrong object name + ***** ChangeLog for 3.8.3 compared to 3.8.2 ***** FIX: #3805 FIX: #3231 [Members] Public subscription page displays GeoIP error From eb65707da8e431f0b4a495039ced1586e62aff5c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 12 Mar 2016 12:50:05 +0100 Subject: [PATCH 07/12] Fix code to publishing packages on foundation server --- build/makepack-dolibarr.pl | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 9a6a9175ca7..7482d181c64 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -1086,6 +1086,14 @@ if ($nboftargetok) { "$DESTI/standard/$FILENAMETGZ.tgz"=>'Dolibarr ERP-CRM', "$DESTI/standard/$FILENAMETGZ.zip"=>'Dolibarr ERP-CRM' ); + %filestoscanstableasso=( + "$DESTI/package_rpm_generic/$FILENAMERPM"=>'package_rpm_generic', + "$DESTI/package_debian-ubuntu/${FILENAMEDEB}_all.deb"=>'package_debian-ubuntu', + "$DESTI/package_windows/$FILENAMEEXEDOLIWAMP.exe"=>'package_windows', + "$DESTI/standard/$FILENAMETGZ.tgz"=>'standard', + "$DESTI/standard/$FILENAMETGZ.zip"=>'standard' + ); + use POSIX qw/strftime/; foreach my $file (sort keys %filestoscansf) { @@ -1128,13 +1136,15 @@ if ($nboftargetok) { if ($target eq 'SF') { $destFolder="$NEWPUBLISH/$filestoscan{$file}/".$MAJOR.'.'.$MINOR.'.'.$BUILD; - print "Publish file ".$file." to $NEWPUBLISH/".$filestoscan{$file}."\n"; } + elsif ($target eq 'ASSO' && $NEWPUBLISH =~ /stable/) { + $destFolder="$NEWPUBLISH/$filestoscanstableasso{$file}"; + } else { $destFolder="$NEWPUBLISH"; - print "Publish file ".$file." to $NEWPUBLISH\n"; } + print "Publish file ".$file." to ".$destFolder."\n"; # mkdir #my $ssh = Net::SSH::Perl->new("frs.sourceforge.net"); From 58988e4ad2d990a1fdf87019c7474b824cf7021f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 12 Mar 2016 18:22:44 +0100 Subject: [PATCH 08/12] Fix not visible menu title --- htdocs/theme/eldy/style.css.php | 110 ++++++++++++++++++++++++++++---- htdocs/theme/md/style.css.php | 105 ++++++++++++++++++++++++++---- 2 files changed, 189 insertions(+), 26 deletions(-) diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 310da9087aa..4d5ae4a3ba3 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -209,6 +209,8 @@ print '$colortexttitlenotab='.$colortexttitlenotab."\n"; print '$colortexttitle='.$colortexttitle."\n"; print '$colortext='.$colortext."\n"; print '$colortextlink='.$colortextlink."\n"; +print '$colortextbackhmenu='.$colortextbackhmenu."\n"; +print '$colortextbackvmenu='.$colortextbackvmenu."\n"; print 'dol_hide_topmenu='.$dol_hide_topmenu."\n"; print 'dol_hide_leftmenu='.$dol_hide_leftmenu."\n"; print 'dol_optimize_smallscreen='.$dol_optimize_smallscreen."\n"; @@ -284,15 +286,24 @@ input.removedassigned { vertical-align: text-bottom; margin-bottom: -3px; } -input.smallpadd { +input.smallpadd { /* Used for timesheet input */ padding-left: 0px !important; padding-right: 0px !important; } +span.timesheetalreadyrecorded input { + /*font-size: smaller;*/ + border: none; + /*background: transparent;*/ +} select.flat, form.flat select { font-weight: normal; } +.optiongrey { + opacity: 0.5; +} +select:invalid { color: gray; } input:disabled { background:#ddd; } @@ -509,6 +520,23 @@ div.myavailability { padding-top: 4px; padding-bottom: 4px; } +.checkallactions { + vertical-align: top; + margin-top: 6px; + margin-left: 4px; +} +.selectlimit { + margin-right: 10px !important; +} +.strikefordisabled { + text-decoration: line-through; +} +.tdoverflow { + max-width: 0; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} /* ============================================================================== */ @@ -593,7 +621,6 @@ div.fiche { margin-: dol_optimize_smallscreen)?'12':'6')); ?>px; dol_hide_leftmenu) && ! empty($conf->dol_hide_topmenu)) print 'margin-top: 4px;'; ?> } - div.fichecenter { width: 100%; clear: both; /* This is to have div fichecenter that are true rectangles */ @@ -1184,6 +1211,8 @@ div.vmenu, td.vmenu { .menu_contenu { padding-top: 5px; padding-bottom: 2px; + overflow: hidden; + text-overflow: ellipsis; } #menu_contenu_logo { padding-right: 4px; } .companylogo { } @@ -1195,7 +1224,7 @@ a.vmenu:link, a.vmenu:visited { color: #; } a.vsmenu:link, a.vsmenu:visited, a.vsmenu:hover, a.vsmenu:active, span.vsmenu { font-size:px; font-family: ; text-align: ; font-weight: normal; color: #202020; margin: 1px 1px 1px 8px; } font.vsmenudisabled { font-size:px; font-family: ; text-align: ; font-weight: normal; color: #aaa; } -a.vsmenu:link, a.vsmenu:visited { color: #; } +a.vsmenu:link, a.vsmenu:visited { color: #; white-space: nowrap; } font.vsmenudisabledmargin { margin: 1px 1px 1px 8px; } a.help:link, a.help:visited, a.help:hover, a.help:active { font-size:px; font-family: ; text-align: ; font-weight: normal; color: #666666; text-decoration: none; } @@ -2546,12 +2575,23 @@ div.tabBar .noborder { background-color: #; } +span.boxstatstext { + opacity: 0.8; + line-height: 18px; +} span.boxstatsindicator { font-size: 110%; - font-weight: bold; + font-weight: normal; } span.dashboardlineindicator, span.dashboardlineindicatorlate { font-size: 120%; + font-weight: normal; +} +span.dashboardlineok { + color: #008800; +} +span.dashboardlineko { + color: #880000; font-weight: bold; } .boxtable { @@ -3950,6 +3990,12 @@ border-top-right-radius: 6px; +/* For demo pages */ +img.demothumb { + box-shadow: 2px 2px 8px #888; +} + + /* The theme for public pages */ .public_body { margin: 20px; @@ -3960,6 +4006,9 @@ border-top-right-radius: 6px; + + + /* CSS style used for small screen */ .imgopensurveywizard @@ -3977,25 +4026,53 @@ border-top-right-radius: 6px; } -@media only screen and (max-width: px) +/* nboftopmenuentries = , fontsize= */ +/* rule to reduce top menu - 1st reduction */ +@media only screen and (max-width: px) { + div.tmenucenter { + max-width: px; /* size of viewport */ + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + color: #; + } .mainmenuaspan { - display: none; + /*display: none;*/ + font-size: 10px; } + .topmenuimage { + background-size: 26px auto; + margin-top: 0px; + } + li.tmenu, li.tmenusel { min-width: 32px; } div.mainmenu { min-width: auto; } - .topmenuimage { - background-size: 26px auto; - margin-top: 8px; - } div.tmenuleft { display: none; } } +/* rule to reduce top menu - 2nd reduction */ +@media only screen and (max-width: px) +{ + div.tmenucenter { + max-width: px; /* size of viewport */ + text-overflow: clip; + } + .mainmenuaspan { + /*display: none;*/ + font-size: 10px; + } + .topmenuimage { + background-size: 20px auto; + margin-top: 2px; + } +} +/* rule to reduce top menu - 3rd reduction */ @media only screen and (max-width: 570px) { /* Reduce login top right info */ @@ -4013,13 +4090,20 @@ border-top-right-radius: 6px; top: 4px; max-width: 82px; } + li.tmenu, li.tmenusel { + min-width: 30px; + } + div.tmenucenter { + text-overflow: clip; + } + .topmenuimage { + background-size: 20px auto; + margin-top: 2px !important; + } div.mainmenu { min-width: 20px; } - .topmenuimage { - background-size: 20px auto; - } #tooltip { position: absolute; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 38ac3d13c1e..764bfe2ab4d 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -204,6 +204,8 @@ print '$colortexttitlenotab='.$colortexttitlenotab."\n"; print '$colortexttitle='.$colortexttitle."\n"; print '$colortext='.$colortext."\n"; print '$colortextlink='.$colortextlink."\n"; +print '$colortextbackhmenu='.$colortextbackhmenu."\n"; +print '$colortextbackvmenu='.$colortextbackvmenu."\n"; print 'dol_hide_topmenu='.$dol_hide_topmenu."\n"; print 'dol_hide_leftmenu='.$dol_hide_leftmenu."\n"; print 'dol_optimize_smallscreen='.$dol_optimize_smallscreen."\n"; @@ -506,6 +508,24 @@ div.myavailability { padding-top: 4px; padding-bottom: 4px; } +.checkallactions { + vertical-align: top; + margin-top: 6px; + margin-left: 4px; +} +.selectlimit { + margin-right: 10px !important; +} +.strikefordisabled { + text-decoration: line-through; +} +.tdoverflow { + max-width: 0; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + /* ============================================================================== */ /* Styles to hide objects */ @@ -644,7 +664,6 @@ div.fiche { dol_hide_leftmenu) && ! empty($conf->dol_hide_topmenu)) print 'margin-top: 4px;'; ?> margin-bottom: 15px; } - div.fichecenter { width: 100%; clear: both; /* This is to have div fichecenter that are true rectangles */ @@ -827,13 +846,14 @@ ul.tmenu { /* t r b l */ } ul.tmenu li { background: rgb(); - + /* background-image: linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(0,0,0,.3) 100%); background-image: -o-linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(0,0,0,.3) 100%); background-image: -moz-linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(0,0,0,.3) 100%); background-image: -webkit-linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(0,0,0,.3) 100%); background-image: -ms-linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(0,0,0,.3) 100%); background-image: -webkit-gradient( linear, left top, left bottom, color-stop(0, rgba(255,255,255,.3)), color-stop(1, rgba(0,0,0,.3)) ); + */ } li.tmenu, li.tmenusel { @@ -1229,7 +1249,12 @@ div.vmenu, td.vmenu { width: 202px; } -.menu_contenu { padding-top: 4px; padding-bottom: 3px;} +.menu_contenu { + padding-top: 4px; + padding-bottom: 3px; + overflow: hidden; + text-overflow: ellipsis; +} #menu_contenu_logo { padding-right: 4px; } .companylogo { padding-top: 4px; } .searchform { padding-top: 8px; } @@ -1240,7 +1265,7 @@ a.vmenu:link, a.vmenu:visited { color: #; } a.vsmenu:link, a.vsmenu:visited, a.vsmenu:hover, a.vsmenu:active, span.vsmenu { font-size:px; font-family: ; text-align: ; font-weight: normal; color: #202020; margin: 1px 1px 1px 8px; } font.vsmenudisabled { font-size:px; font-family: ; text-align: ; font-weight: normal; color: #aaa; } -a.vsmenu:link, a.vsmenu:visited { color: #; } +a.vsmenu:link, a.vsmenu:visited { color: #; white-space: nowrap; } font.vsmenudisabledmargin { margin: 1px 1px 1px 8px; } a.help:link, a.help:visited, a.help:hover, a.help:active { font-size:px; font-family: ; text-align: ; font-weight: normal; color: #666666; text-decoration: none; } @@ -2378,14 +2403,25 @@ div.tabBar .noborder { background-color: #; } +span.boxstatstext { + opacity: 0.8; + line-height: 18px; +} span.boxstatsindicator { font-size: 110%; - font-weight: bold; + font-weight: normal; } span.dashboardlineindicator, span.dashboardlineindicatorlate { font-size: 120%; font-weight: bold; } +span.dashboardlineok { + color: #008800; +} +span.dashboardlineko { + color: #880000; + font-weight: bold; +} .boxtable { -moz-box-shadow: 3px 3px 4px #f4f4f4; @@ -3785,6 +3821,13 @@ border-top-right-radius: 6px; +/* For demo pages */ +img.demothumb { + box-shadow: 2px 2px 8px #888; + margin-bottom: 4px; +} + + /* The theme for public pages */ .public_body { margin: 20px; @@ -3827,25 +3870,53 @@ border-top-right-radius: 6px; } } + +/* nboftopmenuentries = , fontsize= */ +/* rule to reduce top menu - 1st reduction */ @media only screen and (max-width: px) { + div.tmenucenter { + max-width: px; /* size of viewport */ + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + color: #; + } .mainmenuaspan { - display: none; + /*display: none;*/ + font-size: 10px; } + .topmenuimage { + background-size: 26px auto; + margin-top: 0px; + } li.tmenu, li.tmenusel { min-width: 32px; } div.mainmenu { min-width: auto; } - .topmenuimage { - background-size: 26px auto; - margin-top: 8px; - } div.tmenuleft { display: none; } } +/* rule to reduce top menu - 2nd reduction */ +@media only screen and (max-width: px) +{ + div.tmenucenter { + max-width: px; /* size of viewport */ + text-overflow: clip; + } + .mainmenuaspan { + /*display: none;*/ + font-size: 10px; + } + .topmenuimage { + background-size: 20px auto; + margin-top: 2px; + } +} +/* rule to reduce top menu - 3rd reduction */ @media only screen and (max-width: 570px) { /* Reduce login top right info */ @@ -3863,12 +3934,20 @@ border-top-right-radius: 6px; top: 9px; } + li.tmenu, li.tmenusel { + min-width: 30px; + } + + div.tmenucenter { + text-overflow: clip; + } + .topmenuimage { + background-size: 20px auto; + margin-top: 2px !important; + } div.mainmenu { min-width: 20px; } - .topmenuimage { - background-size: 20px auto; - } #tooltip { position: absolute; From bad07bc38c0b9c0a5508f642e5983602c604d6bb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 12 Mar 2016 18:30:19 +0100 Subject: [PATCH 09/12] Fix dos and bom and end of line --- htdocs/includes/ccampbell/chromephp/ChromePhp.php | 0 htdocs/includes/mobiledetect/mobiledetectlib/tests/BasicsTest.php | 0 htdocs/includes/tecnickcom/tcpdf/tools/tcpdf_addfont.php | 0 3 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 htdocs/includes/ccampbell/chromephp/ChromePhp.php mode change 100755 => 100644 htdocs/includes/mobiledetect/mobiledetectlib/tests/BasicsTest.php mode change 100755 => 100644 htdocs/includes/tecnickcom/tcpdf/tools/tcpdf_addfont.php diff --git a/htdocs/includes/ccampbell/chromephp/ChromePhp.php b/htdocs/includes/ccampbell/chromephp/ChromePhp.php old mode 100755 new mode 100644 diff --git a/htdocs/includes/mobiledetect/mobiledetectlib/tests/BasicsTest.php b/htdocs/includes/mobiledetect/mobiledetectlib/tests/BasicsTest.php old mode 100755 new mode 100644 diff --git a/htdocs/includes/tecnickcom/tcpdf/tools/tcpdf_addfont.php b/htdocs/includes/tecnickcom/tcpdf/tools/tcpdf_addfont.php old mode 100755 new mode 100644 From 0727ee88e6ea4dd205949af5f9644be9226d68f9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 12 Mar 2016 18:33:32 +0100 Subject: [PATCH 10/12] More robust initdemo script. --- dev/initdata/initdemo.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dev/initdata/initdemo.sh b/dev/initdata/initdemo.sh index e8ea47c71b2..10dc671e09d 100755 --- a/dev/initdata/initdemo.sh +++ b/dev/initdata/initdemo.sh @@ -171,6 +171,8 @@ then fi #echo "mysql -P$port -u$admin $passwd $base < $mydir/$dumpfile" #mysql -P$port -u$admin $passwd $base < $mydir/$dumpfile +#echo "drop old table" +echo "drop table llx_accounting_account;" | mysql -P$port -u$admin $passwd $base echo "mysql -P$port -u$admin -p***** $base < $mydir/$dumpfile" mysql -P$port -u$admin $passwd $base < $mydir/$dumpfile export res=$? From 1b30c1adb43016e4e9d818169fe849d57986c482 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 12 Mar 2016 20:49:38 +0100 Subject: [PATCH 11/12] Fix regression on vat calculation when invoice was not a situation invoice --- htdocs/accountancy/journal/sellsjournal.php | 4 ++-- htdocs/compta/facture.php | 4 ++-- htdocs/compta/facture/class/facture.class.php | 13 ++++++++++--- htdocs/compta/journal/sellsjournal.php | 4 ++-- .../core/modules/facture/doc/pdf_crabe.modules.php | 8 +++++--- 5 files changed, 21 insertions(+), 12 deletions(-) diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index 61f503f5fcb..d0c65e8e909 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -141,8 +141,8 @@ if ($result) { // Situation invoices handling $line = new FactureLigne($db); - $line->fetch($obj->rowid); - $prev_progress = $line->get_prev_progress(); + $line->fetch($obj->fdid); // id of line + $prev_progress = $line->get_prev_progress($obj->rowid); // id of invoice if ($obj->type == Facture::TYPE_SITUATION) { // Avoid divide by 0 if ($obj->situation_percent == 0) { diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 951270c19fe..b45ce4a33e3 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1564,7 +1564,7 @@ if (empty($reshook)) $line = new FactureLigne($db); $line->fetch(GETPOST('lineid')); - $percent = $line->get_prev_progress(); + $percent = $line->get_prev_progress($object->id); if (GETPOST('progress') < $percent) { @@ -1682,7 +1682,7 @@ if (empty($reshook)) { foreach ($object->lines as $line) { - $percent = $line->get_prev_progress(); + $percent = $line->get_prev_progress($object->id); if (GETPOST('all_progress') < $percent) { $mesg = '
' . $langs->trans("CantBeLessThanMinPercent") . '
'; $result = -1; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 7c761ccb40f..0f41620bd89 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -4256,15 +4256,22 @@ class FactureLigne extends CommonInvoiceLine } /** - * Returns situation_percent of the previous line + * Returns situation_percent of the previous line. + * Warning: If invoice is a replacement invoice, this->fk_prev_id is id of the replaced line. * - * @return int >= 0 + * @param int $invoiceid Invoice id + * @return int >= 0 */ - function get_prev_progress() + function get_prev_progress($invoiceid) { if (is_null($this->fk_prev_id) || empty($this->fk_prev_id) || $this->fk_prev_id == "") { return 0; } else { + // If invoice is a not a situation invoice, this->fk_prev_id is used for something else + $tmpinvoice=new Facture($this->db); + $tmpinvoice->fetch($invoiceid); + if ($tmpinvoice->type != Facture::TYPE_SITUATION) return 0; + $sql = 'SELECT situation_percent FROM ' . MAIN_DB_PREFIX . 'facturedet WHERE rowid=' . $this->fk_prev_id; $resql = $this->db->query($sql); if ($resql && $resql->num_rows > 0) { diff --git a/htdocs/compta/journal/sellsjournal.php b/htdocs/compta/journal/sellsjournal.php index cddbdcaa064..c0ebdb1aa3a 100644 --- a/htdocs/compta/journal/sellsjournal.php +++ b/htdocs/compta/journal/sellsjournal.php @@ -166,8 +166,8 @@ if ($result) // Situation invoices handling $line = new FactureLigne($db); - $line->fetch($obj->id); - $prev_progress = $line->get_prev_progress(); + $line->fetch($obj->id); // id of line + $prev_progress = $line->get_prev_progress($obj->rowid); // id on invoice if ($obj->type==Facture::TYPE_SITUATION) { // Avoid divide by 0 if ($obj->situation_percent == 0) { diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 8637f02bebc..c627da68418 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -167,7 +167,7 @@ class pdf_crabe extends ModelePDFFactures function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0) { global $user,$langs,$conf,$mysoc,$db,$hookmanager; - + if (! is_object($outputlangs)) $outputlangs=$langs; // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1'; @@ -540,13 +540,14 @@ class pdf_crabe extends ModelePDFFactures $pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->postotalht, 3, $total_excl_tax, 0, 'R', 0); // Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva - $prev_progress = $object->lines[$i]->get_prev_progress(); + $prev_progress = $object->lines[$i]->get_prev_progress($object->id); if ($prev_progress > 0) // Compute progress from previous situation { $tvaligne = $object->lines[$i]->total_tva * ($object->lines[$i]->situation_percent - $prev_progress) / $object->lines[$i]->situation_percent; } else { $tvaligne = $object->lines[$i]->total_tva; } + $localtax1ligne=$object->lines[$i]->total_localtax1; $localtax2ligne=$object->lines[$i]->total_localtax2; $localtax1_rate=$object->lines[$i]->localtax1_tx; @@ -1103,7 +1104,8 @@ class pdf_crabe extends ModelePDFFactures } } } - //} + + //} // VAT foreach($this->tva as $tvakey => $tvaval) { From f345ff7300a01d4229feb2643b512a946525bb5b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 13 Mar 2016 01:11:42 +0100 Subject: [PATCH 12/12] Fix regression on vat calculation when invoice was not a situation invoice --- htdocs/accountancy/journal/sellsjournal.php | 7 ++++--- htdocs/compta/journal/sellsjournal.php | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index d0c65e8e909..19bca595dd7 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -142,13 +142,14 @@ if ($result) { // Situation invoices handling $line = new FactureLigne($db); $line->fetch($obj->fdid); // id of line - $prev_progress = $line->get_prev_progress($obj->rowid); // id of invoice + $prev_progress = 0; if ($obj->type == Facture::TYPE_SITUATION) { - // Avoid divide by 0 + // Avoid divide by 0 if ($obj->situation_percent == 0) { $situation_ratio = 0; } else { - $situation_ratio = ($obj->situation_percent - $prev_progress) / $obj->situation_percent; + $prev_progress = $line->get_prev_progress($obj->rowid); // id of invoice + $situation_ratio = ($obj->situation_percent - $prev_progress) / $obj->situation_percent; } } else { $situation_ratio = 1; diff --git a/htdocs/compta/journal/sellsjournal.php b/htdocs/compta/journal/sellsjournal.php index c0ebdb1aa3a..0cbd5068077 100644 --- a/htdocs/compta/journal/sellsjournal.php +++ b/htdocs/compta/journal/sellsjournal.php @@ -167,13 +167,14 @@ if ($result) // Situation invoices handling $line = new FactureLigne($db); $line->fetch($obj->id); // id of line - $prev_progress = $line->get_prev_progress($obj->rowid); // id on invoice + $prev_progress = 0; if ($obj->type==Facture::TYPE_SITUATION) { // Avoid divide by 0 if ($obj->situation_percent == 0) { $situation_ratio = 0; } else { - $situation_ratio = ($obj->situation_percent - $prev_progress) / $obj->situation_percent; + $prev_progress = $line->get_prev_progress($obj->rowid); // id on invoice + $situation_ratio = ($obj->situation_percent - $prev_progress) / $obj->situation_percent; } } else { $situation_ratio = 1;