1919
2020namespace FacturaScripts \Plugins \Modelo347 \Mod ;
2121
22- use FacturaScripts \Core \Base \ Contract \PurchasesModInterface ;
23- use FacturaScripts \Core \Base \ Translator ;
22+ use FacturaScripts \Core \Contract \PurchasesModInterface ;
23+ use FacturaScripts \Core \Translator ;
2424use FacturaScripts \Core \Model \Base \PurchaseDocument ;
2525use FacturaScripts \Core \Model \User ;
26+ use FacturaScripts \Core \Tools ;
27+
2628
2729/**
2830 * Add new fields in the modal window of the document header
3335 */
3436class PurchasesHeaderHTMLMod implements PurchasesModInterface
3537{
36- public function apply (PurchaseDocument &$ model , array $ formData, User $ user )
38+ public function apply (PurchaseDocument &$ model , array $ formData): void
3739 {
3840 if (property_exists ($ model , 'excluir347 ' )) {
3941 $ model ->excluir347 = ($ formData ['excluir347 ' ] ?? '' ) === 'true ' ;
4042 }
4143 }
4244
43- public function applyBefore (PurchaseDocument &$ model , array $ formData, User $ user )
45+ public function applyBefore (PurchaseDocument &$ model , array $ formData): void
4446 {
4547 }
4648
@@ -58,9 +60,10 @@ public function newFields(): array
5860 return [];
5961 }
6062
61- public function renderField (Translator $ i18n , PurchaseDocument $ model , string $ field ): ?string
63+ public function renderField (PurchaseDocument $ model , string $ field ): ?string
6264 {
6365 if ($ field == 'excluir347 ' ) {
66+ $ i18n = new Translator ();
6467 return $ this ->excluir347 ($ i18n , $ model );
6568 }
6669
@@ -88,8 +91,8 @@ private static function excluir347(Translator $i18n, PurchaseDocument $model): s
8891
8992 $ attributes = $ model ->editable ? 'name="excluir347" required="" ' : 'disabled="" ' ;
9093 return '<div class="col-sm-6"> '
91- . '<div class="form-group "> ' . $ i18n ->trans ('exclude-347 ' )
92- . '<select ' . $ attributes . ' class="form-control "/> ' . implode ('' , $ options ) . '</select> '
94+ . '<div class="mb-3 "> ' . $ i18n ->trans ('exclude-347 ' )
95+ . '<select ' . $ attributes . ' class="form-select "/> ' . implode ('' , $ options ) . '</select> '
9396 . '</div> '
9497 . '</div> ' ;
9598 }
0 commit comments