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 : add option to add external billing contact on the supplier_proposal pdf #30298

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions htdocs/admin/pdf_other.php
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,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"));
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 failure on line 304 in htdocs/admin/pdf_other.php

View workflow job for this annotation

GitHub Actions / pre-commit

Whitespace found at end of line
print '</table>';
print '</div>';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1353,7 +1353,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 @@ -1375,7 +1375,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) {
$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 @@ -2361,6 +2361,8 @@ INVOICE_ADD_SWISS_QR_CODE=Show the swiss QR-Bill code on invoices
INVOICE_ADD_SWISS_QR_CODEMore=Switzerland's standard for invoices; make sure ZIP & City are filled and that the accounts have valid Swiss/Liechtenstein IBANs.
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
Loading