Overview
Comment:Invoice module: brackets removed from {{if}} blocks since the API removed this feature (see #e4fe4245c74000f542a0e8770dca9c54314fafc8)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | invoice_module
Files: files | file ages | folders
SHA3-256: 9c7b63df332f0bc13f6b63d671380a20b61623ee73f7a308d9717ea9bab69293
User & Date: alinaar on 2023-03-24 14:53:23
Other Links: branch diff | manifest | tags
Context
2023-03-24
16:31
Invoice module: document structure cleaned (field names made consistent) check-in: 7cb8006dd3 user: alinaar tags: invoice_module
14:53
Invoice module: brackets removed from {{if}} blocks since the API removed this feature (see #e4fe4245c74000f542a0e8770dca9c54314fafc8) check-in: 9c7b63df33 user: alinaar tags: invoice_module
14:44
Invoice module: code cleaned (module=$module.name hack removed) check-in: 25f513b90f user: alinaar tags: invoice_module
Changes

Modified src/modules/invoice/edit.html from [31803d178e] to [e4bf2a21a2].

66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
	{{if !$_POST.date}}
		{{:assign var='check_errors.' value="La date est obligatoire."}}
	{{/if}}
	{{if $_POST.date|date_short === null}} {{* Means data is not a date *}}
		{{:assign var='check_errors.' value="La date du devis doit être une date."}}
	{{/if}}

{{* Commented awaiting #e4fe4245c74000f542a0e8770dca9c54314fafc8 resolution
	{{if ($_POST.deadline) && ($_POST.deadline|date_short === null)}}
		{{:assign var='check_errors.' value="L'échéance doit être une date."}}
	{{/if}}
*}}
	{{if $deadline && $deadline < $date}}
		{{:assign var='check_errors.' value="L'échéance doit se situer après la date du devis (%s)."|args:$_POST.date}}
	{{/if}}

	{{if $_POST.status}}
		{{:assign var='check_errors.' value="Le statut ne peut pas être changé."}}
	{{/if}}







<
|


<







66
67
68
69
70
71
72

73
74
75

76
77
78
79
80
81
82
	{{if !$_POST.date}}
		{{:assign var='check_errors.' value="La date est obligatoire."}}
	{{/if}}
	{{if $_POST.date|date_short === null}} {{* Means data is not a date *}}
		{{:assign var='check_errors.' value="La date du devis doit être une date."}}
	{{/if}}


	{{if $_POST.deadline && $_POST.deadline|date_short === null}}
		{{:assign var='check_errors.' value="L'échéance doit être une date."}}
	{{/if}}

	{{if $deadline && $deadline < $date}}
		{{:assign var='check_errors.' value="L'échéance doit se situer après la date du devis (%s)."|args:$_POST.date}}
	{{/if}}

	{{if $_POST.status}}
		{{:assign var='check_errors.' value="Le statut ne peut pas être changé."}}
	{{/if}}
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126

127
128
129
130

131
132
133
134
135
136
137
		{{:assign var='computed_item.id' value=$index|intval}}
		{{:assign var='computed_item.unit_price' value=$unit_price|floatval|money_int}}
		{{:assign var='computed_item.quantity' value=$quantity|floatval}}
		{{:assign var='items.' value=$computed_item}}
		{{:assign var='computed_total' value="%d + %d * %F"|args:$computed_total:$computed_item.unit_price:$computed_item.quantity|math}}
	{{/foreach}}

{{* Commented awaiting #e4fe4245c74000f542a0e8770dca9c54314fafc8 resolution
	{{if ($computed_total != $_POST.quotation_total|money_int) || ($computed_total < 0)}}
		{{:assign var='check_errors.' value='Erreur de calcul du total. Enregistrement du devis refusé.'}}
	{{/if}}
*}}
	{{if $module.config.vat_exemption}}
		{{:assign vat_exemption=$module.config.vat_exemption}}
	{{else}}
		{{:assign vat_exemption=$NONPROFIT_VAT_EXEMPTION_TYPE}}
	{{/if}}
{{* Commented awaiting #e4fe4245c74000f542a0e8770dca9c54314fafc8 resolution

	{{if $_POST.signing && (!$_POST.signing_place || !$_POST.signing_date)}}
		{{:assign var='check_errors.' value='La date et le lieu de la signature du devis sont obligatoires si le devis est signé.'}}
	{{/if}}
*}}

	{{:include file='./include/check_max_length.tpl' keep='check_errors' check_label='Lieu de da signature trop long' check_value=$_POST.signing_place check_max=128}}
	{{:assign signing_date=$_POST.signing_date|date:'Y-m-d'}}
	{{if $signing_date && $signing_date < $date}}
		{{:assign var='check_errors.' value="La date de signature doit se situer après la date du devis (%s)."|args:$_POST.date}}
	{{/if}}

	{{if $_POST.key}}







<
|


|





|
>
|
|
|
|
>







107
108
109
110
111
112
113

114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
		{{:assign var='computed_item.id' value=$index|intval}}
		{{:assign var='computed_item.unit_price' value=$unit_price|floatval|money_int}}
		{{:assign var='computed_item.quantity' value=$quantity|floatval}}
		{{:assign var='items.' value=$computed_item}}
		{{:assign var='computed_total' value="%d + %d * %F"|args:$computed_total:$computed_item.unit_price:$computed_item.quantity|math}}
	{{/foreach}}


	{{if $computed_total != $_POST.quotation_total|money_int || $computed_total < 0}}
		{{:assign var='check_errors.' value='Erreur de calcul du total. Enregistrement du devis refusé.'}}
	{{/if}}

	{{if $module.config.vat_exemption}}
		{{:assign vat_exemption=$module.config.vat_exemption}}
	{{else}}
		{{:assign vat_exemption=$NONPROFIT_VAT_EXEMPTION_TYPE}}
	{{/if}}

	{{if $_POST.signing}}
		{{if !$_POST.signing_place || !$_POST.signing_date}}
			{{:assign var='check_errors.' value='La date et le lieu de la signature du devis sont obligatoires si le devis est signé.'}}
		{{/if}}
	{{/if}}

	{{:include file='./include/check_max_length.tpl' keep='check_errors' check_label='Lieu de da signature trop long' check_value=$_POST.signing_place check_max=128}}
	{{:assign signing_date=$_POST.signing_date|date:'Y-m-d'}}
	{{if $signing_date && $signing_date < $date}}
		{{:assign var='check_errors.' value="La date de signature doit se situer après la date du devis (%s)."|args:$_POST.date}}
	{{/if}}

	{{if $_POST.key}}