Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dolibarr
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
a12e9598
Commit
a12e9598
authored
9 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
Do not show billed status after order status
parent
a52408c5
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
htdocs/commande/card.php
+34
-33
34 additions, 33 deletions
htdocs/commande/card.php
htdocs/commande/class/commande.class.php
+30
-24
30 additions, 24 deletions
htdocs/commande/class/commande.class.php
htdocs/commande/list.php
+4
-4
4 additions, 4 deletions
htdocs/commande/list.php
with
68 additions
and
61 deletions
htdocs/commande/card.php
+
34
−
33
View file @
a12e9598
...
...
@@ -2281,6 +2281,14 @@ if ($action == 'create' && $user->rights->commande->creer)
$reshook
=
$hookmanager
->
executeHooks
(
'addMoreActionsButtons'
,
$parameters
,
$object
,
$action
);
// Note that $action and $object may have been
// modified by hook
if
(
empty
(
$reshook
))
{
// Send
if
(
$object
->
statut
>
Commande
::
STATUS_DRAFT
)
{
if
((
empty
(
$conf
->
global
->
MAIN_USE_ADVANCED_PERMS
)
||
$user
->
rights
->
commande
->
order_advance
->
send
))
{
print
'<div class="inline-block divButAction"><a class="butAction" href="'
.
$_SERVER
[
"PHP_SELF"
]
.
'?id='
.
$object
->
id
.
'&action=presend&mode=init">'
.
$langs
->
trans
(
'SendByMail'
)
.
'</a></div>'
;
}
else
print
'<div class="inline-block divButAction"><a class="butActionRefused" href="#">'
.
$langs
->
trans
(
'SendByMail'
)
.
'</a></div>'
;
}
// Valid
if
(
$object
->
statut
==
Commande
::
STATUS_DRAFT
&&
$object
->
total_ttc
>=
0
&&
$numlines
>
0
&&
((
empty
(
$conf
->
global
->
MAIN_USE_ADVANCED_PERMS
)
&&
!
empty
(
$user
->
rights
->
commande
->
creer
))
...
...
@@ -2300,12 +2308,27 @@ if ($action == 'create' && $user->rights->commande->creer)
{
print
'<a class="butAction" href="'
.
DOL_URL_ROOT
.
'/comm/action/card.php?action=create&origin='
.
$object
->
element
.
'&originid='
.
$object
->
id
.
'&socid='
.
$object
->
socid
.
'">'
.
$langs
->
trans
(
"AddAction"
)
.
'</a>'
;
}
// Send
if
(
$object
->
statut
>
Commande
::
STATUS_DRAFT
)
{
if
((
empty
(
$conf
->
global
->
MAIN_USE_ADVANCED_PERMS
)
||
$user
->
rights
->
commande
->
order_advance
->
send
))
{
print
'<div class="inline-block divButAction"><a class="butAction" href="'
.
$_SERVER
[
"PHP_SELF"
]
.
'?id='
.
$object
->
id
.
'&action=presend&mode=init">'
.
$langs
->
trans
(
'SendByMail'
)
.
'</a></div>'
;
}
else
print
'<div class="inline-block divButAction"><a class="butActionRefused" href="#">'
.
$langs
->
trans
(
'SendByMail'
)
.
'</a></div>'
;
// Create intervention
if
(
$conf
->
ficheinter
->
enabled
)
{
$langs
->
load
(
"interventions"
);
if
(
$object
->
statut
>
Commande
::
STATUS_DRAFT
&&
$object
->
statut
<
Commande
::
STATUS_CLOSED
&&
$object
->
getNbOfServicesLines
()
>
0
)
{
if
(
$user
->
rights
->
ficheinter
->
creer
)
{
print
'<div class="inline-block divButAction"><a class="butAction" href="'
.
DOL_URL_ROOT
.
'/fichinter/card.php?action=create&origin='
.
$object
->
element
.
'&originid='
.
$object
->
id
.
'&socid='
.
$object
->
socid
.
'">'
.
$langs
->
trans
(
'AddIntervention'
)
.
'</a></div>'
;
}
else
{
print
'<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'
.
dol_escape_htmltag
(
$langs
->
trans
(
"NotAllowed"
))
.
'">'
.
$langs
->
trans
(
'AddIntervention'
)
.
'</a></div>'
;
}
}
}
// Create contract
if
(
$conf
->
contrat
->
enabled
&&
(
$object
->
statut
==
Commande
::
STATUS_VALIDATED
||
$object
->
statut
==
Commande
::
STATUS_ACCEPTED
))
{
$langs
->
load
(
"contracts"
);
if
(
$user
->
rights
->
contrat
->
creer
)
{
print
'<div class="inline-block divButAction"><a class="butAction" href="'
.
DOL_URL_ROOT
.
'/contrat/card.php?action=create&origin='
.
$object
->
element
.
'&originid='
.
$object
->
id
.
'&socid='
.
$object
->
socid
.
'">'
.
$langs
->
trans
(
'AddContract'
)
.
'</a></div>'
;
}
}
// Ship
...
...
@@ -2327,31 +2350,14 @@ if ($action == 'create' && $user->rights->commande->creer)
}
}
// Create intervention
if
(
$conf
->
ficheinter
->
enabled
)
{
$langs
->
load
(
"interventions"
);
if
(
$object
->
statut
>
Commande
::
STATUS_DRAFT
&&
$object
->
statut
<
Commande
::
STATUS_CLOSED
&&
$object
->
getNbOfServicesLines
()
>
0
)
{
if
(
$user
->
rights
->
ficheinter
->
creer
)
{
print
'<div class="inline-block divButAction"><a class="butAction" href="'
.
DOL_URL_ROOT
.
'/fichinter/card.php?action=create&origin='
.
$object
->
element
.
'&originid='
.
$object
->
id
.
'&socid='
.
$object
->
socid
.
'">'
.
$langs
->
trans
(
'AddIntervention'
)
.
'</a></div>'
;
}
else
{
print
'<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'
.
dol_escape_htmltag
(
$langs
->
trans
(
"NotAllowed"
))
.
'">'
.
$langs
->
trans
(
'AddIntervention'
)
.
'</a></div>'
;
}
}
}
// Reopen a closed order
if
((
$object
->
statut
==
Commande
::
STATUS_CLOSED
||
$object
->
statut
==
Commande
::
STATUS_CANCELED
)
&&
$user
->
rights
->
commande
->
creer
)
{
print
'<div class="inline-block divButAction"><a class="butAction" href="'
.
$_SERVER
[
'PHP_SELF'
]
.
'?id='
.
$object
->
id
.
'&action=reopen">'
.
$langs
->
trans
(
'ReOpen'
)
.
'</a></div>'
;
}
// Create contract
if
(
$conf
->
contrat
->
enabled
&&
(
$object
->
statut
==
Commande
::
STATUS_VALIDATED
||
$object
->
statut
==
Commande
::
STATUS_ACCEPTED
))
{
$langs
->
load
(
"contracts"
);
if
(
$user
->
rights
->
contrat
->
creer
)
{
print
'<div class="inline-block divButAction"><a class="butAction" href="'
.
DOL_URL_ROOT
.
'/contrat/card.php?action=create&origin='
.
$object
->
element
.
'&originid='
.
$object
->
id
.
'&socid='
.
$object
->
socid
.
'">'
.
$langs
->
trans
(
'AddContract'
)
.
'</a></div>'
;
}
// Set to shipped
if
((
$object
->
statut
==
Commande
::
STATUS_VALIDATED
||
$object
->
statut
==
Commande
::
STATUS_ACCEPTED
)
&&
$user
->
rights
->
commande
->
cloturer
)
{
print
'<div class="inline-block divButAction"><a class="butAction" href="'
.
$_SERVER
[
"PHP_SELF"
]
.
'?id='
.
$object
->
id
.
'&action=shipped">'
.
$langs
->
trans
(
'ClassifyShipped'
)
.
'</a></div>'
;
}
// Create bill and Classify billed
...
...
@@ -2360,16 +2366,11 @@ if ($action == 'create' && $user->rights->commande->creer)
if
(
!
empty
(
$conf
->
facture
->
enabled
)
&&
$user
->
rights
->
facture
->
creer
&&
empty
(
$conf
->
global
->
WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER
))
{
print
'<div class="inline-block divButAction"><a class="butAction" href="'
.
DOL_URL_ROOT
.
'/compta/facture.php?action=create&origin='
.
$object
->
element
.
'&originid='
.
$object
->
id
.
'&socid='
.
$object
->
socid
.
'">'
.
$langs
->
trans
(
"CreateBill"
)
.
'</a></div>'
;
}
if
(
$user
->
rights
->
commande
->
creer
&&
$object
->
statut
>
Commande
::
STATUS_
ACCEP
TED
&&
empty
(
$conf
->
global
->
WORKFLOW_DISABLE_CLASSIFY_BILLED_FROM_ORDER
)
&&
empty
(
$conf
->
global
->
WORKFLOW_BILL_ON_SHIPMENT
))
{
if
(
$user
->
rights
->
commande
->
creer
&&
$object
->
statut
>
=
Commande
::
STATUS_
VALIDA
TED
&&
empty
(
$conf
->
global
->
WORKFLOW_DISABLE_CLASSIFY_BILLED_FROM_ORDER
)
&&
empty
(
$conf
->
global
->
WORKFLOW_BILL_ON_SHIPMENT
))
{
print
'<div class="inline-block divButAction"><a class="butAction" href="'
.
$_SERVER
[
"PHP_SELF"
]
.
'?id='
.
$object
->
id
.
'&action=classifybilled">'
.
$langs
->
trans
(
"ClassifyBilled"
)
.
'</a></div>'
;
}
}
// Set to shipped
if
((
$object
->
statut
==
Commande
::
STATUS_VALIDATED
||
$object
->
statut
==
Commande
::
STATUS_ACCEPTED
)
&&
$user
->
rights
->
commande
->
cloturer
)
{
print
'<div class="inline-block divButAction"><a class="butAction" href="'
.
$_SERVER
[
"PHP_SELF"
]
.
'?id='
.
$object
->
id
.
'&action=shipped">'
.
$langs
->
trans
(
'ClassifyShipped'
)
.
'</a></div>'
;
}
// Clone
if
(
$user
->
rights
->
commande
->
creer
)
{
print
'<div class="inline-block divButAction"><a class="butAction" href="'
.
$_SERVER
[
'PHP_SELF'
]
.
'?id='
.
$object
->
id
.
'&socid='
.
$object
->
socid
.
'&action=clone&object=order">'
.
$langs
->
trans
(
"ToClone"
)
.
'</a></div>'
;
...
...
This diff is collapsed.
Click to expand it.
htdocs/commande/class/commande.class.php
+
30
−
24
View file @
a12e9598
...
...
@@ -2865,7 +2865,8 @@ class Commande extends CommonOrder
*/
function
getLibStatut
(
$mode
)
{
return
$this
->
LibStatut
(
$this
->
statut
,
$this
->
facturee
,
$mode
);
if
(
$this
->
facturee
&&
empty
(
$this
->
billed
))
$this
->
billed
=
$this
->
facturee
;
// For backward compatibility
return
$this
->
LibStatut
(
$this
->
statut
,
$this
->
billed
,
$mode
);
}
/**
...
...
@@ -2874,70 +2875,75 @@ class Commande extends CommonOrder
* @param int $statut Id statut
* @param int $billed If invoiced
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
* @param int $donotshowbilled Do not show billed status after order status
* @return string Label of status
*/
function
LibStatut
(
$statut
,
$billed
,
$mode
)
function
LibStatut
(
$statut
,
$billed
,
$mode
,
$donotshowbilled
=
0
)
{
global
$langs
,
$conf
;
$billedtext
=
''
;
if
(
empty
(
$donotshowbilled
))
$billedtext
.
=
(
$billed
?
' - '
.
$langs
->
trans
(
"Billed"
)
:
''
);
//print 'x'.$statut.'-'.$billed;
if
(
$mode
==
0
)
{
if
(
$statut
==
self
::
STATUS_CANCELED
)
return
$langs
->
trans
(
'StatusOrderCanceled'
);
if
(
$statut
==
self
::
STATUS_DRAFT
)
return
$langs
->
trans
(
'StatusOrderDraft'
);
if
(
$statut
==
self
::
STATUS_VALIDATED
)
return
$langs
->
trans
(
'StatusOrderValidated'
);
if
(
$statut
==
self
::
STATUS_ACCEPTED
)
return
$langs
->
trans
(
'StatusOrderSentShort'
);
if
(
$statut
==
self
::
STATUS_VALIDATED
)
return
$langs
->
trans
(
'StatusOrderValidated'
)
.
$billedtext
;
if
(
$statut
==
self
::
STATUS_ACCEPTED
)
return
$langs
->
trans
(
'StatusOrderSentShort'
)
.
$billedtext
;
if
(
$statut
==
self
::
STATUS_CLOSED
&&
(
!
$billed
&&
empty
(
$conf
->
global
->
WORKFLOW_BILL_ON_SHIPMENT
)))
return
$langs
->
trans
(
'StatusOrderToBill'
);
if
(
$statut
==
self
::
STATUS_CLOSED
&&
(
$billed
&&
empty
(
$conf
->
global
->
WORKFLOW_BILL_ON_SHIPMENT
)))
return
$langs
->
trans
(
'StatusOrderProcessed'
)
.
' - '
.
$langs
->
trans
(
"B
illed
"
)
;
if
(
$statut
==
self
::
STATUS_CLOSED
&&
(
$billed
&&
empty
(
$conf
->
global
->
WORKFLOW_BILL_ON_SHIPMENT
)))
return
$langs
->
trans
(
'StatusOrderProcessed'
)
.
$b
illed
text
;
if
(
$statut
==
self
::
STATUS_CLOSED
&&
(
!
empty
(
$conf
->
global
->
WORKFLOW_BILL_ON_SHIPMENT
)))
return
$langs
->
trans
(
'StatusOrderProcessed'
);
}
elseif
(
$mode
==
1
)
{
if
(
$statut
==
self
::
STATUS_CANCELED
)
return
$langs
->
trans
(
'StatusOrderCanceledShort'
);
if
(
$statut
==
self
::
STATUS_DRAFT
)
return
$langs
->
trans
(
'StatusOrderDraftShort'
);
if
(
$statut
==
self
::
STATUS_VALIDATED
)
return
$langs
->
trans
(
'StatusOrderValidatedShort'
);
if
(
$statut
==
self
::
STATUS_ACCEPTED
)
return
$langs
->
trans
(
'StatusOrderSentShort'
);
if
(
$statut
==
self
::
STATUS_VALIDATED
)
return
$langs
->
trans
(
'StatusOrderValidatedShort'
)
.
$billedtext
;
if
(
$statut
==
self
::
STATUS_ACCEPTED
)
return
$langs
->
trans
(
'StatusOrderSentShort'
)
.
$billedtext
;
if
(
$statut
==
self
::
STATUS_CLOSED
&&
(
!
$billed
&&
empty
(
$conf
->
global
->
WORKFLOW_BILL_ON_SHIPMENT
)))
return
$langs
->
trans
(
'StatusOrderToBillShort'
);
if
(
$statut
==
self
::
STATUS_CLOSED
&&
(
$billed
&&
empty
(
$conf
->
global
->
WORKFLOW_BILL_ON_SHIPMENT
)))
return
$langs
->
trans
(
'StatusOrderProcessed'
)
.
' - '
.
$langs
->
trans
(
"B
illed
"
)
;
if
(
$statut
==
self
::
STATUS_CLOSED
&&
(
$billed
&&
empty
(
$conf
->
global
->
WORKFLOW_BILL_ON_SHIPMENT
)))
return
$langs
->
trans
(
'StatusOrderProcessed'
)
.
$b
illed
text
;
if
(
$statut
==
self
::
STATUS_CLOSED
&&
(
!
empty
(
$conf
->
global
->
WORKFLOW_BILL_ON_SHIPMENT
)))
return
$langs
->
trans
(
'StatusOrderProcessed'
);
}
elseif
(
$mode
==
2
)
{
if
(
$statut
==
self
::
STATUS_CANCELED
)
return
img_picto
(
$langs
->
trans
(
'StatusOrderCanceled'
),
'statut5'
)
.
' '
.
$langs
->
trans
(
'StatusOrderCanceledShort'
);
if
(
$statut
==
self
::
STATUS_DRAFT
)
return
img_picto
(
$langs
->
trans
(
'StatusOrderDraft'
),
'statut0'
)
.
' '
.
$langs
->
trans
(
'StatusOrderDraftShort'
);
if
(
$statut
==
self
::
STATUS_VALIDATED
)
return
img_picto
(
$langs
->
trans
(
'StatusOrderValidated'
),
'statut1'
)
.
' '
.
$langs
->
trans
(
'StatusOrderValidatedShort'
);
if
(
$statut
==
self
::
STATUS_ACCEPTED
)
return
img_picto
(
$langs
->
trans
(
'StatusOrderSent'
),
'statut3'
)
.
' '
.
$langs
->
trans
(
'StatusOrderSentShort'
);
if
(
$statut
==
self
::
STATUS_VALIDATED
)
return
img_picto
(
$langs
->
trans
(
'StatusOrderValidated'
),
'statut1'
)
.
' '
.
$langs
->
trans
(
'StatusOrderValidatedShort'
)
.
$billedtext
;
if
(
$statut
==
self
::
STATUS_ACCEPTED
)
return
img_picto
(
$langs
->
trans
(
'StatusOrderSent'
),
'statut3'
)
.
' '
.
$langs
->
trans
(
'StatusOrderSentShort'
)
.
$billedtext
;
if
(
$statut
==
self
::
STATUS_CLOSED
&&
(
!
$billed
&&
empty
(
$conf
->
global
->
WORKFLOW_BILL_ON_SHIPMENT
)))
return
img_picto
(
$langs
->
trans
(
'StatusOrderToBill'
),
'statut7'
)
.
' '
.
$langs
->
trans
(
'StatusOrderToBillShort'
);
if
(
$statut
==
self
::
STATUS_CLOSED
&&
(
$billed
&&
empty
(
$conf
->
global
->
WORKFLOW_BILL_ON_SHIPMENT
)))
return
img_picto
(
$langs
->
trans
(
'StatusOrderProcessed'
)
.
' - '
.
$langs
->
trans
(
"B
illed
"
)
,
'statut6'
)
.
' '
.
$langs
->
trans
(
'StatusOrderProcessed'
)
.
' - '
.
$langs
->
trans
(
"B
illed
"
)
;
if
(
$statut
==
self
::
STATUS_CLOSED
&&
(
$billed
&&
empty
(
$conf
->
global
->
WORKFLOW_BILL_ON_SHIPMENT
)))
return
img_picto
(
$langs
->
trans
(
'StatusOrderProcessed'
)
.
$b
illed
text
,
'statut6'
)
.
' '
.
$langs
->
trans
(
'StatusOrderProcessed'
)
.
$b
illed
text
;
if
(
$statut
==
self
::
STATUS_CLOSED
&&
(
!
empty
(
$conf
->
global
->
WORKFLOW_BILL_ON_SHIPMENT
)))
return
img_picto
(
$langs
->
trans
(
'StatusOrderProcessed'
),
'statut6'
)
.
' '
.
$langs
->
trans
(
'StatusOrderProcessedShort'
);
}
elseif
(
$mode
==
3
)
{
if
(
$statut
==
self
::
STATUS_CANCELED
)
return
img_picto
(
$langs
->
trans
(
'StatusOrderCanceled'
),
'statut5'
);
if
(
$statut
==
self
::
STATUS_DRAFT
)
return
img_picto
(
$langs
->
trans
(
'StatusOrderDraft'
),
'statut0'
);
if
(
$statut
==
self
::
STATUS_VALIDATED
)
return
img_picto
(
$langs
->
trans
(
'StatusOrderValidated'
),
'statut1'
);
if
(
$statut
==
self
::
STATUS_ACCEPTED
)
return
img_picto
(
$langs
->
trans
(
'StatusOrderSentShort'
),
'statut3'
);
if
(
$statut
==
self
::
STATUS_VALIDATED
)
return
img_picto
(
$langs
->
trans
(
'StatusOrderValidated'
)
.
$billedtext
,
'statut1'
);
if
(
$statut
==
self
::
STATUS_ACCEPTED
)
return
img_picto
(
$langs
->
trans
(
'StatusOrderSentShort'
)
.
$billedtext
,
'statut3'
);
if
(
$statut
==
self
::
STATUS_CLOSED
&&
(
!
$billed
&&
empty
(
$conf
->
global
->
WORKFLOW_BILL_ON_SHIPMENT
)))
return
img_picto
(
$langs
->
trans
(
'StatusOrderToBill'
),
'statut7'
);
if
(
$statut
==
self
::
STATUS_CLOSED
&&
(
$billed
&&
empty
(
$conf
->
global
->
WORKFLOW_BILL_ON_SHIPMENT
)))
return
img_picto
(
$langs
->
trans
(
'StatusOrderProcessed'
)
.
' - '
.
$langs
->
trans
(
"B
illed
"
)
,
'statut6'
);
if
(
$statut
==
self
::
STATUS_CLOSED
&&
(
$billed
&&
empty
(
$conf
->
global
->
WORKFLOW_BILL_ON_SHIPMENT
)))
return
img_picto
(
$langs
->
trans
(
'StatusOrderProcessed'
)
.
$b
illed
text
,
'statut6'
);
if
(
$statut
==
self
::
STATUS_CLOSED
&&
(
!
empty
(
$conf
->
global
->
WORKFLOW_BILL_ON_SHIPMENT
)))
return
img_picto
(
$langs
->
trans
(
'StatusOrderProcessed'
),
'statut6'
);
}
elseif
(
$mode
==
4
)
{
if
(
$statut
==
self
::
STATUS_CANCELED
)
return
img_picto
(
$langs
->
trans
(
'StatusOrderCanceled'
),
'statut5'
)
.
' '
.
$langs
->
trans
(
'StatusOrderCanceled'
);
if
(
$statut
==
self
::
STATUS_DRAFT
)
return
img_picto
(
$langs
->
trans
(
'StatusOrderDraft'
),
'statut0'
)
.
' '
.
$langs
->
trans
(
'StatusOrderDraft'
);
if
(
$statut
==
self
::
STATUS_VALIDATED
)
return
img_picto
(
$langs
->
trans
(
'StatusOrderValidated'
),
'statut1'
)
.
' '
.
$langs
->
trans
(
'StatusOrderValidated'
);
if
(
$statut
==
self
::
STATUS_ACCEPTED
)
return
img_picto
(
$langs
->
trans
(
'StatusOrderSentShort'
),
'statut3'
)
.
' '
.
$langs
->
trans
(
'StatusOrderSent'
);
if
(
$statut
==
self
::
STATUS_VALIDATED
)
return
img_picto
(
$langs
->
trans
(
'StatusOrderValidated'
)
.
$billedtext
,
'statut1'
)
.
' '
.
$langs
->
trans
(
'StatusOrderValidated'
)
.
$billedtext
;
if
(
$statut
==
self
::
STATUS_ACCEPTED
)
return
img_picto
(
$langs
->
trans
(
'StatusOrderSentShort'
)
.
$billedtext
,
'statut3'
)
.
' '
.
$langs
->
trans
(
'StatusOrderSent'
)
.
$billedtext
;
if
(
$statut
==
self
::
STATUS_CLOSED
&&
(
!
$billed
&&
empty
(
$conf
->
global
->
WORKFLOW_BILL_ON_SHIPMENT
)))
return
img_picto
(
$langs
->
trans
(
'StatusOrderToBill'
),
'statut7'
)
.
' '
.
$langs
->
trans
(
'StatusOrderToBill'
);
if
(
$statut
==
self
::
STATUS_CLOSED
&&
(
$billed
&&
empty
(
$conf
->
global
->
WORKFLOW_BILL_ON_SHIPMENT
)))
return
img_picto
(
$langs
->
trans
(
'StatusOrderToBill'
)
.
' - '
.
$langs
->
trans
(
"B
illed
"
)
,
'statut6'
)
.
' '
.
$langs
->
trans
(
'StatusOrderToBill'
)
.
' - '
.
$langs
->
trans
(
"B
illed
"
)
;
if
(
$statut
==
self
::
STATUS_CLOSED
&&
(
$billed
&&
empty
(
$conf
->
global
->
WORKFLOW_BILL_ON_SHIPMENT
)))
return
img_picto
(
$langs
->
trans
(
'StatusOrderToBill'
)
.
$b
illed
text
,
'statut6'
)
.
' '
.
$langs
->
trans
(
'StatusOrderToBill'
)
.
$b
illed
text
;
if
(
$statut
==
self
::
STATUS_CLOSED
&&
(
!
empty
(
$conf
->
global
->
WORKFLOW_BILL_ON_SHIPMENT
)))
return
img_picto
(
$langs
->
trans
(
'StatusOrderProcessed'
),
'statut6'
)
.
' '
.
$langs
->
trans
(
'StatusOrderProcessed'
);
}
elseif
(
$mode
==
5
)
{
if
(
$statut
==
self
::
STATUS_CANCELED
)
return
'<span class="hideonsmartphone">'
.
$langs
->
trans
(
'StatusOrderCanceledShort'
)
.
' </span>'
.
img_picto
(
$langs
->
trans
(
'StatusOrderCanceled'
),
'statut5'
);
if
(
$statut
==
self
::
STATUS_DRAFT
)
return
'<span class="hideonsmartphone">'
.
$langs
->
trans
(
'StatusOrderDraftShort'
)
.
' </span>'
.
img_picto
(
$langs
->
trans
(
'StatusOrderDraft'
),
'statut0'
);
if
(
$statut
==
self
::
STATUS_VALIDATED
)
return
'<span class="hideonsmartphone">'
.
$langs
->
trans
(
'StatusOrderValidatedShort'
)
.
' </span>'
.
img_picto
(
$langs
->
trans
(
'StatusOrderValidated'
),
'statut1'
);
if
(
$statut
==
self
::
STATUS_ACCEPTED
)
return
'<span class="hideonsmartphone">'
.
$langs
->
trans
(
'StatusOrderSentShort'
)
.
' </span>'
.
img_picto
(
$langs
->
trans
(
'StatusOrderSent'
),
'statut3'
);
if
(
$statut
==
self
::
STATUS_VALIDATED
)
return
'<span class="hideonsmartphone">'
.
$langs
->
trans
(
'StatusOrderValidatedShort'
)
.
$billedtext
.
' </span>'
.
img_picto
(
$langs
->
trans
(
'StatusOrderValidated'
)
.
$billedtext
,
'statut1'
);
if
(
$statut
==
self
::
STATUS_ACCEPTED
)
return
'<span class="hideonsmartphone">'
.
$langs
->
trans
(
'StatusOrderSentShort'
)
.
$billedtext
.
' </span>'
.
img_picto
(
$langs
->
trans
(
'StatusOrderSent'
)
.
$billedtext
,
'statut3'
);
if
(
$statut
==
self
::
STATUS_CLOSED
&&
(
!
$billed
&&
empty
(
$conf
->
global
->
WORKFLOW_BILL_ON_SHIPMENT
)))
return
'<span class="hideonsmartphone">'
.
$langs
->
trans
(
'StatusOrderToBillShort'
)
.
' </span>'
.
img_picto
(
$langs
->
trans
(
'StatusOrderToBill'
),
'statut7'
);
if
(
$statut
==
self
::
STATUS_CLOSED
&&
(
$billed
&&
empty
(
$conf
->
global
->
WORKFLOW_BILL_ON_SHIPMENT
)))
return
'<span class="hideonsmartphone">'
.
$langs
->
trans
(
'StatusOrderToBillShort'
)
.
' - '
.
$langs
->
trans
(
"B
illed
"
)
.
' </span>'
.
img_picto
(
$langs
->
trans
(
'StatusOrderToBill'
)
.
' - '
.
$langs
->
trans
(
"B
illed
"
)
,
'statut6'
);
if
(
$statut
==
self
::
STATUS_CLOSED
&&
(
$billed
&&
empty
(
$conf
->
global
->
WORKFLOW_BILL_ON_SHIPMENT
)))
return
'<span class="hideonsmartphone">'
.
$langs
->
trans
(
'StatusOrderToBillShort'
)
.
$b
illed
text
.
' </span>'
.
img_picto
(
$langs
->
trans
(
'StatusOrderToBill'
)
.
$b
illed
text
,
'statut6'
);
if
(
$statut
==
self
::
STATUS_CLOSED
&&
(
!
empty
(
$conf
->
global
->
WORKFLOW_BILL_ON_SHIPMENT
)))
return
'<span class="hideonsmartphone">'
.
$langs
->
trans
(
'StatusOrderProcessedShort'
)
.
' </span>'
.
img_picto
(
$langs
->
trans
(
'StatusOrderProcessed'
),
'statut6'
);
}
}
...
...
This diff is collapsed.
Click to expand it.
htdocs/commande/list.php
+
4
−
4
View file @
a12e9598
...
...
@@ -136,7 +136,7 @@ llxHeader('',$langs->trans("Orders"),$help_url);
$sql
=
'SELECT'
;
if
(
$sall
||
$search_product_category
>
0
)
$sql
=
'SELECT DISTINCT'
;
$sql
.
=
' s.nom as name, s.rowid as socid, s.client, s.code_client, c.rowid, c.ref, c.total_ht, c.tva as total_tva, c.total_ttc, c.ref_client,'
;
$sql
.
=
' c.date_valid, c.date_commande, c.note_private, c.date_livraison as date_delivery, c.fk_statut, c.facture as
facturee
'
;
$sql
.
=
' c.date_valid, c.date_commande, c.note_private, c.date_livraison as date_delivery, c.fk_statut, c.facture as
billed
'
;
$sql
.
=
' FROM '
.
MAIN_DB_PREFIX
.
'societe as s'
;
$sql
.
=
', '
.
MAIN_DB_PREFIX
.
'commande as c'
;
if
(
$sall
||
$search_product_category
>
0
)
$sql
.
=
' LEFT JOIN '
.
MAIN_DB_PREFIX
.
'commandedet as pd ON c.rowid=pd.fk_commande'
;
...
...
@@ -559,7 +559,7 @@ if ($resql)
{
if
(
$user
->
rights
->
facture
->
creer
)
{
if
((
$objp
->
fk_statut
>
0
&&
$objp
->
fk_statut
<
3
)
||
(
$objp
->
fk_statut
==
3
&&
$objp
->
facturee
==
0
))
if
((
$objp
->
fk_statut
>
0
&&
$objp
->
fk_statut
<
3
)
||
(
$objp
->
fk_statut
==
3
&&
$objp
->
billed
==
0
))
{
print
' <a href="'
.
DOL_URL_ROOT
.
'/commande/orderstoinvoice.php?socid='
.
$companystatic
->
id
.
'">'
;
print
img_picto
(
$langs
->
trans
(
"CreateInvoiceForThisCustomer"
)
.
' : '
.
$companystatic
->
name
,
'object_bill'
,
'hideonsmartphone'
)
.
'</a>'
;
...
...
@@ -582,10 +582,10 @@ if ($resql)
print
'<td align="right" class="nowrap">'
.
price
(
$objp
->
total_ht
)
.
'</td>'
;
// Statut
print
'<td align="right" class="nowrap">'
.
$generic_commande
->
LibStatut
(
$objp
->
fk_statut
,
$objp
->
facturee
,
5
)
.
'</td>'
;
print
'<td align="right" class="nowrap">'
.
$generic_commande
->
LibStatut
(
$objp
->
fk_statut
,
$objp
->
billed
,
5
,
1
)
.
'</td>'
;
// Billed
print
'<td align="center">'
.
yn
(
$objp
->
facturee
)
.
'</td>'
;
print
'<td align="center">'
.
yn
(
$objp
->
billed
)
.
'</td>'
;
print
'<td></td>'
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment