Allow supplier code to be '0', but not empty ('')
This commit is contained in:
parent
86f0d6c26f
commit
05cdf895e8
@ -221,7 +221,7 @@ class BookKeeping extends CommonObject
|
|||||||
if (empty($this->credit)) $this->credit = 0;
|
if (empty($this->credit)) $this->credit = 0;
|
||||||
|
|
||||||
// Check parameters
|
// Check parameters
|
||||||
if (empty($this->numero_compte) || $this->numero_compte == '-1' || $this->numero_compte == 'NotDefined')
|
if (($this->numero_compte == "") || $this->numero_compte == '-1' || $this->numero_compte == 'NotDefined')
|
||||||
{
|
{
|
||||||
$langs->loadLangs(array("errors"));
|
$langs->loadLangs(array("errors"));
|
||||||
if (in_array($this->doc_type, array('bank', 'expense_report')))
|
if (in_array($this->doc_type, array('bank', 'expense_report')))
|
||||||
|
|||||||
@ -140,7 +140,7 @@ if ($result) {
|
|||||||
$num = $db->num_rows($result);
|
$num = $db->num_rows($result);
|
||||||
|
|
||||||
// Variables
|
// Variables
|
||||||
$cptfour = (! empty($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER)) ? $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER : 'NotDefined';
|
$cptfour = ($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER != "") ? $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER : 'NotDefined';
|
||||||
$cpttva = (! empty($conf->global->ACCOUNTING_VAT_BUY_ACCOUNT)) ? $conf->global->ACCOUNTING_VAT_BUY_ACCOUNT : 'NotDefined';
|
$cpttva = (! empty($conf->global->ACCOUNTING_VAT_BUY_ACCOUNT)) ? $conf->global->ACCOUNTING_VAT_BUY_ACCOUNT : 'NotDefined';
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
@ -148,7 +148,7 @@ if ($result) {
|
|||||||
$obj = $db->fetch_object($result);
|
$obj = $db->fetch_object($result);
|
||||||
|
|
||||||
// Controls
|
// Controls
|
||||||
$compta_soc = (! empty($obj->code_compta_fournisseur)) ? $obj->code_compta_fournisseur : $cptfour;
|
$compta_soc = ($obj->code_compta_fournisseur != "") ? $obj->code_compta_fournisseur : $cptfour;
|
||||||
|
|
||||||
$compta_prod = $obj->compte;
|
$compta_prod = $obj->compte;
|
||||||
if (empty($compta_prod)) {
|
if (empty($compta_prod)) {
|
||||||
@ -742,7 +742,7 @@ if (empty($action) || $action == 'view') {
|
|||||||
journalHead($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''), '', $varlink);
|
journalHead($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''), '', $varlink);
|
||||||
|
|
||||||
// Button to write into Ledger
|
// Button to write into Ledger
|
||||||
if (empty($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER) || $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == '-1') {
|
if (($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == "") || $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == '-1') {
|
||||||
print img_warning().' '.$langs->trans("SomeMandatoryStepsOfSetupWereNotDone");
|
print img_warning().' '.$langs->trans("SomeMandatoryStepsOfSetupWereNotDone");
|
||||||
print ' : '.$langs->trans("AccountancyAreaDescMisc", 4, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
print ' : '.$langs->trans("AccountancyAreaDescMisc", 4, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
||||||
}
|
}
|
||||||
@ -877,7 +877,7 @@ if (empty($action) || $action == 'view') {
|
|||||||
// Account
|
// Account
|
||||||
print "<td>";
|
print "<td>";
|
||||||
$accountoshow = length_accounta($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER);
|
$accountoshow = length_accounta($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER);
|
||||||
if (empty($accountoshow) || $accountoshow == 'NotDefined')
|
if (($accountoshow == "") || $accountoshow == 'NotDefined')
|
||||||
{
|
{
|
||||||
print '<span class="error">'.$langs->trans("MainAccountForSupplierssNotDefined").'</span>';
|
print '<span class="error">'.$langs->trans("MainAccountForSupplierssNotDefined").'</span>';
|
||||||
}
|
}
|
||||||
@ -886,7 +886,7 @@ if (empty($action) || $action == 'view') {
|
|||||||
// Subledger account
|
// Subledger account
|
||||||
print "<td>";
|
print "<td>";
|
||||||
$accountoshow = length_accounta($k);
|
$accountoshow = length_accounta($k);
|
||||||
if (empty($accountoshow) || $accountoshow == 'NotDefined')
|
if (($accountoshow == "") || $accountoshow == 'NotDefined')
|
||||||
{
|
{
|
||||||
print '<span class="error">'.$langs->trans("ThirdpartyAccountNotDefined").'</span>';
|
print '<span class="error">'.$langs->trans("ThirdpartyAccountNotDefined").'</span>';
|
||||||
}
|
}
|
||||||
@ -912,7 +912,7 @@ if (empty($action) || $action == 'view') {
|
|||||||
// Account
|
// Account
|
||||||
print "<td>";
|
print "<td>";
|
||||||
$accountoshow = length_accountg($k);
|
$accountoshow = length_accountg($k);
|
||||||
if (empty($accountoshow) || $accountoshow == 'NotDefined')
|
if (($accountoshow == "") || $accountoshow == 'NotDefined')
|
||||||
{
|
{
|
||||||
print '<span class="error">'.$langs->trans("ProductAccountNotDefined").'</span>';
|
print '<span class="error">'.$langs->trans("ProductAccountNotDefined").'</span>';
|
||||||
}
|
}
|
||||||
@ -946,7 +946,7 @@ if (empty($action) || $action == 'view') {
|
|||||||
// Account
|
// Account
|
||||||
print "<td>";
|
print "<td>";
|
||||||
$accountoshow = length_accountg($k);
|
$accountoshow = length_accountg($k);
|
||||||
if (empty($accountoshow) || $accountoshow == 'NotDefined')
|
if (($accountoshow == "") || $accountoshow == 'NotDefined')
|
||||||
{
|
{
|
||||||
print '<span class="error">'.$langs->trans("VATAccountNotDefined").' ('.$langs->trans("Purchase").')'.'</span>';
|
print '<span class="error">'.$langs->trans("VATAccountNotDefined").' ('.$langs->trans("Purchase").')'.'</span>';
|
||||||
}
|
}
|
||||||
@ -977,7 +977,7 @@ if (empty($action) || $action == 'view') {
|
|||||||
// Account
|
// Account
|
||||||
print "<td>";
|
print "<td>";
|
||||||
$accountoshow = length_accountg($k);
|
$accountoshow = length_accountg($k);
|
||||||
if (empty($accountoshow) || $accountoshow == 'NotDefined')
|
if (($accountoshow == "") || $accountoshow == 'NotDefined')
|
||||||
{
|
{
|
||||||
print '<span class="error">'.$langs->trans("VATAccountNotDefined").' ('.$langs->trans("NPR counterpart").'). Set ACCOUNTING_COUNTERPART_VAT_NPR to the subvention account'.'</span>';
|
print '<span class="error">'.$langs->trans("VATAccountNotDefined").' ('.$langs->trans("NPR counterpart").'). Set ACCOUNTING_COUNTERPART_VAT_NPR to the subvention account'.'</span>';
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user