diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php index 1e15d8c3754..14f99457f0b 100644 --- a/htdocs/accountancy/admin/index.php +++ b/htdocs/accountancy/admin/index.php @@ -435,6 +435,20 @@ if ($action == 'setenabletabonthirdparty') { } } +if ($action == 'setenabledissociatecashsales') { + $setenabledissociatecashsales = GETPOSTINT('value'); + $res = dolibarr_set_const($db, "ACCOUNTING_DISSOCIATE_CASH_SALES", $setenabledissociatecashsales, 'yesno', 0, '', $conf->entity); + if (!($res > 0)) { + $error++; + } + + if (!$error) { + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } else { + setEventMessages($langs->trans("Error"), null, 'mesgs'); + } +} + if ($action == 'setexportenablelettering') { $setexportenablelettering = GETPOSTINT('value'); $res = dolibarr_set_const($db, "ACCOUNTING_DEFAULT_NOT_EXPORT_LETTERING", $setexportenablelettering, 'yesno', 0, '', $conf->entity); @@ -929,6 +943,20 @@ if (getDolGlobalString('ACCOUNTING_ENABLE_TABONTHIRDPARTY')) { } print ''; +print '
| ".$langs->trans("Date")." | "; + print "".$langs->trans("Piece").' ('.$langs->trans("InvoiceRef").") | "; + print "".$langs->trans("AccountAccounting")." | "; + print "".$langs->trans("SubledgerAccount")." | "; + print "".$langs->trans("LabelOperation")." | "; + print ''.$langs->trans("AccountingDebit")." | "; + print ''.$langs->trans("AccountingCredit")." | "; + print "
| ".$date." | "; + print ""; + print $langs->trans("Replaced"); + print ' | '; + // Subledger account + print ""; + print ' | '; + print ""; + print " | "; + print ''; + print ' | '; + print " | |
| ".$date." | "; + print "".$invoicestatic->getNomUrl(1)." | "; + // Account + print ""; + print ''.$langs->trans('ErrorInvoiceContainsLinesNotYetBoundedShort', $val['ref']).''; + print ' | '; + // Subledger account + print ""; + print ' | '; + print ""; + print " | "; + print ''; + print ' | '; + print " |
| " . $date . " | "; + print "" . $invoicestatic->getNomUrl(1) . " | "; + // Account + print ""; + $accountoshow = length_accountg(getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER_RETAINED_WARRANTY')); + if (($accountoshow == "") || $accountoshow == 'NotDefined') { + print '' . $langs->trans("MainAccountForRetainedWarrantyNotDefined") . ''; + } else { + print $accountoshow; + } + print ' | '; + // Subledger account + print ""; + $accountoshow = length_accounta($k); + if (($accountoshow == "") || $accountoshow == 'NotDefined') { + print '' . $langs->trans("ThirdpartyAccountNotDefined") . ''; + } else { + print $accountoshow; + } + print ' | '; + print "" . $bookkeepingstatic->accountingLabelForOperation($companystatic->getNomUrl(0), $invoicestatic->ref, $langs->trans("RetainedWarranty"), 1) . " | "; + print '' . ($mt >= 0 ? price($mt) : '') . " | "; + print '' . ($mt < 0 ? price(-$mt) : '') . " | "; + print "
| ".$date." | "; + print "".$invoicestatic->getNomUrl(1)." | "; + // Account + print ""; + $accountoshow = length_accountg($companystatic->accountancy_code_customer_general); + if (($accountoshow == "") || $accountoshow == "-1" || $accountoshow == 'NotDefined') { + print ''.$langs->trans("MainAccountForCustomersNotDefined").''; + } else { + print $accountoshow; + } + print ' | '; + // Subledger account + print ""; + $accountoshow = length_accounta($k); + if (($accountoshow == "") || $accountoshow == 'NotDefined') { + print ''.$langs->trans("ThirdpartyAccountNotDefined").''; + } else { + print $accountoshow; + } + print ' | '; + print "" . $bookkeepingstatic->accountingLabelForOperation($companystatic->getNomUrl(0, 'customer'), $invoicestatic->ref, $langs->trans("SubledgerAccount"), 1) . " | "; + print ''.($mt >= 0 ? price($mt) : '')." | "; + print ''.($mt < 0 ? price(-$mt) : '')." | "; + print "
| ".$date." | "; + print "".$invoicestatic->getNomUrl(1)." | "; + // Account + print ""; + $accountoshow = length_accountg($k); + if (($accountoshow == "") || $accountoshow == 'NotDefined') { + print ''.$langs->trans("ProductNotDefined").''; + } else { + print $accountoshow; + } + print " | "; + // Subledger account + print ""; + if (getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER_USE_AUXILIARY_ON_DEPOSIT')) { + if ($k == getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT')) { + print length_accounta($tabcompany[$key]['code_compta']); + } + } elseif (($accountoshow == "") || $accountoshow == 'NotDefined') { + print '' . $langs->trans("ThirdpartyAccountNotDefined") . ''; + } + print ' | '; + $companystatic->id = $tabcompany[$key]['id']; + $companystatic->name = $tabcompany[$key]['name']; + print "" . $bookkeepingstatic->accountingLabelForOperation($companystatic->getNomUrl(0, 'customer'), $invoicestatic->ref, $accountingaccount->label, 1) . " | "; + print ''.($mt < 0 ? price(-$mt) : '')." | "; + print ''.($mt >= 0 ? price($mt) : '')." | "; + print "
| ".$date." | "; + print "".$invoicestatic->getNomUrl(1)." | "; + // Account + print ""; + $accountoshow = length_accountg($k); + if (($accountoshow == "") || $accountoshow == 'NotDefined') { + print ''.$langs->trans("VATAccountNotDefined").' ('.$langs->trans("AccountingJournalType6").')'; + } else { + print $accountoshow; + } + print " | "; + // Subledger account + print ""; + print ' | '; + // $def_tva is array[invoiceid][accountancy_code_sell_of_vat_rate_found][vatrate]=vatrate + //var_dump($arrayofvat[$key]); //var_dump($key); //var_dump($k); + $tmpvatrate = (empty($def_tva[$key][$k]) ? (empty($arrayofvat[$key][$k]) ? '' : $arrayofvat[$key][$k]) : implode(', ', $def_tva[$key][$k])); + $labelvatrate = $langs->trans("Taxes").' '.$tmpvatrate.' %'; + $labelvatrate .= ($numtax ? ' - Localtax '.$numtax : ''); + print "" . $bookkeepingstatic->accountingLabelForOperation($companystatic->getNomUrl(0, 'customer'), $invoicestatic->ref, $labelvatrate, 1) . " | "; + print ''.($mt < 0 ? price(-$mt) : '')." | "; + print ''.($mt >= 0 ? price($mt) : '')." | "; + print "
| " . $date . " | "; + print "" . $invoicestatic->getNomUrl(1) . " | "; + // Account + print ""; + $accountoshow = length_accountg($k); + if (($accountoshow == "") || $accountoshow == 'NotDefined') { + print '' . $langs->trans("MainAccountForRevenueStampSaleNotDefined") . ''; + } else { + print $accountoshow; + } + print ' | '; + // Subledger account + print ""; + print ' | '; + print "" . $bookkeepingstatic->accountingLabelForOperation($companystatic->getNomUrl(0, 'customer'), $invoicestatic->ref, $langs->trans("RevenueStamp"), 1) . " | "; + print '' . ($mt < 0 ? price(-$mt) : '') . " | "; + print '' . ($mt >= 0 ? price($mt) : '') . " | "; + print "
| '.$langs->trans("NoRecordFound").' | ||||||