finish client code on talk

This commit is contained in:
Tiavina 2025-01-23 16:03:55 +03:00
parent 4afb42ee13
commit 36edfebfba
27 changed files with 82 additions and 26 deletions

View File

@ -130,6 +130,7 @@ return [
['name' => 'page#addClientGroupDiscountFeatureTables', 'url' => '/addClientGroupDiscountFeatureTables', 'verb' => 'POST'],
['name' => 'page#addClientGroupFacturationFeatureTables', 'url' => '/addClientGroupFacturationFeatureTables', 'verb' => 'POST'],
['name' => 'page#addProductTypeTables', 'url' => '/addProductTypeTables', 'verb' => 'POST'],
['name' => 'page#addClientCodesColumn', 'url' => '/addClientCodesColumn', 'verb' => 'POST'],
//clients discount
['name' => 'page#getClientGroupDiscounts', 'url' => '/getClientGroupDiscounts', 'verb' => 'PROPFIND'],

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -2717,4 +2717,18 @@ class PageController extends Controller {
public function getProductTypes() {
return $this->myDb->getProductTypes();
}
/**
* @NoAdminRequired
* @NoCSRFRequired
*
*/
public function addClientCodesColumn(){
try{
$this->myDb->addClientCodesColumn();
return true;
}
catch(\OCP\Files\NotFoundException $e) { }
}
}

View File

@ -42,7 +42,8 @@ class Bdd {
"commentaire", "designation", "hypodermiques_text1", "hypodermiques_text2", "qte", "endroit",
"fk_client_group_id","fk_produit_id","ht_amount","client_group_name",
"fk_client_group_facturation_id","group_facturation_name",
"fk_product_type_id");
"fk_product_type_id",
"portal_code","alarm_code","funeral_code");
$this->whiteTable = array(
"client", "lieu", "trajet", "devis", "produit_devis", "facture", "produit", "configuration", "ligne_trajet", "thanato", "article", "defunt", "article_devis", "bibliotheque", "bijou_defunt", "obs_defunt", "hypo_defunt",
"client_group_discount","client_group",
@ -656,7 +657,9 @@ class Bdd {
$sql = "SELECT ".$this->tableprefix."devis.id as devisid, ".$this->tableprefix."devis.version, ".$this->tableprefix."devis.comment, ".$this->tableprefix."devis.date, num,"
.$this->tableprefix."devis.id_nextcloud as didnextcloud,".$this->tableprefix."devis.id_client, id_lieu, id_thanato,"
.$this->tableprefix."defunt.id as id_defunt, ".$this->tableprefix."defunt.nom as nom_defunt,"
.$this->tableprefix."client.id as clientid, ".$this->tableprefix."client.nom, ".$this->tableprefix."client.prenom, legal_one, entreprise, telephone, mail, ".$this->tableprefix."client.adresse,"
.$this->tableprefix."client.id as clientid, ".$this->tableprefix."client.nom, "
.$this->tableprefix."client.prenom, legal_one, entreprise, telephone, mail, ".$this->tableprefix."client.adresse,"
.$this->tableprefix."client.portal_code, alarm_code, funeral_code,"
.$this->tableprefix."lieu.nom as lieu, ".$this->tableprefix."lieu.adresse as adresse_soin ,"
.$this->tableprefix."thanato.nom as nom_thanato, ".$this->tableprefix."thanato.prenom as prenom_thanato
FROM ".$this->tableprefix."devis
@ -3273,7 +3276,22 @@ class Bdd {
if(strtolower($devis->comment) != "commentaire" && $devis->comment != ""){
$comment = html_entity_decode($devis->comment);
}
$message .= ". COMMENTAIRES: ".$comment;
$message .= ". COMMENTAIRES: ".$comment.". ";
$clientCodes = [
"Code portail" => $devis->portal_code,
"Code alarme" => $devis->alarm_code,
"Code funéraire" => $devis->funeral_code
];
$clientCodeMessageContent = "";
foreach($clientCodes as $label => $code){
$value = "Aucun";
if($code != null && trim($code) != ""){
$value = $code;
}
$clientCodeMessageContent .= $label. ": ".$value.". ";
}
$clientCodeMessageContent = trim($clientCodeMessageContent);
$message .= $clientCodeMessageContent;
return $message;
}
@ -3476,4 +3494,18 @@ class Bdd {
$productTypes = $this->execSQL($sql,[]);
return $productTypes;
}
public function addClientCodesColumn(){
$sql = "ALTER TABLE oc_gestion_client
ADD portal_code VARCHAR(255) DEFAULT NULL;";
$this->execSQLNoData($sql,[]);
$sql = "ALTER TABLE oc_gestion_client
ADD alarm_code VARCHAR(255) DEFAULT NULL;";
$this->execSQLNoData($sql,[]);
$sql = "ALTER TABLE oc_gestion_client
ADD funeral_code VARCHAR(255) DEFAULT NULL;";
$this->execSQLNoData($sql,[]);
}
}

View File

@ -18,6 +18,9 @@ export class Client {
this.adresse = ((myresp.adresse.length === 0) ? '-' : myresp.adresse);
this.clientGroupName = ((myresp.client_group_name.length === 0) ? '-' : myresp.client_group_name);
this.clientGroupFacturationName = ((myresp.client_group_facturation_name.length === 0) ? '-' : myresp.client_group_facturation_name);
this.portalCode = myresp.portal_code != null && myresp.portal_code.length > 0 ? myresp.portal_code : "-";
this.alarmCode = myresp.alarm_code != null && myresp.alarm_code.length > 0 ? myresp.alarm_code : "-";
this.funeralCode = myresp.funeral_code != null && myresp.funeral_code.length > 0 ? myresp.funeral_code : "-";
let clientGroupId = 0;
if(myresp.fk_client_group_id != null && myresp.fk_client_group_id.length > 0){
@ -48,6 +51,9 @@ export class Client {
'<div class="editable" data-table="client" data-column="adresse" data-id="' + this.id + '">' + this.adresse + '</div>',
'<div class="selectClientGroupList" data-table="client" data-column="fk_client_group_id" data-id="' + this.id + '" data-current="' + this.clientGroupId + '">' + this.clientGroupName + '</div>',
'<div class="selectClientGroupFacturationList" data-table="client" data-column="fk_client_group_facturation_id" data-id="' + this.id + '" data-current="' + this.clientGroupFacturationId + '">' + this.clientGroupFacturationName + '</div>',
'<div class="editable" data-table="client" data-column="portal_code" data-id="' + this.id + '">' + this.portalCode + '</div>',
'<div class="editable" data-table="client" data-column="alarm_code" data-id="' + this.id + '">' + this.alarmCode + '</div>',
'<div class="editable" data-table="client" data-column="funeral_code" data-id="' + this.id + '">' + this.funeralCode + '</div>',
'<center><div data-modifier="client" data-id=' + this.id + ' data-table="client" style="display:inline-block;margin-right:0px;" class="deleteItem icon-delete"></div></center>'
];
return myrow;

View File

@ -23,7 +23,7 @@
<table id="client" class="display tabledt" style="font-size:11px;">
<thead>
<tr>
<th><?php p($l->t('A exporter'));?></th>
<th><?php '';?></th>
<th><?php p($l->t('ID'));?></th>
<th><?php p($l->t('Code comptable'));?></th>
<th><?php p($l->t('Agence'));?></th>
@ -34,6 +34,9 @@
<th><?php p($l->t('Address'));?></th>
<th><?php p($l->t('Groupes tarifaires'));?></th>
<th><?php p($l->t('Groupes facturations'));?></th>
<th><?php p($l->t('Code portail'));?></th>
<th><?php p($l->t('Code alarme'));?></th>
<th><?php p($l->t('Code funéraire'));?></th>
<th><?php p($l->t('Actions'));?></th>
</tr>
</thead>