diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index a275fc07ff4..a1c145840a9 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -540,7 +540,7 @@ if ($action == 'create') { print ''; print ''; - // Date document creation + // Date document export print ''; print ''.$langs->trans("DateExport").''; print ''; @@ -548,7 +548,7 @@ if ($action == 'create') { print ''; print ''; - // Date document creation + // Date document validation print ''; print ''.$langs->trans("DateValidation").''; print ''; @@ -607,6 +607,7 @@ if ($action == 'create') { print '
'; $result = $object->fetchAllPerMvt($piece_num, $mode); // This load $object->linesmvt + if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } else { @@ -647,9 +648,14 @@ if ($action == 'create') { print "\n"; - // Add an empty line - $line = new BookKeepingLine(); - $object->linesmvt[] = $line; + // Add an empty line if there is not yet + if (!empty($object->linesmvt[0])) { + $tmpline = $object->linesmvt[0]; + if (!empty($tmpline->numero_compte)) { + $line = new BookKeepingLine(); + $object->linesmvt[] = $line; + } + } foreach ($object->linesmvt as $line) { print ''; diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index d01ad89293f..992b885f272 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -606,9 +606,13 @@ class BookKeeping extends CommonObject if (empty($this->credit)) { $this->credit = 0; } + if (empty($this->montant)) { + $this->montant = 0; + } $this->debit = price2num($this->debit, 'MT'); $this->credit = price2num($this->credit, 'MT'); + $this->montant = price2num($this->montant, 'MT'); $now = dol_now(); @@ -1661,11 +1665,10 @@ class BookKeeping extends CommonObject $this->doc_date = $this->db->jdate($obj->doc_date); $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; + $this->date_creation = $this->db->jdate($obj->date_creation); + $this->date_modification = $this->db->jdate($obj->date_modification); + $this->date_export = $this->db->jdate($obj->date_export); + $this->date_validation = $this->db->jdate($obj->date_validation); } else { $this->error = "Error ".$this->db->lasterror(); dol_syslog(__METHOD__.$this->error, LOG_ERR); diff --git a/htdocs/compta/bank/categ.php b/htdocs/compta/bank/categ.php index 2605bc39d30..aa60c1ddf41 100644 --- a/htdocs/compta/bank/categ.php +++ b/htdocs/compta/bank/categ.php @@ -113,7 +113,7 @@ if ($action != 'edit') { print ''; print ' '; print ''; - print ''; + print ''; print ''; } diff --git a/htdocs/compta/bank/list.php b/htdocs/compta/bank/list.php index d91a14f14cd..238b9919ef1 100644 --- a/htdocs/compta/bank/list.php +++ b/htdocs/compta/bank/list.php @@ -550,7 +550,7 @@ foreach ($accounts as $key => $type) { // Account type if (!empty($arrayfields['accountype']['checked'])) { - print ''; + print ''; print $objecttmp->type_lib[$objecttmp->type]; print ''; if (!$i) { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index b17b837aa88..5940a0d58c4 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -342,7 +342,7 @@ function dol_shutdown() $depth = $db->transaction_opened; $disconnectdone = $db->close(); } - dol_syslog("--- End access to ".$_SERVER["PHP_SELF"].(($disconnectdone && $depth) ? ' (Warn: db disconnection forced, transaction depth was '.$depth.')' : ''), (($disconnectdone && $depth) ?LOG_WARNING:LOG_INFO)); + dol_syslog("--- End access to ".$_SERVER["PHP_SELF"].(($disconnectdone && $depth) ? ' (Warn: db disconnection forced, transaction depth was '.$depth.')' : ''), (($disconnectdone && $depth) ? LOG_WARNING : LOG_INFO)); } /** diff --git a/htdocs/install/mysql/migration/15.0.0-16.0.0.sql b/htdocs/install/mysql/migration/15.0.0-16.0.0.sql index 06d957310bb..d4079d4f64c 100644 --- a/htdocs/install/mysql/migration/15.0.0-16.0.0.sql +++ b/htdocs/install/mysql/migration/15.0.0-16.0.0.sql @@ -406,4 +406,9 @@ ALTER TABLE llx_extrafields ADD COLUMN cssview varchar(128); ALTER TABLE llx_extrafields ADD COLUMN csslist varchar(128); ALTER TABLE llx_cronjob ADD COLUMN email_alert varchar(128); - \ No newline at end of file + +ALTER TABLE llx_paiement MODIFY COLUMN ext_payment_id varchar(255); +ALTER TABLE llx_payment_donation MODIFY COLUMN ext_payment_id varchar(255); +ALTER TABLE llx_prelevement_facture_demande MODIFY COLUMN ext_payment_id varchar(255); + + diff --git a/htdocs/install/mysql/tables/llx_paiement.sql b/htdocs/install/mysql/tables/llx_paiement.sql index bbf7d52e6c7..84cdc86b29a 100644 --- a/htdocs/install/mysql/tables/llx_paiement.sql +++ b/htdocs/install/mysql/tables/llx_paiement.sql @@ -32,7 +32,7 @@ create table llx_paiement fk_paiement integer NOT NULL, -- type of payment in llx_c_paiement num_paiement varchar(50), note text, - ext_payment_id varchar(128), -- external id of payment (for example Stripe charge id) + ext_payment_id varchar(255), -- external id of payment (for example Stripe charge id) ext_payment_site varchar(128), -- name of external paymentmode (for example 'stripe') fk_bank integer NOT NULL DEFAULT 0, fk_user_creat integer, -- utilisateur qui a cree l'info diff --git a/htdocs/install/mysql/tables/llx_payment_donation.sql b/htdocs/install/mysql/tables/llx_payment_donation.sql index a93a6c1a0e9..c14ec9b00de 100644 --- a/htdocs/install/mysql/tables/llx_payment_donation.sql +++ b/htdocs/install/mysql/tables/llx_payment_donation.sql @@ -27,7 +27,7 @@ create table llx_payment_donation fk_typepayment integer NOT NULL, num_payment varchar(50), note text, - ext_payment_id varchar(128), -- external id of payment (for example Stripe charge id) + ext_payment_id varchar(255), -- external id of payment (for example Stripe charge id) ext_payment_site varchar(128), -- name of external paymentmode (for example 'stripe') fk_bank integer NOT NULL, fk_user_creat integer, -- creation user diff --git a/htdocs/install/mysql/tables/llx_prelevement_facture_demande.sql b/htdocs/install/mysql/tables/llx_prelevement_facture_demande.sql index 4e1f37c6d3f..9837f709777 100644 --- a/htdocs/install/mysql/tables/llx_prelevement_facture_demande.sql +++ b/htdocs/install/mysql/tables/llx_prelevement_facture_demande.sql @@ -35,6 +35,6 @@ create table llx_prelevement_facture_demande code_guichet varchar(6), number varchar(255), cle_rib varchar(5), - ext_payment_id varchar(128), + ext_payment_id varchar(255), ext_payment_site varchar(128) )ENGINE=innodb; diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index d035661ba62..c5ef90a0ecd 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -2247,7 +2247,7 @@ function top_menu_user($hideloginname = 0, $urllogout = '') $btnUser = '