parent
fa07184a46
commit
807e77855d
@ -1,162 +0,0 @@
|
||||
[%
|
||||
USE Dumper;
|
||||
USE Date;
|
||||
USE Math;
|
||||
|
||||
template_variables.description = {};
|
||||
template_variables.description.import({
|
||||
invoice => {
|
||||
'invoice_self' => 'Information about invoice.',
|
||||
'amount' => 'Invoice amount with already considered discount.',
|
||||
}
|
||||
});
|
||||
|
||||
IF !invoice.serial;
|
||||
#info from db
|
||||
DEFAULT invoice.month=date.format(date.now(),'%m');
|
||||
DEFAULT invoice.serial=Math.int(Math.rand(999999))|format('%06d');
|
||||
DEFAULT invoice.year=date.format(date.now(),'%y');
|
||||
#/info from db
|
||||
DEFAULT invoice.amount='1200';
|
||||
DEFAULT invoice.amount_netto='1000';
|
||||
DEFAULT invoice.amount_payment='650';
|
||||
DEFAULT invoice.amount_vat='200';
|
||||
DEFAULT invoice.cloud_pbx_amount='921';
|
||||
DEFAULT invoice.debit='500';
|
||||
DEFAULT invoice.discount_service='10';
|
||||
DEFAULT invoice.discount_wire_transfer='40';
|
||||
DEFAULT invoice.serviceallowance='69';
|
||||
DEFAULT invoice.voice_termination_fees='10';
|
||||
END;
|
||||
|
||||
template_variables.description.import({
|
||||
provider => {
|
||||
'provider_self' => 'Information about invoice issuer, reseller.',
|
||||
'bic' => 'BIC information of provider.',
|
||||
'city' => 'Provider city.',
|
||||
}
|
||||
});
|
||||
|
||||
IF 1 || !provider;
|
||||
DEFAULT provider.bic='ABCDEFG1234';
|
||||
DEFAULT provider.city='Provider City';
|
||||
DEFAULT provider.company='Provider Gmbh.';
|
||||
DEFAULT provider.country='Provider-Country';
|
||||
DEFAULT provider.email='office@provider.com';
|
||||
DEFAULT provider.fax='+1 650 1234566';
|
||||
DEFAULT provider.fn='305595';
|
||||
DEFAULT provider.iban='1234567890ABC';
|
||||
DEFAULT provider.mobile='+1 650 1234568';
|
||||
DEFAULT provider.phone='+1 650 1234567';
|
||||
DEFAULT provider.postcode='65104';
|
||||
DEFAULT provider.street='Provider Street';
|
||||
DEFAULT provider.url='http://www.provider.com/';
|
||||
DEFAULT provider.vat='UATAA1234AA1234';
|
||||
ELSE;
|
||||
FOREACH i in ['bic','city','company','country','email','fax','fn','iban','mobile','phone','postcode','street','url','vat'];
|
||||
TRY;
|
||||
provider.${i} = provider.get_column(i);
|
||||
CATCH;
|
||||
provider.${i} = 'Provider' _ ucfirst(i);
|
||||
END;
|
||||
#IF !provider.${i};
|
||||
provider.${i} = 'Provider' _ ucfirst(i);
|
||||
#END;
|
||||
END;
|
||||
END;
|
||||
|
||||
template_variables.description.import({
|
||||
client => {
|
||||
'client_self' => 'Information about invoice receiver, customer.',
|
||||
'bic' => "Client's BIC.",
|
||||
}
|
||||
});
|
||||
|
||||
IF !client.id;
|
||||
DEFAULT client.bic='ABCDEFG1234';
|
||||
DEFAULT client.city='Client City';
|
||||
DEFAULT client.country='Client-Country';
|
||||
DEFAULT client.title='Herr Dipl. Ing (FH)';
|
||||
DEFAULT client.firstname='Client Firstname';
|
||||
DEFAULT client.id=Math.int(Math.rand(999999))|format('%06d');
|
||||
DEFAULT client.lastname='Client-Lastname Sr.';
|
||||
DEFAULT client.postcode='65104';
|
||||
DEFAULT client.sepa='AT1234567890';
|
||||
DEFAULT client.street='Client Street';
|
||||
DEFAULT client.vatid='AA1234';
|
||||
END;
|
||||
|
||||
|
||||
template_variables.description.import({
|
||||
bp => {
|
||||
'name' => 'Billing Profile name',
|
||||
'interval_charge' => 'Constant fee for invoice period.',
|
||||
}
|
||||
});
|
||||
|
||||
IF !bp.id;
|
||||
DEFAULT bp.name='Default Billing Profile';
|
||||
DEFAULT bp.interval_charge='125';
|
||||
DEFAULT bp.handle ='default';
|
||||
DEFAULT bp.prepaid = '';
|
||||
DEFAULT bp.interval_charge = '';
|
||||
DEFAULT bp.interval_free_time = '';
|
||||
DEFAULT bp.interval_free_cash = '';
|
||||
DEFAULT bp.interval_unit = '';
|
||||
DEFAULT bp.interval_count = '';
|
||||
DEFAULT bp.fraud_interval_limit = '';
|
||||
DEFAULT bp.fraud_interval_lock = '';
|
||||
DEFAULT bp.fraud_interval_notify = '';
|
||||
DEFAULT bp.fraud_daily_limit = '';
|
||||
DEFAULT bp.fraud_daily_lock = '';
|
||||
DEFAULT bp.fraud_daily_notify = '';
|
||||
DEFAULT bp.currency = '';
|
||||
DEFAULT bp.vat_rate = '';
|
||||
DEFAULT bp.vat_included = '';
|
||||
END;
|
||||
|
||||
invoice_details_zones = [];
|
||||
invoice_details_calls = [];
|
||||
|
||||
template_variables.description.import({
|
||||
callsdata => {
|
||||
'callsdata_self' => 'Information about calls.',
|
||||
'start_time' => 'Call start time, Call will be included in invoice period, in which call started.',
|
||||
}
|
||||
});
|
||||
IF !invoice_details_calls.size();
|
||||
i=1;
|
||||
WHILE i <= 44;
|
||||
invoice_details_calls.push([i,{
|
||||
start_time => date.format(date.now(),'%s'),
|
||||
source_customer_cost => i / 10,
|
||||
duration => i * 10,
|
||||
destination_user_in => '+1234567890',
|
||||
call_type => 'call',
|
||||
zone => 'Example Zone',
|
||||
zone_detail => 'Default',
|
||||
}]);
|
||||
i = i + 1;
|
||||
END;
|
||||
END;
|
||||
template_variables.description.import({
|
||||
zonesdata => {
|
||||
'zonesdata_self' => 'Information about zone fees.',
|
||||
'number' => 'Number of calls to the zone.',
|
||||
}
|
||||
});
|
||||
IF !invoice_details_zones.size();
|
||||
i=1;
|
||||
WHILE i <= 45;
|
||||
invoice_details_zones.push([i,{
|
||||
number => i * 2 ,
|
||||
cost => i / 10,
|
||||
duration => i * 10,
|
||||
free_time => i * 5,
|
||||
zone => 'Example Zone',
|
||||
zone_detail => 'Default',
|
||||
}]);
|
||||
i = i + 1;
|
||||
END;
|
||||
END;
|
||||
%]
|
||||
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
Loading…
Reference in new issue