Merge branch '10.0' of git@github.com:Dolibarr/dolibarr.git into develop
Conflicts: htdocs/langs/en_US/admin.lang
This commit is contained in:
commit
d7a41c6b72
@ -32,7 +32,7 @@ PSR/simple-cache ? Library for cache (used by PHPSp
|
||||
Restler 3.0.0RC6 LGPL-3+ Yes Library to develop REST Web services (+ swagger-ui js lib into dir explorer)
|
||||
Sabre 3.2.2 BSD Yes DAV support
|
||||
Swift Mailer 5.4.2-DEV MIT license Yes Comprehensive mailing tools for PHP
|
||||
Stripe 6.35 MIT licence Yes Library for Stripe module
|
||||
Stripe 6.41 MIT licence Yes Library for Stripe module
|
||||
TCPDF 6.2.25 LGPL-3+ Yes PDF generation
|
||||
TCPDI 1.0.0 LGPL-3+ / Apache 2.0 Yes FPDI replacement
|
||||
|
||||
|
||||
@ -182,7 +182,7 @@ if ($result > 0)
|
||||
if (empty($dn))
|
||||
{
|
||||
$langs->load("errors");
|
||||
print '<tr '.$bc[false].'><td colspan="2"><font class="error">'.$langs->trans("ErrorModuleSetupNotComplete").'</font></td></tr>';
|
||||
print '<tr '.$bc[false].'><td colspan="2"><font class="error">'.$langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("Member")).'</font></td></tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -37,12 +37,12 @@ $action = GETPOST('action', 'aZ09');
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
|
||||
if ($action == 'setvalue' && $user->admin)
|
||||
{
|
||||
$result=dolibarr_set_const($db, "CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS", GETPOST("CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS"), 'chaine', 0, '', $conf->entity);
|
||||
$result=dolibarr_set_const($db, "CLICKTODIAL_URL", GETPOST("CLICKTODIAL_URL"), 'chaine', 0, '', $conf->entity);
|
||||
|
||||
$result1=dolibarr_set_const($db, "CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS", GETPOST("CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS"), 'chaine', 0, '', $conf->entity);
|
||||
$result2=dolibarr_set_const($db, "CLICKTODIAL_URL", GETPOST("CLICKTODIAL_URL"), 'chaine', 0, '', $conf->entity);
|
||||
|
||||
if ($result1 >= 0 && $result2 >= 0)
|
||||
{
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
|
||||
@ -79,16 +79,6 @@ if (! empty($conf->stock->enabled) && empty($conf->global->CASHDESK_NO_DECREASE_
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
if (! empty($_POST['txtUsername']) && ! empty($conf->banque->enabled) && (empty($conf_fkaccount_cash) && empty($conf_fkaccount_cheque) && empty($conf_fkaccount_cb)))
|
||||
{
|
||||
$langs->load("errors");
|
||||
$retour=$langs->trans("ErrorModuleSetupNotComplete");
|
||||
header('Location: '.DOL_URL_ROOT.'/cashdesk/index.php?err='.urlencode($retour).'&user='.$username.'&socid='.$thirdpartyid.'&warehouseid='.$warehouseid);
|
||||
exit;
|
||||
}
|
||||
*/
|
||||
|
||||
// Check password
|
||||
$auth = new Auth($db);
|
||||
$retour = $auth->verif($username, $password);
|
||||
|
||||
@ -165,7 +165,7 @@ $langs->loadLangs(array("main","bills","cashdesk"));
|
||||
if (empty($_SESSION['CASHDESK_ID_BANKACCOUNT_CASH']) || $_SESSION['CASHDESK_ID_BANKACCOUNT_CASH'] < 0)
|
||||
{
|
||||
$langs->load("errors");
|
||||
print '<input class="bouton_mode_reglement_disabled" type="button" name="btnModeReglement" value="'.$langs->trans("Cash").'" title="'.dol_escape_htmltag($langs->trans("ErrorModuleSetupNotComplete")).'" />';
|
||||
print '<input class="bouton_mode_reglement_disabled" type="button" name="btnModeReglement" value="'.$langs->trans("Cash").'" title="'.dol_escape_htmltag($langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("CashDesk"))).'" />';
|
||||
}
|
||||
else print '<input class="button bouton_mode_reglement" type="submit" name="btnModeReglement" value="'.$langs->trans("Cash").'" onclick="javascript: verifClic(\'ESP\');" />';
|
||||
print '</div>';
|
||||
@ -173,7 +173,7 @@ $langs->loadLangs(array("main","bills","cashdesk"));
|
||||
if (empty($_SESSION['CASHDESK_ID_BANKACCOUNT_CB']) || $_SESSION['CASHDESK_ID_BANKACCOUNT_CB'] < 0)
|
||||
{
|
||||
$langs->load("errors");
|
||||
print '<input class="bouton_mode_reglement_disabled" type="button" name="btnModeReglement" value="'.$langs->trans("CreditCard").'" title="'.dol_escape_htmltag($langs->trans("ErrorModuleSetupNotComplete")).'" />';
|
||||
print '<input class="bouton_mode_reglement_disabled" type="button" name="btnModeReglement" value="'.$langs->trans("CreditCard").'" title="'.dol_escape_htmltag($langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("CashDesk"))).'" />';
|
||||
}
|
||||
else print '<input class="button bouton_mode_reglement" type="submit" name="btnModeReglement" value="'.$langs->trans("CreditCard").'" onclick="javascript: verifClic(\'CB\');" />';
|
||||
print '</div>';
|
||||
@ -181,7 +181,7 @@ $langs->loadLangs(array("main","bills","cashdesk"));
|
||||
if (empty($_SESSION['CASHDESK_ID_BANKACCOUNT_CHEQUE']) || $_SESSION['CASHDESK_ID_BANKACCOUNT_CHEQUE'] < 0)
|
||||
{
|
||||
$langs->load("errors");
|
||||
print '<input class="bouton_mode_reglement_disabled" type="button" name="btnModeReglement" value="'.$langs->trans("CheckBank").'" title="'.dol_escape_htmltag($langs->trans("ErrorModuleSetupNotComplete")).'" />';
|
||||
print '<input class="bouton_mode_reglement_disabled" type="button" name="btnModeReglement" value="'.$langs->trans("CheckBank").'" title="'.dol_escape_htmltag($langs->trans("ErrorModuleSetupNotComplete"), $langs->transnoentitiesnoconv("CashDesk")).'" />';
|
||||
}
|
||||
else print '<input class="button bouton_mode_reglement" type="submit" name="btnModeReglement" value="'.$langs->trans("CheckBank").'" onclick="javascript: verifClic(\'CHQ\');" />';
|
||||
print '</div>';
|
||||
|
||||
@ -168,287 +168,8 @@ if ($action != 'preview' && $action != 'editcontent') $style=' margin-bottom: 5p
|
||||
//var_dump($objectpage);exit;
|
||||
print '<div class="centpercent websitebar">';
|
||||
|
||||
if (count($object->records) > 0)
|
||||
{
|
||||
// ***** Part for web sites
|
||||
|
||||
print '<div class="websiteselection hideonsmartphoneimp">';
|
||||
print $langs->trans("WebSite").': ';
|
||||
print '</div>';
|
||||
|
||||
// List of websites
|
||||
print '<div class="websiteselection">';
|
||||
$out='';
|
||||
$out.='<select name="website" class="minwidth100" id="website">';
|
||||
if (empty($object->records)) $out.='<option value="-1"> </option>';
|
||||
// Loop on each sites
|
||||
$i=0;
|
||||
foreach($object->records as $key => $valwebsite)
|
||||
{
|
||||
if (empty($website)) $website=$valwebsite->ref;
|
||||
|
||||
$out.='<option value="'.$valwebsite->ref.'"';
|
||||
if ($website == $valwebsite->ref) $out.=' selected'; // To preselect a value
|
||||
$out.='>';
|
||||
$out.=$valwebsite->ref;
|
||||
$out.='</option>';
|
||||
$i++;
|
||||
}
|
||||
$out.='</select>';
|
||||
$out.=ajax_combobox('website');
|
||||
print $out;
|
||||
print '<input type="submit" class="button" name="refreshsite" value="'.$langs->trans("Load").'">';
|
||||
|
||||
if ($website)
|
||||
{
|
||||
$virtualurl='';
|
||||
$dataroot=DOL_DATA_ROOT.'/collab/'.$website;
|
||||
if (! empty($object->virtualhost)) $virtualurl=$object->virtualhost;
|
||||
}
|
||||
|
||||
if ($website && $action == 'preview')
|
||||
{
|
||||
$disabled='';
|
||||
if (empty($user->rights->websites->write)) $disabled=' disabled="disabled"';
|
||||
|
||||
print ' ';
|
||||
|
||||
//print '<input type="submit" class="button"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("MediaFiles")).'" name="editmedia">';
|
||||
print '<input type="submit" class="button"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("EditCss")).'" name="editcss">';
|
||||
print '<input type="submit" class="button"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("EditMenu")).'" name="editmenu">';
|
||||
print '<input type="submit"'.$disabled.' class="button" value="'.dol_escape_htmltag($langs->trans("AddPage")).'" name="create">';
|
||||
}
|
||||
|
||||
print '</div>';
|
||||
|
||||
// Button for websites
|
||||
print '<div class="websitetools">';
|
||||
|
||||
if ($action == 'preview')
|
||||
{
|
||||
print '<div class="websiteinputurl">';
|
||||
print '<input type="text" id="previewsiteurl" class="minwidth200imp" name="previewsite" placeholder="'.$langs->trans("http://myvirtualhost").'" value="'.$virtualurl.'">';
|
||||
//print '<input type="submit" class="button" name="previewwebsite" target="tab'.$website.'" value="'.$langs->trans("ViewSiteInNewTab").'">';
|
||||
$htmltext=$langs->trans("SetHereVirtualHost", $dataroot);
|
||||
print $form->textwithpicto('', $htmltext);
|
||||
print '</div>';
|
||||
|
||||
$urlext=$virtualurl;
|
||||
$urlint=$urlwithroot.'/public/collab/index.php?website='.$website;
|
||||
//if (! empty($object->virtualhost))
|
||||
//{
|
||||
print '<a class="websitebuttonsitepreview" id="previewsiteext" href="'.$urlext.'" target="tab'.$website.'" alt="'.dol_escape_htmltag($langs->trans("PreviewSiteServedByWebServer", $langs->transnoentitiesnoconv("Site"), $langs->transnoentitiesnoconv("Site"), $dataroot, $urlext)).'">';
|
||||
print $form->textwithpicto('', $langs->trans("PreviewSiteServedByWebServer", $langs->transnoentitiesnoconv("Site"), $langs->transnoentitiesnoconv("Site"), $dataroot, $urlext?$urlext:$langs->trans("VirtualHostUrlNotDefined")), 1, 'preview_ext');
|
||||
print '</a>';
|
||||
//}
|
||||
|
||||
print '<a class="websitebuttonsitepreview" id="previewsite" href="'.$urlwithroot.'/public/collab/index.php?website='.$website.'" target="tab'.$website.'" alt="'.dol_escape_htmltag($langs->trans("PreviewSiteServedByDolibarr", $langs->transnoentitiesnoconv("Site"), $langs->transnoentitiesnoconv("Site"), $urlint)).'">';
|
||||
print $form->textwithpicto('', $langs->trans("PreviewSiteServedByDolibarr", $langs->transnoentitiesnoconv("Site"), $langs->transnoentitiesnoconv("Site"), $urlint, $dataroot), 1, 'preview');
|
||||
print '</a>';
|
||||
}
|
||||
|
||||
if (in_array($action, array('editcss','editmenu','create')))
|
||||
{
|
||||
if ($action != 'preview') print '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Cancel")).'" name="preview">';
|
||||
if (preg_match('/^create/', $action)) print '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Save")).'" name="update">';
|
||||
if (preg_match('/^edit/', $action)) print '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Save")).'" name="update">';
|
||||
}
|
||||
|
||||
print '</div>';
|
||||
|
||||
|
||||
// ***** Part for pages
|
||||
|
||||
if ($website)
|
||||
{
|
||||
print '</div>';
|
||||
|
||||
$array=$objectpage->fetchAll($object->id);
|
||||
if (! is_array($array) && $array < 0) dol_print_error('', $objectpage->error, $objectpage->errors);
|
||||
$atleastonepage=(is_array($array) && count($array) > 0);
|
||||
|
||||
print '<div class="centpercent websitebar"'.($style?' style="'.$style.'"':'').'">';
|
||||
print '<div class="websiteselection hideonsmartphoneimp">';
|
||||
print $langs->trans("Page").': ';
|
||||
print '</div>';
|
||||
print '<div class="websiteselection">';
|
||||
|
||||
if ($action != 'add')
|
||||
{
|
||||
$out='';
|
||||
$out.='<select name="pageid" id="pageid" class="minwidth200">';
|
||||
if ($atleastonepage)
|
||||
{
|
||||
if (empty($pageid) && $action != 'create') // Page id is not defined, we try to take one
|
||||
{
|
||||
$firstpageid=0;$homepageid=0;
|
||||
foreach($array as $key => $valpage)
|
||||
{
|
||||
if (empty($firstpageid)) $firstpageid=$valpage->id;
|
||||
if ($object->fk_default_home && $key == $object->fk_default_home) $homepageid=$valpage->id;
|
||||
}
|
||||
$pageid=$homepageid?$homepageid:$firstpageid; // We choose home page and if not defined yet, we take first page
|
||||
}
|
||||
|
||||
foreach($array as $key => $valpage)
|
||||
{
|
||||
$out.='<option value="'.$key.'"';
|
||||
if ($pageid > 0 && $pageid == $key) $out.=' selected'; // To preselect a value
|
||||
$out.='>';
|
||||
$out.=$valpage->title;
|
||||
if ($object->fk_default_home && $key == $object->fk_default_home) $out.=' ('.$langs->trans("HomePage").')';
|
||||
$out.='</option>';
|
||||
}
|
||||
}
|
||||
else $out.='<option value="-1"> </option>';
|
||||
$out.='</select>';
|
||||
$out.=ajax_combobox('pageid');
|
||||
print $out;
|
||||
}
|
||||
else
|
||||
{
|
||||
print $langs->trans("New");
|
||||
}
|
||||
|
||||
print '<input type="submit" class="button" name="refreshpage" value="'.$langs->trans("Load").'"'.($atleastonepage?'':' disabled="disabled"').'>';
|
||||
//print $form->selectarray('page', $array);
|
||||
|
||||
if ($action == 'preview')
|
||||
{
|
||||
$disabled='';
|
||||
if (empty($user->rights->websites->write)) $disabled=' disabled="disabled"';
|
||||
|
||||
if ($pageid > 0)
|
||||
{
|
||||
print ' ';
|
||||
|
||||
if ($object->fk_default_home > 0 && $pageid == $object->fk_default_home) print '<input type="submit" class="button" disabled="disabled" value="'.dol_escape_htmltag($langs->trans("SetAsHomePage")).'" name="setashome">';
|
||||
else print '<input type="submit" class="button"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("SetAsHomePage")).'" name="setashome">';
|
||||
print '<input type="submit" class="button"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("EditPageMeta")).'" name="editmeta">';
|
||||
print '<input type="submit" class="button"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("EditPageContent")).'" name="editcontent">';
|
||||
//print '<a href="'.$_SERVER["PHP_SELF"].'?action=editmeta&website='.urlencode($website).'&pageid='.urlencode($pageid).'" class="button">'.dol_escape_htmltag($langs->trans("EditPageMeta")).'</a>';
|
||||
//print '<a href="'.$_SERVER["PHP_SELF"].'?action=editcontent&website='.urlencode($website).'&pageid='.urlencode($pageid).'" class="button">'.dol_escape_htmltag($langs->trans("EditPageContent")).'</a>';
|
||||
print '<input type="submit" class="buttonDelete" name="delete" value="'.$langs->trans("Delete").'"'.($atleastonepage?'':' disabled="disabled"').'>';
|
||||
}
|
||||
}
|
||||
|
||||
print '</div>';
|
||||
print '<div class="websiteselection">';
|
||||
print '</div>';
|
||||
|
||||
print '<div class="websitetools">';
|
||||
|
||||
if ($website && $pageid > 0 && $action == 'preview')
|
||||
{
|
||||
$websitepage = new WebSitePage($db);
|
||||
$websitepage->fetch($pageid);
|
||||
|
||||
$realpage=$urlwithroot.'/public/collab/index.php?website='.$website.'&page='.$pageid;
|
||||
$pagealias = $websitepage->pageurl;
|
||||
|
||||
print '<div class="websiteinputurl">';
|
||||
print '<input type="text" id="previewpageurl" class="minwidth200imp" name="previewsite" value="'.$pagealias.'" disabled="disabled">';
|
||||
//print '<input type="submit" class="button" name="previewwebsite" target="tab'.$website.'" value="'.$langs->trans("ViewSiteInNewTab").'">';
|
||||
$htmltext=$langs->trans("WEBSITE_PAGENAME", $pagealias);
|
||||
print $form->textwithpicto('', $htmltext);
|
||||
print '</div>';
|
||||
|
||||
if (! empty($object->virtualhost))
|
||||
{
|
||||
$urlext=$virtualurl.'/'.$pagealias.'.php';
|
||||
print '<a class="websitebuttonsitepreview" id="previewpageext" href="'.$urlext.'" target="tab'.$website.'" alt="'.dol_escape_htmltag($langs->trans("PreviewSiteServedByWebServer", $langs->transnoentitiesnoconv("Page"), $langs->transnoentitiesnoconv("Page"), $dataroot, $urlext)).'">';
|
||||
print $form->textwithpicto('', $langs->trans("PreviewSiteServedByWebServer", $langs->transnoentitiesnoconv("Page"), $langs->transnoentitiesnoconv("Page"), $dataroot, $urlext?$urlext:$langs->trans("VirtualHostUrlNotDefined")), 1, 'preview_ext');
|
||||
print '</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a class="websitebuttonsitepreview" id="previewpageextnoclick" href="#">';
|
||||
print $form->textwithpicto('', $langs->trans("PreviewSiteServedByWebServer", $langs->transnoentitiesnoconv("Page"), $langs->transnoentitiesnoconv("Page"), $dataroot, $urlext?$urlext:$langs->trans("VirtualHostUrlNotDefined")), 1, 'preview_ext');
|
||||
print '</a>';
|
||||
}
|
||||
|
||||
print '<a class="websitebuttonsitepreview" id="previewpage" href="'.$realpage.'&nocache='.dol_now().'" class="button" target="tab'.$website.'" alt="'.dol_escape_htmltag($langs->trans("PreviewSiteServedByDolibarr", $langs->transnoentitiesnoconv("Page"), $langs->transnoentitiesnoconv("Page"), $realpage)).'">';
|
||||
print $form->textwithpicto('', $langs->trans("PreviewSiteServedByDolibarr", $langs->transnoentitiesnoconv("Page"), $langs->transnoentitiesnoconv("Page"), $realpage, $dataroot), 1, 'preview');
|
||||
print '</a>'; // View page in new Tab
|
||||
//print '<input type="submit" class="button" name="previewpage" target="tab'.$website.'"value="'.$langs->trans("ViewPageInNewTab").'">';
|
||||
|
||||
// TODO Add js to save alias like we save virtual host name and use dynamic virtual host for url of id=previewpageext
|
||||
}
|
||||
if (! in_array($action, array('editcss','editmenu','create')))
|
||||
{
|
||||
if ($action != 'preview') print '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Cancel")).'" name="preview">';
|
||||
if (preg_match('/^create/', $action)) print '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Save")).'" name="update">';
|
||||
if (preg_match('/^edit/', $action)) print '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Save")).'" name="update">';
|
||||
}
|
||||
|
||||
print '</div>';
|
||||
|
||||
if ($action == 'preview')
|
||||
{
|
||||
// Adding jquery code to change on the fly url of preview ext
|
||||
if (! empty($conf->use_javascript_ajax))
|
||||
{
|
||||
print '<script type="text/javascript" language="javascript">
|
||||
jQuery(document).ready(function() {
|
||||
jQuery("#previewsiteext,#previewpageext").click(function() {
|
||||
newurl=jQuery("#previewsiteurl").val();
|
||||
newpage=jQuery("#previewsiteurl").val() + "/" + jQuery("#previewpageurl").val() + ".php";
|
||||
console.log("Open url "+newurl);
|
||||
/* Save url */
|
||||
jQuery.ajax({
|
||||
method: "POST",
|
||||
url: "'.DOL_URL_ROOT.'/core/ajax/saveinplace.php",
|
||||
data: {
|
||||
field: \'editval_virtualhost\',
|
||||
element: \'websites\',
|
||||
table_element: \'website\',
|
||||
fk_element: '.$object->id.',
|
||||
value: newurl,
|
||||
},
|
||||
context: document.body
|
||||
});
|
||||
|
||||
jQuery("#previewsiteext").attr("href",newurl);
|
||||
jQuery("#previewpageext").attr("href",newpage);
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<div class="websiteselection">';
|
||||
$langs->load("errors");
|
||||
print $langs->trans("ErrorModuleSetupNotComplete");
|
||||
print '<div>';
|
||||
$action='';
|
||||
}
|
||||
|
||||
|
||||
print '</div>';
|
||||
|
||||
$head = array();
|
||||
|
||||
if ($action == 'editcontent')
|
||||
{
|
||||
/*
|
||||
* Editing global variables not related to a specific theme
|
||||
*/
|
||||
|
||||
$csscontent = @file_get_contents($filecss);
|
||||
|
||||
$contentforedit = '';
|
||||
/*$contentforedit.='<style scoped>'."\n"; // "scoped" means "apply to parent element only". Not yet supported by browsers
|
||||
$contentforedit.=$csscontent;
|
||||
$contentforedit.='</style>'."\n";*/
|
||||
$contentforedit .= $objectpage->content;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor=new DolEditor('PAGE_CONTENT', $contentforedit, '', 500, 'Full', '', true, true, true, ROWS_5, '90%');
|
||||
$doleditor->Create(0, '', false);
|
||||
}
|
||||
|
||||
print "</div>\n</form>\n";
|
||||
|
||||
|
||||
@ -3516,7 +3516,7 @@ class Propal extends CommonObject
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
print $langs->trans("Error")." ".$langs->trans("ErrorModuleSetupNotComplete");
|
||||
print $langs->trans("Error")." ".$langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("Proposal"));
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
@ -2591,7 +2591,7 @@ if ($action == 'create' && $user->rights->commande->creer)
|
||||
}
|
||||
} else {
|
||||
$langs->load("errors");
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="' . dol_escape_htmltag($langs->trans("ErrorModuleSetupNotComplete")) . '">' . $langs->trans('CreateShipment') . '</a></div>';
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="' . dol_escape_htmltag($langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("Shipment"))) . '">' . $langs->trans('CreateShipment') . '</a></div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -3495,7 +3495,7 @@ class Facture extends CommonInvoice
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
print $langs->trans("Error")." ".$langs->trans("ErrorModuleSetupNotComplete");
|
||||
print $langs->trans("Error")." ".$langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("Invoice"));
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
@ -489,7 +489,7 @@ class RemiseCheque extends CommonObject
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
print $langs->trans("Error")." ".$langs->trans("ErrorModuleSetupNotComplete");
|
||||
print $langs->trans("Error")." ".$langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("Bank"));
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
@ -1141,7 +1141,7 @@ class Paiement extends CommonObject
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
print $langs->trans("Error")." ".$langs->trans("ErrorModuleSetupNotComplete");
|
||||
print $langs->trans("Error")." ".$langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("Invoice"));
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
@ -78,7 +78,7 @@ if (empty($reshook))
|
||||
// $conf->global->PRELEVEMENT_CODE_BANQUE and $conf->global->PRELEVEMENT_CODE_GUICHET should be empty
|
||||
$bprev = new BonPrelevement($db);
|
||||
$executiondate = dol_mktime(0, 0, 0, GETPOST('remonth'), (GETPOST('reday')+$conf->global->PRELEVEMENT_ADDDAYS), GETPOST('reyear'));
|
||||
|
||||
|
||||
$result = $bprev->create($conf->global->PRELEVEMENT_CODE_BANQUE, $conf->global->PRELEVEMENT_CODE_GUICHET, $mode, $format, $executiondate);
|
||||
if ($result < 0)
|
||||
{
|
||||
@ -116,7 +116,7 @@ llxHeader('', $langs->trans("NewStandingOrder"));
|
||||
if (prelevement_check_config() < 0)
|
||||
{
|
||||
$langs->load("errors");
|
||||
setEventMessages($langs->trans("ErrorModuleSetupNotComplete"), null, 'errors');
|
||||
setEventMessages($langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("Withdraw")), null, 'errors');
|
||||
}
|
||||
|
||||
/*$h=0;
|
||||
|
||||
@ -58,7 +58,7 @@ llxHeader('', $langs->trans("CustomersStandingOrdersArea"));
|
||||
if (prelevement_check_config() < 0)
|
||||
{
|
||||
$langs->load("errors");
|
||||
setEventMessages($langs->trans("ErrorModuleSetupNotComplete"), null, 'errors');
|
||||
setEventMessages($langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("Withdraw")), null, 'errors');
|
||||
}
|
||||
|
||||
print load_fiche_titre($langs->trans("CustomersStandingOrdersArea"));
|
||||
|
||||
@ -38,7 +38,7 @@ $id = GETPOST('id', 'int');
|
||||
$result = restrictedArea($user, 'contact', $id, 'socpeople&societe');
|
||||
$object = new Contact($db);
|
||||
if ($id > 0) $object->fetch($id);
|
||||
if(empty($object->thirdparty)) $object->fetch_thirdparty();
|
||||
if (empty($object->thirdparty)) $object->fetch_thirdparty();
|
||||
$socid = $object->thirdparty->id;
|
||||
|
||||
// Sort & Order fields
|
||||
@ -69,7 +69,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
|
||||
}
|
||||
// Customer or supplier selected in drop box
|
||||
$thirdTypeSelect = GETPOST("third_select_id");
|
||||
$type_element = GETPOST('type_element')?GETPOST('type_element'):'';
|
||||
$type_element = GETPOSTISSET('type_element')?GETPOST('type_element'):'';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("companies", "bills", "orders", "suppliers", "propal", "interventions", "contracts", "products"));
|
||||
@ -173,13 +173,13 @@ if ($type_element == 'fichinter')
|
||||
$sql_select = 'SELECT f.rowid as doc_id, f.ref as doc_number, \'1\' as doc_type, f.datec as dateprint, f.fk_statut as status, tc.libelle, ';
|
||||
$tables_from = MAIN_DB_PREFIX.'fichinterdet d';
|
||||
$tables_from.= ' LEFT JOIN '.MAIN_DB_PREFIX.'fichinter as f ON d.fk_fichinter=f.rowid';
|
||||
$tables_from.= ' INNER JOIN '.MAIN_DB_PREFIX.'element_contact ec ON ec.element_id=f.rowid';
|
||||
$tables_from.= ' INNER JOIN '.MAIN_DB_PREFIX.'element_contact ec ON ec.element_id=f.rowid AND ec.fk_socpeople='.$object->id;
|
||||
$tables_from.= ' INNER JOIN '.MAIN_DB_PREFIX."c_type_contact tc ON (ec.fk_c_type_contact=tc.rowid and tc.element='fichinter' and tc.source='external' and tc.active=1)";
|
||||
$where = ' WHERE f.entity IN ('.getEntity('ficheinter').')';
|
||||
$dateprint = 'f.datec';
|
||||
$doc_number='f.ref';
|
||||
}
|
||||
if ($type_element == 'invoice')
|
||||
elseif ($type_element == 'invoice')
|
||||
{ // Customer : show products from invoices
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
$documentstatic=new Facture($db);
|
||||
@ -187,14 +187,14 @@ if ($type_element == 'invoice')
|
||||
$tables_from = MAIN_DB_PREFIX.'facturedet d';
|
||||
$tables_from.= ' LEFT JOIN '.MAIN_DB_PREFIX.'facture as f ON d.fk_facture=f.rowid';
|
||||
$tables_from.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product p ON d.fk_product=p.rowid';
|
||||
$tables_from.= ' INNER JOIN '.MAIN_DB_PREFIX.'element_contact ec ON ec.element_id=f.rowid';
|
||||
$tables_from.= ' INNER JOIN '.MAIN_DB_PREFIX.'element_contact ec ON ec.element_id=f.rowid AND ec.fk_socpeople='.$object->id;
|
||||
$tables_from.= ' INNER JOIN '.MAIN_DB_PREFIX."c_type_contact tc ON (ec.fk_c_type_contact=tc.rowid and tc.element='facture' and tc.source='external' and tc.active=1)";
|
||||
$where = " WHERE f.entity IN (".getEntity('invoice').")";
|
||||
$dateprint = 'f.datef';
|
||||
$doc_number='f.ref';
|
||||
$thirdTypeSelect='customer';
|
||||
}
|
||||
if ($type_element == 'propal')
|
||||
elseif ($type_element == 'propal')
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
|
||||
$documentstatic=new Propal($db);
|
||||
@ -202,14 +202,14 @@ if ($type_element == 'propal')
|
||||
$tables_from = MAIN_DB_PREFIX.'propaldet d';
|
||||
$tables_from.= ' LEFT JOIN '.MAIN_DB_PREFIX.'propal as c ON d.fk_propal=c.rowid';
|
||||
$tables_from.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product p ON d.fk_product=p.rowid';
|
||||
$tables_from.= ' INNER JOIN '.MAIN_DB_PREFIX.'element_contact ec ON ec.element_id=c.rowid';
|
||||
$tables_from.= ' INNER JOIN '.MAIN_DB_PREFIX.'element_contact ec ON ec.element_id=c.rowid AND ec.fk_socpeople='.$object->id;
|
||||
$tables_from.= ' INNER JOIN '.MAIN_DB_PREFIX."c_type_contact tc ON (ec.fk_c_type_contact=tc.rowid and tc.element='propal' and tc.source='external' and tc.active=1)";
|
||||
$where = ' WHERE c.entity IN ('.getEntity('propal').')';
|
||||
$datePrint = 'c.datep';
|
||||
$doc_number='c.ref';
|
||||
$thirdTypeSelect='customer';
|
||||
}
|
||||
if ($type_element == 'order')
|
||||
elseif ($type_element == 'order')
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
|
||||
$documentstatic=new Commande($db);
|
||||
@ -217,14 +217,14 @@ if ($type_element == 'order')
|
||||
$tables_from = MAIN_DB_PREFIX.'commandedet d';
|
||||
$tables_from.= ' LEFT JOIN '.MAIN_DB_PREFIX.'commande as c ON d.fk_commande=c.rowid';
|
||||
$tables_from.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product p ON d.fk_product=p.rowid';
|
||||
$tables_from.= ' INNER JOIN '.MAIN_DB_PREFIX.'element_contact ec ON ec.element_id=c.rowid';
|
||||
$tables_from.= ' INNER JOIN '.MAIN_DB_PREFIX.'element_contact ec ON ec.element_id=c.rowid AND ec.fk_socpeople='.$object->id;
|
||||
$tables_from.= ' INNER JOIN '.MAIN_DB_PREFIX."c_type_contact tc ON (ec.fk_c_type_contact=tc.rowid and tc.element='commande' and tc.source='external' and tc.active=1)";
|
||||
$where = ' WHERE c.entity IN ('.getEntity('order').')';
|
||||
$dateprint = 'c.date_commande';
|
||||
$doc_number='c.ref';
|
||||
$thirdTypeSelect='customer';
|
||||
}
|
||||
if ($type_element == 'supplier_invoice')
|
||||
elseif ($type_element == 'supplier_invoice')
|
||||
{ // Supplier : Show products from invoices.
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
||||
$documentstatic=new FactureFournisseur($db);
|
||||
@ -232,14 +232,14 @@ if ($type_element == 'supplier_invoice')
|
||||
$tables_from = MAIN_DB_PREFIX.'facture_fourn_det d';
|
||||
$tables_from.= ' LEFT JOIN '.MAIN_DB_PREFIX.'facture_fourn as f ON d.fk_facture_fourn=f.rowid';
|
||||
$tables_from.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product p ON d.fk_product=p.rowid';
|
||||
$tables_from.= ' INNER JOIN '.MAIN_DB_PREFIX.'element_contact ec ON ec.element_id=f.rowid';
|
||||
$tables_from.= ' INNER JOIN '.MAIN_DB_PREFIX.'element_contact ec ON ec.element_id=f.rowid AND ec.fk_socpeople='.$object->id;
|
||||
$tables_from.= ' INNER JOIN '.MAIN_DB_PREFIX."c_type_contact tc ON (ec.fk_c_type_contact=tc.rowid and tc.element='invoice_supplier' and tc.source='external' and tc.active=1)";
|
||||
$where = ' WHERE f.entity IN ('.getEntity($documentstatic->element).')';
|
||||
$dateprint = 'f.datef';
|
||||
$doc_number='f.ref';
|
||||
$thirdTypeSelect='supplier';
|
||||
}
|
||||
//if ($type_element == 'supplier_proposal')
|
||||
//elseif ($type_element == 'supplier_proposal')
|
||||
//{
|
||||
// require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php';
|
||||
// $documentstatic=new SupplierProposal($db);
|
||||
@ -252,7 +252,7 @@ if ($type_element == 'supplier_invoice')
|
||||
// $doc_number='c.ref';
|
||||
// $thirdTypeSelect='supplier';
|
||||
//}
|
||||
if ($type_element == 'supplier_order')
|
||||
elseif ($type_element == 'supplier_order')
|
||||
{ // Supplier : Show products from orders.
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
|
||||
$documentstatic=new CommandeFournisseur($db);
|
||||
@ -260,14 +260,14 @@ if ($type_element == 'supplier_order')
|
||||
$tables_from = MAIN_DB_PREFIX.'commande_fournisseurdet d';
|
||||
$tables_from.= ' LEFT JOIN '.MAIN_DB_PREFIX.'commande_fournisseur as c ON d.fk_commande=c.rowid';
|
||||
$tables_from.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product p ON d.fk_product=p.rowid';
|
||||
$tables_from.= ' INNER JOIN '.MAIN_DB_PREFIX.'element_contact ec ON ec.element_id=c.rowid';
|
||||
$tables_from.= ' INNER JOIN '.MAIN_DB_PREFIX.'element_contact ec ON ec.element_id=c.rowid AND ec.fk_socpeople='.$object->id;
|
||||
$tables_from.= ' INNER JOIN '.MAIN_DB_PREFIX."c_type_contact tc ON (ec.fk_c_type_contact=tc.rowid and tc.element='order_supplier' and tc.source='external' and tc.active=1)";
|
||||
$where = ' WHERE c.entity IN ('.getEntity($documentstatic->element).')';
|
||||
$dateprint = 'c.date_valid';
|
||||
$doc_number='c.ref';
|
||||
$thirdTypeSelect='supplier';
|
||||
}
|
||||
if ($type_element == 'contract')
|
||||
elseif ($type_element == 'contract')
|
||||
{ // Order
|
||||
require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
|
||||
$documentstatic=new Contrat($db);
|
||||
@ -276,7 +276,7 @@ if ($type_element == 'contract')
|
||||
$tables_from = MAIN_DB_PREFIX.'contratdet d';
|
||||
$tables_from.= ' LEFT JOIN '.MAIN_DB_PREFIX.'contrat as c ON d.fk_contrat=c.rowid';
|
||||
$tables_from.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product p ON d.fk_product=p.rowid';
|
||||
$tables_from.= ' INNER JOIN '.MAIN_DB_PREFIX.'element_contact ec ON ec.element_id=c.rowid';
|
||||
$tables_from.= ' INNER JOIN '.MAIN_DB_PREFIX.'element_contact ec ON ec.element_id=c.rowid AND ec.fk_socpeople='.$object->id;
|
||||
$tables_from.= ' INNER JOIN '.MAIN_DB_PREFIX."c_type_contact tc ON (ec.fk_c_type_contact=tc.rowid and tc.element='contrat' and tc.source='external' and tc.active=1)";
|
||||
$where = ' WHERE c.entity IN ('.getEntity('contrat').')';
|
||||
$dateprint = 'c.date_valid';
|
||||
|
||||
@ -245,7 +245,7 @@ class Contrat extends CommonObject
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
print $langs->trans("Error")." ".$langs->trans("ErrorModuleSetupNotComplete");
|
||||
print $langs->trans("Error")." ".$langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("Contract"));
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
@ -38,7 +38,8 @@ function takepos_prepare_head()
|
||||
$head[$h][2] = 'setup';
|
||||
$h++;
|
||||
|
||||
for ($i = 1; $i <= $conf->global->TAKEPOS_NUM_TERMINALS; $i++)
|
||||
$numterminals = max(1, $conf->global->TAKEPOS_NUM_TERMINALS);
|
||||
for ($i = 1; $i <= $numterminals; $i++)
|
||||
{
|
||||
$head[$h][0] = DOL_URL_ROOT.'/takepos/admin/terminal.php?terminal='.$i;
|
||||
$head[$h][1] = $langs->trans("Terminal"). " ".$i;
|
||||
|
||||
@ -701,7 +701,7 @@ class PaiementFourn extends Paiement
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
print $langs->trans("Error")." ".$langs->trans("ErrorModuleSetupNotComplete");
|
||||
print $langs->trans("Error")." ".$langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("Supplier"));
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,45 @@
|
||||
# Changelog
|
||||
|
||||
## 6.41.0 - 2019-07-31
|
||||
* [#683](https://github.com/stripe/stripe-php/pull/683) Move the List Balance History API to `/v1/balance_transactions`
|
||||
|
||||
## 6.40.0 - 2019-06-27
|
||||
* [#675](https://github.com/stripe/stripe-php/pull/675) Add support for `SetupIntent` resource and APIs
|
||||
|
||||
## 6.39.2 - 2019-06-26
|
||||
* [#676](https://github.com/stripe/stripe-php/pull/676) Fix exception message in `CustomerBalanceTransaction::update()`
|
||||
|
||||
## 6.39.1 - 2019-06-25
|
||||
* [#674](https://github.com/stripe/stripe-php/pull/674) Add new constants for `collection_method` on `Invoice`
|
||||
|
||||
## 6.39.0 - 2019-06-24
|
||||
* [#673](https://github.com/stripe/stripe-php/pull/673) Enable request latency telemetry by default
|
||||
|
||||
## 6.38.0 - 2019-06-17
|
||||
* [#649](https://github.com/stripe/stripe-php/pull/649) Add support for `CustomerBalanceTransaction` resource and APIs
|
||||
|
||||
## 6.37.2 - 2019-06-17
|
||||
* [#671](https://github.com/stripe/stripe-php/pull/671) Add new PHPDoc
|
||||
* [#672](https://github.com/stripe/stripe-php/pull/672) Add constants for `submit_type` on Checkout `Session`
|
||||
|
||||
## 6.37.1 - 2019-06-14
|
||||
* [#670](https://github.com/stripe/stripe-php/pull/670) Add new PHPDoc
|
||||
|
||||
## 6.37.0 - 2019-05-23
|
||||
* [#663](https://github.com/stripe/stripe-php/pull/663) Add support for `radar.early_fraud_warning` resource
|
||||
|
||||
## 6.36.0 - 2019-05-22
|
||||
* [#661](https://github.com/stripe/stripe-php/pull/661) Add constants for new TaxId types
|
||||
* [#662](https://github.com/stripe/stripe-php/pull/662) Add constants for BalanceTransaction types
|
||||
|
||||
## 6.35.2 - 2019-05-20
|
||||
* [#655](https://github.com/stripe/stripe-php/pull/655) Add constants for payment intent statuses
|
||||
* [#659](https://github.com/stripe/stripe-php/pull/659) Fix PHPDoc for various nested Account actions
|
||||
* [#660](https://github.com/stripe/stripe-php/pull/660) Fix various PHPDoc
|
||||
|
||||
## 6.35.1 - 2019-05-20
|
||||
* [#658](https://github.com/stripe/stripe-php/pull/658) Use absolute value when checking timestamp tolerance
|
||||
|
||||
## 6.35.0 - 2019-05-14
|
||||
* [#651](https://github.com/stripe/stripe-php/pull/651) Add support for the Capability resource and APIs
|
||||
|
||||
|
||||
@ -6,7 +6,11 @@
|
||||
[](https://packagist.org/packages/stripe/stripe-php)
|
||||
[](https://coveralls.io/r/stripe/stripe-php?branch=master)
|
||||
|
||||
You can sign up for a Stripe account at https://stripe.com.
|
||||
The Stripe PHP library provides convenient access to the Stripe API from
|
||||
applications written in the PHP language. It includes a pre-defined set of
|
||||
classes for API resources that initialize themselves dynamically from API
|
||||
responses which makes it compatible with a wide range of versions of the Stripe
|
||||
API.
|
||||
|
||||
## Requirements
|
||||
|
||||
@ -56,7 +60,7 @@ echo $charge;
|
||||
|
||||
## Documentation
|
||||
|
||||
Please see https://stripe.com/docs/api for up-to-date documentation.
|
||||
See the [PHP API docs](https://stripe.com/docs/api/php#intro).
|
||||
|
||||
## Legacy Version Support
|
||||
|
||||
@ -179,6 +183,17 @@ an intermittent network problem:
|
||||
[Idempotency keys][idempotency-keys] are added to requests to guarantee that
|
||||
retries are safe.
|
||||
|
||||
### Request latency telemetry
|
||||
|
||||
By default, the library sends request latency telemetry to Stripe. These
|
||||
numbers help Stripe improve the overall latency of its API for all users.
|
||||
|
||||
You can disable this behavior if you prefer:
|
||||
|
||||
```php
|
||||
\Stripe\Stripe::setEnableTelemetry(false);
|
||||
```
|
||||
|
||||
## Development
|
||||
|
||||
Get [Composer][composer]. For example, on Mac OS:
|
||||
|
||||
@ -1 +1 @@
|
||||
6.35.0
|
||||
6.41.0
|
||||
|
||||
@ -76,6 +76,7 @@ require(dirname(__FILE__) . '/lib/CountrySpec.php');
|
||||
require(dirname(__FILE__) . '/lib/Coupon.php');
|
||||
require(dirname(__FILE__) . '/lib/CreditNote.php');
|
||||
require(dirname(__FILE__) . '/lib/Customer.php');
|
||||
require(dirname(__FILE__) . '/lib/CustomerBalanceTransaction.php');
|
||||
require(dirname(__FILE__) . '/lib/Discount.php');
|
||||
require(dirname(__FILE__) . '/lib/Dispute.php');
|
||||
require(dirname(__FILE__) . '/lib/EphemeralKey.php');
|
||||
@ -104,6 +105,7 @@ require(dirname(__FILE__) . '/lib/Payout.php');
|
||||
require(dirname(__FILE__) . '/lib/Person.php');
|
||||
require(dirname(__FILE__) . '/lib/Plan.php');
|
||||
require(dirname(__FILE__) . '/lib/Product.php');
|
||||
require(dirname(__FILE__) . '/lib/Radar/EarlyFraudWarning.php');
|
||||
require(dirname(__FILE__) . '/lib/Radar/ValueList.php');
|
||||
require(dirname(__FILE__) . '/lib/Radar/ValueListItem.php');
|
||||
require(dirname(__FILE__) . '/lib/Recipient.php');
|
||||
@ -112,6 +114,7 @@ require(dirname(__FILE__) . '/lib/Refund.php');
|
||||
require(dirname(__FILE__) . '/lib/Reporting/ReportRun.php');
|
||||
require(dirname(__FILE__) . '/lib/Reporting/ReportType.php');
|
||||
require(dirname(__FILE__) . '/lib/Review.php');
|
||||
require(dirname(__FILE__) . '/lib/SetupIntent.php');
|
||||
require(dirname(__FILE__) . '/lib/SKU.php');
|
||||
require(dirname(__FILE__) . '/lib/Sigma/ScheduledQueryRun.php');
|
||||
require(dirname(__FILE__) . '/lib/Source.php');
|
||||
|
||||
@ -152,8 +152,8 @@ class Account extends ApiResource
|
||||
|
||||
|
||||
/**
|
||||
* @param string|null $id The ID of the account to which the capability belongs.
|
||||
* @param string|null $capabilityId The ID of the capability to retrieve.
|
||||
* @param string $id The ID of the account to which the capability belongs.
|
||||
* @param string $capabilityId The ID of the capability to retrieve.
|
||||
* @param array|null $params
|
||||
* @param array|string|null $opts
|
||||
*
|
||||
@ -165,8 +165,8 @@ class Account extends ApiResource
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|null $id The ID of the account to which the capability belongs.
|
||||
* @param string|null $capabilityId The ID of the capability to update.
|
||||
* @param string $id The ID of the account to which the capability belongs.
|
||||
* @param string $capabilityId The ID of the capability to update.
|
||||
* @param array|null $params
|
||||
* @param array|string|null $opts
|
||||
*
|
||||
@ -178,7 +178,7 @@ class Account extends ApiResource
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|null $id The ID of the account on which to retrieve the capabilities.
|
||||
* @param string $id The ID of the account on which to retrieve the capabilities.
|
||||
* @param array|null $params
|
||||
* @param array|string|null $opts
|
||||
*
|
||||
@ -190,7 +190,7 @@ class Account extends ApiResource
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|null $id The ID of the account on which to create the external account.
|
||||
* @param string $id The ID of the account on which to create the external account.
|
||||
* @param array|null $params
|
||||
* @param array|string|null $opts
|
||||
*
|
||||
@ -202,8 +202,8 @@ class Account extends ApiResource
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|null $id The ID of the account to which the external account belongs.
|
||||
* @param array|null $externalAccountId The ID of the external account to retrieve.
|
||||
* @param string $id The ID of the account to which the external account belongs.
|
||||
* @param string $externalAccountId The ID of the external account to retrieve.
|
||||
* @param array|null $params
|
||||
* @param array|string|null $opts
|
||||
*
|
||||
@ -215,8 +215,8 @@ class Account extends ApiResource
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|null $id The ID of the account to which the external account belongs.
|
||||
* @param array|null $externalAccountId The ID of the external account to update.
|
||||
* @param string $id The ID of the account to which the external account belongs.
|
||||
* @param string $externalAccountId The ID of the external account to update.
|
||||
* @param array|null $params
|
||||
* @param array|string|null $opts
|
||||
*
|
||||
@ -228,8 +228,8 @@ class Account extends ApiResource
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|null $id The ID of the account to which the external account belongs.
|
||||
* @param array|null $externalAccountId The ID of the external account to delete.
|
||||
* @param string $id The ID of the account to which the external account belongs.
|
||||
* @param string $externalAccountId The ID of the external account to delete.
|
||||
* @param array|null $params
|
||||
* @param array|string|null $opts
|
||||
*
|
||||
@ -241,7 +241,7 @@ class Account extends ApiResource
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|null $id The ID of the account on which to retrieve the external accounts.
|
||||
* @param string $id The ID of the account on which to retrieve the external accounts.
|
||||
* @param array|null $params
|
||||
* @param array|string|null $opts
|
||||
*
|
||||
@ -253,7 +253,7 @@ class Account extends ApiResource
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|null $id The ID of the account on which to create the login link.
|
||||
* @param string $id The ID of the account on which to create the login link.
|
||||
* @param array|null $params
|
||||
* @param array|string|null $opts
|
||||
*
|
||||
@ -280,7 +280,7 @@ class Account extends ApiResource
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|null $id The ID of the account on which to create the person.
|
||||
* @param string $id The ID of the account on which to create the person.
|
||||
* @param array|null $params
|
||||
* @param array|string|null $opts
|
||||
*
|
||||
@ -292,8 +292,8 @@ class Account extends ApiResource
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|null $id The ID of the account to which the person belongs.
|
||||
* @param string|null $personId The ID of the person to retrieve.
|
||||
* @param string $id The ID of the account to which the person belongs.
|
||||
* @param string $personId The ID of the person to retrieve.
|
||||
* @param array|null $params
|
||||
* @param array|string|null $opts
|
||||
*
|
||||
@ -305,8 +305,8 @@ class Account extends ApiResource
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|null $id The ID of the account to which the person belongs.
|
||||
* @param string|null $personId The ID of the person to update.
|
||||
* @param string $id The ID of the account to which the person belongs.
|
||||
* @param string $personId The ID of the person to update.
|
||||
* @param array|null $params
|
||||
* @param array|string|null $opts
|
||||
*
|
||||
@ -318,8 +318,8 @@ class Account extends ApiResource
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|null $id The ID of the account to which the person belongs.
|
||||
* @param string|null $personId The ID of the person to delete.
|
||||
* @param string $id The ID of the account to which the person belongs.
|
||||
* @param string $personId The ID of the person to delete.
|
||||
* @param array|null $params
|
||||
* @param array|string|null $opts
|
||||
*
|
||||
@ -331,7 +331,7 @@ class Account extends ApiResource
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|null $id The ID of the account on which to retrieve the persons.
|
||||
* @param string $id The ID of the account on which to retrieve the persons.
|
||||
* @param array|null $params
|
||||
* @param array|string|null $opts
|
||||
*
|
||||
|
||||
@ -31,11 +31,36 @@ class BalanceTransaction extends ApiResource
|
||||
use ApiOperations\Retrieve;
|
||||
|
||||
/**
|
||||
* @return string The class URL for this resource. It needs to be special
|
||||
* cased because it doesn't fit into the standard resource pattern.
|
||||
* Possible string representations of the type of balance transaction.
|
||||
* @link https://stripe.com/docs/api/balance/balance_transaction#balance_transaction_object-type
|
||||
*/
|
||||
public static function classUrl()
|
||||
{
|
||||
return "/v1/balance/history";
|
||||
}
|
||||
const TYPE_ADJUSTMENT = 'adjustment';
|
||||
const TYPE_ADVANCE = 'advance';
|
||||
const TYPE_ADVANCE_FUNDING = 'advance_funding';
|
||||
const TYPE_APPLICATION_FEE = 'application_fee';
|
||||
const TYPE_APPLICATION_FEE_REFUND = 'application_fee_refund';
|
||||
const TYPE_CHARGE = 'charge';
|
||||
const TYPE_CONNECT_COLLECTION_TRANSFER = 'connect_collection_transfer';
|
||||
const TYPE_ISSUING_AUTHORIZATION_HOLD = 'issuing_authorization_hold';
|
||||
const TYPE_ISSUING_AUTHORIZATION_RELEASE = 'issuing_authorization_release';
|
||||
const TYPE_ISSUING_TRANSACTION = 'issuing_transaction';
|
||||
const TYPE_PAYMENT = 'payment';
|
||||
const TYPE_PAYMENT_FAILURE_REFUND = 'payment_failure_refund';
|
||||
const TYPE_PAYMENT_REFUND = 'payment_refund';
|
||||
const TYPE_PAYOUT = 'payout';
|
||||
const TYPE_PAYOUT_CANCEL = 'payout_cancel';
|
||||
const TYPE_PAYOUT_FAILURE = 'payout_failure';
|
||||
const TYPE_REFUND = 'refund';
|
||||
const TYPE_REFUND_FAILURE = 'refund_failure';
|
||||
const TYPE_RESERVE_TRANSACTION = 'reserve_transaction';
|
||||
const TYPE_RESERVED_FUNDS = 'reserved_funds';
|
||||
const TYPE_STRIPE_FEE = 'stripe_fee';
|
||||
const TYPE_STRIPE_FX_FEE = 'stripe_fx_fee';
|
||||
const TYPE_TAX_FEE = 'tax_fee';
|
||||
const TYPE_TOPUP = 'topup';
|
||||
const TYPE_TOPUP_REVERSAL = 'topup_reversal';
|
||||
const TYPE_TRANSFER = 'transfer';
|
||||
const TYPE_TRANSFER_CANCEL = 'transfer_cancel';
|
||||
const TYPE_TRANSFER_FAILURE = 'transfer_failure';
|
||||
const TYPE_TRANSFER_REFUND = 'transfer_refund';
|
||||
}
|
||||
|
||||
@ -31,6 +31,16 @@ class BankAccount extends ApiResource
|
||||
use ApiOperations\Delete;
|
||||
use ApiOperations\Update;
|
||||
|
||||
/**
|
||||
* Possible string representations of the bank verification status.
|
||||
* @link https://stripe.com/docs/api/external_account_bank_accounts/object#account_bank_account_object-status
|
||||
*/
|
||||
const STATUS_NEW = 'new';
|
||||
const STATUS_VALIDATED = 'validated';
|
||||
const STATUS_VERIFIED = 'verified';
|
||||
const STATUS_VERIFICATION_FAILED = 'verification_failed';
|
||||
const STATUS_ERRORED = 'errored';
|
||||
|
||||
/**
|
||||
* @return string The instance URL for this resource. It needs to be special
|
||||
* cased because it doesn't fit into the standard resource pattern.
|
||||
|
||||
@ -11,7 +11,9 @@ namespace Stripe;
|
||||
* @property int $amount_refunded
|
||||
* @property string $application
|
||||
* @property string $application_fee
|
||||
* @property int $application_fee_amount
|
||||
* @property string $balance_transaction
|
||||
* @property mixed $billing_details
|
||||
* @property bool $captured
|
||||
* @property int $created
|
||||
* @property string $currency
|
||||
@ -30,6 +32,8 @@ namespace Stripe;
|
||||
* @property mixed $outcome
|
||||
* @property bool $paid
|
||||
* @property string $payment_intent
|
||||
* @property string $payment_method
|
||||
* @property mixed $payment_method_details
|
||||
* @property string $receipt_email
|
||||
* @property string $receipt_number
|
||||
* @property string $receipt_url
|
||||
@ -86,6 +90,7 @@ class Charge extends ApiResource
|
||||
const DECLINED_INVALID_PIN = 'invalid_pin';
|
||||
const DECLINED_ISSUER_NOT_AVAILABLE = 'issuer_not_available';
|
||||
const DECLINED_LOST_CARD = 'lost_card';
|
||||
const DECLINED_MERCHANT_BLACKLIST = 'merchant_blacklist';
|
||||
const DECLINED_NEW_ACCOUNT_INFORMATION_AVAILABLE = 'new_account_information_available';
|
||||
const DECLINED_NO_ACTION_TAKEN = 'no_action_taken';
|
||||
const DECLINED_NOT_PERMITTED = 'not_permitted';
|
||||
|
||||
@ -15,6 +15,7 @@ namespace Stripe\Checkout;
|
||||
* @property bool $livemode
|
||||
* @property string $payment_intent
|
||||
* @property string[] $payment_method_types
|
||||
* @property string $submit_type
|
||||
* @property string $subscription
|
||||
* @property string $success_url
|
||||
*
|
||||
@ -27,4 +28,13 @@ class Session extends \Stripe\ApiResource
|
||||
|
||||
use \Stripe\ApiOperations\Create;
|
||||
use \Stripe\ApiOperations\Retrieve;
|
||||
|
||||
/**
|
||||
* Possible string representations of submit type.
|
||||
* @link https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-submit_type
|
||||
*/
|
||||
const SUBMIT_TYPE_AUTO = 'auto';
|
||||
const SUBMIT_TYPE_BOOK = 'book';
|
||||
const SUBMIT_TYPE_DONATE = 'donate';
|
||||
const SUBMIT_TYPE_PAY = 'pay';
|
||||
}
|
||||
|
||||
@ -8,6 +8,7 @@ namespace Stripe;
|
||||
* @property string $id
|
||||
* @property string $object
|
||||
* @property int $amount
|
||||
* @property string $customer_balance_transaction
|
||||
* @property int $created
|
||||
* @property string $currency
|
||||
* @property string $customer
|
||||
|
||||
@ -7,8 +7,8 @@ namespace Stripe;
|
||||
*
|
||||
* @property string $id
|
||||
* @property string $object
|
||||
* @property int $account_balance
|
||||
* @property mixed $address
|
||||
* @property int $balance
|
||||
* @property string $created
|
||||
* @property string $currency
|
||||
* @property string $default_source
|
||||
@ -26,6 +26,7 @@ namespace Stripe;
|
||||
* @property mixed $shipping
|
||||
* @property Collection $sources
|
||||
* @property Collection $subscriptions
|
||||
* @property string $tax_exempt
|
||||
* @property Collection $tax_ids
|
||||
*
|
||||
* @package Stripe
|
||||
@ -61,6 +62,7 @@ class Customer extends ApiResource
|
||||
return $savedNestedResources;
|
||||
}
|
||||
|
||||
const PATH_BALANCE_TRANSACTIONS = '/balance_transactions';
|
||||
const PATH_SOURCES = '/sources';
|
||||
const PATH_TAX_IDS = '/tax_ids';
|
||||
|
||||
@ -264,4 +266,55 @@ class Customer extends ApiResource
|
||||
{
|
||||
return self::_allNestedResources($id, static::PATH_TAX_IDS, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|null $id The ID of the customer on which to create the balance transaction.
|
||||
* @param array|null $params
|
||||
* @param array|string|null $opts
|
||||
*
|
||||
* @return ApiResource
|
||||
*/
|
||||
public static function createBalanceTransaction($id, $params = null, $opts = null)
|
||||
{
|
||||
return self::_createNestedResource($id, static::PATH_BALANCE_TRANSACTIONS, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|null $id The ID of the customer to which the balance transaction belongs.
|
||||
* @param string|null $balanceTransactionId The ID of the balance transaction to retrieve.
|
||||
* @param array|null $params
|
||||
* @param array|string|null $opts
|
||||
*
|
||||
* @return ApiResource
|
||||
*/
|
||||
public static function retrieveBalanceTransaction($id, $balanceTransactionId, $params = null, $opts = null)
|
||||
{
|
||||
return self::_retrieveNestedResource($id, static::PATH_BALANCE_TRANSACTIONS, $balanceTransactionId, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|null $id The ID of the customer on which to update the balance transaction.
|
||||
* @param string|null $balanceTransactionId The ID of the balance transaction to update.
|
||||
* @param array|null $params
|
||||
* @param array|string|null $opts
|
||||
*
|
||||
*
|
||||
* @return ApiResource
|
||||
*/
|
||||
public static function updateBalanceTransaction($id, $balanceTransactionId, $params = null, $opts = null)
|
||||
{
|
||||
return self::_updateNestedResource($id, static::PATH_BALANCE_TRANSACTIONS, $balanceTransactionId, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|null $id The ID of the customer on which to retrieve the customer balance transactions.
|
||||
* @param array|null $params
|
||||
* @param array|string|null $opts
|
||||
*
|
||||
* @return Collection The list of customer balance transactions.
|
||||
*/
|
||||
public static function allBalanceTransactions($id, $params = null, $opts = null)
|
||||
{
|
||||
return self::_allNestedResources($id, static::PATH_BALANCE_TRANSACTIONS, $params, $opts);
|
||||
}
|
||||
}
|
||||
|
||||
88
htdocs/includes/stripe/lib/CustomerBalanceTransaction.php
Normal file
88
htdocs/includes/stripe/lib/CustomerBalanceTransaction.php
Normal file
@ -0,0 +1,88 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe;
|
||||
|
||||
/**
|
||||
* Class CustomerBalanceTransaction
|
||||
*
|
||||
* @package Stripe
|
||||
*
|
||||
* @property string $id
|
||||
* @property string $object
|
||||
* @property int $amount
|
||||
* @property string $credit_note
|
||||
* @property int $created
|
||||
* @property string $currency
|
||||
* @property string $customer
|
||||
* @property string $description
|
||||
* @property int $ending_balance
|
||||
* @property string $invoice
|
||||
* @property bool $livemode
|
||||
* @property StripeObject $metadata
|
||||
* @property string $type
|
||||
*/
|
||||
class CustomerBalanceTransaction extends ApiResource
|
||||
{
|
||||
const OBJECT_NAME = "customer_balance_transaction";
|
||||
|
||||
/**
|
||||
* Possible string representations of a balance transaction's type.
|
||||
* @link https://stripe.com/docs/api/customers/customer_balance_transaction_object#customer_balance_transaction_object-type
|
||||
*/
|
||||
const TYPE_ADJUSTEMENT = 'adjustment';
|
||||
const TYPE_APPLIED_TO_INVOICE = 'applied_to_invoice';
|
||||
const TYPE_CREDIT_NOTE = 'credit_note';
|
||||
const TYPE_INITIAL = 'initial';
|
||||
const TYPE_INVOICE_TOO_LARGE = 'invoice_too_large';
|
||||
const TYPE_INVOICE_TOO_SMALL = 'invoice_too_small';
|
||||
const TYPE_UNSPENT_RECEIVER_CREDIT = 'unspent_receiver_credit';
|
||||
|
||||
/**
|
||||
* @return string The API URL for this balance transaction.
|
||||
*/
|
||||
public function instanceUrl()
|
||||
{
|
||||
$id = $this['id'];
|
||||
$customer = $this['customer'];
|
||||
if (!$id) {
|
||||
throw new Error\InvalidRequest(
|
||||
"Could not determine which URL to request: class instance has invalid ID: $id",
|
||||
null
|
||||
);
|
||||
}
|
||||
$id = Util\Util::utf8($id);
|
||||
$customer = Util\Util::utf8($customer);
|
||||
|
||||
$base = Customer::classUrl();
|
||||
$customerExtn = urlencode($customer);
|
||||
$extn = urlencode($id);
|
||||
return "$base/$customerExtn/balance_transactions/$extn";
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array|string $_id
|
||||
* @param array|string|null $_opts
|
||||
*
|
||||
* @throws \Stripe\Error\InvalidRequest
|
||||
*/
|
||||
public static function retrieve($_id, $_opts = null)
|
||||
{
|
||||
$msg = "Customer Balance Transactions cannot be accessed without a customer ID. " .
|
||||
"Retrieve a balance transaction using Customer::retrieveBalanceTransaction('cus_123', 'cbtxn_123') instead.";
|
||||
throw new Error\InvalidRequest($msg, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $_id
|
||||
* @param array|null $_params
|
||||
* @param array|string|null $_options
|
||||
*
|
||||
* @throws \Stripe\Error\InvalidRequest
|
||||
*/
|
||||
public static function update($_id, $_params = null, $_options = null)
|
||||
{
|
||||
$msg = "Customer Balance Transactions cannot be accessed without a customer ID. " .
|
||||
"Update a balance transaction using Customer::updateBalanceTransaction('cus_123', 'cbtxn_123', \$params) instead.";
|
||||
throw new Error\InvalidRequest($msg, null);
|
||||
}
|
||||
}
|
||||
@ -19,6 +19,7 @@ namespace Stripe;
|
||||
* @property string $billing
|
||||
* @property string $billing_reason
|
||||
* @property string $charge
|
||||
* @property string $collection_method
|
||||
* @property int $created
|
||||
* @property string $currency
|
||||
* @property array $custom_fields
|
||||
@ -28,6 +29,7 @@ namespace Stripe;
|
||||
* @property string $customer_name
|
||||
* @property string $customer_phone
|
||||
* @property mixed $customer_shipping
|
||||
* @property string $customer_tax_exempt
|
||||
* @property array $customer_tax_ids
|
||||
* @property string $default_payment_method
|
||||
* @property string $default_source
|
||||
@ -77,6 +79,25 @@ class Invoice extends ApiResource
|
||||
use ApiOperations\Retrieve;
|
||||
use ApiOperations\Update;
|
||||
|
||||
/**
|
||||
* Possible string representations of the billing reason.
|
||||
* @link https://stripe.com/docs/api/invoices/object#invoice_object-billing_reason
|
||||
*/
|
||||
const BILLING_REASON_MANUAL = 'manual';
|
||||
const BILLING_REASON_SUBSCRIPTION = 'subscription';
|
||||
const BILLING_REASON_SUBSCRIPTION_CREATE = 'subscription_create';
|
||||
const BILLING_REASON_SUBSCRIPTION_CYCLE = 'subscription_cycle';
|
||||
const BILLING_REASON_SUBSCRIPTION_THRESHOLD = 'subscription_threshold';
|
||||
const BILLING_REASON_SUBSCRIPTION_UPDATE = 'subscription_update';
|
||||
const BILLING_REASON_UPCOMING = 'upcoming';
|
||||
|
||||
/**
|
||||
* Possible string representations of the `collection_method` property.
|
||||
* @link https://stripe.com/docs/api/invoices/object#invoice_object-collection_method
|
||||
*/
|
||||
const COLLECTION_METHOD_CHARGE_AUTOMATICALLY = 'charge_automatically';
|
||||
const COLLECTION_METHOD_SEND_INVOICE = 'send_invoice';
|
||||
|
||||
/**
|
||||
* Possible string representations of the invoice status.
|
||||
* @link https://stripe.com/docs/api/invoices/object#invoice_object-status
|
||||
@ -88,23 +109,12 @@ class Invoice extends ApiResource
|
||||
const STATUS_VOID = 'void';
|
||||
|
||||
/**
|
||||
* Possible string representations of the billing.
|
||||
* Possible string representations of the `billing` property.
|
||||
* @deprecated Use `collection_method` instead.
|
||||
* @link https://stripe.com/docs/api/invoices/object#invoice_object-billing
|
||||
*/
|
||||
const BILLING_SEND_INVOICE = 'send_invoice';
|
||||
const BILLING_CHARGE_AUTOMATICALLY = 'charge_automatically';
|
||||
|
||||
/**
|
||||
* Possible string representations of the billing reason.
|
||||
* @link https://stripe.com/docs/api/invoices/object#invoice_object-billing_reason
|
||||
*/
|
||||
const BILLING_REASON_SUBSCRIPTION = 'subscription';
|
||||
const BILLING_REASON_SUBSCRIPTION_CREATE = 'subscription_create';
|
||||
const BILLING_REASON_SUBSCRIPTION_CYCLE = 'subscription_cycle';
|
||||
const BILLING_REASON_SUBSCRIPTION_UPDATE = 'subscription_update';
|
||||
const BILLING_REASON_SUBSCRIPTION_THRESHOLD = 'subscription_threshold';
|
||||
const BILLING_REASON_MANUAL = 'manual';
|
||||
const BILLING_REASON_UPCOMING = 'upcoming';
|
||||
const BILLING_SEND_INVOICE = 'send_invoice';
|
||||
|
||||
/**
|
||||
* @param array|null $params
|
||||
|
||||
@ -17,6 +17,8 @@ namespace Stripe\Issuing;
|
||||
* @property string $dispute
|
||||
* @property bool $livemode
|
||||
* @property mixed $merchant_data
|
||||
* @property int $merchant_amount
|
||||
* @property string $merchant_currency
|
||||
* @property \Stripe\StripeObject $metadata
|
||||
* @property string $type
|
||||
*
|
||||
|
||||
@ -23,7 +23,7 @@ namespace Stripe;
|
||||
* @property Collection $returns
|
||||
* @property string $selected_shipping_method
|
||||
* @property mixed $shipping
|
||||
* @property mixed $shipping_methods
|
||||
* @property array $shipping_methods
|
||||
* @property string $status
|
||||
* @property mixed $status_transitions
|
||||
* @property int $updated
|
||||
|
||||
@ -50,6 +50,19 @@ class PaymentIntent extends ApiResource
|
||||
use ApiOperations\Retrieve;
|
||||
use ApiOperations\Update;
|
||||
|
||||
/**
|
||||
* These constants are possible representations of the status field.
|
||||
*
|
||||
* @link https://stripe.com/docs/api/payment_intents/object#payment_intent_object-status
|
||||
*/
|
||||
const STATUS_CANCELED = 'canceled';
|
||||
const STATUS_PROCESSING = 'processing';
|
||||
const STATUS_REQUIRES_ACTION = 'requires_action';
|
||||
const STATUS_REQUIRES_CAPTURE = 'requires_capture';
|
||||
const STATUS_REQUIRES_CONFIRMATION = 'requires_confirmation';
|
||||
const STATUS_REQUIRES_PAYMENT_METHOD = 'requires_payment_method';
|
||||
const STATUS_SUCCEEDED = 'succeeded';
|
||||
|
||||
/**
|
||||
* @param array|null $params
|
||||
* @param array|string|null $options
|
||||
|
||||
@ -45,7 +45,7 @@ class Person extends ApiResource
|
||||
* Possible string representations of a person's gender.
|
||||
* @link https://stripe.com/docs/api/persons/object#person_object-gender
|
||||
*/
|
||||
const GENDER_MALE = 'male';
|
||||
const GENDER_MALE = 'male';
|
||||
const GENDER_FEMALE = 'female';
|
||||
|
||||
/**
|
||||
|
||||
36
htdocs/includes/stripe/lib/Radar/EarlyFraudWarning.php
Normal file
36
htdocs/includes/stripe/lib/Radar/EarlyFraudWarning.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe\Radar;
|
||||
|
||||
/**
|
||||
* Class EarlyFraudWarning
|
||||
*
|
||||
* @property string $id
|
||||
* @property string $object
|
||||
* @property bool $actionable
|
||||
* @property string $charge
|
||||
* @property int $created
|
||||
* @property string $fraud_type
|
||||
* @property bool $livemode
|
||||
*
|
||||
* @package Stripe\Radar
|
||||
*/
|
||||
class EarlyFraudWarning extends \Stripe\ApiResource
|
||||
{
|
||||
const OBJECT_NAME = "radar.early_fraud_warning";
|
||||
|
||||
use \Stripe\ApiOperations\All;
|
||||
use \Stripe\ApiOperations\Retrieve;
|
||||
|
||||
/**
|
||||
* Possible string representations of an early fraud warning's fraud type.
|
||||
* @link https://stripe.com/docs/api/early_fraud_warnings/object#early_fraud_warning_object-fraud_type
|
||||
*/
|
||||
const FRAUD_TYPE_CARD_NEVER_RECEIVED = 'card_never_received';
|
||||
const FRAUD_TYPE_FRAUDULENT_CARD_APPLICATION = 'fraudulent_card_application';
|
||||
const FRAUD_TYPE_MADE_WITH_COUNTERFEIT_CARD = 'made_with_counterfeit_card';
|
||||
const FRAUD_TYPE_MADE_WITH_LOST_CARD = 'made_with_lost_card';
|
||||
const FRAUD_TYPE_MADE_WITH_STOLEN_CARD = 'made_with_stolen_card';
|
||||
const FRAUD_TYPE_MISC = 'misc';
|
||||
const FRAUD_TYPE_UNAUTHORIZED_USE_OF_CARD = 'unauthorized_use_of_card';
|
||||
}
|
||||
75
htdocs/includes/stripe/lib/SetupIntent.php
Normal file
75
htdocs/includes/stripe/lib/SetupIntent.php
Normal file
@ -0,0 +1,75 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe;
|
||||
|
||||
/**
|
||||
* Class SetupIntent
|
||||
*
|
||||
* @property string $id
|
||||
* @property string $object
|
||||
* @property string $application
|
||||
* @property string $client_secret
|
||||
* @property int $created
|
||||
* @property string $customer
|
||||
* @property string $description
|
||||
* @property mixed $last_setup_error
|
||||
* @property bool $livemode
|
||||
* @property StripeObject $metadata
|
||||
* @property mixed $next_action
|
||||
* @property string $on_behalf_of
|
||||
* @property string $payment_method
|
||||
* @property string[] $payment_method_types
|
||||
* @property string $status
|
||||
*
|
||||
* @package Stripe
|
||||
*/
|
||||
class SetupIntent extends ApiResource
|
||||
{
|
||||
|
||||
const OBJECT_NAME = "setup_intent";
|
||||
|
||||
use ApiOperations\All;
|
||||
use ApiOperations\Create;
|
||||
use ApiOperations\Retrieve;
|
||||
use ApiOperations\Update;
|
||||
|
||||
/**
|
||||
* These constants are possible representations of the status field.
|
||||
*
|
||||
* @link https://stripe.com/docs/api/setup_intents/object#setup_intent_object-status
|
||||
*/
|
||||
const STATUS_CANCELED = 'canceled';
|
||||
const STATUS_PROCESSING = 'processing';
|
||||
const STATUS_REQUIRES_ACTION = 'requires_action';
|
||||
const STATUS_REQUIRES_CONFIRMATION = 'requires_confirmation';
|
||||
const STATUS_REQUIRES_PAYMENT_METHOD = 'requires_payment_method';
|
||||
const STATUS_SUCCEEDED = 'succeeded';
|
||||
|
||||
/**
|
||||
* @param array|null $params
|
||||
* @param array|string|null $options
|
||||
*
|
||||
* @return SetupIntent The canceled setup intent.
|
||||
*/
|
||||
public function cancel($params = null, $options = null)
|
||||
{
|
||||
$url = $this->instanceUrl() . '/cancel';
|
||||
list($response, $opts) = $this->_request('post', $url, $params, $options);
|
||||
$this->refreshFrom($response, $opts);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array|null $params
|
||||
* @param array|string|null $options
|
||||
*
|
||||
* @return SetupIntent The confirmed setup intent.
|
||||
*/
|
||||
public function confirm($params = null, $options = null)
|
||||
{
|
||||
$url = $this->instanceUrl() . '/confirm';
|
||||
list($response, $opts) = $this->_request('post', $url, $params, $options);
|
||||
$this->refreshFrom($response, $opts);
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
@ -18,6 +18,7 @@ namespace Stripe;
|
||||
* @property mixed $code_verification
|
||||
* @property int $created
|
||||
* @property string $currency
|
||||
* @property string $customer
|
||||
* @property mixed $eps
|
||||
* @property string $flow
|
||||
* @property mixed $giropay
|
||||
|
||||
@ -47,7 +47,7 @@ class Stripe
|
||||
public static $maxNetworkRetries = 0;
|
||||
|
||||
// @var boolean Whether client telemetry is enabled. Defaults to false.
|
||||
public static $enableTelemetry = false;
|
||||
public static $enableTelemetry = true;
|
||||
|
||||
// @var float Maximum delay between retries, in seconds
|
||||
private static $maxNetworkRetryDelay = 2.0;
|
||||
@ -55,7 +55,7 @@ class Stripe
|
||||
// @var float Initial delay between retries, in seconds
|
||||
private static $initialNetworkRetryDelay = 0.5;
|
||||
|
||||
const VERSION = '6.35.0';
|
||||
const VERSION = '6.41.0';
|
||||
|
||||
/**
|
||||
* @return string The API key used for requests.
|
||||
|
||||
@ -13,6 +13,7 @@ namespace Stripe;
|
||||
* @property mixed $billing_thresholds
|
||||
* @property bool $cancel_at_period_end
|
||||
* @property int $canceled_at
|
||||
* @property string $collection_method
|
||||
* @property int $created
|
||||
* @property int $current_period_end
|
||||
* @property int $current_period_start
|
||||
@ -31,6 +32,7 @@ namespace Stripe;
|
||||
* @property int $quantity
|
||||
* @property SubscriptionSchedule $schedule
|
||||
* @property int $start
|
||||
* @property int $start_date
|
||||
* @property string $status
|
||||
* @property float $tax_percent
|
||||
* @property int $trial_end
|
||||
|
||||
@ -12,7 +12,6 @@ namespace Stripe;
|
||||
* @property string $country
|
||||
* @property int $created
|
||||
* @property string $customer
|
||||
* @property bool $deleted
|
||||
* @property bool $livemode
|
||||
* @property string $type
|
||||
* @property string $value
|
||||
@ -27,10 +26,12 @@ class TaxId extends ApiResource
|
||||
|
||||
/**
|
||||
* Possible string representations of a tax id's type.
|
||||
* @link https://stripe.com/docs/api/customers/tax_id_object#tax_id_object-type
|
||||
* @link https://stripe.com/docs/api/customer_tax_ids/object#tax_id_object-type
|
||||
*/
|
||||
const TYPE_AU_ABN = 'au_abn';
|
||||
const TYPE_EU_VAT = 'eu_vat';
|
||||
const TYPE_IN_GST = 'in_gst';
|
||||
const TYPE_NO_VAT = 'no_vat';
|
||||
const TYPE_NZ_GST = 'nz_gst';
|
||||
const TYPE_UNKNOWN = 'unknown';
|
||||
|
||||
|
||||
@ -88,6 +88,7 @@ abstract class Util
|
||||
\Stripe\Coupon::OBJECT_NAME => 'Stripe\\Coupon',
|
||||
\Stripe\CreditNote::OBJECT_NAME => 'Stripe\\CreditNote',
|
||||
\Stripe\Customer::OBJECT_NAME => 'Stripe\\Customer',
|
||||
\Stripe\CustomerBalanceTransaction::OBJECT_NAME => 'Stripe\\CustomerBalanceTransaction',
|
||||
\Stripe\Discount::OBJECT_NAME => 'Stripe\\Discount',
|
||||
\Stripe\Dispute::OBJECT_NAME => 'Stripe\\Dispute',
|
||||
\Stripe\EphemeralKey::OBJECT_NAME => 'Stripe\\EphemeralKey',
|
||||
@ -117,6 +118,7 @@ abstract class Util
|
||||
\Stripe\Person::OBJECT_NAME => 'Stripe\\Person',
|
||||
\Stripe\Plan::OBJECT_NAME => 'Stripe\\Plan',
|
||||
\Stripe\Product::OBJECT_NAME => 'Stripe\\Product',
|
||||
\Stripe\Radar\EarlyFraudWarning::OBJECT_NAME => 'Stripe\\Radar\\EarlyFraudWarning',
|
||||
\Stripe\Radar\ValueList::OBJECT_NAME => 'Stripe\\Radar\\ValueList',
|
||||
\Stripe\Radar\ValueListItem::OBJECT_NAME => 'Stripe\\Radar\\ValueListItem',
|
||||
\Stripe\Recipient::OBJECT_NAME => 'Stripe\\Recipient',
|
||||
@ -125,6 +127,7 @@ abstract class Util
|
||||
\Stripe\Reporting\ReportRun::OBJECT_NAME => 'Stripe\\Reporting\\ReportRun',
|
||||
\Stripe\Reporting\ReportType::OBJECT_NAME => 'Stripe\\Reporting\\ReportType',
|
||||
\Stripe\Review::OBJECT_NAME => 'Stripe\\Review',
|
||||
\Stripe\SetupIntent::OBJECT_NAME => 'Stripe\\SetupIntent',
|
||||
\Stripe\SKU::OBJECT_NAME => 'Stripe\\SKU',
|
||||
\Stripe\Sigma\ScheduledQueryRun::OBJECT_NAME => 'Stripe\\Sigma\\ScheduledQueryRun',
|
||||
\Stripe\Source::OBJECT_NAME => 'Stripe\\Source',
|
||||
|
||||
@ -24,6 +24,8 @@ abstract class Webhook
|
||||
*/
|
||||
public static function constructEvent($payload, $sigHeader, $secret, $tolerance = self::DEFAULT_TOLERANCE)
|
||||
{
|
||||
WebhookSignature::verifyHeader($payload, $sigHeader, $secret, $tolerance);
|
||||
|
||||
$data = json_decode($payload, true);
|
||||
$jsonError = json_last_error();
|
||||
if ($data === null && $jsonError !== JSON_ERROR_NONE) {
|
||||
@ -33,8 +35,6 @@ abstract class Webhook
|
||||
}
|
||||
$event = Event::constructFrom($data);
|
||||
|
||||
WebhookSignature::verifyHeader($payload, $sigHeader, $secret, $tolerance);
|
||||
|
||||
return $event;
|
||||
}
|
||||
}
|
||||
|
||||
@ -60,7 +60,7 @@ abstract class WebhookSignature
|
||||
}
|
||||
|
||||
// Check if timestamp is within tolerance
|
||||
if (($tolerance > 0) && ((time() - $timestamp) > $tolerance)) {
|
||||
if (($tolerance > 0) && (abs(time() - $timestamp) > $tolerance)) {
|
||||
throw new Error\SignatureVerification(
|
||||
"Timestamp outside the tolerance zone",
|
||||
$header,
|
||||
|
||||
@ -1931,3 +1931,4 @@ EndPointFor=End point for %s : %s
|
||||
DeleteEmailCollector=Delete email collector
|
||||
ConfirmDeleteEmailCollector=Are you sure you want to delete this email collector?
|
||||
RecipientEmailsWillBeReplacedWithThisValue=Recipient emails will be always replaced with this value
|
||||
AtLeastOneDefaultBankAccountMandatory=At least 1 default bank account must be defined
|
||||
|
||||
@ -90,7 +90,7 @@ ErrorSpecialCharNotAllowedForField=Special characters are not allowed for field
|
||||
ErrorNumRefModel=A reference exists into database (%s) and is not compatible with this numbering rule. Remove record or renamed reference to activate this module.
|
||||
ErrorQtyTooLowForThisSupplier=Quantity too low for this vendor or no price defined on this product for this vendor
|
||||
ErrorOrdersNotCreatedQtyTooLow=Some orders haven't been created because of too-low quantities
|
||||
ErrorModuleSetupNotComplete=Setup of module looks to be uncomplete. Go on Home - Setup - Modules to complete.
|
||||
ErrorModuleSetupNotComplete=Setup of module %s looks to be uncomplete. Go on Home - Setup - Modules to complete.
|
||||
ErrorBadMask=Error on mask
|
||||
ErrorBadMaskFailedToLocatePosOfSequence=Error, mask without sequence number
|
||||
ErrorBadMaskBadRazMonth=Error, bad reset value
|
||||
|
||||
@ -90,7 +90,7 @@ ErrorSpecialCharNotAllowedForField=Les caractères spéciaux ne sont pas admis p
|
||||
ErrorNumRefModel=Une référence existe en base (%s) et est incompatible avec cette numérotation. Supprimez la ligne ou renommez la référence pour activer ce module.
|
||||
ErrorQtyTooLowForThisSupplier=Quantité insuffisante pour ce fournisseur ou aucun tarif défini sur ce produit pour ce fournisseur
|
||||
ErrorOrdersNotCreatedQtyTooLow=Certaines commandes n'ont pas été créées en raison de quantités trop faibles
|
||||
ErrorModuleSetupNotComplete=La configuration des modules semble incomplète. Aller sur la page Accueil - Configuration - Modules pour corriger.
|
||||
ErrorModuleSetupNotComplete=La configuration du module '%s' semble incomplète. Aller sur la page Accueil - Configuration - Modules pour corriger.
|
||||
ErrorBadMask=Erreur sur le masque
|
||||
ErrorBadMaskFailedToLocatePosOfSequence=Erreur, masque sans numéro de séquence
|
||||
ErrorBadMaskBadRazMonth=Erreur, mauvais valeur de remise à zéro
|
||||
|
||||
@ -1935,7 +1935,8 @@ if (preg_match('/^dopayment/', $action)) // If we choosed/click on the payment
|
||||
// JS Code for Stripe
|
||||
if (empty($stripearrayofkeys['publishable_key']))
|
||||
{
|
||||
print info_admin($langs->trans("ErrorModuleSetupNotComplete", "stripe"), 0, 0, 'error');
|
||||
$langs->load("errors");
|
||||
print info_admin($langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("Stripe")), 0, 0, 'error');
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -224,21 +224,25 @@ $object = new Societe($db);
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($action=="change")
|
||||
if ($action=="change") // Change customer for TakePOS
|
||||
{
|
||||
$idcustomer = GETPOST('idcustomer', 'int');
|
||||
$place = (GETPOST('place', 'int') > 0 ? GETPOST('place', 'int') : 0); // $place is id of table for Ba or Restaurant
|
||||
|
||||
$sql="UPDATE ".MAIN_DB_PREFIX."facture set fk_soc=".$idcustomer." where ref='(PROV-POS-".$place.")'";
|
||||
// @TODO Check if draft invoice already exists, if not create it or return a warning to ask to enter at least one line to have it created automatically
|
||||
$sql="UPDATE ".MAIN_DB_PREFIX."facture set fk_soc=".$idcustomer." where ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")'";
|
||||
$resql = $db->query($sql);
|
||||
?>
|
||||
<script>
|
||||
parent.$("#poslines").load("invoice.php?place="+<?php print $place;?>, function() {
|
||||
//parent.$("#poslines").scrollTop(parent.$("#poslines")[0].scrollHeight);
|
||||
parent.$.colorbox.close();
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
?>
|
||||
<script>
|
||||
parent.$("#poslines").load("invoice.php?place="+<?php print $place;?>, function() {
|
||||
//parent.$("#poslines").scrollTop(parent.$("#poslines")[0].scrollHeight);
|
||||
<?php if (! $resql) { ?>
|
||||
alert('Error failed to update customer on draft invoice.');
|
||||
<?php } ?>
|
||||
parent.$.colorbox.close(); /* Close the popup */
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
@ -2506,7 +2506,7 @@ class SupplierProposal extends CommonObject
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
print $langs->trans("Error")." ".$langs->trans("ErrorModuleSetupNotComplete");
|
||||
print $langs->trans("Error")." ".$langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("SupplierProposal"));
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/takepos/admin/setup.php
|
||||
* \file htdocs/takepos/admin/terminal.php
|
||||
* \ingroup takepos
|
||||
* \brief Setup page for TakePos module
|
||||
*/
|
||||
@ -125,30 +125,36 @@ print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Parameters").'</td><td>'.$langs->trans("Value").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="oddeven"><td width=\"50%\">'.$langs->trans("CashDeskThirdPartyForSell").'</td>';
|
||||
print '<td colspan="2">';
|
||||
print '<tr class="oddeven"><td class="fieldrequired">'.$langs->trans("CashDeskThirdPartyForSell").'</td>';
|
||||
print '<td>';
|
||||
print $form->select_company($conf->global->{'CASHDESK_ID_THIRDPARTY'.$terminaltouse}, 'socid', '(s.client IN (1, 3) AND s.status = 1)', 1, 0, 0, array(), 0);
|
||||
print '</td></tr>';
|
||||
|
||||
$atleastonefound = 0;
|
||||
if (! empty($conf->banque->enabled))
|
||||
{
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("CashDeskBankAccountForSell").'</td>';
|
||||
print '<td colspan="2">';
|
||||
print '<td>';
|
||||
$form->select_comptes($conf->global->{'CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse}, 'CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse, 0, "courant=2", 1);
|
||||
if (! empty($conf->global->{'CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse})) $atleastonefound++;
|
||||
print '</td></tr>';
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("CashDeskBankAccountForCheque").'</td>';
|
||||
print '<td colspan="2">';
|
||||
print '<td>';
|
||||
$form->select_comptes($conf->global->{'CASHDESK_ID_BANKACCOUNT_CHEQUE'.$terminaltouse}, 'CASHDESK_ID_BANKACCOUNT_CHEQUE'.$terminaltouse, 0, "courant=1", 1);
|
||||
if (! empty($conf->global->{'CASHDESK_ID_BANKACCOUNT_CHEQUE'.$terminaltouse})) $atleastonefound++;
|
||||
print '</td></tr>';
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("CashDeskBankAccountForCB").'</td>';
|
||||
print '<td colspan="2">';
|
||||
print '<td>';
|
||||
$form->select_comptes($conf->global->{'CASHDESK_ID_BANKACCOUNT_CB'.$terminaltouse}, 'CASHDESK_ID_BANKACCOUNT_CB'.$terminaltouse, 0, "courant=1", 1);
|
||||
if (! empty($conf->global->{'CASHDESK_ID_BANKACCOUNT_CB'.$terminaltouse})) $atleastonefound++;
|
||||
print '</td></tr>';
|
||||
|
||||
foreach($paiements as $modep) {
|
||||
if (in_array($modep->code, array('LIQ', 'CB', 'CHQ'))) continue;
|
||||
if (in_array($modep->code, array('LIQ', 'CB', 'CHQ'))) continue; // Already managed before
|
||||
$name="CASHDESK_ID_BANKACCOUNT_".$modep->code.$terminaltouse;
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("CashDeskBankAccountFor").' '.$langs->trans($modep->libelle).'</td>';
|
||||
print '<td colspan="2">';
|
||||
print '<td>';
|
||||
if (! empty($conf->global->$name)) $atleastonefound++;
|
||||
$cour=preg_match('/^LIQ.*/', $modep->code)?2:1;
|
||||
$form->select_comptes($conf->global->$name, $name, 0, "courant=".$cour, 1);
|
||||
print '</td></tr>';
|
||||
@ -159,7 +165,7 @@ if (! empty($conf->stock->enabled))
|
||||
{
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("CashDeskDoNotDecreaseStock").'</td>'; // Force warehouse (this is not a default value)
|
||||
print '<td colspan="2">';
|
||||
print '<td>';
|
||||
if (empty($conf->productbatch->enabled)) {
|
||||
print $form->selectyesno('CASHDESK_NO_DECREASE_STOCK'.$terminal, $conf->global->{'CASHDESK_NO_DECREASE_STOCK'.$terminal}, 1);
|
||||
}
|
||||
@ -177,7 +183,7 @@ if (! empty($conf->stock->enabled))
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("CashDeskIdWareHouse").'</td>'; // Force warehouse (this is not a default value)
|
||||
print '<td colspan="2">';
|
||||
print '<td>';
|
||||
if (! $disabled)
|
||||
{
|
||||
print $formproduct->selectWarehouses($conf->global->{'CASHDESK_ID_WAREHOUSE'.$terminal}, 'CASHDESK_ID_WAREHOUSE'.$terminal, '', 1, $disabled);
|
||||
@ -191,6 +197,12 @@ if (! empty($conf->stock->enabled))
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
if ($atleastonefound == 0 && ! empty($conf->banque->enabled))
|
||||
{
|
||||
print info_admin($langs->trans("AtLeastOneDefaultBankAccountMandatory"), 0, 0, 'error');
|
||||
}
|
||||
|
||||
print '<br>';
|
||||
|
||||
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></div>';
|
||||
|
||||
@ -42,7 +42,7 @@ $langs->loadLangs(array("bills", "cashdesk"));
|
||||
$id = GETPOST('id', 'int');
|
||||
$action = GETPOST('action', 'alpha');
|
||||
$idproduct = GETPOST('idproduct', 'int');
|
||||
$place = (GETPOST('place', 'int') > 0 ? GETPOST('place', 'int') : 0); // $place is id of table for Ba or Restaurant
|
||||
$place = (GETPOST('place', 'int') > 0 ? GETPOST('place', 'int') : 0); // $place is id of table for Bar or Restaurant
|
||||
|
||||
if ($conf->global->TAKEPOS_PHONE_BASIC_LAYOUT==1 && $conf->browser->layout == 'phone')
|
||||
{
|
||||
@ -209,9 +209,21 @@ if (($action=="addline" || $action=="freezone") && $placeid == 0)
|
||||
$invoice->module_source = 'takepos';
|
||||
$invoice->pos_source = $_SESSION["takeposterminal"];
|
||||
|
||||
$placeid = $invoice->create($user);
|
||||
$sql="UPDATE ".MAIN_DB_PREFIX."facture set ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")' where rowid=".$placeid;
|
||||
$db->query($sql);
|
||||
if ($invoice->socid <= 0)
|
||||
{
|
||||
$langs->load('errors');
|
||||
dol_htmloutput_errors($langs->trans("ErrorModuleSetupNotComplete", "TakePos"), null, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
$placeid = $invoice->create($user);
|
||||
if ($placeid < 0)
|
||||
{
|
||||
dol_htmloutput_errors($invoice->error, $invoice->errors, 1);
|
||||
}
|
||||
$sql="UPDATE ".MAIN_DB_PREFIX."facture set ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")' where rowid=".$placeid;
|
||||
$db->query($sql);
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == "addline")
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/takepos/floors.php
|
||||
* \file htdocs/takepos/takepos.php
|
||||
* \ingroup takepos
|
||||
* \brief Main TakePOS screen
|
||||
*/
|
||||
@ -359,7 +359,7 @@ function deleteline() {
|
||||
}
|
||||
|
||||
function Customer() {
|
||||
console.log("Open box to select the thirdparty");
|
||||
console.log("Open box to select the thirdparty place="+place);
|
||||
$.colorbox({href:"../societe/list.php?contextpage=poslist&nomassaction=1&place="+place, width:"90%", height:"80%", transition:"none", iframe:"true", title:"<?php echo $langs->trans("Customer");?>"});
|
||||
}
|
||||
|
||||
@ -626,6 +626,7 @@ $sql = "SELECT code, libelle FROM ".MAIN_DB_PREFIX."c_paiement";
|
||||
$sql.= " WHERE entity IN (".getEntity('c_paiement').")";
|
||||
$sql.= " AND active = 1";
|
||||
$sql.= " ORDER BY libelle";
|
||||
|
||||
$resql = $db->query($sql);
|
||||
$paiementsModes = array();
|
||||
if ($resql){
|
||||
@ -640,7 +641,8 @@ if ($resql){
|
||||
}
|
||||
}
|
||||
if (empty($paiementsModes)) {
|
||||
setEventMessages($langs->trans("ErrorModuleSetupNotComplete"), null, 'errors');
|
||||
$langs->load('errors');
|
||||
setEventMessages($langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("TakePOS")), null, 'errors');
|
||||
}
|
||||
if (count($maincategories)==0) {
|
||||
setEventMessages($langs->trans("TakeposNeedsCategories"), null, 'errors');
|
||||
|
||||
@ -218,17 +218,16 @@ class Tickets extends DolibarrApi
|
||||
* Get a list of tickets
|
||||
*
|
||||
* @param int $socid Filter list with thirdparty ID
|
||||
* @param string $mode Use this param to filter list
|
||||
* @param string $sortfield Sort field
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101') and (t.fk_statut:=:1)"
|
||||
*
|
||||
* @return array Array of ticket objects
|
||||
*
|
||||
*/
|
||||
public function index($socid = 0, $mode = "", $sortfield = "s.rowid", $sortorder = "ASC", $limit = 0, $page = 0, $sqlfilters = '')
|
||||
public function index($socid = 0, $sortfield = "t.rowid", $sortorder = "ASC", $limit = 100, $page = 0, $sqlfilters = '')
|
||||
{
|
||||
global $db, $conf;
|
||||
|
||||
@ -243,51 +242,25 @@ class Tickets extends DolibarrApi
|
||||
$search_sale = DolibarrApiAccess::$user->id;
|
||||
}
|
||||
|
||||
$sql = "SELECT s.rowid";
|
||||
$sql = "SELECT t.rowid";
|
||||
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) || $search_sale > 0) {
|
||||
$sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects)
|
||||
}
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."ticket as s";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."ticket as t";
|
||||
|
||||
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) || $search_sale > 0) {
|
||||
$sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale
|
||||
}
|
||||
|
||||
$sql.= ' WHERE s.entity IN ('.getEntity('ticket', 1).')';
|
||||
$sql.= ' WHERE t.entity IN ('.getEntity('ticket', 1).')';
|
||||
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) || $search_sale > 0) {
|
||||
$sql.= " AND s.fk_soc = sc.fk_soc";
|
||||
$sql.= " AND t.fk_soc = sc.fk_soc";
|
||||
}
|
||||
if ($socid > 0) {
|
||||
$sql.= " AND s.fk_soc = ".$socid;
|
||||
$sql.= " AND t.fk_soc = ".$socid;
|
||||
}
|
||||
if ($search_sale > 0) {
|
||||
$sql.= " AND s.rowid = sc.fk_soc"; // Join for the needed table to filter by sale
|
||||
}
|
||||
|
||||
// Example of use $mode
|
||||
if ($mode == 'new') {
|
||||
$sql.= " AND s.fk_statut IN (0)";
|
||||
}
|
||||
if ($mode == 'read') {
|
||||
$sql.= " AND s.fk_statut IN (1)";
|
||||
}
|
||||
if ($mode == 'answered') {
|
||||
$sql.= " AND s.fk_statut IN (3)";
|
||||
}
|
||||
if ($mode == 'assign') {
|
||||
$sql.= " AND s.fk_statut IN (4)";
|
||||
}
|
||||
if ($mode == 'inprogress') {
|
||||
$sql.= " AND s.fk_statut IN (5)";
|
||||
}
|
||||
if ($mode == 'waiting') {
|
||||
$sql.= " AND s.fk_statut IN (6)";
|
||||
}
|
||||
if ($mode == 'closed') {
|
||||
$sql.= " AND s.fk_statut IN (8)";
|
||||
}
|
||||
if ($mode == 'deleted') {
|
||||
$sql.= " AND s.fk_statut IN (9)";
|
||||
$sql.= " AND t.rowid = sc.fk_soc"; // Join for the needed table to filter by sale
|
||||
}
|
||||
|
||||
// Insert sale filter
|
||||
@ -344,7 +317,6 @@ class Tickets extends DolibarrApi
|
||||
*
|
||||
* @param array $request_data Request datas
|
||||
* @return int ID of ticket
|
||||
*
|
||||
*/
|
||||
public function post($request_data = null)
|
||||
{
|
||||
@ -364,9 +336,11 @@ class Tickets extends DolibarrApi
|
||||
if (empty($this->ticket->track_id)) {
|
||||
$this->ticket->track_id = generate_random_id(16);
|
||||
}
|
||||
if (! $this->ticket->create(DolibarrApiAccess::$user)) {
|
||||
throw new RestException(500);
|
||||
|
||||
if ($this->ticket->create(DolibarrApiAccess::$user) < 0) {
|
||||
throw new RestException(500, "Error creating ticket", array_merge(array($this->ticket->error), $this->ticket->errors));
|
||||
}
|
||||
|
||||
return $this->ticket->id;
|
||||
}
|
||||
|
||||
@ -561,8 +535,12 @@ class Tickets extends DolibarrApi
|
||||
"lastname",
|
||||
"firstname",
|
||||
"civility_id",
|
||||
"canvas",
|
||||
"cache_msgs_ticket",
|
||||
"cache_logs_ticket",
|
||||
"cache_types_tickets",
|
||||
"cache_category_tickets",
|
||||
"regeximgext",
|
||||
"statuts_short",
|
||||
"statuts"
|
||||
);
|
||||
|
||||
@ -120,7 +120,7 @@ if ($id > 0)
|
||||
if (empty($conf->global->CLICKTODIAL_URL) && empty($object->clicktodial_url))
|
||||
{
|
||||
$langs->load("errors");
|
||||
print '<font class="error">'.$langs->trans("ErrorModuleSetupNotComplete").'</font>';
|
||||
print '<font class="error">'.$langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("ClickToDial")).'</font>';
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -161,7 +161,7 @@ if ($id > 0)
|
||||
if (empty($url))
|
||||
{
|
||||
$langs->load("errors");
|
||||
print '<font class="error">'.$langs->trans("ErrorModuleSetupNotComplete").'</font>';
|
||||
print '<font class="error">'.$langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("ClickToDial")).'</font>';
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user