diff --git a/htdocs/accountancy/supplier/lines.php b/htdocs/accountancy/supplier/lines.php index 42fc7cfb6a8..43a5c5d33b5 100644 --- a/htdocs/accountancy/supplier/lines.php +++ b/htdocs/accountancy/supplier/lines.php @@ -1,9 +1,9 @@ - * Copyright (C) 2013-2021 Alexandre Spangaro - * Copyright (C) 2014-2015 Ari Elbaz (elarifr) - * Copyright (C) 2013-2016 Florian Henry - * Copyright (C) 2014 Juanjo Menent +/* Copyright (C) 2013-2016 Olivier Geffroy + * Copyright (C) 2013-2022 Alexandre Spangaro + * Copyright (C) 2014-2015 Ari Elbaz (elarifr) + * Copyright (C) 2013-2016 Florian Henry + * Copyright (C) 2014 Juanjo Menent * * 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 @@ -49,6 +49,7 @@ $search_societe = GETPOST('search_societe', 'alpha'); $search_lineid = GETPOST('search_lineid', 'int'); $search_ref = GETPOST('search_ref', 'alpha'); $search_invoice = GETPOST('search_invoice', 'alpha'); +$search_ref_supplier = GETPOST('search_ref_supplier', 'alpha'); $search_label = GETPOST('search_label', 'alpha'); $search_desc = GETPOST('search_desc', 'alpha'); $search_amount = GETPOST('search_amount', 'alpha'); @@ -112,6 +113,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x' $search_lineid = ''; $search_ref = ''; $search_invoice = ''; + $search_ref_supplier = ''; $search_label = ''; $search_desc = ''; $search_amount = ''; @@ -236,6 +238,9 @@ if ($search_lineid) { if (strlen(trim($search_invoice))) { $sql .= natural_search("f.ref", $search_invoice); } +if (strlen(trim($search_ref_supplier))) { + $sql .= natural_search("f.ref_supplier", $search_ref_supplier); +} if (strlen(trim($search_label))) { $sql .= natural_search("f.libelle", $search_label); } @@ -328,6 +333,9 @@ if ($result) { if ($search_ref) { $param .= "&search_ref=".urlencode($search_ref); } + if ($search_ref_supplier) { + $param .= '&search_ref_supplier='.urlencode($search_ref_supplier); + } if ($search_label) { $param .= "&search_label=".urlencode($search_label); } @@ -392,6 +400,7 @@ if ($result) { print ''; print ''; print ''; + print ''; print ''; print ''; print '
'; @@ -420,6 +429,7 @@ if ($result) { print ''; print_liste_field_titre("LineId", $_SERVER["PHP_SELF"], "l.rowid", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Invoice", $_SERVER["PHP_SELF"], "f.ref", "", $param, '', $sortfield, $sortorder); + print_liste_field_titre("RefSupplier", $_SERVER["PHP_SELF"], "f.ref_supplier", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("InvoiceLabel", $_SERVER["PHP_SELF"], "f.libelle", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "f.datef, f.ref, l.rowid", "", $param, '', $sortfield, $sortorder, 'center '); print_liste_field_titre("ProductRef", $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder); @@ -446,6 +456,9 @@ if ($result) { $facturefournisseur_static->ref = $objp->ref; $facturefournisseur_static->id = $objp->facid; + $facturefournisseur_static->type = $objp->ftype; + $facturefournisseur_static->ref_supplier = $objp->ref_supplier; + $facturefournisseur_static->label = $objp->invoice_label; $thirdpartystatic->id = $objp->socid; $thirdpartystatic->name = $objp->name; @@ -465,8 +478,8 @@ if ($result) { $productstatic->status = $objp->tosell; $productstatic->status_buy = $objp->tobuy; $productstatic->accountancy_code_buy = $objp->accountancy_code_buy; - $productstatic->accountancy_code_buy_intra = $objp->accountancy_code_sell_buy; - $productstatic->accountancy_code_buy_export = $objp->accountancy_code_sell_buy; + $productstatic->accountancy_code_buy_intra = $objp->accountancy_code_sell_buy_intra; + $productstatic->accountancy_code_buy_export = $objp->accountancy_code_sell_buy_export; $accountingaccountstatic->rowid = $objp->fk_compte; $accountingaccountstatic->label = $objp->label_account; @@ -481,6 +494,12 @@ if ($result) { // Ref Invoice print ''.$facturefournisseur_static->getNomUrl(1).''; + // Ref supplier invoice + print ''; + print $objp->ref_supplier; + print ''; + + // Supplier invoice label print ''; print $objp->invoice_label; print ''; diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index 0af840e3599..d6b8a21e619 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -1,10 +1,10 @@ - * Copyright (C) 2013-2021 Alexandre Spangaro - * Copyright (C) 2014-2015 Ari Elbaz (elarifr) - * Copyright (C) 2013-2021 Florian Henry - * Copyright (C) 2014 Juanjo Menent s - * Copyright (C) 2016 Laurent Destailleur +/* Copyright (C) 2013-2014 Olivier Geffroy + * Copyright (C) 2013-2022 Alexandre Spangaro + * Copyright (C) 2014-2015 Ari Elbaz (elarifr) + * Copyright (C) 2013-2014 Florian Henry + * Copyright (C) 2014 Juanjo Menent s + * Copyright (C) 2016 Laurent Destailleur * * 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 @@ -55,6 +55,7 @@ $mesCasesCochees = GETPOST('toselect', 'array'); $search_societe = GETPOST('search_societe', 'alpha'); $search_lineid = GETPOST('search_lineid', 'int'); $search_ref = GETPOST('search_ref', 'alpha'); +$search_ref_supplier = GETPOST('search_ref_supplier', 'alpha'); $search_invoice = GETPOST('search_invoice', 'alpha'); $search_label = GETPOST('search_label', 'alpha'); $search_desc = GETPOST('search_desc', 'alpha'); @@ -137,6 +138,7 @@ if (empty($reshook)) { $search_societe = ''; $search_lineid = ''; $search_ref = ''; + $search_ref_supplier = ''; $search_invoice = ''; $search_label = ''; $search_desc = ''; @@ -290,6 +292,9 @@ if (strlen(trim($search_invoice))) { if (strlen(trim($search_ref))) { $sql .= natural_search("p.ref", $search_ref); } +if (strlen(trim($search_ref_supplier))) { + $sql .= natural_search("f.ref_supplier", $search_ref_supplier); +} if (strlen(trim($search_label))) { $sql .= natural_search(array("p.label", "f.libelle"), $search_label); } @@ -413,6 +418,9 @@ if ($result) { if ($search_ref) { $param .= '&search_ref='.urlencode($search_ref); } + if ($search_ref_supplier) { + $param .= '&search_ref_supplier='.urlencode($search_ref_supplier); + } if ($search_label) { $param .= '&search_label='.urlencode($search_label); } @@ -469,7 +477,8 @@ if ($result) { print ''; print ''; print ''; - //print ''; + print ''; + print ''; print ''; print '
'; print $form->selectDate($search_date_start ? $search_date_start : -1, 'search_date_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); @@ -499,7 +508,8 @@ if ($result) { print ''; print_liste_field_titre("LineId", $_SERVER["PHP_SELF"], "l.rowid", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Invoice", $_SERVER["PHP_SELF"], "f.ref", "", $param, '', $sortfield, $sortorder); - //print_liste_field_titre("InvoiceLabel", $_SERVER["PHP_SELF"], "f.libelle", "", $param, '', $sortfield, $sortorder); + print_liste_field_titre("RefSupplier", $_SERVER["PHP_SELF"], "f.ref_supplier", "", $param, '', $sortfield, $sortorder); + print_liste_field_titre("InvoiceLabel", $_SERVER["PHP_SELF"], "f.libelle", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "f.datef, f.ref, l.rowid", "", $param, '', $sortfield, $sortorder, 'center '); print_liste_field_titre("ProductRef", $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder); //print_liste_field_titre("ProductLabel", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder); @@ -566,6 +576,7 @@ if ($result) { $facturefourn_static->ref = $objp->ref; $facturefourn_static->id = $objp->facid; $facturefourn_static->type = $objp->ftype; + $facturefourn_static->ref_supplier = $objp->ref_supplier; $facturefourn_static->label = $objp->invoice_label; $facturefourn_static->date = $db->jdate($objp->datef); @@ -625,10 +636,15 @@ if ($result) { // Ref Invoice print ''.$facturefourn_static->getNomUrl(1).''; - /*print ''; + // Ref supplier invoice + print ''; + print $objp->ref_supplier; + print ''; + + // Supplier invoice label + print ''; print $objp->invoice_label; print ''; - */ print ''.dol_print_date($facturefourn_static->date, 'day').'';