Merge branch 'develop' of ssh://git@github.com/Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2012-03-14 11:50:22 +01:00
commit fafc61b1d9
139 changed files with 381 additions and 883 deletions

View File

@ -201,19 +201,6 @@ if ($action == 'create')
} }
print '</td></tr>'; print '</td></tr>';
// Delivery address
if ($conf->global->PROPALE_ADD_DELIVERY_ADDRESS)
{
print '<tr><td>'.$langs->trans('DeliveryAddress').'</td>';
print '<td colspan="3">';
$numaddress = $form->select_address($soc->fk_delivery_address, $_GET['socid'],'fk_address',1);
if ($numaddress==0)
{
print ' &nbsp; <a href=../comm/address.php?socid='.$soc->id.'&action=create>'.$langs->trans("AddAddress").'</a>';
}
print '</td></tr>';
}
// Model // Model
print '<tr>'; print '<tr>';
print '<td>'.$langs->trans("DefaultModel").'</td>'; print '<td>'.$langs->trans("DefaultModel").'</td>';

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2010 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -20,7 +20,7 @@
/** /**
* \file htdocs/comm/address.php * \file htdocs/comm/address.php
* \ingroup societe * \ingroup societe
* \brief Tab address of customer * \brief Tab address of thirdparty
*/ */
require("../main.inc.php"); require("../main.inc.php");
@ -31,58 +31,63 @@ require_once(DOL_DOCUMENT_ROOT."/societe/class/address.class.php");
$langs->load("companies"); $langs->load("companies");
$langs->load("commercial"); $langs->load("commercial");
$id = isset($_GET["id"])?$_GET["id"]:''; $id = GETPOST('id','int');
$origin = isset($_GET["origin"])?$_GET["origin"]:''; $action = GETPOST('action','alpha');
$originid = isset($_GET["originid"])?$_GET["originid"]:''; $confirm = GETPOST('confirm','alpha');
$socid = isset($_REQUEST["socid"])?$_REQUEST["socid"]:''; $origin = GETPOST('origin','alpha');
if (! $socid && ($_REQUEST["action"] != 'create' && $_REQUEST["action"] != 'add' && $_REQUEST["action"] != 'update')) accessforbidden(); $originid = GETPOST('originid','int');
$socid = GETPOST('socid','int');
if (! $socid && ($action != 'create' && $action != 'add' && $action != 'update')) accessforbidden();
// Security check // Security check
if ($user->societe_id) $socid=$user->societe_id; if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'societe', $socid); $result = restrictedArea($user, 'societe', $socid);
$object = new Address($db);
/* /*
* Actions * Actions
*/ */
if ($_POST["action"] == 'add' || $_POST["action"] == 'update') if ($action == 'add' || $action == 'update')
{ {
$address = new Address($db); $object->socid = $socid;
$object->label = ($_POST["label"]!=$langs->trans('RequiredField')?$_POST["label"]:'');
$address->socid = $_POST["socid"]; $object->name = ($_POST["name"]!=$langs->trans('RequiredField')?$_POST["name"]:'');
$address->label = ($_POST["label"]!=$langs->trans('RequiredField')?$_POST["label"]:''); $object->address = $_POST["address"];
$address->name = ($_POST["name"]!=$langs->trans('RequiredField')?$_POST["name"]:''); $object->cp = $_POST["zipcode"];
$address->address = $_POST["address"]; $object->ville = $_POST["town"];
$address->cp = $_POST["zipcode"]; $object->zip = $_POST["zipcode"];
$address->ville = $_POST["town"]; $object->town = $_POST["town"];
$address->zip = $_POST["zipcode"]; $object->pays_id = $_POST["country_id"];
$address->town = $_POST["town"]; $object->country_id= $_POST["country_id"];
$address->pays_id = $_POST["country_id"]; $object->tel = $_POST["tel"];
$address->country_id= $_POST["country_id"]; $object->fax = $_POST["fax"];
$address->tel = $_POST["tel"]; $object->note = $_POST["note"];
$address->fax = $_POST["fax"];
$address->note = $_POST["note"]; // Add new address
if ($action == 'add')
if ($_POST["action"] == 'add')
{ {
$socid = $_POST["socid"]; $result = $object->create($socid, $user);
$origin = $_POST["origin"];
$originid = $_POST["originid"];
$result = $address->create($socid, $user);
if ($result >= 0) if ($result >= 0)
{ {
if ($origin == 'commande') if ($origin == 'commande')
{ {
Header("Location: ../commande/fiche.php?action=editdelivery_adress&socid=".$socid."&id=".$originid); Header("Location: ../commande/contact.php?action=editdelivery_adress&socid=".$socid."&id=".$originid);
exit; exit;
} }
elseif ($origin == 'propal') elseif ($origin == 'propal')
{ {
Header("Location: ../comm/propal.php?action=editdelivery_adress&socid=".$socid."&id=".$originid); Header("Location: ../comm/propal/contact.php?action=editdelivery_adress&socid=".$socid."&id=".$originid);
exit; exit;
} }
elseif ($origin == 'shipment')
{
Header("Location: ../expedition/fiche.php?id=".$originid);
exit;
}
else else
{ {
Header("Location: ".$_SERVER['PHP_SELF']."?socid=".$socid); Header("Location: ".$_SERVER['PHP_SELF']."?socid=".$socid);
@ -91,28 +96,26 @@ if ($_POST["action"] == 'add' || $_POST["action"] == 'update')
} }
else else
{ {
$mesg = $address->error; $mesg = $object->error;
$_GET["action"]='create'; $action='create';
} }
} }
if ($_POST["action"] == 'update') // Update address
else if ($action == 'update')
{ {
$socid = $_POST["socid"]; $result = $object->update($_POST["id"], $socid, $user);
$origin = $_POST["origin"];
$originid = $_POST["originid"];
$result = $address->update($_POST["id"], $socid, $user);
if ($result >= 0) if ($result >= 0)
{ {
if ($origin == 'commande') if ($origin == 'commande')
{ {
Header("Location: ../commande/fiche.php?id=".$originid); Header("Location: ../commande/contact.php?id=".$originid);
exit; exit;
} }
elseif ($origin == 'propal') elseif ($origin == 'propal')
{ {
Header("Location: ../comm/propal.php?id=".$originid); Header("Location: ../comm/propal/contact.php?id=".$originid);
exit; exit;
} }
elseif ($origin == 'shipment') elseif ($origin == 'shipment')
@ -129,17 +132,16 @@ if ($_POST["action"] == 'add' || $_POST["action"] == 'update')
else else
{ {
$reload = 0; $reload = 0;
$mesg = $address->error; $mesg = $object->error;
$_GET["action"]= "edit"; $actino= "edit";
} }
} }
} }
if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == 'yes' && $user->rights->societe->supprimer) else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->societe->supprimer)
{ {
$address = new Address($db); $result = $object->delete($id, $socid);
$result = $address->delete($_GET["id"], $socid);
if ($result == 0) if ($result == 0)
{ {
@ -149,7 +151,7 @@ if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == 'yes' && $user-
else else
{ {
$reload = 0; $reload = 0;
$_GET["action"]=''; $action='';
} }
} }
@ -167,7 +169,7 @@ $countrynotdefined=$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("Se
dol_htmloutput_errors($mesg); dol_htmloutput_errors($mesg);
if ($_GET["action"] == 'create' || $_POST["action"] == 'create') if ($action == 'create')
{ {
if ($user->rights->societe->creer) if ($user->rights->societe->creer)
{ {
@ -175,8 +177,6 @@ if ($_GET["action"] == 'create' || $_POST["action"] == 'create')
* Creation * Creation
*/ */
$address = new Address($db);
$societe=new Societe($db); $societe=new Societe($db);
$societe->fetch($socid); $societe->fetch($socid);
$head = societe_prepare_head($societe); $head = societe_prepare_head($societe);
@ -185,35 +185,35 @@ if ($_GET["action"] == 'create' || $_POST["action"] == 'create')
if ($_POST["label"] && $_POST["name"]) if ($_POST["label"] && $_POST["name"])
{ {
$address->socid = $_POST["socid"]; $object->socid = $socid;
$address->label = $_POST["label"]; $object->label = $_POST["label"];
$address->name = $_POST["name"]; $object->name = $_POST["name"];
$address->address = $_POST["address"]; $object->address = $_POST["address"];
$address->cp = $_POST["zipcode"]; $object->cp = $_POST["zipcode"];
$address->ville = $_POST["town"]; $object->ville = $_POST["town"];
$address->tel = $_POST["tel"]; $object->tel = $_POST["tel"];
$address->fax = $_POST["fax"]; $object->fax = $_POST["fax"];
$address->note = $_POST["note"]; $object->note = $_POST["note"];
} }
// On positionne pays_id, pays_code et libelle du pays choisi // On positionne pays_id, pays_code et libelle du pays choisi
$address->country_id=$_POST["country_id"]?$_POST["country_id"]:$mysoc->country_id; $object->country_id=$_POST["country_id"]?$_POST["country_id"]:$mysoc->country_id;
if ($address->country_id) if ($object->country_id)
{ {
$tmparray=getCountry($address->country_id,'all'); $tmparray=getCountry($object->country_id,'all');
$address->pays_code = $tmparray['code']; $object->pays_code = $tmparray['code'];
$address->pays = $tmparray['label']; $object->pays = $tmparray['label'];
$address->country_code = $tmparray['code']; $object->country_code = $tmparray['code'];
$address->country = $tmparray['label']; $object->country = $tmparray['label'];
} }
print_titre($langs->trans("AddAddress")); print_titre($langs->trans("AddAddress"));
print "<br>\n"; print "<br>\n";
if ($address->error) if ($object->error)
{ {
print '<div class="error">'; print '<div class="error">';
print nl2br($address->error); print nl2br($object->error);
print '</div>'; print '</div>';
} }
@ -221,23 +221,23 @@ if ($_GET["action"] == 'create' || $_POST["action"] == 'create')
if ($conf->use_javascript_ajax) if ($conf->use_javascript_ajax)
{ {
print "\n".'<script type="text/javascript" language="javascript">'; print "\n".'<script type="text/javascript" language="javascript">';
print 'jQuery(document).ready(function () { print '$(document).ready(function () {
jQuery("#label").focus(function() { $("#label").focus(function() {
hideMessage("label","'.$langs->trans('RequiredField').'"); hideMessage("label","'.$langs->trans('RequiredField').'");
}); });
jQuery("#label").blur(function() { $("#label").blur(function() {
displayMessage("label","'.$langs->trans('RequiredField').'"); displayMessage("label","'.$langs->trans('RequiredField').'");
}); });
jQuery("#name").focus(function() { $("#name").focus(function() {
hideMessage("name","'.$langs->trans('RequiredField').'"); hideMessage("name","'.$langs->trans('RequiredField').'");
}); });
jQuery("#name").blur(function() { $("#name").blur(function() {
displayMessage("name","'.$langs->trans('RequiredField').'"); displayMessage("name","'.$langs->trans('RequiredField').'");
}); });
displayMessage("label","'.$langs->trans('RequiredField').'"); displayMessage("label","'.$langs->trans('RequiredField').'");
displayMessage("name","'.$langs->trans('RequiredField').'"); displayMessage("name","'.$langs->trans('RequiredField').'");
jQuery("#label").css("color","grey"); $("#label").css("color","grey");
jQuery("#name").css("color","grey"); $("#name").css("color","grey");
})'; })';
print '</script>'."\n"; print '</script>'."\n";
} }
@ -251,33 +251,33 @@ if ($_GET["action"] == 'create' || $_POST["action"] == 'create')
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
print '<tr><td class="fieldrequired">'.$langs->trans('Label').'</td><td><input type="text" size="30" name="label" id="label" value="'.($address->label?$address->label:$langs->trans('RequiredField')).'"></td></tr>'; print '<tr><td class="fieldrequired">'.$langs->trans('Label').'</td><td><input type="text" size="30" name="label" id="label" value="'.($object->label?$object->label:$langs->trans('RequiredField')).'"></td></tr>';
print '<tr><td class="fieldrequired">'.$langs->trans('Name').'</td><td><input type="text" size="30" name="name" id="name" value="'.($address->name?$address->name:$langs->trans('RequiredField')).'"></td></tr>'; print '<tr><td class="fieldrequired">'.$langs->trans('Name').'</td><td><input type="text" size="30" name="name" id="name" value="'.($object->name?$object->name:$langs->trans('RequiredField')).'"></td></tr>';
print '<tr><td valign="top">'.$langs->trans('Address').'</td><td colspan="3"><textarea name="address" cols="40" rows="3" wrap="soft">'; print '<tr><td valign="top">'.$langs->trans('Address').'</td><td colspan="3"><textarea name="address" cols="40" rows="3" wrap="soft">';
print $address->address; print $object->address;
print '</textarea></td></tr>'; print '</textarea></td></tr>';
// Zip // Zip
print '<tr><td>'.$langs->trans('Zip').'</td><td>'; print '<tr><td>'.$langs->trans('Zip').'</td><td>';
print $formcompany->select_ziptown($address->cp,'zipcode',array('town','selectcountry_id'),6); print $formcompany->select_ziptown($object->cp,'zipcode',array('town','selectcountry_id'),6);
print '</td></tr>'; print '</td></tr>';
// Town // Town
print '<tr><td>'.$langs->trans('Town').'</td><td>'; print '<tr><td>'.$langs->trans('Town').'</td><td>';
print $formcompany->select_ziptown($address->ville,'town',array('zipcode','selectcountry_id')); print $formcompany->select_ziptown($object->ville,'town',array('zipcode','selectcountry_id'));
print '</td></tr>'; print '</td></tr>';
print '<tr><td width="25%">'.$langs->trans('Country').'</td><td colspan="3">'; print '<tr><td width="25%">'.$langs->trans('Country').'</td><td colspan="3">';
print $form->select_country($address->country_id,'selectcountry_id'); print $form->select_country($object->country_id,'selectcountry_id');
print '</td></tr>'; print '</td></tr>';
print '<tr><td>'.$langs->trans('Phone').'</td><td><input type="text" name="tel" value="'.$address->tel.'"></td></tr>'; print '<tr><td>'.$langs->trans('Phone').'</td><td><input type="text" name="tel" value="'.$object->tel.'"></td></tr>';
print '<tr><td>'.$langs->trans('Fax').'</td><td><input type="text" name="fax" value="'.$address->fax.'"></td></tr>'; print '<tr><td>'.$langs->trans('Fax').'</td><td><input type="text" name="fax" value="'.$object->fax.'"></td></tr>';
print '<tr><td>'.$langs->trans('Note').'</td><td colspan="3"><textarea name="note" cols="40" rows="6" wrap="soft">'; print '<tr><td>'.$langs->trans('Note').'</td><td colspan="3"><textarea name="note" cols="40" rows="6" wrap="soft">';
print $address->note; print $object->note;
print '</textarea></td></tr>'; print '</textarea></td></tr>';
print '</table>'."\n"; print '</table>'."\n";
@ -289,15 +289,14 @@ if ($_GET["action"] == 'create' || $_POST["action"] == 'create')
} }
} }
elseif ($_GET["action"] == 'edit' || $_POST["action"] == 'edit') elseif ($action == 'edit')
{ {
/* /*
* Fiche societe en mode edition * Fiche societe en mode edition
*/ */
$address = new Address($db);
$societe=new Societe($db); $societe=new Societe($db);
$societe->fetch($_GET["socid"]); $societe->fetch($socid);
$head = societe_prepare_head($societe); $head = societe_prepare_head($societe);
dol_fiche_head($head, 'customer', $societe->nom); dol_fiche_head($head, 'customer', $societe->nom);
@ -309,78 +308,78 @@ elseif ($_GET["action"] == 'edit' || $_POST["action"] == 'edit')
{ {
if ($reload || ! $_POST["name"]) if ($reload || ! $_POST["name"])
{ {
$address->socid = $socid; $object->socid = $socid;
$address->fetch_address($id); $object->fetch_address($id);
} }
else else
{ {
$address->id = $_POST["id"]; $object->id = $id;
$address->socid = $_POST["socid"]; $object->socid = $socid;
$address->label = $_POST["label"]; $object->label = $_POST["label"];
$address->name = $_POST["name"]; $object->name = $_POST["name"];
$address->address = $_POST["address"]; $object->address = $_POST["address"];
$address->cp = $_POST["zipcode"]; $object->cp = $_POST["zipcode"];
$address->ville = $_POST["town"]; $object->ville = $_POST["town"];
$address->country_id = $_POST["country_id"]?$_POST["country_id"]:$mysoc->country_id; $object->country_id = $_POST["country_id"]?$_POST["country_id"]:$mysoc->country_id;
$address->tel = $_POST["tel"]; $object->tel = $_POST["tel"];
$address->fax = $_POST["fax"]; $object->fax = $_POST["fax"];
$address->note = $_POST["note"]; $object->note = $_POST["note"];
// On positionne country_id, pays_code et libelle du pays choisi // On positionne country_id, pays_code et libelle du pays choisi
if ($address->country_id) if ($object->country_id)
{ {
$tmparray=getCountry($address->country_id,'all'); $tmparray=getCountry($object->country_id,'all');
$address->pays_code = $tmparray['code']; $object->pays_code = $tmparray['code'];
$address->pays = $tmparray['label']; $object->pays = $tmparray['label'];
$address->country_code = $tmparray['code']; $object->country_code = $tmparray['code'];
$address->country = $tmparray['label']; $object->country = $tmparray['label'];
} }
} }
if ($address->error) if ($object->error)
{ {
print '<div class="error">'; print '<div class="error">';
print $address->error; print $object->error;
print '</div>'; print '</div>';
} }
print '<form action="'.$_SERVER['PHP_SELF'].'?socid='.$address->socid.'" method="POST" name="formsoc">'; print '<form action="'.$_SERVER['PHP_SELF'].'?socid='.$object->socid.'" method="POST" name="formsoc">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="update">'; print '<input type="hidden" name="action" value="update">';
print '<input type="hidden" name="socid" value="'.$address->socid.'">'; print '<input type="hidden" name="socid" value="'.$object->socid.'">';
print '<input type="hidden" name="origin" value="'.$origin.'">'; print '<input type="hidden" name="origin" value="'.$origin.'">';
print '<input type="hidden" name="originid" value="'.$originid.'">'; print '<input type="hidden" name="originid" value="'.$originid.'">';
print '<input type="hidden" name="id" value="'.$address->id.'">'; print '<input type="hidden" name="id" value="'.$object->id.'">';
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
print '<tr><td>'.$langs->trans('AddressLabel').'</td><td colspan="3"><input type="text" size="40" name="label" value="'.$address->label.'"></td></tr>'; print '<tr><td>'.$langs->trans('AddressLabel').'</td><td colspan="3"><input type="text" size="40" name="label" value="'.$object->label.'"></td></tr>';
print '<tr><td>'.$langs->trans('Name').'</td><td colspan="3"><input type="text" size="40" name="name" value="'.$address->name.'"></td></tr>'; print '<tr><td>'.$langs->trans('Name').'</td><td colspan="3"><input type="text" size="40" name="name" value="'.$object->name.'"></td></tr>';
print '<tr><td valign="top">'.$langs->trans('Address').'</td><td colspan="3"><textarea name="address" cols="40" rows="3" wrap="soft">'; print '<tr><td valign="top">'.$langs->trans('Address').'</td><td colspan="3"><textarea name="address" cols="40" rows="3" wrap="soft">';
print $address->address; print $object->address;
print '</textarea></td></tr>'; print '</textarea></td></tr>';
// Zip // Zip
print '<tr><td>'.$langs->trans('Zip').'</td><td>'; print '<tr><td>'.$langs->trans('Zip').'</td><td>';
print $formcompany->select_ziptown($address->cp,'zipcode',array('town','selectcountry_id'),6); print $formcompany->select_ziptown($object->cp,'zipcode',array('town','selectcountry_id'),6);
print '</td></tr>'; print '</td></tr>';
// Town // Town
print '<tr><td>'.$langs->trans('Town').'</td><td>'; print '<tr><td>'.$langs->trans('Town').'</td><td>';
print $formcompany->select_ziptown($address->ville,'town',array('zipcode','selectcountry_id')); print $formcompany->select_ziptown($object->ville,'town',array('zipcode','selectcountry_id'));
print '</td></tr>'; print '</td></tr>';
print '<tr><td>'.$langs->trans('Country').'</td><td colspan="3">'; print '<tr><td>'.$langs->trans('Country').'</td><td colspan="3">';
print $form->select_country($address->country_id,'country_id'); print $form->select_country($object->country_id,'country_id');
print '</td></tr>'; print '</td></tr>';
print '<tr><td>'.$langs->trans('Phone').'</td><td><input type="text" name="tel" value="'.$address->tel.'"></td></tr>'; print '<tr><td>'.$langs->trans('Phone').'</td><td><input type="text" name="tel" value="'.$object->tel.'"></td></tr>';
print '<tr><td>'.$langs->trans('Fax').'</td><td><input type="text" name="fax" value="'.$address->fax.'"></td></tr>'; print '<tr><td>'.$langs->trans('Fax').'</td><td><input type="text" name="fax" value="'.$object->fax.'"></td></tr>';
print '<tr><td>'.$langs->trans('Note').'</td><td colspan="3"><textarea name="note" cols="40" rows="6" wrap="soft">'; print '<tr><td>'.$langs->trans('Note').'</td><td colspan="3"><textarea name="note" cols="40" rows="6" wrap="soft">';
print $address->note; print $object->note;
print '</textarea></td></tr>'; print '</textarea></td></tr>';
print '<tr><td align="center" colspan="4"><input type="submit" class="button" value="'.$langs->trans("Save").'"></td></tr>'; print '<tr><td align="center" colspan="4"><input type="submit" class="button" value="'.$langs->trans("Save").'"></td></tr>';
@ -394,16 +393,16 @@ else
/* /*
* Fiche societe en mode visu * Fiche societe en mode visu
*/ */
$address = new Address($db);
$result=$address->fetch_lines($socid); $result=$object->fetch_lines($socid);
if ($result < 0) if ($result < 0)
{ {
dol_print_error($db,$address->error); dol_print_error($db,$object->error);
exit; exit;
} }
$societe=new Societe($db); $societe=new Societe($db);
$societe->fetch($address->socid); $societe->fetch($object->socid);
$head = societe_prepare_head($societe); $head = societe_prepare_head($societe);
dol_fiche_head($head, 'customer', $societe->nom); dol_fiche_head($head, 'customer', $societe->nom);
@ -413,18 +412,18 @@ else
if ($_GET["action"] == 'delete') if ($_GET["action"] == 'delete')
{ {
$form = new Form($db); $form = new Form($db);
$ret=$form->form_confirm($_SERVER['PHP_SELF']."?socid=".$address->socid."&amp;id=".$_GET["id"],$langs->trans("DeleteAddress"),$langs->trans("ConfirmDeleteAddress"),"confirm_delete"); $ret=$form->form_confirm($_SERVER['PHP_SELF']."?socid=".$object->socid."&amp;id=".$id,$langs->trans("DeleteAddress"),$langs->trans("ConfirmDeleteAddress"),"confirm_delete");
if ($ret == 'html') print '<br>'; if ($ret == 'html') print '<br>';
} }
if ($address->error) if ($object->error)
{ {
print '<div class="error">'; print '<div class="error">';
print $address->error; print $object->error;
print '</div>'; print '</div>';
} }
$nblines = count($address->lines); $nblines = count($object->lines);
if ($nblines) if ($nblines)
{ {
for ($i = 0 ; $i < $nblines ; $i++) for ($i = 0 ; $i < $nblines ; $i++)
@ -432,20 +431,20 @@ else
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
print '<tr><td width="20%">'.$langs->trans('AddressLabel').'</td><td colspan="3">'.$address->lines[$i]->label.'</td>'; print '<tr><td width="20%">'.$langs->trans('AddressLabel').'</td><td colspan="3">'.$object->lines[$i]->label.'</td>';
print '<td valign="top" colspan="2" width="50%" rowspan="6">'.$langs->trans('Note').' :<br>'.nl2br($address->lines[$i]->note).'</td></tr>'; print '<td valign="top" colspan="2" width="50%" rowspan="6">'.$langs->trans('Note').' :<br>'.nl2br($object->lines[$i]->note).'</td></tr>';
print '<tr><td width="20%">'.$langs->trans('Name').'</td><td colspan="3">'.$address->lines[$i]->name.'</td></tr>'; print '<tr><td width="20%">'.$langs->trans('Name').'</td><td colspan="3">'.$object->lines[$i]->name.'</td></tr>';
print "<tr><td valign=\"top\">".$langs->trans('Address')."</td><td colspan=\"3\">".nl2br($address->lines[$i]->address)."</td></tr>"; print "<tr><td valign=\"top\">".$langs->trans('Address')."</td><td colspan=\"3\">".nl2br($object->lines[$i]->address)."</td></tr>";
print '<tr><td width="25%">'.$langs->trans('Zip').'</td><td width="25%">'.$address->lines[$i]->cp."</td></tr>"; print '<tr><td width="25%">'.$langs->trans('Zip').'</td><td width="25%">'.$object->lines[$i]->cp."</td></tr>";
print '<tr><td width="25%">'.$langs->trans('Town').'</td><td width="25%">'.$address->lines[$i]->ville."</td></tr>"; print '<tr><td width="25%">'.$langs->trans('Town').'</td><td width="25%">'.$object->lines[$i]->ville."</td></tr>";
print '<tr><td>'.$langs->trans('Country').'</td><td colspan="3">'.$address->lines[$i]->pays.'</td>'; print '<tr><td>'.$langs->trans('Country').'</td><td colspan="3">'.$object->lines[$i]->pays.'</td>';
print '<tr><td>'.$langs->trans('Phone').'</td><td>'.dol_print_phone($address->lines[$i]->tel,$address->lines[$i]->country_code,0,$address->socid,'AC_TEL').'</td></tr>'; print '<tr><td>'.$langs->trans('Phone').'</td><td>'.dol_print_phone($object->lines[$i]->tel,$object->lines[$i]->country_code,0,$object->socid,'AC_TEL').'</td></tr>';
print '<tr><td>'.$langs->trans('Fax').'</td><td>'.dol_print_phone($address->lines[$i]->fax,$address->lines[$i]->country_code,0,$address->socid,'AC_FAX').'</td></tr>'; print '<tr><td>'.$langs->trans('Fax').'</td><td>'.dol_print_phone($object->lines[$i]->fax,$object->lines[$i]->country_code,0,$object->socid,'AC_FAX').'</td></tr>';
print '</td></tr>'; print '</td></tr>';
@ -460,12 +459,12 @@ else
if ($user->rights->societe->creer) if ($user->rights->societe->creer)
{ {
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?socid='.$address->socid.'&amp;id='.$address->lines[$i]->id.'&amp;action=edit">'.$langs->trans("Modify").'</a>'; print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?socid='.$object->socid.'&amp;id='.$object->lines[$i]->id.'&amp;action=edit">'.$langs->trans("Modify").'</a>';
} }
if ($user->rights->societe->supprimer) if ($user->rights->societe->supprimer)
{ {
print '<a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?socid='.$address->socid.'&amp;id='.$address->lines[$i]->id.'&amp;action=delete">'.$langs->trans("Delete").'</a>'; print '<a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?socid='.$object->socid.'&amp;id='.$object->lines[$i]->id.'&amp;action=delete">'.$langs->trans("Delete").'</a>';
} }
@ -484,21 +483,20 @@ else
* Bouton actions * Bouton actions
*/ */
if ($_GET["action"] == '') if ($action == '')
{ {
print '<div class="tabsAction">'; print '<div class="tabsAction">';
if ($user->rights->societe->creer) if ($user->rights->societe->creer)
{ {
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?socid='.$address->socid.'&amp;action=create">'.$langs->trans("Add").'</a>'; print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?socid='.$object->socid.'&amp;action=create">'.$langs->trans("Add").'</a>';
} }
print '</div>'; print '</div>';
} }
} }
$db->close(); $db->close();
llxFooter(); llxFooter();
?> ?>

View File

@ -37,7 +37,6 @@ if ($conf->commande->enabled) require_once(DOL_DOCUMENT_ROOT."/commande/class/co
if ($conf->contrat->enabled) require_once(DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php"); if ($conf->contrat->enabled) require_once(DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php");
if ($conf->adherent->enabled) require_once(DOL_DOCUMENT_ROOT."/adherents/class/adherent.class.php"); if ($conf->adherent->enabled) require_once(DOL_DOCUMENT_ROOT."/adherents/class/adherent.class.php");
if ($conf->ficheinter->enabled) require_once(DOL_DOCUMENT_ROOT."/fichinter/class/fichinter.class.php"); if ($conf->ficheinter->enabled) require_once(DOL_DOCUMENT_ROOT."/fichinter/class/fichinter.class.php");
if (!empty($conf->global->MAIN_MODULE_CHRONODOCS)) require_once(DOL_DOCUMENT_ROOT."/chronodocs/chronodocs_entries.class.php");
$langs->load("companies"); $langs->load("companies");
if ($conf->contrat->enabled) $langs->load("contracts"); if ($conf->contrat->enabled) $langs->load("contracts");
@ -46,7 +45,6 @@ if ($conf->facture->enabled) $langs->load("bills");
if ($conf->projet->enabled) $langs->load("projects"); if ($conf->projet->enabled) $langs->load("projects");
if ($conf->ficheinter->enabled) $langs->load("interventions"); if ($conf->ficheinter->enabled) $langs->load("interventions");
if ($conf->notification->enabled) $langs->load("mails"); if ($conf->notification->enabled) $langs->load("mails");
if (!empty($conf->global->MAIN_MODULE_CHRONODOCS)) $langs->load("chronodocs");
// Security check // Security check
$id = (GETPOST('socid','int') ? GETPOST('socid','int') : GETPOST('id','int')); $id = (GETPOST('socid','int') ? GETPOST('socid','int') : GETPOST('id','int'));

View File

@ -246,13 +246,6 @@ else if ($action == 'setdate_livraison')
if ($result < 0) dol_print_error($db,$object->error); if ($result < 0) dol_print_error($db,$object->error);
} }
else if ($action == 'setaddress' && $user->rights->propale->creer)
{
$object->fetch($id);
$result=$object->set_adresse_livraison($user,$_POST['fk_address']);
if ($result < 0) dol_print_error($db,$object->error);
}
// Positionne ref client // Positionne ref client
else if ($action == 'set_ref_client' && $user->rights->propale->creer) else if ($action == 'set_ref_client' && $user->rights->propale->creer)
{ {
@ -1340,29 +1333,6 @@ if ($id > 0 || ! empty($ref))
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
// Delivery address (deprecated)
if ($conf->global->PROPALE_ADD_DELIVERY_ADDRESS)
{
print '<tr><td>';
print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('DeliveryAddress');
print '</td>';
if ($action != 'editdelivery_address' && $object->brouillon) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editdelivery_address&amp;socid='.$object->socid.'&amp;id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetDeliveryAddress'),1).'</a></td>';
print '</tr></table>';
print '</td><td colspan="3">';
if ($action == 'editdelivery_address')
{
$formother->form_address($_SERVER['PHP_SELF'].'?id='.$object->id,$object->fk_delivery_address,GETPOST('socid','int'),'fk_address','propal',$object->id);
}
else
{
$formother->form_address($_SERVER['PHP_SELF'].'?id='.$object->id,$object->fk_delivery_address,GETPOST('socid','int'),'none','propal',$object->id);
}
print '</td></tr>';
}
// Delivery delay // Delivery delay
print '<tr><td>'; print '<tr><td>';
print '<table class="nobordernopadding" width="100%"><tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>';

View File

@ -1282,34 +1282,6 @@ class Propal extends CommonObject
} }
} }
/**
* Define delivery address
*
* @param User $user Object user that modify
* @param int $fk_address Delivery address id
* @return int <0 si ko, >0 si ok
*/
function set_adresse_livraison($user, $fk_address)
{
if ($user->rights->propale->creer)
{
$sql = "UPDATE ".MAIN_DB_PREFIX."propal SET fk_adresse_livraison = '".$fk_address."'";
$sql.= " WHERE rowid = ".$this->id." AND fk_statut = 0";
if ($this->db->query($sql) )
{
$this->fk_delivery_address = $fk_address;
return 1;
}
else
{
$this->error=$this->db->error();
dol_syslog("Propal::set_adresse_livraison Erreur SQL");
return -1;
}
}
}
/** /**
* Set delivery * Set delivery
* *
@ -1880,78 +1852,6 @@ class Propal extends CommonObject
} }
} }
/**
* Change the payments conditions of the invoice
*
* @param int $cond_reglement_id Id of new payment condition
* @return int >0 if OK, <0 if KO
* TODO deprecated
*/
function cond_reglement($cond_reglement_id)
{
dol_syslog('Propale::cond_reglement('.$cond_reglement_id.')');
if ($this->statut >= 0)
{
$sql = 'UPDATE '.MAIN_DB_PREFIX.'propal';
$sql .= ' SET fk_cond_reglement = '.$cond_reglement_id;
$sql .= ' WHERE rowid='.$this->id;
if ( $this->db->query($sql) )
{
$this->cond_reglement_id = $cond_reglement_id;
return 1;
}
else
{
dol_syslog('Propale::cond_reglement Erreur '.$sql.' - '.$this->db->error());
$this->error=$this->db->error();
return -1;
}
}
else
{
dol_syslog('Propale::cond_reglement, etat propale incompatible');
$this->error='Etat propale incompatible '.$this->statut;
return -2;
}
}
/**
* Change the payment mode
*
* @param int $mode_reglement_id Id of new payment mode
* @return int >0 if OK, <0 if KO
* TODO deprecated
*/
function mode_reglement($mode_reglement_id)
{
dol_syslog('Propale::mode_reglement('.$mode_reglement_id.')');
if ($this->statut >= 0)
{
$sql = 'UPDATE '.MAIN_DB_PREFIX.'propal';
$sql .= ' SET fk_mode_reglement = '.$mode_reglement_id;
$sql .= ' WHERE rowid='.$this->id;
if ( $this->db->query($sql) )
{
$this->mode_reglement_id = $mode_reglement_id;
return 1;
}
else
{
dol_syslog('Propale::mode_reglement Erreur '.$sql.' - '.$this->db->error());
$this->error=$this->db->error();
return -1;
}
}
else
{
dol_syslog('Propale::mode_reglement, etat propale incompatible');
$this->error='Etat facture incompatible '.$this->statut;
return -2;
}
}
/** /**
* Change the delivery time * Change the delivery time
* *

View File

@ -27,6 +27,7 @@ require("../../main.inc.php");
require_once(DOL_DOCUMENT_ROOT."/comm/propal/class/propal.class.php"); require_once(DOL_DOCUMENT_ROOT."/comm/propal/class/propal.class.php");
require_once(DOL_DOCUMENT_ROOT."/contact/class/contact.class.php"); require_once(DOL_DOCUMENT_ROOT."/contact/class/contact.class.php");
require_once(DOL_DOCUMENT_ROOT."/core/lib/propal.lib.php"); require_once(DOL_DOCUMENT_ROOT."/core/lib/propal.lib.php");
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formother.class.php");
require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'); require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php');
$langs->load("facture"); $langs->load("facture");
@ -43,6 +44,8 @@ $action=GETPOST('action', 'alpha');
if ($user->societe_id) $socid=$user->societe_id; if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'propale', $id, 'propal'); $result = restrictedArea($user, 'propale', $id, 'propal');
$object = new Propal($db);
/* /*
* Ajout d'un nouveau contact * Ajout d'un nouveau contact
@ -50,42 +53,38 @@ $result = restrictedArea($user, 'propale', $id, 'propal');
if ($action == 'addcontact' && $user->rights->propale->creer) if ($action == 'addcontact' && $user->rights->propale->creer)
{ {
$result = $object->fetch($id);
$result = 0;
$propal = new Propal($db);
$result = $propal->fetch($id);
if ($result > 0 && $id > 0) if ($result > 0 && $id > 0)
{ {
$result = $propal->add_contact($_POST["contactid"], $_POST["type"], $_POST["source"]); $result = $object->add_contact($_POST["contactid"], $_POST["type"], $_POST["source"]);
} }
if ($result >= 0) if ($result >= 0)
{ {
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$propal->id); Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit; exit;
} }
else else
{ {
if ($propal->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{ {
$langs->load("errors"); $langs->load("errors");
$mesg = '<div class="error">'.$langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType").'</div>'; $mesg = '<div class="error">'.$langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType").'</div>';
} }
else else
{ {
$mesg = '<div class="error">'.$propal->error.'</div>'; $mesg = '<div class="error">'.$object->error.'</div>';
} }
} }
} }
// Bascule du statut d'un contact // Bascule du statut d'un contact
if ($action == 'swapstatut' && $user->rights->propale->creer) else if ($action == 'swapstatut' && $user->rights->propale->creer)
{ {
$propal = new Propal($db); if ($object->fetch($id) > 0)
if ($propal->fetch($id) > 0)
{ {
$result=$propal->swapContactStatus(GETPOST('ligne')); $result=$object->swapContactStatus(GETPOST('ligne'));
} }
else else
{ {
@ -94,15 +93,14 @@ if ($action == 'swapstatut' && $user->rights->propale->creer)
} }
// Efface un contact // Efface un contact
if ($action == 'deleteline' && $user->rights->propale->creer) else if ($action == 'deleteline' && $user->rights->propale->creer)
{ {
$propal = new Propal($db); $object->fetch($id);
$propal->fetch($id); $result = $object->delete_contact($lineid);
$result = $propal->delete_contact($lineid);
if ($result >= 0) if ($result >= 0)
{ {
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$propal->id); Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit; exit;
} }
else else
@ -111,6 +109,13 @@ if ($action == 'deleteline' && $user->rights->propale->creer)
} }
} }
else if ($action == 'setaddress' && $user->rights->propale->creer)
{
$object->fetch($id);
$result=$object->setDeliveryAddress($_POST['fk_address']);
if ($result < 0) dol_print_error($db,$object->error);
}
/* /*
* View * View
@ -120,6 +125,7 @@ llxHeader('', $langs->trans("Proposal"), "Propal");
$form = new Form($db); $form = new Form($db);
$formcompany= new FormCompany($db); $formcompany= new FormCompany($db);
$formother = new FormOther($db);
$contactstatic=new Contact($db); $contactstatic=new Contact($db);
$userstatic=new User($db); $userstatic=new User($db);
@ -133,13 +139,12 @@ dol_htmloutput_mesg($mesg);
if ($id > 0 || ! empty($ref)) if ($id > 0 || ! empty($ref))
{ {
$propal = New Propal($db); if ($object->fetch($id,$ref) > 0)
if ($propal->fetch($id,$ref) > 0)
{ {
$soc = new Societe($db); $soc = new Societe($db);
$soc->fetch($propal->socid); $soc->fetch($object->socid);
$head = propal_prepare_head($propal); $head = propal_prepare_head($object);
dol_fiche_head($head, 'contact', $langs->trans("Proposal"), 0, 'propal'); dol_fiche_head($head, 'contact', $langs->trans("Proposal"), 0, 'propal');
/* /*
@ -151,7 +156,7 @@ if ($id > 0 || ! empty($ref))
// Ref // Ref
print '<tr><td width="25%">'.$langs->trans('Ref').'</td><td colspan="3">'; print '<tr><td width="25%">'.$langs->trans('Ref').'</td><td colspan="3">';
print $form->showrefnav($propal,'ref',$linkback,1,'ref','ref',''); print $form->showrefnav($object,'ref',$linkback,1,'ref','ref','');
print '</td></tr>'; print '</td></tr>';
// Ref client // Ref client
@ -161,15 +166,37 @@ if ($id > 0 || ! empty($ref))
print '</td>'; print '</td>';
print '</tr></table>'; print '</tr></table>';
print '</td><td colspan="3">'; print '</td><td colspan="3">';
print $propal->ref_client; print $object->ref_client;
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
// Customer // Customer
if ( is_null($propal->client) ) if (is_null($object->client)) $object->fetch_thirdparty();
$propal->fetch_thirdparty();
print "<tr><td>".$langs->trans("Company")."</td>"; print "<tr><td>".$langs->trans("Company")."</td>";
print '<td colspan="3">'.$propal->client->getNomUrl(1).'</td></tr>'; print '<td colspan="3">'.$object->client->getNomUrl(1).'</td></tr>';
// Delivery address
if ($conf->global->PROPALE_ADD_DELIVERY_ADDRESS)
{
print '<tr><td>';
print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('DeliveryAddress');
print '</td>';
if ($action != 'editdelivery_address' && $object->brouillon) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editdelivery_address&amp;socid='.$object->socid.'&amp;id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetDeliveryAddress'),1).'</a></td>';
print '</tr></table>';
print '</td><td colspan="3">';
if ($action == 'editdelivery_address')
{
$formother->form_address($_SERVER['PHP_SELF'].'?id='.$object->id,$object->fk_delivery_address,GETPOST('socid','int'),'fk_address','propal',$object->id);
}
else
{
$formother->form_address($_SERVER['PHP_SELF'].'?id='.$object->id,$object->fk_delivery_address,GETPOST('socid','int'),'none','propal',$object->id);
}
print '</td></tr>';
}
print "</table>"; print "</table>";
@ -215,11 +242,11 @@ if ($id > 0 || ! empty($ref))
print '<td>'; print '<td>';
// On recupere les id des users deja selectionnes // On recupere les id des users deja selectionnes
//$userAlreadySelected = $propal->getListContactId('internal'); // On ne doit pas desactiver un contact deja selectionne car on doit pouvoir le selectionner une deuxieme fois pour un autre type //$userAlreadySelected = $object->getListContactId('internal'); // On ne doit pas desactiver un contact deja selectionne car on doit pouvoir le selectionner une deuxieme fois pour un autre type
$form->select_users($user->id,'contactid',0,$userAlreadySelected); $form->select_users($user->id,'contactid',0,$userAlreadySelected);
print '</td>'; print '</td>';
print '<td>'; print '<td>';
$formcompany->selectTypeContact($propal, '', 'type','internal'); $formcompany->selectTypeContact($object, '', 'type','internal');
print '</td>'; print '</td>';
print '<td align="right" colspan="3" ><input type="submit" class="button" value="'.$langs->trans("Add").'"></td>'; print '<td align="right" colspan="3" ><input type="submit" class="button" value="'.$langs->trans("Add").'"></td>';
print '</tr>'; print '</tr>';
@ -241,8 +268,8 @@ if ($id > 0 || ! empty($ref))
print '</td>'; print '</td>';
print '<td>'; print '<td>';
$selectedCompany = isset($_GET["newcompany"])?$_GET["newcompany"]:$propal->client->id; $selectedCompany = isset($_GET["newcompany"])?$_GET["newcompany"]:$object->client->id;
$selectedCompany = $formcompany->selectCompaniesForNewContact($propal, 'id', $selectedCompany, 'newcompany'); $selectedCompany = $formcompany->selectCompaniesForNewContact($object, 'id', $selectedCompany, 'newcompany');
print '</td>'; print '</td>';
print '<td>'; print '<td>';
@ -250,7 +277,7 @@ if ($id > 0 || ! empty($ref))
if ($nbofcontacts == 0) print $langs->trans("NoContactDefined"); if ($nbofcontacts == 0) print $langs->trans("NoContactDefined");
print '</td>'; print '</td>';
print '<td>'; print '<td>';
$formcompany->selectTypeContact($propal, '', 'type','external'); $formcompany->selectTypeContact($object, '', 'type','external');
print '</td>'; print '</td>';
print '<td align="right" colspan="3" ><input type="submit" class="button" value="'.$langs->trans("Add").'"'; print '<td align="right" colspan="3" ><input type="submit" class="button" value="'.$langs->trans("Add").'"';
if (! $nbofcontacts) print ' disabled="disabled"'; if (! $nbofcontacts) print ' disabled="disabled"';
@ -278,7 +305,7 @@ if ($id > 0 || ! empty($ref))
foreach(array('internal','external') as $source) foreach(array('internal','external') as $source)
{ {
$tab = $propal->liste_contact(-1,$source); $tab = $object->liste_contact(-1,$source);
$num=count($tab); $num=count($tab);
$i = 0; $i = 0;
@ -335,9 +362,9 @@ if ($id > 0 || ! empty($ref))
// Statut // Statut
print '<td align="center">'; print '<td align="center">';
// Activation desativation du contact // Activation desativation du contact
if ($propal->statut >= 0) print '<a href="contact.php?id='.$propal->id.'&amp;action=swapstatut&amp;ligne='.$tab[$i]['rowid'].'">'; if ($object->statut >= 0) print '<a href="contact.php?id='.$object->id.'&amp;action=swapstatut&amp;ligne='.$tab[$i]['rowid'].'">';
print $contactstatic->LibStatut($tab[$i]['status'],3); print $contactstatic->LibStatut($tab[$i]['status'],3);
if ($propal->statut >= 0) print '</a>'; if ($object->statut >= 0) print '</a>';
print '</td>'; print '</td>';
// Icon update et delete // Icon update et delete
@ -345,7 +372,7 @@ if ($id > 0 || ! empty($ref))
if ($user->rights->propale->creer) if ($user->rights->propale->creer)
{ {
print '&nbsp;'; print '&nbsp;';
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$propal->id.'&amp;action=deleteline&amp;lineid='.$tab[$i]['rowid'].'">'; print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=deleteline&amp;lineid='.$tab[$i]['rowid'].'">';
print img_delete(); print img_delete();
print '</a>'; print '</a>';
} }
@ -364,8 +391,6 @@ if ($id > 0 || ! empty($ref))
} }
} }
llxFooter();
$db->close(); $db->close();
llxFooter();
?> ?>

View File

@ -1844,34 +1844,6 @@ class Commande extends CommonObject
} }
} }
/**
* Set address
*
* @param User $user Object user making change
* @param int $fk_address Adress of delivery
* @return int <0 ig KO, >0 if Ok
*/
function set_adresse_livraison($user, $fk_address)
{
if ($user->rights->commande->creer)
{
$sql = "UPDATE ".MAIN_DB_PREFIX."commande SET fk_adresse_livraison = '".$fk_address."'";
$sql.= " WHERE rowid = ".$this->id." AND fk_statut = 0";
if ($this->db->query($sql) )
{
$this->fk_delivery_address = $fk_address;
return 1;
}
else
{
$this->error=$this->db->error();
dol_syslog("Commande::set_adresse_livraison Erreur SQL");
return -1;
}
}
}
/** /**
* Set availability * Set availability
* *
@ -1975,77 +1947,6 @@ class Commande extends CommonObject
} }
} }
/**
* Change les conditions de reglement de la commande
*
* @param int $cond_reglement_id Id de la nouvelle condition de reglement
* @return int >0 if OK, <0 if KO
* TODO deprecated
*/
function cond_reglement($cond_reglement_id)
{
dol_syslog('Commande::cond_reglement('.$cond_reglement_id.')');
if ($this->statut >= 0)
{
$sql = 'UPDATE '.MAIN_DB_PREFIX.'commande';
$sql .= ' SET fk_cond_reglement = '.$cond_reglement_id;
$sql .= ' WHERE rowid='.$this->id;
if ( $this->db->query($sql) )
{
$this->cond_reglement_id = $cond_reglement_id;
return 1;
}
else
{
dol_syslog('Commande::cond_reglement Erreur '.$sql.' - '.$this->db->error(), LOG_ERR);
$this->error=$this->db->lasterror();
return -1;
}
}
else
{
dol_syslog('Commande::cond_reglement, etat commande incompatible', LOG_ERR);
$this->error='Etat commande incompatible '.$this->statut;
return -2;
}
}
/**
* Change le mode de reglement
*
* @param int $mode Id du nouveau mode
* @return int >0 si ok, <0 si ko
* TODO deprecated
*/
function mode_reglement($mode_reglement_id)
{
dol_syslog('Commande::mode_reglement('.$mode_reglement_id.')');
if ($this->statut >= 0)
{
$sql = 'UPDATE '.MAIN_DB_PREFIX.'commande';
$sql .= ' SET fk_mode_reglement = '.$mode_reglement_id;
$sql .= ' WHERE rowid='.$this->id;
if ( $this->db->query($sql) )
{
$this->mode_reglement_id = $mode_reglement_id;
return 1;
}
else
{
dol_syslog('Commande::mode_reglement Erreur '.$sql.' - '.$this->db->error(), LOG_ERR);
$this->error=$this->db->lasterror();
return -1;
}
}
else
{
dol_syslog('Commande::mode_reglement, etat facture incompatible', LOG_ERR);
$this->error='Etat commande incompatible '.$this->statut;
return -2;
}
}
/** /**
* Change le delai de livraison * Change le delai de livraison
* *

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2005 Patrick Rouillon <patrick@rouillon.net> /* Copyright (C) 2005 Patrick Rouillon <patrick@rouillon.net>
* Copyright (C) 2005-2011 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2005-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -27,61 +27,61 @@ require("../main.inc.php");
require_once(DOL_DOCUMENT_ROOT."/commande/class/commande.class.php"); require_once(DOL_DOCUMENT_ROOT."/commande/class/commande.class.php");
require_once(DOL_DOCUMENT_ROOT."/contact/class/contact.class.php"); require_once(DOL_DOCUMENT_ROOT."/contact/class/contact.class.php");
require_once(DOL_DOCUMENT_ROOT."/core/lib/order.lib.php"); require_once(DOL_DOCUMENT_ROOT."/core/lib/order.lib.php");
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formother.class.php");
require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'); require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php');
$langs->load("orders"); $langs->load("orders");
$langs->load("sendings"); $langs->load("sendings");
$langs->load("companies"); $langs->load("companies");
$comid = isset($_GET["id"])?$_GET["id"]:''; $id=GETPOST('id','int');
$ref=GETPOST('ref','alpha');
$action=GETPOST('action','alpha');
// Security check // Security check
if ($user->societe_id) $socid=$user->societe_id; if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'commande', $comid,''); $result = restrictedArea($user, 'commande', $id,'');
$object = new Commande($db);
/* /*
* Ajout d'un nouveau contact * Ajout d'un nouveau contact
*/ */
if ($_POST["action"] == 'addcontact' && $user->rights->commande->creer) if ($action == 'addcontact' && $user->rights->commande->creer)
{ {
$result = $object->fetch($id);
$result = 0; if ($result > 0 && $id > 0)
$commande = new Commande($db);
$result = $commande->fetch($_GET["id"]);
if ($result > 0 && $_GET["id"] > 0)
{ {
$result = $commande->add_contact($_POST["contactid"], $_POST["type"], $_POST["source"]); $result = $object->add_contact($_POST["contactid"], $_POST["type"], $_POST["source"]);
} }
if ($result >= 0) if ($result >= 0)
{ {
Header("Location: contact.php?id=".$commande->id); Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit; exit;
} }
else else
{ {
if ($commande->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{ {
$langs->load("errors"); $langs->load("errors");
$mesg = '<div class="error">'.$langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType").'</div>'; $mesg = '<div class="error">'.$langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType").'</div>';
} }
else else
{ {
$mesg = '<div class="error">'.$commande->error.'</div>'; $mesg = '<div class="error">'.$object->error.'</div>';
} }
} }
} }
// bascule du statut d'un contact // bascule du statut d'un contact
if ($_GET["action"] == 'swapstatut' && $user->rights->commande->creer) else if ($action == 'swapstatut' && $user->rights->commande->creer)
{ {
$commande = new Commande($db); if ($object->fetch($id))
if ($commande->fetch(GETPOST('id','int')))
{ {
$result=$commande->swapContactStatus(GETPOST('ligne')); $result=$object->swapContactStatus(GETPOST('ligne'));
} }
else else
{ {
@ -90,15 +90,14 @@ if ($_GET["action"] == 'swapstatut' && $user->rights->commande->creer)
} }
// Efface un contact // Efface un contact
if ($_GET["action"] == 'deleteline' && $user->rights->commande->creer) else if ($action == 'deleteline' && $user->rights->commande->creer)
{ {
$commande = new Commande($db); $object->fetch($id);
$commande->fetch($_GET["id"]); $result = $object->delete_contact($_GET["lineid"]);
$result = $commande->delete_contact($_GET["lineid"]);
if ($result >= 0) if ($result >= 0)
{ {
Header("Location: contact.php?id=".$commande->id); Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit; exit;
} }
else { else {
@ -106,6 +105,11 @@ if ($_GET["action"] == 'deleteline' && $user->rights->commande->creer)
} }
} }
else if ($action == 'setaddress' && $user->rights->commande->creer)
{
$object->fetch($id);
$object->setDeliveryAddress($_POST['fk_address']);
}
/* /*
* View * View
@ -115,6 +119,7 @@ llxHeader('',$langs->trans('Order'),'EN:Customers_Orders|FR:Commandes_Clients|ES
$form = new Form($db); $form = new Form($db);
$formcompany = new FormCompany($db); $formcompany = new FormCompany($db);
$formother = new FormOther($db);
$contactstatic=new Contact($db); $contactstatic=new Contact($db);
$userstatic=new User($db); $userstatic=new User($db);
@ -126,19 +131,17 @@ $userstatic=new User($db);
/* *************************************************************************** */ /* *************************************************************************** */
dol_htmloutput_mesg($mesg); dol_htmloutput_mesg($mesg);
$id = $_GET['id'];
$ref= $_GET['ref'];
if ($id > 0 || ! empty($ref)) if ($id > 0 || ! empty($ref))
{ {
$langs->trans("OrderCard"); $langs->trans("OrderCard");
$commande = new Commande($db);
if ( $commande->fetch($_GET['id'],$_GET['ref']) > 0) if ($object->fetch($id, $ref) > 0)
{ {
$soc = new Societe($db); $soc = new Societe($db);
$soc->fetch($commande->socid); $soc->fetch($object->socid);
$head = commande_prepare_head($commande); $head = commande_prepare_head($object);
dol_fiche_head($head, 'contact', $langs->trans("CustomerOrder"), 0, 'order'); dol_fiche_head($head, 'contact', $langs->trans("CustomerOrder"), 0, 'order');
@ -149,7 +152,7 @@ if ($id > 0 || ! empty($ref))
// Ref // Ref
print '<tr><td width="18%">'.$langs->trans("Ref").'</td><td colspan="3">'; print '<tr><td width="18%">'.$langs->trans("Ref").'</td><td colspan="3">';
print $form->showrefnav($commande,'ref','',1,'ref','ref'); print $form->showrefnav($object,'ref','',1,'ref','ref');
print "</td></tr>"; print "</td></tr>";
// Ref commande client // Ref commande client
@ -159,16 +162,39 @@ if ($id > 0 || ! empty($ref))
print '</td>'; print '</td>';
print '</tr></table>'; print '</tr></table>';
print '</td><td colspan="3">'; print '</td><td colspan="3">';
print $commande->ref_client; print $object->ref_client;
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
// Customer // Customer
if ( is_null($commande->client) ) if (is_null($object->client)) $object->fetch_thirdparty();
$commande->fetch_thirdparty();
print "<tr><td>".$langs->trans("Company")."</td>"; print "<tr><td>".$langs->trans("Company")."</td>";
print '<td colspan="3">'.$commande->client->getNomUrl(1).'</td></tr>'; print '<td colspan="3">'.$object->client->getNomUrl(1).'</td></tr>';
// Delivery address
if ($conf->global->COMMANDE_ADD_DELIVERY_ADDRESS)
{
print '<tr><td>';
print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('DeliveryAddress');
print '</td>';
if ($action != 'editdelivery_address' && $object->brouillon) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editdelivery_address&amp;socid='.$object->socid.'&amp;id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetDeliveryAddress'),1).'</a></td>';
print '</tr></table>';
print '</td><td colspan="3">';
if ($action == 'editdelivery_address')
{
$formother->form_address($_SERVER['PHP_SELF'].'?id='.$object->id,$object->fk_delivery_address,GETPOST('socid','int'),'fk_address','commande',$object->id);
}
else
{
$formother->form_address($_SERVER['PHP_SELF'].'?id='.$object->id,$object->fk_delivery_address,GETPOST('socid','int'),'none','commande',$object->id);
}
print '</td></tr>';
}
print "</table>"; print "</table>";
print '</div>'; print '</div>';
@ -182,7 +208,7 @@ if ($id > 0 || ! empty($ref))
* Ajouter une ligne de contact * Ajouter une ligne de contact
* Non affiche en mode modification de ligne * Non affiche en mode modification de ligne
*/ */
if ($_GET["action"] != 'editline' && $user->rights->commande->creer) if ($action != 'editline' && $user->rights->commande->creer)
{ {
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Source").'</td>'; print '<td>'.$langs->trans("Source").'</td>';
@ -195,7 +221,7 @@ if ($id > 0 || ! empty($ref))
$var = false; $var = false;
print '<form action="contact.php?id='.$id.'" method="post">'; print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$id.'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="addcontact">'; print '<input type="hidden" name="action" value="addcontact">';
print '<input type="hidden" name="source" value="internal">'; print '<input type="hidden" name="source" value="internal">';
@ -213,18 +239,18 @@ if ($id > 0 || ! empty($ref))
print '</td>'; print '</td>';
print '<td colspan="1">'; print '<td colspan="1">';
//$userAlreadySelected = $commande->getListContactId('internal'); // On ne doit pas desactiver un contact deja selectionne car on doit pouvoir le selectionner une deuxieme fois pour un autre type //$userAlreadySelected = $object->getListContactId('internal'); // On ne doit pas desactiver un contact deja selectionne car on doit pouvoir le selectionner une deuxieme fois pour un autre type
$form->select_users($user->id,'contactid',0,$userAlreadySelected); $form->select_users($user->id,'contactid',0,$userAlreadySelected);
print '</td>'; print '</td>';
print '<td>'; print '<td>';
$formcompany->selectTypeContact($commande, '', 'type','internal'); $formcompany->selectTypeContact($object, '', 'type','internal');
print '</td>'; print '</td>';
print '<td align="right" colspan="3" ><input type="submit" class="button" value="'.$langs->trans("Add").'"></td>'; print '<td align="right" colspan="3" ><input type="submit" class="button" value="'.$langs->trans("Add").'"></td>';
print '</tr>'; print '</tr>';
print '</form>'; print '</form>';
print '<form action="contact.php?id='.$id.'" method="post">'; print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$id.'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="addcontact">'; print '<input type="hidden" name="action" value="addcontact">';
print '<input type="hidden" name="source" value="external">'; print '<input type="hidden" name="source" value="external">';
@ -239,8 +265,8 @@ if ($id > 0 || ! empty($ref))
print '</td>'; print '</td>';
print '<td colspan="1">'; print '<td colspan="1">';
$selectedCompany = isset($_GET["newcompany"])?$_GET["newcompany"]:$commande->client->id; $selectedCompany = isset($_GET["newcompany"])?$_GET["newcompany"]:$object->client->id;
$selectedCompany = $formcompany->selectCompaniesForNewContact($commande, 'id', $selectedCompany, 'newcompany'); $selectedCompany = $formcompany->selectCompaniesForNewContact($object, 'id', $selectedCompany, 'newcompany');
print '</td>'; print '</td>';
print '<td colspan="1">'; print '<td colspan="1">';
@ -248,7 +274,7 @@ if ($id > 0 || ! empty($ref))
if ($nbofcontacts == 0) print $langs->trans("NoContactDefined"); if ($nbofcontacts == 0) print $langs->trans("NoContactDefined");
print '</td>'; print '</td>';
print '<td>'; print '<td>';
$formcompany->selectTypeContact($commande, '', 'type','external'); $formcompany->selectTypeContact($object, '', 'type','external');
print '</td>'; print '</td>';
print '<td align="right" colspan="3" ><input type="submit" class="button" value="'.$langs->trans("Add").'"'; print '<td align="right" colspan="3" ><input type="submit" class="button" value="'.$langs->trans("Add").'"';
if (! $nbofcontacts) print ' disabled="disabled"'; if (! $nbofcontacts) print ' disabled="disabled"';
@ -275,7 +301,7 @@ if ($id > 0 || ! empty($ref))
foreach(array('internal','external') as $source) foreach(array('internal','external') as $source)
{ {
$tab = $commande->liste_contact(-1,$source); $tab = $object->liste_contact(-1,$source);
$num=count($tab); $num=count($tab);
$i = 0; $i = 0;
@ -332,17 +358,17 @@ if ($id > 0 || ! empty($ref))
// Statut // Statut
print '<td align="center">'; print '<td align="center">';
// Activation desativation du contact // Activation desativation du contact
if ($commande->statut >= 0) print '<a href="contact.php?id='.$commande->id.'&amp;action=swapstatut&amp;ligne='.$tab[$i]['rowid'].'">'; if ($object->statut >= 0) print '<a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;action=swapstatut&amp;ligne='.$tab[$i]['rowid'].'">';
print $contactstatic->LibStatut($tab[$i]['status'],3); print $contactstatic->LibStatut($tab[$i]['status'],3);
if ($commande->statut >= 0) print '</a>'; if ($object->statut >= 0) print '</a>';
print '</td>'; print '</td>';
// Icon update et delete // Icon update et delete
print '<td align="center" nowrap="nowrap" colspan="2">'; print '<td align="center" nowrap="nowrap" colspan="2">';
if ($commande->statut < 5 && $user->rights->commande->creer) if ($object->statut < 5 && $user->rights->commande->creer)
{ {
print '&nbsp;'; print '&nbsp;';
print '<a href="contact.php?id='.$commande->id.'&amp;action=deleteline&amp;lineid='.$tab[$i]['rowid'].'">'; print '<a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;action=deleteline&amp;lineid='.$tab[$i]['rowid'].'">';
print img_delete(); print img_delete();
print '</a>'; print '</a>';
} }
@ -362,7 +388,7 @@ if ($id > 0 || ! empty($ref))
} }
} }
$db->close();
$db->close();
llxFooter(); llxFooter();
?> ?>

View File

@ -29,7 +29,6 @@
*/ */
require("../main.inc.php"); require("../main.inc.php");
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formother.class.php");
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php"); require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formorder.class.php"); require_once(DOL_DOCUMENT_ROOT."/core/class/html.formorder.class.php");
require_once(DOL_DOCUMENT_ROOT."/core/modules/commande/modules_commande.php"); require_once(DOL_DOCUMENT_ROOT."/core/modules/commande/modules_commande.php");
@ -440,12 +439,6 @@ if ($action == 'setdate_livraison' && $user->rights->commande->creer)
} }
} }
if ($action == 'setaddress' && $user->rights->commande->creer)
{
$object->fetch($id);
$object->set_adresse_livraison($user,$_POST['fk_address']);
}
if ($action == 'setmode' && $user->rights->commande->creer) if ($action == 'setmode' && $user->rights->commande->creer)
{ {
$object->fetch($id); $object->fetch($id);
@ -1193,7 +1186,6 @@ llxHeader('',$langs->trans('Order'),'EN:Customers_Orders|FR:Commandes_Clients|ES
$form = new Form($db); $form = new Form($db);
$formfile = new FormFile($db); $formfile = new FormFile($db);
$formother = new FormOther($db);
$formorder = new FormOrder($db); $formorder = new FormOrder($db);
@ -1330,15 +1322,6 @@ if ($action == 'create' && $user->rights->commande->creer)
$form->select_date($datedelivery,'liv_','','','',"crea_commande",1,1); $form->select_date($datedelivery,'liv_','','','',"crea_commande",1,1);
print "</td></tr>"; print "</td></tr>";
// Delivery address
if ($conf->global->COMMANDE_ADD_DELIVERY_ADDRESS)
{
print '<tr><td nowrap="nowrap">'.$langs->trans('DeliveryAddress').'</td><td colspan="2">';
$numaddress = $formother->select_address($soc->fk_delivery_address, $socid,'fk_address',1);
print ' &nbsp; <a href="../comm/address.php?socid='.$soc->id.'&action=create">'.$langs->trans("AddAddress").'</a>';
print '</td></tr>';
}
// Conditions de reglement // Conditions de reglement
print '<tr><td nowrap="nowrap">'.$langs->trans('PaymentConditionsShort').'</td><td colspan="2">'; print '<tr><td nowrap="nowrap">'.$langs->trans('PaymentConditionsShort').'</td><td colspan="2">';
$form->select_conditions_paiements($soc->cond_reglement,'cond_reglement_id',-1,1); $form->select_conditions_paiements($soc->cond_reglement,'cond_reglement_id',-1,1);
@ -1802,29 +1785,6 @@ else
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
// Delivery address
if ($conf->global->COMMANDE_ADD_DELIVERY_ADDRESS)
{
print '<tr><td height="10">';
print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('DeliveryAddress');
print '</td>';
if ($action != 'editdelivery_adress' && $object->brouillon) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editdelivery_adress&amp;socid='.$object->socid.'&amp;id='.$object->id.'">'.img_edit($langs->trans('SetDeliveryAddress'),1).'</a></td>';
print '</tr></table>';
print '</td><td colspan="2">';
if ($action == 'editdelivery_adress')
{
$formother->form_address($_SERVER['PHP_SELF'].'?id='.$object->id,$object->fk_delivery_address,$socid,'fk_address','commande',$object->id);
}
else
{
$formother->form_address($_SERVER['PHP_SELF'].'?id='.$object->id,$object->fk_delivery_address,$socid,'none','commande',$object->id);
}
print '</td></tr>';
}
// Terms of payment // Terms of payment
print '<tr><td height="10">'; print '<tr><td height="10">';
print '<table class="nobordernopadding" width="100%"><tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>';

View File

@ -121,7 +121,7 @@ if ($action == 'confirm_clone' && $confirm == 'yes')
} }
// Change status of invoice // Change status of invoice
if ($action == 'reopen' && $user->rights->facture->creer) else if ($action == 'reopen' && $user->rights->facture->creer)
{ {
$result = $object->fetch($id); $result = $object->fetch($id);
if ($object->statut == 2 if ($object->statut == 2
@ -141,7 +141,7 @@ if ($action == 'reopen' && $user->rights->facture->creer)
} }
// Delete invoice // Delete invoice
if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->facture->supprimer) else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->facture->supprimer)
{ {
if ($user->rights->facture->supprimer) if ($user->rights->facture->supprimer)
{ {
@ -160,7 +160,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->facture->
} }
// Delete line // Delete line
if ($action == 'confirm_deleteline' && $confirm == 'yes') else if ($action == 'confirm_deleteline' && $confirm == 'yes')
{ {
if ($user->rights->facture->creer) if ($user->rights->facture->creer)
{ {
@ -200,7 +200,7 @@ if ($action == 'confirm_deleteline' && $confirm == 'yes')
} }
// Delete link of credit note to invoice // Delete link of credit note to invoice
if ($action == 'unlinkdiscount') else if ($action == 'unlinkdiscount')
{ {
if ($user->rights->facture->creer) if ($user->rights->facture->creer)
{ {
@ -211,7 +211,7 @@ if ($action == 'unlinkdiscount')
} }
// Validation // Validation
if ($action == 'valid') else if ($action == 'valid')
{ {
$object->fetch($id); $object->fetch($id);
@ -236,7 +236,7 @@ if ($action == 'valid')
} }
} }
if ($action == 'set_thirdparty') else if ($action == 'set_thirdparty')
{ {
$object->fetch($id); $object->fetch($id);
$object->setValueFrom('fk_soc',$socid); $object->setValueFrom('fk_soc',$socid);
@ -245,20 +245,20 @@ if ($action == 'set_thirdparty')
exit; exit;
} }
if ($action == 'classin') else if ($action == 'classin')
{ {
$object->fetch($id); $object->fetch($id);
$object->setProject($_POST['projectid']); $object->setProject($_POST['projectid']);
} }
if ($action == 'setmode') else if ($action == 'setmode')
{ {
$object->fetch($id); $object->fetch($id);
$result = $object->setPaymentMethods(GETPOST('mode_reglement_id','int')); $result = $object->setPaymentMethods(GETPOST('mode_reglement_id','int'));
if ($result < 0) dol_print_error($db,$object->error); if ($result < 0) dol_print_error($db,$object->error);
} }
if ($action == 'setinvoicedate') else if ($action == 'setinvoicedate')
{ {
$object->fetch($id); $object->fetch($id);
$object->date=dol_mktime(12,0,0,$_POST['invoicedatemonth'],$_POST['invoicedateday'],$_POST['invoicedateyear']); $object->date=dol_mktime(12,0,0,$_POST['invoicedatemonth'],$_POST['invoicedateday'],$_POST['invoicedateyear']);
@ -267,16 +267,7 @@ if ($action == 'setinvoicedate')
if ($result < 0) dol_print_error($db,$object->error); if ($result < 0) dol_print_error($db,$object->error);
} }
// TODO obsolete ? not used else if ($action == 'setconditions')
if ($action == 'setpaymentterm')
{
$object->fetch($id);
$date_lim_reglement=dol_mktime(12,0,0,$_POST['paymenttermmonth'],$_POST['paymenttermday'],$_POST['paymenttermyear']);
$result=$object->cond_reglement($object->cond_reglement_id,$date_lim_reglement);
if ($result < 0) dol_print_error($db,$object->error);
}
if ($action == 'setconditions')
{ {
$object->fetch($id); $object->fetch($id);
$result=$object->setPaymentTerms(GETPOST('cond_reglement_id','int')); $result=$object->setPaymentTerms(GETPOST('cond_reglement_id','int'));
@ -289,7 +280,7 @@ if ($action == 'setremisepercent' && $user->rights->facture->creer)
$result = $object->set_remise($user, $_POST['remise_percent']); $result = $object->set_remise($user, $_POST['remise_percent']);
} }
if ($action == "setabsolutediscount" && $user->rights->facture->creer) else if ($action == "setabsolutediscount" && $user->rights->facture->creer)
{ {
// POST[remise_id] ou POST[remise_id_for_payment] // POST[remise_id] ou POST[remise_id_for_payment]
if (! empty($_POST["remise_id"])) if (! empty($_POST["remise_id"]))
@ -322,14 +313,14 @@ if ($action == "setabsolutediscount" && $user->rights->facture->creer)
} }
} }
if ($action == 'set_ref_client') else if ($action == 'set_ref_client')
{ {
$object->fetch($id); $object->fetch($id);
$object->set_ref_client($_POST['ref_client']); $object->set_ref_client($_POST['ref_client']);
} }
// Classify to validated // Classify to validated
if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->facture->valider) else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->facture->valider)
{ {
$idwarehouse=GETPOST('idwarehouse'); $idwarehouse=GETPOST('idwarehouse');
@ -376,7 +367,7 @@ if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->facture->v
} }
// Go back to draft status (unvalidate) // Go back to draft status (unvalidate)
if ($action == 'confirm_modif' && ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->facture->valider) || $user->rights->facture->invoice_advance->unvalidate)) else if ($action == 'confirm_modif' && ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->facture->valider) || $user->rights->facture->invoice_advance->unvalidate))
{ {
$idwarehouse=GETPOST('idwarehouse'); $idwarehouse=GETPOST('idwarehouse');
@ -449,13 +440,13 @@ if ($action == 'confirm_modif' && ((empty($conf->global->MAIN_USE_ADVANCED_PERMS
} }
// Classify "paid" // Classify "paid"
if ($action == 'confirm_paid' && $confirm == 'yes' && $user->rights->facture->paiement) else if ($action == 'confirm_paid' && $confirm == 'yes' && $user->rights->facture->paiement)
{ {
$object->fetch($id); $object->fetch($id);
$result = $object->set_paid($user); $result = $object->set_paid($user);
} }
// Classif "paid partialy" // Classif "paid partialy"
if ($action == 'confirm_paid_partially' && $confirm == 'yes' && $user->rights->facture->paiement) else if ($action == 'confirm_paid_partially' && $confirm == 'yes' && $user->rights->facture->paiement)
{ {
$object->fetch($id); $object->fetch($id);
$close_code=$_POST["close_code"]; $close_code=$_POST["close_code"];
@ -470,7 +461,7 @@ if ($action == 'confirm_paid_partially' && $confirm == 'yes' && $user->rights->f
} }
} }
// Classify "abandoned" // Classify "abandoned"
if ($action == 'confirm_canceled' && $confirm == 'yes') else if ($action == 'confirm_canceled' && $confirm == 'yes')
{ {
$object->fetch($id); $object->fetch($id);
$close_code=$_POST["close_code"]; $close_code=$_POST["close_code"];
@ -486,7 +477,7 @@ if ($action == 'confirm_canceled' && $confirm == 'yes')
} }
// Convertir en reduc // Convertir en reduc
if ($action == 'confirm_converttoreduc' && $confirm == 'yes' && $user->rights->facture->creer) else if ($action == 'confirm_converttoreduc' && $confirm == 'yes' && $user->rights->facture->creer)
{ {
$db->begin(); $db->begin();
@ -561,7 +552,7 @@ if ($action == 'confirm_converttoreduc' && $confirm == 'yes' && $user->rights->f
/* /*
* Insert new invoice in database * Insert new invoice in database
*/ */
if ($action == 'add' && $user->rights->facture->creer) else if ($action == 'add' && $user->rights->facture->creer)
{ {
$object->socid=GETPOST('socid','int'); $object->socid=GETPOST('socid','int');
@ -922,7 +913,7 @@ if ($action == 'add' && $user->rights->facture->creer)
} }
// Add a new line // Add a new line
if (($action == 'addline' || $action == 'addline_predef') && $user->rights->facture->creer) else if (($action == 'addline' || $action == 'addline_predef') && $user->rights->facture->creer)
{ {
$result=0; $result=0;
@ -1130,7 +1121,7 @@ if (($action == 'addline' || $action == 'addline_predef') && $user->rights->fact
$action=''; $action='';
} }
if ($action == 'updateligne' && $user->rights->facture->creer && $_POST['save'] == $langs->trans('Save')) else if ($action == 'updateligne' && $user->rights->facture->creer && $_POST['save'] == $langs->trans('Save'))
{ {
if (! $object->fetch($id) > 0) dol_print_error($db); if (! $object->fetch($id) > 0) dol_print_error($db);
$object->fetch_thirdparty(); $object->fetch_thirdparty();
@ -1218,15 +1209,14 @@ if ($action == 'updateligne' && $user->rights->facture->creer && $_POST['save']
} }
} }
if ($action == 'updateligne' && $user->rights->facture->creer && $_POST['cancel'] == $langs->trans('Cancel')) else if ($action == 'updateligne' && $user->rights->facture->creer && $_POST['cancel'] == $langs->trans('Cancel'))
{ {
Header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$id); // Pour reaffichage de la fiche en cours d'edition Header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$id); // Pour reaffichage de la fiche en cours d'edition
exit; exit;
} }
// Modify line position (up) // Modify line position (up)
if ($action == 'up' && $user->rights->facture->creer) else if ($action == 'up' && $user->rights->facture->creer)
{ {
$object->fetch($id); $object->fetch($id);
$object->fetch_thirdparty(); $object->fetch_thirdparty();
@ -1248,7 +1238,7 @@ if ($action == 'up' && $user->rights->facture->creer)
exit; exit;
} }
// Modify line position (down) // Modify line position (down)
if ($action == 'down' && $user->rights->facture->creer) else if ($action == 'down' && $user->rights->facture->creer)
{ {
$object->fetch($id); $object->fetch($id);
$object->fetch_thirdparty(); $object->fetch_thirdparty();
@ -1478,7 +1468,7 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
/* /*
* Generate document * Generate document
*/ */
if (GETPOST('action') == 'builddoc') // En get ou en post else if ($action == 'builddoc') // En get ou en post
{ {
$object->fetch($id); $object->fetch($id);
$object->fetch_thirdparty(); $object->fetch_thirdparty();

View File

@ -2686,93 +2686,6 @@ class Facture extends CommonObject
} }
} }
/**
* Change les conditions de reglement de la facture
*
* @param int $cond_reglement_id Id de la nouvelle condition de reglement
* @param date $date Date to force payment term
* @return int >0 si ok, <0 si ko
* TODO deprecated, not used
*/
function cond_reglement($cond_reglement_id,$date='')
{
if ($this->statut >= 0 && $this->paye == 0)
{
// Define cond_reglement_id and datelim
if (strval($date) != '')
{
$datelim=$date;
$cond_reglement_id=0;
}
else
{
$datelim=$this->calculate_date_lim_reglement($cond_reglement_id);
$cond_reglement_id=$cond_reglement_id;
}
$sql = 'UPDATE '.MAIN_DB_PREFIX.'facture';
$sql.= ' SET fk_cond_reglement = '.$cond_reglement_id.',';
$sql.= ' date_lim_reglement='.$this->db->idate($datelim);
$sql.= ' WHERE rowid='.$this->id;
dol_syslog(get_class($this)."::cond_reglement sql=".$sql, LOG_DEBUG);
if ( $this->db->query($sql) )
{
$this->cond_reglement_id = $cond_reglement_id;
return 1;
}
else
{
dol_syslog(get_class($this)."::cond_reglement Erreur ".$sql.' - '.$this->db->error());
$this->error=$this->db->error();
return -1;
}
}
else
{
dol_syslog(get_class($this)."::cond_reglement, etat facture incompatible");
$this->error='Entity status not compatible '.$this->statut.' '.$this->paye;
return -2;
}
}
/**
* Change le mode de reglement
*
* @param int $mode_reglement_id Id du nouveau mode
* @return int >0 if OK, <0 if KO
* TODO deprecated
*/
function mode_reglement($mode_reglement_id)
{
dol_syslog(get_class($this).'::mode_reglement('.$mode_reglement_id.')', LOG_DEBUG);
if ($this->statut >= 0 && $this->paye == 0)
{
$sql = 'UPDATE '.MAIN_DB_PREFIX.'facture';
$sql .= ' SET fk_mode_reglement = '.$mode_reglement_id;
$sql .= ' WHERE rowid='.$this->id;
if ( $this->db->query($sql) )
{
$this->mode_reglement_id = $mode_reglement_id;
return 1;
}
else
{
dol_syslog(get_class($this).'::mode_reglement Erreur '.$sql.' - '.$this->db->error());
$this->error=$this->db->error();
return -1;
}
}
else
{
dol_syslog(get_class($this).'::mode_reglement, etat facture incompatible');
$this->error='Etat facture incompatible '.$this->statut.' '.$this->paye;
return -2;
}
}
/** /**
* Renvoi si les lignes de facture sont ventilees et/ou exportees en compta * Renvoi si les lignes de facture sont ventilees et/ou exportees en compta
* *

View File

@ -942,6 +942,33 @@ abstract class CommonObject
} }
} }
/**
* Define delivery address
*
* @param int $id Address id
* @return int <0 si ko, >0 si ok
*/
function setDeliveryAddress($id)
{
$fieldname = 'fk_adresse_livraison';
if ($this->element == 'delivery' || $this->element == 'shipping') $fieldname = 'fk_address';
$sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET ".$fieldname." = ".$id;
$sql.= " WHERE rowid = ".$this->id." AND fk_statut = 0";
if ($this->db->query($sql))
{
$this->fk_delivery_address = $id;
return 1;
}
else
{
$this->error=$this->db->error();
dol_syslog(get_class($this).'::setDeliveryAddress Erreur '.$sql.' - '.$this->error);
return -1;
}
}
/** /**
* Set last model used by doc generator * Set last model used by doc generator
* *

View File

@ -733,6 +733,8 @@ class FormOther
function form_address($page, $selected, $socid, $htmlname='address_id', $origin='', $originid='') function form_address($page, $selected, $socid, $htmlname='address_id', $origin='', $originid='')
{ {
global $langs,$conf; global $langs,$conf;
global $form;
if ($htmlname != "none") if ($htmlname != "none")
{ {
print '<form method="post" action="'.$page.'">'; print '<form method="post" action="'.$page.'">';
@ -740,7 +742,7 @@ class FormOther
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">'; print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
print '<tr><td>'; print '<tr><td>';
$this->select_address($selected, $socid, $htmlname, 1); $form->select_address($selected, $socid, $htmlname, 1);
print '</td>'; print '</td>';
print '<td align="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'">'; print '<td align="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'">';
$langs->load("companies"); $langs->load("companies");

View File

@ -40,7 +40,7 @@ function contract_prepare_head($object)
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/contrat/contact.php?id='.$object->id; $head[$h][0] = DOL_URL_ROOT.'/contrat/contact.php?id='.$object->id;
$head[$h][1] = $langs->trans("ContractContacts"); $head[$h][1] = $langs->trans("ContactsAddresses");
$head[$h][2] = 'contact'; $head[$h][2] = 'contact';
$h++; $h++;

View File

@ -41,7 +41,7 @@ function facturefourn_prepare_head($object)
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/fourn/facture/contact.php?facid='.$object->id; $head[$h][0] = DOL_URL_ROOT.'/fourn/facture/contact.php?facid='.$object->id;
$head[$h][1] = $langs->trans('BillContacts'); $head[$h][1] = $langs->trans('ContactsAddresses');
$head[$h][2] = 'contact'; $head[$h][2] = 'contact';
$h++; $h++;
@ -101,7 +101,7 @@ function ordersupplier_prepare_head($object)
} }
$head[$h][0] = DOL_URL_ROOT.'/fourn/commande/contact.php?id='.$object->id; $head[$h][0] = DOL_URL_ROOT.'/fourn/commande/contact.php?id='.$object->id;
$head[$h][1] = $langs->trans('OrderContact'); $head[$h][1] = $langs->trans('ContactsAddresses');
$head[$h][2] = 'contact'; $head[$h][2] = 'contact';
$h++; $h++;

View File

@ -40,7 +40,7 @@ function facture_prepare_head($object)
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/contact.php?facid='.$object->id; $head[$h][0] = DOL_URL_ROOT.'/compta/facture/contact.php?facid='.$object->id;
$head[$h][1] = $langs->trans('BillContacts'); $head[$h][1] = $langs->trans('ContactsAddresses');
$head[$h][2] = 'contact'; $head[$h][2] = 'contact';
$h++; $h++;

View File

@ -69,7 +69,7 @@ function commande_prepare_head($object)
} }
$head[$h][0] = DOL_URL_ROOT.'/commande/contact.php?id='.$object->id; $head[$h][0] = DOL_URL_ROOT.'/commande/contact.php?id='.$object->id;
$head[$h][1] = $langs->trans('OrderContact'); $head[$h][1] = $langs->trans('ContactsAddresses');
$head[$h][2] = 'contact'; $head[$h][2] = 'contact';
$h++; $h++;

View File

@ -64,7 +64,7 @@ function propal_prepare_head($object)
} }
$head[$h][0] = DOL_URL_ROOT.'/comm/propal/contact.php?id='.$object->id; $head[$h][0] = DOL_URL_ROOT.'/comm/propal/contact.php?id='.$object->id;
$head[$h][1] = $langs->trans('ProposalContact'); $head[$h][1] = $langs->trans('ContactsAddresses');
$head[$h][2] = 'contact'; $head[$h][2] = 'contact';
$h++; $h++;

View File

@ -2,7 +2,7 @@
/* Copyright (C) 2003-2008 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003-2008 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com> * Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -19,8 +19,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
// Code identique a /expedition/shipment.php
/** /**
* \file htdocs/expedition/fiche.php * \file htdocs/expedition/fiche.php
* \ingroup expedition * \ingroup expedition
@ -164,7 +162,7 @@ if ($action == 'add')
/* /*
* Build a receiving receipt * Build a receiving receipt
*/ */
if ($action == 'create_delivery' && $conf->livraison_bon->enabled && $user->rights->expedition->livraison->creer) else if ($action == 'create_delivery' && $conf->livraison_bon->enabled && $user->rights->expedition->livraison->creer)
{ {
$object->fetch($id); $object->fetch($id);
$result = $object->create_delivery($user); $result = $object->create_delivery($user);
@ -179,7 +177,7 @@ if ($action == 'create_delivery' && $conf->livraison_bon->enabled && $user->righ
} }
} }
if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->expedition->valider) else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->expedition->valider)
{ {
$object->fetch($id); $object->fetch($id);
$object->fetch_thirdparty(); $object->fetch_thirdparty();
@ -208,7 +206,7 @@ if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->expedition
} }
} }
if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->expedition->supprimer) else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->expedition->supprimer)
{ {
$object->fetch($id); $object->fetch($id);
$result = $object->delete(); $result = $object->delete();
@ -223,7 +221,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->expeditio
} }
} }
if ($action == 'reopen' && $user->rights->expedition->valider) else if ($action == 'reopen' && $user->rights->expedition->valider)
{ {
$object->fetch($id); $object->fetch($id);
$result = $object->setStatut(0); $result = $object->setStatut(0);
@ -233,7 +231,7 @@ if ($action == 'reopen' && $user->rights->expedition->valider)
} }
} }
if ($action == 'setdate_livraison' && $user->rights->expedition->creer) else if ($action == 'setdate_livraison' && $user->rights->expedition->creer)
{ {
//print "x ".$_POST['liv_month'].", ".$_POST['liv_day'].", ".$_POST['liv_year']; //print "x ".$_POST['liv_month'].", ".$_POST['liv_day'].", ".$_POST['liv_year'];
$datedelivery=dol_mktime(GETPOST('liv_hour','int'), GETPOST('liv_min','int'), 0, GETPOST('liv_month','int'), GETPOST('liv_day','int'), GETPOST('liv_year','int')); $datedelivery=dol_mktime(GETPOST('liv_hour','int'), GETPOST('liv_min','int'), 0, GETPOST('liv_month','int'), GETPOST('liv_day','int'), GETPOST('liv_year','int'));
@ -247,7 +245,7 @@ if ($action == 'setdate_livraison' && $user->rights->expedition->creer)
} }
// Action update description of emailing // Action update description of emailing
if ($action == 'settrackingnumber' || $action == 'settrackingurl' else if ($action == 'settrackingnumber' || $action == 'settrackingurl'
|| $action == 'settrueWeight' || $action == 'settrueWeight'
|| $action == 'settrueWidth' || $action == 'settrueWidth'
|| $action == 'settrueHeight' || $action == 'settrueHeight'
@ -286,7 +284,7 @@ if ($action == 'settrackingnumber' || $action == 'settrackingurl'
/* /*
* Build doc * Build doc
*/ */
if ($action == 'builddoc') // En get ou en post else if ($action == 'builddoc') // En get ou en post
{ {
// Sauvegarde le dernier modele choisi pour generer un document // Sauvegarde le dernier modele choisi pour generer un document
@ -505,12 +503,20 @@ if ($action == 'send' && ! GETPOST('addfile','alpha') && ! GETPOST('removedfile'
} }
} }
if ($action == 'classifybilled') else if ($action == 'classifybilled')
{ {
$object->fetch($id); $object->fetch($id);
$object->set_billed(); $object->set_billed();
} }
else if ($action == 'setaddress' && $user->rights->expedition->creer)
{
$object->fetch($id);
$result=$object->setDeliveryAddress($_POST['fk_address']);
if ($result < 0) dol_print_error($db,$object->error);
}
/* /*
* View * View
*/ */
@ -1036,16 +1042,26 @@ else
print '</tr>'; print '</tr>';
// Delivery address // Delivery address
if (($origin == 'commande' && $conf->global->COMMANDE_ADD_DELIVERY_ADDRESS) if ($conf->global->COMMANDE_ADD_DELIVERY_ADDRESS || $conf->global->PROPAL_ADD_DELIVERY_ADDRESS)
|| ($origin == 'propal' && $conf->global->PROPAL_ADD_DELIVERY_ADDRESS))
{ {
print '<tr><td>'.$langs->trans('DeliveryAddress').'</td>'; print '<tr><td>';
print '<td colspan="3">'; print '<table class="nobordernopadding" width="100%"><tr><td>';
if (!empty($object->fk_delivery_address)) print $langs->trans('DeliveryAddress');
{ print '</td>';
$formother->form_address($_SERVER['PHP_SELF'].'?id='.$object->id,$object->fk_delivery_address,$object->deliveryaddress->socid,'none','shipment',$object->id);
} if ($action != 'editdelivery_address' && $object->brouillon) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editdelivery_address&amp;socid='.$object->socid.'&amp;id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetDeliveryAddress'),1).'</a></td>';
print '</td></tr>'."\n"; print '</tr></table>';
print '</td><td colspan="3">';
if ($action == 'editdelivery_address')
{
$formother->form_address($_SERVER['PHP_SELF'].'?id='.$object->id,$object->fk_delivery_address,$object->socid,'fk_address','shipment',$object->id);
}
else
{
$formother->form_address($_SERVER['PHP_SELF'].'?id='.$object->id,$object->fk_delivery_address,$object->socid,'none','shipment',$object->id);
}
print '</td></tr>';
} }
// Weight // Weight

View File

@ -18,15 +18,12 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
// Code identique a /expedition/fiche.php
/** /**
* \file htdocs/expedition/shipment.php * \file htdocs/expedition/shipment.php
* \ingroup expedition * \ingroup expedition
*/ */
require("../main.inc.php"); require("../main.inc.php");
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formother.class.php");
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php"); require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
require_once(DOL_DOCUMENT_ROOT."/expedition/class/expedition.class.php"); require_once(DOL_DOCUMENT_ROOT."/expedition/class/expedition.class.php");
require_once(DOL_DOCUMENT_ROOT."/product/class/html.formproduct.class.php"); require_once(DOL_DOCUMENT_ROOT."/product/class/html.formproduct.class.php");
@ -100,7 +97,7 @@ if ($action == 'setdeliveryaddress' && $user->rights->commande->creer)
{ {
$commande = new Commande($db); $commande = new Commande($db);
$commande->fetch($id); $commande->fetch($id);
$commande->set_adresse_livraison($user,GETPOST('delivery_address_id','int')); $commande->setDeliveryAddress(GETPOST('delivery_address_id','int'));
} }
if ($action == 'setmode' && $user->rights->commande->creer) if ($action == 'setmode' && $user->rights->commande->creer)
@ -127,7 +124,6 @@ if ($action == 'setconditions' && $user->rights->commande->creer)
$form = new Form($db); $form = new Form($db);
$formfile = new FormFile($db); $formfile = new FormFile($db);
$formother = new FormOther($db);
$formproduct = new FormProduct($db); $formproduct = new FormProduct($db);
llxHeader('',$langs->trans('OrderCard'),''); llxHeader('',$langs->trans('OrderCard'),'');
@ -274,29 +270,6 @@ if ($id > 0 || ! empty($ref))
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
// Delivery address
if ($conf->global->COMMANDE_ADD_DELIVERY_ADDRESS)
{
print '<tr><td height="10">';
print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('DeliveryAddress');
print '</td>';
if ($action != 'editdelivery_adress' && $commande->brouillon) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editdelivery_adress&amp;socid='.$commande->socid.'&amp;id='.$commande->id.'">'.img_edit($langs->trans('SetDeliveryAddress'),1).'</a></td>';
print '</tr></table>';
print '</td><td colspan="2">';
if ($action == 'editdelivery_adress')
{
$formother->form_address($_SERVER['PHP_SELF'].'?id='.$commande->id,$commande->fk_delivery_address,GETPOST('socid','int'),'delivery_address_id','commande',$commande->id);
}
else
{
$formother->form_address($_SERVER['PHP_SELF'].'?id='.$commande->id,$commande->fk_delivery_address,GETPOST('socid','int'),'none','commande',$commande->id);
}
print '</td></tr>';
}
// Terms of payment // Terms of payment
print '<tr><td height="10">'; print '<tr><td height="10">';
print '<table class="nobordernopadding" width="100%"><tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>';

View File

@ -1300,76 +1300,6 @@ class CommandeFournisseur extends Commande
} }
} }
/**
* Change les conditions de reglement de la commande
*
* @param int $cond_reglement_id Id de la nouvelle condition de reglement
* @return int >0 si ok, <0 si ko
* TODO deprecated
*/
function cond_reglement($cond_reglement_id)
{
dol_syslog('CommandeFournisseur::cond_reglement('.$cond_reglement_id.')');
if ($this->statut >= 0)
{
$sql = 'UPDATE '.MAIN_DB_PREFIX.'commande_fournisseur';
$sql .= ' SET fk_cond_reglement = '.$cond_reglement_id;
$sql .= ' WHERE rowid='.$this->id;
if ( $this->db->query($sql) )
{
$this->cond_reglement_id = $cond_reglement_id;
return 1;
}
else
{
dol_syslog('CommandeFournisseur::cond_reglement Erreur '.$sql.' - '.$this->db->error(), LOG_ERR);
$this->error=$this->db->lasterror();
return -1;
}
}
else
{
dol_syslog('CommandeFournisseur::cond_reglement, etat commande incompatible', LOG_ERR);
$this->error='Etat commande incompatible '.$this->statut;
return -2;
}
}
/**
* Change le mode de reglement
*
* @param int $mode_reglement_id Id du nouveau mode
* @return int >0 if OK, <0 if KO
* TODO deprecated
*/
function mode_reglement($mode_reglement_id)
{
dol_syslog('CommandeFournisseur::mode_reglement('.$mode_reglement_id.')');
if ($this->statut >= 0)
{
$sql = 'UPDATE '.MAIN_DB_PREFIX.'commande_fournisseur';
$sql .= ' SET fk_mode_reglement = '.$mode_reglement_id;
$sql .= ' WHERE rowid='.$this->id;
if ( $this->db->query($sql) )
{
$this->mode_reglement_id = $mode_reglement_id;
return 1;
}
else
{
dol_syslog('CommandeFournisseur::mode_reglement Erreur '.$sql.' - '.$this->db->error(), LOG_ERR);
$this->error=$this->db->lasterror();
return -1;
}
}
else
{
dol_syslog('CommandeFournisseur::mode_reglement, etat commande incompatible', LOG_ERR);
$this->error='Etat commande incompatible '.$this->statut;
return -2;
}
}
/** /**
* Set a delivery in database for this supplier order * Set a delivery in database for this supplier order
* *

View File

@ -51,8 +51,7 @@ CustomersInvoices=العملاء والفواتير
SupplierInvoice=فاتورة المورد SupplierInvoice=فاتورة المورد
SuppliersInvoices=الموردين SuppliersInvoices=الموردين
SupplierBill=فاتورة المورد SupplierBill=فاتورة المورد
SupplierBills=فواتير الموردين SupplierBills=فاتورة الاتصالات
BillContacts=فاتورة الاتصالات
Payment=الدفع Payment=الدفع
PaymentBack=دفع العودة PaymentBack=دفع العودة
Payments=المدفوعات Payments=المدفوعات

View File

@ -30,7 +30,6 @@ ServiceStatusClosed=مغلقة
ServicesLegend=خدمات أسطورة ServicesLegend=خدمات أسطورة
Contracts=عقود Contracts=عقود
Contract=العقد Contract=العقد
ContractContacts=عقد اتصالات
NoContracts=أي عقود NoContracts=أي عقود
MenuServices=الخدمات MenuServices=الخدمات
MenuInactiveServices=الخدمات غير الفعالة MenuInactiveServices=الخدمات غير الفعالة

View File

@ -16,7 +16,6 @@ Order=ترتيب
Orders=أوامر Orders=أوامر
OrderLine=من أجل خط OrderLine=من أجل خط
OrderFollow=متابعة OrderFollow=متابعة
OrderContact=من أجل الاتصال
OrderDate=من أجل التاريخ OrderDate=من أجل التاريخ
NewOrder=النظام الجديد NewOrder=النظام الجديد
ToOrder=ومن أجل جعل ToOrder=ومن أجل جعل

View File

@ -18,7 +18,6 @@ ProposalsOpened=افتتح مقترحات تجارية
Prop=مقترحات تجارية Prop=مقترحات تجارية
CommercialProposal=اقتراح التجارية CommercialProposal=اقتراح التجارية
CommercialProposals=مقترحات تجارية CommercialProposals=مقترحات تجارية
ProposalContact=اقتراح الاتصال
NewProp=التجاري الجديد المقترح NewProp=التجاري الجديد المقترح
NewProposal=التجاري الجديد المقترح NewProposal=التجاري الجديد المقترح
NewPropal=اقتراح جديد NewPropal=اقتراح جديد

View File

@ -50,7 +50,6 @@ SupplierInvoice=Factura de proveïdor
SuppliersInvoices=Factures de proveïdors SuppliersInvoices=Factures de proveïdors
SupplierBill=Factura de proveïdor SupplierBill=Factura de proveïdor
SupplierBills=Factures de proveïdors SupplierBills=Factures de proveïdors
BillContacts=Contactes factura
Payment=Pagament Payment=Pagament
PaymentBack=Reembossament PaymentBack=Reembossament
Payments=Pagaments Payments=Pagaments

View File

@ -21,7 +21,6 @@ ServiceStatusClosed=Tancat
ServicesLegend=Llegenda per als serveis ServicesLegend=Llegenda per als serveis
Contracts=Contractes Contracts=Contractes
Contract=Contracte Contract=Contracte
ContractContacts=Contactes contracte
NoContracts=Sense contractes NoContracts=Sense contractes
MenuServices=Serveis MenuServices=Serveis
MenuInactiveServices=Serveis inactius MenuInactiveServices=Serveis inactius

View File

@ -7,7 +7,6 @@ Order=Comanda
Orders=Comandes Orders=Comandes
OrderLine=Línia de comanda OrderLine=Línia de comanda
OrderFollow=Seguiment OrderFollow=Seguiment
OrderContact=Contactes comanda
OrderDate=Data comanda OrderDate=Data comanda
OrderToProcess=Comanda a processar OrderToProcess=Comanda a processar
NewOrder=Nova comanda NewOrder=Nova comanda

View File

@ -10,7 +10,6 @@ CommercialProposal=Pressupost
CommercialProposals=Pressupostos CommercialProposals=Pressupostos
ProposalsOpened=Pressupostos oberts ProposalsOpened=Pressupostos oberts
ProposalCard=Fitxa pressupost ProposalCard=Fitxa pressupost
ProposalContact=Contacte pressupost
NewProp=Nou pressupost NewProp=Nou pressupost
NewProposal=Nou pressupost NewProposal=Nou pressupost
NewPropal=Nou pressupost NewPropal=Nou pressupost

View File

@ -47,7 +47,6 @@ SupplierInvoice=Leverandør faktura
SuppliersInvoices=Leverandørernes fakturaer SuppliersInvoices=Leverandørernes fakturaer
SupplierBill=Leverandør faktura SupplierBill=Leverandør faktura
SupplierBills=leverandører fakturaer SupplierBills=leverandører fakturaer
BillContacts=Faktura kontakter
Payment=Betaling Payment=Betaling
PaymentBack=Betaling tilbage PaymentBack=Betaling tilbage
Payments=Betalinger Payments=Betalinger

View File

@ -29,7 +29,6 @@ ServiceStatusClosed=Lukket
ServicesLegend=Services legend ServicesLegend=Services legend
Contracts=Kontrakter Contracts=Kontrakter
Contract=Kontrakt Contract=Kontrakt
ContractContacts=Kontrakt kontakter
NoContracts=Nr. kontrakter NoContracts=Nr. kontrakter
MenuServices=Services MenuServices=Services
MenuInactiveServices=Tjenester, der ikke er aktive MenuInactiveServices=Tjenester, der ikke er aktive

View File

@ -17,7 +17,6 @@ OrderCard=Bestil kort
Order=Rækkefølge Order=Rækkefølge
Orders=Ordrer Orders=Ordrer
OrderFollow=Opfølgning OrderFollow=Opfølgning
OrderContact=Bestil kontakt
OrderDate=Bestil dato OrderDate=Bestil dato
NewOrder=Ny ordre NewOrder=Ny ordre
ToOrder=Foretag orden ToOrder=Foretag orden

View File

@ -19,7 +19,6 @@ ProposalsOpened=Åbnet kommercielle forslag
Prop=Kommerciel forslag Prop=Kommerciel forslag
CommercialProposal=Kommerciel forslag CommercialProposal=Kommerciel forslag
CommercialProposals=Kommerciel forslag CommercialProposals=Kommerciel forslag
ProposalContact=Forslag kontakt
NewProp=Nye kommercielle forslag NewProp=Nye kommercielle forslag
NewProposal=Nye kommercielle forslag NewProposal=Nye kommercielle forslag
NewPropal=Nyt forslag NewPropal=Nyt forslag

View File

@ -42,7 +42,6 @@ SupplierInvoice=Lieferantenrechnung
SuppliersInvoices=Lieferantenrechnungen SuppliersInvoices=Lieferantenrechnungen
SupplierBill=Lieferantenrechnung SupplierBill=Lieferantenrechnung
SupplierBills=Lieferantenrechnungen SupplierBills=Lieferantenrechnungen
BillContacts=Rechnungskontakte
Payment=Zahlung Payment=Zahlung
PaymentBack=Rückzahlung PaymentBack=Rückzahlung
Payments=Zahlungen Payments=Zahlungen

View File

@ -24,7 +24,6 @@ ServiceStatusClosed=Geschlossen
ServicesLegend=Services Legende ServicesLegend=Services Legende
Contracts=Verträge Contracts=Verträge
Contract=Vertrag Contract=Vertrag
ContractContacts=Vertragskontakt
NoContracts=Keine Verträge NoContracts=Keine Verträge
MenuServices=Services MenuServices=Services
MenuInactiveServices=Inaktive Services MenuInactiveServices=Inaktive Services

View File

@ -12,7 +12,6 @@ OrderCard=Bestell-Karte
Order=Bestellung Order=Bestellung
Orders=Bestellungen Orders=Bestellungen
OrderFollow=Follow-up OrderFollow=Follow-up
OrderContact=Bestellkontakt
OrderDate=Bestelldatum OrderDate=Bestelldatum
NewOrder=Neue Bestellung NewOrder=Neue Bestellung
ToOrder=Erzeuge Bestellung ToOrder=Erzeuge Bestellung

View File

@ -14,7 +14,6 @@ ProposalsOpened=Offene Angebote
Prop=Angebot Prop=Angebot
CommercialProposal=Angebot CommercialProposal=Angebot
CommercialProposals=Angebote CommercialProposals=Angebote
ProposalContact=Angebotskontakt
NewProp=Neues Angebot NewProp=Neues Angebot
NewProposal=Neues Angebot NewProposal=Neues Angebot
NewPropal=Neues Angebot NewPropal=Neues Angebot

View File

@ -42,7 +42,6 @@ SupplierInvoice=Lieferantenrechnung
SuppliersInvoices=Lieferantenrechnungen SuppliersInvoices=Lieferantenrechnungen
SupplierBill=Lieferantenrechnung SupplierBill=Lieferantenrechnung
SupplierBills=Lieferantenrechnungen SupplierBills=Lieferantenrechnungen
BillContacts=Rechnungskontakte
Payment=Zahlung Payment=Zahlung
PaymentBack=Rückzahlung PaymentBack=Rückzahlung
Payments=Zahlungen Payments=Zahlungen

View File

@ -24,7 +24,6 @@ ServiceStatusClosed=Geschlossen
ServicesLegend=Services Legende ServicesLegend=Services Legende
Contracts=Verträge Contracts=Verträge
Contract=Vertrag Contract=Vertrag
ContractContacts=Vertragskontakt
NoContracts=Keine Verträge NoContracts=Keine Verträge
MenuServices=Services MenuServices=Services
MenuInactiveServices=Inaktive Services MenuInactiveServices=Inaktive Services

View File

@ -12,7 +12,6 @@ OrderCard=Bestell-Karte
Order=Bestellung Order=Bestellung
Orders=Bestellungen Orders=Bestellungen
OrderFollow=Follow-up OrderFollow=Follow-up
OrderContact=Bestellkontakt
OrderDate=Bestelldatum OrderDate=Bestelldatum
NewOrder=Neue Bestellung NewOrder=Neue Bestellung
ToOrder=Erzeuge Bestellung ToOrder=Erzeuge Bestellung

View File

@ -14,7 +14,6 @@ ProposalsOpened=Offene Angebote
Prop=Angebot Prop=Angebot
CommercialProposal=Angebot CommercialProposal=Angebot
CommercialProposals=Angebote CommercialProposals=Angebote
ProposalContact=Angebotskontakt
NewProp=Neues Angebot NewProp=Neues Angebot
NewProposal=Neues Angebot NewProposal=Neues Angebot
NewPropal=Neues Angebot NewPropal=Neues Angebot

View File

@ -50,7 +50,6 @@ SupplierInvoice=Τιμολόγιο Προμηθευτή
SuppliersInvoices=Τιμολόγια Προμηθευτή SuppliersInvoices=Τιμολόγια Προμηθευτή
SupplierBill=Τιμολόγιο Προμηθευτή SupplierBill=Τιμολόγιο Προμηθευτή
SupplierBills=Τιμολόγια Προμηθευτή SupplierBills=Τιμολόγια Προμηθευτή
BillContacts=Πρόσωπο Επικοινωνίας
Payment=Πληρωμή Payment=Πληρωμή
PaymentBack=Payment back PaymentBack=Payment back
Payments=Πληρωμές Payments=Πληρωμές

View File

@ -21,7 +21,6 @@ ServiceStatusClosed=Τερματισμένη
ServicesLegend=Services legend ServicesLegend=Services legend
Contracts=Συμβόλαια Contracts=Συμβόλαια
Contract=Συμβόλαιο Contract=Συμβόλαιο
ContractContacts=Contract contacts
NoContracts=Κανένα Συμβόλαιο NoContracts=Κανένα Συμβόλαιο
MenuServices=Υπηρεσίες MenuServices=Υπηρεσίες
MenuInactiveServices=Ανενεργές Υπηρεσίες MenuInactiveServices=Ανενεργές Υπηρεσίες

View File

@ -7,7 +7,6 @@ Order=Παραγγελία
Orders=Παραγγελίες Orders=Παραγγελίες
OrderLine=Γραμμή Παραγγελίας OrderLine=Γραμμή Παραγγελίας
OrderFollow=Follow up OrderFollow=Follow up
OrderContact=Πρόσωπο Επικοιν. παραγγελίας
OrderDate=Ημερομηνία παραγγελίας OrderDate=Ημερομηνία παραγγελίας
OrderToProcess=Παραγγελία προς επεξεργασία OrderToProcess=Παραγγελία προς επεξεργασία
NewOrder=Νέα παραγγελία NewOrder=Νέα παραγγελία

View File

@ -10,7 +10,6 @@ Prop=Εμπορικές προτάσεις
CommercialProposal=Εμπορική πρόταση CommercialProposal=Εμπορική πρόταση
CommercialProposals=Εμπορικές προτάσεις CommercialProposals=Εμπορικές προτάσεις
ProposalCard=Καρτέλα πρότασης ProposalCard=Καρτέλα πρότασης
ProposalContact=Αντιπρόσωπος πρότασης
NewProp=Νέα εμπορική πρόταση NewProp=Νέα εμπορική πρόταση
NewProposal=Νέα εμπορική πρόταση NewProposal=Νέα εμπορική πρόταση
NewPropal=Νέα πρόταση NewPropal=Νέα πρόταση

View File

@ -10,7 +10,6 @@ Prop=Quotations
CommercialProposal=Quotation CommercialProposal=Quotation
CommercialProposals=Quotations CommercialProposals=Quotations
ProposalCard=Quotation card ProposalCard=Quotation card
ProposalContact=Quotation contact
NewProp=New quotation NewProp=New quotation
NewProposal=New quotation NewProposal=New quotation
NewPropal=New quotation NewPropal=New quotation

View File

@ -54,7 +54,6 @@ SupplierInvoice=Supplier invoice
SuppliersInvoices=Supplier's invoices SuppliersInvoices=Supplier's invoices
SupplierBill=Supplier invoice SupplierBill=Supplier invoice
SupplierBills=suppliers invoices SupplierBills=suppliers invoices
BillContacts=Invoice contacts
Payment=Payment Payment=Payment
PaymentBack=Payment back PaymentBack=Payment back
Payments=Payments Payments=Payments

View File

@ -21,7 +21,6 @@ ServiceStatusClosed=Closed
ServicesLegend=Services legend ServicesLegend=Services legend
Contracts=Contracts Contracts=Contracts
Contract=Contract Contract=Contract
ContractContacts=Contract contacts
NoContracts=No contracts NoContracts=No contracts
MenuServices=Services MenuServices=Services
MenuInactiveServices=Services not active MenuInactiveServices=Services not active

View File

@ -7,7 +7,6 @@ Order=Order
Orders=Orders Orders=Orders
OrderLine=Order line OrderLine=Order line
OrderFollow=Follow up OrderFollow=Follow up
OrderContact=Order contact
OrderDate=Order date OrderDate=Order date
OrderToProcess=Order to process OrderToProcess=Order to process
NewOrder=New order NewOrder=New order

View File

@ -10,7 +10,6 @@ Prop=Commercial proposals
CommercialProposal=Commercial proposal CommercialProposal=Commercial proposal
CommercialProposals=Commercial proposals CommercialProposals=Commercial proposals
ProposalCard=Proposal card ProposalCard=Proposal card
ProposalContact=Proposal contact
NewProp=New commercial proposal NewProp=New commercial proposal
NewProposal=New commercial proposal NewProposal=New commercial proposal
NewPropal=New proposal NewPropal=New proposal

View File

@ -50,7 +50,6 @@ SupplierInvoice=Factura de proveedor
SuppliersInvoices=Facturas de proveedores SuppliersInvoices=Facturas de proveedores
SupplierBill=Factura de proveedor SupplierBill=Factura de proveedor
SupplierBills=Facturas de proveedores SupplierBills=Facturas de proveedores
BillContacts=Contactos factura
Payment=Pago Payment=Pago
PaymentBack=Reembolso PaymentBack=Reembolso
Payments=Pagos Payments=Pagos

View File

@ -21,7 +21,6 @@ ServiceStatusClosed=Cerrado
ServicesLegend=Leyenda para los servicios ServicesLegend=Leyenda para los servicios
Contracts=Contratos Contracts=Contratos
Contract=Contrato Contract=Contrato
ContractContacts=Contactos contrato
NoContracts=Sin contratos NoContracts=Sin contratos
MenuServices=Servicios MenuServices=Servicios
MenuInactiveServices=Servicios inactivos MenuInactiveServices=Servicios inactivos

View File

@ -7,7 +7,6 @@ Order=Pedido
Orders=Pedidos Orders=Pedidos
OrderLine=Línea de pedido OrderLine=Línea de pedido
OrderFollow=Seguimiento OrderFollow=Seguimiento
OrderContact=Contactos pedido
OrderDate=Fecha pedido OrderDate=Fecha pedido
OrderToProcess=Pedido a procesar OrderToProcess=Pedido a procesar
NewOrder=Nuevo pedido NewOrder=Nuevo pedido

View File

@ -10,7 +10,6 @@ CommercialProposal=Presupuesto
CommercialProposals=Presupuestos CommercialProposals=Presupuestos
ProposalsOpened=Presupuestos abiertos ProposalsOpened=Presupuestos abiertos
ProposalCard=Ficha presupuesto ProposalCard=Ficha presupuesto
ProposalContact=Contacto presupuesto
NewProp=Nuevo presupuesto NewProp=Nuevo presupuesto
NewProposal=Nuevo presupuesto NewProposal=Nuevo presupuesto
NewPropal=Nuevo presupuesto NewPropal=Nuevo presupuesto

View File

@ -62,7 +62,6 @@ SupplierInvoice=Tarnija arve
SuppliersInvoices=Tarnija arved SuppliersInvoices=Tarnija arved
SupplierBill=Tarnija arve SupplierBill=Tarnija arve
SupplierBills=tarnijate arvete SupplierBills=tarnijate arvete
BillContacts=Arve kontaktid
Payment=Makse Payment=Makse
PaymentBack=Makse tagasi PaymentBack=Makse tagasi
Payments=Maksed Payments=Maksed

View File

@ -29,7 +29,6 @@ ServiceStatusClosed=Suletud
ServicesLegend=Teenused legend ServicesLegend=Teenused legend
Contracts=Lepingud Contracts=Lepingud
Contract=Leping Contract=Leping
ContractContacts=Leping kontaktid
NoContracts=Lepinguid NoContracts=Lepinguid
MenuServices=Teenused MenuServices=Teenused
MenuInactiveServices=Teenused ole aktiivne MenuInactiveServices=Teenused ole aktiivne

View File

@ -15,7 +15,6 @@ Order=Et
Orders=Tellimused Orders=Tellimused
OrderLine=Et liini OrderLine=Et liini
OrderFollow=Järelmeetmed OrderFollow=Järelmeetmed
OrderContact=Selleks kontakt
OrderDate=Selleks kuupäevaks OrderDate=Selleks kuupäevaks
OrderToProcess=Selleks, et protsess OrderToProcess=Selleks, et protsess
NewOrder=New et NewOrder=New et

View File

@ -18,7 +18,6 @@ Prop=Commercial ettepanekuid
CommercialProposal=Commercial ettepanek CommercialProposal=Commercial ettepanek
CommercialProposals=Commercial ettepanekuid CommercialProposals=Commercial ettepanekuid
ProposalCard=Ettepanek kaart ProposalCard=Ettepanek kaart
ProposalContact=Ettepanek kontakt
NewProp=Uus äri-ettepanekut NewProp=Uus äri-ettepanekut
NewProposal=Uus äri-ettepanekut NewProposal=Uus äri-ettepanekut
NewPropal=Uus ettepanek NewPropal=Uus ettepanek

View File

@ -51,8 +51,7 @@ CustomersInvoices=العملاء والفواتير
SupplierInvoice=فاتورة المورد SupplierInvoice=فاتورة المورد
SuppliersInvoices=الموردين SuppliersInvoices=الموردين
SupplierBill=فاتورة المورد SupplierBill=فاتورة المورد
SupplierBills=فواتير الموردين SupplierBills=فاتورة الاتصالات
BillContacts=فاتورة الاتصالات
Payment=الدفع Payment=الدفع
PaymentBack=دفع العودة PaymentBack=دفع العودة
Payments=المدفوعات Payments=المدفوعات

View File

@ -30,7 +30,6 @@ ServiceStatusClosed=مغلقة
ServicesLegend=خدمات أسطورة ServicesLegend=خدمات أسطورة
Contracts=عقود Contracts=عقود
Contract=العقد Contract=العقد
ContractContacts=عقد اتصالات
NoContracts=أي عقود NoContracts=أي عقود
MenuServices=الخدمات MenuServices=الخدمات
MenuInactiveServices=الخدمات غير الفعالة MenuInactiveServices=الخدمات غير الفعالة

View File

@ -16,7 +16,6 @@ Order=ترتيب
Orders=أوامر Orders=أوامر
OrderLine=من أجل خط OrderLine=من أجل خط
OrderFollow=متابعة OrderFollow=متابعة
OrderContact=من أجل الاتصال
OrderDate=من أجل التاريخ OrderDate=من أجل التاريخ
NewOrder=النظام الجديد NewOrder=النظام الجديد
ToOrder=ومن أجل جعل ToOrder=ومن أجل جعل

View File

@ -18,7 +18,6 @@ ProposalsOpened=افتتح مقترحات تجارية
Prop=مقترحات تجارية Prop=مقترحات تجارية
CommercialProposal=اقتراح التجارية CommercialProposal=اقتراح التجارية
CommercialProposals=مقترحات تجارية CommercialProposals=مقترحات تجارية
ProposalContact=اقتراح الاتصال
NewProp=التجاري الجديد المقترح NewProp=التجاري الجديد المقترح
NewProposal=التجاري الجديد المقترح NewProposal=التجاري الجديد المقترح
NewPropal=اقتراح جديد NewPropal=اقتراح جديد

View File

@ -45,7 +45,6 @@ SupplierInvoice=Toimittajan laskun
SuppliersInvoices=Tavarantoimittajat laskujen SuppliersInvoices=Tavarantoimittajat laskujen
SupplierBill=Toimittajan laskun SupplierBill=Toimittajan laskun
SupplierBills=tavarantoimittajien laskut SupplierBills=tavarantoimittajien laskut
BillContacts=Laskun yhteystiedot
Payment=Maksu Payment=Maksu
PaymentBack=Maksun PaymentBack=Maksun
Payments=Maksut Payments=Maksut

View File

@ -27,7 +27,6 @@ ServiceStatusClosed=Suljettu
ServicesLegend=Palvelut legenda ServicesLegend=Palvelut legenda
Contracts=Sopimukset Contracts=Sopimukset
Contract=Sopimus Contract=Sopimus
ContractContacts=Sopimus yhteystiedot
NoContracts=Sopimuksia ei NoContracts=Sopimuksia ei
MenuServices=Palvelut MenuServices=Palvelut
MenuInactiveServices=Palvelut, joita ei aktiivinen MenuInactiveServices=Palvelut, joita ei aktiivinen

View File

@ -15,7 +15,6 @@ OrderCard=Tilaa kortti
Order=Tilata Order=Tilata
Orders=Tilaukset Orders=Tilaukset
OrderFollow=Seuranta OrderFollow=Seuranta
OrderContact=Tilaa yhteyttä
OrderDate=Tilaa päivämäärä OrderDate=Tilaa päivämäärä
NewOrder=Uusi järjestys NewOrder=Uusi järjestys
ToOrder=Tee jotta ToOrder=Tee jotta

View File

@ -17,7 +17,6 @@ ProposalsOpened=Avoinna kaupallinen ehdotuksia
Prop=Kaupalliset ehdotuksia Prop=Kaupalliset ehdotuksia
CommercialProposal=Kaupalliset ehdotus CommercialProposal=Kaupalliset ehdotus
CommercialProposals=Kaupalliset ehdotuksia CommercialProposals=Kaupalliset ehdotuksia
ProposalContact=Ehdotus yhteyttä
NewProp=Uusia kaupallisia ehdotus NewProp=Uusia kaupallisia ehdotus
NewProposal=Uusia kaupallisia ehdotus NewProposal=Uusia kaupallisia ehdotus
NewPropal=Uusi ehdotus NewPropal=Uusi ehdotus

View File

@ -50,7 +50,6 @@ SupplierInvoice=Facture fournisseur
SuppliersInvoices=Factures fournisseurs SuppliersInvoices=Factures fournisseurs
SupplierBill=Facture fournisseur SupplierBill=Facture fournisseur
SupplierBills=Factures fournisseurs SupplierBills=Factures fournisseurs
BillContacts=Contacts facture
Payment=Règlement Payment=Règlement
PaymentBack=Remboursement PaymentBack=Remboursement
Payments=Règlements Payments=Règlements

View File

@ -21,7 +21,6 @@ ServiceStatusClosed=Fermé
ServicesLegend=Légende pour les services ServicesLegend=Légende pour les services
Contracts=Contrats Contracts=Contrats
Contract=Contrat Contract=Contrat
ContractContacts=Contacts contrat
NoContracts=Pas de contrats NoContracts=Pas de contrats
MenuServices=Services MenuServices=Services
MenuInactiveServices=Services inactifs MenuInactiveServices=Services inactifs

View File

@ -7,7 +7,6 @@ Order=Commande
Orders=Commandes Orders=Commandes
OrderLine=Ligne de commande OrderLine=Ligne de commande
OrderFollow=Suivi OrderFollow=Suivi
OrderContact=Contacts commande
OrderDate=Date commande OrderDate=Date commande
OrderToProcess=Commande à traiter OrderToProcess=Commande à traiter
NewOrder=Nouvelle commande NewOrder=Nouvelle commande

View File

@ -10,7 +10,6 @@ CommercialProposal=Proposition commerciale
CommercialProposals=Propositions commerciales CommercialProposals=Propositions commerciales
ProposalsOpened=Propositions commerciales ouvertes ProposalsOpened=Propositions commerciales ouvertes
ProposalCard=Fiche proposition ProposalCard=Fiche proposition
ProposalContact=Contact proposition
NewProp=Nouvelle proposition commerciale NewProp=Nouvelle proposition commerciale
NewProposal=Nouvelle proposition commerciale NewProposal=Nouvelle proposition commerciale
NewPropal=Nouvelle proposition NewPropal=Nouvelle proposition

View File

@ -61,8 +61,7 @@ CustomersInvoices=לקוחות של חשבוניות
SupplierInvoice=חשבונית הספק SupplierInvoice=חשבונית הספק
SuppliersInvoices=הספק של חשבוניות SuppliersInvoices=הספק של חשבוניות
SupplierBill=חשבונית הספק SupplierBill=חשבונית הספק
SupplierBills=חשבוניות ספקים SupplierBills=חשבונית אנשי קשר
BillContacts=חשבונית אנשי קשר
Payment=תשלום Payment=תשלום
PaymentBack=תשלום בחזרה PaymentBack=תשלום בחזרה
Payments=תשלומים Payments=תשלומים

View File

@ -29,7 +29,6 @@ ServiceStatusClosed=סגור
ServicesLegend=שירותי אגדה ServicesLegend=שירותי אגדה
Contracts=חוזים Contracts=חוזים
Contract=חוזה Contract=חוזה
ContractContacts=חוזה אנשי קשר
NoContracts=אין חוזים NoContracts=אין חוזים
MenuServices=שירותים MenuServices=שירותים
MenuInactiveServices=לא פעילים שירותים MenuInactiveServices=לא פעילים שירותים

View File

@ -15,7 +15,6 @@ Order=סדר
Orders=הזמנות Orders=הזמנות
OrderLine=צו קו OrderLine=צו קו
OrderFollow=מעקב OrderFollow=מעקב
OrderContact=סדר קשר
OrderDate=סדר מועד OrderDate=סדר מועד
OrderToProcess=כדי לעבד OrderToProcess=כדי לעבד
NewOrder=חדש הסדר NewOrder=חדש הסדר

View File

@ -18,7 +18,6 @@ Prop=הצעות מסחריות
CommercialProposal=מסחרי ההצעה CommercialProposal=מסחרי ההצעה
CommercialProposals=הצעות מסחריות CommercialProposals=הצעות מסחריות
ProposalCard=הצעת כרטיס ProposalCard=הצעת כרטיס
ProposalContact=ההצעה קשר
NewProp=ההצעה מסחריים חדשים NewProp=ההצעה מסחריים חדשים
NewProposal=ההצעה מסחריים חדשים NewProposal=ההצעה מסחריים חדשים
NewPropal=הצעה חדשה NewPropal=הצעה חדשה

View File

@ -62,7 +62,6 @@ SupplierInvoice=Szállító számlát
SuppliersInvoices=Szállító számlák SuppliersInvoices=Szállító számlák
SupplierBill=Szállító számlát SupplierBill=Szállító számlát
SupplierBills=beszállítói számlák SupplierBills=beszállítói számlák
BillContacts=Számla kapcsolatok
Payment=Fizetés Payment=Fizetés
PaymentBack=Fizetési vissza PaymentBack=Fizetési vissza
Payments=Kifizetések Payments=Kifizetések

View File

@ -21,7 +21,6 @@ ServiceStatusClosed=Lezárva
ServicesLegend=Szolgáltatások magyarázat ServicesLegend=Szolgáltatások magyarázat
Contracts=Szerződések Contracts=Szerződések
Contract=Szerződés Contract=Szerződés
ContractContacts=Szerződés kapcsolattartói
NoContracts=Nincs szerződés NoContracts=Nincs szerződés
MenuServices=Szolgáltatás MenuServices=Szolgáltatás
MenuInactiveServices=Nincs aktív szolgáltatás MenuInactiveServices=Nincs aktív szolgáltatás

View File

@ -15,7 +15,6 @@ Order=Megrendelés
Orders=Megrendelés Orders=Megrendelés
OrderLine=Rendelés vonal OrderLine=Rendelés vonal
OrderFollow=Nyomon követés OrderFollow=Nyomon követés
OrderContact=Megrendelés Kapcsolat
OrderDate=Rendezés dátum OrderDate=Rendezés dátum
OrderToProcess=Feldolgozása érdekében OrderToProcess=Feldolgozása érdekében
NewOrder=Új megbízás NewOrder=Új megbízás

View File

@ -18,7 +18,6 @@ Prop=Üzleti ajánlatok
CommercialProposal=Üzleti ajánlat CommercialProposal=Üzleti ajánlat
CommercialProposals=Üzleti ajánlatok CommercialProposals=Üzleti ajánlatok
ProposalCard=Javaslat kártya ProposalCard=Javaslat kártya
ProposalContact=Javaslat Kapcsolat
NewProp=Új kereskedelmi javaslat NewProp=Új kereskedelmi javaslat
NewProposal=Új kereskedelmi javaslat NewProposal=Új kereskedelmi javaslat
NewPropal=Új javaslat NewPropal=Új javaslat

View File

@ -58,7 +58,6 @@ SupplierInvoice=Birgir Reikningar
SuppliersInvoices=reikningum birgis SuppliersInvoices=reikningum birgis
SupplierBill=Birgir Reikningar SupplierBill=Birgir Reikningar
SupplierBills=birgjum reikninga SupplierBills=birgjum reikninga
BillContacts=Invoice tengiliðir
Payment=Greiðsla Payment=Greiðsla
PaymentBack=Greiðsla til baka PaymentBack=Greiðsla til baka
Payments=Greiðslur Payments=Greiðslur

View File

@ -29,7 +29,6 @@ ServiceStatusClosed=Loka
ServicesLegend=Þjónusta þjóðsaga ServicesLegend=Þjónusta þjóðsaga
Contracts=Samningar Contracts=Samningar
Contract=Samningur Contract=Samningur
ContractContacts=Samningur tengiliðir
NoContracts=Engir samningar NoContracts=Engir samningar
MenuServices=Þjónusta MenuServices=Þjónusta
MenuInactiveServices=Þjónusta ekki virk MenuInactiveServices=Þjónusta ekki virk

View File

@ -15,7 +15,6 @@ Order=Panta
Orders=Pantanir Orders=Pantanir
OrderLine=Pöntunarlína OrderLine=Pöntunarlína
OrderFollow=Eftirfylgni OrderFollow=Eftirfylgni
OrderContact=Panta samband
OrderDate=Panta dagsetningu OrderDate=Panta dagsetningu
OrderToProcess=Til að framkvæma OrderToProcess=Til að framkvæma
NewOrder=New Order NewOrder=New Order

View File

@ -17,7 +17,6 @@ ProposalsOpened=Opnaður auglýsing tillögur
Prop=Auglýsing tillögur Prop=Auglýsing tillögur
CommercialProposal=Auglýsing tillögu CommercialProposal=Auglýsing tillögu
CommercialProposals=Auglýsing tillögur CommercialProposals=Auglýsing tillögur
ProposalContact=Tillaga samband
NewProp=Ný auglýsing tillögu NewProp=Ný auglýsing tillögu
NewProposal=Ný auglýsing tillögu NewProposal=Ný auglýsing tillögu
NewPropal=Ný tillaga NewPropal=Ný tillaga

View File

@ -40,7 +40,6 @@ SupplierInvoice =Fattura del fornitore
SuppliersInvoices =Fatture dei fornitori SuppliersInvoices =Fatture dei fornitori
SupplierBill =Fattura del fornitore SupplierBill =Fattura del fornitore
SupplierBills =Fatture dei fornitori SupplierBills =Fatture dei fornitori
BillContacts =Contatti fattura
Payment =Pagamento Payment =Pagamento
PaymentBack =Rimborso PaymentBack =Rimborso
Payments =Pagamenti Payments =Pagamenti

View File

@ -18,7 +18,6 @@ ServiceStatusClosed =Chiuso
ServicesLegend =Servizi leggenda ServicesLegend =Servizi leggenda
Contracts =Contratti per servizi Contracts =Contratti per servizi
Contract =Contratto per servizi Contract =Contratto per servizi
ContractContacts =Contatti del contratto per servizi
MenuServices =Servizi MenuServices =Servizi
MenuInactiveServices =Servizi non attivi MenuInactiveServices =Servizi non attivi
MenuRunningServices =Servizi in esecuzione MenuRunningServices =Servizi in esecuzione

View File

@ -5,8 +5,7 @@ SuppliersOrdersArea =Sezione ordini fornitori
OrderCard =Scheda ordine OrderCard =Scheda ordine
Order =Ordine Order =Ordine
Orders =Ordini Orders =Ordini
OrderFollow =Follow-up OrderFollow =Follow-up
OrderContact =Contatto ordine
OrderDate =Data ordine OrderDate =Data ordine
NewOrder =Nuovo ordine NewOrder =Nuovo ordine
ToOrder =Richiedere ordine ToOrder =Richiedere ordine

View File

@ -8,7 +8,6 @@ ProposalsOpened =Proposte commerciali aperte
Prop =Preventivi/Prop. commerciali Prop =Preventivi/Prop. commerciali
CommercialProposal =Preventivo/Proposta commerciale CommercialProposal =Preventivo/Proposta commerciale
CommercialProposals =Preventivi/Proposte commerciali CommercialProposals =Preventivi/Proposte commerciali
ProposalContact =Contatto della proposta
NewProp =Nuova proposta commerciale NewProp =Nuova proposta commerciale
NewProposal =Nuova proposta commerciale NewProposal =Nuova proposta commerciale
NewPropal =Nuova proposta NewPropal =Nuova proposta

View File

@ -62,7 +62,6 @@ SupplierInvoice=サプライヤーの請求書
SuppliersInvoices=仕入先の請求書 SuppliersInvoices=仕入先の請求書
SupplierBill=サプライヤーの請求書 SupplierBill=サプライヤーの請求書
SupplierBills=仕入先の請求書 SupplierBills=仕入先の請求書
BillContacts=請求書の連絡先
Payment=支払い Payment=支払い
PaymentBack=戻って支払い PaymentBack=戻って支払い
Payments=支払い Payments=支払い

View File

@ -23,7 +23,6 @@ ServiceStatusClosed=閉じ
ServicesLegend=サービス伝説 ServicesLegend=サービス伝説
Contracts=契約 Contracts=契約
Contract=契約 Contract=契約
ContractContacts=契約担当者
NoContracts=いいえ契約なし NoContracts=いいえ契約なし
MenuServices=サービス MenuServices=サービス
MenuInactiveServices=アクティブでないサービス MenuInactiveServices=アクティブでないサービス

View File

@ -15,7 +15,6 @@ Order=オーダー
Orders=受注 Orders=受注
OrderLine=注文明細行 OrderLine=注文明細行
OrderFollow=フォローアップ OrderFollow=フォローアップ
OrderContact=ご注文お問い合わせ
OrderDate=注文日 OrderDate=注文日
OrderToProcess=プロセスの順序 OrderToProcess=プロセスの順序
NewOrder=新規注文 NewOrder=新規注文

View File

@ -18,7 +18,6 @@ Prop=商用の提案
CommercialProposal=商業的提案 CommercialProposal=商業的提案
CommercialProposals=商用の提案 CommercialProposals=商用の提案
ProposalCard=提案カード ProposalCard=提案カード
ProposalContact=提案の連絡先
NewProp=新しい商業提案 NewProp=新しい商業提案
NewProposal=新しい商業提案 NewProposal=新しい商業提案
NewPropal=新たな提案 NewPropal=新たな提案

View File

@ -41,7 +41,6 @@ SupplierInvoice=Leverandørfaktura
SuppliersInvoices=Leverandørfakturaer SuppliersInvoices=Leverandørfakturaer
SupplierBill=Leverandørfaktura SupplierBill=Leverandørfaktura
SupplierBills=Leverandørfakturaer SupplierBills=Leverandørfakturaer
BillContacts=Fakturakontakter
Payment=Betaling Payment=Betaling
PaymentBack=Betaling tilbake PaymentBack=Betaling tilbake
Payments=Betalinger Payments=Betalinger

View File

@ -17,7 +17,6 @@ ServiceStatusClosed=Lukket
ServicesLegend=Tjeneste legend ServicesLegend=Tjeneste legend
Contracts=Kontrakter Contracts=Kontrakter
Contract=Kontrakt Contract=Kontrakt
ContractContacts=Kontaktperson for kontrakten
NoContracts=Ingen kontrakter NoContracts=Ingen kontrakter
MenuServices=Tjenester MenuServices=Tjenester
MenuInactiveServices=Ikke aktive tjenester MenuInactiveServices=Ikke aktive tjenester

View File

@ -6,7 +6,6 @@ OrderCard=Ordrekort
Order=Ordre Order=Ordre
Orders=Ordre Orders=Ordre
OrderFollow=Oppfølging OrderFollow=Oppfølging
OrderContact=Kontaktperson
OrderDate=Ordredato OrderDate=Ordredato
NewOrder=Ny ordre NewOrder=Ny ordre
ToOrder=Lag ordre ToOrder=Lag ordre

View File

@ -8,7 +8,6 @@ ProposalsOpened=Åpnede tilbud
Prop=Tilbud Prop=Tilbud
CommercialProposal=Tilbud CommercialProposal=Tilbud
CommercialProposals=Tilbud CommercialProposals=Tilbud
ProposalContact=Tilbudskontakt
NewProp=Nytt tilbud NewProp=Nytt tilbud
NewProposal=Nytt tilbud NewProposal=Nytt tilbud
NewPropal=Nytt tilbud NewPropal=Nytt tilbud

View File

@ -34,7 +34,6 @@ SupplierInvoice=Leveranciers factuur
SuppliersInvoices=Leveranciers facturen SuppliersInvoices=Leveranciers facturen
SupplierBill=Factuur leverancier SupplierBill=Factuur leverancier
SupplierBills=Facturen leveranciers SupplierBills=Facturen leveranciers
BillContacts=Factuur contacten
Payment=Betaling Payment=Betaling
Payments=Betalingen Payments=Betalingen
ReceivedPayments=Ontvangen betalingen ReceivedPayments=Ontvangen betalingen

View File

@ -19,7 +19,6 @@ ServiceStatusClosed=Gesloten
ServicesLegend=Legende diensten ServicesLegend=Legende diensten
Contracts=Contracten Contracts=Contracten
Contract=Contract Contract=Contract
ContractContacts=Contract contacten
NoContracts=Geen contracten NoContracts=Geen contracten
MenuServices=Diensten MenuServices=Diensten
MenuInactiveServices=Diensten niet actief MenuInactiveServices=Diensten niet actief

View File

@ -5,7 +5,6 @@ OrderCard=Bestellingskaart
Order=Bestelling Order=Bestelling
Orders=Bestellingen Orders=Bestellingen
OrderFollow=Opvolging OrderFollow=Opvolging
OrderContact=Bestellings contact
OrderDate=Bestellingsdatum OrderDate=Bestellingsdatum
NewOrder=Nieuwe bestelling NewOrder=Nieuwe bestelling
ToOrder=Naar bestelling ToOrder=Naar bestelling

View File

@ -8,7 +8,6 @@ ProposalsOpened=Geopende offertes
Prop=Offertes Prop=Offertes
CommercialProposal=Offerte CommercialProposal=Offerte
CommercialProposals=Offertes CommercialProposals=Offertes
ProposalContact=Voorstel contact
NewProp=Nieuwe offerte NewProp=Nieuwe offerte
NewProposal=Nieuwe offerte NewProposal=Nieuwe offerte
NewPropal=Nieuwe offerte NewPropal=Nieuwe offerte

View File

@ -50,7 +50,6 @@ SupplierInvoice = Leveranciersfactuur
SuppliersInvoices = Leveranciersfacturen SuppliersInvoices = Leveranciersfacturen
SupplierBill = Leveranciersfactuur SupplierBill = Leveranciersfactuur
SupplierBills = leveranciersfacturen SupplierBills = leveranciersfacturen
BillContacts = Factuurcontacten
Payment = Betaling Payment = Betaling
PaymentBack = Terugbetaling PaymentBack = Terugbetaling
Payments = Betalingen Payments = Betalingen

View File

@ -21,7 +21,6 @@ ServiceStatusClosed = Gesloten
ServicesLegend = Dienstenlegenda ServicesLegend = Dienstenlegenda
Contracts = Contracten Contracts = Contracten
Contract = Contract Contract = Contract
ContractContacts = Contractcontactpersonen
NoContracts = Geen contracten NoContracts = Geen contracten
MenuServices = Diensten MenuServices = Diensten
MenuInactiveServices = Inactieve diensten MenuInactiveServices = Inactieve diensten

Some files were not shown because too many files have changed in this diff Show More