Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2021-06-13 16:24:21 +02:00
commit e0abbb2525
29 changed files with 426 additions and 221 deletions

View File

@ -16,7 +16,6 @@ NEW: A lot of fix into english text after a small proofreading campaign (still n
NEW: All main menu entries are using the picto of the module
NEW: Add a copy to clipboard button on some fields
NEW: Add an example of scheduled job to send email reminder for unpaid invoices
NEW: Can make massive stock transfers from a CSV file.
NEW: Accountancy - Add FEC import
NEW: Accountancy - Add a confirmation form with options on export
NEW: Accountancy - Add select date from/to in already bind customer and supplier list
@ -32,58 +31,44 @@ NEW: Add the column "Office phone" and "User mobile" in user list
NEW: Add the column "Price level"in thirdparty list
NEW: Add some company information in the dropdown login menu
NEW: Add constant MAIN_BUGTRACK_URL to set a custom url to redirect to when clicking on link "declare a bug"
NEW: Add contact tag and bulk email status on the thirparty+contact create form
NEW: Add db fields note_public and note_private for ECM module
NEW: Add contact tag and bulk email status on the thirdparty + contact create form
NEW: Support down payment on supplier invoice (& somes ajustments)
NEW: Add edit/delete action icons on categories list pages
NEW: Add hidden option to auto load input line extrafield into new lines
NEW: Add import profile to import BOM
NEW: Add last date of modification for website pages in the list of pages
NEW: Add link picto to the stock movement on the detail of production
NEW: Add mass action "Set tag" for product/service, user, thirdparty, warehouse, project, bank account, members
NEW: Add bulk action Validate and Set to billed on order list.
NEW: add bulk action to set a commercial proposal to status "Refused"
NEW: Add option CONTRACT_ALLOW_EXTERNAL_DOWNLOAD and SUPPLIER_PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD to make generated doc automatically shared.
NEW: Add option CONTRACT_ALLOW_EXTERNAL_DOWNLOAD to make generated doc automatically shared.
NEW: Add option SUPPLIER_PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD to make generated doc automatically shared.
NEW: Add option MAIN_SECURITY_ANTI_SSRF_SERVER_IP to define list of IPs that are local IPs
NEW: Add option SOCIETE_DISABLE_WORKFORCE to hide staff field
NEW: Add a new permission "Export website"
NEW: Add possibility to exports userGroups fields on user exports
NEW: Add price min and price min including tax into product export
NEW: Can search on lots or serials into the quick search bar
NEW: Add support for Friday as a non working day
NEW: Add a total in page of margin by user
NEW: Add the total of margin in invoice list
NEW: Can set a Warehouse on a Thirparty
NEW: Can set a Warehouse on a Thirdparty
NEW: auto notification with module Notification can use templated emails
NEW: Bank Entries : display user linked to a salary or a taxes
NEW: Can set a warehouse in a proposal
NEW: Can clone a cron job.
NEW: Can clone a cron job
NEW: Can create a lot from the list view (Look and feel standardization).
NEW: Can filter files in GED on status Shared/Not shared
NEW: Can filter on extrafields date on lists
NEW: Can filter on rowid in list of blocked logs.
NEW: Can hide columns "time consumed" on timesheet per week.
NEW: Can filter on rowid in list of blocked logs
NEW: Can hide columns "time consumed" on timesheet per week
NEW: Can set an employee on each social contribution
NEW: Can set a percentage when creating an invoice from another object
NEW: Can set if a ticket group is visible on public interface or not.
NEW: Can set order of execution of hooks
NEW: Can show the leave dates/holidays on the agenda view.
NEW: Can show the project ref into PDF documents
NEW: Can show the leave dates/holidays on the agenda view
NEW: Can toggle FCKeditor on public/private notes
NEW: Can use captcha on public page to create a ticket
NEW: Check update availability for externals modules using a button on module page
NEW: Choose lines to use while creating intervention card from origin
NEW: Column shipment method, payment mode, payment term in proposal and order list
NEW: Columns shipment method, payment mode, payment term in proposal and order list
NEW: Conf for default actioncomm status
NEW: customer ref for product customer prices
NEW: date and user signature on proposal (Issue 16062)
NEW: Dictionary for availability - Add a column position
NEW: TAKEPOS delayed payment in TakePOS
NEW: TAKEPOS display date range if exist in TakePOS
NEW: TAKEPOS display resiliate status in TakePOS for member
NEW: TAKEPOS Edit sales lines rights in TakePOS
NEW: TAKEPOS Option for Takepos to show the total price without tax
NEW: TAKEPOS More permission in TakePOS (Can edit added line, can modify once order sent to kitchen)
NEW: Can set a user related to a social contribution
NEW: ICS Direct debit can be set with a different value for each bank account
NEW: LDAP: usergroup search can be filtered
@ -94,37 +79,71 @@ NEW: Add bulk actions for Bank Transfer
NEW: Enhance the multicurrency rate editor
NEW: Multiselect ledger account code filter on book keeping list
NEW: Normalyse Type company field with ajax combobox
NEW: option to automatically close an open project when all its tasks are done (=progress 100%)
NEW: option to select membership type on the online payment page for membership subscription or renewal
NEW: preload product description on selection for customer propal/order/invoice
NEW: Add a ref in product customer price
NEW: Save old page with .old extension on disk when editing a website page
NEW: Search usergroups & resources
NEW: Set status of all variants when changing status of parent
NEW: Setup Page for module creation with module builder enhancement #FoundationFunding
NEW: Show picto of module into the list of dictionaries
NEW: Show the total of payment on the payment confirmation page
NEW: Stock movement list - Add more complete date field
NEW: Support color for types of event
NEW: The global setup for Mandatory fields can now be done on combo list too.
NEW: translate in "en_US" to complete PR 16980
NEW: Update the list of taxes available by default for France
NEW: Add captcha on public page to create a ticket
NEW: Salary payment request and Salary payment are 2 different steps in workflow on Salary payment recording
NEW: VAT payment request and VAT payment are now 2 different steps in workflow on VAT payment recording
NEW: VAT report - Optimisation & collapse by rate
NEW: When we add contacts/users to a project, ask to also affect them on tasks.
NEW: When a doc file is shared, link is visible from the main page of doc.
NEW: Add option in Workflow module to set a shipment as closed.
NEW: Option to automatically create a login/user when a new subscription of a member is done online
NEW: #16378 More E-Mail Contact substitution Values for better salutation
NEW: option to keep the "Automatically create a total payment" checkbox empty on the tax creation page
NEW: #17113 Can upload a favicon in website module
ECM/GED
NEW: Add db fields note_public and note_private for ECM module
NEW: Can filter files in GED on status Shared/Not shared
Members
NEW: #17292 default subscription amount by adherent type
NEW: Option to automatically create a login/user when a new subscription of a member is done online
NEW: option to select membership type on the online payment page for membership subscription or renewal
Projects
NEW: option to automatically close an open project when all its tasks are done (=progress 100%)
NEW: Can show the project ref into PDF documents
Proposals
NEW: add bulk action to set a commercial proposal to status "Refused"
NEW: Can set a warehouse in a proposal
TakePOS
NEW: TAKEPOS delayed payment in TakePOS
NEW: TAKEPOS display date range if exist in TakePOS
NEW: TAKEPOS display resiliate status in TakePOS for member
NEW: TAKEPOS Edit sales lines rights in TakePOS
NEW: TAKEPOS Option for TakePOS to show the total price without tax
NEW: TAKEPOS More permission in TakePOS (Can edit added line, can modify once order sent to kitchen)
Tickets
NEW: Add captcha on public page to create a ticket
NEW: Can use captcha on public page to create a ticket
NEW: Can set if a ticket group is visible on public interface or not
Warehouse
NEW: Can make massive stock transfers from a CSV file
NEW: Stock movement list - Add more complete date field
Website Module
NEW: #17113 Can upload a favicon in website module
NEW: add a new permission "Export website"
NEW: add last date of modification for website pages in the list of pages
NEW: Save old page with .old extension on disk when editing a website page
new Modules
NEW: start new experimental module Event Organization Management
NEW: start new experimental module Partnership Management
NEW: start new experimental module Knowledge Management
NEW: start new experimental module Workstations management
NEW: start new experimental module Workstations Management
For developers:
@ -171,6 +190,7 @@ Following changes may create regressions for some external modules, but were nec
* Function set_price_level() has been renamed into setPriceLevel() to follow camelcase rules
* Remove deprecated subtituion key __REFCLIENT__ (Replaced with __REF_CLIENT__)
***** ChangeLog for 13.0.3 compared to 13.0.2 *****
FIX: 13.0 warning - missing quotes around 'label'
@ -193,7 +213,7 @@ FIX: create sociales : keep values error form
FIX: dol_print_date for %a and %b with some timezone
FIX: email is not case sensitive
FIX: error for duplicate thirdparty found correctly returned by ws
FIX: Espadon PDF shippment model with long public note now wroking
FIX: Espadon PDF shippment model with long public note now working
FIX: esupplier order: error 500 when using packaging with product where it is not defined
FIX: Filter on debit/credit
FIX: Filter on supplier payment list

View File

@ -401,14 +401,14 @@ if ($action != 'export_csv') {
print '<tr class="liste_total">';
print '<td class="right">'.$langs->trans("SubTotal").':</td>';
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
print '<td class="nowrap right">'.price($sous_total_opening_balance).'</td>';
print '<td class="right nowraponall amount">'.price($sous_total_opening_balance).'</td>';
}
print '<td class="nowrap right">'.price($sous_total_debit).'</td>';
print '<td class="nowrap right">'.price($sous_total_credit).'</td>';
print '<td class="right nowraponall amount">'.price($sous_total_debit).'</td>';
print '<td class="right nowraponall amount">'.price($sous_total_credit).'</td>';
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
print '<td class="nowrap right">'.price(price2num($sous_total_opening_balance + $sous_total_debit - $sous_total_credit)).'</td>';
print '<td class="right nowraponall amount">'.price(price2num($sous_total_opening_balance + $sous_total_debit - $sous_total_credit)).'</td>';
} else {
print '<td class="nowrap right">'.price(price2num($sous_total_debit - $sous_total_credit)).'</td>';
print '<td class="right nowraponall amount">'.price(price2num($sous_total_debit - $sous_total_credit)).'</td>';
}
print "<td></td>\n";
print '</tr>';
@ -443,14 +443,14 @@ if ($action != 'export_csv') {
}
}
// Debit
print '<td class="nowraponall right"><a href="'.$urlzoom.'">'.price($line->debit).'</a></td>';
print '<td class="right nowraponall amount"><a href="'.$urlzoom.'">'.price($line->debit).'</a></td>';
// Credit
print '<td class="nowraponall right"><a href="'.$urlzoom.'">'.price($line->credit).'</a></td>';
print '<td class="right nowraponall amount"><a href="'.$urlzoom.'">'.price($line->credit).'</a></td>';
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
print '<td class="nowraponall right">'.price(price2num($opening_balance + $line->debit - $line->credit, 'MT')).'</td>';
print '<td class="right nowraponall amount">'.price(price2num($opening_balance + $line->debit - $line->credit, 'MT')).'</td>';
} else {
print '<td class="nowraponall right">'.price(price2num($line->debit - $line->credit, 'MT')).'</td>';
print '<td class="right nowraponall amount">'.price(price2num($line->debit - $line->credit, 'MT')).'</td>';
}
print '<td class="center">';
print $link;
@ -468,12 +468,12 @@ if ($action != 'export_csv') {
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
print '<td class="nowrap right">'.price($sous_total_opening_balance).'</td>';
}
print '<td class="nowrap right">'.price($sous_total_debit).'</td>';
print '<td class="nowrap right">'.price($sous_total_credit).'</td>';
print '<td class="right nowraponall amount">'.price($sous_total_debit).'</td>';
print '<td class="right nowraponall amount">'.price($sous_total_credit).'</td>';
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
print '<td class="nowrap right">' . price(price2num($sous_total_opening_balance + $sous_total_debit - $sous_total_credit, 'MT')) . '</td>';
print '<td class="right nowraponall amount">' . price(price2num($sous_total_opening_balance + $sous_total_debit - $sous_total_credit, 'MT')) . '</td>';
} else {
print '<td class="nowrap right">' . price(price2num($sous_total_debit - $sous_total_credit, 'MT')) . '</td>';
print '<td class="right nowraponall amount">' . price(price2num($sous_total_debit - $sous_total_credit, 'MT')) . '</td>';
}
print "<td></td>\n";
print '</tr>';
@ -483,8 +483,8 @@ if ($action != 'export_csv') {
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
print '<td class="nowrap right">'.price($total_opening_balance).'</td>';
}
print '<td class="nowrap right">'.price($total_debit).'</td>';
print '<td class="nowrap right">'.price($total_credit).'</td>';
print '<td class="right nowraponall amount">'.price($total_debit).'</td>';
print '<td class="right nowraponall amount">'.price($total_credit).'</td>';
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
print '<td class="nowrap right">' . price(price2num($total_opening_balance + $total_debit - $total_credit, 'MT')) . '</td>';
} else {

View File

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2013-2017 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2017 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2013-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
*
@ -537,6 +537,22 @@ if ($action == 'create') {
print '</td>';
print '</tr>';
// Date document creation
print '<tr>';
print '<td class="titlefield">'.$langs->trans("DateExport").'</td>';
print '<td>';
print $object->date_export ? dol_print_date($object->date_export, 'dayhour') : '&nbsp;';
print '</td>';
print '</tr>';
// Date document creation
print '<tr>';
print '<td class="titlefield">'.$langs->trans("DateValidation").'</td>';
print '<td>';
print $object->date_validation ? dol_print_date($object->date_validation, 'dayhour') : '&nbsp;';
print '</td>';
print '</tr>';
// Validate
/*
print '<tr>';
@ -619,7 +635,9 @@ if ($action == 'create') {
print_liste_field_titre("LabelOperation");
print_liste_field_titre("Debit", "", "", "", "", 'class="right"');
print_liste_field_titre("Credit", "", "", "", "", 'class="right"');
print_liste_field_titre("Action", "", "", "", "", 'width="60" class="center"');
if (empty($object->date_validation)) {
print_liste_field_titre("Action", "", "", "", "", 'width="60" class="center"');
}
print "</tr>\n";
@ -662,21 +680,25 @@ if ($action == 'create') {
}
print '</td>';
print '<td>'.$line->label_operation.'</td>';
print '<td class="nowrap right">'.price($line->debit).'</td>';
print '<td class="nowrap right">'.price($line->credit).'</td>';
print '<td class="right nowraponall amount">'.price($line->debit).'</td>';
print '<td class="right nowraponall amount">'.price($line->credit).'</td>';
print '<td class="center">';
print '<a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?action=update&id='.$line->id.'&piece_num='.urlencode($line->piece_num).'&mode='.urlencode($mode).'&token='.urlencode(newToken()).'">';
print img_edit('', 0, 'class="marginrightonly"');
print '</a> &nbsp;';
$actiontodelete = 'delete';
if ($mode == '_tmp' || $action != 'delmouv') {
$actiontodelete = 'confirm_delete';
if (empty($line->date_export) || empty($line->date_validation)) {
print '<td class="center">';
print '<a class="editfielda reposition" href="' . $_SERVER["PHP_SELF"] . '?action=update&id=' . $line->id . '&piece_num=' . urlencode($line->piece_num) . '&mode=' . urlencode($mode) . '&token=' . urlencode(newToken()) . '">';
print img_edit('', 0, 'class="marginrightonly"');
print '</a> &nbsp;';
}
print '<a href="'.$_SERVER["PHP_SELF"].'?action='.$actiontodelete.'&id='.$line->id.'&piece_num='.urlencode($line->piece_num).'&mode='.urlencode($mode).'&token='.urlencode(newToken()).'">';
print img_delete();
if (empty($line->date_validation)) {
$actiontodelete = 'delete';
if ($mode == '_tmp' || $action != 'delmouv') {
$actiontodelete = 'confirm_delete';
}
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=' . $actiontodelete . '&id=' . $line->id . '&piece_num=' . urlencode($line->piece_num) . '&mode=' . urlencode($mode) . '&token=' . urlencode(newToken()) . '">';
print img_delete();
}
print '</a>';
print '</td>';
@ -691,32 +713,33 @@ if ($action == 'create') {
setEventMessages(null, array($langs->trans('MvtNotCorrectlyBalanced', $total_debit, $total_credit)), 'warnings');
}
if ($action == "" || $action == 'add') {
print '<tr class="oddeven">';
print '<!-- td columns in add mode -->';
print '<td>';
print $formaccounting->select_account('', 'accountingaccount_number', 1, array(), 1, 1, '');
print '</td>';
print '<td>';
// TODO For the moment we keep a free input text instead of a combo. The select_auxaccount has problem because:
// It does not use the setup of "key pressed" to select a thirdparty and this hang browser on large databases.
// Also, it is not possible to use a value that is not in the list.
// Also, the label is not automatically filled when a value is selected.
if (!empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) {
print $formaccounting->select_auxaccount('', 'subledger_account', 1);
} else {
print '<input type="text" class="maxwidth150" name="subledger_account" value="" placeholder="'.dol_escape_htmltag($langs->trans("SubledgerAccount")).'">';
if (empty($object->date_export) || empty($object->date_validation)) {
if ($action == "" || $action == 'add') {
print '<tr class="oddeven">';
print '<!-- td columns in add mode -->';
print '<td>';
print $formaccounting->select_account('', 'accountingaccount_number', 1, array(), 1, 1, '');
print '</td>';
print '<td>';
// TODO For the moment we keep a free input text instead of a combo. The select_auxaccount has problem because:
// It does not use the setup of "key pressed" to select a thirdparty and this hang browser on large databases.
// Also, it is not possible to use a value that is not in the list.
// Also, the label is not automatically filled when a value is selected.
if (!empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) {
print $formaccounting->select_auxaccount('', 'subledger_account', 1);
} else {
print '<input type="text" class="maxwidth150" name="subledger_account" value="" placeholder="' . dol_escape_htmltag($langs->trans("SubledgerAccount")) . '">';
}
print '<br><input type="text" class="maxwidth150" name="subledger_label" value="" placeholder="' . dol_escape_htmltag($langs->trans("SubledgerAccountLabel")) . '">';
print '</td>';
print '<td><input type="text" class="minwidth200" name="label_operation" value="' . $label_operation . '"/></td>';
print '<td class="right"><input type="text" size="6" class="right" name="debit" value=""/></td>';
print '<td class="right"><input type="text" size="6" class="right" name="credit" value=""/></td>';
print '<td><input type="submit" class="button" name="save" value="' . $langs->trans("Add") . '"></td>';
print '</tr>';
}
print '<br><input type="text" class="maxwidth150" name="subledger_label" value="" placeholder="'.dol_escape_htmltag($langs->trans("SubledgerAccountLabel")).'">';
print '</td>';
print '<td><input type="text" class="minwidth200" name="label_operation" value="'.$label_operation.'"/></td>';
print '<td class="right"><input type="text" size="6" class="right" name="debit" value=""/></td>';
print '<td class="right"><input type="text" size="6" class="right" name="credit" value=""/></td>';
print '<td><input type="submit" class="button" name="save" value="'.$langs->trans("Add").'"></td>';
print '</tr>';
print '</table>';
}
print '</table>';
if ($mode == '_tmp' && $action == '') {
print '<br>';

View File

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2020 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2013-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2016-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2018-2021 Frédéric France <frederic.france@netlogic.fr>
*
@ -44,15 +44,47 @@ $action = GETPOST('action', 'aZ09');
$search_mvt_num = GETPOST('search_mvt_num', 'int');
$search_doc_type = GETPOST("search_doc_type", 'alpha');
$search_doc_ref = GETPOST("search_doc_ref", 'alpha');
$search_date_start = dol_mktime(0, 0, 0, GETPOST('search_date_startmonth', 'int'), GETPOST('search_date_startday', 'int'), GETPOST('search_date_startyear', 'int'));
$search_date_end = dol_mktime(23, 59, 59, GETPOST('search_date_endmonth', 'int'), GETPOST('search_date_endday', 'int'), GETPOST('search_date_endyear', 'int'));
$search_date_startyear = GETPOST('search_date_startyear', 'int');
$search_date_startmonth = GETPOST('search_date_startmonth', 'int');
$search_date_startday = GETPOST('search_date_startday', 'int');
$search_date_endyear = GETPOST('search_date_endyear', 'int');
$search_date_endmonth = GETPOST('search_date_endmonth', 'int');
$search_date_endday = GETPOST('search_date_endday', 'int');
$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear);
$search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
$search_doc_date = dol_mktime(0, 0, 0, GETPOST('doc_datemonth', 'int'), GETPOST('doc_dateday', 'int'), GETPOST('doc_dateyear', 'int'));
$search_date_creation_start = dol_mktime(0, 0, 0, GETPOST('date_creation_startmonth', 'int'), GETPOST('date_creation_startday', 'int'), GETPOST('date_creation_startyear', 'int'));
$search_date_creation_end = dol_mktime(23, 59, 59, GETPOST('date_creation_endmonth', 'int'), GETPOST('date_creation_endday', 'int'), GETPOST('date_creation_endyear', 'int'));
$search_date_modification_start = dol_mktime(0, 0, 0, GETPOST('date_modification_startmonth', 'int'), GETPOST('date_modification_startday', 'int'), GETPOST('date_modification_startyear', 'int'));
$search_date_modification_end = dol_mktime(23, 59, 59, GETPOST('date_modification_endmonth', 'int'), GETPOST('date_modification_endday', 'int'), GETPOST('date_modification_endyear', 'int'));
$search_date_export_start = dol_mktime(0, 0, 0, GETPOST('date_export_startmonth', 'int'), GETPOST('date_export_startday', 'int'), GETPOST('date_export_startyear', 'int'));
$search_date_export_end = dol_mktime(23, 59, 59, GETPOST('date_export_endmonth', 'int'), GETPOST('date_export_endday', 'int'), GETPOST('date_export_endyear', 'int'));
$search_date_creation_startyear = GETPOST('search_date_creation_startyear', 'int');
$search_date_creation_startmonth = GETPOST('search_date_creation_startmonth', 'int');
$search_date_creation_startday = GETPOST('search_date_creation_startday', 'int');
$search_date_creation_endyear = GETPOST('search_date_creation_endyear', 'int');
$search_date_creation_endmonth = GETPOST('search_date_creation_endmonth', 'int');
$search_date_creation_endday = GETPOST('search_date_creation_endday', 'int');
$search_date_creation_start = dol_mktime(0, 0, 0, $search_date_creation_startmonth, $search_date_creation_startday, $search_date_creation_startyear);
$search_date_creation_end = dol_mktime(23, 59, 59, $search_date_creation_endmonth, $search_date_creation_endday, $search_date_creation_endyear);
$search_date_modification_startyear = GETPOST('search_date_modification_startyear', 'int');
$search_date_modification_startmonth = GETPOST('search_date_modification_startmonth', 'int');
$search_date_modification_startday = GETPOST('search_date_modification_startday', 'int');
$search_date_modification_endyear = GETPOST('search_date_modification_endyear', 'int');
$search_date_modification_endmonth = GETPOST('search_date_modification_endmonth', 'int');
$search_date_modification_endday = GETPOST('search_date_modification_endday', 'int');
$search_date_modification_start = dol_mktime(0, 0, 0, $search_date_modification_startmonth, $search_date_modification_startday, $search_date_modification_startyear);
$search_date_modification_end = dol_mktime(23, 59, 59, $search_date_modification_endmonth, $search_date_modification_endday, $search_date_modification_endyear);
$search_date_export_startyear = GETPOST('search_date_export_startyear', 'int');
$search_date_export_startmonth = GETPOST('search_date_export_startmonth', 'int');
$search_date_export_startday = GETPOST('search_date_export_startday', 'int');
$search_date_export_endyear = GETPOST('search_date_export_endyear', 'int');
$search_date_export_endmonth = GETPOST('search_date_export_endmonth', 'int');
$search_date_export_endday = GETPOST('search_date_export_endday', 'int');
$search_date_export_start = dol_mktime(0, 0, 0, $search_date_export_startmonth, $search_date_export_startday, $search_date_export_startyear);
$search_date_export_end = dol_mktime(23, 59, 59, $search_date_export_endmonth, $search_date_export_endday, $search_date_export_endyear);
$search_date_validation_startyear = GETPOST('search_date_validation_startyear', 'int');
$search_date_validation_startmonth = GETPOST('search_date_validation_startmonth', 'int');
$search_date_validation_startday = GETPOST('search_date_validation_startday', 'int');
$search_date_validation_endyear = GETPOST('search_date_validation_endyear', 'int');
$search_date_validation_endmonth = GETPOST('search_date_validation_endmonth', 'int');
$search_date_validation_endday = GETPOST('search_date_validation_endday', 'int');
$search_date_validation_start = dol_mktime(0, 0, 0, $search_date_validation_startmonth, $search_date_validation_startday, $search_date_validation_startyear);
$search_date_validation_end = dol_mktime(23, 59, 59, $search_date_validation_endmonth, $search_date_validation_endday, $search_date_validation_endyear);
//var_dump($search_date_start);exit;
if (GETPOST("button_delmvt_x") || GETPOST("button_delmvt.x") || GETPOST("button_delmvt")) {
@ -157,6 +189,7 @@ $arrayfields = array(
't.date_creation'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0),
't.tms'=>array('label'=>$langs->trans("DateModification"), 'checked'=>0),
't.date_export'=>array('label'=>$langs->trans("DateExport"), 'checked'=>1),
't.date_validated'=>array('label'=>$langs->trans("DateValidation"), 'checked'=>1),
);
if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) {
@ -216,14 +249,46 @@ if (empty($reshook)) {
$search_mvt_label = '';
$search_direction = '';
$search_ledger_code = array();
$search_date_startyear = '';
$search_date_startmonth = '';
$search_date_startday = '';
$search_date_endyear = '';
$search_date_endmonth = '';
$search_date_endday = '';
$search_date_start = '';
$search_date_end = '';
$search_date_creation_startyear = '';
$search_date_creation_startmonth = '';
$search_date_creation_startday = '';
$search_date_creation_endyear = '';
$search_date_creation_endmonth = '';
$search_date_creation_endday = '';
$search_date_creation_start = '';
$search_date_creation_end = '';
$search_date_modification_startyear = '';
$search_date_modification_startmonth = '';
$search_date_modification_startday = '';
$search_date_modification_endyear = '';
$search_date_modification_endmonth = '';
$search_date_modification_endday = '';
$search_date_modification_start = '';
$search_date_modification_end = '';
$search_date_export_startyear = '';
$search_date_export_startmonth = '';
$search_date_export_startday = '';
$search_date_export_endyear = '';
$search_date_export_endmonth = '';
$search_date_export_endday = '';
$search_date_export_start = '';
$search_date_export_end = '';
$search_date_validation_startyear = '';
$search_date_validation_startmonth = '';
$search_date_validation_startday = '';
$search_date_validation_endyear = '';
$search_date_validation_endmonth = '';
$search_date_validation_endday = '';
$search_date_validation_start = '';
$search_date_validation_end = '';
$search_debit = '';
$search_credit = '';
$search_lettering_code = '';
@ -328,6 +393,16 @@ if (empty($reshook)) {
$tmp = dol_getdate($search_date_export_end);
$param .= '&date_export_endmonth='.urlencode($tmp['mon']).'&date_export_endday='.urlencode($tmp['mday']).'&date_export_endyear='.urlencode($tmp['year']);
}
if (!empty($search_date_validation_start)) {
$filter['t.date_validated>='] = $search_date_validation_start;
$tmp = dol_getdate($search_date_validation_start);
$param .= '&date_validation_startmonth='.urlencode($tmp['mon']).'&date_validation_startday='.urlencode($tmp['mday']).'&date_validation_startyear='.urlencode($tmp['year']);
}
if (!empty($search_date_validation_end)) {
$filter['t.date_validated<='] = $search_date_validation_end;
$tmp = dol_getdate($search_date_validation_end);
$param .= '&date_validation_endmonth='.urlencode($tmp['mon']).'&date_validation_endday='.urlencode($tmp['mday']).'&date_validation_endyear='.urlencode($tmp['year']);
}
if (!empty($search_debit)) {
$filter['t.debit'] = $search_debit;
$param .= '&search_debit='.urlencode($search_debit);
@ -447,7 +522,8 @@ $sql .= " t.journal_label,";
$sql .= " t.piece_num,";
$sql .= " t.date_creation,";
$sql .= " t.tms as date_modification,";
$sql .= " t.date_export";
$sql .= " t.date_export,";
$sql .= " t.date_validated as date_validation";
$sql .= ' FROM '.MAIN_DB_PREFIX.$object->table_element.' as t';
// Manage filter
$sqlwhere = array();
@ -471,6 +547,8 @@ if (count($filter) > 0) {
$sqlwhere[] = $key.'\''.$db->idate($value).'\'';
} elseif ($key == 't.date_export>=' || $key == 't.date_export<=') {
$sqlwhere[] = $key.'\''.$db->idate($value).'\'';
} elseif ($key == 't.date_validated>=' || $key == 't.date_validated<=') {
$sqlwhere[] = $key.'\''.$db->idate($value).'\'';
} elseif ($key == 't.credit' || $key == 't.debit') {
$sqlwhere[] = natural_search($key, $value, 1, 1);
} elseif ($key == 't.reconciled_option') {
@ -508,10 +586,13 @@ if ($action == 'export_fileconfirm' && $user->rights->accounting->mouvements->ex
$accountancyexport = new AccountancyExport($db);
$accountancyexport->export($object->lines, $formatexportset);
$notifiedexportdate = GETPOST('notifiedexportdate', 'alpha');
$notifiedvalidationdate = GETPOST('notifiedvalidationdate', 'alpha');
if (!empty($accountancyexport->errors)) {
setEventMessages('', $accountancyexport->errors, 'errors');
} else {
// Specify as export : update field date_export
} elseif (!$notifiedexportdate || !$notifiedvalidationdate) {
// Specify as export : update field date_export or date_validated
$error = 0;
$db->begin();
@ -520,8 +601,15 @@ if ($action == 'export_fileconfirm' && $user->rights->accounting->mouvements->ex
$now = dol_now();
$sql = " UPDATE ".MAIN_DB_PREFIX."accounting_bookkeeping";
$sql .= " SET date_export = '".$db->idate($now)."'";
$sql .= " , date_validated = '".$db->idate($now)."'";
$sql .= " SET";
if (!$notifiedexportdate && !$notifiedvalidationdate) {
$sql .= " date_export = '".$db->idate($now)."'";
$sql .= ", date_validated = '".$db->idate($now)."'";
} elseif (!$notifiedexportdate) {
$sql .= " date_export = '".$db->idate($now)."'";
} elseif (!$notifiedvalidationdate) {
$sql .= " date_validated = '".$db->idate($now)."'";
}
$sql .= " WHERE rowid = ".((int) $movement->id);
dol_syslog("/accountancy/bookeeping/list.php Function export_file Specify movements as exported sql=".$sql, LOG_DEBUG);
@ -535,11 +623,11 @@ if ($action == 'export_fileconfirm' && $user->rights->accounting->mouvements->ex
if (!$error) {
$db->commit();
// setEventMessages($langs->trans("AllExportedMovementsWereRecordedAsExported"), null, 'mesgs');
// setEventMessages($langs->trans("AllExportedMovementsWereRecordedAsExportedOrValidated"), null, 'mesgs');
} else {
$error++;
$db->rollback();
setEventMessages($langs->trans("NotAllExportedMovementsCouldBeRecordedAsExported"), null, 'errors');
setEventMessages($langs->trans("NotAllExportedMovementsCouldBeRecordedAsExportedOrValidated"), null, 'errors');
}
}
exit;
@ -587,6 +675,8 @@ if (is_numeric($nbtotalofrecords) && $limit > $nbtotalofrecords) {
llxHeader('', $title_page);
$formconfirm = '';
if ($action == 'export_file') {
$form_question = array();
@ -598,17 +688,15 @@ if ($action == 'export_file') {
);
$form_question['notifiedvalidationdate'] = array(
'name' => 'notifiedvalidationdate',
'type' => 'checkbox', // We don't use select here, the journal_array is already a select html component
'type' => 'checkbox',
'label' => $langs->trans('NotifiedValidationDate'),
'value' => (!empty($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_VALIDATION_DATE) ? 'false' : 'true'),
);
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans("ExportFilteredList").' ('.$listofformat[$formatexportset].')', $langs->trans('ConfirmExportFile'), 'export_fileconfirm', $form_question, '', 1, 300);
print $formconfirm;
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans("ExportFilteredList").' ('.$listofformat[$formatexportset].')', $langs->trans('ConfirmExportFile'), 'export_fileconfirm', $form_question, '', 1, 300, 600);
}
if ($action == 'delmouv') {
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?mvt_num='.GETPOST('mvt_num').$param, $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvtPartial'), 'delmouvconfirm', '', 0, 1);
print $formconfirm;
}
if ($action == 'delbookkeepingyear') {
$form_question = array();
@ -648,9 +736,11 @@ if ($action == 'delbookkeepingyear') {
);
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt', $langs->transnoentitiesnoconv("RegistrationInAccounting")), 'delbookkeepingyearconfirm', $form_question, '', 1, 300);
print $formconfirm;
}
// Print form confirm
print $formconfirm;
//$param=''; param started before
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
$param .= '&contextpage='.urlencode($contextpage);
@ -669,6 +759,8 @@ print '<input type="hidden" name="formfilteraction" id="formfilteraction" value=
print '<input type="hidden" name="sortfield" value="'.urlencode($sortfield).'">';
print '<input type="hidden" name="sortorder" value="'.urlencode($sortorder).'">';
$massactionbutton = '';
if (count($filter)) {
$buttonLabel = $langs->trans("ExportFilteredList");
} else {
@ -701,7 +793,7 @@ if (empty($reshook)) {
$newcardbutton .= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', $url, '', $user->rights->accounting->mouvements->creer);
}
print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit, 0, 0, 1);
print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit, 0, 0, 1);
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
@ -841,6 +933,17 @@ if (!empty($arrayfields['t.date_export']['checked'])) {
print '</div>';
print '</td>';
}
// Date validation
if (!empty($arrayfields['t.date_validated']['checked'])) {
print '<td class="liste_titre center">';
print '<div class="nowrap">';
print $form->selectDate($search_date_validation_start, 'date_validation_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
print '</div>';
print '<div class="nowrap">';
print $form->selectDate($search_date_validation_end, 'date_validation_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"));
print '</div>';
print '</td>';
}
// Action column
print '<td class="liste_titre center">';
$searchpicto = $form->showFilterButtons();
@ -892,6 +995,9 @@ if (!empty($arrayfields['t.tms']['checked'])) {
if (!empty($arrayfields['t.date_export']['checked'])) {
print_liste_field_titre($arrayfields['t.date_export']['label'], $_SERVER['PHP_SELF'], "t.date_export", "", $param, '', $sortfield, $sortorder, 'center ');
}
if (!empty($arrayfields['t.date_validated']['checked'])) {
print_liste_field_titre($arrayfields['t.date_validated']['label'], $_SERVER['PHP_SELF'], "t.date_validated", "", $param, '', $sortfield, $sortorder, 'center ');
}
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
print "</tr>\n";
@ -934,6 +1040,7 @@ while ($i < min($num, $limit)) {
$line->date_creation = $db->jdate($obj->date_creation);
$line->date_modification = $db->jdate($obj->date_modification);
$line->date_export = $db->jdate($obj->date_export);
$line->date_validation = $db->jdate($obj->date_validation);
$total_debit += $line->debit;
$total_credit += $line->credit;
@ -1067,7 +1174,7 @@ while ($i < min($num, $limit)) {
// Amount debit
if (!empty($arrayfields['t.debit']['checked'])) {
print '<td class="nowrap right">'.($line->debit != 0 ? price($line->debit) : '').'</td>';
print '<td class="right nowraponall amount">'.($line->debit != 0 ? price($line->debit) : '').'</td>';
if (!$i) {
$totalarray['nbfield']++;
}
@ -1079,7 +1186,7 @@ while ($i < min($num, $limit)) {
// Amount credit
if (!empty($arrayfields['t.credit']['checked'])) {
print '<td class="nowrap right">'.($line->credit != 0 ? price($line->credit) : '').'</td>';
print '<td class="right nowraponall amount">'.($line->credit != 0 ? price($line->credit) : '').'</td>';
if (!$i) {
$totalarray['nbfield']++;
}
@ -1126,12 +1233,22 @@ while ($i < min($num, $limit)) {
}
}
// Validated operation date
if (!empty($arrayfields['t.date_validated']['checked'])) {
print '<td class="center">'.dol_print_date($line->date_validation, 'dayhour').'</td>';
if (!$i) {
$totalarray['nbfield']++;
}
}
// Action column
print '<td class="nowraponall center">';
if (empty($line->date_export)) {
if (empty($line->date_export) || empty($line->date_validation)) {
if ($user->rights->accounting->mouvements->creer) {
print '<a class="editfielda paddingleft marginrightonly" href="'.DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?piece_num='.$line->piece_num.$param.'&page='.$page.($sortfield ? '&sortfield='.$sortfield : '').($sortorder ? '&sortorder='.$sortorder : '').'">'.img_edit().'</a>';
print '<a class="editfielda paddingleft marginrightonly" href="' . DOL_URL_ROOT . '/accountancy/bookkeeping/card.php?piece_num=' . $line->piece_num . $param . '&page=' . $page . ($sortfield ? '&sortfield=' . $sortfield : '') . ($sortorder ? '&sortorder=' . $sortorder : '') . '">' . img_edit() . '</a>';
}
}
if (empty($line->date_validation)) {
if ($user->rights->accounting->mouvements->supprimer) {
print '<a class="reposition paddingleft marginrightonly" href="'.$_SERVER['PHP_SELF'].'?action=delmouv&mvt_num='.$line->piece_num.$param.'&page='.$page.($sortfield ? '&sortfield='.$sortfield : '').($sortorder ? '&sortorder='.$sortorder : '').'">'.img_delete().'</a>';
}

View File

@ -55,7 +55,7 @@ $search_date_export_endyear = GETPOST('search_date_export_endyear', 'int');
$search_date_export_endmonth = GETPOST('search_date_export_endmonth', 'int');
$search_date_export_endday = GETPOST('search_date_export_endday', 'int');
$search_date_export_start = dol_mktime(0, 0, 0, $search_date_export_startmonth, $search_date_export_startday, $search_date_export_startyear);
$search_date_export_end = dol_mktime(0, 0, 0, $search_date_export_endmonth, $search_date_export_endday, $search_date_export_endyear);
$search_date_export_end = dol_mktime(23, 59, 59, $search_date_export_endmonth, $search_date_export_endday, $search_date_export_endyear);
$search_accountancy_code = GETPOST("search_accountancy_code");
$search_accountancy_code_start = GETPOST('search_accountancy_code_start', 'alpha');
@ -807,7 +807,7 @@ while ($i < min($num, $limit)) {
// Amount debit
if (!empty($arrayfields['t.debit']['checked'])) {
print '<td class="nowrap right">'.($line->debit ? price($line->debit) : '').'</td>';
print '<td class="right nowraponall amount">'.($line->debit ? price($line->debit) : '').'</td>';
if (!$i) {
$totalarray['nbfield']++;
}
@ -819,7 +819,7 @@ while ($i < min($num, $limit)) {
// Amount credit
if (!empty($arrayfields['t.credit']['checked'])) {
print '<td class="nowrap right">'.($line->credit ? price($line->credit) : '').'</td>';
print '<td class="right nowraponall amount">'.($line->credit ? price($line->credit) : '').'</td>';
if (!$i) {
$totalarray['nbfield']++;
}

View File

@ -821,7 +821,7 @@ while ($i < min($num, $limit)) {
// Amount debit
if (!empty($arrayfields['t.debit']['checked'])) {
print '<td class="nowrap right">'.($line->debit ? price($line->debit) : '').'</td>';
print '<td class="right nowraponall amount">'.($line->debit ? price($line->debit) : '').'</td>';
if (!$i) {
$totalarray['nbfield']++;
}
@ -833,7 +833,7 @@ while ($i < min($num, $limit)) {
// Amount credit
if (!empty($arrayfields['t.credit']['checked'])) {
print '<td class="nowrap right">'.($line->credit ? price($line->credit) : '').'</td>';
print '<td class="right nowraponall amount">'.($line->credit ? price($line->credit) : '').'</td>';
if (!$i) {
$totalarray['nbfield']++;
}

View File

@ -296,15 +296,15 @@ if ($resql) {
print '<tr class="oddeven">';
print '<td class="right" colspan="3">'.$langs->trans("Total").':</td>'."\n";
print '<td class="nowrap right"><strong>'.price($debit).'</strong></td>';
print '<td class="nowrap right"><strong>'.price($credit).'</strong></td>';
print '<td class="right nowraponall amount"><strong>'.price($debit).'</strong></td>';
print '<td class="right nowraponall amount"><strong>'.price($credit).'</strong></td>';
print '<td colspan="4"></td>';
print "</tr>\n";
print '<tr class="oddeven">';
print '<td class="right" colspan="3">'.$langs->trans("Balancing").':</td>'."\n";
print '<td colspan="2">&nbsp;</td>';
print '<td class="nowrap right"><strong>'.price($credit - $debit).'</strong></td>';
print '<td class="right nowraponall amount"><strong>'.price($credit - $debit).'</strong></td>';
print '<td colspan="6"></td>';
print "</tr>\n";

View File

@ -293,15 +293,15 @@ if ($resql) {
print '<tr class="oddeven">';
print '<td class="right" colspan="3">'.$langs->trans("Total").':</td>'."\n";
print '<td class="nowrap right"><strong>'.price($debit).'</strong></td>';
print '<td class="nowrap right"><strong>'.price($credit).'</strong></td>';
print '<td class="right nowraponall amount"><strong>'.price($debit).'</strong></td>';
print '<td class="right nowraponall amount"><strong>'.price($credit).'</strong></td>';
print '<td colspan="6"></td>';
print "</tr>\n";
print '<tr class="oddeven">';
print '<td class="right" colspan="3">'.$langs->trans("Balancing").':</td>'."\n";
print '<td colspan="2">&nbsp;</td>';
print '<td class="nowrap right"><strong>'.price($credit - $debit).'</strong></td>';
print '<td class="right nowraponall amount"><strong>'.price($credit - $debit).'</strong></td>';
print '<td colspan="4"></td>';
print "</tr>\n";

View File

@ -263,7 +263,7 @@ class AccountancyCategory // extends CommonObject
if ($id) {
$sql .= " WHERE t.rowid = ".((int) $id);
} else {
$sql .= " WHERE t.entity IN (".getEntity('c_accounting_category').")"; // Dont't use entity if you use rowid
$sql .= " WHERE t.entity IN (".getEntity('c_accounting_category').")"; // Don't use entity if you use rowid
if ($code) {
$sql .= " AND t.code = '".$this->db->escape($code)."'";
} elseif ($label) {

View File

@ -728,7 +728,9 @@ class BookKeeping extends CommonObject
$sql .= " t.code_journal,";
$sql .= " t.journal_label,";
$sql .= " t.piece_num,";
$sql .= " t.date_creation";
$sql .= " t.date_creation,";
$sql .= " t.date_export,";
$sql .= " t.date_validated as date_validation";
$sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.$mode.' as t';
$sql .= ' WHERE 1 = 1';
$sql .= " AND entity IN (".getEntity('accountancy').")";
@ -769,6 +771,9 @@ class BookKeeping extends CommonObject
$this->journal_label = $obj->journal_label;
$this->piece_num = $obj->piece_num;
$this->date_creation = $this->db->jdate($obj->date_creation);
$this->date_export = $this->db->jdate($obj->date_export);
$this->date_validation = $this->db->jdate($obj->date_validated);
$this->date_validation = $this->db->jdate($obj->date_validation);
}
$this->db->free($resql);
@ -834,7 +839,8 @@ class BookKeeping extends CommonObject
$sql .= " t.journal_label,";
$sql .= " t.piece_num,";
$sql .= " t.date_creation,";
$sql .= " t.date_export";
$sql .= " t.date_export,";
$sql .= " t.date_validated as date_validation";
// Manage filter
$sqlwhere = array();
if (count($filter) > 0) {
@ -853,6 +859,8 @@ class BookKeeping extends CommonObject
$sqlwhere[] = $key.'\''.$this->db->idate($value).'\'';
} elseif ($key == 't.date_export>=' || $key == 't.date_export<=') {
$sqlwhere[] = $key.'\''.$this->db->idate($value).'\'';
} elseif ($key == 't.date_validated>=' || $key == 't.date_validated<=') {
$sqlwhere[] = $key.'\''.$this->db->idate($value).'\'';
} elseif ($key == 't.credit' || $key == 't.debit') {
$sqlwhere[] = natural_search($key, $value, 1, 1);
} elseif ($key == 't.reconciled_option') {
@ -926,6 +934,8 @@ class BookKeeping extends CommonObject
$line->piece_num = $obj->piece_num;
$line->date_creation = $this->db->jdate($obj->date_creation);
$line->date_export = $this->db->jdate($obj->date_export);
$line->date_validation = $this->db->jdate($obj->date_validated);
$line->date_validation = $this->db->jdate($obj->date_validation);
$this->lines[] = $line;
@ -987,7 +997,8 @@ class BookKeeping extends CommonObject
$sql .= " t.date_creation,";
$sql .= " t.date_lim_reglement,";
$sql .= " t.tms as date_modification,";
$sql .= " t.date_export";
$sql .= " t.date_export,";
$sql .= " t.date_validated as date_validation";
$sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t';
// Manage filter
$sqlwhere = array();
@ -1009,6 +1020,8 @@ class BookKeeping extends CommonObject
$sqlwhere[] = $key.'\''.$this->db->idate($value).'\'';
} elseif ($key == 't.date_export>=' || $key == 't.date_export<=') {
$sqlwhere[] = $key.'\''.$this->db->idate($value).'\'';
} elseif ($key == 't.date_validated>=' || $key == 't.date_validated<=') {
$sqlwhere[] = $key.'\''.$this->db->idate($value).'\'';
} elseif ($key == 't.credit' || $key == 't.debit') {
$sqlwhere[] = natural_search($key, $value, 1, 1);
} else {
@ -1068,6 +1081,8 @@ class BookKeeping extends CommonObject
$line->date_lim_reglement = $this->db->jdate($obj->date_lim_reglement);
$line->date_modification = $this->db->jdate($obj->date_modification);
$line->date_export = $this->db->jdate($obj->date_export);
$line->date_validation = $this->db->jdate($obj->date_validated);
$line->date_validation = $this->db->jdate($obj->date_validation);
$this->lines[] = $line;
@ -1454,6 +1469,8 @@ class BookKeeping extends CommonObject
$sql .= " AND code_journal = '".$this->db->escape($journal)."'";
}
$sql .= " AND entity IN (".getEntity('accountancy').")";
// Exclusion of validated entries at the time of deletion
$sql .= " AND date_validated IS NULL";
// TODO: In a future we must forbid deletion if record is inside a closed fiscal period.
@ -1603,7 +1620,8 @@ class BookKeeping extends CommonObject
{
global $conf;
$sql = "SELECT piece_num,doc_date,code_journal,journal_label,doc_ref,doc_type,date_creation";
$sql = "SELECT piece_num, doc_date,code_journal, journal_label, doc_ref, doc_type,";
$sql .= " date_creation, tms as date_modification, date_export, date_validated as date_validation";
$sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element.$mode;
$sql .= " WHERE piece_num = ".$piecenum;
$sql .= " AND entity IN (".getEntity('accountancy').")";
@ -1620,6 +1638,10 @@ class BookKeeping extends CommonObject
$this->doc_ref = $obj->doc_ref;
$this->doc_type = $obj->doc_type;
$this->date_creation = $obj->date_creation;
$this->date_modification = $obj->date_modification;
$this->date_export = $obj->date_export;
$this->date_validation = $obj->date_validated;
$this->date_validation = $obj->date_validation;
} else {
$this->error = "Error ".$this->db->lasterror();
dol_syslog(__METHOD__.$this->error, LOG_ERR);
@ -1675,7 +1697,8 @@ class BookKeeping extends CommonObject
$sql = "SELECT rowid, doc_date, doc_type,";
$sql .= " doc_ref, fk_doc, fk_docdet, thirdparty_code, subledger_account, subledger_label,";
$sql .= " numero_compte, label_compte, label_operation, debit, credit,";
$sql .= " montant as amount, sens, fk_user_author, import_key, code_journal, journal_label, piece_num, date_creation";
$sql .= " montant as amount, sens, fk_user_author, import_key, code_journal, journal_label, piece_num,";
$sql .= " date_creation, tms as date_modification, date_export, date_validated as date_validation";
$sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element.$mode;
$sql .= " WHERE piece_num = ".$piecenum;
$sql .= " AND entity IN (".getEntity('accountancy').")";
@ -1708,6 +1731,10 @@ class BookKeeping extends CommonObject
$line->journal_label = $obj->journal_label;
$line->piece_num = $obj->piece_num;
$line->date_creation = $obj->date_creation;
$line->date_modification = $obj->date_modification;
$line->date_export = $obj->date_export;
$line->date_validation = $obj->date_validated;
$line->date_validation = $obj->date_validation;
$this->linesmvt[] = $line;
}
@ -1735,7 +1762,8 @@ class BookKeeping extends CommonObject
$sql = "SELECT rowid, doc_date, doc_type,";
$sql .= " doc_ref, fk_doc, fk_docdet, thirdparty_code, subledger_account, subledger_label,";
$sql .= " numero_compte, label_compte, label_operation, debit, credit,";
$sql .= " montant as amount, sens, fk_user_author, import_key, code_journal, piece_num";
$sql .= " montant as amount, sens, fk_user_author, import_key, code_journal, piece_num,";
$sql .= " date_validated as date_validation";
$sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element;
$sql .= " WHERE entity IN (".getEntity('accountancy').")";
@ -1770,6 +1798,8 @@ class BookKeeping extends CommonObject
$line->sens = $obj->sens;
$line->code_journal = $obj->code_journal;
$line->piece_num = $obj->piece_num;
$line->date_validation = $obj->date_validated;
$line->date_validation = $obj->date_validation;
$this->linesexport[] = $line;
}
@ -2103,4 +2133,9 @@ class BookKeepingLine
* @var integer|string $date_export;
*/
public $date_export;
/**
* @var integer|string $date_validation;
*/
public $date_validation;
}

View File

@ -319,10 +319,10 @@ if ($resql) {
}
print '</td>';
for ($i = 2; $i <= 12; $i++) {
print '<td class="nowrap right">'.price($row[$i]).'</td>';
print '<td class="right nowraponall amount">'.price($row[$i]).'</td>';
}
print '<td class="nowrap right">'.price($row[13]).'</td>';
print '<td class="nowrap right"><b>'.price($row[14]).'</b></td>';
print '<td class="right nowraponall amount">'.price($row[13]).'</td>';
print '<td class="right nowraponall amount"><b>'.price($row[14]).'</b></td>';
print '</tr>';
}
$db->free($resql);
@ -405,10 +405,10 @@ if ($resql) {
print '</td>';
for ($i = 2; $i <= 12; $i++) {
print '<td class="nowrap right">'.price($row[$i]).'</td>';
print '<td class="right nowraponall amount">'.price($row[$i]).'</td>';
}
print '<td class="nowrap right">'.price($row[13]).'</td>';
print '<td class="nowrap right"><b>'.price($row[14]).'</b></td>';
print '<td class="right nowraponall amount">'.price($row[13]).'</td>';
print '<td class="right nowraponall amount"><b>'.price($row[14]).'</b></td>';
print '</tr>';
}
$db->free($resql);
@ -472,9 +472,9 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange
while ($row = $db->fetch_row($resql)) {
print '<tr><td>'.$row[0].'</td>';
for ($i = 1; $i <= 12; $i++) {
print '<td class="nowrap right">'.price($row[$i]).'</td>';
print '<td class="right nowraponall amount">'.price($row[$i]).'</td>';
}
print '<td class="nowrap right"><b>'.price($row[13]).'</b></td>';
print '<td class="right nowraponall amount"><b>'.price($row[13]).'</b></td>';
print '</tr>';
}
$db->free($resql);
@ -533,9 +533,9 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange
while ($row = $db->fetch_row($resql)) {
print '<tr><td>'.$row[0].'</td>';
for ($i = 1; $i <= 12; $i++) {
print '<td class="nowrap right">'.price(price2num($row[$i])).'</td>';
print '<td class="right nowraponall amount">'.price(price2num($row[$i])).'</td>';
}
print '<td class="nowrap right"><b>'.price(price2num($row[13])).'</b></td>';
print '<td class="right nowraponall amount"><b>'.price(price2num($row[13])).'</b></td>';
print '</tr>';
}
$db->free($resql);

View File

@ -492,7 +492,7 @@ if ($result) {
print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->description);
print '</td>';
print '<td class="nowrap right">'.price($objp->total_ht).'</td>';
print '<td class="right nowraponall amount">'.price($objp->total_ht).'</td>';
print '<td class="right">'.vatrate($objp->tva_tx.($objp->vat_src_code ? ' ('.$objp->vat_src_code.')' : '')).'</td>';

View File

@ -687,7 +687,7 @@ if ($result) {
print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->description);
print '</td>';
print '<td class="nowrap right">';
print '<td class="right nowraponall amount">';
print price($objp->total_ht);
print '</td>';

View File

@ -210,10 +210,10 @@ if ($resql) {
}
print '</td>';
for ($i = 2; $i <= 12; $i++) {
print '<td class="nowrap right">'.price($row[$i]).'</td>';
print '<td class="right nowraponall amount">'.price($row[$i]).'</td>';
}
print '<td class="nowrap right">'.price($row[13]).'</td>';
print '<td class="nowrap right"><b>'.price($row[14]).'</b></td>';
print '<td class="right nowraponall amount">'.price($row[13]).'</td>';
print '<td class="right nowraponall amount"><b>'.price($row[14]).'</b></td>';
print '</tr>';
}
$db->free($resql);
@ -290,10 +290,10 @@ if ($resql) {
}
print '</td>';
for ($i = 2; $i <= 12; $i++) {
print '<td class="nowrap right">'.price($row[$i]).'</td>';
print '<td class="right nowraponall amount">'.price($row[$i]).'</td>';
}
print '<td class="nowrap right">'.price($row[13]).'</td>';
print '<td class="nowrap right"><b>'.price($row[14]).'</b></td>';
print '<td class="right nowraponall amount">'.price($row[13]).'</td>';
print '<td class="right nowraponall amount"><b>'.price($row[14]).'</b></td>';
print '</tr>';
}
$db->free($resql);
@ -352,9 +352,9 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange
while ($row = $db->fetch_row($resql)) {
print '<tr><td>'.$row[0].'</td>';
for ($i = 1; $i <= 12; $i++) {
print '<td class="nowrap right">'.price($row[$i]).'</td>';
print '<td class="right nowraponall amount">'.price($row[$i]).'</td>';
}
print '<td class="nowrap right"><b>'.price($row[13]).'</b></td>';
print '<td class="right nowraponall amount"><b>'.price($row[13]).'</b></td>';
print '</tr>';
}

View File

@ -388,7 +388,7 @@ if ($result) {
print '</td>';
// Amount without taxes
print '<td class="nowrap right">'.price($objp->total_ht).'</td>';
print '<td class="right nowraponall amount">'.price($objp->total_ht).'</td>';
// Vat rate
print '<td class="center">'.vatrate($objp->tva_tx.($objp->vat_src_code ? ' ('.$objp->vat_src_code.')' : '')).'</td>';

View File

@ -434,7 +434,7 @@ if ($result) {
print '</td>';
// Amount without taxes
print '<td class="nowrap right">';
print '<td class="right nowraponall amount">';
print price($objp->price);
print '</td>';

View File

@ -1108,8 +1108,8 @@ if (empty($action) || $action == 'view') {
print $reflabel;
print "</td>";
print '<td class="center">'.$val["type_payment"]."</td>";
print '<td class="right nowraponall">'.($mt >= 0 ? price($mt) : '')."</td>";
print '<td class="right nowraponall">'.($mt < 0 ? price(-$mt) : '')."</td>";
print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>";
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
print "</tr>";
}
}
@ -1222,8 +1222,8 @@ if (empty($action) || $action == 'view') {
print "</td>";
print "<td>".$reflabel."</td>";
print '<td class="center">'.$val["type_payment"]."</td>";
print '<td class="right nowraponall">'.($mt < 0 ? price(-$mt) : '')."</td>";
print '<td class="right nowraponall">'.($mt >= 0 ? price($mt) : '')."</td>";
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>";
print "</tr>";
}
}
@ -1259,8 +1259,8 @@ if (empty($action) || $action == 'view') {
print "</td>";
print "<td>".$reflabel."</td>";
print '<td class="center">'.$val["type_payment"]."</td>";
print '<td class="right nowraponall">'.($mt < 0 ? price(-$mt) : '')."</td>";
print '<td class="right nowraponall">'.($mt >= 0 ? price($mt) : '')."</td>";
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>";
print "</tr>";
}
}

View File

@ -610,8 +610,8 @@ if (empty($action) || $action == 'view') {
$userstatic->id = $tabuser[$key]['id'];
$userstatic->name = $tabuser[$key]['name'];
print "<td>".$userstatic->getNomUrl(0, 'user', 16).' - '.$accountingaccount->label."</td>";
print '<td class="right nowraponall">'.($mt >= 0 ? price($mt) : '')."</td>";
print '<td class="right nowraponall">'.($mt < 0 ? price(-$mt) : '')."</td>";
print '<td class="right nowraponall amount amount">'.($mt >= 0 ? price($mt) : '')."</td>";
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
print "</tr>";
}
}
@ -644,8 +644,8 @@ if (empty($action) || $action == 'view') {
}
print '</td>';
print "<td>".$userstatic->getNomUrl(0, 'user', 16).' - '.$langs->trans("SubledgerAccount")."</td>";
print '<td class="right nowraponall">'.($mt < 0 ? price(-$mt) : '')."</td>";
print '<td class="right nowraponall">'.($mt >= 0 ? price($mt) : '')."</td>";
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>";
print "</tr>";
}
@ -680,8 +680,8 @@ if (empty($action) || $action == 'view') {
print '</td>';
print "<td>".$userstatic->getNomUrl(0, 'user', 16).' - '.$langs->trans("VAT").' '.join(', ', $def_tva[$key][$k]).' %'.($numtax ? ' - Localtax '.$numtax : '');
print "</td>";
print '<td class="right nowraponall">'.($mt >= 0 ? price($mt) : '')."</td>";
print '<td class="right nowraponall">'.($mt < 0 ? price(-$mt) : '')."</td>";
print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>";
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
print "</tr>";
}
}

View File

@ -911,8 +911,8 @@ if (empty($action) || $action == 'view') {
}
print '</td>';
print "<td>".$companystatic->getNomUrl(0, 'supplier', 16).' - '.$invoicestatic->ref_supplier.' - '.$langs->trans("SubledgerAccount")."</td>";
print '<td class="right nowraponall">'.($mt < 0 ? price(-$mt) : '')."</td>";
print '<td class="right nowraponall">'.($mt >= 0 ? price($mt) : '')."</td>";
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>";
print "</tr>";
}
@ -940,8 +940,8 @@ if (empty($action) || $action == 'view') {
$companystatic->id = $tabcompany[$key]['id'];
$companystatic->name = $tabcompany[$key]['name'];
print "<td>".$companystatic->getNomUrl(0, 'supplier', 16).' - '.$invoicestatic->ref_supplier.' - '.$accountingaccount->label."</td>";
print '<td class="right nowraponall">'.($mt >= 0 ? price($mt) : '')."</td>";
print '<td class="right nowraponall">'.($mt < 0 ? price(-$mt) : '')."</td>";
print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>";
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
print "</tr>";
}
@ -977,8 +977,8 @@ if (empty($action) || $action == 'view') {
print "<td>";
print $companystatic->getNomUrl(0, 'supplier', 16).' - '.$invoicestatic->ref_supplier.' - '.$langs->trans("VAT").' '.join(', ', $def_tva[$key][$k]).' %'.($numtax ? ' - Localtax '.$numtax : '');
print "</td>";
print '<td class="right nowraponall">'.($mt >= 0 ? price($mt) : '')."</td>";
print '<td class="right nowraponall">'.($mt < 0 ? price(-$mt) : '')."</td>";
print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>";
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
print "</tr>";
}
}
@ -1005,8 +1005,8 @@ if (empty($action) || $action == 'view') {
print "<td>";
print '</td>';
print "<td>".$companystatic->getNomUrl(0, 'supplier', 16).' - '.$invoicestatic->ref_supplier.' - '.$langs->trans("VAT")." NPR (counterpart)</td>";
print '<td class="right nowraponall">'.($mt < 0 ? price(-$mt) : '')."</td>";
print '<td class="right nowraponall">'.($mt >= 0 ? price($mt) : '')."</td>";
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>";
print "</tr>";
}
}

View File

@ -851,8 +851,8 @@ if (empty($action) || $action == 'view') {
}
print '</td>';
print "<td>".$companystatic->getNomUrl(0, 'customer', 16).' - '.$invoicestatic->ref.' - '.$langs->trans("SubledgerAccount")."</td>";
print '<td class="right nowraponall">'.($mt >= 0 ? price($mt) : '')."</td>";
print '<td class="right nowraponall">'.($mt < 0 ? price(-$mt) : '')."</td>";
print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>";
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
print "</tr>";
}
@ -880,8 +880,8 @@ if (empty($action) || $action == 'view') {
$companystatic->id = $tabcompany[$key]['id'];
$companystatic->name = $tabcompany[$key]['name'];
print "<td>".$companystatic->getNomUrl(0, 'customer', 16).' - '.$invoicestatic->ref.' - '.$accountingaccount->label."</td>";
print '<td class="right nowraponall">'.($mt < 0 ? price(-$mt) : '')."</td>";
print '<td class="right nowraponall">'.($mt >= 0 ? price($mt) : '')."</td>";
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>";
print "</tr>";
}
@ -916,8 +916,8 @@ if (empty($action) || $action == 'view') {
print '</td>';
print "<td>".$companystatic->getNomUrl(0, 'customer', 16).' - '.$invoicestatic->ref.' - '.$langs->trans("VAT").' '.join(', ', $def_tva[$key][$k]).' %'.($numtax ? ' - Localtax '.$numtax : '');
print "</td>";
print '<td class="right nowraponall">'.($mt < 0 ? price(-$mt) : '')."</td>";
print '<td class="right nowraponall">'.($mt >= 0 ? price($mt) : '')."</td>";
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>";
print "</tr>";
}
}

View File

@ -314,10 +314,10 @@ if ($resql) {
}
print '</td>';
for ($i = 2; $i <= 12; $i++) {
print '<td class="nowrap right">'.price($row[$i]).'</td>';
print '<td class="right nowraponall amount">'.price($row[$i]).'</td>';
}
print '<td class="nowrap right">'.price($row[13]).'</td>';
print '<td class="nowrap right"><b>'.price($row[14]).'</b></td>';
print '<td class="right nowraponall amount">'.price($row[13]).'</td>';
print '<td class="right nowraponall amount"><b>'.price($row[14]).'</b></td>';
print '</tr>';
}
$db->free($resql);
@ -393,10 +393,10 @@ if ($resql) {
}
print '</td>';
for ($i = 2; $i <= 12; $i++) {
print '<td class="nowrap right">'.price($row[$i]).'</td>';
print '<td class="right nowraponall amount">'.price($row[$i]).'</td>';
}
print '<td class="nowrap right">'.price($row[13]).'</td>';
print '<td class="nowrap right"><b>'.price($row[14]).'</b></td>';
print '<td class="right nowraponall amount">'.price($row[13]).'</td>';
print '<td class="right nowraponall amount"><b>'.price($row[14]).'</b></td>';
print '</tr>';
}
$db->free($resql);
@ -456,9 +456,9 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange
while ($row = $db->fetch_row($resql)) {
print '<tr><td>'.$row[0].'</td>';
for ($i = 1; $i <= 12; $i++) {
print '<td class="nowrap right">'.price($row[$i]).'</td>';
print '<td class="right nowraponall amount">'.price($row[$i]).'</td>';
}
print '<td class="nowrap right"><b>'.price($row[13]).'</b></td>';
print '<td class="right nowraponall amount"><b>'.price($row[13]).'</b></td>';
print '</tr>';
}
$db->free($resql);

View File

@ -497,7 +497,7 @@ if ($result) {
print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->description);
print '</td>';
print '<td class="nowrap right">'.price($objp->total_ht).'</td>';
print '<td class="right nowraponall amount">'.price($objp->total_ht).'</td>';
print '<td class="right">'.vatrate($objp->tva_tx.($objp->vat_src_code ? ' ('.$objp->vat_src_code.')' : '')).'</td>';

View File

@ -671,7 +671,7 @@ if ($result) {
print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->description);
print '</td>';
print '<td class="nowrap right">';
print '<td class="right nowraponall amount">';
print price($objp->total_ht);
print '</td>';

View File

@ -205,11 +205,11 @@ if ($id > 0 || !empty($ref)) {
}
print ' ('.$langs->transnoentities("InvoiceHasAvoir") . (count($invoicecredits) ? ' ' : '') . implode(',', $invoicecredits) . ')';
}
if ($facidnext > 0) {
$facthatreplace = new FactureFournisseur($db);
$facthatreplace->fetch($facidnext);
print ' ('.$langs->transnoentities("ReplacedByInvoice", $facthatreplace->getNomUrl(1)).')';
}
//if ($facidnext > 0) {
// $facthatreplace = new FactureFournisseur($db);
// $facthatreplace->fetch($facidnext);
// print ' ('.$langs->transnoentities("ReplacedByInvoice", $facthatreplace->getNomUrl(1)).')';
//}
print '</td></tr>';
// Label
@ -223,13 +223,13 @@ if ($id > 0 || !empty($ref)) {
// Amount Local Taxes
//TODO: Place into a function to control showing by country or study better option
if ($societe->localtax1_assuj == "1") { //Localtax1
print '<tr><td>'.$langs->transcountry("AmountLT1", $societe->country_code).'</td>';
if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) { //Localtax1
print '<tr><td>'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>';
print '<td>'.price($object->total_localtax1, 1, $langs, 0, -1, -1, $conf->currency).'</td>';
print '</tr>';
}
if ($societe->localtax2_assuj == "1") { //Localtax2
print '<tr><td>'.$langs->transcountry("AmountLT2", $societe->country_code).'</td>';
if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) { //Localtax2
print '<tr><td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td>';
print '<td>'.price($object->total_localtax2, 1, $langs, 0, -1, -1, $conf->currency).'</td>';
print '</tr>';
}

View File

@ -5,7 +5,9 @@
-- Copyright (C) 2004 Guillaume Delecourt <guillaume.delecourt@opensides.be>
-- Copyright (C) 2005-2010 Regis Houssin <regis.houssin@inodbox.com>
-- Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
-- Copyright (C) 2021 Udo Tamm <dev@dolibit.de>
--
--
-- 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
@ -27,25 +29,27 @@
--
--
-- Types de charges
-- Types de charges
--
-- insert into llx_c_chargesociales (fk_pays, id, libelle, deductible, active, code) values (id of country, id of social charges = fk_pays id & free numbering, label, ...);
--
-- France
--
insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values ( 1, 'Securite sociale (URSSAF / MSA)', 1, 1, 'TAXSECU', '1');
insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values ( 2, 'Securite sociale des indépendants (URSSAF)', 1, 1, 'TAXSSI', '1');
insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values ( 10, 'Taxe apprentissage', 1, 1, 'TAXAPP', '1');
insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values ( 11, 'Formation professionnelle continue', 1, 1, 'TAXFPC', '1');
insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values ( 12, 'Cotisation fonciere des entreprises (CFE)', 1, 1, 'TAXCFE', '1');
insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values ( 13, 'Cotisation sur la valeur ajoutee des entreprises (CVAE)', 1, 1, 'TAXCVAE', '1');
insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values ( 20, 'Taxe fonciere', 1, 1, 'TAXFON', '1');
insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values ( 25, 'Prelevement à la source (PAS)', 0, 1, 'TAXPAS', '1');
insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values ( 30, 'Prevoyance', 1, 1,'TAXPREV', '1');
insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values ( 40, 'Mutuelle', 1, 1,'TAXMUT', '1');
insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values ( 50, 'Retraite', 1, 1,'TAXRET', '1');
insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values ( 60, 'Taxe sur vehicule societe (TVS)', 0, 1, 'TAXTVS', '1');
insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values ( 70, 'impôts sur les sociétés (IS)', 0, 1, 'TAXIS', '1');
insert into llx_c_chargesociales (fk_pays, id, libelle, deductible, active, code) values ( 1, 1, 'Securite sociale (URSSAF / MSA)', 1, 1, 'TAXSECU');
insert into llx_c_chargesociales (fk_pays, id, libelle, deductible, active, code) values ( 1, 2, 'Securite sociale des indépendants (URSSAF)', 1, 1, 'TAXSSI');
insert into llx_c_chargesociales (fk_pays, id, libelle, deductible, active, code) values ( 1, 10, 'Taxe apprentissage', 1, 1, 'TAXAPP');
insert into llx_c_chargesociales (fk_pays, id, libelle, deductible, active, code) values ( 1, 11, 'Formation professionnelle continue', 1, 1, 'TAXFPC');
insert into llx_c_chargesociales (fk_pays, id, libelle, deductible, active, code) values ( 1, 12, 'Cotisation fonciere des entreprises (CFE)', 1, 1, 'TAXCFE');
insert into llx_c_chargesociales (fk_pays, id, libelle, deductible, active, code) values ( 1, 13, 'Cotisation sur la valeur ajoutee des entreprises (CVAE)', 1, 1, 'TAXCVAE');
insert into llx_c_chargesociales (fk_pays, id, libelle, deductible, active, code) values ( 1, 20, 'Taxe fonciere', 1, 1, 'TAXFON');
insert into llx_c_chargesociales (fk_pays, id, libelle, deductible, active, code) values ( 1, 25, 'Prelevement à la source (PAS)', 0, 1, 'TAXPAS');
insert into llx_c_chargesociales (fk_pays, id, libelle, deductible, active, code) values ( 1, 30, 'Prevoyance', 1, 1,'TAXPREV');
insert into llx_c_chargesociales (fk_pays, id, libelle, deductible, active, code) values ( 1, 40, 'Mutuelle', 1, 1,'TAXMUT');
insert into llx_c_chargesociales (fk_pays, id, libelle, deductible, active, code) values ( 1, 50, 'Retraite', 1, 1,'TAXRET');
insert into llx_c_chargesociales (fk_pays, id, libelle, deductible, active, code) values ( 1, 60, 'Taxe sur vehicule societe (TVS)', 0, 1, 'TAXTVS');
insert into llx_c_chargesociales (fk_pays, id, libelle, deductible, active, code) values ( 1, 70, 'impôts sur les sociétés (IS)', 0, 1, 'TAXIS');
--
-- Belgique

View File

@ -328,6 +328,9 @@ ACCOUNTING_DISABLE_BINDING_ON_PURCHASES=Disable binding & transfer in accountanc
ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS=Disable binding & transfer in accountancy on expense reports (expense reports will not be taken into account in accounting)
## Export
NotifiedExportDate=Notified export date (modification of the entries will not be possible)
NotifiedValidationDate=Validation of the entries (modification or deletion of the entries will not be possible)
ConfirmExportFile=Confirmation of the generation of the accounting export file ?
ExportDraftJournal=Export draft journal
Modelcsv=Model of export
Selectmodelcsv=Select a model of export
@ -427,4 +430,4 @@ WarningReportNotReliable=Warning, this report is not based on the Ledger, so doe
ExpenseReportJournal=Expense Report Journal
InventoryJournal=Inventory Journal
NAccounts=%s accounts
NAccounts=%s accounts

View File

@ -724,7 +724,6 @@ if ($resql) {
$perm = $user->rights->service->creer;
} elseif ($type == Product::TYPE_PRODUCT) {
$perm = $user->rights->produit->creer;
}
$oldtype = $type;
$params = array();

View File

@ -8,7 +8,7 @@
* Copyright (C) 2012-2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018-2021 Frédéric France <frederic.france@netlogic.fr>
*
* 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
@ -31,7 +31,7 @@
* \brief File of class to generate document from standard template
*/
dol_include_once('/recruitment/core/modules/recruitment/modules_recruitmentjobposition.php');
require_once DOL_DOCUMENT_ROOT.'/recruitment/core/modules/recruitment/modules_recruitmentjobposition.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
@ -130,7 +130,7 @@ class pdf_standard_recruitmentjobposition extends ModelePDFRecruitmentJobPositio
/**
* @var array of document table columns
*/
public $cols;
public $cols = array();
/**
@ -347,7 +347,11 @@ class pdf_standard_recruitmentjobposition extends ModelePDFRecruitmentJobPositio
// Set path to the background PDF File
if (!empty($conf->global->MAIN_ADD_PDF_BACKGROUND)) {
$pagecount = $pdf->setSourceFile($conf->mycompany->multidir_output[$object->entity].'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND);
$logodir = $conf->mycompany->dir_output;
if (!empty($conf->mycompany->multidir_output[$object->entity])) {
$logodir = $conf->mycompany->multidir_output[$object->entity];
}
$pagecount = $pdf->setSourceFile($logodir.'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND);
$tplidx = $pdf->importPage(1);
}

View File

@ -98,7 +98,7 @@ $resources = GETPOST('resources', 'array:int');
// List of fields to search into when doing a "search in all"
$fieldstosearchall = array();
foreach ($object->fields as $key => $val) {
if ($val['searchall']) {
if (!empty($val['searchall'])) {
$fieldstosearchall['t.'.$key] = $val['label'];
}
}
@ -114,7 +114,7 @@ foreach ($object->fields as $key => $val) {
'checked'=>(($visible < 0) ? 0 : 1),
'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)),
'position'=>$val['position'],
'help'=>$val['help']
'help' => empty($val['help']) ? '' : $val['help']
);
}
}
@ -124,7 +124,7 @@ $arrayfields['wug.fk_usergroup'] = array(
'checked'=>(($visible < 0) ? 0 : 1),
'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)),
'position'=>1000,
'help'=>$val['help']
'help' => empty($val['help']) ? '' : $val['help']
);
$arrayfields['wr.fk_resource'] = array(
@ -132,7 +132,7 @@ $arrayfields['wr.fk_resource'] = array(
'checked'=>(($visible < 0) ? 0 : 1),
'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)),
'position'=>1001,
'help'=>$val['help']
'help' => empty($val['help']) ? '' : $val['help']
);
// Extra fields