Merge remote-tracking branch 'upstream/develop' into new_branch_10_10_2018

This commit is contained in:
Philippe GRAND 2018-10-11 09:14:40 +02:00
commit f13c38e117
18 changed files with 129 additions and 81 deletions

View File

@ -79,6 +79,7 @@ $model_option = array (
/*
* Actions
*/
if ($action == 'update') {
$error = 0;
@ -124,6 +125,8 @@ if ($action == 'update') {
}
}
/*
* View
*/
@ -267,7 +270,7 @@ if ($num2) {
} else {
print '<input type="text" size="20" id="'. $label .'" name="' . $key['label'] . '" value="' . $conf->global->$label . '">';
}
print '</td></tr>';
}

View File

@ -130,11 +130,6 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x',
$filter = array();
}
/*
* View
*/
if ($action == 'export_csv') {
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
@ -156,13 +151,23 @@ if ($action == 'export_csv') {
print price($line->credit - $line->debit) . $sep;
print "\n";
}
exit;
}
else {
$title_page = $langs->trans("AccountBalance");
llxHeader('', $title_page);
/*
* View
*/
$title_page = $langs->trans("AccountBalance");
llxHeader('', $title_page);
if ($action != 'export_csv')
{
// List
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))

View File

@ -44,7 +44,8 @@ class AccountancyExport
/**
* @var Type of export. Defined by $conf->global->ACCOUNTING_EXPORT_MODELCSV
*/
public static $EXPORT_TYPE_NORMAL = 1; // Classic CSV
public static $EXPORT_TYPE_NORMAL = 1; // CSV
public static $EXPORT_TYPE_CONFIGURABLE = 10; // CSV
public static $EXPORT_TYPE_CEGID = 2;
public static $EXPORT_TYPE_COALA = 3;
public static $EXPORT_TYPE_BOB50 = 4;
@ -53,7 +54,6 @@ class AccountancyExport
public static $EXPORT_TYPE_EBP = 7;
public static $EXPORT_TYPE_COGILOG = 8;
public static $EXPORT_TYPE_AGIRIS = 9;
public static $EXPORT_TYPE_CONFIGURABLE = 10;
public static $EXPORT_TYPE_FEC = 11;
@ -98,7 +98,8 @@ class AccountancyExport
global $langs;
return array (
self::$EXPORT_TYPE_NORMAL => $langs->trans('Modelcsv_normal'),
//self::$EXPORT_TYPE_NORMAL => $langs->trans('Modelcsv_normal'),
self::$EXPORT_TYPE_CONFIGURABLE => $langs->trans('Modelcsv_configurable'),
self::$EXPORT_TYPE_CEGID => $langs->trans('Modelcsv_CEGID'),
self::$EXPORT_TYPE_COALA => $langs->trans('Modelcsv_COALA'),
self::$EXPORT_TYPE_BOB50 => $langs->trans('Modelcsv_bob50'),
@ -107,11 +108,35 @@ class AccountancyExport
self::$EXPORT_TYPE_EBP => $langs->trans('Modelcsv_ebp'),
self::$EXPORT_TYPE_COGILOG => $langs->trans('Modelcsv_cogilog'),
self::$EXPORT_TYPE_AGIRIS => $langs->trans('Modelcsv_agiris'),
self::$EXPORT_TYPE_CONFIGURABLE => $langs->trans('Modelcsv_configurable'),
self::$EXPORT_TYPE_FEC => $langs->trans('Modelcsv_FEC'),
);
}
/**
* Return string to summarize the format (Used to generated export filename)
*
* @param int $type Format id
* @return string Format code
*/
private static function getFormatCode($type)
{
$formatcode = array (
//self::$EXPORT_TYPE_NORMAL => 'csv',
self::$EXPORT_TYPE_CONFIGURABLE => 'csv',
self::$EXPORT_TYPE_CEGID => 'cegid',
self::$EXPORT_TYPE_COALA => 'coala',
self::$EXPORT_TYPE_BOB50 => 'bob50',
self::$EXPORT_TYPE_CIEL => 'ciel',
self::$EXPORT_TYPE_QUADRATUS => 'quadratus',
self::$EXPORT_TYPE_EBP => 'ebp',
self::$EXPORT_TYPE_COGILOG => 'cogilog',
self::$EXPORT_TYPE_AGIRIS => 'agiris',
self::$EXPORT_TYPE_FEC => 'fec',
);
return $formatcode[$type];
}
/**
* Array with all export type available (key + label) and parameters for config
*
@ -123,13 +148,13 @@ class AccountancyExport
return array (
'param' => array(
self::$EXPORT_TYPE_NORMAL => array(
/*self::$EXPORT_TYPE_NORMAL => array(
'label' => $langs->trans('Modelcsv_normal'),
'ACCOUNTING_EXPORT_FORMAT' => empty($conf->global->ACCOUNTING_EXPORT_FORMAT)?'txt':$conf->global->ACCOUNTING_EXPORT_FORMAT,
'ACCOUNTING_EXPORT_SEPARATORCSV' => empty($conf->global->ACCOUNTING_EXPORT_SEPARATORCSV)?',':$conf->global->ACCOUNTING_EXPORT_SEPARATORCSV,
'ACCOUNTING_EXPORT_ENDLINE' => empty($conf->global->ACCOUNTING_EXPORT_ENDLINE)?1:$conf->global->ACCOUNTING_EXPORT_ENDLINE,
'ACCOUNTING_EXPORT_DATE' => empty($conf->global->ACCOUNTING_EXPORT_DATE)?'%d%m%Y':$conf->global->ACCOUNTING_EXPORT_DATE,
),
),*/
self::$EXPORT_TYPE_CEGID => array(
'label' => $langs->trans('Modelcsv_CEGID'),
),
@ -179,17 +204,6 @@ class AccountancyExport
);
}
/**
* Download the export
*
* @return void
*/
public static function downloadFile()
{
global $conf;
$filename = 'general_ledger';
include DOL_DOCUMENT_ROOT . '/accountancy/tpl/export_journal.tpl.php';
}
/**
* Function who chose which export to use with the default config
@ -201,12 +215,19 @@ class AccountancyExport
{
global $conf, $langs;
self::downloadFile();
$filename = 'general_ledger-'.$this->getFormatCode($conf->global->ACCOUNTING_EXPORT_MODELCSV);
include DOL_DOCUMENT_ROOT . '/accountancy/tpl/export_journal.tpl.php';
switch ($conf->global->ACCOUNTING_EXPORT_MODELCSV) {
case self::$EXPORT_TYPE_NORMAL :
$this->exportNormal($TData);
/*$this->exportNormal($TData);
break;*/
case self::$EXPORT_TYPE_CONFIGURABLE :
$this->exportConfigurable($TData);
break;
case self::$EXPORT_TYPE_NORMAL :
case self::$EXPORT_TYPE_CEGID :
$this->exportCegid($TData);
break;
@ -231,9 +252,6 @@ class AccountancyExport
case self::$EXPORT_TYPE_AGIRIS :
$this->exportAgiris($TData);
break;
case self::$EXPORT_TYPE_CONFIGURABLE :
$this->exportConfigurable($TData);
break;
case self::$EXPORT_TYPE_FEC :
$this->exportFEC($TData);
break;
@ -250,6 +268,7 @@ class AccountancyExport
*
* @return void
*/
/* Use $EXPORT_TYPE_CONFIGURABLE instead
public function exportNormal($objectLines)
{
global $conf;
@ -267,6 +286,7 @@ class AccountancyExport
print $this->end_line;
}
}
*/
/**
* Export format : CEGID
@ -610,12 +630,12 @@ class AccountancyExport
$tab[] = $date;
$tab[] = $line->doc_ref;
$tab[] = $line->label_operation;
$tab[] = length_accountg($line->numero_compte);
$tab[] = length_accounta($line->subledger_account);
$tab[] = price($line->debit);
$tab[] = price($line->credit);
$tab[] = price($line->montant);
$tab[] = $line->code_journal;
$tab[] = length_accountg($line->numero_compte);
$tab[] = length_accounta($line->subledger_account);
$tab[] = price($line->debit);
$tab[] = price($line->credit);
$tab[] = price($line->montant);
$tab[] = $line->code_journal;
$separator = $this->separator;
print implode($separator, $tab) . $this->end_line;

View File

@ -309,9 +309,9 @@ if ($result) {
print '<tr class="liste_titre_filter">';
print '<td class="liste_titre"><input type="text" class="flat maxwidth25" name="search_lineid" value="' . dol_escape_htmltag($search_lineid) . '""></td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_invoice" value="' . dol_escape_htmltag($search_invoice) . '"></td>';
print '<td class="liste_titre center">';
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="search_day" value="'.dol_escape_htmltag($search_day).'">';
print '<input class="flat" type="text" size="1" maxlength="2" name="search_month" value="'.dol_escape_htmltag($search_month).'">';
print '<td class="liste_titre center nowraponall">';
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat valignmiddle" type="text" size="1" maxlength="2" name="search_day" value="'.dol_escape_htmltag($search_day).'">';
print '<input class="flat valignmiddle" type="text" size="1" maxlength="2" name="search_month" value="'.dol_escape_htmltag($search_month).'">';
$formother->select_year($search_year,'search_year',1, 20, 5);
print '</td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_ref" value="' . dol_escape_htmltag($search_ref) . '"></td>';
@ -367,7 +367,7 @@ if ($result) {
print '<td>' . $objp->rowid . '</td>';
// Ref Invoice
print '<td>' . $facture_static->getNomUrl(1) . '</td>';
print '<td class="nowraponall">' . $facture_static->getNomUrl(1) . '</td>';
print '<td align="center">' . dol_print_date($db->jdate($objp->datef), 'day') . '</td>';

View File

@ -466,7 +466,7 @@ if ($result) {
print '<td>' . $objp->rowid . '</td>';
// Ref Invoice
print '<td>' . $facture_static->getNomUrl(1) . '</td>';
print '<td class="nowraponall">' . $facture_static->getNomUrl(1) . '</td>';
print '<td align="center">' . dol_print_date($db->jdate($objp->datef), 'day') . '</td>';

View File

@ -371,7 +371,7 @@ if ($result) {
$tabpay[$obj->rowid]["paymentloanid"] = $paymentloanstatic->id;
//$tabtp[$obj->rowid][$account_pay_loan] += $obj->amount;
} else if ($links[$key]['type'] == 'banktransfert') {
$accountLinestatic->fetch($links[$key]['url_id']);
$accountLinestatic->fetch($links[$key]['url_id']);
$tabpay[$obj->rowid]["lib"] .= ' '.$langs->trans("BankTransfer").'- ' .$accountLinestatic ->getNomUrl(1);
$tabtp[$obj->rowid][$account_transfer] += $obj->amount;
$bankaccountstatic->fetch($tabpay[$obj->rowid]['fk_bank_account']);

View File

@ -400,11 +400,13 @@ if ($action == 'writebookkeeping') {
$param.='&date_endmonth='.$date_endmonth;
$param.='&date_endyear='.$date_endyear;
$param.='&in_bookkeeping='.$in_bookkeeping;
header("Location: ".$_SERVER['PHP_SELF'].($param?'?'.$param:''));
exit;
}
}
/*
* View
*/

View File

@ -313,9 +313,9 @@ if ($result) {
print '<td class="liste_titre"><input type="text" class="flat maxwidth25" name="search_lineid" value="' . dol_escape_htmltag($search_lineid) . '""></td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_invoice" value="' . dol_escape_htmltag($search_invoice) . '"></td>';
print '<td class="liste_titre"></td>';
print '<td class="liste_titre center">';
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="search_day" value="'.$search_day.'">';
print '<input class="flat" type="text" size="1" maxlength="2" name="search_month" value="'.$search_month.'">';
print '<td class="liste_titre center nowraponall">';
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat valignmiddle" type="text" size="1" maxlength="2" name="search_day" value="'.$search_day.'">';
print '<input class="flat valignmiddle" type="text" size="1" maxlength="2" name="search_month" value="'.$search_month.'">';
$formother->select_year($search_year,'search_year',1, 20, 5);
print '</td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_ref" value="' . dol_escape_htmltag($search_ref) . '"></td>';
@ -374,7 +374,7 @@ if ($result) {
print '<td>' . $objp->rowid . '</td>';
// Ref Invoice
print '<td>' . $facturefournisseur_static->getNomUrl(1) . '</td>';
print '<td class="nowraponall">' . $facturefournisseur_static->getNomUrl(1) . '</td>';
print '<td class="tdoverflowonsmartphone">';
print $objp->invoice_label;

View File

@ -469,7 +469,7 @@ if ($result) {
print '<td>' . $objp->rowid . '</td>';
// Ref Invoice
print '<td>' . $facturefourn_static->getNomUrl(1) . '</td>';
print '<td class="nowraponall">' . $facturefourn_static->getNomUrl(1) . '</td>';
print '<td class="tdoverflowonsmartphone">';
print $objp->invoice_label;

View File

@ -204,12 +204,12 @@ if (empty($reshook))
}
// Conciliation
if (GETPOST('confirm_reconcile') && $user->rights->banque->consolidate)
if ((GETPOST('confirm_savestatement','alpha') || GETPOST('confirm_reconcile','alpha')) && $user->rights->banque->consolidate)
{
$error=0;
// Definition, nettoyage parametres
$num_releve=trim(GETPOST("num_releve"));
$num_releve=trim(GETPOST("num_releve","alpha"));
if ($num_releve)
{
@ -222,7 +222,7 @@ if (GETPOST('confirm_reconcile') && $user->rights->banque->consolidate)
{
$result=$bankline->fetch($row);
$bankline->num_releve=$num_releve; //$_POST["num_releve"];
$result=$bankline->update_conciliation($user, GETPOST("cat"));
$result=$bankline->update_conciliation($user, GETPOST("cat"), GETPOST('confirm_reconcile','alpha')?1:0); // If we confirm_reconcile, we set flag 'rappro' to 1.
if ($result < 0)
{
setEventMessages($bankline->error, $bankline->errors, 'errors');
@ -248,7 +248,21 @@ if (GETPOST('confirm_reconcile') && $user->rights->banque->consolidate)
if (! $error)
{
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); // To avoid to submit twice and allow back
$param='action=reconcile&contextpage=banktransactionlist&id='.$id.'&search_account='.$id;
$param.='&search_conciliated='.urlencode($search_conciliated);
if ($page) $param.='&page='.urlencode($page);
if ($offset) $param.='&offset='.urlencode($offset);
if ($search_thirdparty) $param.='&search_thirdparty='.urlencode($search_thirdparty);
if ($search_num_releve) $param.='&search_num_releve='.urlencode($search_num_releve);
if ($search_start_dt) $param.='&search_start_dt='.urlencode($search_start_dt);
if ($search_end_dt) $param.='&search_end_dt='.urlencode($search_end_dt);
if ($search_start_dv) $param.='&search_start_dv='.urlencode($search_start_dv);
if ($search_end_dv) $param.='&search_end_dv='.urlencode($search_end_dv);
if ($search_type) $param.='&search_type='.urlencode($search_type);
if ($search_debit) $param.='&search_debit='.urlencode($search_debit);
if ($search_credit) $param.='&search_credit='.urlencode($search_credit);
$param.='&sortfield='.urlencode($sortfield).'&sortorder='.urlencode($sortorder);
header('Location: '.$_SERVER["PHP_SELF"].'?'.$param); // To avoid to submit twice and allow the back button
exit;
}
}
@ -429,7 +443,7 @@ if ($id > 0 || ! empty($ref))
if ($user->rights->banque->consolidate) {
$newparam = $param;
$newparam = preg_replace('/search_conciliated=\d+/i','',$newparam);
$buttonreconcile = '<a class="butActionNew" style="margin-bottom: 5px !important; margin-top: 5px !important" href="'.DOL_URL_ROOT.'/compta/bank/bankentries_list.php?action=reconcile&search_conciliated=0'.$newparam.'">'.$langs->trans("Conciliate").'</a>';
$buttonreconcile = '<a class="butActionNew" style="margin-bottom: 5px !important; margin-top: 5px !important" href="'.DOL_URL_ROOT.'/compta/bank/bankentries_list.php?action=reconcile&sortfield=b.datev,b.dateo,b.rowid&amp;sortorder=asc,asc,asc&search_conciliated=0'.$newparam.'">'.$langs->trans("Conciliate").'</a>';
} else {
$buttonreconcile = '<a class="butActionNewRefused" style="margin-bottom: 5px !important; margin-top: 5px !important" title="'.$langs->trans("NotEnoughPermissions").'" href="#">'.$langs->trans("Conciliate").'</a>';
}
@ -579,6 +593,8 @@ if ($resql)
print Form::selectarray('cat', $options, GETPOST('cat'), 1);
}
print '<br>'.$langs->trans("ThenCheckLinesAndConciliate").' ';
print '<input class="button" name="confirm_savestatement" type="submit" value="'.$langs->trans("SaveStatementOnly").'">';
print ' '.$langs->trans("or").' ';
print '<input class="button" name="confirm_reconcile" type="submit" value="'.$langs->trans("Conciliate").'">';
print ' '.$langs->trans("or").' ';
print '<input type="submit" name="cancel" class="button" value="'.$langs->trans("Cancel").'">';
@ -1401,16 +1417,17 @@ if ($resql)
if (! empty($arrayfields['b.num_releve']['checked']))
{
print '<td class="nowrap" align="center">';
print '<td class="nowraponall" align="center">';
// Transaction reconciliated or edit link
if ($bankaccount->canBeConciliated() > 0)
{
if ($objp->conciliated) // If line not conciliated and account can be conciliated
if ($objp->num_releve)
{
print '<a href="releve.php?num='.$objp->num_releve.'&amp;account='.$objp->bankid.'">'.$objp->num_releve.'</a>';
print '<a href="releve.php?num='.$objp->num_releve.'&account='.$objp->bankid.'&save_lastsearch_values=1">'.$objp->num_releve.'</a>';
}
else if ($action == 'reconcile')
if (! $objp->conciliated && $action == 'reconcile')
{
if ($objp->num_releve) print '&nbsp;';
print '<input class="flat" name="rowid['.$objp->rowid.']" type="checkbox" value="'.$objp->rowid.'" size="1"'.(! empty($_POST['rowid'][$objp->rowid])?' checked':'').'>';
}
}
@ -1435,7 +1452,7 @@ if ($resql)
// Transaction reconciliated or edit link
if ($objp->conciliated && $bankaccount->canBeConciliated() > 0) // If line not conciliated and account can be conciliated
{
print '<a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$objp->rowid.'&amp;account='.$objp->bankid.'&amp;page='.$page.'">';
print '<a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?save_lastsearch_values=1&amp;rowid='.$objp->rowid.'&amp;account='.$objp->bankid.'&amp;page='.$page.'">';
print img_edit();
print '</a>';
}
@ -1443,13 +1460,13 @@ if ($resql)
{
if ($user->rights->banque->modifier || $user->rights->banque->consolidate)
{
print '<a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$objp->rowid.'&amp;account='.$objp->bankid.'&amp;page='.$page.'">';
print '<a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?save_lastsearch_values=1&amp;rowid='.$objp->rowid.'&amp;account='.$objp->bankid.'&amp;page='.$page.'">';
print img_edit();
print '</a>';
}
else
{
print '<a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$objp->rowid.'&amp;account='.$objp->bankid.'&amp;page='.$page.'">';
print '<a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?save_lastsearch_values=1&amp;rowid='.$objp->rowid.'&amp;account='.$objp->bankid.'&amp;page='.$page.'">';
print img_view();
print '</a>';
}

View File

@ -2006,11 +2006,12 @@ class AccountLine extends CommonObject
/**
* Update conciliation field
*
* @param User $user Objet user making update
* @param int $cat Category id
* @return int <0 if KO, >0 if OK
* @param User $user Objet user making update
* @param int $cat Category id
* @param int $conciliated 1=Set transaction to conciliated, 0=Keep transaction non conciliated
* @return int <0 if KO, >0 if OK
*/
function update_conciliation(User $user, $cat)
function update_conciliation(User $user, $cat, $conciliated=1)
{
// phpcs:enable
global $conf,$langs;
@ -2028,9 +2029,9 @@ class AccountLine extends CommonObject
}
$sql = "UPDATE ".MAIN_DB_PREFIX."bank SET";
$sql.= " rappro = 1";
$sql.= " rappro = ".$conciliated;
$sql.= ", num_releve = '".$this->db->escape($this->num_releve)."'";
$sql.= ", fk_user_rappro = ".$user->id;
if ($conciliated) $sql.= ", fk_user_rappro = ".$user->id;
$sql.= " WHERE rowid = ".$this->id;
dol_syslog(get_class($this)."::update_conciliation", LOG_DEBUG);

View File

@ -3744,7 +3744,7 @@ class Form
* @param int $disableformtag 1=Disable form tag. Can be used if we are already inside a <form> section.
* @return string HTML ajax code if a confirm ajax popup is required, Pure HTML code if it's an html form
*/
function formconfirm($page, $title, $question, $action, $formquestion='', $selectedchoice='', $useajax=0, $height=200, $width=500, $disableformtag=0)
function formconfirm($page, $title, $question, $action, $formquestion='', $selectedchoice='', $useajax=0, $height=210, $width=500, $disableformtag=0)
{
global $langs,$conf;
global $useglobalvars;

View File

@ -49,7 +49,6 @@ create table llx_user
fk_country integer DEFAULT 0,
birth date, -- birthday
job varchar(128),
skype varchar(255),
office_phone varchar(20),
office_fax varchar(20),
user_mobile varchar(20),

View File

@ -266,7 +266,7 @@ Modelcsv_quadratus=Export towards Quadratus QuadraCompta
Modelcsv_ebp=Export towards EBP
Modelcsv_cogilog=Export towards Cogilog
Modelcsv_agiris=Export towards Agiris
Modelcsv_configurable=Export Configurable
Modelcsv_configurable=Export CSV Configurable
Modelcsv_FEC=Export FEC (Art. L47 A) (Test)
ChartofaccountsId=Chart of accounts Id

View File

@ -76,6 +76,7 @@ TransactionsToConciliate=Entries to reconcile
Conciliable=Can be reconciled
Conciliate=Reconcile
Conciliation=Reconciliation
SaveStatementOnly=Save statement only
ReconciliationLate=Reconciliation late
IncludeClosedAccount=Include closed accounts
OnlyOpenedAccount=Only open accounts

View File

@ -111,7 +111,7 @@ Refund=Refund
SocialContributionsPayments=Social/fiscal taxes payments
ShowVatPayment=Show VAT payment
TotalToPay=Total to pay
BalanceVisibilityDependsOnSortAndFilters=Balance is visible in this list only if table is sorted ascending on %s and filtered for 1 bank account
BalanceVisibilityDependsOnSortAndFilters=Balance is visible in this list only if table is sorted on %s and filtered for 1 bank account
CustomerAccountancyCode=Customer accounting code
SupplierAccountancyCode=Vendor accounting code
CustomerAccountancyCodeShort=Cust. account. code

View File

@ -477,12 +477,12 @@ if ($action == 'charge' && ! empty($conf->stripe->enabled))
'amount' => price2num($amountstripe, 'MU'),
'currency' => $currency,
'capture' => true, // Charge immediatly
'description' => 'Stripe payment: '.$FULLTAG,
'description' => 'Stripe payment: '.$FULLTAG.' ref='.$ref,
'metadata' => $metadata,
'customer' => $customer->id,
'source' => $card,
'statement_descriptor' => dol_trunc(dol_trunc(dol_string_unaccent($mysoc->name), 6, 'right', 'UTF-8', 1).' '.$FULLTAG, 22, 'right', 'UTF-8', 1) // 22 chars that appears on bank receipt
),array("idempotency_key" => "$ref","stripe_account" => "$stripeacc"));
),array("idempotency_key" => "$ref", "stripe_account" => "$stripeacc"));
// Return $charge = array('id'=>'ch_XXXX', 'status'=>'succeeded|pending|failed', 'failure_code'=>, 'failure_message'=>...)
if (empty($charge))
{
@ -517,10 +517,10 @@ if ($action == 'charge' && ! empty($conf->stripe->enabled))
'amount' => price2num($amountstripe, 'MU'),
'currency' => $currency,
'capture' => true, // Charge immediatly
'description' => 'Stripe payment: '.$FULLTAG,
'description' => 'Stripe payment: '.$FULLTAG.' ref='.$ref,
'metadata' => $metadata,
'statement_descriptor' => dol_trunc(dol_trunc(dol_string_unaccent($mysoc->name), 6, 'right', 'UTF-8', 1).' '.$FULLTAG, 22, 'right', 'UTF-8', 1) // 22 chars that appears on bank receipt
),array("idempotency_key" => "$ref","stripe_account" => "$stripeacc"));
),array("idempotency_key" => "$ref", "stripe_account" => "$stripeacc"));
// Return $charge = array('id'=>'ch_XXXX', 'status'=>'succeeded|pending|failed', 'failure_code'=>, 'failure_message'=>...)
if (empty($charge))
{
@ -813,7 +813,7 @@ if ($source == 'order')
$amount=price2num($amount);
}
$fulltag='ORD='.$order->ref.'.CUS='.$order->thirdparty->id;
$fulltag='ORD='.$order->id.'.CUS='.$order->thirdparty->id;
//$fulltag.='.NAM='.strtr($order->thirdparty->name,"-"," ");
if (! empty($TAG)) { $tag=$TAG; $fulltag.='.TAG='.$TAG; }
$fulltag=dol_string_unaccent($fulltag);
@ -933,7 +933,7 @@ if ($source == 'invoice')
$amount=price2num($amount);
}
$fulltag='INV='.$invoice->ref.'.CUS='.$invoice->thirdparty->id;
$fulltag='INV='.$invoice->id.'.CUS='.$invoice->thirdparty->id;
//$fulltag.='.NAM='.strtr($invoice->thirdparty->name,"-"," ");
if (! empty($TAG)) { $tag=$TAG; $fulltag.='.TAG='.$TAG; }
$fulltag=dol_string_unaccent($fulltag);
@ -1115,7 +1115,7 @@ if ($source == 'contractline')
$amount=price2num($amount);
}
$fulltag='COL='.$contractline->ref.'.CON='.$contract->ref.'.CUS='.$contract->thirdparty->id.'.DAT='.dol_print_date(dol_now(),'%Y%m%d%H%M');
$fulltag='COL='.$contractline->id.'.CON='.$contract->id.'.CUS='.$contract->thirdparty->id.'.DAT='.dol_print_date(dol_now(),'%Y%m%d%H%M');
//$fulltag.='.NAM='.strtr($contract->thirdparty->name,"-"," ");
if (! empty($TAG)) { $tag=$TAG; $fulltag.='.TAG='.$TAG; }
$fulltag=dol_string_unaccent($fulltag);

View File

@ -313,7 +313,7 @@ if ($ispaymentok)
$adht = new AdherentType($db);
$object = new Adherent($db);
$result1 = $object->fetch(0, $tmptag['MEM']);
$result1 = $object->fetch($tmptag['MEM']);
$result2 = $adht->fetch($object->typeid);
if ($result1 > 0 && $result2 > 0)
@ -588,7 +588,7 @@ if ($ispaymentok)
// Record payment
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
$invoice = new Facture($db);
$result = $invoice->fetch(0, $tmptag['INV']);
$result = $invoice->fetch($tmptag['INV']);
if ($result)
{
$FinalPaymentAmt = $_SESSION["FinalPaymentAmt"];
@ -776,9 +776,9 @@ if ($ispaymentok)
}
elseif (in_array('INV', array_keys($tmptag)))
{
$url=$urlwithroot."/compta/facture/card.php?ref=".$tmptag['INV'];
$url=$urlwithroot."/compta/facture/card.php?id=".$tmptag['INV'];
$content.='<strong>'.$companylangs->trans("Payment")."</strong><br><br>\n";
$content.=$companylangs->trans("Invoice").': <strong>'.$tmptag['INV']."</strong><br>\n";
$content.=$companylangs->trans("InvoiceId").': <strong>'.$tmptag['INV']."</strong><br>\n";
//$content.=$companylangs->trans("ThirdPartyId").': '.$tmptag['CUS']."<br>\n";
$content.=$companylangs->trans("Link").': <a href="'.$url.'">'.$url.'</a>'."<br>\n";
}