787 public function LibStatut($paye, $status, $mode = 0, $alreadypaid = -1, $type = -1)
790 global $langs, $hookmanager;
791 $langs->load(
'bills');
797 $statusType =
'status0';
801 $labelStatus = $langs->transnoentitiesnoconv(
'BillStatusDraft');
802 $labelStatusShort = $langs->transnoentitiesnoconv(
'Bill'.$prefix.
'StatusDraft');
803 } elseif (($status == 3 || $status == 2) && $alreadypaid <= 0) {
805 $labelStatus = $langs->transnoentitiesnoconv(
'BillStatusCanceled');
806 $labelStatusShort = $langs->transnoentitiesnoconv(
'Bill'.$prefix.
'StatusCanceled');
808 $labelStatus = $langs->transnoentitiesnoconv(
'BillStatusClosedUnpaid');
809 $labelStatusShort = $langs->transnoentitiesnoconv(
'Bill'.$prefix.
'StatusClosedUnpaid');
811 $statusType =
'status5';
812 } elseif (($status == 3 || $status == 2) && $alreadypaid > 0) {
813 $labelStatus = $langs->transnoentitiesnoconv(
'BillStatusClosedPaidPartially');
814 $labelStatusShort = $langs->transnoentitiesnoconv(
'Bill'.$prefix.
'StatusClosedPaidPartially');
815 $statusType =
'status9';
816 } elseif ($alreadypaid == 0) {
817 $labelStatus = $langs->transnoentitiesnoconv(
'BillStatusNotPaid');
818 $labelStatusShort = $langs->transnoentitiesnoconv(
'Bill'.$prefix.
'StatusNotPaid');
819 $statusType =
'status1';
821 $labelStatus = $langs->transnoentitiesnoconv(
'BillStatusStarted');
822 $labelStatusShort = $langs->transnoentitiesnoconv(
'Bill'.$prefix.
'StatusStarted');
823 $statusType =
'status3';
826 $statusType =
'status6';
828 if ($type == self::TYPE_CREDIT_NOTE) {
829 $labelStatus = $langs->transnoentitiesnoconv(
'BillStatusPaidBackOrConverted');
830 $labelStatusShort = $langs->transnoentitiesnoconv(
'Bill'.$prefix.
'StatusPaidBackOrConverted');
831 } elseif ($type == self::TYPE_DEPOSIT) {
832 $labelStatus = $langs->transnoentitiesnoconv(
'BillStatusConverted');
833 $labelStatusShort = $langs->transnoentitiesnoconv(
'Bill'.$prefix.
'StatusConverted');
835 $labelStatus = $langs->transnoentitiesnoconv(
'BillStatusPaid');
836 $labelStatusShort = $langs->transnoentitiesnoconv(
'Bill'.$prefix.
'StatusPaid');
844 'alreadypaid' => $alreadypaid,
848 $reshook = $hookmanager->executeHooks(
'LibStatut', $parameters, $this);
851 return $hookmanager->resPrint;
856 return dolGetStatus($labelStatus, $labelStatusShort,
'', $statusType, $mode);
1107 public function makeStripeSepaRequest($fuser, $did, $type =
'direct-debit', $sourcetype =
'facture', $service =
'', $forcestripe =
'')
1109 global $conf, $user, $langs;
1111 if ($type !=
'bank-transfer' && $type !=
'credit-transfer' && !
getDolGlobalString(
'STRIPE_SEPA_DIRECT_DEBIT')) {
1118 if (empty($service)) {
1119 $service =
'StripeTest';
1121 $service =
'StripeLive';
1127 dol_syslog(get_class($this).
"::makeStripeSepaRequest start did=".$did.
" type=".$type.
" service=".$service.
" sourcetype=".$sourcetype.
" forcestripe=".$forcestripe, LOG_DEBUG);
1129 if ($this->
status > self::STATUS_DRAFT && $this->paye == 0) {
1131 require_once DOL_DOCUMENT_ROOT.
'/societe/class/companybankaccount.class.php';
1133 $result = $bac->fetch(0, $this->socid, 1,
'ban');
1134 if ($result <= 0 || empty($bac->id)) {
1135 $this->error = $langs->trans(
"ThirdpartyHasNoDefaultBanAccount");
1136 $this->errors[] = $this->error;
1137 dol_syslog(get_class($this).
"::makeStripeSepaRequest ".$this->error);
1142 $sql =
"SELECT rowid, date_demande, amount, fk_facture, fk_facture_fourn, fk_salary, fk_prelevement_bons";
1143 $sql .=
" FROM ".$this->db->prefix().
"prelevement_demande";
1144 $sql .=
" WHERE rowid = ".((int) $did);
1145 if ($type !=
'bank-transfer' && $type !=
'credit-transfer') {
1146 $sql .=
" AND fk_facture = ".((int) $this->
id);
1148 if ($type !=
'direct-debit') {
1149 if ($sourcetype ==
'salary') {
1150 $sql .=
" AND fk_salary = ".((int) $this->
id);
1152 $sql .=
" AND fk_facture_fourn = ".((int) $this->
id);
1155 $sql .=
" AND traite = 0";
1157 dol_syslog(get_class($this).
"::makeStripeSepaRequest load requests to process", LOG_DEBUG);
1158 $resql = $this->db->query($sql);
1160 $obj = $this->db->fetch_object($resql);
1167 $amount = $obj->amount;
1169 if (is_numeric($amount) && $amount != 0) {
1170 require_once DOL_DOCUMENT_ROOT.
'/societe/class/companypaymentmode.class.php';
1172 $companypaymentmode->fetch($bac->id);
1174 $this->stripechargedone = 0;
1175 $this->stripechargeerror = 0;
1179 $currency = $conf->currency;
1181 $errorforinvoice = 0;
1185 dol_syslog(
"makeStripeSepaRequest Process payment request amount=".$amount.
" thirdparty_id=" . $this->thirdparty->id .
", thirdparty_name=" . $this->thirdparty->name .
" ban id=" . $bac->id, LOG_DEBUG);
1190 $amounttopay = $amount;
1194 $arrayzerounitcurrency = [
'BIF',
'CLP',
'DJF',
'GNF',
'JPY',
'KMF',
'KRW',
'MGA',
'PYG',
'RWF',
'VND',
'VUV',
'XAF',
'XOF',
'XPF'];
1195 $amountstripe = $amounttopay;
1196 if (!in_array($currency, $arrayzerounitcurrency)) {
1197 $amountstripe = $amountstripe * 100;
1200 $fk_bank_account =
getDolGlobalInt(
'STRIPE_BANK_ACCOUNT_FOR_PAYMENTS');
1201 if (!($fk_bank_account > 0)) {
1204 dol_syslog(
"makeStripeSepaRequest Error no bank account defined for Stripe payments", LOG_ERR);
1205 $this->errors[] =
"Error bank account for Stripe payments not defined into Stripe module";
1211 require_once DOL_DOCUMENT_ROOT.
'/compta/prelevement/class/bonprelevement.class.php';
1214 if (empty($obj->fk_prelevement_bons)) {
1216 $nbinvoices = $bon->create(0, 0,
'real',
'ALL',
'', 0, $type, $did, $fk_bank_account);
1217 if ($nbinvoices <= 0) {
1220 dol_syslog(
"makeStripeSepaRequest Error on BonPrelevement creation", LOG_ERR);
1221 $this->errors[] =
"Error on BonPrelevement creation";
1240 dol_syslog(
"makeStripeSepaRequest Error Line already part of a bank payment order", LOG_ERR);
1241 $this->errors[] =
"The line is already included into a bank payment order. Delete the bank payment order first.";
1246 if ($amountstripe > 0) {
1248 global $savstripearrayofkeysbyenv;
1249 global $stripearrayofkeysbyenv;
1251 if ($service ==
'StripeLive') {
1256 dol_syslog(
"makeStripeSepaRequest We will try to pay with companypaymentmodeid=" . $companypaymentmode->id .
" stripe_card_ref=" . $companypaymentmode->stripe_card_ref .
" mode=" . $companypaymentmode->status, LOG_DEBUG);
1258 $thirdparty =
new Societe($this->db);
1259 $resultthirdparty = $thirdparty->fetch($this->socid);
1261 include_once DOL_DOCUMENT_ROOT .
'/stripe/class/stripe.class.php';
1263 $stripe =
new Stripe($this->db);
1265 if (empty($savstripearrayofkeysbyenv)) {
1266 $savstripearrayofkeysbyenv = $stripearrayofkeysbyenv;
1268 dol_syslog(
"makeStripeSepaRequest Current Stripe environment is " . $stripearrayofkeysbyenv[$servicestatus][
'publishable_key']);
1269 dol_syslog(
"makeStripeSepaRequest Current Saved Stripe environment is ".$savstripearrayofkeysbyenv[$servicestatus][
'publishable_key']);
1271 $foundalternativestripeaccount =
'';
1274 if (! empty($forcestripe)) {
1275 dol_syslog(
"makeStripeSepaRequest A dedicated stripe account was forced, so we switch to it.");
1277 $tmparray = explode(
'@', $forcestripe);
1278 if (! empty($tmparray[1])) {
1279 $tmparray2 = explode(
':', $tmparray[1]);
1280 if (! empty($tmparray2[1])) {
1281 $stripearrayofkeysbyenv[$servicestatus][
"publishable_key"] = $tmparray2[0];
1282 $stripearrayofkeysbyenv[$servicestatus][
"secret_key"] = $tmparray2[1];
1284 $stripearrayofkeys = $stripearrayofkeysbyenv[$servicestatus];
1285 \Stripe\Stripe::setApiKey($stripearrayofkeys[
'secret_key']);
1287 $foundalternativestripeaccount = $tmparray[0];
1289 dol_syslog(
"makeStripeSepaRequest We use now customer=".$foundalternativestripeaccount.
" publishable_key=".$stripearrayofkeys[
'publishable_key'], LOG_DEBUG);
1293 if (! $foundalternativestripeaccount) {
1294 $stripearrayofkeysbyenv = $savstripearrayofkeysbyenv;
1296 $stripearrayofkeys = $savstripearrayofkeysbyenv[$servicestatus];
1297 \Stripe\Stripe::setApiKey($stripearrayofkeys[
'secret_key']);
1298 dol_syslog(
"makeStripeSepaRequest We found a bad value for Stripe Account for thirdparty id=".$thirdparty->id.
", so we ignore it and keep using the global one, so ".$stripearrayofkeys[
'publishable_key'], LOG_WARNING);
1301 $stripearrayofkeysbyenv = $savstripearrayofkeysbyenv;
1303 $stripearrayofkeys = $savstripearrayofkeysbyenv[$servicestatus];
1304 \Stripe\Stripe::setApiKey($stripearrayofkeys[
'secret_key']);
1305 dol_syslog(
"makeStripeSepaRequest No dedicated Stripe Account requested, so we use global one, so ".$stripearrayofkeys[
'publishable_key'], LOG_DEBUG);
1308 $stripeacc = $stripe->getStripeAccount($service, $this->socid);
1310 if ($foundalternativestripeaccount) {
1311 if (empty($stripeacc)) {
1312 $customer = \Stripe\Customer::retrieve(array(
'id'=>
"$foundalternativestripeaccount",
'expand[]'=>
'sources'));
1314 $customer = \Stripe\Customer::retrieve(array(
'id'=>
"$foundalternativestripeaccount",
'expand[]'=>
'sources'), array(
"stripe_account" => $stripeacc));
1317 $customer = $stripe->customerStripe($thirdparty, $stripeacc, $servicestatus, 0);
1318 if (empty($customer) && ! empty($stripe->error)) {
1319 $this->errors[] = $stripe->error;
1329 $postactionmessages = [];
1331 if ($resultthirdparty > 0 && !empty($customer)) {
1334 if ($companypaymentmode->type ==
'ban') {
1338 $stripecard = $stripe->sepaStripe($customer, $companypaymentmode, $stripeacc, $servicestatus, 0);
1341 $this->error =
'The payment mode type is not "ban"';
1345 $FULLTAG =
'DID='.$did.
'-INV=' . $this->
id .
'-CUS=' . $thirdparty->id;
1346 $description =
'Stripe payment from makeStripeSepaRequest: ' . $FULLTAG .
' did='.$did.
' ref=' . $this->ref;
1348 $stripefailurecode =
'';
1349 $stripefailuremessage =
'';
1350 $stripefailuredeclinecode =
'';
1353 dol_syslog(
"* Create payment on SEPA " . $stripecard->id .
", amounttopay=" . $amounttopay .
", amountstripe=" . $amountstripe .
", FULLTAG=" . $FULLTAG, LOG_DEBUG);
1356 $paymentintent = $stripe->getPaymentIntent($amounttopay, $currency, $FULLTAG, $description, $this, $customer->id, $stripeacc, $servicestatus, 0,
'automatic',
true, $stripecard->id, 1, 1, $did);
1360 if ($paymentintent->status ===
'succeeded' || $paymentintent->status ===
'processing') {
1361 $charge->status =
'ok';
1362 $charge->id = $paymentintent->id;
1363 $charge->customer = $customer->id;
1364 } elseif ($paymentintent->status ===
'requires_action') {
1366 dol_syslog(var_export($paymentintent,
true), LOG_DEBUG);
1368 $charge->status =
'failed';
1369 $charge->customer = $customer->id;
1370 $charge->failure_code = $stripe->code;
1371 $charge->failure_message = $stripe->error;
1372 $charge->failure_declinecode = $stripe->declinecode;
1373 $stripefailurecode = $stripe->code;
1374 $stripefailuremessage =
'Action required. Contact the support at ';
1375 $stripefailuredeclinecode = $stripe->declinecode;
1377 dol_syslog(var_export($paymentintent,
true), LOG_DEBUG);
1379 $charge->status =
'failed';
1380 $charge->customer = $customer->id;
1381 $charge->failure_code = $stripe->code;
1382 $charge->failure_message = $stripe->error;
1383 $charge->failure_declinecode = $stripe->declinecode;
1384 $stripefailurecode = $stripe->code;
1385 $stripefailuremessage = $stripe->error;
1386 $stripefailuredeclinecode = $stripe->declinecode;
1394 if (empty($charge) || $charge->status ==
'failed') {
1395 dol_syslog(
'Failed to charge payment mode ' . $stripecard->id .
' stripefailurecode=' . $stripefailurecode .
' stripefailuremessage=' . $stripefailuremessage .
' stripefailuredeclinecode=' . $stripefailuredeclinecode, LOG_WARNING);
1398 $this->stripechargeerror++;
1402 $errmsg = $langs->trans(
"FailedToChargeCard");
1403 if (!empty($charge)) {
1404 if ($stripefailuredeclinecode ==
'authentication_required') {
1405 $errauthenticationmessage = $langs->trans(
"ErrSCAAuthentication");
1406 $errmsg = $errauthenticationmessage;
1407 } elseif (in_array($stripefailuredeclinecode, [
'insufficient_funds',
'generic_decline'])) {
1408 $errmsg .=
': ' . $charge->failure_code;
1409 $errmsg .= ($charge->failure_message ?
' - ' :
'') .
' ' . $charge->failure_message;
1410 if (empty($stripefailurecode)) {
1411 $stripefailurecode = $charge->failure_code;
1413 if (empty($stripefailuremessage)) {
1414 $stripefailuremessage = $charge->failure_message;
1417 $errmsg .=
': failure_code=' . $charge->failure_code;
1418 $errmsg .= ($charge->failure_message ?
' - ' :
'') .
' failure_message=' . $charge->failure_message;
1419 if (empty($stripefailurecode)) {
1420 $stripefailurecode = $charge->failure_code;
1422 if (empty($stripefailuremessage)) {
1423 $stripefailuremessage = $charge->failure_message;
1427 $errmsg .=
': ' . $stripefailurecode .
' - ' . $stripefailuremessage;
1428 $errmsg .= ($stripefailuredeclinecode ?
' - ' . $stripefailuredeclinecode :
'');
1431 $description =
'Stripe payment ERROR from makeStripeSepaRequest: ' . $FULLTAG;
1432 $postactionmessages[] = $errmsg .
' (' . $stripearrayofkeys[
'publishable_key'] .
')';
1433 $this->errors[] = $errmsg;
1435 dol_syslog(
'Successfuly request '.$type.
' '.$stripecard->id);
1437 $postactionmessages[] =
'Success to request '.$type.
' (' . $charge->id .
' with ' . $stripearrayofkeys[
'publishable_key'] .
')';
1441 $this->stripechargedone++;
1444 $description =
'Stripe payment request OK (' . $charge->id .
') from makeStripeSepaRequest: ' . $FULLTAG;
1450 if (empty($charge) || $charge->status ==
'failed') {
1451 $actioncode =
'PAYMENT_STRIPE_KO';
1452 $extraparams = $stripefailurecode;
1453 $extraparams .= (($extraparams && $stripefailuremessage) ?
' - ' :
'') . $stripefailuremessage;
1454 $extraparams .= (($extraparams && $stripefailuredeclinecode) ?
' - ' :
'') . $stripefailuredeclinecode;
1456 $actioncode =
'PAYMENT_STRIPE_OK';
1462 dol_syslog(
"No ban payment method found for this stripe customer " . $customer->id, LOG_WARNING);
1463 $this->errors[] =
'Failed to get direct debit payment method for stripe customer = ' . $customer->id;
1465 $description =
'Failed to find or use the payment mode - no ban defined for the thirdparty account';
1466 $stripefailurecode =
'BADPAYMENTMODE';
1467 $stripefailuremessage =
'Failed to find or use the payment mode - no ban defined for the thirdparty account';
1468 $postactionmessages[] = $description .
' (' . $stripearrayofkeys[
'publishable_key'] .
')';
1472 $actioncode =
'PAYMENT_STRIPE_KO';
1478 $stripefailurecode =
'';
1479 $stripefailuremessage =
'';
1487 if ($resultthirdparty <= 0) {
1488 dol_syslog(
'SellYourSaasUtils Failed to load customer for thirdparty_id = ' . $thirdparty->id, LOG_WARNING);
1489 $this->errors[] =
'Failed to load Stripe account for thirdparty_id = ' . $thirdparty->id;
1491 dol_syslog(
'SellYourSaasUtils Failed to get Stripe customer id for thirdparty_id = ' . $thirdparty->id .
" in mode " . $servicestatus .
" in Stripe env " . $stripearrayofkeysbyenv[$servicestatus][
'publishable_key'], LOG_WARNING);
1492 $this->errors[] =
'Failed to get Stripe account id for thirdparty_id = ' . $thirdparty->id .
" in mode " . $servicestatus .
" in Stripe env " . $stripearrayofkeysbyenv[$servicestatus][
'publishable_key'];
1497 $description =
'Failed to find or use your payment mode (no payment mode for this customer id)';
1498 $stripefailurecode =
'BADPAYMENTMODE';
1499 $stripefailuremessage =
'Failed to find or use your payment mode (no payment mode for this customer id)';
1500 $postactionmessages = [];
1504 $actioncode =
'PAYMENT_STRIPE_KO';
1509 dol_syslog(
"* Record event for credit transfer or direct debit request result - " . $description);
1510 require_once DOL_DOCUMENT_ROOT.
'/comm/action/class/actioncomm.class.php';
1515 $actioncomm->type_code =
'AC_OTH_AUTO';
1516 $actioncomm->code =
'AC_' . $actioncode;
1517 $actioncomm->label = $description;
1518 $actioncomm->note_private = join(
",\n", $postactionmessages);
1519 $actioncomm->fk_project = $this->fk_project;
1520 $actioncomm->datep = $now;
1521 $actioncomm->datef = $now;
1522 $actioncomm->percentage = -1;
1523 $actioncomm->socid = $thirdparty->id;
1524 $actioncomm->contactid = 0;
1525 $actioncomm->authorid = $user->id;
1526 $actioncomm->userownerid = $user->id;
1536 $actioncomm->fk_element = $this->id;
1537 $actioncomm->elementtype = $this->element;
1538 $actioncomm->extraparams =
dol_trunc($extraparams, 250);
1540 $actioncomm->create($user);
1544 $this->postactionmessages = $postactionmessages;
1548 dol_syslog(
'Error ' . $e->getMessage(), LOG_ERR);
1549 $this->errors[] =
'Error ' . $e->getMessage();
1554 dol_syslog(
"Remain to pay is null for the invoice " . $this->
id .
" " . $this->
ref .
". Why is the invoice not classified 'Paid' ?", LOG_WARNING);
1555 $this->errors[] =
"Remain to pay is null for the invoice " . $this->
id .
" " . $this->ref .
". Why is the invoice not classified 'Paid' ?";
1560 if (!$error && !$errorforinvoice) {
1561 $result = $bon->set_infotrans($user, $now, 3);
1565 dol_syslog(
"Error on BonPrelevement creation", LOG_ERR);
1566 $this->errors[] =
"Error on BonPrelevement creation";
1570 if (!$error && !$errorforinvoice) {
1572 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"prelevement_demande SET";
1573 $sql .=
" ext_payment_id = '".$this->db->escape($paymentintent->id).
"',";
1574 $sql .=
" ext_payment_site = '".$this->db->escape($service).
"'";
1575 $sql .=
" WHERE rowid = ".((int) $did);
1577 dol_syslog(get_class($this).
"::makeStripeSepaRequest update to save stripe paymentintent ids", LOG_DEBUG);
1578 $resql = $this->db->query($sql);
1580 $this->error = $this->db->lasterror();
1581 dol_syslog(get_class($this).
'::makeStripeSepaRequest Erreur');
1586 if (!$error && !$errorforinvoice) {
1587 $this->db->commit();
1589 $this->db->rollback();
1592 $this->error =
'WithdrawRequestErrorNilAmount';
1593 dol_syslog(get_class($this).
'::makeStripeSepaRequest WithdrawRequestErrorNilAmount');
1611 $this->error = $this->db->error();
1612 dol_syslog(get_class($this).
'::makeStripeSepaRequest Erreur -2');
1616 $this->error =
"Status of invoice does not allow this";
1617 dol_syslog(get_class($this).
"::makeStripeSepaRequest ".$this->error.
" ".$this->status.
" ,".$this->paye.
", ".$this->mode_reglement_id, LOG_WARNING);
1713 global $conf, $mysoc;
1716 $tmplang->setDefaultLang(
'en_US');
1717 $tmplang->load(
"main");
1719 $pricewithtaxstring =
price2num($this->total_ttc, 2, 1);
1720 $pricetaxstring =
price2num($this->total_tva, 2, 1);
1722 $complementaryinfo =
'';
1736 $complementaryinfo =
'//S1/10/'.str_replace(
'/',
'', $this->
ref).
'/11/'.$datestring;
1737 if ($this->ref_client) {
1738 $complementaryinfo .=
'/20/'.$this->ref_client;
1740 if ($this->thirdparty->tva_intra) {
1741 $complementaryinfo .=
'/30/'.$this->thirdparty->tva_intra;
1744 include_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
1745 $bankaccount =
new Account($this->db);
1753 if ($this->fk_account > 0) {
1755 $bankaccount->fetch($this->fk_account);
1756 $s .= $bankaccount->iban.
"\n";
1760 if ($bankaccount->id > 0 &&
getDolGlobalString(
'PDF_SWISS_QRCODE_USE_OWNER_OF_ACCOUNT_AS_CREDITOR')) {
1764 $s .=
dol_trunc($bankaccount->proprio, 70,
'right',
'UTF-8', 1).
"\n";
1765 $addresslinearray = explode(
"\n", $bankaccount->owner_address);
1766 $s .=
dol_trunc(empty($addresslinearray[1]) ?
'' : $addresslinearray[1], 70,
'right',
'UTF-8', 1).
"\n";
1767 $s .=
dol_trunc(empty($addresslinearray[2]) ?
'' : $addresslinearray[2], 70,
'right',
'UTF-8', 1).
"\n";
1773 $s .=
dol_trunc($mysoc->name, 70,
'right',
'UTF-8', 1).
"\n";
1774 $addresslinearray = explode(
"\n", $mysoc->address);
1775 $s .=
dol_trunc(empty($addresslinearray[1]) ?
'' : $addresslinearray[1], 70,
'right',
'UTF-8', 1).
"\n";
1776 $s .=
dol_trunc(empty($addresslinearray[2]) ?
'' : $addresslinearray[2], 70,
'right',
'UTF-8', 1).
"\n";
1777 $s .=
dol_trunc($mysoc->zip, 16,
'right',
'UTF-8', 1).
"\n";
1778 $s .=
dol_trunc($mysoc->town, 35,
'right',
'UTF-8', 1).
"\n";
1779 $s .=
dol_trunc($mysoc->country_code, 2,
'right',
'UTF-8', 1).
"\n";
1790 $s .=
price($pricewithtaxstring, 0,
'none', 0, 0, 2).
"\n";
1791 $s .= ($this->multicurrency_code ? $this->multicurrency_code : $conf->currency).
"\n";
1794 $s .=
dol_trunc($this->thirdparty->name, 70,
'right',
'UTF-8', 1).
"\n";
1795 $addresslinearray = explode(
"\n", $this->thirdparty->address);
1796 $s .=
dol_trunc(empty($addresslinearray[1]) ?
'' : $addresslinearray[1], 70,
'right',
'UTF-8', 1).
"\n";
1797 $s .=
dol_trunc(empty($addresslinearray[2]) ?
'' : $addresslinearray[2], 70,
'right',
'UTF-8', 1).
"\n";
1798 $s .=
dol_trunc($this->thirdparty->zip, 16,
'right',
'UTF-8', 1).
"\n";
1799 $s .=
dol_trunc($this->thirdparty->town, 35,
'right',
'UTF-8', 1).
"\n";
1800 $s .=
dol_trunc($this->thirdparty->country_code, 2,
'right',
'UTF-8', 1).
"\n";
1805 if ($complementaryinfo) {
1806 $s .= $complementaryinfo.
"\n";
1812 if ($complementaryinfo) {
1813 $s .= $complementaryinfo.
"\n";