summaryrefslogtreecommitdiff
path: root/vietnam
diff options
context:
space:
mode:
authorIkiWiki <ikiwiki.info>2023-04-13 11:11:05 +0200
committerIkiWiki <ikiwiki.info>2023-04-13 11:50:46 +0200
commit5fa2e223c6fcd73af9b384bc05e5c7b2e1a7b4f8 (patch)
tree3116f52e311ef27a57b4218a9abee630f53697fd /vietnam
parentd9f2d21e67018778ef6731df3134452a4aa63371 (diff)
rewrite intro
Diffstat (limited to 'vietnam')
0 files changed, 0 insertions, 0 deletions
n>
  • # This program is distributed in the hope that it will be useful,
  • # but WITHOUT ANY WARRANTY; without even the implied warranty of
  • # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  • # GNU General Public License for more details.
  • # You should have received a copy of the GNU General Public License
  • # along with this program; if not, write to the Free Software
  • # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  • #======================================================================
  • #
  • # customer/vendor module
  • #
  • #======================================================================
  • use LedgerSMB::CT;
  • use LedgerSMB::Template;
  • 1;
  • # end of main
  • sub add {
  • $form->{title} = "Add";
  • # $locale->text('Add Customer')
  • # $locale->text('Add Vendor')
  • $form->{callback} =
  • "$form->{script}?action=add&db=$form->{db}&path=$form->{path}&login=$form->{login}&sessionid=$form->{sessionid}"
  • unless $form->{callback};
  • CT->create_links( \%myconfig, \%$form );
  • &form_header;
  • &form_footer;
  • }
  • sub history {
  • # $locale->text('Customer History')
  • # $locale->text('Vendor History')
  • my %hiddens;
  • my @buttons;
  • $history = 1;
  • $label = ucfirst $form->{db};
  • $label .= " History";
  • if ( $form->{db} eq 'customer' ) {
  • $form->{invlabel} = $locale->text('Sales Invoices');
  • $form->{ordlabel} = $locale->text('Sales Orders');
  • $form->{quolabel} = $locale->text('Quotations');
  • } else {
  • $form->{invlabel} = $locale->text('Vendor Invoices');
  • $form->{ordlabel} = $locale->text('Purchase Orders');
  • $form->{quolabel} = $locale->text('Request for Quotations');
  • }
  • $form->{title} = $locale->text($label);
  • $form->{nextsub} = "list_history";
  • &search_name(\%hiddens, \@buttons);
  • ##SC: Temporary removal
  • ## if ( $form->{lynx} ) {
  • ## require "bin/menu.pl";
  • ## &menubar;
  • ## }
  • my $template = LedgerSMB::Template->new_UI(
  • user => \%myconfig,
  • locale => $locale,
  • template => 'ct-search',
  • );
  • $template->render({
  • form => $form,
  • user => \%myconfig,
  • hiddens => \%hiddens,
  • buttons => \@buttons,
  • });
  • }
  • sub transactions {
  • if ( $form->{db} eq 'customer' ) {
  • $form->{translabel} = $locale->text('AR Transactions');
  • $form->{invlabel} = $locale->text('Sales Invoices');
  • $form->{ordlabel} = $locale->text('Sales Orders');
  • $form->{quolabel} = $locale->text('Quotations');
  • } else {
  • $form->{translabel} = $locale->text('AP Transactions');
  • $form->{invlabel} = $locale->text('Vendor Invoices');
  • $form->{ordlabel} = $locale->text('Purchase Orders');
  • $form->{quolabel} = $locale->text('Request for Quotations');
  • }
  • }
  • sub include_in_report {
  • $label = ucfirst $form->{db};
  • my @fields = ();
  • push @fields, {
  • name => 'l_ndx',
  • label => $locale->text('No.'),
  • };
  • push @fields, {
  • name => 'l_id',
  • label => $locale->text('ID'),
  • };
  • push @fields, {
  • name => "l_$form->{db}number",
  • label => $locale->text($label . ' Number'),
  • };
  • push @fields, {
  • name => 'l_name',
  • label => $locale->text('Company Name'),
  • $form->{l_name} => $form->{l_name},
  • };
  • push @fields, {
  • name => 'l_contact',
  • label => $locale->text('Contact'),
  • $form->{l_contact} => $form->{l_contact},
  • };
  • push @fields, {
  • name => 'l_email',
  • label => $locale->text('E-mail'),
  • $form->{l_email} => $form->{l_email},
  • };
  • push @fields, {
  • name => 'l_address',
  • label => $locale->text('Address'),
  • };
  • push @fields, {
  • name => 'l_city',
  • label => $locale->text('City'),
  • };
  • push @fields, {
  • name => 'l_state',
  • label => $locale->text('State/Province'),
  • };
  • push @fields, {
  • name => 'l_zipcode',
  • label => $locale->text('Zip/Postal Code'),
  • };
  • push @fields, {
  • name => 'l_country',
  • label => $locale->text('Country'),
  • };
  • push @fields, {
  • name => 'l_phone',
  • label => $locale->text('Phone'),
  • $form->{l_phone} => $form->{l_phone},
  • };
  • push @fields, {
  • name => 'l_fax',
  • label => $locale->text('Fax'),
  • };
  • push @fields, {
  • name => 'l_cc',
  • label => $locale->text('Cc'),
  • };
  • if ( $myconfig{role} =~ /(admin|manager)/ ) {
  • push @fields, {
  • name => 'l_bcc',
  • label => $locale->text('Bcc'),
  • };
  • }
  • push @fields, {
  • name => 'l_notes',
  • label => $locale->text('Notes'),
  • };
  • push @fields, {
  • name => 'l_discount',
  • label => $locale->text('Discount'),
  • };
  • push @fields, {
  • name => 'l_taxaccount',
  • label => $locale->text('Tax Account'),
  • };
  • push @fields, {
  • name => 'l_taxnumber',
  • label => $locale->text('Tax Number'),
  • };
  • if ( $form->{db} eq 'customer' ) {
  • push @fields, {
  • name => 'l_employee',
  • label => $locale->text('Salesperson'),
  • };
  • push @fields, {
  • name => 'l_manager',
  • label => $locale->text('Manager'),
  • };
  • push @fields, {
  • name => 'l_pricegroup',
  • label => $locale->text('Pricegroup'),
  • };
  • } else {
  • push @fields, {
  • name => 'l_employee',
  • label => $locale->text('Employee'),
  • };
  • push @fields, {
  • name => 'l_manager',
  • label => $locale->text('Manager'),
  • };
  • push @fields, {
  • name => 'l_gifi_accno',
  • label => $locale->text('GIFI'),
  • };
  • }
  • push @fields, {
  • name => 'l_sic_code',
  • label => $locale->text('SIC'),
  • };
  • push @fields, {
  • name => 'l_iban',
  • label => $locale->text('IBAN'),
  • };
  • push @fields, {
  • name => 'l_bic',
  • label => $locale->text('BIC'),
  • };
  • push @fields, {
  • name => 'l_business',
  • label => $locale->text('Type of Business'),
  • };
  • push @fields, {
  • name => 'l_terms',
  • label => $locale->text('Terms'),
  • };
  • push @fields, {
  • name => 'l_langauge',
  • label => $locale->text('Language'),
  • };
  • push @fields, {
  • name => 'l_startdate',
  • label => $locale->text('Startdate'),
  • };
  • push @fields, {
  • name => 'l_enddate',
  • label => $locale->text('Enddate'),
  • };
  • $form->{includes} = [];
  • my $i = 0;
  • while (@fields) {
  • push @{$form->{includes}}, [];
  • for ( 1 .. 5 ) {
  • push @{$form->{includes}[$i]}, shift(@fields);
  • if ($form->{includes}[$i][$_ - 1]) {
  • $form->{includes}[$i][$_ - 1]{type} = 'checkbox';
  • $form->{includes}[$i][$_ - 1]{value} = 'Y';
  • }
  • }
  • $i++;
  • }
  • }
  • sub search {
  • # $locale->text('Customers')
  • # $locale->text('Vendors')
  • my %hiddens;
  • my @buttons;
  • $form->{title} = $locale->text('Search') unless $form->{title};
  • for (qw(name contact phone email)) { $form->{"l_$_"} = 'checked' }
  • $form->{nextsub} = "list_names";
  • &transactions;
  • &include_in_report;
  • &search_name(\%hiddens, \@buttons);
  • ##SC: Temporary removal
  • ## if ( $form->{lynx} ) {
  • ## require "bin/menu.pl";
  • ## &menubar;
  • ## }
  • my $template = LedgerSMB::Template->new_UI(
  • user => \%myconfig,
  • locale => $locale,
  • template => 'ct-search',
  • );
  • $template->render({
  • form => $form,
  • user => \%myconfig,
  • hiddens => \%hiddens,
  • buttons => \@buttons,
  • });
  • }
  • sub search_name {
  • my $hiddens = shift;
  • my $buttons = shift;
  • my $label = ucfirst $form->{db};
  • $form->{label} = $label;
  • $hiddens->{$_} = $form->{$_} foreach qw(db nextsub path login sessionid);
  • push @{$buttons}, {
  • name => 'action',
  • value => 'continue',
  • text => $locale->text('Continue'),
  • };
  • }
  • sub list_names {
  • my %hiddens;
  • my @buttons;
  • my @options;
  • CT->search( \%myconfig, \%$form );
  • my $href =
  • "$form->{script}?action=list_names&direction=$form->{direction}&oldsort=$form->{oldsort}&db=$form->{db}&path=$form->{path}&login=$form->{login}&sessionid=$form->{sessionid}&status=$form->{status}&l_subtotal=$form->{l_subtotal}";
  • $form->sort_order();
  • my $callback =
  • "$form->{script}?action=list_names&direction=$form->{direction}&oldsort=$form->{oldsort}&db=$form->{db}&path=$form->{path}&login=$form->{login}&sessionid=$form->{sessionid}&status=$form->{status}&l_subtotal=$form->{l_subtotal}";
  • my @columns = $form->sort_columns( id, name, "$form->{db}number", address,
  • city, state, zipcode, country,
  • contact, phone, fax, email,
  • cc, bcc, employee, manager,
  • notes, discount, terms, taxaccount,
  • taxnumber, gifi_accno, sic_code, business,
  • pricegroup, language, iban, bic,
  • startdate, enddate, invnumber, invamount,
  • invtax, invtotal, ordnumber, ordamount,
  • ordtax, ordtotal, quonumber, quoamount,
  • quotax, quototal
  • );
  • unshift @columns, "ndx";
  • $form->{l_invnumber} = "Y" if $form->{l_transnumber};
  • foreach my $item (qw(inv ord quo)) {