Français [Billing System x Company System] Envoyer des factures aux entreprises

  • Auteur de la discussion Auteur de la discussion MrAnciens
  • Date de début Date de début

MrAnciens

User
4/1/21
120
16
10
950
26
Hey, ce tutoriel sert a recevoir les payements des factures a l'entreprise.
Pratique si vous utiliser ce tutoriel : Français - [Billing System] Autoriser seulement les entreprises a pouvoir créer de nouvelles factures.

Tout d'abord aller dans @The_Programmer/addons/
Et décompressé Billing System.pbo

Ouvre le fichiers => @The_Programmer/addons/billing_system/client/fn_sendFacture.sqf Remplacer ce bloc
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];

Par ceci :
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/>"];

Ouvre le fichier => @The_Programmer/addons/billing_system/client/fn_payFacture.sqf Remplacer ce bloc :
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;
{
    _idEntreprises = _x select 0;
    _realEntreprise = _x select 1;
    if (_idEntreprises isEqualTo (parseNumber _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,(name player),_price,2] remoteExecCall ["max_entreprise_fnc_insertEntrepriseLogs",2];
};

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];";

C'est enfin fini ! Facile nah ? :D

Tout problème n'hésite pas a faire un post sur : Arma 3 Support
 
  • Like
Les réactions: TartiFlette