diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php index 70e79e31063..0eca61c72c1 100644 --- a/htdocs/accountancy/customer/index.php +++ b/htdocs/accountancy/customer/index.php @@ -1,9 +1,9 @@ - * Copyright (C) 2013-2014 Florian Henry - * Copyright (C) 2013-2021 Alexandre Spangaro - * Copyright (C) 2014 Juanjo Menent - * Copyright (C) 2015 Jean-François Ferry +/* Copyright (C) 2013 Olivier Geffroy + * Copyright (C) 2013-2014 Florian Henry + * Copyright (C) 2013-2022 Alexandre Spangaro + * Copyright (C) 2014 Juanjo Menent + * Copyright (C) 2015 Jean-François Ferry * * 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 @@ -174,7 +174,9 @@ if ($action == 'validatehistory') { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa2 ON " . $alias_product_perentity . ".accountancy_code_sell_intra = aa2.account_number AND aa2.active = 1 AND aa2.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa2.entity = ".$conf->entity; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa3 ON " . $alias_product_perentity . ".accountancy_code_sell_export = aa3.account_number AND aa3.active = 1 AND aa3.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa3.entity = ".$conf->entity; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa4 ON " . $alias_societe_perentity . ".accountancy_code_sell = aa4.account_number AND aa4.active = 1 AND aa4.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa4.entity = ".$conf->entity; - $sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0 AND l.product_type <= 2 AND f.entity = ".((int) $conf->entity); + $sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0"; + $sql .= " AND l.product_type <= 2"; + $sql .= " AND f.entity IN (".getEntity('invoice', 0).")"; // We don't share object for accountancy if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) { $sql .= " AND f.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'"; } diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php index e46b508512d..e56645f1a1b 100644 --- a/htdocs/accountancy/supplier/index.php +++ b/htdocs/accountancy/supplier/index.php @@ -1,7 +1,7 @@ * Copyright (C) 2013-2021 Florian Henry - * Copyright (C) 2013-2021 Alexandre Spangaro + * Copyright (C) 2013-2022 Alexandre Spangaro * Copyright (C) 2014 Juanjo Menent * * This program is free software; you can redistribute it and/or modify @@ -171,8 +171,10 @@ if ($action == 'validatehistory') { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON " . $alias_product_perentity . ".accountancy_code_buy = aa.account_number AND aa.active = 1 AND aa.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa.entity = ".$conf->entity; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa2 ON " . $alias_product_perentity . ".accountancy_code_buy_intra = aa2.account_number AND aa2.active = 1 AND aa2.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa2.entity = ".$conf->entity; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa3 ON " . $alias_product_perentity . ".accountancy_code_buy_export = aa3.account_number AND aa3.active = 1 AND aa3.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa3.entity = ".$conf->entity; - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa4 ON " . $alias_societe_perentity . ".accountancy_code_buy = aa4.account_number AND aa4.active = 1 AND aa4.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa4.entity = ".$conf->entity; - $sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0 AND l.product_type <= 2 AND f.entity = ".((int) $conf->entity); + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa4 ON " . $alias_product_perentity . ".accountancy_code_buy = aa4.account_number AND aa4.active = 1 AND aa4.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa4.entity = ".$conf->entity; + $sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0"; + $sql .= " AND l.product_type <= 2"; + $sql .= " AND f.entity IN (".getEntity('facture_fourn', 0).")"; // We don't share object for accountancy if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) { $sql .= " AND f.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'"; } diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index c6fe68c62ed..49d86c1ceb6 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1012,7 +1012,7 @@ if (empty($reshook)) { $object->date = $dateinvoice; $object->date_pointoftax = $date_pointoftax; $object->note_public = trim(GETPOST('note_public', 'restricthtml')); - // We do not copy the private note + $object->note_private = trim(GETPOST('note_private', 'restricthtml')); $object->ref_client = GETPOST('ref_client', 'alphanohtml'); $object->model_pdf = GETPOST('model', 'alphanohtml'); $object->fk_project = GETPOST('projectid', 'int'); @@ -1065,7 +1065,7 @@ if (empty($reshook)) { $object->date = $dateinvoice; $object->date_pointoftax = $date_pointoftax; $object->note_public = trim(GETPOST('note_public', 'restricthtml')); - // We do not copy the private note + $object->note_private = trim(GETPOST('note_private', 'restricthtml')); $object->ref_client = GETPOST('ref_client'); $object->model_pdf = GETPOST('model'); $object->fk_project = GETPOST('projectid', 'int'); diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php index fc208fd9ac3..3f33d76516f 100644 --- a/htdocs/cron/list.php +++ b/htdocs/cron/list.php @@ -353,6 +353,10 @@ if ($action == 'execute') { print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$id.'&securitykey='.$securitykey.$param, $langs->trans("CronExecute"), $langs->trans("CronConfirmExecute"), "confirm_execute", '', '', 1); } +if ($action == 'delete') { + print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$id.$param, $langs->trans("CronDelete"), $langs->trans("CronConfirmDelete"), "confirm_delete", '', '', 1); +} + // List of mass actions available $arrayofmassactions = array( //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),