devis numero devis table label , facture user_id
This commit is contained in:
parent
6d9da00813
commit
5d7d21087d
@ -1764,14 +1764,20 @@ class Bdd {
|
||||
}
|
||||
|
||||
public function lastNumFacture($idNextcloud) {
|
||||
$factures = json_decode($this->getFactures($idNextcloud));
|
||||
$max = 5977;
|
||||
foreach ($factures as $key => $facture) {
|
||||
$numsplit = explode('/', $facture->num);
|
||||
$num = (int) $numsplit[2];
|
||||
$max = ($max<=$num)?$num:$max;
|
||||
$lastFactureId = $this->getLastFactureId();
|
||||
return $lastFactureId;
|
||||
}
|
||||
|
||||
private function getLastFactureId(){
|
||||
$sql = "SELECT
|
||||
max(facture.id) as LAST_FACTURE_ID FROM "
|
||||
. $this->tableprefix."facture as facture;";
|
||||
$res = $this->execSQLNoJsonReturn($sql,[]);
|
||||
$lastId = 0;
|
||||
if(!empty($res)){
|
||||
$lastId = $res[0]['LAST_FACTURE_ID'];
|
||||
}
|
||||
return $max;
|
||||
return $lastId;
|
||||
}
|
||||
|
||||
public function backup(){
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
<tr>
|
||||
<th><?php p($l->t('A facturer'));?></th>
|
||||
<th><?php p($l->t('ID'));?></th>
|
||||
<th><?php p($l->t('Num'));?></th>
|
||||
<th><?php p($l->t('Numéro de devis'));?></th>
|
||||
<th><?php p($l->t('Quote date'));?></th>
|
||||
<th>Défunt</th>
|
||||
<th><?php p($l->t('Customer quote'));?></th>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user