Skip to content

Commit

Permalink
NEW : add option to add external billing contact on the supplier_prop…
Browse files Browse the repository at this point in the history
…osal pdf (#30298)

* add external contact with billing code in supplier_proposal pdf

* update with pr returns

* Update pdf_other.php

---------

Co-authored-by: Laurent Destailleur <[email protected]>
  • Loading branch information
samifilali and eldy committed Jul 16, 2024
1 parent 97b4093 commit 4aa5e45
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 2 deletions.
13 changes: 13 additions & 0 deletions htdocs/admin/pdf_other.php
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,19 @@
}
print '</td></tr>';

/* Keep this option hidden for the moment to avoid options inflation. We'll see later if it is used enough...
print '<tr class="oddeven"><td>';
print $form->textwithpicto($langs->trans("SUPPLIER_PROPOSAL_ADD_BILLING_CONTACT"), $langs->trans("SUPPLIER_PROPOSAL_ADD_BILLING_CONTACTMore"));

Check failure on line 323 in htdocs/admin/pdf_other.php

View workflow job for this annotation

GitHub Actions / pre-commit / pre-commit

Missing translation; print $form->textwithpicto($langs->trans("SUPPLIER_PROPOSAL_ADD_BILLING_CONTACT"), $langs->trans("SUPPLIER_PROPOSAL_ADD_BILLING_CONTACTMore"));
print '</td><td>';
if ($conf->use_javascript_ajax) {
print ajax_constantonoff('SUPPLIER_PROPOSAL_ADD_BILLING_CONTACT');
} else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
print $form->selectarray("SUPPLIER_PROPOSAL_ADD_BILLING_CONTACT", $arrval, $conf->global->SUPPLIER_PROPOSAL_ADD_BILLING_CONTACT);
}
print '</td></tr>';
*/

Check warning on line 333 in htdocs/admin/pdf_other.php

View workflow job for this annotation

GitHub Actions / phan / Run phan

pdf_other.php: PhanPluginWhitespaceTrailing: The first occurrence of trailing whitespace was seen here.
print '</table>';
print '</div>';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1356,7 +1356,11 @@ protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs)

// If CUSTOMER contact defined, we use it
$usecontact = false;
$arrayidcontact = $object->getIdContact('external', 'CUSTOMER');
if (getDolGlobalInt('SUPPLIER_PROPOSAL_ADD_BILLING_CONTACT')) {
$arrayidcontact = $object->getIdContact('external', 'CUSTOMER');
} else {
$arrayidcontact = array_merge($object->getIdContact('external', 'CUSTOMER'), $object->getIdContact('external', 'BILLING'));
}
if (count($arrayidcontact) > 0) {
$usecontact = true;
$result = $object->fetch_contact($arrayidcontact[0]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1377,7 +1377,11 @@ protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs)

// If CUSTOMER contact defined on proposal, we use it. Note: Even if this is a supplier object, the code for external contat that follow order is 'CUSTOMER'
$usecontact = false;
$arrayidcontact = $object->getIdContact('external', 'CUSTOMER');
if (getDolGlobalInt('SUPPLIER_PROPOSAL_ADD_BILLING_CONTACT')) {
$arrayidcontact = $object->getIdContact('external', 'CUSTOMER');
} else {
$arrayidcontact = array_merge($object->getIdContact('external', 'CUSTOMER'), $object->getIdContact('external', 'BILLING'));
}
if (count($arrayidcontact) > 0) {

Check warning on line 1385 in htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php

View workflow job for this annotation

GitHub Actions / phan / Run phan

pdf_zenith.modules.php: PhanTypeMismatchArgumentNullableInternal: Argument 1 ($value) is $arrayidcontact of type ?int[] but \count() takes \Countable|\ResourceBundle|\SimpleXMLElement|array (expected type to be non-nullable)
$usecontact = true;
$result = $object->fetch_contact($arrayidcontact[0]);
Expand Down
2 changes: 2 additions & 0 deletions htdocs/langs/en_US/admin.lang
Original file line number Diff line number Diff line change
Expand Up @@ -2389,6 +2389,8 @@ INVOICE_ADD_EPC_QR_CODEMore=This feature allows you to add or remove an EPC QR C
INVOICE_ADD_EPC_QR_CODEPay=Scan this QR code to pay with a smartphone supporting payment with EPC QR code.
INVOICE_SHOW_SHIPPING_ADDRESS=Show shipping address
INVOICE_SHOW_SHIPPING_ADDRESSMore=Compulsory indication in some countries (France, ...)
SUPPLIER_PROPOSAL_ADD_BILLING_CONTACT = Show billing contact on proposal
SUPPLIER_PROPOSAL_ADD_BILLING_CONTACMore = By default the contact only appears for billing
UrlSocialNetworksDesc=Url link of social network. Use {socialid} for the variable part that contains the social network ID.
IfThisCategoryIsChildOfAnother=If this category is a child of another one
DarkThemeMode=Dark theme mode
Expand Down

0 comments on commit 4aa5e45

Please sign in to comment.