NEW Upload file with drag and drop for VATs
This commit is contained in:
parent
f61f425231
commit
c4dc0b3c35
@ -15,6 +15,7 @@ NEW: Accountancy - Add specific page to export accounting data rather than the j
|
|||||||
NEW: Accountancy - Add sub-account balance FPC22
|
NEW: Accountancy - Add sub-account balance FPC22
|
||||||
NEW: Accountancy - Manage customer retained warranty FPC21+
|
NEW: Accountancy - Manage customer retained warranty FPC21+
|
||||||
NEW: Accountancy - Manage intra-community VAT on supplier invoices - FPC22
|
NEW: Accountancy - Manage intra-community VAT on supplier invoices - FPC22
|
||||||
|
NEW: Can upload a file with drag and drop on purchase invoice, vats, salaries and social contributions
|
||||||
NEW: adapt category and product pictures sizes on takepos
|
NEW: adapt category and product pictures sizes on takepos
|
||||||
NEW: Add ability of ODT support to supplier invoices
|
NEW: Add ability of ODT support to supplier invoices
|
||||||
NEW: Add a public virtual card page for each user
|
NEW: Add a public virtual card page for each user
|
||||||
|
|||||||
@ -453,9 +453,6 @@ if ($action == 'create') {
|
|||||||
|
|
||||||
// View mode
|
// View mode
|
||||||
if ($id > 0) {
|
if ($id > 0) {
|
||||||
$object = new ChargeSociales($db);
|
|
||||||
$result = $object->fetch($id);
|
|
||||||
|
|
||||||
$formconfirm = '';
|
$formconfirm = '';
|
||||||
|
|
||||||
if ($result > 0) {
|
if ($result > 0) {
|
||||||
|
|||||||
@ -43,9 +43,9 @@ if (isModEnabled('accounting')) {
|
|||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array('compta', 'banks', 'bills'));
|
$langs->loadLangs(array('compta', 'banks', 'bills'));
|
||||||
|
|
||||||
$id = GETPOST("id", 'int');
|
$id = GETPOST('id', 'int');
|
||||||
$ref = GETPOST('ref', 'alpha');
|
$ref = GETPOST('ref', 'alpha');
|
||||||
$action = GETPOST("action", "aZ09");
|
$action = GETPOST('action', 'aZ09');
|
||||||
$confirm = GETPOST('confirm', 'alpha');
|
$confirm = GETPOST('confirm', 'alpha');
|
||||||
$cancel = GETPOST('cancel', 'aZ09');
|
$cancel = GETPOST('cancel', 'aZ09');
|
||||||
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'myobjectcard'; // To manage different context of search
|
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'myobjectcard'; // To manage different context of search
|
||||||
@ -80,8 +80,8 @@ if (empty($action) && empty($id) && empty($ref)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Load object
|
// Load object
|
||||||
if ($id > 0) {
|
if ($id > 0 || $ref) {
|
||||||
$object->fetch($id);
|
$object->fetch($id, $ref);
|
||||||
}
|
}
|
||||||
|
|
||||||
$permissiontoread = $user->rights->tax->charges->lire;
|
$permissiontoread = $user->rights->tax->charges->lire;
|
||||||
@ -96,19 +96,20 @@ $socid = GETPOST('socid', 'int');
|
|||||||
if ($user->socid) {
|
if ($user->socid) {
|
||||||
$socid = $user->socid;
|
$socid = $user->socid;
|
||||||
}
|
}
|
||||||
$result = restrictedArea($user, 'tax', '', 'tva', 'charges');
|
$result = restrictedArea($user, 'tax', $object->id, 'tva', 'charges');
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$parameters = array();
|
$parameters = array('socid' => $socid);
|
||||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
if ($reshook < 0) {
|
if ($reshook < 0) {
|
||||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (empty($reshook)) {
|
||||||
if ($cancel && !$id) {
|
if ($cancel && !$id) {
|
||||||
header("Location: list.php");
|
header("Location: list.php");
|
||||||
exit;
|
exit;
|
||||||
@ -369,6 +370,10 @@ if ($action == 'confirm_clone' && $confirm == 'yes' && ($user->rights->tax->char
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Actions to build doc
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
@ -382,16 +387,7 @@ $title = $langs->trans("VAT")." - ".$langs->trans("Card");
|
|||||||
$help_url = '';
|
$help_url = '';
|
||||||
llxHeader('', $title, $help_url);
|
llxHeader('', $title, $help_url);
|
||||||
|
|
||||||
|
// Form to create a VAT
|
||||||
if ($id) {
|
|
||||||
$result = $object->fetch($id);
|
|
||||||
if ($result <= 0) {
|
|
||||||
dol_print_error($db);
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Form to enter VAT
|
|
||||||
if ($action == 'create') {
|
if ($action == 'create') {
|
||||||
print load_fiche_titre($langs->trans("VAT").' - '.$langs->trans("New"));
|
print load_fiche_titre($langs->trans("VAT").' - '.$langs->trans("New"));
|
||||||
|
|
||||||
@ -532,6 +528,8 @@ if ($action == 'create') {
|
|||||||
|
|
||||||
// View mode
|
// View mode
|
||||||
if ($id > 0) {
|
if ($id > 0) {
|
||||||
|
$formconfirm = '';
|
||||||
|
|
||||||
$head = vat_prepare_head($object);
|
$head = vat_prepare_head($object);
|
||||||
|
|
||||||
$totalpaid = $object->getSommePaiement();
|
$totalpaid = $object->getSommePaiement();
|
||||||
@ -546,25 +544,37 @@ if ($id > 0) {
|
|||||||
$formquestion[] = array('type' => 'date', 'name' => 'clone_period', 'label' => $langs->trans("PeriodEndDate"), 'value' => -1);
|
$formquestion[] = array('type' => 'date', 'name' => 'clone_period', 'label' => $langs->trans("PeriodEndDate"), 'value' => -1);
|
||||||
$formquestion[] = array('type' => 'text', 'name' => 'amount', 'label' => $langs->trans("Amount"), 'value' => price($object->amount), 'morecss' => 'width100');
|
$formquestion[] = array('type' => 'text', 'name' => 'amount', 'label' => $langs->trans("Amount"), 'value' => price($object->amount), 'morecss' => 'width100');
|
||||||
|
|
||||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneVAT', $object->ref), 'confirm_clone', $formquestion, 'yes', 1, 240);
|
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneVAT', $object->ref), 'confirm_clone', $formquestion, 'yes', 1, 240);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'paid') {
|
if ($action == 'paid') {
|
||||||
$text = $langs->trans('ConfirmPayVAT');
|
$text = $langs->trans('ConfirmPayVAT');
|
||||||
print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id, $langs->trans('PayVAT'), $text, "confirm_paid", '', '', 2);
|
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id, $langs->trans('PayVAT'), $text, "confirm_paid", '', '', 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'delete') {
|
if ($action == 'delete') {
|
||||||
$text = $langs->trans('ConfirmDeleteVAT');
|
$text = $langs->trans('ConfirmDeleteVAT');
|
||||||
print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id, $langs->trans('DeleteVAT'), $text, 'confirm_delete', '', '', 2);
|
$formconfirm = $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id, $langs->trans('DeleteVAT'), $text, 'confirm_delete', '', '', 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'edit') {
|
if ($action == 'edit') {
|
||||||
print "<form name=\"charge\" action=\"".$_SERVER["PHP_SELF"]."?id=$object->id&action=update\" method=\"post\">";
|
print '<form name="charge" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="POST">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
|
print '<input type="hidden" name="action" value="update">';
|
||||||
|
}
|
||||||
|
// Call Hook formConfirm
|
||||||
|
$parameters = array('formConfirm' => $formconfirm, 'lineid' => $lineid);
|
||||||
|
$reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
|
if (empty($reshook)) {
|
||||||
|
$formconfirm .= $hookmanager->resPrint;
|
||||||
|
} elseif ($reshook > 0) {
|
||||||
|
$formconfirm = $hookmanager->resPrint;
|
||||||
}
|
}
|
||||||
|
|
||||||
print dol_get_fiche_head($head, 'card', $langs->trans("VATPayment"), -1, 'payment');
|
print dol_get_fiche_head($head, 'card', $langs->trans("VATPayment"), -1, 'payment', 0, '', '', 0, '', 1);
|
||||||
|
|
||||||
|
// Print form confirm
|
||||||
|
print $formconfirm;
|
||||||
|
|
||||||
$morehtmlref = '<div class="refidno">';
|
$morehtmlref = '<div class="refidno">';
|
||||||
// Label of social contribution
|
// Label of social contribution
|
||||||
|
|||||||
@ -299,15 +299,13 @@ class Tva extends CommonObject
|
|||||||
* Load object in memory from database
|
* Load object in memory from database
|
||||||
*
|
*
|
||||||
* @param int $id id object
|
* @param int $id id object
|
||||||
* @param User $user User that load
|
* @param string $ref Ref of VAT (not used yet)
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
public function fetch($id, $user = null)
|
public function fetch($id, $ref = '')
|
||||||
{
|
{
|
||||||
global $langs;
|
|
||||||
$sql = "SELECT";
|
$sql = "SELECT";
|
||||||
$sql .= " t.rowid,";
|
$sql .= " t.rowid,";
|
||||||
|
|
||||||
$sql .= " t.tms,";
|
$sql .= " t.tms,";
|
||||||
$sql .= " t.datep,";
|
$sql .= " t.datep,";
|
||||||
$sql .= " t.datev,";
|
$sql .= " t.datev,";
|
||||||
@ -320,12 +318,11 @@ class Tva extends CommonObject
|
|||||||
$sql .= " t.fk_user_creat,";
|
$sql .= " t.fk_user_creat,";
|
||||||
$sql .= " t.fk_user_modif,";
|
$sql .= " t.fk_user_modif,";
|
||||||
$sql .= " t.fk_account";
|
$sql .= " t.fk_account";
|
||||||
|
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."tva as t";
|
$sql .= " FROM ".MAIN_DB_PREFIX."tva as t";
|
||||||
//$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON t.fk_bank = b.rowid";
|
|
||||||
$sql .= " WHERE t.rowid = ".((int) $id);
|
$sql .= " WHERE t.rowid = ".((int) $id);
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
|
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
|
||||||
|
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
if ($this->db->num_rows($resql)) {
|
if ($this->db->num_rows($resql)) {
|
||||||
|
|||||||
@ -11268,7 +11268,7 @@ function getElementProperties($element_type)
|
|||||||
|
|
||||||
$regs = array();
|
$regs = array();
|
||||||
|
|
||||||
$classfile = $classname = $classpath = $dir_output = '';
|
$classfile = $classname = $classpath = $subdir = $dir_output = '';
|
||||||
|
|
||||||
// Parse element/subelement
|
// Parse element/subelement
|
||||||
$module = $element_type;
|
$module = $element_type;
|
||||||
@ -11439,6 +11439,10 @@ function getElementProperties($element_type)
|
|||||||
} elseif ($element_type == 'chargesociales') {
|
} elseif ($element_type == 'chargesociales') {
|
||||||
$classpath = 'compta/sociales/class';
|
$classpath = 'compta/sociales/class';
|
||||||
$module = 'tax';
|
$module = 'tax';
|
||||||
|
} elseif ($element_type == 'tva') {
|
||||||
|
$classpath = 'compta/tva/class';
|
||||||
|
$module = 'tax';
|
||||||
|
$subdir = '/vat';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($classfile)) {
|
if (empty($classfile)) {
|
||||||
@ -11451,6 +11455,8 @@ function getElementProperties($element_type)
|
|||||||
$classpath = $module.'/class';
|
$classpath = $module.'/class';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//print 'getElementProperties subdir='.$subdir;
|
||||||
|
|
||||||
// Set dir_output
|
// Set dir_output
|
||||||
if ($module && isset($conf->$module)) { // The generic case
|
if ($module && isset($conf->$module)) { // The generic case
|
||||||
if (!empty($conf->$module->multidir_output[$conf->entity])) {
|
if (!empty($conf->$module->multidir_output[$conf->entity])) {
|
||||||
@ -11468,6 +11474,7 @@ function getElementProperties($element_type)
|
|||||||
} elseif ($element == 'invoice_supplier') {
|
} elseif ($element == 'invoice_supplier') {
|
||||||
$dir_output = $conf->fournisseur->facture->dir_output;
|
$dir_output = $conf->fournisseur->facture->dir_output;
|
||||||
}
|
}
|
||||||
|
$dir_output .= $subdir;
|
||||||
|
|
||||||
$element_properties = array(
|
$element_properties = array(
|
||||||
'module' => $module,
|
'module' => $module,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user