diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 1bdf4e75e5d..cc4b7719069 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -264,13 +264,13 @@ if ($id > 0) // Local Taxes if ($mysoc->useLocalTax(1)) { - print ''.$langs->trans("LocalTax1IsUsedES").''; + print ''.$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code).''; print yn($object->localtax1_assuj); print ''; } if ($mysoc->useLocalTax(2)) { - print ''.$langs->trans("LocalTax2IsUsedES").''; + print ''.$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code).''; print yn($object->localtax2_assuj); print ''; } diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 31eb96d633f..23242559f1f 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -54,7 +54,6 @@ $confirm = GETPOST('confirm','alpha'); $backtopage = GETPOST('backtopage','alpha'); $id = GETPOST('id','int'); $socid = GETPOST('socid','int'); -if ($user->societe_id) $socid=$user->societe_id; $object = new Contact($db); $extrafields = new ExtraFields($db); @@ -74,6 +73,7 @@ if (! empty($canvas)) } // Security check +if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'contact', $id, 'socpeople&societe', '', '', 'rowid', $objcanvas); // If we create a contact with no company (shared contacts), no check on write permission // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array diff --git a/htdocs/contact/document.php b/htdocs/contact/document.php index 8c79dfd1580..825c1e8dab5 100644 --- a/htdocs/contact/document.php +++ b/htdocs/contact/document.php @@ -37,9 +37,22 @@ $id = GETPOST('id','int'); $action = GETPOST("action"); $confirm = GETPOST('confirm', 'alpha'); +$object = new Contact($db); + +// Get object canvas (By default, this is not defined, so standard usage of dolibarr) +$object->getCanvas($id); +$objcanvas=null; +$canvas = (! empty($object->canvas)?$object->canvas:GETPOST("canvas")); +if (! empty($canvas)) +{ + require_once DOL_DOCUMENT_ROOT.'/core/class/canvas.class.php'; + $objcanvas = new Canvas($db, $action); + $objcanvas->getCanvas('contact', 'contactcard', $canvas); +} + // Security check if ($user->societe_id) $socid=$user->societe_id; -$result = restrictedArea($user, 'contact', $id, '',''); +$result = restrictedArea($user, 'contact', $id, 'socpeople&societe', '', '', 'rowid', $objcanvas); // If we create a contact with no company (shared contacts), no check on write permission // Get parameters $sortfield = GETPOST("sortfield",'alpha'); @@ -54,7 +67,6 @@ $pagenext = $page + 1; if (! $sortorder) $sortorder="ASC"; if (! $sortfield) $sortfield="name"; -$object = new Contact($db); if ($id > 0) $object->fetch($id); $upload_dir = $conf->societe->dir_output.'/contact/'.dol_sanitizeFileName($object->ref); diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 78fbe392774..f637caec3cb 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2030,24 +2030,6 @@ else print ''; - // Ref - /* - print ''; - print "\n"; - - // Ref supplier - print ''; - - // Third party - print ''; - print ''; - */ - // Type print ''; - // Assujeti TVA + // Vat is used print ''; print ''; - // VAT payers - print ''; + // Local Taxes + //TODO: Place into a function to control showing by country or study better option + if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1") + { + print ''; + + } + elseif($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj!="1") + { + print ''; + + } + elseif($mysoc->localtax2_assuj=="1" && $mysoc->localtax1_assuj!="1") + { + print ''; + } + // VAT Code print ''; - print ''; print ''; - // Local Taxes - //TODO: Place into a function to control showing by country or study better option - if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1") - { - print ''; - - } - elseif($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj!="1") - { - print ''; - - } - elseif($mysoc->localtax2_assuj=="1" && $mysoc->localtax1_assuj!="1") - { - print ''; - } - // Type - Size print ''; - // VAT payers + // VAT is used print ''; print ''; + // Local Taxes + //TODO: Place into a function to control showing by country or study better option + if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1") + { + print ''; + + if($object->localtax1_assuj=="1" && (! isOnlyOneLocalTax(1))) + { + print ''; + print ''; + print ''; + print ''; + if($action == 'editRE') + { + print ''; + } + else + { + print ''; + } + print ''; + } + if($object->localtax2_assuj=="1" && (! isOnlyOneLocalTax(2))) + { + print ''; + print ''; + print ''; + print ''; + if($action == 'editIRPF'){ + print ''; + }else{ + print ''; + } + print ''; + } + } + elseif($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj!="1") + { + print ''; + if($object->localtax1_assuj=="1" && (! isOnlyOneLocalTax(1))) + { + print ''; + print ''; + print ''; + print ''; + if($action == 'editRE'){ + print ''; + }else{ + print ''; + } + print ''; + + } + } + elseif($mysoc->localtax2_assuj=="1" && $mysoc->localtax1_assuj!="1") + { + print ''; + if($object->localtax2_assuj=="1" && (! isOnlyOneLocalTax(2))) + { + + print ''; + print ''; + print ''; + print ''; + if($action == 'editIRPF'){ + print ''; + }else{ + print ''; + } + print ''; + + } + } + /* + if ($mysoc->country_code=='ES' && $mysoc->localtax2_assuj!="1" && ! empty($conf->fournisseur->enabled) && $object->fournisseur==1) + { + print ''; + } + */ + // VAT Code print ''; print ''; print ''; - // Local Taxes - //TODO: Place into a function to control showing by country or study better option - if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1") - { - print ''; - - if($object->localtax1_assuj=="1" && (! isOnlyOneLocalTax(1))) - { - print ''; - print ''; - print ''; - print ''; - if($action == 'editRE') - { - print ''; - } - else - { - print ''; - } - print ''; - } - if($object->localtax2_assuj=="1" && (! isOnlyOneLocalTax(2))) - { - print ''; - print ''; - print ''; - print ''; - if($action == 'editIRPF'){ - print ''; - }else{ - print ''; - } - print ''; - } - } - elseif($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj!="1") - { - print ''; - if($object->localtax1_assuj=="1" && (! isOnlyOneLocalTax(1))) - { - print ''; - print ''; - print ''; - print ''; - if($action == 'editRE'){ - print ''; - }else{ - print ''; - } - print ''; - - } - } - elseif($mysoc->localtax2_assuj=="1" && $mysoc->localtax1_assuj!="1") - { - print ''; - if($object->localtax2_assuj=="1" && (! isOnlyOneLocalTax(2))) - { - - print ''; - print ''; - print ''; - print ''; - if($action == 'editIRPF'){ - print ''; - }else{ - print ''; - } - print ''; - - } - } -/* - if ($mysoc->country_code=='ES' && $mysoc->localtax2_assuj!="1" && ! empty($conf->fournisseur->enabled) && $object->fournisseur==1) - { - print ''; - } -*/ // Type + Staff $arr = $formcompany->typent_array(1); $object->typent= $arr[$object->typent_code]; @@ -2185,6 +2186,26 @@ else print '
'; print '
'.$langs->trans("Ref").''; - print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref'); - print '
'.$form->editfieldkey("RefSupplier",'ref_supplier',$object->ref_supplier,$object,($object->statutrights->fournisseur->facture->creer)).''; - print $form->editfieldval("RefSupplier",'ref_supplier',$object->ref_supplier,$object,($object->statutrights->fournisseur->facture->creer)); - print '
'.$langs->trans('Supplier').''.$societe->getNomUrl(1,'supplier'); - print '   ('.$langs->trans('OtherBills').')
'.$langs->trans('Type').''; print $object->getLibType(); diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index e9896fc61af..71f2ae41536 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -1132,7 +1132,7 @@ else } if ($j % 2 == 1) print '
'.fieldLabel('VATIsUsed','assujtva_value').''; print $form->selectyesno('assujtva_value',1,1); // Assujeti par defaut en creation @@ -1688,14 +1688,64 @@ else } if ($j % 2 == 1) print '
'.fieldLabel('VATIsUsed','assujtva_value').''; + // VAT is used + print '
'.fieldLabel('VATIsUsed','assujtva_value').''; print $form->selectyesno('assujtva_value',$object->tva_assuj,1); print '
'.fieldLabel($langs->transcountry("LocalTax1IsUsed",$mysoc->country_code),'localtax1assuj_value').''; + print $form->selectyesno('localtax1assuj_value',$object->localtax1_assuj,1); + if(! isOnlyOneLocalTax(1)) + { + print ' '.$langs->transcountry("Type",$mysoc->country_code).': '; + $formcompany->select_localtax(1,$object->localtax1_value, "lt1"); + print ''; + } + + print ''.fieldLabel($langs->transcountry("LocalTax2IsUsed",$mysoc->country_code),'localtax2assuj_value').''; + print $form->selectyesno('localtax2assuj_value',$object->localtax2_assuj,1); + if (! isOnlyOneLocalTax(2)) + { + print ' '.$langs->transcountry("Type",$mysoc->country_code).': '; + $formcompany->select_localtax(2,$object->localtax2_value, "lt2"); + print ''; + } + print '
'.fieldLabel($langs->transcountry("LocalTax1IsUsed",$mysoc->country_code),'localtax1assuj_value').''; + print $form->selectyesno('localtax1assuj_value',$object->localtax1_assuj,1); + if(! isOnlyOneLocalTax(1)) + { + print ' '.$langs->transcountry("Type",$mysoc->country_code).': '; + $formcompany->select_localtax(1,$object->localtax1_value, "lt1"); + print ''; + } + print '
'.fieldLabel($langs->transcountry("LocalTax2IsUsed",$mysoc->country_code),'localtax2assuj_value').''; + print $form->selectyesno('localtax2assuj_value',$object->localtax2_assuj,1); + if(! isOnlyOneLocalTax(2)) + { + print ' '.$langs->transcountry("Type",$mysoc->country_code).': '; + $formcompany->select_localtax(2,$object->localtax2_value, "lt2"); + print ''; + } + print '
'.fieldLabel('VATIntra','intra_vat').''; + print ''; $s =''; if (empty($conf->global->MAIN_DISABLEVATCHECK)) @@ -1723,56 +1773,6 @@ else print '
'.fieldLabel($langs->transcountry("LocalTax1IsUsed",$mysoc->country_code),'localtax1assuj_value').''; - print $form->selectyesno('localtax1assuj_value',$object->localtax1_assuj,1); - if(! isOnlyOneLocalTax(1)) - { - print ' '.$langs->transcountry("Type",$mysoc->country_code).': '; - $formcompany->select_localtax(1,$object->localtax1_value, "lt1"); - print ''; - } - - print ''.fieldLabel($langs->transcountry("LocalTax2IsUsed",$mysoc->country_code),'localtax2assuj_value').''; - print $form->selectyesno('localtax2assuj_value',$object->localtax2_assuj,1); - if (! isOnlyOneLocalTax(2)) - { - print ' '.$langs->transcountry("Type",$mysoc->country_code).': '; - $formcompany->select_localtax(2,$object->localtax2_value, "lt2"); - print ''; - } - print '
'.fieldLabel($langs->transcountry("LocalTax1IsUsed",$mysoc->country_code),'localtax1assuj_value').''; - print $form->selectyesno('localtax1assuj_value',$object->localtax1_assuj,1); - if(! isOnlyOneLocalTax(1)) - { - print ' '.$langs->transcountry("Type",$mysoc->country_code).': '; - $formcompany->select_localtax(1,$object->localtax1_value, "lt1"); - print ''; - } - print '
'.fieldLabel($langs->transcountry("LocalTax2IsUsed",$mysoc->country_code),'localtax2assuj_value').''; - print $form->selectyesno('localtax2assuj_value',$object->localtax2_assuj,1); - if(! isOnlyOneLocalTax(2)) - { - print ' '.$langs->transcountry("Type",$mysoc->country_code).': '; - $formcompany->select_localtax(2,$object->localtax2_value, "lt2"); - print ''; - } - print '
'.fieldLabel('ThirdPartyType','typent_id').''; print $form->selectarray("typent_id",$formcompany->typent_array(0), $object->typent_id, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?'ASC':$conf->global->SOCIETE_SORT_ON_TYPEENT)); @@ -2027,7 +2027,7 @@ else } //if ($j % 2 == 1) print '
'; print $langs->trans('VATIsUsed'); print ''; @@ -2035,6 +2035,104 @@ else print '
'.$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code).''; + print yn($object->localtax1_assuj); + print '
'.$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code).''; + print yn($object->localtax2_assuj); + print '
'.$langs->transcountry("TypeLocaltax1", $mysoc->country_code).' id.'">'.img_edit($langs->transnoentitiesnoconv('Edit'),1).''; + $formcompany->select_localtax(1,$object->localtax1_value, "lt1"); + print ''.$object->localtax1_value.'
'.$langs->transcountry("TypeLocaltax2", $mysoc->country_code).'id.'">'.img_edit($langs->transnoentitiesnoconv('Edit'),1).''; + $formcompany->select_localtax(2,$object->localtax2_value, "lt2"); + print ''.$object->localtax2_value.'
'.$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code).''; + print yn($object->localtax1_assuj); + print '
'.$langs->transcountry("TypeLocaltax1", $mysoc->country_code).'id.'">'.img_edit($langs->transnoentitiesnoconv('Edit'),1).''; + $formcompany->select_localtax(1,$object->localtax1_value, "lt1"); + print ''.$object->localtax1_value.'
'.$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code).''; + print yn($object->localtax2_assuj); + print '
'.$langs->transcountry("TypeLocaltax2", $mysoc->country_code).' id.'">'.img_edit($langs->transnoentitiesnoconv('Edit'),1).''; + $formcompany->select_localtax(2,$object->localtax2_value, "lt2"); + print ''.$object->localtax2_value.'
'.$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code).''; + print yn($object->localtax2_assuj); + print '
'.$langs->trans('VATIntra').''; @@ -2074,103 +2172,6 @@ else print '
'.$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code).''; - print yn($object->localtax1_assuj); - print '
'.$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code).''; - print yn($object->localtax2_assuj); - print '
'.$langs->transcountry("TypeLocaltax1", $mysoc->country_code).' id.'">'.img_edit($langs->transnoentitiesnoconv('Edit'),1).''; - $formcompany->select_localtax(1,$object->localtax1_value, "lt1"); - print ''.$object->localtax1_value.'
'.$langs->transcountry("TypeLocaltax2", $mysoc->country_code).'id.'">'.img_edit($langs->transnoentitiesnoconv('Edit'),1).''; - $formcompany->select_localtax(2,$object->localtax2_value, "lt2"); - print ''.$object->localtax2_value.'
'.$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code).''; - print yn($object->localtax1_assuj); - print '
'.$langs->transcountry("TypeLocaltax1", $mysoc->country_code).'id.'">'.img_edit($langs->transnoentitiesnoconv('Edit'),1).''; - $formcompany->select_localtax(1,$object->localtax1_value, "lt1"); - print ''.$object->localtax1_value.'
'.$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code).''; - print yn($object->localtax2_assuj); - print '
'.$langs->transcountry("TypeLocaltax2", $mysoc->country_code).' id.'">'.img_edit($langs->transnoentitiesnoconv('Edit'),1).''; - $formcompany->select_localtax(2,$object->localtax2_value, "lt2"); - print ''.$object->localtax2_value.'
'.$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code).''; - print yn($object->localtax2_assuj); - print '
'; + // Tags / categories + if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire)) + { + // Customer + if ($object->prospect || $object->client) { + print ''; + print '"; + } + + // Supplier + if ($object->fournisseur) { + print ''; + print '"; + } + } + // Legal print ''; @@ -2207,26 +2228,6 @@ else print ''; } - // Tags / categories - if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire)) - { - // Customer - if ($object->prospect || $object->client) { - print ''; - print '"; - } - - // Supplier - if ($object->fournisseur) { - print ''; - print '"; - } - } - // Incoterms if (!empty($conf->incoterm->enabled)) {
' . $langs->trans("CustomersCategoriesShort") . ''; + print $form->showCategories($object->id, 'customer', 1); + print "
' . $langs->trans("SuppliersCategoriesShort") . ''; + print $form->showCategories($object->id, 'supplier', 1); + print "
'.$langs->trans('JuridicalStatus').''.$object->forme_juridique.'
' . $langs->trans("CustomersCategoriesShort") . ''; - print $form->showCategories($object->id, 'customer', 1); - print "
' . $langs->trans("SuppliersCategoriesShort") . ''; - print $form->showCategories($object->id, 'supplier', 1); - print "