mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
set ref_supplier for contract field
This commit is contained in:
parent
f9fb73ee82
commit
14ca936cfc
|
|
@ -48,7 +48,7 @@ For users:
|
|||
- New: [ task #1204 ] add Numering contrat module free (like leopard in product module).
|
||||
- New: [ task #712 ] Add warning when creating invoice from proposal or order, when there is already one invoice.
|
||||
- New: Enable supplier price log table.
|
||||
- New: [ task #1204 ] add a External reference to contract.
|
||||
- New: [ task #1204 ] add a supplier reference to contract.
|
||||
- New: [ task #1218 ] Can drag and drop an event from calendar to change its day.
|
||||
- New: Optimize size of image static resources.
|
||||
- New: Add hourly and daily amount on user card. Add weekly working hours and salary on user card.
|
||||
|
|
|
|||
|
|
@ -207,7 +207,7 @@ if ($action == 'add' && $user->rights->contrat->creer)
|
|||
$object->fk_project = GETPOST('projectid','int');
|
||||
$object->remise_percent = GETPOST('remise_percent','alpha');
|
||||
$object->ref = GETPOST('ref','alpha');
|
||||
$object->ref_customer = GETPOST('ref_customer','alpha');
|
||||
$object->ref_supplier = GETPOST('ref_supplier','alpha');
|
||||
|
||||
// If creation from another object of another module (Example: origin=propal, originid=1)
|
||||
if ($_POST['origin'] && $_POST['originid'])
|
||||
|
|
@ -733,17 +733,17 @@ else if ($action == 'confirm_move' && $confirm == 'yes' && $user->rights->contra
|
|||
$action = 'edit_extras';
|
||||
setEventMessage($object->error,'errors');
|
||||
}
|
||||
} elseif ($action=='setref_customer') {
|
||||
} elseif ($action=='setref_supplier') {
|
||||
$result = $object->fetch($id);
|
||||
if ($result < 0) {
|
||||
setEventMessage($object->errors,'errors');
|
||||
}
|
||||
$object->ref_customer=GETPOST('ref_customer','alpha');
|
||||
$object->ref_supplier=GETPOST('ref_supplier','alpha');
|
||||
|
||||
$result = $object->update($user);
|
||||
if ($result < 0) {
|
||||
setEventMessage($object->errors,'errors');
|
||||
$action='editref_customer';
|
||||
$action='editref_supplier';
|
||||
} else {
|
||||
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
|
||||
exit;
|
||||
|
|
@ -928,7 +928,7 @@ if ($action == 'create')
|
|||
|
||||
// Ref Int
|
||||
print '<tr><td>'.$langs->trans('RefCustomer').'</td>';
|
||||
print '<td colspan="2"><input type="text" siez="5" name="ref_customer" id="ref_customer" value="'.GETPOST('ref_customer','alpha').'"></td></tr>';
|
||||
print '<td colspan="2"><input type="text" siez="5" name="ref_supplier" id="ref_supplier" value="'.GETPOST('ref_supplier','alpha').'"></td></tr>';
|
||||
|
||||
// Customer
|
||||
print '<tr>';
|
||||
|
|
@ -1129,9 +1129,9 @@ else
|
|||
|
||||
print '<tr>';
|
||||
print '<td width="20%">';
|
||||
print $form->editfieldkey("RefCustomer",'ref_customer',$object->ref_customer,$object,$user->rights->contrat->creer);
|
||||
print $form->editfieldkey("RefCustomer",'ref_supplier',$object->ref_supplier,$object,$user->rights->contrat->creer);
|
||||
print '</td><td>';
|
||||
print $form->editfieldval("RefCustomer",'ref_customer',$object->ref_customer,$object,$user->rights->contrat->creer);
|
||||
print $form->editfieldval("RefCustomer",'ref_supplier',$object->ref_supplier,$object,$user->rights->contrat->creer);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ class Contrat extends CommonObject
|
|||
var $id;
|
||||
var $ref;
|
||||
var $ref_ext;
|
||||
var $ref_customer;
|
||||
var $ref_supplier;
|
||||
var $socid;
|
||||
var $societe; // Objet societe
|
||||
var $statut=0; // 0=Draft,
|
||||
|
|
@ -402,7 +402,7 @@ class Contrat extends CommonObject
|
|||
$sql.= " fk_projet,";
|
||||
$sql.= " fk_commercial_signature, fk_commercial_suivi,";
|
||||
$sql.= " note_private, note_public, extraparams";
|
||||
$sql.= " ,ref_customer";
|
||||
$sql.= " ,ref_supplier";
|
||||
$sql.= " ,ref_ext";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."contrat";
|
||||
if ($ref)
|
||||
|
|
@ -422,7 +422,7 @@ class Contrat extends CommonObject
|
|||
{
|
||||
$this->id = $result["rowid"];
|
||||
$this->ref = (!isset($result["ref"]) || !$result["ref"]) ? $result["rowid"] : $result["ref"];
|
||||
$this->ref_customer = $result["ref_customer"];
|
||||
$this->ref_supplier = $result["ref_supplier"];
|
||||
$this->ref_ext = $result["ref_ext"];
|
||||
$this->statut = $result["statut"];
|
||||
$this->mise_en_service = $this->db->jdate($result["datemise"]);
|
||||
|
|
@ -724,7 +724,7 @@ class Contrat extends CommonObject
|
|||
// Insert contract
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."contrat (datec, fk_soc, fk_user_author, date_contrat,";
|
||||
$sql.= " fk_commercial_signature, fk_commercial_suivi, fk_projet,";
|
||||
$sql.= " ref, entity, note_private, note_public, ref_customer, ref_ext)";
|
||||
$sql.= " ref, entity, note_private, note_public, ref_supplier, ref_ext)";
|
||||
$sql.= " VALUES ('".$this->db->idate($now)."',".$this->socid.",".$user->id;
|
||||
$sql.= ", '".$this->db->idate($this->date_contrat)."'";
|
||||
$sql.= ",".($this->commercial_signature_id>0?$this->commercial_signature_id:"NULL");
|
||||
|
|
@ -734,7 +734,7 @@ class Contrat extends CommonObject
|
|||
$sql.= ", ".$conf->entity;
|
||||
$sql.= ", ".(!empty($this->note_private)?("'".$this->db->escape($this->note_private)."'"):"NULL");
|
||||
$sql.= ", ".(!empty($this->note_public)?("'".$this->db->escape($this->note_public)."'"):"NULL");
|
||||
$sql.= ", ".(!empty($this->ref_customer)?("'".$this->db->escape($this->ref_customer)."'"):"NULL");
|
||||
$sql.= ", ".(!empty($this->ref_supplier)?("'".$this->db->escape($this->ref_supplier)."'"):"NULL");
|
||||
$sql.= ", ".(!empty($this->ref_ext)?("'".$this->db->escape($this->ref_ext)."'"):"NULL");
|
||||
$sql.= ")";
|
||||
$resql=$this->db->query($sql);
|
||||
|
|
@ -986,7 +986,7 @@ class Contrat extends CommonObject
|
|||
// Clean parameters
|
||||
|
||||
if (isset($this->ref)) $this->ref=trim($this->ref);
|
||||
if (isset($this->ref_customer)) $this->ref_customer=trim($this->ref_customer);
|
||||
if (isset($this->ref_supplier)) $this->ref_supplier=trim($this->ref_supplier);
|
||||
if (isset($this->ref_ext)) $this->ref_ext=trim($this->ref_ext);
|
||||
if (isset($this->entity)) $this->entity=trim($this->entity);
|
||||
if (isset($this->statut)) $this->statut=trim($this->statut);
|
||||
|
|
@ -1010,7 +1010,7 @@ class Contrat extends CommonObject
|
|||
$sql = "UPDATE ".MAIN_DB_PREFIX."contrat SET";
|
||||
|
||||
$sql.= " ref=".(isset($this->ref)?"'".$this->db->escape($this->ref)."'":"null").",";
|
||||
$sql.= " ref_customer=".(isset($this->ref_customer)?"'".$this->db->escape($this->ref_customer)."'":"null").",";
|
||||
$sql.= " ref_supplier=".(isset($this->ref_supplier)?"'".$this->db->escape($this->ref_supplier)."'":"null").",";
|
||||
$sql.= " ref_ext=".(isset($this->ref_ext)?"'".$this->db->escape($this->ref_ext)."'":"null").",";
|
||||
$sql.= " entity=".$conf->entity.",";
|
||||
$sql.= " date_contrat=".(dol_strlen($this->date_contrat)!=0 ? "'".$this->db->idate($this->date_contrat)."'" : 'null').",";
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ $offset = $limit * $page ;
|
|||
|
||||
$search_nom=GETPOST('search_nom');
|
||||
$search_contract=GETPOST('search_contract');
|
||||
$search_ref_customer=GETPOST('search_ref_customer','alpha');
|
||||
$search_ref_supplier=GETPOST('search_ref_supplier','alpha');
|
||||
$sall=GETPOST('sall');
|
||||
$statut=GETPOST('statut')?GETPOST('statut'):1;
|
||||
$socid=GETPOST('socid');
|
||||
|
|
@ -75,7 +75,7 @@ $sql.= ' SUM('.$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NOT NULL AND
|
|||
$sql.= ' SUM('.$db->ifsql("cd.statut=5",1,0).') as nb_closed,';
|
||||
$sql.= " c.rowid as cid, c.ref, c.datec, c.date_contrat, c.statut,";
|
||||
$sql.= " s.nom, s.rowid as socid";
|
||||
$sql.= " ,c.ref_customer";
|
||||
$sql.= " ,c.ref_supplier";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."contrat as c";
|
||||
|
|
@ -90,8 +90,8 @@ if ($search_nom) {
|
|||
if ($search_contract) {
|
||||
$sql .= natural_search(array('c.rowid', 'c.ref'), $search_contract);
|
||||
}
|
||||
if (!empty($search_ref_customer)) {
|
||||
$sql .= natural_search(array('c.ref_customer'), $search_ref_customer);
|
||||
if (!empty($search_ref_supplier)) {
|
||||
$sql .= natural_search(array('c.ref_supplier'), $search_ref_supplier);
|
||||
}
|
||||
if ($sall) {
|
||||
$sql .= natural_search(array('s.nom', 'cd.label', 'cd.description'), $sall);
|
||||
|
|
@ -114,9 +114,9 @@ if ($resql)
|
|||
print '<tr class="liste_titre">';
|
||||
$param='&search_contract='.$search_contract;
|
||||
$param.='&search_nom='.$search_nom;
|
||||
$param.='&search_ref_customer='.$search_ref_customer;
|
||||
$param.='&search_ref_supplier='.$search_ref_supplier;
|
||||
print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "c.rowid","","$param",'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("RefCustomer"), $_SERVER["PHP_SELF"], "c.ref_customer","","$param",'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("RefCustomer"), $_SERVER["PHP_SELF"], "c.ref_supplier","","$param",'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Company"), $_SERVER["PHP_SELF"], "s.nom","","$param",'',$sortfield,$sortorder);
|
||||
//print_liste_field_titre($langs->trans("DateCreation"), $_SERVER["PHP_SELF"], "c.datec","","$param",'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("DateContract"), $_SERVER["PHP_SELF"], "c.date_contrat","","$param",'align="center"',$sortfield,$sortorder);
|
||||
|
|
@ -134,7 +134,7 @@ if ($resql)
|
|||
print '<input type="text" class="flat" size="3" name="search_contract" value="'.$search_contract.'">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre">';
|
||||
print '<input type="text" class="flat" size="7" name="search_ref_customer value="'.$search_ref_customer.'">';
|
||||
print '<input type="text" class="flat" size="7" name="search_ref_supplier value="'.$search_ref_supplier.'">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre">';
|
||||
print '<input type="text" class="flat" size="24" name="search_nom" value="'.$search_nom.'">';
|
||||
|
|
@ -156,7 +156,7 @@ if ($resql)
|
|||
print img_object($langs->trans("ShowContract"),"contract").' '.(isset($obj->ref) ? $obj->ref : $obj->cid) .'</a>';
|
||||
if ($obj->nb_late) print img_warning($langs->trans("Late"));
|
||||
print '</td>';
|
||||
print '<td>'.$obj->ref_customer.'</td>';
|
||||
print '<td>'.$obj->ref_supplier.'</td>';
|
||||
print '<td><a href="../comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->nom.'</a></td>';
|
||||
//print '<td align="center">'.dol_print_date($obj->datec).'</td>';
|
||||
print '<td align="center">'.dol_print_date($db->jdate($obj->date_contrat)).'</td>';
|
||||
|
|
|
|||
|
|
@ -47,9 +47,9 @@ ALTER TABLE llx_user ADD COLUMN fk_user_modif integer AFTER fk_user_creat;
|
|||
|
||||
-- Add module accounting Expert
|
||||
ALTER TABLE llx_bookkeeping RENAME TO llx_accounting_bookkeeping; -- To update old user of module Accounting Expert
|
||||
|
||||
|
||||
CREATE TABLE llx_accounting_bookkeeping
|
||||
|
||||
CREATE TABLE llx_accounting_bookkeeping
|
||||
(
|
||||
rowid integer NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
doc_date date NOT NULL,
|
||||
|
|
@ -79,7 +79,7 @@ ALTER TABLE llx_accountingaccount add column tms timestamp AFTER datec;
|
|||
ALTER TABLE llx_accountingaccount add column fk_user_author integer DEFAULT NULL AFTER label;
|
||||
ALTER TABLE llx_accountingaccount add column fk_user_modif integer DEFAULT NULL AFTER fk_user_author;
|
||||
|
||||
-- Qual
|
||||
-- Qual
|
||||
UPDATE llx_const SET name = 'ACCOUNTING_MODE' WHERE name = 'COMPTA_MODE';
|
||||
UPDATE llx_const SET name = 'ACCOUNTING_ACCOUNT_CUSTOMER' WHERE name = 'COMPTA_ACCOUNT_CUSTOMER';
|
||||
UPDATE llx_const SET name = 'ACCOUNTING_ACCOUNT_SUPPLIER' WHERE name = 'COMPTA_ACCOUNT_SUPPLIER';
|
||||
|
|
@ -204,7 +204,7 @@ create table llx_accounting_fiscalyear
|
|||
)ENGINE=innodb;
|
||||
|
||||
ALTER TABLE llx_contrat ADD COLUMN ref_ext varchar(30) after ref;
|
||||
ALTER TABLE llx_contrat ADD COLUMN ref_customer varchar(30) after ref_ext;
|
||||
ALTER TABLE llx_contrat ADD COLUMN ref_supplier varchar(30) after ref_ext;
|
||||
|
||||
ALTER TABLE llx_propal ADD COLUMN fk_shipping_method integer AFTER date_livraison;
|
||||
ALTER TABLE llx_commande ADD COLUMN fk_shipping_method integer AFTER date_livraison;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user