Merge branch 'develop' of https://github.com/Dolibarr/dolibarr into develop
This commit is contained in:
commit
cef835cd2d
@ -260,6 +260,12 @@ source_file = htdocs/langs/en_US/propal.lang
|
||||
source_lang = en_US
|
||||
type = MOZILLAPROPERTIES
|
||||
|
||||
[dolibarr.resource]
|
||||
file_filter = htdocs/langs/<lang>/resource.lang
|
||||
source_file = htdocs/langs/en_US/resource.lang
|
||||
source_lang = en_US
|
||||
type = MOZILLAPROPERTIES
|
||||
|
||||
[dolibarr.salaries]
|
||||
file_filter = htdocs/langs/<lang>/salaries.lang
|
||||
source_file = htdocs/langs/en_US/salaries.lang
|
||||
|
||||
@ -162,7 +162,8 @@ Dolibarr better:
|
||||
creation of a pdf or odt, hook "afterPDFCreation" or "afterODTCreation" must be used instead.
|
||||
- A lot of pages called fiche.php were renamed into card.php
|
||||
- A lot of pages called liste.php were renamed into list.php
|
||||
|
||||
- If you used warehouse/stock module, recheck setup of stock increase/decrease rules of the
|
||||
warehouse module and your Point Of Sale module if you use one.
|
||||
|
||||
|
||||
***** ChangeLog for 3.6.2 compared to 3.6.1 *****
|
||||
@ -174,7 +175,10 @@ Dolibarr better:
|
||||
- Fix: Civility & birthdate wasn't save into adherent module.
|
||||
- Fix: webservice Thirdparty parameter lastname for invidual creation is now lastname and not ref
|
||||
- Fix: Chars - is no more allowed into value for code for extra fields.
|
||||
( Fix: [ bug #1622 ] Requesting holiday than spans across two years cause high CPU usage by Apache
|
||||
- Fix: [ bug #1622 ] Requesting holiday than spans across two years cause high CPU usage by Apache
|
||||
- Fix: [ bug #1595 ] Selected boolean extrafield in intervention creation page, does not save state
|
||||
- Fix: Show sender Country on PDF docs when sender Country <> receiver Country
|
||||
- Fix: [ bug #1624 ] Use lowest buying price for margin when selling with POS
|
||||
|
||||
***** ChangeLog for 3.6.1 compared to 3.6.* *****
|
||||
For users:
|
||||
|
||||
@ -26,7 +26,7 @@ for <a href="http://www.dolibarr.org">$projectname</a> by Doxygen $doxygenversio
|
||||
|
||||
|
||||
<!-- Google AdSense -->
|
||||
<center>
|
||||
<div class="center">
|
||||
<script type="text/javascript"><!--
|
||||
google_ad_client = "pub-1071905880519467";
|
||||
/* PUBBANDEAUDOLIBARR */
|
||||
@ -36,7 +36,7 @@ google_ad_height = 60;
|
||||
//-->
|
||||
</script>
|
||||
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
|
||||
</center>
|
||||
</div>
|
||||
<!-- End google adsense -->
|
||||
<br>
|
||||
|
||||
|
||||
@ -24,7 +24,7 @@ File added into doxygen generated documentation
|
||||
</div>
|
||||
|
||||
<div id="logodol">
|
||||
<center>
|
||||
<div class="center">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td><div id="projectname">$projectname</div> - <span id="projectnumber">$projectnumber</span></td>
|
||||
@ -54,7 +54,7 @@ File added into doxygen generated documentation
|
||||
<!-- banner end --></td>
|
||||
</tr>
|
||||
</table>
|
||||
</center>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@ -1,21 +0,0 @@
|
||||
#!/bin/sh
|
||||
# Helps find duplicate translation keys in language files
|
||||
#
|
||||
# Copyright (C) 2014 Raphaël Doursenaud - rdoursenaud@gpcsolutions.fr
|
||||
|
||||
for file in `find . -type f`
|
||||
do
|
||||
dupes=$(
|
||||
sed "s/^\s*//" "$file" | # Remove any leading whitespace
|
||||
sed "s/\s*\=/=/" | # Remove any whitespace before =
|
||||
grep -Po "(^.*?)=" | # Non greedeely match everything before =
|
||||
sed "s/\=//" | # Remove trailing = so we get the key
|
||||
sort | uniq -d # Find duplicates
|
||||
)
|
||||
|
||||
if [ -n "$dupes" ]
|
||||
then
|
||||
echo "Duplicates found in $file"
|
||||
echo "$dupes"
|
||||
fi
|
||||
done
|
||||
@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
#------------------------------------------------------
|
||||
# Script to find files that are not Unix encoded
|
||||
# Detect files that does not contains any tab inside
|
||||
#
|
||||
# Laurent Destailleur - eldy@users.sourceforge.net
|
||||
#------------------------------------------------------
|
||||
38
dev/fixduplicatelangkey.sh
Executable file
38
dev/fixduplicatelangkey.sh
Executable file
@ -0,0 +1,38 @@
|
||||
#!/bin/sh
|
||||
# Helps find duplicate translation keys in language files
|
||||
#
|
||||
# Copyright (C) 2014 Raphaël Doursenaud - rdoursenaud@gpcsolutions.fr
|
||||
|
||||
|
||||
# Syntax
|
||||
if [ "x$1" != "xlist" -a "x$1" != "xfix" ]
|
||||
then
|
||||
echo "Usage: detectduplicatelangkey.sh (list|fix)"
|
||||
fi
|
||||
|
||||
|
||||
if [ "x$1" = "xlist" ]
|
||||
then
|
||||
for file in `find htdocs/langs/en_US -name *.lang -type f`
|
||||
do
|
||||
dupes=$(
|
||||
sed "s/^\s*//" "$file" | # Remove any leading whitespace
|
||||
sed "s/\s*\=/=/" | # Remove any whitespace before =
|
||||
grep -Po "(^.*?)=" | # Non greedeely match everything before =
|
||||
sed "s/\=//" | # Remove trailing = so we get the key
|
||||
sort | uniq -d # Find duplicates
|
||||
)
|
||||
|
||||
if [ -n "$dupes" ]
|
||||
then
|
||||
echo "Duplicates found in $file"
|
||||
echo "$dupes"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# To convert
|
||||
if [ "x$1" = "xfix" ]
|
||||
then
|
||||
echo Feature not implemented. Please fix files manually.
|
||||
fi
|
||||
@ -10,6 +10,7 @@ INPLACE='0'
|
||||
max_input_size=0
|
||||
max_output_size=0
|
||||
|
||||
|
||||
usage()
|
||||
{
|
||||
cat <<EO
|
||||
@ -37,7 +38,8 @@ optimize_image()
|
||||
max_input_size=$(expr $max_input_size + $input_file_size)
|
||||
|
||||
if [ "${1##*.}" = "png" ]; then
|
||||
optipng -o1 -clobber -quiet $1 -out $2.firstpass
|
||||
#optipng -o1 -clobber -quiet $1 -out $2.firstpass
|
||||
optipng -o1 -quiet $1 -out $2.firstpass
|
||||
pngcrush -q -rem alla -reduce $2.firstpass $2 >/dev/null
|
||||
rm -fr $2.firstpass
|
||||
fi
|
||||
@ -67,6 +69,25 @@ get_max_file_length()
|
||||
|
||||
main()
|
||||
{
|
||||
test=`type pngcrush >/dev/null 2>&1`
|
||||
result=$?
|
||||
if [ "x$result" == "x1" ]; then
|
||||
echo "Tool pngcrush not found" && exit
|
||||
fi
|
||||
|
||||
test=`type optipng >/dev/null 2>&1`
|
||||
result=$?
|
||||
if [ "x$result" == "x1" ]; then
|
||||
echo "Tool optipng not found" && exit
|
||||
fi
|
||||
|
||||
test=`type jpegtran >/dev/null 2>&1`
|
||||
result=$?
|
||||
if [ "x$result" == "x1" ]; then
|
||||
echo "Tool jpegtran not found" && exit
|
||||
fi
|
||||
|
||||
|
||||
# If $INPUT is empty, then we use current directory
|
||||
if [[ "$INPUT" == "" ]]; then
|
||||
INPUT=$(pwd)
|
||||
@ -81,6 +102,8 @@ main()
|
||||
OUTPUT='/tmp/optimize'
|
||||
fi
|
||||
|
||||
echo "Mode is $INPLACE (1=Images are replaced, 0=New images are stored into $OUTPUT)"
|
||||
|
||||
# We create the output directory
|
||||
mkdir -p $OUTPUT
|
||||
|
||||
@ -96,6 +119,7 @@ main()
|
||||
|
||||
# Search of all jpg/jpeg/png in $INPUT
|
||||
# We remove images from $OUTPUT if $OUTPUT is a subdirectory of $INPUT
|
||||
echo "Scan $INPUT to find images"
|
||||
IMAGES=$(find $INPUT -regextype posix-extended -regex '.*\.(jpg|jpeg|png)' | grep -v $OUTPUT)
|
||||
|
||||
if [ "$QUIET" == "0" ]; then
|
||||
@ -103,6 +127,7 @@ main()
|
||||
echo
|
||||
fi
|
||||
for CURRENT_IMAGE in $IMAGES; do
|
||||
echo "Process $CURRENT_IMAGE"
|
||||
filename=$(basename $CURRENT_IMAGE)
|
||||
if [ "$QUIET" == "0" ]; then
|
||||
printf '%s ' "$filename"
|
||||
@ -155,6 +180,13 @@ SHORTOPTS="h,i:,o:,q,s,p"
|
||||
LONGOPTS="help,input:,output:,quiet,no-stats,inplace"
|
||||
ARGS=$(getopt -s bash --options $SHORTOPTS --longoptions $LONGOPTS --name $PROGNAME -- "$@")
|
||||
|
||||
# Syntax
|
||||
if [ "x$1" != "xlist" -a "x$1" != "xfix" ]
|
||||
then
|
||||
echo "Usage: optimize_images.sh (list|fix) -i dirtoscan"
|
||||
exit
|
||||
fi
|
||||
|
||||
eval set -- "$ARGS"
|
||||
while true; do
|
||||
case $1 in
|
||||
@ -191,5 +223,11 @@ while true; do
|
||||
shift
|
||||
done
|
||||
|
||||
# To convert
|
||||
if [ "x$1" = "xlist" ]
|
||||
then
|
||||
INPLACE=0
|
||||
fi
|
||||
|
||||
main
|
||||
|
||||
|
||||
@ -282,7 +282,7 @@ if ($action == 'create')
|
||||
|
||||
print '<br>';
|
||||
|
||||
print '<center><input type="submit" class="button" name="add" value="'.$langs->trans("Create").'"> <input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></center>';
|
||||
print '<div class="center"><input type="submit" class="button" name="add" value="'.$langs->trans("Create").'"> <input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
@ -304,7 +304,7 @@ if (($id || $ref) && $action == 'edit')
|
||||
|
||||
print '<br>';
|
||||
|
||||
print '<center><input type="submit" class="button" name="add" value="'.$langs->trans("Create").'"></center>';
|
||||
print '<div class="center"><input type="submit" class="button" name="add" value="'.$langs->trans("Create").'"></div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
|
||||
@ -19,14 +19,14 @@
|
||||
</head>
|
||||
<body class="body">
|
||||
|
||||
<center>
|
||||
<div class="center">
|
||||
|
||||
<div class="login_table" align="center">
|
||||
|
||||
<!-- <tr><td colspan="2" valign="middle"> -->
|
||||
<div id="login_line1" align="center">
|
||||
|
||||
<div id="login_left" style="display: inline-block; min-width: 250px; margin: 0 auto;"><center>
|
||||
<div id="login_left" style="display: inline-block; min-width: 250px; margin: 0 auto;"><div class="center">
|
||||
|
||||
<table class="none" summary="Login pass" cellpadding="2" align="center">
|
||||
|
||||
@ -46,7 +46,7 @@
|
||||
|
||||
</table>
|
||||
|
||||
</center>
|
||||
</div>
|
||||
</div> <!-- end div left -->
|
||||
|
||||
<!-- </td>
|
||||
@ -64,7 +64,7 @@
|
||||
|
||||
</div>
|
||||
|
||||
</center>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@ -164,8 +164,11 @@ if ($action == 'create')
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '<br><center><input class="button" type="submit" value="' . $langs->trans("Save") . '"> ';
|
||||
print '<input class="button" type="submit" name="cancel" value="' . $langs->trans("Cancel") . '"></center';
|
||||
print '<br><div class="center">';
|
||||
print '<input class="button" type="submit" value="' . $langs->trans("Save") . '">';
|
||||
print ' ';
|
||||
print '<input class="button" type="submit" name="cancel" value="' . $langs->trans("Cancel") . '">';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
}
|
||||
@ -214,9 +217,11 @@ else if ($id)
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '<br><center><input type="submit" class="button" value="' . $langs->trans("Save") . '"> ';
|
||||
print '<br><div class="center">';
|
||||
print '<input type="submit" class="button" value="' . $langs->trans("Save") . '">';
|
||||
print ' ';
|
||||
print '<input type="submit" name="cancel" class="button" value="' . $langs->trans("Cancel") . '">';
|
||||
print '</center>';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
|
||||
@ -200,8 +200,11 @@ if ($action == 'create')
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '<br><center><input class="button" type="submit" value="'.$langs->trans("Save").'"> ';
|
||||
print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'"></center';
|
||||
print '<br><div class="center">';
|
||||
print '<input class="button" type="submit" value="'.$langs->trans("Save").'">';
|
||||
print ' ';
|
||||
print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
}
|
||||
@ -251,9 +254,11 @@ else if ($id)
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '<br><center><input type="submit" class="button" value="'.$langs->trans("Save").'"> ';
|
||||
print '<br><div class="center">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">';
|
||||
print ' ';
|
||||
print '<input type="submit" name="cancel" class="button" value="'.$langs->trans("Cancel").'">';
|
||||
print '</center>';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
|
||||
@ -127,8 +127,11 @@ if (! empty($id)) {
|
||||
print '</td></tr>';
|
||||
print '</table>';
|
||||
|
||||
print '<br><center><input class="button" type="submit" value="' . $langs->trans("Save") . '"> ';
|
||||
print '<input class="button" type="submit" name="cancel" value="' . $langs->trans("Cancel") . '"></center';
|
||||
print '<br><div class="center">';
|
||||
print '<input class="button" type="submit" value="' . $langs->trans("Save") . '">';
|
||||
print ' ';
|
||||
print '<input class="button" type="submit" name="cancel" value="' . $langs->trans("Cancel") . '">';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
} else {
|
||||
|
||||
@ -203,9 +203,9 @@ if (! empty($conf->paybox->enabled) || ! empty($conf->paypal->enabled))
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '<center>';
|
||||
print '<br><input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
||||
print '</center>';
|
||||
print '<br><div class="center">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
|
||||
@ -915,7 +915,7 @@ else
|
||||
print "</table>\n";
|
||||
print '<br>';
|
||||
|
||||
print '<center><input type="submit" class="button" value="'.$langs->trans("AddMember").'"></center>';
|
||||
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("AddMember").'"></div>';
|
||||
|
||||
print "</form>\n";
|
||||
|
||||
@ -1164,11 +1164,11 @@ else
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '<br><center>';
|
||||
print '<br><div class="center">';
|
||||
print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
|
||||
print ' ';
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
print '</center';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
|
||||
@ -1078,11 +1078,11 @@ if ($rowid)
|
||||
print '</table>';
|
||||
print '<br>';
|
||||
|
||||
print '<center>';
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" name="add" value="'.$langs->trans("AddSubscription").'">';
|
||||
print ' ';
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
print '</center>';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
|
||||
@ -271,9 +271,11 @@ if ($action == 'create')
|
||||
}
|
||||
print "</table>\n";
|
||||
|
||||
print '<br>';
|
||||
print '<center><input type="submit" name="button" class="button" value="'.$langs->trans("Add").'"> ';
|
||||
print '<input type="submit" name="button" class="button" value="'.$langs->trans("Cancel").'"></center>';
|
||||
print '<br><div class="center">';
|
||||
print '<input type="submit" name="button" class="button" value="'.$langs->trans("Add").'">';
|
||||
print ' ';
|
||||
print '<input type="submit" name="button" class="button" value="'.$langs->trans("Cancel").'">';
|
||||
print '</div>';
|
||||
|
||||
print "</form>\n";
|
||||
}
|
||||
@ -678,8 +680,11 @@ if ($rowid > 0)
|
||||
print '</table><br><br>';
|
||||
}
|
||||
|
||||
print '<center><input type="submit" class="button" value="'.$langs->trans("Save").'"> ';
|
||||
print '<input type="submit" name="button" class="button" value="'.$langs->trans("Cancel").'"></center>';
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">';
|
||||
print ' ';
|
||||
print '<input type="submit" name="button" class="button" value="'.$langs->trans("Cancel").'">';
|
||||
print '</div>';
|
||||
|
||||
print "</form>";
|
||||
}
|
||||
|
||||
@ -184,9 +184,9 @@ if (! empty($triggers))
|
||||
}
|
||||
print '</table>';
|
||||
|
||||
print '<br><center>';
|
||||
print '<br><div class="center">';
|
||||
print '<input type="submit" name="save" class="button" value="'.$langs->trans("Save").'">';
|
||||
print "</center>";
|
||||
print "</div>";
|
||||
|
||||
print "</form>\n";
|
||||
|
||||
|
||||
@ -220,9 +220,9 @@ while ($i <= $MAXAGENDA)
|
||||
print '</table>';
|
||||
print '<br>';
|
||||
|
||||
print '<center>';
|
||||
print "<input type=\"submit\" id=\"save\" name=\"save\" class=\"button hideifnotset\" value=\"".$langs->trans("Save")."\">";
|
||||
print "</center>";
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" id="save" name="save" class="button hideifnotset" value="'.$langs->trans("Save").'">';
|
||||
print '</div>';
|
||||
|
||||
print "</form>\n";
|
||||
|
||||
|
||||
@ -157,7 +157,7 @@ print '</td></tr>'."\n";
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '<center><input class="button" type="submit" name="save" value="'.dol_escape_htmltag($langs->trans("Save")).'"></center>';
|
||||
print '<div class="center"><input class="button" type="submit" name="save" value="'.dol_escape_htmltag($langs->trans("Save")).'"></div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
|
||||
@ -136,9 +136,9 @@ print "</tr>";
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '<br><center>';
|
||||
print '<br><div class="center">';
|
||||
print "<input type=\"submit\" name=\"save\" class=\"button\" value=\"".$langs->trans("Save")."\">";
|
||||
print "</center>";
|
||||
print "</div>";
|
||||
|
||||
print "</form>\n";
|
||||
|
||||
|
||||
@ -94,7 +94,7 @@ print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '<center><br><input type="submit" class="button" value="'.$langs->trans("Modify").'"></center>';
|
||||
print '<div class="center"><br><input type="submit" class="button" value="'.$langs->trans("Modify").'"></div>';
|
||||
|
||||
print '</form><br><br>';
|
||||
|
||||
|
||||
@ -668,11 +668,11 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
}
|
||||
|
||||
|
||||
print '<br><center>';
|
||||
print '<br><div class="center">';
|
||||
print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
|
||||
print ' ';
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
print '</center>';
|
||||
print '</div>';
|
||||
print '<br>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
@ -177,7 +177,7 @@ if ($action == 'edit')
|
||||
|
||||
print '<br>';
|
||||
|
||||
print '<br><center><input type="submit" class="button" value="'.$langs->trans("Save").'"></center>';
|
||||
print '<br><div class="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></div>';
|
||||
print '<br>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
@ -214,11 +214,11 @@ print '<td>http://news.google.com/news?ned=us&topic=h&output=rss<br>http://www.d
|
||||
print '</tr>';
|
||||
print '</table>';
|
||||
|
||||
print '<center><br>';
|
||||
print '<br><div class="center">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Add").'">';
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
print '<input type="hidden" name="norss" value="'.($lastexternalrss+1).'">';
|
||||
print '<br><br>';
|
||||
print '</div><br><br>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
|
||||
@ -165,7 +165,7 @@ else
|
||||
$readonly=($mode=='dolibarr_readonly'?1:0);
|
||||
$editor=new DolEditor('formtestfield',isset($conf->global->FCKEDITOR_TEST)?$conf->global->FCKEDITOR_TEST:'Test','',200,$mode,'In', true, $uselocalbrowser, 1, 120, 8, $readonly);
|
||||
$editor->Create();
|
||||
print '<center><br><input class="button" type="submit" name="save" value="'.$langs->trans("Save").'"></center>'."\n";
|
||||
print '<br><div class="center"><input class="button" type="submit" name="save" value="'.$langs->trans("Save").'"></div>'."\n";
|
||||
print '<div id="divforlog"></div>';
|
||||
print '</form>'."\n";
|
||||
|
||||
|
||||
@ -287,9 +287,9 @@ if ($action == 'edit') // Edit
|
||||
print '</table>'."\n";
|
||||
|
||||
|
||||
print '<br><center>';
|
||||
print '<br><div class="center">';
|
||||
print '<input class="button" type="submit" value="'.$langs->trans("Save").'">';
|
||||
print '</center>';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
print '<br>';
|
||||
|
||||
@ -109,7 +109,7 @@ if (empty($reshook))
|
||||
print "<br>";
|
||||
|
||||
// Show logo
|
||||
print '<center><div class="logo_setup"></div></center>';
|
||||
print '<div class="center"><div class="logo_setup"></div></div>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -239,7 +239,7 @@ print '</td><td>secret</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '<center><input type="submit" class="button" value="'.$langs->trans("Modify").'"></center>';
|
||||
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
|
||||
@ -126,9 +126,9 @@ if ($action == 'edit')
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '<br><center>';
|
||||
print '<br><div class="center">';
|
||||
print '<input class="button" type="submit" value="'.$langs->trans("Save").'">';
|
||||
print '</center>';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
print '<br>';
|
||||
|
||||
@ -477,11 +477,11 @@ if ($action == 'edit')
|
||||
print '"></td></tr>';
|
||||
print '</table>';
|
||||
|
||||
print '<br><center>';
|
||||
print '<br><div class="center">';
|
||||
print '<input class="button" type="submit" name="save" value="'.$langs->trans("Save").'">';
|
||||
print ' ';
|
||||
print ' ';
|
||||
print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
print '</center>';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
print '<br>';
|
||||
|
||||
@ -203,11 +203,11 @@ if ($action == 'edit')
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '<br><center>';
|
||||
print '<br><div class="center">';
|
||||
print '<input class="button" type="submit" name="save" value="'.$langs->trans("Save").'">';
|
||||
print ' ';
|
||||
print ' ';
|
||||
print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
print '</center>';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
@ -369,9 +369,11 @@ if ($action == 'create')
|
||||
print '</table>';
|
||||
|
||||
// Boutons
|
||||
print '<center><br><input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></center>';
|
||||
print '<br><div class="center">';
|
||||
print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
}
|
||||
@ -453,9 +455,11 @@ elseif ($action == 'edit')
|
||||
print '</table>';
|
||||
|
||||
// Bouton
|
||||
print '<center><br><input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></center>';
|
||||
print '<br><div class="center">';
|
||||
print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
|
||||
@ -534,7 +534,7 @@ dol_fiche_end();
|
||||
|
||||
|
||||
// Show warning about external users
|
||||
if ($mode != 'marketplace') print '<div class="info">'.showModulesExludedForExternal($modules).'</div><br>'."\n";
|
||||
if ($mode != 'marketplace') print info_admin(showModulesExludedForExternal($modules))."\n";
|
||||
|
||||
|
||||
llxFooter();
|
||||
|
||||
@ -142,7 +142,7 @@ print '</table>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
print '<center><input type="submit" class="button" value="'.$langs->trans("Save").'"></center>';
|
||||
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
|
||||
@ -250,9 +250,9 @@ if ($action == 'edit') // Edit
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '<br><center>';
|
||||
print '<br><div class="center">';
|
||||
print '<input class="button" type="submit" value="'.$langs->trans("Save").'">';
|
||||
print '</center>';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
print '<br>';
|
||||
|
||||
@ -116,7 +116,7 @@ foreach ($modulesdir as $dir)
|
||||
$db->commit();
|
||||
|
||||
// Show warning about external users
|
||||
print showModulesExludedForExternal($modules).'<br>'."\n";
|
||||
print info_admin(showModulesExludedForExternal($modules)).'<br>'."\n";
|
||||
print "<br>\n";
|
||||
|
||||
|
||||
|
||||
@ -161,7 +161,7 @@ print '</td></tr>';
|
||||
print '</table>';
|
||||
print '<br>';
|
||||
|
||||
print '<center><input type="submit" class="button" value="'.$langs->trans("Save").'"></center>';
|
||||
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
|
||||
@ -163,6 +163,22 @@ if ($action == 'setdefaultduration')
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL')
|
||||
{
|
||||
$res = dolibarr_set_const($db, "BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL",$value,'chaine',0,'',$conf->entity);
|
||||
|
||||
if (! $res > 0) $error++;
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
}
|
||||
}
|
||||
|
||||
// Define constants for submodules that contains parameters (forms with param1, param2, ... and value1, value2, ...)
|
||||
if ($action == 'setModuleOptions')
|
||||
{
|
||||
@ -582,6 +598,35 @@ print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">'
|
||||
print "</td></tr>\n";
|
||||
print '</form>';
|
||||
|
||||
if ($conf->banque->enabled)
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>';
|
||||
print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL").'</td><td> </td><td align="center">';
|
||||
if (! empty($conf->use_javascript_ajax))
|
||||
{
|
||||
print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL');
|
||||
}
|
||||
else
|
||||
{
|
||||
if (empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL))
|
||||
{
|
||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL&value=1">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL&value=0">'.img_picto($langs->trans("Enabled"),'switch_on').'</a>';
|
||||
}
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>';
|
||||
print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL").'</td><td> </td><td align="center">'.$langs->trans('NotAvailable').'</td></tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
||||
|
||||
@ -203,11 +203,11 @@ if ($action == 'edit')
|
||||
*/
|
||||
print '</table>';
|
||||
|
||||
print '<br><center>';
|
||||
print '<br><div class="center">';
|
||||
print '<input class="button" type="submit" name="save" value="'.$langs->trans("Save").'"'.(!count($listofmethods)?' disabled="disbaled"':'').'>';
|
||||
print ' ';
|
||||
print ' ';
|
||||
print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
print '</center>';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
print '<br>';
|
||||
|
||||
@ -193,6 +193,11 @@ if (! empty($conf->expedition->enabled))
|
||||
print "</form>\n</td>\n</tr>\n";
|
||||
}
|
||||
print '</table>';
|
||||
|
||||
//if (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) || ! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT))
|
||||
//{
|
||||
print info_admin($langs->trans("IfYouUsePointOfSaleCheckModule"));
|
||||
//}
|
||||
print '<br>';
|
||||
|
||||
// Title rule for stock increase
|
||||
|
||||
@ -53,7 +53,7 @@ print '<br><br>';
|
||||
|
||||
|
||||
// Show logo
|
||||
print '<center><div class="logo_setup"></div></center>';
|
||||
print '<div class="center"><div class="logo_setup"></div></div>';
|
||||
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
@ -151,7 +151,7 @@ print '</td></tr></table>';
|
||||
if ($choice != 'confirm_allfiles')
|
||||
{
|
||||
print '<br>';
|
||||
print '<center><input class="button" type="submit" value="'.$langs->trans("PurgeRunNow").'"></center>';
|
||||
print '<div class="center"><input class="button" type="submit" value="'.$langs->trans("PurgeRunNow").'"></div>';
|
||||
}
|
||||
|
||||
print '</form>';
|
||||
|
||||
@ -80,7 +80,7 @@ print '<tr '.$bc[$var].'><td>';
|
||||
print $langs->trans("NbOfBoomarkToShow").'</td><td>';
|
||||
print '<input size="3" type="text" name="BOOKMARKS_SHOW_IN_MENU" value="'.$conf->global->BOOKMARKS_SHOW_IN_MENU.'">';
|
||||
print '</td></tr>';
|
||||
print '</table><br /><center><input type="submit" class="button" value="'.$langs->trans("Modify").'"></center></form>';
|
||||
print '</table><br><div class="center"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></div></form>';
|
||||
|
||||
$db->close();
|
||||
|
||||
|
||||
@ -136,9 +136,11 @@ if ($action == 'create')
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" enctype="multipart/form-data">'."\n";
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
|
||||
|
||||
print_fiche_titre($langs->trans("NewBookmark"));
|
||||
|
||||
dol_fiche_head($head, $hselected, $langs->trans("Bookmark"),0,'bookmark');
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr><td width="25%" class="fieldrequired">'.$langs->trans("BookmarkTitle").'</td><td><input class="flat" name="title" size="30" value="'.$title.'"></td><td class="hideonsmartphone">'.$langs->trans("SetHereATitleForLink").'</td></tr>';
|
||||
@ -159,8 +161,10 @@ if ($action == 'create')
|
||||
print '<input class="flat" name="position" size="5" value="'.(isset($_POST["position"])?$_POST["position"]:$bookmark->position).'">';
|
||||
print '</td><td class="hideonsmartphone"> </td></tr>';
|
||||
|
||||
print '</table><br>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print '<div align="center">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("CreateBookmark").'" name="create"> ';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Cancel").'" name="cancel">';
|
||||
@ -186,8 +190,6 @@ if ($id > 0 && ! preg_match('/^add/i',$action))
|
||||
)
|
||||
);
|
||||
|
||||
dol_fiche_head($head, 'card', $langs->trans("Bookmark"),0,'bookmark');
|
||||
|
||||
if ($action == 'edit')
|
||||
{
|
||||
print '<form name="edit" method="POST" action="'.$_SERVER["PHP_SELF"].'" enctype="multipart/form-data">';
|
||||
@ -198,6 +200,8 @@ if ($id > 0 && ! preg_match('/^add/i',$action))
|
||||
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||
}
|
||||
|
||||
dol_fiche_head($head, $hselected, $langs->trans("Bookmark"),0,'bookmark');
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td>'.$bookmark->ref.'</td></tr>';
|
||||
@ -275,12 +279,14 @@ if ($id > 0 && ! preg_match('/^add/i',$action))
|
||||
|
||||
print '</table>';
|
||||
|
||||
if ($action == 'edit') print '<br><div align="center"><input class="button" type="submit" name="save" value="'.$langs->trans("Save").'"> <input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'"></div>';
|
||||
|
||||
if ($action == 'edit') print '</form>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
if ($action == 'edit')
|
||||
{
|
||||
print '<div align="center"><input class="button" type="submit" name="save" value="'.$langs->trans("Save").'"> <input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'"></div>';
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
|
||||
print "<div class=\"tabsAction\">\n";
|
||||
|
||||
|
||||
@ -50,14 +50,13 @@ if (GETPOST('action','alpha') == 'set')
|
||||
$db->begin();
|
||||
|
||||
if (GETPOST('socid','int') < 0) $_POST["socid"]='';
|
||||
/*if (GETPOST("CASHDESK_ID_BANKACCOUNT") < 0) $_POST["CASHDESK_ID_BANKACCOUNT"]='';
|
||||
if (GETPOST("CASHDESK_ID_WAREHOUSE") < 0) $_POST["CASHDESK_ID_WAREHOUSE"]='';*/
|
||||
|
||||
$res = dolibarr_set_const($db,"CASHDESK_ID_THIRDPARTY",GETPOST('socid','int'),'chaine',0,'',$conf->entity);
|
||||
$res = dolibarr_set_const($db,"CASHDESK_ID_BANKACCOUNT_CASH",GETPOST('CASHDESK_ID_BANKACCOUNT_CASH','alpha'),'chaine',0,'',$conf->entity);
|
||||
$res = dolibarr_set_const($db,"CASHDESK_ID_BANKACCOUNT_CHEQUE",GETPOST('CASHDESK_ID_BANKACCOUNT_CHEQUE','alpha'),'chaine',0,'',$conf->entity);
|
||||
$res = dolibarr_set_const($db,"CASHDESK_ID_BANKACCOUNT_CB",GETPOST('CASHDESK_ID_BANKACCOUNT_CB','alpha'),'chaine',0,'',$conf->entity);
|
||||
$res = dolibarr_set_const($db,"CASHDESK_ID_WAREHOUSE",GETPOST('CASHDESK_ID_WAREHOUSE','alpha'),'chaine',0,'',$conf->entity);
|
||||
$res = dolibarr_set_const($db,"CASHDESK_ID_THIRDPARTY",(GETPOST('socid','int') > 0 ? GETPOST('socid','int') : ''),'chaine',0,'',$conf->entity);
|
||||
$res = dolibarr_set_const($db,"CASHDESK_ID_BANKACCOUNT_CASH",(GETPOST('CASHDESK_ID_BANKACCOUNT_CASH','alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_CASH','alpha') : ''),'chaine',0,'',$conf->entity);
|
||||
$res = dolibarr_set_const($db,"CASHDESK_ID_BANKACCOUNT_CHEQUE",(GETPOST('CASHDESK_ID_BANKACCOUNT_CHEQUE','alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_CHEQUE','alpha') : ''),'chaine',0,'',$conf->entity);
|
||||
$res = dolibarr_set_const($db,"CASHDESK_ID_BANKACCOUNT_CB",(GETPOST('CASHDESK_ID_BANKACCOUNT_CB','alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_CB','alpha') : ''),'chaine',0,'',$conf->entity);
|
||||
$res = dolibarr_set_const($db,"CASHDESK_ID_WAREHOUSE",(GETPOST('CASHDESK_ID_WAREHOUSE','alpha') > 0 ? GETPOST('CASHDESK_ID_WAREHOUSE','alpha') : ''),'chaine',0,'',$conf->entity);
|
||||
$res = dolibarr_set_const($db,"CASHDESK_NO_DECREASE_STOCK",GETPOST('CASHDESK_NO_DECREASE_STOCK','alpha'),'chaine',0,'',$conf->entity);
|
||||
$res = dolibarr_set_const($db,"CASHDESK_SERVICES", GETPOST('CASHDESK_SERVICES','alpha'),'chaine',0,'',$conf->entity);
|
||||
|
||||
dol_syslog("admin/cashdesk: level ".GETPOST('level','alpha'));
|
||||
@ -129,9 +128,25 @@ if (! empty($conf->banque->enabled))
|
||||
if (! empty($conf->stock->enabled))
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("CashDeskIdWareHouse").'</td>';
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("CashDeskDoNotDecreaseStock").'</td>'; // Force warehouse (this is not a default value)
|
||||
print '<td colspan="2">';
|
||||
print $formproduct->selectWarehouses($conf->global->CASHDESK_ID_WAREHOUSE,'CASHDESK_ID_WAREHOUSE','',1);
|
||||
print $form->selectyesno('CASHDESK_NO_DECREASE_STOCK',$conf->global->CASHDESK_NO_DECREASE_STOCK,1);
|
||||
print '</td></tr>';
|
||||
|
||||
$disabled=$conf->global->CASHDESK_NO_DECREASE_STOCK;
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("CashDeskIdWareHouse").'</td>'; // Force warehouse (this is not a default value)
|
||||
print '<td colspan="2">';
|
||||
if (! $disabled)
|
||||
{
|
||||
print $formproduct->selectWarehouses($conf->global->CASHDESK_ID_WAREHOUSE,'CASHDESK_ID_WAREHOUSE','',1,$disabled);
|
||||
print ' <a href="'.DOL_URL_ROOT.'/product/stock/card.php?action=create&backtopage='.urlencode($_SERVER["PHP_SELF"]).'">('.$langs->trans("Create").')</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print $langs->trans("StockDecreaseForPointOfSaleDisabled");
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
@ -148,7 +163,7 @@ if (! empty($conf->service->enabled))
|
||||
print '</table>';
|
||||
print '<br>';
|
||||
|
||||
print '<center><input type="submit" class="button" value="'.$langs->trans("Save").'"></center>';
|
||||
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></div>';
|
||||
|
||||
print "</form>\n";
|
||||
|
||||
|
||||
@ -45,7 +45,17 @@ else
|
||||
|
||||
|
||||
|
||||
// Left area with selected articles (shopping cart)
|
||||
$obj_facturation->calculTotaux(); // Redefine prix_total_ttc, prix_total_ht et montant_tva from $_SESSION['poscart']
|
||||
|
||||
$total_ttc = $obj_facturation->prixTotalTtc();
|
||||
|
||||
/*var_dump($obj_facturation);
|
||||
var_dump($_SESSION['poscart']);
|
||||
var_dump($total_ttc);
|
||||
exit;*/
|
||||
|
||||
|
||||
// Left area with selected articles (area for article, amount and payments)
|
||||
print '<div class="principal">';
|
||||
|
||||
$page=GETPOST('menu','alpha');
|
||||
@ -72,13 +82,10 @@ print '</div>';
|
||||
|
||||
|
||||
|
||||
|
||||
// Right area with selected articles (shopping cart)
|
||||
print '<div class="liste_articles">';
|
||||
|
||||
require ('tpl/liste_articles.tpl.php');
|
||||
$obj_facturation->prixTotalHt($lst_total_ht);
|
||||
$obj_facturation->prixTotalTtc($lst_total_ttc);
|
||||
|
||||
print '</div>';
|
||||
|
||||
|
||||
@ -222,6 +222,7 @@ p.titre {
|
||||
margin: 0 15px;
|
||||
padding: 0;
|
||||
max-width: 500px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.titre1 {
|
||||
@ -308,7 +309,7 @@ p.titre {
|
||||
}
|
||||
|
||||
.texte_ref {
|
||||
width: 80px;
|
||||
min-width: 150px;
|
||||
}
|
||||
|
||||
.texte1,.texte1_off {
|
||||
@ -321,8 +322,8 @@ p.titre {
|
||||
|
||||
/* ------------------- */
|
||||
.textarea_note {
|
||||
width: 300px;
|
||||
height: 150px;
|
||||
width: 100%;
|
||||
height: 50px;
|
||||
padding: 2px 2px;
|
||||
}
|
||||
|
||||
@ -362,7 +363,7 @@ p.titre {
|
||||
}
|
||||
|
||||
.resume_label,.note_label {
|
||||
width: 200px;
|
||||
min-width: 200px;
|
||||
font-weight: bold;
|
||||
font-size: 1.1em;
|
||||
}
|
||||
|
||||
@ -137,16 +137,17 @@ switch ( $_GET['action'] )
|
||||
|
||||
case 'ajout_article': // We have clicked on button "Add product"
|
||||
|
||||
//var_dump($obj_facturation);
|
||||
//var_dump('ajout_article');
|
||||
//exit;
|
||||
|
||||
if (! empty($obj_facturation->id)) // A product has been selected and stored in session
|
||||
if (! empty($obj_facturation->id)) // A product was previously selected and stored in session, so we can add it
|
||||
{
|
||||
$obj_facturation->qte($_POST['txtQte']);
|
||||
$obj_facturation->tva($_POST['selTva']);
|
||||
$obj_facturation->remisePercent($_POST['txtRemise']);
|
||||
$obj_facturation->ajoutArticle();
|
||||
|
||||
$obj_facturation->ajoutArticle(); // This add an entry into $_SESSION['poscart']
|
||||
// We update prixTotalTtc
|
||||
|
||||
}
|
||||
|
||||
$redirection = DOL_URL_ROOT.'/cashdesk/affIndex.php?menu=facturation';
|
||||
@ -160,7 +161,7 @@ switch ( $_GET['action'] )
|
||||
|
||||
}
|
||||
|
||||
|
||||
// We saved object obj_facturation
|
||||
$_SESSION['serObjFacturation'] = serialize($obj_facturation);
|
||||
|
||||
header('Location: '.$redirection);
|
||||
|
||||
@ -32,6 +32,7 @@ $conf_db_base = $dolibarr_main_db_name;
|
||||
$conf_fksoc = (! empty($_SESSION["CASHDESK_ID_THIRDPARTY"]))?$_SESSION["CASHDESK_ID_THIRDPARTY"]:($conf->global->CASHDESK_ID_THIRDPARTY>0?$conf->global->CASHDESK_ID_THIRDPARTY:0);
|
||||
// Identifiant unique correspondant a l'entrepot a utiliser
|
||||
$conf_fkentrepot = (! empty($_SESSION["CASHDESK_ID_WAREHOUSE"]))?$_SESSION["CASHDESK_ID_WAREHOUSE"]:($conf->global->CASHDESK_ID_WAREHOUSE>0?$conf->global->CASHDESK_ID_WAREHOUSE:0);
|
||||
if (! empty($conf->global->CASHDESK_NO_DECREASE_STOCK)) $conf_fkentrepot = 0; // If option to disable stock decrease is on, we set warehouse id to 0.
|
||||
|
||||
// Identifiant unique correspondant au compte caisse / liquide
|
||||
$conf_fkaccount_cash = (! empty($_SESSION["CASHDESK_ID_BANKACCOUNT_CASH"]))?$_SESSION["CASHDESK_ID_BANKACCOUNT_CASH"]:($conf->global->CASHDESK_ID_BANKACCOUNT_CASH>0?$conf->global->CASHDESK_ID_BANKACCOUNT_CASH:0);
|
||||
|
||||
@ -99,16 +99,15 @@ print $form->select_company(GETPOST('socid','int')?GETPOST('socid','int'):$conf-
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
if (! empty($conf->stock->enabled))
|
||||
if (! empty($conf->stock->enabled) && empty($conf->global->CASHDESK_NO_DECREASE_STOCK))
|
||||
{
|
||||
$langs->load("stocks");
|
||||
print "<tr>";
|
||||
print '<td class="label1">'.$langs->trans("Warehouse").'</td>';
|
||||
print '<td>';
|
||||
$disabled=0;
|
||||
if (! empty($conf->global->CASHDESK_ID_WAREHOUSE)) $disabled=1; // If a particular stock is defined, we disable choice
|
||||
print $formproduct->selectWarehouses((GETPOST('warehouseid')?GETPOST('warehouseid'):(empty($conf->global->CASHDESK_ID_WAREHOUSE)?'ifone':$conf->global->CASHDESK_ID_WAREHOUSE)),'warehouseid','',!$disabled,$disabled);
|
||||
//print '<input name="warehouse_id" class="texte_login" type="warehouse_id" value="" />';
|
||||
if ($conf->global->CASHDESK_ID_WAREHOUSE > 0) $disabled=1; // If a particular stock is defined, we disable choice
|
||||
print $formproduct->selectWarehouses((GETPOST('warehouseid')?GETPOST('warehouseid','int'):(empty($conf->global->CASHDESK_ID_WAREHOUSE)?'ifone':$conf->global->CASHDESK_ID_WAREHOUSE)),'warehouseid','',!$disabled,$disabled);
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
@ -36,11 +36,11 @@ $langs->load("cashdesk");
|
||||
|
||||
$username = GETPOST("txtUsername");
|
||||
$password = GETPOST("pwdPassword");
|
||||
$thirdpartyid = (GETPOST('socid','int')!='')?GETPOST('socid','int'):$conf->global->CASHDESK_ID_THIRDPARTY;
|
||||
$warehouseid = (GETPOST("warehouseid")!='')?GETPOST("warehouseid"):$conf->global->CASHDESK_ID_WAREHOUSE;
|
||||
$bankid_cash = (GETPOST("CASHDESK_ID_BANKACCOUNT_CASH")!='')?GETPOST("CASHDESK_ID_BANKACCOUNT_CASH"):$conf->global->CASHDESK_ID_BANKACCOUNT_CASH;
|
||||
$bankid_cheque = (GETPOST("CASHDESK_ID_BANKACCOUNT_CHEQUE")!='')?GETPOST("CASHDESK_ID_BANKACCOUNT_CHEQUE"):$conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE;
|
||||
$bankid_cb = (GETPOST("CASHDESK_ID_BANKACCOUNT_CB")!='')?GETPOST("CASHDESK_ID_BANKACCOUNT_CB"):$conf->global->CASHDESK_ID_BANKACCOUNT_CB;
|
||||
$thirdpartyid = (GETPOST('socid','int') > 0)?GETPOST('socid','int'):$conf->global->CASHDESK_ID_THIRDPARTY;
|
||||
$warehouseid = (GETPOST("warehouseid") > 0)?GETPOST("warehouseid",'int'):$conf->global->CASHDESK_ID_WAREHOUSE;
|
||||
$bankid_cash = (GETPOST("CASHDESK_ID_BANKACCOUNT_CASH") > 0)?GETPOST("CASHDESK_ID_BANKACCOUNT_CASH",'int'):$conf->global->CASHDESK_ID_BANKACCOUNT_CASH;
|
||||
$bankid_cheque = (GETPOST("CASHDESK_ID_BANKACCOUNT_CHEQUE") > 0)?GETPOST("CASHDESK_ID_BANKACCOUNT_CHEQUE",'int'):$conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE;
|
||||
$bankid_cb = (GETPOST("CASHDESK_ID_BANKACCOUNT_CB") > 0)?GETPOST("CASHDESK_ID_BANKACCOUNT_CB",'int'):$conf->global->CASHDESK_ID_BANKACCOUNT_CB;
|
||||
|
||||
// Check username
|
||||
if (empty($username))
|
||||
@ -58,15 +58,15 @@ if (! ($thirdpartyid > 0))
|
||||
}
|
||||
|
||||
// If we setup stock module to ask movement on invoices, we must not allow access if required setup not finished.
|
||||
if (! empty($conf->stock->enabled) && $conf->global->STOCK_CALCULATE_ON_BILL && ! ($warehouseid > 0))
|
||||
if (! empty($conf->stock->enabled) && empty($conf->global->CASHDESK_NO_DECREASE_STOCK) && ! ($warehouseid > 0))
|
||||
{
|
||||
$retour=$langs->trans("CashDeskSetupStock");
|
||||
$retour=$langs->trans("CashDeskYouDidNotDisableStockDecease");
|
||||
header('Location: '.DOL_URL_ROOT.'/cashdesk/index.php?err='.urlencode($retour).'&user='.$username.'&socid='.$thirdpartyid.'&warehouseid='.$warehouseid.'&bankid_cash='.$bankid_cash.'&bankid_cheque='.$bankid_cheque.'&bankid_cb='.$bankid_cb);
|
||||
exit;
|
||||
}
|
||||
|
||||
// If stock decrease on bill validation, check user has stock edit permissions
|
||||
if (! empty($conf->stock->enabled) && $conf->global->STOCK_CALCULATE_ON_BILL && ! empty($username))
|
||||
if (! empty($conf->stock->enabled) && empty($conf->global->CASHDESK_NO_DECREASE_STOCK) && ! empty($username))
|
||||
{
|
||||
$testuser=new User($db);
|
||||
$testuser->fetch(0,$username);
|
||||
@ -117,8 +117,9 @@ if ( $retour >= 0 )
|
||||
$_SESSION['uname'] = $username;
|
||||
$_SESSION['lastname'] = $tab['lastname'];
|
||||
$_SESSION['firstname'] = $tab['firstname'];
|
||||
$_SESSION['CASHDESK_ID_THIRDPARTY'] = $thirdpartyid;
|
||||
$_SESSION['CASHDESK_ID_WAREHOUSE'] = $warehouseid;
|
||||
$_SESSION['CASHDESK_ID_THIRDPARTY'] = ($thirdpartyid > 0 ? $thirdpartyid : '');
|
||||
$_SESSION['CASHDESK_ID_WAREHOUSE'] = ($warehouseid > 0 ? $warehouseid : '');
|
||||
|
||||
$_SESSION['CASHDESK_ID_BANKACCOUNT_CASH'] = ($bankid_cash > 0 ? $bankid_cash : '');
|
||||
$_SESSION['CASHDESK_ID_BANKACCOUNT_CHEQUE'] = ($bankid_cheque > 0 ? $bankid_cheque : '');
|
||||
$_SESSION['CASHDESK_ID_BANKACCOUNT_CB'] = ($bankid_cb > 0 ? $bankid_cb : '');
|
||||
@ -131,7 +132,6 @@ if ( $retour >= 0 )
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -43,6 +43,7 @@ $langs->load("cashdesk");
|
||||
<!-- Affichage de la reference et de la designation -->
|
||||
<td><input class="texte_ref" type="text" id ="txtRef" name="txtRef" value="<?php echo $obj_facturation->ref() ?>"
|
||||
onchange="javascript: setSource('REF');"
|
||||
onkeyup="javascript: verifResultat('resultats_dhtml', this.value);"
|
||||
onfocus="javascript: this.select(); verifResultat('resultats_dhtml', this.value);"
|
||||
onBlur="javascript: document.getElementById('resultats_dhtml').innerHTML = '';"/>
|
||||
</td>
|
||||
@ -147,7 +148,7 @@ $langs->load("cashdesk");
|
||||
</form>
|
||||
</fieldset>
|
||||
|
||||
<!-- ========================= Cadre "Difference" ============================= -->
|
||||
<!-- ========================= Cadre "Amount" ============================= -->
|
||||
<form id="frmDifference" class="formulaire1" method="post" onsubmit="javascript: return verifReglement()" action="validation_verif.php?action=valide_achat">
|
||||
<input type="hidden" name="hdnChoix" value="" />
|
||||
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>" />
|
||||
|
||||
@ -42,7 +42,7 @@ $tab=array();
|
||||
$tab = $_SESSION['poscart'];
|
||||
|
||||
$tab_size=count($tab);
|
||||
if ($tab_size <= 0) print '<center>'.$langs->trans("NoArticle").'<center><br>';
|
||||
if ($tab_size <= 0) print '<div class="center">'.$langs->trans("NoArticle").'</div><br>';
|
||||
else
|
||||
{
|
||||
for ($i=0;$i < $tab_size;$i++)
|
||||
@ -67,8 +67,6 @@ else
|
||||
}
|
||||
}
|
||||
|
||||
$obj_facturation->calculTotaux();
|
||||
$total_ttc = $obj_facturation->prixTotalTtc();
|
||||
echo ('<p class="cadre_prix_total">'.$langs->trans("Total").' : '.price(price2num($total_ttc, 'MT'),0,$langs,0,0,-1,$conf->currency).'<br></p>'."\n");
|
||||
|
||||
?></div>
|
||||
|
||||
@ -72,7 +72,7 @@ print $langs->trans("CashDeskThirdParty").': '.$companyLink.'<br>';
|
||||
/*print $langs->trans("CashDeskBankCash").': '.$bankcashLink.'<br>';
|
||||
print $langs->trans("CashDeskBankCB").': '.$bankcbLink.'<br>';
|
||||
print $langs->trans("CashDeskBankCheque").': '.$bankchequeLink.'<br>';*/
|
||||
if (!empty($_SESSION["CASHDESK_ID_WAREHOUSE"]) && ! empty($conf->stock->enabled))
|
||||
if (!empty($_SESSION["CASHDESK_ID_WAREHOUSE"]) && ! empty($conf->stock->enabled) && empty($conf->global->CASHDESK_NO_DECREASE_STOCK))
|
||||
{
|
||||
print $langs->trans("CashDeskWarehouse").': '.$warehouseLink;
|
||||
}
|
||||
|
||||
@ -17,6 +17,7 @@
|
||||
*/
|
||||
|
||||
$langs->load("main");
|
||||
$langs->load("bills");
|
||||
|
||||
// Object $form must de defined
|
||||
|
||||
@ -111,8 +112,9 @@ $langs->load("main");
|
||||
</p>
|
||||
<p class="note_label"><?php echo $langs->trans("Notes"); ?><br><textarea class="textarea_note" name="txtaNotes"></textarea></p>
|
||||
|
||||
<span><input class="bouton_validation" type="submit" name="btnValider" value="<?php echo $langs->trans("ValidateInvoice"); ?>" /></span>
|
||||
<p><a class="lien1" href="affIndex.php?menu=facturation"><?php echo $langs->trans("RestartSelling"); ?></a></p>
|
||||
<div class="center"><input class="button" type="submit" name="btnValider" value="<?php echo $langs->trans("ValidateInvoice"); ?>" /><br>
|
||||
<br><a class="lien1" href="affIndex.php?menu=facturation"><?php echo $langs->trans("RestartSelling"); ?></a>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
@ -18,10 +18,11 @@
|
||||
*/
|
||||
|
||||
$langs->load("main");
|
||||
$langs->load("bills");
|
||||
|
||||
?>
|
||||
|
||||
<h3 class="titre1"><?php echo $langs->trans("SellFinished"); ?></h3>
|
||||
<h3 class="titre1"><?php echo $langs->trans("SellFinished"); ?></h3><br>
|
||||
|
||||
<div class="cadre_facturation">
|
||||
|
||||
|
||||
@ -218,7 +218,33 @@ switch ($action)
|
||||
$resultcreate=$invoice->create($user,0,dol_stringtotime($obj_facturation->paiementLe()));
|
||||
if ($resultcreate > 0)
|
||||
{
|
||||
$resultvalid=$invoice->validate($user, $obj_facturation->numInvoice(), (isset($_SESSION["CASHDESK_ID_WAREHOUSE"])?$_SESSION["CASHDESK_ID_WAREHOUSE"]:0));
|
||||
$warehouseidtodecrease=(isset($_SESSION["CASHDESK_ID_WAREHOUSE"])?$_SESSION["CASHDESK_ID_WAREHOUSE"]:0);
|
||||
if (! empty($conf->global->CASHDESK_NO_DECREASE_STOCK)) $warehouseidtodecrease=0; // If a particular stock is defined, we disable choice
|
||||
|
||||
$resultvalid=$invoice->validate($user, $obj_facturation->numInvoice(), 0);
|
||||
|
||||
if ($warehouseidtodecrease > 0)
|
||||
{
|
||||
// Decrease
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
|
||||
$langs->load("agenda");
|
||||
// Loop on each line
|
||||
$cpt=count($invoice->lines);
|
||||
for ($i = 0; $i < $cpt; $i++)
|
||||
{
|
||||
if ($invoice->lines[$i]->fk_product > 0)
|
||||
{
|
||||
$mouvP = new MouvementStock($db);
|
||||
$mouvP->origin = &$invoice;
|
||||
// We decrease stock for product
|
||||
if ($invoice->type == $invoice::TYPE_CREDIT_NOTE) $result=$mouvP->reception($user, $invoice->lines[$i]->fk_product, $warehouseidtodecrease, $invoice->lines[$i]->qty, $invoice->lines[$i]->subprice, $langs->trans("InvoiceValidatedInDolibarrFromPos",$invoice->newref));
|
||||
else $result=$mouvP->livraison($user, $invoice->lines[$i]->fk_product, $warehouseidtodecrease, $invoice->lines[$i]->qty, $invoice->lines[$i]->subprice, $langs->trans("InvoiceValidatedInDolibarrFromPos",$invoice->newref));
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -232,7 +258,33 @@ switch ($action)
|
||||
$resultcreate=$invoice->create($user,0,0);
|
||||
if ($resultcreate > 0)
|
||||
{
|
||||
$resultvalid=$invoice->validate($user, $obj_facturation->numInvoice(), (isset($_SESSION["CASHDESK_ID_WAREHOUSE"])?$_SESSION["CASHDESK_ID_WAREHOUSE"]:0));
|
||||
$warehouseidtodecrease=(isset($_SESSION["CASHDESK_ID_WAREHOUSE"])?$_SESSION["CASHDESK_ID_WAREHOUSE"]:0);
|
||||
if (! empty($conf->global->CASHDESK_NO_DECREASE_STOCK)) $warehouseidtodecrease=0; // If a particular stock is defined, we disable choice
|
||||
|
||||
$resultvalid=$invoice->validate($user, $obj_facturation->numInvoice(), 0);
|
||||
|
||||
if ($warehouseidtodecrease > 0)
|
||||
{
|
||||
// Decrease
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
|
||||
$langs->load("agenda");
|
||||
// Loop on each line
|
||||
$cpt=count($invoice->lines);
|
||||
for ($i = 0; $i < $cpt; $i++)
|
||||
{
|
||||
if ($invoice->lines[$i]->fk_product > 0)
|
||||
{
|
||||
$mouvP = new MouvementStock($db);
|
||||
$mouvP->origin = &$invoice;
|
||||
// We decrease stock for product
|
||||
if ($invoice->type == $invoice::TYPE_CREDIT_NOTE) $result=$mouvP->reception($user, $invoice->lines[$i]->fk_product, $warehouseidtodecrease, $invoice->lines[$i]->qty, $invoice->lines[$i]->subprice, $langs->trans("InvoiceValidatedInDolibarrFromPos",$invoice->newref));
|
||||
else $result=$mouvP->livraison($user, $invoice->lines[$i]->fk_product, $warehouseidtodecrease, $invoice->lines[$i]->qty, $invoice->lines[$i]->subprice, $langs->trans("InvoiceValidatedInDolibarrFromPos",$invoice->newref));
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$id = $invoice->id;
|
||||
|
||||
|
||||
@ -256,11 +256,11 @@ if ($user->rights->categorie->creer)
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '<center><br>';
|
||||
print '<br><div class="center">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("CreateThisCat").'" name="creation" />';
|
||||
print ' ';
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Cancel").'" name="cancel" />';
|
||||
print '</center>';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
@ -163,8 +163,7 @@ if (empty($reshook) && ! empty($extrafields->attribute_label))
|
||||
print '</table>';
|
||||
print '<br>';
|
||||
|
||||
print '<center><input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
||||
print '</center>';
|
||||
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
|
||||
@ -190,9 +190,11 @@ if ($action == 'edit')
|
||||
}
|
||||
}
|
||||
|
||||
print '<br /><center>';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Save").'"> ';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></center>';
|
||||
print '<br /><div class="center">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">';
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
@ -266,9 +268,11 @@ if ($action == 'add' && ($user->rights->produit->creer || $user->rights->service
|
||||
print '</tr>';
|
||||
print '</table>';
|
||||
|
||||
print '<br><center>';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Save").'"> ';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></center>';
|
||||
print '<br><div class="center">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">';
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
|
||||
@ -779,11 +779,11 @@ if ($action == 'create')
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '<center><br>';
|
||||
print '<br><div class="center">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Add").'">';
|
||||
print ' ';
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
print '</center>';
|
||||
print '</div>';
|
||||
|
||||
print "</form>";
|
||||
}
|
||||
@ -1013,9 +1013,11 @@ if ($id > 0)
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print '<center><input type="submit" class="button" name="edit" value="'.$langs->trans("Save").'">';
|
||||
print ' <input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
print '</center>';
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" name="edit" value="'.$langs->trans("Save").'">';
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
}
|
||||
@ -1246,34 +1248,6 @@ if ($id > 0)
|
||||
|
||||
if ($action != 'edit')
|
||||
{
|
||||
|
||||
if (empty($conf->global->SOCIETE_DISABLE_BUILDDOC)) {
|
||||
print '<div class="fichecenter"><div class="fichehalfleft">';
|
||||
print '<a name="builddoc"></a>'; // ancre
|
||||
|
||||
/*
|
||||
* Documents generes
|
||||
*/
|
||||
|
||||
$filedir=$conf->agenda->multidir_output[$conf->entity].'/'.$object->id;
|
||||
$urlsource=$_SERVER["PHP_SELF"]."?socid=".$object->id;
|
||||
|
||||
$genallowed=$user->rights->agenda->myactions->create;
|
||||
$delallowed=$user->rights->agenda->myactions->delete;
|
||||
|
||||
$var=true;
|
||||
|
||||
$somethingshown=$formfile->show_documents('agenda',$object->id,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,0,0,'','','',$object->default_lang);
|
||||
|
||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||
|
||||
|
||||
print '</div></div></div>';
|
||||
|
||||
print '<div style="clear:both;"> </div>';
|
||||
}
|
||||
|
||||
|
||||
// Link to agenda views
|
||||
print '<div id="agendaviewbutton">';
|
||||
print '<form name="listactionsfiltermonth" action="'.DOL_URL_ROOT.'/comm/action/index.php" method="POST" style="float: left; padding-right: 10px;">';
|
||||
@ -1313,6 +1287,33 @@ if ($id > 0)
|
||||
print img_picto($langs->trans("ViewCal"),'object_calendarperuser','class="hideonsmartphone"').' <input type="submit" style="min-width: 120px" class="button" name="viewperuser" value="'.$langs->trans("ViewPerUser").'">';
|
||||
print '</form>'."\n";
|
||||
print '</div>';
|
||||
|
||||
if (empty($conf->global->AGENDA_DISABLE_BUILDDOC))
|
||||
{
|
||||
print '<div style="clear:both;"> </div><div class="fichecenter"><div class="fichehalfleft">';
|
||||
print '<a name="builddoc"></a>'; // ancre
|
||||
|
||||
/*
|
||||
* Documents generes
|
||||
*/
|
||||
|
||||
$filedir=$conf->agenda->multidir_output[$conf->entity].'/'.$object->id;
|
||||
$urlsource=$_SERVER["PHP_SELF"]."?socid=".$object->id;
|
||||
|
||||
$genallowed=$user->rights->agenda->myactions->create;
|
||||
$delallowed=$user->rights->agenda->myactions->delete;
|
||||
|
||||
$var=true;
|
||||
|
||||
$somethingshown=$formfile->show_documents('agenda',$object->id,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,0,0,'','','',$object->default_lang);
|
||||
|
||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||
|
||||
|
||||
print '</div></div></div>';
|
||||
|
||||
print '<div style="clear:both;"> </div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -281,14 +281,14 @@ if ($action == 'create')
|
||||
|
||||
print '</table>'."\n";
|
||||
|
||||
print '<br><center>';
|
||||
print '<br><div class="center">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans('Add').'">';
|
||||
if (! empty($backtopage))
|
||||
{
|
||||
print ' ';
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
}
|
||||
print '</center>'."\n";
|
||||
print '</div>'."\n";
|
||||
|
||||
print '</form>'."\n";
|
||||
|
||||
@ -381,11 +381,11 @@ elseif ($action == 'edit')
|
||||
|
||||
print '</table><br>';
|
||||
|
||||
print '<center>';
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
|
||||
print ' ';
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
print '</center>';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
@ -94,6 +94,13 @@ $object->substitutionarrayfortest=array(
|
||||
//,'__PERSONALIZED__' => 'TESTPersonalized' // Not used yet
|
||||
);
|
||||
|
||||
// List of sending methods
|
||||
$listofmethods=array();
|
||||
$listofmethods['mail']='PHP mail function';
|
||||
//$listofmethods['simplemail']='Simplemail class';
|
||||
$listofmethods['smtps']='SMTP/SMTPS socket library';
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@ -701,7 +708,7 @@ if ($action == 'create')
|
||||
print '</td></tr>';
|
||||
print '</table>';
|
||||
|
||||
print '<br><center><input type="submit" class="button" value="'.$langs->trans("CreateMailing").'"></center>';
|
||||
print '<br><div class="center"><input type="submit" class="button" value="'.$langs->trans("CreateMailing").'"></div>';
|
||||
|
||||
print '</form>';
|
||||
}
|
||||
@ -741,10 +748,21 @@ else
|
||||
{
|
||||
// Define message to recommand from command line
|
||||
|
||||
// Pour des raisons de securite, on ne permet pas cette fonction via l'IHM,
|
||||
// on affiche donc juste un message
|
||||
$sendingmode=$conf->global->MAIN_MAIL_SENDMODE;
|
||||
if (empty($sendingmode)) $sendingmode='mail'; // If not defined, we use php mail function
|
||||
|
||||
if (empty($conf->global->MAILING_LIMIT_SENDBYWEB))
|
||||
if (! empty($conf->global->MAILING_NO_USING_PHPMAIL) && $sendingmode == 'mail')
|
||||
{
|
||||
// EMailing feature may be a spam problem, so when you host several users/instance, having this option may force each user to use their own SMTP agent.
|
||||
// You ensure that every user is using its own SMTP server.
|
||||
$linktoadminemailbefore='<a href="'.DOL_URL_ROOT.'/admin/mails.php">';
|
||||
$linktoadminemailend='</a>';
|
||||
setEventMessage($langs->trans("MailSendSetupIs", $listofmethods[$sendingmode]), 'warnings');
|
||||
setEventMessage($langs->trans("MailSendSetupIs2", $linktoadminemailbefore, $linktoadminemailend, $langs->transnoentitiesnoconv("MAIN_MAIL_SENDMODE"), $listofmethods['smtps']), 'warnings');
|
||||
if (! empty($conf->global->MAILING_SMTP_SETUP_EMAILS_FOR_QUESTIONS)) setEventMessage($langs->trans("MailSendSetupIs3", $conf->global->MAILING_SMTP_SETUP_EMAILS_FOR_QUESTIONS), 'warnings');
|
||||
$_GET["action"]='';
|
||||
}
|
||||
else if (empty($conf->global->MAILING_LIMIT_SENDBYWEB))
|
||||
{
|
||||
// Pour des raisons de securite, on ne permet pas cette fonction via l'IHM,
|
||||
// on affiche donc juste un message
|
||||
@ -764,7 +782,7 @@ else
|
||||
}
|
||||
$text.=$langs->trans('ConfirmSendingEmailing').'<br>';
|
||||
$text.=$langs->trans('LimitSendingEmailing',$conf->global->MAILING_LIMIT_SENDBYWEB);
|
||||
print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('SendMailing'),$text,'sendallconfirmed',$formquestion,'',1,260);
|
||||
print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('SendMailing'),$text,'sendallconfirmed',$formquestion,'',1,270);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1139,11 +1157,11 @@ else
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '<br><center>';
|
||||
print '<br><div class="center">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Save").'" name="save">';
|
||||
print ' ';
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Cancel").'" name="cancel">';
|
||||
print '</center>';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
print '<br>';
|
||||
|
||||
@ -276,7 +276,8 @@ if ($object->fetch($id) >= 0)
|
||||
|
||||
$obj = new $classname($db);
|
||||
|
||||
$qualified=1;
|
||||
// Check dependencies
|
||||
$qualified=(isset($obj->enabled)?$obj->enabled:1);
|
||||
foreach ($obj->require_module as $key)
|
||||
{
|
||||
if (! $conf->$key->enabled || (! $user->admin && $obj->require_admin))
|
||||
|
||||
@ -1310,9 +1310,11 @@ if ($action == 'create')
|
||||
print '</td></tr>';
|
||||
|
||||
// Bank Account
|
||||
print '<tr><td>' . $langs->trans('BankAccount') . '</td><td colspan="2">';
|
||||
$form->select_comptes($fk_account, 'fk_account', 0, '', 1);
|
||||
print '</td></tr>';
|
||||
if (! empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL) && $conf->module->banque->enabled) {
|
||||
print '<tr><td>' . $langs->trans('BankAccount') . '</td><td colspan="2">';
|
||||
$form->select_comptes($fk_account, 'fk_account', 0, '', 1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// What trigger creation
|
||||
print '<tr><td>' . $langs->trans('Source') . '</td><td>';
|
||||
@ -1514,10 +1516,11 @@ if ($action == 'create')
|
||||
|
||||
|
||||
$langs->load("bills");
|
||||
print '<center>';
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" value="' . $langs->trans("CreateDraft") . '">';
|
||||
print ' <input type="button" class="button" value="' . $langs->trans("Cancel") . '" onClick="javascript:history.go(-1)">';
|
||||
print '</center>';
|
||||
print ' ';
|
||||
print '<input type="button" class="button" value="' . $langs->trans("Cancel") . '" onClick="javascript:history.go(-1)">';
|
||||
print '</div>';
|
||||
|
||||
print "</form>";
|
||||
|
||||
@ -1892,7 +1895,7 @@ if ($action == 'create')
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
if (! empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL))
|
||||
if (! empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL) && $conf->banque->enabled)
|
||||
{
|
||||
// Bank Account
|
||||
print '<tr><td>';
|
||||
|
||||
@ -3,7 +3,8 @@
|
||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2014 Frederic France <frederic.france@free.fr>
|
||||
*
|
||||
* 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
|
||||
@ -22,14 +23,13 @@
|
||||
/**
|
||||
* \file htdocs/comm/propal/apercu.php
|
||||
* \ingroup propal
|
||||
* \brief Page de l'onglet apercu d'une propal
|
||||
* \brief Preview tab of propal
|
||||
*/
|
||||
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
|
||||
$langs->load('propal');
|
||||
$langs->load("bills");
|
||||
@ -44,18 +44,11 @@ $result = restrictedArea($user, 'propal', $id);
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
* View Mode
|
||||
*/
|
||||
|
||||
llxHeader();
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
/* *************************************************************************** */
|
||||
/* */
|
||||
/* Mode fiche */
|
||||
/* */
|
||||
/* *************************************************************************** */
|
||||
|
||||
if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
@ -73,29 +66,30 @@ if ($id > 0 || ! empty($ref))
|
||||
/*
|
||||
* Propal
|
||||
*/
|
||||
print '<table class="border" width="100%">';
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Ref
|
||||
print '<tr><td width="25%">'.$langs->trans('Ref').'</td><td colspan="5">'.$object->ref.'</td></tr>';
|
||||
// Ref
|
||||
print '<tr><td width="25%">'.$langs->trans('Ref').'</td>';
|
||||
print '<td colspan="5">'.$object->ref.'</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Ref client
|
||||
print '<tr><td>';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td class="nowrap">';
|
||||
print $langs->trans('RefCustomer').'</td><td align="left">';
|
||||
print '</td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="5">';
|
||||
print $object->ref_client;
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
// Ref client
|
||||
print '<tr><td>'.$langs->trans('RefCustomer').'</td>';
|
||||
print '<td colspan="5">'.$object->ref_client.'</td>';
|
||||
print '</tr>';
|
||||
|
||||
$rowspan=2;
|
||||
|
||||
// Tiers
|
||||
print '<tr><td>'.$langs->trans('Company').'</td><td colspan="5">'.$soc->getNomUrl(1).'</td>';
|
||||
print '</tr>';
|
||||
// Thirdparty
|
||||
print '<tr><td>'.$langs->trans('Company').'</td>';
|
||||
print '<td colspan="5">'.$soc->getNomUrl(1).'</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Ligne info remises tiers
|
||||
// Status
|
||||
print '<tr><td>'.$langs->trans("Status").'</td>';
|
||||
print '<td colspan="5">'.$object->getLibStatut(4).'</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Discount
|
||||
print '<tr><td>'.$langs->trans('Discounts').'</td><td colspan="5">';
|
||||
if ($soc->remise_percent) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_percent);
|
||||
else print $langs->trans("CompanyHasNoRelativeDiscount");
|
||||
@ -103,44 +97,43 @@ if ($id > 0 || ! empty($ref))
|
||||
print '. ';
|
||||
if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",$absolute_discount,$langs->trans("Currency".$conf->currency));
|
||||
else print $langs->trans("CompanyHasNoAbsoluteDiscount");
|
||||
print '.';
|
||||
print '</td></tr>';
|
||||
print '.</td>';
|
||||
print '</tr>';
|
||||
|
||||
// ligne
|
||||
// partie Gauche
|
||||
print '<tr><td>'.$langs->trans('Date').'</td><td colspan="3">';
|
||||
print dol_print_date($object->date,'daytext');
|
||||
print '</td>';
|
||||
// Date
|
||||
print '<tr><td>'.$langs->trans('Date').'</td>';
|
||||
print '<td>'.dol_print_date($object->date,'daytext').'</td>';
|
||||
|
||||
// partie Droite sur $rowspan lignes
|
||||
print '<td colspan="2" rowspan="'.$rowspan.'" valign="top" width="50%">';
|
||||
// Right part with $rowspan lines
|
||||
$rowspan=4;
|
||||
print '<td rowspan="'.$rowspan.'" valign="top" width="50%">';
|
||||
|
||||
/*
|
||||
* Documents
|
||||
*/
|
||||
$objectref = dol_sanitizeFileName($object->ref);
|
||||
$dir_output = $conf->propal->dir_output . "/";
|
||||
$filepath = $dir_output . $objectref . "/";
|
||||
$file = $filepath . $objectref . ".pdf";
|
||||
$filedetail = $filepath . $objectref . "-detail.pdf";
|
||||
/*
|
||||
* Documents
|
||||
*/
|
||||
$objectref = dol_sanitizeFileName($object->ref);
|
||||
$dir_output = $conf->propal->dir_output . "/";
|
||||
$filepath = $dir_output . $objectref . "/";
|
||||
$file = $filepath . $objectref . ".pdf";
|
||||
$filedetail = $filepath . $objectref . "-detail.pdf";
|
||||
$relativepath = $objectref.'/'.$objectref.'.pdf';
|
||||
$relativepathdetail = $objectref.'/'.$objectref.'-detail.pdf';
|
||||
|
||||
// Define path to preview pdf file (preview precompiled "file.ext" are "file.ext_preview.png")
|
||||
$fileimage = $file.'_preview.png'; // If PDF has 1 page
|
||||
$fileimage = $file.'_preview.png'; // If PDF has 1 page
|
||||
$fileimagebis = $file.'_preview-0.pdf.png'; // If PDF has more than one page
|
||||
$relativepathimage = $relativepath.'_preview.png';
|
||||
|
||||
$var=true;
|
||||
$var=true;
|
||||
|
||||
// Si fichier PDF existe
|
||||
if (file_exists($file))
|
||||
{
|
||||
$encfile = urlencode($file);
|
||||
print_titre($langs->trans("Documents"));
|
||||
print '<table class="border" width="100%">';
|
||||
print '<table class="nobordernopadding" width="100%">';
|
||||
print '<tr class="liste_titre"><td colspan="4">'.$langs->trans("Documents").'</td></tr>';
|
||||
|
||||
print "<tr ".$bc[$var]."><td>".$langs->trans("Propal")." PDF</td>";
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("Proposal").' PDF</td>';
|
||||
|
||||
print '<td><a data-ajax="false" href="'.DOL_URL_ROOT . '/document.php?modulepart=propal&file='.urlencode($relativepath).'">'.$object->ref.'.pdf</a></td>';
|
||||
|
||||
@ -166,13 +159,25 @@ if ($id > 0 || ! empty($ref))
|
||||
}
|
||||
}
|
||||
|
||||
print "</td>";
|
||||
print '</tr>';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr><td height="10">'.$langs->trans('AmountHT').'</td>';
|
||||
print '<td align="right" colspan="2"><b>'.price($object->price).'</b></td>';
|
||||
print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>';
|
||||
print '</table>';
|
||||
// Total HT - left part
|
||||
print '<tr><td>'.$langs->trans('AmountHT').'</td>';
|
||||
print '<td align="right" class="nowrap"><b>' . price($object->total_ht, '', $langs, 0, - 1, - 1, $conf->currency) . '</b></td>';
|
||||
print '</tr>';
|
||||
|
||||
// Total VAT - left part
|
||||
print '<tr><td>'.$langs->trans('AmountVAT').'</td>';
|
||||
print '<td align="right" class="nowrap"><b>' . price($object->total_tva, '', $langs, 0, - 1, - 1, $conf->currency) . '</b></td>';
|
||||
print '</tr>';
|
||||
|
||||
// Total TTC - left part
|
||||
print '<tr><td>'.$langs->trans('AmountTTC').'</td>';
|
||||
print '<td align="right" class="nowrap"><b>' . price($object->total_ttc, '', $langs, 0, - 1, - 1, $conf->currency) . '</b></td>';
|
||||
print '</tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
dol_fiche_end();
|
||||
}
|
||||
@ -183,10 +188,13 @@ if ($id > 0 || ! empty($ref))
|
||||
}
|
||||
}
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tr><td>';
|
||||
print '<div class="photolist">';
|
||||
// Si fichier png PDF d'1 page trouve
|
||||
if (file_exists($fileimage))
|
||||
{
|
||||
print '<img style="background: #FFF" src="'.DOL_URL_ROOT . '/viewimage.php?modulepart=apercupropal&file='.urlencode($relativepathimage).'">';
|
||||
print '<img class="photo photowithmargin" src="'.DOL_URL_ROOT . '/viewimage.php?modulepart=apercupropal&file='.urlencode($relativepathimage).'">';
|
||||
}
|
||||
// Si fichier png PDF de plus d'1 page trouve
|
||||
elseif (file_exists($fileimagebis))
|
||||
@ -199,10 +207,13 @@ elseif (file_exists($fileimagebis))
|
||||
|
||||
if (file_exists($dir_output.$preview))
|
||||
{
|
||||
print '<img style="background: #FFF" src="'.DOL_URL_ROOT . '/viewimage.php?modulepart=apercupropal&file='.urlencode($preview).'"><p>';
|
||||
print '<img class="photo photowithmargin" src="'.DOL_URL_ROOT . '/viewimage.php?modulepart=apercupropal&file='.urlencode($preview).'"><p>';
|
||||
}
|
||||
}
|
||||
}
|
||||
print '</div>';
|
||||
print '</td></tr>';
|
||||
print '</table>';
|
||||
|
||||
|
||||
llxFooter();
|
||||
|
||||
@ -416,7 +416,15 @@ class Propal extends CommonObject
|
||||
|
||||
|
||||
// infos marge
|
||||
$this->line->fk_fournprice = $fk_fournprice;
|
||||
if (!empty($fk_product) && empty($fk_fournprice) && empty($pa_ht)) {
|
||||
// by external module, take lowest buying price
|
||||
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
|
||||
$productFournisseur = new ProductFournisseur($this->db);
|
||||
$productFournisseur->find_min_price_product_fournisseur($fk_product);
|
||||
$this->line->fk_fournprice = $productFournisseur->product_fourn_price_id;
|
||||
} else {
|
||||
$this->line->fk_fournprice = $fk_fournprice;
|
||||
}
|
||||
$this->line->pa_ht = $pa_ht;
|
||||
|
||||
// Mise en option de la ligne
|
||||
@ -567,7 +575,15 @@ class Propal extends CommonObject
|
||||
$this->line->skip_update_total = $skip_update_total;
|
||||
|
||||
// infos marge
|
||||
$this->line->fk_fournprice = $fk_fournprice;
|
||||
if (!empty($fk_product) && empty($fk_fournprice) && empty($pa_ht)) {
|
||||
// by external module, take lowest buying price
|
||||
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
|
||||
$productFournisseur = new ProductFournisseur($this->db);
|
||||
$productFournisseur->find_min_price_product_fournisseur($fk_product);
|
||||
$this->line->fk_fournprice = $productFournisseur->product_fourn_price_id;
|
||||
} else {
|
||||
$this->line->fk_fournprice = $fk_fournprice;
|
||||
}
|
||||
$this->line->pa_ht = $pa_ht;
|
||||
|
||||
$this->line->date_start=$date_start;
|
||||
|
||||
@ -136,14 +136,14 @@ if ($socid > 0)
|
||||
|
||||
print "</table>";
|
||||
|
||||
print '<center>';
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
||||
if (! empty($backtopage))
|
||||
{
|
||||
print ' ';
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
}
|
||||
print '</center>';
|
||||
print '</div>';
|
||||
|
||||
print "</form>";
|
||||
|
||||
|
||||
@ -278,14 +278,14 @@ if ($socid > 0)
|
||||
|
||||
print "</table>";
|
||||
|
||||
print '<center>';
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" name="submit" value="'.$langs->trans("AddGlobalDiscount").'">';
|
||||
if (! empty($backtopage))
|
||||
{
|
||||
print ' ';
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
}
|
||||
print '</center>';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
|
||||
@ -3,7 +3,8 @@
|
||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2014 Frederic France <frederic.france@free.fr>
|
||||
*
|
||||
* 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
|
||||
@ -22,21 +23,17 @@
|
||||
/**
|
||||
* \file htdocs/commande/apercu.php
|
||||
* \ingroup commande
|
||||
* \brief Page de l'onglet apercu d'une commande
|
||||
* \brief Preview tab of order
|
||||
*/
|
||||
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
|
||||
if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
|
||||
if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
|
||||
$langs->load('orders');
|
||||
$langs->load('propal');
|
||||
$langs->load("bills");
|
||||
$langs->load('compta');
|
||||
$langs->load('sendings');
|
||||
|
||||
// Security check
|
||||
$socid=0;
|
||||
@ -47,19 +44,11 @@ $result=restrictedArea($user,'commande',$id,'');
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
* View Mode
|
||||
*/
|
||||
|
||||
llxHeader('',$langs->trans('Order'),'EN:Customers_Orders|FR:Commandes_Clients|ES:Pedidos de clientes');
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
/* *************************************************************************** */
|
||||
/* */
|
||||
/* Mode fiche */
|
||||
/* */
|
||||
/* *************************************************************************** */
|
||||
|
||||
if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
$object = new Commande($db);
|
||||
@ -70,40 +59,46 @@ if ($id > 0 || ! empty($ref))
|
||||
$soc->fetch($object->socid);
|
||||
|
||||
|
||||
$head = commande_prepare_head($object);
|
||||
$head = commande_prepare_head($object);
|
||||
dol_fiche_head($head, 'preview', $langs->trans("CustomerOrder"), 0, 'order');
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Ref
|
||||
print '<tr><td width="18%">'.$langs->trans("Ref")."</td>";
|
||||
print '<td colspan="2">'.$object->ref.'</td>';
|
||||
print '<td width="50%">'.$langs->trans("Source").' : '.$object->getLabelSource();
|
||||
if ($object->source == 0)
|
||||
{
|
||||
// Propale
|
||||
$propal = new Propal($db);
|
||||
$propal->fetch($object->propale_id);
|
||||
print ' -> <a href="'.DOL_URL_ROOT.'/comm/propal.php?id='.$propal->id.'">'.$propal->ref.'</a>';
|
||||
}
|
||||
print "</td></tr>";
|
||||
print '<tr><td width="25%">'.$langs->trans("Ref")."</td>";
|
||||
print '<td colspan="5">'.$object->ref.'</td></tr>';
|
||||
|
||||
// Ref cde client
|
||||
print '<tr><td>';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td class="nowrap">';
|
||||
print $langs->trans('RefCustomer').'</td><td align="left">';
|
||||
print '</td>';
|
||||
print '</tr></table>';
|
||||
print '</td>';
|
||||
print '<td colspan="2">';
|
||||
print $object->ref_client;
|
||||
print '</td>';
|
||||
$nbrow=6;
|
||||
print '<td rowspan="'.$nbrow.'" valign="top">';
|
||||
print '<tr><td>'.$langs->trans('RefCustomer').'</td>';
|
||||
print '<td colspan="5">'.$object->ref_client.'</td>';
|
||||
print '</tr>';
|
||||
|
||||
/*
|
||||
* Documents
|
||||
*/
|
||||
// Client
|
||||
print '<tr><td>'.$langs->trans("Customer").'</td>';
|
||||
print '<td colspan="5">'.$soc->getNomUrl(1).'</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Statut
|
||||
print '<tr><td>'.$langs->trans("Status").'</td>';
|
||||
print '<td colspan="5">'.$object->getLibStatut(4).'</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Discount - left part
|
||||
print '<tr><td>'.$langs->trans('Discounts').'</td>';
|
||||
print '<td colspan="5">'.$object->remise_percent.'%</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Date - left part
|
||||
print '<tr><td>'.$langs->trans("Date").'</td>';
|
||||
print '<td colspan="3">'.dol_print_date($object->date,"daytext").'</td>';
|
||||
|
||||
// Right part with $rowspan lines
|
||||
$rowspan=4;
|
||||
print '<td rowspan="'.$rowspan.'" valign="top" width="50%">';
|
||||
|
||||
/*
|
||||
* Documents
|
||||
*/
|
||||
$objectref = dol_sanitizeFileName($object->ref);
|
||||
$dir_output = $conf->commande->dir_output . "/";
|
||||
$filepath = $dir_output . $objectref . "/";
|
||||
@ -119,16 +114,16 @@ if ($id > 0 || ! empty($ref))
|
||||
|
||||
$var=true;
|
||||
|
||||
// Si fichier PDF existe
|
||||
// if PDF file exist
|
||||
if (file_exists($file))
|
||||
{
|
||||
$encfile = urlencode($file);
|
||||
print_titre($langs->trans("Documents"));
|
||||
print '<table class="border" width="100%">';
|
||||
print '<table class="nobordernopadding" width="100%">';
|
||||
print '<tr class="liste_titre"><td colspan="4">'.$langs->trans("Documents").'</td></tr>';
|
||||
|
||||
print "<tr ".$bc[$var]."><td>".$langs->trans("Order")." PDF</td>";
|
||||
|
||||
print '<td><a data-ajax="false" href="'.DOL_URL_ROOT . '/document.php?modulepart=commande&file='.urlencode($relativepath).'">'.$object->ref.'.pdf</a></td>';
|
||||
print '<td><a data-ajax="false" href="'.DOL_URL_ROOT . '/document.php?modulepart=commande&file='.urlencode($relativepath).'">'.$object->ref.'.pdf</a></td>';
|
||||
print '<td align="right">'.dol_print_size(dol_filesize($file)).'</td>';
|
||||
print '<td align="right">'.dol_print_date(dol_filemtime($file),'dayhour').'</td>';
|
||||
print '</tr>';
|
||||
@ -139,7 +134,7 @@ if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
print "<tr ".$bc[$var]."><td>Commande detaillee</td>";
|
||||
|
||||
print '<td><a data-ajax="false" href="'.DOL_URL_ROOT . '/document.php?modulepart=commande&file='.urlencode($relativepathdetail).'">'.$object->ref.'-detail.pdf</a></td>';
|
||||
print '<td><a data-ajax="false" href="'.DOL_URL_ROOT . '/document.php?modulepart=commande&file='.urlencode($relativepathdetail).'">'.$object->ref.'-detail.pdf</a></td>';
|
||||
print '<td align="right">'.dol_print_size(dol_filesize($filedetail)).'</td>';
|
||||
print '<td align="right">'.dol_print_date(dol_filemtime($filedetail),'dayhour').'</td>';
|
||||
print '</tr>';
|
||||
@ -162,37 +157,24 @@ if ($id > 0 || ! empty($ref))
|
||||
}
|
||||
}
|
||||
|
||||
print "</td></tr>";
|
||||
print '</td></tr>';
|
||||
|
||||
// Client
|
||||
print "<tr><td>".$langs->trans("Customer")."</td>";
|
||||
print '<td colspan="2">';
|
||||
print '<a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$soc->id.'">'.$soc->getNomUrl(1).'</a>';
|
||||
print '</td>';
|
||||
// Total HT - left part
|
||||
print '<tr><td>'.$langs->trans('AmountHT').'</td>';
|
||||
print '<td align="right" class="nowrap"><b>' . price($object->total_ht, '', $langs, 0, - 1, - 1, $conf->currency) . '</b></td>';
|
||||
print '</tr>';
|
||||
|
||||
// Statut
|
||||
print '<tr><td>'.$langs->trans("Status").'</td>';
|
||||
print "<td colspan=\"2\">".$object->getLibStatut(4)."</td>\n";
|
||||
// Total VAT - left part
|
||||
print '<tr><td>'.$langs->trans('AmountVAT').'</td>';
|
||||
print '<td align="right" class="nowrap"><b>' . price($object->total_tva, '', $langs, 0, - 1, - 1, $conf->currency) . '</b></td>';
|
||||
print '</tr>';
|
||||
|
||||
// Date
|
||||
print '<tr><td>'.$langs->trans("Date").'</td>';
|
||||
print "<td colspan=\"2\">".dol_print_date($object->date,"daytext")."</td>\n";
|
||||
print '</tr>';
|
||||
// Total TTC - left part
|
||||
print '<tr><td>'.$langs->trans('AmountTTC').'</td>';
|
||||
print '<td align="right" class="nowrap"><b>' . price($object->total_ttc, '', $langs, 0, - 1, - 1, $conf->currency) . '</b></td>';
|
||||
print '</tr>';
|
||||
|
||||
// ligne 6
|
||||
// partie Gauche
|
||||
print '<tr><td height="10" nowrap>'.$langs->trans('GlobalDiscount').'</td>';
|
||||
print '<td colspan="2">'.$object->remise_percent.'%</td>';
|
||||
print '</tr>';
|
||||
|
||||
// ligne 7
|
||||
// partie Gauche
|
||||
print '<tr><td height="10">'.$langs->trans('AmountHT').'</td>';
|
||||
print '<td align="right" colspan="1"><b>'.price($object->total_ht).'</b></td>';
|
||||
print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>';
|
||||
print '</table>';
|
||||
print '</table>';
|
||||
|
||||
dol_fiche_end();
|
||||
}
|
||||
@ -203,10 +185,13 @@ if ($id > 0 || ! empty($ref))
|
||||
}
|
||||
}
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tr><td>';
|
||||
print '<div class="photolist">';
|
||||
// Si fichier png PDF d'1 page trouve
|
||||
if (file_exists($fileimage))
|
||||
{
|
||||
print '<img style="background: #FFF" src="'.DOL_URL_ROOT . '/viewimage.php?modulepart=apercucommande&file='.urlencode($relativepathimage).'">';
|
||||
print '<img class="photo photowithmargin" src="'.DOL_URL_ROOT . '/viewimage.php?modulepart=apercucommande&file='.urlencode($relativepathimage).'">';
|
||||
}
|
||||
// Si fichier png PDF de plus d'1 page trouve
|
||||
elseif (file_exists($fileimagebis))
|
||||
@ -219,10 +204,13 @@ elseif (file_exists($fileimagebis))
|
||||
|
||||
if (file_exists($dir_output.$preview))
|
||||
{
|
||||
print '<img style="background: #FFF" src="'.DOL_URL_ROOT . '/viewimage.php?modulepart=apercucommande&file='.urlencode($preview).'"><p>';
|
||||
print '<img class="photo photowithmargin" src="'.DOL_URL_ROOT . '/viewimage.php?modulepart=apercucommande&file='.urlencode($preview).'"><p>';
|
||||
}
|
||||
}
|
||||
}
|
||||
print '</div>';
|
||||
print '</td></tr>';
|
||||
print '</table>';
|
||||
|
||||
|
||||
llxFooter();
|
||||
|
||||
@ -1391,10 +1391,13 @@ if ($action == 'create' && $user->rights->commande->creer) {
|
||||
print '</td></tr>';
|
||||
|
||||
// Bank Account
|
||||
print '<tr><td>' . $langs->trans('BankAccount') . '</td><td colspan="2">';
|
||||
$form->select_comptes($fk_account, 'fk_account', 0, '', 1);
|
||||
print '</td></tr>';
|
||||
|
||||
if (! empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_ORDER) && ! empty($conf->banque->enabled))
|
||||
{
|
||||
print '<tr><td>' . $langs->trans('BankAccount') . '</td><td colspan="2">';
|
||||
$form->select_comptes($fk_account, 'fk_account', 0, '', 1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Delivery delay
|
||||
print '<tr><td>' . $langs->trans('AvailabilityPeriod') . '</td><td colspan="2">';
|
||||
$form->selectAvailabilityDelay($availability_id, 'availability_id', '', 1);
|
||||
@ -1530,7 +1533,7 @@ if ($action == 'create' && $user->rights->commande->creer) {
|
||||
print '</table>';
|
||||
|
||||
// Button "Create Draft"
|
||||
print '<br><center><input type="submit" class="button" name="bouton" value="' . $langs->trans('CreateDraft') . '"></center>';
|
||||
print '<br><div class="center"><input type="submit" class="button" name="bouton" value="' . $langs->trans('CreateDraft') . '"></div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
@ -1995,22 +1998,25 @@ if ($action == 'create' && $user->rights->commande->creer) {
|
||||
$rowspan ++;
|
||||
|
||||
// Bank Account
|
||||
print '<tr><td class="nowrap">';
|
||||
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
|
||||
print $langs->trans('BankAccount');
|
||||
print '<td>';
|
||||
if ($action != 'editbankaccount' && $user->rights->commande->creer)
|
||||
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'),1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="3">';
|
||||
if ($action == 'editbankaccount') {
|
||||
$form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'fk_account', 1);
|
||||
} else {
|
||||
$form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'none');
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
if (! empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_ORDER) && ! empty($conf->banque->enabled))
|
||||
{
|
||||
print '<tr><td class="nowrap">';
|
||||
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
|
||||
print $langs->trans('BankAccount');
|
||||
print '<td>';
|
||||
if ($action != 'editbankaccount' && $user->rights->commande->creer)
|
||||
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'),1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="3">';
|
||||
if ($action == 'editbankaccount') {
|
||||
$form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'fk_account', 1);
|
||||
} else {
|
||||
$form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'none');
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
// Total HT
|
||||
print '<tr><td>' . $langs->trans('AmountHT') . '</td>';
|
||||
print '<td align="right">' . price($object->total_ht, 1, '', 1, - 1, - 1, $conf->currency) . '</td>';
|
||||
|
||||
@ -1224,7 +1224,15 @@ class Commande extends CommonOrder
|
||||
$this->line->date_end=$date_end;
|
||||
|
||||
// infos marge
|
||||
$this->line->fk_fournprice = $fk_fournprice;
|
||||
if (!empty($fk_product) && empty($fk_fournprice) && empty($pa_ht)) {
|
||||
// by external module, take lowest buying price
|
||||
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
|
||||
$productFournisseur = new ProductFournisseur($this->db);
|
||||
$productFournisseur->find_min_price_product_fournisseur($fk_product);
|
||||
$this->line->fk_fournprice = $productFournisseur->product_fourn_price_id;
|
||||
} else {
|
||||
$this->line->fk_fournprice = $fk_fournprice;
|
||||
}
|
||||
$this->line->pa_ht = $pa_ht;
|
||||
|
||||
// TODO Ne plus utiliser
|
||||
@ -2421,7 +2429,15 @@ class Commande extends CommonOrder
|
||||
$this->line->skip_update_total=$skip_update_total;
|
||||
|
||||
// infos marge
|
||||
$this->line->fk_fournprice = $fk_fournprice;
|
||||
if (!empty($fk_product) && empty($fk_fournprice) && empty($pa_ht)) {
|
||||
//by external module, take lowest buying price
|
||||
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
|
||||
$productFournisseur = new ProductFournisseur($this->db);
|
||||
$productFournisseur->find_min_price_product_fournisseur($fk_product);
|
||||
$this->line->fk_fournprice = $productFournisseur->product_fourn_price_id;
|
||||
} else {
|
||||
$this->line->fk_fournprice = $fk_fournprice;
|
||||
}
|
||||
$this->line->pa_ht = $pa_ht;
|
||||
|
||||
// TODO deprecated
|
||||
|
||||
@ -496,7 +496,7 @@ if ($action == 'create' && !$error)
|
||||
}
|
||||
|
||||
// Button "Create Draft"
|
||||
print '<br><center><input type="submit" class="button" name="bouton" value="'.$langs->trans('CreateDraft').'" /></center>';
|
||||
print '<br><div class="center"><input type="submit" class="button" name="bouton" value="'.$langs->trans('CreateDraft').'" /></div>';
|
||||
print "</form>\n";
|
||||
|
||||
print '</td></tr>';
|
||||
@ -683,7 +683,7 @@ if (($action != 'create' && $action != 'add') || !$error)
|
||||
/*
|
||||
* Boutons actions
|
||||
*/
|
||||
print '<center><br><input type="checkbox" checked="checked" name="autocloseorders"> '.$langs->trans("CloseProcessedOrdersAutomatically");
|
||||
print '<br><div class="center"><input type="checkbox" checked="checked" name="autocloseorders"> '.$langs->trans("CloseProcessedOrdersAutomatically");
|
||||
print '<div align="right">';
|
||||
print '<input type="hidden" name="socid" value="'.$socid.'">';
|
||||
print '<input type="hidden" name="action" value="create">';
|
||||
@ -691,6 +691,7 @@ if (($action != 'create' && $action != 'add') || !$error)
|
||||
//print '<a class="butAction" href="index.php">'.$langs->trans("GoBack").'</a>';
|
||||
print '<input type="submit" class="butAction" value="'.$langs->trans("GenerateBill").'">';
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
print '</form>';
|
||||
$db->free($resql);
|
||||
}
|
||||
|
||||
@ -496,11 +496,11 @@ else
|
||||
unset($tblyear[1]);
|
||||
unset($tblyear[2]);
|
||||
|
||||
print '<div class="fichecenter"><div class="fichehalfleft"><center>';
|
||||
print '<div class="fichecenter"><div class="fichehalfleft"><div class="center">';
|
||||
print $show1;
|
||||
print '</center></div><div class="fichehalfright"><div class="ficheaddleft"><center>';
|
||||
print '</div></div><div class="fichehalfright"><div class="ficheaddleft"><div class="center">';
|
||||
print $show2;
|
||||
print '</center></div></div></div>';
|
||||
print '</div></div></div></div>';
|
||||
print '<div style="clear:both"></div>';
|
||||
}
|
||||
|
||||
|
||||
@ -354,7 +354,7 @@ if ($action == 'create')
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '<center><br><input value="'.$langs->trans("CreateAccount").'" type="submit" class="button"></center>';
|
||||
print '<br><div class="center"><input value="'.$langs->trans("CreateAccount").'" type="submit" class="button"></div>';
|
||||
|
||||
print '</form>';
|
||||
}
|
||||
@ -647,8 +647,11 @@ else
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '<center><br><input value="'.$langs->trans("Modify").'" type="submit" class="button">';
|
||||
print ' <input name="cancel" value="'.$langs->trans("Cancel").'" type="submit" class="button"></center>';
|
||||
print '<br><div class="center">';
|
||||
print '<input value="'.$langs->trans("Modify").'" type="submit" class="button">';
|
||||
print ' ';
|
||||
print '<input name="cancel" value="'.$langs->trans("Cancel").'" type="submit" class="button">';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
@ -220,7 +220,7 @@ class Account extends CommonObject
|
||||
/**
|
||||
* Add an entry into table ".MAIN_DB_PREFIX."bank
|
||||
*
|
||||
* @param timsestmap $date Date operation
|
||||
* @param timestamp $date Date operation
|
||||
* @param string $oper 1,2,3,4... (deprecated) or TYP,VIR,PRE,LIQ,VAD,CB,CHQ...
|
||||
* @param string $label Descripton
|
||||
* @param float $amount Amount
|
||||
|
||||
@ -182,7 +182,7 @@ print '<td><input name="amount" class="flat" type="text" size="8" value="'.$amou
|
||||
|
||||
print "</table>";
|
||||
|
||||
print '<br><center><input type="submit" class="button" value="'.$langs->trans("Add").'"></center>';
|
||||
print '<br><div class="center"><input type="submit" class="button" value="'.$langs->trans("Add").'"></div>';
|
||||
|
||||
print "</form>";
|
||||
|
||||
|
||||
@ -303,8 +303,11 @@ if ($action == 'create')
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '<br><center><input class="button" type="submit" value="'.$langs->trans("Save").'"> ';
|
||||
print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'"></center';
|
||||
print '<br><div class="center">';
|
||||
print '<input class="button" type="submit" value="'.$langs->trans("Save").'">';
|
||||
print ' ';
|
||||
print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
}
|
||||
@ -396,9 +399,11 @@ else if ($id)
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '<br><center><input type="submit" class="button" value="'.$langs->trans("Save").'"> ';
|
||||
print '<br><div class="center">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">';
|
||||
print ' ';
|
||||
print '<input type="submit" name="cancel" class="button" value="'.$langs->trans("Cancel").'">';
|
||||
print '</center>';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
|
||||
@ -76,7 +76,7 @@ if ($action == 'update')
|
||||
|
||||
if (empty($amount))
|
||||
{
|
||||
$setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Amount")), 'errors');
|
||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Amount")), 'errors');
|
||||
$action = "create";
|
||||
$error++;
|
||||
}
|
||||
@ -329,7 +329,7 @@ if ($action == 'create')
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$don,$action); // Note that $action and $object may have been modified by hook
|
||||
|
||||
print "</table>\n";
|
||||
print '<br><center><input type="submit" class="button" name="save" value="'.$langs->trans("Save").'"> <input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></center>';
|
||||
print '<br><div class="center"><input type="submit" class="button" name="save" value="'.$langs->trans("Save").'"> <input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></div>';
|
||||
print "</form>\n";
|
||||
}
|
||||
|
||||
@ -429,7 +429,7 @@ if (! empty($id) && $action == 'edit')
|
||||
|
||||
print "</table>\n";
|
||||
|
||||
print '<br><center><input type="submit" class="button" name="save" value="'.$langs->trans("Save").'"> <input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></center>';
|
||||
print '<br><div class="center"><input type="submit" class="button" name="save" value="'.$langs->trans("Save").'"> <input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></div>';
|
||||
|
||||
print "</form>\n";
|
||||
|
||||
|
||||
@ -2275,10 +2275,11 @@ if ($action == 'create')
|
||||
print "</table>\n";
|
||||
|
||||
// Button "Create Draft"
|
||||
print '<br><center>';
|
||||
print '<br><div class="center">';
|
||||
print '<input type="submit" class="button" name="bouton" value="' . $langs->trans('CreateDraft') . '">';
|
||||
print ' <input type="button" class="button" value="' . $langs->trans("Cancel") . '" onClick="javascript:history.go(-1)">';
|
||||
print '</center>';
|
||||
print ' ';
|
||||
print '<input type="button" class="button" value="' . $langs->trans("Cancel") . '" onClick="javascript:history.go(-1)">';
|
||||
print '</div>';
|
||||
|
||||
print "</form>\n";
|
||||
|
||||
@ -3486,7 +3487,7 @@ if ($action == 'create')
|
||||
$i ++;
|
||||
}
|
||||
print '</table>';
|
||||
print '<br><center><input type="submit" class="button" value="' . $langs->trans('ToLink') . '"> <input type="submit" class="button" name="cancel" value="' . $langs->trans('Cancel') . '"></center>';
|
||||
print '<br><div class="center"><input type="submit" class="button" value="' . $langs->trans('ToLink') . '"> <input type="submit" class="button" name="cancel" value="' . $langs->trans('Cancel') . '"></div>';
|
||||
print '</form>';
|
||||
$db->free($resqlorderlist);
|
||||
} else {
|
||||
|
||||
@ -3,7 +3,8 @@
|
||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2014 Frederic France <frederic.france@free.fr>
|
||||
*
|
||||
* 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
|
||||
@ -21,9 +22,9 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/compta/facture/apercu.php
|
||||
* \ingroup facture
|
||||
* \brief Page de l'onglet apercu d'une facture
|
||||
* \file htdocs/compta/facture/apercu.php
|
||||
* \ingroup facture
|
||||
* \brief Preview Tab of invoice
|
||||
*/
|
||||
|
||||
require '../../main.inc.php';
|
||||
@ -67,12 +68,6 @@ if ($id > 0 || ! empty($ref))
|
||||
$soc = new Societe($db);
|
||||
$soc->fetch($object->socid);
|
||||
|
||||
$author = new User($db);
|
||||
if ($object->user_author)
|
||||
{
|
||||
$author->fetch($object->user_author);
|
||||
}
|
||||
|
||||
$head = facture_prepare_head($object);
|
||||
dol_fiche_head($head, 'preview', $langs->trans("InvoiceCustomer"), 0, 'bill');
|
||||
|
||||
@ -80,32 +75,28 @@ if ($id > 0 || ! empty($ref))
|
||||
$totalpaye = $object->getSommePaiement();
|
||||
|
||||
/*
|
||||
* Facture
|
||||
* Invoice
|
||||
*/
|
||||
print '<table class="border" width="100%">';
|
||||
$rowspan=3;
|
||||
|
||||
// Ref
|
||||
print '<tr><td width="20%">'.$langs->trans('Ref').'</td><td colspan="5">'.$object->ref.'</td></tr>';
|
||||
print '<tr><td width="25%">'.$langs->trans('Ref').'</td>';
|
||||
print '<td colspan="5">'.$object->ref.'</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Ref customer
|
||||
print '<tr><td width="20%">';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
print $langs->trans('RefCustomer');
|
||||
print '</td>';
|
||||
print '</tr></table>';
|
||||
print '</td>';
|
||||
print '<td colspan="5">';
|
||||
print $object->ref_client;
|
||||
print '</td></tr>';
|
||||
print '<tr><td>'.$langs->trans('RefCustomer').'</td>';
|
||||
print '<td colspan="5">'.$object->ref_client.'</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Societe
|
||||
// Thirdparty
|
||||
print '<tr><td>'.$langs->trans("Company").'</td>';
|
||||
print '<td colspan="5">'.$soc->getNomUrl(1,'compta').'</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Type
|
||||
print '<tr><td>'.$langs->trans('Type').'</td><td colspan="5">';
|
||||
print '<tr><td>'.$langs->trans('Type').'</td>';
|
||||
print '<td colspan="5">';
|
||||
print $object->getLibType();
|
||||
if ($object->type == Facture::TYPE_REPLACEMENT)
|
||||
{
|
||||
@ -141,14 +132,15 @@ if ($id > 0 || ! empty($ref))
|
||||
$facthatreplace->fetch($objectidnext);
|
||||
print ' ('.$langs->transnoentities("ReplacedByInvoice",$facthatreplace->getNomUrl(1)).')';
|
||||
}
|
||||
print '</td></tr>';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Relative and absolute discounts
|
||||
$addabsolutediscount=' <a href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$soc->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"]).'?facid='.$object->id.'">'.$langs->trans("AddGlobalDiscount").'</a>';
|
||||
$addcreditnote=' <a href="'.DOL_URL_ROOT.'/compta/facture.php?action=create&socid='.$soc->id.'&type=2&backtopage='.urlencode($_SERVER["PHP_SELF"]).'?facid='.$object->id.'">'.$langs->trans("AddCreditNote").'</a>';
|
||||
|
||||
print '<tr><td>'.$langs->trans('Discounts');
|
||||
print '</td><td colspan="5">';
|
||||
print '<tr><td>'.$langs->trans('Discounts').'</td>';
|
||||
print '<td colspan="5">';
|
||||
if ($soc->remise_percent) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_percent);
|
||||
else print $langs->trans("CompanyHasNoRelativeDiscount");
|
||||
|
||||
@ -187,7 +179,7 @@ if ($id > 0 || ! empty($ref))
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($absolute_creditnote > 0) // If not linke will be added later
|
||||
if ($absolute_creditnote > 0) // If not linked will be added later
|
||||
{
|
||||
if ($object->statut == 0 && $object->type != Facture::TYPE_CREDIT_NOTE && $object->type != Facture::TYPE_DEPOSIT) print ' - '.$addabsolutediscount.'<br>';
|
||||
else print '.';
|
||||
@ -230,66 +222,17 @@ if ($id > 0 || ! empty($ref))
|
||||
print $addabsolutediscount;
|
||||
//print ' - '.$addcreditnote; // We disbale link to credit note
|
||||
}*/
|
||||
print '</td></tr>';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Dates
|
||||
print '<tr><td>'.$langs->trans("Date").'</td>';
|
||||
print '<td colspan="5">'.dol_print_date($object->date,"daytext").'</td>';
|
||||
print "</tr>";
|
||||
print '<td>'.dol_print_date($object->date,"daytext").'</td>';
|
||||
|
||||
// Date payment term
|
||||
print '<tr><td>';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
print $langs->trans('DateMaxPayment');
|
||||
print '</td>';
|
||||
if ($object->type != Facture::TYPE_CREDIT_NOTE && $action != 'editpaymentterm' && $object->brouillon && $user->rights->facture->creer) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editpaymentterm&facid='.$object->id.'">'.img_edit($langs->trans('SetDate'),1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="5">';
|
||||
if ($object->type != Facture::TYPE_CREDIT_NOTE)
|
||||
{
|
||||
if ($action == 'editpaymentterm')
|
||||
{
|
||||
$form->form_date($_SERVER['PHP_SELF'].'?facid='.$object->id,$object->date_lim_reglement,'paymentterm');
|
||||
}
|
||||
else
|
||||
{
|
||||
print dol_print_date($object->date_lim_reglement,'daytext');
|
||||
if ($object->date_lim_reglement < ($now - $conf->facture->client->warning_delay) && ! $object->paye && $object->statut == 1 && ! $object->am) print img_warning($langs->trans('Late'));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print ' ';
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Conditions reglement
|
||||
print '<tr><td>'.$langs->trans("PaymentConditionsShort").'</td><td colspan="5">';
|
||||
$form->form_conditions_reglement($_SERVER["PHP_SELF"]."?facid=$object->id",$object->cond_reglement_id,"none");
|
||||
print '</td>';
|
||||
print '</td></tr>';
|
||||
|
||||
// Mode de reglement
|
||||
print '<tr><td>';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
print $langs->trans('PaymentMode');
|
||||
print '</td>';
|
||||
if ($action != 'editmode' && $object->brouillon && $user->rights->facture->creer) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editmode&facid='.$object->id.'">'.img_edit($langs->trans('SetMode'),1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="3">';
|
||||
if ($action == 'editmode')
|
||||
{
|
||||
$form->form_modes_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id,$object->mode_reglement_id,'mode_reglement_id');
|
||||
}
|
||||
else
|
||||
{
|
||||
$form->form_modes_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id,$object->mode_reglement_id,'none');
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
$nbrows=5;
|
||||
if (! empty($conf->projet->enabled)) $nbrows++;
|
||||
print '<td rowspan="'.$nbrows.'" colspan="2" valign="top">';
|
||||
// Right part with $rowspan lines
|
||||
$rowspan=5;
|
||||
if (! empty($conf->projet->enabled)) $rowspan++;
|
||||
print '<td rowspan="'.$rowspan.'" valign="top" width="50%">';
|
||||
|
||||
/*
|
||||
* Documents
|
||||
@ -303,7 +246,7 @@ if ($id > 0 || ! empty($ref))
|
||||
$relativepathdetail = $objectref.'/'.$objectref.'-detail.pdf';
|
||||
|
||||
// Define path to preview pdf file (preview precompiled "file.ext" are "file.ext_preview.png")
|
||||
$fileimage = $file.'_preview.png'; // If PDF has 1 page
|
||||
$fileimage = $file.'_preview.png'; // If PDF has 1 page
|
||||
$fileimagebis = $file.'_preview-0.pdf.png'; // If PDF has more than one page
|
||||
$relativepathimage = $relativepath.'_preview.png';
|
||||
|
||||
@ -313,8 +256,8 @@ if ($id > 0 || ! empty($ref))
|
||||
if (file_exists($file))
|
||||
{
|
||||
$encfile = urlencode($file);
|
||||
print_titre($langs->trans("Documents"));
|
||||
print '<table class="border" width="100%">';
|
||||
print '<table class="nobordernopadding" width="100%">';
|
||||
print '<tr class="liste_titre"><td colspan="4">'.$langs->trans("Documents").'</td></tr>';
|
||||
|
||||
print "<tr ".$bc[$var]."><td>".$langs->trans("Bill")." PDF</td>";
|
||||
|
||||
@ -353,24 +296,32 @@ if ($id > 0 || ! empty($ref))
|
||||
}
|
||||
print "</td></tr>";
|
||||
|
||||
// Total HT
|
||||
print '<tr><td>'.$langs->trans("AmountHT").'</td>';
|
||||
print '<td align="right" colspan="2"><b>'.price($object->total_ht).'</b></td>';
|
||||
print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>';
|
||||
print '<td align="right" class="nowrap"><b>' . price($object->total_ht, '', $langs, 0, - 1, - 1, $conf->currency) . '</b></td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans('AmountVAT').'</td><td align="right" colspan="2" nowrap>'.price($object->total_tva).'</td>';
|
||||
print '<td>'.$langs->trans('Currency'.$conf->currency).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans('AmountTTC').'</td><td align="right" colspan="2" nowrap>'.price($object->total_ttc).'</td>';
|
||||
print '<td>'.$langs->trans('Currency'.$conf->currency).'</td></tr>';
|
||||
// Total VAT
|
||||
print '<tr><td>'.$langs->trans('AmountVAT').'</td>';
|
||||
print '<td align="right" class="nowrap"><b>' . price($object->total_tva, '', $langs, 0, - 1, - 1, $conf->currency) . '</b></td>';
|
||||
print '</tr>';
|
||||
|
||||
// Total TTC
|
||||
print '<tr><td>'.$langs->trans('AmountTTC').'</td>';
|
||||
print '<td align="right" class="nowrap"><b>' . price($object->total_ttc, '', $langs, 0, - 1, - 1, $conf->currency) . '</b></td>';
|
||||
print '</tr>';
|
||||
|
||||
// Statut
|
||||
print '<tr><td>'.$langs->trans('Status').'</td><td align="left" colspan="3">'.($object->getLibStatut(4,$totalpaye)).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans('Status').'</td>';
|
||||
print '<td align="left">'.($object->getLibStatut(4,$totalpaye)).'</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Projet
|
||||
if (! empty($conf->projet->enabled))
|
||||
{
|
||||
$langs->load("projects");
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans("Project").'</td><td colspan="3">';
|
||||
print '<tr><td>'.$langs->trans("Project").'</td>';
|
||||
print '<td>';
|
||||
if ($object->fk_project > 0)
|
||||
{
|
||||
$project = New Project($db);
|
||||
@ -391,14 +342,17 @@ if ($id > 0 || ! empty($ref))
|
||||
else
|
||||
{
|
||||
// Facture non trouvee
|
||||
print $langs->trans("ErrorBillNotFound",$_GET["facid"]);
|
||||
print $langs->trans("ErrorBillNotFound",$id);
|
||||
}
|
||||
}
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tr><td>';
|
||||
print '<div class="photolist">';
|
||||
// Si fichier png PDF d'1 page trouve
|
||||
if (file_exists($fileimage))
|
||||
{
|
||||
print '<img style="background: #FFF" src="'.DOL_URL_ROOT . '/viewimage.php?modulepart=apercufacture&file='.urlencode($relativepathimage).'">';
|
||||
print '<img class="photo photowithmargin" src="'.DOL_URL_ROOT . '/viewimage.php?modulepart=apercufacture&file='.urlencode($relativepathimage).'">';
|
||||
}
|
||||
// Si fichier png PDF de plus d'1 page trouve
|
||||
elseif (file_exists($fileimagebis))
|
||||
@ -411,11 +365,13 @@ elseif (file_exists($fileimagebis))
|
||||
|
||||
if (file_exists($dir_output.$preview))
|
||||
{
|
||||
print '<img style="background: #FFF" src="'.DOL_URL_ROOT . '/viewimage.php?modulepart=apercufacture&file='.urlencode($preview).'"><p>';
|
||||
print '<img class="photo photowithmargin" src="'.DOL_URL_ROOT . '/viewimage.php?modulepart=apercufacture&file='.urlencode($preview).'"><p>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
print '</div>';
|
||||
print '</td></tr>';
|
||||
print '</table>';
|
||||
|
||||
llxFooter();
|
||||
|
||||
|
||||
@ -1600,7 +1600,7 @@ class Facture extends CommonInvoice
|
||||
*
|
||||
* @param User $user Object user that validate
|
||||
* @param string $force_number Reference to force on invoice
|
||||
* @param int $idwarehouse Id of warehouse to use for stock decrease
|
||||
* @param int $idwarehouse Id of warehouse to use for stock decrease if option to decreasenon stock is on (0=no decrease)
|
||||
* @param int $notrigger 1=Does not execute triggers, 0= execuete triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
@ -1728,7 +1728,7 @@ class Facture extends CommonInvoice
|
||||
$result=$this->client->set_as_client();
|
||||
|
||||
// Si active on decremente le produit principal et ses composants a la validation de facture
|
||||
if ($this->type != self::TYPE_DEPOSIT && $result >= 0 && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_BILL))
|
||||
if ($this->type != self::TYPE_DEPOSIT && $result >= 0 && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_BILL) && $idwarehouse > 0)
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
|
||||
$langs->load("agenda");
|
||||
@ -2203,7 +2203,15 @@ class Facture extends CommonInvoice
|
||||
$this->line->skip_update_total = $skip_update_total;
|
||||
|
||||
// infos marge
|
||||
$this->line->fk_fournprice = $fk_fournprice;
|
||||
if (!empty($fk_product) && empty($fk_fournprice) && empty($pa_ht)) {
|
||||
// POS or external module, take lowest buying price
|
||||
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
|
||||
$productFournisseur = new ProductFournisseur($this->db);
|
||||
$productFournisseur->find_min_price_product_fournisseur($fk_product);
|
||||
$this->line->fk_fournprice = $productFournisseur->product_fourn_price_id;
|
||||
} else {
|
||||
$this->line->fk_fournprice = $fk_fournprice;
|
||||
}
|
||||
$this->line->pa_ht = $pa_ht;
|
||||
|
||||
if (is_array($array_option) && count($array_option)>0) {
|
||||
@ -3498,6 +3506,14 @@ class FactureLigne extends CommonInvoiceLine
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
// POS or by external module, take lowest buying price
|
||||
if (!empty($this->fk_product) && empty($this->fk_fournprice) && empty($this->pa_ht)) {
|
||||
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
|
||||
$productFournisseur = new ProductFournisseur($this->db);
|
||||
$productFournisseur->find_min_price_product_fournisseur($this->fk_product);
|
||||
$this->fk_fournprice = $productFournisseur->product_fourn_price_id;
|
||||
}
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
|
||||
@ -678,7 +678,7 @@ if (! empty($conf->facture->enabled) && ! empty($conf->commande->enabled) && $us
|
||||
$societestatic->name=$obj->name;
|
||||
$societestatic->client=1;
|
||||
print $societestatic->getNomUrl(1,'customer',44);
|
||||
print '</a></td>';
|
||||
print '</td>';
|
||||
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($obj->total_ht).'</td>';
|
||||
print '<td align="right">'.price($obj->total_ttc).'</td>';
|
||||
print '<td align="right">'.price($obj->total_ttc-$obj->tot_fttc).'</td>';
|
||||
@ -777,7 +777,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
|
||||
$societestatic->name=$obj->name;
|
||||
$societestatic->client=1;
|
||||
print $societestatic->getNomUrl(1,'customer',44);
|
||||
print '</a></td>';
|
||||
print '</td>';
|
||||
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($obj->total).'</td>';
|
||||
print '<td align="right">'.price($obj->total_ttc).'</td>';
|
||||
print '<td align="right">'.price($obj->am).'</td>';
|
||||
|
||||
@ -190,8 +190,11 @@ if ($_GET["action"] == 'create')
|
||||
|
||||
print "<br>";
|
||||
|
||||
print '<center><input type="submit" class="button" value="'.$langs->trans("Save").'"> ';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></center>';
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">';
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
@ -626,7 +626,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
$buttontitle=$langs->trans('ToMakePayment');
|
||||
if ($facture->type == 2) $buttontitle=$langs->trans('ToMakePaymentBack');
|
||||
|
||||
print '<center><br>';
|
||||
print '<br><div class="center">';
|
||||
print '<input type="checkbox" checked="checked" name="closepaidinvoices"> '.$checkboxlabel;
|
||||
/*if (! empty($conf->prelevement->enabled))
|
||||
{
|
||||
@ -634,7 +634,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
if (! empty($conf->global->WITHDRAW_DISABLE_AUTOCREATE_ONPAYMENTS)) print '<br>'.$langs->trans("IfInvoiceNeedOnWithdrawPaymentWontBeClosed");
|
||||
}*/
|
||||
print '<br><input type="submit" class="button" value="'.dol_escape_htmltag($buttontitle).'"><br><br>';
|
||||
print '</center>';
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
// Form to confirm payment
|
||||
|
||||
@ -358,14 +358,14 @@ if ($action == 'new')
|
||||
print $form->select_comptes($filteraccountid,'accountid',0,'courant <> 2',1);
|
||||
print '</td></tr>';
|
||||
print '</table>';
|
||||
print '<center>';
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" name="filter" value="'.dol_escape_htmltag($langs->trans("ToFilter")).'">';
|
||||
if ($filterdate || $filteraccountid > 0)
|
||||
{
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" name="removefilter" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
||||
}
|
||||
print '</center>';
|
||||
print '</div>';
|
||||
//print '</fieldset>';
|
||||
print '</form>';
|
||||
print '<br>';
|
||||
|
||||
@ -312,13 +312,11 @@ if ($_GET["action"] == 'create')
|
||||
|
||||
print "</table>";
|
||||
|
||||
print '<br><center>';
|
||||
|
||||
print '<br><div class="center">';
|
||||
print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
|
||||
print ' ';
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
|
||||
print '</center>';
|
||||
print '</div>';
|
||||
|
||||
print "</form>\n";
|
||||
}
|
||||
|
||||
@ -218,7 +218,7 @@ if ($id > 0)
|
||||
print '<input class="flat" type="file" name="userfile"><br>';
|
||||
print '</td></tr>';*/
|
||||
print '</table><br>';
|
||||
print '<center><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("SetToStatusSent")).'">';
|
||||
print '<div class="center"><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("SetToStatusSent")).'"></div>';
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
@ -235,7 +235,7 @@ if ($id > 0)
|
||||
print '</td></tr>';
|
||||
print '</table>';
|
||||
print '<br>'.$langs->trans("ThisWillAlsoAddPaymentOnInvoice");
|
||||
print '<center><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("ClassCredited")).'">';
|
||||
print '<div class="center"><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("ClassCredited")).'"></div>';
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
|
||||
@ -216,7 +216,7 @@ if ($id)
|
||||
print '</table><br>';
|
||||
|
||||
//Confirm Button
|
||||
print '<center><input type="submit" class="button" value='.$langs->trans("Confirm").'><center>';
|
||||
print '<div class="center"><input type="submit" class="button" value='.$langs->trans("Confirm").'></div>';
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
|
||||
@ -274,8 +274,11 @@ if ($action == 'create')
|
||||
|
||||
print "<br>";
|
||||
|
||||
print '<center><input type="submit" class="button" value="'.$langs->trans("Save").'"> ';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></center>';
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">';
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
@ -230,8 +230,11 @@ if ($action == 'create')
|
||||
|
||||
print "<br>";
|
||||
|
||||
print '<center><input type="submit" class="button" value="'.$langs->trans("Save").'"> ';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></center>';
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">';
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
@ -614,14 +614,14 @@ else
|
||||
print "</table><br><br>";
|
||||
|
||||
|
||||
print '<center>';
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" name="add" value="'.$langs->trans("Add").'">';
|
||||
if (! empty($backtopage))
|
||||
{
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
}
|
||||
print '</center>';
|
||||
print '</div>';
|
||||
|
||||
print "</form>";
|
||||
}
|
||||
@ -858,11 +858,11 @@ else
|
||||
|
||||
print '</table><br>';
|
||||
|
||||
print '<center>';
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
|
||||
print ' ';
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
print '</center>';
|
||||
print '</div>';
|
||||
|
||||
print "</form>";
|
||||
}
|
||||
|
||||
@ -145,11 +145,11 @@ if ($action == 'edit')
|
||||
|
||||
print "</table><br>";
|
||||
|
||||
print '<center>';
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
|
||||
print ' ';
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
print '</center>';
|
||||
print '</div>';
|
||||
|
||||
print "</form>";
|
||||
}
|
||||
|
||||
@ -536,10 +536,10 @@ else if ($action == 'addline' && $user->rights->contrat->creer)
|
||||
$outputlangs = new Translate("", $conf);
|
||||
$outputlangs->setDefaultLang($newlang);
|
||||
}
|
||||
$model=$object->modelpdf;
|
||||
if (empty($model)) { $tmp=getListOfModels($db, 'contract'); $keys=array_keys($tmp); $model=$keys[0]; }
|
||||
|
||||
$ret = $object->fetch($id); // Reload to get new records
|
||||
$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
|
||||
$object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
}
|
||||
|
||||
unset($_POST ['prod_entry_mode']);
|
||||
@ -1026,7 +1026,7 @@ if ($action == 'create')
|
||||
print '<input type="hidden" name="originid" value="'.$objectsrc->id.'">';
|
||||
}
|
||||
|
||||
print '<br><center><input type="submit" class="button" value="'.$langs->trans("Create").'"></center>';
|
||||
print '<br><div class="center"><input type="submit" class="button" value="'.$langs->trans("Create").'"></div>';
|
||||
|
||||
print "</form>\n";
|
||||
|
||||
|
||||
@ -2385,39 +2385,4 @@ class ContratLigne extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a contract document on disk using template defined into CONTRACT_ADDON_PDF
|
||||
*
|
||||
* @param string $modele force le modele a utiliser ('' par defaut)
|
||||
* @param Translate $outputlangs objet lang a utiliser pour traduction
|
||||
* @param int $hidedetails Hide details of lines
|
||||
* @param int $hidedesc Hide description
|
||||
* @param int $hideref Hide ref
|
||||
* @return int 0 if KO, 1 if OK
|
||||
*/
|
||||
public function generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
|
||||
{
|
||||
global $conf,$langs,$user,$hookmanager;
|
||||
|
||||
$langs->load("contracts");
|
||||
|
||||
// Positionne modele sur le nom du modele de contrat a utiliser
|
||||
if (! dol_strlen($modele))
|
||||
{
|
||||
if (! empty($conf->global->CONTRACT_ADDON_PDF))
|
||||
{
|
||||
$modele = $conf->global->CONTRACT_ADDON_PDF;
|
||||
}
|
||||
else
|
||||
{
|
||||
$modele = 'strato';
|
||||
}
|
||||
}
|
||||
|
||||
$modelpath = "core/modules/contract/doc/";
|
||||
|
||||
return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -118,6 +118,7 @@ if ($resql)
|
||||
|
||||
print_barre_liste($langs->trans("ListOfContracts"), $page, $_SERVER["PHP_SELF"], '&search_contract='.$search_contract.'&search_name='.$search_name, $sortfield, $sortorder,'',$num);
|
||||
|
||||
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
|
||||
print '<table class="liste" width="100%">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
@ -136,7 +137,6 @@ if ($resql)
|
||||
print '<td class="liste_titre" width="16">'.$staticcontratligne->LibStatut(5,3).'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre">';
|
||||
@ -153,7 +153,6 @@ if ($resql)
|
||||
print '<td colspan="4" class="liste_titre" align="right"><input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
||||
print "</td></tr>\n";
|
||||
print '</form>';
|
||||
|
||||
$var=true;
|
||||
while ($i < min($num,$limit))
|
||||
@ -179,7 +178,8 @@ if ($resql)
|
||||
}
|
||||
$db->free($resql);
|
||||
|
||||
print "</table>";
|
||||
print '</table>';
|
||||
print '</form>';
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -215,9 +215,9 @@ class box_graph_invoices_permonth extends ModeleBoxes
|
||||
$stringtoshow.='<form class="flat formboxfilter" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
$stringtoshow.='<input type="hidden" name="action" value="'.$refreshaction.'">';
|
||||
$stringtoshow.='<input type="hidden" name="DOL_AUTOSET_COOKIE" value="DOLUSERCOOKIE_box_'.$this->boxcode.':year,shownb,showtot">';
|
||||
$stringtoshow.='<input type="checkbox" name="'.$param_shownb.'"'.($shownb?' checked="true"':'').'"> '.$langs->trans("NumberOfBillsByMonth");
|
||||
$stringtoshow.='<input type="checkbox" name="'.$param_shownb.'"'.($shownb?' checked="true"':'').'> '.$langs->trans("NumberOfBillsByMonth");
|
||||
$stringtoshow.=' ';
|
||||
$stringtoshow.='<input type="checkbox" name="'.$param_showtot.'"'.($showtot?' checked="true"':'').'"> '.$langs->trans("AmountOfBillsByMonthHT");
|
||||
$stringtoshow.='<input type="checkbox" name="'.$param_showtot.'"'.($showtot?' checked="true"':'').'> '.$langs->trans("AmountOfBillsByMonthHT");
|
||||
$stringtoshow.='<br>';
|
||||
$stringtoshow.=$langs->trans("Year").' <input class="flat" size="4" type="text" name="'.$param_year.'" value="'.$endyear.'">';
|
||||
$stringtoshow.='<input type="image" alt="'.$langs->trans("Refresh").'" src="'.img_picto($langs->trans("Refresh"),'refresh.png','','',1).'">';
|
||||
|
||||
@ -214,9 +214,9 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
|
||||
$stringtoshow.='<form class="flat formboxfilter" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
$stringtoshow.='<input type="hidden" name="action" value="'.$refreshaction.'">';
|
||||
$stringtoshow.='<input type="hidden" name="DOL_AUTOSET_COOKIE" value="DOLUSERCOOKIE_box_'.$this->boxcode.':year,shownb,showtot">';
|
||||
$stringtoshow.='<input type="checkbox" name="'.$param_shownb.'"'.($shownb?' checked="true"':'').'"> '.$langs->trans("NumberOfBillsByMonth");
|
||||
$stringtoshow.='<input type="checkbox" name="'.$param_shownb.'"'.($shownb?' checked="true"':'').'> '.$langs->trans("NumberOfBillsByMonth");
|
||||
$stringtoshow.=' ';
|
||||
$stringtoshow.='<input type="checkbox" name="'.$param_showtot.'"'.($showtot?' checked="true"':'').'"> '.$langs->trans("AmountOfBillsByMonthHT");
|
||||
$stringtoshow.='<input type="checkbox" name="'.$param_showtot.'"'.($showtot?' checked="true"':'').'> '.$langs->trans("AmountOfBillsByMonthHT");
|
||||
$stringtoshow.='<br>';
|
||||
$stringtoshow.=$langs->trans("Year").' <input class="flat" size="4" type="text" name="'.$param_year.'" value="'.$endyear.'">';
|
||||
$stringtoshow.='<input type="image" alt="'.$langs->trans("Refresh").'" src="'.img_picto($langs->trans("Refresh"),'refresh.png','','',1).'">';
|
||||
|
||||
@ -215,9 +215,9 @@ class box_graph_orders_permonth extends ModeleBoxes
|
||||
$stringtoshow.='<form class="flat formboxfilter" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
$stringtoshow.='<input type="hidden" name="action" value="'.$refreshaction.'">';
|
||||
$stringtoshow.='<input type="hidden" name="DOL_AUTOSET_COOKIE" value="DOLUSERCOOKIE_box_'.$this->boxcode.':year,shownb,showtot">';
|
||||
$stringtoshow.='<input type="checkbox" name="'.$param_shownb.'"'.($shownb?' checked="true"':'').'"> '.$langs->trans("NumberOfOrdersByMonth");
|
||||
$stringtoshow.='<input type="checkbox" name="'.$param_shownb.'"'.($shownb?' checked="true"':'').'> '.$langs->trans("NumberOfOrdersByMonth");
|
||||
$stringtoshow.=' ';
|
||||
$stringtoshow.='<input type="checkbox" name="'.$param_showtot.'"'.($showtot?' checked="true"':'').'"> '.$langs->trans("AmountOfOrdersByMonthHT");
|
||||
$stringtoshow.='<input type="checkbox" name="'.$param_showtot.'"'.($showtot?' checked="true"':'').'> '.$langs->trans("AmountOfOrdersByMonthHT");
|
||||
$stringtoshow.='<br>';
|
||||
$stringtoshow.=$langs->trans("Year").' <input class="flat" size="4" type="text" name="'.$param_year.'" value="'.$endyear.'">';
|
||||
$stringtoshow.='<input type="image" alt="'.$langs->trans("Refresh").'" src="'.img_picto($langs->trans("Refresh"),'refresh.png','','',1).'">';
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user