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

NEW Can use constant into param of a custom calculated export field #31783

Merged
merged 2 commits into from
Nov 12, 2024

Conversation

Quentin-Seekness
Copy link
Contributor

Allow usage of a method param that is not part of the $obj from the sql request.

The issue I encontered is the usage of order's LibStatut method that required a $mode param that can't be fetched from the sql request obj.

This would be the code for the export declaration :
$this->export_special_array[$r] = array(
'orders.fk_statut'=> [
'rule' => 'compute',
'class' => 'Commande',
'classfile' => '/commande/class/commande.class.php',
'method' => 'LibStatut',
'method_params' => ['orders_fk_statut', 'orders_facture', '1'],
],
);

We can see that the first two params will come from the $obj, but the third one will be used for it's value (in this case '1').

Quentin-Seekness and others added 2 commits November 12, 2024 16:16
Allow usage of a method param that is not part of the $obj from the sql request. 

The issue I encontered is the usage of order's LibStatut method that required a $mode param that can't be fetched from the sql request obj.

This would be the code for the export declaration : 
		$this->export_special_array[$r] = array(
			'orders.fk_statut'=> [
				'rule' => 'compute',
				'class' => 'Commande',
				'classfile' => '/commande/class/commande.class.php',
				'method' => 'LibStatut',
				'method_params' => ['orders_fk_statut', 'orders_facture', '1'],
			],
		);

We can see that the first two params will come from the $obj, but the third one will be used for it's value (in this case '1').
@eldy eldy changed the title Update export.class.php NEW Can use constant into param of a custom calculated export field Nov 12, 2024
@eldy eldy merged commit daafa15 into Dolibarr:develop Nov 12, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants