From e7b7c3281e910aafad4cc573dcc90ddd7a8bd8ef Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 13 Dec 2021 17:42:10 +0100 Subject: [PATCH] Fix page of accountancy transaction --- htdocs/accountancy/bookkeeping/card.php | 38 +++++++++++++++++++------ htdocs/langs/en_US/accountancy.lang | 3 +- htdocs/theme/eldy/global.inc.php | 4 +++ htdocs/theme/md/style.css.php | 3 ++ 4 files changed, 38 insertions(+), 10 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index b772da3ce08..195f7fcb26b 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -618,9 +618,10 @@ if ($action == 'create') { print ''."\n"; print ''."\n"; - print ''; - if (count($object->linesmvt) > 0) { + print '
'; + print '
'; + $total_debit = 0; $total_credit = 0; @@ -670,8 +671,14 @@ if ($action == 'create') { print ''; print ''; } else { - $accountingaccount->fetch(null, $line->numero_compte, true); - print ''; + $resultfetch = $accountingaccount->fetch(null, $line->numero_compte, true); + print ''; print ''; print ''; - print ''; } print "\n"; @@ -733,12 +748,16 @@ if ($action == 'create') { print ''; print ''; print ''; - print ''; + print ''; print ''; } - print '
'.$accountingaccount->getNomUrl(0, 1, 1, '', 0).''; + if ($resultfetch > 0) { + $accountingaccount->getNomUrl(0, 1, 1, '', 0); + } else { + print $line->numero_compte.' ('.$langs->trans("AccountRemovedFromCurrentChartOfAccount").')'; + } + print ''.length_accounta($line->subledger_account); if ($line->subledger_label) { print ' - '.$line->subledger_label.''; @@ -681,11 +688,15 @@ if ($action == 'create') { print ''.price($line->debit).''.price($line->credit).''; + print ''; if (empty($line->date_export) && empty($line->date_validation)) { print 'id . '&piece_num=' . urlencode($line->piece_num) . '&mode=' . urlencode($mode) . '&token=' . urlencode(newToken()) . '">'; print img_edit('', 0, 'class="marginrightonly"'); print '  '; + } else { + print ''; + print img_edit($langs->trans("ForbiddenTransactionAlreadyExported"), 0, 'class="marginrightonly"'); + print '  '; } if (empty($line->date_validation)) { @@ -696,9 +707,13 @@ if ($action == 'create') { print ''; print img_delete(); + print ''; + } else { + print ''; + print img_delete($langs->trans("ForbiddenTransactionAlreadyValidated")); + print ''; } - print ''; print '
'; + print ''; + print '
'; } + print ''; + print ''; + if ($mode == '_tmp' && $action == '') { print '
'; print '
'; @@ -753,8 +772,9 @@ if ($action == 'create') { print "
"; } - print ''; } + + print ''; } } else { print load_fiche_titre($langs->trans("NoRecords")); diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index 01487ba3e83..8781bc13f86 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -387,7 +387,8 @@ SaleExport=Export sale SaleEEC=Sale in EEC SaleEECWithVAT=Sale in EEC with a VAT not null, so we suppose this is NOT an intracommunautary sale and the suggested account is the standard product account. SaleEECWithoutVATNumber=Sale in EEC with no VAT but the VAT ID of thirdparty is not defined. We fallback on the product account for standard sales. You can fix the VAT ID of thirdparty or the product account if needed. - +ForbiddenTransactionAlreadyExported=Forbidden: The transaction has been validated and/or exported. +ForbiddenTransactionAlreadyValidated=Forbidden: The transaction has been validated. ## Dictionary Range=Range of accounting account Calculated=Calculated diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index d8bd4673d5c..da23e60498c 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -884,6 +884,10 @@ body[class*="colorblind-"] .text-success{ .editfieldlang:hover { color: var(--colortexttitle) !important; } +a.editfielda.nohover *:hover:before { + color: #ccc !important; +} + .fawidth30 { width: 20px; } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 6805f2c620e..8873149a9be 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1050,6 +1050,9 @@ body[class*="colorblind-"] .text-success{ .editfielda span.fa-pencil-alt:hover, .editfielda span.fa-trash:hover { color: var(--colortexttitle) !important; } +a.editfielda.nohover *:hover:before { + color: #ccc !important; +} .size15x { font-size: 1.5em !important; } .fa-toggle-on, .fa-toggle-off, .size2x { font-size: 2em; }