Merge branch '14.0' of github.com:Dolibarr/dolibarr into 14.0_fix_invoice_situation_with_credit_note
This commit is contained in:
commit
a7482a9ea0
@ -137,9 +137,9 @@ if (is_array($changeaccount) && count($changeaccount) > 0 && $user->rights->acco
|
||||
if (!$error) {
|
||||
$db->begin();
|
||||
|
||||
$sql1 = "UPDATE ".MAIN_DB_PREFIX."facturedet as l";
|
||||
$sql1 .= " SET l.fk_code_ventilation=".(GETPOST('account_parent', 'int') > 0 ? GETPOST('account_parent', 'int') : '0');
|
||||
$sql1 .= ' WHERE l.rowid IN ('.$db->sanitize(implode(',', $changeaccount)).')';
|
||||
$sql1 = "UPDATE ".MAIN_DB_PREFIX."facturedet";
|
||||
$sql1 .= " SET fk_code_ventilation=".(GETPOST('account_parent', 'int') > 0 ? GETPOST('account_parent', 'int') : '0');
|
||||
$sql1 .= ' WHERE rowid IN ('.$db->sanitize(implode(',', $changeaccount)).')';
|
||||
|
||||
dol_syslog('accountancy/customer/lines.php::changeaccount sql= '.$sql1);
|
||||
$resql1 = $db->query($sql1);
|
||||
|
||||
@ -112,77 +112,78 @@ if ($conf->accounting->enabled) {
|
||||
print '<div class="'.($helpisexpanded ? '' : 'hideobject').'" id="idfaq">'; // hideobject is to start hidden
|
||||
print "<br>\n";
|
||||
print '<span class="opacitymedium">'.$langs->trans("AccountancyAreaDescIntro")."</span><br>\n";
|
||||
print "<br>\n"; print "<br>\n";
|
||||
if (!empty($user->rights->accounting->chartofaccount)) {
|
||||
print "<br>\n"; print "<br>\n";
|
||||
|
||||
print load_fiche_titre('<span class="fa fa-calendar-check-o"></span> '.$langs->trans("AccountancyAreaDescActionOnce"), '', '')."\n";
|
||||
print '<hr>';
|
||||
print "<br>\n";
|
||||
print load_fiche_titre('<span class="fa fa-calendar-check-o"></span> '.$langs->trans("AccountancyAreaDescActionOnce"), '', '')."\n";
|
||||
print '<hr>';
|
||||
print "<br>\n";
|
||||
|
||||
// STEPS
|
||||
$step++;
|
||||
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescJournalSetup", $step, '{s}');
|
||||
$s = str_replace('{s}', '<a href="'.DOL_URL_ROOT.'/accountancy/admin/journals_list.php?id=35"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("AccountingJournals").'</strong></a>', $s);
|
||||
print $s;
|
||||
print "<br>\n";
|
||||
$step++;
|
||||
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChartModel", $step, '{s}');
|
||||
$s = str_replace('{s}', '<a href="'.DOL_URL_ROOT.'/accountancy/admin/accountmodel.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Pcg_version").'</strong></a>', $s);
|
||||
print $s;
|
||||
print "<br>\n";
|
||||
$step++;
|
||||
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChart", $step, '{s}');
|
||||
$s = str_replace('{s}', '<a href="'.DOL_URL_ROOT.'/accountancy/admin/account.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Chartofaccounts").'</strong></a>', $s);
|
||||
print $s;
|
||||
print "<br>\n";
|
||||
|
||||
print "<br>\n";
|
||||
print $langs->trans("AccountancyAreaDescActionOnceBis");
|
||||
print "<br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
$step++;
|
||||
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescDefault", $step, '{s}');
|
||||
$s = str_replace('{s}', '<a href="'.DOL_URL_ROOT.'/accountancy/admin/defaultaccounts.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong></a>', $s);
|
||||
print $s;
|
||||
print "<br>\n";
|
||||
|
||||
$step++;
|
||||
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBank", $step, '{s}')."\n";
|
||||
$s = str_replace('{s}', '<a href="'.DOL_URL_ROOT.'/compta/bank/list.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuBankAccounts").'</strong></a>', $s);
|
||||
print $s;
|
||||
print "<br>\n";
|
||||
|
||||
$step++;
|
||||
$textlink = '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=10&from=accountancy"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuVatAccounts").'</strong></a>';
|
||||
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescVat", $step, '{s}');
|
||||
$s = str_replace('{s}', $textlink, $s);
|
||||
print $s;
|
||||
print "<br>\n";
|
||||
if (!empty($conf->tax->enabled)) {
|
||||
$textlink = '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=7&from=accountancy"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuTaxAccounts").'</strong></a>';
|
||||
// STEPS
|
||||
$step++;
|
||||
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescContrib", $step, '{s}');
|
||||
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescJournalSetup", $step, '{s}');
|
||||
$s = str_replace('{s}', '<a href="'.DOL_URL_ROOT.'/accountancy/admin/journals_list.php?id=35"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("AccountingJournals").'</strong></a>', $s);
|
||||
print $s;
|
||||
print "<br>\n";
|
||||
$step++;
|
||||
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChartModel", $step, '{s}');
|
||||
$s = str_replace('{s}', '<a href="'.DOL_URL_ROOT.'/accountancy/admin/accountmodel.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Pcg_version").'</strong></a>', $s);
|
||||
print $s;
|
||||
print "<br>\n";
|
||||
$step++;
|
||||
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChart", $step, '{s}');
|
||||
$s = str_replace('{s}', '<a href="'.DOL_URL_ROOT.'/accountancy/admin/account.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Chartofaccounts").'</strong></a>', $s);
|
||||
print $s;
|
||||
print "<br>\n";
|
||||
|
||||
print "<br>\n";
|
||||
print $langs->trans("AccountancyAreaDescActionOnceBis");
|
||||
print "<br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
$step++;
|
||||
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescDefault", $step, '{s}');
|
||||
$s = str_replace('{s}', '<a href="'.DOL_URL_ROOT.'/accountancy/admin/defaultaccounts.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong></a>', $s);
|
||||
print $s;
|
||||
print "<br>\n";
|
||||
|
||||
$step++;
|
||||
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBank", $step, '{s}')."\n";
|
||||
$s = str_replace('{s}', '<a href="'.DOL_URL_ROOT.'/compta/bank/list.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuBankAccounts").'</strong></a>', $s);
|
||||
print $s;
|
||||
print "<br>\n";
|
||||
|
||||
$step++;
|
||||
$textlink = '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=10&from=accountancy"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuVatAccounts").'</strong></a>';
|
||||
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescVat", $step, '{s}');
|
||||
$s = str_replace('{s}', $textlink, $s);
|
||||
print $s;
|
||||
print "<br>\n";
|
||||
}
|
||||
if (!empty($conf->expensereport->enabled)) { // TODO Move this in the default account page because this is only one accounting account per purpose, not several.
|
||||
if (!empty($conf->tax->enabled)) {
|
||||
$textlink = '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=7&from=accountancy"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuTaxAccounts").'</strong></a>';
|
||||
$step++;
|
||||
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescContrib", $step, '{s}');
|
||||
$s = str_replace('{s}', $textlink, $s);
|
||||
print $s;
|
||||
print "<br>\n";
|
||||
}
|
||||
if (!empty($conf->expensereport->enabled)) { // TODO Move this in the default account page because this is only one accounting account per purpose, not several.
|
||||
$step++;
|
||||
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescExpenseReport", $step, '{s}');
|
||||
$s = str_replace('{s}', '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=17&from=accountancy"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuExpenseReportAccounts").'</strong></a>', $s);
|
||||
print $s;
|
||||
print "<br>\n";
|
||||
}
|
||||
|
||||
$step++;
|
||||
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescExpenseReport", $step, '{s}');
|
||||
$s = str_replace('{s}', '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=17&from=accountancy"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuExpenseReportAccounts").'</strong></a>', $s);
|
||||
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescProd", $step, '{s}');
|
||||
$s = str_replace('{s}', '<a href="'.DOL_URL_ROOT.'/accountancy/admin/productaccount.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("ProductsBinding").'</strong></a>', $s);
|
||||
print $s;
|
||||
print "<br>\n";
|
||||
|
||||
print '<br>';
|
||||
}
|
||||
|
||||
$step++;
|
||||
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescProd", $step, '{s}');
|
||||
$s = str_replace('{s}', '<a href="'.DOL_URL_ROOT.'/accountancy/admin/productaccount.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("ProductsBinding").'</strong></a>', $s);
|
||||
print $s;
|
||||
print "<br>\n";
|
||||
|
||||
|
||||
print '<br>';
|
||||
|
||||
// Step A - E
|
||||
|
||||
print "<br>\n";
|
||||
|
||||
@ -140,9 +140,9 @@ if (is_array($changeaccount) && count($changeaccount) > 0 && $user->rights->acco
|
||||
if (!$error) {
|
||||
$db->begin();
|
||||
|
||||
$sql1 = "UPDATE ".MAIN_DB_PREFIX."facture_fourn_det as l";
|
||||
$sql1 .= " SET l.fk_code_ventilation=".(GETPOST('account_parent', 'int') > 0 ? GETPOST('account_parent', 'int') : '0');
|
||||
$sql1 .= ' WHERE l.rowid IN ('.$db->sanitize(implode(',', $changeaccount)).')';
|
||||
$sql1 = "UPDATE ".MAIN_DB_PREFIX."facture_fourn_det";
|
||||
$sql1 .= " SET fk_code_ventilation=".(GETPOST('account_parent', 'int') > 0 ? GETPOST('account_parent', 'int') : '0');
|
||||
$sql1 .= ' WHERE rowid IN ('.$db->sanitize(implode(',', $changeaccount)).')';
|
||||
|
||||
dol_syslog('accountancy/supplier/lines.php::changeaccount sql= '.$sql1);
|
||||
$resql1 = $db->query($sql1);
|
||||
|
||||
@ -659,7 +659,7 @@ if (empty($reshook) && $action == 'update') {
|
||||
$categories = GETPOST('categories', 'array');
|
||||
$object->setCategories($categories);
|
||||
|
||||
$object->loadReminders();
|
||||
$object->loadReminders($remindertype, 0, false);
|
||||
if (!empty($object->reminders) && $object->datep > dol_now()) {
|
||||
foreach ($object->reminders as $reminder) {
|
||||
$reminder->delete($user);
|
||||
|
||||
@ -19,11 +19,11 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/compta/accounting-files.php
|
||||
* \ingroup compta
|
||||
* \brief Page to show portoflio and files of a thirdparty and download it
|
||||
*/
|
||||
/**
|
||||
* \file htdocs/compta/accounting-files.php
|
||||
* \ingroup compta
|
||||
* \brief Page to show portoflio and files of a thirdparty and download it
|
||||
*/
|
||||
|
||||
if ((array_key_exists('action', $_GET) && $_GET['action'] == 'dl') || (array_key_exists('action', $_POST) && $_POST['action'] == 'dl')) { // To not replace token when downloading file
|
||||
if (!defined('NOTOKENRENEWAL')) {
|
||||
@ -499,7 +499,7 @@ if ($result && $action == "dl" && !$error) {
|
||||
$zip->addFromString('transactions.csv', $log);
|
||||
$zip->close();
|
||||
|
||||
///Then download the zipped file.
|
||||
// Then download the zipped file.
|
||||
header('Content-Type: application/zip');
|
||||
header('Content-disposition: attachment; filename='.basename($zipname));
|
||||
header('Content-Length: '.filesize($zipname));
|
||||
@ -578,7 +578,7 @@ print '<br>';
|
||||
|
||||
foreach ($listofchoices as $choice => $val) {
|
||||
if (empty($val['enabled'])) {
|
||||
continue; // list not qualified
|
||||
continue; // list not qualified
|
||||
}
|
||||
$disabled = '';
|
||||
if (empty($val['perms'])) {
|
||||
@ -588,14 +588,13 @@ foreach ($listofchoices as $choice => $val) {
|
||||
print '<div class="paddingleft inline-block marginrightonly"><input type="checkbox" id="'.$choice.'" name="'.$choice.'" value="1"'.$checked.$disabled.'> <label for="'.$choice.'">'.$langs->trans($val['label']).'</label></div>';
|
||||
}
|
||||
|
||||
print '<input class="button" type="submit" name="search" value="'.$langs->trans("Search").'">';
|
||||
print '<input type="submit" class="button small" name="search" value="'.$langs->trans("Search").'">';
|
||||
|
||||
print '</form>'."\n";
|
||||
|
||||
print dol_get_fiche_end();
|
||||
|
||||
if (!empty($date_start) && !empty($date_stop)) {
|
||||
$param = 'action=searchfiles';
|
||||
$param .= '&date_startday='.GETPOST('date_startday', 'int');
|
||||
$param .= '&date_startmonth='.GETPOST('date_startmonth', 'int');
|
||||
$param .= '&date_startyear='.GETPOST('date_startyear', 'int');
|
||||
@ -603,25 +602,47 @@ if (!empty($date_start) && !empty($date_stop)) {
|
||||
$param .= '&date_stopmonth='.GETPOST('date_stopmonth', 'int');
|
||||
$param .= '&date_stopyear='.GETPOST('date_stopyear', 'int');
|
||||
foreach ($listofchoices as $choice => $val) {
|
||||
$param .= '&'.$choice.'='.(GETPOST($choice, 'int') ? 1 : 0);
|
||||
if (GETPOST($choice, 'int')) {
|
||||
$param .= '&'.$choice.'=1';
|
||||
}
|
||||
}
|
||||
print '<form name="dl" action="'.$_SERVER["PHP_SELF"].'?action=dl" method="POST">'."\n";
|
||||
print '<input type="hidden" name="token" value="'.currentToken().'">';
|
||||
|
||||
$TData = dol_sort_array($filesarray, $sortfield, $sortorder);
|
||||
|
||||
|
||||
$filename = dol_print_date($date_start, 'dayrfc', 'tzuserrel')."-".dol_print_date($date_stop, 'dayrfc', 'tzuserrel').'_export.zip';
|
||||
|
||||
echo dol_print_date($date_start, 'day', 'tzuserrel')." - ".dol_print_date($date_stop, 'day', 'tzuserrel');
|
||||
|
||||
print '<input type="hidden" name="date_startday" value="'.GETPOST('date_startday', 'int').'" />';
|
||||
print '<input type="hidden" name="date_startmonth" value="'.GETPOST('date_startmonth', 'int').'" />';
|
||||
print '<input type="hidden" name="date_startyear" value="'.GETPOST('date_startyear', 'int').'" />';
|
||||
print '<input type="hidden" name="date_stopday" value="'.GETPOST('date_stopday', 'int').'" />';
|
||||
print '<input type="hidden" name="date_stopmonth" value="'.GETPOST('date_stopmonth', 'int').'" />';
|
||||
print '<input type="hidden" name="date_stopyear" value="'.GETPOST('date_stopyear', 'int').'" />';
|
||||
foreach ($listofchoices as $choice => $val) {
|
||||
print '<input type="hidden" name="'.$choice.'" value="'.GETPOST($choice).'">';
|
||||
print '<a class="marginleftonly small'.(empty($TData) ? ' butActionRefused' : ' butAction').'" href="'.$_SERVER["PHP_SELF"].'?action=dl&token='.newToken().'&output=file&file='.urlencode($filename).$param.'"';
|
||||
if (empty($TData)) {
|
||||
print " disabled";
|
||||
}
|
||||
print '>'."\n";
|
||||
print $langs->trans("Download");
|
||||
print '</a><br>';
|
||||
|
||||
print '<input class="butAction butDownload" type="submit" value="'.$langs->trans("Download").'" />';
|
||||
print '</form>'."\n";
|
||||
$param .= '&action=searchfiles';
|
||||
|
||||
/*
|
||||
print '<input type="hidden" name="token" value="'.currentToken().'">';
|
||||
print '<input type="hidden" name="date_startday" value="'.GETPOST('date_startday', 'int').'" />';
|
||||
print '<input type="hidden" name="date_startmonth" value="'.GETPOST('date_startmonth', 'int').'" />';
|
||||
print '<input type="hidden" name="date_startyear" value="'.GETPOST('date_startyear', 'int').'" />';
|
||||
print '<input type="hidden" name="date_stopday" value="'.GETPOST('date_stopday', 'int').'" />';
|
||||
print '<input type="hidden" name="date_stopmonth" value="'.GETPOST('date_stopmonth', 'int').'" />';
|
||||
print '<input type="hidden" name="date_stopyear" value="'.GETPOST('date_stopyear', 'int').'" />';
|
||||
foreach ($listofchoices as $choice => $val) {
|
||||
print '<input type="hidden" name="'.$choice.'" value="'.GETPOST($choice).'">';
|
||||
}
|
||||
|
||||
print '<input class="butAction butDownload small marginleftonly" type="submit" value="'.$langs->trans("Download").'"';
|
||||
if (empty($TData)) {
|
||||
print " disabled";
|
||||
}
|
||||
print '/>';
|
||||
print '</form>'."\n";
|
||||
*/
|
||||
|
||||
print '<br>';
|
||||
|
||||
@ -645,172 +666,181 @@ if (!empty($date_start) && !empty($date_stop)) {
|
||||
print '<td class="center">'.$langs->trans("Currency").'</td>';
|
||||
}
|
||||
print '</tr>';
|
||||
if ($result) {
|
||||
$TData = dol_sort_array($filesarray, $sortfield, $sortorder);
|
||||
|
||||
if (empty($TData)) {
|
||||
print '<tr class="oddeven"><td colspan="7">'.$langs->trans("NoItem").'</td>';
|
||||
if (!empty($conf->multicurrency->enabled)) {
|
||||
print '<td></td>';
|
||||
if (empty($TData)) {
|
||||
print '<tr class="oddeven"><td colspan="13"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td>';
|
||||
if (!empty($conf->multicurrency->enabled)) {
|
||||
print '<td></td>';
|
||||
}
|
||||
print '</tr>';
|
||||
} else {
|
||||
// Sort array by date ASC to calculate balance
|
||||
|
||||
$totalET_debit = 0;
|
||||
$totalIT_debit = 0;
|
||||
$totalVAT_debit = 0;
|
||||
$totalET_credit = 0;
|
||||
$totalIT_credit = 0;
|
||||
$totalVAT_credit = 0;
|
||||
|
||||
// Display array
|
||||
foreach ($TData as $data) {
|
||||
$html_class = '';
|
||||
//if (!empty($data['fk_facture'])) $html_class = 'facid-'.$data['fk_facture'];
|
||||
//elseif (!empty($data['fk_paiement'])) $html_class = 'payid-'.$data['fk_paiement'];
|
||||
print '<tr class="oddeven '.$html_class.'">';
|
||||
|
||||
// Type
|
||||
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($langs->trans($data['item'])).'">'.$langs->trans($data['item']).'</td>';
|
||||
|
||||
// Date
|
||||
print '<td class="center">';
|
||||
print dol_print_date($data['date'], 'day');
|
||||
print "</td>\n";
|
||||
|
||||
// Date due
|
||||
print '<td class="center">';
|
||||
print dol_print_date($data['date_due'], 'day');
|
||||
print "</td>\n";
|
||||
|
||||
// Ref
|
||||
print '<td class="nowraponall tdoverflowmax150">';
|
||||
|
||||
if ($data['item'] == 'Invoice') {
|
||||
$invoice->id = $data['id'];
|
||||
$invoice->ref = $data['ref'];
|
||||
$invoice->total_ht = $data['amount_ht'];
|
||||
$invoice->total_ttc = $data['amount_ttc'];
|
||||
$invoice->total_tva = $data['amount_vat'];
|
||||
$invoice->multicurrency_code = $data['currency'];
|
||||
print $invoice->getNomUrl(1, '', 0, 0, '', 0, 0, 0);
|
||||
} elseif ($data['item'] == 'SupplierInvoice') {
|
||||
$supplier_invoice->id = $data['id'];
|
||||
$supplier_invoice->ref = $data['ref'];
|
||||
$supplier_invoice->total_ht = $data['amount_ht'];
|
||||
$supplier_invoice->total_ttc = $data['amount_ttc'];
|
||||
$supplier_invoice->total_tva = $data['amount_vat'];
|
||||
$supplier_invoice->multicurrency_code = $data['currency'];
|
||||
print $supplier_invoice->getNomUrl(1, '', 0, 0, '', 0, 0, 0);
|
||||
} elseif ($data['item'] == 'ExpenseReport') {
|
||||
$expensereport->id = $data['id'];
|
||||
$expensereport->ref = $data['ref'];
|
||||
print $expensereport->getNomUrl(1, 0, 0, '', 0, 0);
|
||||
} elseif ($data['item'] == 'SalaryPayment') {
|
||||
$salary_payment->id = $data['id'];
|
||||
$salary_payment->ref = $data['ref'];
|
||||
print $salary_payment->getNomUrl(1);
|
||||
} elseif ($data['item'] == 'Donation') {
|
||||
$don->id = $data['id'];
|
||||
$don->ref = $data['ref'];
|
||||
print $don->getNomUrl(1, 0, '', 0);
|
||||
} elseif ($data['item'] == 'SocialContributions') {
|
||||
$charge_sociales->id = $data['id'];
|
||||
$charge_sociales->ref = $data['ref'];
|
||||
print $charge_sociales->getNomUrl(1, 0, 0, 0, 0);
|
||||
} elseif ($data['item'] == 'VariousPayment') {
|
||||
$various_payment->id = $data['id'];
|
||||
$various_payment->ref = $data['ref'];
|
||||
print $various_payment->getNomUrl(1, '', 0, 0);
|
||||
} elseif ($data['item'] == 'LoanPayment') {
|
||||
$payment_loan->id = $data['id'];
|
||||
$payment_loan->ref = $data['ref'];
|
||||
print $payment_loan->getNomUrl(1, 0, 0, '', 0);
|
||||
} else {
|
||||
print $data['ref'];
|
||||
}
|
||||
print '</tr>';
|
||||
} else {
|
||||
// Sort array by date ASC to calculate balance
|
||||
print '</td>';
|
||||
|
||||
$totalET_debit = 0;
|
||||
$totalIT_debit = 0;
|
||||
$totalVAT_debit = 0;
|
||||
$totalET_credit = 0;
|
||||
$totalIT_credit = 0;
|
||||
$totalVAT_credit = 0;
|
||||
|
||||
// Display array
|
||||
foreach ($TData as $data) {
|
||||
$html_class = '';
|
||||
//if (!empty($data['fk_facture'])) $html_class = 'facid-'.$data['fk_facture'];
|
||||
//elseif (!empty($data['fk_paiement'])) $html_class = 'payid-'.$data['fk_paiement'];
|
||||
print '<tr class="oddeven '.$html_class.'">';
|
||||
|
||||
// Type
|
||||
print '<td>'.$langs->trans($data['item']).'</td>';
|
||||
|
||||
// Date
|
||||
print '<td class="center">';
|
||||
print dol_print_date($data['date'], 'day');
|
||||
print "</td>\n";
|
||||
|
||||
// Date due
|
||||
print '<td class="center">';
|
||||
print dol_print_date($data['date_due'], 'day');
|
||||
print "</td>\n";
|
||||
|
||||
// Ref
|
||||
print '<td class="nowraponall">';
|
||||
|
||||
if ($data['item'] == 'Invoice') {
|
||||
$invoice->id = $data['id'];
|
||||
$invoice->ref = $data['ref'];
|
||||
$invoice->total_ht = $data['amount_ht'];
|
||||
$invoice->total_ttc = $data['amount_ttc'];
|
||||
$invoice->total_tva = $data['amount_vat'];
|
||||
$invoice->multicurrency_code = $data['currency'];
|
||||
print $invoice->getNomUrl(1, '', 0, 0, '', 0, 0, 0);
|
||||
} elseif ($data['item'] == 'SupplierInvoice') {
|
||||
$supplier_invoice->id = $data['id'];
|
||||
$supplier_invoice->ref = $data['ref'];
|
||||
$supplier_invoice->total_ht = $data['amount_ht'];
|
||||
$supplier_invoice->total_ttc = $data['amount_ttc'];
|
||||
$supplier_invoice->total_tva = $data['amount_vat'];
|
||||
$supplier_invoice->multicurrency_code = $data['currency'];
|
||||
print $supplier_invoice->getNomUrl(1, '', 0, 0, '', 0, 0, 0);
|
||||
} elseif ($data['item'] == 'ExpenseReport') {
|
||||
$expensereport->id = $data['id'];
|
||||
$expensereport->ref = $data['ref'];
|
||||
print $expensereport->getNomUrl(1, 0, 0, '', 0, 0);
|
||||
} elseif ($data['item'] == 'SalaryPayment') {
|
||||
$salary_payment->id = $data['id'];
|
||||
$salary_payment->ref = $data['ref'];
|
||||
print $salary_payment->getNomUrl(1);
|
||||
} elseif ($data['item'] == 'Donation') {
|
||||
$don->id = $data['id'];
|
||||
$don->ref = $data['ref'];
|
||||
print $don->getNomUrl(1, 0, '', 0);
|
||||
} elseif ($data['item'] == 'SocialContributions') {
|
||||
$charge_sociales->id = $data['id'];
|
||||
$charge_sociales->ref = $data['ref'];
|
||||
print $charge_sociales->getNomUrl(1, 0, 0, 0, 0);
|
||||
} elseif ($data['item'] == 'VariousPayment') {
|
||||
$various_payment->id = $data['id'];
|
||||
$various_payment->ref = $data['ref'];
|
||||
print $various_payment->getNomUrl(1, '', 0, 0);
|
||||
} elseif ($data['item'] == 'LoanPayment') {
|
||||
$payment_loan->id = $data['id'];
|
||||
$payment_loan->ref = $data['ref'];
|
||||
print $payment_loan->getNomUrl(1, 0, 0, '', 0);
|
||||
} else {
|
||||
print $data['ref'];
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// File link
|
||||
print '<td>';
|
||||
if (!empty($data['files'])) {
|
||||
foreach ($data['files'] as $id => $filecursor) {
|
||||
print '<a href='.DOL_URL_ROOT.'/'.$filecursor['link'].' target="_blank">'.($filecursor['name'] ? $filecursor['name'] : $filecursor['ref']).'</a> '.$formfile->showPreview($filecursor, $filecursor['modulepart'], $filecursor['subdir'].'/'.$filecursor['name']).'<br>';
|
||||
// File link
|
||||
print '<td class="tdoverflowmax150">';
|
||||
if (!empty($data['files'])) {
|
||||
foreach ($data['files'] as $id => $filecursor) {
|
||||
$tmppreview = $formfile->showPreview($filecursor, $filecursor['modulepart'], $filecursor['subdir'].'/'.$filecursor['name'], 0);
|
||||
if ($tmppreview) {
|
||||
print $tmppreview;
|
||||
}
|
||||
$filename = ($filecursor['name'] ? $filecursor['name'] : $filecursor['ref']);
|
||||
print '<a href='.DOL_URL_ROOT.'/'.$filecursor['link'].' target="_blank" rel="noopener noreferrer" title="'.dol_escape_htmltag($filename).'">';
|
||||
if (empty($tmppreview)) {
|
||||
print img_picto('', 'generic', '', false, 0, 0, '', 'pictonopreview pictofixedwidth paddingright');
|
||||
}
|
||||
print $filename;
|
||||
print '</a><br>';
|
||||
}
|
||||
print "</td>\n";
|
||||
}
|
||||
print "</td>\n";
|
||||
|
||||
// Paid
|
||||
print '<td aling="left">'.$data['paid'].'</td>';
|
||||
// Paid
|
||||
print '<td class="center">'.($data['paid'] ? yn($data['paid']) : '').'</td>';
|
||||
|
||||
// Total ET
|
||||
print '<td align="right">'.price(price2num($data['sens'] ? $data['amount_ht'] : -$data['amount_ht'], 'MT'))."</td>\n";
|
||||
// Total IT
|
||||
print '<td align="right">'.price(price2num($data['sens'] ? $data['amount_ttc'] : -$data['amount_ttc'], 'MT'))."</td>\n";
|
||||
// Total VAT
|
||||
print '<td align="right">'.price(price2num($data['sens'] ? $data['amount_vat'] : -$data['amount_vat'], 'MT'))."</td>\n";
|
||||
// Total ET
|
||||
print '<td align="right"><span class="amount">'.price(price2num($data['sens'] ? $data['amount_ht'] : -$data['amount_ht'], 'MT'))."</span></td>\n";
|
||||
// Total IT
|
||||
print '<td align="right"><span class="amount">'.price(price2num($data['sens'] ? $data['amount_ttc'] : -$data['amount_ttc'], 'MT'))."</span></td>\n";
|
||||
// Total VAT
|
||||
print '<td align="right"><span class="amount">'.price(price2num($data['sens'] ? $data['amount_vat'] : -$data['amount_vat'], 'MT'))."</span></td>\n";
|
||||
|
||||
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($data['thirdparty_name']).'">'.dol_escape_htmltag($data['thirdparty_name'])."</td>\n";
|
||||
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($data['thirdparty_name']).'">'.dol_escape_htmltag($data['thirdparty_name'])."</td>\n";
|
||||
|
||||
print '<td class="center">'.$data['thirdparty_code']."</td>\n";
|
||||
print '<td class="center">'.$data['thirdparty_code']."</td>\n";
|
||||
|
||||
print '<td class="center">'.$data['country_code']."</td>\n";
|
||||
print '<td class="center">'.$data['country_code']."</td>\n";
|
||||
|
||||
print '<td class="tdoverflowmax150 right" title="'.dol_escape_htmltag($data['vatnum']).'">'.dol_escape_htmltag($data['vatnum'])."</td>\n";
|
||||
// VAT number
|
||||
print '<td class="tdoverflowmax150 right" title="'.dol_escape_htmltag($data['vatnum']).'">'.dol_escape_htmltag($data['vatnum'])."</td>\n";
|
||||
|
||||
if ($data['sens']) {
|
||||
$totalET_credit += $data['amount_ht'];
|
||||
$totalIT_credit += $data['amount_ttc'];
|
||||
$totalVAT_credit += $data['amount_vat'];
|
||||
} else {
|
||||
$totalET_debit -= $data['amount_ht'];
|
||||
$totalIT_debit -= $data['amount_ttc'];
|
||||
$totalVAT_debit -= $data['amount_vat'];
|
||||
}
|
||||
|
||||
if (!empty($conf->multicurrency->enabled)) {
|
||||
print '<td class="center">'.$data['currency']."</td>\n";
|
||||
}
|
||||
|
||||
print "</tr>\n";
|
||||
if ($data['sens']) {
|
||||
$totalET_credit += $data['amount_ht'];
|
||||
$totalIT_credit += $data['amount_ttc'];
|
||||
$totalVAT_credit += $data['amount_vat'];
|
||||
} else {
|
||||
$totalET_debit -= $data['amount_ht'];
|
||||
$totalIT_debit -= $data['amount_ttc'];
|
||||
$totalVAT_debit -= $data['amount_vat'];
|
||||
}
|
||||
|
||||
// Total credits
|
||||
print '<tr class="liste_total">';
|
||||
print '<td colspan="6" class="right">'.$langs->trans('Total').' '.$langs->trans('Income').'</td>';
|
||||
print '<td align="right">'.price(price2num($totalET_credit, 'MT')).'</td>';
|
||||
print '<td align="right">'.price(price2num($totalIT_credit, 'MT')).'</td>';
|
||||
print '<td align="right">'.price(price2num($totalVAT_credit, 'MT')).'</td>';
|
||||
print '<td colspan="4"></td>';
|
||||
if (!empty($conf->multicurrency->enabled)) {
|
||||
print '<td></td>';
|
||||
}
|
||||
print "</tr>\n";
|
||||
// Total debits
|
||||
print '<tr class="liste_total">';
|
||||
print '<td colspan="6" class="right">'.$langs->trans('Total').' '.$langs->trans('Outcome').'</td>';
|
||||
print '<td align="right">'.price(price2num($totalET_debit, 'MT')).'</td>';
|
||||
print '<td align="right">'.price(price2num($totalIT_debit, 'MT')).'</td>';
|
||||
print '<td align="right">'.price(price2num($totalVAT_debit, 'MT')).'</td>';
|
||||
print '<td colspan="4"></td>';
|
||||
if (!empty($conf->multicurrency->enabled)) {
|
||||
print '<td></td>';
|
||||
}
|
||||
print "</tr>\n";
|
||||
// Balance
|
||||
print '<tr class="liste_total">';
|
||||
print '<td colspan="6" class="right">'.$langs->trans('Total').'</td>';
|
||||
print '<td align="right">'.price(price2num($totalET_credit + $totalET_debit, 'MT')).'</td>';
|
||||
print '<td align="right">'.price(price2num($totalIT_credit + $totalIT_debit, 'MT')).'</td>';
|
||||
print '<td align="right">'.price(price2num($totalVAT_credit + $totalVAT_debit, 'MT')).'</td>';
|
||||
print '<td colspan="4"></td>';
|
||||
if (!empty($conf->multicurrency->enabled)) {
|
||||
print '<td></td>';
|
||||
print '<td class="center">'.$data['currency']."</td>\n";
|
||||
}
|
||||
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
// Total credits
|
||||
print '<tr class="liste_total">';
|
||||
print '<td colspan="6" class="right">'.$langs->trans('Total').' '.$langs->trans('Income').'</td>';
|
||||
print '<td align="right">'.price(price2num($totalET_credit, 'MT')).'</td>';
|
||||
print '<td align="right">'.price(price2num($totalIT_credit, 'MT')).'</td>';
|
||||
print '<td align="right">'.price(price2num($totalVAT_credit, 'MT')).'</td>';
|
||||
print '<td colspan="4"></td>';
|
||||
if (!empty($conf->multicurrency->enabled)) {
|
||||
print '<td></td>';
|
||||
}
|
||||
print "</tr>\n";
|
||||
// Total debits
|
||||
print '<tr class="liste_total">';
|
||||
print '<td colspan="6" class="right">'.$langs->trans('Total').' '.$langs->trans('Outcome').'</td>';
|
||||
print '<td align="right">'.price(price2num($totalET_debit, 'MT')).'</td>';
|
||||
print '<td align="right">'.price(price2num($totalIT_debit, 'MT')).'</td>';
|
||||
print '<td align="right">'.price(price2num($totalVAT_debit, 'MT')).'</td>';
|
||||
print '<td colspan="4"></td>';
|
||||
if (!empty($conf->multicurrency->enabled)) {
|
||||
print '<td></td>';
|
||||
}
|
||||
print "</tr>\n";
|
||||
// Balance
|
||||
print '<tr class="liste_total">';
|
||||
print '<td colspan="6" class="right">'.$langs->trans('Total').'</td>';
|
||||
print '<td align="right">'.price(price2num($totalET_credit + $totalET_debit, 'MT')).'</td>';
|
||||
print '<td align="right">'.price(price2num($totalIT_credit + $totalIT_debit, 'MT')).'</td>';
|
||||
print '<td align="right">'.price(price2num($totalVAT_credit + $totalVAT_debit, 'MT')).'</td>';
|
||||
print '<td colspan="4"></td>';
|
||||
if (!empty($conf->multicurrency->enabled)) {
|
||||
print '<td></td>';
|
||||
}
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
print "</table>";
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
@ -179,7 +179,7 @@ if (empty($reshook)) {
|
||||
$action = 'create';
|
||||
}
|
||||
|
||||
if ($action == 'delete') {
|
||||
if ($action == 'confirm_delete' && $confirm == 'yes') {
|
||||
$result = $object->fetch($id);
|
||||
|
||||
if ($object->rappro == 0) {
|
||||
@ -548,6 +548,12 @@ if ($id) {
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneVariousPayment', $object->ref), 'confirm_clone', $formquestion, 'yes', 1, 350);
|
||||
}
|
||||
|
||||
// Confirmation of the removal of the Various Payment
|
||||
if ($action == 'delete') {
|
||||
$text = $langs->trans('ConfirmDeleteVariousPayment');
|
||||
print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id, $langs->trans('DeleteVariousPayment'), $text, 'confirm_delete', '', '', 2);
|
||||
}
|
||||
|
||||
print dol_get_fiche_head($head, 'card', $langs->trans("VariousPayment"), -1, $object->picto);
|
||||
|
||||
$morehtmlref = '<div class="refidno">';
|
||||
|
||||
@ -589,40 +589,6 @@ if (empty($reshook)) {
|
||||
$object->fetch($id);
|
||||
$object->fetch_thirdparty();
|
||||
|
||||
// Check parameters
|
||||
|
||||
// Check for mandatory fields in thirdparty (defined into setup)
|
||||
$array_to_check = array('IDPROF1', 'IDPROF2', 'IDPROF3', 'IDPROF4', 'IDPROF5', 'IDPROF6', 'EMAIL');
|
||||
foreach ($array_to_check as $key) {
|
||||
$keymin = strtolower($key);
|
||||
$i = (int) preg_replace('/[^0-9]/', '', $key);
|
||||
$vallabel = $object->thirdparty->$keymin;
|
||||
|
||||
if ($i > 0) {
|
||||
if ($object->thirdparty->isACompany()) {
|
||||
// Check for mandatory prof id (but only if country is other than ours)
|
||||
if ($mysoc->country_id > 0 && $object->thirdparty->country_id == $mysoc->country_id) {
|
||||
$idprof_mandatory = 'SOCIETE_'.$key.'_INVOICE_MANDATORY';
|
||||
if (!$vallabel && !empty($conf->global->$idprof_mandatory)) {
|
||||
$langs->load("errors");
|
||||
$error++;
|
||||
setEventMessages($langs->trans('ErrorProdIdIsMandatory', $langs->transcountry('ProfId'.$i, $object->thirdparty->country_code)).' ('.$langs->trans("ForbiddenBySetupRules").')', null, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//var_dump($conf->global->SOCIETE_EMAIL_MANDATORY);
|
||||
if ($key == 'EMAIL') {
|
||||
// Check for mandatory
|
||||
if (!empty($conf->global->SOCIETE_EMAIL_INVOICE_MANDATORY) && !isValidEMail($object->thirdparty->email)) {
|
||||
$langs->load("errors");
|
||||
$error++;
|
||||
setEventMessages($langs->trans("ErrorBadEMail", $object->thirdparty->email).' ('.$langs->trans("ForbiddenBySetupRules").')', null, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Check for mandatory fields in invoice
|
||||
$array_to_check = array('REF_CLIENT'=>'RefCustomer');
|
||||
foreach ($array_to_check as $key => $val) {
|
||||
|
||||
@ -2619,7 +2619,7 @@ class Facture extends CommonInvoice
|
||||
*/
|
||||
public function validate($user, $force_number = '', $idwarehouse = 0, $notrigger = 0, $batch_rule = 0)
|
||||
{
|
||||
global $conf, $langs;
|
||||
global $conf, $langs, $mysoc;
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
|
||||
$productStatic = null;
|
||||
@ -2658,6 +2658,53 @@ class Facture extends CommonInvoice
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Check for mandatory fields in thirdparty (defined into setup)
|
||||
$array_to_check = array('IDPROF1', 'IDPROF2', 'IDPROF3', 'IDPROF4', 'IDPROF5', 'IDPROF6', 'EMAIL');
|
||||
foreach ($array_to_check as $key) {
|
||||
$keymin = strtolower($key);
|
||||
$i = (int) preg_replace('/[^0-9]/', '', $key);
|
||||
if ($i == 1) {
|
||||
if (!is_object($this->thirdparty)) {
|
||||
$langs->load('errors');
|
||||
$this->error = $langs->trans('ErrorInvoiceLoadThirdParty', $this->ref);
|
||||
dol_syslog(__METHOD__.' '.$this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
if (!property_exists($this->thirdparty, $keymin)) {
|
||||
$langs->load('errors');
|
||||
$this->error = $langs->trans('ErrorInvoiceLoadThirdPartyKey', $keymin, $this->ref);
|
||||
dol_syslog(__METHOD__.' '.$this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
$vallabel = $this->thirdparty->$keymin;
|
||||
|
||||
if ($i > 0) {
|
||||
if ($this->thirdparty->isACompany()) {
|
||||
// Check for mandatory prof id (but only if country is other than ours)
|
||||
if ($mysoc->country_id > 0 && $this->thirdparty->country_id == $mysoc->country_id) {
|
||||
$idprof_mandatory = 'SOCIETE_'.$key.'_INVOICE_MANDATORY';
|
||||
if (!$vallabel && !empty($conf->global->$idprof_mandatory)) {
|
||||
$langs->load("errors");
|
||||
$this->error = $langs->trans('ErrorProdIdIsMandatory', $langs->transcountry('ProfId'.$i, $this->thirdparty->country_code)).' ('.$langs->trans("ForbiddenBySetupRules").') ['.$langs->trans('Company').' : '.$this->thirdparty->name.']';
|
||||
dol_syslog(__METHOD__.' '.$this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ($key == 'EMAIL') {
|
||||
// Check for mandatory
|
||||
if (!empty($conf->global->SOCIETE_EMAIL_INVOICE_MANDATORY) && !isValidEMail($this->thirdparty->email)) {
|
||||
$langs->load("errors");
|
||||
$this->error = $langs->trans("ErrorBadEMail", $this->thirdparty->email).' ('.$langs->trans("ForbiddenBySetupRules").') ['.$langs->trans('Company').' : '.$this->thirdparty->name.']';
|
||||
dol_syslog(__METHOD__.' '.$this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
// Check parameters
|
||||
|
||||
@ -57,6 +57,7 @@ $socid = GETPOST('socid', 'int');
|
||||
|
||||
// Category
|
||||
$selected_cat = (int) GETPOST('search_categ', 'int');
|
||||
if ($selected_cat == -1) $selected_cat = '';
|
||||
$subcat = false;
|
||||
if (GETPOST('subcat', 'alpha') === 'yes') {
|
||||
$subcat = true;
|
||||
|
||||
@ -503,6 +503,29 @@ if (empty($reshook)) {
|
||||
}
|
||||
}
|
||||
|
||||
// Update extrafields
|
||||
if ($action == 'update_extras' && ! empty($user->rights->societe->contact->creer)) {
|
||||
$object->oldcopy = dol_clone($object);
|
||||
|
||||
// Fill array 'array_options' with data from update form
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'restricthtml'));
|
||||
if ($ret < 0) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$result = $object->insertExtraFields('CONTACT_MODIFY');
|
||||
if ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
if ($error) {
|
||||
$action = 'edit_extras';
|
||||
}
|
||||
}
|
||||
|
||||
// Actions to send emails
|
||||
$triggersendname = 'CONTACT_SENTBYMAIL';
|
||||
$paramname = 'id';
|
||||
|
||||
@ -1246,9 +1246,9 @@ if (!$error && $massaction == 'validate' && $permissiontoadd) {
|
||||
$model = $objecttmp->model_pdf;
|
||||
$ret = $objecttmp->fetch($objecttmp->id); // Reload to get new records
|
||||
// To be sure vars is defined
|
||||
$hidedetails = !empty($hidedetails) ? $hidedetails : 0;
|
||||
$hidedesc = !empty($hidedesc) ? $hidedesc : 0;
|
||||
$hideref = !empty($hideref) ? $hideref : 0;
|
||||
$hidedetails = !empty($hidedetails) ? $hidedetails : (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0);
|
||||
$hidedesc = !empty($hidedesc) ? $hidedesc : (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0);
|
||||
$hideref = !empty($hideref) ? $hideref : (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0);
|
||||
$moreparams = !empty($moreparams) ? $moreparams : null;
|
||||
|
||||
$result = $objecttmp->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
@ -1378,13 +1378,13 @@ if (!$error && $massaction == 'generate_doc' && $permissiontoread) {
|
||||
|
||||
// To be sure vars is defined
|
||||
if (empty($hidedetails)) {
|
||||
$hidedetails = 0;
|
||||
$hidedetails = (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0);
|
||||
}
|
||||
if (empty($hidedesc)) {
|
||||
$hidedesc = 0;
|
||||
$hidedesc = (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0);
|
||||
}
|
||||
if (empty($hideref)) {
|
||||
$hideref = 0;
|
||||
$hideref = (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0);
|
||||
}
|
||||
if (empty($moreparams)) {
|
||||
$moreparams = null;
|
||||
|
||||
@ -79,6 +79,9 @@ class box_dolibarr_state_board extends ModeleBoxes
|
||||
if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) {
|
||||
$hookmanager = new HookManager($this->db);
|
||||
$hookmanager->initHooks(array('index'));
|
||||
$object = new stdClass;
|
||||
$action = '';
|
||||
$hookmanager->executeHooks('addStatisticLine', array(), $object, $action);
|
||||
$boxstatItems = array();
|
||||
$boxstatFromHook = '';
|
||||
$boxstatFromHook = $hookmanager->resPrint;
|
||||
|
||||
@ -252,7 +252,7 @@ class modResource extends DolibarrModules
|
||||
$this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'resource as r';
|
||||
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_type_resource as c ON c.rowid=r.fk_code_type_resource';
|
||||
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'resource_extrafields as extra ON extra.fk_object = r.rowid';
|
||||
$this->export_sql_end[$r] .= ' AND r.entity IN ('.getEntity('resource').')';
|
||||
$this->export_sql_end[$r] .= ' WHERE r.entity IN ('.getEntity('resource').')';
|
||||
|
||||
|
||||
// Imports
|
||||
|
||||
@ -156,6 +156,7 @@ if (empty($reshook) && isset($extrafields->attributes[$object->table_element]['l
|
||||
//var_dump($user->rights);
|
||||
$permok = false;
|
||||
$keyforperm = $object->element;
|
||||
|
||||
if ($object->element == 'fichinter') {
|
||||
$keyforperm = 'ficheinter';
|
||||
}
|
||||
|
||||
@ -1282,6 +1282,15 @@ if (empty($reshook)) {
|
||||
|
||||
$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
}
|
||||
|
||||
unset($qty);
|
||||
unset($value_unit_ht);
|
||||
unset($value_unit);
|
||||
unset($vatrate);
|
||||
unset($comments);
|
||||
unset($fk_c_type_fees);
|
||||
unset($fk_project);
|
||||
unset($date);
|
||||
}
|
||||
|
||||
//header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
|
||||
|
||||
@ -274,6 +274,8 @@ if (empty($reshook)) {
|
||||
|
||||
$db->begin();
|
||||
|
||||
$default_ref_supplier=dol_print_date(dol_now(), '%Y%m%d%H%M%S');
|
||||
|
||||
foreach ($orders as $id_order) {
|
||||
$cmd = new CommandeFournisseur($db);
|
||||
if ($cmd->fetch($id_order) <= 0) {
|
||||
@ -291,7 +293,8 @@ if (empty($reshook)) {
|
||||
$objecttmp->fk_project = $cmd->fk_project;
|
||||
$objecttmp->multicurrency_code = $cmd->multicurrency_code;
|
||||
if (empty($createbills_onebythird)) {
|
||||
$objecttmp->ref_client = $cmd->ref_client;
|
||||
$objecttmp->ref_supplier = !empty($cmd->ref_supplier) ? $cmd->ref_supplier : $default_ref_supplier;
|
||||
$default_ref_supplier+=1;
|
||||
}
|
||||
|
||||
$datefacture = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));
|
||||
|
||||
@ -146,9 +146,11 @@ ConfirmPaySalary=Are you sure you want to classify this salary card as paid?
|
||||
DeleteSocialContribution=Delete a social or fiscal tax payment
|
||||
DeleteVAT=Delete a VAT declaration
|
||||
DeleteSalary=Delete a salary card
|
||||
DeleteVariousPayment=Delete a various payment
|
||||
ConfirmDeleteSocialContribution=Are you sure you want to delete this social/fiscal tax payment ?
|
||||
ConfirmDeleteVAT=Are you sure you want to delete this VAT declaration ?
|
||||
ConfirmDeleteSalary=Are you sure you want to delete this salary?
|
||||
ConfirmDeleteSalary=Are you sure you want to delete this salary ?
|
||||
ConfirmDeleteVariousPayment=Are you sure you want to delete this various payment ?
|
||||
ExportDataset_tax_1=Social and fiscal taxes and payments
|
||||
CalcModeVATDebt=Mode <b>%sVAT on commitment accounting%s</b>.
|
||||
CalcModeVATEngagement=Mode <b>%sVAT on incomes-expenses%s</b>.
|
||||
|
||||
@ -272,6 +272,8 @@ ErrorWrongFileName=Name of the file cannot have __SOMETHING__ in it
|
||||
ErrorNotInDictionaryPaymentConditions=Not in Payment Terms Dictionary, please modify.
|
||||
ErrorExecIdFailed=Can't execute command "id"
|
||||
ErrorBadCharIntoLoginName=Unauthorized character in the login name
|
||||
ErrorInvoiceLoadThirdParty=Can't load third-party object for invoice "%s"
|
||||
ErrorInvoiceLoadThirdPartyKey=Third-party key "%s" no set for invoice "%s"
|
||||
|
||||
# Warnings
|
||||
WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Your PHP parameter upload_max_filesize (%s) is higher than PHP parameter post_max_size (%s). This is not a consistent setup.
|
||||
@ -305,5 +307,8 @@ WarningTheHiddenOptionIsOn=Warning, the hidden option <b>%s</b> is on.
|
||||
WarningCreateSubAccounts=Warning, you can't create directly a sub account, you must create a third party or an user and assign them an accounting code to find them in this list
|
||||
WarningAvailableOnlyForHTTPSServers=Available only if using HTTPS secured connection.
|
||||
WarningModuleXDisabledSoYouMayMissEventHere=Module %s has not been enabled. So you may miss a lot of event here.
|
||||
<<<<<<< HEAD
|
||||
WarningPaypalPaymentNotCompatibleWithStrict=The value 'Strict' makes the online payment features not working correctly. Use 'Lax' instead.
|
||||
|
||||
=======
|
||||
>>>>>>> branch '13.0' of git@github.com:Dolibarr/dolibarr.git
|
||||
|
||||
@ -146,9 +146,11 @@ ConfirmPaySalary=Voulez-vous vraiment classer ce salaire comme payé ?
|
||||
DeleteSocialContribution=Effacer une charge fiscale ou sociale
|
||||
DeleteVAT=Supprimer une déclaration de TVA
|
||||
DeleteSalary=Supprimer un salaire
|
||||
DeleteVariousPayment=Supprimer un paiement divers
|
||||
ConfirmDeleteSocialContribution=Voulez-vous vraiment supprimer ce paiement de taxe sociale / fiscale?
|
||||
ConfirmDeleteVAT=Voulez-vous vraiment supprimer cette déclaration de TVA ?
|
||||
ConfirmDeleteSalary=Êtes-vous sûr de vouloir supprimer ce salaire ?
|
||||
ConfirmDeleteVariousPayment=Voulez-vous vraiment supprimer ce paiement divers ?
|
||||
ExportDataset_tax_1=Taxes sociales et fiscales et paiements
|
||||
CalcModeVATDebt=Mode <b>%sTVA sur débit%s</b>.
|
||||
CalcModeVATEngagement=Mode <b>%sTVA sur encaissement%s</b>.
|
||||
|
||||
@ -1604,23 +1604,23 @@ class Task extends CommonObject
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."projet_task_time";
|
||||
$sql .= " WHERE rowid = ".$this->timespent_id;
|
||||
|
||||
dol_syslog(get_class($this)."::delTimeSpent", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$error++; $this->errors[] = "Error ".$this->db->lasterror();
|
||||
if (!$notrigger) {
|
||||
// Call trigger
|
||||
$result = $this->call_trigger('TASK_TIMESPENT_DELETE', $user);
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
}
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
if (!$notrigger) {
|
||||
// Call trigger
|
||||
$result = $this->call_trigger('TASK_TIMESPENT_DELETE', $user);
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
}
|
||||
// End call triggers
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."projet_task_time";
|
||||
$sql .= " WHERE rowid = ".$this->timespent_id;
|
||||
|
||||
dol_syslog(get_class($this)."::delTimeSpent", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$error++; $this->errors[] = "Error ".$this->db->lasterror();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2005-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2005-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* 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
|
||||
@ -225,7 +225,7 @@ if ($action == "setaskforshippingmet") {
|
||||
}
|
||||
}
|
||||
|
||||
//Activate "Disable prospect/customer type"
|
||||
// Activate "Disable prospect/customer type"
|
||||
if ($action == "setdisableprospectcustomer") {
|
||||
$setdisableprospectcustomer = GETPOST('value', 'int');
|
||||
$res = dolibarr_set_const($db, "SOCIETE_DISABLE_PROSPECTSCUSTOMERS", $setdisableprospectcustomer, 'yesno', 0, '', $conf->entity);
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2008 Patrick Raguin <patrick.raguin@auguria.net>
|
||||
* Copyright (C) 2010-2020 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2013 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2011-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
@ -986,21 +986,24 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
$modCodeFournisseur = new $module;
|
||||
|
||||
// Define if customer/prospect or supplier status is set or not
|
||||
if (GETPOST("type") != 'f') {
|
||||
if (GETPOST("type", 'aZ') != 'f') {
|
||||
$object->client = -1;
|
||||
if (!empty($conf->global->THIRDPARTY_CUSTOMERPROSPECT_BY_DEFAULT)) {
|
||||
$object->client = 3;
|
||||
}
|
||||
}
|
||||
// Prospect / Customer
|
||||
if (GETPOST("type") == 'c') {
|
||||
if (GETPOST("type", 'aZ') == 'c') {
|
||||
if (!empty($conf->global->THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT)) {
|
||||
$object->client = $conf->global->THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT;
|
||||
} else {
|
||||
$object->client = 3;
|
||||
}
|
||||
}
|
||||
if (GETPOST("type") == 'p') {
|
||||
if (!empty($conf->global->SOCIETE_DISABLE_PROSPECTSCUSTOMERS) && $object->client == 3) {
|
||||
$object->client = 1;
|
||||
}
|
||||
if (GETPOST("type", 'aZ') == 'p') {
|
||||
$object->client = 2;
|
||||
}
|
||||
if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && (GETPOST("type") == 'f' || (GETPOST("type") == '' && !empty($conf->global->THIRDPARTY_SUPPLIER_BY_DEFAULT)))) {
|
||||
@ -1757,21 +1760,21 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
|
||||
if (GETPOSTISSET('name')) {
|
||||
// We overwrite with values if posted
|
||||
$object->name = GETPOST('name', 'alphanohtml');
|
||||
$object->prefix_comm = GETPOST('prefix_comm', 'alphanohtml');
|
||||
$object->client = GETPOST('client', 'int');
|
||||
$object->code_client = GETPOST('customer_code', 'alpha');
|
||||
$object->fournisseur = GETPOST('fournisseur', 'int');
|
||||
$object->code_fournisseur = GETPOST('supplier_code', 'alpha');
|
||||
$object->address = GETPOST('address', 'alphanohtml');
|
||||
$object->zip = GETPOST('zipcode', 'alphanohtml');
|
||||
$object->town = GETPOST('town', 'alphanohtml');
|
||||
$object->country_id = GETPOST('country_id') ?GETPOST('country_id', 'int') : $mysoc->country_id;
|
||||
$object->state_id = GETPOST('state_id', 'int');
|
||||
//$object->skype = GETPOST('skype', 'alpha');
|
||||
//$object->twitter = GETPOST('twitter', 'alpha');
|
||||
//$object->facebook = GETPOST('facebook', 'alpha');
|
||||
//$object->linkedin = GETPOST('linkedin', 'alpha');
|
||||
$object->name = GETPOST('name', 'alphanohtml');
|
||||
$object->prefix_comm = GETPOST('prefix_comm', 'alphanohtml');
|
||||
$object->client = GETPOST('client', 'int');
|
||||
$object->code_client = GETPOST('customer_code', 'alpha');
|
||||
$object->fournisseur = GETPOST('fournisseur', 'int');
|
||||
$object->code_fournisseur = GETPOST('supplier_code', 'alpha');
|
||||
$object->address = GETPOST('address', 'alphanohtml');
|
||||
$object->zip = GETPOST('zipcode', 'alphanohtml');
|
||||
$object->town = GETPOST('town', 'alphanohtml');
|
||||
$object->country_id = GETPOST('country_id') ?GETPOST('country_id', 'int') : $mysoc->country_id;
|
||||
$object->state_id = GETPOST('state_id', 'int');
|
||||
//$object->skype = GETPOST('skype', 'alpha');
|
||||
//$object->twitter = GETPOST('twitter', 'alpha');
|
||||
//$object->facebook = GETPOST('facebook', 'alpha');
|
||||
//$object->linkedin = GETPOST('linkedin', 'alpha');
|
||||
$object->socialnetworks = array();
|
||||
if (!empty($conf->socialnetworks->enabled)) {
|
||||
foreach ($socialnetworks as $key => $value) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user