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) {
|
public function lastNumFacture($idNextcloud) {
|
||||||
$factures = json_decode($this->getFactures($idNextcloud));
|
$lastFactureId = $this->getLastFactureId();
|
||||||
$max = 5977;
|
return $lastFactureId;
|
||||||
foreach ($factures as $key => $facture) {
|
}
|
||||||
$numsplit = explode('/', $facture->num);
|
|
||||||
$num = (int) $numsplit[2];
|
private function getLastFactureId(){
|
||||||
$max = ($max<=$num)?$num:$max;
|
$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(){
|
public function backup(){
|
||||||
|
|||||||
@ -34,7 +34,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th><?php p($l->t('A facturer'));?></th>
|
<th><?php p($l->t('A facturer'));?></th>
|
||||||
<th><?php p($l->t('ID'));?></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><?php p($l->t('Quote date'));?></th>
|
||||||
<th>Défunt</th>
|
<th>Défunt</th>
|
||||||
<th><?php p($l->t('Customer quote'));?></th>
|
<th><?php p($l->t('Customer quote'));?></th>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user