Overview
Comment:Invoice module: cancellation reason input added
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | invoice_module
Files: files | file ages | folders
SHA3-256: a749465e53f9743f2990fd8b55b131bbef3c4da18c9ee79da0887cfac42907be
User & Date: alinaar on 2023-03-14 19:06:27
Other Links: branch diff | manifest | tags
Context
2023-03-14
19:10
Invoice module: PDF icon fixed check-in: d1b219f66a user: alinaar tags: invoice_module
19:06
Invoice module: cancellation reason input added check-in: a749465e53 user: alinaar tags: invoice_module
18:34
Invoice module: duplication implemented check-in: 2495908d73 user: alinaar tags: invoice_module
Changes

Modified src/skel-dist/modules/invoice/action.html from [7110ab84c3] to [811b45916b].

99
100
101
102
103
104
105

106
107
108
109
110
111
112
		</form>

	{{elseif $_GET.action === 'ask_cancelling'}}
		<form method="POST" action="">
			<fieldset>
				<legend><h2 class="irreversible">Annuler {{if $type === $INVOICE_TYPE}}la{{else}}le{{/if}} {{$label}} n° {{$key}} ?</h2></legend>
				{{:include file='./include/document_summary.html'}}

				{{:button type="submit" name="cancel_submit" label="Confirmer l'annulation" shape="check" class="main"}}
			</fieldset>
		</form>

	{{elseif $_GET.action === 'ask_duplication'}}
		<form method="POST" action="">
			<fieldset>







>







99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
		</form>

	{{elseif $_GET.action === 'ask_cancelling'}}
		<form method="POST" action="">
			<fieldset>
				<legend><h2 class="irreversible">Annuler {{if $type === $INVOICE_TYPE}}la{{else}}le{{/if}} {{$label}} n° {{$key}} ?</h2></legend>
				{{:include file='./include/document_summary.html'}}
				{{:input type="textarea" name="reason" label="Motif" required=false cols="50" rows="4"}}
				{{:button type="submit" name="cancel_submit" label="Confirmer l'annulation" shape="check" class="main"}}
			</fieldset>
		</form>

	{{elseif $_GET.action === 'ask_duplication'}}
		<form method="POST" action="">
			<fieldset>

Modified src/skel-dist/modules/invoice/details.html from [6e1ac529bf] to [e058ee95eb].

50
51
52
53
54
55
56
57


58
59
60
61
62
63
64

		{{* ======================= Content =========================== *}}

		<fieldset>
			<legend><h2>Informations</h2></legend>
			
			{{if $cancelled}}
				<p class="infos">Statut en cours : <strong class="irreversible">{{$cancelled_label}}</strong>.<br />(dernier statut avant annulation : {{$status_label}})</p>


			{{elseif $status === $AWAITING_STATUS}}
				<p class="infos">{{$label}} <strong>{{if $type === $QUOTATION_TYPE}}signé{{else}}émise{{/if}} le {{$signing_date|date_short}} à {{$signing_place}}</strong>.</p>
				{{if $type === $QUOTATION_TYPE}}
					<p class="">En attente de validation par le/la client.e.</p>
					<p class="infos">
						{{:linkbutton href="action.html?id=%d&show=quotation&action=ask_validation"|args:$id label="Marquer comme validé et générer la facture" shape="check"}}
						{{:linkbutton href="action.html?id=%d&show=quotation&action=ask_rejection"|args:$id label="Marquer comme refusé" shape="alert"}}







|
>
>







50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66

		{{* ======================= Content =========================== *}}

		<fieldset>
			<legend><h2>Informations</h2></legend>
			
			{{if $cancelled}}
				<p>Statut en cours : <strong class="irreversible">{{$cancelled_label}}</strong>.
				{{if $cancellation_reason}}<p>Motif : {{$cancellation_reason|escape|nl2br}}</p>{{/if}}
				<p class="infos">(dernier statut avant annulation : {{$status_label}})</p>
			{{elseif $status === $AWAITING_STATUS}}
				<p class="infos">{{$label}} <strong>{{if $type === $QUOTATION_TYPE}}signé{{else}}émise{{/if}} le {{$signing_date|date_short}} à {{$signing_place}}</strong>.</p>
				{{if $type === $QUOTATION_TYPE}}
					<p class="">En attente de validation par le/la client.e.</p>
					<p class="infos">
						{{:linkbutton href="action.html?id=%d&show=quotation&action=ask_validation"|args:$id label="Marquer comme validé et générer la facture" shape="check"}}
						{{:linkbutton href="action.html?id=%d&show=quotation&action=ask_rejection"|args:$id label="Marquer comme refusé" shape="alert"}}

Modified src/skel-dist/modules/invoice/include/modification.controller.tpl from [b57d30ddef] to [65aa12f24c].

217
218
219
220
221
222
223
224


225
226
227
228
229
230
231
		}}
		{{:http redirect="details.html?id=%d&ok=6&show=invoice"|args:$invoice.id}}
	{{/if}}

{{elseif $_POST.cancel_submit}}
	{{if !$_GET.id}}
		{{:assign var='check_errors.' value='Aucun document sélectionné.'}}
	{{else}}


		{{#load id=$_GET.id}}
			{{if $status === $DRAFT_STATUS}}
				{{:assign var='check_errors.' value='Les brouillons ne peuvent pas être annulés. Vous pouvez néanmoins les supprimer.'}}
			{{elseif $cancelled}}
				{{:assign var='check_errors.' value='Le document est déjà annulé.'}}
			{{/if}}
			{{if !$check_errors}}







|
>
>







217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
		}}
		{{:http redirect="details.html?id=%d&ok=6&show=invoice"|args:$invoice.id}}
	{{/if}}

{{elseif $_POST.cancel_submit}}
	{{if !$_GET.id}}
		{{:assign var='check_errors.' value='Aucun document sélectionné.'}}
	{{/if}}
	{{:include file='./check_max_length.tpl' check_value=$_POST.reason check_max=256 check_label='Motif trop long' keep='check_errors'}}
	{{if !$check_errors}}
		{{#load id=$_GET.id}}
			{{if $status === $DRAFT_STATUS}}
				{{:assign var='check_errors.' value='Les brouillons ne peuvent pas être annulés. Vous pouvez néanmoins les supprimer.'}}
			{{elseif $cancelled}}
				{{:assign var='check_errors.' value='Le document est déjà annulé.'}}
			{{/if}}
			{{if !$check_errors}}
240
241
242
243
244
245
246

247
248
249
250
251
252
253
						recipient_member_numero=$recipient_member_numero
						introduction_text=$introduction_text
						subject=$subject
						date=$date
						deadline=$deadline
						status=$status
						cancelled=true

						items=$items
						total=$total
						vat_exemption=$vat_exemption
						siret=$siret
						org_contact=$org_contact
						author_id=$author_id
						parent_id=$parent_id







>







242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
						recipient_member_numero=$recipient_member_numero
						introduction_text=$introduction_text
						subject=$subject
						date=$date
						deadline=$deadline
						status=$status
						cancelled=true
						cancellation_reason=$_POST.reason
						items=$items
						total=$total
						vat_exemption=$vat_exemption
						siret=$siret
						org_contact=$org_contact
						author_id=$author_id
						parent_id=$parent_id
273
274
275
276
277
278
279

280
281
282
283
284
285
286
						recipient_member_numero=$recipient_member_numero
						introduction_text=$introduction_text
						subject=$subject
						date=$date
						deadline=$deadline
						status=$status
						cancelled=true

						items=$items
						total=$total
						vat_exemption=$vat_exemption
						siret=$siret
						org_contact=$org_contact
						author_id=$author_id
						child_id=$child_id







>







276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
						recipient_member_numero=$recipient_member_numero
						introduction_text=$introduction_text
						subject=$subject
						date=$date
						deadline=$deadline
						status=$status
						cancelled=true
						cancellation_reason=$_POST.reason
						items=$items
						total=$total
						vat_exemption=$vat_exemption
						siret=$siret
						org_contact=$org_contact
						author_id=$author_id
						child_id=$child_id

Modified src/skel-dist/modules/invoice/include/schema/invoice.json from [af26d59dc9] to [6a4372f425].

46
47
48
49
50
51
52





53
54
55
56
57
58
59
			"description": "Statut",
			"type": "string",
			"enum": ["draft", "awaiting", "rejected", "validated", "paid", "misc"]
		},
		"cancelled": {
			"description": "Défini si la facture est annnulée",
			"type": "bool"





		},
		"items": {
			"description": "Articles",
			"type": ["array", "null"],
			"items": {
				"type": "object",
				"properties": {







>
>
>
>
>







46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
			"description": "Statut",
			"type": "string",
			"enum": ["draft", "awaiting", "rejected", "validated", "paid", "misc"]
		},
		"cancelled": {
			"description": "Défini si la facture est annnulée",
			"type": "bool"
		},
		"cancellation_reason": {
			"description": "Motif de l'annulation",
			"type": ["string", "null"],
			"maxLength": 256
		},
		"items": {
			"description": "Articles",
			"type": ["array", "null"],
			"items": {
				"type": "object",
				"properties": {

Modified src/skel-dist/modules/invoice/include/schema/quotation.json from [aec06c36ae] to [bd201f981c].

46
47
48
49
50
51
52





53
54
55
56
57
58
59
			"description": "Statut",
			"type": "string",
			"enum": ["draft", "awaiting", "rejected", "validated", "misc"]
		},
		"cancelled": {
			"description": "Défini si la facture est annnulée",
			"type": "bool"





		},
		"items": {
			"description": "Articles",
			"type": ["array", "null"],
			"items": {
				"type": "object",
				"properties": {







>
>
>
>
>







46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
			"description": "Statut",
			"type": "string",
			"enum": ["draft", "awaiting", "rejected", "validated", "misc"]
		},
		"cancelled": {
			"description": "Défini si la facture est annnulée",
			"type": "bool"
		},
		"cancellation_reason": {
			"description": "Motif de l'annulation",
			"type": ["string", "null"],
			"maxLength": 256
		},
		"items": {
			"description": "Articles",
			"type": ["array", "null"],
			"items": {
				"type": "object",
				"properties": {