Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dolibarr
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
2af3f280
Commit
2af3f280
authored
14 years ago
by
Juanjo Menent
Browse files
Options
Downloads
Patches
Plain Diff
Task #8618: build pdf
parent
f9d5e6fc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
htdocs/core/class/html.formfile.class.php
+2
-2
2 additions, 2 deletions
htdocs/core/class/html.formfile.class.php
htdocs/fourn/facture/fiche.php
+77
-32
77 additions, 32 deletions
htdocs/fourn/facture/fiche.php
with
79 additions
and
34 deletions
htdocs/core/class/html.formfile.class.php
+
2
−
2
View file @
2af3f280
...
...
@@ -277,8 +277,8 @@ class FormFile
if
(
is_array
(
$genallowed
))
$modellist
=
$genallowed
;
else
{
include_once
(
DOL_DOCUMENT_ROOT
.
'/
fourn/facture/modules
/modules_facturefournisseur.php'
);
$model
=
new
ModelePDF
Factures
Suppliers
();
include_once
(
DOL_DOCUMENT_ROOT
.
'/
includes/modules/supplier_invoice
/modules_facturefournisseur.php'
);
$model
=
new
ModelePDFSupplier
sInvoice
s
();
$modellist
=
$model
->
liste_modeles
(
$this
->
db
);
}
}
...
...
This diff is collapsed.
Click to expand it.
htdocs/fourn/facture/fiche.php
+
77
−
32
View file @
2af3f280
...
...
@@ -31,6 +31,7 @@
require
(
"../../main.inc.php"
);
require_once
(
DOL_DOCUMENT_ROOT
.
"/core/class/html.formfile.class.php"
);
require_once
(
DOL_DOCUMENT_ROOT
.
'/fourn/class/fournisseur.class.php'
);
require_once
(
DOL_DOCUMENT_ROOT
.
'/includes/modules/supplier_invoice/modules_facturefournisseur.php'
);
require_once
(
DOL_DOCUMENT_ROOT
.
'/fourn/class/fournisseur.facture.class.php'
);
require_once
(
DOL_DOCUMENT_ROOT
.
'/fourn/class/paiementfourn.class.php'
);
require_once
(
DOL_DOCUMENT_ROOT
.
'/lib/fourn.lib.php'
);
...
...
@@ -463,7 +464,57 @@ if ($_GET['action'] == 'reopen' && $user->rights->fournisseur->facture->creer)
}
}
/*
* Build document
*/
if
(
$_REQUEST
[
'action'
]
==
'builddoc'
)
{
/*
* Generation de la facture
* definit dans /includes/modules/supplier_invoice/modules_facturefournisseur.php
*/
// Sauvegarde le dernier module choisi pour generer un document
$facture
=
new
FactureFournisseur
(
$db
);
$facture
->
fetch
(
$_REQUEST
[
'facid'
]);
if
(
$_REQUEST
[
'model'
])
{
$facture
->
setDocModel
(
$user
,
$_REQUEST
[
'model'
]);
}
$outputlangs
=
$langs
;
if
(
!
empty
(
$_REQUEST
[
'lang_id'
]))
{
$outputlangs
=
new
Translate
(
""
,
$conf
);
$outputlangs
->
setDefaultLang
(
$_REQUEST
[
'lang_id'
]);
}
$result
=
supplier_invoice_pdf_create
(
$db
,
$facture
,
$facture
->
modelpdf
,
$outputlangs
);
if
(
$result
<=
0
)
{
dol_print_error
(
$db
,
$result
);
exit
;
}
else
{
Header
(
'Location: '
.
$_SERVER
[
"PHP_SELF"
]
.
'?facid='
.
$facture
->
id
.
(
empty
(
$conf
->
global
->
MAIN_JUMP_TAG
)
?
''
:
'#builddoc'
));
exit
;
}
}
// Delete file in doc form
if
(
$action
==
'remove_file'
)
{
$facture
=
new
FactureFournisseur
(
$db
);
if
(
$facture
->
fetch
(
$id
))
{
$upload_dir
=
$conf
->
fournisseur
->
facture
->
dir_output
.
"/"
;
$file
=
$upload_dir
.
'/'
.
$_GET
[
'file'
];
dol_delete_file
(
$file
);
$mesg
=
'<div class="ok">'
.
$langs
->
trans
(
"FileWasRemoved"
)
.
'</div>'
;
}
}
/*
...
...
@@ -1234,40 +1285,34 @@ else
print
'</div>'
;
print
'<table width="100%"><tr><td width="50%" valign="top">'
;
print
'<a name="builddoc"></a>'
;
// ancre
if
(
$_GET
[
'action'
]
!=
'presend'
)
{
print
'<table width="100%"><tr><td width="50%" valign="top">'
;
print
'<a name="builddoc"></a>'
;
// ancre
/*
* Documents generes
*/
$filename
=
dol_sanitizeFileName
(
$fac
->
ref
);
$filedir
=
$conf
->
fournisseur
->
dir_output
.
'/facture/'
.
get_exdir
(
$fac
->
id
,
2
)
.
$fac
->
id
;
$urlsource
=
$_SERVER
[
'PHP_SELF'
]
.
'?facid='
.
$fac
->
id
;
//$genallowed=$user->rights->fournisseur->facture->creer;
$genallowed
=
false
;
// TODO Waiting for supplier invoice generation
$delallowed
=
$user
->
rights
->
fournisseur
->
facture
->
supprimer
;
$var
=
true
;
$somethingshown
=
$formfile
->
show_documents
(
'facture_fournisseur'
,
$filename
,
$filedir
,
$urlsource
,
$genallowed
,
$delallowed
,
$fac
->
modelpdf
);
print
'</td><td valign="top" width="50%">'
;
print
'<br>'
;
// List of actions on element
/*
include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php');
$formactions=new FormActions($db);
$somethingshown=$formactions->showactions($fac,'invoice_supplier',$socid);
*/
/*
* Documents generes
*/
$facfournref
=
dol_sanitizeFileName
(
$fac
->
ref
);
$file
=
$conf
->
fournisseur
->
dir_output
.
'/facture/'
.
$facfournref
.
'/'
.
$facfournref
.
'.pdf'
;
$relativepath
=
$facfournref
.
'/'
.
$facfournref
.
'.pdf'
;
$filedir
=
$conf
->
fournisseur
->
dir_output
.
'/facture/'
.
$facfournref
;
$urlsource
=
$_SERVER
[
'PHP_SELF'
]
.
'?facid='
.
$fac
->
id
;
$genallowed
=
$user
->
rights
->
fournisseur
->
facture
->
creer
;
$delallowed
=
$user
->
rights
->
fournisseur
->
facture
->
supprimer
;
$somethingshown
=
$formfile
->
show_documents
(
'facture_fournisseur'
,
$facfournref
,
$filedir
,
$urlsource
,
$genallowed
,
$delallowed
,
$facture
->
modelpdf
);
print
'</td><td valign="top" width="50%">'
;
print
'<br>'
;
// List of actions on element
/*
include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php');
$formactions=new FormActions($db);
$somethingshown=$formactions->showactions($fac,'invoice_supplier',$socid);
*/
print
'</td></tr></table>'
;
}
print
'</td></tr></table>'
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment