Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
63f3143718
@ -4633,7 +4633,7 @@ else if ($id > 0 || ! empty($ref))
|
||||
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 . '&action=create&accountid='.$object->fk_account.'">' . $langs->trans('DoPayment') . '</a></div>';
|
||||
|
||||
@ -628,6 +628,7 @@ class CMailFile
|
||||
|
||||
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;
|
||||
|
||||
@ -173,7 +173,7 @@ abstract class CommonInvoice extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
|
||||
@ -795,7 +795,7 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$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";
|
||||
@ -814,6 +814,7 @@ class pdf_crabe extends ModelePDFFactures
|
||||
|
||||
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);
|
||||
@ -1304,7 +1305,7 @@ class pdf_crabe extends ModelePDFFactures
|
||||
|
||||
$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');
|
||||
@ -1322,9 +1323,10 @@ class pdf_crabe extends ModelePDFFactures
|
||||
// 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);
|
||||
}
|
||||
|
||||
@ -39,34 +39,33 @@ require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
|
||||
// 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;
|
||||
|
||||
@ -75,13 +74,13 @@ llxHeader('', $langs->trans('HRMArea'));
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
@ -524,7 +524,7 @@ foreach($valid_dashboardlines as $board)
|
||||
}
|
||||
}
|
||||
//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">';
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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);
|
||||
@ -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);
|
||||
|
||||
29
htdocs/install/mysql/tables/llx_website_account.key.sql
Normal file
29
htdocs/install/mysql/tables/llx_website_account.key.sql
Normal file
@ -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
htdocs/install/mysql/tables/llx_website_account.sql
Normal file
36
htdocs/install/mysql/tables/llx_website_account.sql
Normal file
@ -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;
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -270,7 +270,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
// 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);
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user