Fix autocheck if vat rate seems wrong

This commit is contained in:
Laurent Destailleur 2021-11-15 09:08:58 +01:00
parent 5b5f41606a
commit 67d69e5cd6
4 changed files with 12 additions and 16 deletions

View File

@ -249,13 +249,13 @@ if ($action == 'validatehistory') {
if (!is_array($return) && $return<0) {
setEventMessage($accountingAccount->error, 'errors');
} else {
$suggestedid=$return['suggestedid'];
$suggestedaccountingaccountfor=$return['suggestedaccountingaccountfor'];
$suggestedid = $return['suggestedid'];
$suggestedaccountingaccountfor = $return['suggestedaccountingaccountfor'];
if (!empty($suggestedid) && $suggestedaccountingaccountfor<>'') {
$suggestedid=$return['suggestedid'];
if (!empty($suggestedid) && $suggestedaccountingaccountfor != '' && $suggestedaccountingaccountfor != 'eecwithoutvatnumber') {
$suggestedid = $return['suggestedid'];
} else {
$suggestedid=0;
$suggestedid = 0;
}
}

View File

@ -734,10 +734,8 @@ if ($result) {
// Column with checkbox
print '<td class="center">';
$ischecked = 0;
if (!empty($suggestedid) && $suggestedaccountingaccountfor <> '') {
if (!empty($suggestedid) && $suggestedaccountingaccountfor != '' && $suggestedaccountingaccountfor != 'eecwithoutvatnumber') {
$ischecked = 1;
} elseif ($suggestedaccountingaccountfor == 'eecwithoutvatnumber') {
$ischecked = 0;
}
print '<input type="checkbox" class="flat checkforselect checkforselect'.$facture_static_det->id.'" name="toselect[]" value="'.$facture_static_det->id."_".$i.'"'.($ischecked ? " checked" : "").'/>';
print '</td>';

View File

@ -245,13 +245,13 @@ if ($action == 'validatehistory') {
if (!is_array($return) && $return<0) {
setEventMessage($accountingAccount->error, 'errors');
} else {
$suggestedid=$return['suggestedid'];
$suggestedaccountingaccountfor=$return['suggestedaccountingaccountfor'];
$suggestedid = $return['suggestedid'];
$suggestedaccountingaccountfor = $return['suggestedaccountingaccountfor'];
if (!empty($suggestedid) && $suggestedaccountingaccountfor<>'') {
$suggestedid=$return['suggestedid'];
if (!empty($suggestedid) && $suggestedaccountingaccountfor != '' && $suggestedaccountingaccountfor != 'eecwithoutvatnumber') {
$suggestedid = $return['suggestedid'];
} else {
$suggestedid=0;
$suggestedid = 0;
}
}

View File

@ -725,10 +725,8 @@ if ($result) {
// Column with checkbox
print '<td class="center">';
$ischecked = 0;
if (!empty($suggestedid) && $suggestedaccountingaccountfor <> '') {
if (!empty($suggestedid) && $suggestedaccountingaccountfor != '' && $suggestedaccountingaccountfor != 'eecwithoutvatnumber') {
$ischecked = 1;
} elseif ($suggestedaccountingaccountfor == 'eecwithoutvatnumber') {
$ischecked = 0;
}
print '<input type="checkbox" class="flat checkforselect checkforselect'.$facturefourn_static_det->id.'" name="toselect[]" value="'.$facturefourn_static_det->id."_".$i.'"'.($ischecked ? " checked" : "").'/>';
print '</td>';