Commit 41f9cb13 authored by Frank Bergmann's avatar Frank Bergmann

- started adding new-company-from-freelance

parent b6001529
Pipeline #311 failed with stages
......@@ -137,14 +137,14 @@ create table im_invoice_items (
begin
acs_object_type.create_type (
supertype => 'acs_object',
object_type => 'im_invoice',
pretty_name => 'Invoice',
object_type => 'im_invoice',
pretty_name => 'Invoice',
pretty_plural => 'Invoices',
table_name => 'im_invoices',
table_name => 'im_invoices',
id_column => 'invoice_id',
package_name => 'im_invoice',
package_name => 'im_invoice',
type_extension_table => null,
name_method => 'im_invoice.name'
name_method => 'im_invoice.name'
);
end;
/
......
<master src="../../intranet-core/www/master">
<property name="title">@page_title;noquote@</property>
<property name="main_navbar_label">finance</property>
<%= [im_costs_navbar "none" "/intranet/invoices/index" "" "" [list] "invoices_new"] %>
<table cellpadding=0 cellspacing=0 border=0 width=100%>
<tr>
<td valign=top>
<H2>@page_title;noquote@</H2>
<ul>
@new_list_html;noquote@
</ul>
<%= [im_component_bay left] %>
</td>
<td valign=top>
<%= [im_component_bay right] %>
</td>
</tr>
</table><br>
<table cellpadding=0 cellspacing=0 border=0>
<tr><td>
<%= [im_component_bay bottom] %>
</td></tr>
</table>
# /packages/intranet-invoices/www/index.tcl
#
# Copyright (C) 2003-2004 Project/Open
#
# All rights reserved. Please check
# http://www.project-open.com/license/ for details.
ad_page_contract {
Offers a menu to create new Invoices, Quotes, POs
and Bills
@author frank.bergmann@project-open.com
} {
{ project_id 0 }
{ customer_id 0 }
}
set user_id [ad_maybe_redirect_for_registration]
# select the "Finance" Menu
set parent_menu_sql "select menu_id from im_menus where label='finance'"
set parent_menu_id [db_string parent_admin_menu $parent_menu_sql -default 0]
set menu_select_sql "
select m.*
from im_menus m
where parent_menu_id = :parent_menu_id
and acs_permission.permission_p(m.menu_id, :user_id, 'read') = 't'
order by sort_order"
# Start formatting the menu bar
set new_list_html ""
set ctr 0
db_foreach menu_select $menu_select_sql {
ns_log Notice "im_sub_navbar: menu_name='$name'"
if {$customer_id} { append url "&customer_id=$customer_id" }
if {$project_id} { append url "&project_id=$project_id" }
append new_list_html "<li><a href=\"$url\">$name</a></li>\n"
}
set page_title "New Financial Item"
set context_bar [ad_context_bar $page_title]
......@@ -26,6 +26,7 @@ ad_page_contract {
template_id:integer
vat:float
tax:float
note
item_sort_order:array
item_name:array
item_units:float,array
......@@ -110,7 +111,8 @@ if {!$invoice_exists_p} {
payment_days => :payment_days,
amount => 0,
vat => :vat,
tax => :tax
tax => :tax,
note => :note
);
END;"
}
......@@ -142,6 +144,7 @@ set
payment_days = :payment_days,
vat = :vat,
tax = :tax,
note = :note,
variable_cost_p = 't'
where
cost_id = :invoice_id
......
......@@ -70,7 +70,7 @@
<td align=center valign=top class=rowtitle colspan=2>Customer</td>
</tr>
<tr>
<td class=roweven>Customer:</tr>
<td class=roweven>Customer:</td>
<td class=roweven>@customer_select;noquote@</td>
</tr>
<input type=hidden name=provider_id value=@provider_id@>
......@@ -82,7 +82,7 @@
<td align=center valign=top class=rowtitle colspan=2>Provider</td>
</tr>
<tr>
<td class=roweven>Provider:</tr>
<td class=roweven>Provider:</td>
<td class=roweven>@provider_select;noquote@</td>
</tr>
<input type=hidden name=customer_id value=@customer_id@>
......@@ -90,6 +90,14 @@
</else>
<tr>
<td class=rowodd>Note:</td>
<td>
<textarea name=note rows=6 cols=40 wrap=hard>@cost_note@</textarea>
</td>
</tr>
</table>
</tr>
</table>
......
......@@ -88,6 +88,7 @@ select
ci.payment_days,
ci.vat,
ci.tax,
ci.note as cost_note,
i.payment_method_id,
ci.template_id,
ci.cost_status_id,
......
......@@ -40,7 +40,7 @@ if {"" != $del} {
if {"" != $add} {
ns_log Notice "payment-action: add payment"
ad_returnredirect "/intranet-payments/new?cost_id=$cost_id"
ad_returnredirect "/intranet-payments/new?[export_url_vars cost_id return_url]"
}
ad_return_complaint 1 "<li>No command specified"
......@@ -141,3 +141,4 @@
</table>
</td></tr>
</table>
......@@ -89,6 +89,7 @@ append query "
select
i.*,
ci.*,
ci.note as cost_note,
c.*,
c.customer_id as company_id,
o.*,
......@@ -127,6 +128,21 @@ set page_title "One $cost_type"
set context_bar [ad_context_bar [list /intranet-invoices/ "Finance"] $page_title]
# ---------------------------------------------------------------
# Update the amount paid for this cost_item
# ---------------------------------------------------------------
db_dml update_cost_items "
update im_costs
set paid_amount = (
select sum(amount)
from im_payments
where cost_id = :invoice_id
)
where cost_id = :invoice_id
"
# ---------------------------------------------------------------
# Payments list
# ---------------------------------------------------------------
......@@ -184,7 +200,8 @@ where
<input type=submit name=del value=\"Del\">
</td>
</tr>
</table>\n"
</table>
</form>\n"
}
# ---------------------------------------------------------------
......@@ -319,6 +336,12 @@ append item_html "
<td valign=top>Payment Method:</td>
<td valign=top colspan=[expr $colspan-1]> $invoice_payment_method_desc</td>
</tr>
<tr>
<td valign=top>Note:</td>
<td valign=top colspan=[expr $colspan-1]>
<pre><span style=\"font-family: verdana, arial, helvetica, sans-serif\">$cost_note</font></pre>
</td>
</tr>
"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment