Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added CreditUsed Report and CreditTicket Report #40

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

xacobofg
Copy link
Contributor

CreditUsed Report: lists each credit spent.
CreditTicket Report: lists each credit voucher information.
old pull request #23
#34

@gperrot
Copy link

gperrot commented Sep 4, 2019

Hello,

Thanks for everithing already done.

does this report focntion still working?

because i tried to add it without success, tried to check code but i'm not really good as php ;(

regards

@stonebuzz
Copy link
Contributor

Can you rebase you branch develop to be compatible with glpi 9.4

Best regards

@xacobofg
Copy link
Contributor Author

xacobofg commented Feb 4, 2020

Hello.
I've rebase the branch

@MarinBerthome
Copy link

Will be great to add the possibility to search tickets with credits criteria.

@cedric-anne cedric-anne changed the base branch from develop to main November 10, 2023 14:32
@cedric-anne cedric-anne requested review from a team, Rom1-B, AdrienClairembault and stonebuzz and removed request for a team, stonebuzz, Rom1-B and AdrienClairembault February 22, 2024 10:47
Copy link
Contributor

@Rom1-B Rom1-B left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello,
I haven't pointed out all the cases, but you must be careful to use English in the names of variables/functions and comments.
Please correct.

$LANG['creditused'][5]="Number ticket";
$LANG['creditused'][6]="Entity";
$LANG['creditused'][7]="Active";
$LANG['creditused_nulo'][0]="None";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose it's a typo?

Suggested change
$LANG['creditused_nulo'][0]="None";
$LANG['creditused_null'][0]="None";

include ("../../../../inc/includes.php");

$report= new PluginReportsAutoReport($LANG['plugin_credit']['creditused']);
//Filtro fecha
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

English comments, please

$report->setColumns([new PluginReportsColumn('id', $LANG['creditused'][5]),
new PluginReportsColumn('ticket', $LANG['creditused'][0]),
new PluginReportsColumn('active', $LANG['creditused'][7]),
new PluginReportsColumn('categoria', $LANG['creditused'][1]),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
new PluginReportsColumn('categoria', $LANG['creditused'][1]),
new PluginReportsColumn('category', $LANG['creditused'][1]),

//Filtro fecha
new PluginReportsDateIntervalCriteria($report, 'date', $LANG['creditused_criteria'][0]);
//Filtro activo
$choices = [0=>'--', 2 =>$LANG['creditused_active'][1], 1 => $LANG['creditused_active'][0]];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$choices = [0=>'--', 2 =>$LANG['creditused_active'][1], 1 => $LANG['creditused_active'][0]];
$choices = [
0 => '--',
2 => $LANG['creditused_active'][1],
1 => $LANG['creditused_active'][0],
];

inner join glpi_plugin_credit_entities as gpce on gpce.id=gpct.plugin_credit_entities_id
inner JOIN `glpi_entities` as ge ON (`gpce`.`entities_id` = `ge`.`id`)
".getEntitiesRestrictRequest(" WHERE", "gpce");
if ($filter_active->getParameterValue()==2) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if ($filter_active->getParameterValue()==2) {
if ($filter_active->getParameterValue() == 2) {


$report= new PluginReportsAutoReport($LANG['plugin_credit']['creditvoucher']);
//Filtro Activo
$choices = [0=>'--', 2 =>$LANG['creditvoucher_active'][1], 1 => $LANG['creditvoucher_active'][0]];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$choices = [0=>'--', 2 =>$LANG['creditvoucher_active'][1], 1 => $LANG['creditvoucher_active'][0]];
$choices = [
0 => '--',
2 => $LANG['creditvoucher_active'][1],
1 => $LANG['creditvoucher_active'][0],
];

left join glpi_plugin_credit_tickets as pct on (`pct`.`plugin_credit_entities_id` = `gpce`.`id`)
inner JOIN `glpi_entities` as ge ON (`gpce`.`entities_id` = `ge`.`id`)".
getEntitiesRestrictRequest(" WHERE", "gpce");
if ($filter_active->getParameterValue()==2) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if ($filter_active->getParameterValue()==2) {
if ($filter_active->getParameterValue() == 2) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants