Français Le paiement des factures n'est pas crédité à l'entreprise

  • Auteur de la discussion Auteur de la discussion TartiFlette
  • Date de début Date de début
18/9/21
202
5
7
800
Bonjour à tous,

Je reviens vers vous concernant le fonctionnement des facture

Je fait en sorte que les factures partent directement sur le compte de l'entreprise concernée

J'ai suivi les différents tuto et aide qu'on m'a déjà donné

Actuellement, l'argent se déduit du compte de la personne recevant la facture et l'argent n'arrive pas sur le compte entreprise ou perso

Merci de l'aide Capture d’écran 2025-01-26 111043.png
 

Fichiers joints

Hello, l'id de l'entreprise c'est bien 4 ?
Est-ce que dans ta base de données -> entreprise_logs il y a une ligne "...paiement facture..." ?

Sinon dans ton fn_payFacture.sqf trouve cette ligne :
Code:
[1] call SOCK_fnc_updatePartial;
et ajoute en dessous :
Code:
_realEntreprise = objNull;
Il est possible que ça règle le problème
 
Upvote 0
L'ID de l'entreprise est bien 4, cela correspond à la DIR

Je n'ai pas de ligne paiement facture, souhaite tu que j'en rajoute une ?

Je teste les modification apportées et reviens vers toi

_realEntreprise = objNull;

Je l'ai déjà, c'était un fichier mal remplis
 
Upvote 0
Fait attention à ne pas partager les fichiers complets de nos scripts, c'est interdit 😰

Tu parles bien des factures ? Ou y'a un autre souci avec l'assurance ?

Je pense avoir compris, la condition n'est pas bonne dans le fn_payFacture.sqf :
Code:
if (_id isEqualTo _from_uid) exitWith {_realEntreprise = _x select 1;};
ça devrait être comme ça :
Code:
if (_entrepriseId isEqualTo _from_uid) exitWith {_realEntreprise = _x select 1;};

Tu as suivi quel post pour faire cette modification ? Je vais le corriger aussi :)
 
Dernière édition:
Upvote 0
Salut

Merci de la réponse cependant est-il possible de refaire un tutoriel complet car je suis réellement de mon côté perdu entre des modifications et autres

Je ne sais plus quel fichier ou qu'elle tutoriel suivre
Est-il possible quelque part de tout reprendre à zéro afin que je puisse réellement mettre en place cette partie de script merci à toi
 
Upvote 0
Tout les post ou j'ai publié

En indiquant facture

 
Upvote 0
Hey, petit Tuto
Re-télécharge l'addons Billing System (On repart a zéro)

Ouvre le fichiers => @The_Programmer/addons/billing_system/client/fn_sendFacture.sqf
Ligne 25 à 28

Code:
[1,(["STR_RECEIVE_NEW_FACTURE","Max_Settings_Facture","Facture_Localization"] call theprogrammer_core_fnc_localize)] remoteExecCall ["life_fnc_broadcast",_to];

_objet = _objet regexReplace [endl, "<br/>"];
[(getPlayerUID player),(getPlayerUID _to),_objet,_entreprise,_montant,(name _to)] remoteExec ["max_facture_fnc_insertFacture",2];

Remplace par
Code:
_realEntreprise = player getVariable ["current_entreprise",objNull];
if (isNull _realEntreprise) exitWith {hint "Vous n'avez pas d'entreprise, vous ne pouvez pas envoyer de facture !";};
_id = _realEntreprise getVariable ["entreprise_id",-1];
if (_id isEqualTo -1) exitWith {hint "Vous n'avez pas d'entreprise, vous ne pouvez pas envoyer de facture !";};

[1,(["STR_RECEIVE_NEW_FACTURE","Max_Settings_Facture","Facture_Localization"] call theprogrammer_core_fnc_localize)] remoteExecCall ["life_fnc_broadcast",_to];

[(str _id),(getPlayerUID _to),_objet,_entreprise,_montant,(name _to)] remoteExec ["max_facture_fnc_insertFacture",2];

_objet = _objet regexReplace [endl, "<br/>"];

Dans ton @The_Programmer/addons/billing_system/client/fn_payFacture.sqf, remplace ceci :
Ligne 23 à 53
Code:
_fn_find_player = {
    {
        if (_this isEqualTo (getPlayerUID _x)) exitWith {
            _x;
        };
        objNull
    } foreach playableUnits;
};

_player = _from_uid call _fn_find_player;

[] spawn max_facture_fnc_factureListMenu;

life_atmbank = life_atmbank - _price;
[1] call SOCK_fnc_updatePartial;

if (isNull _player) then {
    [_from_uid,_price] remoteExec ["max_facture_fnc_updatePlayer",2];
    if !(isNil "masterpay_script_enable_and_ready") then {
        if (masterpay_script_enable_and_ready) then {
            [player,(["STR_BILLING_SYSTEM_FROM","The_Programmer_Settings_MasterPay","MasterPay_Localization"] call theprogrammer_core_fnc_localize),_price,format [(["STR_BILLING_SYSTEM_DESCRITPION","The_Programmer_Settings_MasterPay","MasterPay_Localization"] call theprogrammer_core_fnc_localize),_id]] spawn masterpay_fnc_updateBank;
        };
    };
} else {
    [0,player,_price,_id] remoteExec ["max_facture_fnc_factureResult",_player];
    if !(isNil "masterpay_script_enable_and_ready") then {
        if (masterpay_script_enable_and_ready) then {
            [player,_player,_price,format [(["STR_BILLING_SYSTEM_DESCRITPION","The_Programmer_Settings_MasterPay","MasterPay_Localization"] call theprogrammer_core_fnc_localize),_id]] spawn masterpay_fnc_updateBank;
        };
    };
};
Par ceci :
Code:
[] spawn max_facture_fnc_factureListMenu;

life_atmbank = life_atmbank - _price;
[1] call SOCK_fnc_updatePartial;

_realEntreprise = objNull;
{
    _entrepriseId = _x select 0;
    _realEntreprise = _x select 1;
    if (_entrepriseId isEqualTo _from_uid) exitWith {_realEntreprise = _x select 1;};
} foreach maxence_all_entreprises;

if !(isNull _realEntreprise) then {
    _oldEntACC = _realEntreprise getVariable ["entreprise_bankacc",0];
    _oldEntACC = _oldEntACC + _price;
    _realEntreprise setVariable ["entreprise_bankacc",_oldEntACC,true];
    [(_realEntreprise getVariable ["entreprise_id",0]),5,(_realEntreprise getVariable ["entreprise_bankacc",0])] remoteExecCall ["max_entreprise_fnc_updateEntreprise",2];
    [_realEntreprise,format ["%1 (paiement facture #%2)",(name player),_id],_price,2] remoteExecCall ["max_entreprise_fnc_insertEntrepriseLogs",2];
};

Comme la dit Maxence Maxence si tu as pas fait les modification:
Pour que les employés de l'entreprise voient les factures envoyés par l'entreprise, dans ta mission/The-Programmer/Factures/dialogs/facture_list.hpp, remplace cette ligne :
Code:
onbuttonclick = "[(getPlayerUID player)] remoteExec [""max_facture_fnc_getFacturesSended"",2];";
Par ceci
Code:
onbuttonclick = "_realEntreprise = player getVariable [""current_entreprise"",objNull]; if (isNull _realEntreprise) exitWith {hint ""Vous n'avez pas d'entreprise, vous ne pouvez pas envoyer de facture !"";}; [str (_realEntreprise getVariable [""entreprise_id"",-1])] remoteExec [""max_facture_fnc_getFacturesSended"",2];";

Pense a me dire si tout fonctionne correctement :D
Cordialement MrAnciens MrAnciens
 
Upvote 0