Skip to content

Commit

Permalink
Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Jul 2, 2018
2 parents dc69960 + 7bf33b1 commit 63f3143
Show file tree
Hide file tree
Showing 13 changed files with 94 additions and 24 deletions.
2 changes: 1 addition & 1 deletion htdocs/compta/facture/card.php
Expand Up @@ -4633,7 +4633,7 @@ function js_recalculate_revenuestamp(){
if ($objectidnext) {
print '<div class="inline-block divButAction"><span class="butActionRefused" title="' . $langs->trans("DisabledBecauseReplacedInvoice") . '">' . $langs->trans('DoPayment') . '</span></div>';
} else {
//if ($resteapayer == 0) {
//if ($resteapayer == 0) { // Sometimes we can receive more, so we accept to enter more and will offer a button to convert into discount (but it is not a credit note, just a prepayment done)
// print '<div class="inline-block divButAction"><span class="butActionRefused" title="' . $langs->trans("DisabledBecauseRemainderToPayIsZero") . '">' . $langs->trans('DoPayment') . '</span></div>';
//} else {
print '<div class="inline-block divButAction"><a class="butAction" href="'. DOL_URL_ROOT .'/compta/paiement.php?facid=' . $object->id . '&amp;action=create&amp;accountid='.$object->fk_account.'">' . $langs->trans('DoPayment') . '</a></div>';
Expand Down
1 change: 1 addition & 0 deletions htdocs/core/class/CMailFile.class.php
Expand Up @@ -628,6 +628,7 @@ function sendfile()

if (! $res)
{
$langs->load("errors");
$this->error="Failed to send mail with php mail";
$linuxlike=1;
if (preg_match('/^win/i',PHP_OS)) $linuxlike=0;
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/class/commoninvoice.class.php
Expand Up @@ -173,7 +173,7 @@ function getSumDepositsUsed($multicurrency=0)
}

/**
* Return amount (with tax) of all credit notes and deposits invoices used by invoice
* Return amount (with tax) of all credit notes invoices + excess received used by invoice
*
* @param int $multicurrency Return multicurrency_amount instead of amount
* @return int <0 if KO, Sum of credit notes and deposits amount otherwise
Expand Down
8 changes: 5 additions & 3 deletions htdocs/core/modules/facture/doc/pdf_crabe.modules.php
Expand Up @@ -795,7 +795,7 @@ function _tableau_versements(&$pdf, $object, $posy, $outputlangs)
$pdf->SetFont('','', $default_font_size - 4);


// Loop on each deposits and credit notes included
// Loop on each discount available (deposits and credit notes and excess of payment included)
$sql = "SELECT re.rowid, re.amount_ht, re.multicurrency_amount_ht, re.amount_tva, re.multicurrency_amount_tva, re.amount_ttc, re.multicurrency_amount_ttc,";
$sql.= " re.description, re.fk_facture_source,";
$sql.= " f.type, f.datef";
Expand All @@ -814,6 +814,7 @@ function _tableau_versements(&$pdf, $object, $posy, $outputlangs)

if ($obj->type == 2) $text=$outputlangs->trans("CreditNote");
elseif ($obj->type == 3) $text=$outputlangs->trans("Deposit");
elseif ($obj->type == 0) $text=$outputlangs->trans("ExcessReceived");
else $text=$outputlangs->trans("UnknownType");

$invoice->fetch($obj->fk_facture_source);
Expand Down Expand Up @@ -1304,7 +1305,7 @@ function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs)

$pdf->SetTextColor(0,0,0);

$creditnoteamount=$object->getSumCreditNotesUsed(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? 1 : 0);
$creditnoteamount=$object->getSumCreditNotesUsed(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? 1 : 0); // Warning, this also include excess received
$depositsamount=$object->getSumDepositsUsed(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? 1 : 0);
//print "x".$creditnoteamount."-".$depositsamount;exit;
$resteapayer = price2num($total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 'MT');
Expand All @@ -1322,9 +1323,10 @@ function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs)
// Credit note
if ($creditnoteamount)
{
$labeltouse = ($outputlangs->transnoentities("CreditNotesOrExcessReceived") != "CreditNotesOrExcessReceived") ? $outputlangs->transnoentities("CreditNotesOrExcessReceived") : $outputlangs->transnoentities("CreditNotes");
$index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("CreditNotes"), 0, 'L', 0);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $labeltouse, 0, 'L', 0);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($creditnoteamount, 0, $outputlangs), 0, 'R', 0);
}
Expand Down
25 changes: 12 additions & 13 deletions htdocs/hrm/index.php
Expand Up @@ -39,34 +39,33 @@
// Load translation files required by the page
$langs->loadLangs(array('users', 'holidays', 'trips'));

$socid=GETPOST("socid");
$socid=GETPOST("socid","int");

// Protection if external user
if ($user->societe_id > 0) accessforbidden();

if (empty($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY)) $setupcompanynotcomplete=1;

$holiday = new Holiday($db);
$holidaystatic=new Holiday($db);



/*
* Actions
*/

// None

// Update sold
if (! empty($conf->holiday->enabled) && ! empty($setupcompanynotcomplete))
{
$result = $holiday->updateBalance();
}


/*
* View
*/

$holiday = new Holiday($db);
$holidaystatic=new Holiday($db);

// Update sold
if (! empty($conf->holiday->enabled))
{
$result = $holiday->updateBalance();
}

$childids = $user->getAllChildIds();
$childids[]=$user->id;

Expand All @@ -75,13 +74,13 @@
print load_fiche_titre($langs->trans("HRMArea"),'', 'title_hrm.png');


if (empty($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY)) $setupcompanynotcomplete=1;
if (! empty($setupcompanynotcomplete))
{
$langs->load("errors");
$warnpicto=img_warning($langs->trans("WarningMandatorySetupNotComplete"));
print '<br><div class="warning"><a href="'.DOL_URL_ROOT.'/admin/company.php?mainmenu=home'.(empty($setupcompanynotcomplete)?'':'&action=edit').'">'.$warnpicto.' '.$langs->trans("WarningMandatorySetupNotComplete").'</a></div>';

llxFooter();
exit;
}

Expand Down
2 changes: 1 addition & 1 deletion htdocs/index.php
Expand Up @@ -524,7 +524,7 @@
}
}
//var_dump($totallate, $totaltodo);
if(!empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE)) $totallate = round($totallate / $totaltodo * 100, 2);
if(!empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE) && !empty($totaltodo)) $totallate = round($totallate / $totaltodo * 100, 2);
//var_dump($totallate);
$boxwork='';
$boxwork.='<div class="box">';
Expand Down
7 changes: 4 additions & 3 deletions htdocs/install/mysql/migration/6.0.0-7.0.0.sql
Expand Up @@ -298,6 +298,7 @@ ALTER TABLE llx_website_account ADD INDEX idx_website_account_login (login);
ALTER TABLE llx_website_account ADD INDEX idx_website_account_import_key (import_key);
ALTER TABLE llx_website_account ADD INDEX idx_website_account_status (status);
ALTER TABLE llx_website_account ADD INDEX idx_website_account_fk_soc (fk_soc);
ALTER TABLE llx_website_account ADD INDEX idx_website_account_fk_website (fk_website);

ALTER TABLE llx_website_account ADD UNIQUE INDEX uk_website_account_login_website_soc(login, fk_website, fk_soc);

Expand Down Expand Up @@ -474,7 +475,7 @@ ALTER TABLE llx_extrafields MODIFY COLUMN list integer DEFAULT 1;

ALTER TABLE llx_extrafields MODIFY COLUMN langs varchar(64);

ALTER TABLE llx_holiday_config MODIFY COLUMN name varchar(128);
ALTER TABLE llx_holiday_config MODIFY COLUMN name varchar(128) NOT NULL;
ALTER TABLE llx_holiday_config ADD UNIQUE INDEX idx_holiday_config (name);

ALTER TABLE llx_societe MODIFY COLUMN ref_ext varchar(255);
Expand Down Expand Up @@ -670,9 +671,9 @@ ALTER TABLE llx_blockedlog ADD COLUMN user_fullname varchar(255);
ALTER TABLE llx_blockedlog MODIFY COLUMN ref_object varchar(255);

-- SPEC : use database type 'double' to store monetary values
ALTER TABLE llx_blockedlog MODIFY COLUMN amounts double(24,8);
ALTER TABLE llx_blockedlog MODIFY COLUMN amounts double(24,8) NOT NULL;
ALTER TABLE llx_chargessociales MODIFY COLUMN amount double(24,8);
ALTER TABLE llx_commande MODIFY COLUMN amount_ht double(24,8);
ALTER TABLE llx_commande MODIFY COLUMN amount_ht double(24,8) default 0;
ALTER TABLE llx_commande_fournisseur MODIFY COLUMN amount_ht double(24,8);
ALTER TABLE llx_don MODIFY COLUMN amount double(24,8);
ALTER TABLE llx_expensereport_rules MODIFY COLUMN amount double(24,8);
Expand Down
29 changes: 29 additions & 0 deletions htdocs/install/mysql/tables/llx_website_account.key.sql
@@ -0,0 +1,29 @@
-- Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see http://www.gnu.org/licenses/.


-- BEGIN MODULEBUILDER INDEXES
ALTER TABLE llx_website_account ADD INDEX idx_website_account_rowid (rowid);
ALTER TABLE llx_website_account ADD INDEX idx_website_account_login (login);
ALTER TABLE llx_website_account ADD INDEX idx_website_account_import_key (import_key);
ALTER TABLE llx_website_account ADD INDEX idx_website_account_status (status);
ALTER TABLE llx_website_account ADD INDEX idx_website_account_fk_soc (fk_soc);
ALTER TABLE llx_website_account ADD INDEX idx_website_account_fk_website (fk_website);
-- END MODULEBUILDER INDEXES

ALTER TABLE llx_website_account ADD UNIQUE INDEX uk_website_account_login_website_soc(login, fk_website, fk_soc);

ALTER TABLE llx_website_account ADD CONSTRAINT llx_website_account_fk_website FOREIGN KEY (fk_website) REFERENCES llx_website(rowid);

36 changes: 36 additions & 0 deletions htdocs/install/mysql/tables/llx_website_account.sql
@@ -0,0 +1,36 @@
-- Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see http://www.gnu.org/licenses/.


CREATE TABLE llx_website_account(
-- BEGIN MODULEBUILDER FIELDS
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
login varchar(64) NOT NULL,
pass_encoding varchar(24) NOT NULL,
pass_crypted varchar(128),
pass_temp varchar(128), -- temporary password when asked for forget password
fk_soc integer,
fk_website integer NOT NULL,
note_private text,
date_last_login datetime,
date_previous_login datetime,
date_creation datetime NOT NULL,
tms timestamp NOT NULL,
fk_user_creat integer NOT NULL,
fk_user_modif integer,
import_key varchar(14),
status integer
-- END MODULEBUILDER FIELDS
) ENGINE=innodb;
1 change: 1 addition & 0 deletions htdocs/langs/en_US/bills.lang
Expand Up @@ -282,6 +282,7 @@ RelativeDiscount=Relative discount
GlobalDiscount=Global discount
CreditNote=Credit note
CreditNotes=Credit notes
CreditNotesOrExcessReceived=Credit notes or excess received
Deposit=Down payment
Deposits=Down payments
DiscountFromCreditNote=Discount from credit note %s
Expand Down
2 changes: 1 addition & 1 deletion htdocs/langs/en_US/compta.lang
Expand Up @@ -78,7 +78,7 @@ MenuNewSocialContribution=New social/fiscal tax
NewSocialContribution=New social/fiscal tax
AddSocialContribution=Add social/fiscal tax
ContributionsToPay=Social/fiscal taxes to pay
AccountancyTreasuryArea=Accountancy/Treasury area
AccountancyTreasuryArea=Billing and payment area
NewPayment=New payment
Payments=Payments
PaymentCustomerInvoice=Customer invoice payment
Expand Down
1 change: 1 addition & 0 deletions htdocs/langs/fr_FR/bills.lang
Expand Up @@ -282,6 +282,7 @@ RelativeDiscount=Remise relative
GlobalDiscount=Ligne de déduction
CreditNote=Avoir
CreditNotes=Avoirs
CreditNotesOrExcessReceived=Avoirs ou trop perçus
Deposit=Acompte
Deposits=Acomptes
DiscountFromCreditNote=Remise issue de l'avoir %s
Expand Down
2 changes: 1 addition & 1 deletion htdocs/modulebuilder/template/myobject_card.php
Expand Up @@ -270,7 +270,7 @@ function init_myfunc()
// array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1),
// array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockDecrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1, 0, 0, '', 0, $forcecombo))
);
}*/
*/
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('XXX'), $text, 'confirm_xxx', $formquestion, 0, 1, 220);
}

Expand Down

0 comments on commit 63f3143

Please sign in to comment.