From dde7a1f5430cdda2d8ac29aa4b8b1544d20926cb Mon Sep 17 00:00:00 2001 From: eldy Date: Thu, 29 Sep 2011 13:53:17 +0200 Subject: [PATCH 1/3] New: After creating supplier payment, go on supplier invoice if payment was on one invoice only. This save one click. --- htdocs/fourn/facture/paiement.php | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index bfeef4c3a0f..6ec8bf2654a 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -67,10 +67,7 @@ if ($action == 'add_paiement') { $error = 0; - $datepaye = dol_mktime(12, 0 , 0, - $_POST['remonth'], - $_POST['reday'], - $_POST['reyear']); + $datepaye = dol_mktime(12, 0 , 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); $paiement_id = 0; $total = 0; @@ -149,7 +146,20 @@ if ($action == 'add_paiement') if (! $error) { $db->commit(); - $loc = DOL_URL_ROOT.'/fourn/paiement/fiche.php?id='.$paiement_id; + + // If payment dispatching on more than one invoice, we keep on summary page, otherwise go on invoice card + $invoiceid=0; + foreach ($paiement->amounts as $key => $amount) + { + $facid = $key; + if (is_numeric($amount) && $amount <> 0) + { + if ($invoiceid != 0) $invoiceid=-1; // There is more than one invoice payed by this payment + else $invoiceid=$facid; + } + } + if ($invoiceid > 0) $loc = DOL_URL_ROOT.'/fourn/facture/fiche.php?facid='.$invoiceid; + else $loc = DOL_URL_ROOT.'/compta/paiement/fiche.php?id='.$paiement_id; Header('Location: '.$loc); exit; } @@ -198,8 +208,8 @@ if ($action == 'create' || $action == 'add_paiement') print_fiche_titre($langs->trans('DoPayment')); - if ($mesg) print $mesg; - if ($errmsg) print $errmsg; + if ($mesg) dol_htmloutput_mesg($mesg); + if ($errmsg) dol_htmloutput_errors($errmsg); print '
'; print ''; @@ -296,7 +306,7 @@ if ($action == 'create' || $action == 'add_paiement') print ''.price($objp->total_ttc - $objp->am).''; print ''; $namef = 'amount_'.$objp->facid; - print ''; + print ''; print "\n"; $total+=$objp->total; $total_ttc+=$objp->total_ttc; From 8027d5905e5ca368fc7f4b75b9becbfa4458cac8 Mon Sep 17 00:00:00 2001 From: eldy Date: Thu, 29 Sep 2011 14:47:57 +0200 Subject: [PATCH 2/3] Fix: Bad case --- htdocs/lib/databases/mssql.class.php | 6 +++--- htdocs/lib/databases/mysql.class.php | 6 +++--- htdocs/lib/databases/pgsql.class.php | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/lib/databases/mssql.class.php b/htdocs/lib/databases/mssql.class.php index ee38e7d1f79..b69eff6cf0b 100644 --- a/htdocs/lib/databases/mssql.class.php +++ b/htdocs/lib/databases/mssql.class.php @@ -25,11 +25,11 @@ /** - * \class DoliDbMssql + * \class DoliDBMssql * \brief Classe de gestion de la database de dolibarr * \remarks Works with PHP5 Only */ -class DoliDbMssql +class DoliDBMssql { //! Database handler var $db; @@ -80,7 +80,7 @@ class DoliDbMssql * @param int $port Port of database server * @return int 1 if OK, 0 if not */ - function DoliDbMssql($type, $host, $user, $pass, $name='', $port=0) + function DoliDBMssql($type, $host, $user, $pass, $name='', $port=0) { global $conf,$langs; diff --git a/htdocs/lib/databases/mysql.class.php b/htdocs/lib/databases/mysql.class.php index 4240820195a..d9d189c7438 100644 --- a/htdocs/lib/databases/mysql.class.php +++ b/htdocs/lib/databases/mysql.class.php @@ -26,10 +26,10 @@ /** - * \class DoliDbMysql + * \class DoliDBMysql * \brief Class to manage Dolibarr database access for a Mysql database */ -class DoliDbMysql +class DoliDBMysql { //! Database handler var $db; @@ -80,7 +80,7 @@ class DoliDbMysql * @param int $port Port of database server * @return int 1 if OK, 0 if not */ - function DoliDb($type, $host, $user, $pass, $name='', $port=0) + function DoliDBMysql($type, $host, $user, $pass, $name='', $port=0) { global $conf,$langs; diff --git a/htdocs/lib/databases/pgsql.class.php b/htdocs/lib/databases/pgsql.class.php index 7982e963e23..5a8f1b0c79c 100644 --- a/htdocs/lib/databases/pgsql.class.php +++ b/htdocs/lib/databases/pgsql.class.php @@ -27,10 +27,10 @@ /** - * \class DoliDbPgsql + * \class DoliDBPgsql * \brief Class to drive a Postgresql database for Dolibarr */ -class DoliDbPgsql +class DoliDBPgsql { var $db; // Database handler var $type='pgsql'; // Name of manager @@ -70,7 +70,7 @@ class DoliDbPgsql * @param int $port Port of database server * @return int 1 if OK, 0 if not */ - function DoliDbPgsql($type, $host, $user, $pass, $name='', $port=0) + function DoliDBPgsql($type, $host, $user, $pass, $name='', $port=0) { global $conf,$langs; From 1e3174d1ce86fcaaedb5b884050afafc3cf36a1a Mon Sep 17 00:00:00 2001 From: eldy Date: Thu, 29 Sep 2011 15:03:28 +0200 Subject: [PATCH 3/3] Add paper format --- .../install/mysql/migration/3.1.0-3.2.0.sql | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/htdocs/install/mysql/migration/3.1.0-3.2.0.sql b/htdocs/install/mysql/migration/3.1.0-3.2.0.sql index d7d6c54e82a..7b42303d9ba 100755 --- a/htdocs/install/mysql/migration/3.1.0-3.2.0.sql +++ b/htdocs/install/mysql/migration/3.1.0-3.2.0.sql @@ -22,3 +22,29 @@ ALTER TABLE llx_user ADD COLUMN ref_int varchar(50) AFTER ref_ext; ALTER TABLE llx_societe MODIFY code_client varchar(24); ALTER TABLE llx_societe MODIFY code_fournisseur varchar(24); + +-- Europe +INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (1, 'EU4A0', 'Format 4A0', '1682', '2378', 'mm', 1); +INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (2, 'EU2A0', 'Format 2A0', '1189', '1682', 'mm', 1); +INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (3, 'EUA0', 'Format A0', '840', '1189', 'mm', 1); +INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (4, 'EUA1', 'Format A1', '594', '840', 'mm', 1); +INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (5, 'EUA2', 'Format A2', '420', '594', 'mm', 1); +INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (6, 'EUA3', 'Format A3', '297', '420', 'mm', 1); +INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (7, 'EUA4', 'Format A4', '210', '297', 'mm', 1); +INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (8, 'EUA5', 'Format A5', '148', '210', 'mm', 1); +INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (9, 'EUA6', 'Format A6', '105', '148', 'mm', 1); + +-- US +INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (100, 'USLetter', 'Format Letter (A)', '216', '279', 'mm', 1); +INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (105, 'USLegal', 'Format Legal', '216', '356', 'mm', 1); +INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (110, 'USExecutive', 'Format Executive', '190', '254', 'mm', 1); +INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (115, 'USLedger', 'Format Ledger/Tabloid (B)', '279', '432', 'mm', 1); + +-- Canadian +INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (200, 'CAP1', 'Format Canadian P1', '560', '860', 'mm', 1); +INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (205, 'CAP2', 'Format Canadian P2', '430', '560', 'mm', 1); +INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (210, 'CAP3', 'Format Canadian P3', '280', '430', 'mm', 1); +INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (215, 'CAP4', 'Format Canadian P4', '215', '280', 'mm', 1); +INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (220, 'CAP5', 'Format Canadian P5', '140', '215', 'mm', 1); +INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (225, 'CAP6', 'Format Canadian P6', '107', '140', 'mm', 1); +