New: Can open back a commercial proposal
This commit is contained in:
parent
0c32afe40b
commit
b54da5a719
@ -5,6 +5,7 @@ English Dolibarr ChangeLog
|
|||||||
***** ChangeLog for 3.2 compared to 3.1 *****
|
***** ChangeLog for 3.2 compared to 3.1 *****
|
||||||
|
|
||||||
For users:
|
For users:
|
||||||
|
- New: Can open back a closed commercial proposal.
|
||||||
- New: show thirdparty barcode on main tab.
|
- New: show thirdparty barcode on main tab.
|
||||||
- New: Can input note (private and public) during note and expenses creation.
|
- New: Can input note (private and public) during note and expenses creation.
|
||||||
- New: Print ticket show invoice ref into POS module.
|
- New: Print ticket show invoice ref into POS module.
|
||||||
|
|||||||
@ -89,6 +89,7 @@ $hookmanager=new HookManager($db);
|
|||||||
$hookmanager->callHooks(array('propalcard'));
|
$hookmanager->callHooks(array('propalcard'));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
/* Actions */
|
/* Actions */
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
@ -246,9 +247,7 @@ if ($_POST['action'] == 'set_ref_client' && $user->rights->propale->creer)
|
|||||||
$object->set_ref_client($user, $_POST['ref_client']);
|
$object->set_ref_client($user, $_POST['ref_client']);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
// Create proposal
|
||||||
* Creation propale
|
|
||||||
*/
|
|
||||||
if ($_POST['action'] == 'add' && $user->rights->propale->creer)
|
if ($_POST['action'] == 'add' && $user->rights->propale->creer)
|
||||||
{
|
{
|
||||||
$object->socid=$_POST['socid'];
|
$object->socid=$_POST['socid'];
|
||||||
@ -382,10 +381,22 @@ if ($action == 'classifybilled')
|
|||||||
$object->cloture($user, 4, '');
|
$object->cloture($user, 4, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
// Reopen proposal
|
||||||
* Cloture de la propale
|
if ($action == 'confirm_reopen' && $user->rights->propale->cloturer)
|
||||||
*/
|
{
|
||||||
if (GETPOST('action') == 'setstatut' && $user->rights->propale->cloturer)
|
if (! $_POST['cancel'])
|
||||||
|
{
|
||||||
|
$object->fetch($id);
|
||||||
|
// prevent browser refresh from reopening proposal several times
|
||||||
|
if ($object->statut==2 || $object->statut==3)
|
||||||
|
{
|
||||||
|
$object->setStatut(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Close proposal
|
||||||
|
if ($action == 'setstatut' && $user->rights->propale->cloturer)
|
||||||
{
|
{
|
||||||
if (! $_POST['cancel'])
|
if (! $_POST['cancel'])
|
||||||
{
|
{
|
||||||
@ -407,7 +418,6 @@ if (GETPOST('action') == 'setstatut' && $user->rights->propale->cloturer)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Add file in email form
|
* Add file in email form
|
||||||
*/
|
*/
|
||||||
@ -1051,17 +1061,19 @@ if ($id > 0 || ! empty($ref))
|
|||||||
$formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id,$langs->trans('ClonePropal'),$langs->trans('ConfirmClonePropal',$object->ref),'confirm_clone',$formquestion,'yes',1);
|
$formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id,$langs->trans('ClonePropal'),$langs->trans('ConfirmClonePropal',$object->ref),'confirm_clone',$formquestion,'yes',1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
// Confirm delete
|
||||||
* Confirmation de la suppression de la propale
|
|
||||||
*/
|
|
||||||
if ($action == 'delete')
|
if ($action == 'delete')
|
||||||
{
|
{
|
||||||
$formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteProp'), $langs->trans('ConfirmDeleteProp'), 'confirm_delete','',0,1);
|
$formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteProp'), $langs->trans('ConfirmDeleteProp',$object->ref), 'confirm_delete','',0,1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
// Confirm reopen
|
||||||
* Confirmation de la suppression d'une ligne produit/service
|
if ($action == 'reopen')
|
||||||
*/
|
{
|
||||||
|
$formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ReOpen'), $langs->trans('ConfirmReOpenProp',$object->ref), 'confirm_reopen','',0,1);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Confirmation delete product/service line
|
||||||
if ($action == 'ask_deleteline')
|
if ($action == 'ask_deleteline')
|
||||||
{
|
{
|
||||||
$formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline','',0,1);
|
$formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline','',0,1);
|
||||||
@ -1569,6 +1581,13 @@ if ($id > 0 || ! empty($ref))
|
|||||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=modif">'.$langs->trans('Modify').'</a>';
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=modif">'.$langs->trans('Modify').'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ReOpen
|
||||||
|
if (($object->statut == 2 || $object->statut == 3) && $user->rights->propale->cloturer)
|
||||||
|
{
|
||||||
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=reopen'.(empty($conf->global->MAIN_JUMP_TAG)?'':'#reopen').'"';
|
||||||
|
print '>'.$langs->trans('ReOpen').'</a>';
|
||||||
|
}
|
||||||
|
|
||||||
// Send
|
// Send
|
||||||
if ($object->statut == 1 || $object->statut == 2)
|
if ($object->statut == 1 || $object->statut == 2)
|
||||||
{
|
{
|
||||||
@ -1594,9 +1613,9 @@ if ($id > 0 || ! empty($ref))
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create an invoice and classify billed
|
// Create an invoice and classify billed
|
||||||
if ($conf->facture->enabled && $object->statut == 2 && $user->societe_id == 0)
|
if ($object->statut == 2 && $user->societe_id == 0)
|
||||||
{
|
{
|
||||||
if ($user->rights->facture->creer)
|
if ($conf->facture->enabled && $user->rights->facture->creer)
|
||||||
{
|
{
|
||||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("AddBill").'</a>';
|
print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("AddBill").'</a>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -116,17 +116,17 @@ class Propal extends CommonObject
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param DoliDB $DB Database handler
|
* @param DoliDB $db Database handler
|
||||||
* @param int $socid Id third party
|
* @param int $socid Id third party
|
||||||
* @param int $propalid Id proposal
|
* @param int $propalid Id proposal
|
||||||
*/
|
*/
|
||||||
function Propal($DB, $socid="", $propalid=0)
|
function Propal($db, $socid="", $propalid=0)
|
||||||
{
|
{
|
||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
|
|
||||||
$this->db = $DB ;
|
$this->db = $db;
|
||||||
$this->socid = $socid;
|
$this->socid = $socid;
|
||||||
$this->id = $propalid;
|
$this->id = $propalid;
|
||||||
$this->products = array();
|
$this->products = array();
|
||||||
@ -1464,12 +1464,43 @@ class Propal extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Closure of the commercial proposal
|
* Close the commercial proposal
|
||||||
* @param User $user Object user that closure
|
*
|
||||||
|
* @param User $user Object user that close
|
||||||
* @param int $statut Statut
|
* @param int $statut Statut
|
||||||
* @param text $note Commentaire
|
* @param text $note Comment
|
||||||
* @return int <0 si ko, >0 si ok
|
* @return int <0 if KO, >0 if OK
|
||||||
|
*/
|
||||||
|
function reopen($user, $statut, $note)
|
||||||
|
{
|
||||||
|
global $langs,$conf;
|
||||||
|
|
||||||
|
$this->statut = $statut;
|
||||||
|
$error=0;
|
||||||
|
|
||||||
|
$this->db->begin();
|
||||||
|
|
||||||
|
$sql = "UPDATE ".MAIN_DB_PREFIX."propal";
|
||||||
|
$sql.= " SET fk_statut = ".$statut.", note = '".$this->db->escape($note)."', date_cloture=".$this->db->idate(mktime()).", fk_user_cloture=".$user->id;
|
||||||
|
$sql.= " WHERE rowid = ".$this->id;
|
||||||
|
|
||||||
|
$resql=$this->db->query($sql);
|
||||||
|
if ($resql)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Close the commercial proposal
|
||||||
|
*
|
||||||
|
* @param User $user Object user that close
|
||||||
|
* @param int $statut Statut
|
||||||
|
* @param text $note Comment
|
||||||
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function cloture($user, $statut, $note)
|
function cloture($user, $statut, $note)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -77,7 +77,8 @@ CreateEmptyPropal=Create empty commercial proposals vierge or from list of produ
|
|||||||
DefaultProposalDurationValidity=Default commercial proposal validity duration (in days)
|
DefaultProposalDurationValidity=Default commercial proposal validity duration (in days)
|
||||||
UseCustomerContactAsPropalRecipientIfExist=Use customer contact address if defined instead of third party address as proposal recipient address
|
UseCustomerContactAsPropalRecipientIfExist=Use customer contact address if defined instead of third party address as proposal recipient address
|
||||||
ClonePropal=Clone commercial proposal
|
ClonePropal=Clone commercial proposal
|
||||||
ConfirmClonePropal=Are you sure you want to clone this commercial proposal <b>%s</b> ?
|
ConfirmClonePropal=Are you sure you want to clone the commercial proposal <b>%s</b> ?
|
||||||
|
ConfirmReOpenProp=Are you sure you want to open back the commercial proposal <b>%s</b> ?
|
||||||
ProposalsAndProposalsLines=Commercial proposal and lines
|
ProposalsAndProposalsLines=Commercial proposal and lines
|
||||||
ProposalLine=Proposal line
|
ProposalLine=Proposal line
|
||||||
AvailabilityPeriod=Availability delay
|
AvailabilityPeriod=Availability delay
|
||||||
|
|||||||
@ -77,7 +77,8 @@ CreateEmptyPropal=Créer proposition/devis vierge
|
|||||||
DefaultProposalDurationValidity=Délai de validité par défaut (en jours)
|
DefaultProposalDurationValidity=Délai de validité par défaut (en jours)
|
||||||
UseCustomerContactAsPropalRecipientIfExist=Utiliser adresse contact suivi client si défini plutôt que adresse tiers comme destinataire des propositions
|
UseCustomerContactAsPropalRecipientIfExist=Utiliser adresse contact suivi client si défini plutôt que adresse tiers comme destinataire des propositions
|
||||||
ClonePropal=Cloner proposition commerciale
|
ClonePropal=Cloner proposition commerciale
|
||||||
ConfirmClonePropal=Êtes-vous sûr de vouloir cloner cette proposition commerciale <b>%s</b> ?
|
ConfirmClonePropal=Êtes-vous sûr de vouloir cloner la proposition commerciale <b>%s</b> ?
|
||||||
|
ConfirmReOpenProp=Êtes-vous sûr de vouloir réouvrir la proposition commerciale <b>%s</b> ?
|
||||||
ProposalsAndProposalsLines=Propositions commerciales clientes et lignes de propositions
|
ProposalsAndProposalsLines=Propositions commerciales clientes et lignes de propositions
|
||||||
ProposalLine=Ligne de proposition
|
ProposalLine=Ligne de proposition
|
||||||
AvailabilityPeriod=Délai de livraison
|
AvailabilityPeriod=Délai de livraison
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user